@vindral/web-sdk 4.1.9-1-gd2bb86b5 → 4.1.9-2-ga281ba4b

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.
@@ -22,10 +22,10 @@ var vu = (s, e) => {
22
22
  e.indexOf(i) < 0 && Su.call(s, i) && (t[i] = s[i]);
23
23
  return t;
24
24
  };
25
- var Ci = (s) => {
25
+ var Ri = (s) => {
26
26
  var e;
27
27
  return [, , , om((e = s == null ? void 0 : s[lt("metadata")]) != null ? e : null)];
28
- }, Tu = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], er = (s) => s !== void 0 && typeof s != "function" ? Bt("Function expected") : s, dm = (s, e, t, i, n) => ({ kind: Tu[s], name: e, metadata: i, addInitializer: (o) => t._ ? Bt("Already initialized") : n.push(er(o || null)) }), Zt = (s, e) => Ya(e, lt("metadata"), s[3]), Ri = (s, e, t, i) => {
28
+ }, Tu = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], tr = (s) => s !== void 0 && typeof s != "function" ? Bt("Function expected") : s, dm = (s, e, t, i, n) => ({ kind: Tu[s], name: e, metadata: i, addInitializer: (o) => t._ ? Bt("Already initialized") : n.push(tr(o || null)) }), Zt = (s, e) => Ya(e, lt("metadata"), s[3]), Bi = (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
31
  }, ye = (s, e, t, i, n, o) => {
@@ -36,9 +36,9 @@ var Ci = (s) => {
36
36
  } }, t));
37
37
  g ? b && g < 4 && bu(o, (g > 2 ? "set " : g > 1 ? "get " : "") + t) : bu(n, t);
38
38
  for (var U = i.length - 1; U >= 0; U--)
39
- l = dm(g, t, u = {}, s[3], P), g && (l.static = w, l.private = b, p = l.access = { has: b ? (B) => lm(n, B) : (B) => t in B }, g ^ 3 && (p.get = b ? (B) => (g ^ 1 ? a : A)(B, n, g ^ 4 ? o : E.get) : (B) => B[t]), g > 2 && (p.set = b ? (B, X) => m(B, n, X, g ^ 4 ? o : E.set) : (B, X) => B[t] = X)), h = (0, i[U])(g ? g < 4 ? b ? o : E[k] : g > 4 ? void 0 : { get: E.get, set: E.set } : n, l), u._ = 1, g ^ 4 || h === void 0 ? er(h) && (g > 4 ? I.unshift(h) : g ? b ? o = h : E[k] = h : n = h) : typeof h != "object" || h === null ? Bt("Object expected") : (er(c = h.get) && (E.get = c), er(c = h.set) && (E.set = c), er(c = h.init) && I.unshift(c));
39
+ l = dm(g, t, u = {}, s[3], P), g && (l.static = w, l.private = b, p = l.access = { has: b ? (B) => lm(n, B) : (B) => t in B }, g ^ 3 && (p.get = b ? (B) => (g ^ 1 ? a : A)(B, n, g ^ 4 ? o : E.get) : (B) => B[t]), g > 2 && (p.set = b ? (B, Q) => m(B, n, Q, g ^ 4 ? o : E.set) : (B, Q) => B[t] = Q)), h = (0, i[U])(g ? g < 4 ? b ? o : E[k] : g > 4 ? void 0 : { get: E.get, set: E.set } : n, l), u._ = 1, g ^ 4 || h === void 0 ? tr(h) && (g > 4 ? I.unshift(h) : g ? b ? o = h : E[k] = h : n = h) : typeof h != "object" || h === null ? Bt("Object expected") : (tr(c = h.get) && (E.get = c), tr(c = h.set) && (E.set = c), tr(c = h.init) && I.unshift(c));
40
40
  return g || Zt(s, n), E && Hc(n, t, E), b ? g ^ 4 ? o : E : n;
