@vindral/web-sdk 4.2.0-32-gbe3fbabd8 → 4.2.0-33-g96e854459

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.
@@ -5578,19 +5578,19 @@ function rf(e) {
5578
5578
  }
5579
5579
  //#endregion
5580
5580
  //#region ../../libs/moq/src/session/Session.ts
5581
- var af, of, sf = /* @__PURE__ */ new WeakMap(), cf = /* @__PURE__ */ new WeakMap(), lf = /* @__PURE__ */ new WeakMap(), uf = /* @__PURE__ */ new WeakMap(), df = /* @__PURE__ */ new WeakMap(), ff = /* @__PURE__ */ new WeakSet();
5581
+ var af, of, sf = /* @__PURE__ */ new WeakMap(), cf = /* @__PURE__ */ new WeakMap(), lf = /* @__PURE__ */ new WeakMap(), uf = /* @__PURE__ */ new WeakMap(), df = /* @__PURE__ */ new WeakMap(), ff = /* @__PURE__ */ new WeakMap(), pf = /* @__PURE__ */ new WeakSet();
5582
5582
  af = Ht(), of = Symbol.dispose;
5583
- var pf = class {
5583
+ var mf = class {
5584
5584
  constructor(t, n) {
5585
- S(this, ff), v(this, sf, void 0), v(this, cf, void 0), v(this, lf, void 0), v(this, uf, O.get().createContext("Session")), e(this, "subscriber", void 0), e(this, "publisher", void 0), v(this, df, void 0);
5585
+ S(this, pf), v(this, sf, void 0), v(this, cf, void 0), v(this, lf, new w()), v(this, uf, void 0), v(this, df, O.get().createContext("Session")), e(this, "subscriber", void 0), e(this, "publisher", void 0), v(this, ff, void 0);
5586
5586
  let [r, i] = we(100);
5587
- x(sf, this, t), x(lf, this, i), this.subscriber = new tf(this, r), this.publisher = new Fd(this, t, r), x(cf, this, y(ff, this, hf).call(this)), x(df, this, new A(n)), this.closed().then(() => this.close()).catch(o);
5587
+ x(sf, this, t), x(uf, this, i), this.subscriber = new tf(this, r), this.publisher = new Fd(this, t, r), x(cf, this, y(pf, this, gf).call(this)), x(ff, this, new A(n)), this.closed().then(() => this.close()).catch(o);
5588
5588
  }
5589
5589
  updateAuthToken(e) {
5590
- b(df, this).update(e);
5590
+ b(ff, this).update(e);
5591
5591
  }
5592
5592
  authToken() {
5593
- return b(df, this).current();
5593
+ return b(ff, this).current();
5594
5594
  }
5595
5595
  transportType() {
5596
5596
  return b(sf, this).transportType();
@@ -5599,53 +5599,56 @@ var pf = class {
5599
5599
  return b(sf, this).url();
5600
5600
  }
5601
5601
  closed() {
5602
- return b(cf, this);
5602
+ return Promise.race([b(cf, this), b(lf, this).promise]);
5603
+ }
5604
+ fail(e) {
5605
+ b(lf, this).pending && b(lf, this).resolve(e);
5603
5606
  }
5604
5607
  close() {
5605
5608
  try {
5606
- this.subscriber.close(), this.publisher.close(), b(lf, this).cancel("closing"), b(sf, this).close();
5609
+ this.subscriber.close(), this.publisher.close(), b(uf, this).cancel("closing"), b(sf, this).close();
5607
5610
  } catch (e) {
5608
- b(uf, this).warn("Error closing session", e);
5611
+ b(df, this).warn("Error closing session", e);
5609
5612
  }
5610
5613
  }
5611
5614
  [af]() {
5612
- y(ff, this, yf).call(this);
5615
+ y(pf, this, bf).call(this);
5613
5616
  }
5614
5617
  [of]() {
5615
- y(ff, this, yf).call(this);
5618
+ y(pf, this, bf).call(this);
5616
5619
  }
5617
5620
  };
5618
- function mf(e) {
5621
+ function hf(e) {
5619
5622
  var n = this;
5620
5623
  return t(function* () {
5621
5624
  var t, r;
5622
- switch (b(uf, n).debug("received message", e), yield (t = n.subscriber) == null ? void 0 : t.onMessage(e), yield (r = n.publisher) == null ? void 0 : r.onMessage(e), e.type) {
5625
+ switch (b(df, n).debug("received message", e), yield (t = n.subscriber) == null ? void 0 : t.onMessage(e), yield (r = n.publisher) == null ? void 0 : r.onMessage(e), e.type) {
5623
5626
  case J.Goaway:
5624
- b(uf, n).info("received GoAway", e);
5627
+ b(df, n).info("received GoAway", e);
5625
5628
  break;
5626
5629
  default: break;
5627
5630
  }
5628
5631
  })();
5629
5632
  }
5630
- function hf() {
5633
+ function gf() {
5631
5634
  var e = this;
5632
5635
  return t(function* () {
5633
5636
  return (yield Promise.all([
5634
- y(ff, e, _f).call(e),
5635
- y(ff, e, vf).call(e),
5636
- y(ff, e, gf).call(e)
5637
+ y(pf, e, vf).call(e),
5638
+ y(pf, e, yf).call(e),
5639
+ y(pf, e, _f).call(e)
5637
5640
  ])).find((e) => e instanceof Error);
5638
5641
  })();
5639
5642
  }
5640
- function gf() {
5643
+ function _f() {
5641
5644
  var e = this;
5642
5645
  return t(function* () {
5643
5646
  try {
5644
5647
  var t = !1, n = !1, r;
5645
5648
  try {
5646
- for (var i = U(b(lf, e)), a; t = !(a = yield i.next()).done; t = !1) {
5649
+ for (var i = U(b(uf, e)), a; t = !(a = yield i.next()).done; t = !1) {
5647
5650
  let t = a.value;
5648
- b(uf, e).debug("sending message", t), yield b(sf, e).writeMessage(t);
5651
+ b(df, e).debug("sending message", t), yield b(sf, e).writeMessage(t);
5649
5652
  }
5650
5653
  } catch (e) {
5651
5654
  n = !0, r = e;
@@ -5657,29 +5660,29 @@ function gf() {
5657
5660
  }
5658
5661
  }
5659
5662
  } catch (t) {
5660
- return b(uf, e).error("Error 'runOutgoingMessages'", t), t;
5663
+ return b(df, e).error("Error 'runOutgoingMessages'", t), t;
5661
5664
  }
5662
- b(uf, e).info("Return 'runOutgoingMessages'");
5665
+ b(df, e).info("Return 'runOutgoingMessages'");
5663
5666
  })();
5664
5667
  }
5665
- function _f() {
5668
+ function vf() {
5666
5669
  var e = this;
5667
5670
  return t(function* () {
5668
5671
  try {
5669
5672
  for (yield b(sf, e).afterHandshake();;) {
5670
5673
  let t = yield b(sf, e).readMessage().catch(() => void 0);
5671
5674
  if (!t) break;
5672
- yield y(ff, e, mf).call(e, t);
5675
+ yield y(pf, e, hf).call(e, t);
5673
5676
  }
5674
5677
  } catch (t) {
5675
- return b(uf, e).error("Error 'runControl'", t), t;
5678
+ return b(df, e).error("Error 'runControl'", t), t;
5676
5679
  } finally {
5677
- b(lf, e).cancel("closing");
5680
+ b(uf, e).cancel("closing");
5678
5681
  }
5679
- b(uf, e).info("Return 'runControl'");
5682
+ b(df, e).info("Return 'runControl'");
5680
5683
  })();
5681
5684
  }
5682
- function vf() {
5685
+ function yf() {
5683
5686
  var e = this;
5684
5687
  return t(function* () {
5685
5688
  try {
@@ -5690,128 +5693,128 @@ function vf() {
5690
5693
  yield (t = e.subscriber) == null ? void 0 : t.onObjectReader(n);
5691
5694
  }
5692
5695
  } catch (t) {
5693
- return b(uf, e).error("Error 'runObjects'", t), t;
5696
+ return b(df, e).error("Error 'runObjects'", t), t;
5694
5697
  }
5695
- b(uf, e).info("Return 'runObjects'");
5698
+ b(df, e).info("Return 'runObjects'");
5696
5699
  })();
5697
5700
  }
5698
- function yf() {
5699
- b(uf, this).debug("Enter 'dispose'"), this.close();
5701
+ function bf() {
5702
+ b(df, this).debug("Enter 'dispose'"), this.close();
5700
5703
  }
5701
5704
  //#endregion
5702
5705
  //#region ../../libs/moq/src/protocol/StreamIdBufferWriter.ts
5703
- var bf = 128, xf = /* @__PURE__ */ new WeakMap(), Sf = /* @__PURE__ */ new WeakMap(), Cf = /* @__PURE__ */ new WeakMap(), wf = /* @__PURE__ */ new WeakMap(), Tf = /* @__PURE__ */ new WeakMap(), Ef = /* @__PURE__ */ new WeakSet(), Df = class {
5706
+ var xf = 128, Sf = /* @__PURE__ */ new WeakMap(), Cf = /* @__PURE__ */ new WeakMap(), wf = /* @__PURE__ */ new WeakMap(), Tf = /* @__PURE__ */ new WeakMap(), Ef = /* @__PURE__ */ new WeakMap(), Df = /* @__PURE__ */ new WeakSet(), Of = class {
5704
5707
  constructor(e, t, n) {
5705
- S(this, Ef), v(this, xf, void 0), v(this, Sf, void 0), v(this, Cf, !0), v(this, wf, !1), v(this, Tf, void 0), x(xf, this, e), x(Sf, this, t), x(Tf, this, n);
5708
+ S(this, Df), v(this, Sf, void 0), v(this, Cf, void 0), v(this, wf, !0), v(this, Tf, !1), v(this, Ef, void 0), x(Sf, this, e), x(Cf, this, t), x(Ef, this, n);
5706
5709
  }
5707
5710
  writeUnsigned8(e) {
5708
5711
  var n = this;
5709
5712
  return t(function* () {
5710
- return y(Ef, n, Of).call(n), yield y(Ef, n, kf).call(n), b(xf, n).writeUnsigned8(e);
5713
+ return y(Df, n, kf).call(n), yield y(Df, n, Af).call(n), b(Sf, n).writeUnsigned8(e);
5711
5714
  })();
5712
5715
  }
5713
5716
  writeVarInt(e) {
5714
5717
  var n = this;
5715
5718
  return t(function* () {
5716
- return y(Ef, n, Of).call(n), yield y(Ef, n, kf).call(n), b(xf, n).writeVarInt(e);
5719
+ return y(Df, n, kf).call(n), yield y(Df, n, Af).call(n), b(Sf, n).writeVarInt(e);
5717
5720
  })();
5718
5721
  }
5719
5722
  writeBigVarInt(e) {
5720
5723
  var n = this;
5721
5724
  return t(function* () {
5722
- return y(Ef, n, Of).call(n), yield y(Ef, n, kf).call(n), b(xf, n).writeBigVarInt(e);
5725
+ return y(Df, n, kf).call(n), yield y(Df, n, Af).call(n), b(Sf, n).writeBigVarInt(e);
5723
5726
  })();
5724
5727
  }
5725
5728
  write(e) {
5726
5729
  var n = this;
5727
5730
  return t(function* () {
5728
- return y(Ef, n, Of).call(n), yield y(Ef, n, kf).call(n), b(xf, n).write(e);
5731
+ return y(Df, n, kf).call(n), yield y(Df, n, Af).call(n), b(Sf, n).write(e);
5729
5732
  })();
5730
5733
  }
5731
5734
  writeString(e) {
5732
5735
  var n = this;
5733
5736
  return t(function* () {
5734
- return y(Ef, n, Of).call(n), yield y(Ef, n, kf).call(n), b(xf, n).writeString(e);
5737
+ return y(Df, n, kf).call(n), yield y(Df, n, Af).call(n), b(Sf, n).writeString(e);
5735
5738
  })();
5736
5739
  }
5737
5740
  flush() {
5738
5741
  var e = this;
5739
5742
  return t(function* () {
5740
- y(Ef, e, Of).call(e), x(Cf, e, !0), yield b(xf, e).flush();
5743
+ y(Df, e, kf).call(e), x(wf, e, !0), yield b(Sf, e).flush();
5741
5744
  })();
5742
5745
  }
5743
5746
  close() {
5744
5747
  var e = this;
5745
5748
  return t(function* () {
5746
- b(wf, e) || (x(Cf, e, !0), yield y(Ef, e, kf).call(e, !1), yield b(xf, e).flush(), x(wf, e, !0), b(Tf, e).call(e));
5749
+ b(Tf, e) || (x(wf, e, !0), yield y(Df, e, Af).call(e, !1), yield b(Sf, e).flush(), x(Tf, e, !0), b(Ef, e).call(e));
5747
5750
  })();
5748
5751
  }
5749
5752
  };
5750
- function Of() {
5751
- if (b(wf, this)) throw Error("Stream is closed");
5753
+ function kf() {
5754
+ if (b(Tf, this)) throw Error("Stream is closed");
5752
5755
  }
5753
- function kf(e = !0) {
5754
- if (b(Cf, this)) return x(Cf, this, !1), b(xf, this).writeUnsigned8(b(Sf, this) | (e ? bf : 0));
5756
+ function Af(e = !0) {
5757
+ if (b(wf, this)) return x(wf, this, !1), b(Sf, this).writeUnsigned8(b(Cf, this) | (e ? xf : 0));
5755
5758
  }
5756
5759
  //#endregion
5757
5760
  //#region ../../libs/moq/src/transport/WebSocketConnection.ts
5758
- var Af = /* @__PURE__ */ new WeakMap(), jf = /* @__PURE__ */ new WeakMap(), Mf = /* @__PURE__ */ new WeakMap(), Nf = /* @__PURE__ */ new WeakMap(), Pf = /* @__PURE__ */ new WeakMap(), Ff = /* @__PURE__ */ new WeakMap(), If = /* @__PURE__ */ new WeakMap(), Lf = /* @__PURE__ */ new WeakSet(), Rf = class {
5761
+ var jf = /* @__PURE__ */ new WeakMap(), Mf = /* @__PURE__ */ new WeakMap(), Nf = /* @__PURE__ */ new WeakMap(), Pf = /* @__PURE__ */ new WeakMap(), Ff = /* @__PURE__ */ new WeakMap(), If = /* @__PURE__ */ new WeakMap(), Lf = /* @__PURE__ */ new WeakMap(), Rf = /* @__PURE__ */ new WeakSet(), zf = class {
5759
5762
  constructor(e, t) {
5760
- S(this, Lf), v(this, Af, void 0), v(this, jf, void 0), v(this, Mf, void 0), v(this, Nf, void 0), v(this, Pf, /* @__PURE__ */ new Map()), v(this, Ff, O.get().createContext("WebSocketConnection")), v(this, If, new Set(Array(128).fill(0).map((e, t) => t + 1))), x(Af, this, e), x(jf, this, t), x(Mf, this, new ReadableStream(new mc(e))), b(Af, this).addEventListener("close", (e) => {
5761
- b(Ff, this).info("WebSocket closed", {
5763
+ S(this, Rf), v(this, jf, void 0), v(this, Mf, void 0), v(this, Nf, void 0), v(this, Pf, void 0), v(this, Ff, /* @__PURE__ */ new Map()), v(this, If, O.get().createContext("WebSocketConnection")), v(this, Lf, new Set(Array(128).fill(0).map((e, t) => t + 1))), x(jf, this, e), x(Mf, this, t), x(Nf, this, new ReadableStream(new mc(e))), b(jf, this).addEventListener("close", (e) => {
5764
+ b(If, this).info("WebSocket closed", {
5762
5765
  code: e.code,
5763
5766
  reason: e.reason,
5764
5767
  wasClean: e.wasClean
5765
- }), b(jf, this).markPostHandshake(), b(Pf, this).forEach((e) => e.close());
5768
+ }), b(Mf, this).markPostHandshake(), b(Ff, this).forEach((e) => e.close());
5766
5769
  });
5767
5770
  }
5768
5771
  openSendStream() {
5769
- let e = b(If, this).values().next().value;
5772
+ let e = b(Lf, this).values().next().value;
5770
5773
  if (!e) throw Error("No stream IDs available");
5771
- return b(If, this).delete(e), Promise.resolve(new Df(new Vc(b(Af, this)), e, () => y(Lf, this, zf).call(this, e)));
5774
+ return b(Lf, this).delete(e), Promise.resolve(new Of(new Vc(b(jf, this)), e, () => y(Rf, this, Bf).call(this, e)));
5772
5775
  }
5773
5776
  transportType() {
5774
5777
  return "websocket";
5775
5778
  }
5776
5779
  url() {
5777
- return b(Af, this).url;
5780
+ return b(jf, this).url;
5778
5781
  }
5779
5782
  afterHandshake() {
5780
- return b(jf, this).postHandshake();
5783
+ return b(Mf, this).postHandshake();
5781
5784
  }
5782
5785
  objectStream() {
5783
5786
  var e = this;
5784
5787
  return t(function* () {
5785
5788
  for (;;) {
5786
- x(Nf, e, b(Mf, e).getReader());
5789
+ x(Pf, e, b(Nf, e).getReader());
5787
5790
  try {
5788
- let { value: n, done: r } = yield b(Nf, e).read();
5791
+ let { value: n, done: r } = yield b(Pf, e).read();
5789
5792
  if (r) return;
5790
5793
  let [i, a, o] = n;
5791
- if (b(Pf, e).has(T(a))) {
5792
- let t = b(Pf, e).get(T(a));
5794
+ if (b(Ff, e).has(T(a))) {
5795
+ let t = b(Ff, e).get(T(a));
5793
5796
  if (!t) throw Error("Stream not found");
5794
- o.length > 0 && (yield t.push(o)), i || (b(Ff, e).debug("Closing stream", { streamId: a }), t.close(), b(Pf, e).delete(T(a)));
5797
+ o.length > 0 && (yield t.push(o)), i || (b(If, e).debug("Closing stream", { streamId: a }), t.close(), b(Ff, e).delete(T(a)));
5795
5798
  } else {
5796
- b(Ff, e).debug("Creating new stream", { streamId: a });
5799
+ b(If, e).debug("Creating new stream", { streamId: a });
5797
5800
  let [n, r] = we(1e3), s = new ReadableStream({ pull(e) {
5798
5801
  return t(function* () {
5799
5802
  let t = yield r.pop();
5800
5803
  t ? e.enqueue(t) : e.close();
5801
5804
  })();
5802
5805
  } });
5803
- if (b(Pf, e).set(T(a), n), i || (b(Ff, e).debug("Closing new stream", { streamId: a }), yield s.cancel(), b(Pf, e).delete(T(a))), o.length > 0) return yield ic(new bc(o, s), a);
5806
+ if (b(Ff, e).set(T(a), n), i || (b(If, e).debug("Closing new stream", { streamId: a }), yield s.cancel(), b(Ff, e).delete(T(a))), o.length > 0) return yield ic(new bc(o, s), a);
5804
5807
  }
5805
5808
  } finally {
5806
5809
  var n;
5807
- (n = b(Nf, e)) == null || n.releaseLock();
5810
+ (n = b(Pf, e)) == null || n.releaseLock();
5808
5811
  }
5809
5812
  }
5810
5813
  })();
5811
5814
  }
5812
5815
  close() {
5813
5816
  var e;
5814
- return b(jf, this).cancel().catch(o), b(Mf, this).cancel("closing").catch(o), (e = b(Nf, this)) == null || e.cancel("closing").catch(o), b(Af, this).close();
5817
+ return b(Mf, this).cancel().catch(o), b(Nf, this).cancel("closing").catch(o), (e = b(Pf, this)) == null || e.cancel("closing").catch(o), b(jf, this).close();
5815
5818
  }
5816
5819
  closed() {
5817
5820
  return Promise.resolve();
@@ -5819,116 +5822,118 @@ var Af = /* @__PURE__ */ new WeakMap(), jf = /* @__PURE__ */ new WeakMap(), Mf =
5819
5822
  writeMessage(e) {
5820
5823
  var n = this;
5821
5824
  return t(function* () {
5822
- yield b(jf, n).write(e);
5825
+ yield b(Mf, n).write(e);
5823
5826
  })();
5824
5827
  }
5825
5828
  readMessage() {
5826
5829
  var e = this;
5827
5830
  return t(function* () {
5828
- return b(jf, e).read();
5831
+ return b(Mf, e).read();
5829
5832
  })();
5830
5833
  }
5831
5834
  };
5832
- function zf(e) {
5833
- b(If, this).add(e);
5835
+ function Bf(e) {
5836
+ b(Lf, this).add(e);
5834
5837
  }
5835
5838
  //#endregion
5836
5839
  //#region ../../libs/moq/src/transport/WebTransportConnection.ts
5837
- var Bf = /* @__PURE__ */ new WeakMap(), Vf = /* @__PURE__ */ new WeakMap(), Hf = /* @__PURE__ */ new WeakMap(), Uf = /* @__PURE__ */ new WeakMap(), Wf = /* @__PURE__ */ new WeakMap(), Gf = /* @__PURE__ */ new WeakMap(), Kf = /* @__PURE__ */ new WeakSet(), qf = class {
5840
+ var Vf = /* @__PURE__ */ new WeakMap(), Hf = /* @__PURE__ */ new WeakMap(), Uf = /* @__PURE__ */ new WeakMap(), Wf = /* @__PURE__ */ new WeakMap(), Gf = /* @__PURE__ */ new WeakMap(), Kf = /* @__PURE__ */ new WeakMap(), qf = /* @__PURE__ */ new WeakSet(), Jf = class {
5838
5841
  constructor(e, t, n) {
5839
- S(this, Kf), v(this, Bf, void 0), v(this, Vf, void 0), v(this, Hf, new ke(100)), v(this, Uf, void 0), v(this, Wf, 0), v(this, Gf, O.get().createContext("WebTransportConnection")), x(Uf, this, n), x(Bf, this, e), x(Vf, this, t), y(Kf, this, Jf).call(this).catch((e) => {
5840
- b(Gf, this).warn("Incoming streams handling ended with error", e), b(Vf, this).markPostHandshake(), b(Hf, this).close();
5841
- }), b(Bf, this).closed.then(() => {
5842
- b(Vf, this).markPostHandshake(), b(Hf, this).close();
5842
+ S(this, qf), v(this, Vf, void 0), v(this, Hf, void 0), v(this, Uf, new ke(100)), v(this, Wf, void 0), v(this, Gf, 0), v(this, Kf, O.get().createContext("WebTransportConnection")), x(Wf, this, n), x(Vf, this, e), x(Hf, this, t), y(qf, this, Yf).call(this).catch((e) => {
5843
+ b(Kf, this).warn("Incoming streams handling ended with error", e), b(Hf, this).markPostHandshake(), b(Uf, this).close();
5844
+ }), b(Vf, this).closed.then(() => {
5845
+ b(Hf, this).markPostHandshake(), b(Uf, this).close();
5843
5846
  });
5844
5847
  }
5845
5848
  openSendStream() {
5846
5849
  var e = this;
5847
5850
  return t(function* () {
5848
- return new Fc(yield b(Bf, e).createUnidirectionalStream());
5851
+ return new Fc(yield b(Vf, e).createUnidirectionalStream());
5849
5852
  })();
5850
5853
  }
5851
5854
  transportType() {
5852
5855
  return "webtransport";
5853
5856
  }
5854
5857
  url() {
5855
- return b(Uf, this);
5858
+ return b(Wf, this);
5856
5859
  }
5857
5860
  afterHandshake() {
5858
- return b(Vf, this).postHandshake();
5861
+ return b(Hf, this).postHandshake();
5859
5862
  }
5860
5863
  closed() {
5861
5864
  var e = this;
5862
5865
  return t(function* () {
5863
- yield b(Bf, e).closed;
5866
+ yield b(Vf, e).closed;
5864
5867
  })();
5865
5868
  }
5866
5869
  close() {
5867
- b(Bf, this).close();
5870
+ b(Vf, this).close();
5868
5871
  }
5869
5872
  writeMessage(e) {
5870
5873
  var n = this;
5871
5874
  return t(function* () {
5872
- yield b(Vf, n).write(e);
5875
+ yield b(Hf, n).write(e);
5873
5876
  })();
5874
5877
  }
5875
5878
  readMessage() {
5876
5879
  var e = this;
5877
5880
  return t(function* () {
5878
- return b(Vf, e).read();
5881
+ return b(Hf, e).read();
5879
5882
  })();
5880
5883
  }
5881
5884
  objectStream() {
5882
5885
  var e = this;
5883
5886
  return t(function* () {
5884
- return b(Hf, e).pop();
5887
+ return b(Uf, e).pop();
5885
5888
  })();
5886
5889
  }
5887
5890
  };
5888
- function Jf() {
5891
+ function Yf() {
5889
5892
  var e = this;
5890
5893
  return t(function* () {
5891
- let t = b(Bf, e).incomingUnidirectionalStreams.getReader();
5894
+ let t = b(Vf, e).incomingUnidirectionalStreams.getReader();
5892
5895
  for (;;) {
5893
5896
  var n;
5894
5897
  let { value: r, done: i } = yield t.read();
5895
5898
  if (i) {
5896
- b(Hf, e).close();
5899
+ b(Uf, e).close();
5897
5900
  return;
5898
5901
  }
5899
5902
  let a = new bc(new Uint8Array(), r);
5900
- yield b(Hf, e).push(ic(a, b(Wf, e))), x(Wf, e, (n = b(Wf, e), n++, n));
5903
+ yield b(Uf, e).push(ic(a, b(Gf, e))), x(Gf, e, (n = b(Gf, e), n++, n));
5901
5904
  }
5902
5905
  })();
5903
5906
  }
5904
5907
  //#endregion
5905
5908
  //#region ../../libs/moq/src/client.ts
5906
- var Yf = O.get().createContext("MoqClient");
5907
- function Xf(e) {
5908
- return Zf.apply(this, arguments);
5909
+ var Xf = O.get().createContext("MoqClient");
5910
+ function Zf(e) {
5911
+ return Qf.apply(this, arguments);
5909
5912
  }
5910
- function Zf() {
5911
- return Zf = t(function* (e) {
5913
+ function Qf() {
5914
+ return Qf = t(function* (e) {
5912
5915
  let t = new WebSocket(e.wsUrl || e.url);
5913
5916
  t.binaryType = "arraybuffer", yield new Promise((e, n) => {
5914
5917
  t.addEventListener("error", () => n(/* @__PURE__ */ Error("WebSocket error")), { once: !0 }), t.addEventListener("open", e, { once: !0 });
5915
5918
  });
5916
5919
  let n = Iu.wrapWebsocket(t), r = zu(n, e.role).catch((e) => {
5917
- throw Yf.warn("MoQ handshake failed, closing WebSocket", { error: e }), t.close(), e;
5920
+ throw Xf.warn("MoQ handshake failed, closing WebSocket", { error: e }), t.close(), e;
5918
5921
  });
5919
5922
  e.handshakePipelining || (yield r);
5920
- let i = new pf(new Rf(t, n), e.authToken);
5921
- return Yf.info("connected", {
5923
+ let i = new mf(new zf(t, n), e.authToken);
5924
+ return Xf.info("connected", {
5922
5925
  url: e.wsUrl || e.url,
5923
5926
  transport: "websocket"
5927
+ }), e.handshakePipelining && r.catch((e) => {
5928
+ i.fail(e);
5924
5929
  }), i;
5925
- }), Zf.apply(this, arguments);
5930
+ }), Qf.apply(this, arguments);
5926
5931
  }
5927
- function Qf(e) {
5928
- return $f.apply(this, arguments);
5932
+ function $f(e) {
5933
+ return ep.apply(this, arguments);
5929
5934
  }
5930
- function $f() {
5931
- return $f = t(function* (e) {
5935
+ function ep() {
5936
+ return ep = t(function* (e) {
5932
5937
  let t = new Uint8Array(64 / 2);
5933
5938
  for (let e = 0; e < t.length; e += 1) t[e] = parseInt("60b82e8021689e163c1041b4475ef9c86e7565bc45d1a0aa43f5148769f461c7".slice(2 * e, 2 * e + 2), 16);
5934
5939
  let n = new WebTransport(e.url, { congestionControl: "low-latency" });
@@ -5937,31 +5942,31 @@ function $f() {
5937
5942
  n.close();
5938
5943
  });
5939
5944
  e.handshakePipelining || (yield a);
5940
- let o = new pf(new qf(n, i, e.url.toString()), e.authToken);
5941
- return Yf.info("connected", {
5945
+ let o = new mf(new Jf(n, i, e.url.toString()), e.authToken);
5946
+ return Xf.info("connected", {
5942
5947
  url: e.url,
5943
5948
  transport: "webtransport"
5944
5949
  }), o;
5945
- }), $f.apply(this, arguments);
5950
+ }), ep.apply(this, arguments);
5946
5951
  }
5947
- function ep(e) {
5948
- return tp.apply(this, arguments);
5952
+ function tp(e) {
5953
+ return np.apply(this, arguments);
5949
5954
  }
5950
- function tp() {
5951
- return tp = t(function* (e) {
5955
+ function np() {
5956
+ return np = t(function* (e) {
5952
5957
  if (self.WebTransport && (e == null ? void 0 : e.preferredTransport) !== "websocket" && e.url.protocol.startsWith("https")) {
5953
- if (!e.websocketFallbackTimeoutMs) return Qf(e);
5954
- let t = Qf(e).catch(() => Xf(e));
5955
- return (yield Promise.race([t, pn(e.websocketFallbackTimeoutMs)])) || Xf(e);
5958
+ if (!e.websocketFallbackTimeoutMs) return $f(e);
5959
+ let t = $f(e).catch(() => Zf(e));
5960
+ return (yield Promise.race([t, pn(e.websocketFallbackTimeoutMs)])) || Zf(e);
5956
5961
  }
5957
- return Xf(e);
5958
- }), tp.apply(this, arguments);
5962
+ return Zf(e);
5963
+ }), np.apply(this, arguments);
5959
5964
  }
5960
5965
  //#endregion
5961
5966
  //#region ../../libs/moq/src/session/Track.ts
5962
- var np = /* @__PURE__ */ new WeakMap(), rp = class {
5967
+ var rp = /* @__PURE__ */ new WeakMap(), ip = class {
5963
5968
  constructor() {
5964
- v(this, np, {
5969
+ v(this, rp, {
5965
5970
  name: "",
5966
5971
  priority: 0,
5967
5972
  groupOrder: "ascending",
@@ -5969,16 +5974,16 @@ var np = /* @__PURE__ */ new WeakMap(), rp = class {
5969
5974
  });
5970
5975
  }
5971
5976
  name(e) {
5972
- return b(np, this).name = e, this;
5977
+ return b(rp, this).name = e, this;
5973
5978
  }
5974
5979
  priority(e) {
5975
- return b(np, this).priority = e, this;
5980
+ return b(rp, this).priority = e, this;
5976
5981
  }
5977
5982
  groupOrder(e) {
5978
- return b(np, this).groupOrder = e, this;
5983
+ return b(rp, this).groupOrder = e, this;
5979
5984
  }
5980
5985
  startGroup(e) {
5981
- return b(np, this).filterType = {
5986
+ return b(rp, this).filterType = {
5982
5987
  type: "absolute-start",
5983
5988
  start: {
5984
5989
  group: e,
@@ -5987,7 +5992,7 @@ var np = /* @__PURE__ */ new WeakMap(), rp = class {
5987
5992
  }, this;
5988
5993
  }
5989
5994
  range(e, t) {
5990
- return b(np, this).filterType = {
5995
+ return b(rp, this).filterType = {
5991
5996
  type: "absolute-range",
5992
5997
  start: {
5993
5998
  group: e,
@@ -6000,69 +6005,69 @@ var np = /* @__PURE__ */ new WeakMap(), rp = class {
6000
6005
  }, this;
6001
6006
  }
6002
6007
  build() {
6003
- return b(np, this);
6008
+ return b(rp, this);
6004
6009
  }
6005
- }, ip = /* @__PURE__ */ new WeakMap(), ap = /* @__PURE__ */ new WeakMap(), op = class {
6010
+ }, ap = /* @__PURE__ */ new WeakMap(), op = /* @__PURE__ */ new WeakMap(), sp = class {
6006
6011
  constructor(e, t) {
6007
- v(this, ip, void 0), v(this, ap, void 0), x(ip, this, e), x(ap, this, t);
6012
+ v(this, ap, void 0), v(this, op, void 0), x(ap, this, e), x(op, this, t);
6008
6013
  }
6009
6014
  subscribe(e, t = /* @__PURE__ */ new Map()) {
6010
- return b(ip, this).subscribe(this.namespace(), e, t);
6015
+ return b(ap, this).subscribe(this.namespace(), e, t);
6011
6016
  }
6012
6017
  closed() {
6013
- return b(ip, this).closed();
6018
+ return b(ap, this).closed();
6014
6019
  }
6015
6020
  namespace() {
6016
- return b(ap, this).namespace;
6021
+ return b(op, this).namespace;
6017
6022
  }
6018
6023
  };
6019
6024
  //#endregion
6020
6025
  //#region ../../libs/voq-catalog/src/catalog/Catalog.ts
6021
- function sp(e, t) {
6026
+ function cp(e, t) {
6022
6027
  return t ? [
6023
6028
  "com.vindral.moq",
6024
6029
  e,
6025
6030
  t
6026
6031
  ] : ["com.vindral.moq", e];
6027
6032
  }
6028
- function cp(e) {
6033
+ function lp(e) {
6029
6034
  let t = e[1];
6030
6035
  if (!t) throw Error("namespace must contain a channel ID");
6031
6036
  return t;
6032
6037
  }
6033
- function lp(e) {
6038
+ function up(e) {
6034
6039
  return "tracks" in e;
6035
6040
  }
6036
- function up(e) {
6041
+ function dp(e) {
6037
6042
  let t = new TextDecoder().decode(e);
6038
6043
  return JSON.parse(t);
6039
6044
  }
6040
6045
  //#endregion
6041
6046
  //#region ../../libs/voq/src/tracks/Track.ts
6042
- var dp, fp = /* @__PURE__ */ new WeakMap(), pp = /* @__PURE__ */ new WeakMap(), mp = /* @__PURE__ */ new WeakMap(), hp = /* @__PURE__ */ new WeakMap(), gp = /* @__PURE__ */ new WeakMap(), _p = /* @__PURE__ */ new WeakMap(), vp = /* @__PURE__ */ new WeakSet();
6043
- dp = Symbol.asyncIterator;
6044
- var yp = class e {
6047
+ var fp, pp = /* @__PURE__ */ new WeakMap(), mp = /* @__PURE__ */ new WeakMap(), hp = /* @__PURE__ */ new WeakMap(), gp = /* @__PURE__ */ new WeakMap(), _p = /* @__PURE__ */ new WeakMap(), vp = /* @__PURE__ */ new WeakMap(), yp = /* @__PURE__ */ new WeakSet();
6048
+ fp = Symbol.asyncIterator;
6049
+ var bp = class e {
6045
6050
  constructor(e, n) {
6046
6051
  var r = this;
6047
- S(this, vp), v(this, fp, void 0), v(this, pp, void 0), v(this, mp, new _(100)), v(this, hp, void 0), v(this, gp, void 0), v(this, _p, function() {
6052
+ S(this, yp), v(this, pp, void 0), v(this, mp, void 0), v(this, hp, new _(100)), v(this, gp, void 0), v(this, _p, void 0), v(this, vp, function() {
6048
6053
  var e = t(function* (e) {
6049
- if (!e) return b(fp, r).close();
6050
- if (b(hp, r)) return;
6051
- let t = b(mp, r).items().reduce((e, t) => e < t ? e : t, e);
6052
- x(hp, r, y(vp, r, bp).call(r, t, e)), b(hp, r).size === 0 && (yield b(fp, r).close());
6054
+ if (!e) return b(pp, r).close();
6055
+ if (b(gp, r)) return;
6056
+ let t = b(hp, r).items().reduce((e, t) => e < t ? e : t, e);
6057
+ x(gp, r, y(yp, r, xp).call(r, t, e)), b(gp, r).size === 0 && (yield b(pp, r).close());
6053
6058
  });
6054
6059
  return function(t) {
6055
6060
  return e.apply(this, arguments);
6056
6061
  };
6057
- }()), x(fp, this, e), x(pp, this, n), e.done().then(function() {
6062
+ }()), x(pp, this, e), x(mp, this, n), e.done().then(function() {
6058
6063
  var e = t(function* (e) {
6059
6064
  var t;
6060
- return b(_p, r).call(r, (t = e.finalInfo) == null ? void 0 : t.group);
6065
+ return b(vp, r).call(r, (t = e.finalInfo) == null ? void 0 : t.group);
6061
6066
  });
6062
6067
  return function(t) {
6063
6068
  return e.apply(this, arguments);
6064
6069
  };
6065
- }()).catch(o), x(gp, this, e.groups());
6070
+ }()).catch(o), x(_p, this, e.groups());
6066
6071
  }
6067
6072
  static subscribe(n, r) {
6068
6073
  return t(function* () {
@@ -6070,61 +6075,61 @@ var yp = class e {
6070
6075
  })();
6071
6076
  }
6072
6077
  subscribeId() {
6073
- return b(fp, this).id;
6078
+ return b(pp, this).id;
6074
6079
  }
6075
6080
  name() {
6076
- return b(fp, this).name;
6081
+ return b(pp, this).name;
6077
6082
  }
6078
6083
  largestGroupId() {
6079
- return b(pp, this);
6084
+ return b(mp, this);
6080
6085
  }
6081
6086
  needsRenewal() {
6082
- return b(fp, this).expiryState() === "active" && b(hp, this) === void 0;
6087
+ return b(pp, this).expiryState() === "active" && b(gp, this) === void 0;
6083
6088
  }
6084
6089
  endOfTrack(e) {
6085
- let t = b(mp, this).items().reduce((e, t) => e < t ? e : t, e);
6090
+ let t = b(hp, this).items().reduce((e, t) => e < t ? e : t, e);
6086
6091
  return this.update(t, e);
6087
6092
  }
6088
6093
  update(e, n) {
6089
6094
  var r = this;
6090
6095
  return t(function* () {
6091
- return x(hp, r, y(vp, r, bp).call(r, e, n)), b(hp, r).size === 0 && (yield b(fp, r).close()), b(fp, r).update(e, n);
6096
+ return x(gp, r, y(yp, r, xp).call(r, e, n)), b(gp, r).size === 0 && (yield b(pp, r).close()), b(pp, r).update(e, n);
6092
6097
  })();
6093
6098
  }
6094
6099
  unsubscribe() {
6095
- return b(fp, this).unsubscribe();
6100
+ return b(pp, this).unsubscribe();
6096
6101
  }
6097
6102
  next() {
6098
6103
  var e = this;
6099
6104
  return t(function* () {
6100
6105
  var t;
6101
- if (b(hp, e) && b(hp, e).size === 0) return {
6106
+ if (b(gp, e) && b(gp, e).size === 0) return {
6102
6107
  done: !0,
6103
6108
  value: void 0
6104
6109
  };
6105
- let n = yield b(gp, e).next();
6110
+ let n = yield b(_p, e).next();
6106
6111
  if (n.done) return n;
6107
6112
  let r = n.value.groupId();
6108
- return (t = b(hp, e)) == null || t.delete(r), b(mp, e).push(r), b(pp, e) || x(pp, e, r), x(pp, e, b(pp, e) < r ? r : b(pp, e)), n;
6113
+ return (t = b(gp, e)) == null || t.delete(r), b(hp, e).push(r), b(mp, e) || x(mp, e, r), x(mp, e, b(mp, e) < r ? r : b(mp, e)), n;
6109
6114
  })();
6110
6115
  }
6111
6116
  return() {
6112
- return b(fp, this).return();
6117
+ return b(pp, this).return();
6113
6118
  }
6114
- [dp]() {
6119
+ [fp]() {
6115
6120
  return this;
6116
6121
  }
6117
6122
  };
6118
- function bp(e, t) {
6123
+ function xp(e, t) {
6119
6124
  let n = /* @__PURE__ */ new Set();
6120
6125
  for (let r = e; r <= t; r++) n == null || n.add(r);
6121
- return b(mp, this).items().forEach((e) => {
6126
+ return b(hp, this).items().forEach((e) => {
6122
6127
  n == null || n.delete(e);
6123
6128
  }), n;
6124
6129
  }
6125
6130
  //#endregion
6126
6131
  //#region \0@oxc-project+runtime@0.115.0/helpers/asyncGeneratorDelegate.js
6127
- function xp(e) {
6132
+ function Sp(e) {
6128
6133
  var t = {}, n = !1;
6129
6134
  function r(t, r) {
6130
6135
  return n = !0, r = new Promise(function(n) {
@@ -6147,24 +6152,24 @@ function xp(e) {
6147
6152
  }
6148
6153
  //#endregion
6149
6154
  //#region ../../libs/voq/src/tracks/Renewable.ts
6150
- var Sp, Cp = /* @__PURE__ */ new WeakMap(), wp = /* @__PURE__ */ new WeakMap(), Tp = /* @__PURE__ */ new WeakMap(), Ep = /* @__PURE__ */ new WeakMap(), Dp = /* @__PURE__ */ new WeakSet(), Op = /* @__PURE__ */ new WeakMap();
6151
- Sp = Symbol.asyncIterator;
6152
- var kp = class e {
6155
+ var Cp, wp = /* @__PURE__ */ new WeakMap(), Tp = /* @__PURE__ */ new WeakMap(), Ep = /* @__PURE__ */ new WeakMap(), Dp = /* @__PURE__ */ new WeakMap(), Op = /* @__PURE__ */ new WeakSet(), kp = /* @__PURE__ */ new WeakMap();
6156
+ Cp = Symbol.asyncIterator;
6157
+ var Ap = class e {
6153
6158
  constructor(e) {
6154
6159
  var n = this;
6155
- S(this, Dp), v(this, Cp, void 0), v(this, wp, void 0), v(this, Tp, new ke(10)), v(this, Ep, void 0), v(this, Op, function() {
6160
+ S(this, Op), v(this, wp, void 0), v(this, Tp, void 0), v(this, Ep, new ke(10)), v(this, Dp, void 0), v(this, kp, function() {
6156
6161
  var e = t(function* (e, t) {
6157
6162
  try {
6158
6163
  var r = td();
6159
- let i = r.u(yield b(Cp, n).lock()), a = { subscribeId: i.value.subscribeId() };
6164
+ let i = r.u(yield b(wp, n).lock()), a = { subscribeId: i.value.subscribeId() };
6160
6165
  if (!i.value.needsRenewal()) {
6161
- b(Ep, n).debug("Subscription does not need renewal", a);
6166
+ b(Dp, n).debug("Subscription does not need renewal", a);
6162
6167
  return;
6163
6168
  }
6164
- let s = i.value.largestGroupId(), c = s !== void 0, l = new rp().name(t.name).priority(t.priority).groupOrder(t.groupOrder);
6165
- switch (a.largestGroupId = s, b(Ep, n).debug("Renewing subscription", a), t.filterType.type) {
6169
+ let s = i.value.largestGroupId(), c = s !== void 0, l = new ip().name(t.name).priority(t.priority).groupOrder(t.groupOrder);
6170
+ switch (a.largestGroupId = s, b(Dp, n).debug("Renewing subscription", a), t.filterType.type) {
6166
6171
  case "absolute-range":
6167
- b(Ep, n).debug("Absolute range is not renewed", a);
6172
+ b(Dp, n).debug("Absolute range is not renewed", a);
6168
6173
  return;
6169
6174
  case "absolute-start":
6170
6175
  case "latest-group":
@@ -6175,9 +6180,9 @@ var kp = class e {
6175
6180
  let u = l.build();
6176
6181
  a.newTrack = u;
6177
6182
  let [d] = yield Promise.all([e.subscribe(u), c ? i.value.update(s, s) : i.value.unsubscribe()]);
6178
- d.done().then(() => y(Dp, n, Ap).call(n, d)).catch(o), d.expiryNotification().then(() => b(Op, n).call(n, e, u)).catch(o);
6179
- let f = new yp(d, s);
6180
- i.value = f, yield b(Tp, n).push(f), b(Ep, n).info("Subscription renewed", a);
6183
+ d.done().then(() => y(Op, n, jp).call(n, d)).catch(o), d.expiryNotification().then(() => b(kp, n).call(n, e, u)).catch(o);
6184
+ let f = new bp(d, s);
6185
+ i.value = f, yield b(Ep, n).push(f), b(Dp, n).info("Subscription renewed", a);
6181
6186
  } catch (e) {
6182
6187
  r.e = e;
6183
6188
  } finally {
@@ -6187,24 +6192,24 @@ var kp = class e {
6187
6192
  return function(t, n) {
6188
6193
  return e.apply(this, arguments);
6189
6194
  };
6190
- }()), x(Cp, this, new Xt(e)), x(wp, this, e), x(Ep, this, O.get().createContext(`Renewable '${e.name()}'`));
6195
+ }()), x(wp, this, new Xt(e)), x(Tp, this, e), x(Dp, this, O.get().createContext(`Renewable '${e.name()}'`));
6191
6196
  }
6192
6197
  static subscribe(n, r, i) {
6193
6198
  return t(function* () {
6194
- let t = i == null ? void 0 : i.params, a = i == null ? void 0 : i.largestGroupId, s = yield n.subscribe(r, t), c = new e(new yp(s, a));
6195
- return s.done().then(() => y(Dp, c, Ap).call(c, s)).catch(o), s.expiryNotification().then(() => b(Op, c).call(c, n, r)).catch(o), c;
6199
+ let t = i == null ? void 0 : i.params, a = i == null ? void 0 : i.largestGroupId, s = yield n.subscribe(r, t), c = new e(new bp(s, a));
6200
+ return s.done().then(() => y(Op, c, jp).call(c, s)).catch(o), s.expiryNotification().then(() => b(kp, c).call(c, n, r)).catch(o), c;
6196
6201
  })();
6197
6202
  }
6198
6203
  largestGroupId() {
6199
- return b(Cp, this).unsafeValue().largestGroupId();
6204
+ return b(wp, this).unsafeValue().largestGroupId();
6200
6205
  }
6201
6206
  update(e, n) {
6202
6207
  var r = this;
6203
6208
  return t(function* () {
6204
6209
  try {
6205
6210
  var t = td();
6206
- let i = t.u(yield b(Cp, r).lock());
6207
- return b(Tp, r).close(), i.value.update(e, n);
6211
+ let i = t.u(yield b(wp, r).lock());
6212
+ return b(Ep, r).close(), i.value.update(e, n);
6208
6213
  } catch (e) {
6209
6214
  t.e = e;
6210
6215
  } finally {
@@ -6217,8 +6222,8 @@ var kp = class e {
6217
6222
  return t(function* () {
6218
6223
  try {
6219
6224
  var t = td();
6220
- let r = t.u(yield b(Cp, n).lock());
6221
- return b(Tp, n).close(), r.value.endOfTrack(e);
6225
+ let r = t.u(yield b(wp, n).lock());
6226
+ return b(Ep, n).close(), r.value.endOfTrack(e);
6222
6227
  } catch (e) {
6223
6228
  t.e = e;
6224
6229
  } finally {
@@ -6231,8 +6236,8 @@ var kp = class e {
6231
6236
  return t(function* () {
6232
6237
  try {
6233
6238
  var t = td();
6234
- let n = t.u(yield b(Cp, e).lock());
6235
- return b(Tp, e).close(), n.value.unsubscribe();
6239
+ let n = t.u(yield b(wp, e).lock());
6240
+ return b(Ep, e).close(), n.value.unsubscribe();
6236
6241
  } catch (e) {
6237
6242
  t.e = e;
6238
6243
  } finally {
@@ -6245,8 +6250,8 @@ var kp = class e {
6245
6250
  return t(function* () {
6246
6251
  try {
6247
6252
  var t = td();
6248
- let n = t.u(yield b(Cp, e).lock());
6249
- return b(Tp, e).close(), n.value.return();
6253
+ let n = t.u(yield b(wp, e).lock());
6254
+ return b(Ep, e).close(), n.value.return();
6250
6255
  } catch (e) {
6251
6256
  t.e = e;
6252
6257
  } finally {
@@ -6257,17 +6262,17 @@ var kp = class e {
6257
6262
  next() {
6258
6263
  var e = this;
6259
6264
  return t(function* () {
6260
- let t = yield b(wp, e).next();
6265
+ let t = yield b(Tp, e).next();
6261
6266
  if (t.done) {
6262
6267
  var n, r;
6263
- yield (n = (r = b(wp, e)).return) == null ? void 0 : n.call(r);
6264
- let t = yield b(Tp, e).pop();
6265
- if (t) return x(wp, e, t), e.next();
6268
+ yield (n = (r = b(Tp, e)).return) == null ? void 0 : n.call(r);
6269
+ let t = yield b(Ep, e).pop();
6270
+ if (t) return x(Tp, e, t), e.next();
6266
6271
  }
6267
6272
  return t;
6268
6273
  })();
6269
6274
  }
6270
- [Sp]() {
6275
+ [Cp]() {
6271
6276
  return this;
6272
6277
  }
6273
6278
  objects() {
@@ -6277,7 +6282,7 @@ var kp = class e {
6277
6282
  try {
6278
6283
  for (var i = U(e), a; t = !(a = yield k(i.next())).done; t = !1) try {
6279
6284
  var o = td();
6280
- yield* xp(U(o.a(a.value)));
6285
+ yield* Sp(U(o.a(a.value)));
6281
6286
  } catch (e) {
6282
6287
  o.e = e;
6283
6288
  } finally {
@@ -6295,16 +6300,16 @@ var kp = class e {
6295
6300
  })();
6296
6301
  }
6297
6302
  };
6298
- function Ap(e) {
6303
+ function jp(e) {
6299
6304
  var n = this;
6300
6305
  return t(function* () {
6301
6306
  var t;
6302
6307
  if (e.unsubscribed() || (t = e.range()) != null && t.endGroup) {
6303
- b(Ep, n).info("Server initiated subscribe done but the subscription is already closing");
6308
+ b(Dp, n).info("Server initiated subscribe done but the subscription is already closing");
6304
6309
  return;
6305
6310
  }
6306
- if (b(Cp, n).unsafeValue().subscribeId() !== e.id) {
6307
- b(Ep, n).info("subscribeId mismatch - the subscription already has been renewed");
6311
+ if (b(wp, n).unsafeValue().subscribeId() !== e.id) {
6312
+ b(Dp, n).info("subscribeId mismatch - the subscription already has been renewed");
6308
6313
  return;
6309
6314
  }
6310
6315
  return n.return();
@@ -6312,50 +6317,50 @@ function Ap(e) {
6312
6317
  }
6313
6318
  //#endregion
6314
6319
  //#region ../../libs/voq/src/tracks/Catalog.ts
6315
- var jp = "catalog";
6316
- function Mp(e) {
6317
- let t = up(e.payload);
6318
- if (!lp(t)) throw Error("unexpected catalog type");
6320
+ var Mp = "catalog";
6321
+ function Np(e) {
6322
+ let t = dp(e.payload);
6323
+ if (!up(t)) throw Error("unexpected catalog type");
6319
6324
  return t;
6320
6325
  }
6321
- var Np = /* @__PURE__ */ new WeakMap(), Pp = /* @__PURE__ */ new WeakMap(), Fp = /* @__PURE__ */ new WeakMap(), Ip = /* @__PURE__ */ new WeakMap(), Lp = /* @__PURE__ */ new WeakSet(), Rp = class e {
6326
+ var Pp = /* @__PURE__ */ new WeakMap(), Fp = /* @__PURE__ */ new WeakMap(), Ip = /* @__PURE__ */ new WeakMap(), Lp = /* @__PURE__ */ new WeakMap(), Rp = /* @__PURE__ */ new WeakSet(), zp = class e {
6322
6327
  constructor(e, t, n) {
6323
- S(this, Lp), v(this, Np, void 0), v(this, Pp, void 0), v(this, Fp, void 0), v(this, Ip, void 0), x(Pp, this, e), x(Np, this, t), x(Fp, this, n), x(Ip, this, y(Lp, this, zp).call(this)), this.closed().finally(() => b(Np, this).close()).catch(o);
6328
+ S(this, Rp), v(this, Pp, void 0), v(this, Fp, void 0), v(this, Ip, void 0), v(this, Lp, void 0), x(Fp, this, e), x(Pp, this, t), x(Ip, this, n), x(Lp, this, y(Rp, this, Bp).call(this)), this.closed().finally(() => b(Pp, this).close()).catch(o);
6324
6329
  }
6325
6330
  catalog() {
6326
- return b(Np, this);
6331
+ return b(Pp, this);
6327
6332
  }
6328
6333
  closed() {
6329
- return b(Ip, this);
6334
+ return b(Lp, this);
6330
6335
  }
6331
6336
  close() {
6332
6337
  var e = this;
6333
6338
  return t(function* () {
6334
- return b(Np, e).close(), (yield b(Pp, e).promise).unsubscribe();
6339
+ return b(Pp, e).close(), (yield b(Fp, e).promise).unsubscribe();
6335
6340
  })();
6336
6341
  }
6337
6342
  static start(n, r) {
6338
6343
  return t(function* () {
6339
- let t = w.fromPromise(kp.subscribe(n, new rp().name(r.catalogName || jp).groupOrder("ascending").build())), i = w.fromPromise(t.promise.then((e) => e.objects()));
6344
+ let t = w.fromPromise(Ap.subscribe(n, new ip().name(r.catalogName || Mp).groupOrder("ascending").build())), i = w.fromPromise(t.promise.then((e) => e.objects()));
6340
6345
  if (r.catalog) return new e(t, new A(r.catalog), i);
6341
6346
  let a = yield (yield i.promise).next();
6342
6347
  if (!a.value) throw Error("No catalog found");
6343
- return new e(t, new A(Mp(a.value)), i);
6348
+ return new e(t, new A(Np(a.value)), i);
6344
6349
  })();
6345
6350
  }
6346
6351
  };
6347
- function zp() {
6352
+ function Bp() {
6348
6353
  var e = this;
6349
6354
  return t(function* () {
6350
- let t = yield b(Fp, e).promise;
6355
+ let t = yield b(Ip, e).promise;
6351
6356
  var n = !1, r = !1, i;
6352
6357
  try {
6353
6358
  for (var a = U(t), o; n = !(o = yield a.next()).done; n = !1) {
6354
6359
  let t = o.value;
6355
6360
  {
6356
6361
  if (t.objectStatus !== H.Normal) continue;
6357
- let n = Mp(t);
6358
- b(Np, e).update(n);
6362
+ let n = Np(t);
6363
+ b(Pp, e).update(n);
6359
6364
  }
6360
6365
  }
6361
6366
  } catch (e) {
@@ -6371,51 +6376,51 @@ function zp() {
6371
6376
  }
6372
6377
  //#endregion
6373
6378
  //#region ../../libs/voq/src/tracks/Cmaf.ts
6374
- var Bp, Vp, Hp, Up, Wp, Gp, Kp, qp, Jp = /* @__PURE__ */ new WeakMap(), Yp = /* @__PURE__ */ new WeakMap(), Xp = /* @__PURE__ */ new WeakMap(), Zp = /* @__PURE__ */ new WeakMap(), Qp = /* @__PURE__ */ new WeakMap(), $p = /* @__PURE__ */ new WeakMap(), em = /* @__PURE__ */ new WeakMap(), tm = /* @__PURE__ */ new WeakMap(), nm = /* @__PURE__ */ new WeakSet();
6375
- Bp = Ht(), Vp = Symbol.dispose;
6376
- var rm = class {
6379
+ var Vp, Hp, Up, Wp, Gp, Kp, qp, Jp, Yp = /* @__PURE__ */ new WeakMap(), Xp = /* @__PURE__ */ new WeakMap(), Zp = /* @__PURE__ */ new WeakMap(), Qp = /* @__PURE__ */ new WeakMap(), $p = /* @__PURE__ */ new WeakMap(), em = /* @__PURE__ */ new WeakMap(), tm = /* @__PURE__ */ new WeakMap(), nm = /* @__PURE__ */ new WeakMap(), rm = /* @__PURE__ */ new WeakSet();
6380
+ Vp = Ht(), Hp = Symbol.dispose;
6381
+ var im = class {
6377
6382
  constructor(e, t) {
6378
- S(this, nm), v(this, Jp, void 0), v(this, Yp, void 0), v(this, Xp, void 0), v(this, Zp, void 0), v(this, Qp, void 0), v(this, $p, void 0), v(this, em, void 0), v(this, tm, 0), x(Jp, this, e), x(Yp, this, t);
6383
+ S(this, rm), v(this, Yp, void 0), v(this, Xp, void 0), v(this, Zp, void 0), v(this, Qp, void 0), v(this, $p, void 0), v(this, em, void 0), v(this, tm, void 0), v(this, nm, 0), x(Yp, this, e), x(Xp, this, t);
6379
6384
  }
6380
6385
  onFragment(e, t, n, r, i) {
6381
6386
  var a;
6382
- b(Xp, this) === void 0 && (x(Xp, this, e), x(Zp, this, t), x(Qp, this, n), x($p, this, r), b(Jp, this).debug("group start", {
6383
- name: b(Yp, this).name,
6387
+ b(Zp, this) === void 0 && (x(Zp, this, e), x(Qp, this, t), x($p, this, n), x(em, this, r), b(Yp, this).debug("group start", {
6388
+ name: b(Xp, this).name,
6384
6389
  groupId: e,
6385
6390
  startTimeMs: r,
6386
6391
  endTimeMs: i,
6387
6392
  subscribeId: t,
6388
6393
  mediaType: n,
6389
- namespace: b(Yp, this).namespace
6390
- })), x(tm, this, (a = b(tm, this), a++, a)), x(em, this, i);
6391
- }
6392
- [Bp]() {
6393
- y(nm, this, im).call(this);
6394
+ namespace: b(Xp, this).namespace
6395
+ })), x(nm, this, (a = b(nm, this), a++, a)), x(tm, this, i);
6394
6396
  }
6395
6397
  [Vp]() {
6396
- y(nm, this, im).call(this);
6398
+ y(rm, this, am).call(this);
6399
+ }
6400
+ [Hp]() {
6401
+ y(rm, this, am).call(this);
6397
6402
  }
6398
6403
  };
6399
- function im() {
6400
- b(Xp, this) !== void 0 && b($p, this) !== void 0 && b(em, this) !== void 0 && b(Jp, this).debug("group end", {
6401
- name: b(Yp, this).name,
6402
- groupId: b(Xp, this),
6403
- startTimeMs: b($p, this),
6404
- endTimeMs: b(em, this),
6405
- durationMs: b(em, this) - b($p, this),
6406
- fragmentCount: b(tm, this),
6407
- subscribeId: b(Zp, this),
6408
- mediaType: b(Qp, this),
6409
- namespace: b(Yp, this).namespace
6404
+ function am() {
6405
+ b(Zp, this) !== void 0 && b(em, this) !== void 0 && b(tm, this) !== void 0 && b(Yp, this).debug("group end", {
6406
+ name: b(Xp, this).name,
6407
+ groupId: b(Zp, this),
6408
+ startTimeMs: b(em, this),
6409
+ endTimeMs: b(tm, this),
6410
+ durationMs: b(tm, this) - b(em, this),
6411
+ fragmentCount: b(nm, this),
6412
+ subscribeId: b(Qp, this),
6413
+ mediaType: b($p, this),
6414
+ namespace: b(Xp, this).namespace
6410
6415
  });
6411
6416
  }
6412
- var am = /* @__PURE__ */ new WeakMap(), om = /* @__PURE__ */ new WeakMap(), sm = /* @__PURE__ */ new WeakMap(), cm = /* @__PURE__ */ new WeakMap(), lm = /* @__PURE__ */ new WeakSet();
6413
- Hp = Symbol.asyncIterator, Up = Vt(), Wp = Symbol.asyncDispose;
6414
- var um = class {
6417
+ var om = /* @__PURE__ */ new WeakMap(), sm = /* @__PURE__ */ new WeakMap(), cm = /* @__PURE__ */ new WeakMap(), lm = /* @__PURE__ */ new WeakMap(), um = /* @__PURE__ */ new WeakSet();
6418
+ Up = Symbol.asyncIterator, Wp = Vt(), Gp = Symbol.asyncDispose;
6419
+ var dm = class {
6415
6420
  constructor(t, n, r, i) {
6416
- S(this, lm), v(this, am, void 0), v(this, om, void 0), v(this, sm, void 0), e(this, "track", void 0), v(this, cm, O.get().createContext("CmafGroup")), this.track = i, x(am, this, r), x(om, this, t), x(sm, this, n);
6421
+ S(this, um), v(this, om, void 0), v(this, sm, void 0), v(this, cm, void 0), e(this, "track", void 0), v(this, lm, O.get().createContext("CmafGroup")), this.track = i, x(om, this, r), x(sm, this, t), x(cm, this, n);
6417
6422
  }
6418
- [Hp]() {
6423
+ [Up]() {
6419
6424
  var e = this;
6420
6425
  return Qt(function* () {
6421
6426
  try {
@@ -6423,18 +6428,18 @@ var um = class {
6423
6428
  let s = {
6424
6429
  name: e.track.trackObject.name,
6425
6430
  namespace: e.track.namespace
6426
- }, c = t.u(new rm(b(cm, e), s));
6431
+ }, c = t.u(new im(b(lm, e), s));
6427
6432
  var n = !1, r = !1, i;
6428
6433
  try {
6429
- for (var a = U(b(om, e)), o; n = !(o = yield k(a.next())).done; n = !1) {
6434
+ for (var a = U(b(sm, e)), o; n = !(o = yield k(a.next())).done; n = !1) {
6430
6435
  let t = o.value;
6431
6436
  {
6432
6437
  if (t.objectStatus === H.EndOfTrackAndGroup && (yield k(e.track.endOfTrack(t.groupId))), t.objectStatus !== H.Normal) continue;
6433
- let n = b(sm, e).createFragment(t.payload), r = n.timescale(), i = n.baseMediaDecodeTime() / r * 1e3, a = i + n.duration() / r * 1e3, o = b(am, e) / 1e3 * r;
6438
+ let n = b(cm, e).createFragment(t.payload), r = n.timescale(), i = n.baseMediaDecodeTime() / r * 1e3, a = i + n.duration() / r * 1e3, o = b(om, e) / 1e3 * r;
6434
6439
  n.updateBaseMediaDecodeTime(n.baseMediaDecodeTime() - o);
6435
6440
  let l = e.track.timestampRange();
6436
6441
  if (l && i >= l[1]) break;
6437
- b(cm, e).trace("fragment", C(C({}, s), {}, {
6442
+ b(lm, e).trace("fragment", C(C({}, s), {}, {
6438
6443
  startTime: i,
6439
6444
  endTime: a,
6440
6445
  subscribeId: t.subscribeId,
@@ -6460,41 +6465,41 @@ var um = class {
6460
6465
  }
6461
6466
  })();
6462
6467
  }
6463
- [Up]() {
6464
- return y(lm, this, dm).call(this);
6465
- }
6466
6468
  [Wp]() {
6467
- return y(lm, this, dm).call(this);
6469
+ return y(um, this, fm).call(this);
6470
+ }
6471
+ [Gp]() {
6472
+ return y(um, this, fm).call(this);
6468
6473
  }
6469
6474
  };
6470
- function dm() {
6475
+ function fm() {
6471
6476
  var e = this;
6472
6477
  return t(function* () {
6473
6478
  var t, n;
6474
- return yield (t = (n = b(om, e)).return) == null ? void 0 : t.call(n), Promise.resolve();
6479
+ return yield (t = (n = b(sm, e)).return) == null ? void 0 : t.call(n), Promise.resolve();
6475
6480
  })();
6476
6481
  }
6477
- var fm = /* @__PURE__ */ new WeakMap(), pm = /* @__PURE__ */ new WeakMap(), mm = /* @__PURE__ */ new WeakMap(), hm = /* @__PURE__ */ new WeakMap();
6478
- Gp = Symbol.asyncIterator, Kp = Vt(), qp = Symbol.asyncDispose;
6479
- var gm = class n {
6482
+ var pm = /* @__PURE__ */ new WeakMap(), mm = /* @__PURE__ */ new WeakMap(), hm = /* @__PURE__ */ new WeakMap(), gm = /* @__PURE__ */ new WeakMap();
6483
+ Kp = Symbol.asyncIterator, qp = Vt(), Jp = Symbol.asyncDispose;
6484
+ var _m = class n {
6480
6485
  constructor(t, n, r, i, a) {
6481
- v(this, fm, void 0), v(this, pm, void 0), v(this, mm, void 0), v(this, hm, void 0), e(this, "trackObject", void 0), e(this, "namespace", void 0), this.trackObject = t, this.namespace = n, x(pm, this, r), x(fm, this, i), x(mm, this, a);
6486
+ v(this, pm, void 0), v(this, mm, void 0), v(this, hm, void 0), v(this, gm, void 0), e(this, "trackObject", void 0), e(this, "namespace", void 0), this.trackObject = t, this.namespace = n, x(mm, this, r), x(pm, this, i), x(hm, this, a);
6482
6487
  }
6483
6488
  static subscribe(e, r, { timestampOffsetMs: i, startGroup: a, params: o }) {
6484
6489
  return t(function* () {
6485
6490
  if (r.format !== "cmaf") throw Error("format must be cmaf");
6486
- let t = new rp().name(r.name);
6491
+ let t = new ip().name(r.name);
6487
6492
  a && t.startGroup(a);
6488
6493
  let s = t.build();
6489
6494
  if (r.initTrack) {
6490
- let t = new rp().name(r.initTrack).build(), [c, l] = yield Promise.all([_m.call(n, e, t), kp.subscribe(e, s, {
6495
+ let t = new ip().name(r.initTrack).build(), [c, l] = yield Promise.all([vm.call(n, e, t), Ap.subscribe(e, s, {
6491
6496
  params: o,
6492
6497
  largestGroupId: a ? a - T(1) : void 0
6493
6498
  })]), u = new oa(c);
6494
6499
  return new n(r, e.namespace(), l, u, i);
6495
6500
  }
6496
6501
  de(r.initData, "no init data found on track");
6497
- let c = Be(r.initData), l = new oa(new Uint8Array(c)), u = yield kp.subscribe(e, s, {
6502
+ let c = Be(r.initData), l = new oa(new Uint8Array(c)), u = yield Ap.subscribe(e, s, {
6498
6503
  params: o,
6499
6504
  largestGroupId: a ? a - T(1) : void 0
6500
6505
  });
@@ -6502,59 +6507,59 @@ var gm = class n {
6502
6507
  })();
6503
6508
  }
6504
6509
  largestGroupId() {
6505
- return b(pm, this).largestGroupId();
6510
+ return b(mm, this).largestGroupId();
6506
6511
  }
6507
6512
  stopAfterTimestampReached(e) {
6508
- x(hm, this, [0, e]);
6513
+ x(gm, this, [0, e]);
6509
6514
  }
6510
6515
  timestampRange() {
6511
- return b(hm, this);
6516
+ return b(gm, this);
6512
6517
  }
6513
6518
  endOfTrack(e) {
6514
- return b(pm, this).endOfTrack(e);
6519
+ return b(mm, this).endOfTrack(e);
6515
6520
  }
6516
6521
  update(e, t) {
6517
- return b(pm, this).update(e, t);
6522
+ return b(mm, this).update(e, t);
6518
6523
  }
6519
6524
  unsubscribe() {
6520
6525
  var e = this;
6521
6526
  return t(function* () {
6522
- return b(pm, e).unsubscribe();
6527
+ return b(mm, e).unsubscribe();
6523
6528
  })();
6524
6529
  }
6525
6530
  next() {
6526
6531
  var e = this;
6527
6532
  return t(function* () {
6528
- let t = yield b(pm, e).next();
6533
+ let t = yield b(mm, e).next();
6529
6534
  return t.done ? t : {
6530
6535
  done: !1,
6531
- value: new um(t.value, b(fm, e), b(mm, e), e)
6536
+ value: new dm(t.value, b(pm, e), b(hm, e), e)
6532
6537
  };
6533
6538
  })();
6534
6539
  }
6535
6540
  return() {
6536
6541
  var e = this;
6537
6542
  return t(function* () {
6538
- return yield b(pm, e).return(), {
6543
+ return yield b(mm, e).return(), {
6539
6544
  done: !0,
6540
6545
  value: void 0
6541
6546
  };
6542
6547
  })();
6543
6548
  }
6544
- [Gp]() {
6549
+ [Kp]() {
6545
6550
  return this;
6546
6551
  }
6547
- [Kp]() {
6552
+ [qp]() {
6548
6553
  return this.unsubscribe();
6549
6554
  }
6550
- [qp]() {
6555
+ [Jp]() {
6551
6556
  var e = this;
6552
6557
  return t(function* () {
6553
6558
  return e.unsubscribe();
6554
6559
  })();
6555
6560
  }
6556
6561
  };
6557
- function _m(e, n) {
6562
+ function vm(e, n) {
6558
6563
  return t(function* () {
6559
6564
  try {
6560
6565
  var t = td();
@@ -6570,46 +6575,46 @@ function _m(e, n) {
6570
6575
  }
6571
6576
  //#endregion
6572
6577
  //#region ../../libs/voq/src/tracks/Timeline.ts
6573
- var vm = 1e4, ym = 3e4, bm = /* @__PURE__ */ new WeakMap(), xm = /* @__PURE__ */ new WeakMap(), Sm = /* @__PURE__ */ new WeakMap(), Cm = /* @__PURE__ */ new WeakMap(), wm = /* @__PURE__ */ new WeakMap(), Tm = /* @__PURE__ */ new WeakMap(), Em = /* @__PURE__ */ new WeakSet(), Dm = class e {
6578
+ var ym = 1e4, bm = 3e4, xm = /* @__PURE__ */ new WeakMap(), Sm = /* @__PURE__ */ new WeakMap(), Cm = /* @__PURE__ */ new WeakMap(), wm = /* @__PURE__ */ new WeakMap(), Tm = /* @__PURE__ */ new WeakMap(), Em = /* @__PURE__ */ new WeakMap(), Dm = /* @__PURE__ */ new WeakSet(), Om = class e {
6574
6579
  constructor(e, t, n) {
6575
- S(this, Em), v(this, bm, O.get().createContext("Timeline")), v(this, xm, new A([])), v(this, Sm, void 0), v(this, Cm, void 0), v(this, wm, void 0), v(this, Tm, void 0), x(Cm, this, e), x(wm, this, n), x(Sm, this, t), x(Tm, this, y(Em, this, Om).call(this, b(Sm, this))), this.closed().finally(() => b(xm, this).close()).catch(o);
6580
+ S(this, Dm), v(this, xm, O.get().createContext("Timeline")), v(this, Sm, new A([])), v(this, Cm, void 0), v(this, wm, void 0), v(this, Tm, void 0), v(this, Em, void 0), x(wm, this, e), x(Tm, this, n), x(Cm, this, t), x(Em, this, y(Dm, this, km).call(this, b(Cm, this))), this.closed().finally(() => b(Sm, this).close()).catch(o);
6576
6581
  }
6577
6582
  closed() {
6578
- return b(Tm, this);
6583
+ return b(Em, this);
6579
6584
  }
6580
6585
  close() {
6581
6586
  var e = this;
6582
6587
  return t(function* () {
6583
- return (yield b(Sm, e).promise).unsubscribe();
6588
+ return (yield b(Cm, e).promise).unsubscribe();
6584
6589
  })();
6585
6590
  }
6586
6591
  timeline() {
6587
- let [e, t] = b(xm, this).value();
6592
+ let [e, t] = b(Sm, this).value();
6588
6593
  return e;
6589
6594
  }
6590
6595
  timestampWallclockOffset() {
6591
6596
  return Ot(this.timeline().map((e) => e.mediaPts - e.wallclock));
6592
6597
  }
6593
6598
  static start(t, n) {
6594
- return new e(t, w.fromPromise(kp.subscribe(t, new rp().name(n).groupOrder("ascending").build())), n);
6599
+ return new e(t, w.fromPromise(Ap.subscribe(t, new ip().name(n).groupOrder("ascending").build())), n);
6595
6600
  }
6596
6601
  waitForWallclockTime(e) {
6597
6602
  var n = this;
6598
6603
  return t(function* () {
6599
- return yield b(xm, n).waitFor((t) => !!t.find((t) => t.wallclock >= e)), n.timeline();
6604
+ return yield b(Sm, n).waitFor((t) => !!t.find((t) => t.wallclock >= e)), n.timeline();
6600
6605
  })();
6601
6606
  }
6602
6607
  waitForTimelineToHaveMinDuration() {
6603
6608
  var e = this;
6604
6609
  return t(function* () {
6605
- return yield b(xm, e).waitFor((e) => {
6610
+ return yield b(Sm, e).waitFor((e) => {
6606
6611
  let t = e[0], n = e[e.length - 1];
6607
- return !t || !n ? !1 : n.wallclock - t.wallclock > vm;
6612
+ return !t || !n ? !1 : n.wallclock - t.wallclock > ym;
6608
6613
  }), e.timeline();
6609
6614
  })();
6610
6615
  }
6611
6616
  };
6612
- function Om(e) {
6617
+ function km(e) {
6613
6618
  var n = this;
6614
6619
  return t(function* () {
6615
6620
  let t = yield e.promise;
@@ -6624,13 +6629,13 @@ function Om(e) {
6624
6629
  let e = p.value;
6625
6630
  {
6626
6631
  if (e.objectStatus !== H.Normal) continue;
6627
- let r = Am(e.payload);
6628
- b(xm, n).update((e) => {
6632
+ let r = jm(e.payload);
6633
+ b(Sm, n).update((e) => {
6629
6634
  var t, n;
6630
- for (e.push(...r), e.sort((e, t) => e.wallclock - t.wallclock); e[0] && ((t = (n = e[e.length - 1]) == null ? void 0 : n.wallclock) == null ? 0 : t) - e[0].wallclock > ym;) e.shift();
6635
+ for (e.push(...r), e.sort((e, t) => e.wallclock - t.wallclock); e[0] && ((t = (n = e[e.length - 1]) == null ? void 0 : n.wallclock) == null ? 0 : t) - e[0].wallclock > bm;) e.shift();
6631
6636
  return e;
6632
- }), t === b(Sm, n).resolved && e.groupId > T(0) && e.objectId === T(0) && y(Em, n, km).call(n, e.groupId).catch((e) => {
6633
- b(bm, n).warn("backfill failed", e);
6637
+ }), t === b(Cm, n).resolved && e.groupId > T(0) && e.objectId === T(0) && y(Dm, n, Am).call(n, e.groupId).catch((e) => {
6638
+ b(xm, n).warn("backfill failed", e);
6634
6639
  });
6635
6640
  }
6636
6641
  }
@@ -6659,20 +6664,20 @@ function Om(e) {
6659
6664
  }
6660
6665
  })();
6661
6666
  }
6662
- function km(e) {
6667
+ function Am(e) {
6663
6668
  var n = this;
6664
6669
  return t(function* () {
6665
6670
  let t = e - T(1), r = n.timeline(), i = r[0], a = r[r.length - 1];
6666
- if (!i || !a || a.wallclock - i.wallclock > vm) return;
6667
- b(bm, n).debug("backfilling timeline", {
6671
+ if (!i || !a || a.wallclock - i.wallclock > ym) return;
6672
+ b(xm, n).debug("backfilling timeline", {
6668
6673
  currentGroupId: e,
6669
6674
  backfillGroupId: t
6670
6675
  });
6671
- let o = w.fromPromise(kp.subscribe(b(Cm, n), new rp().name(b(wm, n)).groupOrder("ascending").range(t, t).build()));
6672
- return y(Em, n, Om).call(n, o);
6676
+ let o = w.fromPromise(Ap.subscribe(b(wm, n), new ip().name(b(Tm, n)).groupOrder("ascending").range(t, t).build()));
6677
+ return y(Dm, n, km).call(n, o);
6673
6678
  })();
6674
6679
  }
6675
- function Am(e) {
6680
+ function jm(e) {
6676
6681
  var t;
6677
6682
  let n = new TextDecoder("utf-8").decode(e).split("\n");
6678
6683
  return (t = n[0]) != null && t.startsWith("MEDIA_PTS") && n.shift(), n.filter((e) => e.length > 0).map((e) => {
@@ -6689,40 +6694,40 @@ function Am(e) {
6689
6694
  }
6690
6695
  //#endregion
6691
6696
  //#region ../../libs/voq/src/tracks/WebVTT.ts
6692
- var jm, Mm, Nm;
6693
- function Pm(e) {
6697
+ var Mm, Nm, Pm;
6698
+ function Fm(e) {
6694
6699
  return typeof e.language == "string";
6695
6700
  }
6696
- var Fm = /* @__PURE__ */ new WeakMap(), Im = /* @__PURE__ */ new WeakMap(), Lm = /* @__PURE__ */ new WeakMap(), Rm = /* @__PURE__ */ new WeakMap();
6697
- jm = Symbol.asyncIterator, Mm = Vt(), Nm = Symbol.asyncDispose;
6698
- var zm = class n {
6701
+ var Im = /* @__PURE__ */ new WeakMap(), Lm = /* @__PURE__ */ new WeakMap(), Rm = /* @__PURE__ */ new WeakMap(), zm = /* @__PURE__ */ new WeakMap();
6702
+ Mm = Symbol.asyncIterator, Nm = Vt(), Pm = Symbol.asyncDispose;
6703
+ var Bm = class n {
6699
6704
  constructor(t, n, r, i, a) {
6700
- v(this, Fm, new Zo()), v(this, Im, void 0), v(this, Lm, void 0), v(this, Rm, 0), e(this, "trackObject", void 0), e(this, "namespace", void 0), x(Lm, this, t), x(Im, this, n), this.trackObject = r, this.namespace = i, x(Rm, this, a);
6705
+ v(this, Im, new Zo()), v(this, Lm, void 0), v(this, Rm, void 0), v(this, zm, 0), e(this, "trackObject", void 0), e(this, "namespace", void 0), x(Rm, this, t), x(Lm, this, n), this.trackObject = r, this.namespace = i, x(zm, this, a);
6701
6706
  }
6702
6707
  static subscribe(e, r, i) {
6703
6708
  return t(function* () {
6704
- if (!Pm(r)) throw Error("track object language is required");
6705
- let t = new rp().name(r.name).build(), a = yield kp.subscribe(e, t);
6709
+ if (!Fm(r)) throw Error("track object language is required");
6710
+ let t = new ip().name(r.name).build(), a = yield Ap.subscribe(e, t);
6706
6711
  return new n(a, a.objects(), r, e.namespace(), i);
6707
6712
  })();
6708
6713
  }
6709
6714
  largestGroupId() {
6710
- return b(Lm, this).largestGroupId();
6715
+ return b(Rm, this).largestGroupId();
6711
6716
  }
6712
6717
  update(e, t) {
6713
- return b(Lm, this).update(e, t);
6718
+ return b(Rm, this).update(e, t);
6714
6719
  }
6715
6720
  unsubscribe() {
6716
- return b(Lm, this).unsubscribe();
6721
+ return b(Rm, this).unsubscribe();
6717
6722
  }
6718
6723
  next() {
6719
6724
  var e = this;
6720
6725
  return t(function* () {
6721
6726
  for (;;) {
6722
- let t = yield b(Im, e).next();
6727
+ let t = yield b(Lm, e).next();
6723
6728
  if (t.done) return t;
6724
6729
  if (t.value.objectStatus !== H.Normal) continue;
6725
- let n = new TextDecoder().decode(t.value.payload), r = b(Fm, e).parse(n).map((t) => (t.startTime -= b(Rm, e) / 1e3, t.endTime -= b(Rm, e) / 1e3, t));
6730
+ let n = new TextDecoder().decode(t.value.payload), r = b(Im, e).parse(n).map((t) => (t.startTime -= b(zm, e) / 1e3, t.endTime -= b(zm, e) / 1e3, t));
6726
6731
  return {
6727
6732
  done: !1,
6728
6733
  value: {
@@ -6736,29 +6741,29 @@ var zm = class n {
6736
6741
  return() {
6737
6742
  var e = this;
6738
6743
  return t(function* () {
6739
- return yield b(Lm, e).return(), {
6744
+ return yield b(Rm, e).return(), {
6740
6745
  done: !0,
6741
6746
  value: void 0
6742
6747
  };
6743
6748
  })();
6744
6749
  }
6745
- [jm]() {
6750
+ [Mm]() {
6746
6751
  return this;
6747
6752
  }
6748
- [Mm]() {
6753
+ [Nm]() {
6749
6754
  return this.unsubscribe();
6750
6755
  }
6751
- [Nm]() {
6756
+ [Pm]() {
6752
6757
  return this.unsubscribe();
6753
6758
  }
6754
- }, Bm = /* @__PURE__ */ new WeakMap(), Vm = /* @__PURE__ */ new WeakMap(), Hm = /* @__PURE__ */ new WeakMap(), Um = /* @__PURE__ */ new WeakMap(), Wm = /* @__PURE__ */ new WeakSet(), Gm = class n {
6759
+ }, Vm = /* @__PURE__ */ new WeakMap(), Hm = /* @__PURE__ */ new WeakMap(), Um = /* @__PURE__ */ new WeakMap(), Wm = /* @__PURE__ */ new WeakMap(), Gm = /* @__PURE__ */ new WeakSet(), Km = class n {
6755
6760
  constructor(t, n, r, i, a) {
6756
- S(this, Wm), e(this, "namespace", void 0), v(this, Bm, void 0), v(this, Vm, void 0), v(this, Hm, void 0), v(this, Um, void 0), this.namespace = i, x(Bm, this, t), x(Vm, this, n), x(Hm, this, r), x(Um, this, a);
6761
+ S(this, Gm), e(this, "namespace", void 0), v(this, Vm, void 0), v(this, Hm, void 0), v(this, Um, void 0), v(this, Wm, void 0), this.namespace = i, x(Vm, this, t), x(Hm, this, n), x(Um, this, r), x(Wm, this, a);
6757
6762
  }
6758
6763
  static start(e, r) {
6759
6764
  return t(function* () {
6760
- qm._.info("Enter 'start'", { config: r });
6761
- let t = new op(e, { namespace: r.namespace }), [i, a] = yield Promise.all([Dm.start(t, "timeline"), Rp.start(t, {
6765
+ Jm._.info("Enter 'start'", { config: r });
6766
+ let t = new sp(e, { namespace: r.namespace }), [i, a] = yield Promise.all([Om.start(t, "timeline"), zp.start(t, {
6762
6767
  catalog: r.catalog,
6763
6768
  namespace: r.namespace
6764
6769
  })]);
@@ -6766,42 +6771,42 @@ var zm = class n {
6766
6771
  })();
6767
6772
  }
6768
6773
  closed() {
6769
- return b(Hm, this).closed();
6774
+ return b(Um, this).closed();
6770
6775
  }
6771
6776
  catalog() {
6772
- return b(Hm, this).catalog();
6777
+ return b(Um, this).catalog();
6773
6778
  }
6774
6779
  timestampWallclockOffset() {
6775
- return b(Vm, this).timestampWallclockOffset();
6780
+ return b(Hm, this).timestampWallclockOffset();
6776
6781
  }
6777
6782
  timestampOffsetMs() {
6778
- return b(Um, this);
6783
+ return b(Wm, this);
6779
6784
  }
6780
6785
  setTimestampOffsetMs(e) {
6781
- x(Um, this, e);
6786
+ x(Wm, this, e);
6782
6787
  }
6783
6788
  waitForWallclockTime(e) {
6784
- return b(Vm, this).waitForWallclockTime(e);
6789
+ return b(Hm, this).waitForWallclockTime(e);
6785
6790
  }
6786
6791
  subscribeCmafTrack(e, t) {
6787
6792
  let n = t == null ? void 0 : t.startGroup, r = t == null ? void 0 : t.params, i = this.catalog().current().tracks, a = e["com.vindral.variant_uid"] === void 0 ? void 0 : i.find((t) => t["com.vindral.variant_uid"] === e["com.vindral.variant_uid"]);
6788
- return y(Wm, this, Km).call(this, () => gm.subscribe(b(Bm, this), a == null ? e : a, {
6789
- timestampOffsetMs: b(Um, this),
6793
+ return y(Gm, this, qm).call(this, () => _m.subscribe(b(Vm, this), a == null ? e : a, {
6794
+ timestampOffsetMs: b(Wm, this),
6790
6795
  startGroup: n,
6791
6796
  params: r
6792
6797
  }));
6793
6798
  }
6794
6799
  subscribeWebVttTrack(e) {
6795
- return y(Wm, this, Km).call(this, () => zm.subscribe(b(Bm, this), e, b(Um, this)));
6800
+ return y(Gm, this, qm).call(this, () => Bm.subscribe(b(Vm, this), e, b(Wm, this)));
6796
6801
  }
6797
6802
  subscribeTrack(e) {
6798
- return y(Wm, this, Km).call(this, () => b(Bm, this).subscribe(e));
6803
+ return y(Gm, this, qm).call(this, () => b(Vm, this).subscribe(e));
6799
6804
  }
6800
6805
  close() {
6801
- return Promise.all([b(Hm, this).close(), b(Vm, this).close()]);
6806
+ return Promise.all([b(Um, this).close(), b(Hm, this).close()]);
6802
6807
  }
6803
6808
  };
6804
- function Km(e) {
6809
+ function qm(e) {
6805
6810
  var n = this;
6806
6811
  return t(function* () {
6807
6812
  let [t, r] = n.catalog().value();
@@ -6813,45 +6818,45 @@ function Km(e) {
6813
6818
  }
6814
6819
  })();
6815
6820
  }
6816
- var qm = { _: O.get().createContext("Channel") }, Jm = T(8);
6817
- function Ym(e) {
6821
+ var Jm = { _: O.get().createContext("Channel") }, Ym = T(8);
6822
+ function Xm(e) {
6818
6823
  if (e < 0 || e > 65535) throw RangeError("burstMs must be between 0 and 65535 inclusive");
6819
6824
  return {
6820
- type: Jm,
6825
+ type: Ym,
6821
6826
  payload: new Uint8Array([e >> 8 & 255, e & 255])
6822
6827
  };
6823
6828
  }
6824
6829
  //#endregion
6825
6830
  //#region ../../libs/voq/src/ProducerReferenceClock.ts
6826
- var Xm = /* @__PURE__ */ new WeakMap(), Zm = /* @__PURE__ */ new WeakMap(), Qm = /* @__PURE__ */ new WeakSet(), $m = class e {
6831
+ var Zm = /* @__PURE__ */ new WeakMap(), Qm = /* @__PURE__ */ new WeakMap(), $m = /* @__PURE__ */ new WeakSet(), eh = class e {
6827
6832
  constructor(e) {
6828
- S(this, Qm), v(this, Xm, void 0), v(this, Zm, void 0);
6833
+ S(this, $m), v(this, Zm, void 0), v(this, Qm, void 0);
6829
6834
  let [t, n] = e.value.value();
6830
- x(Xm, this, {
6835
+ x(Zm, this, {
6831
6836
  createdAt: /* @__PURE__ */ new Date(),
6832
6837
  wallclock: new Date(t.ntpTimestamp),
6833
6838
  rtt: t.rtt
6834
- }), x(Zm, this, y(Qm, this, eh).call(this, e));
6839
+ }), x(Qm, this, y($m, this, th).call(this, e));
6835
6840
  }
6836
6841
  wallclock() {
6837
- let e = Date.now() - b(Xm, this).createdAt.getTime();
6838
- return b(Xm, this).wallclock.getTime() + e;
6842
+ let e = Date.now() - b(Zm, this).createdAt.getTime();
6843
+ return b(Zm, this).wallclock.getTime() + e;
6839
6844
  }
6840
6845
  closed() {
6841
- return b(Zm, this);
6846
+ return b(Qm, this);
6842
6847
  }
6843
6848
  static start(t) {
6844
6849
  return new e(t);
6845
6850
  }
6846
6851
  };
6847
- function eh(e) {
6852
+ function th(e) {
6848
6853
  var n = this;
6849
6854
  return t(function* () {
6850
6855
  var t = !1, r = !1, i;
6851
6856
  try {
6852
6857
  for (var a = U(e.value), o; t = !(o = yield a.next()).done; t = !1) {
6853
6858
  let e = o.value;
6854
- x(Xm, n, {
6859
+ x(Zm, n, {
6855
6860
  createdAt: /* @__PURE__ */ new Date(),
6856
6861
  wallclock: new Date(e.ntpTimestamp),
6857
6862
  rtt: e.rtt
@@ -6870,7 +6875,7 @@ function eh(e) {
6870
6875
  }
6871
6876
  //#endregion
6872
6877
  //#region \0@oxc-project+runtime@0.115.0/helpers/objectWithoutPropertiesLoose.js
6873
- function th(e, t) {
6878
+ function nh(e, t) {
6874
6879
  if (e == null) return {};
6875
6880
  var n = {};
6876
6881
  for (var r in e) if ({}.hasOwnProperty.call(e, r)) {
@@ -6881,9 +6886,9 @@ function th(e, t) {
6881
6886
  }
6882
6887
  //#endregion
6883
6888
  //#region \0@oxc-project+runtime@0.115.0/helpers/objectWithoutProperties.js
6884
- function nh(e, t) {
6889
+ function rh(e, t) {
6885
6890
  if (e == null) return {};
6886
- var n, r, i = th(e, t);
6891
+ var n, r, i = nh(e, t);
6887
6892
  if (Object.getOwnPropertySymbols) {
6888
6893
  var a = Object.getOwnPropertySymbols(e);
6889
6894
  for (r = 0; r < a.length; r++) n = a[r], t.includes(n) || {}.propertyIsEnumerable.call(e, n) && (i[n] = e[n]);
@@ -6892,27 +6897,27 @@ function nh(e, t) {
6892
6897
  }
6893
6898
  //#endregion
6894
6899
  //#region ../../libs/voq/src/tracks/Drm.ts
6895
- var rh = ["fairplayCertificate"];
6896
- function ih(e) {
6897
- return typeof e == "string" || e == null;
6898
- }
6900
+ var ih = ["fairplayCertificate"];
6899
6901
  function ah(e) {
6900
- return "provider" in e && typeof e.provider == "string" && (!("widevineLicenseUrl" in e) || ih(e.widevineLicenseUrl)) && (!("playreadyLicenseUrl" in e) || ih(e.playreadyLicenseUrl)) && (!("fairplayLicenseUrl" in e) || ih(e.fairplayLicenseUrl)) && (!("fairplayCertificate" in e) || ih(e.fairplayCertificate));
6902
+ return typeof e == "string" || e == null;
6901
6903
  }
6902
6904
  function oh(e) {
6905
+ return "provider" in e && typeof e.provider == "string" && (!("widevineLicenseUrl" in e) || ah(e.widevineLicenseUrl)) && (!("playreadyLicenseUrl" in e) || ah(e.playreadyLicenseUrl)) && (!("fairplayLicenseUrl" in e) || ah(e.fairplayLicenseUrl)) && (!("fairplayCertificate" in e) || ah(e.fairplayCertificate));
6906
+ }
6907
+ function sh(e) {
6903
6908
  try {
6904
6909
  return Be(e);
6905
6910
  } catch (e) {
6906
6911
  throw Error("Failed to convert fairplayCertificate");
6907
6912
  }
6908
6913
  }
6909
- function sh(e) {
6914
+ function ch(e) {
6910
6915
  let t = new TextDecoder().decode(e), n = JSON.parse(t);
6911
- if (!ah(n)) throw Error("Invalid drm object");
6916
+ if (!oh(n)) throw Error("Invalid drm object");
6912
6917
  let { fairplayCertificate: r } = n;
6913
- return C(C({}, nh(n, rh)), {}, { fairplayCertificate: r ? oh(r) : void 0 });
6918
+ return C(C({}, rh(n, ih)), {}, { fairplayCertificate: r ? sh(r) : void 0 });
6914
6919
  }
6915
- var ch = class n {
6920
+ var lh = class n {
6916
6921
  constructor(t) {
6917
6922
  e(this, "value", void 0), this.value = t;
6918
6923
  }
@@ -6920,9 +6925,9 @@ var ch = class n {
6920
6925
  return t(function* () {
6921
6926
  try {
6922
6927
  var t = td();
6923
- let a = yield t.a(yield e.subscribeTrack(new rp().name("drm").build())).objects().next();
6928
+ let a = yield t.a(yield e.subscribeTrack(new ip().name("drm").build())).objects().next();
6924
6929
  if (a.done) throw Error("No drm object received");
6925
- return new n(C(C({}, sh(a.value.payload)), {}, {
6930
+ return new n(C(C({}, ch(a.value.payload)), {}, {
6926
6931
  videoCodec: r,
6927
6932
  audioCodec: i
6928
6933
  }));
@@ -6936,20 +6941,20 @@ var ch = class n {
6936
6941
  };
6937
6942
  //#endregion
6938
6943
  //#region ../../libs/voq/src/tracks/Stats.ts
6939
- function lh(e) {
6944
+ function uh(e) {
6940
6945
  return "rtt" in e && typeof e.rtt == "number" && "ntpTimestamp" in e && typeof e.ntpTimestamp == "number" && "estimatedBandwidth" in e && typeof e.estimatedBandwidth == "number";
6941
6946
  }
6942
- function uh(e) {
6947
+ function dh(e) {
6943
6948
  let t = new TextDecoder().decode(e), n = JSON.parse(t);
6944
- if (!lh(n)) throw Error("Invalid stats object");
6949
+ if (!uh(n)) throw Error("Invalid stats object");
6945
6950
  return n;
6946
6951
  }
6947
- var dh = 1e4, fh = /* @__PURE__ */ new WeakMap(), ph = /* @__PURE__ */ new WeakSet(), mh = class n {
6952
+ var fh = 1e4, ph = /* @__PURE__ */ new WeakMap(), mh = /* @__PURE__ */ new WeakSet(), hh = class n {
6948
6953
  constructor(t, n, r) {
6949
- S(this, ph), e(this, "ip", void 0), e(this, "value", void 0), v(this, fh, void 0), this.ip = r, this.value = new A(n), x(fh, this, y(ph, this, hh).call(this, t));
6954
+ S(this, mh), e(this, "ip", void 0), e(this, "value", void 0), v(this, ph, void 0), this.ip = r, this.value = new A(n), x(ph, this, y(mh, this, gh).call(this, t));
6950
6955
  }
6951
6956
  closed() {
6952
- return b(fh, this);
6957
+ return b(ph, this);
6953
6958
  }
6954
6959
  idleTimeout() {
6955
6960
  var e = this;
@@ -6957,7 +6962,7 @@ var dh = 1e4, fh = /* @__PURE__ */ new WeakMap(), ph = /* @__PURE__ */ new WeakS
6957
6962
  for (;;) {
6958
6963
  let [t, n] = e.value.value();
6959
6964
  try {
6960
- yield Promise.race([mn(dh, /* @__PURE__ */ Error("Idle timeout")), n]);
6965
+ yield Promise.race([mn(fh, /* @__PURE__ */ Error("Idle timeout")), n]);
6961
6966
  } catch (e) {
6962
6967
  return e;
6963
6968
  }
@@ -6966,15 +6971,15 @@ var dh = 1e4, fh = /* @__PURE__ */ new WeakMap(), ph = /* @__PURE__ */ new WeakS
6966
6971
  }
6967
6972
  static start(e) {
6968
6973
  return t(function* () {
6969
- let t = (yield e.subscribe(new rp().name("stats").groupOrder("ascending").build())).objects(), r = yield t.next();
6974
+ let t = (yield e.subscribe(new ip().name("stats").groupOrder("ascending").build())).objects(), r = yield t.next();
6970
6975
  if (r.done) throw Error("No stats object received");
6971
- let i = uh(r.value.payload);
6976
+ let i = dh(r.value.payload);
6972
6977
  if (!i.ip) throw Error("Expected IP in initial stats object");
6973
6978
  return new n(t, i, i.ip);
6974
6979
  })();
6975
6980
  }
6976
6981
  };
6977
- function hh(e) {
6982
+ function gh(e) {
6978
6983
  var n = this;
6979
6984
  return t(function* () {
6980
6985
  var t = !1, r = !1, i;
@@ -6983,7 +6988,7 @@ function hh(e) {
6983
6988
  let e = o.value;
6984
6989
  {
6985
6990
  if (e.objectStatus !== H.Normal) continue;
6986
- let t = uh(e.payload);
6991
+ let t = dh(e.payload);
6987
6992
  n.value.update(t);
6988
6993
  }
6989
6994
  }
@@ -7000,21 +7005,21 @@ function hh(e) {
7000
7005
  }
7001
7006
  //#endregion
7002
7007
  //#region ../../libs/voq/src/UpstreamWatcher.ts
7003
- var gh = /* @__PURE__ */ new WeakMap(), _h = /* @__PURE__ */ new WeakMap(), vh = class {
7008
+ var _h = /* @__PURE__ */ new WeakMap(), vh = /* @__PURE__ */ new WeakMap(), yh = class {
7004
7009
  constructor(e) {
7005
- v(this, gh, O.get().createContext("UpstreamWatcher")), v(this, _h, void 0), x(_h, this, new A(w.fromPromise(e.closed())));
7010
+ v(this, _h, O.get().createContext("UpstreamWatcher")), v(this, vh, void 0), x(vh, this, new A(w.fromPromise(e.closed())));
7006
7011
  }
7007
7012
  update(e) {
7008
- b(_h, this).update(w.fromPromise(e.closed()));
7013
+ b(vh, this).update(w.fromPromise(e.closed()));
7009
7014
  }
7010
7015
  closed() {
7011
7016
  var e = this;
7012
7017
  return t(function* () {
7013
7018
  try {
7014
7019
  for (;;) {
7015
- let [t, n] = b(_h, e).value(), r = !1;
7020
+ let [t, n] = b(vh, e).value(), r = !1;
7016
7021
  yield Promise.race([n == null ? void 0 : n.then(() => r = !0), t.promise.then(() => {
7017
- if (!r) throw b(gh, e).warn("Upstream closed"), Error("Upstream closed");
7022
+ if (!r) throw b(_h, e).warn("Upstream closed"), Error("Upstream closed");
7018
7023
  })]);
7019
7024
  }
7020
7025
  } catch (e) {
@@ -7022,19 +7027,19 @@ var gh = /* @__PURE__ */ new WeakMap(), _h = /* @__PURE__ */ new WeakMap(), vh =
7022
7027
  }
7023
7028
  })();
7024
7029
  }
7025
- }, yh, bh = /* @__PURE__ */ new WeakMap(), xh = /* @__PURE__ */ new WeakMap(), Sh = /* @__PURE__ */ new WeakMap();
7026
- yh = Symbol.asyncIterator;
7027
- var Ch = class {
7030
+ }, bh, xh = /* @__PURE__ */ new WeakMap(), Sh = /* @__PURE__ */ new WeakMap(), Ch = /* @__PURE__ */ new WeakMap();
7031
+ bh = Symbol.asyncIterator;
7032
+ var wh = class {
7028
7033
  constructor(e, t) {
7029
- v(this, bh, O.get().createContext("TracksIterator")), v(this, xh, void 0), v(this, Sh, void 0), x(xh, this, e), x(Sh, this, t);
7034
+ v(this, xh, O.get().createContext("TracksIterator")), v(this, Sh, void 0), v(this, Ch, void 0), x(Sh, this, e), x(Ch, this, t);
7030
7035
  }
7031
- [yh]() {
7036
+ [bh]() {
7032
7037
  var e = this;
7033
7038
  return Qt(function* () {
7034
- let t = b(Sh, e);
7039
+ let t = b(Ch, e);
7035
7040
  var n = !1, r = !1, i;
7036
7041
  try {
7037
- for (var a = U(b(xh, e)), o; n = !(o = yield k(a.next())).done; n = !1) {
7042
+ for (var a = U(b(Sh, e)), o; n = !(o = yield k(a.next())).done; n = !1) {
7038
7043
  let n = o.value;
7039
7044
  {
7040
7045
  if (!n) continue;
@@ -7042,7 +7047,7 @@ var Ch = class {
7042
7047
  name: n.trackObject.name,
7043
7048
  namespace: n.namespace
7044
7049
  };
7045
- b(bh, e).debug("track start", C({ mediaType: t }, r)), yield* xp(U(n)), b(bh, e).debug("track end", C({ mediaType: t }, r));
7050
+ b(xh, e).debug("track start", C({ mediaType: t }, r)), yield* Sp(U(n)), b(xh, e).debug("track end", C({ mediaType: t }, r));
7046
7051
  }
7047
7052
  }
7048
7053
  } catch (e) {
@@ -7054,45 +7059,45 @@ var Ch = class {
7054
7059
  if (r) throw i;
7055
7060
  }
7056
7061
  }
7057
- b(bh, e).debug("tracks ended", { mediaType: t });
7062
+ b(xh, e).debug("tracks ended", { mediaType: t });
7058
7063
  })();
7059
7064
  }
7060
- }, wh = /* @__PURE__ */ new WeakMap(), Th = /* @__PURE__ */ new WeakMap(), Eh = /* @__PURE__ */ new WeakMap(), Dh = /* @__PURE__ */ new WeakMap(), Z = /* @__PURE__ */ new WeakMap(), Oh = /* @__PURE__ */ new WeakMap(), kh = /* @__PURE__ */ new WeakMap(), Ah = /* @__PURE__ */ new WeakMap(), jh = /* @__PURE__ */ new WeakMap(), Mh = /* @__PURE__ */ new WeakMap(), Nh = /* @__PURE__ */ new WeakSet(), Ph = class n {
7065
+ }, Th = /* @__PURE__ */ new WeakMap(), Eh = /* @__PURE__ */ new WeakMap(), Dh = /* @__PURE__ */ new WeakMap(), Oh = /* @__PURE__ */ new WeakMap(), Z = /* @__PURE__ */ new WeakMap(), kh = /* @__PURE__ */ new WeakMap(), Ah = /* @__PURE__ */ new WeakMap(), jh = /* @__PURE__ */ new WeakMap(), Mh = /* @__PURE__ */ new WeakMap(), Nh = /* @__PURE__ */ new WeakMap(), Ph = /* @__PURE__ */ new WeakSet(), Fh = class n {
7061
7066
  constructor(t, n, r) {
7062
- S(this, Nh), v(this, wh, void 0), v(this, Th, void 0), v(this, Eh, void 0), v(this, Dh, O.get().createContext("Player")), v(this, Z, void 0), v(this, Oh, new A(void 0)), v(this, kh, new A(void 0)), v(this, Ah, new A(void 0)), v(this, jh, void 0), v(this, Mh, void 0), e(this, "subtitles", new Ch(b(Ah, this), "subtitles")), e(this, "video", new Ch(b(kh, this), "video")), e(this, "audio", new Ch(b(Oh, this), "audio")), x(wh, this, t), x(Th, this, $m.start(r)), x(Eh, this, r), x(Z, this, new A(n)), x(jh, this, new vh(n)), x(Mh, this, Promise.race([
7067
+ S(this, Ph), v(this, Th, void 0), v(this, Eh, void 0), v(this, Dh, void 0), v(this, Oh, O.get().createContext("Player")), v(this, Z, void 0), v(this, kh, new A(void 0)), v(this, Ah, new A(void 0)), v(this, jh, new A(void 0)), v(this, Mh, void 0), v(this, Nh, void 0), e(this, "subtitles", new wh(b(jh, this), "subtitles")), e(this, "video", new wh(b(Ah, this), "video")), e(this, "audio", new wh(b(kh, this), "audio")), x(Th, this, t), x(Eh, this, eh.start(r)), x(Dh, this, r), x(Z, this, new A(n)), x(Mh, this, new yh(n)), x(Nh, this, Promise.race([
7063
7068
  r.idleTimeout(),
7064
- y(Nh, this, Lh).call(this),
7065
- b(jh, this).closed()
7066
- ])), b(wh, this).closed().then(() => this.close()).catch(o);
7069
+ y(Ph, this, Rh).call(this),
7070
+ b(Mh, this).closed()
7071
+ ])), b(Th, this).closed().then(() => this.close()).catch(o);
7067
7072
  }
7068
7073
  closed() {
7069
- return b(Mh, this);
7074
+ return b(Nh, this);
7070
7075
  }
7071
7076
  static start(e, r) {
7072
7077
  return t(function* () {
7073
7078
  let t = /* @__PURE__ */ new Map();
7074
7079
  if (r.burstMs !== void 0) {
7075
- let e = Ym(r.burstMs);
7080
+ let e = Xm(r.burstMs);
7076
7081
  t.set(e.type, e);
7077
7082
  }
7078
- let i = new op(e, { namespace: sp("auxiliary") }), [[a, o, s], c] = yield Promise.all([Gm.start(e, r).then((e) => Promise.all([
7083
+ let i = new sp(e, { namespace: cp("auxiliary") }), [[a, o, s], c] = yield Promise.all([Km.start(e, r).then((e) => Promise.all([
7079
7084
  Promise.resolve(e),
7080
7085
  r.videoTrack ? e.subscribeCmafTrack(r.videoTrack, { params: t }) : void 0,
7081
7086
  r.audioTrack ? e.subscribeCmafTrack(r.audioTrack, { params: t }) : void 0
7082
- ])), mh.start(i)]), l = new n(e, a, c);
7083
- return s && b(Oh, l).update(s), o && b(kh, l).update(o), l;
7087
+ ])), hh.start(i)]), l = new n(e, a, c);
7088
+ return s && b(kh, l).update(s), o && b(Ah, l).update(o), l;
7084
7089
  })();
7085
7090
  }
7086
7091
  connectionInfo() {
7087
- let e = b(Eh, this).value.current();
7092
+ let e = b(Dh, this).value.current();
7088
7093
  return {
7089
- ip: b(Eh, this).ip,
7094
+ ip: b(Dh, this).ip,
7090
7095
  rtt: e.rtt,
7091
7096
  estimatedBandwidth: e.estimatedBandwidth
7092
7097
  };
7093
7098
  }
7094
7099
  stats() {
7095
- return b(Eh, this).value;
7100
+ return b(Dh, this).value;
7096
7101
  }
7097
7102
  catalog() {
7098
7103
  return b(Z, this).current().catalog();
@@ -7102,48 +7107,48 @@ var Ch = class {
7102
7107
  }
7103
7108
  videoTrack() {
7104
7109
  var e;
7105
- return (e = b(kh, this).current()) == null ? void 0 : e.trackObject;
7110
+ return (e = b(Ah, this).current()) == null ? void 0 : e.trackObject;
7106
7111
  }
7107
7112
  audioTrack() {
7108
7113
  var e;
7109
- return (e = b(Oh, this).current()) == null ? void 0 : e.trackObject;
7114
+ return (e = b(kh, this).current()) == null ? void 0 : e.trackObject;
7110
7115
  }
7111
7116
  referenceClock() {
7112
- return b(Th, this);
7117
+ return b(Eh, this);
7113
7118
  }
7114
7119
  drm() {
7115
7120
  var e = this;
7116
7121
  return t(function* () {
7117
7122
  var t, n;
7118
- if (e.catalog().current().tracks.find(({ name: e }) => e === "drm")) return ch.create(b(Z, e).current(), (t = e.videoTrack()) == null ? void 0 : t.codec, (n = e.audioTrack()) == null ? void 0 : n.codec);
7123
+ if (e.catalog().current().tracks.find(({ name: e }) => e === "drm")) return lh.create(b(Z, e).current(), (t = e.videoTrack()) == null ? void 0 : t.codec, (n = e.audioTrack()) == null ? void 0 : n.codec);
7119
7124
  })();
7120
7125
  }
7121
7126
  close() {
7122
- return b(Dh, this).info("Enter 'close'"), Promise.all([
7127
+ return b(Oh, this).info("Enter 'close'"), Promise.all([
7123
7128
  b(Z, this).current().close(),
7124
7129
  b(Z, this).close(),
7125
- y(Nh, this, Fh).call(this, b(Oh, this)),
7126
- y(Nh, this, Fh).call(this, b(kh, this)),
7127
- y(Nh, this, Fh).call(this, b(Ah, this))
7130
+ y(Ph, this, Ih).call(this, b(kh, this)),
7131
+ y(Ph, this, Ih).call(this, b(Ah, this)),
7132
+ y(Ph, this, Ih).call(this, b(jh, this))
7128
7133
  ]);
7129
7134
  }
7130
7135
  zap(e, n) {
7131
7136
  var r = this;
7132
7137
  return t(function* () {
7133
- b(Dh, r).info("Enter 'zap'", {
7138
+ b(Oh, r).info("Enter 'zap'", {
7134
7139
  config: e,
7135
7140
  zapOffsetMs: n
7136
7141
  });
7137
- let t = yield Gm.start(b(wh, r), e), i = b(Th, r).wallclock() - n, a = b(Z, r).current(), o = a.timestampWallclockOffset(), s = yield t.waitForWallclockTime(i);
7138
- b(jh, r).update(t), yield b(Z, r).current().close();
7142
+ let t = yield Km.start(b(Th, r), e), i = b(Eh, r).wallclock() - n, a = b(Z, r).current(), o = a.timestampWallclockOffset(), s = yield t.waitForWallclockTime(i);
7143
+ b(Mh, r).update(t), yield b(Z, r).current().close();
7139
7144
  let c = s.toReversed().find((e) => e.wallclock <= i), l = c != null && c.mediaPts ? c.mediaPts - a.timestampOffsetMs() : void 0, u = t.timestampWallclockOffset() - o + a.timestampOffsetMs();
7140
7145
  t.setTimestampOffsetMs(u);
7141
7146
  let d = c != null && c.groupId ? T(c.groupId) : void 0;
7142
7147
  if (l) {
7143
7148
  var f, p;
7144
- (f = b(kh, r).current()) == null || f.stopAfterTimestampReached(l), (p = b(Oh, r).current()) == null || p.stopAfterTimestampReached(l);
7149
+ (f = b(Ah, r).current()) == null || f.stopAfterTimestampReached(l), (p = b(kh, r).current()) == null || p.stopAfterTimestampReached(l);
7145
7150
  }
7146
- b(Z, r).update(t), yield Promise.all([e.videoTrack ? r.setVideoTrack(e.videoTrack, d) : void 0, e.audioTrack ? r.setAudioTrack(e.audioTrack, d) : void 0]), b(Dh, r).info("Return 'zap'");
7151
+ b(Z, r).update(t), yield Promise.all([e.videoTrack ? r.setVideoTrack(e.videoTrack, d) : void 0, e.audioTrack ? r.setAudioTrack(e.audioTrack, d) : void 0]), b(Oh, r).info("Return 'zap'");
7147
7152
  })();
7148
7153
  }
7149
7154
  setSubtitleTrack(e) {
@@ -7152,36 +7157,36 @@ var Ch = class {
7152
7157
  var t;
7153
7158
  if (!e) {
7154
7159
  var r;
7155
- yield (r = b(Ah, n).current()) == null ? void 0 : r.unsubscribe();
7160
+ yield (r = b(jh, n).current()) == null ? void 0 : r.unsubscribe();
7156
7161
  return;
7157
7162
  }
7158
- let [i] = yield Promise.all([b(Z, n).current().subscribeWebVttTrack(e), (t = b(Ah, n).current()) == null ? void 0 : t.unsubscribe()]);
7159
- b(Ah, n).update(i);
7163
+ let [i] = yield Promise.all([b(Z, n).current().subscribeWebVttTrack(e), (t = b(jh, n).current()) == null ? void 0 : t.unsubscribe()]);
7164
+ b(jh, n).update(i);
7160
7165
  })();
7161
7166
  }
7162
7167
  setVideoTrack(e, n) {
7163
7168
  var r = this;
7164
7169
  return t(function* () {
7165
- let t = yield y(Nh, r, Ih).call(r, b(Z, r).current(), e, b(kh, r).current(), n);
7166
- b(kh, r).update(t);
7170
+ let t = yield y(Ph, r, Lh).call(r, b(Z, r).current(), e, b(Ah, r).current(), n);
7171
+ b(Ah, r).update(t);
7167
7172
  })();
7168
7173
  }
7169
7174
  setAudioTrack(e, n) {
7170
7175
  var r = this;
7171
7176
  return t(function* () {
7172
- let t = yield y(Nh, r, Ih).call(r, b(Z, r).current(), e, b(Oh, r).current(), n);
7173
- b(Oh, r).update(t);
7177
+ let t = yield y(Ph, r, Lh).call(r, b(Z, r).current(), e, b(kh, r).current(), n);
7178
+ b(kh, r).update(t);
7174
7179
  })();
7175
7180
  }
7176
7181
  };
7177
- function Fh(e) {
7182
+ function Ih(e) {
7178
7183
  let t = e.current(), n = t == null ? void 0 : t.largestGroupId();
7179
7184
  return e.isClosed() || e.update(void 0), e.close(), n ? t == null ? void 0 : t.update(n, n) : t == null ? void 0 : t.unsubscribe();
7180
7185
  }
7181
- function Ih(e, n, r, i) {
7186
+ function Lh(e, n, r, i) {
7182
7187
  var a = this;
7183
7188
  return t(function* () {
7184
- b(Dh, a).info("Enter '#replaceTrack'", {
7189
+ b(Oh, a).info("Enter '#replaceTrack'", {
7185
7190
  trackObject: n,
7186
7191
  startGroupId: i
7187
7192
  });
@@ -7189,7 +7194,7 @@ function Ih(e, n, r, i) {
7189
7194
  return o;
7190
7195
  })();
7191
7196
  }
7192
- function Lh() {
7197
+ function Rh() {
7193
7198
  var e = this;
7194
7199
  return t(function* () {
7195
7200
  var t = !1, n = !1, r;
@@ -7200,7 +7205,7 @@ function Lh() {
7200
7205
  try {
7201
7206
  for (var l = U(t.catalog()), u; o = !(u = yield l.next()).done; o = !1) {
7202
7207
  let t = u.value;
7203
- yield Promise.all([y(Nh, e, Rh).call(e, t, b(kh, e)), y(Nh, e, Rh).call(e, t, b(Oh, e))]);
7208
+ yield Promise.all([y(Ph, e, zh).call(e, t, b(Ah, e)), y(Ph, e, zh).call(e, t, b(kh, e))]);
7204
7209
  }
7205
7210
  } catch (e) {
7206
7211
  s = !0, c = e;
@@ -7223,7 +7228,7 @@ function Lh() {
7223
7228
  }
7224
7229
  })();
7225
7230
  }
7226
- function Rh(e, n) {
7231
+ function zh(e, n) {
7227
7232
  var r = this;
7228
7233
  return t(function* () {
7229
7234
  let t = n.current();
@@ -7240,73 +7245,73 @@ function Rh(e, n) {
7240
7245
  }
7241
7246
  //#endregion
7242
7247
  //#region ../../libs/web-sdk/src/adapters/MoqConnectionAdapter.ts
7243
- function zh(e, t, n) {
7248
+ function Bh(e, t, n) {
7244
7249
  let r = new URL("/voq/subscribe", e);
7245
7250
  return r.searchParams.set("sessionId", t.sessionId), r.searchParams.set("clientId", t.clientId), r.searchParams.set("channelId", t.channelId), n && r.searchParams.set("authToken", n), r;
7246
7251
  }
7247
- var Bh = 1e4, Q = /* @__PURE__ */ new WeakMap(), Vh = /* @__PURE__ */ new WeakMap(), Hh = /* @__PURE__ */ new WeakMap(), Uh = /* @__PURE__ */ new WeakMap(), $ = /* @__PURE__ */ new WeakMap(), Wh = /* @__PURE__ */ new WeakMap(), Gh = /* @__PURE__ */ new WeakMap(), Kh = /* @__PURE__ */ new WeakMap(), qh = /* @__PURE__ */ new WeakMap(), Jh = /* @__PURE__ */ new WeakMap(), Yh = /* @__PURE__ */ new WeakSet(), Xh = /* @__PURE__ */ new WeakMap(), Zh = /* @__PURE__ */ new WeakMap(), Qh = /* @__PURE__ */ new WeakMap(), $h = class n {
7252
+ var Vh = 1e4, Q = /* @__PURE__ */ new WeakMap(), Hh = /* @__PURE__ */ new WeakMap(), Uh = /* @__PURE__ */ new WeakMap(), Wh = /* @__PURE__ */ new WeakMap(), $ = /* @__PURE__ */ new WeakMap(), Gh = /* @__PURE__ */ new WeakMap(), Kh = /* @__PURE__ */ new WeakMap(), qh = /* @__PURE__ */ new WeakMap(), Jh = /* @__PURE__ */ new WeakMap(), Yh = /* @__PURE__ */ new WeakMap(), Xh = /* @__PURE__ */ new WeakSet(), Zh = /* @__PURE__ */ new WeakMap(), Qh = /* @__PURE__ */ new WeakMap(), $h = /* @__PURE__ */ new WeakMap(), eg = class n {
7248
7253
  get estimatedBandwidth() {
7249
- return b(qh, this);
7254
+ return b(Jh, this);
7250
7255
  }
7251
7256
  unload() {
7252
- b(Q, this).off("send signal", b(Zh, this)), b(Q, this).off("disconnect", this.disconnect), b(Q, this).off("text track", b(Xh, this)), this.disconnect();
7257
+ b(Q, this).off("send signal", b(Qh, this)), b(Q, this).off("disconnect", this.disconnect), b(Q, this).off("text track", b(Zh, this)), this.disconnect();
7253
7258
  }
7254
7259
  suspend() {}
7255
7260
  unsuspend() {}
7256
7261
  getStatistics() {
7257
- let e = b(Hh, this).transportType() === "webtransport" ? "moq" : "moq_ws";
7262
+ let e = b(Uh, this).transportType() === "webtransport" ? "moq" : "moq_ws";
7258
7263
  return {
7259
- edgeUrl: b(Hh, this).url(),
7264
+ edgeUrl: b(Uh, this).url(),
7260
7265
  connectionProtocol: e
7261
7266
  };
7262
7267
  }
7263
7268
  constructor(t, n, r, i, a, s, c) {
7264
- S(this, Yh), v(this, Q, void 0), v(this, Vh, void 0), v(this, Hh, void 0), v(this, Uh, "disconnected"), v(this, $, void 0), v(this, Wh, /* @__PURE__ */ new Map()), v(this, Gh, void 0), v(this, Kh, void 0), v(this, qh, void 0), v(this, Jh, /* @__PURE__ */ new Map()), v(this, Xh, (e) => {
7269
+ S(this, Xh), v(this, Q, void 0), v(this, Hh, void 0), v(this, Uh, void 0), v(this, Wh, "disconnected"), v(this, $, void 0), v(this, Gh, /* @__PURE__ */ new Map()), v(this, Kh, void 0), v(this, qh, void 0), v(this, Jh, void 0), v(this, Yh, /* @__PURE__ */ new Map()), v(this, Zh, (e) => {
7265
7270
  if (!e) {
7266
7271
  b($, this).setSubtitleTrack(void 0).catch(o);
7267
7272
  return;
7268
7273
  }
7269
- let t = b(Wh, this).get(cp(b($, this).namespace())), n = t == null ? void 0 : t.getTextTrack(e);
7274
+ let t = b(Gh, this).get(lp(b($, this).namespace())), n = t == null ? void 0 : t.getTextTrack(e);
7270
7275
  n && b($, this).setSubtitleTrack(n).catch(o);
7271
- }), v(this, Zh, (e) => {
7276
+ }), v(this, Qh, (e) => {
7272
7277
  switch (e.type) {
7273
7278
  case "subscribe":
7274
- if (b(Qh, this)) {
7275
- b(Vh, this).info("Ignoring - we are already switching");
7279
+ if (b($h, this)) {
7280
+ b(Hh, this).info("Ignoring - we are already switching");
7276
7281
  return;
7277
7282
  }
7278
- x(Qh, this, !0), y(Yh, this, ng).call(this, e.subscription).catch((t) => {
7279
- b(Vh, this).error("error handling subscription", t), b(Q, this).emit("received signal", {
7283
+ x($h, this, !0), y(Xh, this, rg).call(this, e.subscription).catch((t) => {
7284
+ b(Hh, this).error("error handling subscription", t), b(Q, this).emit("received signal", {
7280
7285
  type: "subscription changed",
7281
7286
  subscription: e.subscription,
7282
7287
  reset: !0
7283
7288
  });
7284
- }).finally(() => x(Qh, this, !1));
7289
+ }).finally(() => x($h, this, !1));
7285
7290
  break;
7286
7291
  case "telemetry":
7287
- me(new URL("/api/telemetry", b(Hh, this).url().replace("wss://", "https://")), {
7292
+ me(new URL("/api/telemetry", b(Uh, this).url().replace("wss://", "https://")), {
7288
7293
  body: e.body,
7289
7294
  headers: { "Content-Type": "text/plain" }
7290
7295
  }).catch(o);
7291
7296
  break;
7292
7297
  case "refresh auth":
7293
- b(Hh, this).updateAuthToken(e.token);
7298
+ b(Uh, this).updateAuthToken(e.token);
7294
7299
  break;
7295
7300
  }
7296
- }), v(this, Qh, !1), e(this, "disconnect", (e = "Disconnect Requested") => {
7297
- b(Vh, this).info("Disconnecting", e), b(Hh, this).close(), b($, this).close().catch(o), x(Jh, this, /* @__PURE__ */ new Map()), y(Yh, this, rg).call(this, "disconnected");
7298
- }), x(Q, this, t), x(Vh, this, n), x(Hh, this, r), x($, this, i), x(Wh, this, a), x(Gh, this, s), x(Kh, this, c), b(Q, this).on("send signal", b(Zh, this)), b(Q, this).on("disconnect", this.disconnect), b(Q, this).on("text track", b(Xh, this)), y(Yh, this, eg).call(this).catch(o), y(Yh, this, ig).call(this).catch(o);
7301
+ }), v(this, $h, !1), e(this, "disconnect", (e = "Disconnect Requested") => {
7302
+ b(Hh, this).info("Disconnecting", e), b(Uh, this).close(), b($, this).close().catch(o), x(Yh, this, /* @__PURE__ */ new Map()), y(Xh, this, ig).call(this, "disconnected");
7303
+ }), x(Q, this, t), x(Hh, this, n), x(Uh, this, r), x($, this, i), x(Gh, this, a), x(Kh, this, s), x(qh, this, c), b(Q, this).on("send signal", b(Qh, this)), b(Q, this).on("disconnect", this.disconnect), b(Q, this).on("text track", b(Zh, this)), y(Xh, this, tg).call(this).catch(o), y(Xh, this, ag).call(this).catch(o);
7299
7304
  }
7300
7305
  static start(e, r, i, a, o) {
7301
7306
  return t(function* () {
7302
7307
  var t, s, c;
7303
- let l = new Map(a.connectInfo.channels.map((e) => [cp(e.catalog.namespace), new dg(new A(e.catalog))])), u = yield a.onConnectInfo(a.connectInfo), d = a.options.get("authenticationToken"), f, p;
7308
+ let l = new Map(a.connectInfo.channels.map((e) => [lp(e.catalog.namespace), new fg(new A(e.catalog))])), u = yield a.onConnectInfo(a.connectInfo), d = a.options.get("authenticationToken"), f, p;
7304
7309
  switch (typeof a.edgeUrl) {
7305
7310
  case "string":
7306
- f = zh(a.edgeUrl, u, d);
7311
+ f = Bh(a.edgeUrl, u, d);
7307
7312
  break;
7308
7313
  default:
7309
- f = zh(a.edgeUrl.moqUrl || a.edgeUrl.moqWsUrl, u, d), p = zh(a.edgeUrl.moqWsUrl, u, d);
7314
+ f = Bh(a.edgeUrl.moqUrl || a.edgeUrl.moqWsUrl, u, d), p = Bh(a.edgeUrl.moqWsUrl, u, d);
7310
7315
  break;
7311
7316
  }
7312
7317
  let m = (t = a.connectInfo.channels.find((e) => e.channelId === u.channelId)) == null ? void 0 : t.catalog;
@@ -7314,7 +7319,7 @@ var Bh = 1e4, Q = /* @__PURE__ */ new WeakMap(), Vh = /* @__PURE__ */ new WeakMa
7314
7319
  edgeUrl: f,
7315
7320
  edgeWsUrl: p
7316
7321
  }), de(m, "no catalog found");
7317
- let h = (s = l.get(cp(m.namespace))) == null ? void 0 : s.getVideoTrack(u.video), ee = (c = l.get(cp(m.namespace))) == null ? void 0 : c.getAudioTrack(u.audio), te = yield ep({
7322
+ let h = (s = l.get(lp(m.namespace))) == null ? void 0 : s.getVideoTrack(u.video), ee = (c = l.get(lp(m.namespace))) == null ? void 0 : c.getAudioTrack(u.audio), te = yield tp({
7318
7323
  url: f,
7319
7324
  wsUrl: p,
7320
7325
  handshakePipelining: !0,
@@ -7325,17 +7330,17 @@ var Bh = 1e4, Q = /* @__PURE__ */ new WeakMap(), Vh = /* @__PURE__ */ new WeakMa
7325
7330
  }), ne = te.closed().then((e) => {
7326
7331
  throw e instanceof Error ? e : Error(e ? `Session closed before player started: ${String(e)}` : "Session closed before player started");
7327
7332
  }), re = yield Promise.race([
7328
- Ph.start(te.subscriber, {
7333
+ Fh.start(te.subscriber, {
7329
7334
  namespace: m.namespace,
7330
7335
  catalog: m,
7331
7336
  videoTrack: h == null ? void 0 : h.track,
7332
7337
  audioTrack: ee == null ? void 0 : ee.track,
7333
7338
  burstMs: u.burstMs || 0
7334
7339
  }),
7335
- mn(Bh, /* @__PURE__ */ Error("Timeout waiting for player to start")),
7340
+ mn(Vh, /* @__PURE__ */ Error("Timeout waiting for player to start")),
7336
7341
  ne
7337
- ]), g = new dg(re.catalog());
7338
- l.set(cp(m.namespace), g), e.emit("received signal", {
7342
+ ]), g = new fg(re.catalog());
7343
+ l.set(lp(m.namespace), g), e.emit("received signal", {
7339
7344
  type: "client ip",
7340
7345
  ip: re.connectionInfo().ip
7341
7346
  }), re.drm().then((t) => {
@@ -7344,28 +7349,28 @@ var Bh = 1e4, Q = /* @__PURE__ */ new WeakMap(), Vh = /* @__PURE__ */ new WeakMa
7344
7349
  r.error("Error getting DRM data", e);
7345
7350
  });
7346
7351
  let ie = new n(e, r, te, re, l, i, o);
7347
- return u.textTrack && b(Xh, ie).call(ie, u.textTrack), ie;
7352
+ return u.textTrack && b(Zh, ie).call(ie, u.textTrack), ie;
7348
7353
  })();
7349
7354
  }
7350
7355
  getState() {
7351
- return b(Uh, this);
7356
+ return b(Wh, this);
7352
7357
  }
7353
7358
  close() {
7354
- b(Hh, this).close();
7359
+ b(Uh, this).close();
7355
7360
  }
7356
7361
  closed() {
7357
- return Promise.race([b(Hh, this).closed(), b($, this).closed()]);
7362
+ return Promise.race([b(Uh, this).closed(), b($, this).closed()]);
7358
7363
  }
7359
7364
  };
7360
- function eg() {
7365
+ function tg() {
7361
7366
  var e = this;
7362
7367
  return t(function* () {
7363
- b(Hh, e).transportType() === "websocket" && (yield pn(5e3));
7368
+ b(Uh, e).transportType() === "websocket" && (yield pn(5e3));
7364
7369
  var t = !1, n = !1, r;
7365
7370
  try {
7366
7371
  for (var i = U(b($, e).stats()), a; t = !(a = yield i.next()).done; t = !1) {
7367
7372
  let { rtt: t, estimatedBandwidth: n } = a.value;
7368
- x(qh, e, n), b(Kh, e).push(t), b(Q, e).emit("rtt", Ot(b(Kh, e).items()));
7373
+ x(Jh, e, n), b(qh, e).push(t), b(Q, e).emit("rtt", Ot(b(qh, e).items()));
7369
7374
  }
7370
7375
  } catch (e) {
7371
7376
  n = !0, r = e;
@@ -7378,26 +7383,26 @@ function eg() {
7378
7383
  }
7379
7384
  })();
7380
7385
  }
7381
- function tg(e) {
7386
+ function ng(e) {
7382
7387
  var n = this;
7383
7388
  return t(function* () {
7384
7389
  var t;
7385
- let r = yield b(Gh, n).connect({ channelId: e });
7390
+ let r = yield b(Kh, n).connect({ channelId: e });
7386
7391
  if (!ce(r)) throw Error("no moq connect info found");
7387
7392
  let i = (t = r.channels.find((t) => t.channelId === e)) == null ? void 0 : t.catalog;
7388
7393
  if (!i) throw Error("no catalog found");
7389
7394
  return i;
7390
7395
  })();
7391
7396
  }
7392
- function ng(e) {
7397
+ function rg(e) {
7393
7398
  var n = this;
7394
7399
  return t(function* () {
7395
7400
  var t, r;
7396
- b(Vh, n).info("handle subscription", e);
7397
- let i = b($, n), a = b(Wh, n).get(e.channelId);
7398
- if (a || (a = new dg(new A(yield y(Yh, n, tg).call(n, e.channelId))), b(Wh, n).set(e.channelId, a)), i.namespace().join("/") !== a.namespace().join("/")) {
7401
+ b(Hh, n).info("handle subscription", e);
7402
+ let i = b($, n), a = b(Gh, n).get(e.channelId);
7403
+ if (a || (a = new fg(new A(yield y(Xh, n, ng).call(n, e.channelId))), b(Gh, n).set(e.channelId, a)), i.namespace().join("/") !== a.namespace().join("/")) {
7399
7404
  var o;
7400
- b(Vh, n).info("changing channel", e.channelId);
7405
+ b(Hh, n).info("changing channel", e.channelId);
7401
7406
  let t = a.getVideoTrack(e.video), r = a.getAudioTrack(e.audio);
7402
7407
  yield i.zap({
7403
7408
  namespace: a.namespace(),
@@ -7407,8 +7412,8 @@ function ng(e) {
7407
7412
  }, 500), i.drm().then((e) => {
7408
7413
  e && b(Q, n).emit("received drm data", e.value);
7409
7414
  }).catch((e) => {
7410
- b(Vh, n).error("Error getting DRM data", e);
7411
- }), b(Vh, n).info("switched channel", e.channelId), (o = b(Wh, n).get(cp(i.namespace()))) == null || o.updateCatalog(i.catalog()), b(Q, n).emit("received signal", {
7415
+ b(Hh, n).error("Error getting DRM data", e);
7416
+ }), b(Hh, n).info("switched channel", e.channelId), (o = b(Gh, n).get(lp(i.namespace()))) == null || o.updateCatalog(i.catalog()), b(Q, n).emit("received signal", {
7412
7417
  type: "subscription changed",
7413
7418
  subscription: e
7414
7419
  });
@@ -7421,26 +7426,26 @@ function ng(e) {
7421
7426
  });
7422
7427
  })();
7423
7428
  }
7424
- function rg(e) {
7425
- x(Uh, this, e), b(Q, this).emit("connection state", e);
7429
+ function ig(e) {
7430
+ x(Wh, this, e), b(Q, this).emit("connection state", e);
7426
7431
  }
7427
- function ig() {
7432
+ function ag() {
7428
7433
  var e = this;
7429
7434
  return t(function* () {
7430
7435
  try {
7431
- y(Yh, e, rg).call(e, "connecting"), b(Vh, e).info("Connecting..."), y(Yh, e, rg).call(e, "connected"), yield Promise.all([
7432
- y(Yh, e, og).call(e, b($, e).referenceClock(), b($, e).audio),
7433
- y(Yh, e, og).call(e, b($, e).referenceClock(), b($, e).video),
7434
- y(Yh, e, ag).call(e, b($, e).subtitles)
7435
- ]), yield b($, e).closed(), b(Hh, e).close(), b(Vh, e).info("Session closed");
7436
+ y(Xh, e, ig).call(e, "connecting"), b(Hh, e).info("Connecting..."), y(Xh, e, ig).call(e, "connected"), yield Promise.all([
7437
+ y(Xh, e, sg).call(e, b($, e).referenceClock(), b($, e).audio),
7438
+ y(Xh, e, sg).call(e, b($, e).referenceClock(), b($, e).video),
7439
+ y(Xh, e, og).call(e, b($, e).subtitles)
7440
+ ]), yield b($, e).closed(), b(Uh, e).close(), b(Hh, e).info("Session closed");
7436
7441
  } catch (t) {
7437
- b(Vh, e).warn("Session error", t);
7442
+ b(Hh, e).warn("Session error", t);
7438
7443
  } finally {
7439
- y(Yh, e, rg).call(e, "disconnected");
7444
+ y(Xh, e, ig).call(e, "disconnected");
7440
7445
  }
7441
7446
  })();
7442
7447
  }
7443
- function ag(e) {
7448
+ function og(e) {
7444
7449
  var n = this;
7445
7450
  return t(function* () {
7446
7451
  var t = !1, r = !1, i;
@@ -7460,7 +7465,7 @@ function ag(e) {
7460
7465
  }
7461
7466
  })();
7462
7467
  }
7463
- function og(e, n) {
7468
+ function sg(e, n) {
7464
7469
  var r = this;
7465
7470
  return t(function* () {
7466
7471
  let t = "", i = "", a, o = b($, r).videoTrack() === void 0;
@@ -7470,7 +7475,7 @@ function og(e, n) {
7470
7475
  let n = d.value;
7471
7476
  {
7472
7477
  var f;
7473
- let s = cp(n.track.namespace), c = n.track.trackObject.language, l = pe((f = n.track.trackObject.codec) == null ? "" : f), u = n.track.trackObject.codec, d = l ? _n({
7478
+ let s = lp(n.track.namespace), c = n.track.trackObject.language, l = pe((f = n.track.trackObject.codec) == null ? "" : f), u = n.track.trackObject.codec, d = l ? _n({
7474
7479
  codec: l,
7475
7480
  codecString: u
7476
7481
  }) : void 0, ne = !!n.track.trackObject["com.vindral.drm"];
@@ -7485,11 +7490,11 @@ function og(e, n) {
7485
7490
  drmTransition: a !== void 0 && a !== ne
7486
7491
  };
7487
7492
  t = s, i = c, a = ne;
7488
- let m = f.producerReferenceTime(), h = b(Jh, r).get(n.track.namespace) || 0;
7493
+ let m = f.producerReferenceTime(), h = b(Yh, r).get(n.track.namespace) || 0;
7489
7494
  if (m && Date.now() - h > 1e3) {
7490
- b(Jh, r).set(n.track.namespace, Date.now());
7495
+ b(Yh, r).set(n.track.namespace, Date.now());
7491
7496
  let t = e.wallclock() - m.getTime();
7492
- b(Vh, r).debug("timing-info", {
7497
+ b(Hh, r).debug("timing-info", {
7493
7498
  mediaType: f.mediaType(),
7494
7499
  referenceClock: e,
7495
7500
  delta: t,
@@ -7512,7 +7517,7 @@ function og(e, n) {
7512
7517
  mimeType: d,
7513
7518
  codec: l,
7514
7519
  switchInfo: p,
7515
- renditionId: sg(n.track.trackObject.name)
7520
+ renditionId: cg(n.track.trackObject.name)
7516
7521
  });
7517
7522
  }
7518
7523
  }
@@ -7538,52 +7543,52 @@ function og(e, n) {
7538
7543
  }
7539
7544
  })();
7540
7545
  }
7541
- function sg(e) {
7546
+ function cg(e) {
7542
7547
  return e.split("").reduce((e, t) => e = t.charCodeAt(0) + (e << 6) + (e << 16) - e, 0);
7543
7548
  }
7544
- var cg = /* @__PURE__ */ new WeakMap(), lg = /* @__PURE__ */ new WeakMap(), ug = /* @__PURE__ */ new WeakSet(), dg = class {
7549
+ var lg = /* @__PURE__ */ new WeakMap(), ug = /* @__PURE__ */ new WeakMap(), dg = /* @__PURE__ */ new WeakSet(), fg = class {
7545
7550
  constructor(e) {
7546
- S(this, ug), v(this, cg, void 0), v(this, lg, void 0), x(cg, this, e), x(lg, this, y(ug, this, fg).call(this));
7551
+ S(this, dg), v(this, lg, void 0), v(this, ug, void 0), x(lg, this, e), x(ug, this, y(dg, this, pg).call(this));
7547
7552
  }
7548
7553
  catalog() {
7549
- return b(cg, this).current();
7554
+ return b(lg, this).current();
7550
7555
  }
7551
7556
  namespace() {
7552
- return b(cg, this).current().namespace;
7557
+ return b(lg, this).current().namespace;
7553
7558
  }
7554
7559
  updateCatalog(e) {
7555
- x(cg, this, e);
7560
+ x(lg, this, e);
7556
7561
  }
7557
7562
  getTextTrack(e) {
7558
- return b(cg, this).current().tracks.find((t) => t.label === e);
7563
+ return b(lg, this).current().tracks.find((t) => t.label === e);
7559
7564
  }
7560
7565
  getAudioTrack(e) {
7561
7566
  if (!e.codec) return;
7562
- let t = b(lg, this).filter((t) => !(!gn(t) || t.bitRate > e.bitRate || e.codec && t.codec !== e.codec || e.language && t.language !== e.language));
7567
+ let t = b(ug, this).filter((t) => !(!gn(t) || t.bitRate > e.bitRate || e.codec && t.codec !== e.codec || e.language && t.language !== e.language));
7563
7568
  return t[t.length - 1];
7564
7569
  }
7565
7570
  getVideoTrack(e) {
7566
7571
  if (!e.codec) return;
7567
- let t = b(lg, this).filter((t) => !(!hn(t) || t.bitRate > e.bitRate || e.codec && t.codec !== e.codec));
7572
+ let t = b(ug, this).filter((t) => !(!hn(t) || t.bitRate > e.bitRate || e.codec && t.codec !== e.codec));
7568
7573
  return t[t.length - 1];
7569
7574
  }
7570
7575
  renditions() {
7571
- return b(lg, this);
7576
+ return b(ug, this);
7572
7577
  }
7573
7578
  };
7574
- function fg() {
7575
- let [e, t] = b(cg, this).value();
7579
+ function pg() {
7580
+ let [e, t] = b(lg, this).value();
7576
7581
  return ue(e);
7577
7582
  }
7578
7583
  //#endregion
7579
7584
  //#region ../../libs/web-sdk/src/resolveEdgeUrl.ts
7580
- var pg = (e, t) => {
7585
+ var mg = (e, t) => {
7581
7586
  var n, r;
7582
7587
  let i = new URL("/subscribe", e);
7583
7588
  return i.searchParams.append("channelId", t.channelId), i.searchParams.append("sessionId", t.sessionId), i.searchParams.append("clientId", t.clientId), (n = t.audio) != null && n.codec && (i.searchParams.append("audio.bitRate", Math.round(t.audio.bitRate).toString()), i.searchParams.append("audio.codec", t.audio.codec), t.audio.language && i.searchParams.append("audio.language", t.audio.language)), (r = t.video) != null && r.codec && (i.searchParams.append("video.width", t.video.width.toString()), i.searchParams.append("video.height", t.video.height.toString()), i.searchParams.append("video.bitRate", Math.round(t.video.bitRate).toString()), i.searchParams.append("video.codec", t.video.codec)), t.expectAdditionalConnection && i.searchParams.append("expectAdditionalConnection", t.expectAdditionalConnection.toString()), t.burstMs && i.searchParams.append("burstMs", t.burstMs.toString()), t.channelGroupId && i.searchParams.append("channelGroupId", t.channelGroupId), t.authToken && (i.searchParams.append("auth.token", t.authToken), i.searchParams.append("auth.type", "jwt")), i.toString();
7584
- }, mg = /* @__PURE__ */ function(e) {
7589
+ }, hg = /* @__PURE__ */ function(e) {
7585
7590
  return e[e.AuthenticationFailed = 4e3] = "AuthenticationFailed", e[e.AuthenticationRefreshFailed = 4001] = "AuthenticationRefreshFailed", e[e.AuthenticationExpired = 4002] = "AuthenticationExpired", e[e.ChannelNotFound = 4003] = "ChannelNotFound", e[e.Inactivity = 4010] = "Inactivity", e;
7586
- }({}), hg = class extends _e {
7591
+ }({}), gg = class extends _e {
7587
7592
  constructor(n, r) {
7588
7593
  var i;
7589
7594
  super(), i = this, e(this, "options", void 0), e(this, "websockets", []), e(this, "logger", void 0), e(this, "reconnectState", { reconnectRetries: 0 }), e(this, "isSuspended", !1), e(this, "_connectionAttemptCount", 0), e(this, "connectStartTime", 0), e(this, "_connectTime", void 0), e(this, "shouldContinueConnecting", !1), e(this, "_isConnectInProgress", !1), e(this, "readyState", () => {
@@ -7625,19 +7630,19 @@ var pg = (e, t) => {
7625
7630
  code: e.code,
7626
7631
  isSuspended: this.isSuspended
7627
7632
  })), this.close("one websocket was closed"), e.code) {
7628
- case mg.AuthenticationFailed:
7633
+ case hg.AuthenticationFailed:
7629
7634
  this.emit("error", ne(se()));
7630
7635
  break;
7631
- case mg.AuthenticationRefreshFailed:
7636
+ case hg.AuthenticationRefreshFailed:
7632
7637
  this.emit("error", ne(se()));
7633
7638
  break;
7634
- case mg.AuthenticationExpired:
7639
+ case hg.AuthenticationExpired:
7635
7640
  this.emit("error", h(se()));
7636
7641
  break;
7637
- case mg.ChannelNotFound:
7642
+ case hg.ChannelNotFound:
7638
7643
  this.emit("error", m("internal", se()));
7639
7644
  break;
7640
- case mg.Inactivity:
7645
+ case hg.Inactivity:
7641
7646
  this.emit("error", oe("internal", se()));
7642
7647
  break;
7643
7648
  default:
@@ -7686,10 +7691,10 @@ var pg = (e, t) => {
7686
7691
  get connectTime() {
7687
7692
  return this._connectTime;
7688
7693
  }
7689
- }, gg, _g = 65536 * 8, vg = .9, yg = 40, bg = (e) => {
7690
- let t = e || yg;
7691
- return _g * vg * 1e3 / t;
7692
- }, xg = class n {
7694
+ }, _g, vg = 65536 * 8, yg = .9, bg = 40, xg = (e) => {
7695
+ let t = e || bg;
7696
+ return vg * yg * 1e3 / t;
7697
+ }, Sg = class n {
7693
7698
  constructor(r, i, a, s) {
7694
7699
  var c = this;
7695
7700
  e(this, "emitter", void 0), e(this, "transport", void 0), e(this, "logger", void 0), e(this, "config", void 0), e(this, "rtts", void 0), e(this, "lastPingSentTime", Date.now()), e(this, "isPingInFlight", !1), e(this, "connectCount", 0), e(this, "missedPings", 0), e(this, "contextSwitchesInProgress", /* @__PURE__ */ new Set()), e(this, "contextSwitchesCompleted", /* @__PURE__ */ new Set()), e(this, "buffer", []), e(this, "disconnected", new w()), e(this, "unload", () => {
@@ -7738,7 +7743,7 @@ var pg = (e, t) => {
7738
7743
  }), e(this, "resolveEdgeUrl", t(function* () {
7739
7744
  let e = c.config.connectInfo, t = yield c.config.onConnectInfo(e), n = c.config.options.getOverride("separateVideoSocketEnabled", t.channelId), r = c.config.options.get("media") === "audio+video", i = 1;
7740
7745
  r && (i = n === !1 ? 1 : 2);
7741
- let a = pg(c.config.edgeUrl, {
7746
+ let a = mg(c.config.edgeUrl, {
7742
7747
  video: t.video,
7743
7748
  audio: t.audio,
7744
7749
  burstMs: t.burstMs,
@@ -7771,7 +7776,7 @@ var pg = (e, t) => {
7771
7776
  }
7772
7777
  }
7773
7778
  }), e(this, "connectWebSocketTransport", () => {
7774
- let e = new hg({
7779
+ let e = new gg({
7775
7780
  reconnectDelay: 1e3,
7776
7781
  onMessage: this.onMessage,
7777
7782
  reconnectHandler: this.config.reconnectHandler,
@@ -7812,47 +7817,47 @@ var pg = (e, t) => {
7812
7817
  return this.disconnected.promise;
7813
7818
  }
7814
7819
  };
7815
- gg = xg, e(xg, "PING_INTERVAL", 5e3), e(xg, "MAX_MISSED_PINGS", 4), e(xg, "TLS_ROUNDTRIPS", 3), e(xg, "start", (e, t, n, r) => new Promise((i, a) => {
7816
- let o = new gg(e, t, n, r);
7820
+ _g = Sg, e(Sg, "PING_INTERVAL", 5e3), e(Sg, "MAX_MISSED_PINGS", 4), e(Sg, "TLS_ROUNDTRIPS", 3), e(Sg, "start", (e, t, n, r) => new Promise((i, a) => {
7821
+ let o = new _g(e, t, n, r);
7817
7822
  o.transport.once("error", (e) => a(e)), o.transport.once("open", () => i(o));
7818
7823
  }));
7819
7824
  //#endregion
7820
7825
  //#region ../../libs/web-sdk/src/EdgeSelector.ts
7821
- var Sg = /* @__PURE__ */ new WeakMap(), Cg = /* @__PURE__ */ new WeakMap(), wg = /* @__PURE__ */ new WeakMap(), Tg = class {
7826
+ var Cg = /* @__PURE__ */ new WeakMap(), wg = /* @__PURE__ */ new WeakMap(), Tg = /* @__PURE__ */ new WeakMap(), Eg = class {
7822
7827
  constructor(e) {
7823
- v(this, Sg, void 0), v(this, Cg, []), v(this, wg, void 0), x(Sg, this, e);
7828
+ v(this, Cg, void 0), v(this, wg, []), v(this, Tg, void 0), x(Cg, this, e);
7824
7829
  }
7825
7830
  select(e) {
7826
- if (b(Sg, this).edgeUrl) return b(Sg, this).edgeUrl;
7827
- b(Cg, this).length === 0 && x(Cg, this, b(Cg, this).concat(e));
7828
- let t = b(Cg, this).shift();
7829
- if (x(wg, this, t), t) return t;
7831
+ if (b(Cg, this).edgeUrl) return b(Cg, this).edgeUrl;
7832
+ b(wg, this).length === 0 && x(wg, this, b(wg, this).concat(e));
7833
+ let t = b(wg, this).shift();
7834
+ if (x(Tg, this, t), t) return t;
7830
7835
  }
7831
7836
  shiftedEdge() {
7832
- return b(wg, this);
7837
+ return b(Tg, this);
7833
7838
  }
7834
7839
  reset() {
7835
- x(wg, this, void 0), x(Cg, this, []);
7840
+ x(Tg, this, void 0), x(wg, this, []);
7836
7841
  }
7837
- }, Eg, Dg = /* @__PURE__ */ new WeakMap(), Og = /* @__PURE__ */ new WeakMap(), kg = /* @__PURE__ */ new WeakMap(), Ag = /* @__PURE__ */ new WeakMap(), jg = /* @__PURE__ */ new WeakMap(), Mg = /* @__PURE__ */ new WeakMap(), Ng = /* @__PURE__ */ new WeakMap(), Pg = /* @__PURE__ */ new WeakMap(), Fg = /* @__PURE__ */ new WeakMap(), Ig = /* @__PURE__ */ new WeakMap(), Lg = /* @__PURE__ */ new WeakSet(), Rg = class n {
7842
+ }, Dg, Og = /* @__PURE__ */ new WeakMap(), kg = /* @__PURE__ */ new WeakMap(), Ag = /* @__PURE__ */ new WeakMap(), jg = /* @__PURE__ */ new WeakMap(), Mg = /* @__PURE__ */ new WeakMap(), Ng = /* @__PURE__ */ new WeakMap(), Pg = /* @__PURE__ */ new WeakMap(), Fg = /* @__PURE__ */ new WeakMap(), Ig = /* @__PURE__ */ new WeakMap(), Lg = /* @__PURE__ */ new WeakMap(), Rg = /* @__PURE__ */ new WeakSet(), zg = class n {
7838
7843
  constructor(r, i, a) {
7839
7844
  var o = this;
7840
- S(this, Lg), e(this, "emitter", void 0), e(this, "logger", void 0), e(this, "config", void 0), e(this, "apiClient", void 0), e(this, "connectionImpl", void 0), v(this, Dg, new _(10)), v(this, Og, !0), v(this, kg, void 0), v(this, Ag, 0), v(this, jg, 0), v(this, Mg, 0), v(this, Ng, void 0), v(this, Pg, void 0), e(this, "unload", () => {
7845
+ S(this, Rg), e(this, "emitter", void 0), e(this, "logger", void 0), e(this, "config", void 0), e(this, "apiClient", void 0), e(this, "connectionImpl", void 0), v(this, Og, new _(10)), v(this, kg, !0), v(this, Ag, void 0), v(this, jg, 0), v(this, Mg, 0), v(this, Ng, 0), v(this, Pg, void 0), v(this, Fg, void 0), e(this, "unload", () => {
7841
7846
  var e;
7842
7847
  this.logger.debug("Unloading module..."), this.disconnect("Unloading"), (e = this.connectionImpl) == null || e.unload(), this.logger.debug("Unloaded module");
7843
7848
  }), e(this, "suspend", () => {
7844
7849
  var e;
7845
- x(Og, this, !1), (e = this.connectionImpl) == null || e.suspend();
7850
+ x(kg, this, !1), (e = this.connectionImpl) == null || e.suspend();
7846
7851
  }), e(this, "unsuspend", () => {
7847
7852
  var e;
7848
- x(Og, this, !0), (e = this.connectionImpl) == null || e.unsuspend(), this.connect();
7853
+ x(kg, this, !0), (e = this.connectionImpl) == null || e.unsuspend(), this.connect();
7849
7854
  }), e(this, "getState", () => this.connectionImpl ? this.connectionImpl.getState() : "disconnected"), e(this, "getStatistics", () => {
7850
- let e = b(jg, this) > 0 ? b(Mg, this) / b(jg, this) : 0;
7855
+ let e = b(Mg, this) > 0 ? b(Ng, this) / b(Mg, this) : 0;
7851
7856
  return this.connectionImpl ? C(C({}, this.connectionImpl.getStatistics()), {}, {
7852
- rtt: At(b(Dg, this).items()),
7857
+ rtt: At(b(Og, this).items()),
7853
7858
  estimatedBandwidth: this.estimatedBandwidth,
7854
- connectCount: b(Mg, this),
7855
- connectionAttemptCount: b(jg, this),
7859
+ connectCount: b(Ng, this),
7860
+ connectionAttemptCount: b(Mg, this),
7856
7861
  connectionSuccessRatio: e
7857
7862
  }) : {
7858
7863
  rtt: {
@@ -7862,19 +7867,19 @@ var Sg = /* @__PURE__ */ new WeakMap(), Cg = /* @__PURE__ */ new WeakMap(), wg =
7862
7867
  last: 0
7863
7868
  },
7864
7869
  estimatedBandwidth: 0,
7865
- connectCount: b(Mg, this),
7866
- connectionAttemptCount: b(jg, this),
7870
+ connectCount: b(Ng, this),
7871
+ connectionAttemptCount: b(Mg, this),
7867
7872
  connectionSuccessRatio: e,
7868
7873
  connectionProtocol: void 0
7869
7874
  };
7870
7875
  }), e(this, "connect", () => {
7871
- x(Og, this, !0), !b(kg, this) && x(kg, this, y(Lg, this, zg).call(this));
7876
+ x(kg, this, !0), !b(Ag, this) && x(Ag, this, y(Rg, this, Bg).call(this));
7872
7877
  }), e(this, "disconnect", (e = "Disconnect Requested") => {
7873
7878
  var t;
7874
- x(Og, this, !1), (t = this.connectionImpl) == null || t.close(e);
7879
+ x(kg, this, !1), (t = this.connectionImpl) == null || t.close(e);
7875
7880
  }), e(this, "reconnect", (e) => {
7876
7881
  this.disconnect(e), this.connect();
7877
- }), v(this, Fg, t(function* () {
7882
+ }), v(this, Ig, t(function* () {
7878
7883
  try {
7879
7884
  return yield o.apiClient.connect(o.config.options.getOptions());
7880
7885
  } catch (e) {
@@ -7885,7 +7890,7 @@ var Sg = /* @__PURE__ */ new WeakMap(), Cg = /* @__PURE__ */ new WeakMap(), wg =
7885
7890
  }
7886
7891
  throw o.emitter.emit("error", te(e instanceof Error ? e : void 0)), e;
7887
7892
  }
7888
- })), v(this, Ig, t(function* () {
7893
+ })), v(this, Lg, t(function* () {
7889
7894
  let e = Date.now(), t = () => Date.now() - e, r = globalThis.AbortController ? new AbortController() : void 0, i = fetch(new URL("/api/v4/connect/ping", o.config.options.get("url")).toString(), {
7890
7895
  method: "HEAD",
7891
7896
  signal: r == null ? void 0 : r.signal
@@ -7897,43 +7902,43 @@ var Sg = /* @__PURE__ */ new WeakMap(), Cg = /* @__PURE__ */ new WeakMap(), wg =
7897
7902
  });
7898
7903
  }
7899
7904
  get rtt() {
7900
- return b(Dg, this).items().length > 0 ? Ot(b(Dg, this).items()) : 0;
7905
+ return b(Og, this).items().length > 0 ? Ot(b(Og, this).items()) : 0;
7901
7906
  }
7902
7907
  get estimatedBandwidth() {
7903
- return this.connectionImpl && "estimatedBandwidth" in this.connectionImpl && this.connectionImpl.estimatedBandwidth ? this.connectionImpl.estimatedBandwidth : bg(this.rtt);
7908
+ return this.connectionImpl && "estimatedBandwidth" in this.connectionImpl && this.connectionImpl.estimatedBandwidth ? this.connectionImpl.estimatedBandwidth : xg(this.rtt);
7904
7909
  }
7905
7910
  get firstConnectionTime() {
7906
- return b(Ng, this);
7911
+ return b(Pg, this);
7907
7912
  }
7908
7913
  get lastConnectionTime() {
7909
- return b(Pg, this);
7914
+ return b(Fg, this);
7910
7915
  }
7911
7916
  };
7912
- Eg = Rg;
7913
- function zg() {
7917
+ Dg = zg;
7918
+ function Bg() {
7914
7919
  var e = this;
7915
7920
  return t(function* () {
7916
- let t = new Tg({ edgeUrl: e.config.options.get("edgeUrl") });
7917
- for (x(Ag, e, 0);;) {
7921
+ let t = new Eg({ edgeUrl: e.config.options.get("edgeUrl") });
7922
+ for (x(jg, e, 0);;) {
7918
7923
  var n, r, i;
7919
- x(Ag, e, (n = b(Ag, e), n++, n)), x(jg, e, (r = b(jg, e), r++, r));
7924
+ x(jg, e, (n = b(jg, e), n++, n)), x(Mg, e, (r = b(Mg, e), r++, r));
7920
7925
  let o = !1;
7921
7926
  try {
7922
7927
  var a;
7923
- let [n, r] = yield Promise.all([b(Fg, e).call(e), b(Ig, e).call(e)]);
7924
- if (b(Dg, e).clear(), r !== void 0 && b(Dg, e).push(r / 2), !b(Og, e)) break;
7928
+ let [n, r] = yield Promise.all([b(Ig, e).call(e), b(Lg, e).call(e)]);
7929
+ if (b(Og, e).clear(), r !== void 0 && b(Og, e).push(r / 2), !b(kg, e)) break;
7925
7930
  let i = t.select(n.edges);
7926
7931
  if (!i) throw new g("Failed to resolve edge url", {
7927
7932
  isFatal: !0,
7928
7933
  code: "failed_to_resolve_edge_url"
7929
7934
  });
7930
- ce(n) ? e.connectionImpl = yield $h.start(e.emitter, e.logger, e.apiClient, C(C({}, e.config), {}, {
7935
+ ce(n) ? e.connectionImpl = yield eg.start(e.emitter, e.logger, e.apiClient, C(C({}, e.config), {}, {
7931
7936
  connectInfo: n,
7932
7937
  edgeUrl: i
7933
- }), b(Dg, e)) : (de(typeof i == "string", "Edge URL is expected to be a string"), e.connectionImpl = yield xg.start(e.emitter, e.logger, C(C({}, e.config), {}, {
7938
+ }), b(Og, e)) : (de(typeof i == "string", "Edge URL is expected to be a string"), e.connectionImpl = yield Sg.start(e.emitter, e.logger, C(C({}, e.config), {}, {
7934
7939
  connectInfo: n,
7935
7940
  edgeUrl: i
7936
- }), b(Dg, e))), t.reset(), x(Mg, e, (a = b(Mg, e), a++, a)), x(Ag, e, 0), x(Pg, e, Date.now()), b(Ng, e) || x(Ng, e, b(Pg, e)), yield e.connectionImpl.closed(), e.logger.info("Connection closed");
7941
+ }), b(Og, e))), t.reset(), x(Ng, e, (a = b(Ng, e), a++, a)), x(jg, e, 0), x(Fg, e, Date.now()), b(Pg, e) || x(Pg, e, b(Fg, e)), yield e.connectionImpl.closed(), e.logger.info("Connection closed");
7937
7942
  } catch (n) {
7938
7943
  e.logger.warn("Failed to connect", n);
7939
7944
  let r = t.shiftedEdge();
@@ -7946,30 +7951,30 @@ function zg() {
7946
7951
  }));
7947
7952
  }
7948
7953
  if ((i = e.connectionImpl) == null || i.unload(), e.connectionImpl = void 0, o) {
7949
- x(Og, e, !1);
7954
+ x(kg, e, !1);
7950
7955
  break;
7951
7956
  }
7952
- if (!b(Og, e)) break;
7953
- if (!(yield e.config.reconnectHandler({ reconnectRetries: b(Ag, e) }))) {
7957
+ if (!b(kg, e)) break;
7958
+ if (!(yield e.config.reconnectHandler({ reconnectRetries: b(jg, e) }))) {
7954
7959
  e.emitter.emit("error", s());
7955
7960
  break;
7956
7961
  }
7957
- if (yield pn(1e3), !b(Og, e)) break;
7962
+ if (yield pn(1e3), !b(kg, e)) break;
7958
7963
  }
7959
- x(kg, e, void 0);
7964
+ x(Ag, e, void 0);
7960
7965
  })();
7961
7966
  }
7962
- e(Rg, "PING_TIMEOUT", 1e3), e(Rg, "create", (e, t, n) => new Eg(e, t, n));
7967
+ e(zg, "PING_TIMEOUT", 1e3), e(zg, "create", (e, t, n) => new Dg(e, t, n));
7963
7968
  //#endregion
7964
7969
  //#region ../../libs/web-sdk/src/modules/ConstraintCapModule.ts
7965
- var Bg, Vg = () => ({
7970
+ var Vg, Hg = () => ({
7966
7971
  video: C(C({}, yn()), {}, { bitRate: vn() }),
7967
7972
  audio: { bitRate: vn() }
7968
- }), Hg = () => ({
7973
+ }), Ug = () => ({
7969
7974
  width: window.innerWidth,
7970
7975
  height: window.innerHeight,
7971
7976
  bitRate: vn()
7972
- }), Ug = class t {
7977
+ }), Wg = class t {
7973
7978
  constructor(n, r, i, a) {
7974
7979
  e(this, "emitter", void 0), e(this, "timers", new j()), e(this, "pictureInPictureSource", void 0), e(this, "element", void 0), e(this, "currentCap", void 0), e(this, "userSpecifiedCap", void 0), e(this, "renditionLevelSource", void 0), e(this, "resizeObserver", void 0), e(this, "elementSize", void 0), e(this, "_sizeBasedResolutionCapEnabled", void 0), e(this, "unload", () => {
7975
7980
  var e;
@@ -7991,7 +7996,7 @@ var Bg, Vg = () => ({
7991
7996
  this.timers.unload();
7992
7997
  }), e(this, "setUserSpecifiedCap", (e) => {
7993
7998
  var t;
7994
- let n = (t = this.getUserSpecifiedCap()) == null ? Vg() : t;
7999
+ let n = (t = this.getUserSpecifiedCap()) == null ? Hg() : t;
7995
8000
  this.userSpecifiedCap = C(C({}, n), {}, {
7996
8001
  video: C(C({}, n.video), e.video),
7997
8002
  audio: C(C({}, n.audio), e.audio)
@@ -8015,7 +8020,7 @@ var Bg, Vg = () => ({
8015
8020
  });
8016
8021
  }), e(this, "evaluateConstraintCap", () => {
8017
8022
  var e, t, n, r;
8018
- let i = this.sizeBasedResolutionCapEnabled ? C(C({}, Vg()), {}, { video: Hg() }) : Vg();
8023
+ let i = this.sizeBasedResolutionCapEnabled ? C(C({}, Hg()), {}, { video: Ug() }) : Hg();
8019
8024
  if (!this.resizeObserver) {
8020
8025
  let e = this.element.getBoundingClientRect();
8021
8026
  this.elementSize = {
@@ -8052,14 +8057,14 @@ var Bg, Vg = () => ({
8052
8057
  this._sizeBasedResolutionCapEnabled = e, this.evaluateConstraintCap();
8053
8058
  }
8054
8059
  };
8055
- Bg = Ug, e(Ug, "CHECK_SIZE_INTERVAL", 1e3), e(Ug, "create", (e, t, n, r) => new Bg(e, t, n, r));
8060
+ Vg = Wg, e(Wg, "CHECK_SIZE_INTERVAL", 1e3), e(Wg, "create", (e, t, n, r) => new Vg(e, t, n, r));
8056
8061
  //#endregion
8057
8062
  //#region ../../libs/web-sdk/src/modules/DecoderModule.ts
8058
- var Wg = 5, Gg = 100, Kg = 1e3, qg = class r {
8063
+ var Gg = 5, Kg = 100, qg = 1e3, Jg = class r {
8059
8064
  constructor(t, n, r, i, a = !1, o = !1, s = !1) {
8060
8065
  e(this, "timers", j.create()), e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "trackContexts", void 0), e(this, "playbackSource", void 0), e(this, "isSuspended", !1), e(this, "_webCodecsInUse", void 0), e(this, "_audioWebCodecsInUse", void 0), e(this, "_offscreenCanvasInUse", void 0), e(this, "decodedVideoSamplesInCurrentInterval", 0), e(this, "currentVideoDecodeRate", 2 ** 53 - 1), e(this, "isAudioEmitRetryScheduled", !1), e(this, "videoKeyframeTimestamps", []), e(this, "load", () => {
8061
- let e = this._audioWebCodecsInUse ? 20 : Gg;
8062
- this.timers.setInterval(this.emitDecodedFrames, e), this.timers.setInterval(this.emitDecodeRate, Kg), this.emitter.on("init segment", this.onInitSegment), this.emitter.on("coded sample", this.decode);
8066
+ let e = this._audioWebCodecsInUse ? 20 : Kg;
8067
+ this.timers.setInterval(this.emitDecodedFrames, e), this.timers.setInterval(this.emitDecodeRate, qg), this.emitter.on("init segment", this.onInitSegment), this.emitter.on("coded sample", this.decode);
8063
8068
  }), e(this, "unload", () => {
8064
8069
  this.trackContexts.forEach(({ decoderContext: e }) => e.unload()), this.timers.unload(), this.isAudioEmitRetryScheduled = !1, this.videoKeyframeTimestamps = [], this.emitter.off("init segment", this.onInitSegment), this.emitter.off("coded sample", this.decode);
8065
8070
  }), e(this, "suspend", () => {
@@ -8076,7 +8081,7 @@ var Wg = 5, Gg = 100, Kg = 1e3, qg = class r {
8076
8081
  if (!t) return 2 ** 53 - 1;
8077
8082
  let n = (e = t.sampleDuration) == null ? 40 : e;
8078
8083
  if (!Number.isFinite(n) || n <= 0) return 0;
8079
- let r = 1e3 / n, i = this.decodedVideoSamplesInCurrentInterval * 1e3 / Kg / r;
8084
+ let r = 1e3 / n, i = this.decodedVideoSamplesInCurrentInterval * 1e3 / qg / r;
8080
8085
  return !Number.isFinite(i) || i < 0 ? 0 : i;
8081
8086
  }), e(this, "getStatistics", () => {
8082
8087
  var e, t, n, r, i;
@@ -8118,7 +8123,7 @@ var Wg = 5, Gg = 100, Kg = 1e3, qg = class r {
8118
8123
  if (this.isSuspended) return;
8119
8124
  t.sampleDuration = e.duration / e.timescale * 1e3;
8120
8125
  let n = e.compositionTimeOffset || 0, { decoderContext: r, buffer: i } = t, a = (e.timestamp + n) / e.timescale * 1e3, o = e.duration / e.timescale * 1e3, s = i[i.length - 1];
8121
- if (!s || a - Wg > s.end ? i.push({
8126
+ if (!s || a - Gg > s.end ? i.push({
8122
8127
  start: a,
8123
8128
  end: a + o
8124
8129
  }) : a + o * 5 < s.end ? (t.buffer = [{
@@ -8234,7 +8239,7 @@ var Wg = 5, Gg = 100, Kg = 1e3, qg = class r {
8234
8239
  return new r(e, i, t, s, p, m, h);
8235
8240
  })();
8236
8241
  }
8237
- }, Jg, Yg = class {
8242
+ }, Yg, Xg = class {
8238
8243
  constructor(t) {
8239
8244
  e(this, "emitter", void 0), e(this, "isVisibleCount", 0), e(this, "isHiddenCount", 0), e(this, "isOnlineCount", 0), e(this, "isOfflineCount", 0), e(this, "isActive", document.visibilityState === "visible"), e(this, "unload", () => {
8240
8245
  document.removeEventListener("visibilitychange", this.onVisibilityChanged), window.removeEventListener("pagehide", this.onPageHide), window.removeEventListener("online", this.onOnline), window.removeEventListener("offline", this.onOffline);
@@ -8268,12 +8273,12 @@ var Wg = 5, Gg = 100, Kg = 1e3, qg = class r {
8268
8273
  return document.visibilityState === "visible";
8269
8274
  }
8270
8275
  };
8271
- Jg = Yg, e(Yg, "create", (e) => new Jg(e));
8276
+ Yg = Xg, e(Xg, "create", (e) => new Yg(e));
8272
8277
  //#endregion
8273
8278
  //#region ../../libs/web-sdk/src/modules/EventModule.ts
8274
- var Xg, Zg = (e) => (t, n, r) => t.timestamp <= n || t.timestampAdded <= r - e, Qg = class t {
8279
+ var Zg, Qg = (e) => (t, n, r) => t.timestamp <= n || t.timestampAdded <= r - e, $g = class t {
8275
8280
  constructor(n, r, i) {
8276
- e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "waitingEvents", []), e(this, "isTriggered", Zg(t.EVENT_TIMEOUT)), e(this, "timeSource", void 0), e(this, "timers", new j()), e(this, "load", () => {
8281
+ e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "waitingEvents", []), e(this, "isTriggered", Qg(t.EVENT_TIMEOUT)), e(this, "timeSource", void 0), e(this, "timers", new j()), e(this, "load", () => {
8277
8282
  this.timers.setInterval(this.onBufferedStateChanged, t.EVENT_CHECK_INTERVAL), this.emitter.on("add event", this.addEvent);
8278
8283
  }), e(this, "unload", () => {
8279
8284
  this.timers.unload(), this.emitter.off("add event", this.addEvent);
@@ -8300,10 +8305,10 @@ var Xg, Zg = (e) => (t, n, r) => t.timestamp <= n || t.timestampAdded <= r - e,
8300
8305
  }), this.logger = r, this.emitter = n, this.timeSource = i;
8301
8306
  }
8302
8307
  };
8303
- Xg = Qg, e(Qg, "EVENT_TIMEOUT", 5e3), e(Qg, "EVENT_CHECK_INTERVAL", 20), e(Qg, "create", (e, t, n) => new Xg(e, t, n));
8308
+ Zg = $g, e($g, "EVENT_TIMEOUT", 5e3), e($g, "EVENT_CHECK_INTERVAL", 20), e($g, "create", (e, t, n) => new Zg(e, t, n));
8304
8309
  //#endregion
8305
8310
  //#region ../../libs/web-sdk/src/modules/IncomingDataModule.ts
8306
- var $g, e_ = class t {
8311
+ var e_, t_ = class t {
8307
8312
  constructor(n) {
8308
8313
  e(this, "emitter", void 0), e(this, "timers", j.create()), e(this, "bytesReceived", /* @__PURE__ */ new Map()), e(this, "timeoutInterval", void 0), e(this, "lastBytesUpdated", Date.now()), e(this, "load", () => {
8309
8314
  this.emitter.on("connection state", this.onConnectionState), this.timers.setInterval(() => this.bytesReceived.forEach((e) => e.tick()), 100);
@@ -8338,10 +8343,10 @@ var $g, e_ = class t {
8338
8343
  }), this.emitter = n;
8339
8344
  }
8340
8345
  };
8341
- $g = e_, e(e_, "NO_DATA_ERROR_TIMEOUT", 20 * 1e3), e(e_, "NO_DATA_TIMEOUT", 5 * 1e3), e(e_, "UPDATE_RECEIVED_BYTES_INTERVAL", 1e3), e(e_, "create", (e) => new $g(e));
8346
+ e_ = t_, e(t_, "NO_DATA_ERROR_TIMEOUT", 20 * 1e3), e(t_, "NO_DATA_TIMEOUT", 5 * 1e3), e(t_, "UPDATE_RECEIVED_BYTES_INTERVAL", 1e3), e(t_, "create", (e) => new e_(e));
8342
8347
  //#endregion
8343
8348
  //#region ../../libs/web-sdk/src/modules/JitterModule.ts
8344
- var t_ = 1e3, n_ = 50, r_ = class t {
8349
+ var n_ = 1e3, r_ = 50, i_ = class t {
8345
8350
  constructor(t) {
8346
8351
  e(this, "logger", void 0), e(this, "trackingState", /* @__PURE__ */ new Map()), e(this, "runningJitter", /* @__PURE__ */ new Map()), e(this, "recentJitterSamples", /* @__PURE__ */ new Map()), e(this, "load", () => {
8347
8352
  this.logger.debug("JitterModule loaded");
@@ -8362,9 +8367,9 @@ var t_ = 1e3, n_ = 50, r_ = class t {
8362
8367
  this.trackingState.set(a, {
8363
8368
  lastArrivalTime: o,
8364
8369
  lastTimestampMs: s,
8365
- jitterSamples: new _(t_),
8366
- interArrivalTimes: new _(t_)
8367
- }), this.runningJitter.set(a, 0), this.recentJitterSamples.set(a, new _(n_));
8370
+ jitterSamples: new _(n_),
8371
+ interArrivalTimes: new _(n_)
8372
+ }), this.runningJitter.set(a, 0), this.recentJitterSamples.set(a, new _(r_));
8368
8373
  return;
8369
8374
  }
8370
8375
  let l = s - c.lastTimestampMs;
@@ -8377,7 +8382,7 @@ var t_ = 1e3, n_ = 50, r_ = class t {
8377
8382
  let f = (i = this.runningJitter.get(a)) == null ? 0 : i, p = f + (d - f) / 16;
8378
8383
  this.runningJitter.set(a, p);
8379
8384
  let m = this.recentJitterSamples.get(a);
8380
- m || (m = new _(n_), this.recentJitterSamples.set(a, m)), m.push(d), c.lastArrivalTime = o, c.lastTimestampMs = s;
8385
+ m || (m = new _(r_), this.recentJitterSamples.set(a, m)), m.push(d), c.lastArrivalTime = o, c.lastTimestampMs = s;
8381
8386
  }
8382
8387
  getJitterForType(e) {
8383
8388
  for (let [i, a] of this.trackingState) if (i.startsWith(e)) {
@@ -8408,10 +8413,10 @@ var t_ = 1e3, n_ = 50, r_ = class t {
8408
8413
  videoJitter: this.getJitterForType("video")
8409
8414
  };
8410
8415
  }
8411
- }, i_ = () => window.AudioContext || window.webkitAudioContext, a_ = class n extends _e {
8416
+ }, a_ = () => window.AudioContext || window.webkitAudioContext, o_ = class n extends _e {
8412
8417
  constructor() {
8413
8418
  var r;
8414
- super(), r = this, e(this, "context", new (i_())()), e(this, "timers", j.create()), e(this, "previousCurrentTime", 0), e(this, "_isStuck", !1), e(this, "mediaStreamDestination", void 0), e(this, "unload", () => (this.timers.unload(), this.context.removeEventListener("statechange", this.onStateChange), this.context.state === "closed" ? Promise.resolve() : this.context.close())), e(this, "createGain", () => this.context.createGain()), e(this, "createBuffer", (e, t, n) => this.context.createBuffer(e, t, n)), e(this, "createBufferSource", () => this.context.createBufferSource()), e(this, "getMediaStreamDestination", () => (this.mediaStreamDestination || (this.mediaStreamDestination = this.context.createMediaStreamDestination()), this.mediaStreamDestination)), e(this, "getDefaultDestination", () => this.context.destination), e(this, "createSplitter", () => this.context.createChannelSplitter(2)), e(this, "resume", t(function* () {
8419
+ super(), r = this, e(this, "context", new (a_())()), e(this, "timers", j.create()), e(this, "previousCurrentTime", 0), e(this, "_isStuck", !1), e(this, "mediaStreamDestination", void 0), e(this, "unload", () => (this.timers.unload(), this.context.removeEventListener("statechange", this.onStateChange), this.context.state === "closed" ? Promise.resolve() : this.context.close())), e(this, "createGain", () => this.context.createGain()), e(this, "createBuffer", (e, t, n) => this.context.createBuffer(e, t, n)), e(this, "createBufferSource", () => this.context.createBufferSource()), e(this, "getMediaStreamDestination", () => (this.mediaStreamDestination || (this.mediaStreamDestination = this.context.createMediaStreamDestination()), this.mediaStreamDestination)), e(this, "getDefaultDestination", () => this.context.destination), e(this, "createSplitter", () => this.context.createChannelSplitter(2)), e(this, "resume", t(function* () {
8415
8420
  try {
8416
8421
  return yield Promise.race([r.context.resume(), mn(1e3, p())]);
8417
8422
  } catch (e) {
@@ -8440,10 +8445,10 @@ var t_ = 1e3, n_ = 50, r_ = class t {
8440
8445
  return this.context.state;
8441
8446
  }
8442
8447
  };
8443
- e(a_, "CHECK_INTERVAL", 1e3);
8448
+ e(o_, "CHECK_INTERVAL", 1e3);
8444
8449
  //#endregion
8445
8450
  //#region ../../libs/web-audio-player/src/AudioPlayer.ts
8446
- var o_, s_ = 400, c_ = class extends _e {
8451
+ var s_, c_ = 400, l_ = class extends _e {
8447
8452
  get isContextRunning() {
8448
8453
  var e;
8449
8454
  return ((e = this.audio) == null ? void 0 : e.state) === "running";
@@ -8568,14 +8573,14 @@ var o_, s_ = 400, c_ = class extends _e {
8568
8573
  }
8569
8574
  })), e(this, "getAudioContext", () => this.audio ? this.audio : this.setupContext()), e(this, "setupContext", () => {
8570
8575
  var e, t, n;
8571
- return (e = this.audio) == null || e.unload(), this.audio = new a_(), this.audio.on("state", (e) => {
8576
+ return (e = this.audio) == null || e.unload(), this.audio = new o_(), this.audio.on("state", (e) => {
8572
8577
  this.logger.info("AudioContext state change", { state: e }), e === "running" && (this._muted = this._userProvidedMuted, this.setGain(this._volume)), !this.ignoreSuspendCalls && this.emit("state change", e);
8573
8578
  }), this.audio.on("stuck", () => {
8574
8579
  this.reInitWhenStuck && (this.logger.info("Re-init audio context"), this.setupContext(), this.resume().catch(o), this.emit("stuck"));
8575
8580
  }), (t = this.gainNode) == null || t.disconnect(), this.gainNode = this.audio.createGain(), this.setGain(this._volume), this.startTime = this.audio.currentTime, (n = this.splitter) == null || n.disconnect(), this.splitter = this.audio.createSplitter(), this.audio;
8576
8581
  }), e(this, "setGain", (e) => {
8577
8582
  this.gainNode && (this.gainNode.gain.value = this._muted ? 0 : e);
8578
- }), this._muted = i, this._userProvidedMuted = i, this.logger = n, this.clockSource = r, this.reInitWhenStuck = a, this.audioBufferMultiplier = s !== void 0 && s < s_ ? 2 : 5;
8583
+ }), this._muted = i, this._userProvidedMuted = i, this.logger = n, this.clockSource = r, this.reInitWhenStuck = a, this.audioBufferMultiplier = s !== void 0 && s < c_ ? 2 : 5;
8579
8584
  }
8580
8585
  useMediaStreamDestination() {
8581
8586
  var e;
@@ -8588,10 +8593,10 @@ var o_, s_ = 400, c_ = class extends _e {
8588
8593
  return (e = this.gainNode) == null || e.connect(t), t;
8589
8594
  }
8590
8595
  };
8591
- o_ = c_, e(c_, "create", (e, t, n) => new o_(e, t, n));
8596
+ s_ = l_, e(l_, "create", (e, t, n) => new s_(e, t, n));
8592
8597
  //#endregion
8593
8598
  //#region ../../libs/web-sdk/src/players/VideoPlayer.ts
8594
- var l_, u_ = class {
8599
+ var u_, d_ = class {
8595
8600
  constructor(t, n, r, i, a, o) {
8596
8601
  e(this, "staleFrameThresholdMs", 400), e(this, "pool", void 0), e(this, "logger", void 0), e(this, "videoRenderer", new rr()), e(this, "videoFrameCanvas2DRenderer", null), e(this, "renderQueue", []), e(this, "clockSource", void 0), e(this, "isFirstFrame", !0), e(this, "usingWebCodecs", !1), e(this, "onCanvasChangeCallback", void 0), e(this, "onRendererErrorCallback", void 0), e(this, "animationFrameRequest", void 0), e(this, "firstFrameAnimationFrameRequest", void 0), e(this, "pendingFirstFrameSample", void 0), e(this, "renderedFrameCount", 0), e(this, "rendererDroppedFrameCount", 0), e(this, "renderTargetSize", void 0), e(this, "load", () => {
8597
8602
  this.videoRenderer.load(), this.subscribeToContextLost(this.videoRenderer);
@@ -8681,12 +8686,12 @@ var l_, u_ = class {
8681
8686
  }), this.logger = t, this.clockSource = n, this.pool = r, this.renderTargetSize = i || this.videoRenderer.canvas, this.onCanvasChangeCallback = a, this.onRendererErrorCallback = o;
8682
8687
  }
8683
8688
  };
8684
- l_ = u_, e(u_, "create", (e, t, n, r, i, a) => new l_(e, t, n, r, i, a));
8689
+ u_ = d_, e(d_, "create", (e, t, n, r, i, a) => new u_(e, t, n, r, i, a));
8685
8690
  //#endregion
8686
8691
  //#region ../../libs/web-sdk/src/TextTracks.ts
8687
- var d_ = /* @__PURE__ */ new WeakMap(), f_ = class {
8692
+ var f_ = /* @__PURE__ */ new WeakMap(), p_ = class {
8688
8693
  constructor() {
8689
- v(this, d_, []), x(d_, this, []);
8694
+ v(this, f_, []), x(f_, this, []);
8690
8695
  }
8691
8696
  addTextTrack(e, t, n) {
8692
8697
  let r = [], i = {
@@ -8703,37 +8708,37 @@ var d_ = /* @__PURE__ */ new WeakMap(), f_ = class {
8703
8708
  t !== -1 && r.splice(t, 1);
8704
8709
  }
8705
8710
  };
8706
- return b(d_, this).push(i), i;
8711
+ return b(f_, this).push(i), i;
8707
8712
  }
8708
8713
  set language(e) {
8709
- b(d_, this).forEach((t) => {
8714
+ b(f_, this).forEach((t) => {
8710
8715
  t.language === e ? t.mode = "showing" : t.mode = "hidden";
8711
8716
  });
8712
8717
  }
8713
8718
  get language() {
8714
8719
  var e;
8715
- return (e = b(d_, this).find((e) => e.mode === "showing")) == null ? void 0 : e.language;
8720
+ return (e = b(f_, this).find((e) => e.mode === "showing")) == null ? void 0 : e.language;
8716
8721
  }
8717
8722
  getActiveCues(e) {
8718
- let t = b(d_, this).find((e) => e.mode === "showing");
8723
+ let t = b(f_, this).find((e) => e.mode === "showing");
8719
8724
  return t ? t.cues.filter(({ startTime: t, endTime: n }) => e >= t && e <= n) : [];
8720
8725
  }
8721
- }, p_ = (e, t) => {
8726
+ }, m_ = (e, t) => {
8722
8727
  let n;
8723
8728
  for (n = t; e > 1; e--) n += t;
8724
8729
  return n;
8725
- }, m_ = class {
8730
+ }, h_ = class {
8726
8731
  constructor() {
8727
8732
  e(this, "audio", void 0), e(this, "unmute", () => this.audio.play().catch(o));
8728
8733
  let t = document.createElement("div");
8729
8734
  t.innerHTML = "<audio x-webkit-airplay='deny'></audio>";
8730
8735
  let n = t.children.item(0);
8731
- if (n instanceof HTMLAudioElement) this.audio = n, this.audio.controls = !1, this.audio.disableRemotePlayback = !0, this.audio.preload = "auto", this.audio.src = "data:audio/mpeg;base64,//uQx" + p_(23, "A") + "WGluZwAAAA8AAAACAAACcQCA" + p_(16, "gICA") + p_(66, "/") + "8AAABhTEFNRTMuMTAwA8MAAAAAAAAAABQgJAUHQQAB9AAAAnGMHkkI" + p_(320, "A") + "//sQxAADgnABGiAAQBCqgCRMAAgEAH" + p_(15, "/") + "7+n/9FTuQsQH//////2NG0jWUGlio5gLQTOtIoeR2WX////X4s9Atb/JRVCbBUpeRUq" + p_(18, "/") + "9RUi0f2jn/+xDECgPCjAEQAABN4AAANIAAAAQVTEFNRTMuMTAw" + p_(97, "V") + "Q==", this.audio.loop = !1, this.audio.load();
8736
+ if (n instanceof HTMLAudioElement) this.audio = n, this.audio.controls = !1, this.audio.disableRemotePlayback = !0, this.audio.preload = "auto", this.audio.src = "data:audio/mpeg;base64,//uQx" + m_(23, "A") + "WGluZwAAAA8AAAACAAACcQCA" + m_(16, "gICA") + m_(66, "/") + "8AAABhTEFNRTMuMTAwA8MAAAAAAAAAABQgJAUHQQAB9AAAAnGMHkkI" + m_(320, "A") + "//sQxAADgnABGiAAQBCqgCRMAAgEAH" + m_(15, "/") + "7+n/9FTuQsQH//////2NG0jWUGlio5gLQTOtIoeR2WX////X4s9Atb/JRVCbBUpeRUq" + m_(18, "/") + "9RUi0f2jn/+xDECgPCjAEQAABN4AAANIAAAAQVTEFNRTMuMTAw" + m_(97, "V") + "Q==", this.audio.loop = !1, this.audio.load();
8732
8737
  else throw Error("Failed to create audio tag");
8733
8738
  }
8734
- }, h_, g_ = class {
8739
+ }, g_, __ = class {
8735
8740
  constructor(t, n, r, i, a, o, s, c) {
8736
- e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "audioPlayer", void 0), e(this, "videoPlayer", void 0), e(this, "pool", void 0), e(this, "unmuter", new m_()), e(this, "_isPaused", !1), e(this, "isDisconnected", !1), e(this, "timers", new j()), e(this, "isVideoRenderingEnabled", !0), e(this, "isLoaded", !1), e(this, "isSuspended", !0), e(this, "isVideoPlayerLoaded", !1), e(this, "textTracks", new f_()), e(this, "playbackRate", void 0), e(this, "reset", () => {}), e(this, "load", () => {
8741
+ e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "audioPlayer", void 0), e(this, "videoPlayer", void 0), e(this, "pool", void 0), e(this, "unmuter", new h_()), e(this, "_isPaused", !1), e(this, "isDisconnected", !1), e(this, "timers", new j()), e(this, "isVideoRenderingEnabled", !0), e(this, "isLoaded", !1), e(this, "isSuspended", !0), e(this, "isVideoPlayerLoaded", !1), e(this, "textTracks", new p_()), e(this, "playbackRate", void 0), e(this, "reset", () => {}), e(this, "load", () => {
8737
8742
  this.audioPlayer.useDefaultDestination(), this.emitter.on("decoded frame", this.onDecodedFrame), this.emitter.on("flush buffers", this.flushBuffers), this.isLoaded = !0, this.isVideoRenderingEnabled && (this.videoPlayer.load(), this.isVideoPlayerLoaded = !0, this.startTextTrackInterval());
8738
8743
  }), e(this, "unload", () => {
8739
8744
  this.emitter.off("decoded frame", this.onDecodedFrame), this.emitter.off("flush buffers", this.flushBuffers), this.audioPlayer.unload(), this.isVideoPlayerLoaded && (this.videoPlayer.unload(), this.isVideoPlayerLoaded = !1), this.timers.unload(), this.isLoaded = !1;
@@ -8767,7 +8772,7 @@ var d_ = /* @__PURE__ */ new WeakMap(), f_ = class {
8767
8772
  e instanceof Error && this.emitter.emit("error", re(!1, e));
8768
8773
  }
8769
8774
  this.isVideoRenderingEnabled && this.videoPlayer.onDecodedFrame(e);
8770
- }), this.logger = n, this.emitter = t, this.pool = r, this.audioPlayer = c_.create(this.logger.createContext("AudioPlayerModule"), i, {
8775
+ }), this.logger = n, this.emitter = t, this.pool = r, this.audioPlayer = l_.create(this.logger.createContext("AudioPlayerModule"), i, {
8771
8776
  muted: a,
8772
8777
  reInitWhenStuck: !0,
8773
8778
  bufferTime: c
@@ -8778,7 +8783,7 @@ var d_ = /* @__PURE__ */ new WeakMap(), f_ = class {
8778
8783
  volume: this.volume,
8779
8784
  isMuted: this.muted
8780
8785
  });
8781
- }), this.videoPlayer = u_.create(this.logger.createContext("VideoPlayerModule"), this.audioPlayer, this.pool, void 0, s);
8786
+ }), this.videoPlayer = d_.create(this.logger.createContext("VideoPlayerModule"), this.audioPlayer, this.pool, void 0, s);
8782
8787
  }
8783
8788
  get volume() {
8784
8789
  return this.audioPlayer.volume;
@@ -8834,12 +8839,12 @@ var d_ = /* @__PURE__ */ new WeakMap(), f_ = class {
8834
8839
  this._isPaused = !0, this.audioPlayer.pause(), this.emitter.emit("media element state", "paused");
8835
8840
  }
8836
8841
  };
8837
- h_ = g_, e(g_, "create", (e, t, n, r, i, a, o, s) => new h_(e, t, n, r, i, a, o, s));
8842
+ g_ = __, e(__, "create", (e, t, n, r, i, a, o, s) => new g_(e, t, n, r, i, a, o, s));
8838
8843
  //#endregion
8839
8844
  //#region ../../libs/web-sdk/src/modules/ModernCanvasModule.ts
8840
- var __, v_ = class {
8845
+ var v_, y_ = class {
8841
8846
  constructor(t, n, r, i, { muted: a, volume: s, type: c, poster: l, offscreenCanvas: u, bufferTime: d }) {
8842
- e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "mediaElement", void 0), e(this, "audioPlayer", void 0), e(this, "videoPlayer", void 0), e(this, "pool", void 0), e(this, "isDisconnected", !0), e(this, "_userProvidedMuted", !1), e(this, "timers", new j()), e(this, "offscreenCanvas", void 0), e(this, "nativeTextTrack", void 0), e(this, "nativeTrackCues", []), e(this, "volumeState", void 0), e(this, "textTracks", new f_()), e(this, "reset", () => {}), e(this, "load", () => {
8847
+ e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "mediaElement", void 0), e(this, "audioPlayer", void 0), e(this, "videoPlayer", void 0), e(this, "pool", void 0), e(this, "isDisconnected", !0), e(this, "_userProvidedMuted", !1), e(this, "timers", new j()), e(this, "offscreenCanvas", void 0), e(this, "nativeTextTrack", void 0), e(this, "nativeTrackCues", []), e(this, "volumeState", void 0), e(this, "textTracks", new p_()), e(this, "reset", () => {}), e(this, "load", () => {
8843
8848
  this.mediaElement.load(), this.emitter.on("decoded frame", this.onDecodedFrame), this.emitter.on("flush buffers", this.flushBuffers), this.emitter.on("ios-hack: reset size", this.resetCanvasSize), this.emitter.on("enter picture in picture", this.onEnterIOSHack), this.emitter.on("exit picture in picture", this.onExitIOSHack), this.element().element.addEventListener("webkitendfullscreen", this.onExitIOSHack), this.element().element.addEventListener("webkitbeginfullscreen", this.onEnterIOSHack), this.videoPlayer.load(), this.nativeTextTrack = this.mediaElement.element.addTextTrack("subtitles", "", ""), this.nativeTextTrack.mode = "showing", this.timers.setInterval(() => {
8844
8849
  if (!this.textTracks.language) {
8845
8850
  this.clearNativeTrackCues();
@@ -8924,7 +8929,7 @@ var __, v_ = class {
8924
8929
  this.updateVolumeState(), !e.isMuted && !this.audioPlayer.isContextRunning && this.activateAudioPlayer().catch(o), e.isMuted || (this._userProvidedMuted = !1);
8925
8930
  }), this.mediaElement.on("media element state", (e) => {
8926
8931
  e === "paused" && this.audioPlayer.flushBuffer(), this.emitter.emit("media element state", e);
8927
- }), this.audioPlayer = c_.create(this.logger.createContext("AudioPlayerModule"), i, {
8932
+ }), this.audioPlayer = l_.create(this.logger.createContext("AudioPlayerModule"), i, {
8928
8933
  muted: !1,
8929
8934
  reInitWhenStuck: !1,
8930
8935
  bufferTime: d
@@ -8932,7 +8937,7 @@ var __, v_ = class {
8932
8937
  this.isDisconnected = !0;
8933
8938
  }), this.audioPlayer.on("state change", (e) => {
8934
8939
  e === "suspended" || e === "interrupted" ? this.mediaElement.muted = !0 : e === "running" && (this.mediaElement.muted = this._userProvidedMuted || document.visibilityState === "hidden"), this.updateVolumeState();
8935
- }), this.videoPlayer = u_.create(this.logger.createContext("VideoPlayerModule"), this.audioPlayer, this.pool, this.mediaElement.element, () => this.reconnectCanvasStream(), this.onVideoPlayerError), this.volumeState = {
8940
+ }), this.videoPlayer = d_.create(this.logger.createContext("VideoPlayerModule"), this.audioPlayer, this.pool, this.mediaElement.element, () => this.reconnectCanvasStream(), this.onVideoPlayerError), this.volumeState = {
8936
8941
  volume: this.volume,
8937
8942
  isMuted: this.muted
8938
8943
  };
@@ -8990,10 +8995,10 @@ var __, v_ = class {
8990
8995
  this.mediaElement.pause();
8991
8996
  }
8992
8997
  };
8993
- __ = v_, e(v_, "create", (e, t, n, r, i) => new __(e, t, n, r, i));
8998
+ v_ = y_, e(y_, "create", (e, t, n, r, i) => new v_(e, t, n, r, i));
8994
8999
  //#endregion
8995
9000
  //#region ../../libs/mse/src/AsyncSourceBuffer.ts
8996
- var y_ = () => (e) => b_(e.buffered.start(0), e.buffered.end(e.buffered.length - 1)), b_ = (e, t) => (n) => n.remove(Math.max(0, e), Math.min(Infinity, t)), x_ = (e) => (t) => t.appendBuffer(e), S_ = (e) => (t) => t.changeType(e), C_ = (e) => (t) => e(t), w_ = class {
9001
+ var b_ = () => (e) => x_(e.buffered.start(0), e.buffered.end(e.buffered.length - 1)), x_ = (e, t) => (n) => n.remove(Math.max(0, e), Math.min(Infinity, t)), S_ = (e) => (t) => t.appendBuffer(e), C_ = (e) => (t) => t.changeType(e), w_ = (e) => (t) => e(t), T_ = class {
8997
9002
  constructor(t) {
8998
9003
  e(this, "commandQueue", []), e(this, "sourceBuffer", void 0), e(this, "currentInit", void 0), e(this, "handleQueue", () => {
8999
9004
  if (!this.sourceBuffer.updating) {
@@ -9002,28 +9007,28 @@ var y_ = () => (e) => b_(e.buffered.start(0), e.buffered.end(e.buffered.length -
9002
9007
  }
9003
9008
  }), e(this, "appendBuffer", (e, t) => new Promise((n, r) => {
9004
9009
  if (t && this.currentInit !== t) {
9005
- let e = new Dt(x_(t), n, r);
9010
+ let e = new Dt(S_(t), n, r);
9006
9011
  this.commandQueue.push(e), this.currentInit = t;
9007
9012
  }
9008
- let i = new Dt(x_(e), n, r);
9013
+ let i = new Dt(S_(e), n, r);
9009
9014
  this.commandQueue.push(i), this.handleQueue();
9010
9015
  })), e(this, "execute", (e) => new Promise((t, n) => {
9011
- let r = new Dt(C_(e), t, n);
9016
+ let r = new Dt(w_(e), t, n);
9012
9017
  this.commandQueue.push(r), this.handleQueue();
9013
9018
  })), e(this, "buffered", () => this.sourceBuffer.buffered), e(this, "removeFromMediaSource", (e) => {
9014
9019
  e.removeSourceBuffer(this.sourceBuffer);
9015
9020
  }), e(this, "changeType", (e) => new Promise((t, n) => {
9016
- let r = new Dt(S_(e), t, n);
9021
+ let r = new Dt(C_(e), t, n);
9017
9022
  this.commandQueue.push(r), this.handleQueue();
9018
9023
  })), e(this, "removeBuffer", (e, t) => new Promise((n, r) => {
9019
- let i = new Dt(b_(e, t), n, r);
9024
+ let i = new Dt(x_(e, t), n, r);
9020
9025
  this.commandQueue.push(i), this.handleQueue();
9021
9026
  })), e(this, "flush", () => new Promise((e, t) => {
9022
- let n = new Dt(y_, e, t);
9027
+ let n = new Dt(b_, e, t);
9023
9028
  this.commandQueue.push(n), this.handleQueue();
9024
9029
  })), this.sourceBuffer = t, this.sourceBuffer.addEventListener("updateend", this.handleQueue);
9025
9030
  }
9026
- }, T_ = class extends _e {
9031
+ }, E_ = class extends _e {
9027
9032
  constructor() {
9028
9033
  super(), e(this, "MediaSource", Ve()), e(this, "mediaSource", new this.MediaSource()), e(this, "isOpen", () => this.mediaSource.readyState === "open"), e(this, "isClosed", () => this.mediaSource.readyState === "closed"), e(this, "isEnded", () => this.mediaSource.readyState === "ended"), e(this, "createObjectURL", () => URL.createObjectURL(this.mediaSource)), e(this, "attach", (e) => {
9029
9034
  let t = e;
@@ -9039,7 +9044,7 @@ var y_ = () => (e) => b_(e.buffered.start(0), e.buffered.end(e.buffered.length -
9039
9044
  this.mediaSource.endOfStream();
9040
9045
  } catch (e) {}
9041
9046
  e.srcObject && (e.srcObject = null), e.src !== "" && (URL.revokeObjectURL(e.src), e.removeAttribute("src")), e.load();
9042
- }), e(this, "addSourceBuffer", (e) => new w_(this.mediaSource.addSourceBuffer(e))), e(this, "removeSourceBuffer", (e) => {
9047
+ }), e(this, "addSourceBuffer", (e) => new T_(this.mediaSource.addSourceBuffer(e))), e(this, "removeSourceBuffer", (e) => {
9043
9048
  e.removeFromMediaSource(this.mediaSource);
9044
9049
  }), e(this, "endOfStream", (e) => {
9045
9050
  this.mediaSource.endOfStream(e);
@@ -9056,13 +9061,13 @@ var y_ = () => (e) => b_(e.buffered.start(0), e.buffered.end(e.buffered.length -
9056
9061
  }), this.mediaSource.addEventListener("sourceopen", this.onSourceOpen), this.mediaSource.addEventListener("sourceclose", this.onSourceClosed), this.mediaSource.addEventListener("sourceended", this.onSourceEnded);
9057
9062
  }
9058
9063
  };
9059
- e(T_, "isTypeSupported", (e) => {
9064
+ e(E_, "isTypeSupported", (e) => {
9060
9065
  var t, n;
9061
9066
  return (t = (n = Ve()) == null ? void 0 : n.isTypeSupported(e)) == null ? !1 : t;
9062
9067
  });
9063
9068
  //#endregion
9064
9069
  //#region ../../libs/web-sdk/src/modules/MseModule.ts
9065
- var E_, D_ = class {
9070
+ var D_, O_ = class {
9066
9071
  constructor() {
9067
9072
  e(this, "initSegments", /* @__PURE__ */ new Map()), e(this, "set", (e, t, n) => {
9068
9073
  var r;
@@ -9074,7 +9079,7 @@ var E_, D_ = class {
9074
9079
  });
9075
9080
  }
9076
9081
  };
9077
- function O_(e, { mediaSource: t, mimeType: n, codec: r }) {
9082
+ function k_(e, { mediaSource: t, mimeType: n, codec: r }) {
9078
9083
  return C(C({}, e), {}, {
9079
9084
  state: "initialized",
9080
9085
  mimeType: n,
@@ -9086,10 +9091,10 @@ function O_(e, { mediaSource: t, mimeType: n, codec: r }) {
9086
9091
  lastBufferCleanupTime: Date.now()
9087
9092
  });
9088
9093
  }
9089
- function k_({ initSegments: e, pendingSamples: t }) {
9094
+ function A_({ initSegments: e, pendingSamples: t }) {
9090
9095
  return {
9091
9096
  state: "uninitialized",
9092
- initSegments: e == null ? new D_() : e,
9097
+ initSegments: e == null ? new O_() : e,
9093
9098
  sequenceNumber: 0,
9094
9099
  isWorkingOnPendingSamples: !1,
9095
9100
  hasFirstSync: !!t,
@@ -9099,10 +9104,10 @@ function k_({ initSegments: e, pendingSamples: t }) {
9099
9104
  successfulAppendCalls: 0
9100
9105
  };
9101
9106
  }
9102
- var A_ = class {
9107
+ var j_ = class {
9103
9108
  constructor(n, a, s) {
9104
9109
  var u = this;
9105
- e(this, "maxChunkSize", 20), e(this, "minConsecutiveErrorsBeforeEmit", 5), e(this, "maxSecondsInBuffer", 60), e(this, "logger", void 0), e(this, "timers", j.create()), e(this, "emitter", void 0), e(this, "mediaElement", void 0), e(this, "mediaSource", new T_()), e(this, "trackContexts", /* @__PURE__ */ new Map()), e(this, "autoRecoverFromMediaErrors", !0), e(this, "quotaErrorCount", 0), e(this, "recoveredFromErrorCount", 0), e(this, "sourceOpenStartTime", Date.now()), e(this, "sourceOpenEndTime", Date.now()), e(this, "pendingTracksToAddSourceBuffers", void 0), e(this, "hasAddedInitialPosterFrame", !0), e(this, "videoKeyframeTimestamps", []), e(this, "isReopening", !1), e(this, "load", () => {
9110
+ e(this, "maxChunkSize", 20), e(this, "minConsecutiveErrorsBeforeEmit", 5), e(this, "maxSecondsInBuffer", 60), e(this, "logger", void 0), e(this, "timers", j.create()), e(this, "emitter", void 0), e(this, "mediaElement", void 0), e(this, "mediaSource", new E_()), e(this, "trackContexts", /* @__PURE__ */ new Map()), e(this, "autoRecoverFromMediaErrors", !0), e(this, "quotaErrorCount", 0), e(this, "recoveredFromErrorCount", 0), e(this, "sourceOpenStartTime", Date.now()), e(this, "sourceOpenEndTime", Date.now()), e(this, "pendingTracksToAddSourceBuffers", void 0), e(this, "hasAddedInitialPosterFrame", !0), e(this, "videoKeyframeTimestamps", []), e(this, "isReopening", !1), e(this, "load", () => {
9106
9111
  this.emitter.on("init segment", this.init), this.emitter.on("coded sample", this.onCodedSample), this.emitter.on("flush buffers", this.flushBuffers), this.emitter.on("fragment", this.onFragment);
9107
9112
  }), e(this, "unload", () => {
9108
9113
  this.logger.debug("Unloading module..."), this.emitter.off("init segment", this.init), this.emitter.off("coded sample", this.onCodedSample), this.emitter.off("flush buffers", this.flushBuffers), this.emitter.off("fragment", this.onFragment), this.mediaSource.off("source ended", this.onSourceEnded), this.mediaSource.off("source open", this.onSourceOpen), this.mediaElement.removeEventListener("error", this.onMediaElementError), this.mediaSource.detach(this.mediaElement), this.trackContexts.forEach((e) => {
@@ -9138,7 +9143,7 @@ var A_ = class {
9138
9143
  var n, r, i;
9139
9144
  let a = e.get(t), o = (n = a == null ? void 0 : a.pendingSamples) == null ? [] : n, s = a == null ? void 0 : a.initSegments, c = (r = a == null ? void 0 : a.pendingSamplesOffset) == null ? 0 : r;
9140
9145
  for (; c < o.length && !((i = o[c]) != null && i.isSync);) c++;
9141
- let l = k_({
9146
+ let l = A_({
9142
9147
  pendingSamples: o,
9143
9148
  initSegments: s
9144
9149
  });
@@ -9164,10 +9169,10 @@ var A_ = class {
9164
9169
  }
9165
9170
  for (let t of e) {
9166
9171
  let e = u.trackContexts.get(t.type);
9167
- e || (e = k_({
9172
+ e || (e = A_({
9168
9173
  pendingSamples: [],
9169
- initSegments: new D_()
9170
- }), u.trackContexts.set(t.type, e)), e.state === "initialized" ? t.mimeType !== e.sourceBufferMimeType && (yield e.sourceBuffer.changeType(t.mimeType), e.sourceBufferMimeType = t.mimeType) : u.trackContexts.set(t.type, O_(e, {
9174
+ initSegments: new O_()
9175
+ }), u.trackContexts.set(t.type, e)), e.state === "initialized" ? t.mimeType !== e.sourceBufferMimeType && (yield e.sourceBuffer.changeType(t.mimeType), e.sourceBufferMimeType = t.mimeType) : u.trackContexts.set(t.type, k_(e, {
9171
9176
  mimeType: t.mimeType,
9172
9177
  mediaSource: u.mediaSource,
9173
9178
  codec: t.codec
@@ -9291,7 +9296,7 @@ var A_ = class {
9291
9296
  let t = (e.timestamp + ((n = e.compositionTimeOffset) == null ? 0 : n)) / e.timescale * 1e3, r = this.videoKeyframeTimestamps[this.videoKeyframeTimestamps.length - 1];
9292
9297
  r !== void 0 && t < r && (this.videoKeyframeTimestamps = []), this.videoKeyframeTimestamps.push(t), this.videoKeyframeTimestamps.length > 20 && (this.videoKeyframeTimestamps = this.videoKeyframeTimestamps.slice(-20));
9293
9298
  }
9294
- t.state !== "uninitialized" && (t.isWorkingOnPendingSamples || P_(t, this.append, this.maxChunkSize).catch((n) => {
9299
+ t.state !== "uninitialized" && (t.isWorkingOnPendingSamples || F_(t, this.append, this.maxChunkSize).catch((n) => {
9295
9300
  if (t.isWorkingOnPendingSamples = !1, !this.isReopening && n instanceof Error) {
9296
9301
  if (this.logger.error("append failed", {
9297
9302
  message: n.message,
@@ -9334,24 +9339,24 @@ var A_ = class {
9334
9339
  }), this.logger = n, this.mediaElement = s, this.emitter = a;
9335
9340
  }
9336
9341
  };
9337
- E_ = A_, e(A_, "create", (e, t, n) => {
9338
- let r = new E_(e, t, n);
9342
+ D_ = j_, e(j_, "create", (e, t, n) => {
9343
+ let r = new D_(e, t, n);
9339
9344
  return r.setTrackContexts(), r.mediaSource.on("source ended", r.onSourceEnded), r.mediaSource.on("source open", r.onSourceOpen), n.addEventListener("error", r.onMediaElementError), r.mediaSource.attach(n), r;
9340
9345
  });
9341
- var j_ = (e, t) => {
9346
+ var M_ = (e, t) => {
9342
9347
  var n;
9343
9348
  let r = e.renditionId !== t.renditionId, i = e.channelId !== t.channelId, a = ((n = e.timestamp) == null ? 0 : n) > t.timestamp, o = e.type === "video" && t.type === "video" && "levelIdc" in e && "levelIdc" in t && e.levelIdc !== t.levelIdc, s = !1;
9344
9349
  return e.type === "video" && t.type === "video" && "width" in e && "width" in t && (s = t.width !== e.width || t.height !== e.height), i || r || a || s || o;
9345
- }, M_ = 32, N_ = (e) => {
9350
+ }, N_ = 32, P_ = (e) => {
9346
9351
  let t = e.pendingSamplesOffset;
9347
9352
  if (t !== 0) {
9348
9353
  if (t >= e.pendingSamples.length) {
9349
9354
  e.pendingSamples = [], e.pendingSamplesOffset = 0;
9350
9355
  return;
9351
9356
  }
9352
- t < M_ || t * 2 < e.pendingSamples.length || (e.pendingSamples = e.pendingSamples.slice(t), e.pendingSamplesOffset = 0);
9357
+ t < N_ || t * 2 < e.pendingSamples.length || (e.pendingSamples = e.pendingSamples.slice(t), e.pendingSamplesOffset = 0);
9353
9358
  }
9354
- }, P_ = function() {
9359
+ }, F_ = function() {
9355
9360
  var e = t(function* (e, t, n) {
9356
9361
  for (e.isWorkingOnPendingSamples = !0; e.pendingSamplesOffset < e.pendingSamples.length;) {
9357
9362
  let r = [], i = e.pendingSamplesOffset;
@@ -9359,7 +9364,7 @@ var j_ = (e, t) => {
9359
9364
  i = t;
9360
9365
  let a = e.pendingSamples[t], o = e.pendingSamples[t + 1];
9361
9366
  if (a && (r.push(a), o)) {
9362
- if (j_(a, o)) break;
9367
+ if (M_(a, o)) break;
9363
9368
  let e = (a.timestamp + a.duration) / a.timescale;
9364
9369
  if (o.timestamp / o.timescale - e > .1) break;
9365
9370
  }
@@ -9367,14 +9372,14 @@ var j_ = (e, t) => {
9367
9372
  }
9368
9373
  let a = r[0];
9369
9374
  if (!a) break;
9370
- yield t(r, e.previousSample ? j_(e.previousSample, a) : !0), e.pendingSamplesOffset = i + 1, e.previousSample = r[r.length - 1], N_(e);
9375
+ yield t(r, e.previousSample ? M_(e.previousSample, a) : !0), e.pendingSamplesOffset = i + 1, e.previousSample = r[r.length - 1], P_(e);
9371
9376
  }
9372
9377
  e.isWorkingOnPendingSamples = !1;
9373
9378
  });
9374
9379
  return function(t, n, r) {
9375
9380
  return e.apply(this, arguments);
9376
9381
  };
9377
- }(), F_, I_ = class {
9382
+ }(), I_, L_ = class {
9378
9383
  constructor(n, r) {
9379
9384
  var i = this;
9380
9385
  e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "element", void 0), e(this, "pictureInPictureWindow", void 0), e(this, "unload", () => {
@@ -9406,10 +9411,10 @@ var j_ = (e, t) => {
9406
9411
  }()), e(this, "isWebkitPresentationModeSupported", () => !!this.element && xt(this.element)), this.emitter = n, this.logger = r, this.emitter.on("add picture in picture listener", this.onEnablePictureInPicture);
9407
9412
  }
9408
9413
  };
9409
- F_ = I_, e(I_, "create", (e, t) => new F_(e, t));
9414
+ I_ = L_, e(L_, "create", (e, t) => new I_(e, t));
9410
9415
  //#endregion
9411
9416
  //#region ../../libs/web-sdk/src/modules/PlaybackModule.ts
9412
- var L_, R_ = class {
9417
+ var R_, z_ = class {
9413
9418
  constructor(t, n, r, i) {
9414
9419
  e(this, "emitter", void 0), e(this, "logger", void 0), e(this, "clockSource", void 0), e(this, "state", "buffering"), e(this, "bufferFullness", 0), e(this, "targetBufferTime", void 0), e(this, "lastBufferStateEvent", "drained"), e(this, "firstFrameTime", void 0), e(this, "currentTimeIsInRange", !1), e(this, "needsInputForAudioCount", 0), e(this, "needsInputForVideoCount", 0), e(this, "unload", () => {
9415
9420
  this.emitter.off("buffer state", this.onBufferedStateChanged), this.emitter.off("needs user input", this.onNeedsUserInput);
@@ -9427,24 +9432,24 @@ var L_, R_ = class {
9427
9432
  }), this.emitter = t, this.logger = n, this.clockSource = r, this.targetBufferTime = i, this.emitter.on("buffer state", this.onBufferedStateChanged), this.emitter.on("needs user input", this.onNeedsUserInput), this.emitter.emit("target buffer time", i);
9428
9433
  }
9429
9434
  };
9430
- L_ = R_, e(R_, "create", (e, t, n, r) => new L_(e, t, n, r));
9435
+ R_ = z_, e(z_, "create", (e, t, n, r) => new R_(e, t, n, r));
9431
9436
  //#endregion
9432
9437
  //#region ../../libs/web-sdk/src/modules/QualityOfServiceModule.ts
9433
- var z_, B_ = () => ({
9438
+ var B_, V_ = () => ({
9434
9439
  upgradesFromLevel: [],
9435
9440
  downgradesFromLevel: [],
9436
9441
  bufferingRanges: [],
9437
9442
  activeRanges: [],
9438
9443
  decodeRate: 2 ** 53 - 1
9439
- }), V_ = () => ({
9444
+ }), H_ = () => ({
9440
9445
  levels: {},
9441
9446
  levelDowngrades: [],
9442
9447
  levelUpgrades: [],
9443
9448
  bufferFullness: 0,
9444
- general: B_()
9445
- }), H_ = class {
9449
+ general: V_()
9450
+ }), U_ = class {
9446
9451
  constructor(t, n, r) {
9447
- e(this, "minBufferFullnessLengthForRegression", 6), e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "timers", j.create()), e(this, "metrics", V_()), e(this, "bufferFullness", new _(30)), e(this, "bufferFullnessRegression", void 0), e(this, "currentLevel", void 0), e(this, "isSuspended", !1), e(this, "_fatalQosCount", 0), e(this, "targetBufferTime", 0), e(this, "renditionLevelSource", void 0), e(this, "qualityIndexOrder", []), e(this, "hasAsserted", !1), e(this, "load", () => {
9452
+ e(this, "minBufferFullnessLengthForRegression", 6), e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "timers", j.create()), e(this, "metrics", H_()), e(this, "bufferFullness", new _(30)), e(this, "bufferFullnessRegression", void 0), e(this, "currentLevel", void 0), e(this, "isSuspended", !1), e(this, "_fatalQosCount", 0), e(this, "targetBufferTime", 0), e(this, "renditionLevelSource", void 0), e(this, "qualityIndexOrder", []), e(this, "hasAsserted", !1), e(this, "load", () => {
9448
9453
  this.emitter.on("playback state", this.onPlaybackState), this.emitter.on("buffer fullness", this.onBufferFullness), this.emitter.on("rendition level changed", this.onRenditionLevelChanged), this.emitter.on("video decode rate", this.onVideoDecodeRate), this.emitter.on("target buffer time", this.onTargetBufferTime);
9449
9454
  }), e(this, "unload", () => {
9450
9455
  this.emitter.off("playback state", this.onPlaybackState), this.emitter.off("buffer fullness", this.onBufferFullness), this.emitter.off("rendition level changed", this.onRenditionLevelChanged), this.emitter.off("video decode rate", this.onVideoDecodeRate), this.emitter.off("target buffer time", this.onTargetBufferTime), this.suspend();
@@ -9512,14 +9517,14 @@ var z_, B_ = () => ({
9512
9517
  let d = !1;
9513
9518
  if (e.from) {
9514
9519
  var f;
9515
- let e = (f = this.metrics.levels[l]) == null ? B_() : f;
9520
+ let e = (f = this.metrics.levels[l]) == null ? V_() : f;
9516
9521
  l < u ? e.upgradesFromLevel.push(Date.now()) : e.downgradesFromLevel.push(Date.now()), on(e.activeRanges);
9517
9522
  let t = e.bufferingRanges[e.bufferingRanges.length - 1];
9518
9523
  d = !!t && !t.end, on(e.bufferingRanges), this.metrics.levels[l] = e;
9519
9524
  }
9520
9525
  if (e.to) {
9521
9526
  var p;
9522
- let e = (p = this.metrics.levels[u]) == null ? B_() : p;
9527
+ let e = (p = this.metrics.levels[u]) == null ? V_() : p;
9523
9528
  sn(e.activeRanges), d && sn(e.bufferingRanges), this.metrics.levels[u] = e, this.currentLevel = u;
9524
9529
  }
9525
9530
  }), e(this, "onBufferFullness", (e) => {
@@ -9588,10 +9593,10 @@ var z_, B_ = () => ({
9588
9593
  sn(this.metrics.general.activeRanges);
9589
9594
  }
9590
9595
  };
9591
- z_ = H_, e(H_, "create", (e, t, n) => new z_(e, t, n));
9596
+ B_ = U_, e(U_, "create", (e, t, n) => new B_(e, t, n));
9592
9597
  //#endregion
9593
9598
  //#region ../../libs/web-sdk/src/modules/RenditionsModule.ts
9594
- var U_, W_ = class {
9599
+ var W_, G_ = class {
9595
9600
  constructor(t, n) {
9596
9601
  e(this, "renditions", /* @__PURE__ */ new Map()), e(this, "renditionLevels", []), e(this, "languages", []), e(this, "emitter", void 0), e(this, "subscriptionSource", void 0), e(this, "renditionLevelChangeCount", 0), e(this, "unload", () => {
9597
9602
  this.emitter.off("renditions", this.onRenditions), this.emitter.off("subscription changed", this.onSubscriptionChanged);
@@ -9666,10 +9671,10 @@ var U_, W_ = class {
9666
9671
  }), e(this, "getCurrentSubscription", () => this.subscriptionSource.getCurrentSubscription()), this.subscriptionSource = n, this.emitter = t, this.emitter.on("renditions", this.onRenditions), this.emitter.on("subscription changed", this.onSubscriptionChanged);
9667
9672
  }
9668
9673
  };
9669
- U_ = W_, e(W_, "create", (e, t) => new U_(e, t));
9674
+ W_ = G_, e(G_, "create", (e, t) => new W_(e, t));
9670
9675
  //#endregion
9671
9676
  //#region ../../libs/web-sdk/src/modules/SubscriptionModule.ts
9672
- var G_, K_ = (e) => JSON.parse(JSON.stringify(e)), q_ = 1e4, J_ = class {
9677
+ var K_, q_ = (e) => JSON.parse(JSON.stringify(e)), J_ = 1e4, Y_ = class {
9673
9678
  constructor(t, n, r) {
9674
9679
  e(this, "logger", void 0), e(this, "timers", new j()), e(this, "emitter", void 0), e(this, "targetSubscription", void 0), e(this, "currentSubscription", void 0), e(this, "_isSwitchingSubscription", !1), e(this, "pendingSubscriptionTimeoutId", void 0), e(this, "burstMs", 0), e(this, "unload", () => {
9675
9680
  this.logger.debug("Unloading module..."), this.timers.unload(), this.emitter.off("subscription changed", this.onSubscriptionChanged), this.logger.debug("Unloaded module");
@@ -9707,23 +9712,23 @@ var G_, K_ = (e) => JSON.parse(JSON.stringify(e)), q_ = 1e4, J_ = class {
9707
9712
  this.logger.debug("onSubscriptionChanged", {
9708
9713
  to: e,
9709
9714
  reset: t
9710
- }), t ? this.targetSubscription = K_(this.currentSubscription) : this.currentSubscription = K_(e), this._isSwitchingSubscription = this.isNewSubscription();
9715
+ }), t ? this.targetSubscription = q_(this.currentSubscription) : this.currentSubscription = q_(e), this._isSwitchingSubscription = this.isNewSubscription();
9711
9716
  }), e(this, "scheduleSubscriptionChange", () => {
9712
- this.targetSubscription = K_(this.targetSubscription), this._isSwitchingSubscription = this.isNewSubscription();
9717
+ this.targetSubscription = q_(this.targetSubscription), this._isSwitchingSubscription = this.isNewSubscription();
9713
9718
  let e = this.currentSubscription.channelId, t = this.targetSubscription.channelId, n = e !== t;
9714
9719
  this._isSwitchingSubscription && (n && this.burstMs ? this.setBurst(this.burstMs) : this.setBurst(0), this.pendingSubscriptionTimeoutId && (this.timers.clearTimeout(this.pendingSubscriptionTimeoutId), this.pendingSubscriptionTimeoutId = void 0), n && this.timers.setTimeout(() => {
9715
- this.currentSubscription.channelId === e && this.targetSubscription.channelId === t && (this.logger.warn("Channel switch timeout", t), this.targetSubscription = K_(this.currentSubscription), this.emitter.emit("channel switch timeout", t));
9716
- }, q_), this.pendingSubscriptionTimeoutId = this.timers.setTimeout(() => this.emitter.emit("send signal", {
9720
+ this.currentSubscription.channelId === e && this.targetSubscription.channelId === t && (this.logger.warn("Channel switch timeout", t), this.targetSubscription = q_(this.currentSubscription), this.emitter.emit("channel switch timeout", t));
9721
+ }, J_), this.pendingSubscriptionTimeoutId = this.timers.setTimeout(() => this.emitter.emit("send signal", {
9717
9722
  type: "subscribe",
9718
9723
  subscription: this.getTargetSubscription()
9719
9724
  }), 0));
9720
- }), this.logger = t, this.targetSubscription = n, this.currentSubscription = K_(n), this.emitter = r, this.emitter.on("subscription changed", this.onSubscriptionChanged);
9725
+ }), this.logger = t, this.targetSubscription = n, this.currentSubscription = q_(n), this.emitter = r, this.emitter.on("subscription changed", this.onSubscriptionChanged);
9721
9726
  }
9722
9727
  };
9723
- G_ = J_, e(J_, "create", (e, t, n) => new G_(e, n, t));
9728
+ K_ = Y_, e(Y_, "create", (e, t, n) => new K_(e, n, t));
9724
9729
  //#endregion
9725
9730
  //#region ../../libs/web-sdk/src/modules/SyncModule.ts
9726
- var Y_, X_ = 5e3, Z_ = () => Ye() || Ke(), Q_ = () => Z_() ? 100 : 0, $_ = (e) => (t) => t > e, ev = {
9731
+ var X_, Z_ = 5e3, Q_ = () => Ye() || Ke(), $_ = () => Q_() ? 100 : 0, ev = (e) => (t) => t > e, tv = {
9727
9732
  seek: {
9728
9733
  toleranceMs: 200,
9729
9734
  toleranceMaxMs: 2500,
@@ -9755,7 +9760,7 @@ var Y_, X_ = 5e3, Z_ = () => Ye() || Ke(), Q_ = () => Z_() ? 100 : 0, $_ = (e) =
9755
9760
  decayCooldownMultiplier: 3,
9756
9761
  decayCheckInterval: 15e3
9757
9762
  }
9758
- }, tv = class {
9763
+ }, nv = class {
9759
9764
  get driftSamplesToAverage() {
9760
9765
  return this._driftSamplesToAverage;
9761
9766
  }
@@ -9763,7 +9768,7 @@ var Y_, X_ = 5e3, Z_ = () => Ye() || Ke(), Q_ = () => Z_() ? 100 : 0, $_ = (e) =
9763
9768
  this._driftSamplesToAverage = e, this.driftSamples = new _(e);
9764
9769
  }
9765
9770
  constructor(t, n, r, i, a) {
9766
- e(this, "emitter", void 0), e(this, "logger", void 0), e(this, "playbackSource", void 0), e(this, "bufferSource", void 0), e(this, "keyframeTimestamps", new _(10)), e(this, "lastSeekTime", Date.now()), e(this, "lastAdjustmentTime", Date.now()), e(this, "lastDecayCheckTime", Date.now()), e(this, "config", void 0), e(this, "state", void 0), e(this, "allowTimeshiftOnAudio", !1), e(this, "syncInfoToleranceMaxMs", 150), e(this, "syncInfoToleranceStep", 20), e(this, "seekOvershoot", Q_()), e(this, "timers", j.create()), e(this, "rtt", 0), e(this, "channelSyncInfo", /* @__PURE__ */ new Map()), e(this, "seekAdjustmentCount", 0), e(this, "timeshiftAdjustmentCount", 0), e(this, "syncInfoCorrectionCount", 0), e(this, "playbackRateAdjustmentCount", 0), e(this, "lastPlaybackRateChangeTime", 0), e(this, "seekAdjustmentTimestamps", []), e(this, "timeshiftAdjustmentTimestamps", []), e(this, "_driftSamplesToAverage", 5), e(this, "driftSamples", new _(this._driftSamplesToAverage)), e(this, "timestampOffset", void 0), e(this, "currentChannelId", void 0), e(this, "highestSeenTimestamps", /* @__PURE__ */ new Map()), e(this, "isSuspended", !1), e(this, "isSyncAdjustmentActivated", !1), e(this, "queuedTimeshift", !1), e(this, "load", () => {
9771
+ e(this, "emitter", void 0), e(this, "logger", void 0), e(this, "playbackSource", void 0), e(this, "bufferSource", void 0), e(this, "keyframeTimestamps", new _(10)), e(this, "lastSeekTime", Date.now()), e(this, "lastAdjustmentTime", Date.now()), e(this, "lastDecayCheckTime", Date.now()), e(this, "config", void 0), e(this, "state", void 0), e(this, "allowTimeshiftOnAudio", !1), e(this, "syncInfoToleranceMaxMs", 150), e(this, "syncInfoToleranceStep", 20), e(this, "seekOvershoot", $_()), e(this, "timers", j.create()), e(this, "rtt", 0), e(this, "channelSyncInfo", /* @__PURE__ */ new Map()), e(this, "seekAdjustmentCount", 0), e(this, "timeshiftAdjustmentCount", 0), e(this, "syncInfoCorrectionCount", 0), e(this, "playbackRateAdjustmentCount", 0), e(this, "lastPlaybackRateChangeTime", 0), e(this, "seekAdjustmentTimestamps", []), e(this, "timeshiftAdjustmentTimestamps", []), e(this, "_driftSamplesToAverage", 5), e(this, "driftSamples", new _(this._driftSamplesToAverage)), e(this, "timestampOffset", void 0), e(this, "currentChannelId", void 0), e(this, "highestSeenTimestamps", /* @__PURE__ */ new Map()), e(this, "isSuspended", !1), e(this, "isSyncAdjustmentActivated", !1), e(this, "queuedTimeshift", !1), e(this, "load", () => {
9767
9772
  this.timers.setInterval(this.onSync, 100);
9768
9773
  }), e(this, "unload", () => {
9769
9774
  this.logger.debug("Unloading module..."), this.emitter.off("rtt", this.updateRtt), this.timers.unload(), this.logger.debug("Unloaded module");
@@ -9801,7 +9806,7 @@ var Y_, X_ = 5e3, Z_ = () => Ye() || Ke(), Q_ = () => Z_() ? 100 : 0, $_ = (e) =
9801
9806
  }), e(this, "processSample", (e) => {
9802
9807
  var t;
9803
9808
  if (!e.channelId) throw Error("Sample must be assigned to a channel");
9804
- this.currentChannelId || (this.currentChannelId = e.channelId), this.timestampOffset || (this.timestampOffset = e.timestamp / e.timescale * 1e3 - X_);
9809
+ this.currentChannelId || (this.currentChannelId = e.channelId), this.timestampOffset || (this.timestampOffset = e.timestamp / e.timescale * 1e3 - Z_);
9805
9810
  let n = e.type === "video" && e.isSync;
9806
9811
  if (this.currentChannelId !== e.channelId) {
9807
9812
  let t = 2 ** 53 - 1;
@@ -9818,7 +9823,7 @@ var Y_, X_ = 5e3, Z_ = () => Ye() || Ke(), Q_ = () => Z_() ? 100 : 0, $_ = (e) =
9818
9823
  this.currentChannelId || (this.currentChannelId = e);
9819
9824
  let r = t.mediaType();
9820
9825
  if (!r) throw Error("Fragment must have a media type");
9821
- this.timestampOffset || (this.timestampOffset = t.baseMediaDecodeTime() / t.timescale() * 1e3 - X_);
9826
+ this.timestampOffset || (this.timestampOffset = t.baseMediaDecodeTime() / t.timescale() * 1e3 - Z_);
9822
9827
  let i = t.mediaType() === "video" && t.startsWithKeyframe();
9823
9828
  if (this.currentChannelId !== e) {
9824
9829
  let t = 2 ** 53 - 1;
@@ -9926,7 +9931,7 @@ var Y_, X_ = 5e3, Z_ = () => Ye() || Ke(), Q_ = () => Z_() ? 100 : 0, $_ = (e) =
9926
9931
  return;
9927
9932
  }
9928
9933
  if (n >= this.getEffectiveSeekToleranceMs() || n < this.currentTimeshiftToleranceMs()) return;
9929
- let r = Date.now() - this.config.seek.timeoutMs * this.state.timeshiftToleranceMultiplier, i = this.timeshiftAdjustmentTimestamps.filter($_(r)).length;
9934
+ let r = Date.now() - this.config.seek.timeoutMs * this.state.timeshiftToleranceMultiplier, i = this.timeshiftAdjustmentTimestamps.filter(ev(r)).length;
9930
9935
  if (i && this.state.timeshiftToleranceMultiplier > 2) {
9931
9936
  this.logger.info("Too many timeshifts within sliding window", {
9932
9937
  timeshiftCooldownThreshold: r,
@@ -9973,7 +9978,7 @@ var Y_, X_ = 5e3, Z_ = () => Ye() || Ke(), Q_ = () => Z_() ? 100 : 0, $_ = (e) =
9973
9978
  if (this.driftSamples.push(t), this.driftSamples.items().length < this.driftSamplesToAverage && Math.abs(t) < 2e3) return;
9974
9979
  let n = Ot(this.driftSamples.items());
9975
9980
  if (this.tryPlaybackRateSync(n) || n < 0 && -n < this.currentAheadToleranceMs() || n > 0 && n < this.currentSeekToleranceMs() || Math.abs(n) < 1 || !this.isSeekCooldownExpired()) return;
9976
- let r = Date.now() - this.config.seek.timeoutMs * this.state.seekToleranceMultiplier, i = this.seekAdjustmentTimestamps.filter($_(r)).length;
9981
+ let r = Date.now() - this.config.seek.timeoutMs * this.state.seekToleranceMultiplier, i = this.seekAdjustmentTimestamps.filter(ev(r)).length;
9977
9982
  if (i && this.state.seekToleranceMultiplier > 2) {
9978
9983
  this.logger.info("Too many seek adjustments within sliding window", {
9979
9984
  seekCooldownThreshold: r,
@@ -9989,10 +9994,10 @@ var Y_, X_ = 5e3, Z_ = () => Ye() || Ke(), Q_ = () => Z_() ? 100 : 0, $_ = (e) =
9989
9994
  if (t && r) return n;
9990
9995
  }
9991
9996
  }), this.logger = n, this.emitter = t, this.playbackSource = r, this.bufferSource = i, this.config = {
9992
- seek: C({}, ev.seek),
9993
- timeshift: C({}, ev.timeshift),
9994
- playbackRate: C({}, ev.playbackRate),
9995
- backoff: C({}, ev.backoff)
9997
+ seek: C({}, tv.seek),
9998
+ timeshift: C({}, tv.timeshift),
9999
+ playbackRate: C({}, tv.playbackRate),
10000
+ backoff: C({}, tv.backoff)
9996
10001
  }, this.config.timeshift.enabled = a, this.state = {
9997
10002
  seekToleranceMultiplier: 1,
9998
10003
  timeshiftToleranceMultiplier: 1
@@ -10048,10 +10053,10 @@ var Y_, X_ = 5e3, Z_ = () => Ye() || Ke(), Q_ = () => Z_() ? 100 : 0, $_ = (e) =
10048
10053
  return this.serverCurrentTime - this.playbackSource.currentTime;
10049
10054
  }
10050
10055
  };
10051
- Y_ = tv, e(tv, "create", (e, t, n, r, i) => new Y_(e, t, n, r, i));
10056
+ X_ = nv, e(nv, "create", (e, t, n, r, i) => new X_(e, t, n, r, i));
10052
10057
  //#endregion
10053
10058
  //#region ../../libs/web-sdk/src/modules/TelemetryModule.ts
10054
- var nv, rv = {
10059
+ var rv, iv = {
10055
10060
  enabled: !0,
10056
10061
  interval: 3e4,
10057
10062
  includeErrors: !0,
@@ -10060,11 +10065,11 @@ var nv, rv = {
10060
10065
  maxRetries: 10,
10061
10066
  maxErrorReports: 50,
10062
10067
  maxEvents: 50
10063
- }, iv = (e, t) => C(C({}, t), {}, {
10068
+ }, av = (e, t) => C(C({}, t), {}, {
10064
10069
  type: e,
10065
10070
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
10066
10071
  discriminator: "web"
10067
- }), av = class {
10072
+ }), ov = class {
10068
10073
  constructor(n, r, i, a) {
10069
10074
  var o = this;
10070
10075
  e(this, "logger", void 0), e(this, "timers", new j()), e(this, "emitter", void 0), e(this, "options", void 0), e(this, "parentContext", void 0), e(this, "unsentLines", new _(100)), e(this, "retries", 0), e(this, "errorCount", 0), e(this, "eventCount", 0), e(this, "statsCount", 0), e(this, "unload", () => {
@@ -10081,7 +10086,7 @@ var nv, rv = {
10081
10086
  initiator: "interval"
10082
10087
  }, n = {}) => {
10083
10088
  if (!this.options.includeStats) return;
10084
- let r = this.parentContext.getStatistics(), i = iv("stats", C(C(C({}, n), r), {}, {
10089
+ let r = this.parentContext.getStatistics(), i = av("stats", C(C(C({}, n), r), {}, {
10085
10090
  isFinal: e,
10086
10091
  initiator: t,
10087
10092
  count: this.statsCount++
@@ -10089,7 +10094,7 @@ var nv, rv = {
10089
10094
  this.unsentLines.push(i);
10090
10095
  }), e(this, "addEvent", (e) => {
10091
10096
  if (!this.options.includeEvents || this.eventCount > this.options.maxEvents) return;
10092
- let t = iv("event", C(C({}, this.parentContext.getStatistics()), e));
10097
+ let t = av("event", C(C({}, this.parentContext.getStatistics()), e));
10093
10098
  this.eventCount++, this.unsentLines.push(t);
10094
10099
  }), e(this, "getStatistics", () => ({ errorCount: this.errorCount })), e(this, "send", function() {
10095
10100
  var e = t(function* (e) {
@@ -10135,15 +10140,15 @@ var nv, rv = {
10135
10140
  if (t && e instanceof g) {
10136
10141
  if (this.errorCount++, this.errorCount > n) return;
10137
10142
  let t = this.parentContext.getStatistics();
10138
- this.unsentLines.push(iv("error", C(C({}, t), e.toStringifiable())));
10143
+ this.unsentLines.push(av("error", C(C({}, t), e.toStringifiable())));
10139
10144
  }
10140
- }), this.logger = n, this.emitter = r, this.options = C(C({}, rv), i), this.parentContext = a;
10145
+ }), this.logger = n, this.emitter = r, this.options = C(C({}, iv), i), this.parentContext = a;
10141
10146
  }
10142
10147
  };
10143
- nv = av, e(av, "create", (e, t, n, r) => new nv(e, t, n, r));
10148
+ rv = ov, e(ov, "create", (e, t, n, r) => new rv(e, t, n, r));
10144
10149
  //#endregion
10145
10150
  //#region ../../libs/web-sdk/src/modules/UnpauseModule.ts
10146
- var ov, sv = class {
10151
+ var sv, cv = class {
10147
10152
  constructor(t, n, r) {
10148
10153
  e(this, "logger", void 0), e(this, "element", void 0), e(this, "documentState", void 0), e(this, "timers", new j()), e(this, "unload", () => {
10149
10154
  this.timers.unload();
@@ -10152,10 +10157,10 @@ var ov, sv = class {
10152
10157
  }), this.logger = t, this.element = n, this.documentState = r, this.timers.setInterval(this.unpause, 100);
10153
10158
  }
10154
10159
  };
10155
- ov = sv, e(sv, "create", (e, t, n) => new ov(e, t, n));
10160
+ sv = cv, e(cv, "create", (e, t, n) => new sv(e, t, n));
10156
10161
  //#endregion
10157
10162
  //#region ../../libs/web-sdk/src/OptionsProvider.ts
10158
- var cv = [
10163
+ var lv = [
10159
10164
  "minBufferTime",
10160
10165
  "maxBufferTime",
10161
10166
  "burstEnabled",
@@ -10165,10 +10170,10 @@ var cv = [
10165
10170
  "offscreenCanvasEnabled",
10166
10171
  "videoCodecs"
10167
10172
  ];
10168
- function lv(e) {
10169
- return cv.includes(e);
10173
+ function uv(e) {
10174
+ return lv.includes(e);
10170
10175
  }
10171
- var uv = class {
10176
+ var dv = class {
10172
10177
  constructor(t) {
10173
10178
  e(this, "options", void 0), e(this, "overrides", /* @__PURE__ */ new Map()), this.options = t;
10174
10179
  }
@@ -10182,7 +10187,7 @@ var uv = class {
10182
10187
  this.options[e] = t;
10183
10188
  }
10184
10189
  get(e, t) {
10185
- if (t && lv(e)) {
10190
+ if (t && uv(e)) {
10186
10191
  var n;
10187
10192
  let r = (n = this.overrides.get(t)) == null ? void 0 : n[e];
10188
10193
  if (r !== void 0) return r;
@@ -10193,7 +10198,7 @@ var uv = class {
10193
10198
  var n;
10194
10199
  return (n = this.overrides.get(t)) == null ? void 0 : n[e];
10195
10200
  }
10196
- }, dv = 6, fv = (e) => {
10201
+ }, fv = 6, pv = (e) => {
10197
10202
  let t = [e], n = 0, r = 0, i = !1, a = (e, t) => {
10198
10203
  var i, a;
10199
10204
  if (e.flags && Lo(e.flags)) {
@@ -10205,7 +10210,7 @@ var uv = class {
10205
10210
  return u > 0 && (r = u), C(C({}, e), {}, { duration: u > 0 ? u : r });
10206
10211
  };
10207
10212
  return (e, n = !1) => {
10208
- if (e.flags && Lo(e.flags) && n && (i = !i), !(n && t.length < dv && i) && t.length > 0) {
10213
+ if (e.flags && Lo(e.flags) && n && (i = !i), !(n && t.length < fv && i) && t.length > 0) {
10209
10214
  i = !1;
10210
10215
  let n = e;
10211
10216
  for (let e = t.length - 1; e > 0; e--) {
@@ -10218,13 +10223,13 @@ var uv = class {
10218
10223
  }
10219
10224
  return t.push(e), [];
10220
10225
  };
10221
- }, pv = ["mse", "wasm"], mv = (e) => e == null ? pv : e, hv = (e) => {
10226
+ }, mv = ["mse", "wasm"], hv = (e) => e == null ? mv : e, gv = (e) => {
10222
10227
  if (!e) return !1;
10223
10228
  let t = e.headers && Object.keys(e.headers).length > 0, n = e.queryParams && Object.keys(e.queryParams).length > 0;
10224
10229
  return !!(t || n);
10225
- }, gv = (e, t, n) => {
10226
- if (hv(n)) return "mse";
10227
- let r = mv(e);
10230
+ }, _v = (e, t, n) => {
10231
+ if (gv(n)) return "mse";
10232
+ let r = hv(e);
10228
10233
  for (let e of r) switch (e) {
10229
10234
  case "mse":
10230
10235
  if (t) return "mse";
@@ -10235,7 +10240,7 @@ var uv = class {
10235
10240
  case "wasm": return "wasm";
10236
10241
  }
10237
10242
  return "wasm";
10238
- }, _v = (e, t, n) => {
10243
+ }, vv = (e, t, n) => {
10239
10244
  if (hn(t)) return C(C({}, e), {}, {
10240
10245
  type: "video",
10241
10246
  codec: t.codec,
@@ -10256,8 +10261,8 @@ var uv = class {
10256
10261
  data: e.payload,
10257
10262
  duration: 0
10258
10263
  });
10259
- }, vv = (e, t) => e && typeof e == "object" && t in e, yv = (e) => !(typeof e != "object" || !vv(e, "channelId") || typeof e.channelId != "string" || !vv(e, "url") || typeof e.url != "string" || e.channelId.length === 0 || e.url.length === 0), bv = (e) => {
10260
- if (!yv(e)) throw new g("Invalid options", {
10264
+ }, yv = (e, t) => e && typeof e == "object" && t in e, bv = (e) => !(typeof e != "object" || !yv(e, "channelId") || typeof e.channelId != "string" || !yv(e, "url") || typeof e.url != "string" || e.channelId.length === 0 || e.url.length === 0), xv = (e) => {
10265
+ if (!bv(e)) throw new g("Invalid options", {
10261
10266
  isFatal: !0,
10262
10267
  code: "invalid_options"
10263
10268
  });
@@ -10266,13 +10271,13 @@ var uv = class {
10266
10271
  let n = t;
10267
10272
  n[e] === void 0 && delete n[e];
10268
10273
  }), t;
10269
- }, xv = (e) => {
10274
+ }, Sv = (e) => {
10270
10275
  if (typeof e != "object" || !e) throw Error("not an object");
10271
10276
  if (!("video" in e)) throw Error("missing video in subscription");
10272
10277
  if (!("audio" in e)) throw Error("missing audio in subscription");
10273
10278
  if (!("channelId" in e)) throw Error("missing channelId");
10274
10279
  return !0;
10275
- }, Sv = class {
10280
+ }, Cv = class {
10276
10281
  constructor(n) {
10277
10282
  var r = this;
10278
10283
  e(this, "cache", /* @__PURE__ */ new Map()), e(this, "inFlight", /* @__PURE__ */ new Map()), e(this, "checkVideoSupport", function() {
@@ -10332,10 +10337,10 @@ var uv = class {
10332
10337
  return this.inFlight.set(e, o), o;
10333
10338
  }), this.logger = n;
10334
10339
  }
10335
- }, Cv = /* @__PURE__ */ new WeakMap(), wv = /* @__PURE__ */ new WeakMap(), Tv = /* @__PURE__ */ new WeakMap(), Ev = class n extends _e {
10340
+ }, wv = /* @__PURE__ */ new WeakMap(), Tv = /* @__PURE__ */ new WeakMap(), Ev = /* @__PURE__ */ new WeakMap(), Dv = class n extends _e {
10336
10341
  constructor(r) {
10337
10342
  var i, a;
10338
- super(), i = this, e(this, "pictureInPicture", void 0), e(this, "drm", void 0), e(this, "browser", rt()), e(this, "options", void 0), e(this, "element", void 0), e(this, "playbackSource", void 0), e(this, "emitter", new _e()), e(this, "logger", void 0), e(this, "modules", void 0), e(this, "clientIp", void 0), e(this, "sessionId", void 0), e(this, "clientId", fn()), e(this, "_channels", []), e(this, "createdAt", Date.now()), e(this, "offscreenCanvasElement", void 0), e(this, "webCodecsRenditionSupport", void 0), e(this, "hasCalledConnect", !1), e(this, "latestEmittedLanguages", []), e(this, "wakeLock", void 0), e(this, "pool", new Se(n.MAX_POOL_SIZE)), e(this, "userAgentInformation", new dn()), e(this, "encryptedMediaExtensions", void 0), v(this, Cv, 0), v(this, wv, []), e(this, "sampleProcessingSesssions", /* @__PURE__ */ new Map()), e(this, "sizes", /* @__PURE__ */ new Map()), e(this, "isSuspended", !0), e(this, "disconnectTimeout", void 0), e(this, "offscreenSubtitleInterval", void 0), v(this, Tv, void 0), e(this, "attach", (e) => {
10343
+ super(), i = this, e(this, "pictureInPicture", void 0), e(this, "drm", void 0), e(this, "browser", rt()), e(this, "options", void 0), e(this, "element", void 0), e(this, "playbackSource", void 0), e(this, "emitter", new _e()), e(this, "logger", void 0), e(this, "modules", void 0), e(this, "clientIp", void 0), e(this, "sessionId", void 0), e(this, "clientId", fn()), e(this, "_channels", []), e(this, "createdAt", Date.now()), e(this, "offscreenCanvasElement", void 0), e(this, "webCodecsRenditionSupport", void 0), e(this, "hasCalledConnect", !1), e(this, "latestEmittedLanguages", []), e(this, "wakeLock", void 0), e(this, "pool", new Se(n.MAX_POOL_SIZE)), e(this, "userAgentInformation", new dn()), e(this, "encryptedMediaExtensions", void 0), v(this, wv, 0), v(this, Tv, []), e(this, "sampleProcessingSesssions", /* @__PURE__ */ new Map()), e(this, "sizes", /* @__PURE__ */ new Map()), e(this, "isSuspended", !0), e(this, "disconnectTimeout", void 0), e(this, "offscreenSubtitleInterval", void 0), v(this, Ev, void 0), e(this, "attach", (e) => {
10339
10344
  var t;
10340
10345
  (t = this.wakeLock) == null || t.attach(e), e.appendChild(this.element);
10341
10346
  }), e(this, "setElement", (e) => {
@@ -10418,20 +10423,20 @@ var uv = class {
10418
10423
  }), e(this, "updateTextTracks", (e) => {
10419
10424
  let t = e.filter((e) => e.codec === "webvtt");
10420
10425
  t.forEach((e) => {
10421
- if (!b(wv, this).find((t) => t.language === e.language)) {
10426
+ if (!b(Tv, this).find((t) => t.language === e.language)) {
10422
10427
  if (this.modules.canvasModule) {
10423
10428
  let t = this.modules.canvasModule.textTracks.addTextTrack(e.kind, e.label || e.language || "", e.language || "");
10424
- b(wv, this).push(t);
10429
+ b(Tv, this).push(t);
10425
10430
  } else if (this.mediaElement instanceof HTMLVideoElement) {
10426
10431
  let t = this.mediaElement.addTextTrack(e.kind, e.label || e.language, e.language);
10427
- b(wv, this).push(t);
10432
+ b(Tv, this).push(t);
10428
10433
  }
10429
10434
  }
10430
10435
  });
10431
- for (let e of b(wv, this)) t.find((t) => t.language === e.language) ? e.mode === "disabled" && (e.mode = "hidden") : e.mode = "disabled";
10436
+ for (let e of b(Tv, this)) t.find((t) => t.language === e.language) ? e.mode === "disabled" && (e.mode = "hidden") : e.mode = "disabled";
10432
10437
  this.emit("text tracks", this.textTracks);
10433
10438
  }), e(this, "cleanupTextTracks", (e = this.currentTime - 2e4) => {
10434
- b(wv, this).forEach((t) => {
10439
+ b(Tv, this).forEach((t) => {
10435
10440
  if (t.cues) for (let n of t.cues) n.endTime * 1e3 < e - 2e3 && t.removeCue(n);
10436
10441
  });
10437
10442
  }), e(this, "filterRenditions", function() {
@@ -10565,8 +10570,8 @@ var uv = class {
10565
10570
  u = void 0, d = void 0, i.logger.warn("Failed to enable OffscreenCanvas; falling back to main thread rendering", { error: e });
10566
10571
  }
10567
10572
  else s && i.logger.warn("OffscreenCanvas requested but not supported; falling back to main thread rendering");
10568
- let f = yield qg.create(i.emitter, i.logger.createContext("DecoderModule"), i.options.get("logLevel"), n, i.playbackSource, i.pool, a, o, u), { videoRenderer: p } = f.getStatistics(), m = i.modules.canvasModule;
10569
- if (m instanceof g_) if (p === "OffscreenCanvas" && d) {
10573
+ let f = yield Jg.create(i.emitter, i.logger.createContext("DecoderModule"), i.options.get("logLevel"), n, i.playbackSource, i.pool, a, o, u), { videoRenderer: p } = f.getStatistics(), m = i.modules.canvasModule;
10574
+ if (m instanceof __) if (p === "OffscreenCanvas" && d) {
10570
10575
  m.setVideoRenderingEnabled(!1);
10571
10576
  let e = i.element;
10572
10577
  e.parentElement ? e.parentElement.replaceChild(d, e) : i.logger.warn("OffscreenCanvas rendering is active but the current element is not attached to the DOM. Updating internal element reference only."), i.offscreenCanvasElement = d, i.setElement(d);
@@ -10578,10 +10583,10 @@ var uv = class {
10578
10583
  t.parentElement && t.parentElement.replaceChild(e, t), i.setElement(e);
10579
10584
  }
10580
10585
  }
10581
- else m instanceof v_ && (p === "OffscreenCanvas" && d ? (m.setOffscreenCanvas(d), i.offscreenCanvasElement = d) : (m.setOffscreenCanvas(void 0), i.offscreenCanvasElement = void 0));
10586
+ else m instanceof y_ && (p === "OffscreenCanvas" && d ? (m.setOffscreenCanvas(d), i.offscreenCanvasElement = d) : (m.setOffscreenCanvas(void 0), i.offscreenCanvasElement = void 0));
10582
10587
  (e = i.modules.decoder) == null || e.unload(), i.modules.decoder = f, i.modules.decoder.load(), i.setupOffscreenSubtitleRouting();
10583
10588
  })), e(this, "setupOffscreenSubtitleRouting", () => {
10584
- if (this.offscreenSubtitleInterval !== void 0 && (clearInterval(this.offscreenSubtitleInterval), this.offscreenSubtitleInterval = void 0), !this.offscreenCanvasElement || !this.modules.decoder || this.modules.canvasModule instanceof v_) return;
10589
+ if (this.offscreenSubtitleInterval !== void 0 && (clearInterval(this.offscreenSubtitleInterval), this.offscreenSubtitleInterval = void 0), !this.offscreenCanvasElement || !this.modules.decoder || this.modules.canvasModule instanceof y_) return;
10585
10590
  let e = this.modules.decoder, t = this.modules.canvasModule;
10586
10591
  if (!t) return;
10587
10592
  let n = !1;
@@ -10620,10 +10625,10 @@ var uv = class {
10620
10625
  e && "reset" in e && e.reset();
10621
10626
  }), this.sampleProcessingSesssions.clear(), this.playbackSource.currentTime = 0, this.playbackSource.isActivated = !1;
10622
10627
  }), e(this, "getRuntimeInfo", () => {
10623
- let e = this.modules.canvasModule instanceof v_ ? !0 : void 0;
10628
+ let e = this.modules.canvasModule instanceof y_ ? !0 : void 0;
10624
10629
  return C({
10625
10630
  uptime: Date.now() - this.createdAt,
10626
- version: "4.2.0-32-gbe3fbabd8",
10631
+ version: "4.2.0-33-g96e854459",
10627
10632
  clientId: this.clientId,
10628
10633
  sessionId: this.sessionId,
10629
10634
  channelId: this.channelId,
@@ -10647,7 +10652,7 @@ var uv = class {
10647
10652
  }), e(this, "timeToFirstFrame", () => {
10648
10653
  let e = this.modules.playback.getFirstFrameTime(), t = this.modules.connection.firstConnectionTime;
10649
10654
  if (t && e) return e - t;
10650
- }), this.options = new uv(C(C({}, xn), bv(r))), r.telemetryEnabled === void 0 && ["localhost", "127.0.0.1"].includes(location.hostname) && this.options.set("telemetryEnabled", !1);
10655
+ }), this.options = new dv(C(C({}, xn), xv(r))), r.telemetryEnabled === void 0 && ["localhost", "127.0.0.1"].includes(location.hostname) && this.options.set("telemetryEnabled", !1);
10651
10656
  let o = {
10652
10657
  channelId: this.options.get("channelId"),
10653
10658
  audio: {
@@ -10660,16 +10665,16 @@ var uv = class {
10660
10665
  height: this.options.get("maxSize").height
10661
10666
  }
10662
10667
  }, s = O.get();
10663
- s.setLevel(this.options.get("logLevel")), s.setDebug(!1), this.logger = s, this.webCodecsRenditionSupport = new Sv(s), r.iosMediaElementEnabled !== void 0 && this.logger.warn("Option iosMediaElementEnabled is deprecated and will be removed in a future release. Use streamToMediaElementEnabled instead.");
10668
+ s.setLevel(this.options.get("logLevel")), s.setDebug(!1), this.logger = s, this.webCodecsRenditionSupport = new Cv(s), r.iosMediaElementEnabled !== void 0 && this.logger.warn("Option iosMediaElementEnabled is deprecated and will be removed in a future release. Use streamToMediaElementEnabled instead.");
10664
10669
  let c = (a = r.streamToMediaElementEnabled) == null ? r.iosMediaElementEnabled : a;
10665
10670
  c !== void 0 && (this.options.set("streamToMediaElementEnabled", c), this.options.set("iosMediaElementEnabled", c));
10666
10671
  let l = r.mseEnabled !== void 0, f = r.decoders !== void 0;
10667
10672
  l && this.logger.warn("Option mseEnabled is deprecated and will be removed in a future release. Use decoders instead (e.g. decoders: [\"wasm\"])."), l && !f && r.mseEnabled === !1 && this.options.set("decoders", ["wasm"]);
10668
- let p = I_.create(this.emitter, this.logger.createContext("PictureInPictureModule")), h = j.create(), ee = Rg.create(this.emitter, this.logger.createContext("ConnectionModule"), {
10673
+ let p = L_.create(this.emitter, this.logger.createContext("PictureInPictureModule")), h = j.create(), ee = zg.create(this.emitter, this.logger.createContext("ConnectionModule"), {
10669
10674
  reconnectHandler: this.options.get("reconnectHandler"),
10670
10675
  options: this.options,
10671
10676
  onConnectInfo: this.onConnectInfo
10672
- }), te = J_.create(this.logger.createContext("SubscriptionModule"), this.emitter, o), ne = W_.create(this.emitter, te), re = H_.create(this.emitter, this.logger.createContext("QualityOfServiceModule"), ne), ie = R_.create(this.emitter, this.logger.createContext("PlaybackModule"), this, this.options.get("minBufferTime"));
10677
+ }), te = Y_.create(this.logger.createContext("SubscriptionModule"), this.emitter, o), ne = G_.create(this.emitter, te), re = U_.create(this.emitter, this.logger.createContext("QualityOfServiceModule"), ne), ie = z_.create(this.emitter, this.logger.createContext("PlaybackModule"), this, this.options.get("minBufferTime"));
10673
10678
  this.encryptedMediaExtensions = new Rr(this.emitter, this.logger.createContext("EncryptedMediaExtensions"), r.drm), this.drm = {
10674
10679
  setHeaders: (e) => {
10675
10680
  this.encryptedMediaExtensions.headers = e;
@@ -10678,7 +10683,7 @@ var uv = class {
10678
10683
  this.encryptedMediaExtensions.queryParams = e;
10679
10684
  }
10680
10685
  };
10681
- let ae = Yg.create(this.emitter), oe = this.options.get("poster"), se = oe === !0 ? this.getThumbnailUrl() : oe || void 0, _, y, S;
10686
+ let ae = Xg.create(this.emitter), oe = this.options.get("poster"), se = oe === !0 ? this.getThumbnailUrl() : oe || void 0, _, y, S;
10682
10687
  if (this.willUseMediaSource()) {
10683
10688
  let e = new ts({
10684
10689
  type: this.options.get("media") === "audio" ? "audio" : "video",
@@ -10688,9 +10693,9 @@ var uv = class {
10688
10693
  logger: this.logger.createContext("MediaElement"),
10689
10694
  poster: se
10690
10695
  });
10691
- e.on("buffer state", (e) => this.emitter.emit("buffer state", e)), e.on("needs user input", (e) => this.emitter.emit("needs user input", e)), e.on("volume state", (e) => this.emit("volume state", e)), e.on("media element state", (e) => this.onMediaElementState(e)), this.element = e.element, this.playbackSource = e, Rr.isSupported() && this.encryptedMediaExtensions.attach(e.element), _ = A_.create(this.logger.createContext("MseModule"), this.emitter, this.element), this.options.get("pauseSupportEnabled") || (y = sv.create(this.logger.createContext("UnpauseModule"), e, ae)), this.options.get("pictureInPictureEnabled") && this.emitter.emit("add picture in picture listener", { element: e.element });
10696
+ e.on("buffer state", (e) => this.emitter.emit("buffer state", e)), e.on("needs user input", (e) => this.emitter.emit("needs user input", e)), e.on("volume state", (e) => this.emit("volume state", e)), e.on("media element state", (e) => this.onMediaElementState(e)), this.element = e.element, this.playbackSource = e, Rr.isSupported() && this.encryptedMediaExtensions.attach(e.element), _ = j_.create(this.logger.createContext("MseModule"), this.emitter, this.element), this.options.get("pauseSupportEnabled") || (y = cv.create(this.logger.createContext("UnpauseModule"), e, ae)), this.options.get("pictureInPictureEnabled") && this.emitter.emit("add picture in picture listener", { element: e.element });
10692
10697
  } else if (this.options.get("streamToMediaElementEnabled") && Et(this.browser)) {
10693
- let e = v_.create(this.emitter, this.logger.createContext("ModernCanvasModule"), this.pool, this, {
10698
+ let e = y_.create(this.emitter, this.logger.createContext("ModernCanvasModule"), this.pool, this, {
10694
10699
  type: this.options.get("media") === "audio" ? "audio" : "video",
10695
10700
  muted: this.options.get("muted") || this.options.get("media") === "video",
10696
10701
  volume: this.options.get("volume"),
@@ -10700,10 +10705,10 @@ var uv = class {
10700
10705
  }), t = e.element();
10701
10706
  this.element = t.element, this.playbackSource = e, S = e;
10702
10707
  let n = this.browser.platform.isIOS && this.browser.platform.iosVersion <= 15;
10703
- this.options.get("pictureInPictureEnabled") && !n && this.emitter.emit("add picture in picture listener", { element: this.element }), this.options.get("pauseSupportEnabled") || (y = sv.create(this.logger.createContext("UnpauseModule"), t, ae));
10708
+ this.options.get("pictureInPictureEnabled") && !n && this.emitter.emit("add picture in picture listener", { element: this.element }), this.options.get("pauseSupportEnabled") || (y = cv.create(this.logger.createContext("UnpauseModule"), t, ae));
10704
10709
  } else {
10705
10710
  let e;
10706
- e = g_.create(this.emitter, this.logger.createContext("LegacyCanvasModule"), this.pool, this, this.options.get("muted") || this.options.get("media") === "video", this.options.get("volume"), () => {
10711
+ e = __.create(this.emitter, this.logger.createContext("LegacyCanvasModule"), this.pool, this, this.options.get("muted") || this.options.get("media") === "video", this.options.get("volume"), () => {
10707
10712
  this.setElement(e.element());
10708
10713
  }, this.options.get("minBufferTime")), this.element = e.element(), this.playbackSource = e, S = e, this.options.get("iosWakeLockEnabled") && (this.wakeLock = new Go());
10709
10714
  }
@@ -10717,9 +10722,9 @@ var uv = class {
10717
10722
  }, this.emitter.on("error", (e) => {
10718
10723
  if (e.type() === "external" && this.emit("error", e), e.isFatal()) return () => void this.unload();
10719
10724
  });
10720
- let ce = this.browser.platform.isWebKit, ue = tv.create(this.emitter, this.logger.createContext("SyncModule"), this.playbackSource, ie, this.willUseMediaSource() && !ce), de = r_.create(this.logger.createContext("JitterModule")), fe = (this.options.get("edgeUrl") || this.options.get("url")).replace("wss://", "https://").replace("ws://", "http://").replace("//lb.", "//errors."), pe = new URL("/telemetry", fe).toString();
10725
+ let ce = this.browser.platform.isWebKit, ue = nv.create(this.emitter, this.logger.createContext("SyncModule"), this.playbackSource, ie, this.willUseMediaSource() && !ce), de = i_.create(this.logger.createContext("JitterModule")), fe = (this.options.get("edgeUrl") || this.options.get("url")).replace("wss://", "https://").replace("ws://", "http://").replace("//lb.", "//errors."), pe = new URL("/telemetry", fe).toString();
10721
10726
  this.modules = {
10722
- telemetry: av.create(this.logger.createContext("TelemetryModule"), this.emitter, {
10727
+ telemetry: ov.create(this.logger.createContext("TelemetryModule"), this.emitter, {
10723
10728
  url: pe,
10724
10729
  enabled: this.options.get("telemetryEnabled"),
10725
10730
  includeStats: !1,
@@ -10729,10 +10734,10 @@ var uv = class {
10729
10734
  maxBufferTime: this.options.get("maxBufferTime"),
10730
10735
  minBufferTime: this.options.get("minBufferTime")
10731
10736
  }),
10732
- incomingData: e_.create(this.emitter),
10737
+ incomingData: t_.create(this.emitter),
10733
10738
  adaptivity: fs.create(this.emitter, this.logger.createContext("AdaptivityModule"), re, { cooldownTime: Math.max(this.options.get("minBufferTime"), 2e3) }),
10734
- constraintCap: Ug.create(this.emitter, this.element, ne, this.options.get("abrEnabled") ? this.options.get("sizeBasedResolutionCapEnabled") : !1),
10735
- event: Qg.create(this.emitter, this.logger.createContext("EventModule"), ue),
10739
+ constraintCap: Wg.create(this.emitter, this.element, ne, this.options.get("abrEnabled") ? this.options.get("sizeBasedResolutionCapEnabled") : !1),
10740
+ event: $g.create(this.emitter, this.logger.createContext("EventModule"), ue),
10736
10741
  sync: ue,
10737
10742
  jitter: de,
10738
10743
  documentState: ae,
@@ -10785,7 +10790,7 @@ var uv = class {
10785
10790
  let r = ((t = (n = e.telemetry) == null ? void 0 : n.probability) == null ? 1 : t) >= Math.random();
10786
10791
  if (e.telemetry) {
10787
10792
  var i;
10788
- (i = this.modules.telemetry) == null || i.unload(), this.modules.telemetry = av.create(this.logger.createContext("TelemetryModule"), this.emitter, C(C({}, e.telemetry), {}, { enabled: this.options.get("telemetryEnabled") && r }), this), this.modules.telemetry.load();
10793
+ (i = this.modules.telemetry) == null || i.unload(), this.modules.telemetry = ov.create(this.logger.createContext("TelemetryModule"), this.emitter, C(C({}, e.telemetry), {}, { enabled: this.options.get("telemetryEnabled") && r }), this), this.modules.telemetry.load();
10789
10794
  }
10790
10795
  }), this.emitter.on("adapt level", (e) => {
10791
10796
  this.logger.debug("adapt level", { direction: e });
@@ -10817,8 +10822,8 @@ var uv = class {
10817
10822
  audio: C(C({}, this.targetSubscription.audio), d == null ? void 0 : d.audio)
10818
10823
  })), this.emitter.emit("adapted level");
10819
10824
  }), this.emitter.on("text track data", (e) => {
10820
- let t = b(wv, this).find((t) => t.language === e.language), n = this.modules.sync.getTimeshiftOffset() / 1e3, r = n - b(Cv, this);
10821
- if (x(Cv, this, n), t) {
10825
+ let t = b(Tv, this).find((t) => t.language === e.language), n = this.modules.sync.getTimeshiftOffset() / 1e3, r = n - b(wv, this);
10826
+ if (x(wv, this, n), t) {
10822
10827
  if (t.cues) for (let e of t.cues) e.startTime -= r, e.endTime -= r;
10823
10828
  for (let r of e.cues) {
10824
10829
  let e = new VTTCue(r.startTime - n, r.endTime - n, r.text);
@@ -10832,19 +10837,19 @@ var uv = class {
10832
10837
  this.clientIp = t.ip;
10833
10838
  break;
10834
10839
  case "renditions":
10835
- this.updateTextTracks(t.renditions), x(Tv, this, this.filterRenditions(t.renditions).then((e) => {
10840
+ this.updateTextTracks(t.renditions), x(Ev, this, this.filterRenditions(t.renditions).then((e) => {
10836
10841
  this.emitter.emit("renditions", {
10837
10842
  renditions: e,
10838
10843
  channelId: this.currentSubscription.channelId
10839
10844
  }), this.emit("rendition levels", this.modules.renditions.getRenditionLevels()), this.emitLanguagesIfChanged();
10840
10845
  }).finally(() => {
10841
- x(Tv, this, void 0);
10846
+ x(Ev, this, void 0);
10842
10847
  }));
10843
10848
  break;
10844
10849
  case "subscription changed":
10845
10850
  var r;
10846
10851
  try {
10847
- xv(t.subscription);
10852
+ Sv(t.subscription);
10848
10853
  } catch (e) {
10849
10854
  this.emitter.emit("error", new g("Subscription failed validation", {
10850
10855
  source: e instanceof Error ? e : void 0,
@@ -10954,7 +10959,7 @@ var uv = class {
10954
10959
  let ve = function() {
10955
10960
  var e = t(function* (e) {
10956
10961
  let t = e.channelId;
10957
- b(Tv, i) && (yield b(Tv, i));
10962
+ b(Ev, i) && (yield b(Ev, i));
10958
10963
  let n = i.modules.renditions.getRendition(e.renditionId, t);
10959
10964
  if (!zo(e.flags)) {
10960
10965
  if (Bo(e.flags)) {
@@ -10962,8 +10967,8 @@ var uv = class {
10962
10967
  if (e.renditionId !== 0) {
10963
10968
  let e = le(t);
10964
10969
  if (e && e.language !== void 0) {
10965
- let t = new Zo().parse(e.content || ""), r = n / 1e3, a = b(wv, i).find((t) => t.language === e.language), o = r - b(Cv, i);
10966
- if (x(Cv, i, r), a) {
10970
+ let t = new Zo().parse(e.content || ""), r = n / 1e3, a = b(Tv, i).find((t) => t.language === e.language), o = r - b(wv, i);
10971
+ if (x(wv, i, r), a) {
10967
10972
  if (a.cues) for (let e of a.cues) e.startTime -= o, e.endTime -= o;
10968
10973
  for (let e of t) {
10969
10974
  let t = new VTTCue(e.startTime - r, e.endTime - r, e.text);
@@ -10995,10 +11000,10 @@ var uv = class {
10995
11000
  mimeType: s
10996
11001
  }), i.emit("initialized media");
10997
11002
  } else {
10998
- let t = _v(e, n, i.sizes.get(e.renditionId));
11003
+ let t = vv(e, n, i.sizes.get(e.renditionId));
10999
11004
  i.modules.jitter.recordSample(t);
11000
11005
  let a = i.sampleProcessingSesssions.get(r);
11001
- if (!a) a = fv(i.modules.sync.processSample(t)), i.sampleProcessingSesssions.set(r, a);
11006
+ if (!a) a = pv(i.modules.sync.processSample(t)), i.sampleProcessingSesssions.set(r, a);
11002
11007
  else {
11003
11008
  let e = i.willUseMediaSource() && i.isSwitchingRenditionLevel && t.type === "video", n = a(i.modules.sync.processSample(t), e), r = t;
11004
11009
  n.forEach((e) => {
@@ -11106,7 +11111,7 @@ var uv = class {
11106
11111
  this.modules.subscription.setLanguage(e), this.alignSizeAndBitRate(this.targetSubscription);
11107
11112
  }
11108
11113
  set textTrack(e) {
11109
- e !== this.textTrack && (b(wv, this).forEach((t) => {
11114
+ e !== this.textTrack && (b(Tv, this).forEach((t) => {
11110
11115
  if (t.label === e) t.mode = "showing";
11111
11116
  else {
11112
11117
  if (t.mode === "showing" && t.cues) for (let e of [...t.cues]) t.removeCue(e);
@@ -11115,11 +11120,11 @@ var uv = class {
11115
11120
  }), this.emitter.emit("text track", e));
11116
11121
  }
11117
11122
  get textTracks() {
11118
- return b(wv, this).filter((e) => e.mode !== "disabled").map((e) => e.label);
11123
+ return b(Tv, this).filter((e) => e.mode !== "disabled").map((e) => e.label);
11119
11124
  }
11120
11125
  get textTrack() {
11121
11126
  var e;
11122
- return (e = b(wv, this).find((e) => e.mode === "showing")) == null ? void 0 : e.label;
11127
+ return (e = b(Tv, this).find((e) => e.mode === "showing")) == null ? void 0 : e.label;
11123
11128
  }
11124
11129
  get channelId() {
11125
11130
  var e, t;
@@ -11253,7 +11258,7 @@ var uv = class {
11253
11258
  return this.modules.subscription.getTargetSubscription();
11254
11259
  }
11255
11260
  resolvedDecoder(e) {
11256
- return gv(this.options.get("decoders", e), this.browser.supportsMediaSource, this.options.get("drm"));
11261
+ return _v(this.options.get("decoders", e), this.browser.supportsMediaSource, this.options.get("drm"));
11257
11262
  }
11258
11263
  willUseMediaSource() {
11259
11264
  return this.resolvedDecoder() === "mse";
@@ -11272,6 +11277,6 @@ var uv = class {
11272
11277
  return t === void 0 ? this.shouldUseWebCodecs(e) : t;
11273
11278
  }
11274
11279
  };
11275
- e(Ev, "MAX_POOL_SIZE", 10), e(Ev, "DISCONNECT_TIMEOUT", 15 * 1e3), e(Ev, "REMOVE_CUE_THRESHOLD", 1e3 * 10);
11280
+ e(Dv, "MAX_POOL_SIZE", 10), e(Dv, "DISCONNECT_TIMEOUT", 15 * 1e3), e(Dv, "REMOVE_CUE_THRESHOLD", 1e3 * 10);
11276
11281
  //#endregion
11277
- export { $e as _, ut as a, lt as c, wt as d, St as f, Tt as g, xt as h, mt as i, ft as l, _t as m, O as n, pt as o, bt as p, dt as r, yt as s, Ev as t, gt as u, Qe as v };
11282
+ export { $e as _, ut as a, lt as c, wt as d, St as f, Tt as g, xt as h, mt as i, ft as l, _t as m, O as n, pt as o, bt as p, dt as r, yt as s, Dv as t, gt as u, Qe as v };