@slashedcloud/player
Version:
A media player application utilizing Shaka Player for adaptive video streaming, capable of playing HLS, MPD and plain HTTP video streams.
1,302 lines • 1.19 MB
JavaScript
/*!
* SlashedCloud v0.1.2 (https://github.com/SlashedCloud/player#readme)
* Copyright 2024-2024 rogerio.jardim@fedrax.pt
* Licensed under Apache (https://github.com/SlashedCloud/player/blob/develop/LICENSE)
*/
var Kk = typeof globalThis != "undefined" ? globalThis : typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : {};
function qk(nr) {
return nr && nr.__esModule && Object.prototype.hasOwnProperty.call(nr, "default") ? nr.default : nr;
}
var CA = {};
/*
@license
Shaka Player
Copyright 2016 Google LLC
SPDX-License-Identifier: Apache-2.0
*/
(function(nr) {
(function() {
var F0 = typeof window != "undefined" ? window : Kk, bc = {};
(function(b, G0, jc) {
var p;
function V0(e) {
var t = 0;
return function() {
return t < e.length ? { done: !1, value: e[t++] } : { done: !0 };
};
}
var ju = typeof Object.defineProperties == "function" ? Object.defineProperty : function(e, t, n) {
return e == Array.prototype || e == Object.prototype || (e[t] = n.value), e;
};
function MA(e) {
e = [typeof globalThis == "object" && globalThis, e, typeof b == "object" && b, typeof self == "object" && self, typeof G0 == "object" && G0];
for (var t = 0; t < e.length; ++t) {
var n = e[t];
if (n && n.Math == Math) return n;
}
throw Error("Cannot find global object");
}
var ui = MA(this);
function Me(e, t) {
if (t) e: {
var n = ui;
e = e.split(".");
for (var i = 0; i < e.length - 1; i++) {
var r = e[i];
if (!(r in n)) break e;
n = n[r];
}
e = e[e.length - 1], i = n[e], t = t(i), t != i && t != null && ju(n, e, { configurable: !0, writable: !0, value: t });
}
}
Me("Symbol", function(e) {
function t(o) {
if (this instanceof t) throw new TypeError("Symbol is not a constructor");
return new n(i + (o || "") + "_" + r++, o);
}
function n(o, s) {
this.g = o, ju(this, "description", { configurable: !0, writable: !0, value: s });
}
if (e) return e;
n.prototype.toString = function() {
return this.g;
};
var i = "jscomp_symbol_" + (1e9 * Math.random() >>> 0) + "_", r = 0;
return t;
}), Me("Symbol.iterator", function(e) {
if (e) return e;
e = Symbol("Symbol.iterator");
for (var t = "Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "), n = 0; n < t.length; n++) {
var i = ui[t[n]];
typeof i == "function" && typeof i.prototype[e] != "function" && ju(i.prototype, e, { configurable: !0, writable: !0, value: function() {
return H0(V0(this));
} });
}
return e;
});
function H0(e) {
return e = { next: e }, e[Symbol.iterator] = function() {
return this;
}, e;
}
function g(e) {
var t = typeof Symbol != "undefined" && Symbol.iterator && e[Symbol.iterator];
if (t) return t.call(e);
if (typeof e.length == "number") return { next: V0(e) };
throw Error(String(e) + " is not an iterable or ArrayLike");
}
function X(e) {
if (!(e instanceof Array)) {
e = g(e);
for (var t, n = []; !(t = e.next()).done; ) n.push(t.value);
e = n;
}
return e;
}
var kA = typeof Object.create == "function" ? Object.create : function(e) {
function t() {
}
return t.prototype = e, new t();
}, Fc;
if (typeof Object.setPrototypeOf == "function") Fc = Object.setPrototypeOf;
else {
var Bc;
e: {
var LA = { a: !0 }, z0 = {};
try {
z0.__proto__ = LA, Bc = z0.a;
break e;
} catch (e) {
}
Bc = !1;
}
Fc = Bc ? function(e, t) {
if (e.__proto__ = t, e.__proto__ !== t) throw new TypeError(e + " is not extensible");
return e;
} : null;
}
var K0 = Fc;
function fe(e, t) {
if (e.prototype = kA(t.prototype), e.prototype.constructor = e, K0) K0(e, t);
else for (var n in t) if (n != "prototype") if (Object.defineProperties) {
var i = Object.getOwnPropertyDescriptor(t, n);
i && Object.defineProperty(e, n, i);
} else e[n] = t[n];
e.cm = t.prototype;
}
function Fu() {
this.o = !1, this.l = null, this.h = void 0, this.g = 1, this.j = this.m = 0, this.A = this.i = null;
}
function Gc(e) {
if (e.o) throw new TypeError("Generator is already running");
e.o = !0;
}
Fu.prototype.u = function(e) {
this.h = e;
};
function Vc(e, t) {
e.i = { Ch: t, Nh: !0 }, e.g = e.m || e.j;
}
Fu.prototype.return = function(e) {
this.i = { return: e }, this.g = this.j;
};
function T(e, t, n) {
return e.g = n, { value: t };
}
Fu.prototype.B = function(e) {
this.g = e;
};
function H(e) {
e.g = 0;
}
function ee(e, t, n) {
e.m = t, n != null && (e.j = n);
}
function ai(e, t) {
e.m = 0, e.j = t || 0;
}
function he(e, t, n) {
e.g = t, e.m = n || 0;
}
function te(e, t) {
return e.m = t || 0, t = e.i.Ch, e.i = null, t;
}
function Jt(e) {
e.A = [e.i], e.m = 0, e.j = 0;
}
function Zt(e, t) {
var n = e.A.splice(0)[0];
(n = e.i = e.i || n) ? n.Nh ? e.g = e.m || e.j : n.B != null && e.j < n.B ? (e.g = n.B, e.i = null) : e.g = e.j : e.g = t;
}
function RA(e) {
this.g = new Fu(), this.h = e;
}
function PA(e, t) {
Gc(e.g);
var n = e.g.l;
return n ? Hc(e, "return" in n ? n.return : function(i) {
return { value: i, done: !0 };
}, t, e.g.return) : (e.g.return(t), is(e));
}
function Hc(e, t, n, i) {
try {
var r = t.call(e.g.l, n);
if (!(r instanceof Object)) throw new TypeError("Iterator result " + r + " is not an object");
if (!r.done) return e.g.o = !1, r;
var o = r.value;
} catch (s) {
return e.g.l = null, Vc(e.g, s), is(e);
}
return e.g.l = null, i.call(e.g, o), is(e);
}
function is(e) {
for (; e.g.g; ) try {
var t = e.h(e.g);
if (t) return e.g.o = !1, { value: t.value, done: !1 };
} catch (n) {
e.g.h = void 0, Vc(e.g, n);
}
if (e.g.o = !1, e.g.i) {
if (t = e.g.i, e.g.i = null, t.Nh) throw t.Ch;
return { value: t.return, done: !0 };
}
return { value: void 0, done: !0 };
}
function DA(e) {
this.next = function(t) {
return Gc(e.g), e.g.l ? t = Hc(e, e.g.l.next, t, e.g.u) : (e.g.u(t), t = is(e)), t;
}, this.throw = function(t) {
return Gc(e.g), e.g.l ? t = Hc(e, e.g.l.throw, t, e.g.u) : (Vc(e.g, t), t = is(e)), t;
}, this.return = function(t) {
return PA(e, t);
}, this[Symbol.iterator] = function() {
return this;
};
}
function NA(e) {
function t(i) {
return e.next(i);
}
function n(i) {
return e.throw(i);
}
return new Promise(function(i, r) {
function o(s) {
s.done ? i(s.value) : Promise.resolve(s.value).then(t, n).then(o, r);
}
o(e.next());
});
}
function k(e) {
return NA(new DA(new RA(e)));
}
function xn() {
for (var e = Number(this), t = [], n = e; n < arguments.length; n++) t[n - e] = arguments[n];
return t;
}
Me("Promise", function(e) {
function t(s) {
this.h = 0, this.i = void 0, this.g = [], this.o = !1;
var u = this.j();
try {
s(u.resolve, u.reject);
} catch (a) {
u.reject(a);
}
}
function n() {
this.g = null;
}
function i(s) {
return s instanceof t ? s : new t(function(u) {
u(s);
});
}
if (e) return e;
n.prototype.h = function(s) {
if (this.g == null) {
this.g = [];
var u = this;
this.i(function() {
u.l();
});
}
this.g.push(s);
};
var r = ui.setTimeout;
n.prototype.i = function(s) {
r(s, 0);
}, n.prototype.l = function() {
for (; this.g && this.g.length; ) {
var s = this.g;
this.g = [];
for (var u = 0; u < s.length; ++u) {
var a = s[u];
s[u] = null;
try {
a();
} catch (l) {
this.j(l);
}
}
}
this.g = null;
}, n.prototype.j = function(s) {
this.i(function() {
throw s;
});
}, t.prototype.j = function() {
function s(l) {
return function(c) {
a || (a = !0, l.call(u, c));
};
}
var u = this, a = !1;
return { resolve: s(this.H), reject: s(this.l) };
}, t.prototype.H = function(s) {
if (s === this) this.l(new TypeError("A Promise cannot resolve to itself"));
else if (s instanceof t) this.J(s);
else {
e: switch (typeof s) {
case "object":
var u = s != null;
break e;
case "function":
u = !0;
break e;
default:
u = !1;
}
u ? this.G(s) : this.m(s);
}
}, t.prototype.G = function(s) {
var u = void 0;
try {
u = s.then;
} catch (a) {
this.l(a);
return;
}
typeof u == "function" ? this.K(u, s) : this.m(s);
}, t.prototype.l = function(s) {
this.u(2, s);
}, t.prototype.m = function(s) {
this.u(1, s);
}, t.prototype.u = function(s, u) {
if (this.h != 0) throw Error("Cannot settle(" + s + ", " + u + "): Promise already settled in state" + this.h);
this.h = s, this.i = u, this.h === 2 && this.I(), this.A();
}, t.prototype.I = function() {
var s = this;
r(function() {
if (s.C()) {
var u = ui.console;
typeof u != "undefined" && u.error(s.i);
}
}, 1);
}, t.prototype.C = function() {
if (this.o) return !1;
var s = ui.CustomEvent, u = ui.Event, a = ui.dispatchEvent;
return typeof a == "undefined" ? !0 : (typeof s == "function" ? s = new s("unhandledrejection", { cancelable: !0 }) : typeof u == "function" ? s = new u("unhandledrejection", { cancelable: !0 }) : (s = ui.document.createEvent("CustomEvent"), s.initCustomEvent("unhandledrejection", !1, !0, s)), s.promise = this, s.reason = this.i, a(s));
}, t.prototype.A = function() {
if (this.g != null) {
for (var s = 0; s < this.g.length; ++s) o.h(this.g[s]);
this.g = null;
}
};
var o = new n();
return t.prototype.J = function(s) {
var u = this.j();
s.pe(u.resolve, u.reject);
}, t.prototype.K = function(s, u) {
var a = this.j();
try {
s.call(u, a.resolve, a.reject);
} catch (l) {
a.reject(l);
}
}, t.prototype.then = function(s, u) {
function a(d, f) {
return typeof d == "function" ? function(m) {
try {
l(d(m));
} catch (v) {
c(v);
}
} : f;
}
var l, c, h = new t(function(d, f) {
l = d, c = f;
});
return this.pe(a(s, l), a(u, c)), h;
}, t.prototype.catch = function(s) {
return this.then(void 0, s);
}, t.prototype.pe = function(s, u) {
function a() {
switch (l.h) {
case 1:
s(l.i);
break;
case 2:
u(l.i);
break;
default:
throw Error("Unexpected state: " + l.h);
}
}
var l = this;
this.g == null ? o.h(a) : this.g.push(a), this.o = !0;
}, t.resolve = i, t.reject = function(s) {
return new t(function(u, a) {
a(s);
});
}, t.race = function(s) {
return new t(function(u, a) {
for (var l = g(s), c = l.next(); !c.done; c = l.next()) i(c.value).pe(u, a);
});
}, t.all = function(s) {
var u = g(s), a = u.next();
return a.done ? i([]) : new t(function(l, c) {
function h(m) {
return function(v) {
d[m] = v, f--, f == 0 && l(d);
};
}
var d = [], f = 0;
do
d.push(void 0), f++, i(a.value).pe(h(d.length - 1), c), a = u.next();
while (!a.done);
});
}, t;
});
function Un(e, t) {
return Object.prototype.hasOwnProperty.call(e, t);
}
Me("WeakMap", function(e) {
function t(a) {
if (this.g = (u += Math.random() + 1).toString(), a) {
a = g(a);
for (var l; !(l = a.next()).done; ) l = l.value, this.set(l[0], l[1]);
}
}
function n() {
}
function i(a) {
var l = typeof a;
return l === "object" && a !== null || l === "function";
}
function r(a) {
if (!Un(a, s)) {
var l = new n();
ju(a, s, { value: l });
}
}
function o(a) {
var l = Object[a];
l && (Object[a] = function(c) {
return c instanceof n ? c : (Object.isExtensible(c) && r(c), l(c));
});
}
if (function() {
if (!e || !Object.seal) return !1;
try {
var a = Object.seal({}), l = Object.seal({}), c = new e([[a, 2], [l, 3]]);
return c.get(a) != 2 || c.get(l) != 3 ? !1 : (c.delete(a), c.set(l, 4), !c.has(a) && c.get(l) == 4);
} catch (h) {
return !1;
}
}()) return e;
var s = "$jscomp_hidden_" + Math.random();
o("freeze"), o("preventExtensions"), o("seal");
var u = 0;
return t.prototype.set = function(a, l) {
if (!i(a)) throw Error("Invalid WeakMap key");
if (r(a), !Un(a, s)) throw Error("WeakMap key fail: " + a);
return a[s][this.g] = l, this;
}, t.prototype.get = function(a) {
return i(a) && Un(a, s) ? a[s][this.g] : void 0;
}, t.prototype.has = function(a) {
return i(a) && Un(
a,
s
) && Un(a[s], this.g);
}, t.prototype.delete = function(a) {
return i(a) && Un(a, s) && Un(a[s], this.g) ? delete a[s][this.g] : !1;
}, t;
}), Me("Map", function(e) {
function t() {
var u = {};
return u.ic = u.next = u.head = u;
}
function n(u, a) {
var l = u[1];
return H0(function() {
if (l) {
for (; l.head != u[1]; ) l = l.ic;
for (; l.next != l.head; ) return l = l.next, { done: !1, value: a(l) };
l = null;
}
return { done: !0, value: void 0 };
});
}
function i(u, a) {
var l = a && typeof a;
l == "object" || l == "function" ? o.has(a) ? l = o.get(a) : (l = "" + ++s, o.set(a, l)) : l = "p_" + a;
var c = u[0][l];
if (c && Un(u[0], l)) for (u = 0; u < c.length; u++) {
var h = c[u];
if (a !== a && h.key !== h.key || a === h.key) return { id: l, list: c, index: u, entry: h };
}
return {
id: l,
list: c,
index: -1,
entry: void 0
};
}
function r(u) {
if (this[0] = {}, this[1] = t(), this.size = 0, u) {
u = g(u);
for (var a; !(a = u.next()).done; ) a = a.value, this.set(a[0], a[1]);
}
}
if (function() {
if (!e || typeof e != "function" || !e.prototype.entries || typeof Object.seal != "function") return !1;
try {
var u = Object.seal({ x: 4 }), a = new e(g([[u, "s"]]));
if (a.get(u) != "s" || a.size != 1 || a.get({ x: 4 }) || a.set({ x: 4 }, "t") != a || a.size != 2) return !1;
var l = a.entries(), c = l.next();
return c.done || c.value[0] != u || c.value[1] != "s" ? !1 : (c = l.next(), !(c.done || c.value[0].x != 4 || c.value[1] != "t" || !l.next().done));
} catch (h) {
return !1;
}
}()) return e;
var o = /* @__PURE__ */ new WeakMap();
r.prototype.set = function(u, a) {
u = u === 0 ? 0 : u;
var l = i(this, u);
return l.list || (l.list = this[0][l.id] = []), l.entry ? l.entry.value = a : (l.entry = { next: this[1], ic: this[1].ic, head: this[1], key: u, value: a }, l.list.push(l.entry), this[1].ic.next = l.entry, this[1].ic = l.entry, this.size++), this;
}, r.prototype.delete = function(u) {
return u = i(this, u), u.entry && u.list ? (u.list.splice(u.index, 1), u.list.length || delete this[0][u.id], u.entry.ic.next = u.entry.next, u.entry.next.ic = u.entry.ic, u.entry.head = null, this.size--, !0) : !1;
}, r.prototype.clear = function() {
this[0] = {}, this[1] = this[1].ic = t(), this.size = 0;
}, r.prototype.has = function(u) {
return !!i(this, u).entry;
}, r.prototype.get = function(u) {
return (u = i(this, u).entry) && u.value;
}, r.prototype.entries = function() {
return n(this, function(u) {
return [u.key, u.value];
});
}, r.prototype.keys = function() {
return n(this, function(u) {
return u.key;
});
}, r.prototype.values = function() {
return n(this, function(u) {
return u.value;
});
}, r.prototype.forEach = function(u, a) {
for (var l = this.entries(), c; !(c = l.next()).done; ) c = c.value, u.call(a, c[1], c[0], this);
}, r.prototype[Symbol.iterator] = r.prototype.entries;
var s = 0;
return r;
});
function zc(e, t) {
e instanceof String && (e += "");
var n = 0, i = !1, r = { next: function() {
if (!i && n < e.length) {
var o = n++;
return { value: t(o, e[o]), done: !1 };
}
return i = !0, { done: !0, value: void 0 };
} };
return r[Symbol.iterator] = function() {
return r;
}, r;
}
Me("Array.prototype.keys", function(e) {
return e || function() {
return zc(this, function(t) {
return t;
});
};
}), Me("Set", function(e) {
function t(n) {
if (this.g = /* @__PURE__ */ new Map(), n) {
n = g(n);
for (var i; !(i = n.next()).done; ) this.add(i.value);
}
this.size = this.g.size;
}
return function() {
if (!e || typeof e != "function" || !e.prototype.entries || typeof Object.seal != "function") return !1;
try {
var n = Object.seal({ x: 4 }), i = new e(g([n]));
if (!i.has(n) || i.size != 1 || i.add(n) != i || i.size != 1 || i.add({ x: 4 }) != i || i.size != 2) return !1;
var r = i.entries(), o = r.next();
return o.done || o.value[0] != n || o.value[1] != n ? !1 : (o = r.next(), o.done || o.value[0] == n || o.value[0].x != 4 || o.value[1] != o.value[0] ? !1 : r.next().done);
} catch (s) {
return !1;
}
}() ? e : (t.prototype.add = function(n) {
return n = n === 0 ? 0 : n, this.g.set(n, n), this.size = this.g.size, this;
}, t.prototype.delete = function(n) {
return n = this.g.delete(n), this.size = this.g.size, n;
}, t.prototype.clear = function() {
this.g.clear(), this.size = 0;
}, t.prototype.has = function(n) {
return this.g.has(n);
}, t.prototype.entries = function() {
return this.g.entries();
}, t.prototype.values = function() {
return this.g.values();
}, t.prototype.keys = t.prototype.values, t.prototype[Symbol.iterator] = t.prototype.values, t.prototype.forEach = function(n, i) {
var r = this;
this.g.forEach(function(o) {
return n.call(i, o, o, r);
});
}, t);
}), Me("Array.from", function(e) {
return e || function(t, n, i) {
n = n != null ? n : function(u) {
return u;
};
var r = [], o = typeof Symbol != "undefined" && Symbol.iterator && t[Symbol.iterator];
if (typeof o == "function") {
t = o.call(t);
for (var s = 0; !(o = t.next()).done; ) r.push(n.call(i, o.value, s++));
} else for (o = t.length, s = 0; s < o; s++) r.push(n.call(i, t[s], s));
return r;
};
}), Me("Array.prototype.values", function(e) {
return e || function() {
return zc(this, function(t, n) {
return n;
});
};
}), Me("Object.is", function(e) {
return e || function(t, n) {
return t === n ? t !== 0 || 1 / t === 1 / n : t !== t && n !== n;
};
}), Me("Array.prototype.includes", function(e) {
return e || function(t, n) {
var i = this;
i instanceof String && (i = String(i));
var r = i.length;
for (n = n || 0, 0 > n && (n = Math.max(n + r, 0)); n < r; n++) {
var o = i[n];
if (o === t || Object.is(o, t)) return !0;
}
return !1;
};
});
function Bu(e, t, n) {
if (e == null) throw new TypeError("The 'this' value for String.prototype." + n + " must not be null or undefined");
if (t instanceof RegExp) throw new TypeError("First argument to String.prototype." + n + " must not be a regular expression");
return e + "";
}
Me("String.prototype.includes", function(e) {
return e || function(t, n) {
return Bu(this, t, "includes").indexOf(t, n || 0) !== -1;
};
}), Me("String.fromCodePoint", function(e) {
return e || function(t) {
for (var n = "", i = 0; i < arguments.length; i++) {
var r = Number(arguments[i]);
if (0 > r || 1114111 < r || r !== Math.floor(r)) throw new RangeError("invalid_code_point " + r);
65535 >= r ? n += String.fromCharCode(r) : (r -= 65536, n += String.fromCharCode(r >>> 10 & 1023 | 55296), n += String.fromCharCode(r & 1023 | 56320));
}
return n;
};
});
function q0(e, t, n) {
e instanceof String && (e = String(e));
for (var i = e.length, r = 0; r < i; r++) {
var o = e[r];
if (t.call(n, o, r, e)) return { Lh: r, v: o };
}
return { Lh: -1, v: void 0 };
}
Me("Array.prototype.findIndex", function(e) {
return e || function(t, n) {
return q0(this, t, n).Lh;
};
}), Me("WeakSet", function(e) {
function t(n) {
if (this.g = /* @__PURE__ */ new WeakMap(), n) {
n = g(n);
for (var i; !(i = n.next()).done; ) this.add(i.value);
}
}
return function() {
if (!e || !Object.seal) return !1;
try {
var n = Object.seal({}), i = Object.seal({}), r = new e([n]);
return !r.has(n) || r.has(i) ? !1 : (r.delete(n), r.add(i), !r.has(n) && r.has(i));
} catch (o) {
return !1;
}
}() ? e : (t.prototype.add = function(n) {
return this.g.set(n, !0), this;
}, t.prototype.has = function(n) {
return this.g.has(n);
}, t.prototype.delete = function(n) {
return this.g.delete(n);
}, t);
}), Me("Array.prototype.find", function(e) {
return e || function(t, n) {
return q0(this, t, n).v;
};
}), Me("String.prototype.startsWith", function(e) {
return e || function(t, n) {
var i = Bu(this, t, "startsWith"), r = i.length, o = t.length;
n = Math.max(0, Math.min(n | 0, i.length));
for (var s = 0; s < o && n < r; ) if (i[n++] != t[s++]) return !1;
return s >= o;
};
}), Me("Object.entries", function(e) {
return e || function(t) {
var n = [], i;
for (i in t) Un(t, i) && n.push([i, t[i]]);
return n;
};
});
var _A = typeof Object.assign == "function" ? Object.assign : function(e, t) {
for (var n = 1; n < arguments.length; n++) {
var i = arguments[n];
if (i) for (var r in i) Un(i, r) && (e[r] = i[r]);
}
return e;
};
Me("Object.assign", function(e) {
return e || _A;
}), Me("Promise.prototype.finally", function(e) {
return e || function(t) {
return this.then(function(n) {
return Promise.resolve(t()).then(function() {
return n;
});
}, function(n) {
return Promise.resolve(t()).then(function() {
throw n;
});
});
};
}), Me("Array.prototype.entries", function(e) {
return e || function() {
return zc(this, function(t, n) {
return [t, n];
});
};
}), Me("Number.isNaN", function(e) {
return e || function(t) {
return typeof t == "number" && isNaN(t);
};
}), Me("String.prototype.repeat", function(e) {
return e || function(t) {
var n = Bu(this, null, "repeat");
if (0 > t || 1342177279 < t) throw new RangeError("Invalid count value");
t |= 0;
for (var i = ""; t; ) t & 1 && (i += n), (t >>>= 1) && (n += n);
return i;
};
}), Me("Number.isFinite", function(e) {
return e || function(t) {
return typeof t != "number" ? !1 : !isNaN(t) && t !== 1 / 0 && t !== -1 / 0;
};
}), Me("Object.values", function(e) {
return e || function(t) {
var n = [], i;
for (i in t) Un(t, i) && n.push(t[i]);
return n;
};
}), Me("Math.log2", function(e) {
return e || function(t) {
return Math.log(t) / Math.LN2;
};
}), Me("Number.MAX_SAFE_INTEGER", function() {
return 9007199254740991;
}), Me("String.prototype.endsWith", function(e) {
return e || function(t, n) {
var i = Bu(this, t, "endsWith");
n === void 0 && (n = i.length), n = Math.max(0, Math.min(n | 0, i.length));
for (var r = t.length; 0 < r && 0 < n; ) if (i[--n] != t[--r]) return !1;
return 0 >= r;
};
}), Me("Math.trunc", function(e) {
return e || function(t) {
if (t = Number(t), isNaN(t) || t === 1 / 0 || t === -1 / 0 || t === 0) return t;
var n = Math.floor(Math.abs(t));
return 0 > t ? -n : n;
};
});
function Kc(e) {
if (e = Math.trunc(e) || 0, 0 > e && (e += this.length), !(0 > e || e >= this.length)) return this[e];
}
Me("Array.prototype.at", function(e) {
return e || Kc;
});
function li(e) {
return e || Kc;
}
Me("Int8Array.prototype.at", li), Me("Uint8Array.prototype.at", li), Me("Uint8ClampedArray.prototype.at", li), Me("Int16Array.prototype.at", li), Me("Uint16Array.prototype.at", li), Me("Int32Array.prototype.at", li), Me("Uint32Array.prototype.at", li), Me("Float32Array.prototype.at", li), Me("Float64Array.prototype.at", li), Me("String.prototype.at", function(e) {
return e || Kc;
});
var UA = this || self;
function B(e, t) {
e = e.split(".");
var n = UA;
e[0] in n || typeof n.execScript == "undefined" || n.execScript("var " + e[0]);
for (var i; e.length && (i = e.shift()); ) e.length || t === void 0 ? n[i] && n[i] !== Object.prototype[i] ? n = n[i] : n = n[i] = {} : n[i] = t;
}
function OA() {
}
function bA() {
}
function V(e, t) {
if (t) if (t instanceof Map) for (var n = g(t.keys()), i = n.next(); !i.done; i = n.next()) i = i.value, Object.defineProperty(this, i, { value: t.get(i), writable: !0, enumerable: !0 });
else for (n in t) Object.defineProperty(this, n, { value: t[n], writable: !0, enumerable: !0 });
this.defaultPrevented = this.cancelable = this.bubbles = !1, this.timeStamp = b.performance && b.performance.now ? b.performance.now() : Date.now(), this.type = e, this.isTrusted = !1, this.target = this.currentTarget = null, this.g = !1;
}
function W0(e) {
var t = new V(e.type), n;
for (n in e) Object.defineProperty(t, n, { value: e[n], writable: !0, enumerable: !0 });
return t;
}
V.prototype.preventDefault = function() {
this.cancelable && (this.defaultPrevented = !0);
}, V.prototype.stopImmediatePropagation = function() {
this.g = !0;
}, V.prototype.stopPropagation = function() {
}, B("shaka.util.FakeEvent", V);
var Gu = {
Sk: "abrstatuschanged",
Tk: "adaptation",
Uk: "audiotrackchanged",
Vk: "buffering",
Wk: "complete",
Xk: "downloadfailed",
Yk: "downloadheadersreceived",
Zk: "drmsessionupdate",
al: "emsg",
Dl: "prft",
Error: "error",
cl: "expirationupdated",
fl: "firstquartile",
hl: "gapjumped",
kl: "keystatuschanged",
rl: "loaded",
ul: "loading",
wl: "manifestparsed",
xl: "manifestupdated",
yl: "mediaqualitychanged",
zl: "mediasourcerecovered",
Metadata: "metadata",
Al: "midpoint",
Bl: "nospatialvideoinfo",
Cl: "onstatechange",
El: "ratechange",
Gl: "segmentappended",
Hl: "sessiondata",
Il: "spatialvideoinfo",
Jl: "stalldetected",
Kl: "started",
Ll: "statechanged",
Ml: "streaming",
Nl: "textchanged",
Ol: "texttrackvisibility",
Pl: "thirdquartile",
Ql: "timelineregionadded",
Rl: "timelineregionenter",
Sl: "timelineregionexit",
Tl: "trackschanged",
Vl: "unloading",
Xl: "variantchanged"
};
function jA() {
}
function ci() {
}
function de() {
}
function ir(e) {
var t = xn.apply(1, arguments);
X0.has(e) || (X0.add(e), de.apply(jA, X(t)));
}
function FA() {
}
function Wk() {
}
function Xk() {
}
var X0 = /* @__PURE__ */ new Set();
b.console && (de = function() {
return console.warn.apply(console, X(xn.apply(0, arguments)));
}, ci = function() {
console.error.apply(console, X(xn.apply(0, arguments)));
});
function Vu() {
this.g = {};
}
p = Vu.prototype, p.push = function(e, t) {
this.g.hasOwnProperty(e) ? this.g[e].push(t) : this.g[e] = [t];
}, p.get = function(e) {
return (e = this.g[e]) ? e.slice() : null;
}, p.remove = function(e, t) {
e in this.g && (this.g[e] = this.g[e].filter(function(n) {
return n != t;
}), this.g[e].length == 0 && delete this.g[e]);
}, p.forEach = function(e) {
for (var t in this.g) e(t, this.g[t]);
}, p.size = function() {
return Object.keys(this.g).length;
}, p.keys = function() {
return Object.keys(this.g);
};
function Se() {
this.Ha = new Vu(), this.ee = this;
}
Se.prototype.addEventListener = function(e, t) {
this.Ha && this.Ha.push(e, t);
}, Se.prototype.removeEventListener = function(e, t) {
this.Ha && this.Ha.remove(e, t);
}, Se.prototype.dispatchEvent = function(e) {
if (!this.Ha) return !0;
var t = this.Ha.get(e.type) || [], n = this.Ha.get("All");
for (n && (t = t.concat(n)), t = g(t), n = t.next(); !n.done; n = t.next()) {
n = n.value, e.target = this.ee, e.currentTarget = this.ee;
try {
n.handleEvent ? n.handleEvent(e) : n.call(this, e);
} catch (i) {
}
if (e.g) break;
}
return e.defaultPrevented;
}, Se.prototype.release = function() {
this.Ha = null;
};
function qc(e, t) {
var n = [];
e = g(e);
for (var i = e.next(); !i.done; i = e.next()) n.push(t(i.value));
return n;
}
function BA(e, t) {
e = g(e);
for (var n = e.next(); !n.done; n = e.next()) if (!t(n.value)) return !1;
return !0;
}
function Y0(e, t) {
e = g(e);
for (var n = e.next(); !n.done; n = e.next()) if (t(n.value)) return !0;
return !1;
}
function Or(e, t) {
var n = [];
e = g(e);
for (var i = e.next(); !i.done; i = e.next()) i = i.value, t(i) && n.push(i);
return n;
}
var GA = RegExp("^(?:([^:/?#.]+):)?(?://(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#(.*))?$");
/*
@license
Copyright 2006 The Closure Library Authors
SPDX-License-Identifier: Apache-2.0
*/
function Ye(e) {
var t;
e instanceof Ye ? (Hu(this, e.Wb), this.Wc = e.Wc, zu(this, e.$b), Wc(this, e.qd), this.jb = e.jb, rr(this, e.g.clone()), this.Fc = e.Fc) : e && (t = String(e).match(GA)) ? (Hu(this, t[1] || "", !0), this.Wc = rs(t[2] || ""), zu(this, t[3] || "", !0), Wc(this, t[4]), this.jb = rs(t[5] || "", !0), rr(this, t[6] || "", !0), this.Fc = rs(t[7] || "")) : this.g = new br(null);
}
p = Ye.prototype, p.Wb = "", p.Wc = "", p.$b = "", p.qd = null, p.jb = "", p.Fc = "", p.toString = function() {
var e = [], t = this.Wb;
if (t && e.push(os(t, $0, !0), ":"), t = this.$b) {
e.push("//");
var n = this.Wc;
n && e.push(os(n, $0, !0), "@"), e.push(encodeURIComponent(t).replace(/%25([0-9a-fA-F]{2})/g, "%$1")), t = this.qd, t != null && e.push(":", String(t));
}
return (t = this.jb) && (this.$b && t.charAt(0) != "/" && e.push("/"), e.push(os(t, t.charAt(0) == "/" ? zA : HA, !0))), (t = this.g.toString()) && e.push("?", t), (t = this.Fc) && e.push("#", os(t, qA)), e.join("");
}, p.resolve = function(e) {
var t = this.clone();
t.Wb === "data" && (t = new Ye());
var n = !!e.Wb;
n ? Hu(t, e.Wb) : n = !!e.Wc, n ? t.Wc = e.Wc : n = !!e.$b, n ? zu(t, e.$b) : n = e.qd != null;
var i = e.jb;
if (n) Wc(t, e.qd);
else if (n = !!e.jb) {
if (i.charAt(0) != "/") if (this.$b && !this.jb) i = "/" + i;
else {
var r = t.jb.lastIndexOf("/");
r != -1 && (i = t.jb.substr(0, r + 1) + i);
}
if (i == ".." || i == ".") i = "";
else if (i.indexOf("./") != -1 || i.indexOf("/.") != -1) {
r = i.lastIndexOf("/", 0) == 0, i = i.split("/");
for (var o = [], s = 0; s < i.length; ) {
var u = i[s++];
u == "." ? r && s == i.length && o.push("") : u == ".." ? ((1 < o.length || o.length == 1 && o[0] != "") && o.pop(), r && s == i.length && o.push("")) : (o.push(u), r = !0);
}
i = o.join("/");
}
}
return n ? t.jb = i : n = e.g.toString() !== "", n ? rr(t, e.g.clone()) : n = !!e.Fc, n && (t.Fc = e.Fc), t;
}, p.clone = function() {
return new Ye(this);
};
function Hu(e, t, n) {
e.Wb = n ? rs(t, !0) : t, e.Wb && (e.Wb = e.Wb.replace(/:$/, ""));
}
function zu(e, t, n) {
e.$b = n ? rs(t, !0) : t;
}
function Wc(e, t) {
if (t) {
if (t = Number(t), isNaN(t) || 0 > t) throw Error("Bad port number " + t);
e.qd = t;
} else e.qd = null;
}
function rr(e, t, n) {
t instanceof br ? e.g = t : (n || (t = os(t, KA)), e.g = new br(t));
}
function rs(e, t) {
return e ? t ? decodeURI(e) : decodeURIComponent(e) : "";
}
function os(e, t, n) {
return e != null ? (e = encodeURI(e).replace(t, VA), n && (e = e.replace(/%25([0-9a-fA-F]{2})/g, "%$1")), e) : null;
}
function VA(e) {
return e = e.charCodeAt(0), "%" + (e >> 4 & 15).toString(16) + (e & 15).toString(16);
}
var $0 = /[#\/\?@]/g, HA = /[#\?:]/g, zA = /[#\?]/g, KA = /[#\?@]/g, qA = /#/g;
function br(e) {
this.g = e || null;
}
function Ku(e) {
if (!e.eb && (e.eb = {}, e.Dd = 0, e.g)) for (var t = e.g.split("&"), n = 0; n < t.length; n++) {
var i = t[n].indexOf("="), r = null;
if (0 <= i) {
var o = t[n].substring(0, i);
r = t[n].substring(i + 1);
} else o = t[n];
o = decodeURIComponent(o.replace(/\+/g, " ")), r = r || "", e.add(o, decodeURIComponent(r.replace(/\+/g, " ")));
}
}
p = br.prototype, p.eb = null, p.Dd = null;
function J0(e) {
return Ku(e), e.Dd;
}
p.add = function(e, t) {
Ku(this), this.g = null;
var n = this.eb.hasOwnProperty(e) ? this.eb[e] : null;
return n || (this.eb[e] = n = []), n.push(t), this.Dd++, this;
}, p.set = function(e, t) {
return Ku(this), this.g = null, this.eb.hasOwnProperty(e) ? this.eb[e] = [t] : this.add(e, t), this;
}, p.get = function(e) {
return Ku(this), this.eb[e] || [];
}, p.toString = function() {
if (this.g) return this.g;
if (!this.eb) return "";
var e = [], t;
for (t in this.eb) for (var n = encodeURIComponent(t), i = this.eb[t], r = 0; r < i.length; r++) {
var o = n;
i[r] !== "" && (o += "=" + encodeURIComponent(i[r])), e.push(o);
}
return this.g = e.join("&");
}, p.clone = function() {
var e = new br();
if (e.g = this.g, this.eb) {
var t = {}, n;
for (n in this.eb) t[n] = this.eb[n].concat();
e.eb = t, e.Dd = this.Dd;
}
return e;
};
function jr() {
}
function bi(e, t) {
if (!e && !t) return !0;
if (!e || !t || e.byteLength != t.byteLength) return !1;
if (Xc(e) == Xc(t) && (e.byteOffset || 0) == (t.byteOffset || 0)) return !0;
var n = pe(e);
t = pe(t);
for (var i = 0; i < e.byteLength; i++) if (n[i] != t[i]) return !1;
return !0;
}
function Xc(e) {
return e instanceof ArrayBuffer ? e : e.buffer;
}
function hn(e) {
return e instanceof ArrayBuffer ? e : e.byteOffset == 0 && e.byteLength == e.buffer.byteLength ? e.buffer : new Uint8Array(e).buffer;
}
function pe(e, t, n) {
return n = n === void 0 ? 1 / 0 : n, Yc(e, t === void 0 ? 0 : t, n, Uint8Array);
}
function Z0(e, t, n) {
return n = n === void 0 ? 1 / 0 : n, Yc(e, t === void 0 ? 0 : t, n, Uint16Array);
}
function jt(e, t, n) {
return n = n === void 0 ? 1 / 0 : n, Yc(e, t === void 0 ? 0 : t, n, DataView);
}
function Yc(e, t, n, i) {
var r = Xc(e), o = 1;
"BYTES_PER_ELEMENT" in i && (o = i.BYTES_PER_ELEMENT);
var s = ((e.byteOffset || 0) + e.byteLength) / o;
return e = Math.floor(Math.max(0, Math.min(((e.byteOffset || 0) + t) / o, s))), new i(r, e, Math.floor(Math.min(e + Math.max(n, 0), s)) - e);
}
B("shaka.util.BufferUtils", jr), jr.toDataView = jt, jr.toUint16 = Z0, jr.toUint8 = pe, jr.toArrayBuffer = hn, jr.equal = bi;
function L(e, t, n) {
var i = xn.apply(3, arguments);
this.severity = e, this.category = t, this.code = n, this.data = i, this.handled = !1, this.message = "Shaka Error " + this.code;
try {
throw Error(this.message || "Shaka Error");
} catch (r) {
this.stack = r.stack;
}
}
L.prototype.toString = function() {
return "shaka.util.Error " + JSON.stringify(this, null, " ");
}, B("shaka.util.Error", L), L.Severity = { RECOVERABLE: 1, CRITICAL: 2 }, L.Category = { NETWORK: 1, TEXT: 2, MEDIA: 3, MANIFEST: 4, STREAMING: 5, DRM: 6, PLAYER: 7, CAST: 8, STORAGE: 9, ADS: 10 }, L.Code = {
UNSUPPORTED_SCHEME: 1e3,
BAD_HTTP_STATUS: 1001,
HTTP_ERROR: 1002,
TIMEOUT: 1003,
MALFORMED_DATA_URI: 1004,
REQUEST_FILTER_ERROR: 1006,
RESPONSE_FILTER_ERROR: 1007,
MALFORMED_TEST_URI: 1008,
UNEXPECTED_TEST_REQUEST: 1009,
ATTEMPTS_EXHAUSTED: 1010,
SEGMENT_MISSING: 1011,
INVALID_TEXT_HEADER: 2e3,
INVALID_TEXT_CUE: 2001,
UNABLE_TO_DETECT_ENCODING: 2003,
BAD_ENCODING: 2004,
INVALID_XML: 2005,
INVALID_MP4_TTML: 2007,
INVALID_MP4_VTT: 2008,
UNABLE_TO_EXTRACT_CUE_START_TIME: 2009,
INVALID_MP4_CEA: 2010,
TEXT_COULD_NOT_GUESS_MIME_TYPE: 2011,
CANNOT_ADD_EXTERNAL_TEXT_TO_SRC_EQUALS: 2012,
TEXT_ONLY_WEBVTT_SRC_EQUALS: 2013,
MISSING_TEXT_PLUGIN: 2014,
CHAPTERS_TRACK_FAILED: 2015,
UNSUPPORTED_EXTERNAL_THUMBNAILS_URI: 2017,
BUFFER_READ_OUT_OF_BOUNDS: 3e3,
JS_INTEGER_OVERFLOW: 3001,
EBML_OVERFLOW: 3002,
EBML_BAD_FLOATING_POINT_SIZE: 3003,
MP4_SIDX_WRONG_BOX_TYPE: 3004,
MP4_SIDX_INVALID_TIMESCALE: 3005,
MP4_SIDX_TYPE_NOT_SUPPORTED: 3006,
WEBM_CUES_ELEMENT_MISSING: 3007,
WEBM_EBML_HEADER_ELEMENT_MISSING: 3008,
WEBM_SEGMENT_ELEMENT_MISSING: 3009,
WEBM_INFO_ELEMENT_MISSING: 3010,
WEBM_DURATION_ELEMENT_MISSING: 3011,
WEBM_CUE_TRACK_POSITIONS_ELEMENT_MISSING: 3012,
WEBM_CUE_TIME_ELEMENT_MISSING: 3013,
MEDIA_SOURCE_OPERATION_FAILED: 3014,
MEDIA_SOURCE_OPERATION_THREW: 3015,
VIDEO_ERROR: 3016,
QUOTA_EXCEEDED_ERROR: 3017,
TRANSMUXING_FAILED: 3018,
CONTENT_TRANSFORMATION_FAILED: 3019,
MSS_MISSING_DATA_FOR_TRANSMUXING: 3020,
MSS_TRANSMUXING_FAILED: 3022,
TRANSMUXING_NO_VIDEO_DATA: 3023,
UNABLE_TO_GUESS_MANIFEST_TYPE: 4e3,
DASH_INVALID_XML: 4001,
DASH_NO_SEGMENT_INFO: 4002,
DASH_EMPTY_ADAPTATION_SET: 4003,
DASH_EMPTY_PERIOD: 4004,
DASH_WEBM_MISSING_INIT: 4005,
DASH_UNSUPPORTED_CONTAINER: 4006,
DASH_PSSH_BAD_ENCODING: 4007,
DASH_NO_COMMON_KEY_SYSTEM: 4008,
DASH_MULTIPLE_KEY_IDS_NOT_SUPPORTED: 4009,
DASH_CONFLICTING_KEY_IDS: 4010,
RESTRICTIONS_CANNOT_BE_MET: 4012,
HLS_PLAYLIST_HEADER_MISSING: 4015,
INVALID_HLS_TAG: 4016,
HLS_INVALID_PLAYLIST_HIERARCHY: 4017,
DASH_DUPLICATE_REPRESENTATION_ID: 4018,
HLS_MULTIPLE_MEDIA_INIT_SECTIONS_FOUND: 4020,
HLS_REQUIRED_ATTRIBUTE_MISSING: 4023,
HLS_REQUIRED_TAG_MISSING: 4024,
HLS_COULD_NOT_GUESS_CODECS: 4025,
HLS_KEYFORMATS_NOT_SUPPORTED: 4026,
DASH_UNSUPPORTED_XLINK_ACTUATE: 4027,
DASH_XLINK_DEPTH_LIMIT: 4028,
CONTENT_UNSUPPORTED_BY_BROWSER: 4032,
CANNOT_ADD_EXTERNAL_TEXT_TO_LIVE_STREAM: 4033,
NO_VARIANTS: 4036,
PERIOD_FLATTENING_FAILED: 4037,
INCONSISTENT_DRM_ACROSS_PERIODS: 4038,
HLS_VARIABLE_NOT_FOUND: 4039,
HLS_MSE_ENCRYPTED_MP2T_NOT_SUPPORTED: 4040,
HLS_MSE_ENCRYPTED_LEGACY_APPLE_MEDIA_KEYS_NOT_SUPPORTED: 4041,
NO_WEB_CRYPTO_API: 4042,
CANNOT_ADD_EXTERNAL_THUMBNAILS_TO_LIVE_STREAM: 4045,
MSS_INVALID_XML: 4046,
MSS_LIVE_CONTENT_NOT_SUPPORTED: 4047,
AES_128_INVALID_IV_LENGTH: 4048,
AES_128_INVALID_KEY_LENGTH: 4049,
DASH_CONFLICTING_AES_128: 4050,
DASH_UNSUPPORTED_AES_128: 4051,
DASH_INVALID_PATCH: 4052,
HLS_EMPTY_MEDIA_PLAYLIST: 4053,
STREAMING_ENGINE_STARTUP_INVALID_STATE: 5006,
NO_RECOGNIZED_KEY_SYSTEMS: 6e3,
REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE: 6001,
FAILED_TO_CREATE_CDM: 6002,
FAILED_TO_ATTACH_TO_VIDEO: 6003,
INVALID_SERVER_CERTIFICATE: 6004,
FAILED_TO_CREATE_SESSION: 6005,
FAILED_TO_GENERATE_LICENSE_REQUEST: 6006,
LICENSE_REQUEST_FAILED: 6007,
LICENSE_RESPONSE_REJECTED: 6008,
ENCRYPTED_CONTENT_WITHOUT_DRM_INFO: 6010,
NO_LICENSE_SERVER_GIVEN: 6012,
OFFLINE_SESSION_REMOVED: 6013,
EXPIRED: 6014,
SERVER_CERTIFICATE_REQUIRED: 6015,
INIT_DATA_TRANSFORM_ERROR: 6016,
SERVER_CERTIFICATE_REQUEST_FAILED: 6017,
MIN_HDCP_VERSION_NOT_MATCH: 6018,
ERROR_CHECKING_HDCP_VERSION: 6019,
LOAD_INTERRUPTED: 7e3,
OPERATION_ABORTED: 7001,
NO_VIDEO_ELEMENT: 7002,
OBJECT_DESTROYED: 7003,
CONTENT_NOT_LOADED: 7004,
SRC_EQUALS_PRELOAD_NOT_SUPPORTED: 7005,
CAST_API_UNAVAILABLE: 8e3,
NO_CAST_RECEIVERS: 8001,
ALREADY_CASTING: 8002,
UNEXPECTED_CAST_ERROR: 8003,
CAST_CANCELED_BY_USER: 8004,
CAST_CONNECTION_TIMED_OUT: 8005,
CAST_RECEIVER_APP_UNAVAILABLE: 8006,
STORAGE_NOT_SUPPORTED: 9e3,
INDEXED_DB_ERROR: 9001,
DEPRECATED_OPERATION_ABORTED: 9002,
REQUESTED_ITEM_NOT_FOUND: 9003,
MALFORMED_OFFLINE_URI: 9004,
CANNOT_STORE_LIVE_OFFLINE: 9005,
NO_INIT_DATA_FOR_OFFLINE: 9007,
LOCAL_PLAYER_INSTANCE_REQUIRED: 9008,
NEW_KEY_OPERATION_NOT_SUPPORTED: 9011,
KEY_NOT_FOUND: 9012,
MISSING_STORAGE_CELL: 9013,
STORAGE_LIMIT_REACHED: 9014,
DOWNLOAD_SIZE_CALLBACK_ERROR: 9015,
MODIFY_OPERATION_NOT_SUPPORTED: 9016,
INDEXED_DB_INIT_TIMED_OUT: 9017,
CS_IMA_SDK_MISSING: 1e4,
CS_AD_MANAGER_NOT_INITIALIZED: 10001,
SS_IMA_SDK_MISSING: 10002,
SS_AD_MANAGER_NOT_INITIALIZED: 10003,
CURRENT_DAI_REQUEST_NOT_FINISHED: 10004,
MT_AD_MANAGER_NOT_INITIALIZED: 10005,
INTERSTITIAL_AD_MANAGER_NOT_INITIALIZED: 10006,
VAST_INVALID_XML: 4001
};
function Fr(e) {
this.h = e, this.g = void 0;
}
Fr.prototype.value = function() {
return this.g == null && (this.g = this.h()), this.g;
};
function Q0(e, t) {
return e.length && t.length && e !== t ? 0 < $c(e, t).length : !0;
}
function $c(e, t) {
if (!e.length) return t;
if (!t.length) return e;
var n = [];
e = g(e);
for (var i = e.next(); !i.done; i = e.next()) {
i = i.value;
for (var r = g(t), o = r.next(); !o.done; o = r.next()) if (o = o.value, i.keySystem == o.keySystem) {
r = /* @__PURE__ */ new Map();
for (var s = g((i.initData || []).concat(o.initData || [])), u = s.next(); !u.done; u = s.next()) u = u.value, r.set(u.keyId, u);
r = Array.from(r.values()), s = i.keyIds && o.keyIds ? new Set([].concat(X(i.keyIds), X(o.keyIds))) : i.keyIds || o.keyIds, n.push({ keySystem: i.keySystem, licenseServerUri: i.licenseServerUri || o.licenseServerUri, distinctiveIdentifierRequired: i.distinctiveIdentifierRequired || o.distinctiveIdentifierRequired, persistentStateRequired: i.persistentStateRequired || o.persistentStateRequired, videoRobustness: i.videoRobustness || o.videoRobustness, audioRobustness: i.audioRobustness || o.audioRobustness, serverCertificate: i.serverCertificate || o.serverCertificate, serverCertificateUri: i.serverCertificateUri || o.serverCertificateUri, initData: r, keyIds: s });
break;
}
}
return n;
}
function Jc(e) {
return e ? !!e.match(/^com\.(microsoft|chromecast)\.playready/) : !1;
}
var qu = new Fr(function() {
return hn(new Uint8Array([0]));
}), Wu = /* @__PURE__ */ new Map();
function ss(e) {
this.h = e, this.g = null;
}
ss.prototype.X = function(e) {
var t = this;
this.stop();
var n = !0, i = null;
return this.g = function() {
b.clearTimeout(i), n = !1;
}, i = b.setTimeout(function() {
n && t.h();
}, 1e3 * e), this;
}, ss.prototype.stop = function() {
this.g && (this.g(), this.g = null);
};
function oe(e) {
this.h = e, this.g = null;
}
oe.prototype.Sa = function() {
return this.stop(), this.h(), this;
}, oe.prototype.X = function(e) {
var t = this;
return this.stop(), this.g = new ss(function() {
t.h();
}).X(e), this;
}, oe.prototype.Ba = function(e) {
var t = this;
retur