41
- }, r = (s, e, t) => Ya(s, typeof e != "symbol" ? e + "" : e, t), Qc = (s, e, t) => e.has(s) || Bt("Cannot " + t), lm = (s, e) => Object(e) !== e ? Bt('Cannot use the "in" operator on this value') : s.has(e), a = (s, e, t) => (Qc(s, e, "read from private field"), t ? t.call(s) : e.get(s)), d = (s, e, t) => e.has(s) ? Bt("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(s) : e.set(s, t), m = (s, e, t, i) => (Qc(s, e, "write to private field"), i ? i.call(s, t) : e.set(s, t), t), A = (s, e, t) => (Qc(s, e, "access private method"), t);
41
+ }, r = (s, e, t) => Ya(s, typeof e != "symbol" ? e + "" : e, t), Xc = (s, e, t) => e.has(s) || Bt("Cannot " + t), lm = (s, e) => Object(e) !== e ? Bt('Cannot use the "in" operator on this value') : s.has(e), a = (s, e, t) => (Xc(s, e, "read from private field"), t ? t.call(s) : e.get(s)), d = (s, e, t) => e.has(s) ? Bt("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(s) : e.set(s, t), m = (s, e, t, i) => (Xc(s, e, "write to private field"), i ? i.call(s, t) : e.set(s, t), t), A = (s, e, t) => (Xc(s, e, "access private method"), t);
42
42
  var Ge = (s, e, t, i) => ({
43
43
  set _(n) {
44
44
  m(s, e, n, t);
@@ -74,7 +74,7 @@ var f = (s, e, t) => new Promise((i, n) => {
74
74
  }
75
75
  }, n = (c) => o[c] = (h) => new Promise((u, l) => i(c, h, u, l)), o = {};
76
76
  return t = t.apply(s, e), o[lt("asyncIterator")] = () => o, n("next"), n("throw"), n("return"), o;
77
- }, Xc = (s) => {
77
+ }, Qc = (s) => {
78
78
  var e = s[lt("asyncIterator")], t = !1, i, n = {};
79
79
  return e == null ? (e = s[lt("iterator")](), i = (o) => n[o] = (c) => e[o](c)) : (e = e.call(s), i = (o) => n[o] = (c) => {
80
80
  if (t) {
@@ -120,7 +120,7 @@ var je = (s, e, t) => {
120
120
  };
121
121
  return o();
122
122
  };
123
- import { E as Ei } from "./Bx7s5QdT.js";
123
+ import { E as ki } from "./Bx7s5QdT.js";
124
124
  import { a as qe, p as vd, i as Td, c as mm, b as fm, A as pm, d as gm, t as Am, e as wm } from "./CPEMXA01.js";
125
125
  class Eu {
126
126
  constructor(e) {
@@ -231,13 +231,13 @@ function su(s) {
231
231
  const e = new _c(s);
232
232
  return [e, e];
233
233
  }
234
- var xt, Xs, Ye, Lr;
234
+ var xt, Qs, Ye, Lr;
235
235
  class _c {
236
236
  constructor(e) {
237
237
  /// The internal queue
238
238
  d(this, xt);
239
239
  /// Slows down push when the queue is full
240
- d(this, Xs, new z());
240
+ d(this, Qs, new z());
241
241
  /// Slows down pop when the queue is empty
242
242
  d(this, Ye);
243
243
  /// The channel is closed
@@ -258,7 +258,7 @@ class _c {
258
258
  push(e) {
259
259
  return f(this, null, function* () {
260
260
  var t;
261
- a(this, xt).isFull() && (yield a(this, Xs).promise), a(this, xt).push(e), (t = a(this, Ye)) == null || t.resolve(), m(this, Ye, new z());
261
+ a(this, xt).isFull() && (yield a(this, Qs).promise), a(this, xt).push(e), (t = a(this, Ye)) == null || t.resolve(), m(this, Ye, new z());
262
262
  });
263
263
  }
264
264
  pop() {
@@ -267,7 +267,7 @@ class _c {
267
267
  for (; !(a(this, Lr) && a(this, xt).isEmpty()); ) {
268
268
  const t = a(this, xt).pop();
269
269
  if (t)
270
- return a(this, Xs).resolve(), m(this, Xs, new z()), t;
270
+ return a(this, Qs).resolve(), m(this, Qs, new z()), t;
271
271
  a(this, Ye) || m(this, Ye, new z()), yield (e = a(this, Ye)) == null ? void 0 : e.promise;
272
272
  }
273
273
  });
@@ -297,7 +297,7 @@ class _c {
297
297
  return this;
298
298
  }
299
299
  }
300
- xt = new WeakMap(), Xs = new WeakMap(), Ye = new WeakMap(), Lr = new WeakMap();
300
+ xt = new WeakMap(), Qs = new WeakMap(), Ye = new WeakMap(), Lr = new WeakMap();
301
301
  function x(s) {
302
302
  return typeof BigInt == "function" ? BigInt(s) : s;
303
303
  }
@@ -356,13 +356,13 @@ const nu = (s, e, t) => {
356
356
  i = i * 256 + s[n];
357
357
  return i;
358
358
  };
359
- var ne, Mt, ti;
359
+ var ne, Mt, ii;
360
360
  class Zn {
361
361
  constructor(e) {
362
362
  d(this, ne);
363
363
  d(this, Mt);
364
- d(this, ti);
365
- m(this, Mt, e), m(this, ti, new DataView(e.buffer, e.byteOffset, e.byteLength)), m(this, ne, 0);
364
+ d(this, ii);
365
+ m(this, Mt, e), m(this, ii, new DataView(e.buffer, e.byteOffset, e.byteLength)), m(this, ne, 0);
366
366
  }
367
367
  position() {
368
368
  return a(this, ne);
@@ -377,19 +377,19 @@ class Zn {
377
377
  return a(this, Mt).length - a(this, ne);
378
378
  }
379
379
  readUint8() {
380
- const e = a(this, ti).getUint8(a(this, ne));
380
+ const e = a(this, ii).getUint8(a(this, ne));
381
381
  return m(this, ne, a(this, ne) + 1), e;
382
382
  }
383
383
  readUint24() {
384
- const e = a(this, ti).getUint32(a(this, ne)) >> 8 & 16777215;
384
+ const e = a(this, ii).getUint32(a(this, ne)) >> 8 & 16777215;
385
385
  return m(this, ne, a(this, ne) + 3), e;
386
386
  }
387
387
  readUint16() {
388
- const e = a(this, ti).getUint16(a(this, ne));
388
+ const e = a(this, ii).getUint16(a(this, ne));
389
389
  return m(this, ne, a(this, ne) + 2), e;
390
390
  }
391
391
  readUint32() {
392
- const e = a(this, ti).getUint32(a(this, ne));
392
+ const e = a(this, ii).getUint32(a(this, ne));
393
393
  return m(this, ne, a(this, ne) + 4), e;
394
394
  }
395
395
  readUint64() {
@@ -411,7 +411,7 @@ class Zn {
411
411
  return new TextDecoder().decode(new Uint8Array(e));
412
412
  }
413
413
  }
414
- ne = new WeakMap(), Mt = new WeakMap(), ti = new WeakMap();
414
+ ne = new WeakMap(), Mt = new WeakMap(), ii = new WeakMap();
415
415
  class bm {
416
416
  constructor(e = 100, t = 100) {
417
417
  r(this, "resizeSteps");
@@ -554,7 +554,7 @@ class Rs {
554
554
  }
555
555
  }
556
556
  }
557
- const ct = (s) => s.reduce((e, t) => e + t, 0) / s.length, Qt = (s) => ({
557
+ const ct = (s) => s.reduce((e, t) => e + t, 0) / s.length, Xt = (s) => ({
558
558
  last: s[s.length - 1] || 0,
559
559
  average: s.length === 0 ? 0 : ct(s),
560
560
  max: s.length === 0 ? 0 : Math.max(...s),
@@ -590,26 +590,26 @@ class Pm {
590
590
  return this.rates.isEmpty() ? 0 : ct(this.rates.items());
591
591
  }
592
592
  get minMaxAverage() {
593
- return Qt(this.rates.items());
593
+ return Xt(this.rates.items());
594
594
  }
595
595
  }
596
- const Cs = (s, e) => {
596
+ const Yn = (s, e) => {
597
597
  if (s === e) return !0;
598
598
  if (s == null || typeof s != "object" || e == null || typeof e != "object") return !1;
599
599
  let t = 0, i = 0;
600
600
  for (const n in s) t += 1;
601
601
  for (const n in e)
602
- if (i += 1, !(n in s) || !Cs(s[n], e[n])) return !1;
602
+ if (i += 1, !(n in s) || !Yn(s[n], e[n])) return !1;
603
603
  return t == i;
604
604
  }, ku = ["off", "error", "warn", "info", "debug", "trace"], xm = {
605
605
  OFF: "off"
606
606
  };
607
- var Oi, Or, Fi, qs, Zs;
607
+ var Fi, Or, _i, qs, Zs;
608
608
  const $t = class $t {
609
609
  constructor({ context: e, logLevel: t, debug: i }) {
610
- d(this, Oi, /* @__PURE__ */ new Map());
610
+ d(this, Fi, /* @__PURE__ */ new Map());
611
611
  d(this, Or, "");
612
- d(this, Fi, !1);
612
+ d(this, _i, !1);
613
613
  d(this, qs, "off");
614
614
  r(this, "trace", (...e) => {
615
615
  });
@@ -625,11 +625,11 @@ const $t = class $t {
625
625
  });
626
626
  r(this, "count", (...e) => {
627
627
  });
628
- m(this, Or, e), m(this, qs, t), m(this, Fi, i || !1), this.setLevel(t), this.setDebug(a(this, Fi));
628
+ m(this, Or, e), m(this, qs, t), m(this, _i, i || !1), this.setLevel(t), this.setDebug(a(this, _i));
629
629
  }
630
630
  setDebug(e) {
631
- m(this, Fi, e);
632
- for (const [t, i] of a(this, Oi))
631
+ m(this, _i, e);
632
+ for (const [t, i] of a(this, Fi))
633
633
  i.setDebug(e);
634
634
  e ? (this.table = console.table.bind(console), this.count = console.count.bind(console)) : (this.table = () => {
635
635
  }, this.count = () => {
@@ -637,7 +637,7 @@ const $t = class $t {
637
637
  }
638
638
  setLevel(e) {
639
639
  m(this, qs, e);
640
- for (const [i, n] of a(this, Oi))
640
+ for (const [i, n] of a(this, Fi))
641
641
  n.setLevel(e);
642
642
  const t = ku.indexOf(e);
643
643
  for (const [i, n] of ku.entries())
@@ -652,10 +652,10 @@ const $t = class $t {
652
652
  });
653
653
  }
654
654
  createContext(e) {
655
- const t = a(this, Oi).get(e);
655
+ const t = a(this, Fi).get(e);
656
656
  if (!t) {
657
- const i = new $t({ context: `${e}`, logLevel: a(this, qs), debug: a(this, Fi) });
658
- return a(this, Oi).set(e, i), i;
657
+ const i = new $t({ context: `${e}`, logLevel: a(this, qs), debug: a(this, _i) });
658
+ return a(this, Fi).set(e, i), i;
659
659
  }
660
660
  return t;
661
661
  }
@@ -663,7 +663,7 @@ const $t = class $t {
663
663
  return a($t, Zs) || m($t, Zs, new $t({ context: "Vindral", logLevel: "off" })), a($t, Zs);
664
664
  }
665
665
  };
666
- Oi = new WeakMap(), Or = new WeakMap(), Fi = new WeakMap(), qs = new WeakMap(), Zs = new WeakMap(), d($t, Zs);
666
+ Fi = new WeakMap(), Or = new WeakMap(), _i = new WeakMap(), qs = new WeakMap(), Zs = new WeakMap(), d($t, Zs);
667
667
  let ge = $t;
668
668
  function Pe(s) {
669
669
  const e = ge.get().createContext(s.context);
@@ -713,31 +713,31 @@ class Mm {
713
713
  Fr = new WeakSet(), hh = function() {
714
714
  this.unlocker.resolve(this.value);
715
715
  };
716
- var _i, Ni;
716
+ var Ni, Vi;
717
717
  class Lm {
718
718
  constructor(e) {
719
- d(this, _i);
720
- d(this, Ni, new z());
721
- m(this, _i, e), a(this, Ni).resolve(e);
719
+ d(this, Ni);
720
+ d(this, Vi, new z());
721
+ m(this, Ni, e), a(this, Vi).resolve(e);
722
722
  }
723
723
  unsafeValue() {
724
- return a(this, _i);
724
+ return a(this, Ni);
725
725
  }
726
726
  isLocked() {
727
- return a(this, Ni).pending;
727
+ return a(this, Vi).pending;
728
728
  }
729
729
  lock() {
730
730
  return f(this, null, function* () {
731
731
  const e = new z();
732
732
  e.promise.then((i) => {
733
- m(this, _i, i);
733
+ m(this, Ni, i);
734
734
  }).catch(D);
735
- const t = a(this, Ni).promise.then(() => e);
736
- return m(this, Ni, e), yield t, new Mm(a(this, _i), e);
735
+ const t = a(this, Vi).promise.then(() => e);
736
+ return m(this, Vi, e), yield t, new Mm(a(this, Ni), e);
737
737
  });
738
738
  }
739
739
  }
740
- _i = new WeakMap(), Ni = new WeakMap();
740
+ Ni = new WeakMap(), Vi = new WeakMap();
741
741
  var ze, et;
742
742
  class ke {
743
743
  constructor(e) {
@@ -832,14 +832,14 @@ const Iu = (s, e) => {
832
832
  };
833
833
  r(Ho, "create", () => new Ho());
834
834
  let Ae = Ho;
835
- const Pi = (s, e = Date.now()) => {
835
+ const xi = (s, e = Date.now()) => {
836
836
  const t = s.length;
837
837
  if (t > 0) {
838
838
  const i = t - 1, n = s[i];
839
839
  n.end || (n.end = e);
840
840
  }
841
841
  }, Bs = (s, e = Date.now()) => {
842
- Pi(s), s.push({ start: e });
842
+ xi(s), s.push({ start: e });
843
843
  }, Us = (s) => s.reduce((e, t) => {
844
844
  var i;
845
845
  return e + (((i = t.end) != null ? i : Date.now()) - t.start);
@@ -858,13 +858,13 @@ function Ud(s) {
858
858
  const Ru = () => {
859
859
  const s = [...Array(256).keys()].map((t) => t.toString(16).padStart(2, "0")), e = crypto.getRandomValues(new Uint8Array(16));
860
860
  return e[6] = e[6] & 15 | 64, e[8] = e[8] & 63 | 128, [...e.entries()].map(([t, i]) => [4, 6, 8, 10].includes(t) ? `-${s[i]}` : s[i]).join("");
861
- }, ki = (s) => f(null, null, function* () {
861
+ }, Ii = (s) => f(null, null, function* () {
862
862
  return new Promise((e) => setTimeout(e, s));
863
863
  }), ru = (t, ...i) => f(null, [t, ...i], function* (s, e = new Error("Timeout")) {
864
864
  return new Promise((n, o) => setTimeout(() => o(e), s));
865
865
  }), Dm = (s, e) => f(null, null, function* () {
866
866
  throw yield s, new Error(e);
867
- }), ys = (s) => "width" in s && typeof s.width == "number", Ss = (s) => "sampleRate" in s && typeof s.sampleRate == "number", ei = (s) => {
867
+ }), Ss = (s) => "width" in s && typeof s.width == "number", vs = (s) => "sampleRate" in s && typeof s.sampleRate == "number", ti = (s) => {
868
868
  switch (s.codec) {
869
869
  case "opus":
870
870
  return 'audio/mp4; codecs="opus"';
@@ -879,10 +879,10 @@ const Ru = () => {
879
879
  case "av1":
880
880
  return s.codecString ? `video/mp4; codecs="${s.codecString}"` : "video/mp4";
881
881
  }
882
- }, Ti = () => Number.MAX_SAFE_INTEGER, fo = () => ({
882
+ }, Ei = () => Number.MAX_SAFE_INTEGER, fo = () => ({
883
883
  width: Number.MAX_SAFE_INTEGER,
884
884
  height: Number.MAX_SAFE_INTEGER
885
- }), Bu = (s) => !(typeof s != "object" || s === null || !("type" in s)), Om = "connection_failed", Fm = "connection_failed_will_not_attempt_again", _m = "authentication_error", Nm = "authentication_expired", Vm = "channel_not_found", Gm = "no_incoming_data_error", jm = "connection_inactivity", Wm = "missing_init_segment", zm = "no_track_context", Hm = "invalid_track_context_state", Qm = "disconnected_by_edge", Xm = "decoder_error", qm = "audio_player_error", Zm = "media_source_error", Jm = "webgl_context_lost_error", $m = "access_forbidden", Ym = "channel_switch_failed", Km = "drm_error";
885
+ }), Bu = (s) => !(typeof s != "object" || s === null || !("type" in s)), Om = "connection_failed", Fm = "connection_failed_will_not_attempt_again", _m = "authentication_error", Nm = "authentication_expired", Vm = "channel_not_found", Gm = "no_incoming_data_error", jm = "connection_inactivity", Wm = "missing_init_segment", zm = "no_track_context", Hm = "invalid_track_context_state", Xm = "disconnected_by_edge", Qm = "decoder_error", qm = "audio_player_error", Zm = "media_source_error", Jm = "webgl_context_lost_error", $m = "access_forbidden", Ym = "channel_switch_failed", Km = "drm_error";
886
886
  class M extends Error {
887
887
  constructor(t, i, n = {}) {
888
888
  super(t);
@@ -929,7 +929,7 @@ const ef = (s, e) => new M(
929
929
  "MediaElement Error",
930
930
  { isFatal: s, code: "media_element_error", source: e },
931
931
  { mediaErrorCode: e.code }
932
- ), tf = (s, e) => new M("Decoder Error", { isFatal: s, code: Xm, source: e, type: "internal" }), Pd = (s, e) => new M("Audio Player Error", { isFatal: s, code: qm, source: e, type: "internal" }), sf = (s, e) => new M(`No init segment for rendition id ${s} for channel ${e}`, {
932
+ ), tf = (s, e) => new M("Decoder Error", { isFatal: s, code: Qm, source: e, type: "internal" }), Pd = (s, e) => new M("Audio Player Error", { isFatal: s, code: qm, source: e, type: "internal" }), sf = (s, e) => new M(`No init segment for rendition id ${s} for channel ${e}`, {
933
933
  isFatal: !1,
934
934
  code: Wm,
935
935
  type: "internal"
@@ -948,11 +948,11 @@ const ef = (s, e) => new M(
948
948
  code: Hm,
949
949
  type: "internal"
950
950
  }
951
- ), rf = () => new M("Web Audio Context resume timeout", { isFatal: !1, code: "web_audio_context_resume_timeout" }), tr = (s) => new M("Disconnected From Edge Server", {
951
+ ), rf = () => new M("Web Audio Context resume timeout", { isFatal: !1, code: "web_audio_context_resume_timeout" }), ir = (s) => new M("Disconnected From Edge Server", {
952
952
  type: "external",
953
953
  source: s,
954
954
  isFatal: !1,
955
- code: Qm
955
+ code: Xm
956
956
  }), po = (s) => new M("Authentication Failed", { isFatal: !0, code: _m, source: s }), af = (s) => new M("Authentication Expired", { isFatal: !0, code: Nm, source: s }), of = (s, e) => new M("Connection closed due to inactivity", { isFatal: !1, code: jm, source: e, type: s }), xd = (s, e) => new M("Channel not found", { isFatal: !1, code: Vm, source: e, type: s }), cf = (s) => new M("No Incoming Data", { isFatal: !1, code: Gm, source: s }), hf = (s) => new M("Connection attempt failed", {
957
957
  isFatal: !1,
958
958
  code: Om,
@@ -973,8 +973,8 @@ const ef = (s, e) => new M(
973
973
  maxBufferTime: 1500,
974
974
  logLevel: xm.OFF,
975
975
  maxSize: fo(),
976
- maxVideoBitRate: Ti(),
977
- maxAudioBitRate: Ti(),
976
+ maxVideoBitRate: Ei(),
977
+ maxAudioBitRate: Ei(),
978
978
  maxInitialBitRate: 2.5 * 1e3 * 1e3,
979
979
  // 2.5 Mbps
980
980
  tags: [],
@@ -996,7 +996,7 @@ const ef = (s, e) => new M(
996
996
  videoCodecs: ["av1", "h264"],
997
997
  webtransportEnabled: !0
998
998
  };
999
- var Vi, Gi;
999
+ var Gi, ji;
1000
1000
  class Vc {
1001
1001
  constructor(e, t, i, n) {
1002
1002
  r(this, "keySystem");
@@ -1004,20 +1004,20 @@ class Vc {
1004
1004
  r(this, "certificate");
1005
1005
  r(this, "headers", {});
1006
1006
  r(this, "queryParams", {});
1007
- d(this, Vi);
1008
1007
  d(this, Gi);
1009
- m(this, Vi, t), this.keySystem = e, this.licenseServerUrl = i, this.certificate = n;
1008
+ d(this, ji);
1009
+ m(this, Gi, t), this.keySystem = e, this.licenseServerUrl = i, this.certificate = n;
1010
1010
  }
1011
1011
  get statistics() {
1012
1012
  return {
1013
- keySystem: a(this, Vi).keySystem,
1013
+ keySystem: a(this, Gi).keySystem,
1014
1014
  licenseServerUrl: this.licenseServerUrl,
1015
- mediaKeySystemConfiguration: a(this, Vi).getConfiguration()
1015
+ mediaKeySystemConfiguration: a(this, Gi).getConfiguration()
1016
1016
  };
1017
1017
  }
1018
1018
  getMediaKeys() {
1019
1019
  return f(this, null, function* () {
1020
- return a(this, Gi) ? a(this, Gi) : (m(this, Gi, yield a(this, Vi).createMediaKeys()), a(this, Gi));
1020
+ return a(this, ji) ? a(this, ji) : (m(this, ji, yield a(this, Gi).createMediaKeys()), a(this, ji));
1021
1021
  });
1022
1022
  }
1023
1023
  requestLicense(e) {
@@ -1038,7 +1038,7 @@ class Vc {
1038
1038
  });
1039
1039
  }
1040
1040
  }
1041
- Vi = new WeakMap(), Gi = new WeakMap();
1041
+ Gi = new WeakMap(), ji = new WeakMap();
1042
1042
  function Dd(s) {
1043
1043
  const e = window.atob(s.replace(/-/g, "+").replace(/_/g, "/"));
1044
1044
  let t = "";
@@ -1233,19 +1233,19 @@ class Sf extends Vc {
1233
1233
  }
1234
1234
  }
1235
1235
  const vf = 5e3;
1236
- var V, ji, Lt, tt, pt, de, ii, si, Qo, Js, Nr, Vr, ae, Fd, _d, Nd, Vd, Xo, qo, Gd, nr, Zo, jd, Wd;
1236
+ var V, Wi, Lt, tt, pt, de, si, ni, Xo, Js, Nr, Vr, ae, Fd, _d, Nd, Vd, Qo, qo, Gd, rr, Zo, jd, Wd;
1237
1237
  class Du {
1238
1238
  constructor(e, t, i = {}) {
1239
1239
  d(this, ae);
1240
1240
  d(this, V);
1241
- d(this, ji);
1241
+ d(this, Wi);
1242
1242
  d(this, Lt);
1243
1243
  d(this, tt, new z());
1244
1244
  d(this, pt);
1245
1245
  d(this, de);
1246
- d(this, ii, /* @__PURE__ */ new Map());
1247
- d(this, si);
1248
- d(this, Qo, Rd());
1246
+ d(this, si, /* @__PURE__ */ new Map());
1247
+ d(this, ni);
1248
+ d(this, Xo, Rd());
1249
1249
  /**
1250
1250
  * Timeout to wait for new drm data when channel switch happens
1251
1251
  */
@@ -1260,11 +1260,11 @@ class Du {
1260
1260
  d(this, Vr, (e) => {
1261
1261
  a(this, V).info("Encrypted event received", { event: e }), A(this, ae, Fd).call(this, e);
1262
1262
  });
1263
- d(this, Xo, (e) => {
1263
+ d(this, Qo, (e) => {
1264
1264
  var o, c;
1265
1265
  a(this, V).debug("Session message received", { event: e });
1266
1266
  const t = e.target, i = e.message;
1267
- if (!a(this, ii).get(t)) {
1267
+ if (!a(this, si).get(t)) {
1268
1268
  a(this, V).error("No active session found for event", { event: e });
1269
1269
  return;
1270
1270
  }
@@ -1273,10 +1273,10 @@ class Du {
1273
1273
  licenseServerUrl: (o = a(this, de)) == null ? void 0 : o.licenseServerUrl
1274
1274
  }), (c = a(this, de)) == null || c.requestLicense(i).then((h) => {
1275
1275
  a(this, V).debug("License received for session", { sessionId: t.sessionId }), t.update(h).catch((u) => {
1276
- A(this, ae, nr).call(this, { message: "Failed to update session with license", isFatal: !1, error: u });
1276
+ A(this, ae, rr).call(this, { message: "Failed to update session with license", isFatal: !1, error: u });
1277
1277
  });
1278
1278
  }).catch((h) => {
1279
- A(this, ae, nr).call(this, { message: "Failed to request license", isFatal: !1, error: h });
1279
+ A(this, ae, rr).call(this, { message: "Failed to request license", isFatal: !1, error: h });
1280
1280
  });
1281
1281
  });
1282
1282
  d(this, qo, (e) => {
@@ -1303,7 +1303,7 @@ class Du {
1303
1303
  let c = null;
1304
1304
  return n === "clearkey" ? (qe(e.clearkeys, "No clearkeys found"), c = new ff(o, e.clearkeys)) : n === "playready" ? (qe(e.playreadyLicenseUrl, "No playreadyLicenseUrl found"), c = new yf(o, e.playreadyLicenseUrl)) : n === "widevine" ? (qe(e.widevineLicenseUrl, "No widevineLicenseUrl found"), c = new Sf(o, e.widevineLicenseUrl)) : n === "fairplay" && (qe(e.fairplayLicenseUrl, "No fairplayLicenseUrl found"), qe(e.fairplayCertificate, "No fairplayCertificate found"), c = new wf(o, e.fairplayLicenseUrl, e.fairplayCertificate)), c && (c.headers = a(this, pt).headers || {}, c.queryParams = a(this, pt).queryParams || {}), c;
1305
1305
  }));
1306
- m(this, ji, e), m(this, V, t), m(this, pt, i), a(this, ji).on("received drm data", a(this, Nr));
1306
+ m(this, Wi, e), m(this, V, t), m(this, pt, i), a(this, Wi).on("received drm data", a(this, Nr));
1307
1307
  }
1308
1308
  static isSupported() {
1309
1309
  return !!navigator.requestMediaKeySystemAccess;
@@ -1317,9 +1317,9 @@ class Du {
1317
1317
  }
1318
1318
  unload() {
1319
1319
  var e;
1320
- a(this, V).info("Unloading EncryptedMediaExtensions"), a(this, ji).off("received drm data", a(this, Nr)), (e = a(this, Lt)) == null || e.removeEventListener("encrypted", a(this, Vr)), a(this, ii).forEach((t, i) => {
1320
+ a(this, V).info("Unloading EncryptedMediaExtensions"), a(this, Wi).off("received drm data", a(this, Nr)), (e = a(this, Lt)) == null || e.removeEventListener("encrypted", a(this, Vr)), a(this, si).forEach((t, i) => {
1321
1321
  i.close();
1322
- }), a(this, ii).clear(), m(this, si, void 0), m(this, de, void 0);
1322
+ }), a(this, si).clear(), m(this, ni, void 0), m(this, de, void 0);
1323
1323
  }
1324
1324
  set headers(e) {
1325
1325
  a(this, pt).headers = e, a(this, de) && (a(this, de).headers = e);
@@ -1332,7 +1332,7 @@ class Du {
1332
1332
  a(this, V).debug("DRM is not used, skipping channel switch handling");
1333
1333
  return;
1334
1334
  }
1335
- Cm() && a(this, Qo).platform.safariVersion < 18 && A(this, ae, nr).call(this, {
1335
+ Cm() && a(this, Xo).platform.safariVersion < 18 && A(this, ae, rr).call(this, {
1336
1336
  message: "DRM channel switch not supported on Safari < 18",
1337
1337
  isFatal: !0
1338
1338
  }), window.clearTimeout(a(this, Js));
@@ -1342,12 +1342,12 @@ class Du {
1342
1342
  }, vf));
1343
1343
  }
1344
1344
  }
1345
- V = new WeakMap(), ji = new WeakMap(), Lt = new WeakMap(), tt = new WeakMap(), pt = new WeakMap(), de = new WeakMap(), ii = new WeakMap(), si = new WeakMap(), Qo = new WeakMap(), Js = new WeakMap(), Nr = new WeakMap(), Vr = new WeakMap(), ae = new WeakSet(), Fd = function(e) {
1345
+ V = new WeakMap(), Wi = new WeakMap(), Lt = new WeakMap(), tt = new WeakMap(), pt = new WeakMap(), de = new WeakMap(), si = new WeakMap(), ni = new WeakMap(), Xo = new WeakMap(), Js = new WeakMap(), Nr = new WeakMap(), Vr = new WeakMap(), ae = new WeakSet(), Fd = function(e) {
1346
1346
  return f(this, null, function* () {
1347
1347
  try {
1348
1348
  yield A(this, ae, _d).call(this), a(this, V).debug("Media keys initialization completed"), yield A(this, ae, Nd).call(this, e.initData, e.initDataType);
1349
1349
  } catch (t) {
1350
- A(this, ae, nr).call(this, { message: "Failed to handle encrypted event", isFatal: !0, error: t });
1350
+ A(this, ae, rr).call(this, { message: "Failed to handle encrypted event", isFatal: !0, error: t });
1351
1351
  }
1352
1352
  });
1353
1353
  }, _d = function() {
@@ -1359,16 +1359,16 @@ V = new WeakMap(), ji = new WeakMap(), Lt = new WeakMap(), tt = new WeakMap(), p
1359
1359
  a(this, V).debug("Media keys already set on media element");
1360
1360
  return;
1361
1361
  }
1362
- if (a(this, si)) {
1363
- a(this, V).debug("Media keys initialization already in progress, waiting for completion"), yield a(this, si);
1362
+ if (a(this, ni)) {
1363
+ a(this, V).debug("Media keys initialization already in progress, waiting for completion"), yield a(this, ni);
1364
1364
  return;
1365
1365
  }
1366
- m(this, si, f(this, null, function* () {
1366
+ m(this, ni, f(this, null, function* () {
1367
1367
  const i = yield a(this, Zo).call(this, e);
1368
1368
  a(this, V).debug("CDM obtained", { cdm: i }), qe(a(this, Lt), "No media element found"), qe(i, "No CDM found");
1369
1369
  const n = yield i.getMediaKeys();
1370
1370
  i.certificate && (yield A(this, ae, Gd).call(this, n, i.certificate)), a(this, V).debug("Setting media keys on media element"), yield a(this, Lt).setMediaKeys(n), m(this, de, i);
1371
- })), yield a(this, si);
1371
+ })), yield a(this, ni);
1372
1372
  });
1373
1373
  }, Nd = function(e, t) {
1374
1374
  return f(this, null, function* () {
@@ -1381,13 +1381,13 @@ V = new WeakMap(), ji = new WeakMap(), Lt = new WeakMap(), tt = new WeakMap(), p
1381
1381
  const n = i.createSession();
1382
1382
  a(this, V).debug("Creating new session", { session: n }), n.addEventListener("keystatuseschange", a(this, qo)), n.closed.then((o) => {
1383
1383
  a(this, V).info("Session is closed", { reason: o });
1384
- }), n.addEventListener("message", a(this, Xo)), a(this, ii).set(n, e), a(this, V).debug("Generating request for session", { session: n, initDataType: t, initData: e }), yield n.generateRequest(t, e);
1384
+ }), n.addEventListener("message", a(this, Qo)), a(this, si).set(n, e), a(this, V).debug("Generating request for session", { session: n, initDataType: t, initData: e }), yield n.generateRequest(t, e);
1385
1385
  });
1386
1386
  }, Vd = function(e) {
1387
- for (const [t, i] of a(this, ii))
1387
+ for (const [t, i] of a(this, si))
1388
1388
  if (mf(e, i)) return !1;
1389
1389
  return !0;
1390
- }, Xo = new WeakMap(), qo = new WeakMap(), Gd = function(e, t) {
1390
+ }, Qo = new WeakMap(), qo = new WeakMap(), Gd = function(e, t) {
1391
1391
  return f(this, null, function* () {
1392
1392
  try {
1393
1393
  a(this, V).debug("Setting server certificate", { certificate: t }), (yield e.setServerCertificate(t)) || a(this, V).warn("Server certificates are not supported by the CDM.");
@@ -1395,9 +1395,9 @@ V = new WeakMap(), ji = new WeakMap(), Lt = new WeakMap(), tt = new WeakMap(), p
1395
1395
  a(this, V).error("Failed to set server certificate", { error: i });
1396
1396
  }
1397
1397
  });
1398
- }, nr = function(e) {
1398
+ }, rr = function(e) {
1399
1399
  const { message: t, isFatal: i, error: n } = e;
1400
- a(this, V).error(t, { error: n }), a(this, ji).emit("error", Ld(t, i, n));
1400
+ a(this, V).error(t, { error: n }), a(this, Wi).emit("error", Ld(t, i, n));
1401
1401
  }, Zo = new WeakMap(), /**
1402
1402
  * Get the prioritized key system list based on the DRM data provided.
1403
1403
  * The order of the key systems in the list is the order in which they will be tried.
@@ -1487,9 +1487,9 @@ const Tf = 7, Ef = 8, kf = (s) => {
1487
1487
  for (let I = 0; I < (c != 3 ? 8 : 12); I++)
1488
1488
  if (o.readBit()) {
1489
1489
  const E = I < 6 ? 16 : 64;
1490
- let U = 0, B = 8, X = 8;
1491
- for (let Q = 0; Q < E; Q++)
1492
- X != 0 && (U = o.readSignedExpGolomb(), X = (B + U + 256) % 256), B = X == 0 ? B : X;
1490
+ let U = 0, B = 8, Q = 8;
1491
+ for (let X = 0; X < E; X++)
1492
+ Q != 0 && (U = o.readSignedExpGolomb(), Q = (B + U + 256) % 256), B = Q == 0 ? B : Q;
1493
1493
  }
1494
1494
  }
1495
1495
  break;
@@ -1506,8 +1506,8 @@ const Tf = 7, Ef = 8, kf = (s) => {
1506
1506
  p === 0 && o.readBit(), o.readBit();
1507
1507
  let g = u + 1, w = l + 1;
1508
1508
  if (w *= 2 - p, w *= 16, g *= 16, o.readBit()) {
1509
- const k = c == 1 ? 1 : 0, P = 1 << (c == 1 || c == 2 ? 1 : 0), E = 2 - p << k, U = o.readUnsignedExpGolomb() * P, B = o.readUnsignedExpGolomb() * P, X = o.readUnsignedExpGolomb() * E, Q = o.readUnsignedExpGolomb() * E;
1510
- g -= U + B, w -= X + Q;
1509
+ const k = c == 1 ? 1 : 0, P = 1 << (c == 1 || c == 2 ? 1 : 0), E = 2 - p << k, U = o.readUnsignedExpGolomb() * P, B = o.readUnsignedExpGolomb() * P, Q = o.readUnsignedExpGolomb() * E, X = o.readUnsignedExpGolomb() * E;
1510
+ g -= U + B, w -= Q + X;
1511
1511
  }
1512
1512
  let b = {
1513
1513
  numerator: 1,
@@ -1653,22 +1653,22 @@ const Fs = class Fs {
1653
1653
  };
1654
1654
  r(Fs, "type", "emsg");
1655
1655
  let go = Fs;
1656
- const dr = class dr {
1656
+ const lr = class lr {
1657
1657
  constructor(e) {
1658
- r(this, "type", dr.type);
1658
+ r(this, "type", lr.type);
1659
1659
  r(this, "data");
1660
1660
  this.data = e;
1661
1661
  }
1662
1662
  static decodeData(e) {
1663
1663
  const t = e.readRemaining();
1664
- return new dr(t);
1664
+ return new lr(t);
1665
1665
  }
1666
1666
  };
1667
- r(dr, "type", "mdat");
1668
- let Ao = dr;
1669
- const lr = class lr {
1667
+ r(lr, "type", "mdat");
1668
+ let Ao = lr;
1669
+ const mr = class mr {
1670
1670
  constructor(e, t, i) {
1671
- r(this, "type", lr.type);
1671
+ r(this, "type", mr.type);
1672
1672
  r(this, "extra");
1673
1673
  /**
1674
1674
  * The byte offset of the baseMediaDecodeTime field
@@ -1680,14 +1680,14 @@ const lr = class lr {
1680
1680
  static decodeData(e) {
1681
1681
  const t = qt(e), i = e.byteOffset();
1682
1682
  let n = 0;
1683
- return t.version === 1 ? n = e.readUint64() : n = e.readUint32(), new lr(t, i, n);
1683
+ return t.version === 1 ? n = e.readUint64() : n = e.readUint32(), new mr(t, i, n);
1684
1684
  }
1685
1685
  };
1686
- r(lr, "type", "tfdt");
1687
- let wo = lr;
1688
- const _f = 1, Nf = 2, Vf = 8, Gf = 16, jf = 32, mr = class mr {
1686
+ r(mr, "type", "tfdt");
1687
+ let wo = mr;
1688
+ const _f = 1, Nf = 2, Vf = 8, Gf = 16, jf = 32, fr = class fr {
1689
1689
  constructor(e, t, i, n) {
1690
- r(this, "type", mr.type);
1690
+ r(this, "type", fr.type);
1691
1691
  r(this, "extra");
1692
1692
  r(this, "defaultSampleDuration");
1693
1693
  r(this, "defaultSampleSize");
@@ -1697,11 +1697,11 @@ const _f = 1, Nf = 2, Vf = 8, Gf = 16, jf = 32, mr = class mr {
1697
1697
  static decodeData(e) {
1698
1698
  const t = qt(e);
1699
1699
  let i, n, o;
1700
- return e.readUint32(), (t.flags & _f) > 0 && e.readUint64(), (t.flags & Nf) > 0 && e.readUint32(), (t.flags & Vf) > 0 && (i = e.readUint32()), (t.flags & Gf) > 0 && (n = e.readUint32()), (t.flags & jf) > 0 && (o = e.readUint32()), new mr(t, i, n, o);
1700
+ return e.readUint32(), (t.flags & _f) > 0 && e.readUint64(), (t.flags & Nf) > 0 && e.readUint32(), (t.flags & Vf) > 0 && (i = e.readUint32()), (t.flags & Gf) > 0 && (n = e.readUint32()), (t.flags & jf) > 0 && (o = e.readUint32()), new fr(t, i, n, o);
1701
1701
  }
1702
1702
  };
1703
- r(mr, "type", "tfhd");
1704
- let bo = mr;
1703
+ r(fr, "type", "tfhd");
1704
+ let bo = fr;
1705
1705
  const Y = class Y {
1706
1706
  constructor(e, t, i) {
1707
1707
  r(this, "type", Y.type);
@@ -1733,9 +1733,9 @@ const Y = class Y {
1733
1733
  };
1734
1734
  r(Y, "TRUN_DATA_OFFSET", 1), r(Y, "TRUN_FIRST_SAMPLE_FLAGS", 4), r(Y, "SAMPLE_DURATION", 256), r(Y, "SAMPLE_SIZE", 512), r(Y, "SAMPLE_FLAGS", 1024), r(Y, "SAMPLE_CTS", 2048), r(Y, "FLAG_SAMPLE_FLAG_IS_NON_SYNC", 65536), r(Y, "FLAG_SAMPLE_DEPENDS_NO", 33554432), r(Y, "FLAG_SAMPLE_DEPENDS_YES", 16777216), r(Y, "type", "trun");
1735
1735
  let Pr = Y;
1736
- const fr = class fr {
1736
+ const pr = class pr {
1737
1737
  constructor(e, t, i) {
1738
- r(this, "type", fr.type);
1738
+ r(this, "type", pr.type);
1739
1739
  r(this, "tfhd");
1740
1740
  r(this, "tfdt");
1741
1741
  r(this, "trun");
@@ -1747,14 +1747,14 @@ const fr = class fr {
1747
1747
  const o = ht(e);
1748
1748
  o instanceof bo && (t = o), o instanceof wo && (i = o), o instanceof Pr && (n = o);
1749
1749
  }
1750
- return new fr(t, i, n);
1750
+ return new pr(t, i, n);
1751
1751
  }
1752
1752
  };
1753
- r(fr, "type", "traf");
1754
- let yo = fr;
1755
- const pr = class pr {
1753
+ r(pr, "type", "traf");
1754
+ let yo = pr;
1755
+ const gr = class gr {
1756
1756
  constructor(e) {
1757
- r(this, "type", pr.type);
1757
+ r(this, "type", gr.type);
1758
1758
  r(this, "traf");
1759
1759
  this.traf = e;
1760
1760
  }
@@ -1766,24 +1766,24 @@ const pr = class pr {
1766
1766
  }
1767
1767
  if (!t)
1768
1768
  throw new Error("No traf found");
1769
- return new pr(t);
1769
+ return new gr(t);
1770
1770
  }
1771
1771
  };
1772
- r(pr, "type", "moof");
1773
- let So = pr;
1774
- const gr = class gr {
1772
+ r(gr, "type", "moof");
1773
+ let So = gr;
1774
+ const Ar = class Ar {
1775
1775
  constructor() {
1776
- r(this, "type", gr.type);
1776
+ r(this, "type", Ar.type);
1777
1777
  }
1778
1778
  static decodeData(e) {
1779
- return new gr();
1779
+ return new Ar();
1780
1780
  }
1781
1781
  };
1782
- r(gr, "type", "mvhd");
1783
- let vo = gr;
1784
- const Ar = class Ar {
1782
+ r(Ar, "type", "mvhd");
1783
+ let vo = Ar;
1784
+ const wr = class wr {
1785
1785
  constructor(e) {
1786
- r(this, "type", Ar.type);
1786
+ r(this, "type", wr.type);
1787
1787
  r(this, "fourCC");
1788
1788
  this.fourCC = e;
1789
1789
  }
@@ -1802,11 +1802,11 @@ const Ar = class Ar {
1802
1802
  static decodeData(e) {
1803
1803
  qt(e), e.readUint32();
1804
1804
  const t = String.fromCharCode(...e.readBytes(4));
1805
- return new Ar(t);
1805
+ return new wr(t);
1806
1806
  }
1807
1807
  };
1808
- r(Ar, "type", "hdlr");
1809
- let To = Ar;
1808
+ r(wr, "type", "hdlr");
1809
+ let To = wr;
1810
1810
  const _s = class _s {
1811
1811
  constructor(e, t, i, n) {
1812
1812
  r(this, "type", _s.type);
@@ -1828,9 +1828,9 @@ const _s = class _s {
1828
1828
  };
1829
1829
  r(_s, "type", "mdhd");
1830
1830
  let Eo = _s;
1831
- const wr = class wr {
1831
+ const br = class br {
1832
1832
  constructor(e, t, i, n) {
1833
- r(this, "type", wr.type);
1833
+ r(this, "type", br.type);
1834
1834
  r(this, "av01");
1835
1835
  r(this, "avc1");
1836
1836
  r(this, "opus");
@@ -1870,14 +1870,14 @@ const wr = class wr {
1870
1870
  break;
1871
1871
  }
1872
1872
  }
1873
- return new wr(n, c, o, i);
1873
+ return new br(n, c, o, i);
1874
1874
  }
1875
1875
  };
1876
- r(wr, "type", "stsd");
1877
- let ko = wr;
1878
- const br = class br {
1876
+ r(br, "type", "stsd");
1877
+ let ko = br;
1878
+ const yr = class yr {
1879
1879
  constructor(e) {
1880
- r(this, "type", br.type);
1880
+ r(this, "type", yr.type);
1881
1881
  r(this, "stsd");
1882
1882
  this.stsd = e;
1883
1883
  }
@@ -1889,14 +1889,14 @@ const br = class br {
1889
1889
  }
1890
1890
  if (!t)
1891
1891
  throw new Error("No stsd found");
1892
- return new br(t);
1892
+ return new yr(t);
1893
1893
  }
1894
1894
  };
1895
- r(br, "type", "stbl");
1896
- let Io = br;
1897
- const yr = class yr {
1895
+ r(yr, "type", "stbl");
1896
+ let Io = yr;
1897
+ const Sr = class Sr {
1898
1898
  constructor(e) {
1899
- r(this, "type", yr.type);
1899
+ r(this, "type", Sr.type);
1900
1900
  r(this, "stbl");
1901
1901
  this.stbl = e;
1902
1902
  }
@@ -1908,14 +1908,14 @@ const yr = class yr {
1908
1908
  }
1909
1909
  if (!t)
1910
1910
  throw new Error("No stbl found");
1911
- return new yr(t);
1911
+ return new Sr(t);
1912
1912
  }
1913
1913
  };
1914
- r(yr, "type", "minf");
1915
- let Co = yr;
1916
- const Sr = class Sr {
1914
+ r(Sr, "type", "minf");
1915
+ let Co = Sr;
1916
+ const vr = class vr {
1917
1917
  constructor(e, t, i) {
1918
- r(this, "type", Sr.type);
1918
+ r(this, "type", vr.type);
1919
1919
  r(this, "hdlr");
1920
1920
  r(this, "minf");
1921
1921
  r(this, "mdhd");
@@ -1933,14 +1933,14 @@ const Sr = class Sr {
1933
1933
  throw new Error("No minf found");
1934
1934
  if (!n)
1935
1935
  throw new Error("No mdhd found");
1936
- return new Sr(t, i, n);
1936
+ return new vr(t, i, n);
1937
1937
  }
1938
1938
  };
1939
- r(Sr, "type", "mdia");
1940
- let Ro = Sr;
1941
- const vr = class vr {
1939
+ r(vr, "type", "mdia");
1940
+ let Ro = vr;
1941
+ const Tr = class Tr {
1942
1942
  constructor(e, t, i, n, o, c, h, u) {
1943
- r(this, "type", vr.type);
1943
+ r(this, "type", Tr.type);
1944
1944
  r(this, "modificationTime");
1945
1945
  r(this, "creationTime");
1946
1946
  r(this, "trackId");
@@ -1964,14 +1964,14 @@ const vr = class vr {
1964
1964
  const l = e.readUint16();
1965
1965
  e.readUint16();
1966
1966
  const p = e.readUint16();
1967
- return e.readUint16(), new vr(i, n, o, c, h, u, l, p);
1967
+ return e.readUint16(), new Tr(i, n, o, c, h, u, l, p);
1968
1968
  }
1969
1969
  };
1970
- r(vr, "type", "tkhd");
1971
- let Bo = vr;
1972
- const Tr = class Tr {
1970
+ r(Tr, "type", "tkhd");
1971
+ let Bo = Tr;
1972
+ const Er = class Er {
1973
1973
  constructor(e, t) {
1974
- r(this, "type", Tr.type);
1974
+ r(this, "type", Er.type);
1975
1975
  r(this, "tkhd");
1976
1976
  r(this, "mdia");
1977
1977
  this.tkhd = e, this.mdia = t;
@@ -1986,14 +1986,14 @@ const Tr = class Tr {
1986
1986
  throw new Error("No tkhd found");
1987
1987
  if (!i)
1988
1988
  throw new Error("No mdia found");
1989
- return new Tr(t, i);
1989
+ return new Er(t, i);
1990
1990
  }
1991
1991
  };
1992
- r(Tr, "type", "trak");
1993
- let Uo = Tr;
1994
- const Er = class Er {
1992
+ r(Er, "type", "trak");
1993
+ let Uo = Er;
1994
+ const kr = class kr {
1995
1995
  constructor(e, t) {
1996
- r(this, "type", Er.type);
1996
+ r(this, "type", kr.type);
1997
1997
  r(this, "mvhd");
1998
1998
  r(this, "traks");
1999
1999
  this.mvhd = e, this.traks = t;
@@ -2007,14 +2007,14 @@ const Er = class Er {
2007
2007
  }
2008
2008
  if (!t)
2009
2009
  throw new Error("No mvhd found");
2010
- return new Er(t, i);
2010
+ return new kr(t, i);
2011
2011
  }
2012
2012
  };
2013
- r(Er, "type", "moov");
2014
- let Po = Er;
2015
- const kr = class kr {
2013
+ r(kr, "type", "moov");
2014
+ let Po = kr;
2015
+ const Ir = class Ir {
2016
2016
  constructor(e, t, i, n, o, c, h, u) {
2017
- r(this, "type", kr.type);
2017
+ r(this, "type", Ir.type);
2018
2018
  r(this, "configurationVersion");
2019
2019
  r(this, "avcProfileIndication");
2020
2020
  r(this, "profileCompatibility");
@@ -2036,7 +2036,7 @@ const kr = class kr {
2036
2036
  const b = e.readBytes(e.readUint16());
2037
2037
  g.push(b);
2038
2038
  }
2039
- return new kr(
2039
+ return new Ir(
2040
2040
  i,
2041
2041
  n,
2042
2042
  o,
@@ -2048,11 +2048,11 @@ const kr = class kr {
2048
2048
  );
2049
2049
  }
2050
2050
  };
2051
- r(kr, "type", "avcC");
2052
- let uh = kr;
2053
- const Ir = class Ir {
2051
+ r(Ir, "type", "avcC");
2052
+ let uh = Ir;
2053
+ const Cr = class Cr {
2054
2054
  constructor(e, t, i, n, o) {
2055
- r(this, "type", Ir.type);
2055
+ r(this, "type", Cr.type);
2056
2056
  r(this, "avcC");
2057
2057
  r(this, "width");
2058
2058
  r(this, "height");
@@ -2071,24 +2071,24 @@ const Ir = class Ir {
2071
2071
  }
2072
2072
  if (!c)
2073
2073
  throw new Error("no avcC");
2074
- return new Ir(c, t, i, n, o);
2074
+ return new Cr(c, t, i, n, o);
2075
2075
  }
2076
2076
  };
2077
- r(Ir, "type", "avc1");
2078
- let dh = Ir;
2079
- const Cr = class Cr {
2077
+ r(Cr, "type", "avc1");
2078
+ let dh = Cr;
2079
+ const Rr = class Rr {
2080
2080
  constructor() {
2081
- r(this, "type", Cr.type);
2081
+ r(this, "type", Rr.type);
2082
2082
  }
2083
2083
  static decodeData(e) {
2084
- return new Cr();
2084
+ return new Rr();
2085
2085
  }
2086
2086
  };
2087
- r(Cr, "type", "dOps");
2088
- let lh = Cr;
2089
- const Rr = class Rr {
2087
+ r(Rr, "type", "dOps");
2088
+ let lh = Rr;
2089
+ const Br = class Br {
2090
2090
  constructor(e, t, i) {
2091
- r(this, "type", Rr.type);
2091
+ r(this, "type", Br.type);
2092
2092
  r(this, "dops");
2093
2093
  r(this, "channelCount");
2094
2094
  r(this, "sampleRate");
@@ -2103,11 +2103,11 @@ const Rr = class Rr {
2103
2103
  const n = e.readUint16();
2104
2104
  e.readUint16(), t === 1 && (e.readUint64(), e.readUint64());
2105
2105
  const o = Ff(lh, e);
2106
- return new Rr(o, i, n);
2106
+ return new Br(o, i, n);
2107
2107
  }
2108
2108
  };
2109
- r(Rr, "type", "Opus");
2110
- let mh = Rr;
2109
+ r(Br, "type", "Opus");
2110
+ let mh = Br;
2111
2111
  const Ns = class Ns {
2112
2112
  constructor(e, t) {
2113
2113
  r(this, "type", Ns.type);
@@ -2198,7 +2198,7 @@ function Hf(s) {
2198
2198
  moov: n
2199
2199
  };
2200
2200
  }
2201
- function Qf(s) {
2201
+ function Xf(s) {
2202
2202
  if (s.byteLength < 8)
2203
2203
  throw new Error("Buffer too small");
2204
2204
  const e = new Zn(s), t = /* @__PURE__ */ new Map(), i = [];
@@ -2221,7 +2221,7 @@ function Qf(s) {
2221
2221
  };
2222
2222
  }
2223
2223
  var Wr, zr;
2224
- class Xf {
2224
+ class Qf {
2225
2225
  constructor(e) {
2226
2226
  d(this, Wr);
2227
2227
  d(this, zr);
@@ -2241,7 +2241,7 @@ const du = class du {
2241
2241
  d(this, Se);
2242
2242
  d(this, Be);
2243
2243
  d(this, H);
2244
- m(this, Se, t), m(this, Be, e), m(this, H, Qf(t));
2244
+ m(this, Se, t), m(this, Be, e), m(this, H, Xf(t));
2245
2245
  }
2246
2246
  /**
2247
2247
  * @returns a new fragment with a clone of the raw bytes
@@ -2318,11 +2318,11 @@ const du = class du {
2318
2318
  return ((e = a(this, H).moof.traf.trun) == null ? void 0 : e.samplesCount) || 0;
2319
2319
  }
2320
2320
  sample(e) {
2321
- var v, k, I, P, E, U, B, X, Q, _e, ie, Je, ut, Re, y;
2321
+ var v, k, I, P, E, U, B, Q, X, _e, ie, Je, ut, Re, y;
2322
2322
  const t = (v = a(this, Be).init().moov.traks[0]) == null ? void 0 : v.mdia.minf.stbl.stsd.codec, i = ((k = a(this, H).moof.traf.trun) == null ? void 0 : k.samplesCount) || 0, n = (I = a(this, H).moof.traf.tfdt) == null ? void 0 : I.baseMediaDecodeTime;
2323
2323
  if (e >= i || typeof n == "undefined" || !t)
2324
2324
  return;
2325
- const o = this.compositionTimeOffset(e), c = ((P = a(this, H).moof.traf.trun) == null ? void 0 : P.sampleDurations[e]) || 0, h = ((E = a(this, H).moof.traf.trun) == null ? void 0 : E.sampleDurations.slice(0, e).reduce((T, F) => T + F, 0)) || 0, u = n + h, l = ((U = a(this, Be).init().moov.traks[0]) == null ? void 0 : U.mdia.mdhd.timescale) || 1e3, p = ((B = a(this, H).moof.traf.trun) == null ? void 0 : B.sampleSizes[e]) || a(this, H).mdat.data.byteLength, g = ((X = a(this, H).moof.traf.trun) == null ? void 0 : X.sampleSizes.slice(0, e).reduce((T, F) => T + F, 0)) || 0, w = a(this, H).mdat.data.subarray(g, g + p), b = ((Q = a(this, H).moof.traf.trun) == null ? void 0 : Q.is_sync_sample(e)) || !1;
2325
+ const o = this.compositionTimeOffset(e), c = ((P = a(this, H).moof.traf.trun) == null ? void 0 : P.sampleDurations[e]) || 0, h = ((E = a(this, H).moof.traf.trun) == null ? void 0 : E.sampleDurations.slice(0, e).reduce((T, F) => T + F, 0)) || 0, u = n + h, l = ((U = a(this, Be).init().moov.traks[0]) == null ? void 0 : U.mdia.mdhd.timescale) || 1e3, p = ((B = a(this, H).moof.traf.trun) == null ? void 0 : B.sampleSizes[e]) || a(this, H).mdat.data.byteLength, g = ((Q = a(this, H).moof.traf.trun) == null ? void 0 : Q.sampleSizes.slice(0, e).reduce((T, F) => T + F, 0)) || 0, w = a(this, H).mdat.data.subarray(g, g + p), b = ((X = a(this, H).moof.traf.trun) == null ? void 0 : X.is_sync_sample(e)) || !1;
2326
2326
  if (this.mediaType() === "video") {
2327
2327
  const T = ((_e = a(this, Be).init().moov.traks[0]) == null ? void 0 : _e.tkhd.width) || 0, F = ((ie = a(this, Be).init().moov.traks[0]) == null ? void 0 : ie.tkhd.height) || 0;
2328
2328
  return {
@@ -2364,7 +2364,7 @@ var $s;
2364
2364
  class Fu {
2365
2365
  constructor(e) {
2366
2366
  d(this, $s);
2367
- m(this, $s, new Xf(e));
2367
+ m(this, $s, new Qf(e));
2368
2368
  }
2369
2369
  header() {
2370
2370
  return a(this, $s);
@@ -2449,7 +2449,7 @@ const j = {
2449
2449
  new Uint8Array([109, 112, 52, 49])
2450
2450
  // mp41
2451
2451
  ];
2452
- class Qd {
2452
+ class Xd {
2453
2453
  constructor() {
2454
2454
  r(this, "writer", new bm());
2455
2455
  r(this, "moofOffset", 0);
@@ -2543,9 +2543,9 @@ const re = (s, e, t) => {
2543
2543
  0,
2544
2544
  0
2545
2545
  ])), s.writer.writeUint32(2);
2546
- }, Xd = (s) => "sequenceParameterSets" in s, ph = (s) => "sequenceHeader" in s, vs = (s) => s.type == "video", hr = (s) => s.type == "audio", ip = (s, e, t) => {
2546
+ }, Qd = (s) => "sequenceParameterSets" in s, ph = (s) => "sequenceHeader" in s, Ts = (s) => s.type == "video", ur = (s) => s.type == "audio", ip = (s, e, t) => {
2547
2547
  const i = s.writer.position();
2548
- oe(s, j.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(hr(e) ? 1 : 0), s.writer.writeUint16(hr(e) ? 256 : 0), s.writer.writeUint16(0), s.writer.writeBytes(new Uint8Array(
2548
+ oe(s, j.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(ur(e) ? 1 : 0), s.writer.writeUint16(ur(e) ? 256 : 0), s.writer.writeUint16(0), s.writer.writeBytes(new Uint8Array(
2549
2549
  [
2550
2550
  0,
2551
2551
  1,
@@ -2584,14 +2584,14 @@ const re = (s, e, t) => {
2584
2584
  0,
2585
2585
  0
2586
2586
  ]
2587
- )), vs(e) ? (s.writer.writeUint32(e.width * 65536), s.writer.writeUint32(e.height * 65536)) : hr(e) && (s.writer.writeUint32(0), s.writer.writeUint32(0)), s.writer.writeUint32At(i, s.writer.position() - i);
2587
+ )), Ts(e) ? (s.writer.writeUint32(e.width * 65536), s.writer.writeUint32(e.height * 65536)) : ur(e) && (s.writer.writeUint32(0), s.writer.writeUint32(0)), s.writer.writeUint32At(i, s.writer.position() - i);
2588
2588
  }, sp = (s, e) => {
2589
2589
  oe(s, j.mdhd, 20, 0, 0), s.writer.writeUint32(0), s.writer.writeUint32(0), s.writer.writeUint32(e.timescale), s.writer.writeUint32(e.duration);
2590
2590
  const t = e.lang || "und", i = (t.charCodeAt(0) & 31) << 10 | (t.charCodeAt(1) & 31) << 5 | t.charCodeAt(2) & 31;
2591
2591
  s.writer.writeUint16(i), s.writer.writeUint16(0);
2592
2592
  }, np = (s, e) => {
2593
2593
  const t = s.writer.position();
2594
- oe(s, j.hdlr, 0, 0, 0), s.writer.writeUint32(0), s.writer.writeBytes(R(vs(e) ? "vide" : "soun")), s.writer.writeUint32(0), s.writer.writeUint32(0), s.writer.writeUint32(0), s.writer.writeBytes(R(vs(e) ? "VideoHandler\0" : "SoundHandler\0")), s.writer.writeUint32At(t, s.writer.position() - t);
2594
+ oe(s, j.hdlr, 0, 0, 0), s.writer.writeUint32(0), s.writer.writeBytes(R(Ts(e) ? "vide" : "soun")), s.writer.writeUint32(0), s.writer.writeUint32(0), s.writer.writeUint32(0), s.writer.writeBytes(R(Ts(e) ? "VideoHandler\0" : "SoundHandler\0")), s.writer.writeUint32At(t, s.writer.position() - t);
2595
2595
  }, rp = (s) => {
2596
2596
  const e = s.writer.position();
2597
2597
  re(s, j.dinf, 0), oe(s, j.dref, 16, 0, 0), s.writer.writeUint32(1), oe(s, R("url "), 0, 0, 1), s.writer.writeUint32At(e, s.writer.position() - e);
@@ -2612,7 +2612,7 @@ const re = (s, e, t) => {
2612
2612
  ), s.writer.writeUint8(0), s.writer.writeBytes(e.sequenceHeader), s.writer.writeUint32At(t, s.writer.position() - t);
2613
2613
  }, cp = (s, e) => {
2614
2614
  const t = s.writer.position(), i = ph(e) ? j.av01 : j.avc1;
2615
- re(s, i, 0), s.writer.writeUint32(0), s.writer.writeUint16(0), s.writer.writeUint16(1), s.writer.writeUint16(0), s.writer.writeUint16(0), s.writer.writeUint32(0), s.writer.writeUint32(0), s.writer.writeUint32(0), s.writer.writeUint16(e.width), s.writer.writeUint16(e.height), s.writer.writeUint32(4718592), s.writer.writeUint32(4718592), s.writer.writeUint32(0), s.writer.writeUint16(1), s.writer.writeUint8(0), s.writer.writeBytes(new Uint8Array(31)), s.writer.writeUint16(24), s.writer.writeUint16(-1), Xd(e) ? ap(s, e) : ph(e) && (op(s, e), e.parsedSequenceHeader.colorConfig && (re(s, R("colr"), 11), s.writer.writeBytes(j.nclx), s.writer.writeUint16(e.parsedSequenceHeader.colorConfig.colorPrimaries), s.writer.writeUint16(e.parsedSequenceHeader.colorConfig.transferCharacteristics), s.writer.writeUint16(e.parsedSequenceHeader.colorConfig.matrixCoefficients), s.writer.writeUint8(e.parsedSequenceHeader.colorConfig.colorRange ? 1 : 0))), e.pixelAspectRatio && (re(s, R("pasp"), 8), s.writer.writeUint32(e.pixelAspectRatio.numerator), s.writer.writeUint32(e.pixelAspectRatio.denumerator)), e.bitrate && (re(s, R("btrt"), 12), s.writer.writeUint32(0), s.writer.writeUint32(e.bitrate), s.writer.writeUint32(e.bitrate)), s.writer.writeUint32At(t, s.writer.position() - t);
2615
+ re(s, i, 0), s.writer.writeUint32(0), s.writer.writeUint16(0), s.writer.writeUint16(1), s.writer.writeUint16(0), s.writer.writeUint16(0), s.writer.writeUint32(0), s.writer.writeUint32(0), s.writer.writeUint32(0), s.writer.writeUint16(e.width), s.writer.writeUint16(e.height), s.writer.writeUint32(4718592), s.writer.writeUint32(4718592), s.writer.writeUint32(0), s.writer.writeUint16(1), s.writer.writeUint8(0), s.writer.writeBytes(new Uint8Array(31)), s.writer.writeUint16(24), s.writer.writeUint16(-1), Qd(e) ? ap(s, e) : ph(e) && (op(s, e), e.parsedSequenceHeader.colorConfig && (re(s, R("colr"), 11), s.writer.writeBytes(j.nclx), s.writer.writeUint16(e.parsedSequenceHeader.colorConfig.colorPrimaries), s.writer.writeUint16(e.parsedSequenceHeader.colorConfig.transferCharacteristics), s.writer.writeUint16(e.parsedSequenceHeader.colorConfig.matrixCoefficients), s.writer.writeUint8(e.parsedSequenceHeader.colorConfig.colorRange ? 1 : 0))), e.pixelAspectRatio && (re(s, R("pasp"), 8), s.writer.writeUint32(e.pixelAspectRatio.numerator), s.writer.writeUint32(e.pixelAspectRatio.denumerator)), e.bitrate && (re(s, R("btrt"), 12), s.writer.writeUint32(0), s.writer.writeUint32(e.bitrate), s.writer.writeUint32(e.bitrate)), s.writer.writeUint32At(t, s.writer.position() - t);
2616
2616
  }, eo = (s, e, t) => {
2617
2617
  let i = 3;
2618
2618
  for (s.writer.writeUint8(e); i > 0; i--)
@@ -2652,10 +2652,10 @@ const re = (s, e, t) => {
2652
2652
  const t = s.writer.position();
2653
2653
  re(s, j.stbl, 0);
2654
2654
  const i = s.writer.position();
2655
- oe(s, j.stsd, 0, 0, 0), s.writer.writeUint32(1), vs(e) ? cp(s, e) : hr(e) && lp(s, e), s.writer.writeUint32At(i, s.writer.position() - i), oe(s, R("stts"), 4, 0, 0), s.writer.writeUint32(0), oe(s, R("stsc"), 4, 0, 0), s.writer.writeUint32(0), oe(s, R("stsz"), 8, 0, 0), s.writer.writeUint32(0), s.writer.writeUint32(0), oe(s, R("stco"), 4, 0, 0), s.writer.writeUint32(0), s.writer.writeUint32At(t, s.writer.position() - t);
2655
+ oe(s, j.stsd, 0, 0, 0), s.writer.writeUint32(1), Ts(e) ? cp(s, e) : ur(e) && lp(s, e), s.writer.writeUint32At(i, s.writer.position() - i), oe(s, R("stts"), 4, 0, 0), s.writer.writeUint32(0), oe(s, R("stsc"), 4, 0, 0), s.writer.writeUint32(0), oe(s, R("stsz"), 8, 0, 0), s.writer.writeUint32(0), s.writer.writeUint32(0), oe(s, R("stco"), 4, 0, 0), s.writer.writeUint32(0), s.writer.writeUint32At(t, s.writer.position() - t);
2656
2656
  }, fp = (s, e) => {
2657
2657
  const t = s.writer.position();
2658
- re(s, j.minf, 0), vs(e) ? (oe(s, j.vmhd, 8, 0, 1), s.writer.writeUint32(0), s.writer.writeUint32(0)) : hr(e) && (oe(s, j.smhd, 4, 0, 0), s.writer.writeUint16(0), s.writer.writeUint16(0)), rp(s), mp(s, e), s.writer.writeUint32At(t, s.writer.position() - t);
2658
+ re(s, j.minf, 0), Ts(e) ? (oe(s, j.vmhd, 8, 0, 1), s.writer.writeUint32(0), s.writer.writeUint32(0)) : ur(e) && (oe(s, j.smhd, 4, 0, 0), s.writer.writeUint16(0), s.writer.writeUint16(0)), rp(s), mp(s, e), s.writer.writeUint32At(t, s.writer.position() - t);
2659
2659
  }, pp = (s, e) => {
2660
2660
  const t = s.writer.position();
2661
2661
  re(s, j.mdia, 0), sp(s, e), np(s, e), fp(s, e), s.writer.writeUint32At(t, s.writer.position() - t);
@@ -2703,11 +2703,11 @@ const re = (s, e, t) => {
2703
2703
  const t = e.samples.reduce((i, n) => i + n.data.byteLength, 0);
2704
2704
  re(s, j.mdat, t), e.samples.forEach((i) => s.writer.writeBytes(i.data));
2705
2705
  }, Gc = (s, e) => {
2706
- const t = new Qd(), i = s.filter((o) => vs(o) && Xd(o)).length > 0;
2707
- return s.filter((o) => vs(o) && ph(o)).length > 0 ? Zc(t, Jf) : i ? Zc(t, Zf) : Zc(t, $f), bp(t, s, qf), t.writer.buffer();
2706
+ const t = new Xd(), i = s.filter((o) => Ts(o) && Qd(o)).length > 0;
2707
+ return s.filter((o) => Ts(o) && ph(o)).length > 0 ? Zc(t, Jf) : i ? Zc(t, Zf) : Zc(t, $f), bp(t, s, qf), t.writer.buffer();
2708
2708
  }, jc = (s) => {
2709
2709
  var t;
2710
- const e = new Qd();
2710
+ const e = new Xd();
2711
2711
  return ((t = s.samples[0]) == null ? void 0 : t.producerReferenceTime) !== void 0 && ep(e, s.trackId, s.samples[0].producerReferenceTime, s.timestamp), e.moofOffset = e.writer.position(), kp(e, s), Ip(e, s), e.writer.buffer();
2712
2712
  }, Cp = (s, e) => {
2713
2713
  const t = s.map((c) => O(S({}, c), {
@@ -2858,8 +2858,8 @@ const re = (s, e, t) => {
2858
2858
  let I = !1;
2859
2859
  n ? I = !1 : I = s.readBit() !== 0, I && (l = s.readBits(4) + 2, p = s.readBits(3) + 1);
2860
2860
  const P = s.readBit() !== 0, E = s.readBit() !== 0, U = s.readBit() !== 0;
2861
- let B = !1, X = !1, Q = !1, _e = !1, ie = !1, Je = !1, ut = !1, Re = Nu, y = $c, T = 0;
2862
- n || (B = s.readBit() !== 0, X = s.readBit() !== 0, Q = s.readBit() !== 0, _e = s.readBit() !== 0, ie = s.readBit() !== 0, ie && (Je = s.readBit() !== 0, ut = s.readBit() !== 0), s.readBit() !== 0 ? Re = Nu : Re = s.readBit(), Re > 0 ? s.readBit() > 0 ? y = $c : y = s.readBit() : y = $c, ie ? T = s.readBits(3) : T = 0);
2861
+ let B = !1, Q = !1, X = !1, _e = !1, ie = !1, Je = !1, ut = !1, Re = Nu, y = $c, T = 0;
2862
+ n || (B = s.readBit() !== 0, Q = s.readBit() !== 0, X = s.readBit() !== 0, _e = s.readBit() !== 0, ie = s.readBit() !== 0, ie && (Je = s.readBit() !== 0, ut = s.readBit() !== 0), s.readBit() !== 0 ? Re = Nu : Re = s.readBit(), Re > 0 ? s.readBit() > 0 ? y = $c : y = s.readBit() : y = $c, ie ? T = s.readBits(3) : T = 0);
2863
2863
  const F = s.readBit() !== 0, G = s.readBit() !== 0, L = s.readBit() !== 0;
2864
2864
  return {
2865
2865
  seqProfile: e,
@@ -2886,8 +2886,8 @@ const re = (s, e, t) => {
2886
2886
  enableFilterIntra: E,
2887
2887
  enableIntraEdgeFilter: U,
2888
2888
  enableInterintraCompound: B,
2889
- enableMaskedCompound: X,
2890
- enableWarpedMotion: Q,
2889
+ enableMaskedCompound: Q,
2890
+ enableWarpedMotion: X,
2891
2891
  enableDualFilter: _e,
2892
2892
  enableOrderHint: ie,
2893
2893
  enableJntComp: Je,
@@ -2954,7 +2954,7 @@ const re = (s, e, t) => {
2954
2954
  width: e.maxFrameWidth,
2955
2955
  height: e.maxFrameHeight
2956
2956
  };
2957
- }, Qp = (s, e) => {
2957
+ }, Xp = (s, e) => {
2958
2958
  const t = s.map((h) => O(S({}, h), {
2959
2959
  data: new Uint8Array(h.data)
2960
2960
  }));
@@ -2970,7 +2970,7 @@ const re = (s, e, t) => {
2970
2970
  defaultDuration: c,
2971
2971
  samples: t
2972
2972
  });
2973
- }, Xp = (s, e) => {
2973
+ }, Qp = (s, e) => {
2974
2974
  const t = Zd(s);
2975
2975
  if (!t)
2976
2976
  throw new Error("Failed to parse sequence header");
@@ -3007,7 +3007,7 @@ const re = (s, e, t) => {
3007
3007
  case "av1":
3008
3008
  return Hp(e);
3009
3009
  }
3010
- }, Jp = (s, e) => Up(s, e), $p = (s, e) => Xp(s, e), Yp = (s, e, t) => Pp(new Uint8Array(s), t, e), Kp = (s, e, t) => Rp(new Uint8Array(s), t, e, e), eg = (s, e) => {
3010
+ }, Jp = (s, e) => Up(s, e), $p = (s, e) => Qp(s, e), Yp = (s, e, t) => Pp(new Uint8Array(s), t, e), Kp = (s, e, t) => Rp(new Uint8Array(s), t, e, e), eg = (s, e) => {
3011
3011
  if (!s[0])
3012
3012
  throw new Error("At least one sample must be provided");
3013
3013
  switch (s[0].codec) {
@@ -3018,11 +3018,11 @@ const re = (s, e, t) => {
3018
3018
  case "aac":
3019
3019
  return Cp(s, e);
3020
3020
  case "av1":
3021
- return Qp(s, e);
3021
+ return Xp(s, e);
3022
3022
  default:
3023
3023
  throw new Error(`Unsupported codec ${s[0].codec}`);
3024
3024
  }
3025
- }, ur = (s) => !!(s & 1), tg = (s) => !!(s & 2), ig = (s) => !!(s & 4), sg = (s) => !!(s & 8), ng = (s) => !!(s & 16), rg = (s) => {
3025
+ }, dr = (s) => !!(s & 1), tg = (s) => !!(s & 2), ig = (s) => !!(s & 4), sg = (s) => !!(s & 8), ng = (s) => !!(s & 16), rg = (s) => {
3026
3026
  const e = new DataView(s, 0), t = e.getUint8(0), i = e.getUint16(1), n = e.getUint8(3), o = e.getUint8(4), c = nu(new Uint8Array(s), 5, 12), h = e.getUint32(13), u = ng(n) ? e.getInt16(17) : void 0, l = s.slice(i);
3027
3027
  return { version: t, renditionId: o, flags: n, timestamp: c, timescale: h, payload: l, compositionTimeOffset: u };
3028
3028
  }, ag = "data:video/mp4;base64,AAAAHGZ0eXBNNFYgAAACAGlzb21pc28yYXZjMQAAAAhmcmVlAAAGF21kYXTeBAAAbGliZmFhYyAxLjI4AABCAJMgBDIARwAAArEGBf//rdxF6b3m2Ui3lizYINkj7u94MjY0IC0gY29yZSAxNDIgcjIgOTU2YzhkOCAtIEguMjY0L01QRUctNCBBVkMgY29kZWMgLSBDb3B5bGVmdCAyMDAzLTIwMTQgLSBodHRwOi8vd3d3LnZpZGVvbGFuLm9yZy94MjY0Lmh0bWwgLSBvcHRpb25zOiBjYWJhYz0wIHJlZj0zIGRlYmxvY2s9MTowOjAgYW5hbHlzZT0weDE6MHgxMTEgbWU9aGV4IHN1Ym1lPTcgcHN5PTEgcHN5X3JkPTEuMDA6MC4wMCBtaXhlZF9yZWY9MSBtZV9yYW5nZT0xNiBjaHJvbWFfbWU9MSB0cmVsbGlzPTEgOHg4ZGN0PTAgY3FtPTAgZGVhZHpvbmU9MjEsMTEgZmFzdF9wc2tpcD0xIGNocm9tYV9xcF9vZmZzZXQ9LTIgdGhyZWFkcz02IGxvb2thaGVhZF90aHJlYWRzPTEgc2xpY2VkX3RocmVhZHM9MCBucj0wIGRlY2ltYXRlPTEgaW50ZXJsYWNlZD0wIGJsdXJheV9jb21wYXQ9MCBjb25zdHJhaW5lZF9pbnRyYT0wIGJmcmFtZXM9MCB3ZWlnaHRwPTAga2V5aW50PTI1MCBrZXlpbnRfbWluPTI1IHNjZW5lY3V0PTQwIGludHJhX3JlZnJlc2g9MCByY19sb29rYWhlYWQ9NDAgcmM9Y3JmIG1idHJlZT0xIGNyZj0yMy4wIHFjb21wPTAuNjAgcXBtaW49MCBxcG1heD02OSBxcHN0ZXA9NCB2YnZfbWF4cmF0ZT03NjggdmJ2X2J1ZnNpemU9MzAwMCBjcmZfbWF4PTAuMCBuYWxfaHJkPW5vbmUgZmlsbGVyPTAgaXBfcmF0aW89MS40MCBhcT0xOjEuMDAAgAAAAFZliIQL8mKAAKvMnJycnJycnJycnXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXiEASZACGQAjgCEASZACGQAjgAAAAAdBmjgX4GSAIQBJkAIZACOAAAAAB0GaVAX4GSAhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZpgL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGagC/AySEASZACGQAjgAAAAAZBmqAvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZrAL8DJIQBJkAIZACOAAAAABkGa4C/AySEASZACGQAjgCEASZACGQAjgAAAAAZBmwAvwMkhAEmQAhkAI4AAAAAGQZsgL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGbQC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBm2AvwMkhAEmQAhkAI4AAAAAGQZuAL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGboC/AySEASZACGQAjgAAAAAZBm8AvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZvgL8DJIQBJkAIZACOAAAAABkGaAC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBmiAvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZpAL8DJIQBJkAIZACOAAAAABkGaYC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBmoAvwMkhAEmQAhkAI4AAAAAGQZqgL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGawC/AySEASZACGQAjgAAAAAZBmuAvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZsAL8DJIQBJkAIZACOAAAAABkGbIC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBm0AvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZtgL8DJIQBJkAIZACOAAAAABkGbgCvAySEASZACGQAjgCEASZACGQAjgAAAAAZBm6AnwMkhAEmQAhkAI4AhAEmQAhkAI4AhAEmQAhkAI4AhAEmQAhkAI4AAAAhubW9vdgAAAGxtdmhkAAAAAAAAAAAAAAAAAAAD6AAABDcAAQAAAQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAzB0cmFrAAAAXHRraGQAAAADAAAAAAAAAAAAAAABAAAAAAAAA+kAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAALAAAACQAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAAPpAAAAAAABAAAAAAKobWRpYQAAACBtZGhkAAAAAAAAAAAAAAAAAAB1MAAAdU5VxAAAAAAALWhkbHIAAAAAAAAAAHZpZGUAAAAAAAAAAAAAAABWaWRlb0hhbmRsZXIAAAACU21pbmYAAAAUdm1oZAAAAAEAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAAhNzdGJsAAAAr3N0c2QAAAAAAAAAAQAAAJ9hdmMxAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAALAAkABIAAAASAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGP//AAAALWF2Y0MBQsAN/+EAFWdCwA3ZAsTsBEAAAPpAADqYA8UKkgEABWjLg8sgAAAAHHV1aWRraEDyXyRPxbo5pRvPAyPzAAAAAAAAABhzdHRzAAAAAAAAAAEAAAAeAAAD6QAAABRzdHNzAAAAAAAAAAEAAAABAAAAHHN0c2MAAAAAAAAAAQAAAAEAAAABAAAAAQAAAIxzdHN6AAAAAAAAAAAAAAAeAAADDwAAAAsAAAALAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAAiHN0Y28AAAAAAAAAHgAAAEYAAANnAAADewAAA5gAAAO0AAADxwAAA+MAAAP2AAAEEgAABCUAAARBAAAEXQAABHAAAASMAAAEnwAABLsAAATOAAAE6gAABQYAAAUZAAAFNQAABUgAAAVkAAAFdwAABZMAAAWmAAAFwgAABd4AAAXxAAAGDQAABGh0cmFrAAAAXHRraGQAAAADAAAAAAAAAAAAAAACAAAAAAAABDcAAAAAAAAAAAAAAAEBAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAAQkAAADcAABAAAAAAPgbWRpYQAAACBtZGhkAAAAAAAAAAAAAAAAAAC7gAAAykBVxAAAAAAALWhkbHIAAAAAAAAAAHNvdW4AAAAAAAAAAAAAAABTb3VuZEhhbmRsZXIAAAADi21pbmYAAAAQc21oZAAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAADT3N0YmwAAABnc3RzZAAAAAAAAAABAAAAV21wNGEAAAAAAAAAAQAAAAAAAAAAAAIAEAAAAAC7gAAAAAAAM2VzZHMAAAAAA4CAgCIAAgAEgICAFEAVBbjYAAu4AAAADcoFgICAAhGQBoCAgAECAAAAIHN0dHMAAAAAAAAAAgAAADIAAAQAAAAAAQAAAkAAAAFUc3RzYwAAAAAAAAAbAAAAAQAAAAEAAAABAAAAAgAAAAIAAAABAAAAAwAAAAEAAAABAAAABAAAAAIAAAABAAAABgAAAAEAAAABAAAABwAAAAIAAAABAAAACAAAAAEAAAABAAAACQAAAAIAAAABAAAACgAAAAEAAAABAAAACwAAAAIAAAABAAAADQAAAAEAAAABAAAADgAAAAIAAAABAAAADwAAAAEAAAABAAAAEAAAAAIAAAABAAAAEQAAAAEAAAABAAAAEgAAAAIAAAABAAAAFAAAAAEAAAABAAAAFQAAAAIAAAABAAAAFgAAAAEAAAABAAAAFwAAAAIAAAABAAAAGAAAAAEAAAABAAAAGQAAAAIAAAABAAAAGgAAAAEAAAABAAAAGwAAAAIAAAABAAAAHQAAAAEAAAABAAAAHgAAAAIAAAABAAAAHwAAAAQAAAABAAAA4HN0c3oAAAAAAAAAAAAAADMAAAAaAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAACMc3RjbwAAAAAAAAAfAAAALAAAA1UAAANyAAADhgAAA6IAAAO+AAAD0QAAA+0AAAQAAAAEHAAABC8AAARLAAAEZwAABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw", to = () => "wakeLock" in navigator && window.navigator.userAgent.indexOf("Samsung") === -1;
@@ -3082,25 +3082,25 @@ class og {
3082
3082
  }
3083
3083
  }
3084
3084
  const cg = /\r\n|\r|\n/;
3085
- var ni, Dt;
3085
+ var ri, Dt;
3086
3086
  class Gu {
3087
3087
  constructor(e) {
3088
- d(this, ni);
3088
+ d(this, ri);
3089
3089
  d(this, Dt);
3090
- m(this, ni, e), m(this, Dt, 0);
3090
+ m(this, ri, e), m(this, Dt, 0);
3091
3091
  }
3092
3092
  skipEmptyLines() {
3093
3093
  let e = 0;
3094
- for (; a(this, ni)[a(this, Dt)] === ""; )
3094
+ for (; a(this, ri)[a(this, Dt)] === ""; )
3095
3095
  Ge(this, Dt)._++, e++;
3096
3096
  return e;
3097
3097
  }
3098
3098
  readLine() {
3099
- return a(this, ni)[Ge(this, Dt)._++];
3099
+ return a(this, ri)[Ge(this, Dt)._++];
3100
3100
  }
3101
3101
  takeUntilEmptyLine() {
3102
3102
  const e = [];
3103
- for (; a(this, ni)[a(this, Dt)] !== ""; ) {
3103
+ for (; a(this, ri)[a(this, Dt)] !== ""; ) {
3104
3104
  const t = this.readLine();
3105
3105
  if (t === void 0)
3106
3106
  break;
@@ -3109,14 +3109,14 @@ class Gu {
3109
3109
  return e;
3110
3110
  }
3111
3111
  linesLeft() {
3112
- return a(this, ni).length - a(this, Dt);
3112
+ return a(this, ri).length - a(this, Dt);
3113
3113
  }
3114
3114
  }
3115
- ni = new WeakMap(), Dt = new WeakMap();
3116
- var Ts, $d, gh;
3115
+ ri = new WeakMap(), Dt = new WeakMap();
3116
+ var Es, $d, gh;
3117
3117
  class Jd {
3118
3118
  constructor() {
3119
- d(this, Ts);
3119
+ d(this, Es);
3120
3120
  }
3121
3121
  parse(e) {
3122
3122
  const t = [], i = e.split(cg), n = new Gu(i), o = n.readLine();
@@ -3125,13 +3125,13 @@ class Jd {
3125
3125
  for (; n.readLine() !== ""; )
3126
3126
  ;
3127
3127
  for (; n.linesLeft() > 0; ) {
3128
- const c = A(this, Ts, $d).call(this, n);
3128
+ const c = A(this, Es, $d).call(this, n);
3129
3129
  c && t.push(c), n.skipEmptyLines();
3130
3130
  }
3131
3131
  return t;
3132
3132
  }
3133
3133
  }
3134
- Ts = new WeakSet(), $d = function(e) {
3134
+ Es = new WeakSet(), $d = function(e) {
3135
3135
  e.skipEmptyLines();
3136
3136
  const t = e.takeUntilEmptyLine(), i = new Gu(t);
3137
3137
  let n = i.readLine(), o;
@@ -3148,7 +3148,7 @@ Ts = new WeakSet(), $d = function(e) {
3148
3148
  const p = i.readLine();
3149
3149
  if (!p)
3150
3150
  throw new Error("missing text");
3151
- const g = A(this, Ts, gh).call(this, c), w = A(this, Ts, gh).call(this, u);
3151
+ const g = A(this, Es, gh).call(this, c), w = A(this, Es, gh).call(this, u);
3152
3152
  return {
3153
3153
  id: o,
3154
3154
  startTime: g,
@@ -3168,7 +3168,7 @@ const hg = (s) => {
3168
3168
  const e = window;
3169
3169
  e.vindralInstances = e.vindralInstances || {}, e.vindralInstances[s.getStatistics().clientId.substring(0, 8)] = s;
3170
3170
  };
3171
- class Ah extends Ei {
3171
+ class Ah extends ki {
3172
3172
  constructor({ type: t, autoplay: i, muted: n, volume: o, logger: c, poster: h }) {
3173
3173
  super();
3174
3174
  r(this, "element");
@@ -3339,10 +3339,10 @@ const ug = (s) => {
3339
3339
  if (s.codec === "webvtt")
3340
3340
  throw new Error("WebVTT is not supported");
3341
3341
  let e;
3342
- return Ss(s) ? e = {
3342
+ return vs(s) ? e = {
3343
3343
  type: "media-source",
3344
3344
  audio: {
3345
- contentType: ei(s),
3345
+ contentType: ti(s),
3346
3346
  bitrate: s.bitRate,
3347
3347
  channels: s.channels.toString(),
3348
3348
  samplerate: s.sampleRate
@@ -3350,7 +3350,7 @@ const ug = (s) => {
3350
3350
  } : e = {
3351
3351
  type: "media-source",
3352
3352
  video: {
3353
- contentType: ei(s),
3353
+ contentType: ti(s),
3354
3354
  bitrate: s.bitRate,
3355
3355
  width: s.width,
3356
3356
  height: s.height,
@@ -3544,18 +3544,18 @@ function Yd(s) {
3544
3544
  }
3545
3545
  throw new Error("Unknown object status " + s);
3546
3546
  }
3547
- var gt, Ys, Ks, Hr, Qr, en, Xr, qr;
3547
+ var gt, Ys, Ks, Hr, Xr, en, Qr, qr;
3548
3548
  class Ag {
3549
3549
  constructor(e, t, i, n, o, c) {
3550
3550
  d(this, gt);
3551
3551
  d(this, Ys);
3552
3552
  d(this, Ks);
3553
3553
  d(this, Hr);
3554
- d(this, Qr);
3554
+ d(this, Xr);
3555
3555
  d(this, en, new z());
3556
- d(this, Xr, 0);
3556
+ d(this, Qr, 0);
3557
3557
  d(this, qr);
3558
- m(this, gt, e), m(this, Ys, t), m(this, Ks, i), m(this, Hr, n), m(this, Qr, o), m(this, qr, c);
3558
+ m(this, gt, e), m(this, Ys, t), m(this, Ks, i), m(this, Hr, n), m(this, Xr, o), m(this, qr, c);
3559
3559
  }
3560
3560
  endStatus() {
3561
3561
  return a(this, en).promise;
@@ -3572,9 +3572,9 @@ class Ag {
3572
3572
  return { done: !0, value: void 0 };
3573
3573
  if (yield a(this, gt).isDone())
3574
3574
  return { done: !0, value: void 0 };
3575
- const e = a(this, Xr) === 0 ? a(this, Ys) : yield a(this, gt).readBigVarInt(), t = yield a(this, gt).readBigVarInt(), i = yield a(this, gt).readVarInt();
3575
+ const e = a(this, Qr) === 0 ? a(this, Ys) : yield a(this, gt).readBigVarInt(), t = yield a(this, gt).readBigVarInt(), i = yield a(this, gt).readVarInt();
3576
3576
  let n = 0, o = new Uint8Array();
3577
- return i > 0 ? o = yield a(this, gt).read(i) : n = yield a(this, gt).readVarInt(), Yd(n), (n === Ee.EndOfTrackAndGroup || n === Ee.EndOfGroup) && a(this, en).resolve(n), Ge(this, Xr)._++, {
3577
+ return i > 0 ? o = yield a(this, gt).read(i) : n = yield a(this, gt).readVarInt(), Yd(n), (n === Ee.EndOfTrackAndGroup || n === Ee.EndOfGroup) && a(this, en).resolve(n), Ge(this, Qr)._++, {
3578
3578
  done: !1,
3579
3579
  value: {
3580
3580
  subscribeId: a(this, Ks),
@@ -3582,7 +3582,7 @@ class Ag {
3582
3582
  groupId: e,
3583
3583
  subGroupId: x(0),
3584
3584
  objectId: t,
3585
- subscriberPriority: a(this, Qr),
3585
+ subscriberPriority: a(this, Xr),
3586
3586
  streamId: a(this, qr),
3587
3587
  objectStatus: n,
3588
3588
  payload: o
@@ -3607,11 +3607,11 @@ class Ag {
3607
3607
  return Promise.resolve();
3608
3608
  }
3609
3609
  }
3610
- gt = new WeakMap(), Ys = new WeakMap(), Ks = new WeakMap(), Hr = new WeakMap(), Qr = new WeakMap(), en = new WeakMap(), Xr = new WeakMap(), qr = new WeakMap();
3611
- var At, tn, Zr, Jr, sn, Es, Kd, yh;
3610
+ gt = new WeakMap(), Ys = new WeakMap(), Ks = new WeakMap(), Hr = new WeakMap(), Xr = new WeakMap(), en = new WeakMap(), Qr = new WeakMap(), qr = new WeakMap();
3611
+ var At, tn, Zr, Jr, sn, ks, Kd, yh;
3612
3612
  class wg {
3613
3613
  constructor(e, t, i, n, o) {
3614
- d(this, Es);
3614
+ d(this, ks);
3615
3615
  d(this, At);
3616
3616
  d(this, tn);
3617
3617
  d(this, Zr);
@@ -3626,7 +3626,7 @@ class wg {
3626
3626
  return a(this, sn);
3627
3627
  }
3628
3628
  groups() {
3629
- return A(this, Es, Kd).call(this);
3629
+ return A(this, ks, Kd).call(this);
3630
3630
  }
3631
3631
  subscribeId() {
3632
3632
  return a(this, tn);
@@ -3640,13 +3640,13 @@ class wg {
3640
3640
  return this;
3641
3641
  }
3642
3642
  [Rt()]() {
3643
- return A(this, Es, yh).call(this);
3643
+ return A(this, ks, yh).call(this);
3644
3644
  }
3645
3645
  [Symbol.asyncDispose]() {
3646
- return A(this, Es, yh).call(this);
3646
+ return A(this, ks, yh).call(this);
3647
3647
  }
3648
3648
  }
3649
- At = new WeakMap(), tn = new WeakMap(), Zr = new WeakMap(), Jr = new WeakMap(), sn = new WeakMap(), Es = new WeakSet(), Kd = function() {
3649
+ At = new WeakMap(), tn = new WeakMap(), Zr = new WeakMap(), Jr = new WeakMap(), sn = new WeakMap(), ks = new WeakSet(), Kd = function() {
3650
3650
  return Ut(this, null, function* () {
3651
3651
  for (; !(yield new q(a(this, At).isDone())); ) {
3652
3652
  const e = yield new q(a(this, At).readBigVarInt()), t = new Ag(
@@ -3665,10 +3665,10 @@ At = new WeakMap(), tn = new WeakMap(), Zr = new WeakMap(), Jr = new WeakMap(),
3665
3665
  return a(this, At).close().catch(() => {
3666
3666
  });
3667
3667
  };
3668
- var it, nn, $r, rn, Yr, Kr, ea, an, $o, ks, el, Sh;
3668
+ var it, nn, $r, rn, Yr, Kr, ea, an, $o, Is, el, Sh;
3669
3669
  class bg {
3670
3670
  constructor(e, t, i, n, o, c, h) {
3671
- d(this, ks);
3671
+ d(this, Is);
3672
3672
  d(this, it);
3673
3673
  d(this, nn);
3674
3674
  d(this, $r);
@@ -3725,19 +3725,19 @@ class bg {
3725
3725
  });
3726
3726
  }
3727
3727
  groups() {
3728
- return A(this, ks, el).call(this);
3728
+ return A(this, Is, el).call(this);
3729
3729
  }
3730
3730
  [Symbol.asyncIterator]() {
3731
3731
  return this;
3732
3732
  }
3733
3733
  [Rt()]() {
3734
- return A(this, ks, Sh).call(this);
3734
+ return A(this, Is, Sh).call(this);
3735
3735
  }
3736
3736
  [Symbol.asyncDispose]() {
3737
- return A(this, ks, Sh).call(this);
3737
+ return A(this, Is, Sh).call(this);
3738
3738
  }
3739
3739
  }
3740
- it = new WeakMap(), nn = new WeakMap(), $r = new WeakMap(), rn = new WeakMap(), Yr = new WeakMap(), Kr = new WeakMap(), ea = new WeakMap(), an = new WeakMap(), $o = new WeakMap(), ks = new WeakSet(), el = function() {
3740
+ it = new WeakMap(), nn = new WeakMap(), $r = new WeakMap(), rn = new WeakMap(), Yr = new WeakMap(), Kr = new WeakMap(), ea = new WeakMap(), an = new WeakMap(), $o = new WeakMap(), Is = new WeakSet(), el = function() {
3741
3741
  return Ut(this, null, function* () {
3742
3742
  yield this;
3743
3743
  });
@@ -3762,37 +3762,37 @@ function tl(s, e) {
3762
3762
  }
3763
3763
  });
3764
3764
  }
3765
- var ri, ta;
3765
+ var ai, ta;
3766
3766
  class yg {
3767
3767
  constructor(e, t) {
3768
- d(this, ri);
3768
+ d(this, ai);
3769
3769
  d(this, ta);
3770
- m(this, ri, e), m(this, ta, t);
3770
+ m(this, ai, e), m(this, ta, t);
3771
3771
  }
3772
3772
  start(e) {
3773
- a(this, ri).addEventListener("message", (t) => {
3773
+ a(this, ai).addEventListener("message", (t) => {
3774
3774
  if (typeof t.data == "object" && t.data instanceof ArrayBuffer) {
3775
3775
  const i = new Uint8Array(t.data);
3776
3776
  i[0] == a(this, ta) && e.enqueue(i.subarray(1));
3777
3777
  }
3778
- }), a(this, ri).addEventListener("error", () => e.error(new Error("WebSocket error"))), a(this, ri).addEventListener("close", () => Ud(() => e.close()));
3778
+ }), a(this, ai).addEventListener("error", () => e.error(new Error("WebSocket error"))), a(this, ai).addEventListener("close", () => Ud(() => e.close()));
3779
3779
  }
3780
3780
  cancel(e) {
3781
- a(this, ri).close(void 0, e);
3781
+ a(this, ai).close(void 0, e);
3782
3782
  }
3783
3783
  }
3784
- ri = new WeakMap(), ta = new WeakMap();
3785
- var wt, Wi, zi, Hi;
3784
+ ai = new WeakMap(), ta = new WeakMap();
3785
+ var wt, zi, Hi, Xi;
3786
3786
  class Sg {
3787
3787
  constructor(e) {
3788
3788
  d(this, wt);
3789
- d(this, Wi, null);
3790
3789
  d(this, zi, null);
3791
3790
  d(this, Hi, null);
3791
+ d(this, Xi, null);
3792
3792
  m(this, wt, e);
3793
3793
  }
3794
3794
  start(e) {
3795
- m(this, Wi, (t) => {
3795
+ m(this, zi, (t) => {
3796
3796
  if (typeof t.data == "object" && t.data instanceof ArrayBuffer) {
3797
3797
  const i = new Uint8Array(t.data), n = i[0] || 0, o = n & 127, c = (n >> 7 & 1) > 0;
3798
3798
  if (o && o !== 0) {
@@ -3800,14 +3800,14 @@ class Sg {
3800
3800
  e.enqueue([c, o, h]);
3801
3801
  }
3802
3802
  }
3803
- }), m(this, zi, () => Ud(() => e.close())), m(this, Hi, () => e.error(new Error("WebSocket error"))), a(this, wt).addEventListener("message", a(this, Wi)), a(this, wt).addEventListener("error", a(this, Hi)), a(this, wt).addEventListener("close", a(this, zi));
3803
+ }), m(this, Hi, () => Ud(() => e.close())), m(this, Xi, () => e.error(new Error("WebSocket error"))), a(this, wt).addEventListener("message", a(this, zi)), a(this, wt).addEventListener("error", a(this, Xi)), a(this, wt).addEventListener("close", a(this, Hi));
3804
3804
  }
3805
3805
  cancel(e) {
3806
- a(this, Wi) && a(this, wt).removeEventListener("message", a(this, Wi)), a(this, Hi) && a(this, wt).removeEventListener("error", a(this, Hi)), a(this, zi) && a(this, wt).removeEventListener("close", a(this, zi));
3806
+ a(this, zi) && a(this, wt).removeEventListener("message", a(this, zi)), a(this, Xi) && a(this, wt).removeEventListener("error", a(this, Xi)), a(this, Hi) && a(this, wt).removeEventListener("close", a(this, Hi));
3807
3807
  }
3808
3808
  }
3809
- wt = new WeakMap(), Wi = new WeakMap(), zi = new WeakMap(), Hi = new WeakMap();
3810
- var bt, ia, Qi, yt, Yo, W, rr, no, xi, ro, Jt;
3809
+ wt = new WeakMap(), zi = new WeakMap(), Hi = new WeakMap(), Xi = new WeakMap();
3810
+ var bt, ia, Qi, yt, Yo, W, ar, no, Mi, ro, Jt;
3811
3811
  class Lo {
3812
3812
  constructor(e, t) {
3813
3813
  d(this, W);
@@ -3820,7 +3820,7 @@ class Lo {
3820
3820
  }
3821
3821
  readUnsigned8() {
3822
3822
  return f(this, null, function* () {
3823
- return yield A(this, W, xi).call(this, 1), A(this, W, Jt).call(this, 1)[0];
3823
+ return yield A(this, W, Mi).call(this, 1), A(this, W, Jt).call(this, 1)[0];
3824
3824
  });
3825
3825
  }
3826
3826
  readString() {
@@ -3839,23 +3839,23 @@ class Lo {
3839
3839
  }
3840
3840
  readBigVarInt() {
3841
3841
  return f(this, null, function* () {
3842
- yield A(this, W, xi).call(this, 1);
3842
+ yield A(this, W, Mi).call(this, 1);
3843
3843
  const e = (A(this, W, ro).call(this, 1)[0] & 192) >> 6;
3844
3844
  switch (a(this, bt)[a(this, yt)] = A(this, W, ro).call(this, 1)[0] & 63, e) {
3845
3845
  case 0:
3846
3846
  return x(A(this, W, Jt).call(this, 1)[0]);
3847
3847
  case 1: {
3848
- yield A(this, W, xi).call(this, 2);
3848
+ yield A(this, W, Mi).call(this, 2);
3849
3849
  const t = A(this, W, Jt).call(this, 2), i = new DataView(t.buffer, t.byteOffset, t.byteLength);
3850
3850
  return x(i.getUint16(0));
3851
3851
  }
3852
3852
  case 2: {
3853
- yield A(this, W, xi).call(this, 4);
3853
+ yield A(this, W, Mi).call(this, 4);
3854
3854
  const t = A(this, W, Jt).call(this, 4), i = new DataView(t.buffer, t.byteOffset, t.byteLength);
3855
3855
  return x(i.getUint32(0));
3856
3856
  }
3857
3857
  case 3: {
3858
- yield A(this, W, xi).call(this, 8);
3858
+ yield A(this, W, Mi).call(this, 8);
3859
3859
  const t = A(this, W, Jt).call(this, 8), i = new DataView(t.buffer, t.byteOffset, t.byteLength);
3860
3860
  if (typeof i.getBigUint64 != "undefined")
3861
3861
  return x(i.getBigUint64(0));
@@ -3869,19 +3869,19 @@ class Lo {
3869
3869
  }
3870
3870
  read(e) {
3871
3871
  return f(this, null, function* () {
3872
- return yield A(this, W, xi).call(this, e), A(this, W, Jt).call(this, e);
3872
+ return yield A(this, W, Mi).call(this, e), A(this, W, Jt).call(this, e);
3873
3873
  });
3874
3874
  }
3875
3875
  readAll() {
3876
3876
  return f(this, null, function* () {
3877
3877
  for (; yield A(this, W, no).call(this); )
3878
3878
  ;
3879
- return A(this, W, Jt).call(this, A(this, W, rr).call(this));
3879
+ return A(this, W, Jt).call(this, A(this, W, ar).call(this));
3880
3880
  });
3881
3881
  }
3882
3882
  isDone() {
3883
3883
  return f(this, null, function* () {
3884
- return A(this, W, rr).call(this) > 0 ? !1 : (yield A(this, W, no).call(this)) == 0;
3884
+ return A(this, W, ar).call(this) > 0 ? !1 : (yield A(this, W, no).call(this)) == 0;
3885
3885
  });
3886
3886
  }
3887
3887
  closed() {
@@ -3895,14 +3895,14 @@ class Lo {
3895
3895
  });
3896
3896
  }
3897
3897
  }
3898
- bt = new WeakMap(), ia = new WeakMap(), Qi = new WeakMap(), yt = new WeakMap(), Yo = new WeakMap(), W = new WeakSet(), rr = function() {
3898
+ bt = new WeakMap(), ia = new WeakMap(), Qi = new WeakMap(), yt = new WeakMap(), Yo = new WeakMap(), W = new WeakSet(), ar = function() {
3899
3899
  return a(this, bt).length - a(this, yt);
3900
3900
  }, no = function() {
3901
3901
  return f(this, null, function* () {
3902
3902
  const { value: e, done: t } = yield a(this, Qi).read();
3903
3903
  if (t)
3904
3904
  return Promise.resolve(0);
3905
- if (A(this, W, rr).call(this) === 0)
3905
+ if (A(this, W, ar).call(this) === 0)
3906
3906
  m(this, bt, e);
3907
3907
  else {
3908
3908
  const n = a(this, bt).subarray(a(this, yt)), o = new Uint8Array(n.length + e.length);
@@ -3910,9 +3910,9 @@ bt = new WeakMap(), ia = new WeakMap(), Qi = new WeakMap(), yt = new WeakMap(),
3910
3910
  }
3911
3911
  return m(this, yt, 0), Promise.resolve(e.length);
3912
3912
  });
3913
- }, xi = function(e) {
3913
+ }, Mi = function(e) {
3914
3914
  return f(this, null, function* () {
3915
- for (; A(this, W, rr).call(this) < e; )
3915
+ for (; A(this, W, ar).call(this) < e; )
3916
3916
  if ((yield A(this, W, no).call(this)) === 0)
3917
3917
  throw new Error("Read failed");
3918
3918
  });
@@ -3963,14 +3963,14 @@ on = new WeakMap(), cn = new WeakMap(), Ot = new WeakMap(), Ko = new WeakMap();
3963
3963
  const sl = {
3964
3964
  OPEN: 1
3965
3965
  };
3966
- var Ue, Me, Xi, ec;
3967
- const Br = class Br {
3966
+ var Ue, Me, qi, ec;
3967
+ const Ur = class Ur {
3968
3968
  constructor(e) {
3969
3969
  d(this, Ue, 0);
3970
- d(this, Me, new Uint8Array(Br.DEFAULT_BUFFER_SIZE));
3971
- d(this, Xi);
3970
+ d(this, Me, new Uint8Array(Ur.DEFAULT_BUFFER_SIZE));
3971
+ d(this, qi);
3972
3972
  d(this, ec, new TextEncoder());
3973
- m(this, Xi, e);
3973
+ m(this, qi, e);
3974
3974
  }
3975
3975
  writeString(e) {
3976
3976
  return f(this, null, function* () {
@@ -4001,16 +4001,16 @@ const Br = class Br {
4001
4001
  return this.ensureBufferSpace(8), m(this, Ue, a(this, Ue) + ll(e, a(this, Me).subarray(a(this, Ue))).byteLength), Promise.resolve();
4002
4002
  }
4003
4003
  flush() {
4004
- if (a(this, Xi).readyState !== sl.OPEN)
4004
+ if (a(this, qi).readyState !== sl.OPEN)
4005
4005
  throw new Error("Writer is not open");
4006
- return a(this, Xi).send(a(this, Me).subarray(0, a(this, Ue))), m(this, Ue, 0), m(this, Me, new Uint8Array(Br.DEFAULT_BUFFER_SIZE)), Promise.resolve();
4006
+ return a(this, qi).send(a(this, Me).subarray(0, a(this, Ue))), m(this, Ue, 0), m(this, Me, new Uint8Array(Ur.DEFAULT_BUFFER_SIZE)), Promise.resolve();
4007
4007
  }
4008
4008
  close() {
4009
- return a(this, Xi).close(), Promise.resolve();
4009
+ return a(this, qi).close(), Promise.resolve();
4010
4010
  }
4011
4011
  };
4012
- Ue = new WeakMap(), Me = new WeakMap(), Xi = new WeakMap(), ec = new WeakMap(), r(Br, "DEFAULT_BUFFER_SIZE", 1024);
4013
- let Mr = Br;
4012
+ Ue = new WeakMap(), Me = new WeakMap(), qi = new WeakMap(), ec = new WeakMap(), r(Ur, "DEFAULT_BUFFER_SIZE", 1024);
4013
+ let Mr = Ur;
4014
4014
  const nl = 2 ** 6 - 1, rl = 2 ** 14 - 1, al = 2 ** 30 - 1, vg = Number.MAX_SAFE_INTEGER, Tg = typeof BigInt == "function" ? x(2) ** x(62) - x(1) : x(Number.MAX_SAFE_INTEGER);
4015
4015
  function Wc(s, e) {
4016
4016
  return e[0] = s, e.subarray(0, 1);
@@ -4073,7 +4073,7 @@ function au(s, e) {
4073
4073
  });
4074
4074
  }
4075
4075
  const Do = x(2);
4076
- function Yn(s) {
4076
+ function Kn(s) {
4077
4077
  return f(this, null, function* () {
4078
4078
  const e = yield s.readVarInt(), t = /* @__PURE__ */ new Map();
4079
4079
  for (let i = 0; i < e; i++) {
@@ -4083,7 +4083,7 @@ function Yn(s) {
4083
4083
  return t;
4084
4084
  });
4085
4085
  }
4086
- function Kn(s, e) {
4086
+ function er(s, e) {
4087
4087
  return f(this, null, function* () {
4088
4088
  yield s.writeVarInt(e.size);
4089
4089
  for (const [t, i] of e)
@@ -4095,13 +4095,13 @@ function Eg(s) {
4095
4095
  return {
4096
4096
  type: C.Announce,
4097
4097
  namespace: yield zc(s),
4098
- params: yield Yn(s)
4098
+ params: yield Kn(s)
4099
4099
  };
4100
4100
  });
4101
4101
  }
4102
4102
  function kg(s, e) {
4103
4103
  return f(this, null, function* () {
4104
- yield au(s, e.namespace), yield Kn(s, e.params);
4104
+ yield au(s, e.namespace), yield er(s, e.params);
4105
4105
  });
4106
4106
  }
4107
4107
  function Ig(s) {
@@ -4206,7 +4206,7 @@ function fl(s, e) {
4206
4206
  }
4207
4207
  function Pg(s) {
4208
4208
  return f(this, null, function* () {
4209
- const e = yield s.readBigVarInt(), t = yield s.readBigVarInt(), i = yield zc(s), n = yield s.readString(), o = yield s.readUnsigned8(), c = yield ml(s), h = yield Bg(s), u = yield Yn(s);
4209
+ const e = yield s.readBigVarInt(), t = yield s.readBigVarInt(), i = yield zc(s), n = yield s.readString(), o = yield s.readUnsigned8(), c = yield ml(s), h = yield Bg(s), u = yield Kn(s);
4210
4210
  if (h.type === "absolute-range") {
4211
4211
  const l = h.start.group > h.end.group, p = h.start.group === h.end.group && h.start.object > h.end.object;
4212
4212
  if (l || p)
@@ -4227,7 +4227,7 @@ function Pg(s) {
4227
4227
  }
4228
4228
  function xg(s, e) {
4229
4229
  return f(this, null, function* () {
4230
- yield s.writeBigVarInt(e.id), yield s.writeBigVarInt(e.trackAlias), yield au(s, e.namespace), yield s.writeString(e.name), yield s.writeUnsigned8(e.subscriberPriority), yield fl(s, e.groupOrder), yield Ug(s, e.filterType), yield Kn(s, e.params);
4230
+ yield s.writeBigVarInt(e.id), yield s.writeBigVarInt(e.trackAlias), yield au(s, e.namespace), yield s.writeString(e.name), yield s.writeUnsigned8(e.subscriberPriority), yield fl(s, e.groupOrder), yield Ug(s, e.filterType), yield er(s, e.params);
4231
4231
  });
4232
4232
  }
4233
4233
  const vh = {
@@ -4281,7 +4281,7 @@ function Fg(s) {
4281
4281
  group: yield s.readBigVarInt(),
4282
4282
  object: yield s.readBigVarInt()
4283
4283
  });
4284
- const c = yield Yn(s);
4284
+ const c = yield Kn(s);
4285
4285
  return {
4286
4286
  type: C.SubscribeOk,
4287
4287
  id: e,
@@ -4294,12 +4294,12 @@ function Fg(s) {
4294
4294
  }
4295
4295
  function _g(s, e) {
4296
4296
  return f(this, null, function* () {
4297
- yield s.writeBigVarInt(e.id), yield s.writeBigVarInt(e.expires), yield fl(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 Kn(s, e.params);
4297
+ yield s.writeBigVarInt(e.id), yield s.writeBigVarInt(e.expires), yield fl(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 er(s, e.params);
4298
4298
  });
4299
4299
  }
4300
4300
  function Ng(s) {
4301
4301
  return f(this, null, function* () {
4302
- 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 Yn(s), u = t > n, l = t === n && i > o;
4302
+ 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 Kn(s), u = t > n, l = t === n && i > o;
4303
4303
  if (u || l)
4304
4304
  throw new Error("Invalid filter range");
4305
4305
  return {
@@ -4314,7 +4314,7 @@ function Ng(s) {
4314
4314
  }
4315
4315
  function Vg(s, e) {
4316
4316
  return f(this, null, function* () {
4317
- 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 Kn(s, e.params);
4317
+ 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 er(s, e.params);
4318
4318
  });
4319
4319
  }
4320
4320
  const Gg = {
@@ -4335,7 +4335,7 @@ function jg(s, e) {
4335
4335
  yield s.writeVarInt(e.supportedVersions.length);
4336
4336
  for (const t of e.supportedVersions)
4337
4337
  yield s.writeVarInt(t.value);
4338
- yield Kn(s, e.parameters);
4338
+ yield er(s, e.parameters);
4339
4339
  });
4340
4340
  }
4341
4341
  function Wg(s) {
@@ -4343,7 +4343,7 @@ function Wg(s) {
4343
4343
  const e = [], t = yield s.readVarInt();
4344
4344
  for (let n = 0; n < t; n++)
4345
4345
  e.push(yield gl(s));
4346
- const i = yield Yn(s);
4346
+ const i = yield Kn(s);
4347
4347
  if (!i.has(Oo.Role))
4348
4348
  throw new Error("Role parameter is required");
4349
4349
  return {
@@ -4355,7 +4355,7 @@ function Wg(s) {
4355
4355
  }
4356
4356
  function zg(s, e) {
4357
4357
  return f(this, null, function* () {
4358
- yield s.writeVarInt(e.selectedVersion.value), yield Kn(s, e.parameters);
4358
+ yield s.writeVarInt(e.selectedVersion.value), yield er(s, e.parameters);
4359
4359
  });
4360
4360
  }
4361
4361
  function Hg(s) {
@@ -4363,7 +4363,7 @@ function Hg(s) {
4363
4363
  const e = yield gl(s);
4364
4364
  if (e.type !== "known")
4365
4365
  throw new Error("Expected known version");
4366
- const t = yield Yn(s);
4366
+ const t = yield Kn(s);
4367
4367
  if (!t.has(Oo.Role))
4368
4368
  throw new Error("Role parameter is required");
4369
4369
  return {
@@ -4373,7 +4373,7 @@ function Hg(s) {
4373
4373
  };
4374
4374
  });
4375
4375
  }
4376
- function Qg(s) {
4376
+ function Xg(s) {
4377
4377
  return f(this, null, function* () {
4378
4378
  return {
4379
4379
  type: C.Unsubscribe,
@@ -4381,7 +4381,7 @@ function Qg(s) {
4381
4381
  };
4382
4382
  });
4383
4383
  }
4384
- function Xg(s, e) {
4384
+ function Qg(s, e) {
4385
4385
  return f(this, null, function* () {
4386
4386
  yield s.writeBigVarInt(e.id);
4387
4387
  });
@@ -4480,7 +4480,7 @@ Ft = new WeakMap(), hn = new WeakMap(), te = new WeakSet(), wl = function(e, t)
4480
4480
  });
4481
4481
  }, kl = function(e, t) {
4482
4482
  return f(this, null, function* () {
4483
- yield Xg(e, t);
4483
+ yield Qg(e, t);
4484
4484
  });
4485
4485
  }, Il = function(e, t) {
4486
4486
  return f(this, null, function* () {
@@ -4561,7 +4561,7 @@ class Wu {
4561
4561
  case C.SubscribeUpdate:
4562
4562
  return Ng(a(this, he));
4563
4563
  case C.Unsubscribe:
4564
- return Qg(a(this, he));
4564
+ return Xg(a(this, he));
4565
4565
  case C.Announce:
4566
4566
  return Eg(a(this, he));
4567
4567
  case C.AnnounceOk:
@@ -4671,15 +4671,15 @@ class eA {
4671
4671
  this.state = e;
4672
4672
  }
4673
4673
  }
4674
- var fn, ai, qi, sc, Zi, st;
4674
+ var fn, oi, Zi, sc, Ji, st;
4675
4675
  const Gs = class Gs {
4676
4676
  constructor(e) {
4677
4677
  r(this, "subscribe");
4678
4678
  d(this, fn, new z());
4679
- d(this, ai, new z());
4680
- d(this, qi, new z());
4681
- d(this, sc, Date.now());
4679
+ d(this, oi, new z());
4682
4680
  d(this, Zi, new z());
4681
+ d(this, sc, Date.now());
4682
+ d(this, Ji, new z());
4683
4683
  d(this, st);
4684
4684
  switch (this.subscribe = e, e.filterType.type) {
4685
4685
  case "absolute-start":
@@ -4695,24 +4695,24 @@ const Gs = class Gs {
4695
4695
  }
4696
4696
  onError(e) {
4697
4697
  const t = new Error(e.reason);
4698
- return a(this, fn).reject(t), a(this, ai).reject(t), t;
4698
+ return a(this, fn).reject(t), a(this, oi).reject(t), t;
4699
4699
  }
4700
4700
  onDone(e) {
4701
- e.finalInfo && (a(this, st) || m(this, st, { startGroup: x(0) }), a(this, st).endGroup = e.finalInfo.group), a(this, ai).resolve(e);
4701
+ e.finalInfo && (a(this, st) || m(this, st, { startGroup: x(0) }), a(this, st).endGroup = e.finalInfo.group), a(this, oi).resolve(e);
4702
4702
  }
4703
4703
  onUnsubscribe(e) {
4704
- a(this, qi).resolve(e);
4704
+ a(this, Zi).resolve(e);
4705
4705
  }
4706
4706
  onOk(e) {
4707
4707
  const t = Math.max(0, Date.now() - a(this, sc)), i = Number(e.expires);
4708
4708
  if (i > 0) {
4709
4709
  const n = Math.max(Gs.minGraceTime, Math.min(i / 10, Gs.maxGraceTime));
4710
- Promise.race([ki(i - n - t), this.done().catch(D)]).then(() => a(this, Zi).resolve(this.expiryState())).catch(D);
4710
+ Promise.race([Ii(i - n - t), this.done().catch(D)]).then(() => a(this, Ji).resolve(this.expiryState())).catch(D);
4711
4711
  }
4712
4712
  a(this, fn).resolve(e);
4713
4713
  }
4714
4714
  done() {
4715
- return a(this, ai).promise;
4715
+ return a(this, oi).promise;
4716
4716
  }
4717
4717
  ok() {
4718
4718
  return a(this, fn).promise;
@@ -4721,27 +4721,27 @@ const Gs = class Gs {
4721
4721
  return a(this, st);
4722
4722
  }
4723
4723
  close() {
4724
- a(this, Zi).promise.catch(D), a(this, Zi).reject(new Error("Subscription closed"));
4724
+ a(this, Ji).promise.catch(D), a(this, Ji).reject(new Error("Subscription closed"));
4725
4725
  }
4726
4726
  // Returns whether the subscription is still active - i.e. hasn't received a done or unsubscribe
4727
4727
  expiryState() {
4728
- return a(this, ai).resolved && a(this, ai).resolved.errorCode !== vh.Expired ? "done" : a(this, qi).pending ? "active" : "unsubscribed";
4728
+ return a(this, oi).resolved && a(this, oi).resolved.errorCode !== vh.Expired ? "done" : a(this, Zi).pending ? "active" : "unsubscribed";
4729
4729
  }
4730
4730
  unsubscribed() {
4731
- return a(this, qi).promise;
4731
+ return a(this, Zi).promise;
4732
4732
  }
4733
4733
  isUnsubscribed() {
4734
- return a(this, qi).resolved;
4734
+ return a(this, Zi).resolved;
4735
4735
  }
4736
4736
  /**
4737
4737
  * Returns a promise that resolves when the subscription is about to expire (15 seconds before expiry).
4738
4738
 
4739
4739
  */
4740
4740
  expiryNotification() {
4741
- return a(this, Zi).promise;
4741
+ return a(this, Ji).promise;
4742
4742
  }
4743
4743
  };
4744
- fn = new WeakMap(), ai = new WeakMap(), qi = new WeakMap(), sc = new WeakMap(), Zi = new WeakMap(), st = new WeakMap(), r(Gs, "maxGraceTime", 15e3), r(Gs, "minGraceTime", 3e3);
4744
+ fn = new WeakMap(), oi = new WeakMap(), Zi = new WeakMap(), sc = new WeakMap(), Ji = new WeakMap(), st = new WeakMap(), r(Gs, "maxGraceTime", 15e3), r(Gs, "minGraceTime", 3e3);
4745
4745
  let _o = Gs;
4746
4746
  var we, oa;
4747
4747
  class tA {
@@ -4842,15 +4842,15 @@ ca = new WeakMap(), He = new WeakMap(), ha = new WeakMap(), ua = new WeakMap(),
4842
4842
  }
4843
4843
  });
4844
4844
  };
4845
- var Ji, la, gn, ma, An;
4845
+ var $i, la, gn, ma, An;
4846
4846
  class sA {
4847
4847
  constructor(e, t, i) {
4848
- d(this, Ji);
4848
+ d(this, $i);
4849
4849
  d(this, la);
4850
4850
  d(this, gn);
4851
4851
  d(this, ma);
4852
4852
  d(this, An);
4853
- m(this, Ji, e), m(this, la, t), m(this, gn, i), m(this, An, ge.get().createContext(`GroupSubscriptionWriter:${i.subscribe.name}`));
4853
+ m(this, $i, e), m(this, la, t), m(this, gn, i), m(this, An, ge.get().createContext(`GroupSubscriptionWriter:${i.subscribe.name}`));
4854
4854
  }
4855
4855
  finalGroup() {
4856
4856
  return a(this, ma);
@@ -4861,7 +4861,7 @@ class sA {
4861
4861
  try {
4862
4862
  for (var e = $(a(this, la)), t, i, n; t = !(i = yield e.next()).done; t = !1) {
4863
4863
  const o = i.value;
4864
- yield a(this, Ji).write({
4864
+ yield a(this, $i).write({
4865
4865
  subscribeId: a(this, gn).subscribe.id,
4866
4866
  trackAlias: a(this, gn).subscribe.trackAlias,
4867
4867
  subGroupId: x(0),
@@ -4886,21 +4886,21 @@ class sA {
4886
4886
  });
4887
4887
  }
4888
4888
  [Rt()]() {
4889
- return a(this, Ji).close().catch(D);
4889
+ return a(this, $i).close().catch(D);
4890
4890
  }
4891
4891
  [Symbol.asyncDispose]() {
4892
- return a(this, Ji).close().catch(D);
4892
+ return a(this, $i).close().catch(D);
4893
4893
  }
4894
4894
  }
4895
- Ji = new WeakMap(), la = new WeakMap(), gn = new WeakMap(), ma = new WeakMap(), An = new WeakMap();
4896
- var fa, $i, oi, Ms;
4895
+ $i = new WeakMap(), la = new WeakMap(), gn = new WeakMap(), ma = new WeakMap(), An = new WeakMap();
4896
+ var fa, Yi, ci, Ms;
4897
4897
  class nA {
4898
4898
  constructor(e, t, i) {
4899
- d(this, oi);
4899
+ d(this, ci);
4900
4900
  r(this, "state");
4901
4901
  d(this, fa);
4902
- d(this, $i);
4903
- this.state = e, m(this, fa, t), m(this, $i, i);
4902
+ d(this, Yi);
4903
+ this.state = e, m(this, fa, t), m(this, Yi, i);
4904
4904
  }
4905
4905
  /**
4906
4906
  * Accept the subscription and provide a track cache for the subscription
@@ -4918,23 +4918,23 @@ class nA {
4918
4918
  params: /* @__PURE__ */ new Map(),
4919
4919
  largestInfo: n ? { group: n, object: o } : void 0
4920
4920
  };
4921
- return yield a(this, $i).push(h), new iA(this.state, c, a(this, fa), a(this, $i));
4921
+ return yield a(this, Yi).push(h), new iA(this.state, c, a(this, fa), a(this, Yi));
4922
4922
  });
4923
4923
  }
4924
4924
  invalidRange() {
4925
- return A(this, oi, Ms).call(this, x(1), "Invalid range");
4925
+ return A(this, ci, Ms).call(this, x(1), "Invalid range");
4926
4926
  }
4927
4927
  retryTrackAlias() {
4928
- return A(this, oi, Ms).call(this, x(2), "Retry track alias");
4928
+ return A(this, ci, Ms).call(this, x(2), "Retry track alias");
4929
4929
  }
4930
4930
  trackDoesNotExist() {
4931
- return A(this, oi, Ms).call(this, x(3), "Track does not exist");
4931
+ return A(this, ci, Ms).call(this, x(3), "Track does not exist");
4932
4932
  }
4933
4933
  unauthorized() {
4934
- return A(this, oi, Ms).call(this, x(4), "Unauthorized");
4934
+ return A(this, ci, Ms).call(this, x(4), "Unauthorized");
4935
4935
  }
4936
4936
  timeout() {
4937
- return A(this, oi, Ms).call(this, x(5), "Timeout");
4937
+ return A(this, ci, Ms).call(this, x(5), "Timeout");
4938
4938
  }
4939
4939
  [Rt()]() {
4940
4940
  return this.trackDoesNotExist();
@@ -4943,7 +4943,7 @@ class nA {
4943
4943
  return this.trackDoesNotExist();
4944
4944
  }
4945
4945
  }
4946
- fa = new WeakMap(), $i = new WeakMap(), oi = new WeakSet(), Ms = function(e, t) {
4946
+ fa = new WeakMap(), Yi = new WeakMap(), ci = new WeakSet(), Ms = function(e, t) {
4947
4947
  const i = {
4948
4948
  type: C.SubscribeError,
4949
4949
  id: this.state.subscribe.id,
@@ -4951,25 +4951,25 @@ fa = new WeakMap(), $i = new WeakMap(), oi = new WeakSet(), Ms = function(e, t)
4951
4951
  reason: t,
4952
4952
  trackAlias: this.state.subscribe.trackAlias
4953
4953
  };
4954
- return a(this, $i).push(i);
4954
+ return a(this, Yi).push(i);
4955
4955
  };
4956
- var cd, wn, pa, bn, Yi, ci, hi, ui, ah;
4956
+ var cd, wn, pa, bn, Ki, hi, ui, di, ah;
4957
4957
  cd = [Pe({ context: "Session", enter: "info", error: "error" })];
4958
4958
  class Th {
4959
4959
  constructor(e, t, i) {
4960
- Ri(ah, 5, this);
4960
+ Bi(ah, 5, this);
4961
4961
  d(this, wn);
4962
4962
  d(this, pa);
4963
4963
  d(this, bn);
4964
- d(this, Yi, ge.get().createContext("Publisher"));
4965
- d(this, ci, new ke(/* @__PURE__ */ new Map()));
4964
+ d(this, Ki, ge.get().createContext("Publisher"));
4966
4965
  d(this, hi, new ke(/* @__PURE__ */ new Map()));
4967
- d(this, ui, new _c(10));
4966
+ d(this, ui, new ke(/* @__PURE__ */ new Map()));
4967
+ d(this, di, new _c(10));
4968
4968
  m(this, wn, e), m(this, pa, t), m(this, bn, i);
4969
4969
  }
4970
4970
  announce(e) {
4971
4971
  return f(this, null, function* () {
4972
- if (a(this, ci).current().has(e.join("/")))
4972
+ if (a(this, hi).current().has(e.join("/")))
4973
4973
  throw new Error("Duplicate announcement");
4974
4974
  const t = /* @__PURE__ */ new Map(), i = a(this, wn).authToken();
4975
4975
  i && t.set(Do, { type: Do, payload: new TextEncoder().encode(i) });
@@ -4978,15 +4978,15 @@ class Th {
4978
4978
  namespace: e,
4979
4979
  params: t
4980
4980
  }, o = Kg(n);
4981
- if (a(this, ci).update((h) => h.set(n.namespace.join("/"), o)), yield a(this, bn).push(n), !(yield Promise.race([o.state.ok(), a(this, wn).closed()])))
4981
+ if (a(this, hi).update((h) => h.set(n.namespace.join("/"), o)), yield a(this, bn).push(n), !(yield Promise.race([o.state.ok(), a(this, wn).closed()])))
4982
4982
  throw new Error("Session closed");
4983
4983
  });
4984
4984
  }
4985
4985
  close() {
4986
- a(this, hi).current().forEach((e) => e.close()), a(this, hi).close(), a(this, ci).close(), a(this, ui).close();
4986
+ a(this, ui).current().forEach((e) => e.close()), a(this, ui).close(), a(this, hi).close(), a(this, di).close();
4987
4987
  }
4988
4988
  incomingSubscriptions() {
4989
- return a(this, ui);
4989
+ return a(this, di);
4990
4990
  }
4991
4991
  onMessage(e) {
4992
4992
  return f(this, null, function* () {
@@ -4994,77 +4994,77 @@ class Th {
4994
4994
  case C.Subscribe:
4995
4995
  {
4996
4996
  const t = new _o(e);
4997
- if (a(this, hi).update((i) => (i.set(e.id, t), i)), a(this, ui).isFull()) {
4998
- const i = yield a(this, ui).pop();
4997
+ if (a(this, ui).update((i) => (i.set(e.id, t), i)), a(this, di).isFull()) {
4998
+ const i = yield a(this, di).pop();
4999
4999
  yield i == null ? void 0 : i.timeout();
5000
5000
  }
5001
- yield a(this, ui).push(
5001
+ yield a(this, di).push(
5002
5002
  new nA(t, a(this, pa), a(this, bn))
5003
5003
  );
5004
5004
  }
5005
5005
  break;
5006
5006
  case C.SubscribeUpdate:
5007
5007
  {
5008
- const t = a(this, hi).current().get(e.id);
5009
- t || a(this, Yi).debug("No subscription found", e), t == null || t.onUpdate(e);
5008
+ const t = a(this, ui).current().get(e.id);
5009
+ t || a(this, Ki).debug("No subscription found", e), t == null || t.onUpdate(e);
5010
5010
  }
5011
5011
  break;
5012
5012
  case C.Unsubscribe:
5013
5013
  {
5014
- const t = a(this, hi).current().get(e.id);
5015
- t || a(this, Yi).debug("No subscription found", e), t == null || t.onUnsubscribe(e);
5014
+ const t = a(this, ui).current().get(e.id);
5015
+ t || a(this, Ki).debug("No subscription found", e), t == null || t.onUnsubscribe(e);
5016
5016
  }
5017
5017
  break;
5018
5018
  case C.AnnounceOk:
5019
5019
  {
5020
- const t = a(this, ci).current().get(e.namespace.join("/"));
5021
- t || a(this, Yi).debug("No announcement found", e), t == null || t.state.onOk(e);
5020
+ const t = a(this, hi).current().get(e.namespace.join("/"));
5021
+ t || a(this, Ki).debug("No announcement found", e), t == null || t.state.onOk(e);
5022
5022
  }
5023
5023
  break;
5024
5024
  case C.AnnounceError:
5025
5025
  {
5026
- const t = a(this, ci).current().get(e.namespace.join("/"));
5027
- t || a(this, Yi).debug("No announcement found", e), t == null || t.state.onError(e);
5026
+ const t = a(this, hi).current().get(e.namespace.join("/"));
5027
+ t || a(this, Ki).debug("No announcement found", e), t == null || t.state.onError(e);
5028
5028
  }
5029
5029
  break;
5030
5030
  }
5031
5031
  });
5032
5032
  }
5033
5033
  }
5034
- ah = Ci(null), wn = new WeakMap(), pa = new WeakMap(), bn = new WeakMap(), Yi = new WeakMap(), ci = new WeakMap(), hi = new WeakMap(), ui = new WeakMap(), ye(ah, 1, "announce", cd, Th), Zt(ah, Th);
5034
+ ah = Ri(null), wn = new WeakMap(), pa = new WeakMap(), bn = new WeakMap(), Ki = new WeakMap(), hi = new WeakMap(), ui = new WeakMap(), di = new WeakMap(), ye(ah, 1, "announce", cd, Th), Zt(ah, Th);
5035
5035
  function rA(s, e) {
5036
5036
  const t = new _o(e), [i, n] = su(100), o = new aA(t, i), c = new Pl(s, t, n);
5037
5037
  return [o, c];
5038
5038
  }
5039
- var Ki;
5039
+ var es;
5040
5040
  class aA {
5041
5041
  constructor(e, t) {
5042
5042
  r(this, "state");
5043
- d(this, Ki);
5044
- this.state = e, m(this, Ki, t);
5043
+ d(this, es);
5044
+ this.state = e, m(this, es, t);
5045
5045
  }
5046
5046
  onDone(e) {
5047
5047
  this.state.onDone(e);
5048
5048
  }
5049
5049
  onData(e) {
5050
- return a(this, Ki).push(e);
5050
+ return a(this, es).push(e);
5051
5051
  }
5052
5052
  onError(e) {
5053
5053
  const t = this.state.onError(e);
5054
- a(this, Ki).abort(t);
5054
+ a(this, es).abort(t);
5055
5055
  }
5056
5056
  /**
5057
5057
  * Closes the subscription producer so that no more objects an be emitted
5058
5058
  */
5059
5059
  close() {
5060
- this.state.close(), a(this, Ki).close();
5060
+ this.state.close(), a(this, es).close();
5061
5061
  }
5062
5062
  }
5063
- Ki = new WeakMap();
5064
- var hd, yn, le, Sn, vn, oh, Tn, ar;
5063
+ es = new WeakMap();
5064
+ var hd, yn, le, Sn, vn, oh, Tn, or;
5065
5065
  class Pl {
5066
5066
  constructor(e, t, i) {
5067
- Ri(oh, 5, this);
5067
+ Bi(oh, 5, this);
5068
5068
  d(this, Tn);
5069
5069
  d(this, yn);
5070
5070
  d(this, le);
@@ -5225,23 +5225,23 @@ class Pl {
5225
5225
  });
5226
5226
  }
5227
5227
  [(hd = [Pe({ context: "SubscriptionConsumer", enter: "info" })], Rt())]() {
5228
- return A(this, Tn, ar).call(this);
5228
+ return A(this, Tn, or).call(this);
5229
5229
  }
5230
5230
  [Symbol.asyncDispose]() {
5231
- return A(this, Tn, ar).call(this);
5231
+ return A(this, Tn, or).call(this);
5232
5232
  }
5233
5233
  }
5234
- oh = Ci(null), yn = new WeakMap(), le = new WeakMap(), Sn = new WeakMap(), vn = new WeakMap(), Tn = new WeakSet(), ar = function() {
5234
+ oh = Ri(null), yn = new WeakMap(), le = new WeakMap(), Sn = new WeakMap(), vn = new WeakMap(), Tn = new WeakSet(), or = function() {
5235
5235
  return f(this, null, function* () {
5236
5236
  return yield this.close(), this.unsubscribe();
5237
5237
  });
5238
- }, ar = ye(oh, 17, "#dispose", hd, Tn, ar), Zt(oh, Pl);
5238
+ }, or = ye(oh, 17, "#dispose", hd, Tn, or), Zt(oh, Pl);
5239
5239
  const oA = 2e3;
5240
- var ud, dd, ld, md, _t, Le, es, ts, Ps, Ct, oo, Ls;
5240
+ var ud, dd, ld, md, _t, Le, ts, is, Ps, Ct, oo, Ls;
5241
5241
  md = [Pe({ context: "Session", return: "debug" })], ld = [Pe({ context: "Session", enter: "info", error: "error" })], dd = [Pe({ context: "Session", enter: "debug" })], ud = [Pe({ context: "Session", enter: "debug" })];
5242
5242
  class ao {
5243
5243
  constructor(e, t) {
5244
- Ri(Ps, 5, this);
5244
+ Bi(Ps, 5, this);
5245
5245
  d(this, Ct);
5246
5246
  // The owner session of the subscriber
5247
5247
  d(this, _t);
@@ -5249,9 +5249,9 @@ class ao {
5249
5249
  r(this, "nextSubscribeId", x(0));
5250
5250
  // The active subscriptions
5251
5251
  d(this, Le, new ke(/* @__PURE__ */ new Map()));
5252
- d(this, es);
5253
- d(this, ts, ge.get().createContext("Subscriber"));
5254
- m(this, _t, e), m(this, es, t), A(this, Ct, oo).call(this).catch(D);
5252
+ d(this, ts);
5253
+ d(this, is, ge.get().createContext("Subscriber"));
5254
+ m(this, _t, e), m(this, ts, t), A(this, Ct, oo).call(this).catch(D);
5255
5255
  }
5256
5256
  subscribe(n, o) {
5257
5257
  return f(this, arguments, function* (e, t, i = /* @__PURE__ */ new Map()) {
@@ -5267,10 +5267,10 @@ class ao {
5267
5267
  subscriberPriority: t.priority,
5268
5268
  filterType: t.filterType,
5269
5269
  params: i
5270
- }, [l, p] = rA(a(this, es), u);
5271
- if (a(this, Le).update((w) => w.set(c, l)), yield a(this, es).push(u), !(yield Promise.race([l.state.ok(), a(this, _t).closed()])))
5270
+ }, [l, p] = rA(a(this, ts), u);
5271
+ if (a(this, Le).update((w) => w.set(c, l)), yield a(this, ts).push(u), !(yield Promise.race([l.state.ok(), a(this, _t).closed()])))
5272
5272
  throw new Error("Session closed");
5273
- return p.closed().then(() => Promise.race([ki(oA), this.closed()])).then(() => A(this, Ct, Ls).call(this, p.id)).catch(() => A(this, Ct, Ls).call(this, p.id)), p;
5273
+ return p.closed().then(() => Promise.race([Ii(oA), this.closed()])).then(() => A(this, Ct, Ls).call(this, p.id)).catch(() => A(this, Ct, Ls).call(this, p.id)), p;
5274
5274
  });
5275
5275
  }
5276
5276
  closed() {
@@ -5286,7 +5286,7 @@ class ao {
5286
5286
  return f(this, null, function* () {
5287
5287
  switch (e.type) {
5288
5288
  case C.Announce:
5289
- yield a(this, es).push({
5289
+ yield a(this, ts).push({
5290
5290
  type: C.AnnounceOk,
5291
5291
  namespace: e.namespace
5292
5292
  });
@@ -5300,13 +5300,13 @@ class ao {
5300
5300
  case C.SubscribeError:
5301
5301
  {
5302
5302
  const t = a(this, Le).current().get(e.id);
5303
- t || a(this, ts).debug("No subscription found", e), t == null || t.onError(e), A(this, Ct, Ls).call(this, e.id);
5303
+ t || a(this, is).debug("No subscription found", e), t == null || t.onError(e), A(this, Ct, Ls).call(this, e.id);
5304
5304
  }
5305
5305
  break;
5306
5306
  case C.SubscribeDone:
5307
5307
  {
5308
5308
  const t = a(this, Le).current().get(e.id);
5309
- t || a(this, ts).debug("No subscription found", e), t == null || t.onDone(e);
5309
+ t || a(this, is).debug("No subscription found", e), t == null || t.onDone(e);
5310
5310
  }
5311
5311
  break;
5312
5312
  }
@@ -5316,7 +5316,7 @@ class ao {
5316
5316
  return f(this, null, function* () {
5317
5317
  const t = a(this, Le).current().get(e.subscribeId());
5318
5318
  if (!t) {
5319
- a(this, ts).warn("No subscription found", e.subscribeId());
5319
+ a(this, is).warn("No subscription found", e.subscribeId());
5320
5320
  return;
5321
5321
  }
5322
5322
  yield t.onData(e);
@@ -5326,13 +5326,13 @@ class ao {
5326
5326
  a(this, Le).current().forEach((e) => e.close()), a(this, Le).close();
5327
5327
  }
5328
5328
  }
5329
- Ps = Ci(null), _t = new WeakMap(), Le = new WeakMap(), es = new WeakMap(), ts = new WeakMap(), Ct = new WeakSet(), oo = function() {
5329
+ Ps = Ri(null), _t = new WeakMap(), Le = new WeakMap(), ts = new WeakMap(), is = new WeakMap(), Ct = new WeakSet(), oo = function() {
5330
5330
  return f(this, null, function* () {
5331
5331
  try {
5332
5332
  for (var e = $(a(this, Le)), t, i, n; t = !(i = yield e.next()).done; t = !1) {
5333
5333
  const o = i.value;
5334
5334
  const c = [...o.values()].map((h) => h.state.subscribe);
5335
- a(this, ts).debug("current subscriptions", c);
5335
+ a(this, is).debug("current subscriptions", c);
5336
5336
  }
5337
5337
  } catch (i) {
5338
5338
  n = [i];
@@ -5348,23 +5348,23 @@ Ps = Ci(null), _t = new WeakMap(), Le = new WeakMap(), es = new WeakMap(), ts =
5348
5348
  }, Ls = function(e) {
5349
5349
  a(this, Le).isClosed() || a(this, Le).update((t) => (t.delete(e), t));
5350
5350
  }, oo = ye(Ps, 17, "#observeChanges", md, Ct, oo), ye(Ps, 1, "subscribe", ld, ao), ye(Ps, 1, "close", dd, ao), Ls = ye(Ps, 17, "#deleteSubscription", ud, Ct, Ls), Zt(Ps, ao);
5351
- var fd, pd, gd, Ad, nt, ga, is, En, kn, ue, xl, Ml, xs, co, ho, uo, or;
5351
+ var fd, pd, gd, Ad, nt, ga, ss, En, kn, ue, xl, Ml, xs, co, ho, uo, cr;
5352
5352
  class ou {
5353
5353
  constructor(e, t) {
5354
- Ri(xs, 5, this);
5354
+ Bi(xs, 5, this);
5355
5355
  d(this, ue);
5356
5356
  // The underlying transport implementation
5357
5357
  d(this, nt);
5358
5358
  // The background "thread" running the background tasks
5359
5359
  d(this, ga);
5360
5360
  // Outgoing messages
5361
- d(this, is);
5361
+ d(this, ss);
5362
5362
  d(this, En, ge.get().createContext("Session"));
5363
5363
  r(this, "subscriber");
5364
5364
  r(this, "publisher");
5365
5365
  d(this, kn);
5366
5366
  const [i, n] = su(100);
5367
- m(this, nt, e), m(this, is, n), this.subscriber = new ao(this, i), this.publisher = new Th(this, e, i), m(this, ga, A(this, ue, Ml).call(this)), m(this, kn, new ke(t)), this.closed().then(() => this.close()).catch(D);
5367
+ m(this, nt, e), m(this, ss, n), this.subscriber = new ao(this, i), this.publisher = new Th(this, e, i), m(this, ga, A(this, ue, Ml).call(this)), m(this, kn, new ke(t)), this.closed().then(() => this.close()).catch(D);
5368
5368
  }
5369
5369
  updateAuthToken(e) {
5370
5370
  a(this, kn).update(e);
@@ -5383,19 +5383,19 @@ class ou {
5383
5383
  }
5384
5384
  close() {
5385
5385
  try {
5386
- this.subscriber.close(), this.publisher.close(), a(this, is).cancel("closing"), a(this, nt).close();
5386
+ this.subscriber.close(), this.publisher.close(), a(this, ss).cancel("closing"), a(this, nt).close();
5387
5387
  } catch (e) {
5388
5388
  a(this, En).warn("Error closing session", e);
5389
5389
  }
5390
5390
  }
5391
5391
  [(Ad = [Pe({ context: "Session", return: "info", error: "error" })], gd = [Pe({ context: "Session", return: "info", error: "error" })], pd = [Pe({ context: "Session", return: "info", error: "error" })], fd = [Pe({ context: "Session", enter: "debug" })], Bd())]() {
5392
- A(this, ue, or).call(this);
5392
+ A(this, ue, cr).call(this);
5393
5393
  }
5394
5394
  [Symbol.dispose]() {
5395
- A(this, ue, or).call(this);
5395
+ A(this, ue, cr).call(this);
5396
5396
  }
5397
5397
  }
5398
- xs = Ci(null), nt = new WeakMap(), ga = new WeakMap(), is = new WeakMap(), En = new WeakMap(), kn = new WeakMap(), ue = new WeakSet(), xl = function(e) {
5398
+ xs = Ri(null), nt = new WeakMap(), ga = new WeakMap(), ss = new WeakMap(), En = new WeakMap(), kn = new WeakMap(), ue = new WeakSet(), xl = function(e) {
5399
5399
  return f(this, null, function* () {
5400
5400
  var t, i;
5401
5401
  a(this, En).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, C.Goaway;
@@ -5408,7 +5408,7 @@ xs = Ci(null), nt = new WeakMap(), ga = new WeakMap(), is = new WeakMap(), En =
5408
5408
  return f(this, null, function* () {
5409
5409
  try {
5410
5410
  try {
5411
- for (var e = $(a(this, is)), t, i, n; t = !(i = yield e.next()).done; t = !1) {
5411
+ for (var e = $(a(this, ss)), t, i, n; t = !(i = yield e.next()).done; t = !1) {
5412
5412
  const o = i.value;
5413
5413
  a(this, En).debug("sending message", o), yield a(this, nt).writeMessage(o);
5414
5414
  }
@@ -5439,7 +5439,7 @@ xs = Ci(null), nt = new WeakMap(), ga = new WeakMap(), is = new WeakMap(), En =
5439
5439
  } catch (e) {
5440
5440
  return e;
5441
5441
  } finally {
5442
- a(this, is).cancel("closing");
5442
+ a(this, ss).cancel("closing");
5443
5443
  }
5444
5444
  });
5445
5445
  }, uo = function() {
@@ -5456,76 +5456,76 @@ xs = Ci(null), nt = new WeakMap(), ga = new WeakMap(), is = new WeakMap(), En =
5456
5456
  return t;
5457
5457
  }
5458
5458
  });
5459
- }, or = function() {
5459
+ }, cr = function() {
5460
5460
  this.close();
5461
- }, co = ye(xs, 17, "#runOutgoingMessages", Ad, ue, co), ho = ye(xs, 17, "#runControl", gd, ue, ho), uo = ye(xs, 17, "#runObjects", pd, ue, uo), or = ye(xs, 17, "#dispose", fd, ue, or), Zt(xs, ou);
5461
+ }, co = ye(xs, 17, "#runOutgoingMessages", Ad, ue, co), ho = ye(xs, 17, "#runControl", gd, ue, ho), uo = ye(xs, 17, "#runObjects", pd, ue, uo), cr = ye(xs, 17, "#dispose", fd, ue, cr), Zt(xs, ou);
5462
5462
  const cA = 128;
5463
- var Qe, Aa, ss, In, wa, be, Mi, Li;
5463
+ var Xe, Aa, ns, In, wa, be, Li, Di;
5464
5464
  class hA {
5465
5465
  constructor(e, t, i) {
5466
5466
  d(this, be);
5467
- d(this, Qe);
5467
+ d(this, Xe);
5468
5468
  d(this, Aa);
5469
- d(this, ss, !0);
5469
+ d(this, ns, !0);
5470
5470
  d(this, In, !1);
5471
5471
  d(this, wa);
5472
- m(this, Qe, e), m(this, Aa, t), m(this, wa, i);
5472
+ m(this, Xe, e), m(this, Aa, t), m(this, wa, i);
5473
5473
  }
5474
5474
  writeUnsigned8(e) {
5475
5475
  return f(this, null, function* () {
5476
- return A(this, be, Mi).call(this), yield A(this, be, Li).call(this), a(this, Qe).writeUnsigned8(e);
5476
+ return A(this, be, Li).call(this), yield A(this, be, Di).call(this), a(this, Xe).writeUnsigned8(e);
5477
5477
  });
5478
5478
  }
5479
5479
  writeVarInt(e) {
5480
5480
  return f(this, null, function* () {
5481
- return A(this, be, Mi).call(this), yield A(this, be, Li).call(this), a(this, Qe).writeVarInt(e);
5481
+ return A(this, be, Li).call(this), yield A(this, be, Di).call(this), a(this, Xe).writeVarInt(e);
5482
5482
  });
5483
5483
  }
5484
5484
  writeBigVarInt(e) {
5485
5485
  return f(this, null, function* () {
5486
- return A(this, be, Mi).call(this), yield A(this, be, Li).call(this), a(this, Qe).writeBigVarInt(e);
5486
+ return A(this, be, Li).call(this), yield A(this, be, Di).call(this), a(this, Xe).writeBigVarInt(e);
5487
5487
  });
5488
5488
  }
5489
5489
  write(e) {
5490
5490
  return f(this, null, function* () {
5491
- return A(this, be, Mi).call(this), yield A(this, be, Li).call(this), a(this, Qe).write(e);
5491
+ return A(this, be, Li).call(this), yield A(this, be, Di).call(this), a(this, Xe).write(e);
5492
5492
  });
5493
5493
  }
5494
5494
  writeString(e) {
5495
5495
  return f(this, null, function* () {
5496
- return A(this, be, Mi).call(this), yield A(this, be, Li).call(this), a(this, Qe).writeString(e);
5496
+ return A(this, be, Li).call(this), yield A(this, be, Di).call(this), a(this, Xe).writeString(e);
5497
5497
  });
5498
5498
  }
5499
5499
  flush() {
5500
5500
  return f(this, null, function* () {
5501
- A(this, be, Mi).call(this), m(this, ss, !0), yield a(this, Qe).flush();
5501
+ A(this, be, Li).call(this), m(this, ns, !0), yield a(this, Xe).flush();
5502
5502
  });
5503
5503
  }
5504
5504
  close() {
5505
5505
  return f(this, null, function* () {
5506
- a(this, In) || (m(this, ss, !0), yield A(this, be, Li).call(this, !1), yield a(this, Qe).flush(), m(this, In, !0), a(this, wa).call(this));
5506
+ a(this, In) || (m(this, ns, !0), yield A(this, be, Di).call(this, !1), yield a(this, Xe).flush(), m(this, In, !0), a(this, wa).call(this));
5507
5507
  });
5508
5508
  }
5509
5509
  }
5510
- Qe = new WeakMap(), Aa = new WeakMap(), ss = new WeakMap(), In = new WeakMap(), wa = new WeakMap(), be = new WeakSet(), Mi = function() {
5510
+ Xe = new WeakMap(), Aa = new WeakMap(), ns = new WeakMap(), In = new WeakMap(), wa = new WeakMap(), be = new WeakSet(), Li = function() {
5511
5511
  if (a(this, In))
5512
5512
  throw new Error("Stream is closed");
5513
- }, Li = function(e = !0) {
5514
- if (a(this, ss))
5515
- return m(this, ss, !1), a(this, Qe).writeUnsigned8(a(this, Aa) | (e ? cA : 0));
5513
+ }, Di = function(e = !0) {
5514
+ if (a(this, ns))
5515
+ return m(this, ns, !1), a(this, Xe).writeUnsigned8(a(this, Aa) | (e ? cA : 0));
5516
5516
  };
5517
- var di, Nt, Cn, ns, Vt, Rn, Bn, rc, Ll;
5517
+ var li, Nt, Cn, rs, Vt, Rn, Bn, rc, Ll;
5518
5518
  class uA {
5519
5519
  constructor(e, t) {
5520
5520
  d(this, rc);
5521
- d(this, di);
5521
+ d(this, li);
5522
5522
  d(this, Nt);
5523
5523
  d(this, Cn);
5524
- d(this, ns);
5524
+ d(this, rs);
5525
5525
  d(this, Vt, /* @__PURE__ */ new Map());
5526
5526
  d(this, Rn, ge.get().createContext("WebSocketConnection"));
5527
5527
  d(this, Bn, new Set(new Array(128).fill(0).map((e, t) => t + 1)));
5528
- m(this, di, e), m(this, Nt, t), m(this, Cn, new ReadableStream(new Sg(e))), a(this, di).addEventListener("close", () => {
5528
+ m(this, li, e), m(this, Nt, t), m(this, Cn, new ReadableStream(new Sg(e))), a(this, li).addEventListener("close", () => {
5529
5529
  a(this, Nt).markPostHandshake(), a(this, Vt).forEach((i) => i.close());
5530
5530
  });
5531
5531
  }
@@ -5534,14 +5534,14 @@ class uA {
5534
5534
  if (!e)
5535
5535
  throw new Error("No stream IDs available");
5536
5536
  return a(this, Bn).delete(e), Promise.resolve(
5537
- new hA(new Mr(a(this, di)), e, () => A(this, rc, Ll).call(this, e))
5537
+ new hA(new Mr(a(this, li)), e, () => A(this, rc, Ll).call(this, e))
5538
5538
  );
5539
5539
  }
5540
5540
  transportType() {
5541
5541
  return "websocket";
5542
5542
  }
5543
5543
  url() {
5544
- return a(this, di).url;
5544
+ return a(this, li).url;
5545
5545
  }
5546
5546
  afterHandshake() {
5547
5547
  return a(this, Nt).postHandshake();
@@ -5550,9 +5550,9 @@ class uA {
5550
5550
  return f(this, null, function* () {
5551
5551
  var e;
5552
5552
  for (; ; ) {
5553
- m(this, ns, a(this, Cn).getReader());
5553
+ m(this, rs, a(this, Cn).getReader());
5554
5554
  try {
5555
- const { value: t, done: i } = yield a(this, ns).read();
5555
+ const { value: t, done: i } = yield a(this, rs).read();
5556
5556
  if (i)
5557
5557
  return;
5558
5558
  const [n, o, c] = t;
@@ -5576,14 +5576,14 @@ class uA {
5576
5576
  return yield tl(new Lo(c, l), o);
5577
5577
  }
5578
5578
  } finally {
5579
- (e = a(this, ns)) == null || e.releaseLock();
5579
+ (e = a(this, rs)) == null || e.releaseLock();
5580
5580
  }
5581
5581
  }
5582
5582
  });
5583
5583
  }
5584
5584
  close() {
5585
5585
  var e;
5586
- return a(this, Nt).cancel().catch(D), a(this, Cn).cancel("closing").catch(D), (e = a(this, ns)) == null || e.cancel("closing").catch(D), a(this, di).close();
5586
+ return a(this, Nt).cancel().catch(D), a(this, Cn).cancel("closing").catch(D), (e = a(this, rs)) == null || e.cancel("closing").catch(D), a(this, li).close();
5587
5587
  }
5588
5588
  closed() {
5589
5589
  return Promise.resolve();
@@ -5599,27 +5599,27 @@ class uA {
5599
5599
  });
5600
5600
  }
5601
5601
  }
5602
- di = new WeakMap(), Nt = new WeakMap(), Cn = new WeakMap(), ns = new WeakMap(), Vt = new WeakMap(), Rn = new WeakMap(), Bn = new WeakMap(), rc = new WeakSet(), /**
5602
+ li = new WeakMap(), Nt = new WeakMap(), Cn = new WeakMap(), rs = new WeakMap(), Vt = new WeakMap(), Rn = new WeakMap(), Bn = new WeakMap(), rc = new WeakSet(), /**
5603
5603
  * Return a stream ID to the pool of available stream IDs
5604
5604
  * @param streamId - The stream ID to return
5605
5605
  */
5606
5606
  Ll = function(e) {
5607
5607
  a(this, Bn).add(e);
5608
5608
  };
5609
- var Gt, jt, li, ba, ya, ac, oc, Dl;
5609
+ var Gt, jt, mi, ba, ya, ac, oc, Dl;
5610
5610
  class dA {
5611
5611
  constructor(e, t, i) {
5612
5612
  d(this, oc);
5613
5613
  d(this, Gt);
5614
5614
  d(this, jt);
5615
- d(this, li, new _c(100));
5615
+ d(this, mi, new _c(100));
5616
5616
  d(this, ba);
5617
5617
  d(this, ya, 0);
5618
5618
  d(this, ac, ge.get().createContext("WebTransportConnection"));
5619
5619
  m(this, ba, i), m(this, Gt, e), m(this, jt, t), A(this, oc, Dl).call(this).catch((n) => {
5620
- a(this, ac).debug("Incoming streams handling ended with error", n), a(this, jt).markPostHandshake(), a(this, li).close();
5620
+ a(this, ac).debug("Incoming streams handling ended with error", n), a(this, jt).markPostHandshake(), a(this, mi).close();
5621
5621
  }), a(this, Gt).closed.then(() => {
5622
- a(this, jt).markPostHandshake(), a(this, li).close();
5622
+ a(this, jt).markPostHandshake(), a(this, mi).close();
5623
5623
  });
5624
5624
  }
5625
5625
  openSendStream() {
@@ -5657,21 +5657,21 @@ class dA {
5657
5657
  }
5658
5658
  objectStream() {
5659
5659
  return f(this, null, function* () {
5660
- return a(this, li).pop();
5660
+ return a(this, mi).pop();
5661
5661
  });
5662
5662
  }
5663
5663
  }
5664
- Gt = new WeakMap(), jt = new WeakMap(), li = new WeakMap(), ba = new WeakMap(), ya = new WeakMap(), ac = new WeakMap(), oc = new WeakSet(), Dl = function() {
5664
+ Gt = new WeakMap(), jt = new WeakMap(), mi = new WeakMap(), ba = new WeakMap(), ya = new WeakMap(), ac = new WeakMap(), oc = new WeakSet(), Dl = function() {
5665
5665
  return f(this, null, function* () {
5666
5666
  const e = a(this, Gt).incomingUnidirectionalStreams.getReader();
5667
5667
  for (; ; ) {
5668
5668
  const { value: t, done: i } = yield e.read();
5669
5669
  if (i) {
5670
- a(this, li).close();
5670
+ a(this, mi).close();
5671
5671
  return;
5672
5672
  }
5673
5673
  const n = new Lo(new Uint8Array(), t);
5674
- yield a(this, li).push(tl(n, a(this, ya))), Ge(this, ya)._++;
5674
+ yield a(this, mi).push(tl(n, a(this, ya))), Ge(this, ya)._++;
5675
5675
  }
5676
5676
  });
5677
5677
  };
@@ -5710,14 +5710,14 @@ function lA(s) {
5710
5710
  function mA(s) {
5711
5711
  return f(this, null, function* () {
5712
5712
  if (self.WebTransport && (s == null ? void 0 : s.preferredTransport) !== "websocket" && s.url.protocol.startsWith("https")) {
5713
- const e = lA(s).catch(() => eh(s)), t = yield Promise.race([e, ki(s.websocketFallbackTimeoutMs)]);
5713
+ const e = lA(s).catch(() => eh(s)), t = yield Promise.race([e, Ii(s.websocketFallbackTimeoutMs)]);
5714
5714
  return t || eh(s);
5715
5715
  }
5716
5716
  return eh(s);
5717
5717
  });
5718
5718
  }
5719
5719
  var Wt;
5720
- class Xt {
5720
+ class Qt {
5721
5721
  constructor() {
5722
5722
  d(this, Wt, {
5723
5723
  name: "",
@@ -5778,7 +5778,7 @@ Un = new WeakMap(), Sa = new WeakMap();
5778
5778
  function fA(s, e) {
5779
5779
  return ["com.vindral.moq", s];
5780
5780
  }
5781
- function Bi(s) {
5781
+ function Ui(s) {
5782
5782
  const e = s[1];
5783
5783
  if (!e)
5784
5784
  throw new Error("namespace must contain a channel ID");
@@ -5791,7 +5791,7 @@ function gA(s) {
5791
5791
  const e = new TextDecoder().decode(s);
5792
5792
  return JSON.parse(e);
5793
5793
  }
5794
- var De, St, rs, Xe, va, cc, Ta, Eh;
5794
+ var De, St, as, Qe, va, cc, Ta, Eh;
5795
5795
  const lu = class lu {
5796
5796
  constructor(e, t) {
5797
5797
  d(this, Ta);
@@ -5799,17 +5799,17 @@ const lu = class lu {
5799
5799
  // The largest group id seen so far - used to switch seamlessly between tracks
5800
5800
  d(this, St);
5801
5801
  // We keep track of the most recent groups to ensure we haven't missed any due to re-ordering before we close subscriptions
5802
- d(this, rs, new ee(100));
5802
+ d(this, as, new ee(100));
5803
5803
  // This contains the unconsumed groups if this track has an absolute range
5804
- d(this, Xe);
5804
+ d(this, Qe);
5805
5805
  d(this, va);
5806
5806
  d(this, cc, (e) => f(this, null, function* () {
5807
5807
  if (!e)
5808
5808
  return a(this, De).close();
5809
- if (a(this, Xe))
5809
+ if (a(this, Qe))
5810
5810
  return;
5811
- const t = a(this, rs).items().reduce((i, n) => i < n ? i : n, e);
5812
- m(this, Xe, A(this, Ta, Eh).call(this, t, e)), a(this, Xe).size === 0 && (yield a(this, De).close());
5811
+ const t = a(this, as).items().reduce((i, n) => i < n ? i : n, e);
5812
+ m(this, Qe, A(this, Ta, Eh).call(this, t, e)), a(this, Qe).size === 0 && (yield a(this, De).close());
5813
5813
  }));
5814
5814
  m(this, De, e), m(this, St, t), e.done().then((i) => f(this, null, function* () {
5815
5815
  var n;
@@ -5834,18 +5834,18 @@ const lu = class lu {
5834
5834
  // The subscription needs renewal if it is still active and aren't finishing up the unconsumed group IDs.
5835
5835
  // If we are just finishing up the unconsumed group IDs we assume we'll finish up before the expiry.
5836
5836
  needsRenewal() {
5837
- return a(this, De).expiryState() === "active" && a(this, Xe) === void 0;
5837
+ return a(this, De).expiryState() === "active" && a(this, Qe) === void 0;
5838
5838
  }
5839
5839
  /** Set the endGroup as the end of group.
5840
5840
  * This lets the subscription end when the endGroup is reached.
5841
5841
  */
5842
5842
  endOfTrack(e) {
5843
- const t = a(this, rs).items().reduce((i, n) => i < n ? i : n, e);
5843
+ const t = a(this, as).items().reduce((i, n) => i < n ? i : n, e);
5844
5844
  return this.update(t, e);
5845
5845
  }
5846
5846
  update(e, t) {
5847
5847
  return f(this, null, function* () {
5848
- return m(this, Xe, A(this, Ta, Eh).call(this, e, t)), a(this, Xe).size === 0 && (yield a(this, De).close()), a(this, De).update(e, t);
5848
+ return m(this, Qe, A(this, Ta, Eh).call(this, e, t)), a(this, Qe).size === 0 && (yield a(this, De).close()), a(this, De).update(e, t);
5849
5849
  });
5850
5850
  }
5851
5851
  unsubscribe() {
@@ -5854,13 +5854,13 @@ const lu = class lu {
5854
5854
  next() {
5855
5855
  return f(this, null, function* () {
5856
5856
  var i;
5857
- if (a(this, Xe) && a(this, Xe).size === 0)
5857
+ if (a(this, Qe) && a(this, Qe).size === 0)
5858
5858
  return { done: !0, value: void 0 };
5859
5859
  const e = yield a(this, va).next();
5860
5860
  if (e.done)
5861
5861
  return e;
5862
5862
  const t = e.value.groupId();
5863
- return (i = a(this, Xe)) == null || i.delete(t), a(this, rs).push(t), a(this, St) || m(this, St, t), m(this, St, a(this, St) < t ? t : a(this, St)), e;
5863
+ return (i = a(this, Qe)) == null || i.delete(t), a(this, as).push(t), a(this, St) || m(this, St, t), m(this, St, a(this, St) < t ? t : a(this, St)), e;
5864
5864
  });
5865
5865
  }
5866
5866
  return() {
@@ -5870,23 +5870,23 @@ const lu = class lu {
5870
5870
  return this;
5871
5871
  }
5872
5872
  };
5873
- De = new WeakMap(), St = new WeakMap(), rs = new WeakMap(), Xe = new WeakMap(), va = new WeakMap(), cc = new WeakMap(), Ta = new WeakSet(), Eh = function(e, t) {
5873
+ De = new WeakMap(), St = new WeakMap(), as = new WeakMap(), Qe = new WeakMap(), va = new WeakMap(), cc = new WeakMap(), Ta = new WeakSet(), Eh = function(e, t) {
5874
5874
  const i = /* @__PURE__ */ new Set();
5875
5875
  for (let n = e; n <= t; n++)
5876
5876
  i == null || i.add(n);
5877
- return a(this, rs).items().forEach((n) => {
5877
+ return a(this, as).items().forEach((n) => {
5878
5878
  i == null || i.delete(n);
5879
5879
  }), i;
5880
5880
  };
5881
5881
  let No = lu;
5882
- var rt, as, zt, vt, Ea, kh, ka;
5882
+ var rt, os, zt, vt, Ea, kh, ka;
5883
5883
  const mu = class mu {
5884
5884
  constructor(e) {
5885
5885
  d(this, Ea);
5886
5886
  // The current active subscription
5887
5887
  d(this, rt);
5888
5888
  // The current group iterator - gets replaced by the next in #groups when it runs out
5889
- d(this, as);
5889
+ d(this, os);
5890
5890
  // The next group iterators to switch to when the current one runs out
5891
5891
  d(this, zt, new _c(10));
5892
5892
  d(this, vt);
@@ -5901,7 +5901,7 @@ const mu = class mu {
5901
5901
  }
5902
5902
  const o = i.value.largestGroupId();
5903
5903
  const c = o !== void 0;
5904
- const h = new Xt().name(t.name).priority(t.priority).groupOrder(t.groupOrder);
5904
+ const h = new Qt().name(t.name).priority(t.priority).groupOrder(t.groupOrder);
5905
5905
  n.largestGroupId = o;
5906
5906
  a(this, vt).debug("Renewing subscription", n);
5907
5907
  switch (t.filterType.type) {
@@ -5932,7 +5932,7 @@ const mu = class mu {
5932
5932
  We(g, b, v);
5933
5933
  }
5934
5934
  }));
5935
- m(this, rt, new Lm(e)), m(this, as, e), m(this, vt, ge.get().createContext(`Renewable '${e.name()}'`));
5935
+ m(this, rt, new Lm(e)), m(this, os, e), m(this, vt, ge.get().createContext(`Renewable '${e.name()}'`));
5936
5936
  }
5937
5937
  static subscribe(e, t, i) {
5938
5938
  return f(this, null, function* () {
@@ -6008,12 +6008,12 @@ const mu = class mu {
6008
6008
  next() {
6009
6009
  return f(this, null, function* () {
6010
6010
  var t, i;
6011
- const e = yield a(this, as).next();
6011
+ const e = yield a(this, os).next();
6012
6012
  if (e.done) {
6013
- yield (i = (t = a(this, as)).return) == null ? void 0 : i.call(t);
6013
+ yield (i = (t = a(this, os)).return) == null ? void 0 : i.call(t);
6014
6014
  const n = yield a(this, zt).pop();
6015
6015
  if (n)
6016
- return m(this, as, n), this.next();
6016
+ return m(this, os, n), this.next();
6017
6017
  }
6018
6018
  return e;
6019
6019
  });
@@ -6029,7 +6029,7 @@ const mu = class mu {
6029
6029
  var t = [];
6030
6030
  try {
6031
6031
  const g = je(t, e, !0);
6032
- yield* Xc(g);
6032
+ yield* Qc(g);
6033
6033
  } catch (i) {
6034
6034
  var n = i, o = !0;
6035
6035
  } finally {
@@ -6050,7 +6050,7 @@ const mu = class mu {
6050
6050
  });
6051
6051
  }
6052
6052
  };
6053
- rt = new WeakMap(), as = new WeakMap(), zt = new WeakMap(), vt = new WeakMap(), Ea = new WeakSet(), kh = function(e) {
6053
+ rt = new WeakMap(), os = new WeakMap(), zt = new WeakMap(), vt = new WeakMap(), Ea = new WeakSet(), kh = function(e) {
6054
6054
  return f(this, null, function* () {
6055
6055
  var t;
6056
6056
  if (e.unsubscribed() || (t = e.range()) != null && t.endGroup) {
@@ -6064,7 +6064,7 @@ rt = new WeakMap(), as = new WeakMap(), zt = new WeakMap(), vt = new WeakMap(),
6064
6064
  return this.return();
6065
6065
  });
6066
6066
  }, ka = new WeakMap();
6067
- let Ii = mu;
6067
+ let Ci = mu;
6068
6068
  const AA = "catalog";
6069
6069
  function zu(s) {
6070
6070
  const e = gA(s.payload);
@@ -6072,33 +6072,33 @@ function zu(s) {
6072
6072
  throw new Error("unexpected catalog type");
6073
6073
  return e;
6074
6074
  }
6075
- var mi, Ia, Ca, Ra, hc, Fl;
6075
+ var fi, Ia, Ca, Ra, hc, Fl;
6076
6076
  const uc = class uc {
6077
6077
  constructor(e, t, i) {
6078
6078
  d(this, hc);
6079
- d(this, mi);
6079
+ d(this, fi);
6080
6080
  d(this, Ia);
6081
6081
  d(this, Ca);
6082
6082
  d(this, Ra);
6083
- m(this, Ia, e), m(this, mi, t), m(this, Ca, i), m(this, Ra, A(this, hc, Fl).call(this)), this.closed().finally(() => a(this, mi).close()).catch(D);
6083
+ m(this, Ia, e), m(this, fi, t), m(this, Ca, i), m(this, Ra, A(this, hc, Fl).call(this)), this.closed().finally(() => a(this, fi).close()).catch(D);
6084
6084
  }
6085
6085
  catalog() {
6086
- return a(this, mi);
6086
+ return a(this, fi);
6087
6087
  }
6088
6088
  closed() {
6089
6089
  return a(this, Ra);
6090
6090
  }
6091
6091
  close() {
6092
6092
  return f(this, null, function* () {
6093
- return a(this, mi).close(), (yield a(this, Ia).promise).unsubscribe();
6093
+ return a(this, fi).close(), (yield a(this, Ia).promise).unsubscribe();
6094
6094
  });
6095
6095
  }
6096
6096
  static start(e, t) {
6097
6097
  return f(this, null, function* () {
6098
6098
  const i = z.fromPromise(
6099
- Ii.subscribe(
6099
+ Ci.subscribe(
6100
6100
  e,
6101
- new Xt().name(t.catalogName || AA).groupOrder("ascending").build()
6101
+ new Qt().name(t.catalogName || AA).groupOrder("ascending").build()
6102
6102
  )
6103
6103
  ), n = z.fromPromise(i.promise.then((u) => u.objects()));
6104
6104
  if (t.catalog)
@@ -6111,7 +6111,7 @@ const uc = class uc {
6111
6111
  });
6112
6112
  }
6113
6113
  };
6114
- mi = new WeakMap(), Ia = new WeakMap(), Ca = new WeakMap(), Ra = new WeakMap(), hc = new WeakSet(), Fl = function() {
6114
+ fi = new WeakMap(), Ia = new WeakMap(), Ca = new WeakMap(), Ra = new WeakMap(), hc = new WeakSet(), Fl = function() {
6115
6115
  return f(this, null, function* () {
6116
6116
  const e = yield a(this, Ca).promise;
6117
6117
  try {
@@ -6120,7 +6120,7 @@ mi = new WeakMap(), Ia = new WeakMap(), Ca = new WeakMap(), Ra = new WeakMap(),
6120
6120
  if (c.objectStatus !== Ee.Normal)
6121
6121
  continue;
6122
6122
  const h = zu(c);
6123
- a(this, mi).update(h);
6123
+ a(this, fi).update(h);
6124
6124
  }
6125
6125
  } catch (n) {
6126
6126
  o = [n];
@@ -6217,18 +6217,18 @@ const js = class js {
6217
6217
  var v;
6218
6218
  if (t.format !== "cmaf")
6219
6219
  throw new Error("format must be cmaf");
6220
- const l = new Xt().name(t.name);
6220
+ const l = new Qt().name(t.name);
6221
6221
  n && l.startGroup(n);
6222
6222
  const p = l.build();
6223
6223
  if (t.initTrack) {
6224
- const k = new Xt().name(t.initTrack).build(), [I, P] = yield Promise.all([
6224
+ const k = new Qt().name(t.initTrack).build(), [I, P] = yield Promise.all([
6225
6225
  A(v = js, dc, _l).call(v, e, k),
6226
- Ii.subscribe(e, p, { params: o, largestGroupId: n ? n - x(1) : void 0 })
6226
+ Ci.subscribe(e, p, { params: o, largestGroupId: n ? n - x(1) : void 0 })
6227
6227
  ]), E = new Fu(I);
6228
6228
  return new js(t, e.namespace(), P, E, i);
6229
6229
  }
6230
6230
  qe(t.initData, "no init data found on track");
6231
- const g = kd(t.initData), w = new Fu(new Uint8Array(g)), b = yield Ii.subscribe(e, p, {
6231
+ const g = kd(t.initData), w = new Fu(new Uint8Array(g)), b = yield Ci.subscribe(e, p, {
6232
6232
  params: o,
6233
6233
  largestGroupId: n ? n - x(1) : void 0
6234
6234
  });
@@ -6301,28 +6301,28 @@ xa = new WeakMap(), Tt = new WeakMap(), Ma = new WeakMap(), La = new WeakMap(),
6301
6301
  }, d(js, dc);
6302
6302
  let Rh = js;
6303
6303
  const Hu = 1e4, bA = 3e4;
6304
- var lc, fi, os, Da, Oa, Fa, Is, Uh, Nl;
6304
+ var lc, pi, cs, Da, Oa, Fa, Cs, Uh, Nl;
6305
6305
  const fu = class fu {
6306
6306
  constructor(e, t, i) {
6307
- d(this, Is);
6307
+ d(this, Cs);
6308
6308
  d(this, lc, ge.get().createContext("Timeline"));
6309
- d(this, fi, new ke([]));
6310
- d(this, os);
6309
+ d(this, pi, new ke([]));
6310
+ d(this, cs);
6311
6311
  d(this, Da);
6312
6312
  d(this, Oa);
6313
6313
  d(this, Fa);
6314
- m(this, Da, e), m(this, Oa, i), m(this, os, t), m(this, Fa, A(this, Is, Uh).call(this, a(this, os))), this.closed().finally(() => a(this, fi).close()).catch(D);
6314
+ m(this, Da, e), m(this, Oa, i), m(this, cs, t), m(this, Fa, A(this, Cs, Uh).call(this, a(this, cs))), this.closed().finally(() => a(this, pi).close()).catch(D);
6315
6315
  }
6316
6316
  closed() {
6317
6317
  return a(this, Fa);
6318
6318
  }
6319
6319
  close() {
6320
6320
  return f(this, null, function* () {
6321
- return (yield a(this, os).promise).unsubscribe();
6321
+ return (yield a(this, cs).promise).unsubscribe();
6322
6322
  });
6323
6323
  }
6324
6324
  timeline() {
6325
- const [e, t] = a(this, fi).value();
6325
+ const [e, t] = a(this, pi).value();
6326
6326
  return e;
6327
6327
  }
6328
6328
  /**
@@ -6334,25 +6334,25 @@ const fu = class fu {
6334
6334
  }
6335
6335
  static start(e, t) {
6336
6336
  const i = z.fromPromise(
6337
- Ii.subscribe(e, new Xt().name(t).groupOrder("ascending").build())
6337
+ Ci.subscribe(e, new Qt().name(t).groupOrder("ascending").build())
6338
6338
  );
6339
6339
  return new fu(e, i, t);
6340
6340
  }
6341
6341
  waitForWallclockTime(e) {
6342
6342
  return f(this, null, function* () {
6343
- return yield a(this, fi).waitFor((t) => !!t.find((i) => i.wallclock >= e)), this.timeline();
6343
+ return yield a(this, pi).waitFor((t) => !!t.find((i) => i.wallclock >= e)), this.timeline();
6344
6344
  });
6345
6345
  }
6346
6346
  waitForTimelineToHaveMinDuration() {
6347
6347
  return f(this, null, function* () {
6348
- return yield a(this, fi).waitFor((e) => {
6348
+ return yield a(this, pi).waitFor((e) => {
6349
6349
  const t = e[0], i = e[e.length - 1];
6350
6350
  return !t || !i ? !1 : i.wallclock - t.wallclock > Hu;
6351
6351
  }), this.timeline();
6352
6352
  });
6353
6353
  }
6354
6354
  };
6355
- lc = new WeakMap(), fi = new WeakMap(), os = new WeakMap(), Da = new WeakMap(), Oa = new WeakMap(), Fa = new WeakMap(), Is = new WeakSet(), Uh = function(e) {
6355
+ lc = new WeakMap(), pi = new WeakMap(), cs = new WeakMap(), Da = new WeakMap(), Oa = new WeakMap(), Fa = new WeakMap(), Cs = new WeakSet(), Uh = function(e) {
6356
6356
  return f(this, null, function* () {
6357
6357
  const t = yield e.promise;
6358
6358
  try {
@@ -6367,12 +6367,12 @@ lc = new WeakMap(), fi = new WeakMap(), os = new WeakMap(), Da = new WeakMap(),
6367
6367
  if (E.objectStatus !== Ee.Normal)
6368
6368
  continue;
6369
6369
  const U = yA(E.payload);
6370
- a(this, fi).update((B) => {
6371
- var X, Q;
6372
- for (B.push(...U), B.sort((_e, ie) => _e.wallclock - ie.wallclock); B[0] && ((Q = (X = B[B.length - 1]) == null ? void 0 : X.wallclock) != null ? Q : 0) - B[0].wallclock > bA; )
6370
+ a(this, pi).update((B) => {
6371
+ var Q, X;
6372
+ for (B.push(...U), B.sort((_e, ie) => _e.wallclock - ie.wallclock); B[0] && ((X = (Q = B[B.length - 1]) == null ? void 0 : Q.wallclock) != null ? X : 0) - B[0].wallclock > bA; )
6373
6373
  B.shift();
6374
6374
  return B;
6375
- }), t === a(this, os).resolved && E.groupId > x(0) && E.objectId == x(0) && A(this, Is, Nl).call(this, E.groupId).catch((B) => {
6375
+ }), t === a(this, cs).resolved && E.groupId > x(0) && E.objectId == x(0) && A(this, Cs, Nl).call(this, E.groupId).catch((B) => {
6376
6376
  a(this, lc).warn("backfill failed", B);
6377
6377
  });
6378
6378
  }
@@ -6410,12 +6410,12 @@ lc = new WeakMap(), fi = new WeakMap(), os = new WeakMap(), Da = new WeakMap(),
6410
6410
  if (!n || !o || o.wallclock - n.wallclock > Hu)
6411
6411
  return;
6412
6412
  const c = z.fromPromise(
6413
- Ii.subscribe(
6413
+ Ci.subscribe(
6414
6414
  a(this, Da),
6415
- new Xt().name(a(this, Oa)).groupOrder("ascending").range(t, t).build()
6415
+ new Qt().name(a(this, Oa)).groupOrder("ascending").range(t, t).build()
6416
6416
  )
6417
6417
  );
6418
- return A(this, Is, Uh).call(this, c);
6418
+ return A(this, Cs, Uh).call(this, c);
6419
6419
  });
6420
6420
  };
6421
6421
  let Bh = fu;
@@ -6439,33 +6439,33 @@ function yA(s) {
6439
6439
  function SA(s) {
6440
6440
  return typeof s.language == "string";
6441
6441
  }
6442
- var mc, _a, pi, Mn;
6442
+ var mc, _a, gi, Mn;
6443
6443
  const pu = class pu {
6444
6444
  constructor(e, t, i, n, o) {
6445
6445
  d(this, mc, new Jd());
6446
6446
  d(this, _a);
6447
- d(this, pi);
6447
+ d(this, gi);
6448
6448
  d(this, Mn, 0);
6449
6449
  r(this, "trackObject");
6450
6450
  r(this, "namespace");
6451
- m(this, pi, e), m(this, _a, t), this.trackObject = i, this.namespace = n, m(this, Mn, o);
6451
+ m(this, gi, e), m(this, _a, t), this.trackObject = i, this.namespace = n, m(this, Mn, o);
6452
6452
  }
6453
6453
  static subscribe(e, t, i) {
6454
6454
  return f(this, null, function* () {
6455
6455
  if (!SA(t))
6456
6456
  throw new Error("track object language is required");
6457
- const n = new Xt().name(t.name).build(), o = yield Ii.subscribe(e, n), c = o.objects();
6457
+ const n = new Qt().name(t.name).build(), o = yield Ci.subscribe(e, n), c = o.objects();
6458
6458
  return new pu(o, c, t, e.namespace(), i);
6459
6459
  });
6460
6460
  }
6461
6461
  largestGroupId() {
6462
- return a(this, pi).largestGroupId();
6462
+ return a(this, gi).largestGroupId();
6463
6463
  }
6464
6464
  update(e, t) {
6465
- return a(this, pi).update(e, t);
6465
+ return a(this, gi).update(e, t);
6466
6466
  }
6467
6467
  unsubscribe() {
6468
- return a(this, pi).unsubscribe();
6468
+ return a(this, gi).unsubscribe();
6469
6469
  }
6470
6470
  next() {
6471
6471
  return f(this, null, function* () {
@@ -6485,7 +6485,7 @@ const pu = class pu {
6485
6485
  }
6486
6486
  return() {
6487
6487
  return f(this, null, function* () {
6488
- return yield a(this, pi).return(), { done: !0, value: void 0 };
6488
+ return yield a(this, gi).return(), { done: !0, value: void 0 };
6489
6489
  });
6490
6490
  }
6491
6491
  [Symbol.asyncIterator]() {
@@ -6498,19 +6498,19 @@ const pu = class pu {
6498
6498
  return this.unsubscribe();
6499
6499
  }
6500
6500
  };
6501
- mc = new WeakMap(), _a = new WeakMap(), pi = new WeakMap(), Mn = new WeakMap();
6501
+ mc = new WeakMap(), _a = new WeakMap(), gi = new WeakMap(), Mn = new WeakMap();
6502
6502
  let Ph = pu;
6503
- var wd, cs, hs, us, gi, ch, Ln, lo;
6503
+ var wd, hs, us, ds, Ai, ch, Ln, lo;
6504
6504
  wd = [Pe({ context: "Channel", enter: "info" })];
6505
6505
  const Ws = class Ws {
6506
6506
  constructor(e, t, i, n, o) {
6507
6507
  d(this, Ln);
6508
6508
  r(this, "namespace");
6509
- d(this, cs);
6510
6509
  d(this, hs);
6511
6510
  d(this, us);
6512
- d(this, gi);
6513
- this.namespace = n, m(this, cs, e), m(this, hs, t), m(this, us, i), m(this, gi, o);
6511
+ d(this, ds);
6512
+ d(this, Ai);
6513
+ this.namespace = n, m(this, hs, e), m(this, us, t), m(this, ds, i), m(this, Ai, o);
6514
6514
  }
6515
6515
  static start(e, t) {
6516
6516
  return f(this, null, function* () {
@@ -6522,56 +6522,56 @@ const Ws = class Ws {
6522
6522
  });
6523
6523
  }
6524
6524
  closed() {
6525
- return a(this, us).closed();
6525
+ return a(this, ds).closed();
6526
6526
  }
6527
6527
  catalog() {
6528
- return a(this, us).catalog();
6528
+ return a(this, ds).catalog();
6529
6529
  }
6530
6530
  timestampWallclockOffset() {
6531
- return a(this, hs).timestampWallclockOffset();
6531
+ return a(this, us).timestampWallclockOffset();
6532
6532
  }
6533
6533
  timestampOffsetMs() {
6534
- return a(this, gi);
6534
+ return a(this, Ai);
6535
6535
  }
6536
6536
  setTimestampOffsetMs(e) {
6537
- m(this, gi, e);
6537
+ m(this, Ai, e);
6538
6538
  }
6539
6539
  waitForWallclockTime(e) {
6540
- return a(this, hs).waitForWallclockTime(e);
6540
+ return a(this, us).waitForWallclockTime(e);
6541
6541
  }
6542
6542
  subscribeCmafTrack(e, t) {
6543
6543
  const i = t == null ? void 0 : t.startGroup, n = t == null ? void 0 : t.params, o = this.catalog().current().tracks, c = e["com.vindral.variant_uid"] !== void 0 ? o.find((h) => h["com.vindral.variant_uid"] === e["com.vindral.variant_uid"]) : void 0;
6544
- return A(this, Ln, lo).call(this, () => Rh.subscribe(a(this, cs), c != null ? c : e, {
6545
- timestampOffsetMs: a(this, gi),
6544
+ return A(this, Ln, lo).call(this, () => Rh.subscribe(a(this, hs), c != null ? c : e, {
6545
+ timestampOffsetMs: a(this, Ai),
6546
6546
  startGroup: i,
6547
6547
  params: n
6548
6548
  }));
6549
6549
  }
6550
6550
  subscribeWebVttTrack(e) {
6551
- return A(this, Ln, lo).call(this, () => Ph.subscribe(a(this, cs), e, a(this, gi)));
6551
+ return A(this, Ln, lo).call(this, () => Ph.subscribe(a(this, hs), e, a(this, Ai)));
6552
6552
  }
6553
6553
  subscribeTrack(e) {
6554
- return A(this, Ln, lo).call(this, () => a(this, cs).subscribe(e));
6554
+ return A(this, Ln, lo).call(this, () => a(this, hs).subscribe(e));
6555
6555
  }
6556
6556
  /**
6557
6557
  * Closes the channel subscriptions
6558
6558
  */
6559
6559
  close() {
6560
- return Promise.all([a(this, us).close(), a(this, hs).close()]);
6560
+ return Promise.all([a(this, ds).close(), a(this, us).close()]);
6561
6561
  }
6562
6562
  };
6563
- ch = Ci(null), cs = new WeakMap(), hs = new WeakMap(), us = new WeakMap(), gi = new WeakMap(), Ln = new WeakSet(), lo = function(e) {
6563
+ ch = Ri(null), hs = new WeakMap(), us = new WeakMap(), ds = new WeakMap(), Ai = new WeakMap(), Ln = new WeakSet(), lo = function(e) {
6564
6564
  return f(this, null, function* () {
6565
6565
  const [t, i] = this.catalog().value();
6566
6566
  try {
6567
6567
  return yield e();
6568
6568
  } catch (n) {
6569
- if (t === this.catalog().current() && i && (yield Promise.race([i, ki(500)])), t !== this.catalog().current())
6569
+ if (t === this.catalog().current() && i && (yield Promise.race([i, Ii(500)])), t !== this.catalog().current())
6570
6570
  return e();
6571
6571
  throw n;
6572
6572
  }
6573
6573
  });
6574
- }, ye(ch, 9, "start", wd, Ws), Zt(ch, Ws), Ri(ch, 3, Ws);
6574
+ }, ye(ch, 9, "start", wd, Ws), Zt(ch, Ws), Bi(ch, 3, Ws);
6575
6575
  let Vo = Ws;
6576
6576
  const vA = x(8);
6577
6577
  function TA(s) {
@@ -6580,14 +6580,14 @@ function TA(s) {
6580
6580
  const e = new Uint8Array([s >> 8 & 255, s & 255]);
6581
6581
  return { type: vA, payload: e };
6582
6582
  }
6583
- var ds, Na, fc, Vl;
6583
+ var ls, Na, fc, Vl;
6584
6584
  const gu = class gu {
6585
6585
  constructor(e) {
6586
6586
  d(this, fc);
6587
- d(this, ds);
6587
+ d(this, ls);
6588
6588
  d(this, Na);
6589
6589
  const [t, i] = e.value.value();
6590
- m(this, ds, {
6590
+ m(this, ls, {
6591
6591
  createdAt: /* @__PURE__ */ new Date(),
6592
6592
  wallclock: new Date(t.ntpTimestamp),
6593
6593
  rtt: t.rtt
@@ -6597,8 +6597,8 @@ const gu = class gu {
6597
6597
  * @returns returns the current wallclock time in milliseconds based on the ntp timestamp of the stats track + the elapsed time since the last stats track.
6598
6598
  */
6599
6599
  wallclock() {
6600
- const t = Date.now() - a(this, ds).createdAt.getTime();
6601
- return a(this, ds).wallclock.getTime() + t;
6600
+ const t = Date.now() - a(this, ls).createdAt.getTime();
6601
+ return a(this, ls).wallclock.getTime() + t;
6602
6602
  }
6603
6603
  closed() {
6604
6604
  return a(this, Na);
@@ -6607,12 +6607,12 @@ const gu = class gu {
6607
6607
  return new gu(e);
6608
6608
  }
6609
6609
  };
6610
- ds = new WeakMap(), Na = new WeakMap(), fc = new WeakSet(), Vl = function(e) {
6610
+ ls = new WeakMap(), Na = new WeakMap(), fc = new WeakSet(), Vl = function(e) {
6611
6611
  return f(this, null, function* () {
6612
6612
  try {
6613
6613
  for (var t = $(e.value), i, n, o; i = !(n = yield t.next()).done; i = !1) {
6614
6614
  const c = n.value;
6615
- m(this, ds, {
6615
+ m(this, ls, {
6616
6616
  createdAt: /* @__PURE__ */ new Date(),
6617
6617
  wallclock: new Date(c.ntpTimestamp),
6618
6618
  rtt: c.rtt
@@ -6662,7 +6662,7 @@ class cu {
6662
6662
  return f(this, null, function* () {
6663
6663
  var u = [];
6664
6664
  try {
6665
- const n = je(u, yield e.subscribeTrack(new Xt().name("drm").build()), !0);
6665
+ const n = je(u, yield e.subscribeTrack(new Qt().name("drm").build()), !0);
6666
6666
  const o = n.objects();
6667
6667
  const c = yield o.next();
6668
6668
  if (c.done)
@@ -6681,7 +6681,7 @@ class cu {
6681
6681
  function CA(s) {
6682
6682
  return "rtt" in s && typeof s.rtt == "number" && "ntpTimestamp" in s && typeof s.ntpTimestamp == "number" && "estimatedBandwidth" in s && typeof s.estimatedBandwidth == "number";
6683
6683
  }
6684
- function Qu(s) {
6684
+ function Xu(s) {
6685
6685
  const e = new TextDecoder().decode(s), t = JSON.parse(e);
6686
6686
  if (!CA(t))
6687
6687
  throw new Error("Invalid stats object");
@@ -6714,10 +6714,10 @@ const Au = class Au {
6714
6714
  }
6715
6715
  static start(e) {
6716
6716
  return f(this, null, function* () {
6717
- const i = (yield e.subscribe(new Xt().name("stats").groupOrder("ascending").build())).objects(), n = yield i.next();
6717
+ const i = (yield e.subscribe(new Qt().name("stats").groupOrder("ascending").build())).objects(), n = yield i.next();
6718
6718
  if (n.done)
6719
6719
  throw new Error("No stats object received");
6720
- const o = Qu(n.value.payload);
6720
+ const o = Xu(n.value.payload);
6721
6721
  if (!o.ip)
6722
6722
  throw new Error("Expected IP in initial stats object");
6723
6723
  return new Au(i, o, o.ip);
@@ -6731,7 +6731,7 @@ Va = new WeakMap(), pc = new WeakSet(), Gl = function(e) {
6731
6731
  const c = n.value;
6732
6732
  if (c.objectStatus !== Ee.Normal)
6733
6733
  continue;
6734
- const h = Qu(c.payload);
6734
+ const h = Xu(c.payload);
6735
6735
  this.value.update(h);
6736
6736
  }
6737
6737
  } catch (n) {
@@ -6798,7 +6798,7 @@ class th {
6798
6798
  name: c.trackObject.name,
6799
6799
  namespace: c.namespace
6800
6800
  };
6801
- a(this, On).debug("track start", S({ mediaType: e }, h)), yield* Xc(c), a(this, On).debug("track end", S({ mediaType: e }, h));
6801
+ a(this, On).debug("track start", S({ mediaType: e }, h)), yield* Qc(c), a(this, On).debug("track end", S({ mediaType: e }, h));
6802
6802
  }
6803
6803
  } catch (n) {
6804
6804
  o = [n];
@@ -6815,25 +6815,25 @@ class th {
6815
6815
  }
6816
6816
  }
6817
6817
  On = new WeakMap(), Ga = new WeakMap(), ja = new WeakMap();
6818
- var bd, yd, Sd, Fn, _n, ls, fe, at, ot, Ai, Nn, Wa, sr, Ie, mo, cr, jl, Dh;
6818
+ var bd, yd, Sd, Fn, _n, ms, fe, at, ot, wi, Nn, Wa, nr, Ie, mo, hr, jl, Dh;
6819
6819
  Sd = [Pe({ context: "Player", enter: "info" })], yd = [Pe({ context: "Player", enter: "info", return: "info" })], bd = [Pe({ context: "Player", enter: "info" })];
6820
6820
  const zs = class zs {
6821
6821
  constructor(e, t, i) {
6822
- Ri(sr, 5, this);
6822
+ Bi(nr, 5, this);
6823
6823
  d(this, Ie);
6824
6824
  d(this, Fn);
6825
6825
  d(this, _n);
6826
- d(this, ls);
6826
+ d(this, ms);
6827
6827
  d(this, fe);
6828
6828
  d(this, at, new ke(void 0));
6829
6829
  d(this, ot, new ke(void 0));
6830
- d(this, Ai, new ke(void 0));
6830
+ d(this, wi, new ke(void 0));
6831
6831
  d(this, Nn);
6832
6832
  d(this, Wa);
6833
- r(this, "subtitles", new th(a(this, Ai), "subtitles"));
6833
+ r(this, "subtitles", new th(a(this, wi), "subtitles"));
6834
6834
  r(this, "video", new th(a(this, ot), "video"));
6835
6835
  r(this, "audio", new th(a(this, at), "audio"));
6836
- m(this, Fn, e), m(this, _n, xh.start(i)), m(this, ls, i), m(this, fe, new ke(t)), m(this, Nn, new BA(t)), m(this, Wa, Promise.race([i.idleTimeout(), A(this, Ie, jl).call(this), a(this, Nn).closed()])), a(this, Fn).closed().then(() => this.close()).catch(D);
6836
+ m(this, Fn, e), m(this, _n, xh.start(i)), m(this, ms, i), m(this, fe, new ke(t)), m(this, Nn, new BA(t)), m(this, Wa, Promise.race([i.idleTimeout(), A(this, Ie, jl).call(this), a(this, Nn).closed()])), a(this, Fn).closed().then(() => this.close()).catch(D);
6837
6837
  }
6838
6838
  closed() {
6839
6839
  return a(this, Wa);
@@ -6857,15 +6857,15 @@ const zs = class zs {
6857
6857
  });
6858
6858
  }
6859
6859
  connectionInfo() {
6860
- const e = a(this, ls).value.current();
6860
+ const e = a(this, ms).value.current();
6861
6861
  return {
6862
- ip: a(this, ls).ip,
6862
+ ip: a(this, ms).ip,
6863
6863
  rtt: e.rtt,
6864
6864
  estimatedBandwidth: e.estimatedBandwidth
6865
6865
  };
6866
6866
  }
6867
6867
  stats() {
6868
- return a(this, ls).value;
6868
+ return a(this, ms).value;
6869
6869
  }
6870
6870
  catalog() {
6871
6871
  return a(this, fe).current().catalog();
@@ -6900,7 +6900,7 @@ const zs = class zs {
6900
6900
  // Close the consumers so that the iterators will stop
6901
6901
  A(this, Ie, mo).call(this, a(this, at)),
6902
6902
  A(this, Ie, mo).call(this, a(this, ot)),
6903
- A(this, Ie, mo).call(this, a(this, Ai))
6903
+ A(this, Ie, mo).call(this, a(this, wi))
6904
6904
  ]);
6905
6905
  }
6906
6906
  zap(e, t) {
@@ -6921,33 +6921,33 @@ const zs = class zs {
6921
6921
  return f(this, null, function* () {
6922
6922
  var i, n;
6923
6923
  if (!e) {
6924
- yield (i = a(this, Ai).current()) == null ? void 0 : i.unsubscribe();
6924
+ yield (i = a(this, wi).current()) == null ? void 0 : i.unsubscribe();
6925
6925
  return;
6926
6926
  }
6927
6927
  const [t] = yield Promise.all([
6928
6928
  a(this, fe).current().subscribeWebVttTrack(e),
6929
- (n = a(this, Ai).current()) == null ? void 0 : n.unsubscribe()
6929
+ (n = a(this, wi).current()) == null ? void 0 : n.unsubscribe()
6930
6930
  ]);
6931
- a(this, Ai).update(t);
6931
+ a(this, wi).update(t);
6932
6932
  });
6933
6933
  }
6934
6934
  setVideoTrack(e, t) {
6935
6935
  return f(this, null, function* () {
6936
- const i = yield A(this, Ie, cr).call(this, a(this, fe).current(), e, a(this, ot).current(), t);
6936
+ const i = yield A(this, Ie, hr).call(this, a(this, fe).current(), e, a(this, ot).current(), t);
6937
6937
  a(this, ot).update(i);
6938
6938
  });
6939
6939
  }
6940
6940
  setAudioTrack(e, t) {
6941
6941
  return f(this, null, function* () {
6942
- const i = yield A(this, Ie, cr).call(this, a(this, fe).current(), e, a(this, at).current(), t);
6942
+ const i = yield A(this, Ie, hr).call(this, a(this, fe).current(), e, a(this, at).current(), t);
6943
6943
  a(this, at).update(i);
6944
6944
  });
6945
6945
  }
6946
6946
  };
6947
- sr = Ci(null), Fn = new WeakMap(), _n = new WeakMap(), ls = new WeakMap(), fe = new WeakMap(), at = new WeakMap(), ot = new WeakMap(), Ai = new WeakMap(), Nn = new WeakMap(), Wa = new WeakMap(), Ie = new WeakSet(), mo = function(e) {
6947
+ nr = Ri(null), Fn = new WeakMap(), _n = new WeakMap(), ms = new WeakMap(), fe = new WeakMap(), at = new WeakMap(), ot = new WeakMap(), wi = new WeakMap(), Nn = new WeakMap(), Wa = new WeakMap(), Ie = new WeakSet(), mo = function(e) {
6948
6948
  const t = e.current(), i = t == null ? void 0 : t.largestGroupId();
6949
6949
  return e.isClosed() || e.update(void 0), e.close(), i ? t == null ? void 0 : t.update(i, i) : t == null ? void 0 : t.unsubscribe();
6950
- }, cr = function(e, t, i, n) {
6950
+ }, hr = function(e, t, i, n) {
6951
6951
  return f(this, null, function* () {
6952
6952
  const o = i == null ? void 0 : i.largestGroupId(), [c, h] = yield Promise.all([
6953
6953
  e.subscribeCmafTrack(t, {
@@ -7006,23 +7006,23 @@ sr = Ci(null), Fn = new WeakMap(), _n = new WeakMap(), ls = new WeakMap(), fe =
7006
7006
  t.update(yield a(this, fe).current().subscribeCmafTrack(h));
7007
7007
  }
7008
7008
  });
7009
- }, ye(sr, 1, "close", Sd, zs), ye(sr, 1, "zap", yd, zs), cr = ye(sr, 17, "#replaceTrack", bd, Ie, cr), Zt(sr, zs);
7009
+ }, ye(nr, 1, "close", Sd, zs), ye(nr, 1, "zap", yd, zs), hr = ye(nr, 17, "#replaceTrack", bd, Ie, hr), Zt(nr, zs);
7010
7010
  let Lh = zs;
7011
7011
  function ih(s, e, t) {
7012
7012
  const i = new URL("/voq/subscribe", s);
7013
7013
  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;
7014
7014
  }
7015
7015
  const UA = 1e4;
7016
- var me, ve, Oe, ms, K, wi, za, Vn, Ha, Gn, Ce, Wl, jn, Qa, Wn, zl, Hl, Ql, Xl, Fh;
7016
+ var me, ve, Oe, fs, K, bi, za, Vn, Ha, Gn, Ce, Wl, jn, Xa, Wn, zl, Hl, Xl, Ql, Fh;
7017
7017
  const wu = class wu {
7018
7018
  constructor(e, t, i, n, o, c, h) {
7019
7019
  d(this, Ce);
7020
7020
  d(this, me);
7021
7021
  d(this, ve);
7022
7022
  d(this, Oe);
7023
- d(this, ms, "disconnected");
7023
+ d(this, fs, "disconnected");
7024
7024
  d(this, K);
7025
- d(this, wi, /* @__PURE__ */ new Map());
7025
+ d(this, bi, /* @__PURE__ */ new Map());
7026
7026
  d(this, za);
7027
7027
  d(this, Vn);
7028
7028
  d(this, Ha);
@@ -7032,10 +7032,10 @@ const wu = class wu {
7032
7032
  a(this, K).setSubtitleTrack(void 0).catch(D);
7033
7033
  return;
7034
7034
  }
7035
- const t = a(this, wi).get(Bi(a(this, K).namespace())), i = t == null ? void 0 : t.getTextTrack(e);
7035
+ const t = a(this, bi).get(Ui(a(this, K).namespace())), i = t == null ? void 0 : t.getTextTrack(e);
7036
7036
  i && a(this, K).setSubtitleTrack(i).catch(D);
7037
7037
  });
7038
- d(this, Qa, (e) => {
7038
+ d(this, Xa, (e) => {
7039
7039
  switch (e.type) {
7040
7040
  case "subscribe":
7041
7041
  {
@@ -7065,15 +7065,15 @@ const wu = class wu {
7065
7065
  });
7066
7066
  d(this, Wn, !1);
7067
7067
  r(this, "disconnect", (e = "Disconnect Requested") => {
7068
- a(this, ve).info("Disconnecting", e), a(this, Oe).close(), a(this, K).close().catch(D), m(this, Gn, /* @__PURE__ */ new Map()), m(this, ms, "disconnected");
7068
+ a(this, ve).info("Disconnecting", e), a(this, Oe).close(), a(this, K).close().catch(D), m(this, Gn, /* @__PURE__ */ new Map()), m(this, fs, "disconnected");
7069
7069
  });
7070
- m(this, me, e), m(this, ve, t), m(this, Oe, i), m(this, K, n), m(this, wi, o), m(this, za, c), m(this, Vn, h), a(this, me).on("send signal", a(this, Qa)), a(this, me).on("disconnect", this.disconnect), a(this, me).on("text track", a(this, jn)), A(this, Ce, Wl).call(this).catch(D), A(this, Ce, Ql).call(this).catch(D);
7070
+ m(this, me, e), m(this, ve, t), m(this, Oe, i), m(this, K, n), m(this, bi, o), m(this, za, c), m(this, Vn, h), a(this, me).on("send signal", a(this, Xa)), a(this, me).on("disconnect", this.disconnect), a(this, me).on("text track", a(this, jn)), A(this, Ce, Wl).call(this).catch(D), A(this, Ce, Xl).call(this).catch(D);
7071
7071
  }
7072
7072
  get estimatedBandwidth() {
7073
7073
  return a(this, Ha);
7074
7074
  }
7075
7075
  unload() {
7076
- a(this, me).off("send signal", a(this, Qa)), a(this, me).off("disconnect", this.disconnect), a(this, me).off("text track", a(this, jn)), this.disconnect();
7076
+ a(this, me).off("send signal", a(this, Xa)), a(this, me).off("disconnect", this.disconnect), a(this, me).off("text track", a(this, jn)), this.disconnect();
7077
7077
  }
7078
7078
  suspend() {
7079
7079
  }
@@ -7088,18 +7088,18 @@ const wu = class wu {
7088
7088
  }
7089
7089
  static start(e, t, i, n, o) {
7090
7090
  return f(this, null, function* () {
7091
- var E, U, B, X;
7091
+ var E, U, B, Q;
7092
7092
  const c = new Map(
7093
- n.connectInfo.channels.map((Q) => [
7094
- Bi(Q.catalog.namespace),
7095
- new sh(new ke(Q.catalog))
7093
+ n.connectInfo.channels.map((X) => [
7094
+ Ui(X.catalog.namespace),
7095
+ new sh(new ke(X.catalog))
7096
7096
  ])
7097
7097
  ), h = yield n.onConnectInfo(n.connectInfo), u = n.options.get("authenticationToken");
7098
7098
  let l, p;
7099
7099
  typeof n.edgeUrl === "string" ? l = ih(n.edgeUrl, h, u) : (l = ih(n.edgeUrl.moqUrl || n.edgeUrl.moqWsUrl, h, u), p = ih(n.edgeUrl.moqWsUrl, h, u));
7100
- const g = (E = n.connectInfo.channels.find((Q) => Q.channelId === h.channelId)) == null ? void 0 : E.catalog;
7100
+ const g = (E = n.connectInfo.channels.find((X) => X.channelId === h.channelId)) == null ? void 0 : E.catalog;
7101
7101
  t.debug("Resolved edge url", { edgeUrl: l, edgeWsUrl: p }), qe(g, "no catalog found");
7102
- const w = (U = c.get(Bi(g.namespace))) == null ? void 0 : U.getVideoTrack(h.video), b = (B = c.get(Bi(g.namespace))) == null ? void 0 : B.getAudioTrack(h.audio), v = yield mA({
7102
+ const w = (U = c.get(Ui(g.namespace))) == null ? void 0 : U.getVideoTrack(h.video), b = (B = c.get(Ui(g.namespace))) == null ? void 0 : B.getAudioTrack(h.audio), v = yield mA({
7103
7103
  url: l,
7104
7104
  wsUrl: p,
7105
7105
  authToken: n.options.get("authenticationToken"),
@@ -7117,20 +7117,20 @@ const wu = class wu {
7117
7117
  ru(UA, new Error("Timeout waiting for player to start")),
7118
7118
  Dm(v.closed(), "Session closed before player started")
7119
7119
  ]), I = new sh(k.catalog());
7120
- c.set(Bi(g.namespace), I), e.emit("received signal", {
7120
+ c.set(Ui(g.namespace), I), e.emit("received signal", {
7121
7121
  type: "client ip",
7122
7122
  ip: k.connectionInfo().ip
7123
- }), k.drm().then((Q) => {
7124
- Q && e.emit("received drm data", Q.value);
7125
- }).catch((Q) => {
7126
- t.error("Error getting DRM data", Q);
7123
+ }), k.drm().then((X) => {
7124
+ X && e.emit("received drm data", X.value);
7125
+ }).catch((X) => {
7126
+ t.error("Error getting DRM data", X);
7127
7127
  });
7128
7128
  const P = new wu(e, t, v, k, c, i, o);
7129
- return h.textTrack && a(X = P, jn).call(X, h.textTrack), P;
7129
+ return h.textTrack && a(Q = P, jn).call(Q, h.textTrack), P;
7130
7130
  });
7131
7131
  }
7132
7132
  getState() {
7133
- return a(this, ms);
7133
+ return a(this, fs);
7134
7134
  }
7135
7135
  close() {
7136
7136
  a(this, Oe).close();
@@ -7139,9 +7139,9 @@ const wu = class wu {
7139
7139
  return Promise.race([a(this, Oe).closed(), a(this, K).closed()]);
7140
7140
  }
7141
7141
  };
7142
- me = new WeakMap(), ve = new WeakMap(), Oe = new WeakMap(), ms = new WeakMap(), K = new WeakMap(), wi = new WeakMap(), za = new WeakMap(), Vn = new WeakMap(), Ha = new WeakMap(), Gn = new WeakMap(), Ce = new WeakSet(), Wl = function() {
7142
+ me = new WeakMap(), ve = new WeakMap(), Oe = new WeakMap(), fs = new WeakMap(), K = new WeakMap(), bi = new WeakMap(), za = new WeakMap(), Vn = new WeakMap(), Ha = new WeakMap(), Gn = new WeakMap(), Ce = new WeakSet(), Wl = function() {
7143
7143
  return f(this, null, function* () {
7144
- a(this, Oe).transportType() === "websocket" && (yield ki(5e3));
7144
+ a(this, Oe).transportType() === "websocket" && (yield Ii(5e3));
7145
7145
  try {
7146
7146
  for (var e = $(a(this, K).stats()), t, i, n; t = !(i = yield e.next()).done; t = !1) {
7147
7147
  const { rtt: o, estimatedBandwidth: c } = i.value;
@@ -7158,7 +7158,7 @@ me = new WeakMap(), ve = new WeakMap(), Oe = new WeakMap(), ms = new WeakMap(),
7158
7158
  }
7159
7159
  }
7160
7160
  });
7161
- }, jn = new WeakMap(), Qa = new WeakMap(), Wn = new WeakMap(), zl = function(e) {
7161
+ }, jn = new WeakMap(), Xa = new WeakMap(), Wn = new WeakMap(), zl = function(e) {
7162
7162
  return f(this, null, function* () {
7163
7163
  var n;
7164
7164
  const t = yield a(this, za).connect({ channelId: e });
@@ -7174,8 +7174,8 @@ me = new WeakMap(), ve = new WeakMap(), Oe = new WeakMap(), ms = new WeakMap(),
7174
7174
  var c, h, u;
7175
7175
  a(this, ve).info("handle subscription", e);
7176
7176
  const t = a(this, K);
7177
- let i = a(this, wi).get(e.channelId);
7178
- if (i || (i = new sh(new ke(yield A(this, Ce, zl).call(this, e.channelId))), a(this, wi).set(e.channelId, i)), t.namespace().join("/") !== i.namespace().join("/")) {
7177
+ let i = a(this, bi).get(e.channelId);
7178
+ if (i || (i = new sh(new ke(yield A(this, Ce, zl).call(this, e.channelId))), a(this, bi).set(e.channelId, i)), t.namespace().join("/") !== i.namespace().join("/")) {
7179
7179
  a(this, ve).info("changing channel", e.channelId);
7180
7180
  const l = i.getVideoTrack(e.video), p = i.getAudioTrack(e.audio);
7181
7181
  yield t.zap(
@@ -7190,7 +7190,7 @@ me = new WeakMap(), ve = new WeakMap(), Oe = new WeakMap(), ms = new WeakMap(),
7190
7190
  g && a(this, me).emit("received drm data", g.value);
7191
7191
  }).catch((g) => {
7192
7192
  a(this, ve).error("Error getting DRM data", g);
7193
- }), a(this, ve).info("switched channel", e.channelId), (c = a(this, wi).get(Bi(t.namespace()))) == null || c.updateCatalog(t.catalog()), a(this, me).emit("received signal", {
7193
+ }), a(this, ve).info("switched channel", e.channelId), (c = a(this, bi).get(Ui(t.namespace()))) == null || c.updateCatalog(t.catalog()), a(this, me).emit("received signal", {
7194
7194
  type: "subscription changed",
7195
7195
  subscription: e
7196
7196
  });
@@ -7205,19 +7205,19 @@ me = new WeakMap(), ve = new WeakMap(), Oe = new WeakMap(), ms = new WeakMap(),
7205
7205
  subscription: e
7206
7206
  });
7207
7207
  });
7208
- }, Ql = function() {
7208
+ }, Xl = function() {
7209
7209
  return f(this, null, function* () {
7210
7210
  try {
7211
- m(this, ms, "connecting"), a(this, ve).info("Connecting..."), m(this, ms, "connected"), yield Promise.all([
7211
+ m(this, fs, "connecting"), a(this, ve).info("Connecting..."), m(this, fs, "connected"), yield Promise.all([
7212
7212
  A(this, Ce, Fh).call(this, a(this, K).referenceClock(), a(this, K).audio),
7213
7213
  A(this, Ce, Fh).call(this, a(this, K).referenceClock(), a(this, K).video),
7214
- A(this, Ce, Xl).call(this, a(this, K).subtitles)
7214
+ A(this, Ce, Ql).call(this, a(this, K).subtitles)
7215
7215
  ]), yield a(this, K).closed(), a(this, Oe).close(), a(this, ve).info("Session closed");
7216
7216
  } catch (e) {
7217
7217
  a(this, ve).warn("Session error", e);
7218
7218
  }
7219
7219
  });
7220
- }, Xl = function(e) {
7220
+ }, Ql = function(e) {
7221
7221
  return f(this, null, function* () {
7222
7222
  try {
7223
7223
  for (var t = $(e), i, n, o; i = !(n = yield t.next()).done; i = !1) {
@@ -7243,16 +7243,16 @@ me = new WeakMap(), ve = new WeakMap(), Oe = new WeakMap(), ms = new WeakMap(),
7243
7243
  try {
7244
7244
  for (var w = $(t), b, v, k; b = !(v = yield w.next()).done; b = !1) {
7245
7245
  const I = v.value;
7246
- const P = Bi(I.track.namespace), E = I.track.trackObject.language, U = mm((h = I.track.trackObject.codec) != null ? h : ""), B = I.track.trackObject.codec, X = U ? ei({ codec: U, codecString: B }) : void 0, Q = !!I.track.trackObject["com.vindral.drm"];
7246
+ const P = Ui(I.track.namespace), E = I.track.trackObject.language, U = mm((h = I.track.trackObject.codec) != null ? h : ""), B = I.track.trackObject.codec, Q = U ? ti({ codec: U, codecString: B }) : void 0, X = !!I.track.trackObject["com.vindral.drm"];
7247
7247
  try {
7248
7248
  for (var u = $(I), l, p, g; l = !(p = yield u.next()).done; l = !1) {
7249
7249
  const [_e, ie] = p.value;
7250
7250
  const ut = {
7251
7251
  channelId: i !== "" && (c || ie.mediaType() === "video") && i !== P ? P : void 0,
7252
7252
  language: ie.mediaType() === "audio" && n !== E ? E : void 0,
7253
- drmTransition: o !== void 0 && o !== Q
7253
+ drmTransition: o !== void 0 && o !== X
7254
7254
  };
7255
- i = P, n = E, o = Q;
7255
+ i = P, n = E, o = X;
7256
7256
  const Re = ie.producerReferenceTime(), y = a(this, Gn).get(I.track.namespace) || 0;
7257
7257
  if (Re && Date.now() - y > 1e3) {
7258
7258
  a(this, Gn).set(I.track.namespace, Date.now());
@@ -7277,7 +7277,7 @@ me = new WeakMap(), ve = new WeakMap(), Oe = new WeakMap(), ms = new WeakMap(),
7277
7277
  payload: ie,
7278
7278
  channelId: P,
7279
7279
  groupId: _e,
7280
- mimeType: X,
7280
+ mimeType: Q,
7281
7281
  codec: U,
7282
7282
  switchInfo: ut,
7283
7283
  // FIXME: We should replace this with something better than hashing the track name
@@ -7314,13 +7314,13 @@ function PA(s) {
7314
7314
  0
7315
7315
  );
7316
7316
  }
7317
- var Ht, fs, Ac, ql;
7317
+ var Ht, ps, Ac, ql;
7318
7318
  class sh {
7319
7319
  constructor(e) {
7320
7320
  d(this, Ac);
7321
7321
  d(this, Ht);
7322
- d(this, fs);
7323
- m(this, Ht, e), m(this, fs, A(this, Ac, ql).call(this));
7322
+ d(this, ps);
7323
+ m(this, Ht, e), m(this, ps, A(this, Ac, ql).call(this));
7324
7324
  }
7325
7325
  catalog() {
7326
7326
  return a(this, Ht).current();
@@ -7337,20 +7337,20 @@ class sh {
7337
7337
  getAudioTrack(e) {
7338
7338
  if (!e.codec)
7339
7339
  return;
7340
- const t = a(this, fs).filter((i) => !(!Ss(i) || i.bitRate > e.bitRate || e.codec && i.codec !== e.codec || e.language && i.language !== e.language));
7340
+ const t = a(this, ps).filter((i) => !(!vs(i) || i.bitRate > e.bitRate || e.codec && i.codec !== e.codec || e.language && i.language !== e.language));
7341
7341
  return t[t.length - 1];
7342
7342
  }
7343
7343
  getVideoTrack(e) {
7344
7344
  if (!e.codec)
7345
7345
  return;
7346
- const t = a(this, fs).filter((i) => !(!ys(i) || i.bitRate > e.bitRate || e.codec && i.codec !== e.codec));
7346
+ const t = a(this, ps).filter((i) => !(!Ss(i) || i.bitRate > e.bitRate || e.codec && i.codec !== e.codec));
7347
7347
  return t[t.length - 1];
7348
7348
  }
7349
7349
  renditions() {
7350
- return a(this, fs);
7350
+ return a(this, ps);
7351
7351
  }
7352
7352
  }
7353
- Ht = new WeakMap(), fs = new WeakMap(), Ac = new WeakSet(), ql = function() {
7353
+ Ht = new WeakMap(), ps = new WeakMap(), Ac = new WeakSet(), ql = function() {
7354
7354
  const [e, t] = a(this, Ht).value();
7355
7355
  return fm(e);
7356
7356
  };
@@ -7358,7 +7358,7 @@ const xA = (s, e) => {
7358
7358
  const t = new URL("/subscribe", s);
7359
7359
  return t.searchParams.append("channelId", e.channelId), t.searchParams.append("sessionId", e.sessionId), t.searchParams.append("clientId", e.clientId), e.audio && e.audio.codec && (t.searchParams.append("audio.bitRate", Math.round(e.audio.bitRate).toString()), t.searchParams.append("audio.codec", e.audio.codec), e.audio.language && t.searchParams.append("audio.language", e.audio.language)), e.video && e.video.codec && (t.searchParams.append("video.width", e.video.width.toString()), t.searchParams.append("video.height", e.video.height.toString()), t.searchParams.append("video.bitRate", Math.round(e.video.bitRate).toString()), t.searchParams.append("video.codec", e.video.codec)), e.expectAdditionalConnection && t.searchParams.append("expectAdditionalConnection", e.expectAdditionalConnection.toString()), e.burstMs && t.searchParams.append("burstMs", e.burstMs.toString()), e.channelGroupId && t.searchParams.append("channelGroupId", e.channelGroupId), e.authToken && (t.searchParams.append("auth.token", e.authToken), t.searchParams.append("auth.type", "jwt")), t.toString();
7360
7360
  };
7361
- class MA extends Ei {
7361
+ class MA extends ki {
7362
7362
  constructor(t, i) {
7363
7363
  super();
7364
7364
  r(this, "options");
@@ -7416,19 +7416,19 @@ class MA extends Ei {
7416
7416
  isSuspended: this.isSuspended
7417
7417
  })), this.close("one websocket was closed"), t.code) {
7418
7418
  case 4e3:
7419
- this.emit("error", po(tr()));
7419
+ this.emit("error", po(ir()));
7420
7420
  break;
7421
7421
  case 4001:
7422
- this.emit("error", po(tr()));
7422
+ this.emit("error", po(ir()));
7423
7423
  break;
7424
7424
  case 4002:
7425
- this.emit("error", af(tr()));
7425
+ this.emit("error", af(ir()));
7426
7426
  break;
7427
7427
  case 4003:
7428
- this.emit("error", xd("internal", tr()));
7428
+ this.emit("error", xd("internal", ir()));
7429
7429
  break;
7430
7430
  case 4010:
7431
- this.emit("error", of("internal", tr()));
7431
+ this.emit("error", of("internal", ir()));
7432
7432
  break;
7433
7433
  }
7434
7434
  this.emit("close", this);
@@ -7446,7 +7446,7 @@ class MA extends Ei {
7446
7446
  if (this.isSuspended)
7447
7447
  return !1;
7448
7448
  if (this.readyState() !== WebSocket.CLOSED && this.close("new connection in progress"), this.shouldContinueConnecting = !0, this._isConnectInProgress = !0, t && this.options.reconnectDelay > 0) {
7449
- this.logger.info("Waiting for reconnect delay", S({}, this.options)), yield ki(this.options.reconnectDelay);
7449
+ this.logger.info("Waiting for reconnect delay", S({}, this.options)), yield Ii(this.options.reconnectDelay);
7450
7450
  const i = yield this.options.reconnectHandler(this.reconnectState);
7451
7451
  if (this.reconnectState.reconnectRetries++, !i)
7452
7452
  return this._isConnectInProgress = !1, this.emit("error", Md()), !1;
@@ -7655,11 +7655,11 @@ r(mt, "PING_INTERVAL", 5e3), r(mt, "MAX_MISSED_PINGS", 4), r(mt, "TLS_ROUNDTRIPS
7655
7655
  h.transport.once("error", (u) => c(u)), h.transport.once("open", () => o(h));
7656
7656
  }));
7657
7657
  let _h = mt;
7658
- var zn, bi, Hn;
7658
+ var zn, yi, Hn;
7659
7659
  class _A {
7660
7660
  constructor(e) {
7661
7661
  d(this, zn);
7662
- d(this, bi, []);
7662
+ d(this, yi, []);
7663
7663
  d(this, Hn);
7664
7664
  m(this, zn, e);
7665
7665
  }
@@ -7676,8 +7676,8 @@ class _A {
7676
7676
  select(e) {
7677
7677
  if (a(this, zn).edgeUrl)
7678
7678
  return a(this, zn).edgeUrl;
7679
- a(this, bi).length === 0 && m(this, bi, a(this, bi).concat(e));
7680
- const t = a(this, bi).shift();
7679
+ a(this, yi).length === 0 && m(this, yi, a(this, yi).concat(e));
7680
+ const t = a(this, yi).shift();
7681
7681
  if (m(this, Hn, t), t)
7682
7682
  return t;
7683
7683
  }
@@ -7692,11 +7692,11 @@ class _A {
7692
7692
  * Resets the cached list of edges
7693
7693
  */
7694
7694
  reset() {
7695
- m(this, Hn, void 0), m(this, bi, []);
7695
+ m(this, Hn, void 0), m(this, yi, []);
7696
7696
  }
7697
7697
  }
7698
- zn = new WeakMap(), bi = new WeakMap(), Hn = new WeakMap();
7699
- var Et, kt, Qn, ps, yi, gs, Xn, qn, wc, bc, yc, Zl;
7698
+ zn = new WeakMap(), yi = new WeakMap(), Hn = new WeakMap();
7699
+ var Et, kt, Xn, gs, Si, As, Qn, qn, wc, bc, yc, Zl;
7700
7700
  const Hs = class Hs {
7701
7701
  constructor(e, t, i) {
7702
7702
  d(this, yc);
@@ -7707,13 +7707,13 @@ const Hs = class Hs {
7707
7707
  r(this, "connectionImpl");
7708
7708
  d(this, Et, new ee(10));
7709
7709
  d(this, kt, !0);
7710
- d(this, Qn);
7710
+ d(this, Xn);
7711
7711
  // used for tracking current connection attempt count for reconnects
7712
- d(this, ps, 0);
7713
- // used for tracking total connection attempts since instantiation
7714
- d(this, yi, 0);
7715
7712
  d(this, gs, 0);
7716
- d(this, Xn);
7713
+ // used for tracking total connection attempts since instantiation
7714
+ d(this, Si, 0);
7715
+ d(this, As, 0);
7716
+ d(this, Qn);
7717
7717
  d(this, qn);
7718
7718
  r(this, "unload", () => {
7719
7719
  var e;
@@ -7729,24 +7729,24 @@ const Hs = class Hs {
7729
7729
  });
7730
7730
  r(this, "getState", () => this.connectionImpl ? this.connectionImpl.getState() : "disconnected");
7731
7731
  r(this, "getStatistics", () => {
7732
- const e = a(this, yi) > 0 ? a(this, gs) / a(this, yi) : 0;
7732
+ const e = a(this, Si) > 0 ? a(this, As) / a(this, Si) : 0;
7733
7733
  return this.connectionImpl ? O(S({}, this.connectionImpl.getStatistics()), {
7734
- rtt: Qt(a(this, Et).items()),
7734
+ rtt: Xt(a(this, Et).items()),
7735
7735
  estimatedBandwidth: this.estimatedBandwidth,
7736
- connectCount: a(this, gs),
7737
- connectionAttemptCount: a(this, yi),
7736
+ connectCount: a(this, As),
7737
+ connectionAttemptCount: a(this, Si),
7738
7738
  connectionSuccessRatio: e
7739
7739
  }) : {
7740
7740
  rtt: { min: 0, max: 0, average: 0, last: 0 },
7741
7741
  estimatedBandwidth: 0,
7742
- connectCount: a(this, gs),
7743
- connectionAttemptCount: a(this, yi),
7742
+ connectCount: a(this, As),
7743
+ connectionAttemptCount: a(this, Si),
7744
7744
  connectionSuccessRatio: e,
7745
7745
  connectionProtocol: void 0
7746
7746
  };
7747
7747
  });
7748
7748
  r(this, "connect", () => {
7749
- m(this, kt, !0), !a(this, Qn) && m(this, Qn, A(this, yc, Zl).call(this));
7749
+ m(this, kt, !0), !a(this, Xn) && m(this, Xn, A(this, yc, Zl).call(this));
7750
7750
  });
7751
7751
  r(this, "disconnect", (e = "Disconnect Requested") => {
7752
7752
  var t;
@@ -7772,7 +7772,7 @@ const Hs = class Hs {
7772
7772
  d(this, bc, () => f(this, null, function* () {
7773
7773
  const e = Date.now(), t = () => Date.now() - e;
7774
7774
  return Promise.race([
7775
- ki(Hs.PING_TIMEOUT),
7775
+ Ii(Hs.PING_TIMEOUT),
7776
7776
  fetch(new URL("/api/v4/connect/ping", this.config.options.get("url")).toString(), {
7777
7777
  method: "HEAD"
7778
7778
  })
@@ -7793,7 +7793,7 @@ const Hs = class Hs {
7793
7793
  * The timestamp when the first connection was made
7794
7794
  */
7795
7795
  get firstConnectionTime() {
7796
- return a(this, Xn);
7796
+ return a(this, Qn);
7797
7797
  }
7798
7798
  /**
7799
7799
  * The timestamp when the last connection was made
@@ -7802,12 +7802,12 @@ const Hs = class Hs {
7802
7802
  return a(this, qn);
7803
7803
  }
7804
7804
  };
7805
- Et = new WeakMap(), kt = new WeakMap(), Qn = new WeakMap(), ps = new WeakMap(), yi = new WeakMap(), gs = new WeakMap(), Xn = new WeakMap(), qn = new WeakMap(), wc = new WeakMap(), bc = new WeakMap(), yc = new WeakSet(), Zl = function() {
7805
+ Et = new WeakMap(), kt = new WeakMap(), Xn = new WeakMap(), gs = new WeakMap(), Si = new WeakMap(), As = new WeakMap(), Qn = new WeakMap(), qn = new WeakMap(), wc = new WeakMap(), bc = new WeakMap(), yc = new WeakSet(), Zl = function() {
7806
7806
  return f(this, null, function* () {
7807
7807
  var t;
7808
7808
  const e = new _A({ edgeUrl: this.config.options.get("edgeUrl") });
7809
- for (m(this, ps, 0); ; ) {
7810
- Ge(this, ps)._++, Ge(this, yi)._++;
7809
+ for (m(this, gs, 0); ; ) {
7810
+ Ge(this, gs)._++, Ge(this, Si)._++;
7811
7811
  try {
7812
7812
  const [n, o] = yield Promise.all([a(this, wc).call(this), a(this, bc).call(this)]), c = o / 2;
7813
7813
  if (a(this, Et).clear(), a(this, Et).push(c), !a(this, kt))
@@ -7832,7 +7832,7 @@ Et = new WeakMap(), kt = new WeakMap(), Qn = new WeakMap(), ps = new WeakMap(),
7832
7832
  edgeUrl: h
7833
7833
  }),
7834
7834
  a(this, Et)
7835
- )), e.reset(), Ge(this, gs)._++, m(this, ps, 0), m(this, qn, Date.now()), a(this, Xn) || m(this, Xn, a(this, qn)), yield this.connectionImpl.closed();
7835
+ )), e.reset(), Ge(this, As)._++, m(this, gs, 0), m(this, qn, Date.now()), a(this, Qn) || m(this, Qn, a(this, qn)), yield this.connectionImpl.closed();
7836
7836
  } catch (n) {
7837
7837
  this.logger.info("Failed to connect", n);
7838
7838
  const o = e.shiftedEdge();
@@ -7844,30 +7844,30 @@ Et = new WeakMap(), kt = new WeakMap(), Qn = new WeakMap(), ps = new WeakMap(),
7844
7844
  if ((t = this.connectionImpl) == null || t.unload(), this.connectionImpl = void 0, !a(this, kt))
7845
7845
  break;
7846
7846
  if (!(yield this.config.reconnectHandler({
7847
- reconnectRetries: a(this, ps)
7847
+ reconnectRetries: a(this, gs)
7848
7848
  }))) {
7849
7849
  this.emitter.emit("error", Md());
7850
7850
  break;
7851
7851
  }
7852
- if (yield ki(1e3), !a(this, kt))
7852
+ if (yield Ii(1e3), !a(this, kt))
7853
7853
  break;
7854
7854
  }
7855
- m(this, Qn, void 0);
7855
+ m(this, Xn, void 0);
7856
7856
  });
7857
7857
  }, r(Hs, "PING_TIMEOUT", 1e3), r(Hs, "create", (e, t, i) => new Hs(e, t, i));
7858
7858
  let Nh = Hs;
7859
7859
  const nh = () => ({
7860
7860
  video: O(S({}, fo()), {
7861
- bitRate: Ti()
7861
+ bitRate: Ei()
7862
7862
  }),
7863
7863
  audio: {
7864
- bitRate: Ti()
7864
+ bitRate: Ei()
7865
7865
  }
7866
7866
  }), NA = () => ({
7867
7867
  width: window.innerWidth,
7868
7868
  height: window.innerHeight,
7869
- bitRate: Ti()
7870
- }), Qs = class Qs {
7869
+ bitRate: Ei()
7870
+ }), Xs = class Xs {
7871
7871
  constructor(e, t, i, n) {
7872
7872
  r(this, "emitter");
7873
7873
  r(this, "timers", new Ae());
@@ -7887,7 +7887,7 @@ const nh = () => ({
7887
7887
  window.ResizeObserver && (this.resizeObserver = new ResizeObserver(this.onResize), this.resizeObserver.observe(this.element)), this.evaluateConstraintCap();
7888
7888
  });
7889
7889
  r(this, "unsuspend", () => {
7890
- this.timers.setInterval(this.evaluateConstraintCap, Qs.CHECK_SIZE_INTERVAL), this.evaluateConstraintCap();
7890
+ this.timers.setInterval(this.evaluateConstraintCap, Xs.CHECK_SIZE_INTERVAL), this.evaluateConstraintCap();
7891
7891
  });
7892
7892
  r(this, "suspend", () => {
7893
7893
  this.timers.unload();
@@ -7938,7 +7938,7 @@ const nh = () => ({
7938
7938
  });
7939
7939
  i && i.video && (e.video.width = i.video.width, e.video.height = i.video.height);
7940
7940
  const n = (h = this.userSpecifiedCap) == null ? void 0 : h.video, o = (u = this.userSpecifiedCap) == null ? void 0 : u.audio;
7941
- n && (e.video.width > n.width && (e.video.width = n.width), e.video.height > n.height && (e.video.height = n.height)), e.video.bitRate = (l = n == null ? void 0 : n.bitRate) != null ? l : e.video.bitRate, e.audio.bitRate = (p = o == null ? void 0 : o.bitRate) != null ? p : e.audio.bitRate, Cs(e, this.currentCap) ? this.currentCap = S({}, e) : (this.currentCap = S({}, e), this.emitter.emit("constraint cap changed", e));
7941
+ n && (e.video.width > n.width && (e.video.width = n.width), e.video.height > n.height && (e.video.height = n.height)), e.video.bitRate = (l = n == null ? void 0 : n.bitRate) != null ? l : e.video.bitRate, e.audio.bitRate = (p = o == null ? void 0 : o.bitRate) != null ? p : e.audio.bitRate, Yn(e, this.currentCap) ? this.currentCap = S({}, e) : (this.currentCap = S({}, e), this.emitter.emit("constraint cap changed", e));
7942
7942
  });
7943
7943
  r(this, "enterPictureInPicture", (e) => {
7944
7944
  this.pictureInPictureSource = e, this.evaluateConstraintCap();
@@ -7957,8 +7957,8 @@ const nh = () => ({
7957
7957
  this._sizeBasedResolutionCapEnabled = e, this.evaluateConstraintCap();
7958
7958
  }
7959
7959
  };
7960
- r(Qs, "CHECK_SIZE_INTERVAL", 1e3), r(Qs, "create", (e, t, i, n) => new Qs(e, t, i, n));
7961
- let Vh = Qs;
7960
+ r(Xs, "CHECK_SIZE_INTERVAL", 1e3), r(Xs, "create", (e, t, i, n) => new Xs(e, t, i, n));
7961
+ let Vh = Xs;
7962
7962
  const VA = 5, GA = 100, jA = 1e3;
7963
7963
  class hu {
7964
7964
  constructor(e, t, i, n) {
@@ -7986,12 +7986,12 @@ class hu {
7986
7986
  });
7987
7987
  r(this, "videoDecodeRate", () => {
7988
7988
  var o, c, h;
7989
- const e = this.trackContexts.get("video"), t = (o = e == null ? void 0 : e.sampleDuration) != null ? o : 40, i = Qt((c = e == null ? void 0 : e.decodeTime.items()) != null ? c : []), n = Qt((h = e == null ? void 0 : e.transportTime.items()) != null ? h : []);
7989
+ const e = this.trackContexts.get("video"), t = (o = e == null ? void 0 : e.sampleDuration) != null ? o : 40, i = Xt((c = e == null ? void 0 : e.decodeTime.items()) != null ? c : []), n = Xt((h = e == null ? void 0 : e.transportTime.items()) != null ? h : []);
7990
7990
  return t / (i.average + n.average);
7991
7991
  });
7992
7992
  r(this, "getStatistics", () => {
7993
7993
  var o, c, h, u;
7994
- const e = this.trackContexts.get("video"), t = Qt((o = e == null ? void 0 : e.decodeTime.items()) != null ? o : []), i = Qt((c = e == null ? void 0 : e.transportTime.items()) != null ? c : []), n = Qt((u = (h = this.trackContexts.get("audio")) == null ? void 0 : h.decodeTime.items()) != null ? u : []);
7994
+ const e = this.trackContexts.get("video"), t = Xt((o = e == null ? void 0 : e.decodeTime.items()) != null ? o : []), i = Xt((c = e == null ? void 0 : e.transportTime.items()) != null ? c : []), n = Xt((u = (h = this.trackContexts.get("audio")) == null ? void 0 : h.decodeTime.items()) != null ? u : []);
7995
7995
  return {
7996
7996
  videoDecodeRate: this.videoDecodeRate(),
7997
7997
  videoDecodeTime: t,
@@ -8075,7 +8075,7 @@ class hu {
8075
8075
  for (const h of i)
8076
8076
  switch (h.type) {
8077
8077
  case "audio": {
8078
- const { OpusDecoderContext: u } = yield import("./D0Ik22bd.js");
8078
+ const { OpusDecoderContext: u } = yield import("./CofbhZ99.js");
8079
8079
  c.set(h.type, {
8080
8080
  buffer: [],
8081
8081
  decoderContext: yield u.create(48e3, 2),
@@ -8086,7 +8086,7 @@ class hu {
8086
8086
  break;
8087
8087
  }
8088
8088
  case "video": {
8089
- const { H264DecoderWorkerContext: u } = yield import("./C3-fZf7D.js");
8089
+ const { H264DecoderWorkerContext: u } = yield import("./oaKqkyT2.js");
8090
8090
  c.set(h.type, {
8091
8091
  buffer: [],
8092
8092
  decoderContext: yield u.create(o),
@@ -8253,7 +8253,7 @@ const $e = class $e {
8253
8253
  };
8254
8254
  r($e, "NO_DATA_ERROR_TIMEOUT", 20 * 1e3), r($e, "NO_DATA_TIMEOUT", 5 * 1e3), r($e, "UPDATE_RECEIVED_BYTES_INTERVAL", 1e3), r($e, "create", (e) => new $e(e));
8255
8255
  let Wh = $e;
8256
- const Xu = 1e3, qu = 50;
8256
+ const Qu = 1e3, qu = 50;
8257
8257
  class uu {
8258
8258
  constructor(e) {
8259
8259
  r(this, "logger");
@@ -8293,8 +8293,8 @@ class uu {
8293
8293
  this.trackingState.set(t, {
8294
8294
  lastArrivalTime: i,
8295
8295
  lastTimestampMs: n,
8296
- jitterSamples: new ee(Xu),
8297
- interArrivalTimes: new ee(Xu)
8296
+ jitterSamples: new ee(Qu),
8297
+ interArrivalTimes: new ee(Qu)
8298
8298
  }), this.runningJitter.set(t, 0), this.recentJitterSamples.set(t, new ee(qu));
8299
8299
  return;
8300
8300
  }
@@ -8321,7 +8321,7 @@ class uu {
8321
8321
  if (o.startsWith(e)) {
8322
8322
  if (c.jitterSamples.items().length < 1)
8323
8323
  return;
8324
- const u = (t = this.runningJitter.get(o)) != null ? t : 0, l = (n = (i = this.recentJitterSamples.get(o)) == null ? void 0 : i.items()) != null ? n : [], { min: p, max: g, average: w } = Qt(l);
8324
+ const u = (t = this.runningJitter.get(o)) != null ? t : 0, l = (n = (i = this.recentJitterSamples.get(o)) == null ? void 0 : i.items()) != null ? n : [], { min: p, max: g, average: w } = Xt(l);
8325
8325
  return {
8326
8326
  min: Math.round(p),
8327
8327
  max: Math.round(g),
@@ -8358,7 +8358,7 @@ class uu {
8358
8358
  };
8359
8359
  }
8360
8360
  }
8361
- const zA = () => window.AudioContext || window.webkitAudioContext, vc = class vc extends Ei {
8361
+ const zA = () => window.AudioContext || window.webkitAudioContext, vc = class vc extends ki {
8362
8362
  constructor() {
8363
8363
  super();
8364
8364
  // TODO: Checkout what happens when limit is reached
@@ -8408,7 +8408,7 @@ const zA = () => window.AudioContext || window.webkitAudioContext, vc = class vc
8408
8408
  };
8409
8409
  r(vc, "CHECK_INTERVAL", 1e3);
8410
8410
  let zh = vc;
8411
- const Tc = class Tc extends Ei {
8411
+ const Tc = class Tc extends ki {
8412
8412
  constructor(t, i, { muted: n, reInitWhenStuck: o }) {
8413
8413
  super();
8414
8414
  r(this, "logger");
@@ -8581,14 +8581,14 @@ const Tc = class Tc extends Ei {
8581
8581
  };
8582
8582
  r(Tc, "create", (t, i, n) => new Tc(t, i, n));
8583
8583
  let Go = Tc;
8584
- var Xa, It, pe, As, Ze, Jl, Ds, $l;
8584
+ var Qa, It, pe, ws, Ze, Jl, Ds, $l;
8585
8585
  class HA {
8586
8586
  constructor() {
8587
8587
  d(this, Ze);
8588
- d(this, Xa, []);
8588
+ d(this, Qa, []);
8589
8589
  d(this, It, document.createElement("canvas"));
8590
8590
  d(this, pe);
8591
- d(this, As, window.devicePixelRatio || 1);
8591
+ d(this, ws, window.devicePixelRatio || 1);
8592
8592
  r(this, "config", {
8593
8593
  backgroundColor: "rgba(0,0,0,0.6)",
8594
8594
  textPadding: 8,
@@ -8604,10 +8604,10 @@ class HA {
8604
8604
  return a(this, It);
8605
8605
  }
8606
8606
  setActiveCues(e) {
8607
- m(this, Xa, e);
8607
+ m(this, Qa, e);
8608
8608
  }
8609
8609
  render(e, t = !1) {
8610
- const i = a(this, Xa).flatMap((h) => h.text.split(`
8610
+ const i = a(this, Qa).flatMap((h) => h.text.split(`
8611
8611
  `).flatMap((l) => A(this, Ze, $l).call(this, l, e.width)).map((l) => {
8612
8612
  A(this, Ze, Ds).call(this);
8613
8613
  const p = a(this, pe).measureText(l);
@@ -8627,8 +8627,8 @@ class HA {
8627
8627
  t && (a(this, pe).strokeStyle = "red", a(this, pe).strokeRect(0, 0, e.width, a(this, It).height));
8628
8628
  }
8629
8629
  }
8630
- Xa = new WeakMap(), It = new WeakMap(), pe = new WeakMap(), As = new WeakMap(), Ze = new WeakSet(), Jl = function(e, t) {
8631
- a(this, It).width = e * a(this, As), a(this, It).height = t * a(this, As), a(this, pe).setTransform(a(this, As), 0, 0, a(this, As), 0, 0), this.canvas.style.width = `${e}px`, this.canvas.style.height = `${t}px`;
8630
+ Qa = new WeakMap(), It = new WeakMap(), pe = new WeakMap(), ws = new WeakMap(), Ze = new WeakSet(), Jl = function(e, t) {
8631
+ a(this, It).width = e * a(this, ws), a(this, It).height = t * a(this, ws), a(this, pe).setTransform(a(this, ws), 0, 0, a(this, ws), 0, 0), this.canvas.style.width = `${e}px`, this.canvas.style.height = `${t}px`;
8632
8632
  }, Ds = function() {
8633
8633
  a(this, pe).fillStyle = "white", a(this, pe).textAlign = "left", a(this, pe).textBaseline = "top", a(this, pe).font = `${this.config.fontSize} sans-serif`;
8634
8634
  }, $l = function(e, t) {
@@ -8647,7 +8647,7 @@ Xa = new WeakMap(), It = new WeakMap(), pe = new WeakMap(), As = new WeakMap(),
8647
8647
  }
8648
8648
  return i;
8649
8649
  };
8650
- const QA = `
8650
+ const XA = `
8651
8651
  precision mediump float;
8652
8652
  uniform sampler2D texture;
8653
8653
 
@@ -8659,7 +8659,7 @@ void main() {
8659
8659
 
8660
8660
  gl_FragColor = vec4(y, y, y, a);
8661
8661
  }
8662
- `, XA = `
8662
+ `, QA = `
8663
8663
  attribute vec2 position;
8664
8664
  varying vec2 texture_coordinate;
8665
8665
  uniform mat4 model;
@@ -8688,7 +8688,7 @@ void main() {
8688
8688
  });
8689
8689
  }
8690
8690
  return i;
8691
- }, Di = (s) => {
8691
+ }, Oi = (s) => {
8692
8692
  const e = s.createTexture();
8693
8693
  if (!e)
8694
8694
  throw new M("Failed to create texture", {
@@ -8720,7 +8720,7 @@ void main() {
8720
8720
  }
8721
8721
  return i;
8722
8722
  };
8723
- var Ec, _, qa, Za, Ja, Si, $n, Yl, Kl, kc;
8723
+ var Ec, _, qa, Za, Ja, vi, $n, Yl, Kl, kc;
8724
8724
  class qA {
8725
8725
  constructor(e) {
8726
8726
  d(this, $n);
@@ -8729,7 +8729,7 @@ class qA {
8729
8729
  d(this, qa);
8730
8730
  d(this, Za);
8731
8731
  d(this, Ja);
8732
- d(this, Si);
8732
+ d(this, vi);
8733
8733
  r(this, "subtitleRenderer", new HA());
8734
8734
  // biome-ignore format: special formatting
8735
8735
  d(this, kc, (e, t, i, n) => [
@@ -8750,14 +8750,14 @@ class qA {
8750
8750
  0,
8751
8751
  1
8752
8752
  ]);
8753
- m(this, _, e), m(this, qa, Di(e)), m(this, Za, Os(e, e.FRAGMENT_SHADER, QA)), m(this, Ja, Os(e, e.VERTEX_SHADER, XA)), m(this, Si, Hh(e, a(this, Ja), a(this, Za))), this.subtitleRenderer.config.fontSize = "64px";
8753
+ m(this, _, e), m(this, qa, Oi(e)), m(this, Za, Os(e, e.FRAGMENT_SHADER, XA)), m(this, Ja, Os(e, e.VERTEX_SHADER, QA)), m(this, vi, Hh(e, a(this, Ja), a(this, Za))), this.subtitleRenderer.config.fontSize = "64px";
8754
8754
  }
8755
8755
  setActiveCues(e, t) {
8756
8756
  this.subtitleRenderer.setActiveCues(e), this.subtitleRenderer.render(t);
8757
8757
  }
8758
8758
  render(e) {
8759
8759
  const t = this.subtitleRenderer.canvas, i = (e.padding + a(this, Ec)) * window.devicePixelRatio;
8760
- t.width !== 0 && (a(this, _).useProgram(a(this, Si)), A(this, $n, Yl).call(this), A(this, $n, Kl).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, _).uniform1i(a(this, _).getUniformLocation(a(this, Si), "texture"), 4), a(this, _).activeTexture(a(this, _).TEXTURE4), a(this, _).bindTexture(a(this, _).TEXTURE_2D, a(this, qa)), a(this, _).enable(a(this, _).BLEND), a(this, _).blendFunc(a(this, _).SRC_ALPHA, a(this, _).ONE_MINUS_SRC_ALPHA), a(this, _).texImage2D(
8760
+ t.width !== 0 && (a(this, _).useProgram(a(this, vi)), A(this, $n, Yl).call(this), A(this, $n, Kl).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, _).uniform1i(a(this, _).getUniformLocation(a(this, vi), "texture"), 4), a(this, _).activeTexture(a(this, _).TEXTURE4), a(this, _).bindTexture(a(this, _).TEXTURE_2D, a(this, qa)), a(this, _).enable(a(this, _).BLEND), a(this, _).blendFunc(a(this, _).SRC_ALPHA, a(this, _).ONE_MINUS_SRC_ALPHA), a(this, _).texImage2D(
8761
8761
  a(this, _).TEXTURE_2D,
8762
8762
  0,
8763
8763
  a(this, _).RGBA,
@@ -8767,11 +8767,11 @@ class qA {
8767
8767
  ), a(this, _).texParameteri(a(this, _).TEXTURE_2D, a(this, _).TEXTURE_MAG_FILTER, a(this, _).LINEAR), a(this, _).drawArrays(a(this, _).TRIANGLE_STRIP, 0, 4));
8768
8768
  }
8769
8769
  }
8770
- Ec = new WeakMap(), _ = new WeakMap(), qa = new WeakMap(), Za = new WeakMap(), Ja = new WeakMap(), Si = new WeakMap(), $n = new WeakSet(), Yl = function() {
8771
- const e = a(this, _).getAttribLocation(a(this, Si), "position");
8770
+ Ec = new WeakMap(), _ = new WeakMap(), qa = new WeakMap(), Za = new WeakMap(), Ja = new WeakMap(), vi = new WeakMap(), $n = new WeakSet(), Yl = function() {
8771
+ const e = a(this, _).getAttribLocation(a(this, vi), "position");
8772
8772
  a(this, _).enableVertexAttribArray(e), a(this, _).vertexAttribPointer(e, 2, a(this, _).FLOAT, !1, 0, 0);
8773
8773
  }, Kl = function(e, t, i, n) {
8774
- const o = a(this, _).getUniformLocation(a(this, Si), "model");
8774
+ const o = a(this, _).getUniformLocation(a(this, vi), "model");
8775
8775
  a(this, _).uniformMatrix4fv(o, !1, a(this, kc).call(this, e, t, i, n));
8776
8776
  }, kc = new WeakMap();
8777
8777
  const $u = `
@@ -8811,37 +8811,43 @@ void main() {
8811
8811
  stencil: !1,
8812
8812
  antialias: !1,
8813
8813
  premultipliedAlpha: !1
8814
- }, Ur = class Ur extends Ei {
8814
+ }, ei = class ei extends ki {
8815
8815
  constructor() {
8816
8816
  super();
8817
8817
  r(this, "canvas", document.createElement("canvas"));
8818
8818
  r(this, "context", Zu(this.canvas, ed));
8819
8819
  r(this, "pixelShader", Os(this.context, this.context.FRAGMENT_SHADER, $u));
8820
8820
  r(this, "vertexShader", Os(this.context, this.context.VERTEX_SHADER, Yu));
8821
- r(this, "buffer", Ju(this.context, Ur.SQUARE_VERTICES));
8821
+ r(this, "buffer", Ju(this.context, ei.SQUARE_VERTICES));
8822
8822
  r(this, "program", Hh(this.context, this.vertexShader, this.pixelShader));
8823
8823
  r(this, "textures", {
8824
- y: Di(this.context),
8825
- u: Di(this.context),
8826
- v: Di(this.context)
8824
+ y: Oi(this.context),
8825
+ u: Oi(this.context),
8826
+ v: Oi(this.context)
8827
8827
  });
8828
8828
  // Lazy loaded when needed
8829
8829
  r(this, "textRenderer");
8830
8830
  r(this, "size", Ku);
8831
+ r(this, "modelLocation", null);
8832
+ r(this, "conversionLocation", null);
8833
+ r(this, "cachedScaleX", 0);
8834
+ r(this, "cachedScaleY", 0);
8835
+ r(this, "cachedTransformMatrix", null);
8836
+ r(this, "texturesNeedRealloc", !0);
8831
8837
  r(this, "onContextLost", (t) => {
8832
8838
  this.textRenderer = void 0;
8833
8839
  const i = new Error(t instanceof WebGLContextEvent ? t.statusMessage : "webgl context lost");
8834
8840
  this.emit("context lost", uf(i)), t.preventDefault();
8835
8841
  });
8836
8842
  r(this, "onContextRestored", () => {
8837
- this.emit("context restored"), this.context = Zu(this.canvas, ed), this.pixelShader = Os(this.context, this.context.FRAGMENT_SHADER, $u), this.vertexShader = Os(this.context, this.context.VERTEX_SHADER, Yu), this.buffer = Ju(this.context, Ur.SQUARE_VERTICES), this.program = Hh(this.context, this.vertexShader, this.pixelShader), this.textures = {
8838
- y: Di(this.context),
8839
- u: Di(this.context),
8840
- v: Di(this.context)
8843
+ this.emit("context restored"), this.context = Zu(this.canvas, ed), this.pixelShader = Os(this.context, this.context.FRAGMENT_SHADER, $u), this.vertexShader = Os(this.context, this.context.VERTEX_SHADER, Yu), this.buffer = Ju(this.context, ei.SQUARE_VERTICES), this.program = Hh(this.context, this.vertexShader, this.pixelShader), this.textures = {
8844
+ y: Oi(this.context),
8845
+ u: Oi(this.context),
8846
+ v: Oi(this.context)
8841
8847
  }, this.load();
8842
8848
  });
8843
8849
  r(this, "load", () => {
8844
- this.context.useProgram(this.program), this.setupPositionVertexAttributes(), this.setSize(Ku), this.context.uniform1i(this.context.getUniformLocation(this.program, "y_texture"), 0), this.context.uniform1i(this.context.getUniformLocation(this.program, "u_texture"), 1), this.context.uniform1i(this.context.getUniformLocation(this.program, "v_texture"), 2), this.setConversionMatrix(this.rec709());
8850
+ this.context.useProgram(this.program), this.setupPositionVertexAttributes(), this.texturesNeedRealloc = !0, this.setSize(Ku), this.modelLocation = this.context.getUniformLocation(this.program, "model"), this.conversionLocation = this.context.getUniformLocation(this.program, "conversion"), this.context.uniform1i(this.context.getUniformLocation(this.program, "y_texture"), 0), this.context.uniform1i(this.context.getUniformLocation(this.program, "u_texture"), 1), this.context.uniform1i(this.context.getUniformLocation(this.program, "v_texture"), 2), this.setConversionMatrix(ei.REC709);
8845
8851
  });
8846
8852
  r(this, "unload", () => {
8847
8853
  var i;
@@ -8861,7 +8867,7 @@ void main() {
8861
8867
  height: t.height,
8862
8868
  codedWidth: t.codedWidth,
8863
8869
  codedHeight: t.codedHeight
8864
- }), this.setConversionMatrix(this.rec709()), this.setModelMatrix(this.size.width / this.size.codedWidth, this.size.height / this.size.codedHeight), this.context.activeTexture(this.context.TEXTURE0), this.updateTexture(this.textures.y, this.size.codedWidth, this.size.codedHeight, t.data[0]), this.context.activeTexture(this.context.TEXTURE1), this.updateTexture(this.textures.u, this.size.codedWidth / 2, this.size.codedHeight / 2, t.data[1]), this.context.activeTexture(this.context.TEXTURE2), this.updateTexture(this.textures.v, this.size.codedWidth / 2, this.size.codedHeight / 2, t.data[2]), this.context.drawArrays(this.context.TRIANGLE_STRIP, 0, 4), this.textRenderer) {
8870
+ }), this.setModelMatrix(this.size.width / this.size.codedWidth, this.size.height / this.size.codedHeight), this.context.activeTexture(this.context.TEXTURE0), this.updateTexture(this.textures.y, this.size.codedWidth, this.size.codedHeight, t.data[0]), this.context.activeTexture(this.context.TEXTURE1), this.updateTexture(this.textures.u, this.size.codedWidth / 2, this.size.codedHeight / 2, t.data[1]), this.context.activeTexture(this.context.TEXTURE2), this.updateTexture(this.textures.v, this.size.codedWidth / 2, this.size.codedHeight / 2, t.data[2]), this.texturesNeedRealloc = !1, this.context.drawArrays(this.context.TRIANGLE_STRIP, 0, 4), this.textRenderer) {
8865
8871
  const n = i.style.getPropertyValue("--vindral-subtitle-offset") || i.style.getPropertyValue("--vindral-control-bar-offset"), o = parseInt(n || "0", 10), c = Number.isNaN(o) ? 0 : -o;
8866
8872
  this.textRenderer.render({
8867
8873
  width: Math.max(i.clientWidth, 960) * window.devicePixelRatio,
@@ -8872,22 +8878,20 @@ void main() {
8872
8878
  });
8873
8879
  r(this, "updateTexture", (t, i, n, o) => {
8874
8880
  const h = this.context.LUMINANCE, u = this.context.UNSIGNED_BYTE;
8875
- this.context.bindTexture(this.context.TEXTURE_2D, t), this.context.texImage2D(this.context.TEXTURE_2D, 0, h, i, n, 0, h, u, o);
8881
+ this.context.bindTexture(this.context.TEXTURE_2D, t), this.texturesNeedRealloc ? this.context.texImage2D(this.context.TEXTURE_2D, 0, h, i, n, 0, h, u, o) : this.context.texSubImage2D(this.context.TEXTURE_2D, 0, 0, 0, i, n, h, u, o);
8876
8882
  });
8877
8883
  r(this, "setupPositionVertexAttributes", () => {
8878
8884
  const t = this.context.getAttribLocation(this.program, "position");
8879
8885
  this.context.enableVertexAttribArray(t), this.context.vertexAttribPointer(t, 2, this.context.FLOAT, !1, 0, 0);
8880
8886
  });
8881
8887
  r(this, "setSize", (t) => {
8882
- Cs(t, this.size) || (this.size = t, this.canvas.setAttribute("width", t.width.toString()), this.canvas.setAttribute("height", t.height.toString()), this.context.viewport(0, 0, t.width, t.height), this.setModelMatrix(t.width / t.codedWidth, t.height / t.codedHeight));
8888
+ t.width === this.size.width && t.height === this.size.height && t.codedWidth === this.size.codedWidth && t.codedHeight === this.size.codedHeight || (this.size = t, this.texturesNeedRealloc = !0, this.canvas.setAttribute("width", t.width.toString()), this.canvas.setAttribute("height", t.height.toString()), this.context.viewport(0, 0, t.width, t.height), this.setModelMatrix(t.width / t.codedWidth, t.height / t.codedHeight));
8883
8889
  });
8884
8890
  r(this, "setModelMatrix", (t, i) => {
8885
- const n = this.context.getUniformLocation(this.program, "model");
8886
- this.context.uniformMatrix4fv(n, !1, this.transformMatrix(t, i));
8891
+ (this.cachedScaleX !== t || this.cachedScaleY !== i || !this.cachedTransformMatrix) && (this.cachedScaleX = t, this.cachedScaleY = i, this.cachedTransformMatrix = this.transformMatrix(t, i)), this.context.uniformMatrix4fv(this.modelLocation, !1, this.cachedTransformMatrix);
8887
8892
  });
8888
8893
  r(this, "setConversionMatrix", (t) => {
8889
- const i = this.context.getUniformLocation(this.program, "conversion");
8890
- this.context.uniformMatrix4fv(i, !1, t);
8894
+ this.context.uniformMatrix4fv(this.conversionLocation, !1, t);
8891
8895
  });
8892
8896
  // biome-ignore format: special formatting
8893
8897
  r(this, "transformMatrix", (t, i) => [
@@ -8908,58 +8912,56 @@ void main() {
8908
8912
  0,
8909
8913
  1
8910
8914
  ]);
8911
- // biome-ignore format: special formatting
8912
- r(this, "rec709", () => [
8913
- 1.16438,
8914
- 0,
8915
- 1.79274,
8916
- -0.97295,
8917
- 1.16438,
8918
- -0.21325,
8919
- -0.53291,
8920
- 0.30148,
8921
- 1.16438,
8922
- 2.1124,
8923
- 0,
8924
- -1.1334,
8925
- 0,
8926
- 0,
8927
- 0,
8928
- 1
8929
- ]);
8930
- // biome-ignore format: special formatting
8931
- r(this, "rec601", () => [
8932
- 1.16438,
8933
- 0,
8934
- 1.59603,
8935
- -0.87079,
8936
- 1.16438,
8937
- -0.39176,
8938
- -0.81297,
8939
- 0.52959,
8940
- 1.16438,
8941
- 2.01723,
8942
- 0,
8943
- -1.08139,
8944
- 0,
8945
- 0,
8946
- 0,
8947
- 1
8948
- ]);
8949
8915
  this.canvas.addEventListener("webglcontextlost", this.onContextLost), this.canvas.addEventListener("webglcontextrestored", this.onContextRestored, !1), this.canvas.style.width = "100%", this.canvas.style.position = "relative";
8950
8916
  }
8951
8917
  getTextRenderer() {
8952
8918
  return this.textRenderer || (this.textRenderer = new qA(this.context)), this.textRenderer;
8953
8919
  }
8954
8920
  };
8955
- r(Ur, "SQUARE_VERTICES", new Float32Array([0, 0, 0, 1, 1, 0, 1, 1]));
8956
- let Qh = Ur;
8921
+ r(ei, "SQUARE_VERTICES", new Float32Array([0, 0, 0, 1, 1, 0, 1, 1])), // biome-ignore format: special formatting
8922
+ r(ei, "REC709", [
8923
+ 1.16438,
8924
+ 0,
8925
+ 1.79274,
8926
+ -0.97295,
8927
+ 1.16438,
8928
+ -0.21325,
8929
+ -0.53291,
8930
+ 0.30148,
8931
+ 1.16438,
8932
+ 2.1124,
8933
+ 0,
8934
+ -1.1334,
8935
+ 0,
8936
+ 0,
8937
+ 0,
8938
+ 1
8939
+ ]), // biome-ignore format: special formatting
8940
+ r(ei, "REC601", [
8941
+ 1.16438,
8942
+ 0,
8943
+ 1.59603,
8944
+ -0.87079,
8945
+ 1.16438,
8946
+ -0.39176,
8947
+ -0.81297,
8948
+ 0.52959,
8949
+ 1.16438,
8950
+ 2.01723,
8951
+ 0,
8952
+ -1.08139,
8953
+ 0,
8954
+ 0,
8955
+ 0,
8956
+ 1
8957
+ ]);
8958
+ let Xh = ei;
8957
8959
  const Ic = class Ic {
8958
8960
  constructor(e, t, i, n) {
8959
8961
  r(this, "oldTimestampLimit", 400);
8960
8962
  r(this, "pool");
8961
8963
  r(this, "logger");
8962
- r(this, "videoRenderer", new Qh());
8964
+ r(this, "videoRenderer", new Xh());
8963
8965
  r(this, "renderQueue", []);
8964
8966
  r(this, "clockSource");
8965
8967
  r(this, "isFirstFrame", !0);
@@ -9022,11 +9024,11 @@ const Ic = class Ic {
9022
9024
  };
9023
9025
  r(Ic, "create", (e, t, i, n) => new Ic(e, t, i, n));
9024
9026
  let jo = Ic;
9025
- var vi;
9027
+ var Ti;
9026
9028
  class em {
9027
9029
  constructor() {
9028
- d(this, vi, []);
9029
- m(this, vi, []);
9030
+ d(this, Ti, []);
9031
+ m(this, Ti, []);
9030
9032
  }
9031
9033
  addTextTrack(e, t, i) {
9032
9034
  const n = [], o = {
@@ -9043,24 +9045,24 @@ class em {
9043
9045
  h !== -1 && n.splice(h, 1);
9044
9046
  }
9045
9047
  };
9046
- return a(this, vi).push(o), o;
9048
+ return a(this, Ti).push(o), o;
9047
9049
  }
9048
9050
  set language(e) {
9049
- a(this, vi).forEach((t) => {
9051
+ a(this, Ti).forEach((t) => {
9050
9052
  t.language === e ? t.mode = "showing" : t.mode = "hidden";
9051
9053
  });
9052
9054
  }
9053
9055
  get language() {
9054
9056
  var e;
9055
- return (e = a(this, vi).find((t) => t.mode === "showing")) == null ? void 0 : e.language;
9057
+ return (e = a(this, Ti).find((t) => t.mode === "showing")) == null ? void 0 : e.language;
9056
9058
  }
9057
9059
  getActiveCues(e) {
9058
- const t = a(this, vi).find((i) => i.mode === "showing");
9060
+ const t = a(this, Ti).find((i) => i.mode === "showing");
9059
9061
  return t ? t.cues.filter(({ startTime: i, endTime: n }) => e >= i && e <= n) : [];
9060
9062
  }
9061
9063
  }
9062
- vi = new WeakMap();
9063
- const Ui = (s, e) => {
9064
+ Ti = new WeakMap();
9065
+ const Pi = (s, e) => {
9064
9066
  let t;
9065
9067
  for (t = e; s > 1; s--) t += e;
9066
9068
  return t;
@@ -9073,7 +9075,7 @@ class ZA {
9073
9075
  e.innerHTML = "<audio x-webkit-airplay='deny'></audio>";
9074
9076
  const t = e.children.item(0);
9075
9077
  if (t instanceof HTMLAudioElement)
9076
- this.audio = t, this.audio.controls = !1, this.audio.disableRemotePlayback = !0, this.audio.preload = "auto", this.audio.src = "data:audio/mpeg;base64,//uQx" + Ui(23, "A") + "WGluZwAAAA8AAAACAAACcQCA" + Ui(16, "gICA") + Ui(66, "/") + "8AAABhTEFNRTMuMTAwA8MAAAAAAAAAABQgJAUHQQAB9AAAAnGMHkkI" + Ui(320, "A") + "//sQxAADgnABGiAAQBCqgCRMAAgEAH" + Ui(15, "/") + "7+n/9FTuQsQH//////2NG0jWUGlio5gLQTOtIoeR2WX////X4s9Atb/JRVCbBUpeRUq" + Ui(18, "/") + "9RUi0f2jn/+xDECgPCjAEQAABN4AAANIAAAAQVTEFNRTMuMTAw" + Ui(97, "V") + "Q==", this.audio.loop = !1, this.audio.load();
9078
+ this.audio = t, this.audio.controls = !1, this.audio.disableRemotePlayback = !0, this.audio.preload = "auto", this.audio.src = "data:audio/mpeg;base64,//uQx" + Pi(23, "A") + "WGluZwAAAA8AAAACAAACcQCA" + Pi(16, "gICA") + Pi(66, "/") + "8AAABhTEFNRTMuMTAwA8MAAAAAAAAAABQgJAUHQQAB9AAAAnGMHkkI" + Pi(320, "A") + "//sQxAADgnABGiAAQBCqgCRMAAgEAH" + Pi(15, "/") + "7+n/9FTuQsQH//////2NG0jWUGlio5gLQTOtIoeR2WX////X4s9Atb/JRVCbBUpeRUq" + Pi(18, "/") + "9RUi0f2jn/+xDECgPCjAEQAABN4AAANIAAAAQVTEFNRTMuMTAw" + Pi(97, "V") + "Q==", this.audio.loop = !1, this.audio.load();
9077
9079
  else
9078
9080
  throw new Error("Failed to create audio tag");
9079
9081
  }
@@ -9194,7 +9196,7 @@ const Cc = class Cc {
9194
9196
  }
9195
9197
  };
9196
9198
  r(Cc, "create", (e, t, i, n, o, c) => new Cc(e, t, i, n, o, c));
9197
- let Xh = Cc;
9199
+ let Qh = Cc;
9198
9200
  const Rc = class Rc {
9199
9201
  constructor(e, t, i, n, { muted: o, volume: c, type: h, poster: u }) {
9200
9202
  r(this, "logger");
@@ -9262,7 +9264,7 @@ const Rc = class Rc {
9262
9264
  isMuted: this.muted,
9263
9265
  volume: this.volume
9264
9266
  };
9265
- Cs(e, this.volumeState) || (this.volumeState = e, this.emitter.emit("volume state", this.volumeState));
9267
+ Yn(e, this.volumeState) || (this.volumeState = e, this.emitter.emit("volume state", this.volumeState));
9266
9268
  });
9267
9269
  this.logger = t, this.emitter = e, this.pool = i, this._userProvidedMuted = o, this.mediaElement = new Ah({
9268
9270
  poster: u,
@@ -9386,7 +9388,7 @@ class KA {
9386
9388
  this.sourceBuffer = e, this.sourceBuffer.addEventListener("updateend", this.handleQueue);
9387
9389
  }
9388
9390
  }
9389
- class im extends Ei {
9391
+ class im extends ki {
9390
9392
  constructor() {
9391
9393
  super();
9392
9394
  r(this, "MediaSource", Jn());
@@ -9971,9 +9973,9 @@ const Yh = () => ({
9971
9973
  let n = !1;
9972
9974
  if (e.from) {
9973
9975
  const U = (P = this.metrics.levels[t]) != null ? P : Yh();
9974
- t < i ? U.upgradesFromLevel.push(Date.now()) : U.downgradesFromLevel.push(Date.now()), Pi(U.activeRanges);
9976
+ t < i ? U.upgradesFromLevel.push(Date.now()) : U.downgradesFromLevel.push(Date.now()), xi(U.activeRanges);
9975
9977
  const B = U.bufferingRanges[U.bufferingRanges.length - 1];
9976
- n = !!B && !B.end, Pi(U.bufferingRanges), this.metrics.levels[t] = U;
9978
+ n = !!B && !B.end, xi(U.bufferingRanges), this.metrics.levels[t] = U;
9977
9979
  }
9978
9980
  if (e.to) {
9979
9981
  const U = (E = this.metrics.levels[i]) != null ? E : Yh();
@@ -10012,9 +10014,9 @@ const Yh = () => ({
10012
10014
  r(this, "stopBuffering", () => {
10013
10015
  if (this.currentLevel) {
10014
10016
  const e = this.metrics.levels[this.currentLevel];
10015
- e && Pi(e.bufferingRanges);
10017
+ e && xi(e.bufferingRanges);
10016
10018
  }
10017
- Pi(this.metrics.general.bufferingRanges);
10019
+ xi(this.metrics.general.bufferingRanges);
10018
10020
  });
10019
10021
  r(this, "startBuffering", () => {
10020
10022
  if (this.currentLevel) {
@@ -10026,9 +10028,9 @@ const Yh = () => ({
10026
10028
  r(this, "unsetActive", () => {
10027
10029
  if (this.currentLevel) {
10028
10030
  const e = this.metrics.levels[this.currentLevel];
10029
- e && Pi(e.activeRanges);
10031
+ e && xi(e.activeRanges);
10030
10032
  }
10031
- Pi(this.metrics.general.activeRanges);
10033
+ xi(this.metrics.general.activeRanges);
10032
10034
  });
10033
10035
  r(this, "getQualityIndex", (e) => {
10034
10036
  var i, n;
@@ -10085,20 +10087,20 @@ const Mc = class Mc {
10085
10087
  r(this, "getLanguages", () => this.languages);
10086
10088
  r(this, "getVideoRendition", (e, t = this.getCurrentSubscription().channelId) => {
10087
10089
  const i = this.getRendition(e, t);
10088
- if (i && ys(i))
10090
+ if (i && Ss(i))
10089
10091
  return i;
10090
10092
  });
10091
10093
  r(this, "getAudioRenditions", (e) => {
10092
10094
  const t = this.renditions.get(e);
10093
- return t == null ? void 0 : t.filter((n) => Ss(n));
10095
+ return t == null ? void 0 : t.filter((n) => vs(n));
10094
10096
  });
10095
10097
  r(this, "getVideoRenditions", (e) => {
10096
10098
  const t = this.renditions.get(e);
10097
- return t == null ? void 0 : t.filter((n) => ys(n));
10099
+ return t == null ? void 0 : t.filter((n) => Ss(n));
10098
10100
  });
10099
10101
  r(this, "getAudioRendition", (e, t = this.getCurrentSubscription().channelId) => {
10100
10102
  const i = this.getRendition(e, t);
10101
- if (i && Ss(i))
10103
+ if (i && vs(i))
10102
10104
  return i;
10103
10105
  });
10104
10106
  r(this, "getRendition", (e, t = this.getCurrentSubscription().channelId) => {
@@ -10134,7 +10136,7 @@ const Mc = class Mc {
10134
10136
  const { channelId: i, initiator: n } = e, o = this.getRenditionLevel(t), c = /* @__PURE__ */ new Set();
10135
10137
  ((l = this.renditions.get(i)) != null ? l : []).filter((p) => p.codec !== "webvtt").forEach((p) => p.language ? c.add(p.language) : void 0), this.languages = Array.from(c), this.renditionLevels = this.createRenditionLevels(e);
10136
10138
  const u = this.getRenditionLevel(e);
10137
- Cs(o, u) || (this.renditionLevelChangeCount++, this.emitter.emit("rendition level changed", {
10139
+ Yn(o, u) || (this.renditionLevelChangeCount++, this.emitter.emit("rendition level changed", {
10138
10140
  to: u,
10139
10141
  from: o,
10140
10142
  reason: n ? "manual" : "abr"
@@ -10142,7 +10144,7 @@ const Mc = class Mc {
10142
10144
  });
10143
10145
  r(this, "createRenditionLevels", (e) => {
10144
10146
  var p;
10145
- const { video: t, audio: i, channelId: n } = e, o = (p = this.renditions.get(n)) != null ? p : [], c = o.filter(ys).filter((g) => t && g.codec === t.codec), h = o.filter(Ss).filter((g) => i && g.codec === i.codec && g.language === i.language), u = Math.max(c.length, h.length), l = [];
10147
+ const { video: t, audio: i, channelId: n } = e, o = (p = this.renditions.get(n)) != null ? p : [], c = o.filter(Ss).filter((g) => t && g.codec === t.codec), h = o.filter(vs).filter((g) => i && g.codec === i.codec && g.language === i.language), u = Math.max(c.length, h.length), l = [];
10146
10148
  for (let g = 0; g < u; g++) {
10147
10149
  const w = c[Math.min(c.length - 1, g)], b = h[Math.min(h.length - 1, g)];
10148
10150
  l.push({
@@ -10158,7 +10160,7 @@ const Mc = class Mc {
10158
10160
  };
10159
10161
  r(Mc, "create", (e, t) => new Mc(e, t));
10160
10162
  let eu = Mc;
10161
- const ir = (s) => JSON.parse(JSON.stringify(s)), sw = 1e4, Lc = class Lc {
10163
+ const sr = (s) => JSON.parse(JSON.stringify(s)), sw = 1e4, Lc = class Lc {
10162
10164
  constructor(e, t, i) {
10163
10165
  r(this, "logger");
10164
10166
  r(this, "timers", new Ae());
@@ -10209,16 +10211,16 @@ const ir = (s) => JSON.parse(JSON.stringify(s)), sw = 1e4, Lc = class Lc {
10209
10211
  });
10210
10212
  r(this, "isNewSubscription", () => {
10211
10213
  const e = ["burstMs", "meta", "initiator", "channelGroupId"];
10212
- return !Cs(Iu(this.currentSubscription, e), Iu(this.targetSubscription, e));
10214
+ return !Yn(Iu(this.currentSubscription, e), Iu(this.targetSubscription, e));
10213
10215
  });
10214
10216
  r(this, "onSubscriptionChanged", ({ to: e, reset: t }) => {
10215
- this.logger.debug("onSubscriptionChanged", { to: e, reset: t }), t ? this.targetSubscription = ir(this.currentSubscription) : this.currentSubscription = ir(e), this._isSwitchingSubscription = this.isNewSubscription();
10217
+ this.logger.debug("onSubscriptionChanged", { to: e, reset: t }), t ? this.targetSubscription = sr(this.currentSubscription) : this.currentSubscription = sr(e), this._isSwitchingSubscription = this.isNewSubscription();
10216
10218
  });
10217
10219
  r(this, "scheduleSubscriptionChange", () => {
10218
- this.targetSubscription = ir(this.targetSubscription), this._isSwitchingSubscription = this.isNewSubscription();
10220
+ this.targetSubscription = sr(this.targetSubscription), this._isSwitchingSubscription = this.isNewSubscription();
10219
10221
  const e = this.currentSubscription.channelId, t = this.targetSubscription.channelId, i = e !== t;
10220
10222
  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(() => {
10221
- this.currentSubscription.channelId === e && this.targetSubscription.channelId === t && (this.logger.warn("Channel switch timeout", t), this.targetSubscription = ir(this.currentSubscription), this.emitter.emit("channel switch timeout", t));
10223
+ this.currentSubscription.channelId === e && this.targetSubscription.channelId === t && (this.logger.warn("Channel switch timeout", t), this.targetSubscription = sr(this.currentSubscription), this.emitter.emit("channel switch timeout", t));
10222
10224
  }, sw), this.pendingSubscriptionTimeoutId = this.timers.setTimeout(
10223
10225
  () => this.emitter.emit("send signal", {
10224
10226
  type: "subscribe",
@@ -10227,7 +10229,7 @@ const ir = (s) => JSON.parse(JSON.stringify(s)), sw = 1e4, Lc = class Lc {
10227
10229
  0
10228
10230
  ));
10229
10231
  });
10230
- this.logger = e, this.targetSubscription = t, this.currentSubscription = ir(t), this.emitter = i, this.emitter.on("subscription changed", this.onSubscriptionChanged);
10232
+ this.logger = e, this.targetSubscription = t, this.currentSubscription = sr(t), this.emitter = i, this.emitter.on("subscription changed", this.onSubscriptionChanged);
10231
10233
  }
10232
10234
  };
10233
10235
  r(Lc, "create", (e, t, i) => new Lc(e, i, t));
@@ -10726,7 +10728,7 @@ const nd = 5e3, nw = () => Id() || Em(), rw = () => nw() ? 100 : 0, rd = (s) =>
10726
10728
  const i = this.channelSyncInfo.get(t);
10727
10729
  if (!i)
10728
10730
  return;
10729
- const n = Qt(i.timeDifferences.items());
10731
+ const n = Xt(i.timeDifferences.items());
10730
10732
  Math.abs(n.average) > e && (this.logger.info("Adjusting sync info", O(S({}, n), { tolerance: e })), i.timestamp += n.average, this.syncInfoCorrectionCount++, i.timeDifferences.clear());
10731
10733
  }
10732
10734
  /**
@@ -10919,8 +10921,8 @@ const uw = 6, dw = (s) => {
10919
10921
  let e = [s], t = 0, i = 0, n = !1;
10920
10922
  const o = (h, u) => {
10921
10923
  var I, P, E;
10922
- h.flags && ur(h.flags) && (t = (I = h.compositionTimeOffset) != null ? I : 0), h.timestamp += t, h.compositionTimeOffset = ((P = h.compositionTimeOffset) != null ? P : 0) - t;
10923
- const l = h.timestamp / h.timescale, g = u.flags && ur(u.flags) ? (E = u.compositionTimeOffset) != null ? E : 0 : t, b = (u.timestamp + g) / u.timescale, v = Math.max(0, Math.round((b - l) * h.timescale));
10924
+ h.flags && dr(h.flags) && (t = (I = h.compositionTimeOffset) != null ? I : 0), h.timestamp += t, h.compositionTimeOffset = ((P = h.compositionTimeOffset) != null ? P : 0) - t;
10925
+ const l = h.timestamp / h.timescale, g = u.flags && dr(u.flags) ? (E = u.compositionTimeOffset) != null ? E : 0 : t, b = (u.timestamp + g) / u.timescale, v = Math.max(0, Math.round((b - l) * h.timescale));
10924
10926
  return v > 0 && (i = v), O(S({}, h), {
10925
10927
  /*
10926
10928
  During resync timeshifts we may end up with negative durations (normalized to 0 above) which is not allowed in mse (the MseModule
@@ -10930,7 +10932,7 @@ const uw = 6, dw = (s) => {
10930
10932
  });
10931
10933
  };
10932
10934
  return (h, u = !1) => {
10933
- if (h.flags && ur(h.flags) && u && (n = !n), !(u && e.length < uw && n) && e.length > 0) {
10935
+ if (h.flags && dr(h.flags) && u && (n = !n), !(u && e.length < uw && n) && e.length > 0) {
10934
10936
  n = !1;
10935
10937
  let p = h;
10936
10938
  for (let w = e.length - 1; w > 0; w--) {
@@ -10947,11 +10949,11 @@ const uw = 6, dw = (s) => {
10947
10949
  return e.push(h), [];
10948
10950
  };
10949
10951
  }, lw = (s, e, t) => {
10950
- if (ys(e))
10952
+ if (Ss(e))
10951
10953
  return S(O(S({}, s), {
10952
10954
  type: "video",
10953
10955
  codec: e.codec,
10954
- isSync: ur(s.flags),
10956
+ isSync: dr(s.flags),
10955
10957
  data: s.payload,
10956
10958
  duration: 0,
10957
10959
  width: e.width,
@@ -10965,7 +10967,7 @@ const uw = 6, dw = (s) => {
10965
10967
  sampleRate: e.sampleRate,
10966
10968
  codec: e.codec,
10967
10969
  language: e.language,
10968
- isSync: ur(s.flags),
10970
+ isSync: dr(s.flags),
10969
10971
  data: s.payload,
10970
10972
  duration: 0
10971
10973
  });
@@ -11034,8 +11036,8 @@ const ad = (s, e) => s && typeof s == "object" && e in s, fw = (s) => !(typeof s
11034
11036
  throw new Error("missing channelId");
11035
11037
  return !0;
11036
11038
  };
11037
- var ws, Fe, bs;
11038
- const Pt = class Pt extends Ei {
11039
+ var bs, Fe, ys;
11040
+ const Pt = class Pt extends ki {
11039
11041
  constructor(t) {
11040
11042
  super();
11041
11043
  // 10s
@@ -11048,7 +11050,7 @@ const Pt = class Pt extends Ei {
11048
11050
  r(this, "options");
11049
11051
  r(this, "element");
11050
11052
  r(this, "playbackSource");
11051
- r(this, "emitter", new Ei());
11053
+ r(this, "emitter", new ki());
11052
11054
  r(this, "logger");
11053
11055
  r(this, "modules");
11054
11056
  r(this, "clientIp");
@@ -11062,13 +11064,13 @@ const Pt = class Pt extends Ei {
11062
11064
  r(this, "pool", new Eu(Pt.MAX_POOL_SIZE));
11063
11065
  r(this, "userAgentInformation", new mw());
11064
11066
  r(this, "encryptedMediaExtensions");
11065
- d(this, ws, 0);
11067
+ d(this, bs, 0);
11066
11068
  d(this, Fe, []);
11067
11069
  r(this, "sampleProcessingSesssions", /* @__PURE__ */ new Map());
11068
11070
  r(this, "sizes", /* @__PURE__ */ new Map());
11069
11071
  r(this, "isSuspended", !0);
11070
11072
  r(this, "disconnectTimeout");
11071
- d(this, bs);
11073
+ d(this, ys);
11072
11074
  /**
11073
11075
  * Attaches the video view to a DOM element. The Vindral video view will be sized to fill this element while
11074
11076
  * maintaining the correct aspect ratio.
@@ -11209,9 +11211,9 @@ const Pt = class Pt extends Ei {
11209
11211
  const i = yield Promise.all(
11210
11212
  t.map((h) => f(this, null, function* () {
11211
11213
  var p, g, w, b;
11212
- if (Ss(h))
11213
- return !(this.willUseMediaSource() && !((p = Jn()) != null && p.isTypeSupported(ei(h))));
11214
- if (!ys(h) || !this.isSupportedVideoCodecProfile(h.codec, h.codecString))
11214
+ if (vs(h))
11215
+ return !(this.willUseMediaSource() && !((p = Jn()) != null && p.isTypeSupported(ti(h))));
11216
+ if (!Ss(h) || !this.isSupportedVideoCodecProfile(h.codec, h.codecString))
11215
11217
  return !1;
11216
11218
  if (!this.willUseMediaSource()) {
11217
11219
  const v = this.options.get("advanced"), k = (g = v.wasmDecodingConstraint.bitRate) != null ? g : Number.MAX_SAFE_INTEGER, I = (w = v.wasmDecodingConstraint.width) != null ? w : Number.MAX_SAFE_INTEGER, P = (b = v.wasmDecodingConstraint.height) != null ? b : Number.MAX_SAFE_INTEGER;
@@ -11243,7 +11245,7 @@ const Pt = class Pt extends Ei {
11243
11245
  n,
11244
11246
  i,
11245
11247
  this.targetSubscription.audio.bitRate
11246
- ), h = this.options.get("media") === "audio" ? [] : this.options.get("videoCodecs", this.channelId), u = this.supportedAudioCodecs(), l = t.renditions.filter(Ss), p = t.renditions.filter(ys), g = u.find((k) => l.find((I) => I.codec === k) !== void 0), w = h.find((k) => p.find((I) => I.codec === k) !== void 0), b = l.map((k) => k.language);
11248
+ ), h = this.options.get("media") === "audio" ? [] : this.options.get("videoCodecs", this.channelId), u = this.supportedAudioCodecs(), l = t.renditions.filter(vs), p = t.renditions.filter(Ss), g = u.find((k) => l.find((I) => I.codec === k) !== void 0), w = h.find((k) => p.find((I) => I.codec === k) !== void 0), b = l.map((k) => k.language);
11247
11249
  if (this.logger.debug("supported and selected codecs", { audioCodecs: u, videoCodecs: h, audioCodec: g, videoCodec: w }), w) {
11248
11250
  const k = this.options.get("maxSize");
11249
11251
  this.modules.subscription.setVideoConstraint(S({
@@ -11265,7 +11267,7 @@ const Pt = class Pt extends Ei {
11265
11267
  r(this, "isSupportedVideoCodecProfile", (t, i) => {
11266
11268
  if (this.willUseMediaSource()) {
11267
11269
  const n = Jn();
11268
- return n ? n.isTypeSupported(ei({ codec: t, codecString: i })) : !0;
11270
+ return n ? n.isTypeSupported(ti({ codec: t, codecString: i })) : !0;
11269
11271
  }
11270
11272
  if (t === "h264") {
11271
11273
  const n = !!(i != null && i.startsWith("avc1.42")), o = !!(i != null && i.startsWith("avc1.66."));
@@ -11286,12 +11288,12 @@ const Pt = class Pt extends Ei {
11286
11288
  throw new M("No currentRenditionLevel", { code: "no_current_rendition_level", isFatal: !1 });
11287
11289
  if (t != null && t.video && i.push({
11288
11290
  type: "video",
11289
- mimeType: ei(t.video),
11291
+ mimeType: ti(t.video),
11290
11292
  codec: t.video.codec
11291
11293
  }), t != null && t.audio && i.push({
11292
11294
  type: "audio",
11293
11295
  codec: t.audio.codec,
11294
- mimeType: ei(t.audio)
11296
+ mimeType: ti(t.audio)
11295
11297
  }), i.length === 0)
11296
11298
  throw new M("Can't initialize decoding module without tracks", { code: "no_tracks", isFatal: !1 });
11297
11299
  if (this.willUseMediaSource() && this.element instanceof HTMLMediaElement)
@@ -11391,7 +11393,7 @@ const Pt = class Pt extends Ei {
11391
11393
  const t = this.modules.canvasModule ? this.options.get("iosMediaElementEnabled") : void 0;
11392
11394
  return S({
11393
11395
  uptime: Date.now() - this.createdAt,
11394
- version: "4.1.9-1-gd2bb86b5",
11396
+ version: "4.1.9-2-ga281ba4b",
11395
11397
  clientId: this.clientId,
11396
11398
  sessionId: this.sessionId,
11397
11399
  channelId: this.channelId,
@@ -11499,7 +11501,7 @@ const Pt = class Pt extends Ei {
11499
11501
  ), T = y.element();
11500
11502
  this.element = T.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") || (P = zo.create(this.logger.createContext("UnpauseModule"), T, b));
11501
11503
  } else {
11502
- const y = Xh.create(
11504
+ const y = Qh.create(
11503
11505
  this.emitter,
11504
11506
  this.logger.createContext("LegacyCanvasModule"),
11505
11507
  this.pool,
@@ -11528,7 +11530,7 @@ const Pt = class Pt extends Ei {
11528
11530
  this.playbackSource,
11529
11531
  w,
11530
11532
  this.willUseMediaSource() && !U
11531
- ), X = uu.create(this.logger.createContext("JitterModule")), Q = (this.options.get("edgeUrl") || this.options.get("url")).replace("wss://", "https://").replace("ws://", "http://").replace("//lb.", "//errors."), _e = new URL("/telemetry", Q).toString(), ie = Wo.create(
11533
+ ), Q = uu.create(this.logger.createContext("JitterModule")), X = (this.options.get("edgeUrl") || this.options.get("url")).replace("wss://", "https://").replace("ws://", "http://").replace("//lb.", "//errors."), _e = new URL("/telemetry", X).toString(), ie = Wo.create(
11532
11534
  this.logger.createContext("TelemetryModule"),
11533
11535
  this.emitter,
11534
11536
  {
@@ -11568,7 +11570,7 @@ const Pt = class Pt extends Ei {
11568
11570
  ),
11569
11571
  event: jh.create(this.emitter, this.logger.createContext("EventModule"), B),
11570
11572
  sync: B,
11571
- jitter: X,
11573
+ jitter: Q,
11572
11574
  documentState: b,
11573
11575
  connection: u,
11574
11576
  playback: w,
@@ -11629,7 +11631,7 @@ const Pt = class Pt extends Ei {
11629
11631
  switch (y) {
11630
11632
  case "upgrade":
11631
11633
  {
11632
- const se = Math.min(G + 1, L), dt = T[se], nm = (xe = this.modules.connection.estimatedBandwidth) != null ? xe : Ti(), rm = ((ce = (J = dt == null ? void 0 : dt.audio) == null ? void 0 : J.bitRate) != null ? ce : 0) + ((Ve = (Ne = dt == null ? void 0 : dt.video) == null ? void 0 : Ne.bitRate) != null ? Ve : 0), am = nm * 2 > rm;
11634
+ const se = Math.min(G + 1, L), dt = T[se], nm = (xe = this.modules.connection.estimatedBandwidth) != null ? xe : Ei(), rm = ((ce = (J = dt == null ? void 0 : dt.audio) == null ? void 0 : J.bitRate) != null ? ce : 0) + ((Ve = (Ne = dt == null ? void 0 : dt.video) == null ? void 0 : Ne.bitRate) != null ? Ve : 0), am = nm * 2 > rm;
11633
11635
  dt && am && this.modules.adaptivity.isQoSOk(dt) && (N = se);
11634
11636
  }
11635
11637
  break;
@@ -11656,8 +11658,8 @@ const Pt = class Pt extends Ei {
11656
11658
  audio: S(S({}, this.targetSubscription.audio), Z == null ? void 0 : Z.audio)
11657
11659
  })), this.emitter.emit("adapted level");
11658
11660
  }), this.emitter.on("text track data", (y) => {
11659
- const T = a(this, Fe).find((N) => N.language === y.language), G = this.modules.sync.getTimeshiftOffset() / 1e3, L = G - a(this, ws);
11660
- if (m(this, ws, G), T) {
11661
+ const T = a(this, Fe).find((N) => N.language === y.language), G = this.modules.sync.getTimeshiftOffset() / 1e3, L = G - a(this, bs);
11662
+ if (m(this, bs, G), T) {
11661
11663
  if (T.cues)
11662
11664
  for (const N of T.cues)
11663
11665
  N.startTime -= L, N.endTime -= L;
@@ -11674,13 +11676,13 @@ const Pt = class Pt extends Ei {
11674
11676
  this.clientIp = T.ip;
11675
11677
  break;
11676
11678
  case "renditions":
11677
- this.updateTextTracks(T.renditions), m(this, bs, this.filterRenditions(T.renditions).then((L) => {
11679
+ this.updateTextTracks(T.renditions), m(this, ys, this.filterRenditions(T.renditions).then((L) => {
11678
11680
  this.emitter.emit("renditions", {
11679
11681
  renditions: L,
11680
11682
  channelId: this.currentSubscription.channelId
11681
11683
  }), this.emit("rendition levels", this.modules.renditions.getRenditionLevels()), this.emitLanguagesIfChanged();
11682
11684
  }).finally(() => {
11683
- m(this, bs, void 0);
11685
+ m(this, ys, void 0);
11684
11686
  }));
11685
11687
  break;
11686
11688
  case "subscription changed":
@@ -11775,7 +11777,7 @@ const Pt = class Pt extends Ei {
11775
11777
  ut && this.attach(ut), this.logger.info("Created Vindral instance", { options: this.options });
11776
11778
  const Re = (y) => f(this, null, function* () {
11777
11779
  const T = y.channelId;
11778
- a(this, bs) && (yield a(this, bs));
11780
+ a(this, ys) && (yield a(this, ys));
11779
11781
  const F = this.modules.renditions.getRendition(y.renditionId, T);
11780
11782
  if (!ig(y.flags)) {
11781
11783
  if (sg(y.flags)) {
@@ -11783,8 +11785,8 @@ const Pt = class Pt extends Ei {
11783
11785
  if (y.renditionId !== 0) {
11784
11786
  const Z = Am(L);
11785
11787
  if (Z && Z.language !== void 0) {
11786
- const J = new Jd().parse(Z.content || ""), ce = N / 1e3, Ne = a(this, Fe).find((se) => se.language === Z.language), Ve = ce - a(this, ws);
11787
- if (m(this, ws, ce), Ne) {
11788
+ const J = new Jd().parse(Z.content || ""), ce = N / 1e3, Ne = a(this, Fe).find((se) => se.language === Z.language), Ve = ce - a(this, bs);
11789
+ if (m(this, bs, ce), Ne) {
11788
11790
  if (Ne.cues)
11789
11791
  for (const se of Ne.cues)
11790
11792
  se.startTime -= Ve, se.endTime -= Ve;
@@ -11813,7 +11815,7 @@ const Pt = class Pt extends Ei {
11813
11815
  channelId: T
11814
11816
  }), N = Zp(L.codec, L.payload);
11815
11817
  N && this.sizes.set(L.renditionId, N);
11816
- const Z = ei({ codec: F.codec, codecString: F.codecString });
11818
+ const Z = ti({ codec: F.codec, codecString: F.codecString });
11817
11819
  this.emitter.emit("init segment", { initSegment: L, mimeType: Z }), this.emit("initialized media");
11818
11820
  } else {
11819
11821
  const L = lw(y, F, this.sizes.get(y.renditionId));
@@ -11837,7 +11839,7 @@ const Pt = class Pt extends Ei {
11837
11839
  }
11838
11840
  }
11839
11841
  });
11840
- this.options.get("maxVideoBitRate") !== Number.MAX_SAFE_INTEGER && (this.maxVideoBitRate = this.options.get("maxVideoBitRate")), this.options.get("maxAudioBitRate") !== Number.MAX_SAFE_INTEGER && (this.maxAudioBitRate = this.options.get("maxAudioBitRate")), Cs(this.options.get("maxSize"), fo()) || (this.maxSize = this.options.get("maxSize")), this.options.get("burstEnabled") && l.enableBurst(this.targetBufferTime);
11842
+ this.options.get("maxVideoBitRate") !== Number.MAX_SAFE_INTEGER && (this.maxVideoBitRate = this.options.get("maxVideoBitRate")), this.options.get("maxAudioBitRate") !== Number.MAX_SAFE_INTEGER && (this.maxAudioBitRate = this.options.get("maxAudioBitRate")), Yn(this.options.get("maxSize"), fo()) || (this.maxSize = this.options.get("maxSize")), this.options.get("burstEnabled") && l.enableBurst(this.targetBufferTime);
11841
11843
  }
11842
11844
  // TODO: volym blir nog fuckad när vi startar och mutear - måste testa om volume ändras när muted ändras
11843
11845
  /**
@@ -12119,7 +12121,7 @@ const Pt = class Pt extends Ei {
12119
12121
  */
12120
12122
  get maxVideoBitRate() {
12121
12123
  var t, i;
12122
- return (i = (t = this.modules.constraintCap.getCurrentConstraintCap()) == null ? void 0 : t.video.bitRate) != null ? i : Ti();
12124
+ return (i = (t = this.modules.constraintCap.getCurrentConstraintCap()) == null ? void 0 : t.video.bitRate) != null ? i : Ei();
12123
12125
  }
12124
12126
  /**
12125
12127
  * Set max video bit rate that will be subscribed to
@@ -12136,7 +12138,7 @@ const Pt = class Pt extends Ei {
12136
12138
  */
12137
12139
  get maxAudioBitRate() {
12138
12140
  var t, i;
12139
- return (i = (t = this.modules.constraintCap.getCurrentConstraintCap()) == null ? void 0 : t.audio.bitRate) != null ? i : Ti();
12141
+ return (i = (t = this.modules.constraintCap.getCurrentConstraintCap()) == null ? void 0 : t.audio.bitRate) != null ? i : Ei();
12140
12142
  }
12141
12143
  /**
12142
12144
  * Set max audio bit rate that will be subscribed to
@@ -12266,12 +12268,12 @@ const Pt = class Pt extends Ei {
12266
12268
  return this.browser.supportsMediaSource && this.options.get("mseEnabled");
12267
12269
  }
12268
12270
  };
12269
- ws = new WeakMap(), Fe = new WeakMap(), bs = new WeakMap(), r(Pt, "MAX_POOL_SIZE", 10), r(Pt, "DISCONNECT_TIMEOUT", 15 * 1e3), r(Pt, "REMOVE_CUE_THRESHOLD", 1e3 * 10);
12271
+ bs = new WeakMap(), Fe = new WeakMap(), ys = new WeakMap(), r(Pt, "MAX_POOL_SIZE", 10), r(Pt, "DISCONNECT_TIMEOUT", 15 * 1e3), r(Pt, "REMOVE_CUE_THRESHOLD", 1e3 * 10);
12270
12272
  let od = Pt;
12271
12273
  export {
12272
12274
  $m as A,
12273
12275
  Om as C,
12274
- Qm as D,
12276
+ Xm as D,
12275
12277
  ee as F,
12276
12278
  jm as I,
12277
12279
  ge as L,