@vindral/web-sdk 4.8.0 → 4.8.1-10-gcc2fea9d

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.
@@ -5,7 +5,7 @@ import { i, n as a, r as o, t as s } from "./DSw1XhvD.js";
5
5
  import { a as c, c as l, i as u, l as d, n as f, o as p, r as m, s as h, t as g } from "./D40eQS8l.js";
6
6
  import { a as _, i as v, n as y, o as b, r as ee, t as te } from "./BdMchGeH.js";
7
7
  import { t as x } from "./D1kpe8tT.js";
8
- import { n as S, r as ne, t as re } from "./BaDhuUsA.js";
8
+ import { n as S, r as ne, t as re } from "./Bg5VLlmK.js";
9
9
  import { t as C } from "./Tj9xPXja.js";
10
10
  //#region ../../libs/utils/src/ArrayBufferPool.ts
11
11
  var ie = class {
@@ -4207,53 +4207,53 @@ function Fc(e) {
4207
4207
  //#region ../../libs/moq/src/protocol/wire-format/DataStreamType.ts
4208
4208
  var Ic = /* @__PURE__ */ function(e) {
4209
4209
  return e[e.StreamHeaderGroup = 4] = "StreamHeaderGroup", e[e.FetchHeader = 5] = "FetchHeader", e[e.StreamHeaderTrack = 60] = "StreamHeaderTrack", e;
4210
- }({}), Lc, Rc, zc, Bc, Vc, Hc, Uc, Wc, Gc, V = {
4210
+ }({}), Lc, Rc, zc, Bc, Vc, Hc, Uc, Wc, Gc, Kc = {
4211
4211
  Normal: 0,
4212
4212
  ObjectDoesNotExist: 1,
4213
4213
  GroupDoesNotExist: 2,
4214
4214
  EndOfGroup: 3,
4215
4215
  EndOfTrackAndGroup: 4
4216
4216
  };
4217
- function Kc(e) {
4217
+ function qc(e) {
4218
4218
  switch (e) {
4219
- case V.Normal:
4220
- case V.ObjectDoesNotExist:
4221
- case V.GroupDoesNotExist:
4222
- case V.EndOfGroup:
4223
- case V.EndOfTrackAndGroup: return;
4219
+ case Kc.Normal:
4220
+ case Kc.ObjectDoesNotExist:
4221
+ case Kc.GroupDoesNotExist:
4222
+ case Kc.EndOfGroup:
4223
+ case Kc.EndOfTrackAndGroup: return;
4224
4224
  }
4225
4225
  throw Error(`Unknown object status ${e}`);
4226
4226
  }
4227
- var qc = /* @__PURE__ */ new WeakMap(), Jc = /* @__PURE__ */ new WeakMap(), Yc = /* @__PURE__ */ new WeakMap(), Xc = /* @__PURE__ */ new WeakMap(), Zc = /* @__PURE__ */ new WeakMap(), Qc = /* @__PURE__ */ new WeakMap(), $c = /* @__PURE__ */ new WeakMap(), el = /* @__PURE__ */ new WeakMap(), tl = /* @__PURE__ */ new WeakMap(), nl = /* @__PURE__ */ new WeakMap(), rl = /* @__PURE__ */ new WeakMap(), il = /* @__PURE__ */ new WeakSet();
4227
+ var Jc = /* @__PURE__ */ new WeakMap(), Yc = /* @__PURE__ */ new WeakMap(), Xc = /* @__PURE__ */ new WeakMap(), Zc = /* @__PURE__ */ new WeakMap(), Qc = /* @__PURE__ */ new WeakMap(), $c = /* @__PURE__ */ new WeakMap(), el = /* @__PURE__ */ new WeakMap(), tl = /* @__PURE__ */ new WeakMap(), nl = /* @__PURE__ */ new WeakMap(), rl = /* @__PURE__ */ new WeakMap(), il = /* @__PURE__ */ new WeakMap(), al = /* @__PURE__ */ new WeakSet();
4228
4228
  Lc = Symbol.asyncIterator, Rc = Et(), zc = Symbol.asyncDispose;
4229
- var al = class {
4229
+ var ol = class {
4230
4230
  endStatus() {
4231
- return s(Qc, this).promise;
4231
+ return s($c, this).promise;
4232
4232
  }
4233
4233
  drained() {
4234
4234
  var e;
4235
- return (e = s(tl, this)) == null ? Promise.resolve() : e;
4235
+ return (e = s(nl, this)) == null ? Promise.resolve() : e;
4236
4236
  }
4237
4237
  drainFailed() {
4238
- return s(nl, this).promise;
4238
+ return s(rl, this).promise;
4239
4239
  }
4240
4240
  constructor(e, t, r, o, c, l) {
4241
- C(this, il), i(this, qc, void 0), i(this, Jc, void 0), i(this, Yc, void 0), i(this, Xc, void 0), i(this, Zc, void 0), i(this, Qc, new w()), i(this, $c, 0), i(this, el, void 0), i(this, tl, void 0), i(this, nl, new w()), i(this, rl, S.get().createContext("TrackReaderGroup")), a(qc, this, e), a(Jc, this, t), a(Yc, this, r), a(Xc, this, o), a(Zc, this, c), a(el, this, l), s(nl, this).promise.catch(n);
4241
+ C(this, al), i(this, Jc, void 0), i(this, Yc, void 0), i(this, Xc, void 0), i(this, Zc, void 0), i(this, Qc, void 0), i(this, $c, new w()), i(this, el, 0), i(this, tl, void 0), i(this, nl, void 0), i(this, rl, new w()), i(this, il, S.get().createContext("TrackReaderGroup")), a(Jc, this, e), a(Yc, this, t), a(Xc, this, r), a(Zc, this, o), a(Qc, this, c), a(tl, this, l), s(rl, this).promise.catch(n);
4242
4242
  }
4243
4243
  groupId() {
4244
- return s(Jc, this);
4244
+ return s(Yc, this);
4245
4245
  }
4246
4246
  subscribeId() {
4247
- return s(Yc, this);
4247
+ return s(Xc, this);
4248
4248
  }
4249
4249
  next() {
4250
- return s(tl, this) ? Promise.resolve({
4250
+ return s(nl, this) ? Promise.resolve({
4251
4251
  done: !0,
4252
4252
  value: void 0
4253
- }) : o(il, this, ol).call(this);
4253
+ }) : o(al, this, sl).call(this);
4254
4254
  }
4255
4255
  return() {
4256
- return s(tl, this) || (a(tl, this, o(il, this, sl).call(this)), s(tl, this).catch(n)), Promise.resolve({
4256
+ return s(nl, this) || (a(nl, this, o(al, this, cl).call(this)), s(nl, this).catch(n)), Promise.resolve({
4257
4257
  done: !0,
4258
4258
  value: void 0
4259
4259
  });
@@ -4268,63 +4268,63 @@ var al = class {
4268
4268
  return Promise.resolve();
4269
4269
  }
4270
4270
  };
4271
- function ol() {
4271
+ function sl() {
4272
4272
  var e = this;
4273
4273
  return t(function* () {
4274
4274
  var t;
4275
- if (!s(Qc, e).pending || (yield s(qc, e).isDone())) return {
4275
+ if (!s($c, e).pending || (yield s(Jc, e).isDone())) return {
4276
4276
  done: !0,
4277
4277
  value: void 0
4278
4278
  };
4279
- let n = s($c, e) === 0 ? s(Jc, e) : yield s(qc, e).readBigVarInt(), r = yield s(qc, e).readBigVarInt(), i = yield s(qc, e).readVarInt(), o = 0, c = new Uint8Array();
4280
- return i > 0 ? c = yield s(qc, e).read(i) : o = yield s(qc, e).readVarInt(), Kc(o), (o === V.EndOfTrackAndGroup || o === V.EndOfGroup) && s(Qc, e).resolve(o), a($c, e, (t = s($c, e), t++, t)), {
4279
+ let n = s(el, e) === 0 ? s(Yc, e) : yield s(Jc, e).readBigVarInt(), r = yield s(Jc, e).readBigVarInt(), i = yield s(Jc, e).readVarInt(), o = 0, c = new Uint8Array();
4280
+ return i > 0 ? c = yield s(Jc, e).read(i) : o = yield s(Jc, e).readVarInt(), qc(o), (o === Kc.EndOfTrackAndGroup || o === Kc.EndOfGroup) && s($c, e).resolve(o), a(el, e, (t = s(el, e), t++, t)), {
4281
4281
  done: !1,
4282
4282
  value: {
4283
- subscribeId: s(Yc, e),
4284
- trackAlias: s(Xc, e),
4283
+ subscribeId: s(Xc, e),
4284
+ trackAlias: s(Zc, e),
4285
4285
  groupId: n,
4286
4286
  subGroupId: E(0),
4287
4287
  objectId: r,
4288
- subscriberPriority: s(Zc, e),
4289
- streamId: s(el, e),
4288
+ subscriberPriority: s(Qc, e),
4289
+ streamId: s(tl, e),
4290
4290
  objectStatus: o,
4291
4291
  payload: c
4292
4292
  }
4293
4293
  };
4294
4294
  })();
4295
4295
  }
4296
- function sl() {
4296
+ function cl() {
4297
4297
  var e = this;
4298
4298
  return t(function* () {
4299
4299
  try {
4300
- for (; !(yield o(il, e, ol).call(e)).done;);
4300
+ for (; !(yield o(al, e, sl).call(e)).done;);
4301
4301
  } catch (t) {
4302
- throw s(rl, e).debug("Stopped draining group", {
4303
- groupId: s(Jc, e),
4302
+ throw s(il, e).debug("Stopped draining group", {
4303
+ groupId: s(Yc, e),
4304
4304
  error: t
4305
- }), s(nl, e).reject(t instanceof Error ? t : Error(String(t))), t;
4305
+ }), s(rl, e).reject(t instanceof Error ? t : Error(String(t))), t;
4306
4306
  }
4307
4307
  })();
4308
4308
  }
4309
- var cl = /* @__PURE__ */ new WeakMap(), ll = /* @__PURE__ */ new WeakMap(), ul = /* @__PURE__ */ new WeakMap(), dl = /* @__PURE__ */ new WeakMap(), fl = /* @__PURE__ */ new WeakMap(), pl = /* @__PURE__ */ new WeakSet();
4309
+ var ll = /* @__PURE__ */ new WeakMap(), ul = /* @__PURE__ */ new WeakMap(), dl = /* @__PURE__ */ new WeakMap(), fl = /* @__PURE__ */ new WeakMap(), pl = /* @__PURE__ */ new WeakMap(), ml = /* @__PURE__ */ new WeakSet();
4310
4310
  Bc = Symbol.asyncIterator, Vc = Et(), Hc = Symbol.asyncDispose;
4311
- var ml = class {
4311
+ var hl = class {
4312
4312
  constructor(e, t, n, r, o) {
4313
- C(this, pl), i(this, cl, void 0), i(this, ll, void 0), i(this, ul, void 0), i(this, dl, void 0), i(this, fl, void 0), a(cl, this, e), a(ll, this, t), a(ul, this, n), a(dl, this, r), a(fl, this, o);
4313
+ C(this, ml), i(this, ll, void 0), i(this, ul, void 0), i(this, dl, void 0), i(this, fl, void 0), i(this, pl, void 0), a(ll, this, e), a(ul, this, t), a(dl, this, n), a(fl, this, r), a(pl, this, o);
4314
4314
  }
4315
4315
  streamId() {
4316
- return s(fl, this);
4316
+ return s(pl, this);
4317
4317
  }
4318
4318
  groups() {
4319
- return o(pl, this, hl).call(this);
4319
+ return o(ml, this, gl).call(this);
4320
4320
  }
4321
4321
  subscribeId() {
4322
- return s(ll, this);
4322
+ return s(ul, this);
4323
4323
  }
4324
4324
  return() {
4325
4325
  var e = this;
4326
4326
  return t(function* () {
4327
- return yield s(cl, e).close(), {
4327
+ return yield s(ll, e).close(), {
4328
4328
  done: !0,
4329
4329
  value: void 0
4330
4330
  };
@@ -4334,63 +4334,63 @@ var ml = class {
4334
4334
  return this;
4335
4335
  }
4336
4336
  [Vc]() {
4337
- return o(pl, this, gl).call(this);
4337
+ return o(ml, this, _l).call(this);
4338
4338
  }
4339
4339
  [Hc]() {
4340
- return o(pl, this, gl).call(this);
4340
+ return o(ml, this, _l).call(this);
4341
4341
  }
4342
4342
  };
4343
- function hl() {
4343
+ function gl() {
4344
4344
  var e = this;
4345
4345
  return Lt(function* () {
4346
- for (; !(yield O(s(cl, e).isDone()));) {
4347
- let t = yield O(s(cl, e).readBigVarInt()), n = new al(s(cl, e), t, s(ll, e), s(ul, e), s(dl, e), s(fl, e));
4346
+ for (; !(yield O(s(ll, e).isDone()));) {
4347
+ let t = yield O(s(ll, e).readBigVarInt()), n = new ol(s(ll, e), t, s(ul, e), s(dl, e), s(fl, e), s(pl, e));
4348
4348
  yield n;
4349
4349
  let r = yield O(Promise.race([
4350
4350
  n.endStatus(),
4351
- s(cl, e).closed(),
4351
+ s(ll, e).closed(),
4352
4352
  n.drainFailed()
4353
4353
  ]));
4354
- if (yield O(n.drained()), r === V.EndOfTrackAndGroup) return;
4354
+ if (yield O(n.drained()), r === Kc.EndOfTrackAndGroup) return;
4355
4355
  }
4356
4356
  })();
4357
4357
  }
4358
- function gl() {
4359
- return s(cl, this).close().catch(() => {});
4358
+ function _l() {
4359
+ return s(ll, this).close().catch(() => {});
4360
4360
  }
4361
- var _l = /* @__PURE__ */ new WeakMap(), vl = /* @__PURE__ */ new WeakMap(), yl = /* @__PURE__ */ new WeakMap(), bl = /* @__PURE__ */ new WeakMap(), xl = /* @__PURE__ */ new WeakMap(), Sl = /* @__PURE__ */ new WeakMap(), Cl = /* @__PURE__ */ new WeakMap(), wl = /* @__PURE__ */ new WeakMap(), Tl = /* @__PURE__ */ new WeakMap(), El = /* @__PURE__ */ new WeakSet();
4361
+ var vl = /* @__PURE__ */ new WeakMap(), yl = /* @__PURE__ */ new WeakMap(), bl = /* @__PURE__ */ new WeakMap(), xl = /* @__PURE__ */ new WeakMap(), Sl = /* @__PURE__ */ new WeakMap(), Cl = /* @__PURE__ */ new WeakMap(), wl = /* @__PURE__ */ new WeakMap(), Tl = /* @__PURE__ */ new WeakMap(), El = /* @__PURE__ */ new WeakMap(), Dl = /* @__PURE__ */ new WeakSet();
4362
4362
  Uc = Symbol.asyncIterator, Wc = Et(), Gc = Symbol.asyncDispose;
4363
- var Dl = class {
4363
+ var Ol = class {
4364
4364
  constructor(e, t, n, r, o, s, c) {
4365
- C(this, El), i(this, _l, void 0), i(this, vl, void 0), i(this, yl, void 0), i(this, bl, void 0), i(this, xl, void 0), i(this, Sl, void 0), i(this, Cl, !1), i(this, wl, void 0), i(this, Tl, S.get().createContext("GroupReader")), a(_l, this, e), a(vl, this, t), a(yl, this, n), a(bl, this, r), a(xl, this, o), a(Sl, this, s), a(wl, this, c);
4365
+ C(this, Dl), i(this, vl, void 0), i(this, yl, void 0), i(this, bl, void 0), i(this, xl, void 0), i(this, Sl, void 0), i(this, Cl, void 0), i(this, wl, !1), i(this, Tl, void 0), i(this, El, S.get().createContext("GroupReader")), a(vl, this, e), a(yl, this, t), a(bl, this, n), a(xl, this, r), a(Sl, this, o), a(Cl, this, s), a(Tl, this, c);
4366
4366
  }
4367
4367
  streamId() {
4368
- return s(wl, this);
4368
+ return s(Tl, this);
4369
4369
  }
4370
4370
  groupId() {
4371
- return s(bl, this);
4371
+ return s(xl, this);
4372
4372
  }
4373
4373
  subscribeId() {
4374
- return s(vl, this);
4374
+ return s(yl, this);
4375
4375
  }
4376
4376
  next() {
4377
4377
  var e = this;
4378
4378
  return t(function* () {
4379
4379
  try {
4380
- if ((yield s(_l, e).isDone()) || s(Cl, e)) return {
4380
+ if ((yield s(vl, e).isDone()) || s(wl, e)) return {
4381
4381
  done: !0,
4382
4382
  value: void 0
4383
4383
  };
4384
- let t = yield s(_l, e).readBigVarInt(), n = yield s(_l, e).readVarInt(), r = 0, i = new Uint8Array();
4385
- return n > 0 ? i = yield s(_l, e).read(n) : r = yield s(_l, e).readVarInt(), Kc(r), r === V.EndOfGroup && a(Cl, e, !0), {
4384
+ let t = yield s(vl, e).readBigVarInt(), n = yield s(vl, e).readVarInt(), r = 0, i = new Uint8Array();
4385
+ return n > 0 ? i = yield s(vl, e).read(n) : r = yield s(vl, e).readVarInt(), qc(r), r === Kc.EndOfGroup && a(wl, e, !0), {
4386
4386
  done: !1,
4387
4387
  value: {
4388
- subscribeId: s(vl, e),
4389
- trackAlias: s(yl, e),
4390
- groupId: s(bl, e),
4391
- subGroupId: s(xl, e),
4392
- subscriberPriority: s(Sl, e),
4393
- streamId: s(wl, e),
4388
+ subscribeId: s(yl, e),
4389
+ trackAlias: s(bl, e),
4390
+ groupId: s(xl, e),
4391
+ subGroupId: s(Sl, e),
4392
+ subscriberPriority: s(Cl, e),
4393
+ streamId: s(Tl, e),
4394
4394
  objectId: t,
4395
4395
  objectStatus: r,
4396
4396
  payload: i
@@ -4398,7 +4398,7 @@ var Dl = class {
4398
4398
  };
4399
4399
  } catch (r) {
4400
4400
  var t, n;
4401
- return (Fc(r) ? s(Tl, e).debug : s(Tl, e).warn)("Error reading object", {
4401
+ return (Fc(r) ? s(El, e).debug : s(El, e).warn)("Error reading object", {
4402
4402
  error: r,
4403
4403
  streamErrorCode: (t = (n = Pc(r)) == null ? void 0 : n.streamErrorCode) == null ? void 0 : t
4404
4404
  }), {
@@ -4411,59 +4411,59 @@ var Dl = class {
4411
4411
  return() {
4412
4412
  var e = this;
4413
4413
  return t(function* () {
4414
- return yield s(_l, e).close().catch(() => {}), {
4414
+ return yield s(vl, e).close().catch(() => {}), {
4415
4415
  done: !0,
4416
4416
  value: void 0
4417
4417
  };
4418
4418
  })();
4419
4419
  }
4420
4420
  groups() {
4421
- return o(El, this, Ol).call(this);
4421
+ return o(Dl, this, kl).call(this);
4422
4422
  }
4423
4423
  [Uc]() {
4424
4424
  return this;
4425
4425
  }
4426
4426
  [Wc]() {
4427
- return o(El, this, kl).call(this);
4427
+ return o(Dl, this, Al).call(this);
4428
4428
  }
4429
4429
  [Gc]() {
4430
- return o(El, this, kl).call(this);
4430
+ return o(Dl, this, Al).call(this);
4431
4431
  }
4432
4432
  };
4433
- function Ol() {
4433
+ function kl() {
4434
4434
  var e = this;
4435
4435
  return Lt(function* () {
4436
4436
  yield e;
4437
4437
  })();
4438
4438
  }
4439
- function kl() {
4440
- return s(_l, this).close().catch(() => {});
4439
+ function Al() {
4440
+ return s(vl, this).close().catch(() => {});
4441
4441
  }
4442
- function Al(e, t) {
4443
- return jl.apply(this, arguments);
4442
+ function jl(e, t) {
4443
+ return Ml.apply(this, arguments);
4444
4444
  }
4445
- function jl() {
4446
- return jl = t(function* (e, t) {
4445
+ function Ml() {
4446
+ return Ml = t(function* (e, t) {
4447
4447
  let n = yield e.readVarInt();
4448
4448
  switch (n) {
4449
- case Ic.StreamHeaderGroup: return new Dl(e, yield e.readBigVarInt(), yield e.readBigVarInt(), yield e.readBigVarInt(), yield e.readBigVarInt(), yield e.readUnsigned8(), t);
4450
- case Ic.StreamHeaderTrack: return new ml(e, yield e.readBigVarInt(), yield e.readBigVarInt(), yield e.readUnsigned8(), t);
4449
+ case Ic.StreamHeaderGroup: return new Ol(e, yield e.readBigVarInt(), yield e.readBigVarInt(), yield e.readBigVarInt(), yield e.readBigVarInt(), yield e.readUnsigned8(), t);
4450
+ case Ic.StreamHeaderTrack: return new hl(e, yield e.readBigVarInt(), yield e.readBigVarInt(), yield e.readUnsigned8(), t);
4451
4451
  default: throw Error(`Unexpected message type ${n}`);
4452
4452
  }
4453
- }), jl.apply(this, arguments);
4453
+ }), Ml.apply(this, arguments);
4454
4454
  }
4455
4455
  //#endregion
4456
4456
  //#region \0@oxc-project+runtime@0.115.0/helpers/asyncIterator.js
4457
- function H(e) {
4457
+ function V(e) {
4458
4458
  var t, n, r, i = 2;
4459
4459
  for (typeof Symbol < "u" && (n = Symbol.asyncIterator, r = Symbol.iterator); i--;) {
4460
4460
  if (n && (t = e[n]) != null) return t.call(e);
4461
- if (r && (t = e[r]) != null) return new Ml(t.call(e));
4461
+ if (r && (t = e[r]) != null) return new Nl(t.call(e));
4462
4462
  n = "@@asyncIterator", r = "@@iterator";
4463
4463
  }
4464
4464
  throw TypeError("Object is not async iterable");
4465
4465
  }
4466
- function Ml(e) {
4466
+ function Nl(e) {
4467
4467
  function t(e) {
4468
4468
  if (Object(e) !== e) return Promise.reject(/* @__PURE__ */ TypeError(e + " is not an object."));
4469
4469
  var t = e.done;
@@ -4474,9 +4474,9 @@ function Ml(e) {
4474
4474
  };
4475
4475
  });
4476
4476
  }
4477
- return Ml = function(e) {
4477
+ return Nl = function(e) {
4478
4478
  this.s = e, this.n = e.next;
4479
- }, Ml.prototype = {
4479
+ }, Nl.prototype = {
4480
4480
  s: null,
4481
4481
  n: null,
4482
4482
  next: function() {
@@ -4493,31 +4493,31 @@ function Ml(e) {
4493
4493
  var n = this.s.return;
4494
4494
  return n === void 0 ? Promise.reject(e) : t(n.apply(this.s, arguments));
4495
4495
  }
4496
- }, new Ml(e);
4496
+ }, new Nl(e);
4497
4497
  }
4498
4498
  //#endregion
4499
4499
  //#region ../../libs/moq/src/transport/WebSocketSource.ts
4500
- var Nl = /* @__PURE__ */ new WeakMap(), Pl = /* @__PURE__ */ new WeakMap(), Fl = class {
4500
+ var Pl = /* @__PURE__ */ new WeakMap(), Fl = /* @__PURE__ */ new WeakMap(), Il = class {
4501
4501
  constructor(e, t) {
4502
- i(this, Nl, void 0), i(this, Pl, void 0), a(Nl, this, e), a(Pl, this, t);
4502
+ i(this, Pl, void 0), i(this, Fl, void 0), a(Pl, this, e), a(Fl, this, t);
4503
4503
  }
4504
4504
  start(e) {
4505
- s(Nl, this).addEventListener("message", (t) => {
4505
+ s(Pl, this).addEventListener("message", (t) => {
4506
4506
  if (typeof t.data == "object" && t.data instanceof ArrayBuffer) {
4507
4507
  let n = new Uint8Array(t.data);
4508
- n[0] === s(Pl, this) && e.enqueue(n.subarray(1));
4508
+ n[0] === s(Fl, this) && e.enqueue(n.subarray(1));
4509
4509
  }
4510
- }), s(Nl, this).addEventListener("error", () => e.error(/* @__PURE__ */ Error("WebSocket error"))), s(Nl, this).addEventListener("close", () => an(() => e.close()));
4510
+ }), s(Pl, this).addEventListener("error", () => e.error(/* @__PURE__ */ Error("WebSocket error"))), s(Pl, this).addEventListener("close", () => an(() => e.close()));
4511
4511
  }
4512
4512
  cancel(e) {
4513
- s(Nl, this).close(void 0, e);
4513
+ s(Pl, this).close(void 0, e);
4514
4514
  }
4515
- }, Il = /* @__PURE__ */ new WeakMap(), Ll = /* @__PURE__ */ new WeakMap(), Rl = /* @__PURE__ */ new WeakMap(), zl = /* @__PURE__ */ new WeakMap(), Bl = class {
4515
+ }, Ll = /* @__PURE__ */ new WeakMap(), Rl = /* @__PURE__ */ new WeakMap(), zl = /* @__PURE__ */ new WeakMap(), Bl = /* @__PURE__ */ new WeakMap(), Vl = class {
4516
4516
  constructor(e) {
4517
- i(this, Il, void 0), i(this, Ll, null), i(this, Rl, null), i(this, zl, null), a(Il, this, e);
4517
+ i(this, Ll, void 0), i(this, Rl, null), i(this, zl, null), i(this, Bl, null), a(Ll, this, e);
4518
4518
  }
4519
4519
  start(e) {
4520
- a(Ll, this, (t) => {
4520
+ a(Rl, this, (t) => {
4521
4521
  if (typeof t.data == "object" && t.data instanceof ArrayBuffer) {
4522
4522
  let n = new Uint8Array(t.data), r = n[0] || 0, i = r & 127, a = (r >> 7 & 1) > 0;
4523
4523
  if (i && i !== 0) {
@@ -4529,29 +4529,29 @@ var Nl = /* @__PURE__ */ new WeakMap(), Pl = /* @__PURE__ */ new WeakMap(), Fl =
4529
4529
  ]);
4530
4530
  }
4531
4531
  }
4532
- }), a(Rl, this, () => an(() => e.close())), a(zl, this, () => e.error(/* @__PURE__ */ Error("WebSocket error"))), s(Il, this).addEventListener("message", s(Ll, this)), s(Il, this).addEventListener("error", s(zl, this)), s(Il, this).addEventListener("close", s(Rl, this));
4532
+ }), a(zl, this, () => an(() => e.close())), a(Bl, this, () => e.error(/* @__PURE__ */ Error("WebSocket error"))), s(Ll, this).addEventListener("message", s(Rl, this)), s(Ll, this).addEventListener("error", s(Bl, this)), s(Ll, this).addEventListener("close", s(zl, this));
4533
4533
  }
4534
4534
  cancel(e) {
4535
- s(Ll, this) && s(Il, this).removeEventListener("message", s(Ll, this)), s(zl, this) && s(Il, this).removeEventListener("error", s(zl, this)), s(Rl, this) && s(Il, this).removeEventListener("close", s(Rl, this));
4535
+ s(Rl, this) && s(Ll, this).removeEventListener("message", s(Rl, this)), s(Bl, this) && s(Ll, this).removeEventListener("error", s(Bl, this)), s(zl, this) && s(Ll, this).removeEventListener("close", s(zl, this));
4536
4536
  }
4537
4537
  };
4538
4538
  //#endregion
4539
4539
  //#region ../../libs/moq/src/protocol/BufferReader.ts
4540
- function Vl(e, t) {
4540
+ function Hl(e, t) {
4541
4541
  return e[t] << 8 | e[t + 1];
4542
4542
  }
4543
- function Hl(e, t) {
4543
+ function Ul(e, t) {
4544
4544
  return (e[t] << 24 | e[t + 1] << 16 | e[t + 2] << 8 | e[t + 3]) >>> 0;
4545
4545
  }
4546
- var Ul = /* @__PURE__ */ new WeakMap(), Wl = /* @__PURE__ */ new WeakMap(), U = /* @__PURE__ */ new WeakMap(), Gl = /* @__PURE__ */ new WeakMap(), Kl = /* @__PURE__ */ new WeakMap(), W = /* @__PURE__ */ new WeakSet(), ql = class {
4546
+ var H = /* @__PURE__ */ new WeakMap(), Wl = /* @__PURE__ */ new WeakMap(), U = /* @__PURE__ */ new WeakMap(), Gl = /* @__PURE__ */ new WeakMap(), Kl = /* @__PURE__ */ new WeakMap(), W = /* @__PURE__ */ new WeakSet(), ql = class {
4547
4547
  constructor(e, t, n) {
4548
- C(this, W), i(this, Ul, void 0), i(this, Wl, void 0), i(this, U, 0), i(this, Gl, new TextDecoder()), i(this, Kl, void 0), a(Ul, this, e), a(Wl, this, t.getReader()), a(Kl, this, n);
4548
+ C(this, W), i(this, H, void 0), i(this, Wl, void 0), i(this, U, 0), i(this, Gl, new TextDecoder()), i(this, Kl, void 0), a(H, this, e), a(Wl, this, t.getReader()), a(Kl, this, n);
4549
4549
  }
4550
4550
  readUnsigned8() {
4551
4551
  var e = this;
4552
4552
  return t(function* () {
4553
4553
  var t, n;
4554
- return yield o(W, e, Xl).call(e, 1), s(Ul, e)[a(U, e, (t = s(U, e), n = t++, t)), n];
4554
+ return yield o(W, e, Xl).call(e, 1), s(H, e)[a(U, e, (t = s(U, e), n = t++, t)), n];
4555
4555
  })();
4556
4556
  }
4557
4557
  readString() {
@@ -4573,26 +4573,26 @@ var Ul = /* @__PURE__ */ new WeakMap(), Wl = /* @__PURE__ */ new WeakMap(), U =
4573
4573
  var e = this;
4574
4574
  return t(function* () {
4575
4575
  yield o(W, e, Xl).call(e, 1);
4576
- let t = s(Ul, e)[s(U, e)], n = (t & 192) >> 6;
4577
- switch (s(Ul, e)[s(U, e)] = t & 63, n) {
4576
+ let t = s(H, e)[s(U, e)], n = (t & 192) >> 6;
4577
+ switch (s(H, e)[s(U, e)] = t & 63, n) {
4578
4578
  case 0:
4579
4579
  var r, i;
4580
- return E(s(Ul, e)[a(U, e, (r = s(U, e), i = r++, r)), i]);
4580
+ return E(s(H, e)[a(U, e, (r = s(U, e), i = r++, r)), i]);
4581
4581
  case 1: {
4582
4582
  yield o(W, e, Xl).call(e, 2);
4583
4583
  let t = s(U, e);
4584
- return a(U, e, s(U, e) + 2), E(Vl(s(Ul, e), t));
4584
+ return a(U, e, s(U, e) + 2), E(Hl(s(H, e), t));
4585
4585
  }
4586
4586
  case 2: {
4587
4587
  yield o(W, e, Xl).call(e, 4);
4588
4588
  let t = s(U, e);
4589
- return a(U, e, s(U, e) + 4), E(Hl(s(Ul, e), t));
4589
+ return a(U, e, s(U, e) + 4), E(Ul(s(H, e), t));
4590
4590
  }
4591
4591
  case 3: {
4592
4592
  yield o(W, e, Xl).call(e, 8);
4593
4593
  let t = s(U, e);
4594
4594
  a(U, e, s(U, e) + 8);
4595
- let n = new DataView(s(Ul, e).buffer, s(Ul, e).byteOffset + t, 8);
4595
+ let n = new DataView(s(H, e).buffer, s(H, e).byteOffset + t, 8);
4596
4596
  return E(_e ? n.getBigUint64(0) : n.getUint32(0) * 4294967296 + n.getUint32(4));
4597
4597
  }
4598
4598
  default: throw Error("Invalid VarInt size");
@@ -4632,7 +4632,7 @@ var Ul = /* @__PURE__ */ new WeakMap(), Wl = /* @__PURE__ */ new WeakMap(), U =
4632
4632
  }
4633
4633
  };
4634
4634
  function Jl() {
4635
- return s(Ul, this).length - s(U, this);
4635
+ return s(H, this).length - s(U, this);
4636
4636
  }
4637
4637
  function Yl() {
4638
4638
  var e = this;
@@ -4640,10 +4640,10 @@ function Yl() {
4640
4640
  var t;
4641
4641
  let { value: n, done: r } = yield s(Wl, e).read();
4642
4642
  if (r) return Promise.resolve(0);
4643
- if ((t = s(Kl, e)) == null || t.call(e), o(W, e, Jl).call(e) === 0) a(Ul, e, n);
4643
+ if ((t = s(Kl, e)) == null || t.call(e), o(W, e, Jl).call(e) === 0) a(H, e, n);
4644
4644
  else {
4645
- let t = s(Ul, e).subarray(s(U, e)), r = new Uint8Array(t.length + n.length);
4646
- r.set(t), r.set(n, t.byteLength), a(Ul, e, r);
4645
+ let t = s(H, e).subarray(s(U, e)), r = new Uint8Array(t.length + n.length);
4646
+ r.set(t), r.set(n, t.byteLength), a(H, e, r);
4647
4647
  }
4648
4648
  return a(U, e, 0), Promise.resolve(n.length);
4649
4649
  })();
@@ -4655,7 +4655,7 @@ function Xl(e) {
4655
4655
  })();
4656
4656
  }
4657
4657
  function Zl(e) {
4658
- return s(Ul, this).subarray(s(U, this), s(U, this) + e);
4658
+ return s(H, this).subarray(s(U, this), s(U, this) + e);
4659
4659
  }
4660
4660
  function Ql(e) {
4661
4661
  let t = o(W, this, Zl).call(this, e);
@@ -5440,7 +5440,7 @@ var q = /* @__PURE__ */ new WeakMap(), rf = class {
5440
5440
  return s(of, this).cancel();
5441
5441
  }
5442
5442
  static wrapWebsocket(t) {
5443
- let n = new ReadableStream(new Fl(t, ff._)), r = new rf(new ql(new Uint8Array([]), n));
5443
+ let n = new ReadableStream(new Il(t, ff._)), r = new rf(new ql(new Uint8Array([]), n));
5444
5444
  return new e(new Zd(new mu(t), new Uint8Array([0])), r);
5445
5445
  }
5446
5446
  static wrapWebTransport(t) {
@@ -5634,7 +5634,7 @@ function Gf() {
5634
5634
  return t(function* () {
5635
5635
  var t = !1, n = !1, r;
5636
5636
  try {
5637
- for (var i = H(s(Ff, e).iterate(s(Hf, e).signal)), o; t = !(o = yield i.next()).done; t = !1) {
5637
+ for (var i = V(s(Ff, e).iterate(s(Hf, e).signal)), o; t = !(o = yield i.next()).done; t = !1) {
5638
5638
  let t = o.value;
5639
5639
  {
5640
5640
  let n = s(If, e).range();
@@ -5676,7 +5676,7 @@ var Zf = class {
5676
5676
  s(Xf, e).debug("write group");
5677
5677
  var t = !1, n = !1, r;
5678
5678
  try {
5679
- for (var i = H(s(qf, e)), o; t = !(o = yield i.next()).done; t = !1) {
5679
+ for (var i = V(s(qf, e)), o; t = !(o = yield i.next()).done; t = !1) {
5680
5680
  let t = o.value;
5681
5681
  yield s(Kf, e).write({
5682
5682
  subscribeId: s(Jf, e).subscribe.id,
@@ -6117,11 +6117,11 @@ var Up = class {
6117
6117
  return Lt(function* () {
6118
6118
  var t = !1, n = !1, r;
6119
6119
  try {
6120
- for (var i = H(e.groups()), a; t = !(a = yield O(i.next())).done; t = !1) {
6120
+ for (var i = V(e.groups()), a; t = !(a = yield O(i.next())).done; t = !1) {
6121
6121
  let e = a.value;
6122
6122
  var o = !1, s = !1, c;
6123
6123
  try {
6124
- for (var l = H(e), u; o = !(u = yield O(l.next())).done; o = !1) yield u.value;
6124
+ for (var l = V(e), u; o = !(u = yield O(l.next())).done; o = !1) yield u.value;
6125
6125
  } catch (e) {
6126
6126
  s = !0, c = e;
6127
6127
  } finally {
@@ -6171,7 +6171,7 @@ function Kp() {
6171
6171
  let t = !1;
6172
6172
  var r = !1, i = !1, c;
6173
6173
  try {
6174
- readers: for (var l = H(s(Fp, e)), u; r = !(u = yield O(l.next())).done; r = !1) try {
6174
+ readers: for (var l = V(s(Fp, e)), u; r = !(u = yield O(l.next())).done; r = !1) try {
6175
6175
  var d = hp();
6176
6176
  let r = d.a(u.value);
6177
6177
  {
@@ -6325,7 +6325,7 @@ function nm() {
6325
6325
  return t(function* () {
6326
6326
  var t = !1, n = !1, r;
6327
6327
  try {
6328
- for (var i = H(s(Zp, e)), a; t = !(a = yield i.next()).done; t = !1) {
6328
+ for (var i = V(s(Zp, e)), a; t = !(a = yield i.next()).done; t = !1) {
6329
6329
  let t = a.value;
6330
6330
  {
6331
6331
  let n = [...t.values()].map((e) => e.state.subscribe);
@@ -6427,7 +6427,7 @@ function vm() {
6427
6427
  try {
6428
6428
  var t = !1, n = !1, r;
6429
6429
  try {
6430
- for (var i = H(s(lm, e)), a; t = !(a = yield i.next()).done; t = !1) {
6430
+ for (var i = V(s(lm, e)), a; t = !(a = yield i.next()).done; t = !1) {
6431
6431
  let t = a.value;
6432
6432
  s(um, e).debug("sending message", t), yield s(om, e).writeMessage(t);
6433
6433
  }
@@ -6544,7 +6544,7 @@ function jm(e = !0) {
6544
6544
  //#region ../../libs/moq/src/transport/WebSocketConnection.ts
6545
6545
  var Mm = /* @__PURE__ */ new WeakMap(), Nm = /* @__PURE__ */ new WeakMap(), Pm = /* @__PURE__ */ new WeakMap(), Fm = /* @__PURE__ */ new WeakMap(), Im = /* @__PURE__ */ new WeakMap(), Lm = /* @__PURE__ */ new WeakMap(), Rm = /* @__PURE__ */ new WeakMap(), zm = /* @__PURE__ */ new WeakMap(), Bm = /* @__PURE__ */ new WeakMap(), Vm = /* @__PURE__ */ new WeakSet(), Hm = class {
6546
6546
  constructor(e, t) {
6547
- C(this, Vm), i(this, Mm, void 0), i(this, Nm, void 0), i(this, Pm, void 0), i(this, Fm, void 0), i(this, Im, /* @__PURE__ */ new Map()), i(this, Lm, /* @__PURE__ */ new Set()), i(this, Rm, S.get().createContext("WebSocketConnection")), i(this, zm, performance.now()), i(this, Bm, new Set(Array(127).fill(0).map((e, t) => t + 1))), a(Mm, this, e), a(Nm, this, t), a(Pm, this, new ReadableStream(new Bl(e))), s(Mm, this).addEventListener("message", () => {
6547
+ C(this, Vm), i(this, Mm, void 0), i(this, Nm, void 0), i(this, Pm, void 0), i(this, Fm, void 0), i(this, Im, /* @__PURE__ */ new Map()), i(this, Lm, /* @__PURE__ */ new Set()), i(this, Rm, S.get().createContext("WebSocketConnection")), i(this, zm, performance.now()), i(this, Bm, new Set(Array(127).fill(0).map((e, t) => t + 1))), a(Mm, this, e), a(Nm, this, t), a(Pm, this, new ReadableStream(new Vl(e))), s(Mm, this).addEventListener("message", () => {
6548
6548
  a(zm, this, performance.now());
6549
6549
  }), s(Mm, this).addEventListener("close", (e) => {
6550
6550
  s(Rm, this).info("WebSocket closed", {
@@ -6599,7 +6599,7 @@ var Mm = /* @__PURE__ */ new WeakMap(), Nm = /* @__PURE__ */ new WeakMap(), Pm =
6599
6599
  },
6600
6600
  cancel: () => o(Vm, e, Wm).call(e, l, n, r)
6601
6601
  });
6602
- if (s(Im, e).set(l, n), i || (s(Rm, e).debug("Closing new stream", { streamId: a }), s(Im, e).delete(l), yield u.cancel()), c.length > 0) return yield Al(new ql(c, u), a);
6602
+ if (s(Im, e).set(l, n), i || (s(Rm, e).debug("Closing new stream", { streamId: a }), s(Im, e).delete(l), yield u.cancel()), c.length > 0) return yield jl(new ql(c, u), a);
6603
6603
  }
6604
6604
  } finally {
6605
6605
  var n;
@@ -6746,7 +6746,7 @@ function ch() {
6746
6746
  streamId: d,
6747
6747
  acceptedAt: performance.now()
6748
6748
  };
6749
- s(Zm, e).push(f), Al(u, d).then((t) => {
6749
+ s(Zm, e).push(f), jl(u, d).then((t) => {
6750
6750
  f.groups = t, o(oh, e, uh).call(e);
6751
6751
  }, (t) => {
6752
6752
  let n = s(Zm, e).indexOf(f);
@@ -7077,14 +7077,14 @@ function Xh() {
7077
7077
  }
7078
7078
  function Zh(e, t) {
7079
7079
  var n;
7080
- let r = s(Lh, this), i = {
7081
- startGroup: r && r.startGroup > (e == null ? 0n : e) ? r.startGroup : e == null ? 0n : e,
7080
+ let r = s(Lh, this), i = e == null ? E(0) : e, c = {
7081
+ startGroup: r && r.startGroup > i ? r.startGroup : i,
7082
7082
  endGroup: r && r.endGroup < t ? r.endGroup : t
7083
7083
  };
7084
- a(Lh, this, i);
7084
+ a(Lh, this, c);
7085
7085
  for (let e of (n = s(Fh, this)) == null ? [] : n) if (!o(Y, this, Qh).call(this, e)) {
7086
- var c;
7087
- (c = s(Fh, this)) == null || c.delete(e);
7086
+ var l;
7087
+ (l = s(Fh, this)) == null || l.delete(e);
7088
7088
  }
7089
7089
  o(Y, this, qh).call(this, !1);
7090
7090
  }
@@ -7321,9 +7321,9 @@ var mg = class e {
7321
7321
  return Lt(function* () {
7322
7322
  var t = !1, n = !1, r;
7323
7323
  try {
7324
- for (var i = H(e), a; t = !(a = yield O(i.next())).done; t = !1) try {
7324
+ for (var i = V(e), a; t = !(a = yield O(i.next())).done; t = !1) try {
7325
7325
  var o = hp();
7326
- yield* og(H(o.a(a.value)));
7326
+ yield* og(V(o.a(a.value)));
7327
7327
  } catch (e) {
7328
7328
  o.e = e;
7329
7329
  } finally {
@@ -7399,10 +7399,10 @@ function wg() {
7399
7399
  let t = yield s(bg, e).promise;
7400
7400
  var n = !1, r = !1, i;
7401
7401
  try {
7402
- for (var a = H(t), o; n = !(o = yield a.next()).done; n = !1) {
7402
+ for (var a = V(t), o; n = !(o = yield a.next()).done; n = !1) {
7403
7403
  let t = o.value;
7404
7404
  {
7405
- if (t.objectStatus !== V.Normal) continue;
7405
+ if (t.objectStatus !== Kc.Normal) continue;
7406
7406
  let n = _g(t);
7407
7407
  s(vg, e).update(n);
7408
7408
  }
@@ -7475,10 +7475,10 @@ var Yg = class {
7475
7475
  }, l = t.u(new Hg(s(qg, e), c));
7476
7476
  var n = !1, r = !1, i;
7477
7477
  try {
7478
- for (var a = H(s(Gg, e)), o; n = !(o = yield O(a.next())).done; n = !1) {
7478
+ for (var a = V(s(Gg, e)), o; n = !(o = yield O(a.next())).done; n = !1) {
7479
7479
  let t = o.value;
7480
7480
  {
7481
- if (t.objectStatus === V.EndOfTrackAndGroup && (yield O(e.track.endOfTrack(t.groupId))), t.objectStatus !== V.Normal) continue;
7481
+ if (t.objectStatus === Kc.EndOfTrackAndGroup && (yield O(e.track.endOfTrack(t.groupId))), t.objectStatus !== Kc.Normal) continue;
7482
7482
  let n = s(Kg, e).createFragment(t.payload), r = n.timescale(), i = n.baseMediaDecodeTime() / r * 1e3, a = i + n.duration() / r * 1e3, o = s(Wg, e) / 1e3 * r;
7483
7483
  n.updateBaseMediaDecodeTime(n.baseMediaDecodeTime() - o);
7484
7484
  let u = e.track.timestampRange();
@@ -7664,15 +7664,15 @@ function p_(e) {
7664
7664
  let t = yield e.promise;
7665
7665
  var r = !1, i = !1, a;
7666
7666
  try {
7667
- for (var c = H(t), l; r = !(l = yield c.next()).done; r = !1) try {
7667
+ for (var c = V(t), l; r = !(l = yield c.next()).done; r = !1) try {
7668
7668
  var u = hp();
7669
7669
  let e = u.a(l.value);
7670
7670
  var d = !1, f = !1, p;
7671
7671
  try {
7672
- for (var m = H(e), h; d = !(h = yield m.next()).done; d = !1) {
7672
+ for (var m = V(e), h; d = !(h = yield m.next()).done; d = !1) {
7673
7673
  let e = h.value;
7674
7674
  {
7675
- if (e.objectStatus !== V.Normal) continue;
7675
+ if (e.objectStatus !== Kc.Normal) continue;
7676
7676
  let r = h_(e.payload);
7677
7677
  s(o_, n).update((e) => {
7678
7678
  var t, n;
@@ -7770,7 +7770,7 @@ var w_ = class n {
7770
7770
  for (;;) {
7771
7771
  let t = yield s(x_, e).next();
7772
7772
  if (t.done) return t;
7773
- if (t.value.objectStatus !== V.Normal) continue;
7773
+ if (t.value.objectStatus !== Kc.Normal) continue;
7774
7774
  let n = new TextDecoder().decode(t.value.payload), r;
7775
7775
  try {
7776
7776
  r = s(b_, e).parse(n);
@@ -7904,7 +7904,7 @@ function z_(e) {
7904
7904
  return t(function* () {
7905
7905
  var t = !1, r = !1, i;
7906
7906
  try {
7907
- for (var o = H(e.value), s; t = !(s = yield o.next()).done; t = !1) {
7907
+ for (var o = V(e.value), s; t = !(s = yield o.next()).done; t = !1) {
7908
7908
  let e = s.value;
7909
7909
  a(F_, n, {
7910
7910
  createdAt: /* @__PURE__ */ new Date(),
@@ -8021,10 +8021,10 @@ function $_(e, n) {
8021
8021
  return t(function* () {
8022
8022
  var t = !1, i = !1, a;
8023
8023
  try {
8024
- for (var o = H(e), s; t = !(s = yield o.next()).done; t = !1) {
8024
+ for (var o = V(e), s; t = !(s = yield o.next()).done; t = !1) {
8025
8025
  let e = s.value;
8026
8026
  {
8027
- if (e.objectStatus !== V.Normal) continue;
8027
+ if (e.objectStatus !== Kc.Normal) continue;
8028
8028
  let t = performance.now(), i = Y_(e.payload);
8029
8029
  n == null || n(i, t), r.value.update(i);
8030
8030
  }
@@ -8076,7 +8076,7 @@ var cv = class {
8076
8076
  let t = s(sv, e);
8077
8077
  var n = !1, r = !1, i;
8078
8078
  try {
8079
- for (var a = H(s(ov, e)), o; n = !(o = yield O(a.next())).done; n = !1) {
8079
+ for (var a = V(s(ov, e)), o; n = !(o = yield O(a.next())).done; n = !1) {
8080
8080
  let n = o.value;
8081
8081
  {
8082
8082
  if (!n) continue;
@@ -8084,7 +8084,7 @@ var cv = class {
8084
8084
  name: n.trackObject.name,
8085
8085
  namespace: n.namespace
8086
8086
  };
8087
- s(av, e).debug("track start", x({ mediaType: t }, r)), yield* og(H(n)), s(av, e).debug("track end", x({ mediaType: t }, r));
8087
+ s(av, e).debug("track start", x({ mediaType: t }, r)), yield* og(V(n)), s(av, e).debug("track end", x({ mediaType: t }, r));
8088
8088
  }
8089
8089
  }
8090
8090
  } catch (e) {
@@ -8250,11 +8250,11 @@ function wv() {
8250
8250
  return t(function* () {
8251
8251
  var t = !1, n = !1, r;
8252
8252
  try {
8253
- for (var i = H(s(pv, e)), a; t = !(a = yield i.next()).done; t = !1) {
8253
+ for (var i = V(s(pv, e)), a; t = !(a = yield i.next()).done; t = !1) {
8254
8254
  let t = a.value;
8255
8255
  var c = !1, l = !1, u;
8256
8256
  try {
8257
- for (var d = H(t.catalog()), f; c = !(f = yield d.next()).done; c = !1) {
8257
+ for (var d = V(t.catalog()), f; c = !(f = yield d.next()).done; c = !1) {
8258
8258
  let t = f.value;
8259
8259
  yield Promise.all([o(yv, e, Ev).call(e, t, s(hv, e)), o(yv, e, Ev).call(e, t, s(mv, e))]);
8260
8260
  }
@@ -8410,72 +8410,86 @@ function Yv(e) {
8410
8410
  s(Wv, this) !== void 0 && e - s(Wv, this) > Lv && (s(Gv, this) != null || a(Gv, this, e), a(Kv, this, e)), a(Wv, this, e);
8411
8411
  }
8412
8412
  //#endregion
8413
- //#region ../../libs/web-sdk/src/adapters/LinkQueueDelay.ts
8414
- var Xv = 3e5, Zv = 3, Qv = 1e4, $v = 1e3, ey = 250, ty = 200, ny = /* @__PURE__ */ new WeakMap(), ry = /* @__PURE__ */ new WeakMap(), iy = /* @__PURE__ */ new WeakMap(), ay = /* @__PURE__ */ new WeakMap(), oy = /* @__PURE__ */ new WeakMap(), sy = /* @__PURE__ */ new WeakMap(), cy = /* @__PURE__ */ new WeakMap(), ly = /* @__PURE__ */ new WeakMap(), uy = /* @__PURE__ */ new WeakSet(), dy = class {
8413
+ //#region ../../libs/web-sdk/src/adapters/EdgeClock.ts
8414
+ var Xv = /* @__PURE__ */ new WeakMap(), Zv = /* @__PURE__ */ new WeakMap(), Qv = /* @__PURE__ */ new WeakMap(), $v = /* @__PURE__ */ new WeakMap(), ey = class {
8415
+ constructor(e, t = () => performance.timeOrigin + performance.now()) {
8416
+ i(this, Xv, void 0), i(this, Zv, void 0), i(this, Qv, void 0), i(this, $v, 0), a(Xv, this, e), a(Zv, this, t);
8417
+ }
8418
+ sample(e, t) {
8419
+ var n;
8420
+ !Number.isFinite(e) || !Number.isFinite(t) || (a($v, this, (n = s(Xv, this).delayOf(e, t)) == null ? s($v, this) : n), a(Qv, this, {
8421
+ edgeTime: e + s($v, this),
8422
+ localTime: t
8423
+ }));
8424
+ }
8425
+ wallclock() {
8426
+ if (s(Qv, this)) return s(Qv, this).edgeTime + (s(Zv, this).call(this) - s(Qv, this).localTime);
8427
+ }
8428
+ }, ty = 3e5, ny = 3, ry = 1e4, iy = 1e3, ay = 250, oy = 200, sy = /* @__PURE__ */ new WeakMap(), cy = /* @__PURE__ */ new WeakMap(), ly = /* @__PURE__ */ new WeakMap(), uy = /* @__PURE__ */ new WeakMap(), dy = /* @__PURE__ */ new WeakMap(), fy = /* @__PURE__ */ new WeakMap(), py = /* @__PURE__ */ new WeakMap(), my = /* @__PURE__ */ new WeakMap(), hy = /* @__PURE__ */ new WeakSet(), gy = class {
8415
8429
  constructor(e = () => performance.timeOrigin + performance.now()) {
8416
- C(this, uy), i(this, ny, void 0), i(this, ry, []), i(this, iy, 0), i(this, ay, void 0), i(this, oy, void 0), i(this, sy, void 0), i(this, cy, 0), i(this, ly, []), a(ny, this, e);
8430
+ C(this, hy), i(this, sy, void 0), i(this, cy, []), i(this, ly, 0), i(this, uy, void 0), i(this, dy, void 0), i(this, fy, void 0), i(this, py, 0), i(this, my, []), a(sy, this, e);
8417
8431
  }
8418
8432
  sample(e, t) {
8419
8433
  var n;
8420
8434
  if (!Number.isFinite(e) || !Number.isFinite(t)) return;
8421
8435
  let r = t - e;
8422
- if (s(ay, this) !== void 0) {
8436
+ if (s(uy, this) !== void 0) {
8423
8437
  var i, c;
8424
- let t = e - s(ay, this), n = s(ly, this).length >= 2 && r < o(uy, this, fy).call(this) - $v && t > ((i = gy(s(ly, this))) == null ? 0 : i) + $v, l = gy(s(ly, this)), u = l === void 0 ? 0 : l - t;
8425
- t < -$v || u > $v && r - ((c = s(sy, this)) == null ? r : c) > u - ey || n ? (a(ry, this, []), a(iy, this, 0), a(ly, this, [])) : t >= ty && a(ly, this, [...s(ly, this).slice(-4), t]);
8438
+ let t = e - s(uy, this), n = s(my, this).length >= 2 && r < o(hy, this, _y).call(this) - iy && t > ((i = xy(s(my, this))) == null ? 0 : i) + iy, l = xy(s(my, this)), u = l === void 0 ? 0 : l - t;
8439
+ t < -iy || u > iy && r - ((c = s(fy, this)) == null ? r : c) > u - ay || n ? (a(cy, this, []), a(ly, this, 0), a(my, this, [])) : t >= oy && a(my, this, [...s(my, this).slice(-4), t]);
8426
8440
  }
8427
- a(ay, this, e), a(oy, this, t), a(sy, this, r), a(iy, this, (n = s(iy, this), n++, n)), a(ry, this, s(ry, this).filter((e) => e.arrivedAt > t - Xv)), s(ry, this).push({
8441
+ a(uy, this, e), a(dy, this, t), a(fy, this, r), a(ly, this, (n = s(ly, this), n++, n)), a(cy, this, s(cy, this).filter((e) => e.arrivedAt > t - ty)), s(cy, this).push({
8428
8442
  arrivedAt: t,
8429
8443
  delay: r
8430
- }), a(cy, this, r - o(uy, this, fy).call(this));
8444
+ }), a(py, this, r - o(hy, this, _y).call(this));
8431
8445
  }
8432
8446
  sentSince(e) {
8433
- return s(ay, this) === void 0 || s(ry, this).length === 0 ? !1 : s(ay, this) + o(uy, this, fy).call(this) >= e;
8447
+ return s(uy, this) === void 0 || s(cy, this).length === 0 ? !1 : s(uy, this) + o(hy, this, _y).call(this) >= e;
8434
8448
  }
8435
- level(e = s(ny, this).call(this)) {
8436
- if (s(iy, this) < Zv || s(oy, this) === void 0) return;
8437
- let t = o(uy, this, py).call(this, e);
8438
- if (!(t <= 0 && e - s(oy, this) > Qv)) return Math.max(s(cy, this), t);
8449
+ level(e = s(sy, this).call(this)) {
8450
+ if (s(ly, this) < ny || s(dy, this) === void 0) return;
8451
+ let t = o(hy, this, vy).call(this, e);
8452
+ if (!(t <= 0 && e - s(dy, this) > ry)) return Math.max(s(py, this), t);
8439
8453
  }
8440
8454
  delayOf(e, t) {
8441
- if (!(this.level(t) === void 0 || !Number.isFinite(e))) return Math.max(0, t - e - o(uy, this, fy).call(this));
8455
+ if (!(this.level(t) === void 0 || !Number.isFinite(e))) return Math.max(0, t - e - o(hy, this, _y).call(this));
8442
8456
  }
8443
- peak(e, t = s(ny, this).call(this)) {
8457
+ peak(e, t = s(sy, this).call(this)) {
8444
8458
  var n;
8445
8459
  return (n = this.summary(e, t)) == null ? void 0 : n.max;
8446
8460
  }
8447
- summary(e, t = s(ny, this).call(this)) {
8461
+ summary(e, t = s(sy, this).call(this)) {
8448
8462
  let n = this.level(t);
8449
8463
  if (n === void 0) return;
8450
- let r = o(uy, this, fy).call(this);
8451
- return yt([...s(ry, this).filter((n) => n.arrivedAt >= t - e).map((e) => e.delay - r), n]);
8464
+ let r = o(hy, this, _y).call(this);
8465
+ return yt([...s(cy, this).filter((n) => n.arrivedAt >= t - e).map((e) => e.delay - r), n]);
8452
8466
  }
8453
8467
  };
8454
- function fy() {
8455
- return s(ry, this).reduce((e, t) => Math.min(e, t.delay), Infinity);
8468
+ function _y() {
8469
+ return s(cy, this).reduce((e, t) => Math.min(e, t.delay), Infinity);
8456
8470
  }
8457
- function py(e) {
8458
- let t = gy(s(ly, this));
8459
- return t === void 0 || s(oy, this) === void 0 ? 0 : e - (s(oy, this) - s(cy, this) + t);
8471
+ function vy(e) {
8472
+ let t = xy(s(my, this));
8473
+ return t === void 0 || s(dy, this) === void 0 ? 0 : e - (s(dy, this) - s(py, this) + t);
8460
8474
  }
8461
- var my = 3e3, hy = (e, t) => {
8462
- let n = t.summary(my);
8475
+ var yy = 3e3, by = (e, t) => {
8476
+ let n = t.summary(yy);
8463
8477
  n !== void 0 && e.debug("Link queue", {
8464
8478
  levelMs: Math.round(n.last),
8465
8479
  peak3sMs: Math.round(n.max)
8466
8480
  });
8467
- }, gy = (e) => {
8481
+ }, xy = (e) => {
8468
8482
  if (e.length === 0) return;
8469
8483
  let t = [...e].sort((e, t) => e - t);
8470
8484
  return t[Math.floor(t.length / 2)];
8471
8485
  };
8472
8486
  //#endregion
8473
8487
  //#region ../../libs/web-sdk/src/adapters/MoqConnectionAdapter.ts
8474
- function _y(e, t, n) {
8488
+ function Sy(e, t, n) {
8475
8489
  let r = new URL("/voq/subscribe", e);
8476
8490
  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;
8477
8491
  }
8478
- function vy(e, t) {
8492
+ function Cy(e, t) {
8479
8493
  let n = [];
8480
8494
  for (let r of e == null ? [] : e) try {
8481
8495
  n.push({
@@ -8490,78 +8504,78 @@ function vy(e, t) {
8490
8504
  }
8491
8505
  return n.length > 0 ? n : void 0;
8492
8506
  }
8493
- function yy(e, t, n) {
8507
+ function wy(e, t, n) {
8494
8508
  return n !== void 0 && e.get("webtransportEnabled") && !e.get("unstableWebtransportEnabled") && !!self.WebTransport && t.protocol.startsWith("https") && Fe();
8495
8509
  }
8496
- var by = 1e4, X = /* @__PURE__ */ new WeakMap(), xy = /* @__PURE__ */ new WeakMap(), Sy = /* @__PURE__ */ new WeakMap(), Cy = /* @__PURE__ */ new WeakMap(), Z = /* @__PURE__ */ new WeakMap(), wy = /* @__PURE__ */ new WeakMap(), Ty = /* @__PURE__ */ new WeakMap(), Ey = /* @__PURE__ */ new WeakMap(), Dy = /* @__PURE__ */ new WeakMap(), Oy = /* @__PURE__ */ new WeakMap(), ky = /* @__PURE__ */ new WeakMap(), Ay = /* @__PURE__ */ new WeakMap(), Q = /* @__PURE__ */ new WeakSet(), jy = /* @__PURE__ */ new WeakMap(), My = /* @__PURE__ */ new WeakMap(), Ny = /* @__PURE__ */ new WeakMap(), Py = /* @__PURE__ */ new WeakMap(), Fy = /* @__PURE__ */ new WeakMap(), Iy = /* @__PURE__ */ new WeakMap(), Ly = class r {
8510
+ var Ty = 1e4, X = /* @__PURE__ */ new WeakMap(), Ey = /* @__PURE__ */ new WeakMap(), Dy = /* @__PURE__ */ new WeakMap(), Oy = /* @__PURE__ */ new WeakMap(), Z = /* @__PURE__ */ new WeakMap(), ky = /* @__PURE__ */ new WeakMap(), Ay = /* @__PURE__ */ new WeakMap(), jy = /* @__PURE__ */ new WeakMap(), My = /* @__PURE__ */ new WeakMap(), Ny = /* @__PURE__ */ new WeakMap(), Py = /* @__PURE__ */ new WeakMap(), Fy = /* @__PURE__ */ new WeakMap(), Iy = /* @__PURE__ */ new WeakMap(), Q = /* @__PURE__ */ new WeakSet(), Ly = /* @__PURE__ */ new WeakMap(), Ry = /* @__PURE__ */ new WeakMap(), zy = /* @__PURE__ */ new WeakMap(), By = /* @__PURE__ */ new WeakMap(), Vy = /* @__PURE__ */ new WeakMap(), Hy = /* @__PURE__ */ new WeakMap(), Uy = class r {
8497
8511
  get estimatedBandwidth() {
8498
- return s(Dy, this);
8512
+ return s(My, this);
8499
8513
  }
8500
8514
  unload() {
8501
- s(X, this).off("send signal", s(My, this)), s(X, this).off("disconnect", this.disconnect), s(X, this).off("text track", s(jy, this)), this.disconnect();
8515
+ s(X, this).off("send signal", s(Ry, this)), s(X, this).off("disconnect", this.disconnect), s(X, this).off("text track", s(Ly, this)), this.disconnect();
8502
8516
  }
8503
8517
  suspend() {}
8504
8518
  unsuspend() {}
8505
8519
  getStatistics() {
8506
- let e = s(Sy, this).transportType() === "webtransport" ? "moq" : "moq_ws";
8520
+ let e = s(Dy, this).transportType() === "webtransport" ? "moq" : "moq_ws";
8507
8521
  return {
8508
- edgeUrl: Pv(s(Sy, this).url()),
8522
+ edgeUrl: Pv(s(Dy, this).url()),
8509
8523
  connectionProtocol: e,
8510
- transportSelectionReason: s(Oy, this)
8524
+ transportSelectionReason: s(Ny, this)
8511
8525
  };
8512
8526
  }
8513
- constructor(t, r, c, l, u, d, f, p, h) {
8514
- C(this, Q), i(this, X, void 0), i(this, xy, void 0), i(this, Sy, void 0), i(this, Cy, "disconnected"), i(this, Z, void 0), i(this, wy, /* @__PURE__ */ new Map()), i(this, Ty, void 0), i(this, Ey, void 0), i(this, Dy, void 0), i(this, Oy, void 0), i(this, ky, /* @__PURE__ */ new Map()), e(this, "linkQueue", void 0), i(this, Ay, void 0), e(this, "closedForBacklog", !1), i(this, jy, (e) => {
8527
+ constructor(t, r, c, l, u, d, f, p, h, g) {
8528
+ C(this, Q), i(this, X, void 0), i(this, Ey, void 0), i(this, Dy, void 0), i(this, Oy, "disconnected"), i(this, Z, void 0), i(this, ky, /* @__PURE__ */ new Map()), i(this, Ay, void 0), i(this, jy, void 0), i(this, My, void 0), i(this, Ny, void 0), i(this, Py, /* @__PURE__ */ new Map()), e(this, "linkQueue", void 0), i(this, Fy, void 0), i(this, Iy, void 0), e(this, "closedForBacklog", !1), i(this, Ly, (e) => {
8515
8529
  if (!e) {
8516
8530
  s(Z, this).setSubtitleTrack(void 0).catch(n);
8517
8531
  return;
8518
8532
  }
8519
- let t = s(wy, this).get(Dh(s(Z, this).namespace())), r = t == null ? void 0 : t.getTextTrack(e);
8533
+ let t = s(ky, this).get(Dh(s(Z, this).namespace())), r = t == null ? void 0 : t.getTextTrack(e);
8520
8534
  r && s(Z, this).setSubtitleTrack(r).catch(n);
8521
- }), i(this, My, (e) => {
8535
+ }), i(this, Ry, (e) => {
8522
8536
  switch (e.type) {
8523
8537
  case "subscribe":
8524
8538
  {
8525
- if (s(Ny, this)) return;
8526
- let t = s(Fy, this);
8539
+ if (s(zy, this)) return;
8540
+ let t = s(Vy, this);
8527
8541
  if (t) {
8528
8542
  if (Av(t, e.subscription)) {
8529
- a(Py, this, void 0);
8543
+ a(By, this, void 0);
8530
8544
  return;
8531
8545
  }
8532
- s(xy, this).info("Queueing - we are already switching"), a(Py, this, e.subscription);
8546
+ s(Ey, this).info("Queueing - we are already switching"), a(By, this, e.subscription);
8533
8547
  return;
8534
8548
  }
8535
- o(Q, this, By).call(this, e.subscription);
8549
+ o(Q, this, Ky).call(this, e.subscription);
8536
8550
  }
8537
8551
  break;
8538
8552
  case "telemetry":
8539
- m(new URL("/api/telemetry", s(Sy, this).url().replace("wss://", "https://")), {
8553
+ m(new URL("/api/telemetry", s(Dy, this).url().replace("wss://", "https://")), {
8540
8554
  body: e.body,
8541
8555
  headers: { "Content-Type": "text/plain" }
8542
8556
  }).catch(n);
8543
8557
  break;
8544
8558
  case "refresh auth":
8545
- s(Sy, this).updateAuthToken(e.token);
8559
+ s(Dy, this).updateAuthToken(e.token);
8546
8560
  break;
8547
8561
  }
8548
- }), i(this, Ny, !1), i(this, Py, void 0), i(this, Fy, void 0), e(this, "disconnect", (e = "Disconnect Requested") => {
8562
+ }), i(this, zy, !1), i(this, By, void 0), i(this, Vy, void 0), e(this, "disconnect", (e = "Disconnect Requested") => {
8549
8563
  var t;
8550
- s(xy, this).info("Disconnecting", e), (t = s(Ay, this)) == null || t.stop(), o(Q, this, zy).call(this), s(Sy, this).close(), s(Z, this).close().catch(n), a(ky, this, /* @__PURE__ */ new Map()), o(Q, this, Uy).call(this, "disconnected");
8551
- }), i(this, Iy, (e) => {
8552
- o(Q, this, zy).call(this), this.closedForBacklog = !0, s(xy, this).info("Link queue over the breaker, reconnecting", { levelMs: Math.round(e) }), s(Sy, this).close(), s(X, this).emit("ping timeout");
8553
- }), a(X, this, t), a(xy, this, r), a(Sy, this, c), a(Z, this, l), a(wy, this, u), a(Ty, this, d), a(Ey, this, f), a(Oy, this, p), this.linkQueue = h, s(X, this).on("send signal", s(My, this)), s(X, this).on("disconnect", this.disconnect), s(X, this).on("text track", s(jy, this)), o(Q, this, Ry).call(this).catch(n), o(Q, this, Wy).call(this).catch(n), h && (a(Ay, this, new Jv(h, () => s(Cy, this) === "connected", s(Iy, this))), s(Ay, this).start());
8564
+ s(Ey, this).info("Disconnecting", e), (t = s(Iy, this)) == null || t.stop(), o(Q, this, Gy).call(this), s(Dy, this).close(), s(Z, this).close().catch(n), a(Py, this, /* @__PURE__ */ new Map()), o(Q, this, Yy).call(this, "disconnected");
8565
+ }), i(this, Hy, (e) => {
8566
+ o(Q, this, Gy).call(this), this.closedForBacklog = !0, s(Ey, this).info("Link queue over the breaker, reconnecting", { levelMs: Math.round(e) }), s(Dy, this).close(), s(X, this).emit("ping timeout");
8567
+ }), a(X, this, t), a(Ey, this, r), a(Dy, this, c), a(Z, this, l), a(ky, this, u), a(Ay, this, d), a(jy, this, f), a(Ny, this, p), this.linkQueue = h, a(Fy, this, g), s(X, this).on("send signal", s(Ry, this)), s(X, this).on("disconnect", this.disconnect), s(X, this).on("text track", s(Ly, this)), o(Q, this, Wy).call(this).catch(n), o(Q, this, Xy).call(this).catch(n), h && (a(Iy, this, new Jv(h, () => s(Oy, this) === "connected", s(Hy, this))), s(Iy, this).start());
8554
8568
  }
8555
8569
  static start(e, n, i, a, o) {
8556
8570
  return t(function* () {
8557
8571
  var t, c, l, u, f;
8558
- let p = new Map(a.connectInfo.channels.map((e) => [Dh(e.catalog.namespace), new Zy(new Wt(e.catalog))])), m = yield a.onConnectInfo(a.connectInfo), h = a.options.get("authenticationToken"), g, _, v;
8572
+ let p = new Map(a.connectInfo.channels.map((e) => [Dh(e.catalog.namespace), new rb(new Wt(e.catalog))])), m = yield a.onConnectInfo(a.connectInfo), h = a.options.get("authenticationToken"), g, _, v;
8559
8573
  switch (typeof a.edgeUrl) {
8560
8574
  case "string":
8561
- g = _y(a.edgeUrl, m, h);
8575
+ g = Sy(a.edgeUrl, m, h);
8562
8576
  break;
8563
8577
  default:
8564
- g = _y(a.edgeUrl.moqUrl || a.edgeUrl.moqWsUrl, m, h), _ = _y(a.edgeUrl.moqWsUrl, m, h), v = vy(a.edgeUrl.serverCertificateHashes, n);
8578
+ g = Sy(a.edgeUrl.moqUrl || a.edgeUrl.moqWsUrl, m, h), _ = Sy(a.edgeUrl.moqWsUrl, m, h), v = Cy(a.edgeUrl.serverCertificateHashes, n);
8565
8579
  break;
8566
8580
  }
8567
8581
  let y = (t = a.connectInfo.channels.find((e) => e.channelId === m.channelId)) == null ? void 0 : t.catalog;
@@ -8569,7 +8583,7 @@ var by = 1e4, X = /* @__PURE__ */ new WeakMap(), xy = /* @__PURE__ */ new WeakMa
8569
8583
  edgeUrl: g,
8570
8584
  edgeWsUrl: _
8571
8585
  }), d(y, "no catalog found");
8572
- let b = (c = p.get(Dh(y.namespace))) == null ? void 0 : c.getVideoTrack(m.video), ee = (l = p.get(Dh(y.namespace))) == null ? void 0 : l.getAudioTrack(m.audio), te = yy(a.options, g, _), x;
8586
+ let b = (c = p.get(Dh(y.namespace))) == null ? void 0 : c.getVideoTrack(m.video), ee = (l = p.get(Dh(y.namespace))) == null ? void 0 : l.getAudioTrack(m.audio), te = wy(a.options, g, _), x;
8573
8587
  try {
8574
8588
  x = yield yh({
8575
8589
  url: g,
@@ -8588,58 +8602,59 @@ var by = 1e4, X = /* @__PURE__ */ new WeakMap(), xy = /* @__PURE__ */ new WeakMa
8588
8602
  (u = a.onTransportConnected) == null || u.call(a);
8589
8603
  let re = S.closed().then((e) => {
8590
8604
  throw e instanceof Error ? e : Error(e ? `Session closed before player started: ${String(e)}` : "Session closed before player started");
8591
- }), C = S.transportType() === "websocket" ? new dy() : void 0, ie, w;
8605
+ }), C = S.transportType() === "websocket" ? new gy() : void 0, ie = C == null ? new gy() : C, w = new ey(ie), ae, oe;
8592
8606
  try {
8593
- w = yield Promise.race([
8607
+ oe = yield Promise.race([
8594
8608
  bv.start(S.subscriber, {
8595
8609
  namespace: y.namespace,
8596
8610
  catalog: y,
8597
8611
  videoTrack: b == null ? void 0 : b.track,
8598
8612
  audioTrack: ee == null ? void 0 : ee.track,
8599
8613
  burstMs: m.burstMs || 0,
8600
- onStats: C && ((e, t) => {
8601
- C.sample(e.ntpTimestamp, performance.timeOrigin + t), hy(n, C), ie == null || ie();
8602
- })
8614
+ onStats: (e, t) => {
8615
+ let r = performance.timeOrigin + t;
8616
+ ie.sample(e.ntpTimestamp, r), w.sample(e.ntpTimestamp, r), C && (by(n, C), ae == null || ae());
8617
+ }
8603
8618
  }),
8604
- ln(by, /* @__PURE__ */ Error("Timeout waiting for player to start")),
8619
+ ln(Ty, /* @__PURE__ */ Error("Timeout waiting for player to start")),
8605
8620
  re
8606
8621
  ]);
8607
8622
  } catch (e) {
8608
8623
  throw S.close(), e;
8609
8624
  }
8610
- let ae = new Zy(w.catalog());
8611
- p.set(Dh(y.namespace), ae), e.emit("received signal", {
8625
+ let se = new rb(oe.catalog());
8626
+ p.set(Dh(y.namespace), se), e.emit("received signal", {
8612
8627
  type: "client ip",
8613
- ip: w.connectionInfo().ip
8614
- }), w.drm().then((t) => {
8628
+ ip: oe.connectionInfo().ip
8629
+ }), oe.drm().then((t) => {
8615
8630
  t && e.emit("received drm data", t.value);
8616
8631
  }).catch((e) => {
8617
8632
  n.error("Error getting DRM data", e);
8618
8633
  });
8619
- let oe = new r(e, n, S, w, p, i, o, ne, C);
8620
- return ie = (f = s(Ay, oe)) == null ? void 0 : f.check, m.textTrack && s(jy, oe).call(oe, m.textTrack), oe;
8634
+ let ce = new r(e, n, S, oe, p, i, o, ne, C, w);
8635
+ return ae = (f = s(Iy, ce)) == null ? void 0 : f.check, m.textTrack && s(Ly, ce).call(ce, m.textTrack), ce;
8621
8636
  })();
8622
8637
  }
8623
8638
  getState() {
8624
- return s(Cy, this);
8639
+ return s(Oy, this);
8625
8640
  }
8626
8641
  close() {
8627
8642
  var e;
8628
- (e = s(Ay, this)) == null || e.stop(), o(Q, this, zy).call(this), s(Sy, this).close();
8643
+ (e = s(Iy, this)) == null || e.stop(), o(Q, this, Gy).call(this), s(Dy, this).close();
8629
8644
  }
8630
8645
  closed() {
8631
- return Promise.race([s(Sy, this).closed(), s(Z, this).closed()]);
8646
+ return Promise.race([s(Dy, this).closed(), s(Z, this).closed()]);
8632
8647
  }
8633
8648
  };
8634
- function Ry() {
8649
+ function Wy() {
8635
8650
  var e = this;
8636
8651
  return t(function* () {
8637
- s(Sy, e).transportType() === "websocket" && (yield cn(5e3));
8652
+ s(Dy, e).transportType() === "websocket" && (yield cn(5e3));
8638
8653
  var t = !1, n = !1, r;
8639
8654
  try {
8640
- for (var i = H(s(Z, e).stats()), o; t = !(o = yield i.next()).done; t = !1) {
8655
+ for (var i = V(s(Z, e).stats()), o; t = !(o = yield i.next()).done; t = !1) {
8641
8656
  let { rtt: t, estimatedBandwidth: n } = o.value;
8642
- a(Dy, e, n), s(Ey, e).push(t), s(X, e).emit("rtt", gt(s(Ey, e).items()));
8657
+ a(My, e, n), s(jy, e).push(t), s(X, e).emit("rtt", gt(s(jy, e).items()));
8643
8658
  }
8644
8659
  } catch (e) {
8645
8660
  n = !0, r = e;
@@ -8652,45 +8667,45 @@ function Ry() {
8652
8667
  }
8653
8668
  })();
8654
8669
  }
8655
- function zy() {
8656
- a(Ny, this, !0), a(Py, this, void 0);
8670
+ function Gy() {
8671
+ a(zy, this, !0), a(By, this, void 0);
8657
8672
  }
8658
- function By(e) {
8659
- a(Fy, this, e), o(Q, this, Hy).call(this, e).catch((t) => {
8660
- if (s(Ny, this)) return;
8661
- s(xy, this).error("error handling subscription", t);
8662
- let n = s(Py, this);
8663
- a(Py, this, void 0), s(X, this).emit("received signal", {
8673
+ function Ky(e) {
8674
+ a(Vy, this, e), o(Q, this, Jy).call(this, e).catch((t) => {
8675
+ if (s(zy, this)) return;
8676
+ s(Ey, this).error("error handling subscription", t);
8677
+ let n = s(By, this);
8678
+ a(By, this, void 0), s(X, this).emit("received signal", {
8664
8679
  type: "subscription changed",
8665
8680
  subscription: n == null ? e : n,
8666
8681
  reset: !0
8667
8682
  });
8668
8683
  }).finally(() => {
8669
- a(Fy, this, void 0);
8670
- let e = s(Py, this);
8671
- a(Py, this, void 0), e && !s(Ny, this) && o(Q, this, By).call(this, e);
8684
+ a(Vy, this, void 0);
8685
+ let e = s(By, this);
8686
+ a(By, this, void 0), e && !s(zy, this) && o(Q, this, Ky).call(this, e);
8672
8687
  });
8673
8688
  }
8674
- function Vy(e) {
8689
+ function qy(e) {
8675
8690
  var n = this;
8676
8691
  return t(function* () {
8677
8692
  var t;
8678
- let r = yield s(Ty, n).connect({ channelId: e });
8693
+ let r = yield s(Ay, n).connect({ channelId: e });
8679
8694
  if (!c(r)) throw Error("no moq connect info found");
8680
8695
  let i = (t = r.channels.find((t) => t.channelId === e)) == null ? void 0 : t.catalog;
8681
8696
  if (!i) throw Error("no catalog found");
8682
8697
  return i;
8683
8698
  })();
8684
8699
  }
8685
- function Hy(e) {
8700
+ function Jy(e) {
8686
8701
  var n = this;
8687
8702
  return t(function* () {
8688
8703
  var t, r;
8689
- s(xy, n).info("handle subscription", e);
8690
- let i = s(Z, n), a = s(wy, n).get(e.channelId);
8691
- if (a || (a = new Zy(new Wt(yield o(Q, n, Vy).call(n, e.channelId))), s(wy, n).set(e.channelId, a)), i.namespace().join("/") !== a.namespace().join("/")) {
8704
+ s(Ey, n).info("handle subscription", e);
8705
+ let i = s(Z, n), a = s(ky, n).get(e.channelId);
8706
+ if (a || (a = new rb(new Wt(yield o(Q, n, qy).call(n, e.channelId))), s(ky, n).set(e.channelId, a)), i.namespace().join("/") !== a.namespace().join("/")) {
8692
8707
  var c;
8693
- s(xy, n).info("changing channel", e.channelId);
8708
+ s(Ey, n).info("changing channel", e.channelId);
8694
8709
  let t = a.getVideoTrack(e.video), r = a.getAudioTrack(e.audio);
8695
8710
  if (yield i.zap({
8696
8711
  namespace: a.namespace(),
@@ -8700,8 +8715,8 @@ function Hy(e) {
8700
8715
  }, 500), i.drm().then((e) => {
8701
8716
  e && s(X, n).emit("received drm data", e.value);
8702
8717
  }).catch((e) => {
8703
- s(xy, n).error("Error getting DRM data", e);
8704
- }), s(xy, n).info("switched channel", e.channelId), (c = s(wy, n).get(Dh(i.namespace()))) == null || c.updateCatalog(i.catalog()), s(Ny, n)) return;
8718
+ s(Ey, n).error("Error getting DRM data", e);
8719
+ }), s(Ey, n).info("switched channel", e.channelId), (c = s(ky, n).get(Dh(i.namespace()))) == null || c.updateCatalog(i.catalog()), s(zy, n)) return;
8705
8720
  s(X, n).emit("received signal", {
8706
8721
  type: "subscription changed",
8707
8722
  subscription: e
@@ -8709,37 +8724,37 @@ function Hy(e) {
8709
8724
  return;
8710
8725
  }
8711
8726
  let l = a.getVideoTrack(e.video), u = a.getAudioTrack(e.audio);
8712
- yield Promise.all([l && l.track.name !== ((t = s(Z, n).videoTrack()) == null ? void 0 : t.name) ? s(Z, n).setVideoTrack(l.track) : void 0, u && u.track.name !== ((r = s(Z, n).audioTrack()) == null ? void 0 : r.name) ? s(Z, n).setAudioTrack(u.track) : void 0]), !s(Ny, n) && s(X, n).emit("received signal", {
8727
+ yield Promise.all([l && l.track.name !== ((t = s(Z, n).videoTrack()) == null ? void 0 : t.name) ? s(Z, n).setVideoTrack(l.track) : void 0, u && u.track.name !== ((r = s(Z, n).audioTrack()) == null ? void 0 : r.name) ? s(Z, n).setAudioTrack(u.track) : void 0]), !s(zy, n) && s(X, n).emit("received signal", {
8713
8728
  type: "subscription changed",
8714
8729
  subscription: e
8715
8730
  });
8716
8731
  })();
8717
8732
  }
8718
- function Uy(e) {
8719
- a(Cy, this, e), s(X, this).emit("connection state", e);
8733
+ function Yy(e) {
8734
+ a(Oy, this, e), s(X, this).emit("connection state", e);
8720
8735
  }
8721
- function Wy() {
8736
+ function Xy() {
8722
8737
  var e = this;
8723
8738
  return t(function* () {
8724
8739
  try {
8725
- o(Q, e, Uy).call(e, "connecting"), s(xy, e).info("Connecting..."), o(Q, e, Uy).call(e, "connected"), yield Promise.all([
8726
- o(Q, e, Ky).call(e, s(Z, e).referenceClock(), s(Z, e).audio),
8727
- o(Q, e, Ky).call(e, s(Z, e).referenceClock(), s(Z, e).video),
8728
- o(Q, e, Gy).call(e, s(Z, e).subtitles)
8729
- ]), yield s(Z, e).closed(), s(Sy, e).close(), s(xy, e).info("Session closed");
8740
+ o(Q, e, Yy).call(e, "connecting"), s(Ey, e).info("Connecting..."), o(Q, e, Yy).call(e, "connected"), yield Promise.all([
8741
+ o(Q, e, Qy).call(e, s(Z, e).referenceClock(), s(Z, e).audio),
8742
+ o(Q, e, Qy).call(e, s(Z, e).referenceClock(), s(Z, e).video),
8743
+ o(Q, e, Zy).call(e, s(Z, e).subtitles)
8744
+ ]), yield s(Z, e).closed(), s(Dy, e).close(), s(Ey, e).info("Session closed");
8730
8745
  } catch (t) {
8731
- s(xy, e).warn("Session error", t), s(Sy, e).close();
8746
+ s(Ey, e).warn("Session error", t), s(Dy, e).close();
8732
8747
  } finally {
8733
- o(Q, e, Uy).call(e, "disconnected");
8748
+ o(Q, e, Yy).call(e, "disconnected");
8734
8749
  }
8735
8750
  })();
8736
8751
  }
8737
- function Gy(e) {
8752
+ function Zy(e) {
8738
8753
  var n = this;
8739
8754
  return t(function* () {
8740
8755
  var t = !1, r = !1, i;
8741
8756
  try {
8742
- for (var a = H(e), o; t = !(o = yield a.next()).done; t = !1) {
8757
+ for (var a = V(e), o; t = !(o = yield a.next()).done; t = !1) {
8743
8758
  let e = o.value;
8744
8759
  s(X, n).emit("text track data", e);
8745
8760
  }
@@ -8754,38 +8769,39 @@ function Gy(e) {
8754
8769
  }
8755
8770
  })();
8756
8771
  }
8757
- function Ky(e, n) {
8772
+ function Qy(e, n) {
8758
8773
  var r = this;
8759
8774
  return t(function* () {
8760
8775
  let t = "", i = "", a, o = s(Z, r).videoTrack() === void 0;
8761
8776
  var c = !1, l = !1, u;
8762
8777
  try {
8763
- for (var d = H(n), f; c = !(f = yield d.next()).done; c = !1) {
8778
+ for (var d = V(n), f; c = !(f = yield d.next()).done; c = !1) {
8764
8779
  let n = f.value;
8765
8780
  {
8766
8781
  var m;
8767
8782
  let c = Dh(n.track.namespace), l = n.track.trackObject.language, u = p((m = n.track.trackObject.codec) == null ? "" : m), d = n.track.trackObject.codec, f = u ? fn({
8768
8783
  codec: u,
8769
8784
  codecString: d
8770
- }) : void 0, ee = !!n.track.trackObject["com.vindral.drm"];
8785
+ }) : void 0, te = !!n.track.trackObject["com.vindral.drm"];
8771
8786
  var h = !1, g = !1, _;
8772
8787
  try {
8773
- for (var v = H(n), y; h = !(y = yield v.next()).done; h = !1) {
8788
+ for (var v = V(n), y; h = !(y = yield v.next()).done; h = !1) {
8774
8789
  let [p, m] = y.value;
8775
8790
  {
8776
8791
  var b;
8777
- (b = s(Ay, r)) == null || b.alive();
8792
+ (b = s(Iy, r)) == null || b.alive();
8778
8793
  let h = {
8779
8794
  channelId: t !== "" && (o || m.mediaType() === "video") && t !== c ? c : void 0,
8780
8795
  language: m.mediaType() === "audio" && i !== l ? l : void 0,
8781
- drmTransition: a !== void 0 && a !== ee
8796
+ drmTransition: a !== void 0 && a !== te
8782
8797
  };
8783
- t = c, i = l, a = ee;
8784
- let g = m.producerReferenceTime(), _ = s(ky, r).get(n.track.namespace), v = performance.now();
8798
+ t = c, i = l, a = te;
8799
+ let g = m.producerReferenceTime(), _ = s(Py, r).get(n.track.namespace), v = performance.now();
8785
8800
  if (g && (_ === void 0 || v - _ > 1e3)) {
8786
- s(ky, r).set(n.track.namespace, v);
8787
- let t = e.wallclock() - g.getTime();
8788
- s(xy, r).debug("timing-info", {
8801
+ var ee;
8802
+ s(Py, r).set(n.track.namespace, v);
8803
+ let t = ((ee = s(Fy, r).wallclock()) == null ? e.wallclock() : ee) - g.getTime();
8804
+ s(Ey, r).debug("timing-info", {
8789
8805
  mediaType: m.mediaType(),
8790
8806
  referenceClock: e,
8791
8807
  delta: t,
@@ -8809,7 +8825,7 @@ function Ky(e, n) {
8809
8825
  codec: u,
8810
8826
  codecString: d,
8811
8827
  switchInfo: h,
8812
- renditionId: qy(n.track.trackObject.name)
8828
+ renditionId: $y(n.track.trackObject.name)
8813
8829
  });
8814
8830
  }
8815
8831
  }
@@ -8835,48 +8851,48 @@ function Ky(e, n) {
8835
8851
  }
8836
8852
  })();
8837
8853
  }
8838
- function qy(e) {
8854
+ function $y(e) {
8839
8855
  return e.split("").reduce((e, t) => e = t.charCodeAt(0) + (e << 6) + (e << 16) - e, 0);
8840
8856
  }
8841
- var Jy = /* @__PURE__ */ new WeakMap(), Yy = /* @__PURE__ */ new WeakMap(), Xy = /* @__PURE__ */ new WeakSet(), Zy = class {
8857
+ var eb = /* @__PURE__ */ new WeakMap(), tb = /* @__PURE__ */ new WeakMap(), nb = /* @__PURE__ */ new WeakSet(), rb = class {
8842
8858
  constructor(e) {
8843
- C(this, Xy), i(this, Jy, void 0), i(this, Yy, void 0), a(Jy, this, e), a(Yy, this, o(Xy, this, Qy).call(this));
8859
+ C(this, nb), i(this, eb, void 0), i(this, tb, void 0), a(eb, this, e), a(tb, this, o(nb, this, ib).call(this));
8844
8860
  }
8845
8861
  catalog() {
8846
- return s(Jy, this).current();
8862
+ return s(eb, this).current();
8847
8863
  }
8848
8864
  namespace() {
8849
- return s(Jy, this).current().namespace;
8865
+ return s(eb, this).current().namespace;
8850
8866
  }
8851
8867
  updateCatalog(e) {
8852
- a(Jy, this, e);
8868
+ a(eb, this, e);
8853
8869
  }
8854
8870
  getTextTrack(e) {
8855
- return s(Jy, this).current().tracks.find((t) => t.label === e);
8871
+ return s(eb, this).current().tracks.find((t) => t.label === e);
8856
8872
  }
8857
8873
  getAudioTrack(e) {
8858
8874
  if (!e.codec) return;
8859
- let t = s(Yy, this).filter((t) => !(!dn(t) || t.bitRate > e.bitRate || e.codec && t.codec !== e.codec || e.language && t.language !== e.language));
8875
+ let t = s(tb, this).filter((t) => !(!dn(t) || t.bitRate > e.bitRate || e.codec && t.codec !== e.codec || e.language && t.language !== e.language));
8860
8876
  return t[t.length - 1];
8861
8877
  }
8862
8878
  getVideoTrack(e) {
8863
8879
  if (!e.codec) return;
8864
- let t = s(Yy, this).filter((t) => !(!un(t) || t.bitRate > e.bitRate || e.codec && t.codec !== e.codec));
8880
+ let t = s(tb, this).filter((t) => !(!un(t) || t.bitRate > e.bitRate || e.codec && t.codec !== e.codec));
8865
8881
  return t[t.length - 1];
8866
8882
  }
8867
8883
  renditions() {
8868
- return s(Yy, this);
8884
+ return s(tb, this);
8869
8885
  }
8870
8886
  };
8871
- function Qy() {
8872
- let [e, t] = s(Jy, this).value();
8887
+ function ib() {
8888
+ let [e, t] = s(eb, this).value();
8873
8889
  return u(e);
8874
8890
  }
8875
8891
  //#endregion
8876
8892
  //#region ../../libs/web-sdk/src/transports/WebSocket.ts
8877
- var $y = /* @__PURE__ */ function(e) {
8893
+ var ab = /* @__PURE__ */ function(e) {
8878
8894
  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;
8879
- }({}), eb = class extends ne {
8895
+ }({}), ob = class extends ne {
8880
8896
  constructor(r, i) {
8881
8897
  var a;
8882
8898
  super(), a = this, e(this, "options", void 0), e(this, "websocket", void 0), 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, "connectTimeout", void 0), e(this, "shouldContinueConnecting", !1), e(this, "_isConnectInProgress", !1), e(this, "readyState", () => {
@@ -8914,19 +8930,19 @@ var $y = /* @__PURE__ */ function(e) {
8914
8930
  })), this.close("websocket was closed");
8915
8931
  let n;
8916
8932
  switch (e.code) {
8917
- case $y.AuthenticationFailed:
8933
+ case ab.AuthenticationFailed:
8918
8934
  n = Kn(Gn());
8919
8935
  break;
8920
- case $y.AuthenticationRefreshFailed:
8936
+ case ab.AuthenticationRefreshFailed:
8921
8937
  n = Kn(Gn());
8922
8938
  break;
8923
- case $y.AuthenticationExpired:
8939
+ case ab.AuthenticationExpired:
8924
8940
  n = qn(Gn());
8925
8941
  break;
8926
- case $y.ChannelNotFound:
8942
+ case ab.ChannelNotFound:
8927
8943
  n = Yn("internal", Gn());
8928
8944
  break;
8929
- case $y.Inactivity:
8945
+ case ab.Inactivity:
8930
8946
  n = Jn("internal", Gn());
8931
8947
  break;
8932
8948
  default: t && (n = Qn(/* @__PURE__ */ Error("WebSocket closed before open")));
@@ -8977,13 +8993,13 @@ var $y = /* @__PURE__ */ function(e) {
8977
8993
  get connectTime() {
8978
8994
  return this._connectTime;
8979
8995
  }
8980
- }, tb, nb = 65536 * 8, rb = .9, ib = 40, ab = (e) => {
8981
- let t = e || ib;
8982
- return nb * rb * 1e3 / t;
8983
- }, ob = class r {
8996
+ }, sb, cb = 65536 * 8, lb = .9, ub = 40, db = (e) => {
8997
+ let t = e || ub;
8998
+ return cb * lb * 1e3 / t;
8999
+ }, fb = class r {
8984
9000
  constructor(i, a, o, s) {
8985
9001
  var c = this;
8986
- 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", performance.now()), e(this, "isPingInFlight", !1), e(this, "connectCount", 0), e(this, "missedPings", 0), e(this, "closedForBacklog", !1), e(this, "isContextSwitchInProgress", !1), e(this, "signalBuffer", []), e(this, "dataBuffer", []), e(this, "disconnected", new w()), e(this, "linkQueue", new dy()), e(this, "clockCorrection", 0), e(this, "backlogBreaker", new Jv(this.linkQueue, () => this.getState() === "connected", (e) => {
9002
+ 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", performance.now()), e(this, "isPingInFlight", !1), e(this, "lastSignalSentTime", performance.now()), e(this, "connectCount", 0), e(this, "missedPings", 0), e(this, "closedForBacklog", !1), e(this, "isContextSwitchInProgress", !1), e(this, "signalBuffer", []), e(this, "dataBuffer", []), e(this, "disconnected", new w()), e(this, "linkQueue", new gy()), e(this, "clockCorrection", 0), e(this, "backlogBreaker", new Jv(this.linkQueue, () => this.getState() === "connected", (e) => {
8987
9003
  this.logger.info("Link queue over the breaker, reconnecting", { levelMs: Math.round(e) }), this.closeForBacklog("link queue over the breaker");
8988
9004
  })), e(this, "unload", () => {
8989
9005
  this.logger.debug("Unloading module..."), this.close("Unloading"), this.emitter.off("send signal", this.sendSignal), this.emitter.off("disconnect", this.close), this.emitter.off("reconnect", this.reconnect), this.logger.debug("Unloaded module");
@@ -9002,7 +9018,7 @@ var $y = /* @__PURE__ */ function(e) {
9002
9018
  this.logger.debug("transport is closed");
9003
9019
  return;
9004
9020
  }
9005
- this.transport.send(JSON.stringify(e));
9021
+ this.transport.send(JSON.stringify(e)), this.lastSignalSentTime = performance.now();
9006
9022
  }), e(this, "getStatistics", () => ({
9007
9023
  edgeUrl: Pv(this.config.edgeUrl),
9008
9024
  connectionProtocol: "vindral_ws",
@@ -9059,7 +9075,10 @@ var $y = /* @__PURE__ */ function(e) {
9059
9075
  if (!hn(t)) return;
9060
9076
  switch (t.type) {
9061
9077
  case "pong":
9062
- this.lastPingSentTime && (this.rtts.push(performance.now() - this.lastPingSentTime), this.isPingInFlight = !1, this.emitter.emit("rtt", gt(this.rtts.items())));
9078
+ if (this.lastPingSentTime) {
9079
+ let e = performance.now() - this.lastPingSentTime;
9080
+ this.isPingInFlight = !1, e < r.PING_INTERVAL && (this.rtts.push(e), this.emitter.emit("rtt", gt(this.rtts.items())));
9081
+ }
9063
9082
  break;
9064
9083
  case "context switch":
9065
9084
  this.logger.info("Starting context switch"), this.emitter.emit("context switch started"), this.isContextSwitchInProgress = !0;
@@ -9070,7 +9089,7 @@ var $y = /* @__PURE__ */ function(e) {
9070
9089
  }
9071
9090
  }
9072
9091
  }), e(this, "connectWebSocketTransport", () => {
9073
- let e = new eb({
9092
+ let e = new ob({
9074
9093
  reconnectDelay: 1e3,
9075
9094
  onMessage: this.onMessage,
9076
9095
  reconnectHandler: this.config.reconnectHandler,
@@ -9094,7 +9113,7 @@ var $y = /* @__PURE__ */ function(e) {
9094
9113
  }), e(this, "closeUnlessConnecting", (e) => this.transport.isConnectInProgress ? (this.logger.debug("Stopping reconnect, already mid-connection"), !1) : (this.close(e), !0)), e(this, "sampleLinkQueue", (e) => {
9095
9114
  if (this.isContextSwitchInProgress || !e.includes("\"timing info\"")) return !1;
9096
9115
  let t = JSON.parse(e);
9097
- return !hn(t) || t.type !== "timing info" ? !1 : (this.linkQueue.sample(t.timingInfo.wallclockTime, performance.timeOrigin + performance.now()), hy(this.logger, this.linkQueue), !0);
9116
+ return !hn(t) || t.type !== "timing info" ? !1 : (this.linkQueue.sample(t.timingInfo.wallclockTime, performance.timeOrigin + performance.now()), by(this.logger, this.linkQueue), !0);
9098
9117
  }), e(this, "correctTimingInfo", (e) => {
9099
9118
  var t;
9100
9119
  if (!e.includes("\"timing info\"")) return e;
@@ -9108,8 +9127,15 @@ var $y = /* @__PURE__ */ function(e) {
9108
9127
  this.missedPings = 0, this.isPingInFlight = !1;
9109
9128
  }), e(this, "pingCooldownExpired", () => performance.now() - this.lastPingSentTime > r.PING_INTERVAL), e(this, "sendPing", () => {
9110
9129
  if (this.isPingInFlight) {
9111
- this.missedPings++, this.missedPings > r.MAX_MISSED_PINGS && this.linkQueue.level() === void 0 && this.closeForBacklog("missed pings");
9112
- return;
9130
+ if (this.missedPings++, this.linkQueue.level() === void 0) {
9131
+ this.missedPings > r.MAX_MISSED_PINGS && this.closeForBacklog("missed pings");
9132
+ return;
9133
+ }
9134
+ let e = performance.now();
9135
+ if (e - this.lastPingSentTime < r.PING_TIMEOUT) {
9136
+ e - this.lastSignalSentTime > r.PING_INTERVAL && this.sendSignal({ type: "keepalive" });
9137
+ return;
9138
+ }
9113
9139
  }
9114
9140
  this.isPingInFlight = !0, this.lastPingSentTime = performance.now(), this.missedPings = 0, this.sendSignal({ type: "ping" });
9115
9141
  }), this.logger = a, this.emitter = i, this.config = o, this.rtts = s, this.emitter.on("send signal", this.sendSignal), this.emitter.on("disconnect", this.close), this.emitter.on("reconnect", this.reconnect), this.disconnected.promise.catch(n), this.transport = this.connectWebSocketTransport();
@@ -9118,8 +9144,8 @@ var $y = /* @__PURE__ */ function(e) {
9118
9144
  return this.disconnected.promise;
9119
9145
  }
9120
9146
  };
9121
- tb = ob, e(ob, "PING_INTERVAL", 5e3), e(ob, "MAX_MISSED_PINGS", 4), e(ob, "TLS_ROUNDTRIPS", 3), e(ob, "start", (e, t, n, r) => new Promise((i, a) => {
9122
- let o = new tb(e, t, n, r);
9147
+ sb = fb, e(fb, "PING_INTERVAL", 5e3), e(fb, "PING_TIMEOUT", 15e3), e(fb, "MAX_MISSED_PINGS", 4), e(fb, "TLS_ROUNDTRIPS", 3), e(fb, "start", (e, t, n, r) => new Promise((i, a) => {
9148
+ let o = new sb(e, t, n, r);
9123
9149
  o.transport.once("error", (e) => a(e)), o.transport.once("open", () => {
9124
9150
  var e;
9125
9151
  (e = n.onTransportConnected) == null || e.call(n), i(o);
@@ -9127,58 +9153,58 @@ tb = ob, e(ob, "PING_INTERVAL", 5e3), e(ob, "MAX_MISSED_PINGS", 4), e(ob, "TLS_R
9127
9153
  }));
9128
9154
  //#endregion
9129
9155
  //#region ../../libs/web-sdk/src/EdgeSelector.ts
9130
- var sb = (e) => {
9156
+ var pb = (e) => {
9131
9157
  var t;
9132
9158
  return typeof e == "string" ? e : `${e.moqWsUrl}|${(t = e.moqUrl) == null ? "" : t}`;
9133
- }, cb = (e) => typeof e == "string" ? e : e.moqUrl || e.moqWsUrl, lb = /* @__PURE__ */ new WeakMap(), ub = /* @__PURE__ */ new WeakMap(), db = /* @__PURE__ */ new WeakMap(), fb = /* @__PURE__ */ new WeakMap(), pb = class {
9159
+ }, mb = (e) => typeof e == "string" ? e : e.moqUrl || e.moqWsUrl, hb = /* @__PURE__ */ new WeakMap(), gb = /* @__PURE__ */ new WeakMap(), _b = /* @__PURE__ */ new WeakMap(), vb = /* @__PURE__ */ new WeakMap(), yb = class {
9134
9160
  constructor(e) {
9135
- i(this, lb, void 0), i(this, ub, []), i(this, db, /* @__PURE__ */ new Set()), i(this, fb, void 0), a(lb, this, e);
9161
+ i(this, hb, void 0), i(this, gb, []), i(this, _b, /* @__PURE__ */ new Set()), i(this, vb, void 0), a(hb, this, e);
9136
9162
  }
9137
9163
  select(e) {
9138
- if (s(lb, this).edgeUrl) return s(lb, this).edgeUrl;
9164
+ if (s(hb, this).edgeUrl) return s(hb, this).edgeUrl;
9139
9165
  if (e.length > 0) {
9140
- a(ub, this, [...e]);
9141
- let t = new Set(s(ub, this).map((e) => sb(e)));
9142
- for (let e of s(db, this)) t.has(e) || s(db, this).delete(e);
9166
+ a(gb, this, [...e]);
9167
+ let t = new Set(s(gb, this).map((e) => pb(e)));
9168
+ for (let e of s(_b, this)) t.has(e) || s(_b, this).delete(e);
9143
9169
  }
9144
- if (s(ub, this).length === 0) return;
9145
- let t = s(ub, this).filter((e) => !s(db, this).has(sb(e)));
9146
- t.length === 0 && (s(db, this).clear(), t = s(ub, this));
9170
+ if (s(gb, this).length === 0) return;
9171
+ let t = s(gb, this).filter((e) => !s(_b, this).has(pb(e)));
9172
+ t.length === 0 && (s(_b, this).clear(), t = s(gb, this));
9147
9173
  let n = t[0];
9148
- if (n) return s(db, this).add(sb(n)), a(fb, this, n), n;
9174
+ if (n) return s(_b, this).add(pb(n)), a(vb, this, n), n;
9149
9175
  }
9150
9176
  shiftedEdge() {
9151
- return s(fb, this);
9177
+ return s(vb, this);
9152
9178
  }
9153
9179
  hasRemainingEdges() {
9154
- return s(ub, this).some((e) => !s(db, this).has(sb(e)));
9180
+ return s(gb, this).some((e) => !s(_b, this).has(pb(e)));
9155
9181
  }
9156
9182
  reset() {
9157
- a(fb, this, void 0), a(ub, this, []), s(db, this).clear();
9183
+ a(vb, this, void 0), a(gb, this, []), s(_b, this).clear();
9158
9184
  }
9159
- }, mb, hb = (e) => {
9185
+ }, bb, xb = (e) => {
9160
9186
  if (e instanceof A && (e.code() === "channel_not_live" || e.code() === "channel_not_found")) return !0;
9161
9187
  let t = e instanceof A ? e.source() : e;
9162
9188
  if (!(t instanceof Error) || !f(t)) return !1;
9163
9189
  let { status: n } = t;
9164
9190
  return n >= 400 && n < 500 && n !== 408 && n !== 429;
9165
- }, gb = 3e4, _b = /* @__PURE__ */ new WeakMap(), $ = /* @__PURE__ */ new WeakMap(), vb = /* @__PURE__ */ new WeakMap(), yb = /* @__PURE__ */ new WeakMap(), bb = /* @__PURE__ */ new WeakMap(), xb = /* @__PURE__ */ new WeakMap(), Sb = /* @__PURE__ */ new WeakMap(), Cb = /* @__PURE__ */ new WeakMap(), wb = /* @__PURE__ */ new WeakMap(), Tb = /* @__PURE__ */ new WeakMap(), Eb = /* @__PURE__ */ new WeakMap(), Db = /* @__PURE__ */ new WeakMap(), Ob = /* @__PURE__ */ new WeakMap(), kb = /* @__PURE__ */ new WeakMap(), Ab = /* @__PURE__ */ new WeakMap(), jb = /* @__PURE__ */ new WeakMap(), Mb = /* @__PURE__ */ new WeakMap(), Nb = /* @__PURE__ */ new WeakMap(), Pb = /* @__PURE__ */ new WeakMap(), Fb = /* @__PURE__ */ new WeakMap(), Ib = /* @__PURE__ */ new WeakMap(), Lb = /* @__PURE__ */ new WeakMap(), Rb = /* @__PURE__ */ new WeakSet(), zb = /* @__PURE__ */ new WeakMap(), Bb = /* @__PURE__ */ new WeakMap(), Vb = /* @__PURE__ */ new WeakMap(), Hb = /* @__PURE__ */ new WeakMap(), Ub = /* @__PURE__ */ new WeakMap(), Wb = /* @__PURE__ */ new WeakMap(), Gb = /* @__PURE__ */ new WeakMap(), Kb = class n {
9191
+ }, Sb = 3e4, Cb = /* @__PURE__ */ new WeakMap(), $ = /* @__PURE__ */ new WeakMap(), wb = /* @__PURE__ */ new WeakMap(), Tb = /* @__PURE__ */ new WeakMap(), Eb = /* @__PURE__ */ new WeakMap(), Db = /* @__PURE__ */ new WeakMap(), Ob = /* @__PURE__ */ new WeakMap(), kb = /* @__PURE__ */ new WeakMap(), Ab = /* @__PURE__ */ new WeakMap(), jb = /* @__PURE__ */ new WeakMap(), Mb = /* @__PURE__ */ new WeakMap(), Nb = /* @__PURE__ */ new WeakMap(), Pb = /* @__PURE__ */ new WeakMap(), Fb = /* @__PURE__ */ new WeakMap(), Ib = /* @__PURE__ */ new WeakMap(), Lb = /* @__PURE__ */ new WeakMap(), Rb = /* @__PURE__ */ new WeakMap(), zb = /* @__PURE__ */ new WeakMap(), Bb = /* @__PURE__ */ new WeakMap(), Vb = /* @__PURE__ */ new WeakMap(), Hb = /* @__PURE__ */ new WeakMap(), Ub = /* @__PURE__ */ new WeakMap(), Wb = /* @__PURE__ */ new WeakSet(), Gb = /* @__PURE__ */ new WeakMap(), Kb = /* @__PURE__ */ new WeakMap(), qb = /* @__PURE__ */ new WeakMap(), Jb = /* @__PURE__ */ new WeakMap(), Yb = /* @__PURE__ */ new WeakMap(), Xb = /* @__PURE__ */ new WeakMap(), Zb = /* @__PURE__ */ new WeakMap(), Qb = class n {
9166
9192
  constructor(c, l, u) {
9167
9193
  var d = this;
9168
- C(this, Rb), 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), i(this, _b, new r(10)), i(this, $, !0), i(this, vb, void 0), i(this, yb, 0), i(this, bb, 0), i(this, xb, void 0), i(this, Sb, 0), i(this, Cb, 0), i(this, wb, 0), i(this, Tb, void 0), i(this, Eb, void 0), i(this, Db, void 0), i(this, Ob, void 0), i(this, kb, void 0), i(this, Ab, void 0), i(this, jb, void 0), i(this, Mb, []), i(this, Nb, void 0), e(this, "unload", () => {
9194
+ C(this, Wb), 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), i(this, Cb, new r(10)), i(this, $, !0), i(this, wb, void 0), i(this, Tb, 0), i(this, Eb, 0), i(this, Db, void 0), i(this, Ob, 0), i(this, kb, 0), i(this, Ab, 0), i(this, jb, void 0), i(this, Mb, void 0), i(this, Nb, void 0), i(this, Pb, void 0), i(this, Fb, void 0), i(this, Ib, void 0), i(this, Lb, void 0), i(this, Rb, []), i(this, zb, void 0), e(this, "unload", () => {
9169
9195
  var e;
9170
- this.logger.debug("Unloading module..."), this.emitter.off("page active", s(Hb, this)), this.disconnect("Unloading"), (e = this.connectionImpl) == null || e.unload(), a(jb, this, void 0), this.logger.debug("Unloaded module");
9196
+ this.logger.debug("Unloading module..."), this.emitter.off("page active", s(Jb, this)), this.disconnect("Unloading"), (e = this.connectionImpl) == null || e.unload(), a(Lb, this, void 0), this.logger.debug("Unloaded module");
9171
9197
  }), e(this, "suspend", () => {
9172
9198
  var e, t;
9173
- a($, this, !1), (e = s(xb, this)) == null || e.abort(), (t = this.connectionImpl) == null || t.suspend();
9199
+ a($, this, !1), (e = s(Db, this)) == null || e.abort(), (t = this.connectionImpl) == null || t.suspend();
9174
9200
  }), e(this, "unsuspend", () => {
9175
9201
  var e;
9176
9202
  a($, this, !0), (e = this.connectionImpl) == null || e.unsuspend(), this.connect();
9177
9203
  }), e(this, "getState", () => this.connectionImpl ? this.connectionImpl.getState() : "disconnected"), e(this, "getStatistics", () => {
9178
9204
  var e;
9179
- let t = s(Sb, this) > 0 ? s(Cb, this) / s(Sb, this) : 0;
9205
+ let t = s(Ob, this) > 0 ? s(kb, this) / s(Ob, this) : 0;
9180
9206
  if (!this.connectionImpl) {
9181
- let e = s(Pb, this).call(this);
9207
+ let e = s(Bb, this).call(this);
9182
9208
  return {
9183
9209
  rtt: {
9184
9210
  min: 0,
@@ -9187,17 +9213,17 @@ var sb = (e) => {
9187
9213
  last: 0
9188
9214
  },
9189
9215
  estimatedBandwidth: 0,
9190
- connectCount: s(Cb, this),
9191
- backlogReconnectCount: s(wb, this),
9192
- connectionAttemptCount: s(Sb, this),
9216
+ connectCount: s(kb, this),
9217
+ backlogReconnectCount: s(Ab, this),
9218
+ connectionAttemptCount: s(Ob, this),
9193
9219
  connectionSuccessRatio: t,
9194
- timeToConnected: s(Ob, this),
9220
+ timeToConnected: s(Pb, this),
9195
9221
  edgeUrl: e == null ? void 0 : e.edgeUrl,
9196
9222
  connectionProtocol: e == null ? void 0 : e.connectionProtocol,
9197
9223
  transportSelectionReason: e == null ? void 0 : e.transportSelectionReason
9198
9224
  };
9199
9225
  }
9200
- let n = this.connectionImpl.getStatistics(), r = (e = this.linkQueue) == null ? void 0 : e.summary(gb);
9226
+ let n = this.connectionImpl.getStatistics(), r = (e = this.linkQueue) == null ? void 0 : e.summary(Sb);
9201
9227
  return x(x({}, n), {}, {
9202
9228
  linkQueue: r && {
9203
9229
  last: Math.round(r.last),
@@ -9205,41 +9231,41 @@ var sb = (e) => {
9205
9231
  max: Math.round(r.max),
9206
9232
  min: Math.round(r.min)
9207
9233
  },
9208
- rtt: yt(s(_b, this).items()),
9234
+ rtt: yt(s(Cb, this).items()),
9209
9235
  estimatedBandwidth: this.estimatedBandwidth,
9210
- connectCount: s(Cb, this),
9211
- backlogReconnectCount: s(wb, this),
9212
- connectionAttemptCount: s(Sb, this),
9236
+ connectCount: s(kb, this),
9237
+ backlogReconnectCount: s(Ab, this),
9238
+ connectionAttemptCount: s(Ob, this),
9213
9239
  connectionSuccessRatio: t,
9214
- timeToConnected: s(Ob, this)
9240
+ timeToConnected: s(Pb, this)
9215
9241
  });
9216
- }), i(this, Pb, () => s($, this) && s(Ab, this) ? s(Ab, this) : s(kb, this)), e(this, "connect", () => {
9217
- if (a($, this, !0), s(vb, this)) {
9242
+ }), i(this, Bb, () => s($, this) && s(Ib, this) ? s(Ib, this) : s(Fb, this)), e(this, "connect", () => {
9243
+ if (a($, this, !0), s(wb, this)) {
9218
9244
  var e;
9219
- (e = s(xb, this)) == null || e.abort();
9245
+ (e = s(Db, this)) == null || e.abort();
9220
9246
  return;
9221
9247
  }
9222
9248
  let t = performance.now();
9223
- s(Ob, this) === void 0 && a(Tb, this, t), s(Eb, this) === void 0 && a(Eb, this, t), a(vb, this, o(Rb, this, qb).call(this));
9224
- }), i(this, Fb, () => {
9225
- s(Ob, this) !== void 0 || s(Tb, this) === void 0 || !s($, this) || (a(Ob, this, performance.now() - s(Tb, this)), a(Tb, this, void 0));
9249
+ s(Pb, this) === void 0 && a(jb, this, t), s(Mb, this) === void 0 && a(Mb, this, t), a(wb, this, o(Wb, this, $b).call(this));
9250
+ }), i(this, Vb, () => {
9251
+ s(Pb, this) !== void 0 || s(jb, this) === void 0 || !s($, this) || (a(Pb, this, performance.now() - s(jb, this)), a(jb, this, void 0));
9226
9252
  }), e(this, "disconnect", (e = "Disconnect Requested") => {
9227
9253
  var t, n;
9228
- a($, this, !1), (t = s(xb, this)) == null || t.abort(), s(Bb, this).call(this), (n = this.connectionImpl) == null || n.close(e);
9254
+ a($, this, !1), (t = s(Db, this)) == null || t.abort(), s(Kb, this).call(this), (n = this.connectionImpl) == null || n.close(e);
9229
9255
  }), e(this, "reconnect", (e) => {
9230
9256
  this.disconnect(e), this.connect();
9231
- }), i(this, Ib, t(function* () {
9257
+ }), i(this, Hb, t(function* () {
9232
9258
  try {
9233
9259
  return yield d.apiClient.connect(d.config.options.getOptions());
9234
9260
  } catch (e) {
9235
9261
  if (f(e)) switch (e.status) {
9236
- case 401: throw d.emitter.emit("error", Kn(e)), Kn(e);
9237
- case 403: throw d.emitter.emit("error", tr(e.message)), tr(e.message);
9262
+ case 401: throw Kn(e);
9263
+ case 403: throw tr(e.message);
9238
9264
  default: break;
9239
9265
  }
9240
- throw d.emitter.emit("error", Qn(e instanceof Error ? e : void 0)), e;
9266
+ throw Qn(e instanceof Error ? e : void 0);
9241
9267
  }
9242
- })), i(this, Lb, t(function* () {
9268
+ })), i(this, Ub, t(function* () {
9243
9269
  let e = performance.now(), t = () => performance.now() - e, r = globalThis.AbortController ? new AbortController() : void 0, i = setTimeout(() => r == null ? void 0 : r.abort(), n.PING_TIMEOUT);
9244
9270
  try {
9245
9271
  return yield fetch(new URL("/api/v4/connect/ping", d.config.options.get("url")).toString(), {
@@ -9251,147 +9277,147 @@ var sb = (e) => {
9251
9277
  } finally {
9252
9278
  clearTimeout(i);
9253
9279
  }
9254
- })), i(this, zb, () => {
9255
- s(Bb, this).call(this), a(Nb, this, setTimeout(() => {
9280
+ })), i(this, Gb, () => {
9281
+ s(Kb, this).call(this), a(zb, this, setTimeout(() => {
9256
9282
  var e;
9257
- !s(jb, this) || ((e = this.connectionImpl) == null ? void 0 : e.getState()) !== "connected" || (this.logger.debug("Connection remained stable for long enough, clearing cached fallback edges"), s(jb, this).reset(), a(Nb, this, void 0));
9283
+ !s(Lb, this) || ((e = this.connectionImpl) == null ? void 0 : e.getState()) !== "connected" || (this.logger.debug("Connection remained stable for long enough, clearing cached fallback edges"), s(Lb, this).reset(), a(zb, this, void 0));
9258
9284
  }, n.EDGE_SELECTOR_RESET_TIMEOUT));
9259
- }), i(this, Bb, () => {
9260
- s(Nb, this) !== void 0 && (clearTimeout(s(Nb, this)), a(Nb, this, void 0));
9261
- }), i(this, Vb, function() {
9285
+ }), i(this, Kb, () => {
9286
+ s(zb, this) !== void 0 && (clearTimeout(s(zb, this)), a(zb, this, void 0));
9287
+ }), i(this, qb, function() {
9262
9288
  var e = t(function* (e) {
9263
- a(xb, d, globalThis.AbortController ? new AbortController() : void 0);
9289
+ a(Db, d, globalThis.AbortController ? new AbortController() : void 0);
9264
9290
  try {
9265
- let c = yield d.config.reconnectHandler({ reconnectRetries: s(yb, d) });
9291
+ let c = yield d.config.reconnectHandler({ reconnectRetries: s(Tb, d) });
9266
9292
  if (!s($, d)) return !1;
9267
9293
  if (!c) return a($, d, !1), d.emitter.emit("error", $n()), !1;
9268
9294
  if (!d.config.documentState.isVisible) {
9269
9295
  var t, r, i, o;
9270
- if ((t = s(xb, d)) != null && t.signal.aborted) return s($, d);
9271
- let e = n.HIDDEN_BACKOFF_BASE_MS * 2 ** (a(bb, d, (r = s(bb, d), i = r++, r)), i), c = Math.min(n.HIDDEN_BACKOFF_MAX_MS, e);
9272
- return d.logger.info("Page hidden, backing off before retrying", { delay: c }), yield cn(c, (o = s(xb, d)) == null ? void 0 : o.signal).catch(() => void 0), s($, d);
9296
+ if ((t = s(Db, d)) != null && t.signal.aborted) return s($, d);
9297
+ let e = n.HIDDEN_BACKOFF_BASE_MS * 2 ** (a(Eb, d, (r = s(Eb, d), i = r++, r)), i), c = Math.min(n.HIDDEN_BACKOFF_MAX_MS, e);
9298
+ return d.logger.info("Page hidden, backing off before retrying", { delay: c }), yield cn(c, (o = s(Db, d)) == null ? void 0 : o.signal).catch(() => void 0), s($, d);
9273
9299
  }
9274
- return a(bb, d, 0), s(Wb, d).call(d) ? (d.logger.info("Reconnect burst detected, applying backoff before retrying"), yield cn(n.RECONNECT_BACKOFF_MS)) : d.logger.info(e === "cached_edge" ? "Retrying with next cached edge without backoff" : "Retrying without backoff"), s($, d);
9300
+ return a(Eb, d, 0), s(Xb, d).call(d) ? (d.logger.info("Reconnect burst detected, applying backoff before retrying"), yield cn(n.RECONNECT_BACKOFF_MS)) : d.logger.info(e === "cached_edge" ? "Retrying with next cached edge without backoff" : "Retrying without backoff"), s($, d);
9275
9301
  } finally {
9276
- a(xb, d, void 0);
9302
+ a(Db, d, void 0);
9277
9303
  }
9278
9304
  });
9279
9305
  return function(t) {
9280
9306
  return e.apply(this, arguments);
9281
9307
  };
9282
- }()), i(this, Hb, (e) => {
9308
+ }()), i(this, Jb, (e) => {
9283
9309
  if (e) {
9284
9310
  var t;
9285
- (t = s(xb, this)) == null || t.abort();
9311
+ (t = s(Db, this)) == null || t.abort();
9286
9312
  }
9287
- }), i(this, Ub, (e = performance.now()) => {
9288
- s(Gb, this).call(this, e), s(Mb, this).push(e);
9289
- }), i(this, Wb, (e = performance.now()) => (s(Gb, this).call(this, e), s(Mb, this).length >= n.RECONNECT_BACKOFF_BURST_THRESHOLD)), i(this, Gb, (e) => {
9290
- for (; s(Mb, this).length > 0;) {
9291
- let t = s(Mb, this)[0];
9313
+ }), i(this, Yb, (e = performance.now()) => {
9314
+ s(Zb, this).call(this, e), s(Rb, this).push(e);
9315
+ }), i(this, Xb, (e = performance.now()) => (s(Zb, this).call(this, e), s(Rb, this).length >= n.RECONNECT_BACKOFF_BURST_THRESHOLD)), i(this, Zb, (e) => {
9316
+ for (; s(Rb, this).length > 0;) {
9317
+ let t = s(Rb, this)[0];
9292
9318
  if (t === void 0 || t > e - n.RECONNECT_BACKOFF_BURST_WINDOW_MS) return;
9293
- s(Mb, this).shift();
9319
+ s(Rb, this).shift();
9294
9320
  }
9295
9321
  }), this.logger = l, this.emitter = c, this.config = u, this.apiClient = new g({
9296
9322
  publicEndpoint: this.config.options.get("url").toString(),
9297
9323
  tokenFactory: () => this.config.options.get("authenticationToken")
9298
- }), this.emitter.on("page active", s(Hb, this));
9324
+ }), this.emitter.on("page active", s(Jb, this));
9299
9325
  }
9300
9326
  get rtt() {
9301
- return s(_b, this).items().length > 0 ? gt(s(_b, this).items()) : 0;
9327
+ return s(Cb, this).items().length > 0 ? gt(s(Cb, this).items()) : 0;
9302
9328
  }
9303
9329
  get isMoq() {
9304
- return this.connectionImpl instanceof Ly;
9330
+ return this.connectionImpl instanceof Uy;
9305
9331
  }
9306
9332
  get estimatedBandwidth() {
9307
9333
  if (this.connectionImpl && "estimatedBandwidth" in this.connectionImpl) {
9308
9334
  let e = this.connectionImpl.estimatedBandwidth;
9309
9335
  if (e && Number.isFinite(e)) return e;
9310
9336
  }
9311
- return ab(this.rtt);
9337
+ return db(this.rtt);
9312
9338
  }
9313
9339
  get linkQueue() {
9314
9340
  var e;
9315
9341
  return (e = this.connectionImpl) == null ? void 0 : e.linkQueue;
9316
9342
  }
9317
9343
  get firstConnectStartTime() {
9318
- return s(Eb, this);
9344
+ return s(Mb, this);
9319
9345
  }
9320
9346
  get lastConnectionTime() {
9321
- return s(Db, this);
9347
+ return s(Nb, this);
9322
9348
  }
9323
9349
  };
9324
- mb = Kb;
9325
- function qb() {
9350
+ bb = Qb;
9351
+ function $b() {
9326
9352
  var e = this;
9327
9353
  return t(function* () {
9328
- let t = new pb({ edgeUrl: e.config.options.get("edgeUrl") });
9329
- for (a(jb, e, t), s(Bb, e).call(e), a(yb, e, 0), a(bb, e, 0), a(Mb, e, []);;) {
9354
+ let t = new yb({ edgeUrl: e.config.options.get("edgeUrl") });
9355
+ for (a(Lb, e, t), s(Kb, e).call(e), a(Tb, e, 0), a(Eb, e, 0), a(Rb, e, []);;) {
9330
9356
  var n, r;
9331
9357
  let u = "standard";
9332
- a(Sb, e, (n = s(Sb, e), n++, n)), s(Ub, e).call(e);
9358
+ a(Ob, e, (n = s(Ob, e), n++, n)), s(Yb, e).call(e);
9333
9359
  let f = !1;
9334
- a(Ab, e, {});
9360
+ a(Ib, e, {});
9335
9361
  try {
9336
9362
  var i, o;
9337
- let [n, r] = yield Promise.all([s(Ib, e).call(e), s(Lb, e).call(e)]);
9338
- if (s(_b, e).clear(), r !== void 0 && s(_b, e).push(r / 2), !s($, e)) break;
9363
+ let [n, r] = yield Promise.all([s(Hb, e).call(e), s(Ub, e).call(e)]);
9364
+ if (s(Cb, e).clear(), r !== void 0 && s(Cb, e).push(r / 2), !s($, e)) break;
9339
9365
  let l = t.select(n.edges);
9340
9366
  if (!l) throw new A("Failed to resolve edge url", {
9341
9367
  isFatal: !0,
9342
9368
  code: "failed_to_resolve_edge_url"
9343
9369
  });
9344
- a(Ab, e, { edgeUrl: Pv(cb(l)) });
9370
+ a(Ib, e, { edgeUrl: Pv(mb(l)) });
9345
9371
  try {
9346
- c(n) ? e.connectionImpl = yield Ly.start(e.emitter, e.logger, e.apiClient, x(x({}, e.config), {}, {
9372
+ c(n) ? e.connectionImpl = yield Uy.start(e.emitter, e.logger, e.apiClient, x(x({}, e.config), {}, {
9347
9373
  connectInfo: n,
9348
9374
  edgeUrl: l,
9349
- onTransportConnected: s(Fb, e)
9350
- }), s(_b, e)) : (d(typeof l == "string", "Edge URL is expected to be a string"), e.connectionImpl = yield ob.start(e.emitter, e.logger, x(x({}, e.config), {}, {
9375
+ onTransportConnected: s(Vb, e)
9376
+ }), s(Cb, e)) : (d(typeof l == "string", "Edge URL is expected to be a string"), e.connectionImpl = yield fb.start(e.emitter, e.logger, x(x({}, e.config), {}, {
9351
9377
  connectInfo: n,
9352
9378
  edgeUrl: l,
9353
- onTransportConnected: s(Fb, e)
9354
- }), s(_b, e)));
9379
+ onTransportConnected: s(Vb, e)
9380
+ }), s(Cb, e)));
9355
9381
  } catch (e) {
9356
9382
  throw u = "cached_edge", e;
9357
9383
  }
9358
- a(kb, e, e.connectionImpl.getStatistics()), a(Ab, e, void 0), s($, e) || e.connectionImpl.close("Disconnected during connect"), s(zb, e).call(e), a(Cb, e, (i = s(Cb, e), i++, i)), a(yb, e, 0), a(bb, e, 0), a(Db, e, performance.now()), s(Fb, e).call(e);
9384
+ a(Fb, e, e.connectionImpl.getStatistics()), a(Ib, e, void 0), s($, e) || e.connectionImpl.close("Disconnected during connect"), s(Gb, e).call(e), a(kb, e, (i = s(kb, e), i++, i)), a(Tb, e, 0), a(Eb, e, 0), a(Nb, e, performance.now()), s(Vb, e).call(e);
9359
9385
  let f = yield e.connectionImpl.closed();
9360
- e.connectionImpl.closedForBacklog && a(wb, e, (o = s(wb, e), o++, o)), e.logger.info("Connection closed", { reason: f instanceof Error ? f.message : f }), u = "cached_edge";
9386
+ e.connectionImpl.closedForBacklog && a(Ab, e, (o = s(Ab, e), o++, o)), e.logger.info("Connection closed", { reason: f instanceof Error ? f.message : f }), u = "cached_edge";
9361
9387
  } catch (n) {
9362
- if (e.logger.warn("Failed to connect", n), !e.connectionImpl && (e.config.documentState.isVisible || hb(n))) {
9388
+ if (e.logger.warn("Failed to connect", n), !e.connectionImpl && (e.config.documentState.isVisible || xb(n))) {
9363
9389
  var l;
9364
- a(yb, e, (l = s(yb, e), l++, l));
9390
+ a(Tb, e, (l = s(Tb, e), l++, l));
9365
9391
  }
9366
9392
  let r = t.shiftedEdge();
9367
9393
  r && e.emitter.emit("telemetry event", {
9368
9394
  code: "shifted_edge",
9369
- edgeUrl: cb(r)
9395
+ edgeUrl: mb(r)
9370
9396
  }), n instanceof A ? (e.emitter.emit("error", n), f = n.isFatal()) : n instanceof Error && e.emitter.emit("error", new A(n.message, {
9371
9397
  code: "start_failed",
9372
9398
  isFatal: !1
9373
9399
  }));
9374
9400
  }
9375
- if ((r = e.connectionImpl) == null || r.unload(), e.connectionImpl = void 0, s(Bb, e).call(e), f) {
9401
+ if ((r = e.connectionImpl) == null || r.unload(), e.connectionImpl = void 0, s(Kb, e).call(e), f) {
9376
9402
  a($, e, !1);
9377
9403
  break;
9378
9404
  }
9379
- if (!s($, e) || !(yield s(Vb, e).call(e, u === "cached_edge" && t.hasRemainingEdges() ? "cached_edge" : "standard"))) break;
9405
+ if (!s($, e) || !(yield s(qb, e).call(e, u === "cached_edge" && t.hasRemainingEdges() ? "cached_edge" : "standard"))) break;
9380
9406
  }
9381
- a(Ab, e, void 0), a(jb, e, void 0), s(Bb, e).call(e), a(vb, e, void 0), s($, e) && e.connect();
9407
+ a(Ib, e, void 0), a(Lb, e, void 0), s(Kb, e).call(e), a(wb, e, void 0), s($, e) && e.connect();
9382
9408
  })();
9383
9409
  }
9384
- e(Kb, "PING_TIMEOUT", 1e3), e(Kb, "RECONNECT_BACKOFF_MS", 1e3), e(Kb, "RECONNECT_BACKOFF_BURST_WINDOW_MS", 5e3), e(Kb, "RECONNECT_BACKOFF_BURST_THRESHOLD", 3), e(Kb, "EDGE_SELECTOR_RESET_TIMEOUT", 60 * 1e3), e(Kb, "HIDDEN_BACKOFF_BASE_MS", 1e3), e(Kb, "HIDDEN_BACKOFF_MAX_MS", 3e4), e(Kb, "create", (e, t, n) => new mb(e, t, n));
9410
+ e(Qb, "PING_TIMEOUT", 1e3), e(Qb, "RECONNECT_BACKOFF_MS", 1e3), e(Qb, "RECONNECT_BACKOFF_BURST_WINDOW_MS", 5e3), e(Qb, "RECONNECT_BACKOFF_BURST_THRESHOLD", 3), e(Qb, "EDGE_SELECTOR_RESET_TIMEOUT", 60 * 1e3), e(Qb, "HIDDEN_BACKOFF_BASE_MS", 1e3), e(Qb, "HIDDEN_BACKOFF_MAX_MS", 3e4), e(Qb, "create", (e, t, n) => new bb(e, t, n));
9385
9411
  //#endregion
9386
9412
  //#region ../../libs/web-sdk/src/modules/ConstraintCapModule.ts
9387
- var Jb, Yb = () => ({
9413
+ var ex, tx = () => ({
9388
9414
  video: x(x({}, mn()), {}, { bitRate: pn() }),
9389
9415
  audio: { bitRate: pn() }
9390
- }), Xb = () => ({
9416
+ }), nx = () => ({
9391
9417
  width: window.innerWidth,
9392
9418
  height: window.innerHeight,
9393
9419
  bitRate: pn()
9394
- }), Zb = class t {
9420
+ }), rx = class t {
9395
9421
  constructor(n, r, i, a) {
9396
9422
  e(this, "emitter", void 0), e(this, "timers", new k()), 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", () => {
9397
9423
  var e;
@@ -9413,7 +9439,7 @@ var Jb, Yb = () => ({
9413
9439
  this.timers.unload();
9414
9440
  }), e(this, "setUserSpecifiedCap", (e) => {
9415
9441
  var t;
9416
- let n = (t = this.getUserSpecifiedCap()) == null ? Yb() : t;
9442
+ let n = (t = this.getUserSpecifiedCap()) == null ? tx() : t;
9417
9443
  this.userSpecifiedCap = x(x({}, n), {}, {
9418
9444
  video: x(x({}, n.video), e.video),
9419
9445
  audio: x(x({}, n.audio), e.audio)
@@ -9437,7 +9463,7 @@ var Jb, Yb = () => ({
9437
9463
  });
9438
9464
  }), e(this, "evaluateConstraintCap", () => {
9439
9465
  var e, t, n, r;
9440
- let i = this.sizeBasedResolutionCapEnabled ? x(x({}, Yb()), {}, { video: Xb() }) : Yb();
9466
+ let i = this.sizeBasedResolutionCapEnabled ? x(x({}, tx()), {}, { video: nx() }) : tx();
9441
9467
  if (!this.resizeObserver) {
9442
9468
  let e = this.element.getBoundingClientRect();
9443
9469
  this.elementSize = {
@@ -9474,20 +9500,20 @@ var Jb, Yb = () => ({
9474
9500
  this._sizeBasedResolutionCapEnabled = e, this.evaluateConstraintCap();
9475
9501
  }
9476
9502
  };
9477
- Jb = Zb, e(Zb, "CHECK_SIZE_INTERVAL", 1e3), e(Zb, "create", (e, t, n, r) => new Jb(e, t, n, r));
9503
+ ex = rx, e(rx, "CHECK_SIZE_INTERVAL", 1e3), e(rx, "create", (e, t, n, r) => new ex(e, t, n, r));
9478
9504
  //#endregion
9479
9505
  //#region ../../libs/web-sdk/src/renditionKey.ts
9480
- var Qb = (e, t) => `${e}\u0000${t == null ? "" : t}`, $b = (e, t, n, r) => e === n && t === r, ex = class {
9506
+ var ix = (e, t) => `${e}\u0000${t == null ? "" : t}`, ax = (e, t, n, r) => e === n && t === r, ox = class {
9481
9507
  constructor() {
9482
9508
  e(this, "lastKey", void 0), e(this, "shouldNotify", (e, t) => {
9483
- let n = Qb(e, t);
9509
+ let n = ix(e, t);
9484
9510
  return this.lastKey === n ? !1 : (this.lastKey = n, !0);
9485
9511
  });
9486
9512
  }
9487
- }, tx = 5, nx = 40, rx = 1, ix = 3e4, ax = 5, ox = (e) => {
9513
+ }, sx = 5, cx = 40, lx = 1, ux = 3e4, dx = 5, fx = (e) => {
9488
9514
  var t, n;
9489
9515
  return ((t = e.maxCompositionOffsetMs) == null ? 0 : t) - ((n = e.minCompositionOffsetMs) == null ? 0 : n);
9490
- }, sx = (e, t, n) => {
9516
+ }, px = (e, t, n) => {
9491
9517
  let r = [];
9492
9518
  for (let i of e) {
9493
9519
  let e = r[r.length - 1];
@@ -9501,10 +9527,10 @@ var Qb = (e, t) => `${e}\u0000${t == null ? "" : t}`, $b = (e, t, n, r) => e ===
9501
9527
  });
9502
9528
  }
9503
9529
  return r;
9504
- }, cx = (e, t) => {
9530
+ }, mx = (e, t) => {
9505
9531
  let n = e[e.length - 1];
9506
9532
  n && n.end > t && n.start < t && (n.end = t);
9507
- }, lx = 100, ux = 1e3, dx = class n {
9533
+ }, hx = 100, gx = 1e3, _x = class n {
9508
9534
  constructor(t, n, r, i, a = !1, o = !1, s = !1) {
9509
9535
  e(this, "backgroundTimersEnabled", !1), e(this, "timers", this.createTimers()), e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "trackContexts", void 0), e(this, "playbackSource", void 0), e(this, "isLoaded", !1), e(this, "isSuspended", !1), e(this, "_webCodecsInUse", void 0), e(this, "_audioWebCodecsInUse", void 0), e(this, "_offscreenCanvasInUse", void 0), e(this, "currentVideoDecodeRate", 2), e(this, "decodeRateGraceIntervals", 3), e(this, "isAudioEmitRetryScheduled", !1), e(this, "videoKeyframeTimestamps", []), e(this, "load", () => {
9510
9536
  this.isLoaded = !0, this.armTimers(), this.emitter.on("init segment", this.onInitSegment), this.emitter.on("coded sample", this.decode), this.emitter.on("flush buffers", this.resetContexts);
@@ -9522,8 +9548,8 @@ var Qb = (e, t) => `${e}\u0000${t == null ? "" : t}`, $b = (e, t, n, r) => e ===
9522
9548
  }), e(this, "unsuspend", () => {
9523
9549
  this.isSuspended = !1, this.emitDecodedFrames(), this._audioWebCodecsInUse && this.scheduleAudioEmitRetry();
9524
9550
  }), e(this, "armTimers", () => {
9525
- let e = this._audioWebCodecsInUse ? 20 : lx;
9526
- this.timers.setInterval(this.emitDecodedFrames, e), this.timers.setInterval(this.emitDecodeRate, ux);
9551
+ let e = this._audioWebCodecsInUse ? 20 : hx;
9552
+ this.timers.setInterval(this.emitDecodedFrames, e), this.timers.setInterval(this.emitDecodeRate, gx);
9527
9553
  }), e(this, "replaceTimers", () => {
9528
9554
  let e = this.isAudioEmitRetryScheduled;
9529
9555
  this.isAudioEmitRetryScheduled = !1, this.timers.unload(), this.timers = this.createTimers(), this.timers.isWorkerBackendUnavailable() && this.logger.warn("Background timer worker is unavailable (likely blocked by CSP or unsupported in this environment). Falling back to main-thread timers; hidden-tab playback may be throttled."), this.isLoaded && (this.armTimers(), e && this.scheduleAudioEmitRetry());
@@ -9592,27 +9618,27 @@ var Qb = (e, t) => `${e}\u0000${t == null ? "" : t}`, $b = (e, t, n, r) => e ===
9592
9618
  i.stream = `${e.channelId}/${e.renditionId}`;
9593
9619
  let c = (e.timestamp + a) / e.timescale * 1e3, l = e.duration / e.timescale * 1e3;
9594
9620
  l > 0 && (i.sampleDuration = l);
9595
- let u = i.sampleDuration || nx, d = e.timestamp / e.timescale * 1e3, f = a / e.timescale * 1e3, p = ox(i), m = (t = s[s.length - 1]) == null ? void 0 : t.end, h = Math.max(u * ax, p + ((n = i.frontierSampleDurationMs) == null ? u : n)), g = m !== void 0 && c + h < m;
9621
+ let u = i.sampleDuration || cx, d = e.timestamp / e.timescale * 1e3, f = a / e.timescale * 1e3, p = fx(i), m = (t = s[s.length - 1]) == null ? void 0 : t.end, h = Math.max(u * dx, p + ((n = i.frontierSampleDurationMs) == null ? u : n)), g = m !== void 0 && c + h < m;
9596
9622
  i.lastDecodeTimestampMs = g ? d : Math.max((r = i.lastDecodeTimestampMs) == null ? d : r, d);
9597
- let _ = i.channelId !== void 0 && !$b(i.channelId, i.renditionId, e.channelId, e.renditionId);
9623
+ let _ = i.channelId !== void 0 && !ax(i.channelId, i.renditionId, e.channelId, e.renditionId);
9598
9624
  i.channelId = e.channelId, i.renditionId = e.renditionId, (g || _) && (i.minCompositionOffsetMs = void 0, i.maxCompositionOffsetMs = void 0, i.hasAnchoredGop = !1, i.isReorderStructureStale = !0);
9599
9625
  let v = i.hasAnchoredGop === !0;
9600
9626
  if (e.isSync && (i.hasAnchoredGop = !0), !g && i.hasAnchoredGop) {
9601
9627
  var y, b;
9602
9628
  i.minCompositionOffsetMs = Math.min((y = i.minCompositionOffsetMs) == null ? f : y, f), i.maxCompositionOffsetMs = Math.max((b = i.maxCompositionOffsetMs) == null ? f : b, f), v && (i.isReorderStructureStale = !1);
9603
9629
  }
9604
- let ee = ox(i) > 0;
9630
+ let ee = fx(i) > 0;
9605
9631
  if (g) i.buffer = [{
9606
9632
  start: c,
9607
9633
  end: c + u
9608
9634
  }], i.frontierSampleDurationMs = u, e.type === "video" && (this.videoKeyframeTimestamps = []);
9609
9635
  else {
9610
9636
  var te;
9611
- !ee && !i.isReorderStructureStale && cx(s, c + u);
9637
+ !ee && !i.isReorderStructureStale && mx(s, c + u);
9612
9638
  let e = (te = s[s.length - 1]) == null ? void 0 : te.end;
9613
- (e === void 0 || c + u >= e) && (i.frontierSampleDurationMs = u), tn(s, c, c + u, tx);
9639
+ (e === void 0 || c + u >= e) && (i.frontierSampleDurationMs = u), tn(s, c, c + u, sx);
9614
9640
  }
9615
- if (rn(i.buffer, this.playbackSource.currentTime - ix), i.playableRangesCache = void 0, e.type === "video" && e.isSync) {
9641
+ if (rn(i.buffer, this.playbackSource.currentTime - ux), i.playableRangesCache = void 0, e.type === "video" && e.isSync) {
9616
9642
  let e = this.videoKeyframeTimestamps[this.videoKeyframeTimestamps.length - 1];
9617
9643
  e !== void 0 && c < e && (this.videoKeyframeTimestamps = []), this.videoKeyframeTimestamps.push(c), this.videoKeyframeTimestamps.length > 20 && (this.videoKeyframeTimestamps = this.videoKeyframeTimestamps.slice(-20));
9618
9644
  }
@@ -9649,11 +9675,11 @@ var Qb = (e, t) => `${e}\u0000${t == null ? "" : t}`, $b = (e, t, n, r) => e ===
9649
9675
  }
9650
9676
  this.currentVideoDecodeRate = this.calculateVideoDecodeRate(), this.emitter.emit("video decode rate", this.currentVideoDecodeRate);
9651
9677
  }), e(this, "playableRanges", (e) => {
9652
- let t = ox(e);
9678
+ let t = fx(e);
9653
9679
  if (t <= 0) return e.buffer;
9654
9680
  if (e.playableRangesCache === void 0) {
9655
9681
  var n, r;
9656
- e.playableRangesCache = sx(e.buffer, ((n = e.lastDecodeTimestampMs) == null ? Infinity : n) - Math.max(0, -((r = e.minCompositionOffsetMs) == null ? 0 : r)) - rx, t + (e.sampleDuration || nx) + rx);
9682
+ e.playableRangesCache = px(e.buffer, ((n = e.lastDecodeTimestampMs) == null ? Infinity : n) - Math.max(0, -((r = e.minCompositionOffsetMs) == null ? 0 : r)) - lx, t + (e.sampleDuration || cx) + lx);
9657
9683
  }
9658
9684
  return e.playableRangesCache;
9659
9685
  }), e(this, "updateBufferState", () => {
@@ -9740,7 +9766,7 @@ var Qb = (e, t) => `${e}\u0000${t == null ? "" : t}`, $b = (e, t, n, r) => e ===
9740
9766
  var e;
9741
9767
  if (this._offscreenCanvasInUse) return (e = this.trackContexts.get("video")) == null ? void 0 : e.decoderContext.videoTrack;
9742
9768
  }
9743
- }, fx, px = class {
9769
+ }, vx, yx = class {
9744
9770
  constructor(t) {
9745
9771
  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, "isBehindAnotherApp", !1), e(this, "unload", () => {
9746
9772
  this.emitter.off("fullscreen app switch", this.onFullscreenAppSwitch), window.removeEventListener("focus", this.onVisibilityChanged), document.removeEventListener("visibilitychange", this.onVisibilityChanged), window.removeEventListener("pageshow", this.onPageShow), window.removeEventListener("pagehide", this.onPageHide), window.removeEventListener("online", this.onOnline), window.removeEventListener("offline", this.onOffline);
@@ -9770,12 +9796,12 @@ var Qb = (e, t) => `${e}\u0000${t == null ? "" : t}`, $b = (e, t, n, r) => e ===
9770
9796
  return document.visibilityState === "visible" && !this.isBehindAnotherApp;
9771
9797
  }
9772
9798
  };
9773
- fx = px, e(px, "create", (e) => new fx(e));
9799
+ vx = yx, e(yx, "create", (e) => new vx(e));
9774
9800
  //#endregion
9775
9801
  //#region ../../libs/web-sdk/src/modules/EventModule.ts
9776
- var mx, hx = (e) => (t, n, r) => t.timestamp <= n || t.timestampAdded <= r - e, gx = class t {
9802
+ var bx, xx = (e) => (t, n, r) => t.timestamp <= n || t.timestampAdded <= r - e, Sx = class t {
9777
9803
  constructor(n, r, i) {
9778
- e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "waitingEvents", []), e(this, "isTriggered", hx(t.EVENT_TIMEOUT)), e(this, "timeSource", void 0), e(this, "timers", new k()), e(this, "load", () => {
9804
+ e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "waitingEvents", []), e(this, "isTriggered", xx(t.EVENT_TIMEOUT)), e(this, "timeSource", void 0), e(this, "timers", new k()), e(this, "load", () => {
9779
9805
  this.timers.setInterval(this.onBufferedStateChanged, t.EVENT_CHECK_INTERVAL), this.emitter.on("add event", this.addEvent);
9780
9806
  }), e(this, "unload", () => {
9781
9807
  this.timers.unload(), this.emitter.off("add event", this.addEvent);
@@ -9802,10 +9828,10 @@ var mx, hx = (e) => (t, n, r) => t.timestamp <= n || t.timestampAdded <= r - e,
9802
9828
  }), this.logger = r, this.emitter = n, this.timeSource = i;
9803
9829
  }
9804
9830
  };
9805
- mx = gx, e(gx, "EVENT_TIMEOUT", 5e3), e(gx, "EVENT_CHECK_INTERVAL", 20), e(gx, "create", (e, t, n) => new mx(e, t, n));
9831
+ bx = Sx, e(Sx, "EVENT_TIMEOUT", 5e3), e(Sx, "EVENT_CHECK_INTERVAL", 20), e(Sx, "create", (e, t, n) => new bx(e, t, n));
9806
9832
  //#endregion
9807
9833
  //#region ../../libs/web-sdk/src/modules/JitterModule.ts
9808
- var _x = 1e3, vx = 50, yx = class t {
9834
+ var Cx = 1e3, wx = 50, Tx = class t {
9809
9835
  constructor(t) {
9810
9836
  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", () => {
9811
9837
  this.logger.debug("JitterModule loaded");
@@ -9826,9 +9852,9 @@ var _x = 1e3, vx = 50, yx = class t {
9826
9852
  this.trackingState.set(n, {
9827
9853
  lastArrivalTime: i,
9828
9854
  lastTimestampMs: a,
9829
- jitterSamples: new r(_x),
9830
- interArrivalTimes: new r(_x)
9831
- }), this.runningJitter.set(n, 0), this.recentJitterSamples.set(n, new r(vx));
9855
+ jitterSamples: new r(Cx),
9856
+ interArrivalTimes: new r(Cx)
9857
+ }), this.runningJitter.set(n, 0), this.recentJitterSamples.set(n, new r(wx));
9832
9858
  return;
9833
9859
  }
9834
9860
  let s = a - o.lastTimestampMs;
@@ -9841,7 +9867,7 @@ var _x = 1e3, vx = 50, yx = class t {
9841
9867
  let u = (t = this.runningJitter.get(n)) == null ? 0 : t, d = u + (l - u) / 16;
9842
9868
  this.runningJitter.set(n, d);
9843
9869
  let f = this.recentJitterSamples.get(n);
9844
- f || (f = new r(vx), this.recentJitterSamples.set(n, f)), f.push(l), o.lastArrivalTime = i, o.lastTimestampMs = a;
9870
+ f || (f = new r(wx), this.recentJitterSamples.set(n, f)), f.push(l), o.lastArrivalTime = i, o.lastTimestampMs = a;
9845
9871
  }
9846
9872
  getJitterForType(e) {
9847
9873
  for (let [i, a] of this.trackingState) if (i.startsWith(e)) {
@@ -9872,10 +9898,10 @@ var _x = 1e3, vx = 50, yx = class t {
9872
9898
  videoJitter: this.getJitterForType("video")
9873
9899
  };
9874
9900
  }
9875
- }, bx = () => window.AudioContext || window.webkitAudioContext, xx = class r extends ne {
9901
+ }, Ex = () => window.AudioContext || window.webkitAudioContext, Dx = class r extends ne {
9876
9902
  constructor() {
9877
9903
  var i;
9878
- super(), i = this, e(this, "context", new (bx())()), e(this, "timers", k.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* () {
9904
+ super(), i = this, e(this, "context", new (Ex())()), e(this, "timers", k.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* () {
9879
9905
  let e = !0, t = i.context.resume();
9880
9906
  t.then(() => {
9881
9907
  e = !1;
@@ -9910,10 +9936,10 @@ var _x = 1e3, vx = 50, yx = class t {
9910
9936
  return this.context.state;
9911
9937
  }
9912
9938
  };
9913
- e(xx, "CHECK_INTERVAL", 1e3);
9939
+ e(Dx, "CHECK_INTERVAL", 1e3);
9914
9940
  //#endregion
9915
9941
  //#region ../../libs/web-audio-player/src/AudioPlayer.ts
9916
- var Sx, Cx = 150, wx = 400, Tx = (e) => e === void 0 ? 5 : e <= Cx ? 1 : e <= wx ? 2 : 5, Ex = class extends ne {
9942
+ var Ox, kx = 150, Ax = 400, jx = (e) => e === void 0 ? 5 : e <= kx ? 1 : e <= Ax ? 2 : 5, Mx = class extends ne {
9917
9943
  get isContextRunning() {
9918
9944
  var e;
9919
9945
  return ((e = this.audio) == null ? void 0 : e.state) === "running";
@@ -9960,7 +9986,7 @@ var Sx, Cx = 150, wx = 400, Tx = (e) => e === void 0 ? 5 : e <= Cx ? 1 : e <= wx
9960
9986
  return this._bufferTime;
9961
9987
  }
9962
9988
  set bufferTime(e) {
9963
- this._bufferTime = e, this.audioBufferMultiplier = Tx(e);
9989
+ this._bufferTime = e, this.audioBufferMultiplier = jx(e);
9964
9990
  }
9965
9991
  get sinkPaused() {
9966
9992
  return this._sinkPaused;
@@ -10066,7 +10092,7 @@ var Sx, Cx = 150, wx = 400, Tx = (e) => e === void 0 ? 5 : e <= Cx ? 1 : e <= wx
10066
10092
  this.ignoreSuspendCalls = !1, this.emit("state change", "suspended");
10067
10093
  }), e(this, "getAudioContext", () => this.audio ? this.audio : this.setupContext()), e(this, "setupContext", () => {
10068
10094
  var e, t, r;
10069
- return (e = this.audio) == null || e.unload(), this.audio = new xx(), this.audio.on("state", (e) => {
10095
+ return (e = this.audio) == null || e.unload(), this.audio = new Dx(), this.audio.on("state", (e) => {
10070
10096
  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);
10071
10097
  }), this.audio.on("stuck", () => {
10072
10098
  if (!this.reInitWhenStuck) {
@@ -10077,7 +10103,7 @@ var Sx, Cx = 150, wx = 400, Tx = (e) => e === void 0 ? 5 : e <= Cx ? 1 : e <= wx
10077
10103
  }), (t = this.gainNode) == null || t.disconnect(), this.gainNode = this.audio.createGain(), this.setGain(this._volume), this.startTime = this.audio.currentTime, (r = this.splitter) == null || r.disconnect(), this.splitter = this.audio.createSplitter(), this.audio;
10078
10104
  }), e(this, "setGain", (e) => {
10079
10105
  this.gainNode && (this.gainNode.gain.value = this._muted ? 0 : e);
10080
- }), this._muted = o, this._userProvidedMuted = o, this.logger = i, this.clockSource = a, this.reInitWhenStuck = s, this._bufferTime = c, this.audioBufferMultiplier = Tx(c);
10106
+ }), this._muted = o, this._userProvidedMuted = o, this.logger = i, this.clockSource = a, this.reInitWhenStuck = s, this._bufferTime = c, this.audioBufferMultiplier = jx(c);
10081
10107
  }
10082
10108
  useMediaStreamDestination() {
10083
10109
  var e;
@@ -10090,10 +10116,10 @@ var Sx, Cx = 150, wx = 400, Tx = (e) => e === void 0 ? 5 : e <= Cx ? 1 : e <= wx
10090
10116
  return (e = this.gainNode) == null || e.connect(t), t;
10091
10117
  }
10092
10118
  };
10093
- Sx = Ex, e(Ex, "create", (e, t, n) => new Sx(e, t, n));
10119
+ Ox = Mx, e(Mx, "create", (e, t, n) => new Ox(e, t, n));
10094
10120
  //#endregion
10095
10121
  //#region ../../libs/web-sdk/src/players/VideoPlayer.ts
10096
- var Dx, Ox = class {
10122
+ var Nx, Px = class {
10097
10123
  constructor(t, n, r, i, a, o) {
10098
10124
  e(this, "staleFrameThresholdMs", 400), e(this, "pool", void 0), e(this, "logger", void 0), e(this, "videoRenderer", new Vr()), 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", () => {
10099
10125
  this.videoRenderer.load(), this.subscribeToContextLost(this.videoRenderer);
@@ -10183,12 +10209,12 @@ var Dx, Ox = class {
10183
10209
  }), this.logger = t, this.clockSource = n, this.pool = r, this.renderTargetSize = i || this.videoRenderer.canvas, this.onCanvasChangeCallback = a, this.onRendererErrorCallback = o;
10184
10210
  }
10185
10211
  };
10186
- Dx = Ox, e(Ox, "create", (e, t, n, r, i, a) => new Dx(e, t, n, r, i, a));
10212
+ Nx = Px, e(Px, "create", (e, t, n, r, i, a) => new Nx(e, t, n, r, i, a));
10187
10213
  //#endregion
10188
10214
  //#region ../../libs/web-sdk/src/TextTracks.ts
10189
- var kx = /* @__PURE__ */ new WeakMap(), Ax = class {
10215
+ var Fx = /* @__PURE__ */ new WeakMap(), Ix = class {
10190
10216
  constructor() {
10191
- i(this, kx, []), a(kx, this, []);
10217
+ i(this, Fx, []), a(Fx, this, []);
10192
10218
  }
10193
10219
  addTextTrack(e, t, n) {
10194
10220
  let r = [], i = {
@@ -10205,43 +10231,43 @@ var kx = /* @__PURE__ */ new WeakMap(), Ax = class {
10205
10231
  t !== -1 && r.splice(t, 1);
10206
10232
  }
10207
10233
  };
10208
- return s(kx, this).push(i), i;
10234
+ return s(Fx, this).push(i), i;
10209
10235
  }
10210
10236
  set language(e) {
10211
- s(kx, this).forEach((t) => {
10237
+ s(Fx, this).forEach((t) => {
10212
10238
  t.language === e ? t.mode = "showing" : t.mode = "hidden";
10213
10239
  });
10214
10240
  }
10215
10241
  get language() {
10216
10242
  var e;
10217
- return (e = s(kx, this).find((e) => e.mode === "showing")) == null ? void 0 : e.language;
10243
+ return (e = s(Fx, this).find((e) => e.mode === "showing")) == null ? void 0 : e.language;
10218
10244
  }
10219
10245
  get tracks() {
10220
- return s(kx, this);
10246
+ return s(Fx, this);
10221
10247
  }
10222
10248
  get activeTrack() {
10223
- return s(kx, this).find((e) => e.mode === "showing");
10249
+ return s(Fx, this).find((e) => e.mode === "showing");
10224
10250
  }
10225
10251
  getActiveCues(e) {
10226
- let t = s(kx, this).find((e) => e.mode === "showing");
10252
+ let t = s(Fx, this).find((e) => e.mode === "showing");
10227
10253
  return t ? t.cues.filter(({ startTime: t, endTime: n }) => e >= t && e < n) : [];
10228
10254
  }
10229
- }, jx = (e, t) => {
10255
+ }, Lx = (e, t) => {
10230
10256
  let n;
10231
10257
  for (n = t; e > 1; e--) n += t;
10232
10258
  return n;
10233
- }, Mx = class {
10259
+ }, Rx = class {
10234
10260
  constructor() {
10235
10261
  e(this, "audio", void 0), e(this, "unmute", () => this.audio.play().catch(n));
10236
10262
  let t = document.createElement("div");
10237
10263
  t.innerHTML = "<audio x-webkit-airplay='deny'></audio>";
10238
10264
  let r = t.children.item(0);
10239
- if (r instanceof HTMLAudioElement) this.audio = r, this.audio.controls = !1, this.audio.disableRemotePlayback = !0, this.audio.preload = "auto", this.audio.src = "data:audio/mpeg;base64,//uQx" + jx(23, "A") + "WGluZwAAAA8AAAACAAACcQCA" + jx(16, "gICA") + jx(66, "/") + "8AAABhTEFNRTMuMTAwA8MAAAAAAAAAABQgJAUHQQAB9AAAAnGMHkkI" + jx(320, "A") + "//sQxAADgnABGiAAQBCqgCRMAAgEAH" + jx(15, "/") + "7+n/9FTuQsQH//////2NG0jWUGlio5gLQTOtIoeR2WX////X4s9Atb/JRVCbBUpeRUq" + jx(18, "/") + "9RUi0f2jn/+xDECgPCjAEQAABN4AAANIAAAAQVTEFNRTMuMTAw" + jx(97, "V") + "Q==", this.audio.loop = !1, this.audio.load();
10265
+ if (r instanceof HTMLAudioElement) this.audio = r, this.audio.controls = !1, this.audio.disableRemotePlayback = !0, this.audio.preload = "auto", this.audio.src = "data:audio/mpeg;base64,//uQx" + Lx(23, "A") + "WGluZwAAAA8AAAACAAACcQCA" + Lx(16, "gICA") + Lx(66, "/") + "8AAABhTEFNRTMuMTAwA8MAAAAAAAAAABQgJAUHQQAB9AAAAnGMHkkI" + Lx(320, "A") + "//sQxAADgnABGiAAQBCqgCRMAAgEAH" + Lx(15, "/") + "7+n/9FTuQsQH//////2NG0jWUGlio5gLQTOtIoeR2WX////X4s9Atb/JRVCbBUpeRUq" + Lx(18, "/") + "9RUi0f2jn/+xDECgPCjAEQAABN4AAANIAAAAQVTEFNRTMuMTAw" + Lx(97, "V") + "Q==", this.audio.loop = !1, this.audio.load();
10240
10266
  else throw Error("Failed to create audio tag");
10241
10267
  }
10242
- }, Nx, Px = class {
10268
+ }, zx, Bx = class {
10243
10269
  constructor(t, n, r, i, a, o, s, c) {
10244
- 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 Mx()), e(this, "_isPaused", !1), e(this, "isDisconnected", !1), e(this, "timers", new k()), e(this, "isVideoRenderingEnabled", !0), e(this, "isLoaded", !1), e(this, "isSuspended", !0), e(this, "isVideoPlayerLoaded", !1), e(this, "volumeState", void 0), e(this, "textTracks", new Ax()), e(this, "playbackRate", void 0), e(this, "emitVolumeState", () => {
10270
+ 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 Rx()), e(this, "_isPaused", !1), e(this, "isDisconnected", !1), e(this, "timers", new k()), e(this, "isVideoRenderingEnabled", !0), e(this, "isLoaded", !1), e(this, "isSuspended", !0), e(this, "isVideoPlayerLoaded", !1), e(this, "volumeState", void 0), e(this, "textTracks", new Ix()), e(this, "playbackRate", void 0), e(this, "emitVolumeState", () => {
10245
10271
  let e = {
10246
10272
  volume: this.volume,
10247
10273
  isMuted: this.userMuted
@@ -10283,13 +10309,13 @@ var kx = /* @__PURE__ */ new WeakMap(), Ax = class {
10283
10309
  e instanceof Error && this.emitter.emit("error", zn(!1, e));
10284
10310
  }
10285
10311
  this.isVideoRenderingEnabled && this.videoPlayer.onDecodedFrame(e);
10286
- }), this.logger = n, this.emitter = t, this.pool = r, this.emitter.on("target buffer time", this.onTargetBufferTime), this.audioPlayer = Ex.create(this.logger.createContext("AudioPlayerModule"), i, {
10312
+ }), this.logger = n, this.emitter = t, this.pool = r, this.emitter.on("target buffer time", this.onTargetBufferTime), this.audioPlayer = Mx.create(this.logger.createContext("AudioPlayerModule"), i, {
10287
10313
  muted: a,
10288
10314
  reInitWhenStuck: !0,
10289
10315
  bufferTime: c
10290
10316
  }), o !== void 0 && (this.audioPlayer.volume = o), this.audioPlayer.on("stuck", () => {
10291
10317
  this.isDisconnected = !0;
10292
- }), this.audioPlayer.on("state change", this.emitVolumeState), this.videoPlayer = Ox.create(this.logger.createContext("VideoPlayerModule"), this.audioPlayer, this.pool, void 0, s);
10318
+ }), this.audioPlayer.on("state change", this.emitVolumeState), this.videoPlayer = Px.create(this.logger.createContext("VideoPlayerModule"), this.audioPlayer, this.pool, void 0, s);
10293
10319
  }
10294
10320
  get volume() {
10295
10321
  return this.audioPlayer.volume;
@@ -10348,29 +10374,29 @@ var kx = /* @__PURE__ */ new WeakMap(), Ax = class {
10348
10374
  this._isPaused = !0, this.audioPlayer.pause(), this.emitter.emit("media element state", "paused");
10349
10375
  }
10350
10376
  };
10351
- Nx = Px, e(Px, "create", (e, t, n, r, i, a, o, s) => new Nx(e, t, n, r, i, a, o, s));
10377
+ zx = Bx, e(Bx, "create", (e, t, n, r, i, a, o, s) => new zx(e, t, n, r, i, a, o, s));
10352
10378
  //#endregion
10353
10379
  //#region ../../libs/web-sdk/src/modules/MediaSessionModule.ts
10354
- var Fx, Ix = [
10380
+ var Vx, Hx = [
10355
10381
  "play",
10356
10382
  "pause",
10357
10383
  "stop"
10358
- ], Lx, Rx = /* @__PURE__ */ new Set(), zx = class t {
10384
+ ], Ux, Wx = /* @__PURE__ */ new Set(), Gx = class t {
10359
10385
  constructor(n, r, i) {
10360
10386
  e(this, "emitter", void 0), e(this, "logger", void 0), e(this, "options", void 0), e(this, "isLoaded", !1), e(this, "playbackState", void 0), e(this, "pageMetadata", null), e(this, "load", () => {
10361
- this.isLoaded || !t.isSupported() || (this.isLoaded = !0, Rx.add(this), this.emitter.on("playback state", this.onPlaybackState), this.emitter.on("volume state", this.update));
10387
+ this.isLoaded || !t.isSupported() || (this.isLoaded = !0, Wx.add(this), this.emitter.on("playback state", this.onPlaybackState), this.emitter.on("volume state", this.update));
10362
10388
  }), e(this, "unload", () => {
10363
10389
  var e;
10364
- this.isLoaded && (this.isLoaded = !1, Rx.delete(this), this.emitter.off("playback state", this.onPlaybackState), this.emitter.off("volume state", this.update), this.handOverOwnership("on unload"), (e = this.options.decoy) == null || e.unload());
10390
+ this.isLoaded && (this.isLoaded = !1, Wx.delete(this), this.emitter.off("playback state", this.onPlaybackState), this.emitter.off("volume state", this.update), this.handOverOwnership("on unload"), (e = this.options.decoy) == null || e.unload());
10365
10391
  }), e(this, "stop", () => {
10366
10392
  var e;
10367
- this.playbackState = void 0, (e = this.options.decoy) == null || e.unload(), Lx === this && this.handOverOwnership("on stop");
10393
+ this.playbackState = void 0, (e = this.options.decoy) == null || e.unload(), Ux === this && this.handOverOwnership("on stop");
10368
10394
  }), e(this, "getStatistics", () => {
10369
10395
  var e;
10370
10396
  return {
10371
10397
  mediaSessionSupported: t.isSupported(),
10372
- mediaSessionOwner: Lx === this,
10373
- mediaSessionPlaybackState: Lx === this ? this.isPaused ? "paused" : "playing" : "none",
10398
+ mediaSessionOwner: Ux === this,
10399
+ mediaSessionPlaybackState: Ux === this ? this.isPaused ? "paused" : "playing" : "none",
10374
10400
  decoyState: (e = this.options.decoy) == null ? void 0 : e.getStatistics().decoyState
10375
10401
  };
10376
10402
  }), e(this, "onPlaybackState", (e) => {
@@ -10379,23 +10405,23 @@ var Fx, Ix = [
10379
10405
  this.update();
10380
10406
  }), e(this, "update", () => {
10381
10407
  if (this.isLoaded) {
10382
- if (this.isEligibleToOwn && Lx !== this) {
10408
+ if (this.isEligibleToOwn && Ux !== this) {
10383
10409
  this.claimOwnership();
10384
10410
  return;
10385
10411
  }
10386
10412
  this.sync();
10387
10413
  }
10388
10414
  }), e(this, "handOverOwnership", (e) => {
10389
- if (Lx === this) {
10415
+ if (Ux === this) {
10390
10416
  this.logger.debug(`Handing over the media session ${e}`), this.releaseOwnership();
10391
- for (let e of Rx) if (e !== this && e.isEligibleToOwn) {
10417
+ for (let e of Wx) if (e !== this && e.isEligibleToOwn) {
10392
10418
  e.claimOwnership();
10393
10419
  return;
10394
10420
  }
10395
10421
  }
10396
10422
  }), e(this, "sync", () => {
10397
10423
  var e, t, n, r, i, a;
10398
- if (Lx !== this) return;
10424
+ if (Ux !== this) return;
10399
10425
  if ((e = (t = this.options).isSuppressed) != null && e.call(t)) {
10400
10426
  var o;
10401
10427
  (o = this.options.decoy) == null || o.unload(), this.handOverOwnership("as suppressed");
@@ -10428,8 +10454,8 @@ var Fx, Ix = [
10428
10454
  (f = this.options.decoy) == null || f.play();
10429
10455
  }
10430
10456
  }), e(this, "claimOwnership", () => {
10431
- Lx == null || Lx.releaseOwnership(), Lx = this, this.pageMetadata = navigator.mediaSession.metadata, this.applyMetadata();
10432
- for (let e of Ix) this.safely(e, () => navigator.mediaSession.setActionHandler(e, this.onAction[e]));
10457
+ Ux == null || Ux.releaseOwnership(), Ux = this, this.pageMetadata = navigator.mediaSession.metadata, this.applyMetadata();
10458
+ for (let e of Hx) this.safely(e, () => navigator.mediaSession.setActionHandler(e, this.onAction[e]));
10433
10459
  this.safely("position state", () => {
10434
10460
  var e, t;
10435
10461
  return (e = (t = navigator.mediaSession).setPositionState) == null ? void 0 : e.call(t, {
@@ -10445,9 +10471,9 @@ var Fx, Ix = [
10445
10471
  });
10446
10472
  }), e(this, "releaseOwnership", () => {
10447
10473
  var e;
10448
- if (Lx === this) {
10449
- Lx = void 0, (e = this.options.decoy) == null || e.pause();
10450
- for (let e of Ix) this.safely(e, () => navigator.mediaSession.setActionHandler(e, null));
10474
+ if (Ux === this) {
10475
+ Ux = void 0, (e = this.options.decoy) == null || e.pause();
10476
+ for (let e of Hx) this.safely(e, () => navigator.mediaSession.setActionHandler(e, null));
10451
10477
  this.options.metadata && this.safely("metadata restore", () => {
10452
10478
  navigator.mediaSession.metadata = this.pageMetadata;
10453
10479
  }), this.safely("release", () => {
@@ -10481,15 +10507,15 @@ var Fx, Ix = [
10481
10507
  return this.playbackState !== void 0 && !this.isPaused && !this.options.isMuted() && ((e = (t = this.options).isSuppressed) == null ? void 0 : e.call(t)) !== !0;
10482
10508
  }
10483
10509
  };
10484
- Fx = zx, e(zx, "create", (e, t, n) => new Fx(e, t, n)), e(zx, "isSupported", () => typeof navigator < "u" && "mediaSession" in navigator && typeof MediaMetadata < "u");
10510
+ Vx = Gx, e(Gx, "create", (e, t, n) => new Vx(e, t, n)), e(Gx, "isSupported", () => typeof navigator < "u" && "mediaSession" in navigator && typeof MediaMetadata < "u");
10485
10511
  //#endregion
10486
10512
  //#region ../../libs/web-sdk/src/modules/ModernCanvasModule.ts
10487
- var Bx, Vx = class {
10513
+ var Kx, qx = class {
10488
10514
  constructor(t, r, i, a, { muted: o, volume: s, type: c, poster: l, offscreenCanvas: u, bufferTime: d, backgroundPlaybackEnabled: f, splitAudio: p }) {
10489
10515
  if (e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "mediaElement", void 0), e(this, "sound", void 0), e(this, "wantsPlay", 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 k()), e(this, "offscreenCanvas", void 0), e(this, "videoTrack", void 0), e(this, "canvasCaptureTracks", []), e(this, "backgroundPlaybackEnabled", void 0), e(this, "nativeTracksByLanguage", /* @__PURE__ */ new Map()), e(this, "nativeCuesByLanguage", /* @__PURE__ */ new Map()), e(this, "lastCanvasCueTexts", []), e(this, "isIOSNativeFullscreen", !1), e(this, "knownNativeLanguage", void 0), e(this, "renderCanvasSubtitlesInNativeFullscreen", (() => {
10490
10516
  let e = Ge().platform;
10491
10517
  return e.isIOS && e.iosVersion <= 16;
10492
- })()), e(this, "volumeState", void 0), e(this, "textTracks", new Ax()), e(this, "reset", () => {}), e(this, "load", () => {
10518
+ })()), e(this, "volumeState", void 0), e(this, "textTracks", new Ix()), e(this, "reset", () => {}), e(this, "load", () => {
10493
10519
  this.mediaElement.load(), this.sound && (this.sound.load(), document.body.appendChild(this.sound.element), this.mediaElement.element.addEventListener("pause", this.onVideoPause), this.mediaElement.element.addEventListener("play", this.onVideoPlay), window.addEventListener("focus", this.onWindowFocus)), 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.textTracks.addEventListener("change", this.onNativeTextTrackChange), this.element().element.addEventListener("webkitendfullscreen", this.onExitIOSHack), this.element().element.addEventListener("webkitbeginfullscreen", this.onEnterIOSHack), this.videoPlayer.load(), this.timers.setInterval(this.syncNativeTextTracks, 100);
10494
10520
  }), e(this, "unload", () => {
10495
10521
  this.emitter.off("target buffer time", this.onTargetBufferTime), this.emitter.off("decoded frame", this.onDecodedFrame), this.emitter.off("flush buffers", this.flushBuffers), this.emitter.off("ios-hack: reset size", this.resetCanvasSize), this.emitter.off("enter picture in picture", this.onEnterIOSHack), this.emitter.off("exit picture in picture", this.onExitIOSHack), this.element().element.textTracks.removeEventListener("change", this.onNativeTextTrackChange), this.element().element.removeEventListener("webkitendfullscreen", this.onExitIOSHack), this.element().element.removeEventListener("webkitbeginfullscreen", this.onEnterIOSHack);
@@ -10642,13 +10668,13 @@ var Bx, Vx = class {
10642
10668
  }), this.soundElement.on("media element state", (e) => {
10643
10669
  e === "paused" && this.audioPlayer.flushBuffer(), this.audioPlayer.sinkPaused = e === "paused", this.emitPlaybackState();
10644
10670
  }), this.sound) for (let e of this.elements()) e.on("needs user input", (e) => this.emitter.emit("needs user input", e)), e.on("error", (e) => this.emitter.emit("error", e));
10645
- this.audioPlayer = Ex.create(this.logger.createContext("AudioPlayerModule"), a, {
10671
+ this.audioPlayer = Mx.create(this.logger.createContext("AudioPlayerModule"), a, {
10646
10672
  muted: !1,
10647
10673
  reInitWhenStuck: !1,
10648
10674
  bufferTime: d
10649
10675
  }), this.audioPlayer.on("state change", (e) => {
10650
10676
  e === "suspended" || e === "interrupted" ? this.soundElement.muted = !0 : e === "running" && this.applyVisibilityMutePolicy(), this.updateVolumeState();
10651
- }), this.videoPlayer = Ox.create(this.logger.createContext("VideoPlayerModule"), this.audioPlayer, this.pool, this.mediaElement.element, () => this.reconnectCanvasStream(), this.onVideoPlayerError);
10677
+ }), this.videoPlayer = Px.create(this.logger.createContext("VideoPlayerModule"), this.audioPlayer, this.pool, this.mediaElement.element, () => this.reconnectCanvasStream(), this.onVideoPlayerError);
10652
10678
  }
10653
10679
  get volume() {
10654
10680
  return this.soundElement.volume;
@@ -10720,10 +10746,10 @@ var Bx, Vx = class {
10720
10746
  return this.renderCanvasSubtitlesInNativeFullscreen && !this.offscreenCanvas;
10721
10747
  }
10722
10748
  };
10723
- Bx = Vx, e(Vx, "create", (e, t, n, r, i) => new Bx(e, t, n, r, i));
10749
+ Kx = qx, e(qx, "create", (e, t, n, r, i) => new Kx(e, t, n, r, i));
10724
10750
  //#endregion
10725
10751
  //#region ../../libs/web-sdk/src/modules/MseModule.ts
10726
- var Hx, Ux = class {
10752
+ var Jx, Yx = class {
10727
10753
  constructor() {
10728
10754
  e(this, "initSegments", /* @__PURE__ */ new Map()), e(this, "set", (e, t, n) => {
10729
10755
  var r;
@@ -10735,7 +10761,7 @@ var Hx, Ux = class {
10735
10761
  });
10736
10762
  }
10737
10763
  };
10738
- function Wx(e, { mediaSource: t, mimeType: n, codec: r }) {
10764
+ function Xx(e, { mediaSource: t, mimeType: n, codec: r }) {
10739
10765
  return x(x({}, e), {}, {
10740
10766
  state: "initialized",
10741
10767
  mimeType: n,
@@ -10747,10 +10773,10 @@ function Wx(e, { mediaSource: t, mimeType: n, codec: r }) {
10747
10773
  lastBufferCleanupTime: performance.now()
10748
10774
  });
10749
10775
  }
10750
- function Gx({ initSegments: e, pendingSamples: t }) {
10776
+ function Zx({ initSegments: e, pendingSamples: t }) {
10751
10777
  return {
10752
10778
  state: "uninitialized",
10753
- initSegments: e == null ? new Ux() : e,
10779
+ initSegments: e == null ? new Yx() : e,
10754
10780
  sequenceNumber: 0,
10755
10781
  isWorkingOnPendingSamples: !1,
10756
10782
  hasFirstSync: t.some((e) => e.isSync),
@@ -10760,7 +10786,7 @@ function Gx({ initSegments: e, pendingSamples: t }) {
10760
10786
  successfulAppendCalls: 0
10761
10787
  };
10762
10788
  }
10763
- var Kx = class {
10789
+ var Qx = class {
10764
10790
  constructor(r, i, a) {
10765
10791
  var o = this;
10766
10792
  e(this, "maxChunkSize", 20), e(this, "minConsecutiveErrorsBeforeEmit", 5), e(this, "maxSecondsInBuffer", 60), e(this, "logger", void 0), e(this, "timers", k.create()), e(this, "emitter", void 0), e(this, "mediaElement", void 0), e(this, "mediaSource", new Js()), e(this, "trackContexts", /* @__PURE__ */ new Map()), e(this, "autoRecoverFromMediaErrors", !0), e(this, "quotaErrorCount", 0), e(this, "recoveredFromErrorCount", 0), e(this, "sourceOpenStartTime", performance.now()), e(this, "sourceOpenEndTime", performance.now()), e(this, "pendingTracksToAddSourceBuffers", void 0), e(this, "hasAddedInitialPosterFrame", !0), e(this, "videoKeyframeTimestamps", []), e(this, "isReopening", !1), e(this, "pendingMediaError", void 0), e(this, "isFlushDeferred", !1), e(this, "hasRecoveredSinceShown", !1), e(this, "playbackStallCount", 0), e(this, "hasStartedPlayback", !1), e(this, "isPlaybackStalled", !1), e(this, "load", () => {
@@ -10806,7 +10832,7 @@ var Kx = class {
10806
10832
  var n, r, i;
10807
10833
  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;
10808
10834
  for (; c < o.length && !((i = o[c]) != null && i.isSync);) c++;
10809
- let l = Gx({
10835
+ let l = Zx({
10810
10836
  pendingSamples: o,
10811
10837
  initSegments: s
10812
10838
  });
@@ -10817,14 +10843,14 @@ var Kx = class {
10817
10843
  this.trackContexts.forEach((e, n) => {
10818
10844
  if (t.has(n)) return;
10819
10845
  e.state === "initialized" && this.mediaSource.isOpen() && this.mediaSource.removeSourceBuffer(e.sourceBuffer);
10820
- let r = Gx({
10846
+ let r = Zx({
10821
10847
  pendingSamples: [],
10822
10848
  initSegments: e.initSegments
10823
10849
  });
10824
10850
  this.trackContexts.set(n, r);
10825
10851
  });
10826
10852
  }), e(this, "isCurrentTrackContext", (e, t) => this.trackContexts.get(e) === t), e(this, "initializeSourceBuffer", (e, t) => {
10827
- let n = Wx(e, {
10853
+ let n = Xx(e, {
10828
10854
  mimeType: t.mimeType,
10829
10855
  mediaSource: this.mediaSource,
10830
10856
  codec: t.codec
@@ -10851,9 +10877,9 @@ var Kx = class {
10851
10877
  }
10852
10878
  for (let t of e) {
10853
10879
  let n = o.trackContexts.get(t.type);
10854
- if (n || (n = Gx({
10880
+ if (n || (n = Zx({
10855
10881
  pendingSamples: [],
10856
- initSegments: new Ux()
10882
+ initSegments: new Yx()
10857
10883
  }), o.trackContexts.set(t.type, n)), n.state === "initialized") {
10858
10884
  if (t.mimeType !== n.sourceBufferMimeType) try {
10859
10885
  yield n.sourceBuffer.changeType(t.mimeType), n.sourceBufferMimeType = t.mimeType;
@@ -10870,7 +10896,7 @@ var Kx = class {
10870
10896
  o.logger.warn("removeSourceBuffer failed", { removeError: t }), o.reopenMediaSource("changeType recovery failed"), o.pendingTracksToAddSourceBuffers = e;
10871
10897
  return;
10872
10898
  }
10873
- let i = Gx({
10899
+ let i = Zx({
10874
10900
  pendingSamples: n.pendingSamples,
10875
10901
  initSegments: n.initSegments
10876
10902
  });
@@ -10894,7 +10920,7 @@ var Kx = class {
10894
10920
  };
10895
10921
  }), e(this, "getNextBufferedRangeStart", (e) => {
10896
10922
  let t = this.getCommonBufferedRangesForCurrentTracks();
10897
- if (t) return qx(e, t);
10923
+ if (t) return $x(e, t);
10898
10924
  }), e(this, "getBufferedEndAt", (e) => {
10899
10925
  var t;
10900
10926
  let n = this.getCommonBufferedRangesForCurrentTracks();
@@ -10944,9 +10970,9 @@ var Kx = class {
10944
10970
  s > 0 && performance.now() - r.lastBufferCleanupTime > 1e4 && (r.lastBufferCleanupTime = performance.now(), yield r.sourceBuffer.removeBuffer(0, s + 10));
10945
10971
  try {
10946
10972
  let t = r.sequenceNumber;
10947
- if ("fragmented" in n) for (let t of Qx(e)) {
10973
+ if ("fragmented" in n) for (let t of iS(e)) {
10948
10974
  var c;
10949
- yield r.sourceBuffer.appendBuffer($x(t.map((e) => e.data)), (c = t[0]) == null ? void 0 : c.initData);
10975
+ yield r.sourceBuffer.appendBuffer(aS(t.map((e) => e.data)), (c = t[0]) == null ? void 0 : c.initData);
10950
10976
  }
10951
10977
  else {
10952
10978
  let n = Ps(e, t++);
@@ -10994,7 +11020,7 @@ var Kx = class {
10994
11020
  let t = this.trackContexts.get(e.type);
10995
11021
  if (!t) throw Hn(e.type, e.renditionId);
10996
11022
  let n = t.pendingSamples.length - t.pendingSamplesOffset;
10997
- if (t.state === "uninitialized" && n >= Yx && (e.isSync || n >= 2 * Yx) && (t.pendingSamples = [], t.pendingSamplesOffset = 0, t.hasFirstSync = !1), !(!t.hasFirstSync && !e.isSync)) {
11023
+ if (t.state === "uninitialized" && n >= tS && (e.isSync || n >= 2 * tS) && (t.pendingSamples = [], t.pendingSamplesOffset = 0, t.hasFirstSync = !1), !(!t.hasFirstSync && !e.isSync)) {
10998
11024
  if (this.hasAddedInitialPosterFrame && e.isSync && e.type === "video") {
10999
11025
  this.hasAddedInitialPosterFrame = !1;
11000
11026
  let n = x({}, e);
@@ -11005,7 +11031,7 @@ var Kx = class {
11005
11031
  let t = (e.timestamp + ((r = e.compositionTimeOffset) == null ? 0 : r)) / e.timescale * 1e3, n = this.videoKeyframeTimestamps[this.videoKeyframeTimestamps.length - 1];
11006
11032
  n !== void 0 && t < n && (this.videoKeyframeTimestamps = []), this.videoKeyframeTimestamps.push(t), this.videoKeyframeTimestamps.length > 20 && (this.videoKeyframeTimestamps = this.videoKeyframeTimestamps.slice(-20));
11007
11033
  }
11008
- t.state !== "uninitialized" && (t.isWorkingOnPendingSamples || tS(t, this.append, this.maxChunkSize).catch((n) => {
11034
+ t.state !== "uninitialized" && (t.isWorkingOnPendingSamples || sS(t, this.append, this.maxChunkSize).catch((n) => {
11009
11035
  if (t.isWorkingOnPendingSamples = !1, !this.isReopening) {
11010
11036
  if (!this.isCurrentTrackContext(e.type, t)) {
11011
11037
  this.logger.debug("Suppressing append error from stale track context", { type: e.type });
@@ -11124,14 +11150,14 @@ var Kx = class {
11124
11150
  if (this.mediaSource.isClosed()) return;
11125
11151
  let e = this.getInitializedTrackBuffers();
11126
11152
  if (e.length !== 0) return this.getCommonBufferedRanges(e);
11127
- }), e(this, "getCommonBufferedRanges", (e) => e.slice(1).reduce((e, t) => Zx(e, t), e[0] ? Array.from(e[0]) : [])), e(this, "getPlaybackStateForBufferedRanges", (e, t) => nn(t, e) ? "playing" : "buffering"), this.logger = r, this.mediaElement = a, this.emitter = i;
11153
+ }), e(this, "getCommonBufferedRanges", (e) => e.slice(1).reduce((e, t) => rS(e, t), e[0] ? Array.from(e[0]) : [])), e(this, "getPlaybackStateForBufferedRanges", (e, t) => nn(t, e) ? "playing" : "buffering"), this.logger = r, this.mediaElement = a, this.emitter = i;
11128
11154
  }
11129
11155
  };
11130
- Hx = Kx, e(Kx, "create", (e, t, n) => {
11131
- let r = new Hx(e, t, n);
11156
+ Jx = Qx, e(Qx, "create", (e, t, n) => {
11157
+ let r = new Jx(e, t, n);
11132
11158
  return r.setTrackContexts(), r.mediaSource.on("source ended", r.onSourceEnded), r.mediaSource.on("source open", r.onSourceOpen), n.addEventListener("error", r.onMediaElementError), n.addEventListener("waiting", r.onPlaybackStall), n.addEventListener("stalled", r.onPlaybackStall), n.addEventListener("playing", r.onPlaybackProgress), n.addEventListener("pause", r.onPlaybackPauseOrSeek), n.addEventListener("play", r.onPlay), n.addEventListener("seeking", r.onPlaybackPauseOrSeek), r.mediaSource.attach(n), r;
11133
11159
  });
11134
- var qx = (e, t) => {
11160
+ var $x = (e, t) => {
11135
11161
  for (let r = 0; r < t.length; r++) {
11136
11162
  let i = t[r];
11137
11163
  if (i) {
@@ -11142,11 +11168,11 @@ var qx = (e, t) => {
11142
11168
  }
11143
11169
  }
11144
11170
  }
11145
- }, Jx = (e, t) => {
11171
+ }, eS = (e, t) => {
11146
11172
  var n;
11147
11173
  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;
11148
11174
  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;
11149
- }, Yx = 1e3, Xx = 32, Zx = (e, t) => {
11175
+ }, tS = 1e3, nS = 32, rS = (e, t) => {
11150
11176
  let n = [], r = 0, i = 0;
11151
11177
  for (; r < e.length && i < t.length;) {
11152
11178
  let a = e[r], o = t[i];
@@ -11158,7 +11184,7 @@ var qx = (e, t) => {
11158
11184
  }), a.end <= o.end ? r++ : i++;
11159
11185
  }
11160
11186
  return n;
11161
- }, Qx = (e) => {
11187
+ }, iS = (e) => {
11162
11188
  let t = [];
11163
11189
  for (let r of e) {
11164
11190
  var n;
@@ -11167,21 +11193,21 @@ var qx = (e, t) => {
11167
11193
  (e == null || (n = e[0]) == null ? void 0 : n.initData) === r.initData ? e.push(r) : t.push([r]);
11168
11194
  }
11169
11195
  return t;
11170
- }, $x = (e) => {
11196
+ }, aS = (e) => {
11171
11197
  if (e.length === 1 && e[0]) return e[0];
11172
11198
  let t = new Uint8Array(e.reduce((e, t) => e + t.byteLength, 0)), n = 0;
11173
11199
  for (let r of e) t.set(r, n), n += r.byteLength;
11174
11200
  return t;
11175
- }, eS = (e) => {
11201
+ }, oS = (e) => {
11176
11202
  let t = e.pendingSamplesOffset;
11177
11203
  if (t !== 0) {
11178
11204
  if (t >= e.pendingSamples.length) {
11179
11205
  e.pendingSamples = [], e.pendingSamplesOffset = 0;
11180
11206
  return;
11181
11207
  }
11182
- t < Xx || t * 2 < e.pendingSamples.length || (e.pendingSamples = e.pendingSamples.slice(t), e.pendingSamplesOffset = 0);
11208
+ t < nS || t * 2 < e.pendingSamples.length || (e.pendingSamples = e.pendingSamples.slice(t), e.pendingSamplesOffset = 0);
11183
11209
  }
11184
- }, tS = function() {
11210
+ }, sS = function() {
11185
11211
  var e = t(function* (e, t, n) {
11186
11212
  for (e.isWorkingOnPendingSamples = !0; e.pendingSamplesOffset < e.pendingSamples.length;) {
11187
11213
  let r = [], i = e.pendingSamplesOffset;
@@ -11189,7 +11215,7 @@ var qx = (e, t) => {
11189
11215
  i = t;
11190
11216
  let a = e.pendingSamples[t], o = e.pendingSamples[t + 1];
11191
11217
  if (a && (r.push(a), o)) {
11192
- if (Jx(a, o)) break;
11218
+ if (eS(a, o)) break;
11193
11219
  let e = (a.timestamp + a.duration) / a.timescale;
11194
11220
  if (o.timestamp / o.timescale - e > .1) break;
11195
11221
  }
@@ -11197,14 +11223,14 @@ var qx = (e, t) => {
11197
11223
  }
11198
11224
  let a = r[0];
11199
11225
  if (!a) break;
11200
- yield t(r, e.previousSample ? Jx(e.previousSample, a) : !0), e.pendingSamplesOffset = i + 1, e.previousSample = r[r.length - 1], eS(e);
11226
+ yield t(r, e.previousSample ? eS(e.previousSample, a) : !0), e.pendingSamplesOffset = i + 1, e.previousSample = r[r.length - 1], oS(e);
11201
11227
  }
11202
11228
  e.isWorkingOnPendingSamples = !1;
11203
11229
  });
11204
11230
  return function(t, n, r) {
11205
11231
  return e.apply(this, arguments);
11206
11232
  };
11207
- }(), nS, rS = class {
11233
+ }(), cS, lS = class {
11208
11234
  constructor(n, r) {
11209
11235
  var i = this;
11210
11236
  e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "element", void 0), e(this, "pictureInPictureWindow", void 0), e(this, "unload", () => {
@@ -11236,10 +11262,10 @@ var qx = (e, t) => {
11236
11262
  }()), e(this, "isWebkitPresentationModeSupported", () => !!this.element && lt(this.element)), this.emitter = n, this.logger = r, this.emitter.on("add picture in picture listener", this.onEnablePictureInPicture);
11237
11263
  }
11238
11264
  };
11239
- nS = rS, e(rS, "create", (e, t) => new nS(e, t));
11265
+ cS = lS, e(lS, "create", (e, t) => new cS(e, t));
11240
11266
  //#endregion
11241
11267
  //#region ../../libs/web-sdk/src/modules/PlaybackModule.ts
11242
- var iS, aS = class {
11268
+ var uS, dS = class {
11243
11269
  constructor(t, n, r, i) {
11244
11270
  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", () => {
11245
11271
  this.emitter.off("buffer state", this.onBufferedStateChanged), this.emitter.off("needs user input", this.onNeedsUserInput);
@@ -11257,24 +11283,24 @@ var iS, aS = class {
11257
11283
  }), 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);
11258
11284
  }
11259
11285
  };
11260
- iS = aS, e(aS, "create", (e, t, n, r) => new iS(e, t, n, r));
11286
+ uS = dS, e(dS, "create", (e, t, n, r) => new uS(e, t, n, r));
11261
11287
  //#endregion
11262
11288
  //#region ../../libs/web-sdk/src/modules/QualityOfServiceModule.ts
11263
- var oS, sS = () => ({
11289
+ var fS, pS = () => ({
11264
11290
  upgradesFromLevel: [],
11265
11291
  downgradesFromLevel: [],
11266
11292
  bufferingRanges: [],
11267
11293
  activeRanges: [],
11268
11294
  decodeRate: 2 ** 53 - 1
11269
- }), cS = () => ({
11295
+ }), mS = () => ({
11270
11296
  levels: {},
11271
11297
  levelDowngrades: [],
11272
11298
  levelUpgrades: [],
11273
11299
  bufferFullness: 0,
11274
- general: sS()
11275
- }), lS = 100, uS = 3600, dS = 1e3, fS = class {
11300
+ general: pS()
11301
+ }), hS = 100, gS = 3600, _S = 1e3, vS = class {
11276
11302
  constructor(t, n, i, a) {
11277
- e(this, "minBufferFullnessLengthForRegression", 6), e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "timers", k.create()), e(this, "metrics", cS()), e(this, "bufferFullness", new r(Infinity)), e(this, "bufferFullnessRegression", void 0), e(this, "lastDeliveryResumeTime", -Infinity), e(this, "currentLevel", void 0), e(this, "isSuspended", !1), e(this, "_fatalQosCount", 0), e(this, "renditionLevelSource", void 0), e(this, "targetBufferTimeSource", void 0), e(this, "qualityIndexOrder", []), e(this, "hasPlayedInSession", !1), e(this, "hasAsserted", !1), e(this, "load", () => {
11303
+ e(this, "minBufferFullnessLengthForRegression", 6), e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "timers", k.create()), e(this, "metrics", mS()), e(this, "bufferFullness", new r(Infinity)), e(this, "bufferFullnessRegression", void 0), e(this, "lastDeliveryResumeTime", -Infinity), e(this, "currentLevel", void 0), e(this, "isSuspended", !1), e(this, "_fatalQosCount", 0), e(this, "renditionLevelSource", void 0), e(this, "targetBufferTimeSource", void 0), e(this, "qualityIndexOrder", []), e(this, "hasPlayedInSession", !1), e(this, "hasAsserted", !1), e(this, "load", () => {
11278
11304
  this.emitter.on("playback state", this.onPlaybackState), this.emitter.on("buffer fullness", this.onBufferFullness), this.emitter.on("media delivery resumed", this.onMediaDeliveryResumed), this.emitter.on("rendition level changed", this.onRenditionLevelChanged), this.emitter.on("video decode rate", this.onVideoDecodeRate), this.emitter.on("connection state", this.onConnectionState);
11279
11305
  }), e(this, "unload", () => {
11280
11306
  this.emitter.off("playback state", this.onPlaybackState), this.emitter.off("buffer fullness", this.onBufferFullness), this.emitter.off("media delivery resumed", this.onMediaDeliveryResumed), this.emitter.off("rendition level changed", this.onRenditionLevelChanged), this.emitter.off("video decode rate", this.onVideoDecodeRate), this.emitter.off("connection state", this.onConnectionState), this.suspend();
@@ -11292,7 +11318,7 @@ var oS, sS = () => ({
11292
11318
  return this.metrics.levels[a];
11293
11319
  }), e(this, "getBufferFullnessRegression", (e = !1) => {
11294
11320
  if (!e) return this.bufferFullnessRegression;
11295
- if (performance.now() - this.lastDeliveryResumeTime < dS) return;
11321
+ if (performance.now() - this.lastDeliveryResumeTime < _S) return;
11296
11322
  let t = this.bufferFullness.items().filter(({ time: e }) => e >= this.lastDeliveryResumeTime);
11297
11323
  return t.length >= this.minBufferFullnessLengthForRegression ? this.calculateLinearRegression(t) : void 0;
11298
11324
  }), e(this, "getTargetBufferTime", () => {
@@ -11352,21 +11378,21 @@ var oS, sS = () => ({
11352
11378
  let d = !1;
11353
11379
  if (e.from) {
11354
11380
  var f;
11355
- let e = (f = this.metrics.levels[l]) == null ? sS() : f;
11381
+ let e = (f = this.metrics.levels[l]) == null ? pS() : f;
11356
11382
  l < u ? e.upgradesFromLevel.push(performance.now()) : e.downgradesFromLevel.push(performance.now()), Zt(e.activeRanges);
11357
11383
  let t = e.bufferingRanges[e.bufferingRanges.length - 1];
11358
11384
  d = !!t && !t.end, Zt(e.bufferingRanges), this.metrics.levels[l] = e;
11359
11385
  }
11360
11386
  if (e.to) {
11361
11387
  var p;
11362
- let e = (p = this.metrics.levels[u]) == null ? sS() : p;
11388
+ let e = (p = this.metrics.levels[u]) == null ? pS() : p;
11363
11389
  Qt(e.activeRanges), d && Qt(e.bufferingRanges), this.metrics.levels[u] = e, this.currentLevel = u;
11364
11390
  }
11365
11391
  }), e(this, "onMediaDeliveryResumed", () => {
11366
11392
  this.lastDeliveryResumeTime = performance.now();
11367
11393
  }), e(this, "onBufferFullness", (e) => {
11368
11394
  if (this.metrics.bufferFullness = e, this.isSuspended) return;
11369
- let t = performance.now(), n = this.bufferFullness.peekLast(), r = (e) => Math.floor(e / lS);
11395
+ let t = performance.now(), n = this.bufferFullness.peekLast(), r = (e) => Math.floor(e / hS);
11370
11396
  if (n && r(n.time) === r(t)) n.time = t, n.value = e;
11371
11397
  else {
11372
11398
  var i, a;
@@ -11374,7 +11400,7 @@ var oS, sS = () => ({
11374
11400
  time: t,
11375
11401
  value: e
11376
11402
  });
11377
- let n = this.bufferFullness.items(), r = (i = (a = n[n.length - this.minBufferFullnessLengthForRegression]) == null ? void 0 : a.time) == null ? -Infinity : i, o = Math.min(t - uS, r);
11403
+ let n = this.bufferFullness.items(), r = (i = (a = n[n.length - this.minBufferFullnessLengthForRegression]) == null ? void 0 : a.time) == null ? -Infinity : i, o = Math.min(t - gS, r);
11378
11404
  this.bufferFullness.filterPop(({ time: e }) => e >= o);
11379
11405
  }
11380
11406
  this.bufferFullnessRegression = this.bufferFullness.items().length >= this.minBufferFullnessLengthForRegression ? this.calculateLinearRegression() : void 0;
@@ -11446,10 +11472,10 @@ var oS, sS = () => ({
11446
11472
  Qt(this.metrics.general.activeRanges);
11447
11473
  }
11448
11474
  };
11449
- oS = fS, e(fS, "create", (e, t, n, r) => new oS(e, t, n, r));
11475
+ fS = vS, e(vS, "create", (e, t, n, r) => new fS(e, t, n, r));
11450
11476
  //#endregion
11451
11477
  //#region ../../libs/web-sdk/src/modules/RenditionsModule.ts
11452
- var pS, mS = class {
11478
+ var yS, bS = class {
11453
11479
  constructor(t, n) {
11454
11480
  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", () => {
11455
11481
  this.emitter.off("renditions", this.onRenditions), this.emitter.off("subscription changed", this.onSubscriptionChanged);
@@ -11524,10 +11550,10 @@ var pS, mS = class {
11524
11550
  }), 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);
11525
11551
  }
11526
11552
  };
11527
- pS = mS, e(mS, "create", (e, t) => new pS(e, t));
11553
+ yS = bS, e(bS, "create", (e, t) => new yS(e, t));
11528
11554
  //#endregion
11529
11555
  //#region ../../libs/web-sdk/src/BFrameTracker.ts
11530
- var hS = class t {
11556
+ var xS = class t {
11531
11557
  constructor() {
11532
11558
  e(this, "channelId", void 0), e(this, "renditionId", void 0), e(this, "anchorCts", void 0), e(this, "hasBFramesValue", !1), e(this, "isAwaitingAssessment", !1), e(this, "zeroOffsetSamples", 0), e(this, "omittedBoundaryCrossings", 0), e(this, "hasSeenKeyframe", !1), e(this, "hasObservedReordering", !1), e(this, "rememberedRenditions", new Tt(t.MAX_REMEMBERED_RENDITIONS));
11533
11559
  }
@@ -11563,7 +11589,7 @@ var hS = class t {
11563
11589
  this.channelId = void 0, this.renditionId = void 0, this.anchorCts = void 0, this.hasBFramesValue = !1, this.zeroOffsetSamples = 0, this.omittedBoundaryCrossings = 0, this.hasSeenKeyframe = !1, this.hasObservedReordering = !1, this.isAwaitingAssessment = !0;
11564
11590
  }
11565
11591
  remember(e) {
11566
- this.channelId !== void 0 && this.rememberedRenditions.set(Qb(this.channelId, this.renditionId), e);
11592
+ this.channelId !== void 0 && this.rememberedRenditions.set(ix(this.channelId, this.renditionId), e);
11567
11593
  }
11568
11594
  latchBFrames() {
11569
11595
  this.hasBFramesValue = !0, this.hasObservedReordering = !0, this.isAwaitingAssessment = !1, this.remember(!0);
@@ -11575,18 +11601,18 @@ var hS = class t {
11575
11601
  this.hasSeenKeyframe && !this.hasObservedReordering && (this.remember(!1), this.hasBFramesValue = !1), this.hasSeenKeyframe = !0, this.omittedBoundaryCrossings = 0;
11576
11602
  }
11577
11603
  resetOnSwitch(e, t) {
11578
- if (!$b(e, t, this.channelId, this.renditionId)) {
11604
+ if (!ax(e, t, this.channelId, this.renditionId)) {
11579
11605
  let n = this.channelId !== void 0;
11580
11606
  this.channelId = e, this.renditionId = t, this.anchorCts = void 0, this.zeroOffsetSamples = 0, this.omittedBoundaryCrossings = 0, this.hasSeenKeyframe = !1, this.hasObservedReordering = !1;
11581
- let r = this.rememberedRenditions.get(Qb(e, t));
11607
+ let r = this.rememberedRenditions.get(ix(e, t));
11582
11608
  this.hasBFramesValue = r == null ? !1 : r, n && (this.isAwaitingAssessment = r === void 0);
11583
11609
  }
11584
11610
  }
11585
11611
  };
11586
- e(hS, "MAX_REMEMBERED_RENDITIONS", 32);
11612
+ e(xS, "MAX_REMEMBERED_RENDITIONS", 32);
11587
11613
  //#endregion
11588
11614
  //#region ../../libs/web-sdk/src/modules/SyncModule.ts
11589
- var gS, _S = 5e3, vS = .5, yS = 3e3, bS = () => Ne() || Ae(), xS = (e) => e && bS() ? 100 : 0, SS = (e) => (t) => t > e, CS = 100, wS = 1e3, TS = 1e3, ES = 1e3, DS = 100, OS = 50, kS = {
11615
+ var SS, CS = 5e3, wS = .5, TS = 3e3, ES = () => Ne() || Ae(), DS = (e) => e && ES() ? 100 : 0, OS = (e) => (t) => t > e, kS = 100, AS = 1e3, jS = 1e3, MS = 1e3, NS = 100, PS = 50, FS = {
11590
11616
  seek: {
11591
11617
  toleranceMs: 200,
11592
11618
  toleranceMaxMs: 2500,
@@ -11618,7 +11644,7 @@ var gS, _S = 5e3, vS = .5, yS = 3e3, bS = () => Ne() || Ae(), xS = (e) => e && b
11618
11644
  decayCooldownMultiplier: 3,
11619
11645
  decayCheckInterval: 15e3
11620
11646
  }
11621
- }, AS = class {
11647
+ }, IS = class {
11622
11648
  get driftSamplesToCollect() {
11623
11649
  return this._driftSamplesToCollect;
11624
11650
  }
@@ -11626,8 +11652,8 @@ var gS, _S = 5e3, vS = .5, yS = 3e3, bS = () => Ne() || Ae(), xS = (e) => e && b
11626
11652
  this._driftSamplesToCollect = e, this.driftSamples = new r(e);
11627
11653
  }
11628
11654
  constructor(t, n, i, a, o, s = !0) {
11629
- e(this, "emitter", void 0), e(this, "logger", void 0), e(this, "playbackSource", void 0), e(this, "bufferSource", void 0), e(this, "keyframeTimestamps", new r(10)), e(this, "lastSeekTime", void 0), e(this, "timeshiftDeferralStartedAt", void 0), e(this, "needsMediaSourceRecovery", !1), e(this, "lastAdjustmentTime", performance.now()), e(this, "lastDecayCheckTime", performance.now()), e(this, "syncInterval", void 0), e(this, "currentSyncIntervalMs", CS), 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", void 0), e(this, "timers", k.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, "_driftSamplesToCollect", 5), e(this, "driftSamples", new r(this._driftSamplesToCollect)), e(this, "timestampOffset", void 0), e(this, "hasObservedBFrames", !1), e(this, "bFrameDetector", new hS()), 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, "playbackState", void 0), e(this, "hasPerformedRecoverySeekInCurrentRecoveryState", !1), e(this, "shouldSeekAfterBuffering", !1), e(this, "shouldSeekWhileStuck", !1), e(this, "hasPerformedStuckSeekInCurrentStillness", !1), e(this, "positionSetBySeek", void 0), e(this, "lastPlayheadPosition", void 0), e(this, "lastPlayheadProgressAt", performance.now()), e(this, "usesMse", void 0), e(this, "load", () => {
11630
- this.emitter.on("page active", this.onPageActive), this.emitter.on("pageshow", this.onPageShow), this.setSyncInterval(document.visibilityState === "hidden" ? wS : CS);
11655
+ e(this, "emitter", void 0), e(this, "logger", void 0), e(this, "playbackSource", void 0), e(this, "bufferSource", void 0), e(this, "keyframeTimestamps", new r(10)), e(this, "lastSeekTime", void 0), e(this, "timeshiftDeferralStartedAt", void 0), e(this, "needsMediaSourceRecovery", !1), e(this, "lastAdjustmentTime", performance.now()), e(this, "lastDecayCheckTime", performance.now()), e(this, "syncInterval", void 0), e(this, "currentSyncIntervalMs", kS), 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", void 0), e(this, "timers", k.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, "_driftSamplesToCollect", 5), e(this, "driftSamples", new r(this._driftSamplesToCollect)), e(this, "timestampOffset", void 0), e(this, "hasObservedBFrames", !1), e(this, "bFrameDetector", new xS()), 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, "playbackState", void 0), e(this, "hasPerformedRecoverySeekInCurrentRecoveryState", !1), e(this, "shouldSeekAfterBuffering", !1), e(this, "shouldSeekWhileStuck", !1), e(this, "hasPerformedStuckSeekInCurrentStillness", !1), e(this, "positionSetBySeek", void 0), e(this, "lastPlayheadPosition", void 0), e(this, "lastPlayheadProgressAt", performance.now()), e(this, "usesMse", void 0), e(this, "load", () => {
11656
+ this.emitter.on("page active", this.onPageActive), this.emitter.on("pageshow", this.onPageShow), this.setSyncInterval(document.visibilityState === "hidden" ? AS : kS);
11631
11657
  }), e(this, "unload", () => {
11632
11658
  this.logger.debug("Unloading module..."), this.emitter.off("rtt", this.updateRtt), this.emitter.off("playback state", this.onPlaybackState), this.emitter.off("page active", this.onPageActive), this.emitter.off("pageshow", this.onPageShow), this.emitter.off("buffers flushed", this.clearBFrameLatch), this.emitter.off("recovered from media error", this.onMediaSourceRecovered), this.clearSyncInterval(), this.timers.unload(), this.logger.debug("Unloaded module");
11633
11659
  }), e(this, "suspend", () => {
@@ -11669,7 +11695,7 @@ var gS, _S = 5e3, vS = .5, yS = 3e3, bS = () => Ne() || Ae(), xS = (e) => e && b
11669
11695
  }), e(this, "processSample", (e) => {
11670
11696
  var t;
11671
11697
  if (!e.channelId) throw Error("Sample must be assigned to a channel");
11672
- this.currentChannelId || (this.currentChannelId = e.channelId), this.timestampOffset || (this.timestampOffset = e.timestamp / e.timescale * 1e3 - _S);
11698
+ this.currentChannelId || (this.currentChannelId = e.channelId), this.timestampOffset || (this.timestampOffset = e.timestamp / e.timescale * 1e3 - CS);
11673
11699
  let n = e.type === "video" && e.isSync;
11674
11700
  if (this.bFrameDetector.update(e), this.latchBFramesIfDetected(), this.currentChannelId !== e.channelId) {
11675
11701
  let t = 2 ** 53 - 1;
@@ -11686,7 +11712,7 @@ var gS, _S = 5e3, vS = .5, yS = 3e3, bS = () => Ne() || Ae(), xS = (e) => e && b
11686
11712
  this.currentChannelId || (this.currentChannelId = e);
11687
11713
  let i = t.mediaType();
11688
11714
  if (!i) throw Error("Fragment must have a media type");
11689
- this.timestampOffset || (this.timestampOffset = t.baseMediaDecodeTime() / t.timescale() * 1e3 - _S);
11715
+ this.timestampOffset || (this.timestampOffset = t.baseMediaDecodeTime() / t.timescale() * 1e3 - CS);
11690
11716
  let a = i === "video" && t.startsWithKeyframe();
11691
11717
  if (i === "video" && (this.bFrameDetector.updateFromFragment({
11692
11718
  type: i,
@@ -11811,7 +11837,7 @@ var gS, _S = 5e3, vS = .5, yS = 3e3, bS = () => Ne() || Ae(), xS = (e) => e && b
11811
11837
  this.timeshiftDeferralStartedAt = void 0;
11812
11838
  return;
11813
11839
  }
11814
- let i = performance.now() - this.config.seek.timeoutMs * this.state.timeshiftToleranceMultiplier, a = this.timeshiftAdjustmentTimestamps.filter(SS(i)).length;
11840
+ let i = performance.now() - this.config.seek.timeoutMs * this.state.timeshiftToleranceMultiplier, a = this.timeshiftAdjustmentTimestamps.filter(OS(i)).length;
11815
11841
  if (a && this.state.timeshiftToleranceMultiplier > 2) {
11816
11842
  this.logger.debug("Too many timeshifts within sliding window", {
11817
11843
  timeshiftCooldownThreshold: i,
@@ -11822,12 +11848,12 @@ var gS, _S = 5e3, vS = .5, yS = 3e3, bS = () => Ne() || Ae(), xS = (e) => e && b
11822
11848
  if (e) {
11823
11849
  var o, s;
11824
11850
  let e = this.playbackSource.currentTime, t = (o = (s = this.bufferSource).getBufferedEndAt) == null ? void 0 : o.call(s, e), n = Math.max(0, (t == null ? e : t) - e);
11825
- if (n - r < this.bufferSource.getTargetBufferTime() * vS) {
11851
+ if (n - r < this.bufferSource.getTargetBufferTime() * wS) {
11826
11852
  let e = performance.now();
11827
11853
  if (this.timeshiftDeferralStartedAt === void 0 && (this.timeshiftDeferralStartedAt = e, this.logger.debug("Deferring timeshift while buffered ahead is thin", {
11828
11854
  drift: r,
11829
11855
  bufferedAhead: n
11830
- })), e - this.timeshiftDeferralStartedAt < yS) return;
11856
+ })), e - this.timeshiftDeferralStartedAt < TS) return;
11831
11857
  }
11832
11858
  this.timeshiftDeferralStartedAt !== void 0 && this.logger.debug("Releasing timeshift deferral", { deferredMs: performance.now() - this.timeshiftDeferralStartedAt });
11833
11859
  }
@@ -11847,20 +11873,20 @@ var gS, _S = 5e3, vS = .5, yS = 3e3, bS = () => Ne() || Ae(), xS = (e) => e && b
11847
11873
  let n = (e = (t = this.bufferSource).getNextBufferedRangeStart) == null ? void 0 : e.call(t, this.playbackSource.currentTime);
11848
11874
  return this.shouldSeekAfterBuffering = n !== void 0, n;
11849
11875
  }), e(this, "observePlayheadProgress", () => {
11850
- let e = this.playbackSource.currentTime, t = e !== this.lastPlayheadPosition, n = t && (this.positionSetBySeek === void 0 || e - this.positionSetBySeek > OS);
11876
+ let e = this.playbackSource.currentTime, t = e !== this.lastPlayheadPosition, n = t && (this.positionSetBySeek === void 0 || e - this.positionSetBySeek > PS);
11851
11877
  this.positionSetBySeek = void 0, (n || this.playbackSource.isPaused) && (this.hasPerformedStuckSeekInCurrentStillness = !1), (t || this.playbackSource.isPaused || this.isSeeking()) && (this.lastPlayheadPosition = e, this.lastPlayheadProgressAt = performance.now());
11852
11878
  }), e(this, "isPlayheadStuckInBuffer", () => {
11853
11879
  var e, t;
11854
- if (performance.now() - this.lastPlayheadProgressAt < TS) return !1;
11880
+ if (performance.now() - this.lastPlayheadProgressAt < jS) return !1;
11855
11881
  let n = this.playbackSource.currentTime, r = (e = (t = this.bufferSource).getBufferedEndAt) == null ? void 0 : e.call(t, n);
11856
- return r !== void 0 && r - n >= ES;
11882
+ return r !== void 0 && r - n >= MS;
11857
11883
  }), e(this, "getRecoverySeekReason", () => {
11858
11884
  if (this.needsMediaSourceRecovery) return "media source reopen";
11859
11885
  if (this.shouldSeekWhileStuck) return "stuck in buffer";
11860
11886
  if (this.shouldSeekAfterBuffering) return "buffering";
11861
11887
  }), e(this, "shouldSkipNormalSeek", (e) => e < 0 && -e < this.currentAheadToleranceMs() || e > 0 && e < this.currentSeekToleranceMs() || Math.abs(e) < 1 ? !0 : !this.isAllowedToSync()), e(this, "shouldDeferRecoverySeek", (e, t) => t !== void 0 && t > e), e(this, "buildStuckInBufferSeekPlan", () => {
11862
11888
  var e, t;
11863
- let n = this.playbackSource.currentTime, r = (e = (t = this.bufferSource).getBufferedEndAt) == null ? void 0 : e.call(t, n), i = n + Math.max(this.seekOvershoot, DS);
11889
+ let n = this.playbackSource.currentTime, r = (e = (t = this.bufferSource).getBufferedEndAt) == null ? void 0 : e.call(t, n), i = n + Math.max(this.seekOvershoot, NS);
11864
11890
  if (r === void 0 || i >= r) return;
11865
11891
  let a = this.findKeyframeCloseToTimestamp(i);
11866
11892
  return {
@@ -11941,7 +11967,7 @@ var gS, _S = 5e3, vS = .5, yS = 3e3, bS = () => Ne() || Ae(), xS = (e) => e && b
11941
11967
  if (r && (this.isSeeking() || !this.currentChannelId || this.isSuspended || this.playbackSource.isPaused) || (this.driftSamples.push(t), vt(this.driftSamples.items()) < this.currentTimeshiftToleranceMs() && (this.timeshiftDeferralStartedAt = void 0), !this.isSeekCooldownExpired()) || !r && this.driftSamples.items().length < this.driftSamplesToCollect && Math.abs(t) < 2e3) return;
11942
11968
  let i = r ? t : vt(this.driftSamples.items());
11943
11969
  if (!r && this.tryPlaybackRateSync(i) || !r && this.shouldSkipNormalSeek(i)) return;
11944
- let a = performance.now() - this.config.seek.timeoutMs * this.state.seekToleranceMultiplier, o = this.seekAdjustmentTimestamps.filter(SS(a)).length, s = this.currentEmergencySeekToleranceMs(), c = i > 0 && i >= s;
11970
+ let a = performance.now() - this.config.seek.timeoutMs * this.state.seekToleranceMultiplier, o = this.seekAdjustmentTimestamps.filter(OS(a)).length, s = this.currentEmergencySeekToleranceMs(), c = i > 0 && i >= s;
11945
11971
  if (o && this.state.seekToleranceMultiplier > 2 && !r && !c) {
11946
11972
  this.logger.debug("Too many seek adjustments within sliding window", {
11947
11973
  seekCooldownThreshold: a,
@@ -11970,9 +11996,9 @@ var gS, _S = 5e3, vS = .5, yS = 3e3, bS = () => Ne() || Ae(), xS = (e) => e && b
11970
11996
  return;
11971
11997
  }
11972
11998
  }), e(this, "onPageActive", (e) => {
11973
- this.setSyncInterval(e ? CS : wS), e && this.onSync();
11999
+ this.setSyncInterval(e ? kS : AS), e && this.onSync();
11974
12000
  }), e(this, "onPageShow", (e) => {
11975
- e.persisted && (this.setSyncInterval(document.visibilityState === "hidden" ? wS : CS), this.onSync());
12001
+ e.persisted && (this.setSyncInterval(document.visibilityState === "hidden" ? AS : kS), this.onSync());
11976
12002
  }), e(this, "setSyncInterval", (e) => {
11977
12003
  this.syncInterval !== void 0 && this.currentSyncIntervalMs === e || (this.clearSyncInterval(), this.currentSyncIntervalMs = e, this.syncInterval = this.timers.setInterval(this.onSync, e));
11978
12004
  }), e(this, "clearSyncInterval", () => {
@@ -11983,11 +12009,11 @@ var gS, _S = 5e3, vS = .5, yS = 3e3, bS = () => Ne() || Ae(), xS = (e) => e && b
11983
12009
  let t = n >= e - this.config.seek.keyframeSearchBeforeMs, r = n <= e + this.config.seek.keyframeSearchAfterMs;
11984
12010
  if (t && r) return n;
11985
12011
  }
11986
- }), this.logger = n, this.emitter = t, this.playbackSource = i, this.bufferSource = a, this.usesMse = s, this.seekOvershoot = xS(s), this.config = {
11987
- seek: x({}, kS.seek),
11988
- timeshift: x({}, kS.timeshift),
11989
- playbackRate: x({}, kS.playbackRate),
11990
- backoff: x({}, kS.backoff)
12012
+ }), this.logger = n, this.emitter = t, this.playbackSource = i, this.bufferSource = a, this.usesMse = s, this.seekOvershoot = DS(s), this.config = {
12013
+ seek: x({}, FS.seek),
12014
+ timeshift: x({}, FS.timeshift),
12015
+ playbackRate: x({}, FS.playbackRate),
12016
+ backoff: x({}, FS.backoff)
11991
12017
  }, this.config.timeshift.enabled = o, s || (this.config.seek.toleranceMs = 50, this.config.timeshift.toleranceMs = 20, this.config.seek.aheadToleranceMs = 40), this.state = {
11992
12018
  seekToleranceMultiplier: 1,
11993
12019
  timeshiftToleranceMultiplier: 1
@@ -12049,10 +12075,10 @@ var gS, _S = 5e3, vS = .5, yS = 3e3, bS = () => Ne() || Ae(), xS = (e) => e && b
12049
12075
  return this.serverCurrentTime - this.playbackSource.currentTime;
12050
12076
  }
12051
12077
  };
12052
- gS = AS, e(AS, "create", (e, t, n, r, i, a = !0) => new gS(e, t, n, r, i, a));
12078
+ SS = IS, e(IS, "create", (e, t, n, r, i, a = !0) => new SS(e, t, n, r, i, a));
12053
12079
  //#endregion
12054
12080
  //#region ../../libs/web-sdk/src/modules/TelemetryModule.ts
12055
- var jS, MS = {
12081
+ var LS, RS = {
12056
12082
  enabled: !0,
12057
12083
  interval: 3e4,
12058
12084
  includeErrors: !0,
@@ -12061,11 +12087,11 @@ var jS, MS = {
12061
12087
  maxRetries: 10,
12062
12088
  maxErrorReports: 50,
12063
12089
  maxEvents: 50
12064
- }, NS = (e, t) => x(x({}, t), {}, {
12090
+ }, zS = (e, t) => x(x({}, t), {}, {
12065
12091
  type: e,
12066
12092
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
12067
12093
  discriminator: "web"
12068
- }), PS = class {
12094
+ }), BS = class {
12069
12095
  constructor(n, i, a, o) {
12070
12096
  var s = this;
12071
12097
  e(this, "logger", void 0), e(this, "timers", new k()), e(this, "emitter", void 0), e(this, "options", void 0), e(this, "parentContext", void 0), e(this, "unsentLines", new r(100)), e(this, "retries", 0), e(this, "errorCount", 0), e(this, "eventCount", 0), e(this, "statsCount", 0), e(this, "unload", () => {
@@ -12082,7 +12108,7 @@ var jS, MS = {
12082
12108
  initiator: "interval"
12083
12109
  }, n = {}) => {
12084
12110
  if (!this.options.includeStats) return;
12085
- let r = this.parentContext.getStatistics(), i = NS("stats", x(x(x({}, n), r), {}, {
12111
+ let r = this.parentContext.getStatistics(), i = zS("stats", x(x(x({}, n), r), {}, {
12086
12112
  isFinal: e,
12087
12113
  initiator: t,
12088
12114
  count: this.statsCount++
@@ -12090,7 +12116,7 @@ var jS, MS = {
12090
12116
  this.unsentLines.push(i);
12091
12117
  }), e(this, "addEvent", (e) => {
12092
12118
  if (!this.options.includeEvents || this.eventCount > this.options.maxEvents) return;
12093
- let t = NS("event", x(x({}, this.parentContext.getStatistics()), e));
12119
+ let t = zS("event", x(x({}, this.parentContext.getStatistics()), e));
12094
12120
  this.eventCount++, this.unsentLines.push(t);
12095
12121
  }), e(this, "getStatistics", () => ({ errorCount: this.errorCount })), e(this, "send", function() {
12096
12122
  var e = t(function* (e) {
@@ -12135,14 +12161,14 @@ var jS, MS = {
12135
12161
  let { includeErrors: t, maxErrorReports: n } = this.options;
12136
12162
  if (!(e instanceof A) || e.code() === "channel_not_live" || !t || (this.errorCount++, this.errorCount > n)) return;
12137
12163
  let r = this.parentContext.getStatistics();
12138
- this.unsentLines.push(NS("error", x(x({}, r), e.toStringifiable())));
12139
- }), this.logger = n, this.emitter = i, this.options = x(x({}, MS), a), this.parentContext = o;
12164
+ this.unsentLines.push(zS("error", x(x({}, r), e.toStringifiable())));
12165
+ }), this.logger = n, this.emitter = i, this.options = x(x({}, RS), a), this.parentContext = o;
12140
12166
  }
12141
12167
  };
12142
- jS = PS, e(PS, "create", (e, t, n, r) => new jS(e, t, n, r));
12168
+ LS = BS, e(BS, "create", (e, t, n, r) => new LS(e, t, n, r));
12143
12169
  //#endregion
12144
12170
  //#region ../../libs/web-sdk/src/modules/UnpauseModule.ts
12145
- var FS, IS = class {
12171
+ var VS, HS = class {
12146
12172
  constructor(t, n, r) {
12147
12173
  e(this, "logger", void 0), e(this, "elements", void 0), e(this, "documentState", void 0), e(this, "timers", new k()), e(this, "unload", () => {
12148
12174
  this.timers.unload();
@@ -12151,10 +12177,10 @@ var FS, IS = class {
12151
12177
  }), this.logger = t, this.elements = n, this.documentState = r, this.timers.setInterval(this.unpause, 100);
12152
12178
  }
12153
12179
  };
12154
- FS = IS, e(IS, "create", (e, t, n) => new FS(e, t, n));
12180
+ VS = HS, e(HS, "create", (e, t, n) => new VS(e, t, n));
12155
12181
  //#endregion
12156
12182
  //#region ../../libs/web-sdk/src/OptionsProvider.ts
12157
- var LS = [
12183
+ var US = [
12158
12184
  "minBufferTime",
12159
12185
  "maxBufferTime",
12160
12186
  "burstEnabled",
@@ -12163,10 +12189,10 @@ var LS = [
12163
12189
  "offscreenCanvasEnabled",
12164
12190
  "videoCodecs"
12165
12191
  ];
12166
- function RS(e) {
12167
- return LS.includes(e);
12192
+ function WS(e) {
12193
+ return US.includes(e);
12168
12194
  }
12169
- var zS = class {
12195
+ var GS = class {
12170
12196
  constructor(t) {
12171
12197
  e(this, "options", void 0), e(this, "overrides", /* @__PURE__ */ new Map()), this.options = t;
12172
12198
  }
@@ -12180,7 +12206,7 @@ var zS = class {
12180
12206
  this.options[e] = t;
12181
12207
  }
12182
12208
  get(e, t) {
12183
- if (t && RS(e)) {
12209
+ if (t && WS(e)) {
12184
12210
  var n;
12185
12211
  let r = (n = this.overrides.get(t)) == null ? void 0 : n[e];
12186
12212
  if (r !== void 0) return r;
@@ -12191,7 +12217,7 @@ var zS = class {
12191
12217
  var n;
12192
12218
  return (n = this.overrides.get(t)) == null ? void 0 : n[e];
12193
12219
  }
12194
- }, BS = 6, VS = (e) => {
12220
+ }, KS = 6, qS = (e) => {
12195
12221
  let t = [e], n = 0, r = 0, i = !1, a = (e, t) => {
12196
12222
  var i, a;
12197
12223
  if (e.flags && Is(e.flags)) {
@@ -12203,7 +12229,7 @@ var zS = class {
12203
12229
  return u > 0 && (r = u), x(x({}, e), {}, { duration: u > 0 ? u : r });
12204
12230
  };
12205
12231
  return (e, n = !1) => {
12206
- if (e.flags && Is(e.flags) && n && (i = !i), !(n && t.length < BS && i) && t.length > 0) {
12232
+ if (e.flags && Is(e.flags) && n && (i = !i), !(n && t.length < KS && i) && t.length > 0) {
12207
12233
  i = !1;
12208
12234
  let n = e;
12209
12235
  for (let e = t.length - 1; e > 0; e--) {
@@ -12216,13 +12242,13 @@ var zS = class {
12216
12242
  }
12217
12243
  return t.push(e), [];
12218
12244
  };
12219
- }, HS = ["mse", "wasm"], US = (e) => e == null ? HS : e, WS = (e) => {
12245
+ }, JS = ["mse", "wasm"], YS = (e) => e == null ? JS : e, XS = (e) => {
12220
12246
  if (!e) return !1;
12221
12247
  let t = e.headers && Object.keys(e.headers).length > 0, n = e.queryParams && Object.keys(e.queryParams).length > 0;
12222
12248
  return !!(t || n);
12223
- }, GS = (e, t, n) => {
12224
- if (WS(n)) return "mse";
12225
- let r = US(e);
12249
+ }, ZS = (e, t, n) => {
12250
+ if (XS(n)) return "mse";
12251
+ let r = YS(e);
12226
12252
  for (let e of r) switch (e) {
12227
12253
  case "mse":
12228
12254
  if (t) return "mse";
@@ -12233,7 +12259,7 @@ var zS = class {
12233
12259
  case "wasm": return "wasm";
12234
12260
  }
12235
12261
  return "wasm";
12236
- }, KS = (e, t, n) => {
12262
+ }, QS = (e, t, n) => {
12237
12263
  if (un(t)) return x(x({}, e), {}, {
12238
12264
  type: "video",
12239
12265
  codec: t.codec,
@@ -12254,12 +12280,12 @@ var zS = class {
12254
12280
  data: e.payload,
12255
12281
  duration: 0
12256
12282
  });
12257
- }, qS = ({ average: e, last: t, max: n, min: r }) => ({
12283
+ }, $S = ({ average: e, last: t, max: n, min: r }) => ({
12258
12284
  average: Math.round(e),
12259
12285
  last: Math.round(t),
12260
12286
  max: Math.round(n),
12261
12287
  min: Math.round(r)
12262
- }), JS = [
12288
+ }), eC = [
12263
12289
  "timeSpentBuffering",
12264
12290
  "timePerBufferingEvent",
12265
12291
  "drift",
@@ -12271,24 +12297,24 @@ var zS = class {
12271
12297
  "videoKeyframeIntervalMs",
12272
12298
  "timeToConnected",
12273
12299
  "mediaSourceOpenTime"
12274
- ], YS = [
12300
+ ], tC = [
12275
12301
  "videoDecodeTime",
12276
12302
  "audioDecodeTime",
12277
12303
  "videoTransportTime",
12278
12304
  "rtt"
12279
- ], XS = (e) => typeof e == "object" && !!e && "min" in e && "max" in e && "average" in e && "last" in e, ZS = (e) => {
12305
+ ], nC = (e) => typeof e == "object" && !!e && "min" in e && "max" in e && "average" in e && "last" in e, rC = (e) => {
12280
12306
  let t = x({}, e);
12281
- for (let e of JS) {
12307
+ for (let e of eC) {
12282
12308
  let n = t[e];
12283
12309
  typeof n == "number" && (t[e] = Math.round(n));
12284
12310
  }
12285
- for (let e of YS) {
12311
+ for (let e of tC) {
12286
12312
  let n = t[e];
12287
- XS(n) && (t[e] = qS(n));
12313
+ nC(n) && (t[e] = $S(n));
12288
12314
  }
12289
12315
  return t;
12290
- }, QS = (e, t) => e && typeof e == "object" && t in e, $S = (e) => !(typeof e != "object" || !QS(e, "channelId") || typeof e.channelId != "string" || !QS(e, "url") || typeof e.url != "string" || e.channelId.length === 0 || e.url.length === 0), eC = (e) => {
12291
- if (!$S(e)) throw new A("Invalid options", {
12316
+ }, iC = (e, t) => e && typeof e == "object" && t in e, aC = (e) => !(typeof e != "object" || !iC(e, "channelId") || typeof e.channelId != "string" || !iC(e, "url") || typeof e.url != "string" || e.channelId.length === 0 || e.url.length === 0), oC = (e) => {
12317
+ if (!aC(e)) throw new A("Invalid options", {
12292
12318
  isFatal: !0,
12293
12319
  code: "invalid_options"
12294
12320
  });
@@ -12297,13 +12323,13 @@ var zS = class {
12297
12323
  let n = t;
12298
12324
  n[e] === void 0 && delete n[e];
12299
12325
  }), t;
12300
- }, tC = (e) => {
12326
+ }, sC = (e) => {
12301
12327
  if (typeof e != "object" || !e) throw Error("not an object");
12302
12328
  if (!("video" in e)) throw Error("missing video in subscription");
12303
12329
  if (!("audio" in e)) throw Error("missing audio in subscription");
12304
12330
  if (!("channelId" in e)) throw Error("missing channelId");
12305
12331
  return !0;
12306
- }, nC = class {
12332
+ }, cC = class {
12307
12333
  constructor(n) {
12308
12334
  var r = this;
12309
12335
  e(this, "cache", /* @__PURE__ */ new Map()), e(this, "inFlight", /* @__PURE__ */ new Map()), e(this, "checkVideoSupport", function() {
@@ -12364,10 +12390,16 @@ var zS = class {
12364
12390
  return this.inFlight.set(e, o), o;
12365
12391
  }), this.logger = n;
12366
12392
  }
12367
- }, rC = 1e4, iC = 300, aC = 3e3, oC = 1e4, sC = 1280 * 720, cC = /* @__PURE__ */ new WeakMap(), lC = /* @__PURE__ */ new WeakMap(), uC = /* @__PURE__ */ new WeakMap(), dC = class n extends ne {
12393
+ }, lC = 1e4, uC = 300, dC = 3e3, fC = 1e4, pC = 1280 * 720, mC = /* @__PURE__ */ new WeakMap(), hC = /* @__PURE__ */ new WeakMap(), gC = /* @__PURE__ */ new WeakMap(), _C = class n extends ne {
12394
+ handleListenerError(e, t) {
12395
+ let n = Object.assign(/* @__PURE__ */ Error(`Listener for "${String(t)}" threw`), { cause: e });
12396
+ setTimeout(() => {
12397
+ throw n;
12398
+ }, 0);
12399
+ }
12368
12400
  constructor(r) {
12369
12401
  var o, c, u;
12370
- super(), o = this, e(this, "pictureInPicture", void 0), e(this, "drm", void 0), e(this, "browser", Ge()), e(this, "options", void 0), e(this, "element", void 0), e(this, "playbackSource", void 0), e(this, "emitter", new ne()), e(this, "logger", void 0), e(this, "modules", void 0), e(this, "clientIp", void 0), e(this, "sessionId", void 0), e(this, "clientId", sn()), e(this, "_channels", []), e(this, "createdAt", performance.now()), e(this, "offscreenCanvasElement", void 0), e(this, "webCodecsRenditionSupport", void 0), e(this, "hasCalledConnect", !1), e(this, "upgradeHeld", !1), e(this, "hasRequestedAudioSession", !1), e(this, "isUserPaused", !1), e(this, "isMediaElementPaused", !1), e(this, "latestEmittedLanguages", []), e(this, "wakeLock", void 0), e(this, "pool", new ie(n.MAX_POOL_SIZE)), e(this, "userAgentInformation", new on()), e(this, "encryptedMediaExtensions", void 0), i(this, cC, 0), i(this, lC, []), e(this, "sampleProcessingSesssions", /* @__PURE__ */ new Map()), e(this, "unbackedSamplesWarned", new ex()), e(this, "unextractableSamplesWarned", new ex()), e(this, "sizes", /* @__PURE__ */ new Map()), e(this, "isSuspended", !0), e(this, "inactivityDisconnectInterval", void 0), e(this, "visiblePauseTimeout", void 0), e(this, "offscreenSubtitleInterval", void 0), i(this, uC, void 0), e(this, "attach", (e) => {
12402
+ super(), o = this, e(this, "pictureInPicture", void 0), e(this, "drm", void 0), e(this, "browser", Ge()), e(this, "options", void 0), e(this, "element", void 0), e(this, "playbackSource", void 0), e(this, "emitter", new ne()), e(this, "logger", void 0), e(this, "modules", void 0), e(this, "clientIp", void 0), e(this, "sessionId", void 0), e(this, "clientId", sn()), e(this, "_channels", []), e(this, "createdAt", performance.now()), e(this, "offscreenCanvasElement", void 0), e(this, "webCodecsRenditionSupport", void 0), e(this, "hasCalledConnect", !1), e(this, "upgradeHeld", !1), e(this, "hasRequestedAudioSession", !1), e(this, "isUserPaused", !1), e(this, "isMediaElementPaused", !1), e(this, "latestEmittedLanguages", []), e(this, "wakeLock", void 0), e(this, "pool", new ie(n.MAX_POOL_SIZE)), e(this, "userAgentInformation", new on()), e(this, "encryptedMediaExtensions", void 0), i(this, mC, 0), i(this, hC, []), e(this, "sampleProcessingSesssions", /* @__PURE__ */ new Map()), e(this, "unbackedSamplesWarned", new ox()), e(this, "unextractableSamplesWarned", new ox()), e(this, "sizes", /* @__PURE__ */ new Map()), e(this, "isSuspended", !0), e(this, "inactivityDisconnectInterval", void 0), e(this, "visiblePauseTimeout", void 0), e(this, "offscreenSubtitleInterval", void 0), i(this, gC, void 0), e(this, "attach", (e) => {
12371
12403
  var t;
12372
12404
  (t = this.wakeLock) == null || t.attach(e), e.appendChild(this.element);
12373
12405
  }), e(this, "setElement", (e) => {
@@ -12467,20 +12499,20 @@ var zS = class {
12467
12499
  }), e(this, "updateTextTracks", (e) => {
12468
12500
  let t = e.filter((e) => e.codec === "webvtt");
12469
12501
  t.forEach((e) => {
12470
- if (!s(lC, this).find((t) => t.language === e.language)) {
12502
+ if (!s(hC, this).find((t) => t.language === e.language)) {
12471
12503
  if (this.modules.canvasModule) {
12472
12504
  let t = this.modules.canvasModule.textTracks.addTextTrack(e.kind, e.label || e.language || "", e.language || "");
12473
- s(lC, this).push(t);
12505
+ s(hC, this).push(t);
12474
12506
  } else if (this.mediaElement instanceof HTMLVideoElement) {
12475
12507
  let t = this.mediaElement.addTextTrack(e.kind, e.label || e.language, e.language);
12476
- s(lC, this).push(t);
12508
+ s(hC, this).push(t);
12477
12509
  }
12478
12510
  }
12479
12511
  });
12480
- for (let e of s(lC, this)) t.find((t) => t.language === e.language) ? e.mode === "disabled" && (e.mode = "hidden") : e.mode = "disabled";
12512
+ for (let e of s(hC, this)) t.find((t) => t.language === e.language) ? e.mode === "disabled" && (e.mode = "hidden") : e.mode = "disabled";
12481
12513
  this.emit("text tracks", this.textTracks);
12482
12514
  }), e(this, "cleanupTextTracks", (e = this.currentTime - 2e4) => {
12483
- s(lC, this).forEach((t) => {
12515
+ s(hC, this).forEach((t) => {
12484
12516
  if (t.cues) for (let n of Array.from(t.cues)) n.endTime * 1e3 < e - 2e3 && t.removeCue(n);
12485
12517
  });
12486
12518
  }), e(this, "filterRenditions", function() {
@@ -12540,7 +12572,7 @@ var zS = class {
12540
12572
  var e;
12541
12573
  let t = this.modules.connection.linkQueue;
12542
12574
  if (!t) return !1;
12543
- let n = Math.max(this.targetBufferTime, aC), r = t.peak(n), i = performance.now() - ((e = this.modules.connection.lastConnectionTime) == null ? performance.now() : e), a = r === void 0 ? i < oC : !(r < iC);
12575
+ let n = Math.max(this.targetBufferTime, dC), r = t.peak(n), i = performance.now() - ((e = this.modules.connection.lastConnectionTime) == null ? performance.now() : e), a = r === void 0 ? i < fC : !(r < uC);
12544
12576
  return a && !this.upgradeHeld && this.logger.debug("Holding the upgrade while the link queues", {
12545
12577
  linkQueuePeakMs: r === void 0 ? void 0 : Math.round(r),
12546
12578
  windowMs: n
@@ -12645,8 +12677,8 @@ var zS = class {
12645
12677
  u = void 0, d = void 0, o.logger.warn("Failed to enable OffscreenCanvas; falling back to main thread rendering", { error: e });
12646
12678
  }
12647
12679
  else s && o.logger.warn("OffscreenCanvas requested but not supported; falling back to main thread rendering");
12648
- let f = o.capturesCanvasOnWebKit(u), p = yield dx.create(o.emitter, o.logger.createContext("DecoderModule"), o.options.get("logLevel"), n, o.playbackSource, o.pool, i, a, u, f), { videoRenderer: m } = p.getStatistics(), h = o.modules.canvasModule;
12649
- if (h instanceof Px) if (m === "OffscreenCanvas" && d) {
12680
+ let f = o.capturesCanvasOnWebKit(u), p = yield _x.create(o.emitter, o.logger.createContext("DecoderModule"), o.options.get("logLevel"), n, o.playbackSource, o.pool, i, a, u, f), { videoRenderer: m } = p.getStatistics(), h = o.modules.canvasModule;
12681
+ if (h instanceof Bx) if (m === "OffscreenCanvas" && d) {
12650
12682
  h.setVideoRenderingEnabled(!1);
12651
12683
  let e = o.element;
12652
12684
  e.parentElement ? e.parentElement.replaceChild(d, e) : o.logger.warn("OffscreenCanvas rendering is active but the current element is not attached to the DOM. Updating internal element reference only."), o.offscreenCanvasElement = d, o.setElement(d);
@@ -12658,11 +12690,11 @@ var zS = class {
12658
12690
  t.parentElement && t.parentElement.replaceChild(e, t), o.setElement(e);
12659
12691
  }
12660
12692
  }
12661
- else h instanceof Vx && (h.setBackgroundPlaybackEnabled(o.isBackgroundPlayEnabled(o.channelId)), m === "OffscreenCanvas" && d ? (h.setOffscreenCanvas(d), o.offscreenCanvasElement = d, f && o.connectWebKitVideoOutput(p, h)) : (h.setVideoTrack(void 0), h.setOffscreenCanvas(void 0), o.offscreenCanvasElement = void 0));
12693
+ else h instanceof qx && (h.setBackgroundPlaybackEnabled(o.isBackgroundPlayEnabled(o.channelId)), m === "OffscreenCanvas" && d ? (h.setOffscreenCanvas(d), o.offscreenCanvasElement = d, f && o.connectWebKitVideoOutput(p, h)) : (h.setVideoTrack(void 0), h.setOffscreenCanvas(void 0), o.offscreenCanvasElement = void 0));
12662
12694
  (e = o.modules.decoder) == null || e.unload(), o.modules.decoder = p, o.isHiddenWithBackgroundPlayback() && o.modules.decoder.enableBackgroundTimers(), o.modules.decoder.setVideoRenderingEnabled(o.isVideoOnScreen()), o.modules.decoder.load(), o.setupOffscreenSubtitleRouting();
12663
- })), e(this, "capturesCanvasOnWebKit", (e) => !!e && this.browser.platform.isWebKit && this.modules.canvasModule instanceof Vx), e(this, "connectWebKitVideoOutput", (e, t) => {
12695
+ })), e(this, "capturesCanvasOnWebKit", (e) => !!e && this.browser.platform.isWebKit && this.modules.canvasModule instanceof qx), e(this, "connectWebKitVideoOutput", (e, t) => {
12664
12696
  let n = () => {
12665
- t.setVideoTrack(void 0), this.browser.platform.isIOS && e.setMaxVideoCanvasPixels(sC);
12697
+ t.setVideoTrack(void 0), this.browser.platform.isIOS && e.setMaxVideoCanvasPixels(pC);
12666
12698
  };
12667
12699
  e.onVideoTrackLost((e) => {
12668
12700
  this.logger.warn("Worker video track lost, falling back to canvas capture", { error: e }), n();
@@ -12670,7 +12702,7 @@ var zS = class {
12670
12702
  let r = e.videoTrack;
12671
12703
  r ? t.setVideoTrack(r) : n();
12672
12704
  }), e(this, "setupOffscreenSubtitleRouting", () => {
12673
- if (this.offscreenSubtitleInterval !== void 0 && (clearInterval(this.offscreenSubtitleInterval), this.offscreenSubtitleInterval = void 0), !this.offscreenCanvasElement || !this.modules.decoder || this.modules.canvasModule instanceof Vx) return;
12705
+ if (this.offscreenSubtitleInterval !== void 0 && (clearInterval(this.offscreenSubtitleInterval), this.offscreenSubtitleInterval = void 0), !this.offscreenCanvasElement || !this.modules.decoder || this.modules.canvasModule instanceof qx) return;
12674
12706
  let e = this.modules.decoder, t = this.modules.canvasModule;
12675
12707
  if (!t) return;
12676
12708
  let n = !1;
@@ -12712,7 +12744,7 @@ var zS = class {
12712
12744
  this.clearVisiblePauseDisconnect(), this.isUserPaused = !1, this.requestAudioSessionOnce(), this.hasCalledConnect ? this.unsuspend() : this.playbackState !== "playing" && (this._connect(), self.addEventListener("__vindral_register_debug__", this.registerDebugInstance), this.modules.timer.setInterval(() => this.cleanupTextTracks(), n.REMOVE_CUE_THRESHOLD)), (e = this.wakeLock) == null || e.enable(), this.playbackState === "paused" && this.playbackSource.isActivated && (this.resetModules(), this.emitter.emit("flush buffers"), this.cleanupTextTracks(2 ** 53 - 1)), this.playbackSource.play(), this.isHiddenWithBackgroundPlayback() && this.scheduleInactivityDisconnect();
12713
12745
  }), e(this, "getStatistics", () => {
12714
12746
  let e = Object.values(this.modules).reduce((e, t) => t && "getStatistics" in t ? x(x({}, e), t.getStatistics()) : e, this.getRuntimeInfo()), t = Math.round(this.timeActive > 0 ? (e.bytesReceived || 0) * 8 / (this.timeActive / 1e3) : 0), n = this.uptime / 36e5, r = Math.max(0, (e.connectCount || 0) - 1), i = n > 0 ? r / n : 0, a = this.timeActive / 6e4, o = Math.max(a, 1), s = a > 0 ? (e.seekAdjustmentCount || 0) / o : 0, c = a > 0 ? (e.timeshiftAdjustmentCount || 0) / o : 0;
12715
- return ZS(x(x({}, e), {}, {
12747
+ return rC(x(x({}, e), {}, {
12716
12748
  averageBitRate: t,
12717
12749
  reconnectsPerHour: i,
12718
12750
  seekAdjustmentsPerMinute: s,
@@ -12721,7 +12753,7 @@ var zS = class {
12721
12753
  }), e(this, "resetModules", () => {
12722
12754
  Object.values(this.modules).forEach((e) => {
12723
12755
  e && "reset" in e && e.reset();
12724
- }), this.playbackSource instanceof uc && this.modules.adaptivity.holdReconnect(rC), this.sampleProcessingSesssions.clear(), this.cleanupTextTracks(Infinity), this.playbackSource.currentTime = 0, this.playbackSource.isActivated = !1;
12756
+ }), this.playbackSource instanceof uc && this.modules.adaptivity.holdReconnect(lC), this.sampleProcessingSesssions.clear(), this.cleanupTextTracks(Infinity), this.playbackSource.currentTime = 0, this.playbackSource.isActivated = !1;
12725
12757
  }), e(this, "disconnectForInactivePage", (e) => {
12726
12758
  if (this.clearInactivityDisconnect(), this.emitter.emit("flush buffers"), !this.isBackgroundPlayEnabled(this.channelId)) {
12727
12759
  var t;
@@ -12752,10 +12784,10 @@ var zS = class {
12752
12784
  e && "unsuspend" in e && e.unsuspend();
12753
12785
  });
12754
12786
  }), e(this, "getRuntimeInfo", () => {
12755
- let e = this.modules.canvasModule instanceof Vx ? !0 : void 0;
12787
+ let e = this.modules.canvasModule instanceof qx ? !0 : void 0;
12756
12788
  return x({
12757
12789
  uptime: this.uptime,
12758
- version: "4.8.0",
12790
+ version: "4.8.1-10-gcc2fea9d",
12759
12791
  clientId: this.clientId,
12760
12792
  sessionId: this.sessionId,
12761
12793
  channelId: this.channelId,
@@ -12800,7 +12832,7 @@ var zS = class {
12800
12832
  if (this.browser.platform.isWebKit || !this.browser.isMobile) return !1;
12801
12833
  let t = (e = this.modules) == null ? void 0 : e.decoder;
12802
12834
  return t ? t.audioWebCodecsInUse : this.isWebCodecsAudioAvailable(this.channelId);
12803
- }), this.options = new zS(x(x({}, ir), eC(r))), r.telemetryEnabled === void 0 && ["localhost", "127.0.0.1"].includes(location.hostname) && this.options.set("telemetryEnabled", !1);
12835
+ }), this.options = new GS(x(x({}, ir), oC(r))), r.telemetryEnabled === void 0 && ["localhost", "127.0.0.1"].includes(location.hostname) && this.options.set("telemetryEnabled", !1);
12804
12836
  let d = {
12805
12837
  channelId: this.options.get("channelId"),
12806
12838
  audio: {
@@ -12813,14 +12845,14 @@ var zS = class {
12813
12845
  height: this.options.get("maxSize").height
12814
12846
  }
12815
12847
  }, f = S.get();
12816
- f.setLevel(this.options.get("logLevel")), f.setDebug(!1), this.logger = f, this.webCodecsRenditionSupport = new nC(f), r.iosMediaElementEnabled !== void 0 && this.logger.warn("Option iosMediaElementEnabled is deprecated and will be removed in a future release. Use streamToMediaElementEnabled instead.");
12848
+ f.setLevel(this.options.get("logLevel")), f.setDebug(!1), this.logger = f, this.webCodecsRenditionSupport = new cC(f), r.iosMediaElementEnabled !== void 0 && this.logger.warn("Option iosMediaElementEnabled is deprecated and will be removed in a future release. Use streamToMediaElementEnabled instead.");
12817
12849
  let p = (c = r.streamToMediaElementEnabled) == null ? r.iosMediaElementEnabled : c;
12818
12850
  p !== void 0 && (this.options.set("streamToMediaElementEnabled", p), this.options.set("iosMediaElementEnabled", p)), r.iosBackgroundPlayEnabled !== void 0 && this.logger.warn("Option iosBackgroundPlayEnabled is deprecated and will be removed in a future release. Use backgroundPlayEnabled instead.");
12819
12851
  let m = (u = r.backgroundPlayEnabled) == null ? r.iosBackgroundPlayEnabled : u;
12820
12852
  m !== void 0 && (this.options.set("backgroundPlayEnabled", m), this.options.set("iosBackgroundPlayEnabled", m));
12821
12853
  let g = r.mseEnabled !== void 0, _ = r.decoders !== void 0;
12822
12854
  g && this.logger.warn("Option mseEnabled is deprecated and will be removed in a future release. Use decoders instead (e.g. decoders: [\"wasm\"])."), g && !_ && r.mseEnabled === !1 && this.options.set("decoders", ["wasm"]);
12823
- let v = rS.create(this.emitter, this.logger.createContext("PictureInPictureModule")), y = this.options.get("mediaSessionEnabled") ? zx.create(this.emitter, this.logger.createContext("MediaSessionModule"), {
12855
+ let v = lS.create(this.emitter, this.logger.createContext("PictureInPictureModule")), y = this.options.get("mediaSessionEnabled") ? Gx.create(this.emitter, this.logger.createContext("MediaSessionModule"), {
12824
12856
  metadata: this.options.get("mediaSessionMetadata"),
12825
12857
  decoy: this.willUseMediaSource() || this.usesSplitCanvasAudio() ? void 0 : kc.create(this.logger.createContext("AudioFocusDecoy"), this.yieldToInterruption),
12826
12858
  isMuted: () => this.playbackSource.userMuted,
@@ -12831,12 +12863,12 @@ var zS = class {
12831
12863
  holdDecoyWhilePaused: this.holdsDecoyWhilePaused(),
12832
12864
  keepDecoyWhenMuted: this.isWebKitCanvasPath(),
12833
12865
  pauseMeansMute: !this.options.get("pauseSupportEnabled")
12834
- }) : void 0, b = k.create(), te = px.create(this.emitter), re = Kb.create(this.emitter, this.logger.createContext("ConnectionModule"), {
12866
+ }) : void 0, b = k.create(), te = yx.create(this.emitter), re = Qb.create(this.emitter, this.logger.createContext("ConnectionModule"), {
12835
12867
  reconnectHandler: this.options.get("reconnectHandler"),
12836
12868
  options: this.options,
12837
12869
  onConnectInfo: this.onConnectInfo,
12838
12870
  documentState: te
12839
- }), C = Mv.create(this.logger.createContext("SubscriptionModule"), this.emitter, d), w = mS.create(this.emitter, C), ae = aS.create(this.emitter, this.logger.createContext("PlaybackModule"), this, this.options.get("minBufferTime")), oe = fS.create(this.emitter, this.logger.createContext("QualityOfServiceModule"), w, ae);
12871
+ }), C = Mv.create(this.logger.createContext("SubscriptionModule"), this.emitter, d), w = bS.create(this.emitter, C), ae = dS.create(this.emitter, this.logger.createContext("PlaybackModule"), this, this.options.get("minBufferTime")), oe = vS.create(this.emitter, this.logger.createContext("QualityOfServiceModule"), w, ae);
12840
12872
  this.encryptedMediaExtensions = new Si(this.emitter, this.logger.createContext("EncryptedMediaExtensions"), r.drm), this.drm = {
12841
12873
  setHeaders: (e) => {
12842
12874
  this.encryptedMediaExtensions.headers = e;
@@ -12855,9 +12887,9 @@ var zS = class {
12855
12887
  logger: this.logger.createContext("MediaElement"),
12856
12888
  poster: ce
12857
12889
  });
12858
- e.on("buffer state", (e) => this.onMediaElementBufferState(e, T)), e.on("needs user input", (e) => this.emitter.emit("needs user input", e)), e.on("volume state", (e) => this.emitter.emit("volume state", e)), e.on("media element state", (e) => this.onMediaElementState(e)), this.element = e.element, this.playbackSource = e, Si.isSupported() && this.encryptedMediaExtensions.attach(e.element), T = Kx.create(this.logger.createContext("MseModule"), this.emitter, this.element), this.options.get("pauseSupportEnabled") || (le = IS.create(this.logger.createContext("UnpauseModule"), [e], te)), this.options.get("pictureInPictureEnabled") && this.emitter.emit("add picture in picture listener", { element: e.element });
12890
+ e.on("buffer state", (e) => this.onMediaElementBufferState(e, T)), e.on("needs user input", (e) => this.emitter.emit("needs user input", e)), e.on("volume state", (e) => this.emitter.emit("volume state", e)), e.on("media element state", (e) => this.onMediaElementState(e)), this.element = e.element, this.playbackSource = e, Si.isSupported() && this.encryptedMediaExtensions.attach(e.element), T = Qx.create(this.logger.createContext("MseModule"), this.emitter, this.element), this.options.get("pauseSupportEnabled") || (le = HS.create(this.logger.createContext("UnpauseModule"), [e], te)), this.options.get("pictureInPictureEnabled") && this.emitter.emit("add picture in picture listener", { element: e.element });
12859
12891
  } else if (this.streamsToMediaElement()) {
12860
- let e = Vx.create(this.emitter, this.logger.createContext("ModernCanvasModule"), this.pool, this, {
12892
+ let e = qx.create(this.emitter, this.logger.createContext("ModernCanvasModule"), this.pool, this, {
12861
12893
  type: this.options.get("media") === "audio" ? "audio" : "video",
12862
12894
  muted: this.options.get("muted") || this.options.get("media") === "video",
12863
12895
  volume: this.options.get("volume"),
@@ -12869,10 +12901,10 @@ var zS = class {
12869
12901
  });
12870
12902
  this.element = e.element().element, this.playbackSource = e, ue = e;
12871
12903
  let t = this.browser.platform.isIOS && this.browser.platform.iosVersion <= 15;
12872
- this.options.get("pictureInPictureEnabled") && !t && this.emitter.emit("add picture in picture listener", { element: this.element }), this.options.get("pauseSupportEnabled") || (le = IS.create(this.logger.createContext("UnpauseModule"), e.elements(), te));
12904
+ this.options.get("pictureInPictureEnabled") && !t && this.emitter.emit("add picture in picture listener", { element: this.element }), this.options.get("pauseSupportEnabled") || (le = HS.create(this.logger.createContext("UnpauseModule"), e.elements(), te));
12873
12905
  } else {
12874
12906
  let e;
12875
- e = Px.create(this.emitter, this.logger.createContext("LegacyCanvasModule"), this.pool, this, this.options.get("muted") || this.options.get("media") === "video", this.options.get("volume"), () => {
12907
+ e = Bx.create(this.emitter, this.logger.createContext("LegacyCanvasModule"), this.pool, this, this.options.get("muted") || this.options.get("media") === "video", this.options.get("volume"), () => {
12876
12908
  this.setElement(e.element());
12877
12909
  }, this.options.get("minBufferTime")), this.element = e.element(), this.playbackSource = e, ue = e, this.options.get("iosWakeLockEnabled") && (this.wakeLock = new Zs());
12878
12910
  }
@@ -12890,9 +12922,9 @@ var zS = class {
12890
12922
  getTargetBufferTime: () => ae.getTargetBufferTime(),
12891
12923
  getNextBufferedRangeStart: T ? (e) => T.getNextBufferedRangeStart(e) : void 0,
12892
12924
  getBufferedEndAt: T ? (e) => T.getBufferedEndAt(e) : void 0
12893
- }, me = AS.create(this.emitter, this.logger.createContext("SyncModule"), this.playbackSource, pe, fe, de), he = yx.create(this.logger.createContext("JitterModule")), ge = pc.create(this.emitter), _e = (this.options.get("edgeUrl") || this.options.get("url")).replace("wss://", "https://").replace("ws://", "http://").replace("//lb.", "//errors."), E = new URL("/telemetry", _e).toString();
12925
+ }, me = IS.create(this.emitter, this.logger.createContext("SyncModule"), this.playbackSource, pe, fe, de), he = Tx.create(this.logger.createContext("JitterModule")), ge = pc.create(this.emitter), _e = (this.options.get("edgeUrl") || this.options.get("url")).replace("wss://", "https://").replace("ws://", "http://").replace("//lb.", "//errors."), E = new URL("/telemetry", _e).toString();
12894
12926
  this.modules = {
12895
- telemetry: PS.create(this.logger.createContext("TelemetryModule"), this.emitter, {
12927
+ telemetry: BS.create(this.logger.createContext("TelemetryModule"), this.emitter, {
12896
12928
  url: E,
12897
12929
  enabled: this.options.get("telemetryEnabled"),
12898
12930
  includeStats: !1,
@@ -12904,8 +12936,8 @@ var zS = class {
12904
12936
  }),
12905
12937
  incomingData: ge,
12906
12938
  adaptivity: Cc.create(this.emitter, this.logger.createContext("AdaptivityModule"), oe, ge, { cooldownTime: Math.max(this.options.get("minBufferTime"), 2e3) }),
12907
- constraintCap: Zb.create(this.emitter, this.element, w, this.options.get("abrEnabled") ? this.options.get("sizeBasedResolutionCapEnabled") : !1),
12908
- event: gx.create(this.emitter, this.logger.createContext("EventModule"), me),
12939
+ constraintCap: rx.create(this.emitter, this.element, w, this.options.get("abrEnabled") ? this.options.get("sizeBasedResolutionCapEnabled") : !1),
12940
+ event: Sx.create(this.emitter, this.logger.createContext("EventModule"), me),
12909
12941
  sync: me,
12910
12942
  jitter: he,
12911
12943
  documentState: te,
@@ -12977,7 +13009,7 @@ var zS = class {
12977
13009
  let r = ((t = (n = e.telemetry) == null ? void 0 : n.probability) == null ? 1 : t) >= Math.random();
12978
13010
  if (e.telemetry) {
12979
13011
  var i;
12980
- (i = this.modules.telemetry) == null || i.unload(), this.modules.telemetry = PS.create(this.logger.createContext("TelemetryModule"), this.emitter, x(x({}, e.telemetry), {}, { enabled: this.options.get("telemetryEnabled") && r }), this), this.modules.telemetry.load();
13012
+ (i = this.modules.telemetry) == null || i.unload(), this.modules.telemetry = BS.create(this.logger.createContext("TelemetryModule"), this.emitter, x(x({}, e.telemetry), {}, { enabled: this.options.get("telemetryEnabled") && r }), this), this.modules.telemetry.load();
12981
13013
  }
12982
13014
  }), this.emitter.on("adapt level", (e) => {
12983
13015
  let t = this.modules.renditions.getRenditionLevels(), n = this.modules.renditions.getRenditionLevel(), r = t.findIndex((e) => e === n), i = t.length - 1, a = r;
@@ -13020,8 +13052,8 @@ var zS = class {
13020
13052
  audio: x(x({}, this.targetSubscription.audio), f == null ? void 0 : f.audio)
13021
13053
  })), this.emitter.emit("adapted level");
13022
13054
  }), this.emitter.on("ping timeout", this.onPingTimeout), this.emitter.on("text track data", (e) => {
13023
- let t = s(lC, this).find((t) => t.language === e.language), n = this.modules.sync.getTimeshiftOffset() / 1e3, r = n - s(cC, this);
13024
- if (a(cC, this, n), t) {
13055
+ let t = s(hC, this).find((t) => t.language === e.language), n = this.modules.sync.getTimeshiftOffset() / 1e3, r = n - s(mC, this);
13056
+ if (a(mC, this, n), t) {
13025
13057
  if (t.cues) for (let e of t.cues) e.startTime -= r, e.endTime -= r;
13026
13058
  for (let r of e.cues) {
13027
13059
  let e = new VTTCue(r.startTime - n, r.endTime - n, r.text);
@@ -13037,19 +13069,19 @@ var zS = class {
13037
13069
  this.clientIp = t.ip;
13038
13070
  break;
13039
13071
  case "renditions":
13040
- this.updateTextTracks(t.renditions), a(uC, this, this.filterRenditions(t.renditions, n.channelId).then((e) => {
13072
+ this.updateTextTracks(t.renditions), a(gC, this, this.filterRenditions(t.renditions, n.channelId).then((e) => {
13041
13073
  r === this.sessionId && (this.emitter.emit("renditions", {
13042
13074
  renditions: e,
13043
13075
  channelId: n.channelId
13044
13076
  }), this.emit("rendition levels", this.modules.renditions.getRenditionLevels()), this.emitLanguagesIfChanged());
13045
13077
  }).finally(() => {
13046
- a(uC, this, void 0);
13078
+ a(gC, this, void 0);
13047
13079
  }));
13048
13080
  break;
13049
13081
  case "subscription changed":
13050
13082
  var i;
13051
13083
  try {
13052
- tC(t.subscription);
13084
+ sC(t.subscription);
13053
13085
  } catch (e) {
13054
13086
  this.emitter.emit("error", new A("Subscription failed validation", {
13055
13087
  source: e instanceof Error ? e : void 0,
@@ -13180,7 +13212,7 @@ var zS = class {
13180
13212
  let ye = function() {
13181
13213
  var e = t(function* (e) {
13182
13214
  let t = e.channelId;
13183
- s(uC, o) && (yield s(uC, o));
13215
+ s(gC, o) && (yield s(gC, o));
13184
13216
  let n = o.modules.renditions.getRendition(e.renditionId, t);
13185
13217
  if (!Rs(e.flags)) {
13186
13218
  if (zs(e.flags)) {
@@ -13194,8 +13226,8 @@ var zS = class {
13194
13226
  } catch (e) {
13195
13227
  o.logger.warn("failed to parse WebVTT segment, dropping it", e);
13196
13228
  }
13197
- let i = n / 1e3, c = s(lC, o).find((t) => t.language === e.language), l = i - s(cC, o);
13198
- if (a(cC, o, i), c) {
13229
+ let i = n / 1e3, c = s(hC, o).find((t) => t.language === e.language), l = i - s(mC, o);
13230
+ if (a(mC, o, i), c) {
13199
13231
  if (c.cues) for (let e of c.cues) e.startTime -= l, e.endTime -= l;
13200
13232
  for (let e of r) {
13201
13233
  let t = new VTTCue(e.startTime - i, e.endTime - i, e.text);
@@ -13231,10 +13263,10 @@ var zS = class {
13231
13263
  mimeType: s
13232
13264
  }), o.emit("initialized media");
13233
13265
  } else {
13234
- let t = KS(e, n, o.sizes.get(e.renditionId));
13266
+ let t = QS(e, n, o.sizes.get(e.renditionId));
13235
13267
  o.modules.jitter.recordSample(t);
13236
13268
  let i = o.sampleProcessingSesssions.get(r);
13237
- if (!i) i = VS(o.modules.sync.processSample(t)), o.sampleProcessingSesssions.set(r, i);
13269
+ if (!i) i = qS(o.modules.sync.processSample(t)), o.sampleProcessingSesssions.set(r, i);
13238
13270
  else {
13239
13271
  let e = o.willUseMediaSource() && o.isSwitchingRenditionLevel && t.type === "video", n = i(o.modules.sync.processSample(t), e), r = t;
13240
13272
  n.forEach((e) => {
@@ -13341,7 +13373,7 @@ var zS = class {
13341
13373
  this.modules.subscription.setLanguage(e), this.alignSizeAndBitRate(this.targetSubscription);
13342
13374
  }
13343
13375
  set textTrack(e) {
13344
- e !== this.textTrack && (s(lC, this).forEach((t) => {
13376
+ e !== this.textTrack && (s(hC, this).forEach((t) => {
13345
13377
  if (t.label === e) t.mode = "showing";
13346
13378
  else {
13347
13379
  if (t.mode === "showing" && t.cues) for (let e of [...t.cues]) t.removeCue(e);
@@ -13350,11 +13382,11 @@ var zS = class {
13350
13382
  }), this.emitter.emit("text track", e));
13351
13383
  }
13352
13384
  get textTracks() {
13353
- return s(lC, this).filter((e) => e.mode !== "disabled").map((e) => e.label);
13385
+ return s(hC, this).filter((e) => e.mode !== "disabled").map((e) => e.label);
13354
13386
  }
13355
13387
  get textTrack() {
13356
13388
  var e;
13357
- return (e = s(lC, this).find((e) => e.mode === "showing")) == null ? void 0 : e.label;
13389
+ return (e = s(hC, this).find((e) => e.mode === "showing")) == null ? void 0 : e.label;
13358
13390
  }
13359
13391
  get channelId() {
13360
13392
  var e, t;
@@ -13492,7 +13524,7 @@ var zS = class {
13492
13524
  return this.modules.subscription.getTargetSubscription();
13493
13525
  }
13494
13526
  resolvedDecoder(e) {
13495
- return GS(this.options.get("decoders", e), this.browser.supportsMediaSource, this.options.get("drm"));
13527
+ return ZS(this.options.get("decoders", e), this.browser.supportsMediaSource, this.options.get("drm"));
13496
13528
  }
13497
13529
  usesSplitCanvasAudio() {
13498
13530
  return !this.willUseMediaSource() && this.options.get("streamToMediaElementEnabled") && mt(this.browser) && this.options.get("media") !== "audio" && this.options.get("media") !== "video" && this.browser.platform.isIOS;
@@ -13532,6 +13564,6 @@ var zS = class {
13532
13564
  return this.hasCalledConnect && this.isBackgroundPlayEnabled(e) && !this.isUserPaused;
13533
13565
  }
13534
13566
  };
13535
- e(dC, "MAX_POOL_SIZE", 10), e(dC, "REMOVE_CUE_THRESHOLD", 1e3 * 10), e(dC, "BACKGROUND_INACTIVITY_DISCONNECT_TIMEOUT", 1e3 * 15), e(dC, "VISIBLE_PAUSE_DISCONNECT_DELAY", 1e3);
13567
+ e(_C, "MAX_POOL_SIZE", 10), e(_C, "REMOVE_CUE_THRESHOLD", 1e3 * 10), e(_C, "BACKGROUND_INACTIVITY_DISCONNECT_TIMEOUT", 1e3 * 15), e(_C, "VISIBLE_PAUSE_DISCONNECT_DELAY", 1e3);
13536
13568
  //#endregion
13537
- export { ut as C, pt as D, lt as E, ze as O, ft as S, at as T, tt as _, bn as a, et as b, gn as c, Sn as d, A as f, Qe as g, nt as h, vn as i, Re as k, Dn as l, $e as m, Nn as n, xn as o, qt as p, yn as r, _n as s, dC as t, Cn as u, st as v, ct as w, it as x, Ze as y };
13569
+ export { ut as C, pt as D, lt as E, ze as O, ft as S, at as T, tt as _, bn as a, et as b, gn as c, Sn as d, A as f, Qe as g, nt as h, vn as i, Re as k, Dn as l, $e as m, Nn as n, xn as o, qt as p, yn as r, _n as s, _C as t, Cn as u, st as v, ct as w, it as x, Ze as y };