/*
 @license
 Shaka Player
 Copyright 2016 Google LLC
 SPDX-License-Identifier: Apache-2.0
*/
(function() {
  var innerGlobal = typeof window != "undefined" ? window : global;
  var exportTo = {};
  (function(window2, global2, module) {
    var p, ba = typeof Object.create == "function" ? Object.create : function(a) {
      function b() {
      }
      b.prototype = a;
      return new b();
    }, ca = typeof Object.defineProperties == "function" ? Object.defineProperty : function(a, b, c) {
      if (a == Array.prototype || a == Object.prototype) return a;
      a[b] = c.value;
      return a;
    };
    function da(a) {
      a = ["object" == typeof globalThis && globalThis, a, "object" == typeof window2 && window2, "object" == typeof self && self, "object" == typeof global2 && global2];
      for (var b = 0; b < a.length; ++b) {
        var c = a[b];
        if (c && c.Math == Math) return c;
      }
      throw Error("Cannot find global object");
    }
    var ea = da(this);
    function fa(a, b) {
      if (b) a: {
        var c = ea;
        a = a.split(".");
        for (var d = 0; d < a.length - 1; d++) {
          var e = a[d];
          if (!(e in c)) break a;
          c = c[e];
        }
        a = a[a.length - 1];
        d = c[a];
        b = b(d);
        b != d && b != null && ca(c, a, { configurable: true, writable: true, value: b });
      }
    }
    var ha;
    if (typeof Object.setPrototypeOf == "function") ha = Object.setPrototypeOf;
    else {
      var ia;
      a: {
        var ja = { a: true }, ka = {};
        try {
          ka.__proto__ = ja;
          ia = ka.a;
          break a;
        } catch (a) {
        }
        ia = false;
      }
      ha = ia ? function(a, b) {
        a.__proto__ = b;
        if (a.__proto__ !== b) throw new TypeError(a + " is not extensible");
        return a;
      } : null;
    }
    var la = ha;
    function ma(a, b) {
      a.prototype = ba(b.prototype);
      a.prototype.constructor = a;
      if (la) la(a, b);
      else for (var c in b) if (c != "prototype") if (Object.defineProperties) {
        var d = Object.getOwnPropertyDescriptor(b, c);
        d && Object.defineProperty(a, c, d);
      } else a[c] = b[c];
      a.Un = b.prototype;
    }
    function na(a) {
      var b = 0;
      return function() {
        return b < a.length ? { done: false, value: a[b++] } : { done: true };
      };
    }
    function t(a) {
      var b = typeof Symbol != "undefined" && Symbol.iterator && a[Symbol.iterator];
      if (b) return b.call(a);
      if (typeof a.length == "number") return { next: na(a) };
      throw Error(String(a) + " is not an iterable or ArrayLike");
    }
    function x(a) {
      if (!(a instanceof Array)) {
        a = t(a);
        for (var b, c = []; !(b = a.next()).done; ) c.push(b.value);
        a = c;
      }
      return a;
    }
    fa("Symbol", function(a) {
      function b(f) {
        if (this instanceof b) throw new TypeError("Symbol is not a constructor");
        return new c(d + (f || "") + "_" + e++, f);
      }
      function c(f, g) {
        this.g = f;
        ca(this, "description", { configurable: true, writable: true, value: g });
      }
      if (a) return a;
      c.prototype.toString = function() {
        return this.g;
      };
      var d = "jscomp_symbol_" + (Math.random() * 1e9 >>> 0) + "_", e = 0;
      return b;
    });
    fa("Symbol.iterator", function(a) {
      if (a) return a;
      a = Symbol("Symbol.iterator");
      for (var b = "Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "), c = 0; c < b.length; c++) {
        var d = ea[b[c]];
        typeof d === "function" && typeof d.prototype[a] != "function" && ca(d.prototype, a, { configurable: true, writable: true, value: function() {
          return oa(na(this));
        } });
      }
      return a;
    });
    function oa(a) {
      a = { next: a };
      a[Symbol.iterator] = function() {
        return this;
      };
      return a;
    }
    function pa() {
      this.u = false;
      this.l = null;
      this.h = void 0;
      this.g = 1;
      this.j = this.m = 0;
      this.C = this.i = null;
    }
    function qa(a) {
      if (a.u) throw new TypeError("Generator is already running");
      a.u = true;
    }
    pa.prototype.A = function(a) {
      this.h = a;
    };
    function ra(a, b) {
      a.i = { Ui: b, fj: true };
      a.g = a.m || a.j;
    }
    pa.prototype.return = function(a) {
      this.i = { return: a };
      this.g = this.j;
    };
    function G(a, b, c) {
      a.g = c;
      return { value: b };
    }
    pa.prototype.B = function(a) {
      this.g = a;
    };
    function H(a) {
      a.g = 0;
    }
    function sa(a, b, c) {
      a.m = b;
      c != void 0 && (a.j = c);
    }
    function ta(a, b) {
      a.m = 0;
      a.j = b || 0;
    }
    function ua(a, b, c) {
      a.g = b;
      a.m = c || 0;
    }
    function va(a, b) {
      a.m = b || 0;
      b = a.i.Ui;
      a.i = null;
      return b;
    }
    function wa(a) {
      a.C = [a.i];
      a.m = 0;
      a.j = 0;
    }
    function xa(a, b) {
      var c = a.C.splice(0)[0];
      (c = a.i = a.i || c) ? c.fj ? a.g = a.m || a.j : c.B != void 0 && a.j < c.B ? (a.g = c.B, a.i = null) : a.g = a.j : a.g = b;
    }
    function Aa(a) {
      this.g = new pa();
      this.h = a;
    }
    function Ga(a, b) {
      qa(a.g);
      var c = a.g.l;
      if (c) return Ha(a, "return" in c ? c["return"] : function(d) {
        return { value: d, done: true };
      }, b, a.g.return);
      a.g.return(b);
      return Ia(a);
    }
    function Ha(a, b, c, d) {
      try {
        var e = b.call(a.g.l, c);
        if (!(e instanceof Object)) throw new TypeError("Iterator result " + e + " is not an object");
        if (!e.done) return a.g.u = false, e;
        var f = e.value;
      } catch (g) {
        return a.g.l = null, ra(a.g, g), Ia(a);
      }
      a.g.l = null;
      d.call(a.g, f);
      return Ia(a);
    }
    function Ia(a) {
      for (; a.g.g; ) try {
        var b = a.h(a.g);
        if (b) return a.g.u = false, { value: b.value, done: false };
      } catch (c) {
        a.g.h = void 0, ra(a.g, c);
      }
      a.g.u = false;
      if (a.g.i) {
        b = a.g.i;
        a.g.i = null;
        if (b.fj) throw b.Ui;
        return { value: b.return, done: true };
      }
      return { value: void 0, done: true };
    }
    function Ka(a) {
      this.next = function(b) {
        qa(a.g);
        a.g.l ? b = Ha(a, a.g.l.next, b, a.g.A) : (a.g.A(b), b = Ia(a));
        return b;
      };
      this.throw = function(b) {
        qa(a.g);
        a.g.l ? b = Ha(a, a.g.l["throw"], b, a.g.A) : (ra(a.g, b), b = Ia(a));
        return b;
      };
      this.return = function(b) {
        return Ga(a, b);
      };
      this[Symbol.iterator] = function() {
        return this;
      };
    }
    function Ma(a) {
      function b(d) {
        return a.next(d);
      }
      function c(d) {
        return a.throw(d);
      }
      return new Promise(function(d, e) {
        function f(g) {
          g.done ? d(g.value) : Promise.resolve(g.value).then(b, c).then(f, e);
        }
        f(a.next());
      });
    }
    function P(a) {
      return Ma(new Ka(new Aa(a)));
    }
    function Na() {
      for (var a = Number(this), b = [], c = a; c < arguments.length; c++) b[c - a] = arguments[c];
      return b;
    }
    fa("Promise", function(a) {
      function b(g) {
        this.h = 0;
        this.i = void 0;
        this.g = [];
        this.u = false;
        var h = this.j();
        try {
          g(h.resolve, h.reject);
        } catch (k2) {
          h.reject(k2);
        }
      }
      function c() {
        this.g = null;
      }
      function d(g) {
        return g instanceof b ? g : new b(function(h) {
          h(g);
        });
      }
      if (a) return a;
      c.prototype.h = function(g) {
        if (this.g == null) {
          this.g = [];
          var h = this;
          this.i(function() {
            h.l();
          });
        }
        this.g.push(g);
      };
      var e = ea.setTimeout;
      c.prototype.i = function(g) {
        e(g, 0);
      };
      c.prototype.l = function() {
        for (; this.g && this.g.length; ) {
          var g = this.g;
          this.g = [];
          for (var h = 0; h < g.length; ++h) {
            var k2 = g[h];
            g[h] = null;
            try {
              k2();
            } catch (l) {
              this.j(l);
            }
          }
        }
        this.g = null;
      };
      c.prototype.j = function(g) {
        this.i(function() {
          throw g;
        });
      };
      b.prototype.j = function() {
        function g(l) {
          return function(m) {
            k2 || (k2 = true, l.call(h, m));
          };
        }
        var h = this, k2 = false;
        return { resolve: g(this.G), reject: g(this.l) };
      };
      b.prototype.G = function(g) {
        if (g === this) this.l(new TypeError("A Promise cannot resolve to itself"));
        else if (g instanceof b) this.I(g);
        else {
          a: switch (typeof g) {
            case "object":
              var h = g != null;
              break a;
            case "function":
              h = true;
              break a;
            default:
              h = false;
          }
          h ? this.F(g) : this.m(g);
        }
      };
      b.prototype.F = function(g) {
        var h = void 0;
        try {
          h = g.then;
        } catch (k2) {
          this.l(k2);
          return;
        }
        typeof h == "function" ? this.J(h, g) : this.m(g);
      };
      b.prototype.l = function(g) {
        this.A(2, g);
      };
      b.prototype.m = function(g) {
        this.A(1, g);
      };
      b.prototype.A = function(g, h) {
        if (this.h != 0) throw Error("Cannot settle(" + g + ", " + h + "): Promise already settled in state" + this.h);
        this.h = g;
        this.i = h;
        this.h === 2 && this.H();
        this.C();
      };
      b.prototype.H = function() {
        var g = this;
        e(function() {
          if (g.D()) {
            var h = ea.console;
            typeof h !== "undefined" && h.error(g.i);
          }
        }, 1);
      };
      b.prototype.D = function() {
        if (this.u) return false;
        var g = ea.CustomEvent, h = ea.Event, k2 = ea.dispatchEvent;
        if (typeof k2 === "undefined") return true;
        typeof g === "function" ? g = new g("unhandledrejection", { cancelable: true }) : typeof h === "function" ? g = new h("unhandledrejection", { cancelable: true }) : (g = ea.document.createEvent("CustomEvent"), g.initCustomEvent("unhandledrejection", false, true, g));
        g.promise = this;
        g.reason = this.i;
        return k2(g);
      };
      b.prototype.C = function() {
        if (this.g != null) {
          for (var g = 0; g < this.g.length; ++g) f.h(this.g[g]);
          this.g = null;
        }
      };
      var f = new c();
      b.prototype.I = function(g) {
        var h = this.j();
        g.hf(h.resolve, h.reject);
      };
      b.prototype.J = function(g, h) {
        var k2 = this.j();
        try {
          g.call(h, k2.resolve, k2.reject);
        } catch (l) {
          k2.reject(l);
        }
      };
      b.prototype.then = function(g, h) {
        function k2(q, r) {
          return typeof q == "function" ? function(u) {
            try {
              l(q(u));
            } catch (w) {
              m(w);
            }
          } : r;
        }
        var l, m, n = new b(function(q, r) {
          l = q;
          m = r;
        });
        this.hf(k2(g, l), k2(h, m));
        return n;
      };
      b.prototype.catch = function(g) {
        return this.then(void 0, g);
      };
      b.prototype.hf = function(g, h) {
        function k2() {
          switch (l.h) {
            case 1:
              g(l.i);
              break;
            case 2:
              h(l.i);
              break;
            default:
              throw Error("Unexpected state: " + l.h);
          }
        }
        var l = this;
        this.g == null ? f.h(k2) : this.g.push(k2);
        this.u = true;
      };
      b.resolve = d;
      b.reject = function(g) {
        return new b(function(h, k2) {
          k2(g);
        });
      };
      b.race = function(g) {
        return new b(function(h, k2) {
          for (var l = t(g), m = l.next(); !m.done; m = l.next()) d(m.value).hf(h, k2);
        });
      };
      b.all = function(g) {
        var h = t(g), k2 = h.next();
        return k2.done ? d([]) : new b(function(l, m) {
          function n(u) {
            return function(w) {
              q[u] = w;
              r--;
              r == 0 && l(q);
            };
          }
          var q = [], r = 0;
          do
            q.push(void 0), r++, d(k2.value).hf(n(q.length - 1), m), k2 = h.next();
          while (!k2.done);
        });
      };
      return b;
    });
    function Pa(a, b) {
      return Object.prototype.hasOwnProperty.call(a, b);
    }
    fa("WeakMap", function(a) {
      function b(k2) {
        this.g = (h += Math.random() + 1).toString();
        if (k2) {
          k2 = t(k2);
          for (var l; !(l = k2.next()).done; ) l = l.value, this.set(l[0], l[1]);
        }
      }
      function c() {
      }
      function d(k2) {
        var l = typeof k2;
        return l === "object" && k2 !== null || l === "function";
      }
      function e(k2) {
        if (!Pa(k2, g)) {
          var l = new c();
          ca(k2, g, { value: l });
        }
      }
      function f(k2) {
        var l = Object[k2];
        l && (Object[k2] = function(m) {
          if (m instanceof c) return m;
          Object.isExtensible(m) && e(m);
          return l(m);
        });
      }
      if (function() {
        if (!a || !Object.seal) return false;
        try {
          var k2 = Object.seal({}), l = Object.seal({}), m = new a([[k2, 2], [l, 3]]);
          if (m.get(k2) != 2 || m.get(l) != 3) return false;
          m.delete(k2);
          m.set(l, 4);
          return !m.has(k2) && m.get(l) == 4;
        } catch (n) {
          return false;
        }
      }()) return a;
      var g = "$jscomp_hidden_" + Math.random();
      f("freeze");
      f("preventExtensions");
      f("seal");
      var h = 0;
      b.prototype.set = function(k2, l) {
        if (!d(k2)) throw Error("Invalid WeakMap key");
        e(k2);
        if (!Pa(k2, g)) throw Error("WeakMap key fail: " + k2);
        k2[g][this.g] = l;
        return this;
      };
      b.prototype.get = function(k2) {
        return d(k2) && Pa(k2, g) ? k2[g][this.g] : void 0;
      };
      b.prototype.has = function(k2) {
        return d(k2) && Pa(
          k2,
          g
        ) && Pa(k2[g], this.g);
      };
      b.prototype.delete = function(k2) {
        return d(k2) && Pa(k2, g) && Pa(k2[g], this.g) ? delete k2[g][this.g] : false;
      };
      return b;
    });
    fa("Map", function(a) {
      function b() {
        var h = {};
        return h.Dc = h.next = h.head = h;
      }
      function c(h, k2) {
        var l = h[1];
        return oa(function() {
          if (l) {
            for (; l.head != h[1]; ) l = l.Dc;
            for (; l.next != l.head; ) return l = l.next, { done: false, value: k2(l) };
            l = null;
          }
          return { done: true, value: void 0 };
        });
      }
      function d(h, k2) {
        var l = k2 && typeof k2;
        l == "object" || l == "function" ? f.has(k2) ? l = f.get(k2) : (l = "" + ++g, f.set(k2, l)) : l = "p_" + k2;
        var m = h[0][l];
        if (m && Pa(h[0], l)) for (h = 0; h < m.length; h++) {
          var n = m[h];
          if (k2 !== k2 && n.key !== n.key || k2 === n.key) return { id: l, list: m, index: h, entry: n };
        }
        return {
          id: l,
          list: m,
          index: -1,
          entry: void 0
        };
      }
      function e(h) {
        this[0] = {};
        this[1] = b();
        this.size = 0;
        if (h) {
          h = t(h);
          for (var k2; !(k2 = h.next()).done; ) k2 = k2.value, this.set(k2[0], k2[1]);
        }
      }
      if (function() {
        if (!a || typeof a != "function" || !a.prototype.entries || typeof Object.seal != "function") return false;
        try {
          var h = Object.seal({ x: 4 }), k2 = new a(t([[h, "s"]]));
          if (k2.get(h) != "s" || k2.size != 1 || k2.get({ x: 4 }) || k2.set({ x: 4 }, "t") != k2 || k2.size != 2) return false;
          var l = k2.entries(), m = l.next();
          if (m.done || m.value[0] != h || m.value[1] != "s") return false;
          m = l.next();
          return m.done || m.value[0].x != 4 || m.value[1] != "t" || !l.next().done ? false : true;
        } catch (n) {
          return false;
        }
      }()) return a;
      var f = /* @__PURE__ */ new WeakMap();
      e.prototype.set = function(h, k2) {
        h = h === 0 ? 0 : h;
        var l = d(this, h);
        l.list || (l.list = this[0][l.id] = []);
        l.entry ? l.entry.value = k2 : (l.entry = { next: this[1], Dc: this[1].Dc, head: this[1], key: h, value: k2 }, l.list.push(l.entry), this[1].Dc.next = l.entry, this[1].Dc = l.entry, this.size++);
        return this;
      };
      e.prototype.delete = function(h) {
        h = d(this, h);
        return h.entry && h.list ? (h.list.splice(h.index, 1), h.list.length || delete this[0][h.id], h.entry.Dc.next = h.entry.next, h.entry.next.Dc = h.entry.Dc, h.entry.head = null, this.size--, true) : false;
      };
      e.prototype.clear = function() {
        this[0] = {};
        this[1] = this[1].Dc = b();
        this.size = 0;
      };
      e.prototype.has = function(h) {
        return !!d(this, h).entry;
      };
      e.prototype.get = function(h) {
        return (h = d(this, h).entry) && h.value;
      };
      e.prototype.entries = function() {
        return c(this, function(h) {
          return [h.key, h.value];
        });
      };
      e.prototype.keys = function() {
        return c(this, function(h) {
          return h.key;
        });
      };
      e.prototype.values = function() {
        return c(this, function(h) {
          return h.value;
        });
      };
      e.prototype.forEach = function(h, k2) {
        for (var l = this.entries(), m; !(m = l.next()).done; ) m = m.value, h.call(k2, m[1], m[0], this);
      };
      e.prototype[Symbol.iterator] = e.prototype.entries;
      var g = 0;
      return e;
    });
    function Qa(a, b) {
      a instanceof String && (a += "");
      var c = 0, d = false, e = { next: function() {
        if (!d && c < a.length) {
          var f = c++;
          return { value: b(f, a[f]), done: false };
        }
        d = true;
        return { done: true, value: void 0 };
      } };
      e[Symbol.iterator] = function() {
        return e;
      };
      return e;
    }
    fa("Array.prototype.keys", function(a) {
      return a ? a : function() {
        return Qa(this, function(b) {
          return b;
        });
      };
    });
    fa("Set", function(a) {
      function b(c) {
        this.g = /* @__PURE__ */ new Map();
        if (c) {
          c = t(c);
          for (var d; !(d = c.next()).done; ) this.add(d.value);
        }
        this.size = this.g.size;
      }
      if (function() {
        if (!a || typeof a != "function" || !a.prototype.entries || typeof Object.seal != "function") return false;
        try {
          var c = Object.seal({ x: 4 }), d = new a(t([c]));
          if (!d.has(c) || d.size != 1 || d.add(c) != d || d.size != 1 || d.add({ x: 4 }) != d || d.size != 2) return false;
          var e = d.entries(), f = e.next();
          if (f.done || f.value[0] != c || f.value[1] != c) return false;
          f = e.next();
          return f.done || f.value[0] == c || f.value[0].x != 4 || f.value[1] != f.value[0] ? false : e.next().done;
        } catch (g) {
          return false;
        }
      }()) return a;
      b.prototype.add = function(c) {
        c = c === 0 ? 0 : c;
        this.g.set(c, c);
        this.size = this.g.size;
        return this;
      };
      b.prototype.delete = function(c) {
        c = this.g.delete(c);
        this.size = this.g.size;
        return c;
      };
      b.prototype.clear = function() {
        this.g.clear();
        this.size = 0;
      };
      b.prototype.has = function(c) {
        return this.g.has(c);
      };
      b.prototype.entries = function() {
        return this.g.entries();
      };
      b.prototype.values = function() {
        return this.g.values();
      };
      b.prototype.keys = b.prototype.values;
      b.prototype[Symbol.iterator] = b.prototype.values;
      b.prototype.forEach = function(c, d) {
        var e = this;
        this.g.forEach(function(f) {
          return c.call(d, f, f, e);
        });
      };
      return b;
    });
    fa("Array.prototype.values", function(a) {
      return a ? a : function() {
        return Qa(this, function(b, c) {
          return c;
        });
      };
    });
    fa("Array.from", function(a) {
      return a ? a : function(b, c, d) {
        c = c != null ? c : function(h) {
          return h;
        };
        var e = [], f = typeof Symbol != "undefined" && Symbol.iterator && b[Symbol.iterator];
        if (typeof f == "function") {
          b = f.call(b);
          for (var g = 0; !(f = b.next()).done; ) e.push(c.call(d, f.value, g++));
        } else for (f = b.length, g = 0; g < f; g++) e.push(c.call(d, b[g], g));
        return e;
      };
    });
    fa("Object.is", function(a) {
      return a ? a : function(b, c) {
        return b === c ? b !== 0 || 1 / b === 1 / c : b !== b && c !== c;
      };
    });
    fa("Array.prototype.includes", function(a) {
      return a ? a : function(b, c) {
        var d = this;
        d instanceof String && (d = String(d));
        var e = d.length;
        c = c || 0;
        for (c < 0 && (c = Math.max(c + e, 0)); c < e; c++) {
          var f = d[c];
          if (f === b || Object.is(f, b)) return true;
        }
        return false;
      };
    });
    function Ra(a, b, c) {
      if (a == null) throw new TypeError("The 'this' value for String.prototype." + c + " must not be null or undefined");
      if (b instanceof RegExp) throw new TypeError("First argument to String.prototype." + c + " must not be a regular expression");
      return a + "";
    }
    fa("String.prototype.includes", function(a) {
      return a ? a : function(b, c) {
        return Ra(this, b, "includes").indexOf(b, c || 0) !== -1;
      };
    });
    fa("String.fromCodePoint", function(a) {
      return a ? a : function(b) {
        for (var c = "", d = 0; d < arguments.length; d++) {
          var e = Number(arguments[d]);
          if (e < 0 || e > 1114111 || e !== Math.floor(e)) throw new RangeError("invalid_code_point " + e);
          e <= 65535 ? c += String.fromCharCode(e) : (e -= 65536, c += String.fromCharCode(e >>> 10 & 1023 | 55296), c += String.fromCharCode(e & 1023 | 56320));
        }
        return c;
      };
    });
    function Sa(a, b, c) {
      a instanceof String && (a = String(a));
      for (var d = a.length, e = 0; e < d; e++) {
        var f = a[e];
        if (b.call(c, f, e, a)) return { cj: e, v: f };
      }
      return { cj: -1, v: void 0 };
    }
    fa("Array.prototype.findIndex", function(a) {
      return a ? a : function(b, c) {
        return Sa(this, b, c).cj;
      };
    });
    fa("WeakSet", function(a) {
      function b(c) {
        this.g = /* @__PURE__ */ new WeakMap();
        if (c) {
          c = t(c);
          for (var d; !(d = c.next()).done; ) this.add(d.value);
        }
      }
      if (function() {
        if (!a || !Object.seal) return false;
        try {
          var c = Object.seal({}), d = Object.seal({}), e = new a([c]);
          if (!e.has(c) || e.has(d)) return false;
          e.delete(c);
          e.add(d);
          return !e.has(c) && e.has(d);
        } catch (f) {
          return false;
        }
      }()) return a;
      b.prototype.add = function(c) {
        this.g.set(c, true);
        return this;
      };
      b.prototype.has = function(c) {
        return this.g.has(c);
      };
      b.prototype.delete = function(c) {
        return this.g.delete(c);
      };
      return b;
    });
    fa("Array.prototype.find", function(a) {
      return a ? a : function(b, c) {
        return Sa(this, b, c).v;
      };
    });
    fa("String.prototype.startsWith", function(a) {
      return a ? a : function(b, c) {
        var d = Ra(this, b, "startsWith"), e = d.length, f = b.length;
        c = Math.max(0, Math.min(c | 0, d.length));
        for (var g = 0; g < f && c < e; ) if (d[c++] != b[g++]) return false;
        return g >= f;
      };
    });
    fa("Object.entries", function(a) {
      return a ? a : function(b) {
        var c = [], d;
        for (d in b) Pa(b, d) && c.push([d, b[d]]);
        return c;
      };
    });
    var Ta = typeof Object.assign == "function" ? Object.assign : function(a, b) {
      for (var c = 1; c < arguments.length; c++) {
        var d = arguments[c];
        if (d) for (var e in d) Pa(d, e) && (a[e] = d[e]);
      }
      return a;
    };
    fa("Object.assign", function(a) {
      return a || Ta;
    });
    fa("Promise.prototype.finally", function(a) {
      return a ? a : function(b) {
        return this.then(function(c) {
          return Promise.resolve(b()).then(function() {
            return c;
          });
        }, function(c) {
          return Promise.resolve(b()).then(function() {
            throw c;
          });
        });
      };
    });
    fa("Array.prototype.entries", function(a) {
      return a ? a : function() {
        return Qa(this, function(b, c) {
          return [b, c];
        });
      };
    });
    fa("Number.isNaN", function(a) {
      return a ? a : function(b) {
        return typeof b === "number" && isNaN(b);
      };
    });
    fa("String.prototype.repeat", function(a) {
      return a ? a : function(b) {
        var c = Ra(this, null, "repeat");
        if (b < 0 || b > 1342177279) throw new RangeError("Invalid count value");
        b |= 0;
        for (var d = ""; b; ) if (b & 1 && (d += c), b >>>= 1) c += c;
        return d;
      };
    });
    fa("Number.EPSILON", function() {
      return 2220446049250313e-31;
    });
    fa("Number.MAX_SAFE_INTEGER", function() {
      return 9007199254740991;
    });
    fa("Number.isFinite", function(a) {
      return a ? a : function(b) {
        return typeof b !== "number" ? false : !isNaN(b) && b !== Infinity && b !== -Infinity;
      };
    });
    fa("Object.values", function(a) {
      return a ? a : function(b) {
        var c = [], d;
        for (d in b) Pa(b, d) && c.push(b[d]);
        return c;
      };
    });
    fa("Math.log2", function(a) {
      return a ? a : function(b) {
        return Math.log(b) / Math.LN2;
      };
    });
    fa("String.prototype.endsWith", function(a) {
      return a ? a : function(b, c) {
        var d = Ra(this, b, "endsWith");
        c === void 0 && (c = d.length);
        c = Math.max(0, Math.min(c | 0, d.length));
        for (var e = b.length; e > 0 && c > 0; ) if (d[--c] != b[--e]) return false;
        return e <= 0;
      };
    });
    fa("Math.trunc", function(a) {
      return a ? a : function(b) {
        b = Number(b);
        if (isNaN(b) || b === Infinity || b === -Infinity || b === 0) return b;
        var c = Math.floor(Math.abs(b));
        return b < 0 ? -c : c;
      };
    });
    function Ua(a) {
      a = Math.trunc(a) || 0;
      a < 0 && (a += this.length);
      if (!(a < 0 || a >= this.length)) return this[a];
    }
    fa("Array.prototype.at", function(a) {
      return a ? a : Ua;
    });
    function Wa(a) {
      return a ? a : Ua;
    }
    fa("Int8Array.prototype.at", Wa);
    fa("Uint8Array.prototype.at", Wa);
    fa("Uint8ClampedArray.prototype.at", Wa);
    fa("Int16Array.prototype.at", Wa);
    fa("Uint16Array.prototype.at", Wa);
    fa("Int32Array.prototype.at", Wa);
    fa("Uint32Array.prototype.at", Wa);
    fa("Float32Array.prototype.at", Wa);
    fa("Float64Array.prototype.at", Wa);
    fa("String.prototype.at", function(a) {
      return a ? a : Ua;
    });
    var Xa = this || self;
    function S(a, b) {
      a = a.split(".");
      var c = Xa;
      a[0] in c || typeof c.execScript == "undefined" || c.execScript("var " + a[0]);
      for (var d; a.length && (d = a.shift()); ) a.length || b === void 0 ? c[d] && c[d] !== Object.prototype[d] ? c = c[d] : c = c[d] = {} : c[d] = b;
    }
    ;
    /*
     @license
     Shaka Player
     Copyright 2016 Google LLC
     SPDX-License-Identifier: Apache-2.0
    */
    function T(a, b) {
      if (b) if (b instanceof Map) for (var c = t(b.keys()), d = c.next(); !d.done; d = c.next()) d = d.value, Object.defineProperty(this, d, { value: b.get(d), writable: true, enumerable: true });
      else for (c in b) Object.defineProperty(this, c, { value: b[c], writable: true, enumerable: true });
      this.defaultPrevented = this.cancelable = this.bubbles = false;
      this.timeStamp = window2.performance && window2.performance.now ? window2.performance.now() : Date.now();
      this.type = a;
      this.isTrusted = false;
      this.target = this.currentTarget = null;
      this.g = false;
    }
    function Ya(a) {
      var b = new T(a.type), c;
      for (c in a) Object.defineProperty(b, c, { value: a[c], writable: true, enumerable: true });
      return b;
    }
    T.prototype.preventDefault = function() {
      this.cancelable && (this.defaultPrevented = true);
    };
    T.prototype.stopImmediatePropagation = function() {
      this.g = true;
    };
    T.prototype.stopPropagation = function() {
    };
    S("shaka.util.FakeEvent", T);
    var Za = {
      Gm: "abrstatuschanged",
      Hm: "adaptation",
      Im: "audiotrackchanged",
      Jm: "audiotrackschanged",
      Km: "boundarycrossed",
      Lm: "buffering",
      Mm: "canupdatestarttime",
      Nm: "complete",
      Om: "currentitemchanged",
      Pm: "downloadcompleted",
      Qm: "downloadfailed",
      Rm: "downloadheadersreceived",
      Sm: "drmsessionupdate",
      Um: "emsg",
      $m: "itemsinserted",
      an: "itemsremoved",
      un: "prft",
      Error: "error",
      Vm: "expirationupdated",
      Wm: "firstquartile",
      Xm: "gapjumped",
      cn: "keystatuschanged",
      hn: "loaded",
      jn: "loading",
      mn: "manifestparsed",
      nn: "manifestupdated",
      on: "mediaqualitychanged",
      pn: "mediasourcerecovered",
      qn: "metadataadded",
      Metadata: "metadata",
      rn: "midpoint",
      sn: "nospatialvideoinfo",
      tn: "onstatechange",
      vn: "ratechange",
      yn: "segmentappended",
      zn: "sessiondata",
      An: "spatialvideoinfo",
      Bn: "stalldetected",
      Cn: "started",
      Dn: "statechanged",
      En: "streaming",
      Fn: "textchanged",
      Gn: "texttrackvisibility",
      Hn: "thirdquartile",
      In: "timelineregionadded",
      Jn: "timelineregionenter",
      Kn: "timelineregionexit",
      Ln: "trackschanged",
      Nn: "unloading",
      Pn: "variantchanged"
    };
    function $a() {
    }
    function ab() {
    }
    function bb() {
    }
    function cb(a) {
      var b = Na.apply(1, arguments);
      db.has(a) || (db.add(a), bb.apply($a, x(b)));
    }
    function eb() {
    }
    function gb() {
    }
    function jb() {
    }
    var db = /* @__PURE__ */ new Set();
    window2.console && ((/* @__PURE__ */ new Map()).set(1, function() {
      return console.error.apply(console, x(Na.apply(0, arguments)));
    }).set(2, function() {
      return console.warn.apply(console, x(Na.apply(0, arguments)));
    }).set(3, function() {
      return console.info.apply(console, x(Na.apply(0, arguments)));
    }).set(4, function() {
      return console.log.apply(console, x(Na.apply(0, arguments)));
    }).set(5, function() {
      return console.debug.apply(console, x(Na.apply(0, arguments)));
    }).set(6, function() {
      return console.debug.apply(console, x(Na.apply(0, arguments)));
    }), bb = function() {
      return console.warn.apply(console, x(Na.apply(0, arguments)));
    }, ab = function() {
      console.error.apply(console, x(Na.apply(0, arguments)));
    });
    function kb() {
      this.g = /* @__PURE__ */ new Map();
    }
    p = kb.prototype;
    p.push = function(a, b) {
      this.g.has(a) ? this.g.get(a).push(b) : this.g.set(a, [b]);
    };
    p.get = function(a) {
      return this.g.has(a) ? this.g.get(a).slice() : null;
    };
    p.remove = function(a, b) {
      if (this.g.has(a)) {
        var c = this.g.get(a).filter(function(d) {
          return d != b;
        });
        this.g.set(a, c);
        c.length || this.g.delete(a);
      }
    };
    p.forEach = function(a) {
      this.g.forEach(function(b, c) {
        a(c, b);
      });
    };
    p.size = function() {
      return this.g.size;
    };
    p.keys = function() {
      return Array.from(this.g.keys());
    };
    function lb() {
      this.hb = new kb();
      this.Ue = this;
    }
    lb.prototype.addEventListener = function(a, b) {
      this.hb && this.hb.push(a, b);
    };
    lb.prototype.removeEventListener = function(a, b) {
      this.hb && this.hb.remove(a, b);
    };
    lb.prototype.dispatchEvent = function(a) {
      if (!this.hb) return true;
      var b = this.hb.get(a.type) || [], c = this.hb.get("All");
      c && (b = b.concat(c));
      b = t(b);
      for (c = b.next(); !c.done; c = b.next()) {
        c = c.value;
        a.target = this.Ue;
        a.currentTarget = this.Ue;
        try {
          c.handleEvent ? c.handleEvent(a) : c.call(this, a);
        } catch (d) {
        }
        if (a.g) break;
      }
      return a.defaultPrevented;
    };
    lb.prototype.release = function() {
      this.hb = null;
    };
    function mb(a, b) {
      var c = [];
      a = t(a);
      for (var d = a.next(); !d.done; d = a.next()) c.push(b(d.value));
      return c;
    }
    function nb(a, b) {
      a = t(a);
      for (var c = a.next(); !c.done; c = a.next()) if (!b(c.value)) return false;
      return true;
    }
    function ob(a, b) {
      a = t(a);
      for (var c = a.next(); !c.done; c = a.next()) if (b(c.value)) return true;
      return false;
    }
    function pb(a, b) {
      var c = [];
      a = t(a);
      for (var d = a.next(); !d.done; d = a.next()) d = d.value, b(d) && c.push(d);
      return c;
    }
    ;
    /*
     @license
     Copyright 2008 The Closure Library Authors
     SPDX-License-Identifier: Apache-2.0
    */
    var qb = RegExp("^(?:([^:/?#.]+):)?(?://(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#(.*))?$");
    /*
     @license
     Copyright 2006 The Closure Library Authors
     SPDX-License-Identifier: Apache-2.0
    */
    function rb(a) {
      var b;
      a instanceof rb ? (sb(this, a.lc), this.wd = a.wd, tb(this, a.Ib), ub(this, a.Od), this.xb = a.xb, wb(this, a.g.clone()), this.cd = a.cd) : a && (b = String(a).match(qb)) ? (sb(this, b[1] || "", true), this.wd = yb(b[2] || ""), tb(this, b[3] || "", true), ub(this, b[4]), this.xb = yb(b[5] || "", true), wb(this, b[6] || "", true), this.cd = yb(b[7] || "")) : this.g = new zb(null);
    }
    p = rb.prototype;
    p.lc = "";
    p.wd = "";
    p.Ib = "";
    p.Od = null;
    p.xb = "";
    p.cd = "";
    p.toString = function() {
      var a = [], b = this.lc;
      b && a.push(Ab(b, Bb, true), ":");
      if (b = this.Ib) {
        a.push("//");
        var c = this.wd;
        c && a.push(Ab(c, Bb, true), "@");
        a.push(encodeURIComponent(b).replace(/%25([0-9a-fA-F]{2})/g, "%$1"));
        b = this.Od;
        b != null && a.push(":", String(b));
      }
      if (b = this.xb) this.Ib && b.charAt(0) != "/" && a.push("/"), a.push(Ab(b, b.charAt(0) == "/" ? Cb : Db, true));
      (b = this.g.toString()) && a.push("?", b);
      (b = this.cd) && a.push("#", Ab(b, Eb));
      return a.join("");
    };
    p.resolve = function(a) {
      var b = this.clone();
      b.lc === "data" && (b = new rb());
      var c = !!a.lc;
      c ? sb(b, a.lc) : c = !!a.wd;
      c ? b.wd = a.wd : c = !!a.Ib;
      c ? tb(b, a.Ib) : c = a.Od != null;
      var d = a.xb;
      if (c) ub(b, a.Od);
      else if (c = !!a.xb) {
        if (d.charAt(0) != "/") if (this.Ib && !this.xb) d = "/" + d;
        else {
          var e = b.xb.lastIndexOf("/");
          e != -1 && (d = b.xb.substr(0, e + 1) + d);
        }
        if (d == ".." || d == ".") d = "";
        else if (d.indexOf("./") != -1 || d.indexOf("/.") != -1) {
          e = d.lastIndexOf("/", 0) == 0;
          d = d.split("/");
          for (var f = [], g = 0; g < d.length; ) {
            var h = d[g++];
            h == "." ? e && g == d.length && f.push("") : h == ".." ? ((f.length > 1 || f.length == 1 && f[0] != "") && f.pop(), e && g == d.length && f.push("")) : (f.push(h), e = true);
          }
          d = f.join("/");
        }
      }
      c ? b.xb = d : c = a.g.toString() !== "";
      c ? wb(b, a.g.clone()) : c = !!a.cd;
      c && (b.cd = a.cd);
      return b;
    };
    p.clone = function() {
      return new rb(this);
    };
    function sb(a, b, c) {
      a.lc = c ? yb(b, true) : b;
      a.lc && (a.lc = a.lc.replace(/:$/, ""));
    }
    function tb(a, b, c) {
      a.Ib = c ? yb(b, true) : b;
    }
    function ub(a, b) {
      if (b) {
        b = Number(b);
        if (isNaN(b) || b < 0) throw Error("Bad port number " + b);
        a.Od = b;
      } else a.Od = null;
    }
    function wb(a, b, c) {
      b instanceof zb ? a.g = b : (c || (b = Ab(b, Fb)), a.g = new zb(b));
    }
    function yb(a, b) {
      return a ? b ? decodeURI(a) : decodeURIComponent(a) : "";
    }
    function Ab(a, b, c) {
      return a != null ? (a = encodeURI(a).replace(b, Gb), c && (a = a.replace(/%25([0-9a-fA-F]{2})/g, "%$1")), a) : null;
    }
    function Gb(a) {
      a = a.charCodeAt(0);
      return "%" + (a >> 4 & 15).toString(16) + (a & 15).toString(16);
    }
    var Bb = /[#\/\?@]/g, Db = /[#\?:]/g, Cb = /[#\?]/g, Fb = /[#\?@]/g, Eb = /#/g;
    function zb(a) {
      this.g = a || null;
    }
    function Hb(a) {
      if (!a.mb && (a.mb = /* @__PURE__ */ new Map(), a.fe = 0, a.g)) for (var b = a.g.split("&"), c = 0; c < b.length; c++) {
        var d = b[c].indexOf("="), e = null;
        if (d >= 0) {
          var f = b[c].substring(0, d);
          e = b[c].substring(d + 1);
        } else f = b[c];
        f = decodeURIComponent(f);
        e = e || "";
        a.add(f, decodeURIComponent(e));
      }
    }
    p = zb.prototype;
    p.mb = null;
    p.fe = null;
    function Ib(a) {
      Hb(a);
      return a.fe;
    }
    p.add = function(a, b) {
      Hb(this);
      this.g = null;
      var c = this.mb.has(a) ? this.mb.get(a) : null;
      c || this.mb.set(a, c = []);
      c.push(b);
      this.fe++;
      return this;
    };
    p.set = function(a, b) {
      Hb(this);
      this.g = null;
      this.mb.has(a) ? this.mb.set(a, [b]) : this.add(a, b);
      return this;
    };
    p.get = function(a) {
      Hb(this);
      return this.mb.get(a) || [];
    };
    p.toString = function() {
      if (this.g) return this.g;
      if (!this.mb || !this.mb.size) return "";
      for (var a = [], b = t(this.mb.keys()), c = b.next(); !c.done; c = b.next()) {
        var d = c.value;
        c = encodeURIComponent(d);
        d = this.mb.get(d);
        for (var e = 0; e < d.length; e++) {
          var f = c;
          d[e] !== "" && (f += "=" + encodeURIComponent(d[e]));
          a.push(f);
        }
      }
      return this.g = a.join("&");
    };
    p.clone = function() {
      var a = new zb();
      a.g = this.g;
      if (this.mb) {
        for (var b = /* @__PURE__ */ new Map(), c = t(this.mb), d = c.next(); !d.done; d = c.next()) {
          var e = t(d.value);
          d = e.next().value;
          e = e.next().value;
          b.set(d, e.concat());
        }
        a.mb = b;
        a.fe = this.fe;
      }
      return a;
    };
    function Jb() {
    }
    function Kb(a, b) {
      if (!a && !b) return true;
      if (!a || !b || a.byteLength != b.byteLength) return false;
      if ((ArrayBuffer.isView(a) ? a.buffer : a) == (ArrayBuffer.isView(b) ? b.buffer : b) && (a.byteOffset || 0) == (b.byteOffset || 0)) return true;
      var c = Lb(a);
      b = Lb(b);
      for (var d = 0; d < a.byteLength; d++) if (c[d] != b[d]) return false;
      return true;
    }
    function Mb(a) {
      return ArrayBuffer.isView(a) ? a.byteOffset == 0 && a.byteLength == a.buffer.byteLength ? a.buffer : new Uint8Array(a).buffer : a;
    }
    function Lb(a, b, c) {
      c = c === void 0 ? Infinity : c;
      return Nb(a, b === void 0 ? 0 : b, c, Uint8Array);
    }
    function Ob(a, b, c) {
      c = c === void 0 ? Infinity : c;
      return Nb(a, b === void 0 ? 0 : b, c, Uint16Array);
    }
    function Pb(a, b, c) {
      c = c === void 0 ? Infinity : c;
      return Nb(a, b === void 0 ? 0 : b, c, DataView);
    }
    function Nb(a, b, c, d) {
      var e = ArrayBuffer.isView(a) ? a.buffer : a, f = 1;
      "BYTES_PER_ELEMENT" in d && (f = d.BYTES_PER_ELEMENT);
      var g = ((a.byteOffset || 0) + a.byteLength) / f;
      a = Math.floor(Math.max(0, Math.min(((a.byteOffset || 0) + b) / f, g)));
      return new d(e, a, Math.floor(Math.min(a + Math.max(c, 0), g)) - a);
    }
    S("shaka.util.BufferUtils", Jb);
    Jb.toDataView = Pb;
    Jb.toUint16 = Ob;
    Jb.toUint8 = Lb;
    Jb.toArrayBuffer = Mb;
    Jb.equal = Kb;
    function U(a, b, c) {
      var d = Na.apply(3, arguments);
      this.severity = a;
      this.category = b;
      this.code = c;
      this.data = d;
      this.handled = false;
      this.message = "Shaka Error " + this.code;
      if (Qb) try {
        throw Error(this.message || "Shaka Error");
      } catch (e) {
        this.stack = e.stack;
      }
    }
    U.prototype.toString = function() {
      return "shaka.util.Error " + JSON.stringify(this, null, "  ");
    };
    S("shaka.util.Error", U);
    var Qb = true;
    U.Severity = { RECOVERABLE: 1, CRITICAL: 2 };
    U.Category = { NETWORK: 1, TEXT: 2, MEDIA: 3, MANIFEST: 4, STREAMING: 5, DRM: 6, PLAYER: 7, CAST: 8, STORAGE: 9, ADS: 10 };
    U.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,
      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,
      STREAMING_NOT_ALLOWED: 3024,
      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,
      DASH_MSE_ENCRYPTED_LEGACY_APPLE_MEDIA_KEYS_NOT_SUPPORTED: 4054,
      CANNOT_ADD_EXTERNAL_CHAPTERS_TO_LIVE_STREAM: 4054,
      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,
      MISSING_EME_SUPPORT: 6020,
      LOAD_INTERRUPTED: 7e3,
      OPERATION_ABORTED: 7001,
      NO_VIDEO_ELEMENT: 7002,
      OBJECT_DESTROYED: 7003,
      CONTENT_NOT_LOADED: 7004,
      SRC_EQUALS_PRELOAD_NOT_SUPPORTED: 7005,
      PRELOAD_DESTROYED: 7006,
      QUEUE_INDEX_OUT_OF_BOUNDS: 7007,
      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: 10007
    };
    function Rb(a) {
      this.h = a;
      this.g = void 0;
    }
    Rb.prototype.value = function() {
      this.g === void 0 && (this.g = this.h());
      return this.g;
    };
    /*
     @license
     Shaka Player
     Copyright 2025 Google LLC
     SPDX-License-Identifier: Apache-2.0
    */
    function Sb() {
      return Tb.value();
    }
    var Ub = null, Vb = null, Tb = new Rb(function() {
      var a = void 0;
      Ub && (a = Ub());
      !a && Vb && (a = Vb());
      return a;
    });
    function Wb() {
    }
    function Xb(a) {
      if (!a) return "";
      a = Lb(a);
      a[0] == 239 && a[1] == 187 && a[2] == 191 && (a = a.subarray(3));
      if (window2.TextDecoder && !Sb().ki()) return a = new TextDecoder().decode(a), a.includes("\uFFFD") && ab('Decoded string contains an "unknown character" codepoint.  That probably means the UTF8 encoding was incorrect!'), a;
      for (var b = "", c = 0; c < a.length; ++c) {
        var d = 65533;
        (a[c] & 128) == 0 ? d = a[c] : a.length >= c + 2 && (a[c] & 224) == 192 && (a[c + 1] & 192) == 128 ? (d = (a[c] & 31) << 6 | a[c + 1] & 63, c += 1) : a.length >= c + 3 && (a[c] & 240) == 224 && (a[c + 1] & 192) == 128 && (a[c + 2] & 192) == 128 ? (d = (a[c] & 15) << 12 | (a[c + 1] & 63) << 6 | a[c + 2] & 63, c += 2) : a.length >= c + 4 && (a[c] & 241) == 240 && (a[c + 1] & 192) == 128 && (a[c + 2] & 192) == 128 && (a[c + 3] & 192) == 128 && (d = (a[c] & 7) << 18 | (a[c + 1] & 63) << 12 | (a[c + 2] & 63) << 6 | a[c + 3] & 63, c += 3);
        if (d <= 65535) b += String.fromCharCode(d);
        else {
          d -= 65536;
          var e = d & 1023;
          b += String.fromCharCode(55296 + (d >> 10));
          b += String.fromCharCode(56320 + e);
        }
      }
      return b;
    }
    function Yb(a, b, c) {
      if (!a) return "";
      if (!c && a.byteLength % 2 != 0) throw new U(2, 2, 2004);
      c = Math.floor(a.byteLength / 2);
      var d = new Uint16Array(c);
      a = Pb(a);
      for (var e = 0; e < c; e++) d[e] = a.getUint16(e * 2, b);
      return Zb(d);
    }
    function $b(a) {
      function b(d) {
        return c.byteLength <= d || c[d] >= 9 && c[d] <= 126;
      }
      if (!a) return "";
      var c = Lb(a);
      if (c[0] == 239 && c[1] == 187 && c[2] == 191) return Xb(c);
      if (c[0] == 254 && c[1] == 255) return Yb(c.subarray(2), false);
      if (c[0] == 255 && c[1] == 254) return Yb(c.subarray(2), true);
      if (c[0] == 0 && c[2] == 0) return Yb(a, false);
      if (c[1] == 0 && c[3] == 0) return Yb(a, true);
      if (b(0) && b(1) && b(2) && b(3)) return Xb(a);
      throw new U(2, 2, 2003);
    }
    function ac(a) {
      if (window2.TextEncoder && !Sb().ki()) {
        var b = new TextEncoder();
        return Mb(b.encode(a));
      }
      a = encodeURIComponent(a);
      a = unescape(a);
      b = new Uint8Array(a.length);
      for (var c = 0; c < a.length; c++) b[c] = a[c].charCodeAt(0);
      return Mb(b);
    }
    function bc(a, b) {
      for (var c = new ArrayBuffer(a.length * 2), d = new DataView(c), e = 0; e < a.length; ++e) d.setUint16(e * 2, a.charCodeAt(e), b);
      return c;
    }
    function Zb(a) {
      return cc.value()(a);
    }
    function dc(a) {
      var b = { "&amp;": "&", "&lt;": "<", "&gt;": ">", "&quot;": '"', "&apos;": "'", "&nbsp;": "\xA0", "&lrm;": "\u200E", "&rlm;": "\u200F" }, c = /&(?:amp|lt|gt|quot|apos|nbsp|lrm|rlm|#[xX]?[0-9a-fA-F]+);/g, d = RegExp(c.source);
      return a && d.test(a) ? a.replace(c, function(e) {
        return e[1] == "#" ? (e = e[2] == "x" || e[2] == "X" ? parseInt(e.substring(3), 16) : parseInt(e.substring(2), 10), e >= 0 && e <= 1114111 ? String.fromCodePoint(e) : "") : b[e] || "'";
      }) : a || "";
    }
    S("shaka.util.StringUtils", Wb);
    Wb.resetFromCharCode = function() {
      cc.g = void 0;
    };
    Wb.toUTF16 = bc;
    Wb.toUTF8 = ac;
    Wb.fromBytesAutoDetect = $b;
    Wb.fromUTF16 = Yb;
    Wb.fromUTF8 = Xb;
    var cc = new Rb(function() {
      function a(c) {
        try {
          var d = new Uint8Array(c);
          return String.fromCharCode.apply(null, d).length > 0;
        } catch (e) {
          return false;
        }
      }
      for (var b = { Uc: 65536 }; b.Uc > 0; b = { Uc: b.Uc }, b.Uc /= 2) if (a(b.Uc)) return /* @__PURE__ */ function(c) {
        return function(d) {
          for (var e = "", f = 0; f < d.length; f += c.Uc) e += String.fromCharCode.apply(null, d.subarray(f, f + c.Uc));
          return e;
        };
      }(b);
      return null;
    });
    function ec() {
    }
    function hc(a) {
      a = Zb(Lb(a));
      return btoa(a);
    }
    function ic(a, b) {
      b = b == void 0 ? true : b;
      a = hc(a).replace(/\+/g, "-").replace(/\//g, "_");
      return b ? a : a.replace(/[=]*$/, "");
    }
    function jc(a) {
      a = window2.atob(a.replace(/-/g, "+").replace(/_/g, "/"));
      for (var b = new Uint8Array(a.length), c = 0; c < a.length; ++c) b[c] = a.charCodeAt(c);
      return b;
    }
    function kc(a) {
      for (var b = a.length / 2, c = new Uint8Array(b), d = 0; d < b; d++) c[d] = window2.parseInt(a.substr(d * 2, 2), 16);
      return c;
    }
    function lc(a) {
      var b = Lb(a);
      a = "";
      b = t(b);
      for (var c = b.next(); !c.done; c = b.next()) c = c.value, c = c.toString(16), c.length == 1 && (c = "0" + c), a += c;
      return a;
    }
    function mc() {
      for (var a = Na.apply(0, arguments), b = 0, c = 0; c < a.length; ++c) b += a[c].byteLength;
      b = new Uint8Array(b);
      for (var d = c = 0; d < a.length; ++d) {
        var e = a[d];
        ArrayBuffer.isView(e) && e.BYTES_PER_ELEMENT === 1 ? b.set(e, c) : b.set(Lb(e), c);
        c += e.byteLength;
      }
      return b;
    }
    S("shaka.util.Uint8ArrayUtils", ec);
    ec.concat = mc;
    ec.toHex = lc;
    ec.fromHex = kc;
    ec.fromBase64 = jc;
    ec.toBase64 = ic;
    ec.toStandardBase64 = hc;
    function nc(a, b, c) {
      c = c === void 0 ? "" : c;
      if (b.length == 0) return a;
      if (a.length == 1 && b.length == 1) {
        var d = new rb(a[0]);
        b = new rb(b[0]);
        b = d.resolve(b);
        c && wb(b, c);
        return [b.toString()];
      }
      b = b.map(function(h) {
        return new rb(h);
      });
      d = [];
      a = t(a);
      for (var e = a.next(); !e.done; e = a.next()) {
        e = new rb(e.value);
        for (var f = t(b), g = f.next(); !g.done; g = f.next()) g = e.resolve(g.value), c && wb(g, c), d.push(g.toString());
      }
      return d;
    }
    function oc(a, b, c, d) {
      a = { keySystem: a, encryptionScheme: b, licenseServerUri: "", distinctiveIdentifierRequired: false, persistentStateRequired: false, audioRobustness: "", videoRobustness: "", serverCertificate: null, serverCertificateUri: "", sessionType: "", initData: c || [], keyIds: /* @__PURE__ */ new Set() };
      d && (a.keySystemUris = /* @__PURE__ */ new Set([d]));
      return a;
    }
    function pc(a, b) {
      b = b === void 0 ? "cenc" : b;
      var c = [], d = [], e = [];
      a.forEach(function(g, h) {
        var k2 = h;
        k2.length != 22 && (k2 = ic(kc(h), false));
        var l = g;
        l.length != 22 && (l = ic(kc(g), false));
        g = { kty: "oct", kid: k2, k: l };
        c.push(g);
        d.push(g.kid);
        e.push(h);
      });
      a = JSON.stringify({ keys: c });
      var f = JSON.stringify({ kids: d });
      f = [{ initData: Lb(ac(f)), initDataType: "keyids" }];
      return {
        keySystem: "org.w3.clearkey",
        encryptionScheme: b,
        licenseServerUri: "data:application/json;base64," + window2.btoa(a),
        distinctiveIdentifierRequired: false,
        persistentStateRequired: false,
        audioRobustness: "",
        videoRobustness: "",
        serverCertificate: null,
        serverCertificateUri: "",
        sessionType: "",
        initData: f,
        keyIds: new Set(e)
      };
    }
    function qc(a, b) {
      if (b.length == 1) return b[0];
      a = rc(a, b);
      if (a != null) return a;
      throw new U(2, 4, 4025, b);
    }
    function rc(a, b) {
      var c = sc.get(a);
      c = t(c);
      for (var d = c.next(); !d.done; d = c.next()) {
        d = d.value;
        for (var e = t(b), f = e.next(); !f.done; f = e.next()) if (f = f.value, d.test(f.trim())) return f.trim();
      }
      return a == tc ? "" : null;
    }
    function uc(a, b) {
      var c = [];
      a = sc.get(a);
      a = t(a);
      for (var d = a.next(); !d.done; d = a.next()) {
        d = d.value;
        for (var e = t(b), f = e.next(); !f.done; f = e.next()) f = f.value, d.test(f.trim()) && c.push(f.trim());
      }
      return c;
    }
    var tc = "text", vc = { Ja: "video", na: "audio", ab: tc, yg: "image", Em: "application" }, wc = 1 / 15, sc = (/* @__PURE__ */ new Map()).set("audio", [/^vorbis$/, /^Opus$/, /^opus$/, /^fLaC$/, /^flac$/, /^mp4a/, /^[ae]c-3$/, /^ac-4/, /^dts[cex]$/, /^iamf/, /^mhm[12]/, /^ac3$/, /^eac3$/, /^apac$/]).set("video", [/^avc/, /^hev/, /^hvc/, /^vvc/, /^vvi/, /^vp0?[89]/, /^av01/, /^dvh/, /^dva/, /^dav/]).set("text", [/^vtt$/, /^wvtt/, /^stpp/]);
    function xc() {
    }
    function yc(a, b) {
      a = zc(a);
      b = zc(b);
      return a.split("-")[0] == b.split("-")[0];
    }
    function Ac(a, b) {
      a = zc(a);
      b = zc(b);
      a = a.split("-");
      b = b.split("-");
      return a[0] == b[0] && a.length == 1 && b.length == 2;
    }
    function Bc(a, b) {
      a = zc(a);
      b = zc(b);
      a = a.split("-");
      b = b.split("-");
      return a.length == 2 && b.length == 2 && a[0] == b[0];
    }
    function zc(a) {
      a = t(a.split("-x-"));
      var b = a.next().value;
      b = b === void 0 ? "" : b;
      a = a.next().value;
      a = a === void 0 ? "" : a;
      var c = t(b.split("-"));
      b = c.next().value;
      b = b === void 0 ? "" : b;
      c = c.next().value;
      c = c === void 0 ? "" : c;
      a = a ? "x-" + a : "";
      b = b.toLowerCase();
      b = Cc.get(b) || b;
      c = c.toUpperCase();
      return (c ? b + "-" + c : b) + (a ? "-" + a : "");
    }
    function Dc(a, b) {
      var c = Ec(a), d = Ec(b);
      return a != c && b != d && c == d;
    }
    function Fc(a, b) {
      a = zc(a);
      b = zc(b);
      return b == a ? 4 : Ac(b, a) ? 3 : Bc(b, a) ? 2 : Ac(a, b) ? 1 : 0;
    }
    function Ec(a) {
      var b = a.indexOf("-");
      a = b >= 0 ? a.substring(0, b) : a;
      a = a.toLowerCase();
      return a = Cc.get(a) || a;
    }
    function Gc(a) {
      return a.language ? zc(a.language) : a.audio && a.audio.language ? zc(a.audio.language) : a.video && a.video.language ? zc(a.video.language) : "und";
    }
    function Hc(a, b) {
      a = zc(a);
      var c = /* @__PURE__ */ new Set();
      b = t(b);
      for (var d = b.next(); !d.done; d = b.next()) c.add(zc(d.value));
      b = t(c);
      for (d = b.next(); !d.done; d = b.next()) if (d = d.value, d == a) return d;
      b = t(c);
      for (d = b.next(); !d.done; d = b.next()) if (d = d.value, Ac(d, a)) return d;
      b = t(c);
      for (d = b.next(); !d.done; d = b.next()) if (d = d.value, Bc(d, a)) return d;
      c = t(c);
      for (b = c.next(); !b.done; b = c.next()) if (b = b.value, Ac(a, b)) return b;
      return null;
    }
    S("shaka.util.LanguageUtils", xc);
    xc.findClosestLocale = Hc;
    xc.getLocaleForVariant = Gc;
    xc.getLocaleForText = function(a) {
      return zc(a.language || "und");
    };
    xc.getBase = Ec;
    xc.relatedness = Fc;
    xc.areSiblings = Dc;
    xc.normalize = zc;
    xc.isSiblingOf = Bc;
    xc.isParentOf = Ac;
    xc.areLanguageCompatible = yc;
    xc.areLocaleCompatible = function(a, b) {
      a = zc(a);
      b = zc(b);
      return a == b;
    };
    var Cc = /* @__PURE__ */ new Map([["aar", "aa"], ["abk", "ab"], ["afr", "af"], ["aka", "ak"], ["alb", "sq"], ["amh", "am"], ["ara", "ar"], ["arg", "an"], ["arm", "hy"], ["asm", "as"], ["ava", "av"], ["ave", "ae"], ["aym", "ay"], ["aze", "az"], ["bak", "ba"], ["bam", "bm"], ["baq", "eu"], ["bel", "be"], ["ben", "bn"], ["bih", "bh"], ["bis", "bi"], ["bod", "bo"], ["bos", "bs"], ["bre", "br"], ["bul", "bg"], ["bur", "my"], ["cat", "ca"], ["ces", "cs"], ["cha", "ch"], ["che", "ce"], ["chi", "zh"], ["chu", "cu"], ["chv", "cv"], ["cor", "kw"], ["cos", "co"], ["cre", "cr"], ["cym", "cy"], [
      "cze",
      "cs"
    ], ["dan", "da"], ["deu", "de"], ["div", "dv"], ["dut", "nl"], ["dzo", "dz"], ["ell", "el"], ["eng", "en"], ["epo", "eo"], ["est", "et"], ["eus", "eu"], ["ewe", "ee"], ["fao", "fo"], ["fas", "fa"], ["fij", "fj"], ["fin", "fi"], ["fra", "fr"], ["fre", "fr"], ["fry", "fy"], ["ful", "ff"], ["geo", "ka"], ["ger", "de"], ["gla", "gd"], ["gle", "ga"], ["glg", "gl"], ["glv", "gv"], ["gre", "el"], ["grn", "gn"], ["guj", "gu"], ["hat", "ht"], ["hau", "ha"], ["heb", "he"], ["her", "hz"], ["hin", "hi"], ["hmo", "ho"], ["hrv", "hr"], ["hun", "hu"], ["hye", "hy"], ["ibo", "ig"], [
      "ice",
      "is"
    ], ["ido", "io"], ["iii", "ii"], ["iku", "iu"], ["ile", "ie"], ["ina", "ia"], ["ind", "id"], ["ipk", "ik"], ["isl", "is"], ["ita", "it"], ["jav", "jv"], ["jpn", "ja"], ["kal", "kl"], ["kan", "kn"], ["kas", "ks"], ["kat", "ka"], ["kau", "kr"], ["kaz", "kk"], ["khm", "km"], ["kik", "ki"], ["kin", "rw"], ["kir", "ky"], ["kom", "kv"], ["kon", "kg"], ["kor", "ko"], ["kua", "kj"], ["kur", "ku"], ["lao", "lo"], ["lat", "la"], ["lav", "lv"], ["lim", "li"], ["lin", "ln"], ["lit", "lt"], ["ltz", "lb"], ["lub", "lu"], ["lug", "lg"], ["mac", "mk"], ["mah", "mh"], ["mal", "ml"], [
      "mao",
      "mi"
    ], ["mar", "mr"], ["may", "ms"], ["mkd", "mk"], ["mlg", "mg"], ["mlt", "mt"], ["mon", "mn"], ["mri", "mi"], ["msa", "ms"], ["mya", "my"], ["nau", "na"], ["nav", "nv"], ["nbl", "nr"], ["nde", "nd"], ["ndo", "ng"], ["nep", "ne"], ["nld", "nl"], ["nno", "nn"], ["nob", "nb"], ["nor", "no"], ["nya", "ny"], ["oci", "oc"], ["oji", "oj"], ["ori", "or"], ["orm", "om"], ["oss", "os"], ["pan", "pa"], ["per", "fa"], ["pli", "pi"], ["pol", "pl"], ["por", "pt"], ["pus", "ps"], ["que", "qu"], ["roh", "rm"], ["ron", "ro"], ["rum", "ro"], ["run", "rn"], ["rus", "ru"], ["sag", "sg"], [
      "san",
      "sa"
    ], ["sin", "si"], ["slk", "sk"], ["slo", "sk"], ["slv", "sl"], ["sme", "se"], ["smo", "sm"], ["sna", "sn"], ["snd", "sd"], ["som", "so"], ["sot", "st"], ["spa", "es"], ["sqi", "sq"], ["srd", "sc"], ["srp", "sr"], ["ssw", "ss"], ["sun", "su"], ["swa", "sw"], ["swe", "sv"], ["tah", "ty"], ["tam", "ta"], ["tat", "tt"], ["tel", "te"], ["tgk", "tg"], ["tgl", "tl"], ["tha", "th"], ["tib", "bo"], ["tir", "ti"], ["ton", "to"], ["tsn", "tn"], ["tso", "ts"], ["tuk", "tk"], ["tur", "tr"], ["twi", "tw"], ["uig", "ug"], ["ukr", "uk"], ["urd", "ur"], ["uzb", "uz"], ["ven", "ve"], [
      "vie",
      "vi"
    ], ["vol", "vo"], ["wel", "cy"], ["wln", "wa"], ["wol", "wo"], ["xho", "xh"], ["yid", "yi"], ["yor", "yo"], ["zha", "za"], ["zho", "zh"], ["zul", "zu"]]);
    function Ic(a) {
      lb.call(this);
      this.j = zc(a);
      this.i = /* @__PURE__ */ new Map();
      this.g = /* @__PURE__ */ new Set();
      this.h = /* @__PURE__ */ new Map();
    }
    ma(Ic, lb);
    p = Ic.prototype;
    p.release = function() {
      lb.prototype.release.call(this);
    };
    p.Li = function(a) {
      var b = this;
      this.g.clear();
      a = t(a);
      for (var c = a.next(); !c.done; c = a.next()) this.g.add(zc(c.value));
      Jc(this);
      a = pb(this.g, function(d) {
        return !b.h.has(d);
      });
      a.length && this.dispatchEvent(new T("unknown-locales", (/* @__PURE__ */ new Map()).set("locales", a)));
      a = pb(this.g, function(d) {
        return b.h.has(d);
      });
      a = (/* @__PURE__ */ new Map()).set("locales", a.length ? a : [this.j]);
      this.dispatchEvent(new T("locale-changed", a));
    };
    p.Wa = function(a, b, c) {
      a = zc(a);
      c === void 0 && (c = Kc);
      var d = this.h.get(a) || /* @__PURE__ */ new Map();
      b.forEach(function(e, f) {
        d.has(f) && c != Kc || d.set(f, e);
      });
      this.h.set(a, d);
      Jc(this);
      this.dispatchEvent(new T("locale-updated"));
      return this;
    };
    p.hm = function(a) {
      for (var b = t(a.keys()), c = b.next(); !c.done; c = b.next()) c = c.value, a.set(c, this.resolve(c));
    };
    p.resolve = function(a) {
      var b = this.i.get(a);
      if (b) return b;
      a = (/* @__PURE__ */ new Map()).set("locales", Array.from(this.g)).set("missing", a);
      this.dispatchEvent(new T("unknown-localization", a));
      return "";
    };
    p.Kk = function() {
      return this.g;
    };
    function Jc(a) {
      for (var b = a.h, c = a.j, d = a.g, e = /* @__PURE__ */ new Set(), f = t(d), g = f.next(), h = {}; !g.done; h = { ve: void 0 }, g = f.next()) {
        h.ve = g.value;
        e.add(h.ve);
        e.add(Ec(h.ve));
        g = pb(b.keys(), /* @__PURE__ */ function(l) {
          return function(m) {
            return Dc(m, l.ve);
          };
        }(h));
        g.sort();
        g = t(g);
        for (var k2 = g.next(); !k2.done; k2 = g.next()) e.add(k2.value);
        h = pb(b.keys(), /* @__PURE__ */ function(l) {
          return function(m) {
            return Ec(m) == l.ve;
          };
        }(h));
        h.sort();
        h = t(h);
        for (g = h.next(); !g.done; g = h.next()) e.add(g.value);
      }
      e.add(c);
      c = [];
      e = t(e);
      for (f = e.next(); !f.done; f = e.next()) (f = b.get(f.value)) && c.push(f);
      c.reverse();
      a.i.clear();
      b = t(c);
      for (e = b.next(); !e.done; e = b.next()) e.value.forEach(function(l, m) {
        a.i.set(m, l);
      });
      b = a.i.keys();
      e = /* @__PURE__ */ new Set();
      c = t(a.g);
      for (f = c.next(); !f.done; f = c.next()) f = a.h.get(f.value) || /* @__PURE__ */ new Map(), Mc(f, b, e);
      e.size > 0 && (d = (/* @__PURE__ */ new Map()).set("locales", Array.from(d)).set("missing", Array.from(e)), a.dispatchEvent(new T("missing-localizations", d)));
    }
    function Mc(a, b, c) {
      b = t(b);
      for (var d = b.next(); !d.done; d = b.next()) d = d.value, a.get(d) || c.add(d);
    }
    S("shaka.ui.Localization", Ic);
    Ic.prototype.getCurrentLocales = Ic.prototype.Kk;
    Ic.prototype.resolve = Ic.prototype.resolve;
    Ic.prototype.resolveDictionary = Ic.prototype.hm;
    Ic.prototype.insert = Ic.prototype.Wa;
    Ic.prototype.changeLocale = Ic.prototype.Li;
    Ic.prototype.release = Ic.prototype.release;
    var Kc = 1;
    Ic.ConflictResolution = { USE_OLD: 0, USE_NEW: Kc };
    Ic.UNKNOWN_LOCALES = "unknown-locales";
    Ic.UNKNOWN_LOCALIZATION = "unknown-localization";
    Ic.MISSING_LOCALIZATIONS = "missing-localizations";
    Ic.LOCALE_CHANGED = "locale-changed";
    Ic.LOCALE_UPDATED = "locale-updated";
    function Nc(a) {
      this.g = Math.exp(Math.log(0.5) / a);
      this.i = this.h = 0;
    }
    Nc.prototype.sample = function(a, b) {
      var c = Math.pow(this.g, a);
      b = b * (1 - c) + c * this.h;
      isNaN(b) || (this.h = b, this.i += a);
    };
    function Oc(a) {
      return a.h / (1 - Math.pow(a.g, a.i));
    }
    ;
    function Pc() {
      this.h = new Nc(2);
      this.j = new Nc(5);
      this.g = 0;
      this.i = 128e3;
      this.l = 16e3;
    }
    Pc.prototype.configure = function(a) {
      this.i = a.minTotalBytes;
      this.l = a.minBytes;
      this.h.g = Math.exp(Math.log(0.5) / a.fastHalfLife);
      this.j.g = Math.exp(Math.log(0.5) / a.slowHalfLife);
    };
    Pc.prototype.sample = function(a, b) {
      if (!(b < this.l)) {
        var c = 8e3 * b / a;
        a /= 1e3;
        this.g += b;
        this.h.sample(a, c);
        this.j.sample(a, c);
      }
    };
    Pc.prototype.getBandwidthEstimate = function(a) {
      return this.g < this.i ? a : Math.min(Oc(this.h), Oc(this.j));
    };
    function Qc() {
      this.g = new kb();
    }
    p = Qc.prototype;
    p.release = function() {
      this.Ta();
      this.g = null;
    };
    p.o = function(a, b, c, d) {
      this.g && (a = new Rc(a, b, c, d), this.g.push(b, a));
    };
    p.qa = function(a, b, c, d) {
      function e(g) {
        f.Ea(a, b, e);
        c(g);
      }
      var f = this;
      this.o(a, b, e, d);
    };
    p.Ea = function(a, b, c) {
      if (this.g) {
        var d = this.g.get(b) || [];
        d = t(d);
        for (var e = d.next(); !e.done; e = d.next()) e = e.value, e.target != a || c != e.listener && c || (e.Ea(), this.g.remove(b, e));
      }
    };
    p.Ta = function() {
      if (this.g) {
        for (var a = [], b = t(this.g.g.values()), c = b.next(); !c.done; c = b.next()) a.push.apply(a, x(c.value));
        a = t(a);
        for (b = a.next(); !b.done; b = a.next()) b.value.Ea();
        this.g.g.clear();
      }
    };
    S("shaka.util.EventManager", Qc);
    Qc.prototype.removeAll = Qc.prototype.Ta;
    Qc.prototype.unlisten = Qc.prototype.Ea;
    Qc.prototype.listenOnce = Qc.prototype.qa;
    Qc.prototype.listen = Qc.prototype.o;
    Qc.prototype.release = Qc.prototype.release;
    function Rc(a, b, c, d) {
      this.target = a;
      this.type = b;
      this.listener = c;
      this.g = Sc(a, d);
      this.target.addEventListener(b, c, this.g);
    }
    Rc.prototype.Ea = function() {
      this.target.removeEventListener(this.type, this.listener, this.g);
      this.listener = this.target = null;
      this.g = false;
    };
    function Sc(a, b) {
      if (b == void 0) return false;
      if (typeof b == "boolean") return b;
      var c = /* @__PURE__ */ new Set(["passive", "capture"]);
      Object.keys(b).filter(function(d) {
        return !c.has(d);
      });
      return Tc(a) ? b : b.capture || false;
    }
    function Tc(a) {
      var b = Uc;
      if (b == void 0) {
        b = false;
        try {
          var c = {}, d = { get: function() {
            b = true;
            return false;
          } };
          Object.defineProperty(c, "passive", d);
          Object.defineProperty(c, "capture", d);
          d = function() {
          };
          a.addEventListener("test", d, c);
          a.removeEventListener("test", d, c);
        } catch (e) {
          b = false;
        }
        Uc = b;
      }
      return b || false;
    }
    var Uc = void 0;
    S("shaka.config.AutoShowText", { NEVER: 0, ALWAYS: 1, IF_PREFERRED_TEXT_LANGUAGE: 2, IF_SUBTITLES_MAY_BE_NEEDED: 3 });
    function Vc(a, b) {
      this.g = a;
      this.h = b;
    }
    Vc.prototype.toString = function() {
      return "v" + this.g + "." + this.h;
    };
    function Wc(a, b) {
      var c = new Vc(5, 0), d = Xc, e = d.g, f = c.h - e.h;
      ((c.g - e.g || f) > 0 ? d.i : d.h)(d.g, c, a, b);
    }
    function Yc(a, b, c, d) {
      bb([c, "has been deprecated and will be removed in", b, ". We are currently at version", a, ". Additional information:", d].join(" "));
    }
    function Zc(a, b, c, d) {
      ab([c, "has been deprecated and has been removed in", b, ". We are now at version", a, ". Additional information:", d].join(" "));
    }
    var Xc = null;
    function $c(a, b, c, d) {
      this.g = null;
      this.l = a;
      this.i = b;
      this.m = c;
      this.u = d;
      this.j = false;
      a: {
        typeof libDPIModule === "undefined" && bb("Could not find LCEVC Library dependencies on this page");
        if (typeof LCEVCdec !== "undefined") this.h = LCEVCdec;
        else if (typeof LcevcDil !== "undefined") this.h = LcevcDil, this.j = true, Wc("LcevcDil", "lcevc_dil.js is deprecated, please use lcevc_dec.js instead");
        else {
          bb("Could not find LCEVC Library on this page");
          a = false;
          break a;
        }
        typeof this.h.SupportObject === "undefined" ? (bb("Could not find LCEVC Library on this page"), a = false) : (this.h.SupportObject.SupportStatus || bb(this.h.SupportObject.SupportError), a = typeof this.h !== "undefined" && typeof libDPIModule !== "undefined" && this.i instanceof HTMLCanvasElement && this.h.SupportObject.SupportStatus);
      }
      a && !this.g && this.h.SupportObject.webGLSupport(this.i) && (this.i.classList.remove("shaka-hidden"), this.g = this.j ? new this.h.LcevcDil(this.l, this.i, this.m) : new this.h.LCEVCdec(this.l, this.i, this.m));
    }
    function ad(a, b, c, d) {
      d.type !== "video" || a.u && !d.baseOriginalId || a.g && a.g.appendBuffer(b, "video", d.id, -c, !a.u);
    }
    function bd(a) {
      a.g && a.i.classList.add("shaka-hidden");
    }
    $c.prototype.release = function() {
      this.g && (this.g.close(), this.g = null);
    };
    function cd(a) {
      return a && typeof LCEVCdec !== "undefined" ? a.codecs == "lvc1" : false;
    }
    S("shaka.lcevc.Dec", $c);
    $c.prototype.release = $c.prototype.release;
    function dd(a) {
      if (ed.has(a)) return ed.get(a);
      var b = window2.ManagedMediaSource || window2.MediaSource;
      return b ? (b = b.isTypeSupported(a), ed.set(a, b), b) : false;
    }
    function fd() {
      var a = window2.ManagedSourceBuffer || window2.SourceBuffer;
      return !!a && !!a.prototype && !!a.prototype.changeType;
    }
    function hd() {
      var a = window2.ManagedMediaSource || window2.MediaSource;
      return a && a.prototype ? !!a.prototype.setLiveSeekableRange && !!a.prototype.clearLiveSeekableRange : false;
    }
    var ed = /* @__PURE__ */ new Map();
    function id() {
    }
    id.prototype.extract = function() {
    };
    id.prototype.decode = function() {
      return [];
    };
    id.prototype.clear = function() {
    };
    id.prototype.getStreams = function() {
      return [];
    };
    function jd() {
    }
    jd.prototype.init = function() {
    };
    jd.prototype.parse = function() {
      return [];
    };
    function kd() {
    }
    p = kd.prototype;
    p.init = function() {
    };
    p.Tf = function() {
    };
    p.$d = function() {
    };
    p.remove = function() {
    };
    p.zg = function() {
    };
    S("shaka.media.IClosedCaptionParser", kd);
    function ld(a) {
      this.h = /* @__PURE__ */ new Map();
      this.i = 0;
      this.j = new jd();
      if (a = md(a.toLowerCase())) this.j = a();
      this.g = new id();
      if (a = nd) this.g = a(), this.h.set(this.i, this.g);
    }
    p = ld.prototype;
    p.init = function(a, b, c) {
      b = b === void 0 ? false : b;
      c = c === void 0 ? -1 : c;
      if (c != -1 && this.i != c) {
        b = c;
        var d = this.h.get(b);
        this.h.set(this.i, this.g);
        if (d) this.g = d;
        else {
          if (d = nd) this.g = d();
          this.h.set(b, this.g);
        }
      } else b || this.$d();
      this.j.init(a);
      c != -1 && (this.i = c);
    };
    p.Tf = function(a) {
      a = this.j.parse(a);
      a = t(a);
      for (var b = a.next(); !b.done; b = a.next()) {
        b = b.value;
        var c = Lb(b.packet);
        c.length > 0 && this.g.extract(c, b.pts);
      }
      return this.g.decode();
    };
    p.$d = function() {
      this.g.clear();
    };
    p.remove = function(a) {
      a = a === void 0 ? [] : a;
      a = new Set(a);
      for (var b = t(this.h.keys()), c = b.next(); !c.done; c = b.next()) if (c = c.value, !a.has(c)) {
        var d = this.h.get(c);
        d && d.clear();
        this.h.delete(c);
      }
    };
    p.zg = function() {
      return this.g.getStreams();
    };
    function od(a, b) {
      pd.set(a, b);
    }
    function md(a) {
      return pd.get(a);
    }
    S("shaka.media.ClosedCaptionParser", ld);
    ld.findDecoder = function() {
      return nd;
    };
    ld.unregisterDecoder = function() {
      nd = null;
    };
    ld.registerDecoder = function(a) {
      nd = a;
    };
    ld.findParser = md;
    ld.unregisterParser = function(a) {
      pd.delete(a);
    };
    ld.registerParser = od;
    var pd = /* @__PURE__ */ new Map(), nd = null;
    function qd() {
      this.id = "";
      this.regionAnchorY = this.regionAnchorX = this.viewportAnchorY = this.viewportAnchorX = 0;
      this.height = this.width = 100;
      this.viewportAnchorUnits = this.widthUnits = this.heightUnits = rd;
      this.scroll = sd;
    }
    S("shaka.text.CueRegion", qd);
    var rd = 1;
    qd.units = { PX: 0, PERCENTAGE: rd, LINES: 2 };
    var sd = "";
    qd.scrollMode = { NONE: sd, UP: "up" };
    function td(a, b) {
      return typeof a === "number" && typeof b === "number" && isNaN(a) && isNaN(b) ? true : a === b;
    }
    function ud(a, b) {
      b = a.indexOf(b);
      b > -1 && a.splice(b, 1);
    }
    function vd(a, b, c) {
      c || (c = td);
      if (a.length != b.length) return false;
      b = b.slice();
      a = t(a);
      for (var d = a.next(), e = {}; !d.done; e = { gj: void 0 }, d = a.next()) {
        e.gj = d.value;
        d = b.findIndex(/* @__PURE__ */ function(f) {
          return function(g) {
            return c(f.gj, g);
          };
        }(e));
        if (d == -1) return false;
        b[d] = b[b.length - 1];
        b.pop();
      }
      return b.length == 0;
    }
    function wd(a, b, c) {
      if (a === b) return true;
      if (!a || !b) return a == b;
      c || (c = td);
      if (a.length != b.length) return false;
      for (var d = 0; d < a.length; d++) if (!c(a[d], b[d])) return false;
      return true;
    }
    ;
    function xd(a) {
      this.h = a || "";
      this.g = 0;
    }
    function yd(a) {
      zd(a, /[ \t]+/gm);
    }
    function zd(a, b) {
      b.lastIndex = a.g;
      b = b.exec(a.h);
      b = b == null ? null : { position: b.index, length: b[0].length, results: b };
      if (a.g == a.h.length || b == null || b.position != a.g) return null;
      a.g += b.length;
      return b.results;
    }
    function Bd(a) {
      return a.g == a.h.length ? null : (a = zd(a, /[^ \t\n]*/gm)) ? a[0] : null;
    }
    function Dd(a) {
      a = zd(a, Ed);
      if (a == null) return null;
      var b = Number(a[2]), c = Number(a[3]);
      return b > 59 || c > 59 ? null : (Number(a[6]) || 0) / 1e3 + c + b * 60 + (Number(a[1]) || 0) * 3600;
    }
    function Fd(a) {
      return a ? Dd(new xd(a)) : null;
    }
    var Ed = /(?:(\d{1,}):)?(\d{2}):(\d{2})((\.(\d{1,3})))?/g;
    function Gd() {
    }
    function Hd(a) {
      function b(d) {
        switch (typeof d) {
          case "undefined":
          case "boolean":
          case "number":
          case "string":
          case "symbol":
          case "function":
            return d;
          default:
            if (!d || ArrayBuffer.isView(d)) return d;
            if (c.has(d)) return null;
            var e = Array.isArray(d);
            if (d.constructor != Object && !e) return null;
            c.add(d);
            var f = e ? [] : {}, g;
            for (g in d) f[g] = b(d[g]);
            e && (f.length = d.length);
            return f;
        }
      }
      var c = /* @__PURE__ */ new WeakSet();
      return b(a);
    }
    function Id(a) {
      var b = {}, c;
      for (c in a) b[c] = a[c];
      return b;
    }
    function Jd(a) {
      if (Array.isArray(a)) {
        for (var b = [], c = 0; c < a.length; c++) {
          var d = c.toString(), e = a[c];
          e !== void 0 && (e = Jd(e)) && b.push(d + ":" + e);
        }
        a = "[" + b.join(",") + "]";
      } else if (typeof a == "function") a = "";
      else if (a instanceof Object) {
        c = Object.keys(a);
        c.sort();
        b = [];
        c = t(c);
        for (d = c.next(); !d.done; d = c.next()) e = d.value, d = JSON.stringify(e), e = a[e], e !== void 0 && (e = Jd(e)) && b.push(d + ":" + e);
        a = "{" + b.join(",") + "}";
      } else a = JSON.stringify(a);
      return a;
    }
    S("shaka.util.ObjectUtils", Gd);
    Gd.alphabeticalKeyOrderStringify = Jd;
    Gd.shallowCloneObject = Id;
    Gd.cloneObject = Hd;
    /*
     @license
     tXml
     Copyright 2015 Tobias Nickel
     SPDX-License-Identifier: MIT
    */
    function Kd(a, b) {
      var c = c === void 0 ? false : c;
      a = $b(a);
      return Ld(a, b, c);
    }
    function Ld(a, b, c) {
      a = Md(a, c === void 0 ? false : c);
      return !b && a.length ? a[0] : (a = a.find(function(d) {
        return b.split(",").includes(d.tagName);
      })) ? a : null;
    }
    function Nd(a) {
      return Od.has(a) ? Od.get(a) : "";
    }
    function Md(a, b) {
      function c(f, g) {
        g = g === void 0 ? false : g;
        for (var h = []; a[e]; ) if (a.charCodeAt(e) == 60) {
          if (a.charCodeAt(e + 1) === 47) {
            g = e + 2;
            e = a.indexOf(">", e);
            g = a.substring(g, e);
            var k2 = g.indexOf(f);
            if (k2 == -1) {
              var l = f.indexOf(".");
              l > 0 && (k2 = g.indexOf(f.substring(0, l)));
            }
            if (k2 == -1) throw f = a.substring(0, e).split("\n"), Error("Unexpected close tag\nLine: " + (f.length - 1) + "\nColumn: " + (f[f.length - 1].length + 1) + "\nChar: " + a[e]);
            e + 1 && (e += 1);
            break;
          } else if (a.charCodeAt(e + 1) === 33) {
            if (a.charCodeAt(e + 2) == 45) {
              for (; e !== -1 && (a.charCodeAt(e) !== 62 || a.charCodeAt(e - 1) != 45 || a.charCodeAt(e - 2) != 45 || e == -1); ) e = a.indexOf(">", e + 1);
              e === -1 && (e = a.length);
            } else if (a.charCodeAt(e + 2) === 91 && a.charCodeAt(e + 8) === 91 && a.substr(e + 3, 5).toLowerCase() === "cdata") {
              k2 = a.indexOf("]]>", e);
              k2 == -1 ? (h.push(a.substr(e + 9)), e = a.length) : (h.push(a.substring(e + 9, k2)), e = k2 + 3);
              continue;
            }
            e++;
            continue;
          }
          a: {
            l = g;
            e++;
            var m = d(), n = {};
            for (k2 = []; a.charCodeAt(e) !== 62 && a[e]; ) {
              var q = a.charCodeAt(e);
              if (q > 64 && q < 91 || q > 96 && q < 123) {
                q = d();
                for (var r = a.charCodeAt(e); r && r !== 39 && r !== 34 && !(r > 64 && r < 91 || r > 96 && r < 123) && r !== 62; ) e++, r = a.charCodeAt(e);
                var u = e + 1;
                e = a.indexOf(a[e], u);
                u = a.slice(u, e);
                if (r === 39 || r === 34) {
                  if (e === -1) {
                    l = { tagName: m, attributes: n, children: k2, parent: null };
                    if (b) for (m = 0; m < k2.length; m++) typeof k2[m] !== "string" && (k2[m].parent = l);
                    k2 = l;
                    break a;
                  }
                } else u = null, e--;
                if (q.startsWith("xmlns:")) {
                  r = u;
                  var w = q.split(":")[1];
                  Od.set(r, w);
                  Pd.set(w, r);
                }
                m === "tt" && q === "xml:space" && u === "preserve" && (l = true);
                n[q] = u;
              }
              e++;
            }
            a.charCodeAt(e - 1) !== 47 ? (e++, k2 = c(m, l)) : e++;
            l = { tagName: m, attributes: n, children: k2, parent: null };
            m = k2.length;
            for (n = 0; n < m; n++) q = k2[n], typeof q !== "string" ? b && (q.parent = l) : n == m - 1 && q == "\n" && k2.pop();
            k2 = l;
          }
          h.push(k2);
          if (typeof k2 === "string") break;
          k2.tagName[0] === "?" && k2.children && (h.push.apply(h, x(k2.children)), k2.children = []);
        } else k2 = e, e = a.indexOf("<", e) - 1, e === -2 && (e = a.length), k2 = a.slice(k2, e + 1), g ? k2.length > 0 && h.push(k2) : h.length && k2.length == 1 && k2[0] == "\n" ? h.push(k2) : k2.trim().length > 0 && h.push(k2), e++;
        return h;
      }
      function d() {
        for (var f = e; "\r\n	>/= ".indexOf(a[e]) === -1 && a[e]; ) e++;
        return a.slice(f, e);
      }
      var e = 0;
      return c("");
    }
    function Qd(a) {
      return typeof a === "string";
    }
    function Rd(a) {
      var b = [];
      if (!a.children) return [];
      a = t(a.children);
      for (var c = a.next(); !c.done; c = a.next()) c = c.value, typeof c !== "string" && b.push(c);
      return b;
    }
    function Sd(a, b) {
      var c = [];
      if (!a.children) return [];
      a = t(a.children);
      for (var d = a.next(); !d.done; d = a.next()) d = d.value, d.tagName === b && c.push(d);
      return c;
    }
    function Td(a) {
      if (typeof a === "string") return dc(a);
      a = a.children.reduce(function(b, c) {
        return typeof c === "string" ? b + c : b;
      }, "");
      return a === "" ? null : dc(a);
    }
    function Ud(a) {
      if (!Array.from(a.children).every(function(b) {
        return typeof b === "string";
      })) return null;
      (a = Td(a)) && (a = a.trim());
      return a;
    }
    function Vd(a, b, c) {
      c = c === void 0 ? [] : c;
      a.tagName === b && c.push(a);
      if (a.children) {
        a = t(a.children);
        for (var d = a.next(); !d.done; d = a.next()) Vd(d.value, b, c);
      }
      return c;
    }
    function Xd(a, b) {
      a = Sd(a, b);
      return a.length != 1 ? null : a[0];
    }
    function Yd(a, b, c) {
      a = Zd(a, b, c);
      return a.length != 1 ? null : a[0];
    }
    function $d(a, b, c, d) {
      d = d === void 0 ? null : d;
      var e = null;
      a = a.attributes[b];
      a != null && (e = c(a));
      return e == null ? d : e;
    }
    function ae(a, b, c) {
      b = Nd(b);
      return a.attributes[b + ":" + c] || null;
    }
    function Zd(a, b, c) {
      var d = Nd(b);
      b = [];
      if (a.children) for (c = d ? d + ":" + c : c, a = t(a.children), d = a.next(); !d.done; d = a.next()) (d = d.value) && d.tagName === c && b.push(d);
      return b;
    }
    function be(a, b, c) {
      b = t(b);
      for (var d = b.next(); !d.done; d = b.next()) if (d = ae(a, d.value, c)) return d;
      return null;
    }
    function ce(a) {
      if (!a) return null;
      /^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(a) && (a += "Z");
      a = Date.parse(a);
      return isNaN(a) ? null : a / 1e3;
    }
    function de(a) {
      if (!a) return null;
      a = RegExp("^P(?:([0-9]*)Y)?(?:([0-9]*)M)?(?:([0-9]*)D)?(?:T(?:([0-9]*)H)?(?:([0-9]*)M)?(?:([0-9.]*)S)?)?$", "i").exec(a);
      if (!a) return null;
      a = 31536e3 * Number(a[1] || null) + 2592e3 * Number(a[2] || null) + 86400 * Number(a[3] || null) + 3600 * Number(a[4] || null) + 60 * Number(a[5] || null) + Number(a[6] || null);
      return isFinite(a) ? a : null;
    }
    function ee(a) {
      var b = /([0-9]+)-([0-9]+)/.exec(a);
      if (!b) return null;
      a = Number(b[1]);
      if (!isFinite(a)) return null;
      b = Number(b[2]);
      return isFinite(b) ? { start: a, end: b } : null;
    }
    function fe(a) {
      a = Number(a);
      return a % 1 === 0 ? a : null;
    }
    function ge(a) {
      a = Number(a);
      return a % 1 === 0 && a > 0 ? a : null;
    }
    function he(a) {
      a = Number(a);
      return a % 1 === 0 && a >= 0 ? a : null;
    }
    function je(a) {
      a = Number(a);
      return isNaN(a) ? null : a;
    }
    function ke(a) {
      return a ? a.toLowerCase() === "true" : false;
    }
    function le(a) {
      var b;
      var c = (b = a.match(/^(\d+)\/(\d+)$/)) ? Number(b[1]) / Number(b[2]) : Number(a);
      return isNaN(c) ? null : c;
    }
    function me(a) {
      var b = [];
      a = dc(a).split(/\/+(?=(?:[^'"]*['"][^'"]*['"])*[^'"]*$)/);
      a = t(a);
      for (var c = a.next(); !c.done; c = a.next()) {
        c = c.value;
        var d = c.match(/^([\w]+)/);
        if (d) {
          var e = c.match(/(@id='(.*?)')/), f = c.match(/(@t='(\d+)')/), g = c.match(/(@n='(\d+)')/), h = c.match(/\[(\d+)\]/);
          b.push({ name: d[0], id: e ? e[0].match(/'(.*?)'/)[0].replace(/'/gm, "") : null, t: f ? Number(f[0].match(/'(.*?)'/)[0].replace(/'/gm, "")) : null, n: g ? Number(g[0].match(/'(.*?)'/)[0].replace(/'/gm, "")) : null, position: h ? Number(h[1]) - 1 : null, Ic: c.split("/@")[1] || null });
        } else c.startsWith("@") && b.length && (b[b.length - 1].Ic = c.slice(1));
      }
      return b;
    }
    function ne(a, b) {
      var c = me(b.attributes.sel || "");
      if (c.length) {
        var d = c[c.length - 1], e = b.attributes.pos || null;
        c = d.position;
        c == null && (d.t !== null && (c = oe(a, "t", d.t)), d.n !== null && (c = oe(a, "n", d.n)));
        c === null ? c = e === "prepend" ? 0 : a.length : e === "prepend" ? --c : e === "after" && ++c;
        e = b.tagName;
        (d = d.Ic) && a[c] ? pe(a[c], e, d, Ud(b) || "") : (e !== "remove" && e !== "replace" || a.splice(c, 1), e !== "add" && e !== "replace" || a.splice.apply(a, [c, 0].concat(x(b.children))));
      }
    }
    function oe(a, b, c) {
      var d = 0;
      a = t(a);
      for (var e = a.next(); !e.done; e = a.next()) {
        if (Number(e.value.attributes[b]) === c) return d;
        d++;
      }
      return null;
    }
    function pe(a, b, c, d) {
      if (b === "remove") delete a.attributes[c];
      else if (b === "add" || b === "replace") a.attributes[c] = d;
    }
    function qe(a) {
      var b = "", c = a.tagName.split(":");
      c.length > 0 && (b = c[0], b = Pd.has(b) ? Pd.get(b) : "");
      b = document.createElementNS(b, a.tagName);
      for (var d in a.attributes) b.setAttribute(d, a.attributes[d]);
      a = t(a.children);
      for (d = a.next(); !d.done; d = a.next()) d = d.value, c = void 0, typeof d == "string" ? c = new Text(d) : c = qe(d), b.appendChild(c);
      return b;
    }
    function re(a) {
      if (!a) return null;
      var b = { tagName: a.tagName, attributes: Id(a.attributes), children: [], parent: null };
      a = t(a.children);
      for (var c = a.next(); !c.done; c = a.next()) c = c.value, typeof c === "string" ? b.children.push(c) : (c = re(c), c.parent = b, b.children.push(c));
      return b;
    }
    var Od = /* @__PURE__ */ new Map(), Pd = /* @__PURE__ */ new Map();
    function se(a, b, c) {
      this.startTime = a;
      this.endTime = b;
      this.payload = c;
      this.region = new qd();
      this.position = null;
      this.positionAlign = te;
      this.size = 0;
      this.textAlign = ue;
      this.direction = ve;
      this.writingMode = we;
      this.lineInterpretation = xe;
      this.line = null;
      this.lineHeight = "";
      this.lineAlign = ye;
      this.displayAlign = ze;
      this.fontSize = this.border = this.backgroundImage = this.backgroundColor = this.color = "";
      this.fontWeight = Ae;
      this.fontStyle = Be;
      this.linePadding = this.letterSpacing = this.fontFamily = "";
      this.opacity = 1;
      this.textCombineUpright = "";
      this.textDecoration = [];
      this.textStrokeWidth = this.textStrokeColor = this.textShadow = "";
      this.wrapLine = true;
      this.id = "";
      this.nestedCues = [];
      this.lineBreak = this.isContainer = false;
      this.rubyTag = null;
      this.cellResolution = { columns: 32, rows: 15 };
    }
    function Ce(a, b) {
      a = new se(a, b, "");
      a.lineBreak = true;
      return a;
    }
    se.prototype.clone = function() {
      var a = new se(0, 0, ""), b;
      for (b in this) a[b] = this[b], Array.isArray(a[b]) && (a[b] = a[b].slice());
      return a;
    };
    function De(a, b) {
      if (a.payload != b.payload || !(Math.abs(a.startTime - b.startTime) < 1e-3 && Math.abs(a.endTime - b.endTime) < 1e-3)) return false;
      for (var c in a) if (c != "startTime" && c != "endTime" && c != "payload") {
        if (c == "nestedCues") {
          if (!wd(a.nestedCues, b.nestedCues, De)) return false;
        } else if (c == "region" || c == "cellResolution") for (var d in a[c]) {
          if (a[c][d] != b[c][d]) return false;
        }
        else if (Array.isArray(a[c])) {
          if (!wd(a[c], b[c])) return false;
        } else if (a[c] != b[c]) return false;
      }
      return true;
    }
    function Fe(a, b) {
      b = b === void 0 ? /* @__PURE__ */ new Map() : b;
      var c = a.payload;
      if (c.includes("<")) {
        b.size === 0 && Ie(b);
        var d = c;
        c = [];
        for (var e = -1, f = 0; f < d.length; f++) d[f] === "<" ? e = f + 1 : d[f] === ">" && e > 0 && (e = d.substr(e, f - e), e.match(Je) && c.push(e), e = -1);
        c = t(c);
        for (f = c.next(); !f.done; f = c.next()) f = f.value, d = d.replace("<" + f + ">", '<div time="' + f + '">'), d += "</div>";
        a: {
          f = d;
          e = [];
          var g = -1;
          c = "";
          d = false;
          for (var h = 0; h < f.length; h++) if (f[h] === "/") {
            var k2 = f.indexOf(">", h);
            if (k2 === -1) {
              c = f;
              break a;
            }
            if ((k2 = f.substring(h + 1, k2)) && k2 == "v") {
              d = true;
              var l = null;
              e.length && (l = e[e.length - 1]);
              if (l) {
                if (l === k2) c += "/" + k2 + ">";
                else {
                  if (!l.startsWith("v")) {
                    c += f[h];
                    continue;
                  }
                  c += "/" + l + ">";
                }
                h += k2.length + 1;
              } else c += f[h];
            } else c += f[h];
          } else f[h] === "<" ? (g = h + 1, f[g] != "v" && (g = -1)) : f[h] === ">" && g > 0 && (e.push(f.substr(g, h - g)), g = -1), c += f[h];
          f = t(e);
          for (e = f.next(); !e.done; e = f.next()) e = e.value, g = e.replace(" ", ".voice-"), c = c.replace("<" + e + ">", "<" + g + ">"), c = c.replace("</" + e + ">", "</" + g + ">"), d || (c += "</" + g + ">");
        }
        c = Ke(c);
        a.payload = "";
        try {
          var m = Ld("<span>" + c + "</span>", "span");
        } catch (n) {
        }
        if (m) if (m = m.children, m.length != 1 || m[0].tagName) for (m = t(m), c = m.next(); !c.done; c = m.next()) Le(c.value, a, b);
        else a.payload = dc(c);
        else a.payload = dc(c);
      } else a.payload = dc(c);
    }
    function Ie(a) {
      for (var b = t(Object.entries(Me)), c = b.next(); !c.done; c = b.next()) {
        var d = t(c.value);
        c = d.next().value;
        d = d.next().value;
        var e = new se(0, 0, "");
        e.color = d;
        a.set("." + c, e);
      }
      b = t(Object.entries(Ne));
      for (c = b.next(); !c.done; c = b.next()) d = t(c.value), c = d.next().value, d = d.next().value, e = new se(0, 0, ""), e.backgroundColor = d, a.set("." + c, e);
    }
    function Ke(a) {
      var b = { "< ": "", " >": " &gt;" }, c = /(< +>|<\s|\s>)/g, d = RegExp(c.source);
      return a && d.test(a) ? a.replace(c, function(e) {
        return b[e] || "";
      }) : a || "";
    }
    function Le(a, b, c) {
      var d = b.clone();
      d.nestedCues = [];
      d.payload = "";
      d.rubyTag = "";
      d.line = null;
      d.region = new qd();
      d.position = null;
      d.size = 0;
      d.textAlign = ue;
      if (a.tagName) for (var e = t(a.tagName.split(/(?=[ .])+/g)), f = e.next(); !f.done; f = e.next()) {
        var g = f = f.value;
        if (g.startsWith(".voice-")) {
          var h = g.split("-").pop();
          g = 'v[voice="' + h + '"]';
          c.has(g) || (g = "v[voice=" + h + "]");
        }
        c.has(g) && (h = d, g = c.get(g)) && (h.backgroundColor = Oe(g.backgroundColor, h.backgroundColor), h.color = Oe(g.color, h.color), h.fontFamily = Oe(g.fontFamily, h.fontFamily), h.fontSize = Oe(g.fontSize, h.fontSize), h.textShadow = Oe(g.textShadow, h.textShadow), h.fontWeight = g.fontWeight, h.fontStyle = g.fontStyle, h.opacity = g.opacity, h.rubyTag = g.rubyTag, h.textCombineUpright = g.textCombineUpright, h.wrapLine = g.wrapLine);
        switch (f) {
          case "br":
            d = Ce(d.startTime, d.endTime);
            b.nestedCues.push(d);
            return;
          case "b":
            d.fontWeight = Pe;
            break;
          case "i":
            d.fontStyle = Qe;
            break;
          case "u":
            d.textDecoration.push(Re);
            break;
          case "font":
            if (f = a.attributes.color) d.color = f;
            break;
          case "div":
            f = a.attributes.time;
            if (!f) break;
            if (f = Fd(f)) d.startTime = f;
            break;
          case "ruby":
          case "rp":
          case "rt":
            d.rubyTag = f;
        }
      }
      e = a.children;
      if (Qd(a) || e.length == 1 && Qd(e[0])) for (c = Td(a).split("\n"), a = true, c = t(c), e = c.next(); !e.done; e = c.next()) e = e.value, a || (a = Ce(d.startTime, d.endTime), b.nestedCues.push(a)), e.length > 0 && (a = d.clone(), a.payload = dc(e), b.nestedCues.push(a)), a = false;
      else for (b.nestedCues.push(d), b = t(e), a = b.next(); !a.done; a = b.next()) Le(a.value, d, c);
    }
    function Oe(a, b) {
      return a && a.length > 0 ? a : b;
    }
    S("shaka.text.Cue", se);
    se.parseCuePayload = Fe;
    se.equal = De;
    se.prototype.clone = se.prototype.clone;
    var te = "auto";
    se.positionAlign = { LEFT: "line-left", RIGHT: "line-right", CENTER: "center", AUTO: te };
    var ue = "center", Se = { LEFT: "left", RIGHT: "right", CENTER: ue, START: "start", END: "end" };
    se.textAlign = Se;
    var ze = "after", Te = { BEFORE: "before", CENTER: "center", AFTER: ze };
    se.displayAlign = Te;
    var ve = "ltr";
    se.direction = { HORIZONTAL_LEFT_TO_RIGHT: ve, HORIZONTAL_RIGHT_TO_LEFT: "rtl" };
    var we = "horizontal-tb";
    se.writingMode = { HORIZONTAL_TOP_TO_BOTTOM: we, VERTICAL_LEFT_TO_RIGHT: "vertical-lr", VERTICAL_RIGHT_TO_LEFT: "vertical-rl" };
    var xe = 0;
    se.lineInterpretation = { LINE_NUMBER: xe, PERCENTAGE: 1 };
    var ye = "start", Ue = { CENTER: "center", START: ye, END: "end" };
    se.lineAlign = Ue;
    var Me = { white: "white", lime: "lime", cyan: "cyan", red: "red", yellow: "yellow", magenta: "magenta", blue: "blue", black: "black" };
    se.defaultTextColor = Me;
    var Ne = { bg_white: "white", bg_lime: "lime", bg_cyan: "cyan", bg_red: "red", bg_yellow: "yellow", bg_magenta: "magenta", bg_blue: "blue", bg_black: "black" };
    se.defaultTextBackgroundColor = Ne;
    var Ae = 400, Pe = 700;
    se.fontWeight = { NORMAL: Ae, BOLD: Pe };
    var Be = "normal", Qe = "italic", Ve = { NORMAL: Be, ITALIC: Qe, OBLIQUE: "oblique" };
    se.fontStyle = Ve;
    var Re = "underline";
    se.textDecoration = { UNDERLINE: Re, LINE_THROUGH: "lineThrough", OVERLINE: "overline" };
    var Je = /(?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{2,3})/g;
    function We() {
    }
    We.prototype.destroy = function() {
    };
    function Xe(a, b, c) {
      Ye.set(a.toLowerCase().split(";")[0] + "-" + c, { priority: c, Uf: b });
    }
    function Ze(a, b) {
      for (var c = a.toLowerCase().split(";")[0], d = t([$e, af, bf, cf]), e = d.next(); !e.done; e = d.next()) if (e = Ye.get(c + "-" + e.value)) {
        var f = e.Uf(), g = f.isSupported(a, b);
        f.destroy();
        if (g) return e.Uf;
      }
      return null;
    }
    S("shaka.transmuxer.TransmuxerEngine", We);
    We.findTransmuxer = Ze;
    We.unregisterTransmuxer = function(a, b) {
      Ye.delete(a.toLowerCase().split(";")[0] + "-" + b);
    };
    We.registerTransmuxer = Xe;
    We.prototype.destroy = We.prototype.destroy;
    var Ye = /* @__PURE__ */ new Map(), cf = 1, bf = 2, af = 3, $e = 4;
    We.PluginPriority = { FALLBACK: cf, PREFERRED_SECONDARY: bf, PREFERRED: af, APPLICATION: $e };
    function df() {
    }
    function ef(a, b) {
      var c = a;
      b && !ff.includes(a) && (c += '; codecs="' + b + '"');
      return c;
    }
    function gf(a, b) {
      b && (a += '; codecs="' + b + '"');
      return a;
    }
    function hf(a, b, c) {
      var d = ef(a, b);
      b = gf(a, b);
      Ze(b) ? (a = Ze(b)) ? (a = a(), c = a.convertCodecs(c, b), a.destroy()) : c = b : c = a != "video/mp2t" && c == "audio" ? d.replace("video", "audio") : d;
      return c;
    }
    function jf(a) {
      return a.split(";")[0].split("/")[1];
    }
    function kf(a) {
      var b = lf(a);
      a = b[0].toLowerCase();
      b = b[1].toLowerCase();
      switch (true) {
        case (a === "mp4a" && b === "69"):
        case (a === "mp4a" && b === "6b"):
        case (a === "mp4a" && b === "40.34"):
          return "mp3";
        case (a === "mp4a" && b === "66"):
        case (a === "mp4a" && b === "67"):
        case (a === "mp4a" && b === "68"):
        case (a === "mp4a" && b === "40.2"):
        case (a === "mp4a" && b === "40.02"):
        case (a === "mp4a" && b === "40.5"):
        case (a === "mp4a" && b === "40.05"):
        case (a === "mp4a" && b === "40.29"):
        case (a === "mp4a" && b === "40.42"):
          return "aac";
        case (a === "mp4a" && b === "a5"):
        case a === "ac3":
        case a === "ac-3":
          return "ac-3";
        case (a === "mp4a" && b === "a6"):
        case a === "eac3":
        case a === "ec-3":
          return "ec-3";
        case a === "ac-4":
          return "ac-4";
        case (a === "mp4a" && b === "b2"):
          return "dtsx";
        case (a === "mp4a" && b === "a9"):
          return "dtsc";
        case a === "vp09":
        case a === "vp9":
          return "vp9";
        case a === "avc1":
        case a === "avc3":
          return "avc";
        case a === "hvc1":
        case a === "hev1":
          return "hevc";
        case a === "vvc1":
        case a === "vvi1":
          return "vvc";
        case a === "dvh1":
        case a === "dvhe":
          return b && b.startsWith("05") ? "dovi-p5" : "dovi-hevc";
        case a === "dvav":
        case a === "dva1":
          return "dovi-avc";
        case a === "dav1":
          return "dovi-av1";
        case a === "dvc1":
        case a === "dvi1":
          return "dovi-vvc";
      }
      return a;
    }
    function mf(a) {
      var b = [];
      a = t(a.split(","));
      for (var c = a.next(); !c.done; c = a.next()) c = lf(c.value), b.push(c[0]);
      return b.sort().join(",");
    }
    function nf(a) {
      return a.split(";")[0];
    }
    function of(a) {
      a = a.split(/ *; */);
      a.shift();
      return (a = a.find(function(b) {
        return b.startsWith("codecs=");
      })) ? a.split("=")[1].replace(/^"|"$/g, "") : "";
    }
    function pf(a) {
      return a === "application/x-mpegurl" || a === "application/vnd.apple.mpegurl";
    }
    function lf(a) {
      a = a.split(".");
      var b = a[0];
      a.shift();
      return [b, a.join(".")];
    }
    S("shaka.util.MimeUtils", df);
    df.getFullTypeWithAllCodecs = gf;
    df.getFullType = ef;
    (/* @__PURE__ */ new Map()).set("codecs", "codecs").set("frameRate", "framerate").set("bandwidth", "bitrate").set("width", "width").set("height", "height").set("channelsCount", "channels");
    var ff = ["audio/aac", "audio/ac3", "audio/ec3", "audio/mpeg"];
    function qf(a) {
      this.i = null;
      this.j = a;
      this.D = false;
      this.l = this.A = 0;
      this.m = Infinity;
      this.h = this.g = null;
      this.F = "";
      this.C = function() {
      };
      this.u = /* @__PURE__ */ new Map();
    }
    function rf(a, b) {
      tf.set(a, b);
    }
    function uf(a) {
      return tf.get(a);
    }
    function vf(a) {
      return tf.has(a) ? true : a == "application/cea-608" || a == "application/cea-708" ? !!nd : false;
    }
    qf.prototype.destroy = function() {
      this.j = this.i = null;
      this.u.clear();
      return Promise.resolve();
    };
    function wf(a, b, c, d, e) {
      var f, g, h, k2, l, m, n;
      return P(function(q) {
        if (q.g == 1) return G(q, Promise.resolve(), 2);
        if (!a.i || !a.j) return q.return();
        if (c == null || d == null) return a.i.parseInit(Lb(b)), q.return();
        f = a.D ? c : a.A;
        g = { periodStart: a.A, segmentStart: c, segmentEnd: d, vttOffset: f };
        h = a.i.parseMedia(Lb(b), g, e, []);
        k2 = t(h);
        for (l = k2.next(); !l.done; l = k2.next()) m = l.value, a.C(m, e || null, g);
        n = h.filter(function(r) {
          return r.startTime >= a.l && r.startTime < a.m;
        });
        a.j.append(n);
        a.g == null && (a.g = Math.max(c, a.l));
        a.h = Math.min(d, a.m);
        H(q);
      });
    }
    qf.prototype.remove = function(a, b) {
      var c = this;
      return P(function(d) {
        if (d.g == 1) return G(d, Promise.resolve(), 2);
        !c.j || !c.j.remove(a, b) || c.g == null || b <= c.g || a >= c.h || (a <= c.g && b >= c.h ? c.g = c.h = null : a <= c.g && b < c.h ? c.g = b : a > c.g && b >= c.h && (c.h = a));
        H(d);
      });
    };
    function xf(a, b, c) {
      a.l = b;
      a.m = c;
    }
    function yf(a, b, c) {
      a.F = b;
      if (b = a.u.get(b)) for (var d = t(b.keys()), e = d.next(); !e.done; e = d.next()) (e = b.get(e.value).filter(function(f) {
        return f.endTime <= c;
      })) && a.j.append(e);
    }
    function zf(a, b, c) {
      b.startTime += c;
      b.endTime += c;
      b = t(b.nestedCues);
      for (var d = b.next(); !d.done; d = b.next()) zf(a, d.value, c);
    }
    function Af(a, b, c, d, e) {
      var f = c + " " + d, g = /* @__PURE__ */ new Map();
      b = t(b);
      for (var h = b.next(); !h.done; h = b.next()) {
        var k2 = h.value;
        h = k2.stream;
        k2 = k2.cue;
        g.has(h) || g.set(h, /* @__PURE__ */ new Map());
        g.get(h).has(f) || g.get(h).set(f, []);
        zf(a, k2, e);
        k2.startTime >= a.l && k2.startTime < a.m && (g.get(h).get(f).push(k2), h == a.F && a.j.append([k2]));
      }
      e = t(g.keys());
      for (f = e.next(); !f.done; f = e.next()) for (f = f.value, a.u.has(f) || a.u.set(f, /* @__PURE__ */ new Map()), b = t(g.get(f).keys()), h = b.next(); !h.done; h = b.next()) h = h.value, k2 = g.get(f).get(h), a.u.get(f).set(h, k2);
      a.g = a.g == null ? Math.max(
        c,
        a.l
      ) : Math.min(a.g, Math.max(c, a.l));
      a.h = Math.max(a.h, Math.min(d, a.m));
    }
    S("shaka.text.TextEngine", qf);
    qf.prototype.destroy = qf.prototype.destroy;
    qf.findParser = uf;
    qf.unregisterParser = function(a) {
      tf.delete(a);
    };
    qf.registerParser = rf;
    var tf = /* @__PURE__ */ new Map();
    function Bf(a) {
      this.h = a;
      this.g = null;
    }
    Bf.prototype.Y = function(a) {
      var b = this;
      this.stop();
      var c = true, d = null;
      this.g = function() {
        window2.clearTimeout(d);
        c = false;
      };
      d = window2.setTimeout(function() {
        c && b.h();
      }, a * 1e3);
      return this;
    };
    Bf.prototype.stop = function() {
      this.g && (this.g(), this.g = null);
    };
    function Cf(a) {
      this.h = a;
      this.g = null;
    }
    Cf.prototype.La = function() {
      this.stop();
      this.h();
      return this;
    };
    Cf.prototype.Y = function(a) {
      var b = this;
      this.stop();
      this.g = new Bf(function() {
        b.h();
      }).Y(a);
      return this;
    };
    Cf.prototype.za = function(a) {
      var b = this;
      this.stop();
      this.g = new Bf(function() {
        b.g.Y(a);
        b.h();
      }).Y(a);
      return this;
    };
    Cf.prototype.stop = function() {
      this.g && (this.g.stop(), this.g = null);
    };
    S("shaka.util.Timer", Cf);
    Cf.prototype.stop = Cf.prototype.stop;
    Cf.prototype.tickEvery = Cf.prototype.za;
    Cf.prototype.tickAfter = Cf.prototype.Y;
    Cf.prototype.tickNow = Cf.prototype.La;
    function Df(a, b) {
      return a.concat(b);
    }
    function Ef() {
    }
    function Ff(a) {
      return a != null;
    }
    function Gf(a, b) {
      return Promise.race([b, new Promise(function(c, d) {
        new Cf(d).Y(a);
      })]);
    }
    ;
    function Hf() {
    }
    function If(a, b, c, d, e) {
      function f(y) {
        var z = String(y.width || "") + String(y.height || "") + String(Math.round(y.frameRate || 0)) + (y.hdr || "") + y.fastSwitching;
        y.dependencyStream && (z += y.dependencyStream.baseOriginalId || "");
        return z;
      }
      function g(y) {
        var z = y.language + (y.channelsCount || 0) + (y.audioSamplingRate || 0) + y.roles.join(",") + y.label + y.groupId + y.fastSwitching;
        y.dependencyStream && (z += y.dependencyStream.baseOriginalId || "");
        return z;
      }
      if (e.length) {
        var h = a.textStreams;
        e = t(e);
        for (var k2 = e.next(), l = {}; !k2.done; l = { si: void 0 }, k2 = e.next()) if (l.si = k2.value, k2 = h.filter(/* @__PURE__ */ function(y) {
          return function(z) {
            return z.codecs.startsWith(y.si) || z.mimeType.startsWith(y.si) ? true : false;
          };
        }(l)), k2.length) {
          h = k2;
          break;
        }
        a.textStreams = h;
      }
      h = a.variants;
      if (b.length || c.length) h = Jf(h, b, c);
      if (d.length) {
        b = new kb();
        c = t(h);
        for (h = c.next(); !h.done; h = c.next()) h = h.value, b.push(String(h.video.width || 0), h);
        var m = [];
        b.forEach(function(y, z) {
          y = 0;
          var A = [];
          z = t(z);
          for (var C = z.next(), D = {}; !C.done; D = { wg: void 0 }, C = z.next()) D.wg = C.value, C = d.filter(/* @__PURE__ */ function(F) {
            return function(B) {
              return F.wg.decodingInfos[0][B];
            };
          }(D)).length, C > y ? (y = C, A = [D.wg]) : C == y && A.push(D.wg);
          m.push.apply(m, x(A));
        });
        h = m;
      }
      c = /* @__PURE__ */ new Set();
      b = /* @__PURE__ */ new Set();
      h = t(h);
      for (e = h.next(); !e.done; e = h.next()) e = e.value, e.audio && c.add(e.audio), e.video && b.add(e.video);
      h = Array.from(c).sort(function(y, z) {
        return y.bandwidth - z.bandwidth;
      });
      var n = [];
      c = /* @__PURE__ */ new Map();
      h = t(h);
      for (e = h.next(); !e.done; e = h.next()) {
        e = e.value;
        k2 = g(e);
        l = c.get(k2) || [];
        if (l.length) {
          var q = l[l.length - 1], r = kf(q.codecs), u = kf(e.codecs);
          r != u || e.bandwidth && q.bandwidth && !(e.bandwidth > q.bandwidth) || (l.push(e), n.push(e.id));
        } else l.push(e), n.push(e.id);
        c.set(k2, l);
      }
      var w = { vp8: 1, avc: 1, "dovi-avc": 0.95, vp9: 0.9, vp09: 0.9, hevc: 0.85, "dovi-hevc": 0.8, "dovi-p5": 0.75, av01: 0.7, "dovi-av1": 0.65, vvc: 0.6 };
      h = Array.from(b).sort(function(y, z) {
        if (!y.bandwidth || !z.bandwidth || y.bandwidth == z.bandwidth) {
          if (y.codecs && z.codecs && y.codecs != z.codecs && y.width == z.width) {
            var A = kf(y.codecs), C = kf(z.codecs);
            if (A != C) return (w[A] || 1) - (w[C] || 1);
          }
          return y.width - z.width;
        }
        return y.bandwidth - z.bandwidth;
      });
      b = fd();
      var v = [];
      c = /* @__PURE__ */ new Map();
      h = t(h);
      for (e = h.next(); !e.done; e = h.next()) {
        e = e.value;
        k2 = f(e);
        l = c.get(k2) || [];
        if (l.length) {
          q = l[l.length - 1];
          if (!b && (r = kf(q.codecs), u = kf(e.codecs), r !== u)) continue;
          r = kf(q.codecs);
          u = kf(e.codecs);
          r != u || e.bandwidth && q.bandwidth && !(e.bandwidth > q.bandwidth) || (l.push(e), v.push(e.id));
        } else l.push(e), v.push(e.id);
        c.set(k2, l);
      }
      a.variants = a.variants.filter(function(y) {
        var z = y.audio;
        y = y.video;
        return z && !n.includes(z.id) || y && !v.includes(y.id) ? false : true;
      });
    }
    function Jf(a, b, c) {
      b = t(b);
      for (var d = b.next(), e = {}; !d.done; e = { videoCodec: void 0 }, d = b.next()) if (e.videoCodec = d.value, d = a.filter(/* @__PURE__ */ function(f) {
        return function(g) {
          return g.video && g.video.codecs.startsWith(f.videoCodec);
        };
      }(e)), d.length) {
        a = d;
        break;
      }
      c = t(c);
      b = c.next();
      for (d = {}; !b.done; d = { audioCodec: void 0 }, b = c.next()) if (d.audioCodec = b.value, b = a.filter(/* @__PURE__ */ function(f) {
        return function(g) {
          return g.audio && g.audio.codecs.startsWith(f.audioCodec);
        };
      }(d)), b.length) {
        a = b;
        break;
      }
      return a;
    }
    function Kf(a, b, c) {
      a.variants = a.variants.filter(function(d) {
        return Lf(d, b, c);
      });
    }
    function Lf(a, b, c) {
      function d(h, k2, l) {
        return h >= k2 && h <= l;
      }
      var e = a.video;
      if (e && e.width && e.height) {
        var f = e.width, g = e.height;
        g > f && (g = t([g, f]), f = g.next().value, g = g.next().value);
        if (!d(f, b.minWidth, Math.min(b.maxWidth, c.width)) || !d(g, b.minHeight, Math.min(b.maxHeight, c.height)) || !d(e.width * e.height, b.minPixels, b.maxPixels)) return false;
      }
      return a && a.video && a.video.frameRate && !d(a.video.frameRate, b.minFrameRate, b.maxFrameRate) || a && a.audio && a.audio.channelsCount && !d(a.audio.channelsCount, b.minChannelsCount, b.maxChannelsCount) || !d(a.bandwidth, b.minBandwidth, b.maxBandwidth) ? false : true;
    }
    function Mf(a, b, c, d) {
      c = c === void 0 ? [] : c;
      d = d === void 0 ? {} : d;
      return P(function(e) {
        if (e.g == 1) return G(e, Nf(a, b, b.offlineSessionIds.length > 0, c, d), 2);
        Of(b);
        return G(e, Pf(b), 0);
      });
    }
    function Nf(a, b, c, d, e) {
      var f, g;
      return P(function(h) {
        if (h.g == 1) return Sb().Qj() && Qf(b.variants), G(h, Rf(b.variants, c, false, d), 2);
        f = null;
        a && (g = a.g) && (f = g.keySystem);
        b.variants = b.variants.filter(function(k2) {
          var l = Sf(k2, f, e);
          if (!l) {
            var m = [];
            k2.audio && m.push(Tf(k2.audio));
            k2.video && m.push(Tf(k2.video));
          }
          return l;
        });
        H(h);
      });
    }
    function Qf(a) {
      var b = (/* @__PURE__ */ new Map()).set("dvav", "avc3").set("dva1", "avc1").set("dvhe", "hev1").set("dvh1", "hvc1").set("dvc1", "vvc1").set("dvi1", "vvi1"), c = /* @__PURE__ */ new Set();
      a = t(a);
      for (var d = a.next(); !d.done; d = a.next()) d = d.value, d.video && c.add(d.video);
      c = t(c);
      for (a = c.next(); !a.done; a = c.next()) {
        a = a.value;
        d = t(b);
        for (var e = d.next(); !e.done; e = d.next()) {
          var f = t(e.value);
          e = f.next().value;
          f = f.next().value;
          if (a.codecs.includes(e)) {
            a.codecs = a.codecs.replace(e, f);
            break;
          }
        }
      }
    }
    function Sf(a, b, c) {
      if (!a.decodingInfos.some(function(k2) {
        return !k2.supported || b && (k2 = k2.keySystemAccess) && (c[k2.keySystem] || k2.keySystem) != b ? false : true;
      })) return false;
      var d = Sb(), e = d.Ub() === "Xbox";
      d = d.Ka() === "MOBILE" && d.Ga() === "GECKO";
      var f = a.video, g = f && f.width || 0, h = f && f.height || 0;
      if (e && f && (g > 1920 || h > 1080) && (f.codecs.includes("avc1.") || f.codecs.includes("avc3.")) || (e = f && f.dependencyStream) && !cd(e)) return false;
      a = a.audio;
      return d && a && a.encrypted && a.codecs.toLowerCase().includes("opus") || a && a.dependencyStream ? false : true;
    }
    function Uf(a, b) {
      var c, d, e, f, g, h, k2;
      return P(function(l) {
        if (l.g == 1) {
          c = function(m, n) {
            if (m) {
              var q = Id(m);
              q.supported = m.supported && n.supported;
              q.powerEfficient = m.powerEfficient && n.powerEfficient;
              q.smooth = m.smooth && n.smooth;
              n.keySystemAccess && !q.keySystemAccess && (q.keySystemAccess = n.keySystemAccess);
              return q;
            }
            return n;
          };
          d = null;
          e = [];
          f = t(b);
          g = f.next();
          for (h = {}; !g.done; h = { cache: void 0, gf: void 0 }, g = f.next()) k2 = g.value, h.gf = Jd(k2), h.cache = Vf, h.cache.has(h.gf) ? d = c(d, h.cache.get(h.gf)) : e.push(Wf(k2).then(/* @__PURE__ */ function(m) {
            return function(n) {
              var q = null;
              n = t(n || []);
              for (var r = n.next(); !r.done; r = n.next()) q = c(q, r.value);
              q && (m.cache.set(m.gf, q), d = c(d, q));
            };
          }(h)));
          return G(l, Promise.all(e), 2);
        }
        d && a.decodingInfos.push(d);
        H(l);
      });
    }
    function Wf(a) {
      var b = [""];
      a.video && (b = of(a.video.contentType).split(","));
      var c = [""];
      a.audio && (c = of(a.audio.contentType).split(","));
      var d = [];
      b = t(b);
      for (var e = b.next(); !e.done; e = b.next()) {
        e = e.value;
        for (var f = t(c), g = f.next(), h = {}; !g.done; h = { bd: void 0 }, g = f.next()) g = g.value, h.bd = Hd(a), a.video && (h.bd.video.contentType = ef(nf(h.bd.video.contentType), e)), a.audio && (h.bd.audio.contentType = ef(nf(h.bd.audio.contentType), g)), d.push(new Promise(/* @__PURE__ */ function(k2) {
          return function(l, m) {
            (Sb().Ka() == "MOBILE" ? Gf(5, navigator.mediaCapabilities.decodingInfo(k2.bd)) : navigator.mediaCapabilities.decodingInfo(k2.bd)).then(function(n) {
              l(n);
            }).catch(m);
          };
        }(h)));
      }
      return Promise.all(d).catch(function() {
        JSON.stringify(a);
        return null;
      });
    }
    function Rf(a, b, c, d) {
      var e, f, g, h, k2, l, m, n, q, r, u, w, v, y, z, A, C, D, F;
      return P(function(B) {
        switch (B.g) {
          case 1:
            if (e = a.some(function(E) {
              return E.decodingInfos.length;
            })) return B.return();
            f = t(d);
            g = f.next();
            h = {};
          case 2:
            if (g.done) {
              B.B(4);
              break;
            }
            h.uj = g.value;
            k2 = false;
            l = t(a);
            m = l.next();
          case 5:
            if (m.done) {
              B.B(7);
              break;
            }
            n = m.value;
            q = Xf(n, b, c).filter(/* @__PURE__ */ function(E) {
              return function(I) {
                I = I[0];
                return (I.keySystemConfiguration && I.keySystemConfiguration.keySystem) === E.uj;
              };
            }(h));
            r = t(q);
            u = r.next();
          case 8:
            if (u.done) {
              B.B(10);
              break;
            }
            w = u.value;
            return G(B, Uf(n, w), 9);
          case 9:
            u = r.next();
            B.B(8);
            break;
          case 10:
            n.decodingInfos.some(function(E) {
              return E.supported;
            }) && (k2 = true);
            m = l.next();
            B.B(5);
            break;
          case 7:
            if (k2) return B.return();
            h = { uj: void 0 };
            g = f.next();
            B.B(2);
            break;
          case 4:
            v = t(a), y = v.next();
          case 12:
            if (y.done) {
              B.B(0);
              break;
            }
            z = y.value;
            A = Xf(z, b, c).filter(function(E) {
              E = E[0];
              E = E.keySystemConfiguration && E.keySystemConfiguration.keySystem;
              return !E || !d.includes(E);
            });
            C = t(A);
            D = C.next();
          case 15:
            if (D.done) {
              y = v.next();
              B.B(12);
              break;
            }
            F = D.value;
            return G(
              B,
              Uf(z, F),
              16
            );
          case 16:
            D = C.next(), B.B(15);
        }
      });
    }
    function Xf(a, b, c) {
      var d = a.audio, e = a.video, f = [], g = [];
      if (e) for (var h = t(e.fullMimeTypes), k2 = h.next(); !k2.done; k2 = h.next()) {
        k2 = k2.value;
        var l = of(k2);
        if (l.includes(",") && !d) {
          var m = l.split(","), n = nf(k2);
          l = qc("video", m);
          m = qc("audio", m);
          m = Yf(m, n);
          n = hf(n, m, "audio");
          g.push({ contentType: n, channels: 2, bitrate: a.bandwidth || 1, samplerate: 1, spatialRendering: false });
        }
        l = Zf(l);
        k2 = { contentType: hf(nf(k2), l, "video"), width: e.width || 64, height: e.height || 64, bitrate: e.bandwidth || a.bandwidth || 1, framerate: e.frameRate || 30 };
        if (e.hdr) switch (e.hdr) {
          case "PQ":
            k2.transferFunction = "pq";
            break;
          case "HLG":
            k2.transferFunction = "hlg";
        }
        e.colorGamut && (k2.colorGamut = e.colorGamut);
        f.push(k2);
      }
      if (d) for (h = t(d.fullMimeTypes), k2 = h.next(); !k2.done; k2 = h.next()) l = k2.value, k2 = nf(l), l = Yf(of(l), k2), k2 = hf(k2, l, "audio"), g.push({ contentType: k2, channels: d.channelsCount || 2, bitrate: d.bandwidth || a.bandwidth || 1, samplerate: d.audioSamplingRate || 1, spatialRendering: d.spatialAudio });
      h = [];
      f.length == 0 && f.push(null);
      g.length == 0 && g.push(null);
      f = t(f);
      for (k2 = f.next(); !k2.done; k2 = f.next()) for (k2 = k2.value, l = t(g), n = l.next(); !n.done; n = l.next()) n = n.value, m = { type: c ? "file" : "media-source" }, k2 && (m.video = k2), n && (m.audio = n), h.push(m);
      g = (a.video ? a.video.drmInfos : []).concat(a.audio ? a.audio.drmInfos : []);
      if (!g.length) return [h];
      a = [];
      c = /* @__PURE__ */ new Map();
      g = t(g);
      for (f = g.next(); !f.done; f = g.next()) f = f.value, c.get(f.keySystem) || c.set(f.keySystem, []), c.get(f.keySystem).push(f);
      g = b ? "required" : "optional";
      b = b ? ["persistent-license"] : ["temporary"];
      f = t(c.keys());
      for (k2 = f.next(); !k2.done; k2 = f.next()) {
        k2 = k2.value;
        n = c.get(k2);
        l = /* @__PURE__ */ new Map();
        n = t(n);
        for (m = n.next(); !m.done; m = n.next()) {
          m = m.value;
          var q = m.videoRobustness + "," + m.audioRobustness;
          l.get(q) || l.set(q, []);
          l.get(q).push(m);
        }
        l = t(l.values());
        for (n = l.next(); !n.done; n = l.next()) {
          n = n.value;
          m = [];
          q = t(h);
          for (var r = q.next(); !r.done; r = q.next()) {
            r = Object.assign({}, r.value);
            for (var u = { keySystem: k2, initDataType: "cenc", persistentState: g, distinctiveIdentifier: "optional", sessionTypes: b }, w = t(n), v = w.next(); !v.done; v = w.next()) {
              v = v.value;
              if (v.initData && v.initData.length) {
                for (var y = /* @__PURE__ */ new Set(), z = t(v.initData), A = z.next(); !A.done; A = z.next()) y.add(A.value.initDataType);
                u.initDataType = v.initData[0].initDataType;
              }
              v.distinctiveIdentifierRequired && (u.distinctiveIdentifier = "required");
              v.persistentStateRequired && (u.persistentState = "required");
              v.sessionType && (u.sessionTypes = [v.sessionType]);
              d && (u.audio ? (v.encryptionScheme && (u.audio.encryptionScheme = u.audio.encryptionScheme || v.encryptionScheme), u.audio.robustness = u.audio.robustness || v.audioRobustness) : (u.audio = { robustness: v.audioRobustness }, v.encryptionScheme && (u.audio.encryptionScheme = v.encryptionScheme)), u.audio.robustness == "" && delete u.audio.robustness);
              e && (u.video ? (v.encryptionScheme && (u.video.encryptionScheme = u.video.encryptionScheme || v.encryptionScheme), u.video.robustness = u.video.robustness || v.videoRobustness) : (u.video = { robustness: v.videoRobustness }, v.encryptionScheme && (u.video.encryptionScheme = v.encryptionScheme)), u.video.robustness == "" && delete u.video.robustness);
            }
            r.keySystemConfiguration = u;
            m.push(r);
          }
          a.push(m);
        }
      }
      return a;
    }
    function Yf(a, b) {
      var c = Sb();
      return a.toLowerCase() == "flac" ? c.Ga() != "WEBKIT" ? "flac" : "fLaC" : a.toLowerCase() === "opus" ? c.Ga() != "WEBKIT" ? "opus" : jf(b) == "mp4" ? "Opus" : "opus" : a.toLowerCase() == "ac-3" && c.Ce() ? "ec-3" : a;
    }
    function Zf(a) {
      if (a.includes("avc1")) {
        var b = a.split(".");
        if (b.length == 3) return a = b.shift() + ".", a += parseInt(b.shift(), 10).toString(16), a += ("000" + parseInt(b.shift(), 10).toString(16)).slice(-4);
      } else if (a == "vp9") return "vp09.00.41.08";
      return a;
    }
    function Of(a) {
      a.textStreams = a.textStreams.filter(function(b) {
        b = ef(b.mimeType, b.codecs);
        return vf(b);
      });
    }
    function Pf(a) {
      var b, c, d, e, f, g, h, k2;
      return P(function(l) {
        switch (l.g) {
          case 1:
            b = [], c = t(a.imageStreams), d = c.next();
          case 2:
            if (d.done) {
              l.B(4);
              break;
            }
            e = d.value;
            f = e.mimeType;
            f == "application/mp4" && e.codecs == "mjpg" && (f = "image/jpg");
            if ($f.has(f)) {
              l.B(5);
              break;
            }
            g = ag.get(f);
            if (!g) {
              $f.set(f, false);
              l.B(5);
              break;
            }
            return G(l, bg(g), 7);
          case 7:
            h = l.h, $f.set(f, h);
          case 5:
            (k2 = $f.get(f)) && b.push(e);
            d = c.next();
            l.B(2);
            break;
          case 4:
            a.imageStreams = b, H(l);
        }
      });
    }
    function bg(a) {
      return new Promise(function(b) {
        var c = new Image();
        c.src = a;
        "decode" in c ? c.decode().then(function() {
          b(true);
        }).catch(function() {
          b(false);
        }) : c.onload = c.onerror = function() {
          b(c.height === 2);
        };
      });
    }
    function cg(a) {
      var b = a.audio, c = a.video, d = b ? b.mimeType : null, e = c ? c.mimeType : null, f = b ? b.codecs : null, g = c ? c.codecs : null, h = b ? b.groupId : null, k2 = [];
      c && k2.push(c.mimeType);
      b && k2.push(b.mimeType);
      k2 = k2[0] || null;
      var l = [];
      b && l.push(b.kind);
      c && l.push(c.kind);
      l = l[0] || null;
      var m = /* @__PURE__ */ new Set();
      if (b) for (var n = t(b.roles), q = n.next(); !q.done; q = n.next()) m.add(q.value);
      if (c) for (n = t(c.roles), q = n.next(); !q.done; q = n.next()) m.add(q.value);
      a = {
        id: a.id,
        active: false,
        type: "variant",
        bandwidth: a.bandwidth,
        language: a.language,
        label: null,
        kind: l,
        width: null,
        height: null,
        frameRate: null,
        pixelAspectRatio: null,
        hdr: null,
        colorGamut: null,
        videoLayout: null,
        mimeType: k2,
        audioMimeType: d,
        videoMimeType: e,
        codecs: "",
        audioCodec: f,
        videoCodec: g,
        primary: a.primary,
        roles: Array.from(m),
        audioRoles: null,
        forced: false,
        videoId: null,
        audioId: null,
        audioGroupId: h,
        channelsCount: null,
        audioSamplingRate: null,
        spatialAudio: false,
        tilesLayout: null,
        audioBandwidth: null,
        videoBandwidth: null,
        originalVideoId: null,
        originalAudioId: null,
        originalTextId: null,
        originalImageId: null,
        accessibilityPurpose: null,
        originalLanguage: null
      };
      if (c) {
        a.videoId = c.id;
        a.originalVideoId = c.originalId;
        a.width = c.width || null;
        a.height = c.height || null;
        a.frameRate = c.frameRate || null;
        a.pixelAspectRatio = c.pixelAspectRatio || null;
        a.videoBandwidth = c.bandwidth || null;
        a.hdr = c.hdr || null;
        a.colorGamut = c.colorGamut || null;
        a.videoLayout = c.videoLayout || null;
        if (d = c.dependencyStream) a.width = d.width || a.width, a.height = d.height || a.height, a.videoCodec = d.codecs || a.videoCodec;
        if (g.includes(",")) {
          a.channelsCount = c.channelsCount;
          a.audioSamplingRate = c.audioSamplingRate;
          a.spatialAudio = c.spatialAudio;
          a.originalLanguage = c.originalLanguage;
          a.audioMimeType = e;
          c = g.split(",");
          try {
            a.videoCodec = qc("video", c), a.audioCodec = qc("audio", c);
          } catch (r) {
          }
        }
      }
      b && (a.audioId = b.id, a.originalAudioId = b.originalId, a.channelsCount = b.channelsCount, a.audioSamplingRate = b.audioSamplingRate, a.audioBandwidth = b.bandwidth || null, a.spatialAudio = b.spatialAudio, a.label = b.label, a.audioRoles = b.roles, a.accessibilityPurpose = b.accessibilityPurpose, a.originalLanguage = b.originalLanguage, b = b.dependencyStream) && (a.audioCodec = b.codecs || a.audioCodec);
      b = [];
      a.videoCodec && b.push(a.videoCodec);
      a.audioCodec && b.push(a.audioCodec);
      a.codecs = b.join(", ");
      return a;
    }
    function dg(a) {
      return { id: a.id, active: false, type: tc, bandwidth: a.bandwidth || 0, language: a.language, label: a.label, kind: a.kind || null, mimeType: a.mimeType, codecs: a.codecs || null, primary: a.primary, roles: a.roles, accessibilityPurpose: a.accessibilityPurpose, forced: a.forced, originalTextId: a.originalId, originalLanguage: a.originalLanguage };
    }
    function eg(a) {
      var b = a.width || null, c = a.height || null, d = null;
      a.segmentIndex && (d = fg(a.segmentIndex));
      var e = a.tilesLayout;
      d && (e = d.tilesLayout || e);
      e && b != null && (b /= Number(e.split("x")[0]));
      e && c != null && (c /= Number(e.split("x")[1]));
      return { id: a.id, type: "image", bandwidth: a.bandwidth || 0, width: b, height: c, mimeType: a.mimeType, codecs: a.codecs || null, tilesLayout: e || null, originalImageId: a.originalId };
    }
    function gg(a) {
      a.__shaka_id || (a.__shaka_id = hg++);
      return a.__shaka_id;
    }
    function ig(a) {
      var b = { id: gg(a), active: a.mode != "disabled", type: tc, bandwidth: 0, language: zc(a.language || "und"), label: a.label, kind: a.kind, mimeType: null, codecs: null, primary: false, roles: [], accessibilityPurpose: null, forced: a.kind == "forced", originalTextId: a.id, originalLanguage: a.language };
      a.kind == "captions" && (b.mimeType = "unknown");
      a.kind == "subtitles" && (b.mimeType = "text/vtt");
      a.kind && (b.roles = [a.kind]);
      return b;
    }
    function jg(a, b) {
      var c = a ? a.language : null;
      c = {
        id: gg(a || b),
        active: a ? a.enabled : b.selected,
        type: "variant",
        bandwidth: 0,
        language: zc(c || "und"),
        label: a ? a.label : null,
        kind: a ? a.kind : null,
        width: null,
        height: null,
        frameRate: null,
        pixelAspectRatio: null,
        hdr: null,
        colorGamut: null,
        videoLayout: null,
        mimeType: null,
        audioMimeType: null,
        videoMimeType: null,
        codecs: null,
        audioCodec: null,
        videoCodec: null,
        primary: a ? a.kind == "main" : false,
        roles: [],
        forced: false,
        audioRoles: null,
        videoId: null,
        audioId: null,
        audioGroupId: null,
        channelsCount: null,
        audioSamplingRate: null,
        spatialAudio: false,
        tilesLayout: null,
        audioBandwidth: null,
        videoBandwidth: null,
        originalVideoId: b ? b.id : null,
        originalAudioId: a ? a.id : null,
        originalTextId: null,
        originalImageId: null,
        accessibilityPurpose: null,
        originalLanguage: c
      };
      a && a.kind && (c.roles = [a.kind], c.audioRoles = [a.kind]);
      a && a.configuration && (a.configuration.codec && (c.audioCodec = a.configuration.codec, c.codecs = c.audioCodec), a.configuration.bitrate && (c.audioBandwidth = a.configuration.bitrate, c.bandwidth += c.audioBandwidth), a.configuration.sampleRate && (c.audioSamplingRate = a.configuration.sampleRate), a.configuration.numberOfChannels && (c.channelsCount = a.configuration.numberOfChannels));
      if (b && b.configuration && (b.configuration.codec && (c.videoCodec = b.configuration.codec, c.codecs = c.codecs ? c.codecs + ("," + c.videoCodec) : c.videoCodec), b.configuration.bitrate && (c.videoBandwidth = b.configuration.bitrate, c.bandwidth += c.videoBandwidth), b.configuration.framerate && (c.frameRate = b.configuration.framerate), b.configuration.width && (c.width = b.configuration.width), b.configuration.height && (c.height = b.configuration.height), b.configuration.colorSpace && b.configuration.colorSpace.transfer)) switch (b.configuration.colorSpace.transfer) {
        case "pq":
          c.hdr = "PQ";
          break;
        case "hlg":
          c.hdr = "HLG";
          break;
        case "bt709":
          c.hdr = "SDR";
      }
      return c;
    }
    function kg(a) {
      return a.allowedByApplication && a.allowedByKeySystem && a.disabledUntilTime == 0;
    }
    function lg(a) {
      return a.filter(function(b) {
        return kg(b);
      });
    }
    function mg(a, b, c, d) {
      var e = a, f = a.filter(function(k2) {
        return k2.primary;
      });
      f.length && (e = f);
      var g = e.length ? e[0].language : "";
      e = e.filter(function(k2) {
        return k2.language == g;
      });
      if (b) {
        var h = Hc(zc(b), a.map(function(k2) {
          return k2.language;
        }));
        h && (e = a.filter(function(k2) {
          return zc(k2.language) == h;
        }));
      }
      e = e.filter(function(k2) {
        return k2.forced == d;
      });
      if (c) {
        if (a = ng(e, c), a.length) return a;
      } else if (a = e.filter(function(k2) {
        return k2.roles.length == 0;
      }), a.length) return a;
      a = e.map(function(k2) {
        return k2.roles;
      }).reduce(Df, []);
      return a.length ? ng(e, a[0]) : e;
    }
    function ng(a, b) {
      return a.filter(function(c) {
        return c.roles.includes(b);
      });
    }
    function og(a) {
      var b = [];
      a.audio && b.push(a.audio);
      a.video && b.push(a.video);
      return b;
    }
    function pg(a, b) {
      b.length && (b = b.filter(function(c) {
        return kf(a.codecs) == kf(c.codecs);
      }).sort(function(c, d) {
        return c.bandwidth && d.bandwidth && c.bandwidth != d.bandwidth ? c.bandwidth - d.bandwidth : (c.width || 0) - (d.width || 0);
      }), a.trickModeVideo = b[0], b.length > 1 && (b = b.find(function(c) {
        return a.width == c.width && a.height == c.height;
      }))) && (a.trickModeVideo = b);
    }
    function Tf(a) {
      return a.type == "audio" ? "type=audio codecs=" + a.codecs + " bandwidth=" + a.bandwidth + " channelsCount=" + a.channelsCount + " audioSamplingRate=" + a.audioSamplingRate : a.type == "video" ? "type=video codecs=" + a.codecs + " bandwidth=" + a.bandwidth + " frameRate=" + a.frameRate + " width=" + a.width + " height=" + a.height : "unexpected stream type";
    }
    function qg(a, b, c) {
      if (c.autoShowText == 0) return false;
      if (c.autoShowText == 1) return true;
      var d = zc(c.preferredTextLanguage);
      b = zc(b.language);
      if (c.autoShowText == 2) return yc(b, d);
      if (c.autoShowText == 3) {
        if (!a) return false;
        a = zc(a.language);
        return yc(b, d) && !yc(a, b);
      }
      bb("Invalid autoShowText setting!");
      return false;
    }
    function rg(a) {
      var b = { id: 0, language: "und", disabledUntilTime: 0, primary: false, audio: null, video: null, bandwidth: 100, allowedByApplication: true, allowedByKeySystem: true, decodingInfos: [] };
      a = t(a);
      for (var c = a.next(); !c.done; c = a.next()) {
        c = c.value;
        var d = {
          id: 0,
          originalId: null,
          groupId: null,
          createSegmentIndex: function() {
            return Promise.resolve();
          },
          segmentIndex: null,
          mimeType: c ? nf(c) : "",
          codecs: c ? of(c) : "",
          encrypted: true,
          drmInfos: [],
          keyIds: /* @__PURE__ */ new Set(),
          language: "und",
          originalLanguage: null,
          label: null,
          type: "video",
          primary: false,
          trickModeVideo: null,
          dependencyStream: null,
          emsgSchemeIdUris: null,
          roles: [],
          forced: false,
          channelsCount: null,
          audioSamplingRate: null,
          spatialAudio: false,
          closedCaptions: null,
          accessibilityPurpose: null,
          external: false,
          fastSwitching: false,
          fullMimeTypes: /* @__PURE__ */ new Set(),
          isAudioMuxedInVideo: false,
          baseOriginalId: null
        };
        d.fullMimeTypes.add(ef(d.mimeType, d.codecs));
        c.startsWith("audio/") ? (d.type = "audio", b.audio = d) : b.video = d;
      }
      return b;
    }
    S("shaka.util.StreamUtils", Hf);
    Hf.meetsRestrictions = Lf;
    var Vf = /* @__PURE__ */ new Map(), hg = 0, $f = (/* @__PURE__ */ new Map()).set("image/svg+xml", true).set("image/png", true).set("image/jpeg", true).set("image/jpg", true), ag = (/* @__PURE__ */ new Map()).set("image/webp", "data:image/webp;base64,UklGRjoAAABXRUJQVlA4IC4AAACyAgCdASoCAAIALmk0mk0iIiIiIgBoSygABc6WWgAA/veff/0PP8bA//LwYAAA").set("image/avif", "data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A=");
    function sg() {
      var a = this;
      this.H = null;
      this.l = false;
      this.u = new Pc();
      this.j = new Qc();
      navigator.connection && navigator.connection.addEventListener && this.j.o(navigator.connection, "change", function() {
        if (a.l && a.g.useNetworkInformation) {
          a.u = new Pc();
          a.g && a.u.configure(a.g.advanced);
          var b = a.chooseVariant();
          b && navigator.onLine && a.H(b, a.g.clearBufferSwitch, a.g.safeMarginSwitch);
        }
      });
      this.G = [];
      this.I = 1;
      this.J = false;
      this.h = this.m = this.g = this.A = null;
      this.C = new Cf(function() {
        if (a.l && (a.g.restrictToElementSize || a.g.restrictToScreenSize)) {
          var b = a.chooseVariant();
          b && a.H(b, a.g.clearBufferSwitch, a.g.safeMarginSwitch);
        }
      });
      this.D = window2;
      "documentPictureInPicture" in window2 && this.j.o(window2.documentPictureInPicture, "enter", function() {
        a.D = window2.documentPictureInPicture.window;
        a.C && a.C.La();
        a.j.qa(a.D, "pagehide", function() {
          a.D = window2;
          a.C && a.C.La();
        });
      });
      this.F = this.i = null;
    }
    p = sg.prototype;
    p.stop = function() {
      this.H = null;
      this.l = false;
      this.G = [];
      this.I = 1;
      this.m = this.A = null;
      this.h && (this.h.disconnect(), this.h = null);
      this.C.stop();
      this.F = this.i = null;
    };
    p.release = function() {
      this.j.release();
      this.C = null;
    };
    p.init = function(a) {
      this.H = a;
    };
    p.chooseVariant = function() {
      var a = Infinity, b = Infinity;
      if (this.g.restrictToScreenSize) {
        var c = this.g.ignoreDevicePixelRatio ? 1 : this.D.devicePixelRatio;
        a = this.D.screen.height * c;
        b = this.D.screen.width * c;
      }
      if (this.h && this.g.restrictToElementSize) {
        c = this.g.ignoreDevicePixelRatio ? 1 : this.D.devicePixelRatio;
        var d = this.m.clientHeight, e = this.m.clientWidth;
        this.i && document.pictureInPictureElement && document.pictureInPictureElement == this.m && (d = this.i.height, e = this.i.width);
        a = Math.min(a, d * c);
        b = Math.min(b, e * c);
      }
      c = this.G.filter(function(l) {
        return l && !(l.audio && l.audio.fastSwitching || l.video && l.video.fastSwitching);
      });
      c.length || (c = this.G);
      d = c;
      c.length != this.G.length && (d = this.G.filter(function(l) {
        return l && (l.audio && l.audio.fastSwitching || l.video && l.video.fastSwitching ? true : false);
      }));
      c = tg(this, this.g.restrictions, d, Infinity, Infinity);
      if (a != Infinity || b != Infinity) {
        c = ug(c);
        c = t(c);
        for (e = c.next(); !e.done; e = c.next()) if (e = e.value, e.height >= a && e.width >= b) {
          a = e.height;
          b = e.width;
          break;
        }
        c = tg(this, this.g.restrictions, d, a, b);
      }
      a = this.getBandwidthEstimate();
      d.length && !c.length && (c = tg(this, null, d, Infinity, Infinity), c = [c[0]]);
      b = c[0] || null;
      for (d = 0; d < c.length; d++) {
        e = c[d];
        for (var f = isNaN(this.I) ? 1 : Math.abs(this.I), g = f * e.bandwidth / this.g.bandwidthDowngradeTarget, h = { bandwidth: Infinity }, k2 = d + 1; k2 < c.length; k2++) if (e.bandwidth != c[k2].bandwidth) {
          h = c[k2];
          break;
        }
        f = f * h.bandwidth / this.g.bandwidthUpgradeTarget;
        a >= g && a <= f && (b.bandwidth != e.bandwidth || b.bandwidth == e.bandwidth && b.video && e.video && (b.video.width < e.video.width || b.video.height < e.video.height)) && (b = e);
      }
      this.A = Date.now();
      return b;
    };
    p.enable = function() {
      this.l = true;
    };
    p.disable = function() {
      this.l = false;
    };
    p.segmentDownloaded = function(a, b, c, d) {
      var e = a;
      this.g.removeLatencyFromFirstPacketTime && d && d.packetNumber === 1 && d.timeToFirstByte && (e = a - d.timeToFirstByte);
      e >= this.g.cacheLoadThreshold && this.u.sample(e, b);
      c && this.A != null && this.l && vg(this);
    };
    p.trySuggestStreams = function() {
      this.A != null && this.l && vg(this);
    };
    p.getBandwidthEstimate = function() {
      var a = this.g.defaultBandwidthEstimate;
      navigator.connection && navigator.connection.downlink && this.g.useNetworkInformation && (a = navigator.connection.downlink * 1e6);
      if (navigator.connection && navigator.connection.downlink && this.g.useNetworkInformation && this.g.preferNetworkInformationBandwidth) return a;
      a = this.u.getBandwidthEstimate(a);
      return this.F ? this.F.getBandwidthEstimate(a) : a;
    };
    p.setVariants = function(a) {
      this.G = a;
    };
    p.playbackRateChanged = function(a) {
      this.I = a;
    };
    p.setMediaElement = function(a) {
      function b() {
        c.C.Y(wg);
      }
      var c = this;
      this.m = a;
      this.h && (this.h.disconnect(), this.h = null);
      this.m && "ResizeObserver" in window2 && (this.h = new ResizeObserver(b), this.h.observe(this.m));
      this.j.o(a, "enterpictureinpicture", function(d) {
        d.pictureInPictureWindow && (c.i = d.pictureInPictureWindow, c.j.o(c.i, "resize", b));
      });
      this.j.o(a, "leavepictureinpicture", function() {
        c.i && c.j.Ea(c.i, "resize", b);
        c.i = null;
      });
    };
    p.setCmsdManager = function(a) {
      this.F = a;
    };
    p.configure = function(a) {
      this.g = a;
      this.u && this.g && this.u.configure(this.g.advanced);
    };
    function vg(a) {
      if (!a.J) {
        var b = a.u;
        if (!(b.g >= b.i)) return;
        a.J = true;
        a.A -= (a.g.switchInterval - a.g.minTimeToSwitch) * 1e3;
      }
      Date.now() - a.A < a.g.switchInterval * 1e3 || (b = a.chooseVariant(), a.getBandwidthEstimate(), b && a.H(b, a.g.clearBufferSwitch, a.g.safeMarginSwitch));
    }
    function tg(a, b, c, d, e) {
      if (a.F) {
        var f = a.F.Yi();
        f && (c = c.filter(function(g) {
          return g.bandwidth && f ? g.bandwidth <= f : true;
        }));
      }
      b && (c = c.filter(function(g) {
        return Lf(g, b, { width: e, height: d });
      }));
      return c.sort(function(g, h) {
        return g.bandwidth - h.bandwidth;
      });
    }
    function ug(a) {
      var b = [];
      a = t(a);
      for (var c = a.next(); !c.done; c = a.next()) (c = c.value.video) && c.height && c.width && b.push({ height: c.height, width: c.width });
      return b.sort(function(d, e) {
        return d.width - e.width;
      });
    }
    S("shaka.abr.SimpleAbrManager", sg);
    sg.prototype.configure = sg.prototype.configure;
    sg.prototype.setCmsdManager = sg.prototype.setCmsdManager;
    sg.prototype.setMediaElement = sg.prototype.setMediaElement;
    sg.prototype.playbackRateChanged = sg.prototype.playbackRateChanged;
    sg.prototype.setVariants = sg.prototype.setVariants;
    sg.prototype.getBandwidthEstimate = sg.prototype.getBandwidthEstimate;
    sg.prototype.trySuggestStreams = sg.prototype.trySuggestStreams;
    sg.prototype.segmentDownloaded = sg.prototype.segmentDownloaded;
    sg.prototype.disable = sg.prototype.disable;
    sg.prototype.enable = sg.prototype.enable;
    sg.prototype.chooseVariant = sg.prototype.chooseVariant;
    sg.prototype.init = sg.prototype.init;
    sg.prototype.release = sg.prototype.release;
    sg.prototype.stop = sg.prototype.stop;
    var wg = 1;
    S("shaka.config.CrossBoundaryStrategy", { KEEP: "keep", RESET: "reset", RESET_TO_ENCRYPTED: "reset_to_encrypted", RESET_ON_ENCRYPTION_CHANGE: "RESET_ON_ENCRYPTION_CHANGE" });
    function yg(a, b) {
      if (a === b || !a.length || !b.length) return true;
      a = t(a);
      for (var c = a.next(); !c.done; c = a.next()) {
        c = c.value;
        if (zg(c)) return true;
        for (var d = t(b), e = d.next(); !e.done; e = d.next()) if (e = e.value, c.keySystem === e.keySystem || zg(e)) return true;
      }
      return false;
    }
    function Ag(a, b) {
      if (!a.length) return b;
      if (!b.length) return a;
      var c = [];
      a = t(a);
      for (var d = a.next(); !d.done; d = a.next()) {
        d = d.value;
        for (var e = t(b), f = e.next(); !f.done; f = e.next()) if (f = f.value, d.keySystem == f.keySystem) {
          e = /* @__PURE__ */ new Map();
          for (var g = t((d.initData || []).concat(f.initData || [])), h = g.next(); !h.done; h = g.next()) h = h.value, e.set(h.keyId, h);
          e = Array.from(e.values());
          g = d.keyIds && f.keyIds ? new Set([].concat(x(d.keyIds), x(f.keyIds))) : d.keyIds || f.keyIds;
          c.push({ keySystem: d.keySystem, licenseServerUri: d.licenseServerUri || f.licenseServerUri, distinctiveIdentifierRequired: d.distinctiveIdentifierRequired || f.distinctiveIdentifierRequired, persistentStateRequired: d.persistentStateRequired || f.persistentStateRequired, videoRobustness: d.videoRobustness || f.videoRobustness, audioRobustness: d.audioRobustness || f.audioRobustness, serverCertificate: d.serverCertificate || f.serverCertificate, serverCertificateUri: d.serverCertificateUri || f.serverCertificateUri, initData: e, keyIds: g });
          break;
        } else zg(d) ? c.push(d) : zg(f) && c.push(f);
      }
      return c;
    }
    function Bg(a) {
      return a ? !!a.match(/^com\.(microsoft|chromecast)\.playready/) : false;
    }
    function Cg(a) {
      return a ? !!a.match(/^com\.apple\.fps/) : false;
    }
    function zg(a) {
      return (a = a.licenseServerUri) ? a.startsWith("data:application/json;base64,") : false;
    }
    var Dg = new Rb(function() {
      return Mb(new Uint8Array([0]));
    }), Ig = /* @__PURE__ */ new Map();
    function Jg(a, b) {
      var c = Kg();
      this.l = a.maxAttempts == null ? c.maxAttempts : a.maxAttempts;
      this.j = a.baseDelay == null ? c.baseDelay : a.baseDelay;
      this.u = a.fuzzFactor == null ? c.fuzzFactor : a.fuzzFactor;
      this.m = a.backoffFactor == null ? c.backoffFactor : a.backoffFactor;
      this.g = 0;
      this.h = this.j;
      if (this.i = b === void 0 ? false : b) this.g = 1;
    }
    function Lg(a) {
      var b, c;
      return P(function(d) {
        if (d.g == 1) {
          if (a.g >= a.l) if (a.i) a.g = 1, a.h = a.j;
          else throw new U(2, 7, 1010);
          b = a.g;
          a.g++;
          if (b == 0) return d.return();
          c = a.h * (1 + (Math.random() * 2 - 1) * a.u);
          return G(d, new Promise(function(e) {
            new Cf(e).Y(c / 1e3);
          }), 2);
        }
        a.h *= a.m;
        H(d);
      });
    }
    function Kg() {
      return { maxAttempts: 2, baseDelay: 1e3, backoffFactor: 2, fuzzFactor: 0.5, timeout: 3e4, stallTimeout: 5e3, connectionTimeout: 1e4 };
    }
    ;
    function Mg() {
      var a, b, c = new Promise(function(d, e) {
        a = d;
        b = e;
      });
      c.resolve = a;
      c.reject = b;
      return c;
    }
    Mg.prototype.resolve = function() {
    };
    Mg.prototype.reject = function() {
    };
    function Ng(a, b) {
      this.promise = a;
      this.i = b;
      this.g = null;
    }
    function Og(a) {
      return new Ng(Promise.reject(a), function() {
        return Promise.resolve();
      });
    }
    function Pg() {
      var a = Promise.reject(new U(2, 7, 7001));
      a.catch(function() {
      });
      return new Ng(a, function() {
        return Promise.resolve();
      });
    }
    function Qg(a) {
      return new Ng(Promise.resolve(a), function() {
        return Promise.resolve();
      });
    }
    function Rg(a) {
      return new Ng(a, function() {
        return a.catch(function() {
        });
      });
    }
    Ng.prototype.abort = function() {
      this.g || (this.g = this.i());
      return this.g;
    };
    function Sg(a) {
      return new Ng(Promise.all(a.map(function(b) {
        return b.promise;
      })), function() {
        return Promise.all(a.map(function(b) {
          return b.abort();
        }));
      });
    }
    Ng.prototype.finally = function(a) {
      this.promise.then(function() {
        return a(true);
      }, function() {
        return a(false);
      });
      return this;
    };
    Ng.prototype.cb = function(a, b) {
      function c(h) {
        return function(k2) {
          if (e.g && h) f.reject(g);
          else {
            var l = h ? a : b;
            l ? d = Tg(l, k2, f) : (h ? f.resolve : f.reject)(k2);
          }
        };
      }
      function d() {
        f.reject(g);
        return e.abort();
      }
      var e = this, f = new Mg();
      f.catch(function() {
      });
      var g = new U(2, 7, 7001);
      this.promise.then(c(true), c(false));
      return new Ng(f, function() {
        return d();
      });
    };
    function Tg(a, b, c) {
      try {
        var d = a(b);
        if (d && d.promise && d.abort) return c.resolve(d.promise), function() {
          return d.abort();
        };
        c.resolve(d);
        return function() {
          return Promise.resolve(d).then(function() {
          }, function() {
          });
        };
      } catch (e) {
        return c.reject(e), function() {
          return Promise.resolve();
        };
      }
    }
    ea.Object.defineProperties(Ng.prototype, { aborted: { configurable: true, enumerable: true, get: function() {
      return this.g !== null;
    } } });
    S("shaka.util.AbortableOperation", Ng);
    Ng.prototype.chain = Ng.prototype.cb;
    Ng.prototype["finally"] = Ng.prototype.finally;
    Ng.all = Sg;
    Ng.prototype.abort = Ng.prototype.abort;
    Ng.notAbortable = Rg;
    Ng.completed = Qg;
    Ng.aborted = Pg;
    Ng.failed = Og;
    function Ug() {
      this.g = [];
    }
    function Vg(a, b) {
      a.g.push(b.finally(function() {
        ud(a.g, b);
      }));
    }
    Ug.prototype.destroy = function() {
      for (var a = [], b = t(this.g), c = b.next(); !c.done; c = b.next()) c = c.value, c.promise.catch(function() {
      }), a.push(c.abort());
      this.g = [];
      return Promise.all(a);
    };
    function Wg(a, b, c, d, e, f, g) {
      lb.call(this);
      this.i = null;
      this.j = false;
      this.A = new Ug();
      this.g = /* @__PURE__ */ new Set();
      this.h = /* @__PURE__ */ new Set();
      this.u = a || null;
      this.m = b || null;
      this.C = c || null;
      this.D = d || null;
      this.F = e || null;
      this.H = f || null;
      this.G = g || null;
      this.l = /* @__PURE__ */ new Map();
    }
    ma(Wg, lb);
    p = Wg.prototype;
    p.configure = function(a) {
      this.i = a;
    };
    function Xg(a, b, c, d) {
      d = d === void 0 ? false : d;
      c = c || Yg;
      var e = Zg.get(a);
      (!e || c >= e.priority) && Zg.set(a, { priority: c, Uf: b, Wl: d });
    }
    function $g(a, b) {
      for (var c = t(a.g), d = c.next(); !d.done; d = c.next()) b.g.add(d.value);
      a = t(a.h);
      for (c = a.next(); !c.done; c = a.next()) b.h.add(c.value);
    }
    p.Zl = function(a) {
      this.g.add(a);
    };
    p.zm = function(a) {
      this.g.delete(a);
    };
    p.qk = function() {
      this.g.clear();
    };
    p.$l = function(a) {
      this.h.add(a);
    };
    p.Am = function(a) {
      this.h.delete(a);
    };
    p.rk = function() {
      this.h.clear();
    };
    p.Ni = function() {
      this.l.clear();
    };
    function ah(a, b, c) {
      return { uris: a, method: "GET", body: null, headers: {}, allowCrossSiteCredentials: false, retryParameters: b, licenseRequestType: null, sessionId: null, drmInfo: null, initData: null, initDataType: null, streamDataCallback: c === void 0 ? null : c };
    }
    p.destroy = function() {
      this.j = true;
      this.g.clear();
      this.h.clear();
      this.l.clear();
      lb.prototype.release.call(this);
      return this.A.destroy();
    };
    p.request = function(a, b, c) {
      var d = this, e = new bh();
      if (this.j) {
        var f = Promise.reject(new U(2, 7, 7001));
        f.catch(function() {
        });
        return new ch(f, function() {
          return Promise.resolve();
        }, e);
      }
      b.method = b.method || "GET";
      b.headers = b.headers || {};
      b.retryParameters = b.retryParameters ? Hd(b.retryParameters) : Kg();
      b.uris = Hd(b.uris);
      f = dh(this, a, b, c);
      var g = f.cb(function() {
        return eh(d, a, b, c, new Jg(b.retryParameters, false), 0, null, e);
      }), h = g.cb(function(q) {
        return fh(d, a, q, c);
      }), k2 = Date.now(), l = 0;
      f.promise.then(function() {
        l = Date.now() - k2;
      }, function() {
      });
      var m = 0;
      g.promise.then(function() {
        m = Date.now();
      }, function() {
      });
      var n = h.cb(function(q) {
        var r = Date.now() - m, u = q.response;
        u.timeMs += l;
        u.timeMs += r;
        q.zl || !d.u || u.fromCache || b.method == "HEAD" || a != gh || d.u(u.timeMs, u.data.byteLength, hh(c), b, c);
        d.G && d.G(a, u, c);
        return u;
      }, function(q) {
        q && (q.severity = 2);
        throw q;
      });
      f = new ch(n.promise, function() {
        return n.abort();
      }, e);
      Vg(this.A, f);
      return f;
    };
    function dh(a, b, c, d) {
      function e(h) {
        f = f.cb(function() {
          c.body && (c.body = Mb(c.body));
          return h(b, c, d);
        });
      }
      var f = Qg(void 0);
      a.F && e(a.F);
      a = t(a.g);
      for (var g = a.next(); !g.done; g = a.next()) e(g.value);
      return f.cb(void 0, function(h) {
        if (h instanceof U && h.code == 7001) throw h;
        throw new U(2, 1, 1006, h);
      });
    }
    function eh(a, b, c, d, e, f, g, h) {
      a.i.forceHTTP && (c.uris[f] = c.uris[f].replace("https://", "http://"));
      a.i.forceHTTPS && (c.uris[f] = c.uris[f].replace("http://", "https://"));
      f > 0 && a.H && a.H(b, d, c.uris[f], c.uris[f - 1]);
      var k2 = new rb(c.uris[f]), l = k2.lc, m = false;
      l || (l = location.protocol, l = l.slice(0, -1), sb(k2, l), c.uris[f] = k2.toString());
      l = l.toLowerCase();
      var n = (l = Zg.get(l)) ? l.Uf : null;
      if (!n) return Og(new U(2, 1, 1e3, k2));
      var q = l.Wl;
      (k2 = a.l.get(k2.Ib)) && (c.headers["common-access-token"] = k2);
      var r = null, u = null, w = false, v = false, y;
      return Rg(Lg(e)).cb(function() {
        if (a.j) return Pg();
        y = Date.now();
        var z = 0;
        c.requestStartTime = Date.now();
        var A = n(c.uris[f], c, b, function(F, B, E) {
          r && r.stop();
          u && u.Y(D / 1e3);
          a.u && b == gh && (z++, c.packetNumber = z, a.u(F, B, hh(d), c, d), m = true, h.g = E);
        }, function(F) {
          v = true;
          c.timeToFirstByte = Date.now() - c.requestStartTime;
          a.m && a.m(F, c, b);
        }, { minBytesForProgressEvents: a.i.minBytesForProgressEvents });
        if (!q) return A;
        var C = c.retryParameters.connectionTimeout;
        C && (r = new Cf(function() {
          w = true;
          A.abort();
        }), r.Y(C / 1e3));
        var D = c.retryParameters.stallTimeout;
        D && (u = new Cf(function() {
          w = true;
          A.abort();
        }));
        return A;
      }).cb(function(z) {
        r && r.stop();
        u && u.stop();
        z.timeMs == void 0 && (z.timeMs = Date.now() - y);
        var A = z.headers["common-access-token"];
        if (A) {
          var C = new rb(z.uri);
          a.l.set(C.Ib, A);
        }
        A = { response: z, zl: m };
        !v && a.m && a.m(z.headers, c, b);
        a.C && a.C(c, z);
        return A;
      }, function(z) {
        r && r.stop();
        u && u.stop();
        if (a.D) {
          var A = null, C = 0;
          z instanceof U && (A = z, z.code == 1001 && (C = z.data[1]));
          a.D(c, A, C, w);
        }
        if (a.j) return Pg();
        w && (z = new U(1, 1, 1003, c.uris[f], b));
        if (z instanceof U) {
          if (z.code == 7001) throw z;
          if (z.code == 1010) throw g;
          if (z.severity == 1) {
            A = (/* @__PURE__ */ new Map()).set("error", z);
            A = new T("retry", A);
            A.cancelable = true;
            a.dispatchEvent(A);
            if (A.defaultPrevented) throw z;
            f = (f + 1) % c.uris.length;
            return eh(a, b, c, d, e, f, z, h);
          }
        }
        throw z;
      });
    }
    function fh(a, b, c, d) {
      var e = Qg(void 0);
      a = t(a.h);
      for (var f = a.next(), g = {}; !f.done; g = { Bj: void 0 }, f = a.next()) g.Bj = f.value, e = e.cb(/* @__PURE__ */ function(h) {
        return function() {
          var k2 = c.response;
          k2.data && (k2.data = Mb(k2.data));
          return (0, h.Bj)(b, k2, d);
        };
      }(g));
      return e.cb(function() {
        return c;
      }, function(h) {
        var k2 = 2;
        if (h instanceof U) {
          if (h.code == 7001) throw h;
          k2 = h.severity;
        }
        throw new U(k2, 1, 1007, h);
      });
    }
    function hh(a) {
      if (a) {
        var b = a.segment;
        a = a.stream;
        if (b && a && a.fastSwitching && b.u) return false;
      }
      return true;
    }
    S("shaka.net.NetworkingEngine", Wg);
    Wg.prototype.request = Wg.prototype.request;
    Wg.prototype.destroy = Wg.prototype.destroy;
    Wg.makeRequest = ah;
    Wg.defaultRetryParameters = function() {
      return Kg();
    };
    Wg.prototype.clearCommonAccessTokenMap = Wg.prototype.Ni;
    Wg.prototype.clearAllResponseFilters = Wg.prototype.rk;
    Wg.prototype.unregisterResponseFilter = Wg.prototype.Am;
    Wg.prototype.registerResponseFilter = Wg.prototype.$l;
    Wg.prototype.clearAllRequestFilters = Wg.prototype.qk;
    Wg.prototype.unregisterRequestFilter = Wg.prototype.zm;
    Wg.prototype.registerRequestFilter = Wg.prototype.Zl;
    Wg.unregisterScheme = function(a) {
      Zg.delete(a);
    };
    Wg.registerScheme = Xg;
    Wg.prototype.configure = Wg.prototype.configure;
    function bh() {
      this.g = 0;
    }
    Wg.NumBytesRemainingClass = bh;
    function ch(a, b, c) {
      Ng.call(this, a, b);
      this.h = c;
    }
    ma(ch, Ng);
    Wg.PendingRequest = ch;
    var gh = 1;
    Wg.RequestType = { MANIFEST: 0, SEGMENT: gh, LICENSE: 2, APP: 3, TIMING: 4, SERVER_CERTIFICATE: 5, KEY: 6, ADS: 7, CONTENT_STEERING: 8 };
    Wg.AdvancedRequestType = { INIT_SEGMENT: 0, MEDIA_SEGMENT: 1, MEDIA_PLAYLIST: 2, MASTER_PLAYLIST: 3, MPD: 4, MSS: 5, MPD_PATCH: 6, MEDIATAILOR_SESSION_INFO: 7, MEDIATAILOR_TRACKING_INFO: 8, MEDIATAILOR_STATIC_RESOURCE: 9, MEDIATAILOR_TRACKING_EVENT: 10, INTERSTITIAL_ASSET_LIST: 11, INTERSTITIAL_AD_URL: 12 };
    var Yg = 3;
    Wg.PluginPriority = { FALLBACK: 1, PREFERRED: 2, APPLICATION: Yg };
    var Zg = /* @__PURE__ */ new Map();
    function ih(a) {
      this.g = false;
      this.h = new Mg();
      this.i = a;
    }
    ih.prototype.destroy = function() {
      var a = this;
      if (this.g) return this.h;
      this.g = true;
      return this.i().then(function() {
        a.h.resolve();
      }, function() {
        a.h.resolve();
      });
    };
    function jh(a, b) {
      if (a.g) {
        if (b instanceof U && b.code == 7003) throw b;
        throw new U(2, 7, 7003, b);
      }
    }
    ;
    function kh(a) {
      for (var b = /* @__PURE__ */ new Map(), c = t(Object.keys(a)), d = c.next(); !d.done; d = c.next()) d = d.value, b.set(d, a[d]);
      return b;
    }
    function lh(a) {
      var b = {};
      a.forEach(function(c, d) {
        b[d] = c;
      });
      return b;
    }
    ;
    function mh(a, b) {
      this.h = Pb(a);
      this.i = b == nh;
      this.g = 0;
    }
    p = mh.prototype;
    p.Pa = function() {
      return this.g < this.h.byteLength;
    };
    p.Ua = function() {
      return this.g;
    };
    p.getLength = function() {
      return this.h.byteLength;
    };
    p.ba = function() {
      try {
        var a = this.h.getUint8(this.g);
        this.g += 1;
        return a;
      } catch (b) {
        throw oh();
      }
    };
    p.Ha = function() {
      try {
        var a = this.h.getUint16(this.g, this.i);
        this.g += 2;
        return a;
      } catch (b) {
        throw oh();
      }
    };
    p.X = function() {
      try {
        var a = this.h.getUint32(this.g, this.i);
        this.g += 4;
        return a;
      } catch (b) {
        throw oh();
      }
    };
    p.Sh = function() {
      try {
        var a = this.h.getInt32(this.g, this.i);
        this.g += 4;
        return a;
      } catch (b) {
        throw oh();
      }
    };
    p.Qd = function() {
      try {
        if (this.i) {
          var a = this.h.getUint32(this.g, true);
          var b = this.h.getUint32(this.g + 4, true);
        } else b = this.h.getUint32(this.g, false), a = this.h.getUint32(this.g + 4, false);
      } catch (c) {
        throw oh();
      }
      if (b > 2097151) throw new U(2, 3, 3001);
      this.g += 8;
      return b * 4294967296 + a;
    };
    p.$b = function(a) {
      if (this.g + a > this.h.byteLength) throw oh();
      var b = Lb(this.h, this.g, a);
      this.g += a;
      return b;
    };
    p.skip = function(a) {
      if (this.g + a > this.h.byteLength) throw oh();
      this.g += a;
    };
    p.Cj = function(a) {
      if (this.g < a) throw oh();
      this.g -= a;
    };
    p.seek = function(a) {
      if (a < 0 || a > this.h.byteLength) throw oh();
      this.g = a;
    };
    p.nd = function() {
      for (var a = this.g; this.Pa() && this.h.getUint8(this.g) != 0; ) this.g += 1;
      a = Lb(this.h, a, this.g - a);
      this.g += 1;
      return Xb(a);
    };
    function oh() {
      return new U(2, 3, 3e3);
    }
    S("shaka.util.DataViewReader", mh);
    mh.prototype.readTerminatedString = mh.prototype.nd;
    mh.prototype.seek = mh.prototype.seek;
    mh.prototype.rewind = mh.prototype.Cj;
    mh.prototype.skip = mh.prototype.skip;
    mh.prototype.readBytes = mh.prototype.$b;
    mh.prototype.readUint64 = mh.prototype.Qd;
    mh.prototype.readInt32 = mh.prototype.Sh;
    mh.prototype.readUint32 = mh.prototype.X;
    mh.prototype.readUint16 = mh.prototype.Ha;
    mh.prototype.readUint8 = mh.prototype.ba;
    mh.prototype.getLength = mh.prototype.getLength;
    mh.prototype.getPosition = mh.prototype.Ua;
    mh.prototype.hasMoreData = mh.prototype.Pa;
    var nh = 1;
    mh.Endianness = { BIG_ENDIAN: 0, LITTLE_ENDIAN: nh };
    function ph() {
      this.i = /* @__PURE__ */ new Map();
      this.h = /* @__PURE__ */ new Map();
      this.g = false;
    }
    p = ph.prototype;
    p.box = function(a, b) {
      a = qh(a);
      this.i.set(a, rh);
      this.h.set(a, b);
      return this;
    };
    p.W = function(a, b) {
      a = qh(a);
      this.i.set(a, sh);
      this.h.set(a, b);
      return this;
    };
    p.stop = function() {
      this.g = true;
    };
    p.parse = function(a, b, c) {
      a = new mh(a, 0);
      for (this.g = false; a.Pa() && !this.g; ) this.Md(0, a, b, c);
    };
    p.Md = function(a, b, c, d) {
      var e = b.Ua();
      if (d && e + 8 > b.getLength()) this.g = true;
      else {
        var f = b.X(), g = b.X(), h = th(g), k2 = false;
        switch (f) {
          case 0:
            f = b.getLength() - e;
            break;
          case 1:
            if (d && b.Ua() + 8 > b.getLength()) {
              this.g = true;
              return;
            }
            f = b.Qd();
            k2 = true;
        }
        var l = this.h.get(g);
        if (l) {
          var m = null, n = null;
          if (this.i.get(g) == sh) {
            if (d && b.Ua() + 4 > b.getLength()) {
              this.g = true;
              return;
            }
            n = b.X();
            m = n >>> 24;
            n &= 16777215;
          }
          g = e + f;
          c && g > b.getLength() && (g = b.getLength());
          d && g > b.getLength() ? this.g = true : (g -= b.Ua(), b = g > 0 ? b.$b(g) : new Uint8Array(0), b = new mh(b, 0), l({
            name: h,
            parser: this,
            partialOkay: c || false,
            stopOnPartial: d || false,
            version: m,
            flags: n,
            reader: b,
            size: f,
            start: e + a,
            has64BitSize: k2
          }));
        } else b.skip(Math.min(e + f - b.Ua(), b.getLength() - b.Ua()));
      }
    };
    function uh(a) {
      for (var b = vh(a); a.reader.Pa() && !a.parser.g; ) a.parser.Md(a.start + b, a.reader, a.partialOkay, a.stopOnPartial);
    }
    function wh(a) {
      for (var b = vh(a), c = a.reader.X(), d = 0; d < c && (a.parser.Md(a.start + b, a.reader, a.partialOkay, a.stopOnPartial), !a.parser.g); d++) ;
    }
    function xh(a) {
      var b = vh(a);
      for (a.reader.skip(78); a.reader.Pa() && !a.parser.g; ) a.parser.Md(a.start + b, a.reader, a.partialOkay, a.stopOnPartial);
    }
    function yh(a) {
      var b = vh(a);
      a.reader.skip(8);
      var c = a.reader.Ha();
      a.reader.skip(6);
      c == 2 ? a.reader.skip(48) : a.reader.skip(12);
      for (c == 1 && a.reader.skip(16); a.reader.Pa() && !a.parser.g; ) a.parser.Md(a.start + b, a.reader, a.partialOkay, a.stopOnPartial);
    }
    function zh(a) {
      return function(b) {
        a(b.reader.$b(b.reader.getLength() - b.reader.Ua()));
      };
    }
    function qh(a) {
      var b = 0;
      a = t(a);
      for (var c = a.next(); !c.done; c = a.next()) b = b << 8 | c.value.charCodeAt(0);
      return b;
    }
    function th(a) {
      return String.fromCharCode(a >> 24 & 255, a >> 16 & 255, a >> 8 & 255, a & 255);
    }
    function vh(a) {
      return 8 + (a.has64BitSize ? 8 : 0) + (a.flags != null ? 4 : 0);
    }
    S("shaka.util.Mp4Parser", ph);
    ph.headerSize = vh;
    ph.typeToString = th;
    ph.allData = zh;
    ph.audioSampleEntry = yh;
    ph.visualSampleEntry = xh;
    ph.sampleDescription = wh;
    ph.children = uh;
    ph.prototype.parseNext = ph.prototype.Md;
    ph.prototype.parse = ph.prototype.parse;
    ph.prototype.stop = ph.prototype.stop;
    ph.prototype.fullBox = ph.prototype.W;
    ph.prototype.box = ph.prototype.box;
    var rh = 0, sh = 1;
    function Ah(a) {
      var b = this;
      this.g = [];
      this.h = [];
      this.data = [];
      new ph().box("moov", uh).box("moof", uh).W("pssh", function(c) {
        if (!(c.version > 1)) {
          var d = Lb(c.reader.h, -12, c.size);
          b.data.push(d);
          b.g.push(lc(c.reader.$b(16)));
          if (c.version > 0) {
            d = c.reader.X();
            for (var e = 0; e < d; e++) {
              var f = lc(c.reader.$b(16));
              b.h.push(f);
            }
          }
        }
      }).parse(a);
    }
    function Bh(a, b, c, d) {
      var e = a.length, f = 12 + b.length + 4 + e;
      d > 0 && (f += 4 + 16 * c.size);
      var g = new Uint8Array(f), h = Pb(g), k2 = 0;
      h.setUint32(k2, f);
      k2 += 4;
      h.setUint32(k2, 1886614376);
      k2 += 4;
      d < 1 ? h.setUint32(k2, 0) : h.setUint32(k2, 16777216);
      k2 += 4;
      g.set(b, k2);
      k2 += b.length;
      if (d > 0) for (h.setUint32(k2, c.size), k2 += 4, b = t(c), c = b.next(); !c.done; c = b.next()) c = kc(c.value), g.set(c, k2), k2 += c.length;
      h.setUint32(k2, e);
      g.set(a, k2 + 4);
      return g;
    }
    ;
    function Ch(a) {
      var b = this;
      this.F = a;
      this.j = this.C = null;
      this.ea = this.R = false;
      this.I = 0;
      this.g = null;
      this.u = new Qc();
      this.i = /* @__PURE__ */ new Map();
      this.V = [];
      this.D = /* @__PURE__ */ new Map();
      this.J = false;
      this.m = new Mg();
      this.h = null;
      this.A = function(c) {
        c.severity == 2 && b.m.reject(c);
        a.onError(c);
      };
      this.$ = /* @__PURE__ */ new Map();
      this.aa = /* @__PURE__ */ new Map();
      this.K = new Cf(function() {
        return Dh(b);
      });
      this.P = false;
      this.M = [];
      this.Z = false;
      this.G = new Cf(function() {
        Eh(b);
      });
      this.m.catch(function() {
      });
      this.l = new ih(function() {
        return Fh(b);
      });
      this.O = false;
      this.L = this.H = null;
      this.S = function() {
        return false;
      };
    }
    p = Ch.prototype;
    p.destroy = function() {
      return this.l.destroy();
    };
    function Fh(a) {
      return P(function(b) {
        switch (b.g) {
          case 1:
            return a.u.release(), a.u = null, a.m.reject(), a.G.stop(), a.G = null, a.K.stop(), a.K = null, G(b, Gh(a), 2);
          case 2:
            if (!a.j) {
              b.B(3);
              break;
            }
            sa(b, 4);
            return G(b, a.j.setMediaKeys(null), 6);
          case 6:
            ua(b, 5);
            break;
          case 4:
            va(b);
          case 5:
            a.j = null;
          case 3:
            a.g = null, a.C = null, a.D = /* @__PURE__ */ new Map(), a.h = null, a.A = function() {
            }, a.F = null, a.O = false, a.H = null, H(b);
        }
      });
    }
    p.configure = function(a, b) {
      this.h = a;
      b && (this.S = b);
      this.G && this.R && this.g && this.G.za(this.h.updateExpirationTime);
    };
    function Hh(a, b, c) {
      a.ea = true;
      a.D = /* @__PURE__ */ new Map();
      a.P = c;
      return Ih(a, b, false);
    }
    function Jh(a, b, c, d) {
      d = d === void 0 ? true : d;
      a.D = /* @__PURE__ */ new Map();
      c = t(c);
      for (var e = c.next(); !e.done; e = c.next()) a.D.set(e.value, { initData: null, initDataType: null });
      c = t(a.h.persistentSessionsMetadata);
      for (e = c.next(); !e.done; e = c.next()) e = e.value, a.D.set(e.sessionId, { initData: e.initData, initDataType: e.initDataType });
      a.P = a.D.size > 0;
      return Ih(a, b, d);
    }
    function Kh(a, b, c, d, e, f) {
      var g, h, k2, l, m;
      return P(function(n) {
        if (n.g == 1) return g = [], f.length && g.push(f[0].contentType), e.length && g.push(e[0].contentType), h = function(q) {
          q = oc(b, q, null);
          q.licenseServerUri = c;
          q.serverCertificate = d;
          q.persistentStateRequired = true;
          q.sessionType = "persistent-license";
          return q;
        }, k2 = rg(g), k2.video && (l = h(f[0].encryptionScheme || ""), k2.video.drmInfos.push(l)), k2.audio && (m = h(e[0].encryptionScheme || ""), k2.audio.drmInfos.push(m)), G(n, Rf([k2], true, a.O, []), 2);
        jh(a.l);
        return n.return(Lh(a, [k2]));
      });
    }
    function Ih(a, b, c) {
      var d, e, f, g, h, k2, l, m, n, q, r, u, w, v, y, z, A, C;
      return P(function(D) {
        if (D.g == 1) {
          Mh(a.h.clearKeys, b);
          d = b.some(function(F) {
            return F.video && F.video.drmInfos.length || F.audio && F.audio.drmInfos.length ? true : false;
          });
          e = kh(a.h.servers);
          f = kh(a.h.advanced || {});
          !d && c && Nh(b, e);
          g = /* @__PURE__ */ new WeakSet();
          h = t(b);
          for (k2 = h.next(); !k2.done; k2 = h.next()) for (l = k2.value, m = Oh(l), n = t(m), q = n.next(); !q.done; q = n.next()) r = q.value, g.has(r) || (g.add(r), Ph(r, e, f, a.h.keySystemsMapping));
          u = function(F, B) {
            var E = [];
            F = t(F);
            for (var I = F.next(); !I.done; I = F.next()) {
              I = I.value;
              var J = I[B] || f.has(I.keySystem) && f.get(I.keySystem)[B] || "", K;
              if (K = J == "") K = (K = I.keySystem) ? !!K.match(/^com\.widevine\.alpha/) : false;
              K && (B == "audioRobustness" ? J = [a.h.defaultAudioRobustnessForWidevine] : B == "videoRobustness" && (J = [a.h.defaultVideoRobustnessForWidevine]));
              if (typeof J === "string") E.push(I);
              else if (Array.isArray(J)) for (J.length === 0 && (J = [""]), J = t(J), K = J.next(); !K.done; K = J.next()) {
                var L = {};
                E.push(Object.assign({}, I, (L[B] = K.value, L)));
              }
            }
            return E;
          };
          w = /* @__PURE__ */ new WeakSet();
          v = t(b);
          for (y = v.next(); !y.done; y = v.next()) z = y.value, z.video && !w.has(z.video) && (z.video.drmInfos = u(z.video.drmInfos, "videoRobustness"), z.video.drmInfos = u(z.video.drmInfos, "audioRobustness"), w.add(z.video)), z.audio && !w.has(z.audio) && (z.audio.drmInfos = u(z.audio.drmInfos, "videoRobustness"), z.audio.drmInfos = u(z.audio.drmInfos, "audioRobustness"), w.add(z.audio));
          return G(D, Rf(b, a.P, a.O, a.h.preferredKeySystems), 2);
        }
        jh(a.l);
        A = d || e.size > 0;
        if (!A) return a.R = true, D.return(Promise.resolve());
        C = Lh(a, b);
        return D.return(d ? C : C.catch(function() {
        }));
      });
    }
    function Qh(a) {
      var b;
      return P(function(c) {
        switch (c.g) {
          case 1:
            if (a.j.mediaKeys) return c.return();
            if (!a.H) {
              c.B(2);
              break;
            }
            return G(c, a.H, 3);
          case 3:
            return jh(a.l), c.return();
          case 2:
            return sa(c, 4), a.H = a.j.setMediaKeys(a.C), G(c, a.H, 6);
          case 6:
            ua(c, 5);
            break;
          case 4:
            b = va(c), a.A(new U(2, 6, 6003, b.message));
          case 5:
            jh(a.l), H(c);
        }
      });
    }
    function Rh(a, b) {
      return P(function(c) {
        if (c.g == 1) return G(c, Qh(a), 2);
        Sh(a, b.initDataType, Lb(b.initData));
        H(c);
      });
    }
    p.bc = function(a) {
      var b = this, c, d;
      return P(function(e) {
        if (e.g == 1) {
          if (b.j === a) return e.return();
          if (!b.C) return b.u.qa(a, "encrypted", function() {
            b.A(new U(2, 6, 6010));
          }), e.return();
          b.j = a;
          b.u.qa(b.j, "play", function() {
            for (var f = t(b.M), g = f.next(); !g.done; g = f.next()) Th(b, g.value);
            b.Z = true;
            b.M = [];
          });
          b.j.remote ? (b.u.o(b.j.remote, "connect", function() {
            return Gh(b);
          }), b.u.o(b.j.remote, "connecting", function() {
            return Gh(b);
          }), b.u.o(b.j.remote, "disconnect", function() {
            return Gh(b);
          })) : "webkitCurrentPlaybackTargetIsWireless" in b.j && b.u.o(b.j, "webkitcurrentplaybacktargetiswirelesschanged", function() {
            return Gh(b);
          });
          b.L = b.g ? b.g.initData.find(function(f) {
            return f.initData.length > 0;
          }) || null : null;
          c = b.g.keySystem;
          return (d = Sb().Kh(c)) || !(b.L || b.D.size || b.h.parseInbandPsshEnabled) ? (b.u.o(b.j, "encrypted", function(f) {
            return Rh(b, f);
          }), e.B(2)) : G(e, Qh(b), 2);
        }
        Uh(b).catch(function() {
        });
        H(e);
      });
    };
    function Vh(a) {
      var b, c, d, e, f;
      return P(function(g) {
        switch (g.g) {
          case 1:
            if (!a.C || !a.g) return g.return();
            if (!a.g.serverCertificateUri || a.g.serverCertificate && a.g.serverCertificate.length) {
              g.B(2);
              break;
            }
            b = ah([a.g.serverCertificateUri], a.h.retryParameters);
            sa(g, 3);
            c = a.F.Bc.request(5, b, { isPreload: a.S() });
            return G(g, c.promise, 5);
          case 5:
            d = g.h;
            a.g.serverCertificate = Lb(d.data);
            ua(g, 4);
            break;
          case 3:
            throw e = va(g), new U(2, 6, 6017, e);
          case 4:
            if (a.l.g) return g.return();
          case 2:
            if (!a.g.serverCertificate || !a.g.serverCertificate.length) return g.return();
            sa(g, 6);
            return G(g, a.C.setServerCertificate(a.g.serverCertificate), 8);
          case 8:
            ua(g, 0);
            break;
          case 6:
            throw f = va(g), new U(2, 6, 6004, f.message);
        }
      });
    }
    function Wh(a, b) {
      var c, d, e;
      return P(function(f) {
        if (f.g == 1) return G(f, Xh(a, b, { initData: null, initDataType: null }), 2);
        if (f.g != 3) {
          c = f.h;
          if (!c) return f.return();
          d = [];
          if (e = a.i.get(c)) e.Rb = new Mg(), d.push(e.Rb);
          d.push(c.remove());
          return G(f, Promise.all(d), 3);
        }
        a.i.delete(c);
        H(f);
      });
    }
    function Uh(a) {
      var b, c, d, e, f;
      return P(function(g) {
        if (g.g == 1) {
          if (!a.D.size) return g.B(2);
          a.D.forEach(function(h, k2) {
            Xh(a, k2, h);
          });
          return G(g, a.m, 3);
        }
        if (g.g != 2) {
          b = a.g && a.g.keyIds || /* @__PURE__ */ new Set([]);
          if (b.size > 0 && Yh(a)) return g.return(a.m);
          a.J = false;
          a.m = new Mg();
          a.m.catch(function() {
          });
        }
        c = (a.g ? a.g.initData : []) || [];
        d = t(c);
        for (e = d.next(); !e.done; e = d.next()) f = e.value, Sh(a, f.initDataType, f.initData);
        Zh(a) && a.m.resolve();
        return g.return(a.m);
      });
    }
    function Sh(a, b, c) {
      if (c.length) {
        if (a.h.ignoreDuplicateInitData) {
          var d = a.i.values();
          d = t(d);
          for (var e = d.next(); !e.done; e = d.next()) if (Kb(c, e.value.initData)) return;
          var f = false;
          a.D.forEach(function(g) {
            !f && Kb(c, g.initData) && (f = true);
          });
          if (f) return;
        }
        a.J = true;
        a.i.size > 0 && Zh(a) && (a.m.resolve(), a.J = false, a.m = new Mg(), a.m.catch(function() {
        }));
        $h(a, b, c, a.g.sessionType);
      }
    }
    function bi(a) {
      a = a.i.keys();
      a = mb(a, function(b) {
        return b.sessionId;
      });
      return Array.from(a);
    }
    p.mh = function() {
      var a = this, b = this.i.keys();
      b = mb(b, function(c) {
        var d = a.i.get(c);
        return { sessionId: c.sessionId, sessionType: d.type, initData: d.initData, initDataType: d.initDataType };
      });
      return Array.from(b);
    };
    p.ke = function() {
      var a = Infinity, b = this.i.keys();
      b = t(b);
      for (var c = b.next(); !c.done; c = b.next()) c = c.value, isNaN(c.expiration) || (a = Math.min(a, c.expiration));
      return a;
    };
    function ci(a) {
      return a.I ? a.I : NaN;
    }
    p.tf = function() {
      return lh(this.aa);
    };
    function Lh(a, b) {
      var c, d, e, f, g, h, k2;
      return P(function(l) {
        switch (l.g) {
          case 1:
            c = /* @__PURE__ */ new Map();
            d = di(a, b, c);
            if (!d) {
              if (!navigator.requestMediaKeySystemAccess) throw new U(2, 6, 6020);
              throw new U(2, 6, 6001);
            }
            jh(a.l);
            sa(l, 2);
            d.getConfiguration();
            var m = e = a.h.keySystemsMapping[d.keySystem] || d.keySystem, n = c.get(e), q = [], r = [], u = [], w = [], v = [], y = /* @__PURE__ */ new Set(), z = /* @__PURE__ */ new Set();
            ei(n, q, r, w, u, v, y, z);
            var A = a.P ? "persistent-license" : "temporary";
            m = {
              keySystem: m,
              encryptionScheme: q[0],
              licenseServerUri: r[0],
              distinctiveIdentifierRequired: n[0].distinctiveIdentifierRequired,
              persistentStateRequired: n[0].persistentStateRequired,
              sessionType: n[0].sessionType || A,
              audioRobustness: n[0].audioRobustness || "",
              videoRobustness: n[0].videoRobustness || "",
              serverCertificate: w[0],
              serverCertificateUri: u[0],
              initData: v,
              keyIds: y
            };
            z.size > 0 && (m.keySystemUris = z);
            n = t(n);
            for (z = n.next(); !z.done; z = n.next()) z = z.value, z.distinctiveIdentifierRequired && (m.distinctiveIdentifierRequired = z.distinctiveIdentifierRequired), z.persistentStateRequired && (m.persistentStateRequired = z.persistentStateRequired);
            a.g = m;
            if (!a.g.licenseServerUri) throw new U(2, 6, 6012, a.g.keySystem);
            return G(l, d.createMediaKeys(), 4);
          case 4:
            f = l.h;
            jh(a.l);
            a.C = f;
            if (!(a.h.minHdcpVersion != "" && "getStatusForPolicy" in a.C)) {
              l.B(5);
              break;
            }
            sa(l, 6);
            return G(l, a.C.getStatusForPolicy({ minHdcpVersion: a.h.minHdcpVersion }), 8);
          case 8:
            g = l.h;
            if (g != "usable") throw new U(2, 6, 6018);
            jh(a.l);
            ua(l, 5, 2);
            break;
          case 6:
            h = va(l, 2);
            if (h instanceof U) throw h;
            throw new U(2, 6, 6019, h.message);
          case 5:
            return a.R = true, a.G.za(a.h.updateExpirationTime), G(l, Vh(a), 9);
          case 9:
            jh(a.l);
            ua(l, 0);
            break;
          case 2:
            k2 = va(l);
            jh(a.l, k2);
            a.g = null;
            if (k2 instanceof U) throw k2;
            throw new U(2, 6, 6002, k2.message);
        }
      });
    }
    function di(a, b, c) {
      for (var d = t(b), e = d.next(); !e.done; e = d.next()) {
        e = t(Oh(e.value));
        for (var f = e.next(); !f.done; f = e.next()) f = f.value, c.has(f.keySystem) || c.set(f.keySystem, []), c.get(f.keySystem).push(f);
      }
      if (c.size == 1 && c.has("")) throw new U(2, 6, 6e3);
      d = a.h.preferredKeySystems;
      d.length || (e = kh(a.h.servers), e.size == 1 && (d = Array.from(e.keys())));
      e = t(d);
      var g = e.next();
      for (f = {}; !g.done; f = { vj: void 0 }, g = e.next()) {
        f.vj = g.value;
        g = t(b);
        for (var h = g.next(); !h.done; h = g.next()) if (h = h.value.decodingInfos.find(/* @__PURE__ */ function(n) {
          return function(q) {
            return q.supported && q.keySystemAccess != null && q.keySystemAccess.keySystem == n.vj;
          };
        }(f))) return h.keySystemAccess;
      }
      e = t([true, false]);
      for (f = e.next(); !f.done; f = e.next()) for (f = f.value, g = t(b), h = g.next(); !h.done; h = g.next()) {
        h = t(h.value.decodingInfos);
        for (var k2 = h.next(); !k2.done; k2 = h.next()) if (k2 = k2.value, k2.supported && k2.keySystemAccess) {
          var l = k2.keySystemAccess.keySystem;
          if (!d.includes(l)) {
            var m = c.get(l);
            !m && a.h.keySystemsMapping[l] && (m = c.get(a.h.keySystemsMapping[l]));
            l = t(m);
            for (m = l.next(); !m.done; m = l.next()) if (!!m.value.licenseServerUri == f) return k2.keySystemAccess;
          }
        }
      }
      return null;
    }
    function fi(a) {
      Zh(a) && a.m.resolve();
    }
    function gi(a, b) {
      new Cf(function() {
        b.loaded = true;
        fi(a);
      }).Y(hi);
    }
    function Xh(a, b, c) {
      var d, e, f, g, h, k2, l;
      return P(function(m) {
        switch (m.g) {
          case 1:
            try {
              d = a.C.createSession("persistent-license");
            } catch (n) {
              return e = new U(2, 6, 6005, n.message), a.A(e), m.return(Promise.reject(e));
            }
            a.u.o(d, "message", function(n) {
              a.j && a.h.delayLicenseRequestUntilPlayed && a.j.paused && !a.Z ? a.M.push(n) : Th(a, n);
            });
            a.u.o(d, "keystatuseschange", function(n) {
              return ii(a, n);
            });
            f = { initData: c.initData, initDataType: c.initDataType, loaded: false, Nh: Infinity, Rb: null, type: "persistent-license" };
            a.i.set(d, f);
            sa(m, 2);
            return G(
              m,
              d.load(b),
              4
            );
          case 4:
            return g = m.h, jh(a.l), g || (a.i.delete(d), h = a.h.persistentSessionOnlinePlayback ? 1 : 2, a.A(new U(h, 6, 6013)), f.loaded = true), gi(a, f), fi(a), m.return(d);
          case 2:
            k2 = va(m), jh(a.l, k2), a.i.delete(d), l = a.h.persistentSessionOnlinePlayback ? 1 : 2, a.A(new U(l, 6, 6005, k2.message)), f.loaded = true, fi(a);
          case 3:
            return m.return(Promise.resolve());
        }
      });
    }
    function $h(a, b, c, d) {
      try {
        var e = a.C.createSession(d);
      } catch (f) {
        a.A(new U(2, 6, 6005, f.message));
        return;
      }
      a.u.o(e, "message", function(f) {
        a.j && a.h.delayLicenseRequestUntilPlayed && a.j.paused && !a.Z ? a.M.push(f) : Th(a, f);
      });
      a.u.o(e, "keystatuseschange", function(f) {
        return ii(a, f);
      });
      a.i.set(e, { initData: c, initDataType: b, loaded: false, Nh: Infinity, Rb: null, type: d });
      try {
        c = a.h.initDataTransform(c, b, a.g);
      } catch (f) {
        b = f;
        f instanceof U || (b = new U(2, 6, 6016, f));
        a.A(b);
        return;
      }
      a.h.logLicenseExchange && ic(c);
      e.generateRequest(b, c).catch(function(f) {
        if (!a.l.g) {
          a.i.delete(e);
          var g = f.errorCode;
          if (g && g.systemCode) {
            var h = g.systemCode;
            h < 0 && (h += 4294967296);
            h = "0x" + h.toString(16);
          }
          a.A(new U(2, 6, 6006, f.message, f, h));
        }
      });
    }
    function ji(a) {
      return P(function(b) {
        return b.g == 1 ? a.J ? G(b, a.m, 3) : b.B(0) : G(b, Promise.all(a.V.map(function(c) {
          return c.promise;
        })), 0);
      });
    }
    function Th(a, b) {
      var c, d, e, f, g, h, k2, l, m, n, q, r, u, w, v;
      P(function(y) {
        switch (y.g) {
          case 1:
            c = b.target;
            a.h.logLicenseExchange && ic(b.message);
            d = a.i.get(c);
            e = a.g.licenseServerUri;
            f = a.h.advanced[a.g.keySystem];
            b.messageType == "individualization-request" && f && f.individualizationServer && (e = f.individualizationServer);
            g = ah([e], a.h.retryParameters);
            g.body = b.message;
            g.method = "POST";
            g.licenseRequestType = b.messageType;
            g.sessionId = c.sessionId;
            g.drmInfo = a.g;
            d && (g.initData = d.initData, g.initDataType = d.initDataType);
            if (f && f.headers) for (h in f.headers) g.headers[h] = f.headers[h];
            if (a.g.keySystem === "org.w3.clearkey") {
              var z = g, A = a.g;
              try {
                var C = $b(z.body);
                if (C) {
                  var D = JSON.parse(C);
                  D.type || (D.type = A.sessionType, z.body = ac(JSON.stringify(D)));
                }
              } catch (F) {
              }
            }
            if (Bg(a.g.keySystem)) if (z = Yb(g.body, true, true), z.includes("PlayReadyKeyMessage")) {
              z = Ld(z, "PlayReadyKeyMessage");
              A = Vd(z, "HttpHeader");
              A = t(A);
              for (C = A.next(); !C.done; C = A.next()) D = C.value, C = Vd(D, "name")[0], D = Vd(D, "value")[0], g.headers[Td(C)] = Td(D);
              z = Vd(z, "Challenge")[0];
              g.body = jc(Td(z));
            } else g.headers["Content-Type"] = "text/xml; charset=utf-8";
            k2 = Date.now();
            sa(y, 2);
            m = a.F.Bc.request(2, g, { isPreload: a.S() });
            a.V.push(m);
            return G(y, m.promise, 4);
          case 4:
            l = y.h;
            ud(a.V, m);
            ua(y, 3);
            break;
          case 2:
            n = va(y);
            if (a.l.g) return y.return();
            q = new U(2, 6, 6007, n);
            a.i.size == 1 ? (a.A(q), d && d.Rb && d.Rb.reject(q)) : (d && d.Rb && d.Rb.reject(q), a.i.delete(c), Zh(a) && (a.m.resolve(), a.K.Y(0.1)));
            return y.return();
          case 3:
            if (a.l.g) return y.return();
            a.I += (Date.now() - k2) / 1e3;
            a.h.logLicenseExchange && ic(l.data);
            sa(y, 5);
            return G(y, c.update(l.data), 7);
          case 7:
            ua(
              y,
              6
            );
            break;
          case 5:
            return u = (r = va(y)) && r.message || String(r), w = new U(2, 6, 6008, u), a.A(w), d && d.Rb && d.Rb.reject(w), y.return();
          case 6:
            if (a.l.g) return y.return();
            v = new T("drmsessionupdate");
            a.F.onEvent(v);
            d && (d.Rb && d.Rb.resolve(), gi(a, d));
            H(y);
        }
      });
    }
    function ii(a, b) {
      b = b.target;
      var c = a.i.get(b), d = false;
      b.keyStatuses.forEach(function(f, g) {
        if (typeof g == "string") {
          var h = g;
          g = f;
          f = h;
        }
        h = Sb();
        if (Bg(a.g.keySystem) && g.byteLength == 16 && h.Yh()) {
          h = Pb(g);
          var k2 = h.getUint32(0, true), l = h.getUint16(4, true), m = h.getUint16(6, true);
          h.setUint32(0, k2, false);
          h.setUint16(4, l, false);
          h.setUint16(6, m, false);
        }
        f != "status-pending" && (c.loaded = true);
        f == "expired" && (d = true);
        g = lc(g).slice(0, 32);
        a.$.set(g, f);
      });
      var e = b.expiration - Date.now();
      (e < 0 || d && e < 1e3) && c && !c.Rb && (a.i.delete(b), ki(b));
      Zh(a) && (a.m.resolve(), a.K.Y(li));
    }
    function Dh(a) {
      var b = a.$, c = a.aa;
      c.clear();
      b.forEach(function(d, e) {
        return c.set(e, d);
      });
      b = Array.from(c.values());
      b.length && b.every(function(d) {
        return d == "expired";
      }) && a.A(new U(2, 6, 6014));
      a.F.Qf(lh(c));
    }
    function pi() {
      var a, b, c, d, e, f, g, h, k2, l, m, n, q, r, u, w, v, y, z, A, C, D, F, B, E, I, J, K, L, M, N, O, Q, R, V;
      return P(function(Ba) {
        if (Ba.g == 1) {
          a = "org.w3.clearkey com.widevine.alpha com.widevine.alpha.experiment com.microsoft.playready com.microsoft.playready.hardware com.microsoft.playready.recommendation com.microsoft.playready.recommendation.3000 com.microsoft.playready.recommendation.3000.clearlead com.chromecast.playready com.apple.fps.1_0 com.apple.fps com.huawei.wiseplay".split(" ");
          if (!(window2.MediaKeys && window2.navigator && window2.navigator.requestMediaKeySystemAccess && window2.MediaKeySystemAccess && window2.MediaKeySystemAccess.prototype.getConfiguration)) {
            b = {};
            c = t(a);
            for (d = c.next(); !d.done; d = c.next()) e = d.value, b[e] = null;
            return Ba.return(b);
          }
          f = "1.0 1.1 1.2 1.3 1.4 2.0 2.1 2.2 2.3".split(" ");
          g = ["SW_SECURE_CRYPTO", "SW_SECURE_DECODE", "HW_SECURE_CRYPTO", "HW_SECURE_DECODE", "HW_SECURE_ALL"];
          h = ["150", "2000", "3000"];
          k2 = { "com.widevine.alpha": g, "com.widevine.alpha.experiment": g, "com.microsoft.playready.recommendation": h };
          l = [
            { contentType: 'video/mp4; codecs="avc1.42E01E"' },
            { contentType: 'video/webm; codecs="vp8"' }
          ];
          m = [{ contentType: 'audio/mp4; codecs="mp4a.40.2"' }, { contentType: 'audio/webm; codecs="opus"' }];
          n = { videoCapabilities: l, audioCapabilities: m, initDataTypes: ["cenc", "sinf", "skd", "keyids"] };
          q = [null, "cenc", "cbcs"];
          r = /* @__PURE__ */ new Map();
          u = Sb();
          w = function(aa, Oa) {
            var La, Ja, Ea, ya, Fa, Da, za, Ca, fb, hb, ib, xb, vb;
            return P(function(Va) {
              switch (Va.g) {
                case 1:
                  return sa(Va, 2), G(Va, Oa.createMediaKeys(), 5);
                case 5:
                  La = Va.h;
                case 4:
                  ua(Va, 3);
                  break;
                case 2:
                  return va(Va), Va.return();
                case 3:
                  Ea = (Ja = Oa.getConfiguration().sessionTypes) ? Ja.includes("persistent-license") : false;
                  u.nj() && (Ea = false);
                  ya = Oa.getConfiguration().videoCapabilities;
                  Fa = Oa.getConfiguration().audioCapabilities;
                  Da = { persistentState: Ea, encryptionSchemes: [], videoRobustnessLevels: [], audioRobustnessLevels: [], minHdcpVersions: [] };
                  r.has(aa) && r.get(aa) ? Da = r.get(aa) : r.set(aa, Da);
                  (za = ya[0].encryptionScheme) && !Da.encryptionSchemes.includes(za) && Da.encryptionSchemes.push(za);
                  (Ca = ya[0].robustness) && !Da.videoRobustnessLevels.includes(Ca) && Da.videoRobustnessLevels.push(Ca);
                  (fb = Fa[0].robustness) && !Da.audioRobustnessLevels.includes(fb) && Da.audioRobustnessLevels.push(fb);
                  if ("getStatusForPolicy" in La) {
                    hb = [];
                    ib = t(f);
                    xb = ib.next();
                    for (vb = {}; !xb.done; vb = { pe: void 0 }, xb = ib.next()) vb.pe = xb.value, Da.minHdcpVersions.includes(vb.pe) || hb.push(La.getStatusForPolicy({ minHdcpVersion: vb.pe }).then(/* @__PURE__ */ function(Wd) {
                      return function(Lc) {
                        Lc != "usable" || Da.minHdcpVersions.includes(Wd.pe) || Da.minHdcpVersions.push(Wd.pe);
                      };
                    }(vb)));
                    return G(Va, Promise.all(hb), 0);
                  }
                  Va.B(0);
              }
            });
          };
          v = function(aa, Oa, La, Ja) {
            var Ea, ya, Fa, Da, za, Ca, fb, hb, ib, xb, vb;
            return P(function(Va) {
              switch (Va.g) {
                case 1:
                  sa(Va, 2);
                  Ea = Hd(n);
                  ya = t(Ea.videoCapabilities);
                  for (Fa = ya.next(); !Fa.done; Fa = ya.next()) Da = Fa.value, Da.encryptionScheme = Oa, Da.robustness = La;
                  za = t(Ea.audioCapabilities);
                  for (Ca = za.next(); !Ca.done; Ca = za.next()) fb = Ca.value, fb.encryptionScheme = Oa, fb.robustness = Ja;
                  hb = Hd(Ea);
                  hb.persistentState = "required";
                  hb.sessionTypes = ["persistent-license"];
                  ib = [hb, Ea];
                  vb = Sb();
                  return vb.Ka() == "MOBILE" ? G(Va, Gf(5, navigator.requestMediaKeySystemAccess(aa, ib)), 7) : G(Va, navigator.requestMediaKeySystemAccess(
                    aa,
                    ib
                  ), 6);
                case 6:
                  xb = Va.h;
                  Va.B(5);
                  break;
                case 7:
                  xb = Va.h;
                case 5:
                  return G(Va, w(aa, xb), 8);
                case 8:
                  ua(Va, 0);
                  break;
                case 2:
                  va(Va), H(Va);
              }
            });
          };
          y = function(aa, Oa, La, Ja) {
            var Ea, ya, Fa, Da;
            return P(function(za) {
              switch (za.g) {
                case 1:
                  return sa(za, 2), Ea = { type: "media-source", video: { contentType: l[0].contentType, width: 640, height: 480, bitrate: 1, framerate: 1 }, audio: { contentType: m[0].contentType, channels: 2, bitrate: 1, samplerate: 1 }, keySystemConfiguration: { keySystem: aa, video: { encryptionScheme: Oa, robustness: La }, audio: {
                    encryptionScheme: Oa,
                    robustness: Ja
                  } } }, Fa = Sb(), Fa.Ka() == "MOBILE" ? G(za, Gf(5, navigator.mediaCapabilities.decodingInfo(Ea)), 7) : G(za, navigator.mediaCapabilities.decodingInfo(Ea), 6);
                case 6:
                  ya = za.h;
                  za.B(5);
                  break;
                case 7:
                  ya = za.h;
                case 5:
                  return Da = ya.keySystemAccess, G(za, w(aa, Da), 8);
                case 8:
                  ua(za, 0);
                  break;
                case 2:
                  va(za), H(za);
              }
            });
          };
          z = t(a);
          for (A = z.next(); !A.done; A = z.next()) C = A.value, r.set(C, null);
          D = function(aa) {
            return Sb().Ga() === "WEBKIT" && aa === "org.w3.clearkey" ? false : true;
          };
          F = [];
          B = t(q);
          for (E = B.next(); !E.done; E = B.next()) for (I = E.value, J = t(a), K = J.next(); !K.done; K = J.next()) L = K.value, D(L) && (F.push(v(L, I, "", "")), F.push(y(L, I, "", "")));
          M = t(a);
          for (N = M.next(); !N.done; N = M.next()) for (O = N.value, Q = t(k2[O] || []), R = Q.next(); !R.done; R = Q.next()) V = R.value, D(O) && (F.push(v(O, null, V, "")), F.push(v(O, null, "", V)), F.push(y(O, null, V, "")), F.push(y(O, null, "", V)));
          return G(Ba, Promise.all(F), 2);
        }
        return Ba.return(lh(r));
      });
    }
    function ki(a) {
      return P(function(b) {
        if (b.g == 1) return sa(b, 2), G(b, Gf(qi, Promise.all([a.close().catch(function() {
        }), a.closed])), 4);
        if (b.g != 2) return ua(b, 0);
        va(b);
        H(b);
      });
    }
    function Gh(a) {
      var b;
      return P(function(c) {
        b = Array.from(a.i.entries());
        a.i.clear();
        return G(c, Promise.all(b.map(function(d) {
          d = t(d);
          var e = d.next().value;
          var f = d.next().value;
          return P(function(g) {
            if (g.g == 1) return sa(g, 2), a.ea || a.D.has(e.sessionId) || f.type !== "persistent-license" || a.h.persistentSessionOnlinePlayback ? G(g, ki(e), 5) : G(g, e.remove(), 5);
            if (g.g != 2) return ua(g, 0);
            va(g);
            H(g);
          });
        })), 0);
      });
    }
    function Oh(a) {
      return (a.video ? a.video.drmInfos : []).concat(a.audio ? a.audio.drmInfos : []);
    }
    function Eh(a) {
      a.i.forEach(function(b, c) {
        var d = b.Nh, e = c.expiration;
        isNaN(e) && (e = Infinity);
        e != d && (a.F.onExpirationUpdated(c.sessionId, e), b.Nh = e);
      });
    }
    function Zh(a) {
      a = a.i.values();
      return nb(a, function(b) {
        return b.loaded;
      });
    }
    function Yh(a) {
      for (var b = t(a.g && a.g.keyIds || /* @__PURE__ */ new Set([])), c = b.next(); !c.done; c = b.next()) if (a.$.get(c.value) !== "usable") return false;
      return true;
    }
    function Nh(a, b) {
      var c = [];
      b.forEach(function(d, e) {
        c.push({ keySystem: e, licenseServerUri: d, distinctiveIdentifierRequired: false, persistentStateRequired: false, audioRobustness: "", videoRobustness: "", serverCertificate: null, serverCertificateUri: "", initData: [], keyIds: /* @__PURE__ */ new Set() });
      });
      a = t(a);
      for (b = a.next(); !b.done; b = a.next()) b = b.value, b.video && (b.video.drmInfos = c), b.audio && (b.audio.drmInfos = c);
    }
    function ei(a, b, c, d, e, f, g, h) {
      var k2 = [];
      a = t(a);
      for (var l = a.next(), m = {}; !l.done; m = { Ra: void 0 }, l = a.next()) {
        m.Ra = l.value;
        b.includes(m.Ra.encryptionScheme) || b.push(m.Ra.encryptionScheme);
        m.Ra.keySystem == "org.w3.clearkey" && m.Ra.licenseServerUri.startsWith("data:application/json;base64,") ? k2.includes(m.Ra.licenseServerUri) || k2.push(m.Ra.licenseServerUri) : c.includes(m.Ra.licenseServerUri) || c.push(m.Ra.licenseServerUri);
        e.includes(m.Ra.serverCertificateUri) || e.push(m.Ra.serverCertificateUri);
        m.Ra.serverCertificate && (d.some(/* @__PURE__ */ function(r) {
          return function(u) {
            return Kb(u, r.Ra.serverCertificate);
          };
        }(m)) || d.push(m.Ra.serverCertificate));
        if (m.Ra.initData) {
          l = t(m.Ra.initData);
          for (var n = l.next(), q = {}; !n.done; q = { Dh: void 0 }, n = l.next()) q.Dh = n.value, f.some(/* @__PURE__ */ function(r) {
            return function(u) {
              var w = r.Dh;
              return u.keyId && u.keyId == w.keyId ? true : u.initDataType == w.initDataType && Kb(u.initData, w.initData);
            };
          }(q)) || f.push(q.Dh);
        }
        if (m.Ra.keyIds) for (l = t(m.Ra.keyIds), n = l.next(); !n.done; n = l.next()) g.add(n.value);
        if (m.Ra.keySystemUris && h) for (m = t(m.Ra.keySystemUris), l = m.next(); !l.done; l = m.next()) h.add(l.value);
      }
      if (k2.length == 1) c.push(k2[0]);
      else if (k2.length > 0) {
        b = [];
        k2 = t(k2);
        for (d = k2.next(); !d.done; d = k2.next()) d = window2.atob(d.value.split("data:application/json;base64,").pop()), d = JSON.parse(d), b.push.apply(b, x(d.keys));
        k2 = JSON.stringify({ keys: b });
        c.push("data:application/json;base64," + window2.btoa(k2));
      }
    }
    function Ph(a, b, c, d) {
      var e = a.keySystem;
      if (e && (e != "org.w3.clearkey" || !a.licenseServerUri)) {
        b.size && b.get(e) && (b = b.get(e), a.licenseServerUri = b);
        a.keyIds || (a.keyIds = /* @__PURE__ */ new Set());
        if (c = c.get(e)) a.distinctiveIdentifierRequired || (a.distinctiveIdentifierRequired = c.distinctiveIdentifierRequired), a.persistentStateRequired || (a.persistentStateRequired = c.persistentStateRequired), a.serverCertificate || (a.serverCertificate = c.serverCertificate), c.sessionType && (a.sessionType = c.sessionType), a.serverCertificateUri || (a.serverCertificateUri = c.serverCertificateUri);
        d[e] && (a.keySystem = d[e]);
        window2.cast && window2.cast.__platform__ && e == "com.microsoft.playready" && (a.keySystem = "com.chromecast.playready");
      }
    }
    function Mh(a, b) {
      a = kh(a);
      if (a.size != 0) {
        a = pc(a);
        b = t(b);
        for (var c = b.next(); !c.done; c = b.next()) c = c.value, c.video && (c.video.drmInfos = [a]), c.audio && (c.audio.drmInfos = [a]);
      }
    }
    var qi = 1, hi = 5, li = 0.5;
    function ri(a, b, c) {
      c = c === void 0 ? true : c;
      this.h = a;
      this.g = /* @__PURE__ */ new Set([a]);
      b = b || [];
      a = t(b);
      for (b = a.next(); !b.done; b = a.next()) this.add(b.value, c);
    }
    ri.prototype.add = function(a, b) {
      var c = this.h;
      b = b === void 0 ? true : b;
      var d;
      if (!(d = !!c.audio != !!a.audio || !!c.video != !!a.video || c.language != a.language) && (d = c.audio && a.audio)) {
        d = c.audio;
        var e = a.audio;
        d = !(!((!d.channelsCount || !e.channelsCount || d.channelsCount > 2 || e.channelsCount > 2) && d.channelsCount != e.channelsCount || d.spatialAudio !== e.spatialAudio || b && !si(d, e)) && ti(d.roles, e.roles) && d.groupId === e.groupId);
      }
      !d && (d = c.video && a.video) && (c = c.video, d = a.video, d = !((!b || si(c, d)) && ti(c.roles, d.roles)));
      return d ? false : (this.g.add(a), true);
    };
    ri.prototype.values = function() {
      return this.g.values();
    };
    function si(a, b) {
      if (a.mimeType != b.mimeType) return false;
      a = a.codecs.split(",").map(function(d) {
        return mf(d);
      });
      b = b.codecs.split(",").map(function(d) {
        return mf(d);
      });
      if (a.length != b.length) return false;
      a.sort();
      b.sort();
      for (var c = 0; c < a.length; c++) if (a[c] != b[c]) return false;
      return true;
    }
    function ti(a, b) {
      a = new Set(a);
      b = new Set(b);
      a.delete("main");
      b.delete("main");
      if (a.size != b.size) return false;
      a = t(a);
      for (var c = a.next(); !c.done; c = a.next()) if (!b.has(c.value)) return false;
      return true;
    }
    S("shaka.media.AdaptationSet", ri);
    S("shaka.config.CodecSwitchingStrategy", { RELOAD: "reload", SMOOTH: "smooth" });
    function ui() {
    }
    ui.prototype.create = function() {
    };
    ui.prototype.configure = function() {
    };
    ui.prototype.getConfiguration = function() {
    };
    S("shaka.media.AdaptationSetCriteria", ui);
    function vi() {
      this.g = wi;
      this.i = (/* @__PURE__ */ new Map()).set(wi, 2).set(xi, 1);
      this.h = 0;
    }
    var xi = 0, wi = 1;
    /*
     @license
     Shaka Player
     Copyright 2023 Google LLC
     SPDX-License-Identifier: Apache-2.0
    */
    function yi(a, b, c) {
      this.g = a;
      this.i = b;
      this.h = c;
    }
    function zi(a, b) {
      return P(function(c) {
        if (c.g == 1) return G(c, Mf(a.h, b, a.g.drm.preferredKeySystems, a.g.drm.keySystemsMapping), 2);
        a.g.streaming.dontChooseCodecs || If(b, a.g.preferredVideoCodecs, a.g.preferredAudioCodecs, a.g.preferredDecodingAttributes, a.g.preferredTextFormats);
        if (!b.variants.some(kg)) throw new U(2, 4, 4032);
        return c.return(Ai(a, b));
      });
    }
    function Bi(a, b) {
      var c = a.g.restrictions;
      a = a.i;
      var d = false;
      b = t(b.variants);
      for (var e = b.next(); !e.done; e = b.next()) {
        e = e.value;
        var f = e.allowedByApplication;
        e.allowedByApplication = Lf(e, c, a);
        f != e.allowedByApplication && (d = true);
      }
      return d;
    }
    function Ai(a, b) {
      var c = Bi(a, b);
      if (b) {
        var d = a.h ? a.h.g : null;
        if (d && a.h.C) {
          for (var e = /* @__PURE__ */ new Set(), f = t(b.variants), g = f.next(); !g.done; g = f.next()) g = g.value, g.audio && e.add(g.audio), g.video && e.add(g.video);
          e = t(e);
          for (f = e.next(); !f.done; f = e.next()) Ci(a, d.keySystem, f.value);
        }
        Di(a, b);
      }
      return c;
    }
    function Ci(a, b, c) {
      c = t(c.drmInfos);
      for (var d = c.next(); !d.done; d = c.next()) if (d = d.value, d.keySystem == b) {
        d = t(d.initData || []);
        for (var e = d.next(); !e.done; e = d.next()) e = e.value, Sh(a.h, e.initDataType, e.initData);
      }
    }
    function Di(a, b) {
      a = a.h ? a.h.tf() : {};
      var c = Object.keys(a);
      c = c.length && c[0] == "00";
      var d = false, e = false, f = /* @__PURE__ */ new Set(), g = /* @__PURE__ */ new Set(), h = /* @__PURE__ */ new Set();
      b = t(b.variants);
      for (var k2 = b.next(); !k2.done; k2 = b.next()) k2 = k2.value, k2.audio && h.add(k2.audio), k2.video && h.add(k2.video), k2.allowedByApplication ? k2.allowedByKeySystem && (d = true) : e = true;
      h = t(h);
      for (b = h.next(); !b.done; b = h.next()) if (b = b.value, b.keyIds.size) for (b = t(b.keyIds), k2 = b.next(); !k2.done; k2 = b.next()) {
        k2 = k2.value;
        var l = a[c ? "00" : k2];
        l ? Ei.includes(l) && g.add(l) : f.add(k2);
      }
      if (!d) throw a = {
        hasAppRestrictions: e,
        missingKeys: Array.from(f),
        restrictedKeyStatuses: Array.from(g)
      }, new U(2, 4, 4012, a);
    }
    var Ei = ["output-restricted", "internal-error"];
    function Fi() {
    }
    function Gi(a, b) {
      Hi.set(a, b);
    }
    function Ii() {
      var a = {};
      Sb();
      if (Ji()) for (var b = t(Hi.keys()), c = b.next(); !c.done; c = b.next()) a[c.value] = true;
      b = t(["application/dash+xml", "application/x-mpegurl", "application/vnd.apple.mpegurl", "application/vnd.ms-sstr+xml"]);
      for (c = b.next(); !c.done; c = b.next()) c = c.value, a[c] = Ji() ? Hi.has(c) : Ki().canPlayType(c) != "";
      return a;
    }
    function Li(a, b) {
      if (b) {
        var c = Hi.get(b.toLowerCase());
        if (c) return c;
      }
      throw new U(2, 4, 4e3, a, b);
    }
    S("shaka.media.ManifestParser", Fi);
    Fi.unregisterParserByMime = function(a) {
      Hi.delete(a);
    };
    Fi.registerParserByMime = Gi;
    Fi.registerParserByExtension = function() {
      Wc("ManifestParser.registerParserByExtension", "Please use an ManifestParser with registerParserByMime function.");
    };
    Fi.AccessibilityPurpose = { On: "visually impaired", Ym: "hard of hearing", xn: "spoken subtitles" };
    var Hi = /* @__PURE__ */ new Map();
    function Mi(a, b) {
      var c = null, d = null, e = null, f = null, g = a.X();
      b & 1 && (e = a.Qd());
      b & 2 && (f = a.X());
      b & 8 && (c = a.X());
      b & 16 && (d = a.X());
      return { trackId: g, ge: c, ie: d, nk: e, Dj: f };
    }
    function Ni(a, b) {
      return b == 1 ? (b = a.X(), a = a.X(), { baseMediaDecodeTime: b * 4294967296 + a }) : { baseMediaDecodeTime: a.X() };
    }
    function Oi(a, b) {
      b == 1 ? (a.skip(8), a.skip(8)) : (a.skip(4), a.skip(4));
      b = a.X();
      a.skip(4);
      a = a.Ha();
      return { timescale: b, language: String.fromCharCode((a >> 10) + 96) + String.fromCharCode(((a & 960) >> 5) + 96) + String.fromCharCode((a & 31) + 96) };
    }
    function Pi(a, b, c) {
      var d = a.X(), e = [], f = null;
      c & 1 && (f = a.Sh());
      c & 4 && a.skip(4);
      for (var g = 0; g < d; g++) {
        var h = { $h: null, sampleSize: null, cg: null };
        c & 256 && (h.$h = a.X());
        c & 512 && (h.sampleSize = a.X());
        c & 1024 && a.skip(4);
        c & 2048 && (h.cg = b == 0 ? a.X() : a.Sh());
        e.push(h);
      }
      return { Tn: d, Zh: e, Ug: f };
    }
    function Qi(a) {
      a.skip(6);
      a.skip(2);
      a.skip(8);
      var b = a.Ha();
      a.skip(2);
      a.skip(2);
      a.skip(2);
      a = a.Ha() + a.Ha() / 65536;
      return { channelCount: b, sampleRate: a };
    }
    function Ri(a) {
      a = a.X();
      return { codec: th(a) };
    }
    function Si(a) {
      var b = null, c = null, d = a.$b(4);
      var e = String.fromCharCode(d[0]);
      e += String.fromCharCode(d[1]);
      e += String.fromCharCode(d[2]);
      e += String.fromCharCode(d[3]);
      if (e === "nclx") {
        switch (a.Ha()) {
          case 1:
          case 5:
          case 6:
          case 7:
            b = "srgb";
            break;
          case 9:
            b = "rec2020";
            break;
          case 11:
          case 12:
            b = "p3";
        }
        d = a.Ha();
        a.Ha();
        switch (d) {
          case 1:
          case 6:
          case 13:
          case 14:
          case 15:
            c = "SDR";
            break;
          case 16:
            c = "PQ";
            break;
          case 18:
            c = "HLG";
        }
      }
      return { colorGamut: b, Ke: c };
    }
    function Ti(a, b) {
      b = b === void 0 ? false : b;
      a = a.toString(16).toUpperCase();
      return b ? a : ("0" + a).slice(-2);
    }
    function Ui(a) {
      return (a < 10 ? "0" : "") + a;
    }
    ;
    function Vi(a) {
      this.g = a;
    }
    function Wi(a) {
      for (var b = [], c = t(a.g), d = c.next(); !d.done; d = c.next()) {
        var e = b, f = e.push;
        var g = d.value;
        d = Xi;
        var h = g.id + 1;
        var k2 = g.stream.width || 0, l = g.stream.height || 0;
        g.type == "audio" && (l = k2 = 0);
        var m = g.duration * g.timescale, n = Math.floor(m / (Yi + 1));
        m = Math.floor(m % (Yi + 1));
        h = new Uint8Array([1, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 3].concat(x(Zi(h, 4)), [0, 0, 0, 0], x(Zi(n, 4)), x(Zi(m, 4)), [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0], x(Zi(k2, 2)), [0, 0], x(Zi(
          l,
          2
        )), [0, 0]));
        h = Xi("tkhd", h);
        k2 = Xi;
        n = g.duration * g.timescale;
        l = Math.floor(n / (Yi + 1));
        n = Math.floor(n % (Yi + 1));
        m = g.stream.language;
        m = m.charCodeAt(0) - 96 << 10 | m.charCodeAt(1) - 96 << 5 | m.charCodeAt(2) - 96;
        l = new Uint8Array([1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 3].concat(x(Zi(g.timescale, 4)), x(Zi(l, 4)), x(Zi(n, 4)), x(Zi(m, 2)), [0, 0]));
        l = Xi("mdhd", l);
        n = g;
        m = new Uint8Array([]);
        switch (n.type) {
          case "video":
            m = $i.value();
            break;
          case "audio":
            m = aj.value();
        }
        n = Xi("hdlr", m);
        a: {
          switch (g.type) {
            case "video":
              g = Xi(
                "minf",
                Xi("vmhd", bj.value()),
                cj.value(),
                dj(g)
              );
              break a;
            case "audio":
              g = Xi("minf", Xi("smhd", ej.value()), cj.value(), dj(g));
              break a;
          }
          g = new Uint8Array([]);
        }
        g = k2("mdia", l, n, g);
        d = d("trak", h, g);
        f.call(e, d);
      }
      b = mc.apply(ec, x(b));
      f = a.g[0];
      c = Xi;
      d = f.duration * f.timescale;
      e = Math.floor(d / (Yi + 1));
      d = Math.floor(d % (Yi + 1));
      e = new Uint8Array([1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 3].concat(x(Zi(f.timescale, 4)), x(Zi(e, 4)), x(Zi(d, 4)), [
        0,
        1,
        0,
        0,
        1,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        1,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        1,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        64,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        255,
        255,
        255,
        255
      ]));
      e = Xi("mvhd", e);
      d = [];
      a = t(a.g);
      for (k2 = a.next(); !k2.done; k2 = a.next()) g = d, h = g.push, k2 = new Uint8Array([0, 0, 0, 0].concat(x(Zi(k2.value.id + 1, 4)), [0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])), k2 = Xi("trex", k2), h.call(g, k2);
      a = mc.apply(ec, x(d));
      a = Xi("mvex", a);
      d = [];
      if (f.encrypted) {
        f = t(f.stream.drmInfos);
        for (g = f.next(); !g.done; g = f.next()) if (g = g.value, g.initData) for (g = t(g.initData), h = g.next(); !h.done; h = g.next()) d.push(h.value.initData);
        f = mc.apply(ec, x(d));
      } else f = new Uint8Array([]);
      a = c("moov", e, b, a, f);
      b = fj.value();
      c = new Uint8Array(b.byteLength + a.byteLength);
      c.set(b);
      c.set(a, b.byteLength);
      return c;
    }
    function dj(a) {
      var b = Xi, c = "aac";
      a.codecs.includes("mp3") ? c = "mp3" : a.codecs.includes("ac-3") ? c = Sb().Ce() ? "ec-3" : "ac-3" : a.codecs.includes("ec-3") ? c = "ec-3" : a.codecs.includes("opus") && (c = "opus");
      var d = new Uint8Array([]);
      switch (a.type) {
        case "video":
          if (a.codecs.includes("avc1")) {
            c = a.stream.width || 0;
            d = a.stream.height || 0;
            if (a.Xa.byteLength > 0) var e = Xi("avcC", a.Xa);
            else {
              e = Xi;
              for (var f = 7, g = [], h = [], k2 = 0, l = 0, m = 0, n = 0; n < a.Gb.length; n++) {
                var q = gj(a.Gb[n]);
                switch (q[0] & 31) {
                  case 7:
                    g.push(q);
                    f += q.length + 2;
                    break;
                  case 8:
                    h.push(q), f += q.length + 2;
                }
              }
              g.length > 0 && (k2 = g[0][1], m = g[0][2], l = g[0][3]);
              f = new Uint8Array(f);
              n = 0;
              f[n++] = 1;
              f[n++] = k2;
              f[n++] = m;
              f[n++] = l;
              f[n++] = 255;
              f[n++] = 224 | g.length;
              for (k2 = 0; k2 < g.length; k2++) f[n++] = (g[k2].length & 65280) >> 8, f[n++] = g[k2].length & 255, f.set(g[k2], n), n += g[k2].length;
              f[n++] = h.length;
              for (g = 0; g < h.length; g++) f[n++] = (h[g].length & 65280) >> 8, f[n++] = h[g].length & 255, f.set(h[g], n), n += h[g].length;
              e = e("avcC", f);
            }
            c = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0].concat(x(Zi(c, 2)), x(Zi(d, 2)), [
              0,
              72,
              0,
              0,
              0,
              72,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              1,
              19,
              118,
              105,
              100,
              101,
              111,
              106,
              115,
              45,
              99,
              111,
              110,
              116,
              114,
              105,
              98,
              45,
              104,
              108,
              115,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              0,
              24,
              17,
              17
            ]));
            d = "avc1";
            h = hj(a);
            g = new Uint8Array([]);
            a.encrypted && (g = ij(a.stream, a.codecs), d = "encv");
            d = Xi(d, c, e, h, g);
          } else a.codecs.includes("hvc1") && (d = a.stream.width || 0, e = a.stream.height || 0, c = new Uint8Array([]), a.Xa.byteLength > 0 && (c = Xi("hvcC", a.Xa)), d = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0].concat(x(Zi(d, 2)), x(Zi(e, 2)), [
            0,
            72,
            0,
            0,
            0,
            72,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            1,
            19,
            118,
            105,
            100,
            101,
            111,
            106,
            115,
            45,
            99,
            111,
            110,
            116,
            114,
            105,
            98,
            45,
            104,
            108,
            115,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            24,
            17,
            17
          ])), e = "hvc1", h = hj(a), g = new Uint8Array([]), a.encrypted && (g = ij(a.stream, a.codecs), e = "encv"), d = Xi(e, d, c, h, g));
          break;
        case "audio":
          if (c == "mp3") a = Xi(".mp3", jj(a));
          else if (c == "ac-3") c = Xi("dac3", a.Na), d = "ac-3", e = new Uint8Array([]), a.encrypted && (e = ij(a.stream, a.codecs), d = "enca"), a = Xi(d, jj(a), c, e);
          else if (c == "ec-3") c = Xi("dec3", a.Na), d = "ec-3", e = new Uint8Array([]), a.encrypted && (e = ij(a.stream, a.codecs), d = "enca"), a = Xi(d, jj(a), c, e);
          else if (c == "opus") c = Xi("dOps", a.Na), d = "Opus", e = new Uint8Array([]), a.encrypted && (e = ij(a.stream, a.codecs), d = "enca"), a = Xi(d, jj(a), c, e);
          else {
            if (a.Na.byteLength > 0) c = Xi("esds", a.Na);
            else {
              c = Xi;
              d = a.id + 1;
              e = a.stream.channelsCount || 2;
              g = a.stream.audioSamplingRate || 44100;
              k2 = qc("audio", a.codecs.split(","));
              l = { 96e3: 0, 88200: 1, 64e3: 2, 48e3: 3, 44100: 4, 32e3: 5, 24e3: 6, 22050: 7, 16e3: 8, 12e3: 9, 11025: 10, 8e3: 11, 7350: 12 };
              h = l[g];
              if (k2 === "mp4a.40.5" || k2 === "mp4a.40.29") h = l[g * 2];
              g = parseInt(k2.split(".").pop(), 10);
              d = new Uint8Array([0, 0, 0, 0, 3, 25].concat(x(Zi(d, 2)), [0, 4, 17, 64, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 2, g << 3 | h >>> 1, h << 7 | e << 3, 6, 1, 2]));
              c = c("esds", d);
            }
            d = "mp4a";
            e = new Uint8Array([]);
            a.encrypted && (e = ij(a.stream, a.codecs), d = "enca");
            a = Xi(d, jj(a), c, e);
          }
          d = a;
      }
      a = Xi("stsd", kj.value(), d);
      return b("stbl", a, Xi("stts", lj.value()), Xi("stsc", mj.value()), Xi("stsz", nj.value()), Xi("stco", oj.value()));
    }
    function hj(a) {
      if (!a.eb && !a.gb) return new Uint8Array([]);
      var b = a.gb;
      a = new Uint8Array([].concat(x(Zi(a.eb, 4)), x(Zi(b, 4))));
      return Xi("pasp", a);
    }
    function jj(a) {
      return new Uint8Array([0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, a.stream.channelsCount || 2, 0, 16, 0, 0, 0, 0].concat(x(Zi(a.stream.audioSamplingRate || 44100, 2)), [0, 0]));
    }
    function ij(a, b) {
      var c = Xi;
      b = new Uint8Array([].concat(x(Zi(pj(b.split(".")[0]), 4))));
      b = Xi("frma", b);
      var d = "cenc";
      var e = a.drmInfos[0];
      e && e.encryptionScheme && (d = e.encryptionScheme);
      d = new Uint8Array([0, 0, 0, 0].concat(x(Zi(pj(d), 4)), [0, 1, 0, 0]));
      d = Xi("schm", d);
      e = Xi;
      var f = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
      a = t(a.drmInfos);
      for (var g = a.next(); !g.done; g = a.next()) if ((g = g.value) && g.keyIds && g.keyIds.size) {
        g = t(g.keyIds);
        for (var h = g.next(); !h.done; h = g.next()) f = gj(h.value);
      }
      a = new Uint8Array([
        0,
        0,
        0,
        0,
        0,
        0,
        1,
        8
      ]);
      f = Xi("tenc", a, f);
      return c("sinf", b, d, e("schi", f));
    }
    function qj(a) {
      var b = [];
      a = t(a.g);
      for (var c = a.next(); !c.done; c = a.next()) {
        c = c.value;
        var d = b.push, e = d.apply;
        var f = Xi;
        var g = new Uint8Array([0, 0, 0, 0].concat(x(Zi(c.data ? c.data.sequenceNumber : 0, 4))));
        g = Xi("mfhd", g);
        var h;
        var k2 = c.data ? c.data.Eb : [];
        var l = new Uint8Array(4 + k2.length);
        for (h = 0; h < k2.length; h++) {
          var m = k2[h].flags;
          l[h + 4] = m.qb << 4 | m.ub << 2 | m.sb;
        }
        k2 = Xi("sdtp", l);
        var n = k2.length + 32 + 20 + 8 + 16 + 8 + 8;
        l = Xi;
        h = new Uint8Array([0, 0, 0, 58].concat(x(Zi(c.id + 1, 4)), [0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]));
        h = Xi("tfhd", h);
        m = c.data ? c.data.baseMediaDecodeTime : 0;
        var q = Math.floor(m % (Yi + 1));
        m = new Uint8Array([1, 0, 0, 0].concat(x(Zi(Math.floor(m / (Yi + 1)), 4)), x(Zi(q, 4))));
        m = Xi("tfdt", m);
        var r = n;
        n = c.data ? c.data.Eb : [];
        q = n.length;
        var u = 12 + 16 * q, w = new Uint8Array(u);
        r += 8 + u;
        w.set([c.type === "video" ? 1 : 0, 0, 15, 1].concat(x(Zi(q, 4)), x(Zi(r, 4))), 0);
        for (r = 0; r < q; r++) {
          var v = n[r];
          u = Zi(v.duration, 4);
          var y = Zi(v.size, 4), z = v.flags;
          v = Zi(v.Ab, 4);
          w.set([].concat(x(u), x(y), [z.Cb << 2 | z.qb, z.ub << 6 | z.sb << 4 | z.Db, z.pb & 61440, z.pb & 15], x(v)), 12 + 16 * r);
        }
        n = Xi("trun", w);
        k2 = l("traf", h, m, n, k2);
        f = f("moof", g, k2);
        e.call(d, b, [f, rj(c)]);
      }
      return mc.apply(ec, x(b));
    }
    function rj(a) {
      a = (a.data ? a.data.Eb : []).map(function(b) {
        return b.data;
      });
      a = mc.apply(ec, x(a));
      return Xi("mdat", a);
    }
    function Zi(a, b) {
      var c = [];
      for (--b; b >= 0; b--) c.push(a >> 8 * b & 255);
      return c;
    }
    function gj(a) {
      for (var b = new Uint8Array(a.length / 2), c = 0; c < a.length / 2; c += 1) b[c] = parseInt(String(a[c * 2] + a[c * 2 + 1]), 16);
      return b;
    }
    function pj(a) {
      for (var b = 0, c = 0; c < a.length; c += 1) b |= a.charCodeAt(c) << (a.length - c - 1) * 8;
      return b;
    }
    function Xi(a) {
      var b = Na.apply(1, arguments), c = sj.get(a);
      c || (c = [a.charCodeAt(0), a.charCodeAt(1), a.charCodeAt(2), a.charCodeAt(3)], sj.set(a, c));
      for (var d = 8, e = b.length - 1; e >= 0; e--) d += b[e].byteLength;
      e = new Uint8Array(d);
      e[0] = d >> 24 & 255;
      e[1] = d >> 16 & 255;
      e[2] = d >> 8 & 255;
      e[3] = d & 255;
      e.set(c, 4);
      c = 0;
      for (d = 8; c < b.length; c++) e.set(b[c], d), d += b[c].byteLength;
      return e;
    }
    var Yi = 4294967295, sj = /* @__PURE__ */ new Map(), $i = new Rb(function() {
      return new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 118, 105, 100, 101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86, 105, 100, 101, 111, 72, 97, 110, 100, 108, 101, 114, 0]);
    }), aj = new Rb(function() {
      return new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 115, 111, 117, 110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 111, 117, 110, 100, 72, 97, 110, 100, 108, 101, 114, 0]);
    }), lj = new Rb(function() {
      return new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0]);
    }), mj = new Rb(function() {
      return new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0]);
    }), oj = new Rb(function() {
      return new Uint8Array([
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0
      ]);
    }), nj = new Rb(function() {
      return new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
    }), bj = new Rb(function() {
      return new Uint8Array([0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0]);
    }), ej = new Rb(function() {
      return new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0]);
    }), kj = new Rb(function() {
      return new Uint8Array([0, 0, 0, 0, 0, 0, 0, 1]);
    }), fj = new Rb(function() {
      var a = new Uint8Array([105, 115, 111, 109]), b = new Uint8Array([97, 118, 99, 49]), c = new Uint8Array([0, 0, 0, 1]);
      return Xi("ftyp", a, c, a, b);
    }), cj = new Rb(function() {
      var a = new Uint8Array([
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        1,
        0,
        0,
        0,
        12,
        117,
        114,
        108,
        32,
        0,
        0,
        0,
        1
      ]);
      a = Xi("dref", a);
      return Xi("dinf", a);
    });
    function tj(a) {
      a = Lb(a);
      var b = null;
      new ph().box("moov", uh).box("trak", uh).box("mdia", uh).box("minf", uh).box("stbl", uh).W("stsd", wh).box("enca", function(c) {
        b = c.reader.h;
        return yh(c);
      }).box("sinf", uh).box("frma", function(c) {
        c.parser.stop();
        Ri(c.reader).codec === "ec-3" && b && b.getUint16(16) !== 2 && b.setUint16(16, 2);
      }).parse(a);
      return a;
    }
    function uj(a, b, c) {
      function d(r) {
        n.push({ box: r, pj: 1701733217 });
      }
      function e(r) {
        n.push({ box: r, pj: 1701733238 });
      }
      function f(r) {
        k2 = true;
        r.parser.stop();
      }
      function g(r) {
        m.push(r);
        uh(r);
      }
      var h = b = Lb(b), k2 = false, l, m = [], n = [];
      new ph().box("moov", g).box("trak", g).box("mdia", g).box("minf", g).box("stbl", g).W("stsd", function(r) {
        l = r;
        m.push(r);
        wh(r);
      }).W("encv", f).W("enca", f).W("dvav", e).W("dva1", e).W("dvh1", e).W("dvhe", e).W("dvc1", e).W("dvi1", e).W("hev1", e).W("hvc1", e).W("avc1", e).W("avc3", e).W("ac-3", d).W("ec-3", d).W(
        "ac-4",
        d
      ).W("Opus", d).W("fLaC", d).W("mp4a", d).parse(b);
      if (k2) return b;
      if (n.length == 0 || !l) throw jb(lc(b)), new U(2, 3, 3019, c);
      n.reverse();
      c = t(n);
      for (var q = c.next(); !q.done; q = c.next()) q = q.value, h = vj(a, h, l, q.box, m, q.pj);
      return Sb().yj() ? (a = new Uint8Array(b.byteLength + h.byteLength), a.set(h), a.set(b, h.byteLength), a) : h;
    }
    function wj(a) {
      a = Lb(a);
      var b = [];
      new ph().box("mdat", function(g) {
        b.push(g);
      }).parse(a);
      for (var c = [], d = 0; d < b.length; d++) {
        var e = b[d - 1], f = b[d];
        c.push(xj(a.subarray(e ? e.start + e.size : 0, f.start + f.size)));
      }
      return mc.apply(ec, x(c));
    }
    function xj(a) {
      function b(n) {
        g.push(n);
        uh(n);
      }
      var c, d, e, f, g = [];
      new ph().box("moof", b).box("traf", b).W("tfhd", function(n) {
        c = n;
        e = Mi(n.reader, n.flags);
      }).W("trun", function(n) {
        d = n;
        f = Pi(n.reader, n.version, n.flags);
      }).parse(a);
      if (e && e.Dj !== 2) {
        var h = c.start + vh(c) + 4 + (e.nk !== null ? 8 : 0), k2 = Pb(a);
        if (e.Dj !== null) k2.setUint32(h, 2);
        else {
          yj(a, c.start, c.size + 4);
          var l = k2.getUint32(c.start + 8);
          k2.setUint32(c.start + 8, l | 2);
          f && f.Ug !== null && k2.setInt32(d.start + vh(d) + 4, f.Ug + 4);
          l = a.subarray(0, h);
          k2 = a.subarray(h);
          a = new Uint8Array(a.byteLength + 4);
          a.set(l);
          l = [];
          for (var m = 3; m >= 0; m--) l.push(2 >> 8 * m & 255);
          a.set(new Uint8Array(l), h);
          a.set(k2, h + 4);
          h = t(g);
          for (k2 = h.next(); !k2.done; k2 = h.next()) k2 = k2.value, yj(a, k2.start, k2.size + 4);
        }
      }
      return a;
    }
    function vj(a, b, c, d, e, f) {
      var g = ij(a, d.name), h = b.subarray(d.start, d.start + d.size);
      a = new Uint8Array(d.size + g.byteLength);
      a.set(h, 0);
      Pb(a).setUint32(4, f);
      a.set(g, d.size);
      yj(a, 0, a.byteLength);
      f = new Uint8Array(b.byteLength + a.byteLength);
      d = Sb().Af() ? d.start : d.start + d.size;
      g = b.subarray(d);
      f.set(b.subarray(0, d));
      f.set(a, d);
      f.set(g, d + a.byteLength);
      b = t(e);
      for (e = b.next(); !e.done; e = b.next()) e = e.value, yj(f, e.start, e.size + a.byteLength);
      a = Pb(f, c.start);
      c = vh(c);
      b = a.getUint32(c);
      a.setUint32(c, b + 1);
      return f;
    }
    function yj(a, b, c) {
      a = Pb(a, b);
      b = a.getUint32(0);
      b != 0 && (b == 1 ? (a.setUint32(8, c >> 32), a.setUint32(12, c & 4294967295)) : a.setUint32(0, c));
    }
    function zj(a) {
      function b(e) {
        d.push({ start: e.start, size: e.size });
        uh(e);
      }
      var c = Lb(a), d = [];
      new ph().box("moov", b).box("trak", b).box("mdia", b).box("minf", b).box("stbl", b).box("stsd", function(e) {
        d.push({ start: e.start, size: e.size });
        for (var f = Pb(c, e.start), g = 0; g < e.size - 3; g++) {
          var h = f.getUint32(g);
          h == 1633889587 ? f.setUint32(g, 1700998451) : h == 1684103987 && f.setUint32(g, 1684366131);
        }
      }).parse(c);
      return c;
    }
    ;
    function Aj(a, b, c, d, e, f, g, h) {
      this.T = a;
      this.startByte = b;
      this.endByte = c;
      this.Kd = d === void 0 ? null : d;
      this.timescale = e === void 0 ? null : e;
      this.h = f === void 0 ? null : f;
      this.aesKey = g === void 0 ? null : g;
      this.g = this.mimeType = this.codecs = null;
      this.encrypted = h === void 0 ? false : h;
    }
    Aj.prototype.Nc = function() {
      return this.startByte;
    };
    Aj.prototype.Lc = function() {
      return this.endByte;
    };
    Aj.prototype.Ee = function(a) {
      this.h = a;
    };
    Aj.prototype.fc = function() {
      return this.h;
    };
    function Bj(a, b) {
      return a === b ? true : a && b ? a.Nc() == b.Nc() && a.Lc() == b.Lc() && wd(a.T().sort(), b.T().sort()) && Kb(a.fc(), b.fc()) : a == b;
    }
    S("shaka.media.InitSegmentReference", Aj);
    Aj.prototype.getEndByte = Aj.prototype.Lc;
    Aj.prototype.getStartByte = Aj.prototype.Nc;
    function Cj(a, b, c, d, e, f, g, h, k2, l, m, n, q, r, u, w) {
      l = l === void 0 ? [] : l;
      r = r === void 0 ? Dj : r;
      this.startTime = a;
      this.j = this.endTime = b;
      this.F = c;
      this.startByte = d;
      this.endByte = e;
      this.ha = f;
      this.timestampOffset = g;
      this.appendWindowStart = h;
      this.appendWindowEnd = k2;
      this.g = l;
      this.tilesLayout = m === void 0 ? "" : m;
      this.D = n === void 0 ? null : n;
      this.h = q === void 0 ? null : q;
      this.status = r;
      this.preload = false;
      this.l = true;
      this.m = false;
      this.aesKey = u === void 0 ? null : u;
      this.thumbnailSprite = null;
      this.i = -1;
      this.C = w === void 0 ? false : w;
      this.G = this.u = false;
      a = t(this.g);
      for (b = a.next(); !b.done; b = a.next()) b.value.lj();
      this.C && this.g.length && this.g[this.g.length - 1].kj();
      this.A = this.bandwidth = this.mimeType = this.codecs = null;
      this.H = false;
    }
    p = Cj.prototype;
    p.T = function() {
      return this.F();
    };
    p.getStartTime = function() {
      return this.startTime;
    };
    p.Mk = function() {
      return this.endTime;
    };
    p.Nc = function() {
      return this.startByte;
    };
    p.Lc = function() {
      return this.endByte;
    };
    p.ql = function() {
      return this.tilesLayout;
    };
    p.ol = function() {
      return this.D;
    };
    p.Oc = function() {
      return this.status;
    };
    p.Ol = function() {
      this.status = Ej;
    };
    p.Jh = function() {
      this.preload = true;
    };
    p.isPreload = function() {
      return this.preload;
    };
    p.Jd = function() {
      this.l = false;
    };
    p.El = function() {
      return this.l;
    };
    p.lj = function() {
      this.u = true;
    };
    p.Gl = function() {
      return this.u;
    };
    p.kj = function() {
      this.G = true;
    };
    p.Fl = function() {
      return this.G;
    };
    p.jj = function() {
      this.m = true;
    };
    p.Al = function() {
      return this.m;
    };
    p.jg = function(a) {
      this.thumbnailSprite = a;
    };
    p.ll = function() {
      return this.thumbnailSprite;
    };
    p.offset = function(a) {
      this.startTime += a;
      this.endTime += a;
      this.j += a;
      for (var b = t(this.g), c = b.next(); !c.done; c = b.next()) c = c.value, c.startTime += a, c.endTime += a, c.j += a;
    };
    p.pi = function(a) {
      this.h == null ? ab("Sync attempted without sync time!") : (a = this.h - a - this.startTime, Math.abs(a) >= 1e-3 && this.offset(a));
    };
    p.Ee = function(a, b) {
      this.A = a;
      this.H = b === void 0 ? false : b;
    };
    p.fc = function(a) {
      var b = this.A;
      (a === void 0 || a) && this.H && (this.A = null);
      return b;
    };
    function Fj(a, b) {
      a.ha = b;
      a = t(a.g);
      for (var c = a.next(); !c.done; c = a.next()) Fj(c.value, b);
    }
    S("shaka.media.SegmentReference", Cj);
    Cj.prototype.getSegmentData = Cj.prototype.fc;
    Cj.prototype.setSegmentData = Cj.prototype.Ee;
    Cj.prototype.syncAgainst = Cj.prototype.pi;
    Cj.prototype.offset = Cj.prototype.offset;
    Cj.prototype.getThumbnailSprite = Cj.prototype.ll;
    Cj.prototype.setThumbnailSprite = Cj.prototype.jg;
    Cj.prototype.hasByterangeOptimization = Cj.prototype.Al;
    Cj.prototype.markAsByterangeOptimization = Cj.prototype.jj;
    Cj.prototype.isLastPartial = Cj.prototype.Fl;
    Cj.prototype.markAsLastPartial = Cj.prototype.kj;
    Cj.prototype.isPartial = Cj.prototype.Gl;
    Cj.prototype.markAsPartial = Cj.prototype.lj;
    Cj.prototype.isIndependent = Cj.prototype.El;
    Cj.prototype.markAsNonIndependent = Cj.prototype.Jd;
    Cj.prototype.isPreload = Cj.prototype.isPreload;
    Cj.prototype.markAsPreload = Cj.prototype.Jh;
    Cj.prototype.markAsUnavailable = Cj.prototype.Ol;
    Cj.prototype.getStatus = Cj.prototype.Oc;
    Cj.prototype.getTileDuration = Cj.prototype.ol;
    Cj.prototype.getTilesLayout = Cj.prototype.ql;
    Cj.prototype.getEndByte = Cj.prototype.Lc;
    Cj.prototype.getStartByte = Cj.prototype.Nc;
    Cj.prototype.getEndTime = Cj.prototype.Mk;
    Cj.prototype.getStartTime = Cj.prototype.getStartTime;
    Cj.prototype.getUris = Cj.prototype.T;
    var Dj = 0, Ej = 1;
    Cj.Status = { Fm: Dj, Mn: Ej, ln: 2 };
    function Gj(a) {
      return a.length == 1 && a.end(0) - a.start(0) < 1e-4;
    }
    function Hj(a) {
      return !a || Gj(a) ? null : a.length == 1 && a.start(0) < 0 ? 0 : a.length ? a.start(0) : null;
    }
    function Ij(a) {
      return !a || Gj(a) ? null : a.length ? a.end(a.length - 1) : null;
    }
    function Jj(a, b) {
      return !a || !a.length || Gj(a) || b > a.end(a.length - 1) ? false : b >= a.start(0);
    }
    function Kj(a, b) {
      if (!a || !a.length || Gj(a)) return 0;
      var c = 0;
      a = t(Lj(a));
      for (var d = a.next(); !d.done; d = a.next()) {
        var e = d.value;
        d = e.start;
        e = e.end;
        e > b && (c += e - Math.max(d, b));
      }
      return c;
    }
    function Mj(a, b, c) {
      if (!a || !a.length || Gj(a)) return null;
      a = Lj(a).findIndex(function(d, e, f) {
        return d.start > b && (e == 0 || f[e - 1].end - b <= c);
      });
      return a >= 0 ? a : null;
    }
    function Lj(a) {
      if (!a) return [];
      for (var b = [], c = 0; c < a.length; c++) b.push({ start: a.start(c), end: a.end(c) });
      return b;
    }
    ;
    function Nj() {
    }
    function W(a) {
      return document.createElement(a);
    }
    function Oj() {
      var a = document.createElement("button");
      a.setAttribute("type", "button");
      return a;
    }
    function Pj(a, b) {
      var c = document.createElement("source");
      c.src = a;
      c.type = b === void 0 ? "" : b;
      return c;
    }
    function Qj(a) {
      for (var b = false, c = a.getElementsByTagName("source"), d = c.length - 1; d >= 0; --d) a.removeChild(c[d]), b = true;
      a.src && (a.removeAttribute("src"), b = true);
      return b;
    }
    function Rj(a) {
      a = a.getElementsByClassName("shaka-overflow-quality-mark");
      return a.length ? a[0] : null;
    }
    function Sj(a) {
      for (; a.firstChild; ) a.removeChild(a.firstChild);
    }
    function Ki() {
      if (Tj) return Tj;
      Uj || (Uj = new Cf(function() {
        Tj = null;
      }));
      (Tj = document.getElementsByTagName("video")[0] || document.getElementsByTagName("audio")[0]) || (Tj = document.createElement("video"));
      Uj.Y(1);
      return Tj;
    }
    function Vj(a, b) {
      var c, d, e, f, g;
      return P(function(h) {
        if (h.g == 1) return "fonts" in document && "FontFace" in window2 ? G(h, document.fonts.ready, 2) : h.return();
        if (!("entries" in document.fonts)) return h.return();
        c = function(k2) {
          k2 = k2.entries();
          for (var l = [], m = k2.next(); m.done === false; ) l.push(m.value), m = k2.next();
          return l;
        };
        d = t(c(document.fonts));
        for (e = d.next(); !e.done; e = d.next()) if (f = e.value, f.family === a && f.display === "swap") return h.return();
        g = new FontFace(a, "url(" + b + ")", { display: "swap" });
        document.fonts.add(g);
        H(h);
      });
    }
    S("shaka.util.Dom", Nj);
    Nj.removeAllChildren = Sj;
    Nj.clearSourceFromVideo = Qj;
    var Uj = null, Tj = null;
    /*
     @license
     Shaka Player
     Copyright 2022 Google LLC
     SPDX-License-Identifier: Apache-2.0
    */
    function Wj() {
    }
    function Xj(a, b) {
      return b + 10 <= a.length && a[b] === 73 && a[b + 1] === 68 && a[b + 2] === 51 && a[b + 3] < 255 && a[b + 4] < 255 && a[b + 6] < 128 && a[b + 7] < 128 && a[b + 8] < 128 && a[b + 9] < 128 ? true : false;
    }
    function Yj(a, b) {
      return b + 10 <= a.length && a[b] === 51 && a[b + 1] === 68 && a[b + 2] === 73 && a[b + 3] < 255 && a[b + 4] < 255 && a[b + 6] < 128 && a[b + 7] < 128 && a[b + 8] < 128 && a[b + 9] < 128 ? true : false;
    }
    function Zj(a, b) {
      var c = (a[b] & 127) << 21;
      c |= (a[b + 1] & 127) << 14;
      c |= (a[b + 2] & 127) << 7;
      return c |= a[b + 3] & 127;
    }
    function ak(a) {
      var b = { key: a.type, description: "", data: "", mimeType: null, pictureType: null };
      if (a.type === "APIC") {
        if (a.size < 2 || a.data[0] !== 3) return null;
        var c = a.data.subarray(1).indexOf(0);
        if (c === -1) return null;
        var d = Xb(Lb(a.data, 1, c)), e = a.data[2 + c], f = a.data.subarray(3 + c).indexOf(0);
        if (f === -1) return null;
        var g = Xb(Lb(a.data, 3 + c, f)), h;
        d === "-->" ? h = Xb(Lb(a.data, 4 + c + f)) : h = Mb(a.data.subarray(4 + c + f));
        b.mimeType = d;
        b.pictureType = e;
        b.description = g;
        b.data = h;
        return b;
      }
      if (a.type === "TXXX") {
        if (a.size < 2 || a.data[0] !== 3) return null;
        d = a.data.subarray(1).indexOf(0);
        if (d === -1) return null;
        c = Xb(Lb(a.data, 1, d));
        a = Xb(Lb(a.data, 2 + d)).replace(/\0*$/, "");
        b.description = c;
        b.data = a;
        return b;
      }
      if (a.type === "WXXX") {
        if (a.size < 2 || a.data[0] !== 3) return null;
        d = a.data.subarray(1).indexOf(0);
        if (d === -1) return null;
        c = Xb(Lb(a.data, 1, d));
        a = Xb(Lb(a.data, 2 + d)).replace(/\0*$/, "");
        b.description = c;
        b.data = a;
        return b;
      }
      if (a.type === "PRIV") {
        if (a.size < 2) return null;
        c = a.data.indexOf(0);
        if (c === -1) return null;
        c = Xb(Lb(a.data, 0, c));
        b.description = c;
        c == "com.apple.streaming.transportStreamTimestamp" ? (c = a.data.subarray(c.length + 1), a = c[3] & 1, c = (c[4] << 23) + (c[5] << 15) + (c[6] << 7) + c[7], c /= 45, a && (c += 4772185884e-2), b.data = c) : (a = Mb(a.data.subarray(c.length + 1)), b.data = a);
        return b;
      }
      if (a.type[0] === "T") {
        if (a.size < 2 || a.data[0] !== 3) return null;
        a = Xb(a.data.subarray(1)).replace(/\0*$/, "");
        b.data = a;
        return b;
      }
      return a.type[0] === "W" ? (a = Xb(a.data).replace(/\0*$/, ""), b.data = a, b) : a.data ? (b.data = Mb(a.data), b) : null;
    }
    function bk(a) {
      for (var b = 0, c = []; Xj(a, b); ) {
        var d = Zj(a, b + 6);
        a[b + 5] >> 6 & 1 && (b += 10);
        b += 10;
        for (d = b + d; b + 10 < d; ) {
          var e = a.subarray(b), f = Zj(e, 4);
          e = { type: String.fromCharCode(e[0], e[1], e[2], e[3]), size: f, data: e.subarray(10, 10 + f) };
          (f = ak(e)) && c.push(f);
          b += e.size + 10;
        }
        Yj(a, b) && (b += 10);
      }
      return c;
    }
    function ck(a, b) {
      for (var c = b = b === void 0 ? 0 : b, d = 0; Xj(a, b); ) a[b + 5] >> 6 & 1 && (d += 10), d += 10, d += Zj(a, b + 6), Yj(a, b + 10) && (d += 10), b += d;
      return d > 0 ? a.subarray(c, c + d) : new Uint8Array([]);
    }
    S("shaka.util.Id3Utils", Wj);
    Wj.getID3Data = ck;
    Wj.getID3Frames = bk;
    function dk(a) {
      return new Date(Date.UTC(1900, 0, 1, 0, 0, 0, 0) + a).getTime();
    }
    ;
    function ek(a, b) {
      this.j = a;
      if (b === void 0 ? 0 : b) {
        b = new Uint8Array(a.byteLength);
        for (var c = 0, d = 0; d < a.byteLength; d++) d >= 2 && a[d] == 3 && a[d - 1] == 0 && a[d - 2] == 0 || (b[c] = a[d], c++);
        this.j = Lb(b, 0, c);
      }
      this.i = this.j.byteLength;
      this.g = this.h = 0;
    }
    function fk(a) {
      var b = a.j.byteLength - a.i, c = new Uint8Array(4), d = Math.min(4, a.i);
      d !== 0 && (c.set(a.j.subarray(b, b + d)), a.h = new mh(c, 0).X(), a.g = d * 8, a.i -= d);
    }
    function gk(a, b) {
      if (a.g <= b) {
        b -= a.g;
        var c = Math.floor(b / 8);
        b -= c * 8;
        a.g -= c;
        fk(a);
      }
      a.h <<= b;
      a.g -= b;
    }
    function hk(a, b) {
      var c = Math.min(a.g, b), d = a.h >>> 32 - c;
      a.g -= c;
      a.g > 0 ? a.h <<= c : a.i > 0 && fk(a);
      c = b - c;
      return c > 0 ? d << c | hk(a, c) : d;
    }
    function ik(a) {
      var b;
      for (b = 0; b < a.g; ++b) if ((a.h & 2147483648 >>> b) !== 0) return a.h <<= b, a.g -= b, b;
      fk(a);
      return b + ik(a);
    }
    function jk(a) {
      gk(a, 1 + ik(a));
    }
    function X(a) {
      var b = ik(a);
      return hk(a, b + 1) - 1;
    }
    function kk(a) {
      a = X(a);
      return 1 & a ? 1 + a >>> 1 : -1 * (a >>> 1);
    }
    function lk(a) {
      return hk(a, 1) === 1;
    }
    function mk(a) {
      return hk(a, 8);
    }
    function nk(a, b) {
      for (var c = 8, d = 8, e = 0; e < b; e++) d !== 0 && (d = kk(a), d = (c + d + 256) % 256), c = d === 0 ? c : d;
    }
    function ok(a) {
      mk(a);
      X(a);
      return X(a);
    }
    S("shaka.util.ExpGolomb", ek);
    function pk() {
      this.I = null;
      this.J = false;
      this.m = this.K = null;
      this.j = [];
      this.g = [];
      this.D = this.F = null;
      this.i = [];
      this.h = [];
      this.G = null;
      this.l = [];
      this.C = this.H = this.u = this.A = null;
    }
    p = pk.prototype;
    p.clearData = function() {
      this.j = [];
      this.g = [];
      this.i = [];
      this.h = [];
      this.l = [];
    };
    p.gg = function(a) {
      this.C != null && this.C != a && (this.u = this.A = null);
      this.C = a;
    };
    p.parse = function(a) {
      if (a.length < 564) return this;
      for (var b = Math.max(0, qk(a)), c = a.length - (a.length + b) % 188, d = false, e = b; e < c; e += 188) if (a[e] == 71) {
        var f = !!(a[e + 1] & 64), g = ((a[e + 1] & 31) << 8) + a[e + 2];
        if ((a[e + 3] & 48) >> 4 > 1) {
          var h = e + 5 + a[e + 4];
          if (h == e + 188) continue;
        } else h = e + 4;
        switch (g) {
          case 0:
            f && (h += a[h] + 1);
            this.I = (a[h + 10] & 31) << 8 | a[h + 11];
            break;
          case 17:
          case 8191:
            break;
          case this.I:
            f && (h += a[h] + 1);
            f = a;
            g = { audio: -1, video: -1, yf: -1, audioCodec: "", videoCodec: "" };
            var k2 = h + 3 + ((f[h + 1] & 15) << 8 | f[h + 2]) - 4;
            for (h += 12 + ((f[h + 10] & 15) << 8 | f[h + 11]); h < k2; ) {
              var l = (f[h + 1] & 31) << 8 | f[h + 2], m = (f[h + 3] & 15) << 8 | f[h + 4];
              switch (f[h]) {
                case 6:
                  if (m > 0) for (var n = h + 5, q = m; q > 2; ) {
                    var r = f[n + 1] + 2;
                    switch (f[n]) {
                      case 5:
                        var u = Zb(f.subarray(n + 2, n + r));
                        g.audio == -1 && u === "Opus" ? (g.audio = l, g.audioCodec = "opus") : g.video == -1 && u === "AV01" && (g.video = l, g.videoCodec = "av1");
                        break;
                      case 106:
                        g.audio == -1 && (g.audio = l, g.audioCodec = "ac3");
                        break;
                      case 122:
                        g.audio == -1 && (g.audio = l, g.audioCodec = "ec3");
                        break;
                      case 124:
                        g.audio == -1 && (g.audio = l, g.audioCodec = "aac");
                        break;
                      case 127:
                        g.audioCodec == "opus" && (u = null, f[n + 2] === 128 && (u = f[n + 3]), u != null && (this.H = { channelCount: (u & 15) === 0 ? 2 : u & 15, pk: u, sampleRate: 48e3 }));
                    }
                    n += r;
                    q -= r;
                  }
                  break;
                case 15:
                  g.audio == -1 && (g.audio = l, g.audioCodec = "aac");
                  break;
                case 17:
                  g.audio == -1 && (g.audio = l, g.audioCodec = "aac-loas");
                  break;
                case 21:
                  g.yf == -1 && (g.yf = l);
                  break;
                case 27:
                  g.video == -1 && (g.video = l, g.videoCodec = "avc");
                  break;
                case 3:
                case 4:
                  g.audio == -1 && (g.audio = l, g.audioCodec = "mp3");
                  break;
                case 36:
                  g.video == -1 && (g.video = l, g.videoCodec = "hvc");
                  break;
                case 129:
                  g.audio == -1 && (g.audio = l, g.audioCodec = "ac3");
                  break;
                case 132:
                case 135:
                  g.audio == -1 && (g.audio = l, g.audioCodec = "ec3");
              }
              h += m + 5;
            }
            f = g;
            f.video != -1 && (this.K = f.video, this.m = f.videoCodec);
            f.audio != -1 && (this.F = f.audio, this.D = f.audioCodec);
            f.yf != -1 && (this.G = f.yf);
            d && !this.J && (d = false, e = b - 188);
            this.J = true;
            break;
          case this.K:
            h = a.subarray(h, e + 188);
            f ? this.j.push([h]) : this.j.length && this.j[this.j.length - 1] && this.j[this.j.length - 1].push(h);
            break;
          case this.F:
            h = a.subarray(h, e + 188);
            f ? this.i.push([h]) : this.i.length && this.i[this.i.length - 1] && this.i[this.i.length - 1].push(h);
            break;
          case this.G:
            h = a.subarray(h, e + 188);
            f ? this.l.push([h]) : this.l.length && this.l[this.l.length - 1] && this.l[this.l.length - 1].push(h);
            break;
          default:
            d = true;
        }
      }
      return this;
    };
    function rk(a, b) {
      if ((b[0] << 16 | b[1] << 8 | b[2]) !== 1) return null;
      var c = { data: new Uint8Array(0), packetLength: b[4] << 8 | b[5], pts: null, dts: null, nalus: [] };
      if (c.packetLength && c.packetLength > b.byteLength - 6) return null;
      var d = b[7];
      if (d & 192) {
        var e = (b[9] & 14) * 536870912 + (b[10] & 255) * 4194304 + (b[11] & 254) * 16384 + (b[12] & 255) * 128 + (b[13] & 254) / 2;
        a.A == null && (a.A = e);
        c.pts = sk(e, a.A);
        a.A = c.pts;
        c.dts = c.pts;
        d & 64 && (d = (b[14] & 14) * 536870912 + (b[15] & 255) * 4194304 + (b[16] & 254) * 16384 + (b[17] & 255) * 128 + (b[18] & 254) / 2, a.u == null && (a.u = d), c.dts = c.pts != e ? sk(d, a.u) : d);
        a.u = c.dts;
      }
      a = b[8] + 9;
      if (b.byteLength <= a) return null;
      c.data = b.subarray(a);
      return c;
    }
    p.Vl = function(a) {
      Wc("TsParser.parseAvcNalus", "Please use parseNalus function instead.");
      return this.Ph(a, { xe: null, state: null });
    };
    p.Ph = function(a, b) {
      var c = a.pts ? a.pts / 9e4 : null;
      a = a.data;
      var d = a.byteLength, e = 1;
      this.m == "hvc" && (e = 2);
      var f = b.state || 0, g = f, h = 0, k2 = [], l = -1, m = 0;
      f == -1 && (l = 0, m = this.m == "hvc" ? a[0] >> 1 & 63 : a[0] & 31, f = 0, h = 1);
      for (; h < d; ) {
        var n = a[h++];
        if (f) if (f === 1) f = n ? 0 : 2;
        else if (n) if (n == 1) {
          n = h - f - 1;
          if (l >= 0) k2.push({ data: a.subarray(l + e, n), fullData: a.subarray(l, n), type: m, time: c, state: null });
          else if (f = k2.length ? k2[k2.length - 1] : b.xe) g && h <= 4 - g && f.state && (f.data = f.data.subarray(0, f.data.byteLength - g), f.fullData = f.fullData.subarray(0, f.fullData.byteLength - g)), n > 0 && (n = a.subarray(0, n), f.data = mc(f.data, n), f.fullData = mc(f.fullData, n), f.state = 0);
          h < d ? (m = this.m == "hvc" ? a[h] >> 1 & 63 : a[h] & 31, l = h, f = 0) : f = -1;
        } else f = 0;
        else f = 3;
        else f = n ? 0 : 1;
      }
      l >= 0 && f >= 0 && k2.push({ data: a.subarray(l + e, d), fullData: a.subarray(l, d), type: m, time: c, state: f });
      !k2.length && b.xe && (c = k2.length ? k2[k2.length - 1] : b.xe) && (c.data = mc(c.data, a), c.fullData = mc(c.fullData, a));
      b.state = f;
      return k2;
    };
    p.getMetadata = function() {
      for (var a = [], b = t(this.l), c = b.next(); !c.done; c = b.next()) c = mc.apply(ec, x(c.value)), (c = rk(this, c)) && a.push({ cueTime: c.pts ? c.pts / 9e4 : null, data: c.data, frames: bk(c.data), dts: c.dts, pts: c.pts });
      return a;
    };
    p.Bb = function() {
      if (this.i.length && !this.h.length) for (var a = t(this.i), b = a.next(); !b.done; b = a.next()) {
        var c = mc.apply(ec, x(b.value)), d = rk(this, c);
        b = this.h.length ? this.h[this.h.length - 1] : null;
        d && d.pts != null && d.dts != null && (!b || b.pts != d.pts && b.dts != d.dts) ? this.h.push(d) : this.h.length && (c = d ? d.data : c) && (b = this.h.pop(), b.data = mc(b.data, c), this.h.push(b));
      }
      return this.h;
    };
    p.hd = function(a) {
      a = a === void 0 ? true : a;
      if (this.j.length && !this.g.length) {
        for (var b = t(this.j), c = b.next(); !c.done; c = b.next()) {
          var d = mc.apply(ec, x(c.value)), e = rk(this, d);
          c = this.g.length ? this.g[this.g.length - 1] : null;
          e && e.pts != null && e.dts != null && (!c || c.pts != e.pts && c.dts != e.dts) ? this.g.push(e) : this.g.length && (d = e ? e.data : d) && (c = this.g.pop(), c.data = mc(c.data, d), this.g.push(c));
        }
        if (a) {
          b = { xe: null, state: null };
          c = [];
          d = t(this.g);
          for (e = d.next(); !e.done; e = d.next()) e = e.value, e.nalus = this.Ph(e, b), e.nalus.length && (c.push(e), b.xe = e.nalus[e.nalus.length - 1]);
          this.g = c;
        }
      }
      return a ? this.g : (a = this.g, this.g = [], a);
    };
    p.getStartTime = function(a) {
      if (a == "audio") {
        a = null;
        var b = this.Bb();
        b.length && (a = b[0], a = Math.min(a.dts, a.pts) / 9e4);
        return a;
      }
      return a == "video" ? (a = null, b = this.hd(false), b.length && (a = b[0], a = Math.min(a.dts, a.pts) / 9e4), a) : null;
    };
    p.je = function() {
      return { audio: this.D, video: this.m };
    };
    p.xf = function() {
      for (var a = [], b = t(this.hd()), c = b.next(); !c.done; c = b.next()) a.push.apply(a, x(c.value.nalus));
      return a;
    };
    p.xl = function() {
      Wc("TsParser.getVideoResolution", "Please use getVideoInfo function instead.");
      var a = this.xh();
      return { height: a.height, width: a.width };
    };
    p.xh = function() {
      return this.m == "hvc" ? tk(this) : uk(this);
    };
    function vk(a) {
      var b = a.hd();
      return b.length > 1 && (a = b[0].pts, b = b[1].pts, !isNaN(b - a)) ? String(1 / (b - a) * 9e4) : null;
    }
    function uk(a) {
      var b = { height: null, width: null, codec: null, frameRate: null }, c = a.xf();
      if (!c.length) return b;
      c = c.find(function(r) {
        return r.type == 7;
      });
      if (!c) return b;
      c = new ek(c.data);
      var d = mk(c), e = mk(c), f = mk(c);
      jk(c);
      if (wk.includes(d)) {
        var g = X(c);
        g === 3 && gk(c, 1);
        jk(c);
        jk(c);
        gk(c, 1);
        if (lk(c)) {
          g = g !== 3 ? 8 : 12;
          for (var h = 0; h < g; h++) lk(c) && (h < 6 ? nk(c, 16) : nk(c, 64));
        }
      }
      jk(c);
      g = X(c);
      if (g === 0) X(c);
      else if (g === 1) for (gk(c, 1), jk(c), jk(c), g = X(c), h = 0; h < g; h++) jk(c);
      jk(c);
      gk(c, 1);
      g = X(c);
      h = X(c);
      var k2 = hk(c, 1);
      k2 === 0 && gk(c, 1);
      gk(
        c,
        1
      );
      var l = 0, m = 0, n = 0, q = 0;
      lk(c) && (l = X(c), m = X(c), n = X(c), q = X(c));
      b.height = String((2 - k2) * (h + 1) * 16 - n * 2 - q * 2);
      b.width = String((g + 1) * 16 - l * 2 - m * 2);
      b.codec = "avc1." + ("0" + d.toString(16).toUpperCase()).slice(-2) + ("0" + e.toString(16).toUpperCase()).slice(-2) + ("0" + f.toString(16).toUpperCase()).slice(-2);
      b.frameRate = vk(a);
      return b;
    }
    function tk(a) {
      var b = { height: null, width: null, codec: null, frameRate: null }, c = a.xf();
      if (!c.length) return b;
      c = c.find(function(D) {
        return D.type == 33;
      });
      if (!c) return b;
      var d = new ek(c.fullData, true);
      mk(d);
      mk(d);
      hk(d, 4);
      var e = hk(d, 3);
      lk(d);
      var f = hk(d, 2), g = hk(d, 1), h = hk(d, 5), k2 = hk(d, 32);
      c = mk(d);
      for (var l = mk(d), m = mk(d), n = mk(d), q = mk(d), r = mk(d), u = mk(d), w = [], v = [], y = 0; y < e; y++) w.push(lk(d)), v.push(lk(d));
      if (e > 0) for (y = e; y < 8; y++) hk(d, 2);
      for (y = 0; y < e; y++) w[y] && hk(d, 88), v[y] && mk(d);
      X(d);
      e = X(d);
      e == 3 && hk(d, 1);
      w = X(d);
      v = X(d);
      var z = y = 0, A = 0, C = 0;
      lk(d) && (y += X(d), z += X(d), A += X(d), C += X(d));
      b.width = String(w - (y + z) * (e === 1 || e === 2 ? 2 : 1));
      b.height = String(v - (A + C) * (e === 1 ? 2 : 1));
      d = function(D) {
        for (var F = 0, B = 0; B < 32; B++) F |= (D >> B & 1) << 31 - B;
        return F >>> 0;
      }(k2);
      g = g == 1 ? "H" : "L";
      f = "hvc1" + ("." + ["", "A", "B", "C"][f] + h);
      f += "." + d.toString(16).toUpperCase();
      f += "." + g + u;
      r && (f += "." + r.toString(16).toUpperCase());
      q && (f += "." + q.toString(16).toUpperCase());
      n && (f += "." + n.toString(16).toUpperCase());
      m && (f += "." + m.toString(16).toUpperCase());
      l && (f += "." + l.toString(16).toUpperCase());
      c && (f += "." + c.toString(16).toUpperCase());
      b.codec = f;
      b.frameRate = vk(a);
      return b;
    }
    function sk(a, b) {
      var c = 1;
      for (a > b && (c = -1); Math.abs(b - a) > 4294967296; ) a += c * 8589934592;
      return a;
    }
    function xk(a) {
      return qk(a) < 0 ? false : true;
    }
    function qk(a) {
      for (var b = Math.min(1e3, a.length - 564), c = 0; c < b; ) {
        if (a[c] == 71 && a[c + 188] == 71 && a[c + 376] == 71) return c;
        c++;
      }
      return -1;
    }
    S("shaka.util.TsParser", pk);
    pk.syncOffset = qk;
    pk.probe = xk;
    pk.prototype.getVideoInfo = pk.prototype.xh;
    pk.prototype.getVideoResolution = pk.prototype.xl;
    pk.prototype.getVideoNalus = pk.prototype.xf;
    pk.prototype.getCodecs = pk.prototype.je;
    pk.prototype.getStartTime = pk.prototype.getStartTime;
    pk.prototype.getVideoData = pk.prototype.hd;
    pk.prototype.getAudioData = pk.prototype.Bb;
    pk.prototype.getMetadata = pk.prototype.getMetadata;
    pk.prototype.parseNalus = pk.prototype.Ph;
    pk.prototype.parseAvcNalus = pk.prototype.Vl;
    pk.prototype.parse = pk.prototype.parse;
    pk.prototype.setDiscontinuitySequence = pk.prototype.gg;
    pk.prototype.clearData = pk.prototype.clearData;
    pk.Timescale = 9e4;
    var wk = [100, 110, 122, 244, 44, 83, 86, 118, 128, 138, 139, 134];
    function yk(a, b, c, d, e) {
      var f = this;
      this.g = a;
      this.O = c;
      this.C = d;
      this.$ = b;
      this.l = /* @__PURE__ */ new Map();
      this.F = /* @__PURE__ */ new Map();
      this.Ma = /* @__PURE__ */ new Map();
      this.h = null;
      this.Ia = false;
      this.M = e || null;
      this.u = /* @__PURE__ */ new Map();
      this.A = new Qc();
      this.j = /* @__PURE__ */ new Map();
      this.J = null;
      this.K = new Mg();
      this.va = "";
      this.fb = false;
      this.ua = true;
      this.L = false;
      this.D = this.P = null;
      this.i = zk(this, this.K);
      this.hb = this.G = false;
      this.I = new ih(function() {
        return Ak(f);
      });
      this.H = false;
      this.V = "UNKNOWN";
      this.Va = this.Za = false;
      this.Oa = new Mg();
      this.m = false;
      this.sa = null;
      this.Z = /* @__PURE__ */ new Map();
      this.ea = this.R = this.oa = this.S = null;
      this.aa = new Mg();
      this.g.remote && (this.L = this.g.remote.state != "disconnected", this.A.o(this.g.remote, "connect", function() {
        f.L = f.g.remote.state != "disconnected";
      }), this.A.o(this.g.remote, "connecting", function() {
        f.L = f.g.remote.state != "disconnected";
      }), this.A.o(this.g.remote, "disconnect", function() {
        f.L = f.g.remote.state != "disconnected";
      }));
    }
    function zk(a, b) {
      a.ua = true;
      if (window2.ManagedMediaSource) {
        a.D || (a.g.disableRemotePlayback = true);
        var c = new ManagedMediaSource();
        a.A.o(c, "startstreaming", function() {
          a.ua = true;
        });
        a.A.o(c, "endstreaming", function() {
          a.ua = false;
        });
      } else c = new MediaSource();
      a.A.qa(c, "sourceopen", function() {
        URL.revokeObjectURL(a.va);
        b.resolve();
      });
      a.A.qa(a.g, "playing", function() {
        a.fb = true;
      });
      a.va = Bk(c);
      a.C.useSourceElements ? (a.g.removeAttribute("src"), a.P && a.g.removeChild(a.P), a.D && a.g.removeChild(a.D), a.P = Pj(a.va), a.g.appendChild(a.P), a.D && a.g.appendChild(a.D), a.g.load()) : a.g.src = a.va;
      return c;
    }
    function Ck(a, b, c) {
      a.g && window2.ManagedMediaSource && a.i && a.C.useSourceElements && (a.D && a.g.removeChild(a.D), a.D = Pj(b, c), a.g.appendChild(a.D), a.g.disableRemotePlayback = false);
    }
    function Ek() {
      var a = 'video/mp4; codecs="avc1.42E01E",video/mp4; codecs="avc3.42E01E",video/mp4; codecs="hev1.1.6.L93.90",video/mp4; codecs="hvc1.1.6.L93.90",video/mp4; codecs="hev1.2.4.L153.B0"; eotf="smpte2084",video/mp4; codecs="hvc1.2.4.L153.B0"; eotf="smpte2084",video/mp4; codecs="vp9",video/mp4; codecs="vp09.00.10.08",video/mp4; codecs="av01.0.01M.08",video/mp4; codecs="dvh1.05.01",video/mp4; codecs="dvh1.20.01",audio/mp4; codecs="mp4a.40.2",audio/mp4; codecs="ac-3",audio/mp4; codecs="ec-3",audio/mp4; codecs="ac-4.02.01.01",audio/mp4; codecs="opus",audio/mp4; codecs="flac",audio/mp4; codecs="dtsc",audio/mp4; codecs="dtse",audio/mp4; codecs="dtsx",audio/mp4; codecs="apac.31.00",video/webm; codecs="vp8",video/webm; codecs="vp9",video/webm; codecs="vp09.00.10.08",audio/webm; codecs="vorbis",audio/webm; codecs="opus",video/mp2t; codecs="avc1.42E01E",video/mp2t; codecs="avc3.42E01E",video/mp2t; codecs="hvc1.1.6.L93.90",video/mp2t; codecs="mp4a.40.2",video/mp2t; codecs="ac-3",video/mp2t; codecs="ec-3",text/vtt,application/mp4; codecs="wvtt",application/ttml+xml,application/mp4; codecs="stpp"'.split(",").concat(x(ff)), b = {};
      Sb();
      a = t(a);
      for (var c = a.next(); !c.done; c = a.next()) {
        c = c.value;
        vf(c) ? b[c] = true : b[c] = Ji() ? dd(c) || (Ze(c) ? true : false) : Ki().canPlayType(c) != "";
        var d = c.split(";")[0];
        b[d] = b[d] || b[c];
      }
      return b;
    }
    p = yk.prototype;
    p.destroy = function() {
      return this.I.destroy();
    };
    function Ak(a) {
      var b, c, d, e, f, g, h, k2, l, m, n, q, r, u, w;
      return P(function(v) {
        if (v.g == 1) {
          b = [];
          c = t(a.u);
          for (d = c.next(); !d.done; d = c.next()) for (e = d.value, f = t(e), g = f.next().value, h = f.next().value, k2 = h[0], l = g, a.u.set(l, h.slice(0, 1)), k2 && b.push(k2.p.catch(Ef)), m = t(h.slice(1)), n = m.next(); !n.done; n = m.next()) q = n.value, q.p.reject(new U(2, 7, 7003, void 0));
          a.h && b.push(a.h.destroy());
          return G(v, Promise.all(b), 2);
        }
        r = t(a.j.values());
        for (u = r.next(); !u.done; u = r.next()) w = u.value, w.destroy();
        a.A && (a.A.release(), a.A = null);
        a.g && a.D && a.g.removeChild(a.D);
        a.g && a.P && (a.g.removeChild(a.P), a.g.load(), a.g.disableRemotePlayback = false);
        a.g = null;
        a.P = null;
        a.D = null;
        a.C = null;
        a.i = null;
        a.h = null;
        a.$ = null;
        a.l.clear();
        a.Ma.clear();
        a.j.clear();
        a.J = null;
        a.u.clear();
        a.M = null;
        a.Z.clear();
        a.O = null;
        H(v);
      });
    }
    p.init = function(a, b, c, d) {
      b = b === void 0 ? false : b;
      c = c === void 0 ? "UNKNOWN" : c;
      d = d === void 0 ? false : d;
      var e = this, f, g, h, k2, l, m;
      return P(function(n) {
        if (n.g == 1) return f = vc, G(n, e.K, 2);
        if (n.g != 3) {
          if (!Fk(e) && !Gk(e)) return n.B(3);
          ab("Expected MediaSource to be open during init(); reopening the media source.");
          e.K = new Mg();
          e.i = zk(e, e.K);
          return G(n, e.K, 3);
        }
        e.H = b;
        e.V = c;
        e.Za = d;
        e.Va = !e.H && e.V == "HLS" && !e.Za;
        e.Z.clear();
        e.S = null;
        e.oa = null;
        e.R = null;
        e.ea = null;
        e.aa = new Mg();
        g = t(a.keys());
        for (h = g.next(); !h.done; h = g.next()) k2 = h.value, l = a.get(k2), Hk(e, k2, l, l.codecs), e.m ? (e.u.set(f.na, []), e.u.set(f.Ja, [])) : e.u.set(k2, []);
        (m = a.get(f.na)) && m.isAudioMuxedInVideo && (e.m = true);
        H(n);
      });
    };
    function Hk(a, b, c, d) {
      b == "audio" && d && (d = Yf(d, c.mimeType));
      var e = ef(c.mimeType, d);
      if (b == tc) Ik(a, e, a.H, c.external);
      else {
        var f = a.C.forceTransmux;
        if (!dd(e) || !a.H && ff.includes(e)) f = true;
        var g = gf(c.mimeType, d);
        if (f) {
          f = rc("audio", (d || "").split(","));
          d = rc("video", (d || "").split(","));
          if (f && d) {
            a.m = true;
            Hk(a, "audio", c, f);
            Hk(a, "video", c, d);
            return;
          }
          if (d = Ze(g)) e = d(), a.j.set(b, e), e = e.convertCodecs(b, g);
        }
        g = e + a.C.addExtraFeaturesToSourceBuffer(e);
        jh(a.I);
        try {
          var h = a.i.addSourceBuffer(g);
        } catch (k2) {
          throw new U(2, 3, 3015, k2, "The mediaSource_ status was " + a.i.readyState + " expected 'open'", null);
        }
        a.H && (h.mode = Jk);
        a.A.o(h, "error", function() {
          var k2 = a.u.get(b)[0];
          k2.p.reject(new U(2, 3, 3014, a.g.error ? a.g.error.code : 0, k2.uri));
        });
        a.A.o(h, "updateend", function() {
          return Kk(a, b);
        });
        a.l.set(b, h);
        a.F.set(b, e);
        a.Ma.set(b, !!c.drmInfos.length);
      }
    }
    p.configure = function(a) {
      this.C = a;
      this.h && (this.h.C = a.modifyCueCallback);
    };
    function Lk(a) {
      return a.ua && !a.L && !a.G;
    }
    function Ik(a, b, c, d) {
      a.h || (a.h = new qf(a.$), a.h && (a.h.C = a.C.modifyCueCallback));
      var e = a.h;
      d = d || a.Ia;
      a = a.V;
      b == "application/cea-608" || b == "application/cea-708" ? e.i = null : (e.i = tf.get(b)(), e.i.setSequenceMode ? e.i.setSequenceMode(c) : Wc("Text parsers w/ setSequenceMode", 'Text parsers should have a "setSequenceMode" method!'), e.i.setManifestType ? e.i.setManifestType(a) : Wc("Text parsers w/ setManifestType", 'Text parsers should have a "setManifestType" method!'), e.D = d);
    }
    function Fk(a) {
      return a.G ? false : a.i ? a.i.readyState == "ended" : true;
    }
    function Gk(a) {
      return a.G ? false : a.i ? a.i.readyState == "closed" : true;
    }
    function Mk(a, b) {
      return a.l.size ? b == tc ? a.h.g : Hj(Nk(a, b)) : null;
    }
    function Ok(a, b) {
      return a.l.size ? b == tc ? a.h.h : Ij(Nk(a, b)) : null;
    }
    function Pk(a, b, c) {
      if (b == tc) return a = a.h, a.h == null || a.h < c ? 0 : a.h - Math.max(c, a.g);
      a = Nk(a, b);
      return Kj(a, c);
    }
    p.cc = function() {
      var a = { total: this.G ? [] : Lj(this.g.buffered), audio: Lj(Nk(this, "audio")), video: Lj(Nk(this, "video")), text: [] };
      if (this.h) {
        var b = this.h.g, c = this.h.h;
        b != null && c != null && a.text.push({ start: b, end: c });
      }
      return a;
    };
    function Nk(a, b) {
      if (a.G || a.L) return null;
      try {
        return a.l.get(b).buffered;
      } catch (c) {
        return a.l.has(b), null;
      }
    }
    function Qk(a, b, c, d, e, f) {
      var g = null, h = [], k2 = Lb(c);
      if (ff.includes(f)) b = bk(k2), b.length && d && ((c = b.find(function(r) {
        return r.description === "com.apple.streaming.transportStreamTimestamp";
      })) && typeof c.data == "number" && (g = Math.round(c.data) / 1e3), a.O.onMetadata([{ cueTime: d.startTime, data: k2, frames: b, dts: d.startTime, pts: d.startTime }], 0, d.endTime));
      else if (f.includes("/mp4") && d && d.ha && d.ha.timescale) {
        var l = d.ha.timescale;
        if (!isNaN(l)) {
          var m = e.emsgSchemeIdUris != null && e.emsgSchemeIdUris.length > 0 || a.C.dispatchAllEmsgBoxes, n = 0, q = false;
          k2 = new ph();
          m && k2.W("emsg", function(r) {
            var u = e.emsgSchemeIdUris;
            if (r.version === 0) {
              var w = r.reader.nd();
              var v = r.reader.nd();
              var y = r.reader.X();
              var z = r.reader.X();
              var A = r.reader.X();
              var C = r.reader.X();
              var D = d.startTime + z / y;
            } else y = r.reader.X(), D = r.reader.Qd() / y + d.timestampOffset, z = D - d.startTime, A = r.reader.X(), C = r.reader.X(), w = r.reader.nd(), v = r.reader.nd();
            r = r.reader.$b(r.reader.getLength() - r.reader.Ua());
            if (u && u.includes(w) || a.C.dispatchAllEmsgBoxes) {
              if (w == "urn:mpeg:dash:event:2012") a.O.Ul();
              else if (u = D + A / y, a.O.Sl({ startTime: D, endTime: u, schemeIdUri: w, value: v, timescale: y, presentationTimeDelta: z, eventDuration: A, id: C, messageData: r }), w == "https://aomedia.org/emsg/ID3" || w == "https://developer.apple.com/streaming/emsg-id3") {
                if (y = bk(r), y.length) a.O.onMetadata([{ cueTime: D, data: r, frames: y, dts: D, pts: D }], 0, u);
              }
            }
          });
          k2.W("prft", function(r) {
            var u = r.reader, w = r.version;
            u.X();
            r = u.X();
            var v = u.X();
            r = r * 1e3 + v / 4294967296 * 1e3;
            w === 0 ? u = u.X() : (w = u.X(), u = u.X(), u = w * 4294967296 + u);
            r = dk(r);
            u = (/* @__PURE__ */ new Map()).set("detail", {
              wallClockTime: r,
              programStartDate: new Date(r - u / l * 1e3)
            });
            u = new T("prft", u);
            a.O.onEvent(u);
          }).box("moof", uh).box("traf", uh).W("tfdt", function(r) {
            q || (n = Ni(r.reader, r.version).baseMediaDecodeTime / l, q = true, m || r.parser.stop());
          }).parse(c, true);
          q && d.timestampOffset == 0 && (g = n);
        }
      } else f.includes("/mp4") || f.includes("/webm") || !xk(k2) || (a.Z.has(b) || a.Z.set(b, new pk()), h = a.Z.get(b), h.clearData(), h.gg(d.i), h.parse(k2), k2 = h.getStartTime(b), k2 != null && (g = k2), h = h.getMetadata());
      return { timestamp: g, metadata: h };
    }
    function Rk(a, b, c, d, e, f, g, h, k2, l, m) {
      g = g === void 0 ? false : g;
      h = h === void 0 ? false : h;
      k2 = k2 === void 0 ? false : k2;
      l = l === void 0 ? false : l;
      var n, q, r, u, w, v, y, z, A, C, D, F, B, E, I, J, K, L;
      return P(function(M) {
        switch (M.g) {
          case 1:
            n = vc;
            if (b != n.ab) {
              M.B(2);
              break;
            }
            if (a.V != "HLS") {
              M.B(3);
              break;
            }
            return G(M, a.Oa, 4);
          case 4:
            q = M.h, a.h.A = q;
          case 3:
            return G(M, wf(a.h, c, d ? d.startTime : null, d ? d.endTime : null, d ? d.T()[0] : null), 5);
          case 5:
            return M.return();
          case 2:
            if (l || !a.m) {
              M.B(6);
              break;
            }
            return G(M, Rk(a, n.na, c, d, e, f, g, h, k2, true), 7);
          case 7:
            return G(M, Rk(
              a,
              n.Ja,
              c,
              d,
              e,
              f,
              g,
              h,
              k2,
              true
            ), 8);
          case 8:
            return M.return();
          case 6:
            if (!a.l.has(b)) return M.return();
            r = a.l.get(b).timestampOffset;
            u = a.F.get(b);
            a.j.has(b) && (u = a.j.get(b).getOriginalMimeType());
            if (d && (w = Qk(a, b, c, d, e, u), v = w.timestamp, y = w.metadata, v != null && (a.S == null && b == n.Ja && (a.S = v, a.oa = d.startTime, a.R != null && (z = 0, a.oa == a.ea && (z = a.S - a.R), a.aa.resolve(z))), a.R == null && b == n.na && (a.R = v, a.ea = d.startTime, a.S != null && (A = 0, a.oa == a.ea && (A = a.S - a.R), a.aa.resolve(A))), C = v, D = ff, !a.H && D.includes(a.F.get(b)) && (C = 0), F = d.startTime - C, B = Math.abs(r - F), (B >= 1e-3 || g || h) && (!k2 || F > 0 || !r) && (r = F, a.Va && (Sk(a, b, function() {
              return Tk(a, b);
            }, null), Sk(a, b, function() {
              return Uk(a, b, r);
            }, null))), (E = b == n.Ja || !a.l.has(n.Ja)) && a.Oa.resolve(r)), y.length)) a.O.onMetadata(y, r, d ? d.endTime : null);
            f && b == n.Ja && (a.h || Ik(a, "application/cea-608", a.H, false), a.J || (I = u.split(";", 1)[0], a.J = new ld(I)), d ? (J = a.J.Tf(c), J.length && Af(a.h, J, d.startTime, d.endTime, r)) : a.J.init(c, h, m));
            if (!a.j.has(b)) {
              M.B(9);
              break;
            }
            return G(M, a.j.get(b).transmux(c, e, d, a.i.duration, b), 10);
          case 10:
            c = M.h;
          case 9:
            c = Vk(a, e, c, d, b);
            if (!d || !a.H || b == n.ab) {
              M.B(11);
              break;
            }
            if (!g && !h) {
              M.B(11);
              break;
            }
            K = d.startTime;
            if (a.V != "HLS" || a.m || b != n.na || !a.l.has(n.Ja)) {
              M.B(13);
              break;
            }
            return G(M, a.aa, 14);
          case 14:
            L = M.h, Math.abs(L) > 0.15 && (K -= L);
          case 13:
            Sk(a, b, function() {
              return Tk(a, b);
            }, null), Sk(a, b, function() {
              return Uk(a, b, K);
            }, null);
          case 11:
            return G(M, Sk(a, b, function() {
              var N = c;
              a.M && ad(a.M, N, r, e);
              a.l.get(b).appendBuffer(N);
            }, d ? d.T()[0] : null), 15);
          case 15:
            H(M);
        }
      });
    }
    function Wk(a, b) {
      var c = Ok(a, "video") || 0;
      yf(a.h, b, c);
    }
    function Xk(a) {
      a.h && yf(a.h, "", 0);
    }
    p.remove = function(a, b, c, d) {
      var e = this, f;
      return P(function(g) {
        return g.g == 1 ? (f = vc, a == f.Ja && e.J && e.J.remove(d), a == f.ab ? G(g, e.h.remove(b, c), 0) : c > b ? G(g, Sk(e, a, function() {
          return Yk(e, a, b, c);
        }, null), 5) : g.B(0)) : e.m ? G(g, Sk(e, f.na, function() {
          return Yk(e, f.na, b, c);
        }, null), 0) : g.B(0);
      });
    };
    function Zk(a, b) {
      var c;
      return P(function(d) {
        return d.g == 1 ? (c = vc, b == c.ab ? a.h ? G(d, a.h.remove(0, Infinity), 0) : d.return() : G(d, Sk(a, b, function() {
          return Yk(a, b, 0, a.i.duration);
        }, null), 4)) : a.m ? G(d, Sk(a, c.na, function() {
          return Yk(a, c.na, 0, a.i.duration);
        }, null), 0) : d.B(0);
      });
    }
    p.flush = function(a) {
      var b = this, c;
      return P(function(d) {
        return d.g == 1 ? (c = vc, a == c.ab ? d.return() : G(d, Sk(b, a, function() {
          b.g.currentTime -= 1e-3;
          Kk(b, a);
        }, null), 2)) : b.m ? G(d, Sk(b, c.na, function() {
          var e = c.na;
          b.g.currentTime -= 1e-3;
          Kk(b, e);
        }, null), 0) : d.B(0);
      });
    };
    function $k(a, b, c, d, e, f, g, h, k2) {
      var l, m, n;
      return P(function(q) {
        if (q.g == 1) {
          l = vc;
          if (b == l.ab) return f || (a.h.A = c), xf(a.h, d, e), q.return();
          m = [];
          return G(q, al(a, b, g, h, k2), 2);
        }
        n = q.h;
        n || (m.push(Sk(a, b, function() {
          return Tk(a, b);
        }, null)), a.m && m.push(Sk(a, l.na, function() {
          return Tk(a, l.na);
        }, null)));
        f || (m.push(Sk(a, b, function() {
          return Uk(a, b, c);
        }, null)), a.m && m.push(Sk(a, l.na, function() {
          return Uk(a, l.na, c);
        }, null)));
        if (d != 0 || e != Infinity) m.push(Sk(a, b, function() {
          return bl(a, b, d, e);
        }, null)), a.m && m.push(Sk(a, l.na, function() {
          return bl(
            a,
            l.na,
            d,
            e
          );
        }, null));
        return m.length ? G(q, Promise.all(m), 0) : q.B(0);
      });
    }
    function cl(a, b, c) {
      var d, e;
      return P(function(f) {
        if (f.g == 1) {
          d = vc;
          if (b == d.ab) return f.return();
          b == d.Ja && (a.Oa = new Mg());
          if (!a.H || (e = Ok(a, b)) && Math.abs(e - c) < 0.15) return f.return();
          Sk(a, b, function() {
            return Tk(a, b);
          }, null);
          a.m && Sk(a, d.na, function() {
            return Tk(a, d.na);
          }, null);
          return G(f, Sk(a, b, function() {
            return Uk(a, b, c);
          }, null), 2);
        }
        return a.m ? G(f, Sk(a, d.na, function() {
          return Uk(a, d.na, c);
        }, null), 0) : f.B(0);
      });
    }
    p.endOfStream = function(a) {
      var b = this;
      return P(function(c) {
        return G(c, dl(b, function() {
          Fk(b) || Gk(b) || (a ? b.i.endOfStream(a) : b.i.endOfStream());
        }), 0);
      });
    };
    p.yb = function(a) {
      var b = this;
      return P(function(c) {
        return G(c, dl(b, function() {
          if (b.C.durationReductionEmitsUpdateEnd && a < b.i.duration) for (var d = t(b.l.keys()), e = d.next(); !e.done; e = d.next()) {
            e = e.value;
            var f = { start: function() {
            }, p: new Mg(), uri: null };
            b.u.get(e).unshift(f);
          }
          b.i.duration = a;
          b.sa = a;
        }), 0);
      });
    };
    p.getDuration = function() {
      return this.i.duration;
    };
    function el(a, b, c) {
      P(function(d) {
        return a.I.g || a.g.error || a.L || a.G || Fk(a) || Gk(a) ? d.return() : G(d, dl(a, function() {
          Fk(a) || Gk(a) || a.i.setLiveSeekableRange(b, c);
        }), 0);
      });
    }
    function fl(a) {
      P(function(b) {
        return a.I.g || a.g.error || a.L || a.G || Fk(a) || Gk(a) ? b.return() : G(b, dl(a, function() {
          Fk(a) || Gk(a) || a.i.clearLiveSeekableRange();
        }), 0);
      });
    }
    function Yk(a, b, c, d) {
      d <= c ? Kk(a, b) : a.l.get(b).remove(c, d);
    }
    function Tk(a, b) {
      var c = a.l.get(b), d = c.appendWindowStart, e = c.appendWindowEnd;
      c.abort();
      c.appendWindowStart = d;
      c.appendWindowEnd = e;
      Kk(a, b);
    }
    function Uk(a, b, c) {
      c < 0 && (c += 1e-3);
      a.l.get(b).timestampOffset = c;
      Kk(a, b);
    }
    function bl(a, b, c, d) {
      var e = a.l.get(b);
      if (e.appendWindowEnd !== d || e.appendWindowStart !== c) e.appendWindowStart = 0, e.appendWindowEnd = d, e.appendWindowStart = c;
      Kk(a, b);
    }
    function Kk(a, b) {
      if (a.G || a.I.g) {
        var c = a.u.get(b);
        c && c.length && ((c = c[0]) && c.p && c.p.resolve(), a.u.set(b, []));
      } else if (c = a.u.get(b)[0]) c.p.resolve(), gl(a, b);
    }
    function Sk(a, b, c, d) {
      jh(a.I);
      c = { start: c, p: new Mg(), uri: d };
      a.u.get(b).push(c);
      a.u.get(b).length == 1 && hl(a, b);
      return c.p;
    }
    function dl(a, b) {
      var c, d, e, f, g, h, k2, l, m, n, q, r, u;
      return P(function(w) {
        switch (w.g) {
          case 1:
            jh(a.I);
            c = [];
            d = Array.from(a.l.keys());
            e = t(d);
            f = e.next();
            for (g = {}; !f.done; g = { ready: void 0 }, f = e.next()) h = f.value, g.ready = new Mg(), k2 = { start: /* @__PURE__ */ function(v) {
              return function() {
                return v.ready.resolve();
              };
            }(g), p: g.ready, uri: null }, l = a.u.get(h), l.push(k2), c.push(g.ready), l.length == 1 && k2.start();
            sa(w, 2);
            return G(w, Promise.all(c), 4);
          case 4:
            ua(w, 3);
            break;
          case 2:
            throw m = va(w), m;
          case 3:
            return sa(w, 5, 6), G(w, b(), 6);
          case 6:
            wa(w);
            n = t(d);
            for (q = n.next(); !q.done; q = n.next()) r = q.value, gl(a, r);
            xa(w, 0);
            break;
          case 5:
            throw u = va(w), new U(2, 3, 3015, u, a.g.error || "No error in the media element", null);
        }
      });
    }
    function gl(a, b) {
      a.u.get(b).shift();
      hl(a, b);
    }
    function hl(a, b) {
      var c = a.u.get(b)[0];
      if (c) try {
        c.start();
      } catch (d) {
        d.name == "QuotaExceededError" ? c.p.reject(new U(2, 3, 3017, b)) : Lk(a) ? c.p.reject(new U(2, 3, 3015, d, a.g.error || "No error in the media element", c.uri)) : c.p.reject(new U(2, 3, 3024, b)), gl(a, b);
      }
    }
    function il(a, b) {
      a.$ = b;
      a.h && (a.h.j = b);
    }
    function Vk(a, b, c, d, e) {
      if (jf(a.F.get(e)) != "mp4") return c;
      var f = d === null, g = a.Ma.get(e), h = a.O.Qk(), k2 = false;
      d && d.ha && (k2 = d.ha.encrypted);
      d = d ? d.T()[0] : null;
      var l = Sb();
      a.C.correctEc3Enca && f && e === "audio" && (c = tj(c));
      a.C.insertFakeEncryptionInInit && g && l.Rd(h, e) && (f ? c = uj(b, c, d) : !k2 && l.zj(e) && (c = wj(c)));
      f && l.Ce() && (c = zj(c));
      return c;
    }
    function jl(a, b, c, d) {
      return Sk(a, b, function() {
        if (b !== tc) {
          a.F.get(b);
          if (fd()) {
            a.j.has(b) && (a.j.get(b).destroy(), a.j.delete(b));
            d && a.j.set(b, d);
            var e = c + a.C.addExtraFeaturesToSourceBuffer(c);
            a.l.get(b).changeType(e);
            a.F.set(b, c);
          }
          Kk(a, b);
        }
      }, null);
    }
    function kl(a, b) {
      var c, d, e, f, g, h, k2, l, m, n, q, r, u, w, v, y, z, A, C, D;
      return P(function(F) {
        if (F.g == 1) {
          if (a.G || a.L) return F.return();
          c = vc;
          a.G = true;
          a.m = false;
          d = a.g.currentTime;
          e = a.g.autoplay;
          a.g.paused || (a.hb = true);
          a.fb && (a.g.autoplay = false);
          ta(F, 2);
          a.A.Ta();
          f = t(a.j.values());
          for (g = f.next(); !g.done; g = f.next()) h = g.value, h.destroy();
          k2 = t(a.l.values());
          for (l = k2.next(); !l.done; l = k2.next()) {
            m = l.value;
            try {
              a.i.removeSourceBuffer(m);
            } catch (B) {
            }
          }
          a.j.clear();
          a.l.clear();
          n = a.i.duration;
          a.K = new Mg();
          a.i = zk(a, a.K);
          return G(F, a.K, 4);
        }
        if (F.g != 2) {
          !isNaN(n) && n ? a.i.duration = n : !isNaN(a.sa) && a.sa && (a.i.duration = a.sa);
          q = new Mg();
          r = a.i.sourceBuffers;
          u = b.size;
          w = 0;
          v = function() {
            w++;
            w === u && (q.resolve(), a.A.Ea(r, "addsourcebuffer", v));
          };
          a.A.o(r, "addsourcebuffer", v);
          y = t(b.keys());
          for (z = y.next(); !z.done; z = y.next()) A = z.value, C = b.get(A), Hk(a, A, C, C.codecs);
          (D = b.get(c.na)) && D.isAudioMuxedInVideo && (a.m = true);
          a.m && !a.u.has(c.na) && a.u.set(c.na, []);
          a.g.currentTime = d;
          return G(F, q, 2);
        }
        wa(F);
        a.G = false;
        jh(a.I);
        a.A.qa(a.g, "canplaythrough", function() {
          a.I.g || (a.g.autoplay = e, a.hb && (a.hb = false, a.g.play()));
        });
        return xa(F, 0);
      });
    }
    function tl(a, b) {
      return dl(a, function() {
        return kl(a, b);
      });
    }
    function ul(a, b, c, d) {
      var e = false, f = rc("audio", (d || "").split(",")), g = rc("video", (d || "").split(",")), h = g;
      b == "audio" && (h = f);
      h || (h = d);
      d = ef(c, h);
      var k2 = nf(a.F.get(b)), l = a.C.forceTransmux;
      !dd(d) || !a.H && ff.includes(d) ? l = true : l || c == k2 || (l = Sb().Ga() === "WEBKIT" && ff.includes(c));
      if (l && (a = gf(c, h), c = Ze(a))) {
        var m = c();
        f && g && (e = true);
        d = m.convertCodecs(b, a);
      }
      b = kf(of(d));
      return { qc: m, xm: e, Ii: nf(d), codec: b, mimeType: d };
    }
    function vl(a, b, c, d, e) {
      if (b == tc) return { type: wl, Nf: c, qc: null };
      var f = kf(of(a.F.get(b))), g = nf(a.F.get(b)), h = ul(a, b, c, d), k2 = h.qc, l = h.xm, m = h.Ii, n = h.codec;
      h = h.mimeType;
      var q = true;
      l && a.F.has("audio") && (c = ul(a, "audio", c, d), d = kf(of(a.F.get("audio"))), q = nf(a.F.get("audio")), q = d == c.codec && q == c.Ii, c.qc && c.qc.destroy());
      if (f === n && g === m && q) return { type: wl, Nf: h, qc: k2 };
      f = true;
      if (a.m && !e.has("audio") || l && k2 && !a.j.has(b)) f = false;
      if (f && a.C.codecSwitchingStrategy === "smooth" && fd()) return { type: xl, Nf: h, qc: k2 };
      k2 && k2.destroy();
      return {
        type: yl,
        Nf: h,
        qc: null
      };
    }
    function al(a, b, c, d, e) {
      var f, g, h, k2, l, m;
      return P(function(n) {
        if (n.g == 1) {
          f = vc;
          g = vl(a, b, c, d, e);
          h = g.type;
          k2 = g.qc;
          l = g.Nf;
          if (m = e.get(f.na)) a.m = m.isAudioMuxedInVideo;
          if (h == wl) return a.j.has(b) && !k2 ? (a.j.get(b).destroy(), a.j.delete(b)) : !a.j.has(b) && k2 ? a.j.set(b, k2) : k2 && (a.j.has(b) && a.j.get(b).transmux !== k2.transmux ? (a.j.get(b).destroy(), a.j.set(b, k2)) : k2.destroy()), n.return(false);
          if (h == xl) return G(n, jl(a, b, l, k2), 3);
          if (h != yl) return n.B(3);
          k2 && k2.destroy();
          return G(n, tl(a, e), 3);
        }
        return n.return(true);
      });
    }
    function zl(a, b, c, d, e) {
      a = vl(a, b, c, d, e);
      a.qc && a.qc.destroy();
      return a.type == yl;
    }
    var Bk = window2.URL.createObjectURL, Jk = "sequence", wl = "none", yl = "reset", xl = "changeType";
    function Al(a, b, c) {
      this.i = a;
      this.F = b;
      this.A = this.l = Infinity;
      this.h = 1;
      this.g = this.j = null;
      this.C = 0;
      this.D = true;
      this.J = false;
      this.I = 0;
      this.G = c === void 0 ? true : c;
      this.H = 0;
      this.u = false;
      this.m = a;
    }
    p = Al.prototype;
    p.getDuration = function() {
      return this.l;
    };
    p.Wk = function() {
      return this.h;
    };
    p.Nj = function(a) {
      this.i = a;
    };
    p.yb = function(a) {
      this.l = a;
    };
    p.cl = function() {
      return this.i;
    };
    p.Kj = function(a) {
      this.C = a;
    };
    p.rd = function(a) {
      a && !this.D && (this.J = true);
      this.D = a;
    };
    p.hg = function(a) {
      this.A = a;
    };
    p.wf = function() {
      return this.A;
    };
    p.ci = function(a) {
      this.F = a;
    };
    p.Lk = function() {
      return this.F;
    };
    p.sj = function(a, b) {
      if (a.length != 0) {
        var c = (Date.now() + this.C) / 1e3;
        a = a.filter(function(e) {
          return e.start + b < c;
        });
        if (a.length != 0) {
          var d = a[a.length - 1].end + b;
          this.Of(a[0].start + b);
          this.h = a.reduce(function(e, f) {
            return Math.max(e, f.end - f.start);
          }, this.h);
          this.g = Math.max(this.g, d);
          this.i != null && this.G && !this.u && (this.i = c - this.g - this.h);
        }
      }
    };
    p.ye = function(a) {
      if (a.length != 0) {
        var b = a[0].startTime, c = a[0].endTime, d = (Date.now() + this.C) / 1e3;
        a = t(a);
        for (var e = a.next(); !e.done; e = a.next()) e = e.value, d < e.startTime || (b = Math.min(b, e.startTime), c = Math.max(c, e.endTime), this.h = Math.max(this.h, e.endTime - e.startTime));
        this.Of(b);
        this.g = Math.max(this.g, c);
        this.i != null && this.G && !this.u && (this.i = d - this.g - this.h);
      }
    };
    p.rj = function(a, b) {
      this.Of(a);
      b == Infinity || this.U() || (this.g = Math.max(this.g, b));
    };
    p.Xk = function() {
      return this.g;
    };
    p.If = function() {
      this.u = true;
    };
    p.Il = function() {
      return this.u;
    };
    p.ei = function(a) {
      this.m = a;
    };
    p.Pk = function() {
      return this.m;
    };
    p.Of = function(a) {
      this.j == null ? this.j = a : this.J || (this.j = Math.min(this.j, a));
    };
    p.Lh = function(a) {
      this.h = Math.max(this.h, a);
    };
    p.offset = function(a) {
      this.j != null && (this.j += a);
      this.g != null && (this.g += a);
    };
    p.U = function() {
      return this.l == Infinity && !this.D;
    };
    p.kd = function() {
      return this.l != Infinity && !this.D;
    };
    p.Nb = function() {
      return Math.max(this.I, this.Mc() - this.A);
    };
    p.Pj = function(a) {
      this.I = a;
    };
    p.Mc = function() {
      return this.U() || this.kd() ? Math.min(Math.max(0, (Date.now() + this.C) / 1e3 - this.h - this.i) + this.H, this.l) : this.g ? Math.min(this.g, this.l) : this.l;
    };
    p.le = function(a) {
      var b = Math.max(this.j, this.I);
      return this.A == Infinity ? Math.ceil(b * 1e3) / 1e3 : Math.max(b, Math.min(this.Mc() - this.A + a, this.Mb()));
    };
    p.ec = function() {
      return this.le(0);
    };
    p.Mb = function() {
      return Math.max(0, this.Mc() - (this.U() || this.kd() ? this.F : 0));
    };
    p.ck = function() {
      return this.i == null || this.g != null && this.G ? false : true;
    };
    p.Jj = function(a) {
      this.H = a;
    };
    p.Bk = function() {
      return this.H;
    };
    S("shaka.media.PresentationTimeline", Al);
    Al.prototype.getAvailabilityTimeOffset = Al.prototype.Bk;
    Al.prototype.setAvailabilityTimeOffset = Al.prototype.Jj;
    Al.prototype.usingPresentationStartTime = Al.prototype.ck;
    Al.prototype.getSeekRangeEnd = Al.prototype.Mb;
    Al.prototype.getSeekRangeStart = Al.prototype.ec;
    Al.prototype.getSafeSeekRangeStart = Al.prototype.le;
    Al.prototype.getSegmentAvailabilityEnd = Al.prototype.Mc;
    Al.prototype.setUserSeekStart = Al.prototype.Pj;
    Al.prototype.getSegmentAvailabilityStart = Al.prototype.Nb;
    Al.prototype.isInProgress = Al.prototype.kd;
    Al.prototype.isLive = Al.prototype.U;
    Al.prototype.offset = Al.prototype.offset;
    Al.prototype.notifyMaxSegmentDuration = Al.prototype.Lh;
    Al.prototype.notifyMinSegmentStartTime = Al.prototype.Of;
    Al.prototype.getInitialProgramDateTime = Al.prototype.Pk;
    Al.prototype.setInitialProgramDateTime = Al.prototype.ei;
    Al.prototype.isStartTimeLocked = Al.prototype.Il;
    Al.prototype.lockStartTime = Al.prototype.If;
    Al.prototype.getMaxSegmentEndTime = Al.prototype.Xk;
    Al.prototype.notifyPeriodDuration = Al.prototype.rj;
    Al.prototype.notifySegments = Al.prototype.ye;
    Al.prototype.notifyTimeRange = Al.prototype.sj;
    Al.prototype.getDelay = Al.prototype.Lk;
    Al.prototype.setDelay = Al.prototype.ci;
    Al.prototype.getSegmentAvailabilityDuration = Al.prototype.wf;
    Al.prototype.setSegmentAvailabilityDuration = Al.prototype.hg;
    Al.prototype.setStatic = Al.prototype.rd;
    Al.prototype.setClockOffset = Al.prototype.Kj;
    Al.prototype.getPresentationStartTime = Al.prototype.cl;
    Al.prototype.setDuration = Al.prototype.yb;
    Al.prototype.setPresentationStartTime = Al.prototype.Nj;
    Al.prototype.getMaxSegmentDuration = Al.prototype.Wk;
    Al.prototype.getDuration = Al.prototype.getDuration;
    function Bl(a, b, c, d) {
      var e = this;
      this.A = d;
      this.g = a;
      this.F = b;
      this.h = c;
      this.j = new Qc();
      this.m = false;
      this.l = 0;
      this.D = false;
      this.H = this.G = 0;
      this.u = Cl(this);
      this.C = false;
      this.j.o(a, "waiting", function() {
        return Dl(e);
      });
      this.i = new Cf(function() {
        Dl(e);
      }).za(this.h.gapJumpTimerTime);
    }
    Bl.prototype.release = function() {
      this.j && (this.j.release(), this.j = null);
      this.i != null && (this.i.stop(), this.i = null);
      this.u && (this.u.release(), this.u = null);
      this.g = this.F = this.A = null;
    };
    Bl.prototype.Rf = function() {
      this.C = true;
      this.i && this.i.za(this.h.gapJumpTimerTime);
      Dl(this);
    };
    function Dl(a) {
      if (a.g.readyState != 0) {
        if (a.g.seeking) {
          if (!a.m) return;
        } else a.m = false;
        if (!a.g.paused || a.g.currentTime == a.l && (a.g.autoplay || a.g.currentTime != a.l)) {
          var b;
          if (!(b = !a.u)) {
            b = a.u;
            var c = b.h, d = El(c), e = c.g.currentTime, f = Date.now() / 1e3;
            if (b.g != e || b.m != d) b.l = f, b.g = e, b.m = d, b.i = false;
            e = f - b.l;
            if (d = e >= b.u && d && !b.i) b.j && b.j(b.g, e), b.i = true, b.g = c.g.currentTime;
            b = !d;
          }
          b && (b = a.g.currentTime, c = a.g.buffered, d = Mj(c, b, a.h.gapDetectionThreshold), d == null || d == 0 && !a.C || (e = c.start(d), (f = a.h.gapPadding) && (e = Math.ceil((e + f) * 100) / 100), e >= a.F.Mb() || e - b < 1e-3 || (d != 0 && c.end(d - 1), Fl(a, e), b == a.l && (a.l = e), a.G++, a.A(new T("gapjumped")))));
        }
      }
    }
    function Fl(a, b) {
      a.D = true;
      a.j.qa(a.g, "seeked", function() {
        a.D = false;
      });
      a.g.currentTime = b;
    }
    function Cl(a) {
      if (!a.h.stallEnabled) return null;
      var b = a.h.stallThreshold, c = a.h.stallSkip;
      return new Gl(new Hl(a.g), b, function() {
        var d;
        return P(function(e) {
          if (e.g == 1) return d = Lj(a.g.buffered), d.length ? c ? (a.g.currentTime += c, e.B(2)) : G(e, a.g.play(), 3) : e.return();
          if (e.g != 2) {
            if (!a.g) return e.return();
            a.g.pause();
            a.g.play();
          }
          a.H++;
          a.A(new T("stalldetected"));
          H(e);
        });
      });
    }
    function Gl(a, b, c) {
      this.h = a;
      this.m = El(a);
      this.g = a.g.currentTime;
      this.l = Date.now() / 1e3;
      this.i = false;
      this.u = b;
      this.j = c;
    }
    Gl.prototype.release = function() {
      this.h && this.h.release();
      this.j = this.h = null;
    };
    function Hl(a) {
      var b = this;
      this.g = a;
      this.h = new Qc();
      this.i = false;
      this.h.o(this.g, "audiofocuspaused", function() {
        b.i = true;
      });
      this.h.o(this.g, "audiofocusgranted", function() {
        b.i = false;
      });
      this.h.o(this.g, "audiofocuslost", function() {
        b.i = true;
      });
    }
    function El(a) {
      if (a.g.paused || a.g.playbackRate == 0 || a.i || a.g.buffered.length == 0) var b = false;
      else a: {
        b = a.g.currentTime;
        a = t(Lj(a.g.buffered));
        for (var c = a.next(); !c.done; c = a.next()) if (c = c.value, !(b < c.start - 0.1 || b > c.end - 0.5)) {
          b = true;
          break a;
        }
        b = false;
      }
      return b;
    }
    Hl.prototype.release = function() {
      this.h && this.h.release();
      this.h = null;
    };
    function Il(a, b, c, d) {
      b == HTMLMediaElement.HAVE_NOTHING || a.readyState >= b ? d() : (b = Jl.value().get(b), c.qa(a, b, d));
    }
    var Jl = new Rb(function() {
      return /* @__PURE__ */ new Map([[HTMLMediaElement.HAVE_METADATA, "loadedmetadata"], [HTMLMediaElement.HAVE_CURRENT_DATA, "loadeddata"], [HTMLMediaElement.HAVE_FUTURE_DATA, "canplay"], [HTMLMediaElement.HAVE_ENOUGH_DATA, "canplaythrough"]]);
    });
    function Kl(a, b, c, d) {
      var e = this;
      this.g = a;
      this.m = b;
      this.A = c;
      this.l = null;
      this.j = function() {
        e.l == null && (e.l = d());
        return e.l;
      };
      this.u = false;
      this.h = new Qc();
      this.i = new Ll(a);
      Il(this.g, HTMLMediaElement.HAVE_METADATA, this.h, function() {
        Ml(e, e.j());
      });
    }
    Kl.prototype.release = function() {
      this.h && (this.h.release(), this.h = null);
      this.i != null && (this.i.release(), this.i = null);
      this.m = function() {
      };
      this.g = null;
    };
    function Nl(a) {
      return a.u ? a.g.currentTime : a.j();
    }
    function Ol(a, b) {
      a.g.readyState > 0 ? Pl(a.i, b) : Il(a.g, HTMLMediaElement.HAVE_METADATA, a.h, function() {
        Ml(a, a.j());
      });
    }
    function Ml(a, b) {
      Math.abs(a.g.currentTime - b) < 1e-3 ? Ql(a) : (a.h.qa(a.g, "seeking", function() {
        Ql(a);
      }), Pl(a.i, a.g.currentTime && a.g.currentTime != 0 ? a.g.currentTime : b));
    }
    function Ql(a) {
      a.u = true;
      a.h.o(a.g, "seeking", function() {
        return a.m();
      });
      a.A(a.g.currentTime);
    }
    function Ll(a) {
      var b = this;
      this.g = a;
      this.m = 10;
      this.j = this.l = this.i = 0;
      this.h = new Cf(function() {
        b.i <= 0 ? b.h.stop() : b.g.currentTime != b.l || b.g.currentTime === b.j ? b.h.stop() : (b.g.currentTime = b.j, b.i--);
      });
    }
    Ll.prototype.release = function() {
      this.h && (this.h.stop(), this.h = null);
      this.g = null;
    };
    function Pl(a, b) {
      a.l = a.g.currentTime;
      a.j = b;
      a.i = a.m;
      a.g.currentTime = b;
      a.h.za(0.1);
    }
    ;
    function Rl(a) {
      this.g = a;
      this.i = false;
      this.h = null;
      this.j = new Qc();
    }
    p = Rl.prototype;
    p.ready = function() {
      function a() {
        if (b.h == null || b.h == 0 && b.g.duration != Infinity) b.i = true;
        else {
          var c = b.g.currentTime, d = null;
          if (typeof b.h === "number") d = b.h;
          else if (b.h instanceof Date) {
            var e = Sl(b);
            e !== null && (d = b.h.getTime() / 1e3 - e, d = Tl(b, d));
          }
          d == null ? b.i = true : (d < 0 && (d = Math.max(0, c + d)), c != d ? (b.j.qa(b.g, "seeking", function() {
            b.i = true;
          }), b.g.currentTime = d) : b.i = true);
        }
      }
      var b = this;
      Il(this.g, HTMLMediaElement.HAVE_FUTURE_DATA, this.j, function() {
        a();
      });
    };
    p.release = function() {
      this.j && (this.j.release(), this.j = null);
      this.g = null;
    };
    p.Ag = function(a) {
      this.h = this.i ? this.h : a;
    };
    p.Xe = function() {
      var a = this.i ? this.g.currentTime : this.h;
      a instanceof Date && (a = a.getTime() / 1e3 - (Sl(this) || 0), a = Tl(this, a));
      return a || 0;
    };
    p.Ci = function() {
      return 0;
    };
    p.Ai = function() {
      return 0;
    };
    p.Bi = function() {
      return false;
    };
    p.qj = function() {
    };
    p.ej = function() {
      var a = Ij(this.g.buffered);
      return a != null && a >= this.g.duration - 1;
    };
    function Sl(a) {
      return a.g.getStartDate && (a = a.g.getStartDate().getTime(), !isNaN(a)) ? a / 1e3 : null;
    }
    function Tl(a, b) {
      a = a.g.seekable;
      a.length > 0 && (b = Math.max(a.start(0), b), b = Math.min(a.end(a.length - 1), b));
      return b;
    }
    function Ul(a, b, c, d, e, f) {
      var g = this;
      this.h = a;
      this.g = b.presentationTimeline;
      this.l = c;
      this.A = e;
      this.u = null;
      this.i = new Bl(a, b.presentationTimeline, c, f);
      this.j = new Kl(a, function() {
        a: {
          var h = g.i;
          h.m = true;
          h.C = false;
          h.i && h.i.za(h.h.gapJumpTimerTime);
          Dl(h);
          var k2 = Nl(g.j);
          h = Vl(g, k2);
          if (!hd() && Math.abs(h - k2) > 1e-3) {
            k2 = false;
            var l = Sb().Ej();
            if (l) {
              var m = Date.now() / 1e3;
              if (!g.u || g.u < m - l) g.u = m, k2 = true;
            } else k2 = true;
            if (k2) {
              Ol(g.j, h);
              h = void 0;
              break a;
            }
          }
          g.A();
          h = void 0;
        }
        return h;
      }, function(h) {
        var k2 = g.i;
        k2.g.seeking && !k2.m && (k2.m = true, k2.l = h);
        k2.i && k2.i.za(k2.h.gapJumpTimerTime);
        Dl(k2);
      }, function() {
        return Wl(g, d);
      });
      this.m = new Cf(function() {
        if (g.h.readyState != 0 && !g.h.paused) {
          var h = Nl(g.j), k2 = g.g.ec(), l = g.g.Mb();
          l - k2 < 3 && (k2 = l - 3);
          h < k2 && (h = Vl(g, h), g.h.currentTime = h);
        }
      });
    }
    p = Ul.prototype;
    p.ready = function() {
      this.m.za(0.25);
    };
    p.release = function() {
      this.j && (this.j.release(), this.j = null);
      this.i && (this.i.release(), this.i = null);
      this.m && (this.m.stop(), this.m = null);
      this.h = this.j = this.g = this.l = null;
      this.A = function() {
      };
    };
    p.Ag = function(a) {
      Ol(this.j, Wl(this, a));
    };
    p.Xe = function() {
      var a = Nl(this.j);
      return this.h.readyState > 0 && !this.h.paused ? Xl(this, a) : a;
    };
    p.Ci = function() {
      return this.i.H;
    };
    p.Ai = function() {
      return this.i.G;
    };
    p.Bi = function() {
      return this.i.D;
    };
    function Wl(a, b) {
      b == null ? b = a.g.getDuration() < Infinity ? a.g.ec() : a.g.Mb() : b instanceof Date ? b = b.getTime() / 1e3 - (a.g.m || a.g.i) : b < 0 && (b = a.g.Mb() + b);
      return Yl(a, Xl(a, b));
    }
    p.qj = function() {
      this.i.Rf();
    };
    p.ej = function() {
      if (this.g.U()) {
        var a = this.g.Mc(), b = Ij(this.h.buffered);
        if (b != null && b >= a) return true;
      }
      return false;
    };
    function Yl(a, b) {
      var c = a.g.getDuration();
      return b >= c ? c - a.l.durationBackoff : b;
    }
    function Vl(a, b) {
      var c = a.l.rebufferingGoal, d = a.l.safeSeekOffset, e = a.g.ec(), f = a.g.Mb(), g = a.g.getDuration();
      f - e < 3 && (e = f - 3);
      var h = a.g.le(c), k2 = a.g.le(d);
      c = a.g.le(c + d);
      return b >= g ? Yl(a, b) : b > f ? f - a.l.safeSeekEndOffset : b < e ? a.g.U() && a.l.returnToEndOfLiveWindowWhenOutside ? f - a.l.safeSeekEndOffset : Jj(a.h.buffered, k2) ? k2 : c : b >= h || Jj(a.h.buffered, b) ? b : c;
    }
    function Xl(a, b) {
      var c = a.g.ec();
      if (b < c) return c;
      a = a.g.Mb();
      return b > a ? a : b;
    }
    ;
    function Zl(a) {
      this.g = a;
      this.m = null;
      this.i = 0;
      this.u = false;
    }
    p = Zl.prototype;
    p.getNumReferences = function() {
      return this.g.length;
    };
    p.getNumEvicted = function() {
      return this.i;
    };
    p.release = function() {
      this.u || (this.g = [], this.m && this.m.stop(), this.m = null);
    };
    p.Pl = function() {
      this.u = true;
    };
    p.Kb = function(a) {
      for (var b = t(this.g), c = b.next(); !c.done; c = b.next()) a(c.value);
    };
    function fg(a) {
      return a.g[0] || null;
    }
    p.find = function(a) {
      for (var b = this.g.length - 1, c = b; c >= 0; --c) {
        var d = this.g[c], e = c < b ? this.g[c + 1].startTime : d.endTime;
        if (a >= d.startTime && a < e) return c + this.i;
      }
      return this.g.length && a < this.g[0].startTime ? this.i : null;
    };
    p.get = function(a) {
      if (this.g.length == 0) return null;
      a -= this.i;
      return a < 0 || a >= this.g.length ? null : this.g[a];
    };
    p.offset = function(a) {
      if (!this.u) for (var b = t(this.g), c = b.next(); !c.done; c = b.next()) c.value.offset(a);
    };
    p.Kf = function(a) {
      if (!this.u && a.length) {
        var b = Math.round(a[0].startTime * 1e3) / 1e3;
        this.g = this.g.filter(function(c) {
          return Math.round(c.startTime * 1e3) / 1e3 < b;
        });
        this.g.push.apply(this.g, x(a));
      }
    };
    p.we = function(a, b) {
      var c = this;
      a = a.filter(function(d) {
        return d.endTime > b && (c.g.length == 0 || d.endTime > c.g[0].startTime);
      });
      this.Kf(a);
      this.ib(b);
    };
    p.ib = function(a) {
      if (!this.u) {
        var b = this.g.length;
        this.g = this.g.filter(function(c) {
          return c.endTime > a;
        });
        this.i += b - this.g.length;
      }
    };
    p.Ed = function(a, b, c) {
      c = c === void 0 ? false : c;
      if (!this.u) {
        for (; this.g.length; ) if (this.g[this.g.length - 1].startTime >= b) this.g.pop();
        else break;
        for (; this.g.length; ) if (this.g[0].endTime <= a) this.g.shift(), c || this.i++;
        else break;
        this.g.length != 0 && (a = this.g[this.g.length - 1], b = new Cj(a.startTime, b, a.F, a.startByte, a.endByte, a.ha, a.timestampOffset, a.appendWindowStart, a.appendWindowEnd, a.g, a.tilesLayout, a.D, a.h, a.status, a.aesKey), b.mimeType = a.mimeType, b.codecs = a.codecs, b.i = a.i, this.g[this.g.length - 1] = b);
      }
    };
    p.pg = function(a, b) {
      var c = this;
      this.u || (this.m && this.m.stop(), this.m = new Cf(function() {
        var d = b();
        d ? c.g.push.apply(c.g, x(d)) : (c.m.stop(), c.m = null);
      }), this.m.za(a));
    };
    Zl.prototype[Symbol.iterator] = function() {
      return this.dc(0);
    };
    Zl.prototype.dc = function(a, b, c) {
      b = b === void 0 ? false : b;
      c = c === void 0 ? false : c;
      var d = this.find(a);
      if (d == null) return null;
      var e = this.get(d);
      c ? d++ : d--;
      var f = -1;
      if (e && e.g.length > 0) for (var g = e.g.length - 1; g >= 0; --g) {
        var h = e.g[g];
        if (a >= h.startTime && a < h.endTime) {
          if (!b) {
            for (; g && !h.l; ) g--, h = e.g[g];
            if (!h.l) return ab("No independent partial segment found!"), null;
          }
          c ? d-- : d++;
          f = g - 1;
          break;
        }
      }
      return new $l(this, d, f, c);
    };
    Zl.prototype.mf = function() {
      return -1;
    };
    function am(a, b, c) {
      a = new Cj(a, a + b, function() {
        return c;
      }, 0, null, null, a, a, a + b);
      return new Zl([a]);
    }
    S("shaka.media.SegmentIndex", Zl);
    Zl.forSingleSegment = am;
    Zl.prototype.getIteratorForTime = Zl.prototype.dc;
    Zl.prototype.updateEvery = Zl.prototype.pg;
    Zl.prototype.fit = Zl.prototype.Ed;
    Zl.prototype.evict = Zl.prototype.ib;
    Zl.prototype.mergeAndEvict = Zl.prototype.we;
    Zl.prototype.offset = Zl.prototype.offset;
    Zl.prototype.get = Zl.prototype.get;
    Zl.prototype.find = Zl.prototype.find;
    Zl.prototype.markImmutable = Zl.prototype.Pl;
    Zl.prototype.release = Zl.prototype.release;
    Zl.prototype.getNumEvicted = Zl.prototype.getNumEvicted;
    Zl.prototype.getNumReferences = Zl.prototype.getNumReferences;
    function $l(a, b, c, d) {
      this.i = a;
      this.h = b;
      this.g = c;
      this.reverse = d;
    }
    p = $l.prototype;
    p.Vd = function(a) {
      this.reverse = a;
    };
    p.wk = function() {
      return this.h;
    };
    p.current = function() {
      var a = this.i.get(this.h);
      a && a.g.length > 0 && a.C && this.g >= a.g.length && (this.h++, this.g = 0, a = this.i.get(this.h));
      return a && a.g.length > 0 ? a.g[this.g] : a;
    };
    p.next = function() {
      var a = this.i.get(this.h);
      this.reverse ? a && a.g.length > 0 ? (this.g--, this.g < 0 && (this.h--, this.g = (a = this.i.get(this.h)) && a.g.length > 0 ? a.g.length - 1 : 0)) : (this.h--, this.g = 0) : a && a.g.length > 0 ? (this.g++, a.C && this.g == a.g.length && (this.h++, this.g = 0)) : (this.h++, this.g = 0);
      a = this.current();
      return { value: a, done: !a };
    };
    p.Wh = function() {
      var a = this.current();
      if (a.u && !a.l && (a = this.i.get(this.h)) && a.g.length > 0) for (var b = a.g[this.g]; b.l && !(this.g <= 0); ) this.g--, b = a.g[this.g];
    };
    S("shaka.media.SegmentIterator", $l);
    $l.prototype.resetToLastIndependent = $l.prototype.Wh;
    $l.prototype.next = $l.prototype.next;
    $l.prototype.current = $l.prototype.current;
    $l.prototype.currentPosition = $l.prototype.wk;
    $l.prototype.setReverse = $l.prototype.Vd;
    function bm() {
      Zl.call(this, []);
      this.h = [];
    }
    ma(bm, Zl);
    p = bm.prototype;
    p.clone = function() {
      var a = new bm();
      a.h = this.h.slice();
      a.i = this.i;
      return a;
    };
    p.release = function() {
      for (var a = t(this.h), b = a.next(); !b.done; b = a.next()) b.value.release();
      this.h = [];
    };
    p.Kb = function(a) {
      for (var b = t(this.h), c = b.next(); !c.done; c = b.next()) c.value.Kb(a);
    };
    function cm(a, b) {
      a = t(a.h);
      for (var c = a.next(); !c.done; c = a.next()) b(c.value);
    }
    p.find = function(a) {
      for (var b = this.i, c = t(this.h), d = c.next(); !d.done; d = c.next()) {
        d = d.value;
        var e = d.find(a);
        if (e != null) return e + b;
        b += d.getNumEvicted() + d.getNumReferences();
      }
      return null;
    };
    function dm(a, b) {
      a = t(a.h);
      for (var c = a.next(); !c.done; c = a.next()) if (c = c.value, c.find(b) != null) return c.mf();
      return -1;
    }
    p.get = function(a) {
      for (var b = this.i, c = t(this.h), d = c.next(); !d.done; d = c.next()) {
        d = d.value;
        var e = d.get(a - b);
        if (e) return e;
        e = d.getNumReferences();
        b += d.getNumEvicted() + e;
      }
      return null;
    };
    p.offset = function() {
    };
    p.Kf = function() {
    };
    p.ib = function(a) {
      for (var b = t(this.h), c = b.next(); !c.done; c = b.next()) c.value.ib(a);
      for (; this.h.length > 1 && this.h[0].getNumReferences() == 0; ) a = this.h.shift(), this.i += a.getNumEvicted(), a.release();
    };
    p.we = function() {
    };
    p.Ed = function() {
    };
    p.pg = function() {
    };
    S("shaka.media.MetaSegmentIndex", bm);
    bm.prototype.updateEvery = bm.prototype.pg;
    bm.prototype.fit = bm.prototype.Ed;
    bm.prototype.mergeAndEvict = bm.prototype.we;
    bm.prototype.evict = bm.prototype.ib;
    bm.prototype.merge = bm.prototype.Kf;
    bm.prototype.offset = bm.prototype.offset;
    bm.prototype.get = bm.prototype.get;
    bm.prototype.find = bm.prototype.find;
    bm.prototype.forEachTopLevelReference = bm.prototype.Kb;
    bm.prototype.release = bm.prototype.release;
    function em(a) {
      var b = this;
      this.g = a;
      this.j = false;
      this.i = this.g.vf();
      this.h = new Cf(function() {
        b.g.oj(b.i * 0.25);
      });
    }
    em.prototype.release = function() {
      this.set(this.fd());
      this.h && (this.h.stop(), this.h = null);
      this.g = null;
    };
    em.prototype.set = function(a) {
      this.i = a;
      fm(this);
    };
    em.prototype.fd = function() {
      return this.g.fd();
    };
    function fm(a) {
      a.h.stop();
      var b = a.j ? 0 : a.i;
      if (b >= 0) try {
        a.g.vf() != b && a.g.gi(b);
        return;
      } catch (c) {
      }
      a.h.za(0.25);
      a.g.vf() != 0 && a.g.gi(0);
    }
    ;
    function gm(a) {
      var b = this;
      this.j = a;
      this.h = new Qc();
      this.g = /* @__PURE__ */ new Set();
      this.i = new Cf(function() {
        hm(b, false);
      }).La();
      a.paused || this.i.za(0.25);
      this.h.o(a, "playing", function() {
        b.i.La().za(0.25);
      });
      this.h.o(a, "pause", function() {
        b.i.stop();
      });
    }
    gm.prototype.release = function() {
      this.h && (this.h.release(), this.h = null);
      this.i.stop();
      for (var a = t(this.g), b = a.next(); !b.done; b = a.next()) b.value.release();
      this.g.clear();
    };
    function hm(a, b) {
      var c = a.j.currentTime;
      a = t(a.g);
      for (var d = a.next(); !d.done; d = a.next()) d.value.j(c, b);
    }
    ;
    function im(a) {
      lb.call(this);
      this.g = /* @__PURE__ */ new Map();
      this.h = a;
    }
    ma(im, lb);
    im.prototype.release = function() {
      this.g.clear();
      lb.prototype.release.call(this);
    };
    function jm(a, b) {
      var c = a.g.get(b);
      c || (c = { Be: [], Tg: null, contentType: b }, a.g.set(b, c));
      return c;
    }
    function km(a, b, c) {
      var d = jm(a, b.contentType);
      lm(a, d);
      a = { Kd: b, position: c };
      d = d.Be;
      b = d.findIndex(function(e) {
        return e.position >= c;
      });
      b >= 0 ? d.splice(b, d[b].position == c ? 1 : 0, a) : d.push(a);
    }
    im.prototype.j = function(a) {
      for (var b = t(this.g.values()), c = b.next(); !c.done; c = b.next()) {
        c = c.value;
        var d = c.Tg;
        a: {
          var e = c.Be;
          for (var f = e.length - 1; f >= 0; f--) {
            var g = e[f];
            if (g.position <= a) {
              e = g.Kd;
              break a;
            }
          }
          e = null;
        }
        f = e && !(d === e || d && e && d.bandwidth == e.bandwidth && d.audioSamplingRate == e.audioSamplingRate && d.codecs == e.codecs && d.contentType == e.contentType && d.frameRate == e.frameRate && d.height == e.height && d.mimeType == e.mimeType && d.channelsCount == e.channelsCount && d.pixelAspectRatio == e.pixelAspectRatio && d.width == e.width);
        g = e && d && e.label && d.label && d.label !== e.label;
        var h = e && d && e.language && d.language && d.language !== e.language;
        d = e && d && e.roles && d.roles && !wd(d.roles, e.roles);
        (g || h || d) && mm(this, a, e.contentType) && (c.Tg = e, d = new T("audiotrackchange", /* @__PURE__ */ new Map([["quality", e], ["position", a]])), this.dispatchEvent(d));
        f && mm(this, a, e.contentType) && (c.Tg = e, JSON.stringify(e), c = new T("qualitychange", /* @__PURE__ */ new Map([["quality", e], ["position", a]])), this.dispatchEvent(c));
      }
    };
    function mm(a, b, c) {
      return (a = a.h()[c]) && a.length > 0 && (c = a[a.length - 1].end, b >= a[0].start && b < c) ? true : false;
    }
    function lm(a, b) {
      if ((a = a.h()[b.contentType]) && a.length > 0) {
        var c = a[0].start, d = a[a.length - 1].end, e = b.Be;
        b.Be = e.filter(function(f, g) {
          return f.position <= c && g + 1 < e.length && e[g + 1].position <= c || f.position >= d ? false : true;
        });
      } else b.Be = [];
    }
    function nm(a) {
      var b = { bandwidth: a.bandwidth || 0, audioSamplingRate: null, codecs: a.codecs, contentType: a.type, frameRate: null, height: null, mimeType: a.mimeType, channelsCount: null, pixelAspectRatio: null, width: null, label: null, roles: a.roles, language: null };
      a.type == "video" && (b.frameRate = a.frameRate || null, b.height = a.height || null, b.pixelAspectRatio = a.pixelAspectRatio || null, b.width = a.width || null);
      a.type == "audio" && (b.audioSamplingRate = a.audioSamplingRate, b.channelsCount = a.channelsCount, b.label = a.label || null, b.language = a.language);
      return b;
    }
    ;
    function om(a) {
      lb.call(this);
      this.h = /* @__PURE__ */ new Map();
      this.i = a;
      this.g = null;
    }
    ma(om, lb);
    om.prototype.release = function() {
      this.h.clear();
      this.g && (this.g.stop(), this.g = null);
      lb.prototype.release.call(this);
    };
    function pm(a, b) {
      var c = b.schemeIdUri + "_" + b.id + "_" + (b.startTime.toFixed(1) + "_" + b.endTime.toFixed(1));
      a.h.has(c) || (a.h.set(c, b), b = new T("regionadd", /* @__PURE__ */ new Map([["region", b]])), a.dispatchEvent(b), qm(a));
    }
    function qm(a) {
      a.g || (a.g = new Cf(function() {
        for (var b = a.i(), c = t(a.h), d = c.next(); !d.done; d = c.next()) {
          var e = t(d.value);
          d = e.next().value;
          e = e.next().value;
          e.endTime < b.start && (a.h.delete(d), d = new T("regionremove", /* @__PURE__ */ new Map([["region", e]])), a.dispatchEvent(d));
        }
        !a.h.size && a.g && (a.g.stop(), a.g = null);
      }).za(2));
    }
    ;
    function rm(a, b, c, d) {
      this.m = a;
      this.i = b;
      this.l = c;
      this.h = /* @__PURE__ */ new Map();
      this.j = /* @__PURE__ */ new Map();
      this.g = null;
      this.u = d;
    }
    function sm(a, b) {
      a.l = b;
      a = t(a.h.values());
      for (var c = a.next(); !c.done; c = a.next()) c.value.g = b;
    }
    function tm(a, b, c) {
      c = c === void 0 ? false : c;
      if (!a.i.segmentIndex) return Promise.resolve();
      a.g || (a.g = a.i.segmentIndex.dc(b, true, a.u));
      if (!a.g) return Promise.resolve();
      c && a.g.next();
      for (b = []; a.h.size < a.m; ) {
        c = a.g.next().value;
        if (!c) break;
        var d = true;
        c.isPreload() && c.endByte != null && (d = false);
        c.Oc() == 2 && (d = false);
        c.fc(false) && (d = false);
        d && c.ha && b.push(um(a, c.ha));
        d && !a.h.has(c) && (d = new vm(a.l), b.push(wm(d, c, a.i)), a.h.set(c, d));
      }
      xm(a);
      return Promise.all(b);
    }
    function um(a, b) {
      if (!a.i.segmentIndex || b.fc() || Array.from(a.j.keys()).some(function(e) {
        return Bj(e, b);
      })) return Promise.resolve();
      var c = new vm(a.l), d = wm(c, b, a.i);
      a.j.set(b, c);
      return d;
    }
    function ym(a, b) {
      b = t(b.keys());
      for (var c = b.next(); !c.done; c = b.next()) (c = c.value) && zm(a, c);
    }
    function Am(a) {
      ym(a, a.h);
      ym(a, a.j);
      a.g = null;
    }
    rm.prototype.ib = function(a, b) {
      b = b === void 0 ? false : b;
      for (var c = t(this.h.keys()), d = c.next(); !d.done; d = c.next()) d = d.value, a > d.endTime && zm(this, d);
      b && xm(this);
    };
    rm.prototype.Vd = function(a) {
      this.u = a;
      this.g && this.g.Vd(a);
    };
    function xm(a) {
      for (var b = Array.from(a.h.keys()), c = t(a.j.keys()), d = c.next(), e = {}; !d.done; e = { Eh: void 0 }, d = c.next()) e.Eh = d.value, b.some(/* @__PURE__ */ function(f) {
        return function(g) {
          return Bj(g.ha, f.Eh);
        };
      }(e)) || zm(a, e.Eh);
    }
    function Bm(a, b) {
      a.m = b;
      for (var c = Array.from(a.h.keys()); c.length > b; ) {
        var d = c.pop();
        d && zm(a, d);
      }
      xm(a);
    }
    function Cm(a, b) {
      b && b !== a.i && (Am(a), a.i = b);
    }
    function zm(a, b) {
      var c = a.h;
      b instanceof Aj && (c = a.j);
      a = c.get(b);
      c.delete(b);
      a && a.abort();
    }
    function vm(a) {
      this.g = a;
      this.ze = this.ni = null;
    }
    function wm(a, b, c) {
      var d = new Uint8Array(0);
      a.ze = a.g(b, c, function(e) {
        return P(function(f) {
          if (f.g == 1) return d.byteLength > 0 ? d = mc(d, e) : d = e, a.ni ? G(f, a.ni(d), 3) : f.B(0);
          d = new Uint8Array(0);
          H(f);
        });
      });
      return a.ze.promise.catch(function(e) {
        return e instanceof U && e.code == 7001 ? Promise.resolve() : Promise.reject(e);
      });
    }
    vm.prototype.abort = function() {
      this.ze && this.ze.abort();
    };
    function Dm(a) {
      var b = nf(a), c = b.split("/")[0];
      a = of(a);
      return { type: c, mimeType: b, codecs: a, language: null, height: null, width: null, channelCount: null, sampleRate: null, closedCaptions: /* @__PURE__ */ new Map(), Ke: null, colorGamut: null, frameRate: null };
    }
    function Em(a, b, c) {
      function d(B) {
        y = B.name;
        var E = B.reader;
        E.skip(24);
        var I = E.Ha(), J = E.Ha();
        E.skip(50);
        q = String(I);
        n = String(J);
        B.reader.Pa() && uh(B);
      }
      function e(B) {
        var E = Qi(B.reader);
        r = E.channelCount;
        u = E.sampleRate;
        f(B.name);
      }
      function f(B) {
        B = B.toLowerCase();
        switch (B) {
          case "avc1":
          case "avc3":
            h.push(B + ".42E01E");
            l = true;
            break;
          case "hev1":
          case "hvc1":
            h.push(B + ".1.6.L93.90");
            l = true;
            break;
          case "dvh1":
          case "dvhe":
            h.push(B + ".05.04");
            l = true;
            break;
          case "vp09":
            h.push(B + ".00.10.08");
            l = true;
            break;
          case "av01":
            h.push(B + ".0.01M.08");
            l = true;
            break;
          case "mp4a":
            g.push("mp4a.40.2");
            k2 = true;
            break;
          case "ac-3":
          case "ec-3":
          case "ac-4":
          case "opus":
          case "flac":
            g.push(B);
            k2 = true;
            break;
          case "apac":
            g.push("apac.31.00"), k2 = true;
        }
      }
      var g = [], h = [], k2 = false, l = false, m = null, n = null, q = null, r = null, u = null, w = null, v = null, y;
      new ph().box("moov", uh).box("trak", uh).box("mdia", uh).W("mdhd", function(B) {
        m = Oi(B.reader, B.version).language;
      }).box("minf", uh).box("stbl", uh).W("stsd", wh).box("mp4a", function(B) {
        var E = Qi(B.reader);
        r = E.channelCount;
        u = E.sampleRate;
        B.reader.Pa() ? uh(B) : f(B.name);
      }).box(
        "esds",
        function(B) {
          B = B.reader;
          for (var E = "mp4a", I, J; B.Pa(); ) {
            I = B.ba();
            for (var K = B.ba(); K & 128; ) K = B.ba();
            if (I == 3) B.Ha(), K = B.ba(), K & 128 && B.Ha(), K & 64 && B.skip(B.ba()), K & 32 && B.Ha();
            else if (I == 4) J = B.ba(), B.skip(12);
            else if (I == 5) break;
          }
          J && (E += "." + Ti(J), I == 5 && B.Pa() && (I = B.ba(), J = (I & 248) >> 3, J === 31 && B.Pa() && (J = 32 + ((I & 7) << 3) + ((B.ba() & 224) >> 5)), E += "." + J));
          g.push(E);
          k2 = true;
        }
      ).box("ac-3", e).box("ec-3", e).box("ac-4", e).box("Opus", e).box("fLaC", e).box("apac", e).box("avc1", d).box("avc3", d).box("hev1", d).box("hvc1", d).box(
        "dva1",
        d
      ).box("dvav", d).box("dvh1", d).box("dvhe", d).box("vp09", d).box("av01", d).box("avcC", function(B) {
        var E = y || "";
        switch (y) {
          case "dvav":
            E = "avc3";
            break;
          case "dva1":
            E = "avc1";
        }
        B = B.reader;
        B.skip(1);
        B = E + "." + Ti(B.ba()) + Ti(B.ba()) + Ti(B.ba());
        h.push(B);
        l = true;
      }).box("hvcC", function(B) {
        var E = y || "";
        switch (y) {
          case "dvh1":
            E = "hvc1";
            break;
          case "dvhe":
            E = "hev1";
        }
        var I = B.reader;
        I.skip(1);
        B = I.ba();
        var J = ["", "A", "B", "C"][B >> 6], K = B & 31, L = I.X(), M = (B & 32) >> 5 ? "H" : "L";
        B = [I.ba(), I.ba(), I.ba(), I.ba(), I.ba(), I.ba()];
        I = I.ba();
        for (var N = 0, O = 0; O < 32; O++) {
          N |= L & 1;
          if (O == 31) break;
          N <<= 1;
          L >>= 1;
        }
        E = E + ("." + J + K) + ("." + Ti(N, true));
        E += "." + M + I;
        J = "";
        for (K = B.length; K--; ) if ((M = B[K]) || J) J = "." + M.toString(16).toUpperCase() + J;
        E += J;
        h.push(E);
        l = true;
      }).box("dvcC", function(B) {
        var E = y || "";
        switch (y) {
          case "hvc1":
            E = "dvh1";
            break;
          case "hev1":
            E = "dvhe";
            break;
          case "avc1":
            E = "dva1";
            break;
          case "avc3":
            E = "dvav";
            break;
          case "av01":
            E = "dav1";
        }
        var I = B.reader;
        I.skip(2);
        B = I.ba();
        I = I.ba();
        h.push(E + "." + Ui(B >> 1 & 127) + "." + Ui(B << 5 & 32 | I >> 3 & 31));
        l = true;
      }).box("dvvC", function(B) {
        var E = y || "";
        switch (y) {
          case "hvc1":
            E = "dvh1";
            break;
          case "hev1":
            E = "dvhe";
            break;
          case "avc1":
            E = "dva1";
            break;
          case "avc3":
            E = "dvav";
            break;
          case "av01":
            E = "dav1";
        }
        var I = B.reader;
        I.skip(2);
        B = I.ba();
        I = I.ba();
        h.push(E + "." + Ui(B >> 1 & 127) + "." + Ui(B << 5 & 32 | I >> 3 & 31));
        l = true;
      }).W("vpcC", function(B) {
        var E = y || "", I = B.reader;
        B = I.ba();
        var J = I.ba();
        I = I.ba() >> 4 & 15;
        h.push(E + "." + Ui(B) + "." + Ui(J) + "." + Ui(I));
        l = true;
      }).box("av1C", function(B) {
        var E = y || "";
        switch (y) {
          case "dav1":
            E = "av01";
        }
        var I = B.reader;
        I.skip(1);
        B = I.ba();
        I = I.ba();
        var J = B >>> 5, K = (I & 64) >> 6;
        h.push(E + "." + J + "." + Ui(B & 31) + (I >>> 7 ? "H" : "M") + "." + Ui(J === 2 && K ? (I & 32) >> 5 ? 12 : 10 : K ? 10 : 8) + "." + ((I & 16) >> 4) + "." + ((I & 8) >> 3) + ((I & 4) >> 2) + (I & 3) + "." + Ui(1) + "." + Ui(1) + "." + Ui(1) + ".0");
        l = true;
      }).box("enca", yh).box("encv", xh).box("sinf", uh).box("frma", function(B) {
        B = Ri(B.reader).codec;
        f(B);
      }).box("colr", function(B) {
        h = h.map(function(J) {
          if (J.startsWith("av01.")) {
            var K = B.reader, L = K.Ua(), M = K.$b(4);
            var N = String.fromCharCode(M[0]);
            N += String.fromCharCode(M[1]);
            N += String.fromCharCode(M[2]);
            N += String.fromCharCode(M[3]);
            if (N === "nclx") {
              M = K.Ha();
              N = K.Ha();
              var O = K.Ha(), Q = K.ba() >> 7, R = J.split(".");
              R.length == 10 && (R[6] = Ui(M), R[7] = Ui(N), R[8] = Ui(O), R[9] = String(Q), J = R.join("."));
            }
            K.seek(L);
          }
          return J;
        });
        var E = Si(B.reader), I = E.colorGamut;
        w = E.Ke;
        v = I;
      }).parse(a || b, true, true);
      if (!g.length && !h.length) return null;
      var z = k2 && !l, A = /* @__PURE__ */ new Map();
      if (l && !c) {
        c = new ld("video/mp4");
        a && c.init(a);
        try {
          c.Tf(b);
          for (var C = t(c.zg()), D = C.next(); !D.done; D = C.next()) {
            var F = D.value;
            A.set(F, F);
          }
        } catch (B) {
        }
        c.$d();
      }
      return {
        type: z ? "audio" : "video",
        mimeType: z ? "audio/mp4" : "video/mp4",
        codecs: Fm(g.concat(h)).join(", "),
        language: m,
        height: n,
        width: q,
        channelCount: r,
        sampleRate: u,
        closedCaptions: A,
        Ke: w,
        colorGamut: v,
        frameRate: null
      };
    }
    function Fm(a) {
      var b = /* @__PURE__ */ new Set(), c = [];
      a = t(a);
      for (var d = a.next(); !d.done; d = a.next()) {
        d = d.value;
        var e = mf(d);
        b.has(e) || (c.push(d), b.add(e));
      }
      b = uc("audio", c);
      d = uc("video", c);
      a = uc(tc, c);
      d = Gm(d);
      b = b.concat(d).concat(a);
      return c.length && !b.length ? c : b;
    }
    function Gm(a) {
      if (a.length <= 1) return a;
      var b = a.find(function(c) {
        return c.startsWith("dvav.") || c.startsWith("dva1.") || c.startsWith("dvh1.") || c.startsWith("dvhe.") || c.startsWith("dav1.") || c.startsWith("dvc1.") || c.startsWith("dvi1.");
      });
      return b ? dd('video/mp4; codecs="' + b + '"') ? [b] : a.filter(function(c) {
        return c != b;
      }) : a;
    }
    function Hm(a) {
      var b = null;
      new ph().box("moov", uh).box("trak", uh).box("mdia", uh).box("minf", uh).box("stbl", uh).W("stsd", wh).box("encv", xh).box("enca", yh).box("sinf", uh).box("schi", uh).W("tenc", function(c) {
        c = c.reader;
        c.ba();
        c.ba();
        c.ba();
        c.ba();
        b = lc(c.$b(16));
      }).parse(a, true);
      return b;
    }
    function Im(a, b, c) {
      var d, e, f, g, h;
      return P(function(k2) {
        if (k2.g == 1) return d = b, d.cryptoKey ? k2.B(2) : G(k2, d.fetchKey(), 3);
        e = d.iv;
        if (!e) for (e = Lb(new ArrayBuffer(16)), f = d.firstMediaSequenceNumber + c, g = e.byteLength - 1; g >= 0; g--) e[g] = f & 255, f >>= 8;
        b.blockCipherMode == "CBC" ? h = { name: "AES-CBC", iv: e } : h = { name: "AES-CTR", counter: e, length: 64 };
        return k2.return(window2.crypto.subtle.decrypt(h, d.cryptoKey, a));
      });
    }
    ;
    function Jm(a, b, c, d, e) {
      a = ah(a, d, e);
      if (b != 0 || c != null) a.headers.Range = c ? "bytes=" + b + "-" + c : "bytes=" + b + "-";
      return a;
    }
    ;
    function Km(a, b) {
      var c = this;
      this.g = b;
      this.j = a;
      this.i = null;
      this.K = /* @__PURE__ */ new Map();
      this.F = 1;
      this.C = this.u = null;
      this.P = 0;
      this.h = /* @__PURE__ */ new Map();
      this.J = false;
      this.R = null;
      this.D = false;
      this.l = new ih(function() {
        return Lm(c);
      });
      this.M = Date.now() / 1e3;
      this.m = /* @__PURE__ */ new Map();
      this.O = { projection: null, hfov: null };
      this.V = 0;
      this.S = Infinity;
      this.G = null;
      this.L = [];
      this.A = new Cf(function() {
        if (c.j && c.g) if (c.j.presentationTimeline.U()) {
          var d = c.j.presentationTimeline.ec(), e = c.j.presentationTimeline.Mb();
          e - d > 1 ? el(c.g.ia, d, e) : fl(c.g.ia);
        } else fl(c.g.ia), c.A && c.A.stop();
        else c.A && c.A.stop();
      });
      this.H = null;
      this.I = new Cf(function() {
        var d = c.g.video;
        !d.ended && c.H && (d.currentTime = c.H, c.H = null);
      });
    }
    p = Km.prototype;
    p.destroy = function() {
      return this.l.destroy();
    };
    function Lm(a) {
      var b, c, d, e, f, g, h;
      return P(function(k2) {
        if (k2.g == 1) {
          a.A && a.A.stop();
          a.A = null;
          a.I && a.I.stop();
          a.I = null;
          b = [];
          c = t(a.h.values());
          for (d = c.next(); !d.done; d = c.next()) e = d.value, Mm(e), b.push(Nm(e)), e.ka && (Am(e.ka), e.ka = null);
          f = t(a.m.values());
          for (g = f.next(); !g.done; g = f.next()) h = g.value, Am(h);
          return G(k2, Promise.all(b), 2);
        }
        a.h.clear();
        a.m.clear();
        a.g = null;
        a.j = null;
        a.i = null;
        a.H = null;
        H(k2);
      });
    }
    p.configure = function(a) {
      this.i = a;
      this.R = new Jg({ maxAttempts: Math.max(a.retryParameters.maxAttempts, 2), baseDelay: a.retryParameters.baseDelay, backoffFactor: a.retryParameters.backoffFactor, fuzzFactor: a.retryParameters.fuzzFactor, timeout: 0, stallTimeout: 0, connectionTimeout: 0 }, true);
      if (a.disableAudioPrefetch) {
        var b = this.h.get("audio");
        b && b.ka && (Am(b.ka), b.ka = null);
        b = t(this.m.keys());
        for (var c = b.next(); !c.done; c = b.next()) c = c.value, Am(this.m.get(c)), this.m.delete(c);
      }
      a.disableTextPrefetch && (b = this.h.get(tc)) && b.ka && (Am(b.ka), b.ka = null);
      a.disableVideoPrefetch && (b = this.h.get("video")) && b.ka && (Am(b.ka), b.ka = null);
      b = t(this.h.keys());
      for (c = b.next(); !c.done; c = b.next()) c = this.h.get(c.value), c.ka ? (Bm(c.ka, a.segmentPrefetchLimit), a.segmentPrefetchLimit > 0 || (Am(c.ka), c.ka = null)) : a.segmentPrefetchLimit > 0 && (c.ka = Om(this, c.stream));
      a.disableAudioPrefetch || Pm(this);
    };
    function Qm(a, b, c) {
      a.j.presentationTimeline.U() || (a.V = b, a.S = c);
    }
    p.start = function(a) {
      var b = this;
      return P(function(c) {
        if (c.g == 1) return G(c, Rm(b, a || /* @__PURE__ */ new Map()), 2);
        jh(b.l);
        b.J = true;
        H(c);
      });
    };
    function Sm(a, b) {
      var c, d, e, f, g, h, k2;
      P(function(l) {
        switch (l.g) {
          case 1:
            return c = vc, a.P++, d = a.P, sa(l, 2), G(l, Zk(a.g.ia, c.ab), 4);
          case 4:
            ua(l, 3);
            break;
          case 2:
            if (e = va(l), a.g) a.g.onError(e);
          case 3:
            f = ef(b.mimeType, b.codecs), Ik(a.g.ia, f, a.j.sequenceMode, b.external), g = a.g.ia.$, (h = g.isTextVisible() || a.i.alwaysStreamText) && a.P == d && (k2 = Tm(a, b), a.h.set(c.ab, k2), Um(a, k2, 0)), H(l);
        }
      });
    }
    function Vm(a) {
      var b = a.h.get(tc);
      b && (Mm(b), Nm(b).catch(function() {
      }), a.G = a.h.get(tc), a.h.delete(tc), b.stream && b.stream.closeSegmentIndex && b.stream.closeSegmentIndex());
      a.C = null;
    }
    function Wm(a, b) {
      for (var c = a.g.Ya() < 0, d = t(a.h.values()), e = d.next(); !e.done; e = d.next()) e = e.value, e.Ba && e.Ba.Vd(c), e.ka && e.ka.Vd(c);
      d = t(a.m.values());
      for (e = d.next(); !e.done; e = d.next()) e.value.Vd(c);
      if (c = a.h.get("video")) {
        if (d = c.stream) {
          if (b) (b = d.trickModeVideo) && !c.Sc && (Xm(a, b, false, 0, false), c.Sc = d);
          else if (b = c.Sc) c.Sc = null, Xm(a, b, true, 0, false);
        }
      }
    }
    function Ym(a, b, c, d, e, f) {
      c = c === void 0 ? false : c;
      d = d === void 0 ? 0 : d;
      e = e === void 0 ? false : e;
      f = f === void 0 ? false : f;
      a.u = b;
      a.J && (b.video && Xm(a, b.video, c, d, e, f), b.audio && Xm(a, b.audio, c, d, e, f));
    }
    function Zm(a, b) {
      P(function(c) {
        if (c.g == 1) return a.G = null, a.C = b, a.J ? b.segmentIndex ? c.B(2) : G(c, b.createSegmentIndex(), 2) : c.return();
        Xm(a, b, true, 0, false);
        H(c);
      });
    }
    function $m(a) {
      var b = a.h.get(tc);
      b && Xm(a, b.stream, true, 0, true);
    }
    function an(a, b) {
      for (var c = t(a.K.entries()), d = c.next(); !d.done; d = c.next()) {
        var e = t(d.value);
        d = e.next().value;
        e = e.next().value;
        d.includes(b.type) && (e(), a.K.delete(d));
      }
    }
    function Xm(a, b, c, d, e, f) {
      var g = a.h.get(b.type);
      g || b.type != tc ? g && (g.Sc && (b.trickModeVideo ? (g.Sc = b, b = b.trickModeVideo) : g.Sc = null), g.stream != b || e) && (a.m.has(b) ? g.ka = a.m.get(b) : g.ka && Cm(g.ka, b), b.type == tc && g.stream != b && (e = ef(b.mimeType, b.codecs), Ik(a.g.ia, e, a.j.sequenceMode, b.external)), !a.m.has(g.stream) && g.stream.closeSegmentIndex && (g.$a ? (e = "(" + g.type + ":" + g.stream.id + ")", a.K.has(e) || a.K.set(e, g.stream.closeSegmentIndex)) : g.stream.closeSegmentIndex()), e = g.stream.isAudioMuxedInVideo != b.isAudioMuxedInVideo, g.stream = b, g.Ba = null, g.Gg = !!f, b.dependencyStream ? g.Kc = Tm(a, b.dependencyStream) : g.Kc = null, e && (g.wb = null, g.yc = null, g.xc = null, b.isAudioMuxedInVideo && (b = null, g.type === "video" ? b = a.h.get("audio") : g.type === "audio" && (b = a.h.get("video")), b && (Nm(b).catch(function() {
      }), b.wb = null, b.yc = null, b.xc = null, bn(a, b), cn(a, b).catch(function(h) {
        if (a.g) a.g.onError(h);
      })))), c ? g.$c ? g.xg = true : g.$a ? (g.Yc = true, g.lf = d, g.xg = true) : (Mm(g), dn(a, g, true, d).catch(function(h) {
        if (a.g) a.g.onError(h);
      })) : g.$a || g.Fb || Um(a, g, 0), cn(a, g).catch(function(h) {
        if (a.g) a.g.onError(h);
      })) : Sm(a, b);
    }
    function cn(a, b) {
      var c, d, e;
      return P(function(f) {
        if (f.g == 1) {
          if (!b.Pb) return f.return();
          c = b.stream;
          d = b.Pb;
          return c.segmentIndex ? f.B(2) : G(f, c.createSegmentIndex(), 2);
        }
        if (f.g != 4) return e = c.dependencyStream, !e || e.segmentIndex ? f.B(4) : G(f, e.createSegmentIndex(), 4);
        if (b.Pb != d || b.stream != c) return f.return();
        var g = a.g.gd();
        var h = Ok(a.g.ia, b.type), k2 = b.stream.segmentIndex.find(b.Sa ? b.Sa.endTime : g), l = k2 == null ? null : b.stream.segmentIndex.get(k2);
        k2 = l ? l.endByte ? l.endByte - l.startByte : null : null;
        l && !k2 && (k2 = (l.endTime - l.getStartTime()) * (b.stream.bandwidth || 0) / 8);
        k2 ? ((l = l.ha) && (k2 += (l.endByte ? l.endByte - l.startByte : null) || 0), l = a.g.getBandwidthEstimate(), g = k2 * 8 / l < (h || 0) - g - a.i.rebufferingGoal || b.Pb.h.g > k2 ? true : false) : g = false;
        g && b.Pb.abort();
        H(f);
      });
    }
    p.qd = function() {
      if (this.g) {
        for (var a = this.g.gd(), b = t(this.h.keys()), c = b.next(); !c.done; c = b.next()) {
          var d = c.value;
          c = this.h.get(d);
          var e = this.g.ia;
          d == tc ? (e = e.h, e = e.g == null || e.h == null ? false : a >= e.g && a < e.h) : (e = Nk(e, d), e = Jj(e, a));
          if (!e) {
            this.M = 0;
            c.ka && (c.ka.g = null);
            if (c.type === "audio") {
              e = t(this.m.values());
              for (var f = e.next(); !f.done; f = e.next()) f.value.g = null;
            }
            c.Ba = null;
            (Ok(this.g.ia, d) != null || c.$a) && bn(this, c);
            c.Pb && (c.Pb.abort(), c.Pb = null);
            d === tc && (d = this.g.ia, d.J && d.J.$d());
            c.qd = true;
          }
        }
        en(this) && fn(this);
      }
    };
    function bn(a, b) {
      b.$c || b.Yc || (b.$a ? (b.Yc = true, b.lf = 0) : Mk(a.g.ia, b.type) == null ? b.Fb == null && Um(a, b, 0) : (Mm(b), dn(a, b, false, 0).catch(function(c) {
        if (a.g) a.g.onError(c);
      })));
    }
    function Rm(a, b) {
      var c, d, e, f, g, h, k2, l;
      return P(function(m) {
        if (m.g == 1) {
          if (!a.u) throw new U(2, 5, 5006);
          c = gn(a, true);
          d = a.g.ia;
          return G(m, d.init(c, a.j.sequenceMode, a.j.type, a.j.ignoreManifestTimestampsInSegmentsMode), 2);
        }
        jh(a.l);
        a.updateDuration();
        e = t(c.keys());
        for (f = e.next(); !f.done; f = e.next()) g = f.value, h = c.get(g), a.h.has(g) || (k2 = Tm(a, h), b.has(h.id) && (l = b.get(h.id), sm(l, function(n, q, r) {
          return hn(n, q, r || null, a.i.retryParameters, a.g.Bc);
        }), k2.ka = l), a.h.set(g, k2), Um(a, k2, 0));
        H(m);
      });
    }
    function Tm(a, b) {
      var c = { stream: b, type: b.type, Ba: null, ka: Om(a, b), Sa: null, wb: null, Hf: null, yc: null, xc: null, Ff: null, Gf: null, Sc: null, endOfStream: false, $a: false, Fb: null, Yc: false, lf: 0, xg: false, $c: false, qd: true, Gg: false, Th: false, oe: false, Pb: null, Kc: null };
      b.dependencyStream && (c.Kc = Tm(a, b.dependencyStream));
      return c;
    }
    function Om(a, b) {
      if (b.type === "video" && a.i.disableVideoPrefetch || b.type === "audio" && a.i.disableAudioPrefetch || b.type === tc && (b.mimeType == "application/cea-608" || b.mimeType == "application/cea-708") || b.type === tc && a.i.disableTextPrefetch) return null;
      if (a.m.has(b)) return a.m.get(b);
      var c = a.h.get(b.type);
      return (c = c && c.ka) && b === c.i ? c : a.i.segmentPrefetchLimit > 0 ? new rm(a.i.segmentPrefetchLimit, b, function(d, e, f) {
        return hn(d, e, f || null, a.i.retryParameters, a.g.Bc);
      }, a.g.Ya() < 0) : null;
    }
    function Pm(a) {
      for (var b = a.i.segmentPrefetchLimit, c = a.i.prefetchAudioLanguages, d = t(a.j.variants), e = d.next(), f = {}; !e.done; f = { Tb: void 0 }, e = d.next()) if (f.Tb = e.value, f.Tb.audio) if (a.m.has(f.Tb.audio)) {
        if (e = a.m.get(f.Tb.audio), Bm(e, b), !(b > 0 && c.some(/* @__PURE__ */ function(h) {
          return function(k2) {
            return yc(h.Tb.audio.language, k2);
          };
        }(f)))) {
          var g = a.h.get(f.Tb.audio.type);
          e !== (g && g.ka) && Am(e);
          a.m.delete(f.Tb.audio);
        }
      } else b <= 0 || !c.some(/* @__PURE__ */ function(h) {
        return function(k2) {
          return yc(h.Tb.audio.language, k2);
        };
      }(f)) || !(e = Om(a, f.Tb.audio)) || (f.Tb.audio.segmentIndex || f.Tb.audio.createSegmentIndex(), a.m.set(f.Tb.audio, e));
    }
    p.updateDuration = function() {
      var a = hd(), b = this.j.presentationTimeline.getDuration();
      b < Infinity ? (a && (this.A && this.A.stop(), fl(this.g.ia)), this.g.ia.yb(b)) : a ? (this.A && this.A.za(0.5), this.g.ia.yb(Infinity)) : this.g.ia.yb(4294967296);
    };
    function jn(a, b) {
      var c, d, e, f, g, h, k2, l, m;
      return P(function(n) {
        switch (n.g) {
          case 1:
            jh(a.l);
            c = vc;
            if (b.$a || b.Fb == null || b.$c) return n.return();
            b.Fb = null;
            if (!b.Yc) {
              n.B(2);
              break;
            }
            return G(n, dn(a, b, b.xg, b.lf), 3);
          case 3:
            return n.return();
          case 2:
            an(a, b);
            if (b.stream.segmentIndex) {
              n.B(4);
              break;
            }
            d = b.stream;
            sa(n, 5);
            return G(n, b.stream.createSegmentIndex(), 7);
          case 7:
            ua(n, 6);
            break;
          case 5:
            return e = va(n), G(n, kn(a, b, e), 8);
          case 8:
            return n.return();
          case 6:
            if (d != b.stream) return d.closeSegmentIndex && d.closeSegmentIndex(), b.$a || b.Fb || Um(a, b, 0), n.return();
          case 4:
            if (!b.Kc) {
              n.B(9);
              break;
            }
            if (b.Kc.stream.segmentIndex) {
              n.B(9);
              break;
            }
            sa(n, 11);
            return G(n, b.Kc.stream.createSegmentIndex(), 13);
          case 13:
            ua(n, 9);
            break;
          case 11:
            va(n);
          case 9:
            sa(n, 14);
            f = ln(a, b);
            f != null && (Um(a, b, f), b.oe = false);
            ua(n, 15);
            break;
          case 14:
            return g = va(n), G(n, kn(a, b, g), 16);
          case 16:
            return n.return();
          case 15:
            if (b.type === c.ab) return n.return();
            h = [b];
            k2 = b.type === c.na ? c.Ja : c.na;
            (l = a.h.get(k2)) && h.push(l);
            if (!a.J || !h.every(function(q) {
              return q.endOfStream;
            })) {
              n.B(0);
              break;
            }
            return G(
              n,
              a.g.ia.endOfStream(),
              18
            );
          case 18:
            jh(a.l), m = a.g.ia.getDuration(), m != 0 && m < a.j.presentationTimeline.getDuration() && a.j.presentationTimeline.yb(m), H(n);
        }
      });
    }
    function ln(a, b) {
      if (mn(b)) return Wk(a.g.ia, b.stream.originalId || ""), null;
      b.type == tc && Xk(a.g.ia);
      if (b.stream.isAudioMuxedInVideo && b.type == "audio") return null;
      if (b.type != tc && Gk(a.g.ia)) return nn(a, true), null;
      var c = a.i.updateIntervalSeconds / Math.max(1, Math.abs(a.g.Ya()));
      if (!Lk(a.g.ia) && b.type != tc) return c / 2;
      var d = a.g.gd();
      if (b.type === "audio") for (var e = t(a.m.keys()), f = e.next(); !f.done; f = e.next()) f = a.m.get(f.value), f.ib(d, true), tm(f, d);
      e = b.Sa ? b.Sa.endTime : d;
      var g = Pk(a.g.ia, b.type, d);
      f = Math.max(1, Math.max(
        a.i.rebufferingGoal,
        a.i.bufferingGoal
      ) * a.F);
      var h = a.j.presentationTimeline.getDuration() - e, k2 = Ok(a.g.ia, b.type);
      if (h < 1e-6 && k2) return b.endOfStream = true, b.type == "video" && (a = a.h.get(tc)) && mn(a) && (a.endOfStream = true), null;
      b.endOfStream = false;
      if (g >= f) return c / 2;
      h = !b.Ba;
      k2 = on(a, b, d, k2);
      if (!k2) return c;
      g = b.wb;
      var l = k2.ha;
      g && l && Bj(l, g) && (g.g = l.g);
      g = false;
      h && b.Gg && (g = true, b.Gg = false);
      h = Infinity;
      l = Array.from(a.h.values());
      l = t(l);
      for (var m = l.next(); !m.done; m = l.next()) m = m.value, mn(m) || m.Ba && !m.Ba.current() || (h = Math.min(h, m.Sa ? m.Sa.endTime : d));
      if (e >= h + a.j.presentationTimeline.h) return c;
      b.ka && b.Ba && !a.m.has(b.stream) && (b.ka.ib(k2.startTime + 1e-3), tm(b.ka, k2.startTime).catch(function() {
      }));
      if (en(a) && pn(a, b, k2)) return null;
      qn(a, b, d, k2, g).catch(function() {
      });
      b.Kc && rn(a, b.Kc, d, f);
      return null;
    }
    function on(a, b, c, d) {
      if (b.Ba) return (c = b.Ba.current()) && b.Sa && Math.abs(b.Sa.startTime - c.startTime) < 1e-3 && (c = b.Ba.next().value), c;
      if (b.Sa || d) return c = b.Sa ? b.Sa.endTime : d, a = a.g.Ya() < 0, b.stream.segmentIndex && (b.Ba = b.stream.segmentIndex.dc(c, false, a)), b.Ba && b.Ba.next().value;
      d = a.j.sequenceMode || en(a) ? 0 : a.i.inaccurateManifestTolerance;
      var e = Math.max(c - d, 0);
      a = a.g.Ya() < 0;
      var f = null;
      d && (b.stream.segmentIndex && (b.Ba = b.stream.segmentIndex.dc(e, false, a)), f = b.Ba && b.Ba.next().value);
      f || (b.stream.segmentIndex && (b.Ba = b.stream.segmentIndex.dc(c, false, a)), f = b.Ba && b.Ba.next().value);
      return f;
    }
    function qn(a, b, c, d, e) {
      var f, g, h, k2, l, m, n, q, r, u, w, v, y, z, A, C, D, F;
      return P(function(B) {
        switch (B.g) {
          case 1:
            f = vc;
            g = b.stream;
            h = b.Ba;
            b.$a = true;
            sa(B, 2);
            if (d.Oc() == 2) throw new U(1, 1, 1011);
            return G(B, sn(a, b, d, e), 4);
          case 4:
            jh(a.l);
            if (a.D) return B.return();
            k2 = g.mimeType == "video/mp4" || g.mimeType == "audio/mp4";
            l = window2.ReadableStream;
            if ((m = a.i.lowLatencyMode && a.j.isLowLatency) && l && k2 && (a.j.type != "HLS" || d.m)) return r = new Uint8Array(0), w = u = false, y = function(E) {
              var I, J, K, L;
              return P(function(M) {
                switch (M.g) {
                  case 1:
                    if (u) return M.return();
                    w = true;
                    jh(a.l);
                    if (a.D) return M.return();
                    sa(M, 2);
                    r = mc(r, E);
                    I = false;
                    J = 0;
                    new ph().box("mdat", function(N) {
                      J = N.size + N.start;
                      I = true;
                    }).parse(r, false, true);
                    if (!I) {
                      M.B(4);
                      break;
                    }
                    K = r.subarray(0, J);
                    r = r.subarray(J);
                    return G(M, tn(a, b, c, g, d, K, true, e), 5);
                  case 5:
                    b.ka && b.Ba && tm(b.ka, d.startTime, true);
                  case 4:
                    ua(M, 0);
                    break;
                  case 2:
                    v = L = va(M), H(M);
                }
              });
            }, G(B, un(a, b, d, y), 9);
            n = un(a, b, d);
            return G(B, n, 7);
          case 7:
            q = B.h;
            jh(a.l);
            if (a.D) return B.return();
            jh(a.l);
            return b.Yc ? (b.$a = false, Um(a, b, 0), B.return()) : G(B, tn(a, b, c, g, d, q, false, e), 6);
          case 9:
            z = B.h;
            if (v) throw v;
            if (w) {
              B.B(10);
              break;
            }
            u = true;
            jh(a.l);
            return a.D ? B.return() : b.Yc ? (b.$a = false, Um(a, b, 0), B.return()) : G(B, tn(a, b, c, g, d, z, false, e), 10);
          case 10:
            b.ka && b.Ba && tm(b.ka, d.startTime, true);
          case 6:
            jh(a.l);
            if (a.D) return B.return();
            b.Sa = d;
            h.next();
            b.$a = false;
            b.Th = false;
            A = a.g.ia.cc();
            C = A[b.type];
            gb(JSON.stringify(C));
            b.Yc || (D = null, b.type === f.Ja ? D = a.h.get(f.na) : b.type === f.na && (D = a.h.get(f.Ja)), D && D.type == f.na ? a.g.Rf(d, b.stream, D.stream.isAudioMuxedInVideo) : a.g.Rf(d, b.stream, b.stream.codecs.includes(",")));
            Mm(b);
            Um(a, b, 0);
            ua(B, 0);
            break;
          case 2:
            F = va(B);
            jh(a.l, F);
            if (a.D) return B.return();
            b.$a = false;
            if (F.code == 7001) b.$a = false, Mm(b), Um(a, b, 0), B.B(0);
            else if (b.type == f.ab && a.i.ignoreTextStreamFailures) a.h.delete(f.ab), B.B(0);
            else {
              if (F.code == 3017) return G(B, vn(a, b, F), 0);
              b.oe = true;
              F.category == 1 && b.ka && zm(b.ka, d);
              F.severity = 2;
              return G(B, kn(a, b, F), 0);
            }
        }
      });
    }
    function rn(a, b, c, d) {
      var e, f, g, h, k2, l, m, n, q, r, u;
      return P(function(w) {
        switch (w.g) {
          case 1:
            e = b.stream;
            for (h = (g = (f = e.segmentIndex) && f.dc(c)) && g.next().value; h && a.L.includes(h.startTime); ) h = g && g.next().value;
            if (!h) {
              w.B(0);
              break;
            }
            k2 = h.ha;
            if (!k2 || Bj(k2, b.wb)) {
              w.B(3);
              break;
            }
            b.wb = k2;
            sa(w, 4);
            return G(w, un(a, b, k2), 6);
          case 6:
            l = w.h;
            var v = a.g.ia;
            v.M && ad(v.M, l, 0, e);
            a.L = [];
            ua(w, 3);
            break;
          case 4:
            throw m = va(w), b.wb = null, m;
          case 3:
            if (b.Sa && b.Sa == h) {
              w.B(0);
              break;
            }
            b.Sa = h;
            sa(w, 8);
            return G(w, un(a, b, h), 10);
          case 10:
            n = w.h;
            v = a.g.ia;
            v.M && ad(v.M, n, 0, e);
            a.L.push(h.startTime);
            ua(w, 9);
            break;
          case 8:
            throw q = va(w), b.Sa = null, q;
          case 9:
            r = Math.max.apply(Math, [0].concat(x(a.L)));
            u = a.g.gd();
            if (u + d > r) return G(w, rn(a, b, h.startTime, d), 0);
            w.B(0);
        }
      });
    }
    function vn(a, b, c) {
      var d, e, f, g, h, k2;
      return P(function(l) {
        if (l.g == 1) {
          d = Array.from(a.h.values());
          if (e = d.some(function(m) {
            return m != b && m.Th;
          })) return l.B(2);
          f = a.i.maxDisabledTime === 0 && c.code == 1011 ? 1 : a.i.maxDisabledTime;
          if (g = a.g.disableStream(b.stream, f)) return l.return();
          if (a.i.avoidEvictionOnQuotaExceededError) return Um(a, b, 4), l.return();
          h = Math.round(100 * a.F);
          if (h > 20) a.F -= 0.2;
          else if (h > 4) a.F -= 0.04;
          else return b.oe = true, a.D = true, a.g.onError(c), l.return();
          b.Th = true;
          k2 = a.g.gd();
          return G(l, wn(a, b, k2), 2);
        }
        Um(a, b, 4);
        H(l);
      });
    }
    function sn(a, b, c, d) {
      var e, f, g, h, k2, l, m, n, q, r, u, w, v, y, z, A;
      return P(function(C) {
        switch (C.g) {
          case 1:
            e = vc;
            f = b.Sa == null;
            g = [];
            h = Math.max(0, Math.max(c.appendWindowStart, a.V) - 0.1);
            k2 = Math.min(c.appendWindowEnd, a.S) + 0.1;
            l = c.codecs || b.stream.codecs;
            m = mf(l);
            n = nf(c.mimeType || b.stream.mimeType);
            q = c.timestampOffset;
            if (q == b.Hf && h == b.yc && k2 == b.xc && m == b.Ff && n == b.Gf) {
              C.B(2);
              break;
            }
            r = b.Ff && b.Gf && zl(a.g.ia, b.type, n, l, gn(a));
            if (!r) {
              C.B(3);
              break;
            }
            u = null;
            b.type === e.Ja ? u = a.h.get(e.na) : b.type === e.na && (u = a.h.get(e.Ja));
            if (!u) {
              C.B(3);
              break;
            }
            return G(
              C,
              Nm(u).catch(function() {
              }),
              5
            );
          case 5:
            u.wb = null, u.yc = null, u.xc = null, bn(a, u);
          case 3:
            return G(C, xn(a, b, q, h, k2, c, m, n), 2);
          case 2:
            return Bj(c.ha, b.wb) || (b.wb = c.ha, c.l && c.ha && (w = un(a, b, c.ha), v = function() {
              var D, F, B, E, I, J, K, L, M;
              return P(function(N) {
                switch (N.g) {
                  case 1:
                    return sa(N, 2), G(N, w, 4);
                  case 4:
                    return D = N.h, jh(a.l), F = null, B = /* @__PURE__ */ new Map(), E = { projection: null, hfov: null }, I = new ph(), I.box("moov", uh).box("trak", uh).box("mdia", uh).W("mdhd", function(O) {
                      F = Oi(O.reader, O.version).timescale;
                    }).box("hdlr", function(O) {
                      O = O.reader;
                      O.skip(8);
                      switch (O.nd()) {
                        case "soun":
                          B.set(e.na, F);
                          break;
                        case "vide":
                          B.set(e.Ja, F);
                      }
                      F = null;
                    }), b.type === e.Ja && I.box("minf", uh).box("stbl", uh).W("stsd", wh).box("encv", xh).box("avc1", xh).box("avc3", xh).box("hev1", xh).box("hvc1", xh).box("dvav", xh).box("dva1", xh).box("dvh1", xh).box("dvhe", xh).box("dvc1", xh).box("dvi1", xh).box("vexu", uh).box("proj", uh).W("prji", function(O) {
                      O = O.reader.nd();
                      E.projection = O;
                    }).box("hfov", function(O) {
                      O = O.reader.X() / 1e3;
                      E.hfov = O;
                    }), I.parse(D, true, true), b.type === e.Ja && yn(a, E), B.has(b.type) ? c.ha.timescale = B.get(b.type) : F != null && (c.ha.timescale = F), J = b.stream.segmentIndex, J instanceof bm && (K = dm(J, c.startTime)), L = b.stream.closedCaptions && b.stream.closedCaptions.size > 0, G(N, a.g.Ji(b.type, D), 5);
                  case 5:
                    return G(N, Rk(a.g.ia, b.type, D, null, b.stream, L, b.qd, d, false, false, K), 6);
                  case 6:
                    ua(N, 0);
                    break;
                  case 2:
                    throw M = va(N), b.wb = null, M;
                }
              });
            }, y = c.startTime, f && (z = Ok(a.g.ia, b.type), z != null && (y = z)), a.g.Tl(y, c.ha), g.push(v()))), A = b.Sa ? b.Sa.i : -1, c.i != A && g.push(cl(a.g.ia, b.type, c.startTime)), G(C, Promise.all(g), 0);
        }
      });
    }
    function xn(a, b, c, d, e, f, g, h) {
      var k2, l, m, n, q;
      return P(function(r) {
        switch (r.g) {
          case 1:
            k2 = vc;
            l = gn(a);
            sa(r, 2);
            b.yc = d;
            b.xc = e;
            g && (b.Ff = g);
            h && (b.Gf = h);
            b.Hf = c;
            m = a.j.sequenceMode || a.j.type == "HLS";
            n = null;
            b.type === k2.Ja ? n = a.h.get(k2.na) : b.type === k2.na && (n = a.h.get(k2.Ja));
            if (!(n && n.stream && n.stream.isAudioMuxedInVideo)) {
              r.B(4);
              break;
            }
            return G(r, $k(a.g.ia, n.type, c, d, e, m, n.stream.mimeType, n.stream.codecs, l), 4);
          case 4:
            return G(r, $k(a.g.ia, b.type, c, d, e, m, f.mimeType || b.stream.mimeType, f.codecs || b.stream.codecs, l), 6);
          case 6:
            ua(
              r,
              0
            );
            break;
          case 2:
            throw q = va(r), b.yc = null, b.xc = null, b.Ff = null, b.Gf = null, b.Hf = null, q;
        }
      });
    }
    function tn(a, b, c, d, e, f, g, h) {
      g = g === void 0 ? false : g;
      h = h === void 0 ? false : h;
      var k2, l, m, n, q;
      return P(function(r) {
        switch (r.g) {
          case 1:
            return k2 = d.closedCaptions && d.closedCaptions.size > 0, a.i.shouldFixTimestampOffset && (l = d.mimeType == "video/mp4" || d.mimeType == "audio/mp4", m = null, e.ha && (m = e.ha.timescale), (n = l && m && d.type === "video" && a.j.type == "DASH") && new ph().box("moof", uh).box("traf", uh).W("tfdt", function(u) {
              var w, v, y, z, A, C;
              return P(function(D) {
                w = Ni(u.reader, u.version);
                v = w.baseMediaDecodeTime;
                if (!v) return D.return();
                y = -v / m;
                z = Number(b.Hf) || 0;
                if (!(z < y)) return D.B(0);
                A = b.yc;
                C = b.xc;
                return G(D, xn(a, b, y, A, C, e), 0);
              });
            }).parse(f, false, g)), G(r, wn(a, b, c), 2);
          case 2:
            return jh(a.l), q = b.qd, b.qd = false, G(r, a.g.Ji(b.type, f), 3);
          case 3:
            return G(r, Rk(a.g.ia, b.type, f, e, d, k2, q, h, g), 4);
          case 4:
            jh(a.l), H(r);
        }
      });
    }
    function wn(a, b, c) {
      var d, e, f, g, h, k2, l, m, n;
      return P(function(q) {
        if (q.g == 1) {
          d = b.stream.segmentIndex;
          d instanceof bm && (d.ib(a.j.presentationTimeline.Nb()), e = [], cm(d, function(r) {
            e.push(r.mf());
          }));
          f = Math.max(a.i.bufferBehind * a.F, a.j.presentationTimeline.h);
          g = Mk(a.g.ia, b.type);
          if (g == null) return a.G == b && (a.G = null), q.return();
          h = c - g;
          k2 = a.i.evictionGoal;
          l = a.j.presentationTimeline.ec();
          m = a.j.presentationTimeline.Mb();
          n = h - f;
          m - l > k2 && (n = Math.max(h - f, l - k2 - g));
          return n <= k2 ? q.return() : G(
            q,
            a.g.ia.remove(b.type, g, g + n, e),
            2
          );
        }
        if (q.g != 4) return jh(a.l), a.G ? G(q, wn(a, a.G, c), 4) : q.B(0);
        jh(a.l);
        H(q);
      });
    }
    function mn(a) {
      return a && a.type == tc && (a.stream.mimeType == "application/cea-608" || a.stream.mimeType == "application/cea-708");
    }
    function un(a, b, c, d) {
      var e, f, g, h, k2;
      return P(function(l) {
        switch (l.g) {
          case 1:
            if (e = c.fc()) return l.return(e);
            f = null;
            if (b.ka) {
              var m = b.ka, n = m.h;
              c instanceof Aj && (n = m.j);
              n.has(c) ? (m = n.get(c), d && (m.ni = d), f = m.ze) : f = null;
            }
            f || (f = hn(c, b.stream, d || null, a.i.retryParameters, a.g.Bc));
            g = 0;
            b.Ba && (g = b.Ba.h);
            b.Pb = f;
            return G(l, f.promise, 2);
          case 2:
            h = l.h;
            b.Pb = null;
            k2 = h.data;
            if (!c.aesKey) {
              l.B(3);
              break;
            }
            return G(l, Im(k2, c.aesKey, g), 4);
          case 4:
            k2 = l.h;
          case 3:
            return l.return(k2);
        }
      });
    }
    function hn(a, b, c, d, e, f) {
      f = f === void 0 ? false : f;
      var g = a instanceof Cj ? a : void 0, h = g ? 1 : 0;
      a = Jm(a.T(), a.startByte, a.endByte, d, c);
      a.contentType = b.type;
      return e.request(gh, a, { type: h, stream: b, segment: g, isPreload: f });
    }
    function dn(a, b, c, d) {
      var e, f;
      return P(function(g) {
        if (g.g == 1) return b.Yc = false, b.xg = false, b.lf = 0, b.$c = true, b.Sa = null, b.Ba = null, b.ka && !a.m.has(b.stream) && Am(b.ka), d ? (e = a.g.gd(), f = a.g.ia.getDuration(), G(g, a.g.ia.remove(b.type, e + d, f), 3)) : G(g, Zk(a.g.ia, b.type), 4);
        if (g.g != 3) return jh(a.l), c ? G(g, a.g.ia.flush(b.type), 3) : g.B(3);
        jh(a.l);
        b.$c = false;
        b.endOfStream = false;
        b.$a || b.Fb || Um(a, b, 0);
        H(g);
      });
    }
    function Um(a, b, c) {
      var d = b.type;
      if (d != tc || a.h.has(d)) b.Fb = new Bf(function() {
        var e;
        return P(function(f) {
          if (f.g == 1) return sa(f, 2), G(f, jn(a, b), 4);
          if (f.g != 2) return ua(f, 0);
          e = va(f);
          if (a.g) a.g.onError(e);
          H(f);
        });
      }).Y(c);
    }
    function Mm(a) {
      a.Fb != null && (a.Fb.stop(), a.Fb = null);
    }
    function Nm(a) {
      return P(function(b) {
        return a.Pb ? G(b, a.Pb.abort(), 0) : b.B(0);
      });
    }
    function kn(a, b, c) {
      var d;
      return P(function(e) {
        if (e.g == 1) return c.code == 3024 ? (b.$a = false, Mm(b), Um(a, b, 0), e.return()) : G(e, Lg(a.R), 2);
        jh(a.l);
        if (c.category === 1 && c.code != 1003) {
          if (b.Sc) return Wm(a, false), e.return();
          d = a.i.maxDisabledTime === 0 && c.code == 1011 ? 1 : a.i.maxDisabledTime;
          c.handled = a.g.disableStream(b.stream, d);
          c.handled && (c.severity = 1);
        }
        if (!c.handled || c.code != 1011) a.g.onError(c);
        c.handled || a.i.failureCallback(c);
        H(e);
      });
    }
    function nn(a, b) {
      b = b === void 0 ? false : b;
      var c = c === void 0 ? true : c;
      var d, e, f, g, h;
      return P(function(k2) {
        if (k2.g == 1) {
          d = Date.now() / 1e3;
          e = a.i.minTimeBetweenRecoveries;
          if (!b) {
            if (!a.i.allowMediaSourceRecoveries || d - a.M < e) return k2.return(false);
            a.M = d;
          }
          f = vc;
          if (g = a.h.get(f.na)) g.wb = null, g.yc = null, g.xc = null, c && bn(a, g), Nm(g).catch(function() {
          }), g.Ba && g.Ba.Wh(), Mm(g);
          if (h = a.h.get(f.Ja)) h.wb = null, h.yc = null, h.xc = null, c && bn(a, h), Nm(h).catch(function() {
          }), h.Ba && h.Ba.Wh(), Mm(h);
          return G(k2, tl(a.g.ia, gn(a)), 2);
        }
        !h || h.$c || h.$a || h.Fb || Um(a, h, 0);
        !g || g.$c || g.$a || g.Fb || Um(a, g, 0);
        return k2.return(true);
      });
    }
    function yn(a, b) {
      if (a.O.projection != b.projection || a.O.hfov != b.hfov) {
        if (b.projection != null || b.hfov != null) {
          var c = (/* @__PURE__ */ new Map()).set("detail", b);
          c = new T("spatialvideoinfo", c);
        } else c = new T("nospatialvideoinfo");
        c.cancelable = true;
        a.g.onEvent(c);
        a.O = b;
      }
    }
    function en(a) {
      return a.i.crossBoundaryStrategy !== "keep" ? true : false;
    }
    function fn(a) {
      if (en(a)) {
        a.I.stop();
        var b = a.g.gd(), c = a.h.get("video") || a.h.get("audio");
        c && (c = c.wb) && c.g !== null && (b = c.g - b, b < 0 || b > 1 || (a.H = c.g + 0.1, a.I.Y(b)));
      }
    }
    function pn(a, b, c) {
      if (b.type === tc) return false;
      var d = b.wb;
      if (!d) return false;
      var e = c.ha;
      c = d.g !== e.g;
      a.i.crossBoundaryStrategy === "reset_to_encrypted" && (d.encrypted || e.encrypted || (c = false), d.encrypted && (a.i.crossBoundaryStrategy = "keep"));
      a.i.crossBoundaryStrategy === "RESET_ON_ENCRYPTION_CHANGE" && d.encrypted == e.encrypted && (c = false);
      if (c && b.qd) {
        var f = a.g.video, g = f.paused;
        nn(a, true).then(function() {
          var h = (/* @__PURE__ */ new Map()).set("oldEncrypted", d.encrypted).set("newEncrypted", e.encrypted);
          a.g.onEvent(new T("boundarycrossed", h));
          g || f.play();
        });
      }
      return c;
    }
    function gn(a, b) {
      b = b === void 0 ? false : b;
      var c = /* @__PURE__ */ new Map();
      a.u.audio && c.set("audio", a.u.audio);
      a.u.video && c.set("video", a.u.video);
      b && a.C && c.set(tc, a.C);
      return c;
    }
    ;
    function zn() {
    }
    function An(a, b, c, d, e) {
      var f = e in d;
      var g = f ? c.constructor == Object && Object.keys(d).length == 0 : c.constructor == Object && Object.keys(c).length == 0;
      var h = f || g, k2 = true, l;
      for (l in b) {
        var m = e + "." + l, n = f ? d[e] : c[l];
        h || l in c ? b[l] === void 0 ? n === void 0 || h ? delete a[l] : a[l] = Hd(n) : g ? a[l] = b[l] : n.constructor == Object && b[l] && b[l].constructor == Object ? (a[l] || (a[l] = Hd(n)), m = An(a[l], b[l], n, d, m), k2 = k2 && m) : typeof b[l] != typeof n || b[l] == null || typeof b[l] != "function" && b[l].constructor != n.constructor ? (ab("Invalid config, wrong type for " + m), k2 = false) : typeof c[l] == "function" && c[l].length != b[l].length ? (bb("Unexpected number of arguments for " + m), a[l] = b[l]) : a[l] = Array.isArray(a[l]) ? b[l].slice() : b[l] : (ab("Invalid config, unrecognized key " + m), k2 = false);
      }
      return k2;
    }
    function Bn(a, b) {
      for (var c = {}, d = c, e = 0, f = 0; ; ) {
        e = a.indexOf(".", e);
        if (e < 0) break;
        if (e == 0 || a[e - 1] != "\\") f = a.substring(f, e).replace(/\\\./g, "."), d[f] = {}, d = d[f], f = e + 1;
        e += 1;
      }
      d[a.substring(f).replace(/\\\./g, ".")] = b;
      return c;
    }
    function Cn(a, b) {
      return a && b;
    }
    function Dn(a, b) {
      function c(f) {
        for (var g = t(Object.keys(f)), h = g.next(); !h.done; h = g.next()) if (h = h.value, !(f[h] instanceof HTMLElement)) if (e(f[h]) && Object.keys(f[h]).length === 0) delete f[h];
        else {
          var k2 = f[h];
          Array.isArray(k2) && k2.length === 0 ? delete f[h] : typeof f[h] == "function" ? delete f[h] : e(f[h]) && (c(f[h]), Object.keys(f[h]).length === 0 && delete f[h]);
        }
      }
      function d(f, g) {
        return Object.keys(f).reduce(function(h, k2) {
          var l = f[k2];
          if (g.hasOwnProperty(k2)) if (l instanceof HTMLElement && g[k2] instanceof HTMLElement) l.isEqualNode(g[k2]) || (h[k2] = l);
          else if (e(l) && e(g[k2])) {
            if (l = d(l, g[k2]), Object.keys(l).length > 0 || !e(l)) h[k2] = l;
          } else Array.isArray(l) && Array.isArray(g[k2]) ? vd(l, g[k2]) || (h[k2] = l) : Number.isNaN(l) && Number.isNaN(g[k2]) || l !== g[k2] && (h[k2] = l);
          else h[k2] = l;
          return h;
        }, {});
      }
      function e(f) {
        return f && typeof f === "object" && !Array.isArray(f);
      }
      a = d(a, b);
      c(a);
      return a;
    }
    S("shaka.util.ConfigUtils", zn);
    zn.getDifferenceFromConfigObjects = Dn;
    zn.convertToConfigObject = Bn;
    zn.mergeConfigObjects = An;
    S("shaka.config.RepeatMode", { OFF: 0, ALL: 1, SINGLE: 2 });
    function En() {
    }
    function Fn(a) {
      a = $b(a);
      return new rb(a).Ib;
    }
    function Gn(a, b, c) {
      function d(h) {
        Pb(f).setUint32(g, h.byteLength, true);
        g += 4;
        f.set(Lb(h), g);
        g += h.byteLength;
      }
      if (!c || !c.byteLength) throw new U(2, 6, 6015);
      var e;
      typeof b == "string" ? e = bc(b, true) : e = b;
      a = $b(a);
      a = bc(a, true);
      var f = new Uint8Array(12 + a.byteLength + e.byteLength + c.byteLength), g = 0;
      d(a);
      d(e);
      d(c);
      return f;
    }
    function Hn(a, b, c) {
      if (b !== "skd") return a;
      b = c.serverCertificate;
      c = $b(a).split("skd://").pop();
      return Gn(a, c, b);
    }
    function In(a, b) {
      a === 2 && (a = b.drmInfo) && Cg(a.keySystem) && (b.headers["Content-Type"] = "application/octet-stream");
    }
    S("shaka.drm.FairPlay", En);
    En.commonFairPlayResponse = function(a, b) {
      if (a === 2 && (a = b.originalRequest.drmInfo) && Cg(a.keySystem)) {
        try {
          var c = Xb(b.data);
        } catch (e) {
          return;
        }
        a = false;
        c = c.trim();
        c.substr(0, 5) === "<ckc>" && c.substr(-6) === "</ckc>" && (c = c.slice(5, -6), a = true);
        if (!a) try {
          var d = JSON.parse(c);
          d.ckc && (c = d.ckc, a = true);
          d.CkcMessage && (c = d.CkcMessage, a = true);
          d.License && (c = d.License, a = true);
        } catch (e) {
        }
        a && (b.data = Mb(jc(c)));
      }
    };
    En.muxFairPlayRequest = function(a, b) {
      In(a, b);
    };
    En.expressplayFairPlayRequest = function(a, b) {
      if (a === 2) {
        var c = b.drmInfo;
        c && Cg(c.keySystem) && In(a, b);
      }
    };
    En.conaxFairPlayRequest = function(a, b) {
      In(a, b);
    };
    En.ezdrmFairPlayRequest = function(a, b) {
      In(a, b);
    };
    En.verimatrixFairPlayRequest = function(a, b) {
      a === 2 && (a = b.drmInfo) && Cg(a.keySystem) && (a = Lb(b.body), a = ic(a), b.headers["Content-Type"] = "application/x-www-form-urlencoded", b.body = ac("spc=" + a));
    };
    En.muxInitDataTransform = function(a, b, c) {
      return Hn(a, b, c);
    };
    En.expressplayInitDataTransform = function(a, b, c) {
      return Hn(a, b, c);
    };
    En.conaxInitDataTransform = function(a, b, c) {
      if (b !== "skd") return a;
      b = c.serverCertificate;
      c = $b(a).split("skd://").pop().split("?").shift();
      c = window2.atob(c);
      var d = new ArrayBuffer(c.length * 2);
      d = Ob(d);
      for (var e = 0, f = c.length; e < f; e++) d[e] = c.charCodeAt(e);
      return Gn(a, d, b);
    };
    En.ezdrmInitDataTransform = function(a, b, c) {
      if (b !== "skd") return a;
      b = c.serverCertificate;
      c = $b(a).split(";").pop();
      return Gn(a, c, b);
    };
    En.verimatrixInitDataTransform = function(a, b, c) {
      return Hn(a, b, c);
    };
    En.initDataTransform = Gn;
    En.defaultGetContentId = Fn;
    En.isFairPlaySupported = function() {
      var a;
      return P(function(b) {
        if (b.g == 1) return a = { initDataTypes: ["cenc", "sinf", "skd"], videoCapabilities: [{ contentType: 'video/mp4; codecs="avc1.42E01E"' }] }, sa(b, 2), G(b, navigator.requestMediaKeySystemAccess("com.apple.fps", [a]), 4);
        if (b.g != 2) return b.return(true);
        va(b);
        return b.return(false);
      });
    };
    function Jn() {
      this.g = null;
    }
    Jn.prototype.configure = function(a) {
      this.g = a;
    };
    Jn.prototype.getConfiguration = function() {
      return this.g;
    };
    Jn.prototype.create = function(a) {
      var b;
      if (this.g.language) {
        var c = Kn(a, this.g.language);
        c.length && (b = c);
      }
      b || (b = a.filter(function(f) {
        return f.primary;
      }), b = b.length ? b : a);
      a = Ln(b, this.g.role);
      a.length && (b = a);
      this.g.videoLayout && (a = Mn(b, this.g.videoLayout), a.length && (b = a));
      this.g.Qc && (a = Nn(b, this.g.Qc), a.length && (b = a));
      var d = [this.g.channelCount, this.g.preferredAudioChannelCount];
      a = d.filter(function(f, g) {
        return f && d.indexOf(f) === g;
      });
      if (a.length) {
        for (a = t(a), c = a.next(); !c.done; c = a.next()) if (c = On(b, c.value), c.length) {
          b = c;
          break;
        }
      }
      this.g.Zc && (a = Pn(b, this.g.Zc), a.length && (b = a));
      this.g.Yd && (a = Qn(b, this.g.Yd), a.length && (b = a));
      a = Rn(b, this.g.spatialAudio);
      a.length && (b = a);
      var e = [this.g.audioCodec, this.g.ae].concat(x(this.g.preferredAudioCodecs));
      a = e.filter(function(f, g) {
        return f && e.indexOf(f) === g;
      });
      if (a.length) {
        for (a = t(a), c = a.next(); !c.done; c = a.next()) if (c = Sn(b, c.value), c.length) {
          b = c;
          break;
        }
      }
      return new ri(b[0], b, !(this.g.codecSwitchingStrategy == "smooth" && fd()));
    };
    function Kn(a, b) {
      b = zc(b);
      var c = Hc(b, a.map(function(d) {
        return Gc(d);
      }));
      return c ? a.filter(function(d) {
        return c == Gc(d);
      }) : [];
    }
    function Ln(a, b) {
      return a.filter(function(c) {
        return c.audio ? b ? c.audio.roles.includes(b) : c.audio.roles.length == 0 : false;
      });
    }
    function Pn(a, b) {
      return a.filter(function(c) {
        return c.audio && c.audio.label ? c.audio.label.toLowerCase() == b.toLowerCase() : false;
      });
    }
    function Qn(a, b) {
      return a.filter(function(c) {
        return c.video && c.video.label ? c.video.label.toLowerCase() == b.toLowerCase() : false;
      });
    }
    function On(a, b) {
      return a.filter(function(c) {
        return c.audio && c.audio.channelsCount && c.audio.channelsCount > b ? false : true;
      }).sort(function(c, d) {
        return c.audio || d.audio ? c.audio ? d.audio ? (d.audio.channelsCount || 0) - (c.audio.channelsCount || 0) : 1 : -1 : 0;
      });
    }
    function Nn(a, b) {
      if (b == "AUTO") {
        var c = a.some(function(d) {
          return d.video && d.video.hdr && d.video.hdr == "HLG" ? true : false;
        });
        b = Tn(c);
      }
      return a.filter(function(d) {
        return d.video && d.video.hdr && d.video.hdr != b ? false : true;
      });
    }
    function Mn(a, b) {
      return a.filter(function(c) {
        return c.video && c.video.videoLayout && c.video.videoLayout != b ? false : true;
      });
    }
    function Rn(a, b) {
      return a.filter(function(c) {
        return c.audio && c.audio.spatialAudio != b ? false : true;
      });
    }
    function Sn(a, b) {
      return a.filter(function(c) {
        return c.audio && c.audio.codecs != b ? false : true;
      });
    }
    ;
    function Un() {
    }
    function Vn() {
      var a = Infinity, b = Sb();
      navigator.connection && navigator.connection.saveData && (a = 360);
      var c = {
        retryParameters: Kg(),
        servers: {},
        clearKeys: {},
        advanced: {},
        delayLicenseRequestUntilPlayed: false,
        persistentSessionOnlinePlayback: false,
        persistentSessionsMetadata: [],
        initDataTransform: function(h, k2, l) {
          "apple" === window2.shakaMediaKeysPolyfill && k2 == "skd" && (k2 = l.serverCertificate, l = Fn(h), h = Gn(h, l, k2));
          return h;
        },
        logLicenseExchange: false,
        updateExpirationTime: 1,
        preferredKeySystems: [],
        keySystemsMapping: {},
        parseInbandPsshEnabled: false,
        minHdcpVersion: "",
        ignoreDuplicateInitData: true,
        defaultAudioRobustnessForWidevine: "SW_SECURE_CRYPTO",
        defaultVideoRobustnessForWidevine: "SW_SECURE_DECODE"
      }, d = "reload", e = false;
      fd() && b.ud() && (d = "smooth", e = true);
      e = {
        retryParameters: Kg(),
        availabilityWindowOverride: NaN,
        disableAudio: false,
        disableVideo: false,
        disableText: false,
        disableThumbnails: false,
        disableIFrames: false,
        defaultPresentationDelay: 0,
        segmentRelativeVttTiming: false,
        raiseFatalErrorOnManifestUpdateRequestFailure: false,
        continueLoadingWhenPaused: true,
        ignoreSupplementalCodecs: false,
        updatePeriod: -1,
        ignoreDrmInfo: false,
        dash: { clockSyncUri: "", disableXlinkProcessing: true, xlinkFailGracefully: false, ignoreMinBufferTime: false, autoCorrectDrift: true, initialSegmentLimit: 1e3, ignoreSuggestedPresentationDelay: false, ignoreEmptyAdaptationSet: false, ignoreMaxSegmentDuration: false, keySystemsByURI: {
          "urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b": "org.w3.clearkey",
          "urn:uuid:e2719d58-a985-b3c9-781a-b030af78d30e": "org.w3.clearkey",
          "urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed": "com.widevine.alpha",
          "urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95": "com.microsoft.playready",
          "urn:uuid:79f0049a-4098-8642-ab92-e65be0885f95": "com.microsoft.playready",
          "urn:uuid:94ce86fb-07ff-4f43-adb8-93d2fa968ca2": "com.apple.fps",
          "urn:uuid:3d5e6d35-9b9a-41e8-b843-dd3c6e72c42c": "com.huawei.wiseplay"
        }, manifestPreprocessor: Wn, manifestPreprocessorTXml: Xn, sequenceMode: false, multiTypeVariantsAllowed: e, useStreamOnceInPeriodFlattening: false, enableFastSwitching: true },
        hls: {
          ignoreTextStreamFailures: false,
          ignoreImageStreamFailures: false,
          defaultAudioCodec: "mp4a.40.2",
          defaultVideoCodec: "avc1.42E01E",
          ignoreManifestProgramDateTime: false,
          ignoreManifestProgramDateTimeForTypes: [],
          mediaPlaylistFullMimeType: 'video/mp2t; codecs="avc1.42E01E, mp4a.40.2"',
          liveSegmentsDelay: 3,
          sequenceMode: b.td(),
          ignoreManifestTimestampsInSegmentsMode: false,
          disableCodecGuessing: false,
          disableClosedCaptionsDetection: false,
          allowLowLatencyByteRangeOptimization: true,
          allowRangeRequestsToGuessMimeType: false
        },
        mss: { manifestPreprocessor: Wn, manifestPreprocessorTXml: Xn, sequenceMode: false, keySystemsBySystemId: { "9a04f079-9840-4286-ab92-e65be0885f95": "com.microsoft.playready", "79f0049a-4098-8642-ab92-e65be0885f95": "com.microsoft.playready" } }
      };
      var f = { trackSelectionCallback: function(h) {
        return P(function(k2) {
          return k2.return(h);
        });
      }, downloadSizeCallback: function(h) {
        var k2;
        return P(function(l) {
          if (l.g == 1) return navigator.storage && navigator.storage.estimate ? G(l, navigator.storage.estimate(), 3) : l.return(true);
          k2 = l.h;
          return l.return(k2.usage + h < k2.quota * 0.95);
        });
      }, progressCallback: function(h, k2) {
        return Cn([h, k2]);
      }, usePersistentLicense: true, numberOfParallelDownloads: 5 }, g = {
        drm: c,
        manifest: e,
        streaming: {
          retryParameters: Kg(),
          failureCallback: function(h) {
            return Cn([h]);
          },
          rebufferingGoal: 0,
          bufferingGoal: 10,
          bufferBehind: 30,
          evictionGoal: 1,
          ignoreTextStreamFailures: false,
          alwaysStreamText: false,
          startAtSegmentBoundary: false,
          gapDetectionThreshold: 0.5,
          gapPadding: 0,
          gapJumpTimerTime: 0.25,
          durationBackoff: 1,
          safeSeekOffset: 5,
          safeSeekEndOffset: 0,
          stallEnabled: true,
          stallThreshold: 1,
          stallSkip: 0.1,
          useNativeHlsForFairPlay: true,
          inaccurateManifestTolerance: 2,
          lowLatencyMode: false,
          preferNativeDash: false,
          preferNativeHls: false,
          updateIntervalSeconds: 1,
          observeQualityChanges: false,
          maxDisabledTime: 30,
          segmentPrefetchLimit: 1,
          prefetchAudioLanguages: [],
          disableAudioPrefetch: false,
          disableTextPrefetch: false,
          disableVideoPrefetch: false,
          liveSync: { enabled: false, targetLatency: 0.5, targetLatencyTolerance: 0.5, maxPlaybackRate: 1.1, minPlaybackRate: 0.95, panicMode: false, panicThreshold: 60, dynamicTargetLatency: { enabled: false, stabilityThreshold: 60, rebufferIncrement: 0.5, maxAttempts: 10, maxLatency: 4, minLatency: 1 } },
          allowMediaSourceRecoveries: true,
          minTimeBetweenRecoveries: 5,
          vodDynamicPlaybackRate: false,
          vodDynamicPlaybackRateLowBufferRate: 0.95,
          vodDynamicPlaybackRateBufferRatio: 0.5,
          preloadNextUrlWindow: 30,
          loadTimeout: 30,
          clearDecodingCache: false,
          dontChooseCodecs: false,
          shouldFixTimestampOffset: false,
          avoidEvictionOnQuotaExceededError: false,
          crossBoundaryStrategy: "keep",
          returnToEndOfLiveWindowWhenOutside: false
        },
        networking: { forceHTTP: false, forceHTTPS: false, minBytesForProgressEvents: 16e3 },
        mediaSource: {
          codecSwitchingStrategy: d,
          addExtraFeaturesToSourceBuffer: function(h) {
            return Cn([h], "");
          },
          forceTransmux: false,
          insertFakeEncryptionInInit: true,
          correctEc3Enca: false,
          modifyCueCallback: function(h, k2) {
            return Cn([h, k2]);
          },
          dispatchAllEmsgBoxes: false,
          useSourceElements: true,
          durationReductionEmitsUpdateEnd: true
        },
        offline: f,
        abrFactory: function() {
          return new sg();
        },
        adaptationSetCriteriaFactory: function() {
          return new (Function.prototype.bind.apply(Jn, [null].concat(x(Na.apply(0, arguments)))))();
        },
        abr: { enabled: true, useNetworkInformation: true, defaultBandwidthEstimate: 1e6, switchInterval: 8, bandwidthUpgradeTarget: 0.85, bandwidthDowngradeTarget: 0.95, restrictions: {
          minWidth: 0,
          maxWidth: Infinity,
          minHeight: 0,
          maxHeight: a,
          minPixels: 0,
          maxPixels: Infinity,
          minFrameRate: 0,
          maxFrameRate: Infinity,
          minBandwidth: 0,
          maxBandwidth: Infinity,
          minChannelsCount: 0,
          maxChannelsCount: Infinity
        }, advanced: { minTotalBytes: 128e3, minBytes: 16e3, fastHalfLife: 2, slowHalfLife: 5 }, restrictToElementSize: false, restrictToScreenSize: false, ignoreDevicePixelRatio: false, clearBufferSwitch: false, safeMarginSwitch: 0, cacheLoadThreshold: 5, minTimeToSwitch: 0, preferNetworkInformationBandwidth: false, removeLatencyFromFirstPacketTime: true },
        autoShowText: 3,
        preferredAudioLanguage: "",
        preferredAudioLabel: "",
        preferredTextLanguage: "",
        preferredVariantRole: "",
        preferredTextRole: "",
        preferredAudioChannelCount: 2,
        preferredVideoHdrLevel: "AUTO",
        preferredVideoLayout: "",
        preferredVideoLabel: "",
        preferredVideoCodecs: [],
        preferredAudioCodecs: [],
        preferredTextFormats: [],
        preferForcedSubs: false,
        preferSpatialAudio: false,
        preferredDecodingAttributes: [],
        restrictions: { minWidth: 0, maxWidth: Infinity, minHeight: 0, maxHeight: Infinity, minPixels: 0, maxPixels: Infinity, minFrameRate: 0, maxFrameRate: Infinity, minBandwidth: 0, maxBandwidth: Infinity, minChannelsCount: 0, maxChannelsCount: Infinity },
        playRangeStart: 0,
        playRangeEnd: Infinity,
        textDisplayer: { captionsUpdatePeriod: 0.25, fontScaleFactor: 1 },
        textDisplayFactory: function() {
          return null;
        },
        cmcd: { enabled: false, sessionId: "", contentId: "", rtpSafetyFactor: 5, useHeaders: false, includeKeys: [], version: 1 },
        cmsd: { enabled: true, applyMaximumSuggestedBitrate: true, estimatedThroughputWeightRatio: 0.5 },
        lcevc: { enabled: false, dynamicPerformanceScaling: true, logLevel: 0, drawLogo: false, poster: true },
        ads: {
          customPlayheadTracker: false,
          skipPlayDetection: false,
          supportsMultipleMediaElements: true,
          disableHLSInterstitial: false,
          disableDASHInterstitial: false,
          allowPreloadOnDomElements: true,
          allowStartInMiddleOfInterstitial: true
        },
        ignoreHardwareResolution: false,
        queue: { preloadNextUrlWindow: 30, repeatMode: 0 }
      };
      f.trackSelectionCallback = function(h) {
        return P(function(k2) {
          return k2.return(Yn(h, g.preferredAudioLanguage, g.preferredVideoHdrLevel));
        });
      };
      return b.bb(g);
    }
    function Zn() {
      return { streaming: { inaccurateManifestTolerance: 0, segmentPrefetchLimit: 2, updateIntervalSeconds: 0.1, maxDisabledTime: 1, retryParameters: { baseDelay: 100 } }, manifest: { dash: { autoCorrectDrift: false }, retryParameters: { baseDelay: 100 } }, drm: { retryParameters: { baseDelay: 100 } } };
    }
    function $n(a, b, c) {
      var d = { ".drm.keySystemsMapping": "", ".drm.servers": "", ".drm.clearKeys": "", ".drm.advanced": { distinctiveIdentifierRequired: false, persistentStateRequired: false, videoRobustness: [], audioRobustness: [], sessionType: "", serverCertificate: new Uint8Array(0), serverCertificateUri: "", individualizationServer: "", headers: {} } };
      return An(a, b, c || Vn(), d, "");
    }
    function Yn(a, b, c) {
      var d = c;
      d == "AUTO" && (c = a.some(function(h) {
        return h.hdr && h.hdr == "HLG" ? true : false;
      }), d = Tn(c));
      var e = a.filter(function(h) {
        return h.type != "variant" || h.hdr && h.hdr != d ? false : true;
      });
      c = [];
      var f = Hc(b, e.map(function(h) {
        return h.language;
      }));
      f && (c = e.filter(function(h) {
        return zc(h.language) == f;
      }));
      c.length == 0 && (c = e.filter(function(h) {
        return h.primary;
      }));
      c.length == 0 && (e.map(function(h) {
        return h.language;
      }), c = e);
      var g = c.filter(function(h) {
        return h.height && h.height <= 480;
      });
      g.length && (g.sort(function(h, k2) {
        return k2.height - h.height;
      }), c = g.filter(function(h) {
        return h.height == g[0].height;
      }));
      b = [];
      c.length && (e = Math.floor(c.length / 2), c.sort(function(h, k2) {
        return h.bandwidth - k2.bandwidth;
      }), b.push(c[e]));
      a = t(a);
      for (c = a.next(); !c.done; c = a.next()) c = c.value, c.type != tc && c.type != "image" || b.push(c);
      return b;
    }
    function Wn(a) {
      return Cn([a], a);
    }
    function Xn(a) {
      return Cn([a], a);
    }
    S("shaka.util.PlayerConfiguration", Un);
    Un.mergeConfigObjects = $n;
    Un.createDefaultForLL = Zn;
    Un.createDefault = Vn;
    function ao() {
      this.g = null;
      this.h = [];
    }
    function bo(a, b) {
      var c = 0;
      a.g && a.g.state == b && (c += a.g.duration);
      a = t(a.h);
      for (var d = a.next(); !d.done; d = a.next()) d = d.value, c += d.state == b ? d.duration : 0;
      return c;
    }
    function co(a) {
      function b(f) {
        return { timestamp: f.timestamp, state: f.state, duration: f.duration };
      }
      for (var c = [], d = t(a.h), e = d.next(); !e.done; e = d.next()) c.push(b(e.value));
      a.g && c.push(b(a.g));
      return c;
    }
    ;
    function eo() {
      this.i = this.h = null;
      this.g = [];
    }
    function fo(a, b, c) {
      a.i != b && (a.i = b, a.g.push({ timestamp: Date.now() / 1e3, id: b.id, type: "text", fromAdaptation: c, bandwidth: null }));
    }
    ;
    function go() {
      this.D = this.V = NaN;
      this.l = "";
      this.j = this.ij = this.A = this.C = this.K = this.F = this.u = this.m = this.J = this.G = this.i = this.R = this.S = this.M = this.O = this.P = NaN;
      this.L = 0;
      this.H = this.I = NaN;
      this.g = new ao();
      this.h = new eo();
    }
    function ho(a, b, c) {
      a.P = b;
      a.O = c;
    }
    function io(a, b, c) {
      a.V = b;
      a.D = c;
    }
    function jo(a, b) {
      a.i = isNaN(a.i) ? b : Math.max(a.i, b);
    }
    function ko(a, b) {
      a.j = isNaN(a.j) ? b : a.j + b;
    }
    function lo(a) {
      var b = a.V, c = a.D, d = a.l, e = a.C, f = a.O, g = a.P, h = a.M, k2 = a.S, l = a.R, m = a.A, n = a.i, q = a.G, r = a.J, u = a.m, w = bo(a.g, "playing"), v = bo(a.g, "paused"), y = bo(a.g, "buffering"), z = a.u, A = a.F, C = a.K, D = a.ij, F = a.j, B = a.L, E = a.I, I = a.H, J = co(a.g), K = [];
      a = t(a.h.g);
      for (var L = a.next(); !L.done; L = a.next()) L = L.value, K.push({ timestamp: L.timestamp, id: L.id, type: L.type, fromAdaptation: L.fromAdaptation, bandwidth: L.bandwidth });
      return {
        width: b,
        height: c,
        currentCodecs: d,
        streamBandwidth: e,
        decodedFrames: f,
        droppedFrames: g,
        corruptedFrames: h,
        stallsDetected: k2,
        gapsJumped: l,
        estimatedBandwidth: m,
        completionPercent: n,
        loadLatency: q,
        manifestTimeSeconds: r,
        drmTimeSeconds: u,
        playTime: w,
        pauseTime: v,
        bufferingTime: y,
        licenseTime: z,
        liveLatency: A,
        maxSegmentDuration: C,
        manifestSizeBytes: D,
        bytesDownloaded: F,
        nonFatalErrorCount: B,
        manifestPeriodCount: E,
        manifestGapCount: I,
        stateHistory: J,
        switchHistory: K
      };
    }
    ;
    function mo(a, b, c, d) {
      lb.call(this);
      this.O = a;
      this.V = b;
      this.Ma = d.networkingEngine;
      this.m = c;
      this.D = null;
      this.Ia = 0;
      this.Za = d.Bd;
      this.H = d.Ml;
      this.fb = d.Nl;
      this.g = d.config;
      this.l = this.I = this.h = null;
      this.sa = false;
      this.J = d.Yl;
      this.ua = false;
      this.i = null;
      this.ea = false;
      this.j = this.G = null;
      this.$ = false;
      this.M = /* @__PURE__ */ new Map();
      this.va = false;
      this.Oa = d.Xl;
      this.Z = new go();
      this.oa = new Mg();
      this.C = new Mg();
      this.P = null;
      this.A = false;
      this.aa = d.lk;
      this.S = this.u = null;
      this.Va = d.kk;
      this.R = false;
      this.L = [];
      this.K = [];
      this.F = true;
    }
    ma(mo, lb);
    function no(a, b, c) {
      (a = b ? a.K : a.L) ? a.push(c) : c();
    }
    function oo(a) {
      if (a.K) for (var b = t(a.K), c = b.next(); !c.done; c = b.next()) c = c.value, c();
      a.K = null;
    }
    function po(a, b) {
      a.P = b;
      a.R = true;
      if (a.L) {
        b = t(a.L);
        for (var c = b.next(); !c.done; c = b.next()) c = c.value, c();
      }
      a.L = null;
    }
    p = mo.prototype;
    p.getStartTime = function() {
      return this.m;
    };
    p.ed = function() {
      return this.O;
    };
    p.qh = function() {
      return this.h;
    };
    function qo(a) {
      a.$ = true;
      return a.j;
    }
    function ro(a) {
      a.ua = true;
      return a.J;
    }
    p.getStats = function() {
      return this.Z;
    };
    function so(a) {
      a.ea = true;
      return a.i;
    }
    p.al = function() {
      return this.u ? cg(this.u) : null;
    };
    p.$k = function() {
      return this.S ? dg(this.S) : null;
    };
    function to(a) {
      a.va = true;
      return a.M;
    }
    function uo(a, b, c) {
      a.j = b;
      a.G = c;
    }
    p.start = function() {
      var a = this;
      (function() {
        var b;
        return P(function(c) {
          switch (c.g) {
            case 1:
              return G(c, Promise.resolve(), 2);
            case 2:
              return sa(c, 3), G(c, vo(a), 5);
            case 5:
              wo(a);
              if ("webkit" === window2.shakaMediaKeysPolyfill) {
                c.B(6);
                break;
              }
              return G(c, xo(a), 7);
            case 7:
              wo(a);
            case 6:
              if (!a.aa) {
                c.B(8);
                break;
              }
              return G(c, yo(a), 9);
            case 9:
              wo(a);
            case 8:
              if (!a.aa || !a.i) {
                c.B(10);
                break;
              }
              return G(c, ji(a.i), 11);
            case 11:
              wo(a);
            case 10:
              a.C.resolve();
              ua(c, 0);
              break;
            case 3:
              b = va(c), b instanceof U && (b.code == 7001 || b.code == 7003) || a.C.reject(b), H(c);
          }
        });
      })();
    };
    p.dispatchEvent = function(a) {
      return this.P ? this.P.dispatchEvent(a) : lb.prototype.dispatchEvent.call(this, a);
    };
    p.onError = function(a) {
      a.severity === 2 && (this.C.reject(a), this.destroy());
      var b = (/* @__PURE__ */ new Map()).set("detail", a);
      b = new T("error", b);
      this.dispatchEvent(b);
      b.defaultPrevented && (a.handled = true);
    };
    function wo(a) {
      if (a.A) throw new U(2, 7, 7003);
    }
    function zo(a, b) {
      a.dispatchEvent(new T("onstatechange", (/* @__PURE__ */ new Map()).set("state", b)));
    }
    function vo(a) {
      var b, c, d, e, f, g;
      return P(function(h) {
        switch (h.g) {
          case 1:
            zo(a, "manifest-parser");
            a.l || (a.I = Li(a.O, a.V), a.l = a.I(), a.l.configure(a.g.manifest, function() {
              return a.F;
            }));
            b = Date.now() / 1e3;
            zo(a, "manifest");
            if (a.h) {
              h.B(2);
              break;
            }
            return G(h, a.l.start(a.O, a.fb), 3);
          case 3:
            return a.h = h.h, G(h, Ao(a), 2);
          case 2:
            return a.oa.resolve(), c = new T("manifestparsed", void 0), G(h, Promise.resolve(), 5);
          case 5:
            a.dispatchEvent(c);
            if (a.h.variants.length == 0) throw new U(2, 4, 4036);
            Bo(a.h);
            d = Bi(a.H, a.h);
            if (!d) {
              h.B(6);
              break;
            }
            e = new T("trackschanged", void 0);
            return G(h, Promise.resolve(), 7);
          case 7:
            wo(a), a.dispatchEvent(e);
          case 6:
            f = Date.now() / 1e3, g = f - b, a.Z.J = g, H(h);
        }
      });
    }
    function xo(a, b) {
      var c, d, e, f;
      return P(function(g) {
        switch (g.g) {
          case 1:
            if (!a.h || a.i) return g.return();
            zo(a, "drm-engine");
            a.Ia = Date.now() / 1e3;
            a.i = a.Za();
            a.H.h = a.i;
            a.i.configure(a.g.drm, function() {
              return a.F;
            });
            c = lg(a.h.variants);
            d = true;
            a.h && a.h.presentationTimeline && (d = a.h.presentationTimeline.U());
            return G(g, Jh(a.i, c, a.h.offlineSessionIds, d), 2);
          case 2:
            wo(a);
            if (!b) {
              g.B(3);
              break;
            }
            return G(g, a.i.bc(b), 4);
          case 4:
            wo(a);
          case 3:
            return G(g, zi(a.H, a.h), 5);
          case 5:
            e = g.h;
            if (!e) {
              g.B(0);
              break;
            }
            f = new T(
              "trackschanged",
              void 0
            );
            return G(g, Promise.resolve(), 7);
          case 7:
            a.dispatchEvent(f), H(g);
        }
      });
    }
    p.configure = function(a, b) {
      a = Bn(a, b);
      $n(this.g, a);
    };
    p.getConfiguration = function() {
      return Hd(this.g);
    };
    function Ao(a) {
      var b, c, d, e, f, g;
      return P(function(h) {
        a.D || (a.D = a.g.adaptationSetCriteriaFactory(), a.D.configure({
          language: a.g.preferredAudioLanguage,
          role: a.g.preferredVariantRole,
          channelCount: a.g.preferredAudioChannelCount,
          Qc: a.g.preferredVideoHdrLevel,
          spatialAudio: a.g.preferSpatialAudio,
          videoLayout: a.g.preferredVideoLayout,
          Zc: a.g.preferredAudioLabel,
          Yd: a.g.preferredVideoLabel,
          codecSwitchingStrategy: a.g.mediaSource.codecSwitchingStrategy,
          audioCodec: "",
          ae: "",
          $e: 0,
          preferredAudioCodecs: a.g.preferredAudioCodecs,
          preferredAudioChannelCount: a.g.preferredAudioChannelCount
        }));
        a.Va && (b = a.g.abrFactory, a.G = b, a.j = b(), a.j.configure(a.g.abr));
        c = Co(a);
        if (!c || a.h.variants.length != 1 && a.h.type != "HLS") return h.B(0);
        d = [];
        e = t([c.video, c.audio]);
        for (f = e.next(); !f.done; f = e.next()) (g = f.value) && !g.segmentIndex && d.push(g.createSegmentIndex());
        return d.length > 0 ? G(h, Promise.all(d), 0) : h.B(0);
      });
    }
    function yo(a) {
      var b, c, d, e, f;
      return P(function(g) {
        !a.u && (b = Co(a)) && (a.u = b);
        if (!a.u) return g.B(0);
        c = a.h.presentationTimeline.U();
        d = [];
        e = a.u;
        e.video && d.push(Do(a, e.video, c));
        e.audio && d.push(Do(a, e.audio, c));
        (f = mg(a.h.textStreams, a.g.preferredTextLanguage, a.g.preferredTextRole, a.g.preferForcedSubs)[0] || null) && qg(e.audio, f, a.g) && (d.push(Do(a, f, c)), a.S = f);
        return G(g, Promise.all(d), 0);
      });
    }
    function Co(a) {
      var b = lg(a.h.variants);
      b = a.D.create(b);
      a.j.configure(a.g.abr);
      a.j.setVariants(Array.from(b.values()));
      return a.j.chooseVariant();
    }
    function Do(a, b, c) {
      var d, e, f, g, h;
      return P(function(k2) {
        if (k2.g == 1) return d = a.g.streaming.segmentPrefetchLimit || 2, e = new rm(d, b, function(l, m, n) {
          return hn(l, m, n || null, a.g.streaming.retryParameters, a.Ma, a.F);
        }, false), a.M.set(b.id, e), b.segmentIndex ? k2.B(2) : G(k2, b.createSegmentIndex(), 2);
        f = typeof a.m === "number" ? a.m : 0;
        g = b.segmentIndex.dc(f);
        h = null;
        g && (h = g.current(), h || (h = g.next().value));
        h || (h = fg(b.segmentIndex));
        return h ? c ? h.ha ? G(k2, um(e, h.ha), 0) : k2.B(0) : G(k2, tm(e, h.startTime), 0) : k2.B(0);
      });
    }
    p.Dm = function() {
      return this.C;
    };
    p.destroy = function() {
      var a = this, b, c, d;
      return P(function(e) {
        switch (e.g) {
          case 1:
            a.A = true;
            if (!a.l || a.sa) {
              e.B(2);
              break;
            }
            return G(e, a.l.stop(), 2);
          case 2:
            if (!a.j || a.$) {
              e.B(4);
              break;
            }
            return G(e, a.j.stop(), 4);
          case 4:
            a.J && !a.ua && a.J.release();
            if (!a.i || a.ea) {
              e.B(6);
              break;
            }
            return G(e, a.i.destroy(), 6);
          case 6:
            if (a.M.size > 0 && !a.va) for (b = t(a.M.values()), c = b.next(); !c.done; c = b.next()) d = c.value, Am(d);
            H(e);
        }
      });
    };
    function Bo(a) {
      function b(c) {
        return c.video && c.audio || c.video && c.video.codecs.includes(",");
      }
      a.variants.some(b) && (a.variants = a.variants.filter(b));
    }
    S("shaka.media.PreloadManager", mo);
    mo.prototype.destroy = mo.prototype.destroy;
    mo.prototype.waitForFinish = mo.prototype.Dm;
    mo.prototype.getPrefetchedTextTrack = mo.prototype.$k;
    mo.prototype.getPrefetchedVariantTrack = mo.prototype.al;
    function Eo(a, b) {
      lb.call(this);
      var c = this;
      this.i = a;
      this.l = b;
      this.g = /* @__PURE__ */ new Map();
      this.m = [{ yd: null, xd: Fo, jd: function(d, e) {
        return Go(c, "enter", d, e);
      } }, { yd: Ho, xd: Fo, jd: function(d, e) {
        return Go(c, "enter", d, e);
      } }, { yd: Io, xd: Fo, jd: function(d, e) {
        return Go(c, "enter", d, e);
      } }, { yd: Fo, xd: Ho, jd: function(d, e) {
        return Go(c, "exit", d, e);
      } }, { yd: Fo, xd: Io, jd: function(d, e) {
        return Go(c, "exit", d, e);
      } }, { yd: Ho, xd: Io, jd: function(d, e) {
        e ? Go(c, "skip", d, e) : (Go(c, "enter", d, e), Go(c, "exit", d, e));
      } }, { yd: Io, xd: Ho, jd: function(d, e) {
        return Go(
          c,
          "skip",
          d,
          e
        );
      } }];
      this.h = new Qc();
      this.h.o(this.i, "regionremove", function(d) {
        c.g.delete(d.region);
      });
    }
    ma(Eo, lb);
    Eo.prototype.release = function() {
      this.i = null;
      this.g.clear();
      this.h.release();
      this.h = null;
      lb.prototype.release.call(this);
    };
    Eo.prototype.j = function(a, b) {
      if (!this.l || a != 0) {
        this.l = false;
        for (var c = t(this.i.h.values()), d = c.next(); !d.done; d = c.next()) {
          d = d.value;
          var e = this.g.get(d), f = a < d.startTime ? Ho : a > d.endTime ? Io : Fo;
          this.g.set(d, f);
          for (var g = t(this.m), h = g.next(); !h.done; h = g.next()) h = h.value, h.yd == e && h.xd == f && h.jd(d, b);
        }
      }
    };
    function Go(a, b, c, d) {
      b = new T(b, /* @__PURE__ */ new Map([["region", c], ["seeking", d]]));
      a.dispatchEvent(b);
    }
    var Ho = 1, Fo = 2, Io = 3;
    function Jo(a, b, c) {
      var d, e, f, g, h, k2, l;
      return P(function(m) {
        switch (m.g) {
          case 1:
            var n = new rb(a).xb.split("/").pop().split(".");
            d = n.length == 1 ? "" : n.pop().toLowerCase();
            if (e = Ko.get(d)) return m.return(e);
            f = 0;
            g = ah([a], c);
            sa(m, 2);
            g.method = "HEAD";
            return G(m, b.request(f, g).promise, 4);
          case 4:
            h = m.h;
            e = h.headers["content-type"];
            ua(m, 3);
            break;
          case 2:
            k2 = va(m);
            if (!k2 || k2.code != 1002 && k2.code != 1001) {
              m.B(3);
              break;
            }
            g.method = "GET";
            return G(m, b.request(f, g).promise, 6);
          case 6:
            l = m.h, e = l.headers["content-type"];
          case 3:
            return m.return(e ? e.toLowerCase().split(";").shift() : "");
        }
      });
    }
    var Ko = (/* @__PURE__ */ new Map()).set("mp4", "video/mp4").set("m4v", "video/mp4").set("m4a", "audio/mp4").set("webm", "video/webm").set("weba", "audio/webm").set("mkv", "video/webm").set("ts", "video/mp2t").set("ogv", "video/ogg").set("ogg", "audio/ogg").set("mpg", "video/mpeg").set("mpeg", "video/mpeg").set("mov", "video/quicktime").set("m3u8", "application/x-mpegurl").set("mpd", "application/dash+xml").set("ism", "application/vnd.ms-sstr+xml").set("mp3", "audio/mpeg").set("aac", "audio/aac").set("flac", "audio/flac").set("wav", "audio/wav").set(
      "sbv",
      "text/x-subviewer"
    ).set("srt", "text/srt").set("vtt", "text/vtt").set("webvtt", "text/vtt").set("ttml", "application/ttml+xml").set("lrc", "application/x-subtitle-lrc").set("ssa", "text/x-ssa").set("ass", "text/x-ssa").set("jpeg", "image/jpeg").set("jpg", "image/jpeg").set("png", "image/png").set("svg", "image/svg+xml").set("webp", "image/webp").set("avif", "image/avif").set("html", "text/html").set("htm", "text/html");
    /*
     @license
     Copyright 2013 Ali Al Dallal
    
     Licensed under the MIT license.
    
     Permission is hereby granted, free of charge, to any person obtaining a copy
     of this software and associated documentation files (the "Software"), to deal
     in the Software without restriction, including without limitation the rights
     to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
     copies of the Software, and to permit persons to whom the Software is
     furnished to do so, subject to the following conditions:
    
     The above copyright notice and this permission notice shall be included in
     all copies or substantial portions of the Software.
    
     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
     IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
     FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
     AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
     LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
     OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
     SOFTWARE.
    */
    for (var Lo = {
      ach: "Lwo",
      ady: "\u0410\u0434\u044B\u0433\u044D\u0431\u0437\u044D",
      af: "Afrikaans",
      "af-NA": "Afrikaans (Namibia)",
      "af-ZA": "Afrikaans (South Africa)",
      ak: "T\u0255\u0265i",
      ar: "\u0627\u0644\u0639\u0631\u0628\u064A\u0629",
      "ar-AR": "\u0627\u0644\u0639\u0631\u0628\u064A\u0629",
      "ar-MA": "\u0627\u0644\u0639\u0631\u0628\u064A\u0629",
      "ar-SA": "\u0627\u0644\u0639\u0631\u0628\u064A\u0629 (\u0627\u0644\u0633\u0639\u0648\u062F\u064A\u0629)",
      "ay-BO": "Aymar aru",
      az: "Az\u0259rbaycan dili",
      "az-AZ": "Az\u0259rbaycan dili",
      "be-BY": "\u0411\u0435\u043B\u0430\u0440\u0443\u0441\u043A\u0430\u044F",
      bg: "\u0411\u044A\u043B\u0433\u0430\u0440\u0441\u043A\u0438",
      "bg-BG": "\u0411\u044A\u043B\u0433\u0430\u0440\u0441\u043A\u0438",
      bn: "\u09AC\u09BE\u0982\u09B2\u09BE",
      "bn-IN": "\u09AC\u09BE\u0982\u09B2\u09BE (\u09AD\u09BE\u09B0\u09A4)",
      "bn-BD": "\u09AC\u09BE\u0982\u09B2\u09BE(\u09AC\u09BE\u0982\u09B2\u09BE\u09A6\u09C7\u09B6)",
      "bs-BA": "Bosanski",
      ca: "Catal\xE0",
      "ca-ES": "Catal\xE0",
      cak: "Maya Kaqchikel",
      "ck-US": "\u13E3\u13B3\u13A9 (tsalagi)",
      cs: "\u010Ce\u0161tina",
      "cs-CZ": "\u010Ce\u0161tina",
      cy: "Cymraeg",
      "cy-GB": "Cymraeg",
      da: "Dansk",
      "da-DK": "Dansk",
      de: "Deutsch",
      "de-AT": "Deutsch (\xD6sterreich)",
      "de-DE": "Deutsch (Deutschland)",
      "de-CH": "Deutsch (Schweiz)",
      dsb: "Dolnoserb\u0161\u0107ina",
      el: "\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AC",
      "el-GR": "\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AC",
      en: "English",
      "en-GB": "English (UK)",
      "en-AU": "English (Australia)",
      "en-CA": "English (Canada)",
      "en-IE": "English (Ireland)",
      "en-IN": "English (India)",
      "en-PI": "English (Pirate)",
      "en-UD": "English (Upside Down)",
      "en-US": "English (US)",
      "en-ZA": "English (South Africa)",
      "en@pirate": "English (Pirate)",
      eo: "Esperanto",
      "eo-EO": "Esperanto",
      es: "Espa\xF1ol",
      "es-AR": "Espa\xF1ol (Argentine)",
      "es-419": "Espa\xF1ol (Latinoam\xE9rica)",
      "es-CL": "Espa\xF1ol (Chile)",
      "es-CO": "Espa\xF1ol (Colombia)",
      "es-EC": "Espa\xF1ol (Ecuador)",
      "es-ES": "Espa\xF1ol (Espa\xF1a)",
      "es-LA": "Espa\xF1ol (Latinoam\xE9rica)",
      "es-NI": "Espa\xF1ol (Nicaragua)",
      "es-MX": "Espa\xF1ol (M\xE9xico)",
      "es-US": "Espa\xF1ol (Estados Unidos)",
      "es-VE": "Espa\xF1ol (Venezuela)",
      et: "eesti keel",
      "et-EE": "Eesti (Estonia)",
      eu: "Euskara",
      "eu-ES": "Euskara",
      fa: "\u0641\u0627\u0631\u0633\u06CC",
      "fa-IR": "\u0641\u0627\u0631\u0633\u06CC",
      "fb-LT": "Leet Speak",
      ff: "Fulah",
      fi: "Suomi",
      "fi-FI": "Suomi",
      "fo-FO": "F\xF8royskt",
      fr: "Fran\xE7ais",
      "fr-CA": "Fran\xE7ais (Canada)",
      "fr-FR": "Fran\xE7ais (France)",
      "fr-BE": "Fran\xE7ais (Belgique)",
      "fr-CH": "Fran\xE7ais (Suisse)",
      "fy-NL": "Frysk",
      ga: "Gaeilge",
      "ga-IE": "Gaeilge (Gaelic)",
      gl: "Galego",
      "gl-ES": "Galego",
      "gn-PY": "Ava\xF1e'\u1EBD",
      "gu-IN": "\u0A97\u0AC1\u0A9C\u0AB0\u0ABE\u0AA4\u0AC0",
      "gx-GR": "\u1F19\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AE \u1F00\u03C1\u03C7\u03B1\u03AF\u03B1",
      he: "\u05E2\u05D1\u05E8\u05D9\u05EA\u200F",
      "he-IL": "\u05E2\u05D1\u05E8\u05D9\u05EA\u200F",
      hi: "\u0939\u093F\u0928\u094D\u0926\u0940",
      "hi-IN": "\u0939\u093F\u0928\u094D\u0926\u0940",
      hr: "Hrvatski",
      "hr-HR": "Hrvatski",
      hsb: "Hornjoserb\u0161\u0107ina",
      ht: "Krey\xF2l",
      hu: "Magyar",
      "hu-HU": "Magyar",
      "hy-AM": "\u0540\u0561\u0575\u0565\u0580\u0565\u0576",
      id: "Bahasa Indonesia",
      "id-ID": "Bahasa Indonesia",
      is: "\xCDslenska",
      "is-IS": "\xCDslenska (Iceland)",
      it: "Italiano",
      "it-IT": "Italiano",
      ja: "\u65E5\u672C\u8A9E",
      "ja-JP": "\u65E5\u672C\u8A9E",
      "jv-ID": "Basa Jawa",
      "ka-GE": "\u10E5\u10D0\u10E0\u10D7\u10E3\u10DA\u10D8",
      "kk-KZ": "\u049A\u0430\u0437\u0430\u049B\u0448\u0430",
      km: "\u1797\u17B6\u179F\u17B6\u1781\u17D2\u1798\u17C2\u179A",
      "km-KH": "\u1797\u17B6\u179F\u17B6\u1781\u17D2\u1798\u17C2\u179A",
      kab: "Taqbaylit",
      kn: "\u0C95\u0CA8\u0CCD\u0CA8\u0CA1",
      "kn-IN": "\u0C95\u0CA8\u0CCD\u0CA8\u0CA1 (India)",
      ko: "\uD55C\uAD6D\uC5B4",
      "ko-KR": "\uD55C\uAD6D\uC5B4 (\u97E9\u56FD)",
      ku: "Kurd\xEE",
      "ku-TR": "Kurd\xEE",
      la: "Latin",
      "la-VA": "Latin",
      lb: "L\xEBtzebuergesch",
      "li-NL": "L\xE8mb\xF6rgs",
      lt: "Lietuvi\u0173",
      "lt-LT": "Lietuvi\u0173",
      lv: "Latvie\u0161u",
      "lv-LV": "Latvie\u0161u",
      mai: "\u092E\u0948\u0925\u093F\u0932\u0940, \u09AE\u09C8\u09A5\u09BF\u09B2\u09C0",
      "mg-MG": "Malagasy",
      mk: "\u041C\u0430\u043A\u0435\u0434\u043E\u043D\u0441\u043A\u0438",
      "mk-MK": "\u041C\u0430\u043A\u0435\u0434\u043E\u043D\u0441\u043A\u0438 (\u041C\u0430\u043A\u0435\u0434\u043E\u043D\u0441\u043A\u0438)",
      ml: "\u0D2E\u0D32\u0D2F\u0D3E\u0D33\u0D02",
      "ml-IN": "\u0D2E\u0D32\u0D2F\u0D3E\u0D33\u0D02",
      "mn-MN": "\u041C\u043E\u043D\u0433\u043E\u043B",
      mr: "\u092E\u0930\u093E\u0920\u0940",
      "mr-IN": "\u092E\u0930\u093E\u0920\u0940",
      ms: "Bahasa Melayu",
      "ms-MY": "Bahasa Melayu",
      mt: "Malti",
      "mt-MT": "Malti",
      my: "\u1017\u1019\u102C\u1005\u1000\u102C",
      nb: "Norsk (bokm\xE5l)",
      "nb-NO": "Norsk (bokm\xE5l)",
      ne: "\u0928\u0947\u092A\u093E\u0932\u0940",
      "ne-NP": "\u0928\u0947\u092A\u093E\u0932\u0940",
      nl: "Nederlands",
      "nl-BE": "Nederlands (Belgi\xEB)",
      "nl-NL": "Nederlands (Nederland)",
      "nn-NO": "Norsk (nynorsk)",
      no: "Norsk",
      oc: "Occitan",
      "or-IN": "\u0B13\u0B21\u0B3C\u0B3F\u0B06",
      pa: "\u0A2A\u0A70\u0A1C\u0A3E\u0A2C\u0A40",
      "pa-IN": "\u0A2A\u0A70\u0A1C\u0A3E\u0A2C\u0A40 (\u0A2D\u0A3E\u0A30\u0A24 \u0A28\u0A42\u0A70)",
      pl: "Polski",
      "pl-PL": "Polski",
      "ps-AF": "\u067E\u069A\u062A\u0648",
      pt: "Portugu\xEAs",
      "pt-BR": "Portugu\xEAs (Brasil)",
      "pt-PT": "Portugu\xEAs (Portugal)",
      "qu-PE": "Qhichwa",
      "rm-CH": "Rumantsch",
      ro: "Rom\xE2n\u0103",
      "ro-RO": "Rom\xE2n\u0103",
      ru: "\u0420\u0443\u0441\u0441\u043A\u0438\u0439",
      "ru-RU": "\u0420\u0443\u0441\u0441\u043A\u0438\u0439",
      "sa-IN": "\u0938\u0902\u0938\u094D\u0915\u0943\u0924\u092E\u094D",
      "se-NO": "Davvis\xE1megiella",
      "si-LK": "\u0DB4\u0DC5\u0DCF\u0DAD",
      sk: "Sloven\u010Dina",
      "sk-SK": "Sloven\u010Dina (Slovakia)",
      sl: "Sloven\u0161\u010Dina",
      "sl-SI": "Sloven\u0161\u010Dina",
      "so-SO": "Soomaaliga",
      sq: "Shqip",
      "sq-AL": "Shqip",
      sr: "\u0421\u0440\u043F\u0441\u043A\u0438",
      "sr-RS": "\u0421\u0440\u043F\u0441\u043A\u0438 (Serbia)",
      su: "Basa Sunda",
      sv: "Svenska",
      "sv-SE": "Svenska",
      sw: "Kiswahili",
      "sw-KE": "Kiswahili",
      ta: "\u0BA4\u0BAE\u0BBF\u0BB4\u0BCD",
      "ta-IN": "\u0BA4\u0BAE\u0BBF\u0BB4\u0BCD",
      te: "\u0C24\u0C46\u0C32\u0C41\u0C17\u0C41",
      "te-IN": "\u0C24\u0C46\u0C32\u0C41\u0C17\u0C41",
      tg: "\u0437\u0430\u0431\u043E\u0301\u043D\u0438 \u0442\u043E\u04B7\u0438\u043A\u04E3\u0301",
      "tg-TJ": "\u0442\u043E\u04B7\u0438\u043A\u04E3",
      th: "\u0E20\u0E32\u0E29\u0E32\u0E44\u0E17\u0E22",
      "th-TH": "\u0E20\u0E32\u0E29\u0E32\u0E44\u0E17\u0E22 (\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28\u0E44\u0E17\u0E22)",
      tl: "Filipino",
      "tl-PH": "Filipino",
      tlh: "tlhIngan-Hol",
      tr: "T\xFCrk\xE7e",
      "tr-TR": "T\xFCrk\xE7e",
      "tt-RU": "\u0442\u0430\u0442\u0430\u0440\u0447\u0430",
      uk: "\u0423\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430",
      "uk-UA": "\u0423\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430",
      ur: "\u0627\u0631\u062F\u0648",
      "ur-PK": "\u0627\u0631\u062F\u0648",
      uz: "O'zbek",
      "uz-UZ": "O'zbek",
      vi: "Ti\u1EBFng Vi\u1EC7t",
      "vi-VN": "Ti\u1EBFng Vi\u1EC7t",
      "xh-ZA": "isiXhosa",
      yi: "\u05D9\u05D9\u05B4\u05D3\u05D9\u05E9",
      "yi-DE": "\u05D9\u05D9\u05B4\u05D3\u05D9\u05E9 (German)",
      zh: "\u4E2D\u6587",
      "zh-HANS": "\u4E2D\u6587\u7B80\u4F53",
      "zh-HANT": "\u4E2D\u6587\u7E41\u9AD4",
      "zh-CN": "\u4E2D\u6587\uFF08\u4E2D\u56FD\uFF09",
      "zh-HK": "\u4E2D\u6587\uFF08\u9999\u6E2F\uFF09",
      "zh-SG": "\u4E2D\u6587\uFF08\u65B0\u52A0\u5761\uFF09",
      "zh-TW": "\u4E2D\u6587\uFF08\u53F0\u7063\uFF09",
      "zu-ZA": "isiZulu"
    }, Mo = t(Object.keys(Lo)), No = Mo.next(); !No.done; No = Mo.next()) {
      var Oo = No.value;
      Lo[Oo.toLowerCase()] = Lo[Oo];
    }
    ;
    function Po(a, b) {
      if (a.lineBreak) return "\n";
      if (a.nestedCues.length) return a.nestedCues.map(function(g) {
        return Po(g, a);
      }).join("");
      if (!a.payload) return a.payload;
      var c = [], d = a.fontWeight >= Pe, e = a.fontStyle == Qe, f = a.textDecoration.includes(Re);
      d && c.push(["b"]);
      e && c.push(["i"]);
      f && c.push(["u"]);
      e = a.color;
      e == "" && b && (e = b.color);
      d = "";
      (e = Qo(e)) && (d += "." + e);
      e = a.backgroundColor;
      e == "" && b && (e = b.backgroundColor);
      (b = Qo(e)) && (d += ".bg_" + b);
      d && c.push(["c", d]);
      return c.reduceRight(function(g, h) {
        var k2 = t(h);
        h = k2.next().value;
        k2 = k2.next().value;
        return "<" + h + (k2 === void 0 ? "" : k2) + ">" + g + "</" + h + ">";
      }, a.payload);
    }
    function Qo(a) {
      a = a.toLowerCase();
      var b = a.replace(/\s/g, "").match(/^rgba?\((\d+),(\d+),(\d+),?([^,\s)]+)?/i);
      b ? a = "#" + (parseInt(b[1], 10) | 256).toString(16).slice(1) + (parseInt(b[2], 10) | 256).toString(16).slice(1) + (parseInt(b[3], 10) | 256).toString(16).slice(1) : a.startsWith("#") && a.length > 7 && (a = a.slice(0, 7));
      switch (a) {
        case "white":
        case "#fff":
        case "#ffffff":
          return "white";
        case "lime":
        case "#0f0":
        case "#00ff00":
          return "lime";
        case "cyan":
        case "#0ff":
        case "#00ffff":
          return "cyan";
        case "red":
        case "#f00":
        case "#ff0000":
          return "red";
        case "yellow":
        case "#ff0":
        case "#ffff00":
          return "yellow";
        case "magenta":
        case "#f0f":
        case "#ff00ff":
          return "magenta";
        case "blue":
        case "#00f":
        case "#0000ff":
          return "blue";
        case "black":
        case "#000":
        case "#000000":
          return "black";
      }
      return null;
    }
    function Ro(a, b) {
      var c = [];
      a = t(So(a));
      for (var d = a.next(); !d.done; d = a.next()) if (d = d.value, d.isContainer) c.push.apply(c, x(Ro(d.nestedCues, d)));
      else {
        var e = d.clone();
        e.nestedCues = [];
        e.payload = Po(d, b);
        c.push(e);
      }
      return c;
    }
    function So(a) {
      var b = [];
      a = t(a);
      for (var c = a.next(), d = {}; !c.done; d = { Qg: void 0 }, c = a.next()) d.Qg = c.value, b.some(/* @__PURE__ */ function(e) {
        return function(f) {
          return De(e.Qg, f);
        };
      }(d)) || b.push(d.Qg);
      return b;
    }
    function To(a) {
      function b(d) {
        for (var e = 5381, f = d.length; f; ) e = e * 33 ^ d.charCodeAt(--f);
        return (e >>> 0).toString();
      }
      if (a.startTime >= a.endTime) return null;
      var c = new VTTCue(a.startTime, a.endTime, a.payload);
      c.id = b(a.startTime.toString()) + b(a.endTime.toString()) + b(a.payload);
      c.lineAlign = a.lineAlign;
      c.positionAlign = a.positionAlign;
      a.size && (c.size = a.size);
      try {
        c.align = a.textAlign;
      } catch (d) {
      }
      a.textAlign == "center" && c.align != "center" && (c.align = "middle");
      a.writingMode == "vertical-lr" ? c.vertical = "lr" : a.writingMode == "vertical-rl" && (c.vertical = "rl");
      a.lineInterpretation == 1 && (c.snapToLines = false);
      a.line != null && (c.line = a.line);
      a.position != null && (c.position = a.position);
      return c;
    }
    function Uo(a, b) {
      var c = Ro(b), d = [];
      b = a.cues ? Array.from(a.cues) : [];
      c = t(c);
      for (var e = c.next(), f = {}; !e.done; f = { Gd: void 0 }, e = c.next()) f.Gd = e.value, !b.some(/* @__PURE__ */ function(g) {
        return function(h) {
          return h.startTime == g.Gd.startTime && h.endTime == g.Gd.endTime && h.text == g.Gd.payload ? true : false;
        };
      }(f)) && f.Gd.payload && (e = To(f.Gd)) && d.push(e);
      b = d.slice().sort(function(g, h) {
        return g.startTime != h.startTime ? g.startTime - h.startTime : g.endTime != h.endTime ? g.endTime - h.startTime : "line" in VTTCue.prototype ? d.indexOf(h) - d.indexOf(g) : d.indexOf(g) - d.indexOf(h);
      });
      b = t(b);
      for (c = b.next(); !c.done; c = b.next()) a.addCue(c.value);
    }
    function Vo(a, b) {
      var c = false;
      a.mode === "disabled" && (c = true, a.mode = "hidden");
      for (var d = 0; d < a.cues.length; ) {
        var e = a.cues[d];
        b(e) ? a.removeCue(e) : d++;
      }
      c && (a.mode = "disabled");
    }
    ;
    function Wo(a) {
      var b = this;
      this.i = a;
      this.l = new Qc();
      this.j = null;
      this.h = /* @__PURE__ */ new Map();
      this.g = -1;
      this.A = false;
      this.u = null;
      this.D = function() {
        b.l.Ea(b.i, "textchanged", b.m);
        b.l.Ea(b.j.textTracks, "change", b.C);
        for (var c = t(b.h.values()), d = c.next(); !d.done; d = c.next()) d.value.remove();
        b.h.clear();
        b.g = -1;
        b.j = null;
      };
      this.m = function() {
        var c = /* @__PURE__ */ new Map(), d = b.i.vc();
        d = t(d);
        for (var e = d.next(); !e.done; e = d.next()) {
          e = e.value;
          if (b.h.has(e.id)) {
            var f = b.h.get(e.id);
            e.active || f.track.mode === "disabled" || (f.track.mode = "disabled");
            b.h.delete(e.id);
          } else {
            f = b.j.ownerDocument.createElement("track");
            f.kind = Xo(e);
            var g = f, h = void 0;
            if (e.label) h = e.label;
            else if (e.language) if (e.language in Lo) h = Lo[e.language];
            else {
              var k2 = Ec(e.language);
              k2 in Lo && (h = Lo[k2] + " (" + e.language + ")");
            }
            h || (h = e.originalTextId, e.language && e.language !== e.originalTextId && (h += " (" + e.language + ")"));
            g.label = h;
            e.language in Lo && (f.srclang = e.language);
            Sb().Ga() === "CHROMIUM" && (f.src = "data:,WEBVTT");
            f.track.mode = "disabled";
            b.j.appendChild(f);
          }
          c.set(e.id, f);
          e.active && (b.g = e.id);
        }
        d = t(b.h.values());
        for (e = d.next(); !e.done; e = d.next()) e.value.remove();
        b.g > -1 && (c.has(b.g) ? (d = c.get(b.g).track, d.mode === "disabled" && (d.mode = b.A ? "showing" : "hidden")) : b.g = -1);
        b.h = c;
      };
      this.C = function() {
        if (!b.u) {
          var c = b.j;
          b.u = new Cf(function() {
            b.u = null;
            if (b.j === c) {
              var d = -1, e = false;
              if (b.h.has(b.g)) {
                var f = b.h.get(b.g);
                f.track.mode === "showing" ? (d = b.g, e = true) : f.track.mode === "hidden" && (d = b.g);
              }
              if (!e) for (e = t(b.h), f = e.next(); !f.done; f = e.next()) {
                var g = t(f.value);
                f = g.next().value;
                g = g.next().value;
                if (g.track.mode === "showing") {
                  d = f;
                  break;
                } else d < 0 && g.track.mode === "hidden" && (d = f);
              }
              e = t(b.h);
              for (f = e.next(); !f.done; f = e.next()) g = t(f.value), f = g.next().value, g = g.next().value, f !== d && g.track.mode !== "disabled" && (g.track.mode = "disabled");
              b.g !== d && (b.g = d, d > -1 && b.i.fg({ id: d }));
              b.i.Fe(d > -1 && b.h.get(d).track.mode === "showing");
            }
          }).Y(0);
        }
      };
      this.l.o(a, "loaded", function() {
        return b.enableTextDisplayer();
      });
      this.enableTextDisplayer();
    }
    p = Wo.prototype;
    p.configure = function() {
    };
    p.remove = function(a, b) {
      if (this.i) this.h.has(this.g) && Vo(this.h.get(this.g).track, function(c) {
        return c.startTime < b && c.endTime > a;
      });
      else return false;
      return true;
    };
    p.append = function(a) {
      this.h.has(this.g) && Uo(this.h.get(this.g).track, a);
    };
    p.destroy = function() {
      this.i && (this.j && this.D(), this.i = null);
      this.l && (this.l.release(), this.l = null);
      return Promise.resolve();
    };
    p.isTextVisible = function() {
      return this.A;
    };
    p.setTextVisibility = function(a) {
      this.A = a;
      if (this.h.has(this.g)) {
        var b = this.h.get(this.g).track;
        b.mode !== "disabled" && (a = a ? "showing" : "hidden", b.mode !== a && (b.mode = a));
      } else if (this.i && this.i.m === 3) if (b = Array.from(this.i.h.textTracks).filter(function(d) {
        return ["captions", "subtitles", "forced"].includes(d.kind);
      }), a) {
        a = null;
        b = t(b);
        for (var c = b.next(); !c.done; c = b.next()) if (c = c.value, c.mode === "showing") {
          a = null;
          break;
        } else a || c.mode !== "hidden" || (a = c);
        a && (a.mode = "showing");
      } else for (a = t(b), b = a.next(); !b.done; b = a.next()) b = b.value, b.mode === "showing" && (b.mode = "hidden");
    };
    p.setTextLanguage = function() {
    };
    p.enableTextDisplayer = function() {
      !this.j && this.i && this.i.m === 2 && (this.j = this.i.h, this.l.qa(this.i, "unloading", this.D), this.l.o(this.i, "textchanged", this.m), this.l.o(this.j.textTracks, "change", this.C), this.m());
    };
    function Xo(a) {
      var b = Sb();
      return a.forced && b.Ga() === "WEBKIT" ? "forced" : a.kind === "caption" || a.roles && a.roles.some(function(c) {
        return c.includes("transcribes-spoken-dialog");
      }) && a.roles.some(function(c) {
        return c.includes("describes-music-and-sound");
      }) ? "captions" : "subtitles";
    }
    S("shaka.text.NativeTextDisplayer", Wo);
    Wo.prototype.enableTextDisplayer = Wo.prototype.enableTextDisplayer;
    Wo.prototype.setTextLanguage = Wo.prototype.setTextLanguage;
    Wo.prototype.setTextVisibility = Wo.prototype.setTextVisibility;
    Wo.prototype.isTextVisible = Wo.prototype.isTextVisible;
    Wo.prototype.destroy = Wo.prototype.destroy;
    Wo.prototype.append = Wo.prototype.append;
    Wo.prototype.remove = Wo.prototype.remove;
    Wo.prototype.configure = Wo.prototype.configure;
    function Yo(a, b) {
      Wc("SimpleTextDisplayer", "Please migrate to NativeTextDisplayer");
      this.h = a;
      this.i = b;
      this.g = null;
      a = t(Array.from(this.h.textTracks));
      for (b = a.next(); !b.done; b = a.next()) b = b.value, b.kind !== "metadata" && b.kind !== "chapters" && (b.mode = "disabled", b.label == this.i && (this.g = b));
      this.g && (this.g.mode = "hidden");
    }
    p = Yo.prototype;
    p.configure = function() {
    };
    p.remove = function(a, b) {
      if (!this.g) return false;
      Vo(this.g, function(c) {
        return c.startTime < b && c.endTime > a;
      });
      return true;
    };
    p.append = function(a) {
      this.g && Uo(this.g, a);
    };
    p.destroy = function() {
      this.g && (Vo(this.g, function() {
        return true;
      }), this.g.mode = "disabled");
      this.g = this.h = null;
      return Promise.resolve();
    };
    p.isTextVisible = function() {
      return this.g ? this.g.mode == "showing" : false;
    };
    p.setTextVisibility = function(a) {
      a && !this.g && Zo(this);
      this.g && (this.g.mode = a ? "showing" : "hidden");
    };
    p.setTextLanguage = function() {
    };
    p.enableTextDisplayer = function() {
      Zo(this);
    };
    function Zo(a) {
      a.h && !a.g && (a.g = a.h.addTextTrack("subtitles", a.i), a.g.mode = "hidden");
    }
    S("shaka.text.SimpleTextDisplayer", Yo);
    Yo.prototype.enableTextDisplayer = Yo.prototype.enableTextDisplayer;
    Yo.prototype.setTextLanguage = Yo.prototype.setTextLanguage;
    Yo.prototype.setTextVisibility = Yo.prototype.setTextVisibility;
    Yo.prototype.isTextVisible = Yo.prototype.isTextVisible;
    Yo.prototype.destroy = Yo.prototype.destroy;
    Yo.prototype.append = Yo.prototype.append;
    Yo.prototype.remove = Yo.prototype.remove;
    Yo.prototype.configure = Yo.prototype.configure;
    function $o() {
    }
    p = $o.prototype;
    p.configure = function() {
    };
    p.remove = function() {
    };
    p.append = function() {
    };
    p.destroy = function() {
    };
    p.isTextVisible = function() {
      return false;
    };
    p.setTextVisibility = function() {
    };
    p.setTextLanguage = function() {
    };
    p.enableTextDisplayer = function() {
    };
    S("shaka.text.StubTextDisplayer", $o);
    $o.prototype.enableTextDisplayer = $o.prototype.enableTextDisplayer;
    $o.prototype.setTextLanguage = $o.prototype.setTextLanguage;
    $o.prototype.setTextVisibility = $o.prototype.setTextVisibility;
    $o.prototype.isTextVisible = $o.prototype.isTextVisible;
    $o.prototype.destroy = $o.prototype.destroy;
    $o.prototype.append = $o.prototype.append;
    $o.prototype.remove = $o.prototype.remove;
    $o.prototype.configure = $o.prototype.configure;
    function ap(a, b) {
      var c = this;
      this.m = false;
      this.h = [];
      this.j = a;
      this.u = b;
      this.D = this.A = null;
      this.g = W("div");
      this.g.classList.add("shaka-text-container");
      this.g.style.textAlign = "center";
      this.g.style.display = "flex";
      this.g.style.flexDirection = "column";
      this.g.style.alignItems = "center";
      this.g.style.justifyContent = "flex-end";
      this.C = new Cf(function() {
        c.j.paused || bp(c);
      });
      cp(this);
      this.l = /* @__PURE__ */ new Map();
      this.i = new Qc();
      this.i.o(document, "fullscreenchange", function() {
        bp(c, true);
      });
      this.i.o(this.j, "seeking", function() {
        bp(c, true);
      });
      this.i.o(this.j, "ratechange", function() {
        cp(c);
      });
      this.i.o(this.j, "resize", function() {
        var d = c.j, e = d.videoWidth;
        d = d.videoHeight;
        e && d ? c.A = e / d : c.A = null;
      });
      this.F = null;
      "ResizeObserver" in window2 && (this.F = new ResizeObserver(function() {
        bp(c, true);
      }), this.F.observe(this.g));
      this.G = /* @__PURE__ */ new Map();
    }
    p = ap.prototype;
    p.configure = function(a) {
      this.D = a;
      cp(this);
      bp(this, true);
    };
    p.append = function(a) {
      var b = [].concat(x(this.h));
      a = t(So(a));
      for (var c = a.next(), d = {}; !c.done; d = { Rg: void 0 }, c = a.next()) d.Rg = c.value, b.some(/* @__PURE__ */ function(e) {
        return function(f) {
          return De(f, e.Rg);
        };
      }(d)) || this.h.push(d.Rg);
      this.h.length && cp(this);
      bp(this);
    };
    p.destroy = function() {
      if (!this.g) return Promise.resolve();
      this.g.parentElement && this.u.removeChild(this.g);
      this.g = null;
      this.m = false;
      this.h = [];
      this.C && (this.C.stop(), this.C = null);
      this.l.clear();
      this.i && (this.i.release(), this.i = null);
      this.F && (this.F.disconnect(), this.F = null);
      return Promise.resolve();
    };
    p.remove = function(a, b) {
      if (!this.g) return false;
      var c = this.h.length;
      this.h = this.h.filter(function(d) {
        return d.startTime < a || d.endTime >= b;
      });
      bp(this, c > this.h.length);
      this.h.length || cp(this);
      return true;
    };
    p.isTextVisible = function() {
      return this.m;
    };
    p.setTextVisibility = function(a) {
      (this.m = a) ? (this.g.parentElement || this.u.appendChild(this.g), bp(this, true)) : this.g.parentElement && this.u.removeChild(this.g);
    };
    p.setTextLanguage = function(a) {
      a && a != "und" ? this.g.setAttribute("lang", a) : this.g.setAttribute("lang", "");
    };
    p.enableTextDisplayer = function() {
    };
    function cp(a) {
      a.C && (a.h.length ? a.C.za((a.D ? a.D.captionsUpdatePeriod : 0.25) / Math.max(1, Math.abs(a.j.playbackRate))) : a.C.stop());
    }
    function dp(a, b) {
      for (; b != null; ) {
        if (b == a.g) return true;
        b = b.parentElement;
      }
      return false;
    }
    function ep(a, b, c, d, e) {
      var f = false, g = [], h = [];
      b = t(b);
      for (var k2 = b.next(); !k2.done; k2 = b.next()) {
        k2 = k2.value;
        e.push(k2);
        var l = a.l.get(k2), m = k2.startTime <= d && k2.endTime > d, n = l ? l.gk : null;
        l && (g.push(l.Sg), l.pd && g.push(l.pd), m || (f = true, a.l.delete(k2), l = null));
        m && (h.push(k2), l ? dp(a, n) || (f = true) : (fp(a, k2, e), l = a.l.get(k2), n = l.gk, f = true));
        k2.nestedCues.length > 0 && n && ep(a, k2.nestedCues, n, d, e);
        e.pop();
      }
      if (f) {
        d = t(g);
        for (e = d.next(); !e.done; e = d.next()) e = e.value, e.parentElement && e.parentElement.removeChild(e);
        h.sort(function(q, r) {
          return q.startTime != r.startTime ? q.startTime - r.startTime : q.endTime - r.endTime;
        });
        h = t(h);
        for (d = h.next(); !d.done; d = h.next()) d = a.l.get(d.value), d.pd ? (d.pd.contains(c) && d.pd.removeChild(c), c.appendChild(d.pd), d.pd.appendChild(d.Sg)) : c.appendChild(d.Sg);
      }
    }
    function bp(a, b) {
      if (a.g) {
        var c = a.j.currentTime;
        if (!a.m || (b === void 0 ? 0 : b)) {
          b = t(a.G.values());
          for (var d = b.next(); !d.done; d = b.next()) Sj(d.value);
          Sj(a.g);
          a.l.clear();
          a.G.clear();
        }
        a.m && ep(a, a.h, a.g, c, []);
      }
    }
    function fp(a, b, c) {
      var d = c.length > 1, e = d ? "span" : "div";
      b.lineBreak && (e = "br");
      b.rubyTag && (e = b.rubyTag);
      d = !d && b.nestedCues.length > 0;
      var f = W(e);
      e != "br" && gp(a, f, b, c, d);
      c = null;
      if (b.region && b.region.id) {
        var g = b.region, h = a.A === 4 / 3 ? 2.5 : 1.9;
        c = g.id + "_" + g.width + "x" + g.height + (g.heightUnits == rd ? "%" : "px") + "-" + g.viewportAnchorX + "x" + g.viewportAnchorY + (g.viewportAnchorUnits == rd ? "%" : "px");
        if (a.G.has(c)) c = a.G.get(c);
        else {
          e = W("span");
          var k2 = g.heightUnits == rd ? "%" : "px", l = g.widthUnits == rd ? "%" : "px", m = g.viewportAnchorUnits == rd ? "%" : "px";
          e.id = "shaka-text-region---" + c;
          e.classList.add("shaka-text-region");
          e.style.position = "absolute";
          var n = g.height, q = g.width;
          g.heightUnits === 2 && (n = g.height * 5.33, k2 = "%");
          g.widthUnits === 2 && (q = g.width * h, l = "%");
          e.style.height = n + k2;
          e.style.width = q + l;
          g.viewportAnchorUnits === 2 ? (h = g.viewportAnchorY / 75 * 100, k2 = g.viewportAnchorX / (a.A === 4 / 3 ? 160 : 210) * 100, h -= g.regionAnchorY * n / 100, k2 -= g.regionAnchorX * q / 100, e.style.top = h + "%", e.style.left = k2 + "%") : (e.style.top = g.viewportAnchorY - g.regionAnchorY * n / 100 + m, e.style.left = g.viewportAnchorX - g.regionAnchorX * q / 100 + m);
          g.heightUnits !== 0 && g.widthUnits !== 0 && g.viewportAnchorUnits !== 0 && (g = Math.max(0, Math.min(100 - (parseInt(e.style.width.slice(0, -1), 10) || 0), parseInt(e.style.left.slice(0, -1), 10) || 0)), e.style.top = Math.max(0, Math.min(100 - (parseInt(e.style.height.slice(0, -1), 10) || 0), parseInt(e.style.top.slice(0, -1), 10) || 0)) + "%", e.style.left = g + "%");
          e.style.display = "flex";
          e.style.flexDirection = "column";
          e.style.alignItems = "center";
          e.style.justifyContent = b.displayAlign == "before" ? "flex-start" : b.displayAlign == "center" ? "center" : "flex-end";
          a.G.set(c, e);
          c = e;
        }
      }
      e = f;
      d && (e = W("span"), e.classList.add("shaka-text-wrapper"), e.style.backgroundColor = b.backgroundColor, e.style.lineHeight = "normal", f.appendChild(e));
      a.l.set(b, { Sg: f, gk: e, pd: c });
    }
    function hp(a) {
      var b = a.direction, c = a.positionAlign;
      a = a.textAlign;
      return c !== te ? c : a === "left" || a === "start" && b === ve || a === "end" && b === "rtl" ? "line-left" : a === "right" || a === "start" && b === "rtl" || a === "end" && b === ve ? "line-right" : "center";
    }
    function gp(a, b, c, d, e) {
      var f = b.style, g = c.nestedCues.length == 0, h = d.length > 1;
      f.whiteSpace = "pre-wrap";
      var k2 = c.payload.replace(/\s+$/g, function(m) {
        return "\xA0".repeat(m.length);
      });
      f.webkitTextStrokeColor = c.textStrokeColor;
      f.webkitTextStrokeWidth = c.textStrokeWidth;
      f.color = c.color;
      f.direction = c.direction;
      f.opacity = c.opacity;
      f.paddingLeft = ip(c.linePadding, c, a.u);
      f.paddingRight = ip(c.linePadding, c, a.u);
      f.textCombineUpright = c.textCombineUpright;
      f.textShadow = c.textShadow;
      if (c.backgroundImage) f.backgroundImage = "url('" + c.backgroundImage + "')", f.backgroundRepeat = "no-repeat", f.backgroundSize = "contain", f.backgroundPosition = "center", c.backgroundColor && (f.backgroundColor = c.backgroundColor), f.width = "100%", f.height = "100%";
      else {
        if (c.nestedCues.length) var l = b;
        else l = W("span"), b.appendChild(l);
        c.border && (l.style.border = c.border);
        e || ((b = jp(d, function(m) {
          return m.backgroundColor;
        })) ? l.style.backgroundColor = b : k2 && (l.style.backgroundColor = "rgba(0, 0, 0, 0.8)"));
        k2 && (l.setAttribute("translate", "no"), l.textContent = k2);
      }
      if (h && !d[d.length - 1].isContainer) f.display = "inline";
      else {
        f.display = "flex";
        f.flexDirection = "column";
        f.alignItems = "center";
        if (c.textAlign == "left" || c.textAlign == "start") f.width = "100%", f.alignItems = "start";
        else if (c.textAlign == "right" || c.textAlign == "end") f.width = "100%", f.alignItems = "end";
        f.justifyContent = c.displayAlign == "before" ? "flex-start" : c.displayAlign == "center" ? "center" : "flex-end";
      }
      g || (f.margin = "0");
      f.fontFamily = c.fontFamily;
      f.fontWeight = c.fontWeight.toString();
      f.fontStyle = c.fontStyle;
      f.letterSpacing = c.letterSpacing;
      f.fontSize = ip(c.fontSize, c, a.u, a.D ? a.D.fontScaleFactor : 1);
      d = c.line;
      d != null && (g = c.lineInterpretation, g == xe && (g = 1, h = 16, a.A && a.A < 1 && (h = 32), d = d < 0 ? 100 + d / h * 100 : d / h * 100), g == 1 && (f.position = "absolute", c.writingMode == we ? (f.width = "100%", c.lineAlign == ye ? f.top = d + "%" : c.lineAlign == "end" && (f.bottom = 100 - d + "%")) : c.writingMode == "vertical-lr" ? (f.height = "100%", c.lineAlign == ye ? f.left = d + "%" : c.lineAlign == "end" && (f.right = 100 - d + "%")) : (f.height = "100%", c.lineAlign == ye ? f.right = d + "%" : c.lineAlign == "end" && (f.left = 100 - d + "%"))));
      f.lineHeight = c.lineHeight;
      a = hp(c);
      a == "line-left" ? (f.cssFloat = "left", c.position !== null && (f.position = "absolute", c.writingMode == we ? (f.left = c.position + "%", f.width = "auto") : f.top = c.position + "%")) : a == "line-right" ? (f.cssFloat = "right", c.position !== null && (f.position = "absolute", c.writingMode == we ? (f.right = 100 - c.position + "%", f.width = "auto") : f.bottom = c.position + "%")) : c.position !== null && c.position != 50 && (f.position = "absolute", c.writingMode == we ? (f.left = c.position + "%", f.width = "auto") : f.top = c.position + "%");
      f.textAlign = c.textAlign;
      f.textDecoration = c.textDecoration.join(" ");
      f.writingMode = c.writingMode;
      "writingMode" in document.documentElement.style && f.writingMode == c.writingMode || (f.webkitWritingMode = c.writingMode);
      c.size && (c.writingMode == we ? f.width = c.size + "%" : f.height = c.size + "%");
    }
    function ip(a, b, c, d) {
      d = d === void 0 ? 1 : d;
      var e = (e = new RegExp(/(\d*\.?\d+)([a-z]+|%+)/).exec(a)) ? { value: Number(e[1]), unit: e[2] } : null;
      if (!e) return a;
      a = e.unit;
      d *= e.value;
      switch (a) {
        case "%":
          return d / 100 * c.clientHeight / b.cellResolution.rows + "px";
        case "c":
          return c.clientHeight * d / b.cellResolution.rows + "px";
        default:
          return d + a;
      }
    }
    function jp(a, b) {
      for (var c = a.length - 1; c >= 0; c--) {
        var d = b(a[c]);
        if (d || d === 0) return d;
      }
      return null;
    }
    S("shaka.text.UITextDisplayer", ap);
    ap.prototype.enableTextDisplayer = ap.prototype.enableTextDisplayer;
    ap.prototype.setTextLanguage = ap.prototype.setTextLanguage;
    ap.prototype.setTextVisibility = ap.prototype.setTextVisibility;
    ap.prototype.isTextVisible = ap.prototype.isTextVisible;
    ap.prototype.remove = ap.prototype.remove;
    ap.prototype.destroy = ap.prototype.destroy;
    ap.prototype.append = ap.prototype.append;
    ap.prototype.configure = ap.prototype.configure;
    function kp(a, b) {
      function c(f) {
        for (var g = f, h = t(b), k2 = h.next(); !k2.done; k2 = h.next()) k2 = k2.value, k2.end && k2.start < f && (g += k2.end - k2.start);
        f = Math.floor(g / 3600);
        h = Math.floor(g / 60 % 60);
        k2 = Math.floor(g % 60);
        g = Math.floor(g * 1e3 % 1e3);
        return (f < 10 ? "0" : "") + f + ":" + (h < 10 ? "0" : "") + h + ":" + (k2 < 10 ? "0" : "") + k2 + "." + (g < 100 ? g < 10 ? "00" : "0" : "") + g;
      }
      var d = Ro(a);
      a = "WEBVTT\n\n";
      d = t(d);
      for (var e = d.next(); !e.done; e = d.next()) e = e.value, a += c(e.startTime) + " --> " + c(e.endTime) + function(f) {
        var g = [];
        switch (f.textAlign) {
          case "left":
            g.push("align:left");
            break;
          case "right":
            g.push("align:right");
            break;
          case ue:
            g.push("align:middle");
            break;
          case "start":
            g.push("align:start");
            break;
          case "end":
            g.push("align:end");
        }
        switch (f.writingMode) {
          case "vertical-lr":
            g.push("vertical:lr");
            break;
          case "vertical-rl":
            g.push("vertical:rl");
        }
        return g.length ? " " + g.join(" ") : "";
      }(e) + "\n", a += e.payload + "\n\n";
      return a;
    }
    S("shaka.text.WebVttGenerator", function() {
    });
    function lp(a, b) {
      this.h = a;
      this.g = b;
      this.i = void 0;
      this.A = false;
      this.G = true;
      this.l = this.D = false;
      this.u = this.m = void 0;
      this.C = 0;
      this.H = false;
      this.F = new Qc();
      this.j = null;
    }
    lp.prototype.setMediaElement = function(a) {
      this.j = a;
      mp(this);
    };
    lp.prototype.configure = function(a) {
      this.g = a;
    };
    function np(a) {
      a.A = false;
      a.G = true;
      a.D = false;
      a.l = false;
      a.m = 0;
      a.u = 0;
      a.C = 0;
      a.H = false;
      a.j = null;
      a.F.Ta();
    }
    function op(a, b) {
      a.l = b;
      a.l ? a.i == pp ? a.i = qp : a.i == rp && (a.i = sp) : a.i == qp ? a.i = pp : a.i == sp && (a.i = rp);
    }
    function tp(a, b) {
      if (a.g && a.g.enabled && a.g.version == up && a.j && a.j.autoplay) {
        var c = a.j.play();
        c && c.then(function() {
          a.C = b;
        }).catch(function() {
          a.C = 0;
        });
      }
    }
    function vp(a, b, c) {
      try {
        if (!a.g.enabled) return b;
        var d = wp(a);
        a: {
          switch (c.toLowerCase()) {
            case "audio/mp4":
            case "audio/webm":
            case "audio/ogg":
            case "audio/mpeg":
            case "audio/aac":
            case "audio/flac":
            case "audio/wav":
              var e = xp;
              break a;
            case "video/webm":
            case "video/mp4":
            case "video/mpeg":
            case "video/mp2t":
              e = yp;
              break a;
            case "application/x-mpegurl":
            case "application/vnd.apple.mpegurl":
            case "application/dash+xml":
            case "video/vnd.mpeg.dash.mpd":
            case "application/vnd.ms-sstr+xml":
              e = zp;
              break a;
          }
          e = void 0;
        }
        d.ot = e;
        d.su = true;
        var f = Ap(d);
        return Bp(b, f);
      } catch (g) {
        return cb("CMCD_SRC_ERROR", "Could not generate src CMCD data.", g), b;
      }
    }
    function mp(a) {
      a.F.qa(a.j, "play", function() {
        a.m || (a.m = Date.now());
      });
      a.F.qa(a.j, "playing", function() {
        a.u || (a.u = Date.now());
      });
    }
    function wp(a) {
      a.g.sessionId || (a.g.sessionId = window2.crypto.randomUUID());
      return { v: a.g.version, sf: a.i, sid: a.g.sessionId, cid: a.g.contentId, mtp: a.h.getBandwidthEstimate() / 1e3 };
    }
    function Cp(a, b, c) {
      c = c === void 0 ? {} : c;
      var d = d === void 0 ? a.g.useHeaders : d;
      if (a.g.enabled) if (a = Dp(a, c), d) d = Ep(a), Object.keys(d).length && Object.assign(b.headers, d);
      else {
        var e = Ap(a);
        e && (b.uris = b.uris.map(function(f) {
          return Bp(f, e);
        }));
      }
    }
    function Fp(a, b) {
      var c = a.g.includeKeys;
      return c.length ? Object.keys(b).reduce(function(d, e) {
        c.includes(e) && (d[e] = b[e]);
        return d;
      }, {}) : b;
    }
    function Gp(a) {
      if (a.type === 0) return Hp;
      if (a = a.stream) {
        var b = a.type;
        if (b == "video") return a.codecs && a.codecs.includes(",") ? yp : Ip;
        if (b == "audio") return xp;
        if (b == "text") return a.mimeType === "application/mp4" ? Jp : Kp;
      }
    }
    function Lp(a, b) {
      b = a.h.cc()[b];
      if (!b.length) return NaN;
      var c = a.h.getCurrentTime();
      return (a = b.find(function(d) {
        return d.start <= c && d.end >= c;
      })) ? (a.end - c) * 1e3 : NaN;
    }
    function Mp(a, b) {
      b = a.h.cc()[b];
      if (!b.length) return 0;
      var c = a.h.getCurrentTime();
      return (a = b.find(function(d) {
        return d.start <= c && d.end >= c;
      })) ? (a.end - c) * 1e3 : 0;
    }
    function aq(a, b) {
      var c = a.h.rb();
      if (!c.length) return NaN;
      a = c[0];
      c = t(c);
      for (var d = c.next(); !d.done; d = c.next()) d = d.value, d.type === "variant" && d.bandwidth > a.bandwidth && (a = d);
      switch (b) {
        case Ip:
          return a.videoBandwidth || NaN;
        case xp:
          return a.audioBandwidth || NaN;
        default:
          return a.bandwidth;
      }
    }
    function Dp(a, b) {
      b = b === void 0 ? {} : b;
      Object.assign(b, wp(a));
      b.pr = a.h.Ya();
      var c = b.ot === Ip || b.ot === yp;
      a.D && c && (b.bs = true, b.su = true, a.D = false);
      b.su == null && (b.su = a.G);
      b.v === up && (a.h.U() && (b.ltc = a.h.uf()), c = !a.H && a.u && a.m ? a.u - (a.C || a.m) : void 0, c != void 0 && (b.msd = c, a.H = true));
      return Fp(a, b);
    }
    function Ap(a) {
      function b(n) {
        return c(n / 100) * 100;
      }
      function c(n) {
        return Math.round(n);
      }
      function d(n) {
        return !Number.isNaN(n) && n != null && n !== "" && n !== false;
      }
      var e = [], f = { br: c, d: c, bl: b, dl: b, mtp: b, nor: function(n) {
        return encodeURIComponent(n);
      }, rtp: b, tb: c }, g = Object.keys(a || {}).sort();
      g = t(g);
      for (var h = g.next(); !h.done; h = g.next()) {
        h = h.value;
        var k2 = a[h];
        if (d(k2) && (h !== "v" || k2 !== 1) && (h != "pr" || k2 !== 1)) {
          var l = f[h];
          l && (k2 = l(k2));
          l = typeof k2;
          var m = void 0;
          m = l === "string" && h !== "ot" && h !== "sf" && h !== "st" ? h + "=" + JSON.stringify(k2) : l === "boolean" ? h : l === "symbol" ? h + "=" + k2.description : h + "=" + k2;
          e.push(m);
        }
      }
      return e.join(",");
    }
    function Ep(a) {
      var b = Object.keys(a), c = {}, d = ["Object", "Request", "Session", "Status"], e = [{}, {}, {}, {}], f = { br: 0, d: 0, ot: 0, tb: 0, bl: 1, dl: 1, mtp: 1, nor: 1, nrr: 1, su: 1, ltc: 1, cid: 2, pr: 2, sf: 2, sid: 2, st: 2, v: 2, msd: 2, bs: 3, rtp: 3 };
      b = t(b);
      for (var g = b.next(); !g.done; g = b.next()) g = g.value, e[f[g] != null ? f[g] : 1][g] = a[g];
      for (a = 0; a < e.length; a++) (f = Ap(e[a])) && (c["CMCD-" + d[a]] = f);
      return c;
    }
    function Bp(a, b) {
      if (!b || a.includes("offline:")) return a;
      a = new rb(a);
      a.g.set("CMCD", b);
      return a.toString();
    }
    var zp = "m", xp = "a", Ip = "v", yp = "av", Hp = "i", Kp = "c", Jp = "tt", up = 2, pp = "d", qp = "ld", rp = "h", sp = "lh";
    S("shaka.util.CmcdManager.StreamingFormat", { DASH: pp, fn: qp, HLS: rp, gn: sp, wn: "s", OTHER: "o" });
    function bq(a) {
      this.h = a;
      this.g = null;
    }
    p = bq.prototype;
    p.configure = function(a) {
      this.h = a;
    };
    p.Yi = function() {
      return this.h.enabled && this.h.applyMaximumSuggestedBitrate && this.g && this.g.has(cq) ? this.g.get(cq) * 1e3 : null;
    };
    p.Xi = function() {
      return this.h.enabled && this.g && this.g.has(dq) ? this.g.get(dq) * 1e3 : null;
    };
    p.fl = function() {
      return this.h.enabled && this.g && this.g.has(eq) ? this.g.get(eq) : null;
    };
    p.hl = function() {
      return this.h.enabled && this.g && this.g.has(fq) ? this.g.get(fq) : null;
    };
    p.getBandwidthEstimate = function(a) {
      var b = this.Xi();
      if (!b) return a;
      var c = this.h.estimatedThroughputWeightRatio;
      return c > 0 && c <= 1 ? a * (1 - c) + b * c : a;
    };
    function gq(a) {
      return a ? a.toLowerCase() === "false" ? false : /^[-0-9]/.test(a) ? parseInt(a, 10) : a.replace(/["]+/g, "") : true;
    }
    S("shaka.util.CmsdManager", bq);
    bq.prototype.getBandwidthEstimate = bq.prototype.getBandwidthEstimate;
    bq.prototype.getRoundTripTime = bq.prototype.hl;
    bq.prototype.getResponseDelay = bq.prototype.fl;
    bq.prototype.getEstimatedThroughput = bq.prototype.Xi;
    bq.prototype.getMaxBitrate = bq.prototype.Yi;
    var dq = "etp", cq = "mb", eq = "rd", fq = "rtt";
    function hq() {
      this.g = null;
      this.h = [];
    }
    function iq(a, b) {
      return P(function(c) {
        if (c.g == 1) return a.g ? G(c, new Promise(function(d) {
          return a.h.push(d);
        }), 2) : c.B(2);
        a.g = b;
        H(c);
      });
    }
    hq.prototype.release = function() {
      this.h.length > 0 ? this.h.shift()() : this.g = null;
    };
    function Y(a, b, c) {
      b = b === void 0 ? null : b;
      lb.call(this);
      var d = this;
      this.m = jq;
      this.h = null;
      this.Re = b;
      this.Z = false;
      this.We = new Qc();
      this.Me = new Qc();
      this.j = new Qc();
      this.kc = new Qc();
      this.Pd = new Qc();
      this.G = this.H = this.F = this.J = null;
      this.Ye = 0;
      this.ea = new hq();
      this.O = this.$ = this.V = this.i = this.Ec = this.I = this.l = this.Je = this.R = this.Ei = this.sa = this.L = this.Za = this.Ia = this.Le = this.P = this.Ma = this.K = this.Ob = null;
      this.aa = false;
      this.Va = this.A = null;
      this.Qe = 1e9;
      this.Ve = [];
      this.fb = [];
      this.Bg = -1;
      this.g = kq(this);
      this.Dg = Zn();
      this.S = null;
      this.Ze = -1;
      this.jc = null;
      this.ua = { width: Infinity, height: Infinity };
      this.Pe = new yi(this.g, this.ua, null);
      this.Te = [];
      this.C = null;
      this.M = this.g.adaptationSetCriteriaFactory();
      this.M.configure({
        language: this.g.preferredAudioLanguage,
        role: this.g.preferredVariantRole,
        channelCount: 0,
        Qc: this.g.preferredVideoHdrLevel,
        spatialAudio: this.g.preferSpatialAudio,
        videoLayout: this.g.preferredVideoLayout,
        Zc: this.g.preferredAudioLabel,
        Yd: this.g.preferredVideoLabel,
        codecSwitchingStrategy: this.g.mediaSource.codecSwitchingStrategy,
        audioCodec: "",
        ae: "",
        $e: 0,
        preferredAudioCodecs: this.g.preferredAudioCodecs,
        preferredAudioChannelCount: this.g.preferredAudioChannelCount
      });
      this.Sd = this.g.preferredTextLanguage;
      this.Zd = this.g.preferredTextRole;
      this.Oe = this.g.preferForcedSubs;
      this.Ne = [];
      c && c(this);
      this.L = lq(this);
      this.sa = new bq(this.g.cmsd);
      this.J = mq(this);
      this.Xd = this.oa = this.va = this.D = null;
      this.Fg = false;
      this.Cg = [];
      this.Eg = new Cf(function() {
        return P(function(e) {
          if (e.g == 1) return d.oa ? G(e, d.bc(d.Xd, true), 3) : e.B(0);
          if (e.g != 4) return G(
            e,
            d.load(d.oa),
            4
          );
          d.Fg ? d.Xd.pause() : d.Xd.play();
          d.oa = null;
          d.Fg = false;
          H(e);
        });
      });
      nq && (this.D = nq(), this.D.configure(this.g.ads), this.Pd.o(this.D, "ad-content-pause-requested", function(e) {
        var f;
        return P(function(g) {
          if (g.g == 1) {
            d.Eg.stop();
            if (d.oa) return g.B(0);
            d.Xd = d.h;
            d.Fg = d.isEnded();
            f = e.saveLivePosition || false;
            return G(g, d.Si(true, f), 3);
          }
          d.oa = g.h;
          H(g);
        });
      }), this.Pd.o(this.D, "ad-content-resume-requested", function(e) {
        e = e.offset || 0;
        if (d.oa) {
          var f = d.oa;
          f.m && e && (typeof f.m === "number" ? f.m += e : f.m.setTime(f.m.getTime() + e * 1e3));
        }
        d.Eg.Y(0.1);
      }), this.Pd.o(this.D, "ad-content-attach-requested", function() {
        return P(function(e) {
          return d.h || !d.Xd ? e.B(0) : G(e, d.bc(d.Xd, true), 0);
        });
      }));
      oq && (this.va = oq(this), this.va.configure(this.g.queue));
      this.We.o(window2, "online", function() {
        pq(d);
        d.Xh();
      });
      this.Se = new Cf(function() {
        for (var e = Date.now() / 1e3, f = false, g = true, h = t(d.i.variants), k2 = h.next(); !k2.done; k2 = h.next()) k2 = k2.value, k2.disabledUntilTime > 0 && k2.disabledUntilTime <= e && (k2.disabledUntilTime = 0, f = true), k2.disabledUntilTime > 0 && (g = false);
        g && d.Se.stop();
        f && qq(d, false, void 0, false, false);
      });
      this.Oa = null;
      a && (Wc("Player w/ mediaElement", "Please migrate from initializing Player with a mediaElement; use the attach method instead."), this.bc(a, true));
      this.u = null;
    }
    ma(Y, lb);
    function rq(a) {
      a.R != null && (bd(a.R), a.R.release(), a.R = null);
    }
    function sq(a, b, c) {
      c || b.lcevc.enabled ? (rq(a), a.R == null && (a.R = new $c(a.h, a.Ei, b.lcevc, c), a.H && (a.H.M = a.R))) : rq(a);
    }
    function tq(a, b) {
      return new T(a, b);
    }
    p = Y.prototype;
    p.destroy = function() {
      var a = this, b;
      return P(function(c) {
        switch (c.g) {
          case 1:
            if (a.m == uq) return c.return();
            rq(a);
            b = a.detach();
            a.m = uq;
            return G(c, b, 2);
          case 2:
            return G(c, a.Vg(), 3);
          case 3:
            a.We && (a.We.release(), a.We = null);
            a.Me && (a.Me.release(), a.Me = null);
            a.j && (a.j.release(), a.j = null);
            a.kc && (a.kc.release(), a.kc = null);
            a.Pd && (a.Pd.release(), a.Pd = null);
            a.Va = null;
            a.g = null;
            a.C = null;
            a.Re = null;
            a.L = null;
            a.sa = null;
            if (!a.J) {
              c.B(4);
              break;
            }
            return G(c, a.J.destroy(), 5);
          case 5:
            a.J = null;
          case 4:
            a.A && (a.A.release(), a.A = null), a.va && (a.va.destroy(), a.va = null), lb.prototype.release.call(a), H(c);
        }
      });
    };
    function vq(a, b) {
      wq.set(a, b);
    }
    function xq() {
      window2.Promise || bb("A Promise implementation or polyfill is required");
      if (!(window2.Promise && window2.Uint8Array && Array.prototype.forEach) || (navigator.userAgent || "").includes("Trident/")) return false;
      Sb();
      return Ji() ? true : Ki().canPlayType("application/x-mpegurl") != "";
    }
    function yq(a, b) {
      a.dispatchEvent(tq("onstatechange", (/* @__PURE__ */ new Map()).set("state", b)));
    }
    p.bc = function(a, b) {
      b = b === void 0 ? true : b;
      var c = this, d, e, f;
      return P(function(g) {
        switch (g.g) {
          case 1:
            if (c.m == uq) throw new U(2, 7, 7e3);
            d = c.h && c.h == a;
            if (!c.h || c.h == a) {
              g.B(2);
              break;
            }
            return G(g, c.detach(), 2);
          case 2:
            return G(g, zq(c, "attach"), 4);
          case 4:
            if (g.h) return g.return();
            sa(g, 5, 6);
            d || (yq(c, "attach"), e = function() {
              var h = Aq(c, false);
              h && Bq(c, h);
            }, c.Me.o(a, "error", e), c.h = a, c.L && c.L.setMediaElement(a));
            Sb();
            if (!b || !Ji() || c.H) {
              g.B(6);
              break;
            }
            return G(g, Cq(c), 6);
          case 6:
            wa(g);
            c.ea.release();
            xa(g, 0);
            break;
          case 5:
            return f = va(g), G(g, c.detach(), 10);
          case 10:
            throw f;
        }
      });
    };
    p.Gi = function(a) {
      this.Ei = a;
    };
    p.detach = function(a) {
      a = a === void 0 ? false : a;
      var b = this;
      return P(function(c) {
        if (c.g == 1) {
          if (b.m == uq) throw new U(2, 7, 7e3);
          return G(c, b.rc(false, a), 2);
        }
        if (c.g != 3) return G(c, zq(b, "detach"), 3);
        if (c.h) return c.return();
        try {
          b.h && (b.Me.Ta(), b.h = null), yq(b, "detach"), b.D && !a && b.D.release();
        } finally {
          b.ea.release();
        }
        H(c);
      });
    };
    function zq(a, b) {
      var c;
      return P(function(d) {
        return d.g == 1 ? (c = ++a.Ye, G(d, iq(a.ea, b), 2)) : c != a.Ye ? (a.ea.release(), d.return(true)) : d.return(false);
      });
    }
    p.rc = function(a, b) {
      a = a === void 0 ? true : a;
      b = b === void 0 ? false : b;
      var c = this, d, e, f, g, h, k2, l, m, n, q, r, u, w;
      return P(function(v) {
        switch (v.g) {
          case 1:
            return c.m != uq && (c.m = jq), G(v, zq(c, "unload"), 2);
          case 2:
            if (v.h) return v.return();
            ta(v, 3);
            c.aa = false;
            yq(c, "unload");
            rq(c);
            d = c.Ne.map(function(y) {
              return y();
            });
            c.Ne = [];
            return G(v, Promise.all(d), 5);
          case 5:
            c.dispatchEvent(tq("unloading"));
            c.Le && (c.Le.release(), c.Le = null);
            c.Ia && (c.Ia.release(), c.Ia = null);
            c.Za && (c.Za.release(), c.Za = null);
            c.h && (c.j.Ta(), c.kc.Ta());
            c.Se.stop();
            c.Ob && (c.Ob.release(), c.Ob = null);
            c.Ma && (c.Ma.stop(), c.Ma = null);
            if (!c.I) {
              v.B(6);
              break;
            }
            return G(v, c.I.stop(), 7);
          case 7:
            c.I = null, c.Ec = null;
          case 6:
            if (!c.A) {
              v.B(8);
              break;
            }
            return G(v, c.A.stop(), 8);
          case 8:
            if (!c.l) {
              v.B(10);
              break;
            }
            return G(v, c.l.destroy(), 11);
          case 11:
            c.l = null;
          case 10:
            c.K && (c.K.release(), c.K = null);
            c.G && (c.G.release(), c.G = null);
            if ("webkit" !== window2.shakaMediaKeysPolyfill || !c.F) {
              v.B(12);
              break;
            }
            return G(v, c.F.destroy(), 13);
          case 13:
            c.F = null;
          case 12:
            if (!c.H) {
              v.B(14);
              break;
            }
            return G(v, c.H.destroy(), 15);
          case 15:
            c.H = null;
          case 14:
            if (c.D && !b) c.D.onAssetUnload();
            c.oa && !b && (c.oa.destroy(), c.oa = null);
            b || c.Eg.stop();
            c.L && np(c.L);
            c.sa && (c.sa.g = null);
            if (!c.u) {
              v.B(16);
              break;
            }
            return G(v, c.u.destroy(), 17);
          case 17:
            c.u = null;
          case 16:
            c.Z = false;
            if (c.h) {
              e = t(c.Cg);
              for (f = e.next(); !f.done; f = e.next()) g = f.value, g.src.startsWith("blob:") && URL.revokeObjectURL(g.src), g.remove();
              c.Cg = [];
              Qj(c.h) && c.h.load();
            }
            if (!c.F) {
              v.B(18);
              break;
            }
            return G(v, c.F.destroy(), 19);
          case 19:
            c.F = null;
          case 18:
            c.Oa && c.V != c.Oa.ed() && (c.Oa.A || c.Oa.destroy(), c.Oa = null);
            c.V = null;
            c.$ = null;
            c.P = null;
            if (c.i) {
              h = t(c.i.variants);
              for (k2 = h.next(); !k2.done; k2 = h.next()) for (l = k2.value, m = t([l.audio, l.video]), n = m.next(); !n.done; n = m.next()) (q = n.value) && q.segmentIndex && q.segmentIndex.release();
              r = t(c.i.textStreams);
              for (u = r.next(); !u.done; u = r.next()) w = u.value, w.segmentIndex && w.segmentIndex.release();
            }
            c.g && c.g.streaming.clearDecodingCache && (Vf.clear(), Ig.clear());
            c.i = null;
            c.C = new go();
            c.Di = null;
            c.jc = null;
            c.S = null;
            c.Ze = -1;
            c.Ve = [];
            c.fb = [];
            c.Bg = -1;
            c.J && c.J.Ni();
            Dq(c);
          case 3:
            wa(v);
            c.ea.release();
            xa(v, 4);
            break;
          case 4:
            Sb();
            if (a && Ji() && !c.H && c.h) return G(v, Cq(c), 0);
            v.B(0);
        }
      });
    };
    p.Cm = function(a) {
      this.O = a;
    };
    p.load = function(a, b, c) {
      b = b === void 0 ? null : b;
      var d = this, e, f, g, h, k2, l, m, n, q, r, u, w, v, y;
      return P(function(z) {
        switch (z.g) {
          case 1:
            if (d.m == uq) throw new U(2, 7, 7e3);
            e = null;
            f = "";
            if (a instanceof mo) {
              if (a.A) throw new U(2, 7, 7006);
              e = a;
              f = e.ed() || "";
            } else f = a || "";
            return G(z, iq(d.ea, "load"), 2);
          case 2:
            d.ea.release();
            if (!d.h) throw new U(2, 7, 7002);
            if (!d.V) {
              z.B(3);
              break;
            }
            d.V = f;
            return G(z, d.rc(false), 3);
          case 3:
            g = ++d.Ye;
            h = function() {
              return P(function(A) {
                if (A.g == 1) return d.Ye == g ? A.B(0) : e ? G(A, e.destroy(), 3) : A.B(3);
                throw new U(
                  2,
                  7,
                  7e3
                );
              });
            };
            k2 = function(A, C) {
              return P(function(D) {
                switch (D.g) {
                  case 1:
                    return ta(D, 2), G(D, iq(d.ea, C), 4);
                  case 4:
                    return G(D, h(), 5);
                  case 5:
                    return G(D, A(), 6);
                  case 6:
                    return G(D, h(), 7);
                  case 7:
                    e && d.g && (e.g = d.g);
                  case 2:
                    wa(D), d.ea.release(), xa(D, 0);
                }
              });
            };
            sa(z, 5, 6);
            b == null && e && (b = e.getStartTime());
            d.O = b;
            d.aa = false;
            d.dispatchEvent(tq("loading"));
            if (e) {
              c = e.V;
              z.B(8);
              break;
            }
            if (c) {
              z.B(8);
              break;
            }
            return G(z, k2(function() {
              return P(function(A) {
                if (A.g == 1) return G(A, Eq(d, f), 2);
                c = A.h;
                H(A);
              });
            }, "guessMimeType_"), 8);
          case 8:
            l = !!e;
            if (e) {
              po(
                e,
                d
              );
              d.C = e.getStats();
              z.B(11);
              break;
            }
            return G(z, Fq(d, f, b, c, true, d.g), 12);
          case 12:
            (e = z.h) ? (e.F = false, po(e, d), d.C = e.getStats(), e.start(), e.C.catch(function() {
            })) : d.C = new go();
          case 11:
            m = !e;
            n = Date.now() / 1e3;
            d.C = e ? e.getStats() : new go();
            d.V = f;
            d.$ = c || null;
            Dq(d);
            q = function() {
              var A = d.h ? d.h.buffered : null;
              return { start: Hj(A) || 0, end: Ij(A) || 0 };
            };
            d.Ia = new om(q);
            d.Ia.addEventListener("regionadd", function(A) {
              Gq(d, A.region, "metadataadded");
            });
            if (m) return G(
              z,
              k2(function() {
                return P(function(A) {
                  return G(A, Hq(d, c), 0);
                });
              }, "initializeSrcEqualsDrmInner_"),
              23
            );
            d.Za = new om(q);
            return G(z, k2(function() {
              return P(function(A) {
                if (A.g == 1) return G(A, Promise.race([e.oa, e.C]), 2);
                d.Ec = e.I;
                var C = e;
                C.sa = true;
                d.I = C.l;
                d.i = e.qh();
                H(A);
              });
            }, "waitForFinish"), 15);
          case 15:
            if (d.H) {
              z.B(16);
              break;
            }
            return G(z, k2(function() {
              return P(function(A) {
                return G(A, Cq(d), 0);
              });
            }, "initializeMediaSourceEngineInner_"), 16);
          case 16:
            return d.i && d.i.textStreams.length && (d.u.enableTextDisplayer ? d.u.enableTextDisplayer() : Wc("Text displayer w/ enableTextDisplayer", 'Text displayer should have a "enableTextDisplayer" method!')), G(z, k2(function() {
              return P(function(A) {
                return G(A, e.C, 0);
              });
            }, "waitForFinish"), 18);
          case 18:
            d.g = e.getConfiguration();
            d.Pe = e.H;
            d.I && d.I.setMediaElement && d.h && d.I.setMediaElement(d.h);
            d.Le = ro(e);
            d.Je = e.Oa;
            if (r = e.D) d.M = r;
            l && d.h && d.h.nodeName === "AUDIO" && (Iq(d), d.configure("manifest.disableVideo", true));
            if (e.i) {
              z.B(19);
              break;
            }
            return G(z, k2(function() {
              return P(function(A) {
                return G(A, xo(e, d.h), 0);
              });
            }, "drmEngine_.init"), 19);
          case 19:
            return d.F = so(e), G(z, k2(
              function() {
                return P(function(A) {
                  return G(A, d.F.bc(d.h), 0);
                });
              },
              "drmEngine_.attach"
            ), 21);
          case 21:
            return !(u = e.G) || d.Va && d.Va == u || (d.A = qo(e), d.Va = e.G, typeof d.A.setMediaElement != "function" && (Wc("AbrManager w/o setMediaElement", "Please use an AbrManager with setMediaElement function."), d.A.setMediaElement = function() {
            }), typeof d.A.setCmsdManager != "function" && (Wc("AbrManager w/o setCmsdManager", "Please use an AbrManager with setCmsdManager function."), d.A.setCmsdManager = function() {
            }), typeof d.A.trySuggestStreams != "function" && (Wc(
              "AbrManager w/o trySuggestStreams",
              "Please use an AbrManager with trySuggestStreams function."
            ), d.A.trySuggestStreams = function() {
            })), w = to(e), v = e.u, G(z, k2(function() {
              return P(function(A) {
                return G(A, Jq(d, n, v, w), 0);
              });
            }, "loadInner_"), 22);
          case 22:
            oo(e);
            d.$ && Sb().kg() && pf(d.$) && Ck(d.H, d.V, d.$);
            z.B(14);
            break;
          case 23:
            return G(z, k2(function() {
              return P(function(A) {
                return G(A, Kq(d, n, c), 0);
              });
            }, "srcEqualsInner_"), 14);
          case 14:
            d.dispatchEvent(tq("loaded"));
          case 6:
            wa(z);
            if (!e) {
              z.B(25);
              break;
            }
            return G(z, e.destroy(), 25);
          case 25:
            d.Oa = null;
            xa(z, 0);
            break;
          case 5:
            y = va(z);
            if (!y || y.code == 7e3) {
              z.B(27);
              break;
            }
            return G(z, d.rc(false), 27);
          case 27:
            throw y;
        }
      });
    };
    function Iq(a) {
      for (var b = t(a.i.variants), c = b.next(); !c.done; c = b.next()) c = c.value, c.video && (c.video.closeSegmentIndex(), c.video = null), c.bandwidth = c.audio && c.audio.bandwidth ? c.audio.bandwidth : 0;
      a.i.variants = a.i.variants.filter(function(d) {
        return d.audio;
      });
    }
    p.ym = function(a, b) {
      a = a === void 0 ? true : a;
      b = b === void 0 ? false : b;
      var c = this, d;
      return P(function(e) {
        return e.g == 1 ? G(e, Lq(c), 2) : e.g != 3 ? (d = e.h, G(e, c.rc(a, b), 3)) : e.return(d);
      });
    };
    p.Si = function(a, b) {
      a = a === void 0 ? false : a;
      b = b === void 0 ? false : b;
      var c = this, d;
      return P(function(e) {
        return e.g == 1 ? G(e, Lq(c, b), 2) : e.g != 3 ? (d = e.h, G(e, c.detach(a), 3)) : e.return(d);
      });
    };
    function Lq(a, b) {
      b = b === void 0 ? false : b;
      var c, d, e;
      return P(function(f) {
        if (f.g == 1) {
          c = null;
          if (!(a.i && a.I && a.Ec && a.V && a.g)) return f.B(2);
          d = a.h.currentTime;
          a.U() && !b && (d = null);
          return G(f, Mq(a, a.V, d, a.$, a.g, true, false, false), 3);
        }
        if (f.g != 2) {
          c = f.h;
          a.Te.push(c);
          a.I && a.I.setMediaElement && a.I.setMediaElement(null);
          if (e = a.l ? a.l.u : null) c.u = e;
          var g = c, h = a.I, k2 = a.Ec;
          g.h = a.i;
          g.l = h;
          g.I = k2;
          c.D = a.M;
          c.start();
          a.i = null;
          a.I = null;
          a.Ec = null;
          a.A = null;
          a.Va = null;
        }
        return f.return(c);
      });
    }
    p.preload = function(a, b, c, d) {
      b = b === void 0 ? null : b;
      var e = this, f, g;
      return P(function(h) {
        if (h.g == 1) return f = kq(e), $n(f, d || e.g, kq(e)), G(h, Fq(e, a, b, c, false, f), 2);
        (g = h.h) ? g.start() : Bq(e, new U(2, 7, 7005));
        return h.return(g);
      });
    };
    p.Vg = function() {
      var a = this, b, c, d, e;
      return P(function(f) {
        b = [];
        c = t(a.Te);
        for (d = c.next(); !d.done; d = c.next()) e = d.value, e.A || b.push(e.destroy());
        a.Te = [];
        return G(f, Promise.all(b), 0);
      });
    };
    function Fq(a, b, c, d, e, f) {
      e = e === void 0 ? false : e;
      var g, h, k2, l, m;
      return P(function(n) {
        if (n.g == 1) return d ? n.B(2) : G(n, Eq(a, b), 3);
        n.g != 2 && (d = n.h);
        if (g = Nq(a, d)) return n.return(null);
        h = f || a.g;
        k2 = false;
        l = true;
        e && (a.A && a.Va == h.abrFactory && (l = false), a.h && a.h.nodeName === "AUDIO" && (k2 = true));
        m = Mq(a, b, c, d || null, h, !e, k2, l);
        m = e ? m.then(function(q) {
          q.F = false;
          return q;
        }) : m.then(function(q) {
          a.Te.push(q);
          return q;
        });
        return n.return(m);
      });
    }
    function Mq(a, b, c, d, e, f, g, h) {
      f = f === void 0 ? true : f;
      g = g === void 0 ? false : g;
      h = h === void 0 ? true : h;
      var k2, l, m, n, q, r, u, w, v, y, z, A, C, D, F;
      return P(function(B) {
        if (B.g == 1) {
          k2 = null;
          l = Hd(e);
          g && (l.manifest.disableVideo = true);
          m = function() {
            return k2.R && k2.A ? null : k2;
          };
          n = function() {
            return m() ? m().getConfiguration() : a.g;
          };
          if (a.ua.width != Infinity || a.ua.height != Infinity || a.g.ignoreHardwareResolution) return B.B(2);
          q = Sb();
          return G(B, q.tc(), 3);
        }
        B.g != 2 && (r = B.h, a.ua.width = r.width, a.ua.height = r.height);
        u = new yi(l, a.ua, null);
        w = {
          networkingEngine: a.J,
          filter: function(E) {
            var I, J;
            return P(function(K) {
              if (K.g == 1) return G(K, zi(u, E), 2);
              if (K.g != 4) {
                I = K.h;
                if (!I) return K.B(0);
                J = tq("trackschanged");
                return G(K, Promise.resolve(), 4);
              }
              k2.dispatchEvent(J);
              H(K);
            });
          },
          makeTextStreamsForClosedCaptions: function(E) {
            return Oq(a, E);
          },
          onTimelineRegionAdded: function(E) {
            pm(k2.J, E);
          },
          onEvent: function(E) {
            return k2.dispatchEvent(E);
          },
          onError: function(E) {
            return k2.onError(E);
          },
          isLowLatencyMode: function() {
            return n().streaming.lowLatencyMode;
          },
          updateDuration: function() {
            a.l && k2.R && a.l.updateDuration();
          },
          newDrmInfo: function(E) {
            var I = k2.i, J = I ? I.g : null;
            J && I.C && Ci(u, J.keySystem, E);
          },
          onManifestUpdated: function() {
            var E = (/* @__PURE__ */ new Map()).set("isLive", a.U());
            k2.dispatchEvent(tq("manifestupdated", E));
            no(k2, false, function() {
              if (a.D) a.D.onManifestUpdated(a.U());
            });
          },
          getBandwidthEstimate: function() {
            return a.A.getBandwidthEstimate();
          },
          onMetadata: function(E, I, J, K) {
            var L = E;
            if (E == "com.apple.hls.interstitial" && (L = "com.apple.quicktime.HLS", E = { startTime: I, endTime: J, values: K }, a.D)) a.D.onHLSInterstitialMetadata(a, a.h, E);
            K = t(K);
            E = K.next();
            for (var M = {}; !E.done; M = { Rh: void 0 }, E = K.next()) M.Rh = E.value, M.Rh.name != "ID" && no(k2, false, /* @__PURE__ */ function(N) {
              return function() {
                Pq(a, I, J, L, N.Rh);
              };
            }(M));
          },
          disableStream: function(E) {
            return a.disableStream(E, a.g.streaming.maxDisabledTime);
          },
          addFont: function(E, I) {
            return a.addFont(E, I);
          }
        };
        v = new om(function() {
          return a.ya();
        });
        v.addEventListener("regionadd", function(E) {
          var I = E.region;
          Qq(a, "timelineregionadded", I, k2);
          no(k2, false, function() {
            a.D && (a.D.onDashTimedMetadata(I), a.D.onDASHInterstitialMetadata(a, a.h, I));
          });
        });
        y = null;
        l.streaming.observeQualityChanges && (y = new im(function() {
          return a.cc();
        }), y.addEventListener("qualitychange", function(E) {
          Rq(a, E.quality, E.position);
        }), y.addEventListener("audiotrackchange", function(E) {
          Rq(a, E.quality, E.position, true);
        }));
        z = true;
        A = { Bc: a.J, onError: function(E) {
          return k2.onError(E);
        }, Qf: function(E) {
          no(k2, true, function() {
            a.F && Sq(a, E);
          });
        }, onExpirationUpdated: function(E, I) {
          var J = tq("expirationupdated");
          k2.dispatchEvent(J);
          if ((J = k2.l) && J.onExpirationUpdated) J.onExpirationUpdated(E, I);
        }, onEvent: function(E) {
          k2.dispatchEvent(E);
          E.type == "drmsessionupdate" && z && (z = false, E = Date.now() / 1e3 - k2.Ia, (a.C || k2.getStats()).m = E, a.R && bd(a.R));
        } };
        C = mq(a, m);
        $g(a.J, C);
        D = function() {
          return a.Bd(A);
        };
        F = { config: l, Nl: w, Yl: v, Xl: y, Bd: D, Ml: u, networkingEngine: C, lk: f, kk: h };
        k2 = new mo(b, d, c, F);
        h || uo(k2, a.A, a.Va);
        return B.return(k2);
      });
    }
    function Eq(a, b) {
      var c, d, e;
      return P(function(f) {
        if (f.g == 1) return c = a.g.manifest.retryParameters, G(f, Jo(b, a.J, c), 2);
        d = f.h;
        d == "application/x-mpegurl" && (e = Sb(), e.Ga() === "WEBKIT" && (d = "application/vnd.apple.mpegurl"));
        return f.return(d);
      });
    }
    function Nq(a, b) {
      if (!Ji(Sb())) return true;
      if (b) {
        if ((a.h || Ki()).canPlayType(b) == "") return false;
        if (!Ji(Sb()) || !Hi.has(b)) return true;
        if (pf(b)) return Sb().Ga() === "WEBKIT" && (a.g.drm.servers["com.apple.fps"] || a.g.drm.servers["com.apple.fps.1_0"]) ? a.g.streaming.useNativeHlsForFairPlay : a.g.streaming.preferNativeHls;
        if (b === "application/dash+xml" || b === "video/vnd.mpeg.dash.mpd") return a.g.streaming.preferNativeDash;
      }
      return false;
    }
    function Tq(a) {
      var b = a.g.textDisplayFactory;
      if (a.Di !== b) {
        var c = a.u;
        a.u = b();
        a.u.configure ? a.u.configure(a.g.textDisplayer) : Wc("Text displayer w/ configure", 'Text displayer should have a "configure" method!');
        a.u.setTextLanguage || Wc("Text displayer w/ setTextLanguage", 'Text displayer should have a "setTextLanguage" method!');
        c ? (a.u.setTextVisibility(c.isTextVisible()), c.destroy().catch(function() {
        })) : a.u.setTextVisibility(a.Z);
        a.H && il(a.H, a.u);
        a.Di = b;
        a.l && $m(a.l);
      } else a.u && a.u.configure && a.u.configure(a.g.textDisplayer);
    }
    function Cq(a) {
      var b, c, d;
      return P(function(e) {
        if (e.g == 1) return Sb(), yq(a, "media-source"), a.g.mediaSource.useSourceElements && Qj(a.h), Tq(a), b = Uq(a.h, a.u, { Qk: function() {
          return a.keySystem();
        }, onMetadata: function(f, g, h) {
          f = t(f);
          for (var k2 = f.next(); !k2.done; k2 = f.next()) if (k2 = k2.value, k2.data && typeof k2.cueTime == "number" && k2.frames) {
            var l = k2.cueTime + g, m = h;
            m && l > m && (m = l);
            for (var n = t(k2.frames), q = n.next(); !q.done; q = n.next()) Pq(a, l, m, "org.id3", q.value);
            if (a.D) a.D.onHlsTimedMetadata(k2, l);
          }
        }, Sl: function(f) {
          a.Za && pm(
            a.Za,
            { schemeIdUri: f.schemeIdUri, startTime: f.startTime, endTime: f.endTime, id: String(f.id), emsg: f }
          );
        }, onEvent: function(f) {
          return a.dispatchEvent(f);
        }, Ul: function() {
          a.I && a.I.update && a.I.update();
        } }, a.R, a.g.mediaSource), c = a.g.manifest, d = c.segmentRelativeVttTiming, b.Ia = d, G(e, b.K, 2);
        a.H = b;
        H(e);
      });
    }
    function Vq(a, b, c) {
      function d() {
        return Wq(a);
      }
      a.j.o(b, "playing", d);
      a.j.o(b, "pause", d);
      a.j.o(b, "ended", d);
      a.j.o(b, "ratechange", function() {
        var f = a.h.playbackRate;
        f != 0 && (a.K && (a.K.set(f), a.m == Xq && a.A.playbackRateChanged(f), Yq(a, f)), f = tq("ratechange"), a.dispatchEvent(f));
      });
      b.remote && (a.j.o(b.remote, "connect", function() {
        a.l && b.remote.state == "connected" && Zq(a);
        $q(a);
      }), a.j.o(b.remote, "connecting", function() {
        return $q(a);
      }), a.j.o(b.remote, "disconnect", function() {
        return P(function(f) {
          if (f.g == 1) return a.l && b.remote.state == "disconnected" ? G(f, nn(a.l), 3) : f.B(2);
          f.g != 2 && Zq(a);
          $q(a);
          H(f);
        });
      }));
      b.audioTracks && (a.j.o(b.audioTracks, "addtrack", function() {
        return $q(a);
      }), a.j.o(b.audioTracks, "removetrack", function() {
        return $q(a);
      }), a.j.o(b.audioTracks, "change", function() {
        return $q(a);
      }));
      b.videoTracks && (a.j.o(b.videoTracks, "addtrack", function() {
        return $q(a);
      }), a.j.o(b.videoTracks, "removetrack", function() {
        return $q(a);
      }), a.j.o(b.videoTracks, "change", function() {
        return $q(a);
      }));
      if (b.textTracks) {
        var e = function() {
          a.m === ar && a.u instanceof Wo && Zq(a);
          $q(a);
        };
        a.j.o(b.textTracks, "addtrack", function(f) {
          if (f.track) switch (f = f.track, f.kind) {
            case "metadata":
              br(a, f);
              break;
            case "chapters":
              cr(a, f);
              break;
            default:
              e();
          }
        });
        a.j.o(b.textTracks, "removetrack", e);
        a.j.o(b.textTracks, "change", e);
        a.g.streaming.crossBoundaryStrategy !== "keep" && (a.j.o(b, "waiting", function() {
          a.l && fn(a.l);
        }), a.j.o(b, "timeupdate", function() {
          a.l && fn(a.l);
        }));
      }
      b.preload != "none" && a.j.qa(b, "loadedmetadata", function() {
        a.C.G = Date.now() / 1e3 - c;
      });
    }
    function Jq(a, b, c, d) {
      var e, f, g, h, k2, l, m, n, q, r, u, w, v, y, z, A, C, D, F, B, E, I, J, K, L, M, N, O;
      return P(function(Q) {
        switch (Q.g) {
          case 1:
            yq(a, "load");
            e = a.h;
            a.K = new em({ vf: function() {
              return e.playbackRate;
            }, fd: function() {
              return e.defaultPlaybackRate;
            }, gi: function(R) {
              e.playbackRate = R;
            }, oj: function(R) {
              e.currentTime += R;
            } });
            Vq(a, e, b);
            "onchange" in window2.screen && a.j.o(window2.screen, "change", function() {
              if (a.M.getConfiguration) {
                var R = a.M.getConfiguration();
                R.Qc == "AUTO" ? dr(a) : a.g.preferredVideoHdrLevel == "AUTO" && a.g.abr.enabled && (R.Qc = "AUTO", a.M.configure(R), dr(a));
              }
            });
            f = false;
            g = t(a.i.variants);
            for (h = g.next(); !h.done; h = g.next()) k2 = h.value, (l = k2.video && k2.video.dependencyStream) && (f = cd(l));
            sq(a, a.g, f);
            a.Sd = a.g.preferredTextLanguage;
            a.Zd = a.g.preferredTextRole;
            a.Oe = a.g.preferForcedSubs;
            er(a.i.presentationTimeline, a.g.playRangeStart, a.g.playRangeEnd);
            a.A.init(function(R, V, Ba) {
              a.i && a.l && R != a.l.u && fr(a, R, true, V === void 0 ? false : V, Ba === void 0 ? 0 : Ba);
            });
            a.A.setMediaElement(e);
            a.A.setCmsdManager(a.sa);
            a.l = gr(a);
            a.l.configure(a.g.streaming);
            a.m = Xq;
            a.dispatchEvent(tq("streaming"));
            m = c;
          case 2:
            (q = a.l.u) || m || (m = dr(a) ? a.A.chooseVariant() : null);
            r = [];
            n = q || m;
            u = t([n.video, n.audio]);
            for (w = u.next(); !w.done; w = u.next()) (v = w.value) && !v.segmentIndex && (r.push(v.createSegmentIndex()), v.dependencyStream && r.push(v.dependencyStream.createSegmentIndex()));
            if (!(r.length > 0)) {
              Q.B(4);
              break;
            }
            return G(Q, Promise.all(r), 4);
          case 4:
            if (!n || n.disabledUntilTime != 0) {
              Q.B(2);
              break;
            }
            if (a.I && a.I.onInitialVariantChosen) a.I.onInitialVariantChosen(n);
            a.i.isLowLatency && (a.g.streaming.lowLatencyMode ? a.configure(a.Dg) : bb("Low-latency live stream detected, but low-latency streaming mode is not enabled in Shaka Player. Set streaming.lowLatencyMode configuration to true, and see https://bit.ly/3clctcj for details."));
            a.L && (op(a.L, a.i.isLowLatency && a.g.streaming.lowLatencyMode), tp(a.L, b * 1e3));
            er(a.i.presentationTimeline, a.g.playRangeStart, a.g.playRangeEnd);
            Qm(a.l, a.g.playRangeStart, a.g.playRangeEnd);
            a.aa = true;
            a.dispatchEvent(tq("canupdatestarttime"));
            y = function(R) {
              a.G = hr(a, R);
              a.Ob = ir(a, R);
              jr(a, e, false);
            };
            a.g.streaming.startAtSegmentBoundary || (z = a.O, z == null && a.i.startTime && (z = a.i.startTime), y(z));
            if (q) {
              Q.B(7);
              break;
            }
            if (!a.g.streaming.startAtSegmentBoundary) {
              Q.B(8);
              break;
            }
            A = a.i.presentationTimeline;
            a.O instanceof Date && (D = A.m || A.i, F = a.O.getTime() / 1e3 - D, F != null && (C = F));
            C == null && (C = typeof a.O === "number" ? a.O : a.h.currentTime);
            a.O == null && a.i.startTime && (C = a.i.startTime);
            B = A.ec();
            E = A.Mb();
            C < B ? C = B : C > E && (C = E);
            return G(Q, kr(m, C), 9);
          case 9:
            I = Q.h, y(I);
          case 8:
            fr(a, m, true, false, 0);
          case 7:
            return a.G.ready(), J = a.vc().find(function(R) {
              return R.active;
            }), J || ((K = mg(a.i.textStreams, a.Sd, a.Zd, a.Oe)[0] || null) && fo(a.C.h, K, true), m && (K ? (qg(m.audio, K, a.g) && (a.Z = true), a.Z && a.u.setTextVisibility(true)) : (a.Z = false, a.u.setTextVisibility(false)), lr(a)), K && (a.g.streaming.alwaysStreamText || a.ld()) && (Zm(a.l, K), mr(a))), G(Q, a.l.start(d), 10);
          case 10:
            a.g.abr.enabled && (a.A.enable(), nr(a));
            $q(a);
            dr(a);
            a.i.variants.some(function(R) {
              return R.primary;
            });
            if ((L = a.U()) && (a.g.streaming.liveSync && a.g.streaming.liveSync.enabled || a.i.serviceDescription || a.g.streaming.liveSync.panicMode) || a.g.streaming.vodDynamicPlaybackRate) M = function() {
              return or(a);
            }, a.j.o(e, "timeupdate", M);
            L || (N = function() {
              return pr(a);
            }, a.j.o(e, "timeupdate", N), pr(a), a.i.nextUrl && (a.g.streaming.preloadNextUrlWindow > 0 && (O = function() {
              var R;
              return P(function(V) {
                if (V.g == 1) {
                  R = a.ya().end - a.h.currentTime;
                  if (isNaN(R) || !(R <= a.g.streaming.preloadNextUrlWindow)) return V.B(0);
                  a.j.Ea(e, "timeupdate", O);
                  return G(V, a.preload(a.i.nextUrl), 4);
                }
                a.Oa = V.h;
                H(V);
              });
            }, a.j.o(e, "timeupdate", O)), a.j.o(e, "ended", function() {
              a.load(a.Oa || a.i.nextUrl);
            })));
            if (a.D) a.D.onManifestUpdated(L);
            H(Q);
        }
      });
    }
    function Hq(a, b) {
      var c, d, e;
      return P(function(f) {
        return f.g == 1 ? (c = Date.now() / 1e3, d = true, a.F = a.Bd({ Bc: a.J, onError: function(g) {
          Bq(a, g);
        }, Qf: function() {
        }, onExpirationUpdated: function() {
          var g = tq("expirationupdated");
          a.dispatchEvent(g);
        }, onEvent: function(g) {
          a.dispatchEvent(g);
          g.type == "drmsessionupdate" && d && (d = false, a.C.m = Date.now() / 1e3 - c);
        } }), a.F.configure(a.g.drm), e = rg([b]), a.F.O = true, G(f, Jh(a.F, [e], []), 2)) : G(f, a.F.bc(a.h), 0);
      });
    }
    function Kq(a, b, c) {
      var d, e, f, g, h, k2, l, m, n, q, r, u;
      return P(function(w) {
        switch (w.g) {
          case 1:
            yq(a, "src-equals");
            d = a.h;
            a.G = new Rl(d);
            e = false;
            a.Ne.push(function() {
              e = true;
            });
            a.dispatchEvent(tq("canupdatestarttime"));
            a.O != null && a.G.Ag(a.O);
            a.Ob = qr(a, a.O || 0);
            a.K = new em({ vf: function() {
              return d.playbackRate;
            }, fd: function() {
              return d.defaultPlaybackRate;
            }, gi: function(v) {
              d.playbackRate = v;
            }, oj: function(v) {
              d.currentTime += v;
            } });
            jr(a, d, true);
            d.textTracks && (Tq(a), f = function(v) {
              if (!(a.u instanceof Wo)) {
                var y = rr(a).find(function(z) {
                  return z.mode !== "disabled";
                });
                y && (y.mode = v ? "showing" : "hidden");
                a.u instanceof Yo && (y = sr(a)) && (y.mode = !v && a.u.isTextVisible() ? "showing" : "hidden");
              }
            }, a.j.o(d, "enterpictureinpicture", function() {
              return f(true);
            }), a.j.o(d, "leavepictureinpicture", function() {
              return f(false);
            }), d.remote ? (a.j.o(d.remote, "connect", function() {
              return f(false);
            }), a.j.o(d.remote, "connecting", function() {
              return f(false);
            }), a.j.o(d.remote, "disconnect", function() {
              return f(false);
            })) : "webkitCurrentPlaybackTargetIsWireless" in d && a.j.o(
              d,
              "webkitcurrentplaybacktargetiswirelesschanged",
              function() {
                return f(false);
              }
            ), g = d, g.webkitSupportsFullscreen && a.j.o(g, "webkitpresentationmodechanged", function() {
              return f(g.webkitPresentationMode !== "inline");
            }));
            Vq(a, d, b);
            h = vp(a.L, a.V, c);
            !h.includes("#t=") && (a.g.playRangeStart > 0 || isFinite(a.g.playRangeEnd)) && (h += "#t=", a.g.playRangeStart > 0 && (h += a.g.playRangeStart), isFinite(a.g.playRangeEnd) && (h += "," + a.g.playRangeEnd));
            if (!a.H) {
              w.B(2);
              break;
            }
            return G(w, a.H.destroy(), 3);
          case 3:
            a.H = null;
          case 2:
            return Qj(d), d.src = h, k2 = Sb(), k2.Ka() == "TV" && d.load(), d.preload != "none" && !d.autoplay && pf(c) && k2.Ga() === "WEBKIT" && d.load(), a.m = ar, a.dispatchEvent(tq("streaming")), l = new Mg(), Il(d, HTMLMediaElement.HAVE_METADATA, a.j, function() {
              a.G.ready();
              a.$ && pf(a.$) || l.resolve();
            }), m = function() {
              return new Promise(function(v) {
                var y = new Cf(v);
                a.j.o(d.textTracks, "change", function() {
                  return y.Y(0.5);
                });
                y.Y(0.5);
              });
            }, Il(d, HTMLMediaElement.HAVE_CURRENT_DATA, a.j, function() {
              var v, y, z, A, C;
              return P(function(D) {
                if (D.g == 1) return G(D, m(), 2);
                if (e) return D.return();
                tr(a);
                v = rr(a);
                v.some(function(F) {
                  return F.mode === "showing";
                }) && (a.Z = true, a.u.setTextVisibility(true));
                if (!(a.u instanceof Wo)) for (v.length && (a.u.enableTextDisplayer ? a.u.enableTextDisplayer() : Wc("Text displayer w/ enableTextDisplayer", 'Text displayer should have a "enableTextDisplayer" method')), y = false, z = t(v), A = z.next(); !A.done; A = z.next()) C = A.value, C.mode !== "disabled" && (y ? (C.mode = "disabled", bb("Found more than one enabled text track, disabling it", C)) : (ur(a, C), y = true));
                vr(a);
                a.$ && pf(a.$) && l.resolve();
                H(D);
              });
            }), d.error ? l.reject(Aq(a)) : d.preload == "none" && (bb('With <video preload="none">, the browser will not load anything until play() is called. We are unable to measure load latency in a meaningful way, and we cannot provide track info yet. Please do not use preload="none" with Shaka Player.'), l.resolve()), a.j.qa(d, "error", function() {
              l.reject(Aq(a));
            }), G(w, Gf(a.g.streaming.loadTimeout, l), 4);
          case 4:
            if ((n = a.U()) && (a.g.streaming.liveSync && a.g.streaming.liveSync.enabled || a.g.streaming.liveSync.panicMode) || a.g.streaming.vodDynamicPlaybackRate) q = function() {
              return or(a);
            }, a.j.o(d, "timeupdate", q);
            n || (r = function() {
              return pr(a);
            }, a.j.o(d, "timeupdate", r), pr(a));
            a.D && (a.D.onManifestUpdated(n), n && (u = a.ya().end, a.j.o(d, "progress", function() {
              var v = a.ya().end;
              u != v && (a.D.onManifestUpdated(a.U()), u = v);
            })));
            a.aa = true;
            H(w);
        }
      });
    }
    function tr(a) {
      var b = a.g.preferredAudioLanguage;
      b != "" && a.Fj(b, a.g.preferredVariantRole);
    }
    function vr(a) {
      var b = a.g.preferredTextLanguage;
      b != "" && a.ai(b, a.g.preferredTextRole, a.g.preferForcedSubs);
    }
    function br(a, b) {
      if (b.kind == "metadata") {
        b.mode = "hidden";
        a.j.o(b, "cuechange", function() {
          if (b.activeCues) {
            for (var d = t(b.activeCues), e = d.next(); !e.done; e = d.next()) if (e = e.value, Pq(a, e.startTime, e.endTime, e.type, e.value), a.D) a.D.onCueMetadataChange(e.value);
          }
          if (b.cues) {
            d = [];
            e = t(b.cues);
            for (var f = e.next(), g = {}; !f.done; g = { Jc: void 0 }, f = e.next()) g.Jc = f.value, g.Jc.type == "com.apple.quicktime.HLS" && g.Jc.startTime != null && (f = d.find(/* @__PURE__ */ function(h) {
              return function(k2) {
                return k2.startTime == h.Jc.startTime && k2.endTime == h.Jc.endTime;
              };
            }(g)), f || (f = { startTime: g.Jc.startTime, endTime: g.Jc.endTime, values: [] }, d.push(f)), f.values.push(g.Jc.value));
            d = t(d);
            for (e = d.next(); !e.done; e = d.next()) e = e.value, e.values.some(function(h) {
              return h.key == "X-ASSET-URI" || h.key == "X-ASSET-LIST";
            }) && a.D && (e.values.push({ key: "CUE", description: "", data: e.startTime != 0 || a.U() ? "ONCE" : "ONCE,PRE", mimeType: null, pictureType: null }), a.D.onHLSInterstitialMetadata(a, a.h, e));
          }
        });
        var c = new Cf(function() {
          var d = wr(a);
          d = t(d);
          for (var e = d.next(); !e.done; e = d.next()) e.value.mode = "hidden";
        }).La().Y(0.5);
        a.Ne.push(function() {
          c.stop();
        });
      }
    }
    function Gq(a, b, c) {
      b = (/* @__PURE__ */ new Map()).set("startTime", b.startTime).set("endTime", b.endTime).set("metadataType", b.schemeIdUri).set("payload", b.payload);
      a.dispatchEvent(tq(c, b));
    }
    function Pq(a, b, c, d, e) {
      a.Ia && (b = { schemeIdUri: d, startTime: b, endTime: c || Infinity, id: "", payload: e }, b.id = JSON.stringify(b), pm(a.Ia, b));
    }
    function cr(a, b) {
      if (b && b.kind == "chapters") {
        b.mode = "hidden";
        var c = new Cf(function() {
          b.mode = "hidden";
        }).La().Y(0.5);
        a.Ne.push(function() {
          c.stop();
        });
      }
    }
    p.bm = function() {
      for (var a = this.ea; a.g; ) a.release();
    };
    p.Bd = function(a) {
      return new Ch(a);
    };
    function mq(a, b) {
      function c(f) {
        b() ? b().dispatchEvent(f) : a.dispatchEvent(f);
      }
      function d(f) {
        b() ? no(b(), true, f) : f();
      }
      b || (b = function() {
        return null;
      });
      var e = new Wg(
        function(f, g, h, k2, l) {
          var m = b() ? b().j : a.A;
          m && m.segmentDownloaded(f, g, h, k2, l);
        },
        function(f, g, h) {
          g = (/* @__PURE__ */ new Map()).set("headers", f).set("request", g).set("requestType", h);
          c(tq("downloadheadersreceived", g));
          d(function() {
            if (a.sa) {
              var k2 = a.sa;
              if (k2.h.enabled) {
                var l = f["cmsd-static"];
                if (l) try {
                  var m = /* @__PURE__ */ new Map(), n = l.split(",");
                  for (l = 0; l < n.length; l++) {
                    var q = n[l].split("=");
                    m.set(q[0], gq(q[1]));
                  }
                } catch (y) {
                }
                if (m = f["cmsd-dynamic"]) {
                  a: {
                    try {
                      var r = /* @__PURE__ */ new Map(), u = m.split(";");
                      for (m = 1; m < u.length; m++) {
                        var w = u[m].split("=");
                        r.set(w[0], gq(w[1]));
                      }
                      var v = r;
                      break a;
                    } catch (y) {
                      v = null;
                      break a;
                    }
                    v = void 0;
                  }
                  v && (k2.g = v);
                }
              }
            }
          });
        },
        function(f, g) {
          f = (/* @__PURE__ */ new Map()).set("request", f).set("response", g);
          c(tq("downloadcompleted", f));
        },
        function(f, g, h, k2) {
          f = (/* @__PURE__ */ new Map()).set("request", f).set("error", g).set("httpResponseCode", h).set("aborted", k2);
          c(tq("downloadfailed", f));
        },
        function(f, g, h) {
          d(function() {
            var k2 = a.L, l = h;
            l = l === void 0 ? {} : l;
            if (k2.g.enabled) if (g.method === "HEAD") Cp(k2, g);
            else switch (f) {
              case 0:
                try {
                  if (k2.g.enabled) {
                    if (l.type) {
                      a: {
                        switch (l.type) {
                          case 4:
                            var m = k2.l ? qp : pp;
                            break a;
                          case 3:
                          case 2:
                            m = k2.l ? sp : rp;
                            break a;
                          case 5:
                            m = "s";
                            break a;
                        }
                        m = void 0;
                      }
                      k2.i = m;
                    }
                    Cp(k2, g, { ot: zp, su: !k2.A });
                  }
                } catch (O) {
                  cb("CMCD_MANIFEST_ERROR", "Could not generate manifest CMCD data.", O);
                }
                break;
              case gh:
                try {
                  if (k2.g.enabled) {
                    var n = g.uris[0], q = l.segment;
                    m = 0;
                    q && (m = q.endTime - q.startTime);
                    var r = { d: m * 1e3, st: k2.h.U() ? "l" : "v" };
                    r.ot = Gp(l);
                    var u = r.ot === Ip || r.ot === xp || r.ot === yp || r.ot === Jp, w = l.stream;
                    if (w) {
                      var v = k2.h.Ya();
                      if (u && (r.bl = Lp(k2, w.type), r.ot !== Jp)) {
                        var y = Mp(k2, w.type);
                        r.dl = v ? y / Math.abs(v) : y;
                      }
                      w.bandwidth && (r.br = w.bandwidth / 1e3);
                      if (w.segmentIndex && q) {
                        var z = w.segmentIndex.dc(q.endTime, true, v < 0);
                        if (z) {
                          var A = z.next().value;
                          if (A && A != q) {
                            if (n && !wd(q.T(), A.T())) {
                              var C = A.T()[0], D = new URL(C), F = new URL(n);
                              if (D.origin !== F.origin) var B = C;
                              else {
                                for (var E = D.pathname.split("/").slice(1), I = F.pathname.split("/").slice(1, -1); E[0] === I[0]; ) E.shift(), I.shift();
                                for (; I.length; ) I.shift(), E.unshift("..");
                                B = E.join("/");
                              }
                              r.nor = B;
                            }
                            if ((A.startByte || A.endByte) && (q.startByte != A.startByte || q.endByte != A.endByte)) {
                              var J = A.startByte + "-";
                              A.endByte && (J += A.endByte);
                              r.nrr = J;
                            }
                          }
                        }
                        var K = k2.h.Ya() || 1, L = Mp(k2, w.type) || 500, M = w.bandwidth;
                        var N = M ? M * (q.endTime - q.startTime) / 1e3 / (L / K / 1e3) * k2.g.rtpSafetyFactor : NaN;
                        isNaN(N) || (r.rtp = N);
                      }
                    }
                    u && r.ot !== Jp && (r.tb = aq(k2, r.ot) / 1e3);
                    Cp(k2, g, r);
                  }
                } catch (O) {
                  cb("CMCD_SEGMENT_ERROR", "Could not generate segment CMCD data.", O);
                }
                break;
              case 2:
              case 5:
              case 6:
                Cp(k2, g, { ot: "k" });
                break;
              case 4:
                Cp(k2, g, { ot: "o" });
            }
          });
        },
        function(f, g, h, k2) {
          (f = b() ? b().l : a.I) && f.banLocation && f.banLocation(k2);
        },
        function(f, g) {
          if (g.data) {
            g = g.data.byteLength;
            var h = b() ? b().getStats() : a.C;
            h && (ko(h, g), f === 0 && (h.ij = g));
          }
        }
      );
      e.configure(a.g.networking);
      return e;
    }
    function hr(a, b) {
      return new Ul(a.h, a.i, a.g.streaming, b, function() {
        a.Ob && hm(a.Ob, !a.G.Bi());
        a.l && a.l.qd();
        a.P && xr(a);
      }, function(c) {
        return a.dispatchEvent(c);
      });
    }
    function ir(a, b) {
      var c = a.U() || typeof b === "number" && b > 0;
      b = new Eo(a.Le, c);
      b.addEventListener("enter", function(f) {
        Qq(a, "timelineregionenter", f.region);
      });
      b.addEventListener("exit", function(f) {
        Qq(a, "timelineregionexit", f.region);
      });
      b.addEventListener("skip", function(f) {
        var g = f.region;
        f.seeking || (Qq(a, "timelineregionenter", g), Qq(a, "timelineregionexit", g));
      });
      var d = new Eo(a.Ia, c);
      d.addEventListener("enter", function(f) {
        Gq(a, f.region, "metadata");
      });
      c = new Eo(a.Za, c);
      c.addEventListener("enter", function(f) {
        f = (/* @__PURE__ */ new Map()).set(
          "detail",
          f.region.emsg
        );
        a.dispatchEvent(tq("emsg", f));
      });
      var e = new gm(a.h);
      e.g.add(b);
      e.g.add(d);
      e.g.add(c);
      a.Je && e.g.add(a.Je);
      return e;
    }
    function qr(a, b) {
      b = new Eo(a.Ia, b instanceof Date || b > 0);
      b.addEventListener("enter", function(d) {
        Gq(a, d.region, "metadata");
      });
      var c = new gm(a.h);
      c.g.add(b);
      return c;
    }
    function jr(a, b, c) {
      a.P = new vi();
      a.P.g = xi;
      yr(a);
      Dq(a);
      a.Ma = new Cf(function() {
        xr(a);
      });
      a.g.streaming.rebufferingGoal && a.Ma.za(0.25);
      a.j.o(b, "waiting", function() {
        return xr(a);
      });
      a.j.o(b, "canplaythrough", function() {
        return xr(a);
      });
      a.j.o(b, "playing", function() {
        return xr(a);
      });
      a.j.o(b, "seeked", function() {
        return xr(a);
      });
      c && (a.j.o(b, "stalled", function() {
        return xr(a);
      }), a.j.o(b, "progress", function() {
        return xr(a);
      }), a.j.o(b, "timeupdate", function() {
        return xr(a);
      }));
    }
    function yr(a) {
      var b = a.g.streaming.rebufferingGoal;
      a.P.i.set(wi, Math.min(0.5, b / 2)).set(xi, b);
    }
    function xr(a) {
      var b = a.H ? Fk(a.H) : false, c = a.isEnded() || b || a.G.ej(), d = Kj(a.h.buffered, a.h.currentTime);
      b = a.P;
      var e = b.i.get(b.g), f = b.g;
      c = c || d >= e && d > 0 ? wi : xi;
      b.g = c;
      (f = f != c) && c === wi && (b.h = Date.now());
      f && Dq(a);
    }
    function Uq(a, b, c, d, e) {
      return new yk(a, b, c, e, d);
    }
    function lq(a) {
      return new lp({ getBandwidthEstimate: function() {
        return a.A ? a.A.getBandwidthEstimate() : NaN;
      }, cc: function() {
        return a.cc();
      }, getCurrentTime: function() {
        return a.h ? a.h.currentTime : 0;
      }, Ya: function() {
        return a.Ya();
      }, Lb: function() {
        return a.Lb();
      }, rb: function() {
        return a.rb();
      }, U: function() {
        return a.U();
      }, uf: function() {
        return a.uf();
      } }, a.g.cmcd);
    }
    function gr(a) {
      return new Km(a.i, { gd: function() {
        return a.G ? a.G.Xe() : 0;
      }, getBandwidthEstimate: function() {
        return a.A.getBandwidthEstimate();
      }, Ya: function() {
        return a.Ya();
      }, video: a.h, ia: a.H, Bc: a.J, onError: function(b) {
        return Bq(a, b);
      }, onEvent: function(b) {
        return a.dispatchEvent(b);
      }, Rf: function(b, c, d) {
        var e = b.startTime;
        b = b.endTime;
        c = c.type;
        if (c != tc) {
          if (a.G) {
            a.G.qj();
            var f = Mk(a.H, c);
            !a.U() && a.h.paused && !a.h.seeking && f != null && f > 0 && a.G.Xe() < f && a.G.Ag(f);
          }
          xr(a);
        }
        d = (/* @__PURE__ */ new Map()).set("start", e).set("end", b).set(
          "contentType",
          c
        ).set("isMuxed", d);
        a.dispatchEvent(tq("segmentappended", d));
      }, Tl: function(b, c) {
        (c = c.Kd) && a.Je && km(a.Je, c, b);
      }, Ji: function(b, c) {
        var d = a.F;
        if (d.h.parseInbandPsshEnabled && !d.L && ["audio", "video"].includes(b)) {
          b = new Ah(Lb(c));
          c = 0;
          for (var e = t(b.data), f = e.next(); !f.done; f = e.next()) c += f.value.length;
          if (c == 0) d = Promise.resolve();
          else {
            c = new Uint8Array(c);
            e = 0;
            b = t(b.data);
            for (f = b.next(); !f.done; f = b.next()) f = f.value, c.set(f, e), e += f.length;
            Sh(d, "cenc", c);
            d = d.m;
          }
        } else d = Promise.resolve();
        return d;
      }, disableStream: function(b, c) {
        return a.disableStream(b, c);
      } });
    }
    p.configure = function(a, b) {
      arguments.length == 2 && typeof a == "string" && (a = Bn(a, b));
      a.streaming && "forceTransmuxTS" in a.streaming && (Wc("streaming.forceTransmuxTS configuration", "Please Use mediaSource.forceTransmux instead."), a.mediaSource = a.mediaSource || {}, a.mediaSource.mediaSource = a.streaming.forceTransmuxTS, delete a.streaming.forceTransmuxTS);
      a.streaming && "forceTransmux" in a.streaming && (Wc("streaming.forceTransmux configuration", "Please Use mediaSource.forceTransmux instead."), a.mediaSource = a.mediaSource || {}, a.mediaSource.mediaSource = a.streaming.forceTransmux, delete a.streaming.forceTransmux);
      if (a.streaming && "useNativeHlsOnSafari" in a.streaming) {
        Wc("streaming.useNativeHlsOnSafari configuration", "Please Use streaming.useNativeHlsForFairPlay or streaming.preferNativeHls instead.");
        var c = Sb();
        a.streaming.preferNativeHls = a.streaming.useNativeHlsOnSafari && c.Ga() === "WEBKIT";
        delete a.streaming.useNativeHlsOnSafari;
      }
      a.streaming && typeof a.streaming.liveSync == "boolean" && (Wc("streaming.liveSync", "Please Use streaming.liveSync.enabled instead."), c = a.streaming.liveSync, a.streaming.liveSync = {}, a.streaming.liveSync.enabled = c);
      if (a.streaming && !(a.streaming.liveSync && "targetLatency" in a.streaming.liveSync) && ("liveSyncMinLatency" in a.streaming || "liveSyncMaxLatency" in a.streaming)) {
        c = a.streaming.liveSyncMinLatency || 0;
        var d = Math.abs((a.streaming.liveSyncMaxLatency || 1) - c) / 2;
        a.streaming.liveSync = a.streaming.liveSync || {};
        a.streaming.liveSync.targetLatency = c + d;
        a.streaming.liveSync.targetLatencyTolerance = d;
      }
      a.streaming && "liveSyncMaxLatency" in a.streaming && (Wc("streaming.liveSyncMaxLatency", "Please Use streaming.liveSync.targetLatency and streaming.liveSync.targetLatencyTolerance instead. Or, set the values in your DASH manifest"), delete a.streaming.liveSyncMaxLatency);
      a.streaming && "liveSyncMinLatency" in a.streaming && (Wc("streaming.liveSyncMinLatency", "Please Use streaming.liveSync.targetLatency and streaming.liveSync.targetLatencyTolerance instead. Or, set the values in your DASH manifest"), delete a.streaming.liveSyncMinLatency);
      a.streaming && "liveSyncTargetLatency" in a.streaming && (Wc("streaming.liveSyncTargetLatency", "Please Use streaming.liveSync.targetLatency instead."), a.streaming.liveSync = a.streaming.liveSync || {}, a.streaming.liveSync.targetLatency = a.streaming.liveSyncTargetLatency, delete a.streaming.liveSyncTargetLatency);
      a.streaming && "liveSyncTargetLatencyTolerance" in a.streaming && (Wc("streaming.liveSyncTargetLatencyTolerance", "Please Use streaming.liveSync.targetLatencyTolerance instead."), a.streaming.liveSync = a.streaming.liveSync || {}, a.streaming.liveSync.targetLatencyTolerance = a.streaming.liveSyncTargetLatencyTolerance, delete a.streaming.liveSyncTargetLatencyTolerance);
      a.streaming && "liveSyncPlaybackRate" in a.streaming && (Wc("streaming.liveSyncPlaybackRate", "Please Use streaming.liveSync.maxPlaybackRate instead."), a.streaming.liveSync = a.streaming.liveSync || {}, a.streaming.liveSync.maxPlaybackRate = a.streaming.liveSyncPlaybackRate, delete a.streaming.liveSyncPlaybackRate);
      a.streaming && "liveSyncMinPlaybackRate" in a.streaming && (Wc("streaming.liveSyncMinPlaybackRate", "Please Use streaming.liveSync.minPlaybackRate instead."), a.streaming.liveSync = a.streaming.liveSync || {}, a.streaming.liveSync.minPlaybackRate = a.streaming.liveSyncMinPlaybackRate, delete a.streaming.liveSyncMinPlaybackRate);
      a.streaming && "liveSyncPanicMode" in a.streaming && (Wc("streaming.liveSyncPanicMode", "Please Use streaming.liveSync.panicMode instead."), a.streaming.liveSync = a.streaming.liveSync || {}, a.streaming.liveSync.panicMode = a.streaming.liveSyncPanicMode, delete a.streaming.liveSyncPanicMode);
      a.streaming && "liveSyncPanicThreshold" in a.streaming && (Wc(
        "streaming.liveSyncPanicThreshold",
        "Please Use streaming.liveSync.panicThreshold instead."
      ), a.streaming.liveSync = a.streaming.liveSync || {}, a.streaming.liveSync.panicThreshold = a.streaming.liveSyncPanicThreshold, delete a.streaming.liveSyncPanicThreshold);
      if (a.mediaSource && "sourceBufferExtraFeatures" in a.mediaSource) {
        Wc("mediaSource.sourceBufferExtraFeatures configuration", "Please Use mediaSource.addExtraFeaturesToSourceBuffer() instead.");
        var e = a.mediaSource.sourceBufferExtraFeatures;
        a.mediaSource.addExtraFeaturesToSourceBuffer = function() {
          return e;
        };
        delete a.mediaSource.sourceBufferExtraFeatures;
      }
      a.manifest && a.manifest.hls && "useSafariBehaviorForLive" in a.manifest.hls && (Wc("manifest.hls.useSafariBehaviorForLive configuration", "Please Use liveSync config to keep on live Edge instead."), delete a.manifest.hls.useSafariBehaviorForLive);
      a.streaming && "parsePrftBox" in a.streaming && (Wc("streaming.parsePrftBox configuration", "Now fired without needing a configuration."), delete a.streaming.parsePrftBox);
      a.manifest && a.manifest.dash && "enableAudioGroups" in a.manifest.dash && (Wc("manifest.dash.enableAudioGroups configuration", "It is now enabled by default and cannot be disabled."), delete a.manifest.dash.enableAudioGroups);
      a.streaming && "dispatchAllEmsgBoxes" in a.streaming && (Wc("streaming.dispatchAllEmsgBoxes configuration", "Please Use mediaSource.dispatchAllEmsgBoxes instead."), a.mediaSource = a.mediaSource || {}, a.mediaSource.dispatchAllEmsgBoxes = a.streaming.dispatchAllEmsgBoxes, delete a.streaming.dispatchAllEmsgBoxes);
      a.streaming && "autoLowLatencyMode" in a.streaming && (Wc("streaming.autoLowLatencyMode configuration", "Please Use streaming.lowLatencyMode instead."), a.streaming.lowLatencyMode = a.streaming.autoLowLatencyMode, delete a.streaming.autoLowLatencyMode);
      a.manifest && a.manifest.dash && "ignoreSupplementalCodecs" in a.manifest.dash && (Wc("manifest.dash.ignoreSupplementalCodecs configuration", "Please Use manifest.ignoreSupplementalCodecs instead."), a.manifest.ignoreSupplementalCodecs = a.manifest.dash.ignoreSupplementalCodecs, delete a.manifest.dash.ignoreSupplementalCodecs);
      a.manifest && a.manifest.hls && "ignoreSupplementalCodecs" in a.manifest.hls && (Wc("manifest.hls.ignoreSupplementalCodecs configuration", "Please Use manifest.ignoreSupplementalCodecs instead."), a.manifest.ignoreSupplementalCodecs = a.manifest.hls.ignoreSupplementalCodecs, delete a.manifest.hls.ignoreSupplementalCodecs);
      a.manifest && a.manifest.dash && "updatePeriod" in a.manifest.dash && (Wc("manifest.dash.updatePeriod configuration", "Please Use manifest.updatePeriod instead."), a.manifest.updatePeriod = a.manifest.dash.updatePeriod, delete a.manifest.dash.updatePeriod);
      a.manifest && a.manifest.hls && "updatePeriod" in a.manifest.hls && (Wc("manifest.hls.updatePeriod configuration", "Please Use manifest.updatePeriod instead."), a.manifest.updatePeriod = a.manifest.hls.updatePeriod, delete a.manifest.hls.updatePeriod);
      a.manifest && a.manifest.dash && "ignoreDrmInfo" in a.manifest.dash && (Wc("manifest.dash.ignoreDrmInfo configuration", "Please Use manifest.ignoreDrmInfo instead."), a.manifest.ignoreDrmInfo = a.manifest.dash.ignoreDrmInfo, delete a.manifest.dash.ignoreDrmInfo);
      if (a.drm && a.drm.advanced) {
        c = false;
        for (var f in a.drm.advanced) {
          var g = a.drm.advanced[f];
          d = g.videoRobustness;
          g = g.audioRobustness;
          "videoRobustness" in a.drm.advanced[f] && !Array.isArray(a.drm.advanced[f].videoRobustness) && (a.drm.advanced[f].videoRobustness = [d], c = true);
          "audioRobustness" in a.drm.advanced[f] && !Array.isArray(a.drm.advanced[f].audioRobustness) && (a.drm.advanced[f].audioRobustness = [g], c = true);
        }
        c && Wc("AdvancedDrmConfiguration's videoRobustness and audioRobustness", "These properties are no longer strings but array of strings, please update your usage of these properties.");
      }
      a.streaming && "forceHTTP" in a.streaming && (Wc("streaming.forceHTTP configuration", "Please Use networking.forceHTTP instead."), a.networking = a.networking || {}, a.networking.forceHTTP = a.streaming.forceHTTP, delete a.streaming.forceHTTP);
      a.streaming && "forceHTTPS" in a.streaming && (Wc("streaming.forceHTTPS configuration", "Please Use networking.forceHTTP instead."), a.networking = a.networking || {}, a.networking.forceHTTPS = a.streaming.forceHTTPS, delete a.streaming.forceHTTPS);
      a.streaming && "minBytesForProgressEvents" in a.streaming && (Wc("streaming.minBytesForProgressEvents configuration", "Please Use networking.minBytesForProgressEvents instead."), a.networking = a.networking || {}, a.networking.minBytesForProgressEvents = a.streaming.minBytesForProgressEvents, delete a.streaming.minBytesForProgressEvents);
      f = $n(this.g, a, kq(this));
      zr(this);
      return f;
    };
    p.vk = function(a) {
      this.Dg = a;
    };
    function zr(a) {
      a.Pe = new yi(a.g, a.ua, a.F);
      if (a.I) {
        var b = Hd(a.g.manifest);
        a.h && a.h.nodeName === "AUDIO" && (b.disableVideo = true);
        a.I.configure(b);
      }
      a.F && a.F.configure(a.g.drm);
      if (a.l) {
        a.l.configure(a.g.streaming);
        try {
          a.m != uq && Ai(a.Pe, a.i) && $q(a);
        } catch (c) {
          Bq(a, c);
        }
        a.A && dr(a);
        b = a.l.u;
        !b || b.allowedByApplication && b.allowedByKeySystem || qq(a);
      }
      a.J && a.J.configure(a.g.networking);
      a.H && (a.H.configure(a.g.mediaSource), a.H.Ia = a.g.manifest.segmentRelativeVttTiming);
      a.u && Tq(a);
      a.A && (a.A.configure(a.g.abr), a.g.abr.enabled ? a.A.enable() : a.A.disable(), nr(a));
      a.P && yr(a);
      a.Ma && (a.g.streaming.rebufferingGoal ? a.Ma.za(0.25) : a.Ma.stop());
      a.i && er(a.i.presentationTimeline, a.g.playRangeStart, a.g.playRangeEnd);
      a.D && a.D.configure(a.g.ads);
      a.L && a.L.configure(a.g.cmcd);
      a.sa && a.sa.configure(a.g.cmsd);
      a.va && a.va.configure(a.g.queue);
    }
    p.getConfiguration = function() {
      var a = kq(this);
      $n(a, this.g, kq(this));
      return a;
    };
    p.Hk = function() {
      return this.Dg;
    };
    p.Zi = function() {
      var a = kq(this);
      $n(a, this.g, kq(this));
      return Dn(this.g, kq(this));
    };
    p.Wi = function() {
      if (this.h) {
        var a = this.h.buffered.length;
        a = a ? this.h.buffered.end(a - 1) : 0;
        var b = this.getConfiguration().streaming.bufferingGoal;
        b = Math.min(this.h.currentTime + b, this.ya().end);
        if (a >= b) return 1;
        if (!(a <= this.h.currentTime) && a < b) return (a - this.h.currentTime) / (b - this.h.currentTime);
      }
      return 0;
    };
    p.Aj = function() {
      for (var a in this.g) delete this.g[a];
      $n(this.g, kq(this), kq(this));
      zr(this);
    };
    p.Rk = function() {
      return this.m;
    };
    p.rh = function() {
      return this.i ? this.i.type : null;
    };
    p.Yk = function() {
      return this.h;
    };
    p.Lb = function() {
      return this.J;
    };
    p.ed = function() {
      return this.V;
    };
    p.rf = function() {
      return this.D ? this.D : null;
    };
    p.uh = function() {
      return this.va ? this.va : null;
    };
    p.U = function() {
      return this.i && !this.Da() ? this.i.presentationTimeline.U() : this.h && (this.h.src || this.Da()) ? this.h.duration == Infinity : false;
    };
    p.kd = function() {
      return this.i ? this.i.presentationTimeline.kd() : false;
    };
    p.Hd = function() {
      if (this.i && !this.Da()) {
        var a = this.i.variants;
        return a.length ? !a[0].video : false;
      }
      return this.h && (this.h.src || this.Da()) ? this.h.videoTracks ? this.h.videoTracks.length == 0 : this.h.videoHeight == 0 : false;
    };
    p.Hh = function() {
      if (this.i && !this.Da()) {
        var a = this.i.variants;
        if (!a.length) return false;
        a = a[0];
        return a.audio || !a.video ? false : !a.video.codecs.includes(",");
      }
      return this.h && (this.h.src || this.Da()) && this.h.audioTracks ? this.h.audioTracks.length == 0 : false;
    };
    p.ya = function() {
      if (this.i && !this.Da()) {
        if (!this.aa && this.i.type == "HLS") return { start: 0, end: 0 };
        var a = this.i.presentationTimeline;
        return { start: a.ec(), end: a.Mb() };
      }
      if (this.h && (this.h.src || this.Da()) && (a = this.h.seekable) && a.length) {
        var b = this.g ? this.g.playRangeStart : 0;
        b = Math.max(a.start(0), b);
        var c = this.g ? this.g.playRangeEnd : Infinity;
        a = Math.min(a.end(a.length - 1), c);
        return { start: b, end: a };
      }
      return { start: 0, end: 0 };
    };
    p.yl = function() {
      this.U() && (this.h.currentTime = this.ya().end);
    };
    p.Cl = function() {
      return this.aa;
    };
    p.keySystem = function() {
      var a = this.drmInfo();
      return a ? a.keySystem : "";
    };
    p.drmInfo = function() {
      return this.F ? this.F.g : null;
    };
    p.ke = function() {
      return this.F ? this.F.ke() : Infinity;
    };
    p.mh = function() {
      return this.F ? this.F.mh() : [];
    };
    p.tf = function() {
      return this.F ? this.F.tf() : {};
    };
    p.Bf = function() {
      return this.P ? this.P.g == xi : !!this.V;
    };
    p.Ya = function() {
      return this.h ? this.K ? this.K.i : 1 : 0;
    };
    p.zi = function(a) {
      this.m == Xq && this.l && Wm(this.l, a);
    };
    p.Xc = function(a, b) {
      b = b === void 0 ? true : b;
      a == 0 ? bb("A trick play rate of 0 is unsupported!") : (this.K.set(a), this.m == Xq && (this.A.playbackRateChanged(a), this.zi(b && a != 1)), Yq(this, a));
    };
    p.zd = function() {
      var a = this.K.fd();
      this.m == ar && this.K.set(a);
      this.m == Xq && (this.K.set(a), this.A.playbackRateChanged(a), this.zi(false));
      this.kc.Ta();
    };
    p.rb = function() {
      if (this.i && !this.Da()) {
        for (var a = this.l ? this.l.u : null, b = [], c = 0, d = t(this.i.variants), e = d.next(); !e.done; e = d.next()) if (e = e.value, kg(e)) {
          var f = cg(e);
          f.active = e == a;
          f.active || c == 1 || a == null || e.video != a.video || e.audio != a.audio || (f.active = true);
          f.active && c++;
          b.push(f);
        }
        return b;
      }
      if (this.h && this.h.audioTracks) {
        var g = Ar(this);
        a = Array.from(this.h.audioTracks);
        return a.length ? a.map(function(h) {
          return jg(h, g);
        }) : g ? [jg(null, g)] : [];
      }
      return [];
    };
    p.vc = function() {
      if (this.i) {
        if (this.Da()) return [];
        for (var a = this.l ? this.l.C : null, b = [], c = t(this.i.textStreams), d = c.next(); !d.done; d = c.next()) {
          d = d.value;
          var e = dg(d);
          e.active = d == a;
          b.push(e);
        }
        return b;
      }
      return this.h && this.h.src && this.h.textTracks ? rr(this).map(function(f) {
        return ig(f);
      }) : [];
    };
    p.ph = function() {
      var a = this.Ve;
      this.i && (a = this.i.imageStreams);
      return a.map(function(b) {
        return eg(b);
      });
    };
    p.yk = function(a) {
      var b = this, c, d;
      return P(function(e) {
        if (e.g == 1) return G(e, Br(b, a), 2);
        c = e.h;
        if (!c) return e.return(null);
        d = [];
        c.segmentIndex.Kb(function(f) {
          var g = Cr(f.tilesLayout || c.tilesLayout);
          if (g) for (var h = g.rows * g.columns, k2 = f.j - f.startTime, l = 0; l < h; l++) {
            var m = Dr(f, c, f.startTime + k2 * l / h, g);
            d.push(m);
          }
        });
        c.closeSegmentIndex && c.closeSegmentIndex();
        return e.return(d);
      });
    };
    function Cr(a) {
      return a ? (a = /(\d+)x(\d+)/.exec(a)) ? { columns: parseInt(a[1], 10), rows: parseInt(a[2], 10) } : null : null;
    }
    p.$i = function(a, b) {
      var c = this, d, e, f, g;
      return P(function(h) {
        if (h.g == 1) return G(h, Br(c, a), 2);
        d = h.h;
        if (!d) return h.return(null);
        e = d.segmentIndex.find(b);
        if (e == null) return h.return(null);
        f = d.segmentIndex.get(e);
        return (g = Cr(f.tilesLayout || d.tilesLayout)) ? h.return(Dr(f, d, b, g)) : h.return(null);
      });
    };
    function Br(a, b) {
      var c, d;
      return P(function(e) {
        if (e.g == 1) {
          if (a.m != Xq && a.m != ar) return e.return(null);
          c = a.Ve;
          a.i && (c = a.i.imageStreams);
          d = c[0];
          if (!d) return e.return(null);
          b != null && (d = c.find(function(f) {
            return f.id == b;
          }));
          return d ? d.segmentIndex ? e.B(2) : G(e, d.createSegmentIndex(), 2) : e.return(null);
        }
        return e.return(d);
      });
    }
    function Dr(a, b, c, d) {
      var e = b.width || 0, f = b.height || 0, g = e / d.columns, h = f / d.rows, k2 = d.columns * d.rows, l = a.j - a.startTime;
      l = a.D || l / k2;
      var m = a.startTime, n = 0, q = 0;
      k2 > 1 && (q = Math.floor((c - a.startTime) / l), m = a.startTime + q * l, n = q % d.columns * g, q = Math.floor(q / d.columns) * h);
      d = false;
      if (c = a.thumbnailSprite) d = true, h = c.height, n = c.positionX, q = c.positionY, g = c.width;
      return { segment: a, imageHeight: f, imageWidth: e, height: h, positionX: n, positionY: q, startTime: m, duration: l, uris: a.T(), startByte: a.Nc(), endByte: a.Lc(), width: g, sprite: d, mimeType: a.mimeType || b.mimeType, codecs: a.codecs || b.codecs };
    }
    p.fg = function(a) {
      function b() {
        var d = c.i.textStreams.find(function(e) {
          return e.id == a.id;
        });
        d && d != c.l.C && (fo(c.C.h, d, false), Zm(c.l, d), Zq(c), mr(c), c.Sd = d.language);
      }
      var c = this;
      if (this.i && this.G && (b(), !this.Da())) return;
      (function() {
        if (c.h && c.h.textTracks) {
          var d = rr(c), e = d.find(function(h) {
            return gg(h) === a.id;
          });
          if (e) {
            if (c.u instanceof Wo) {
              d = t(d);
              for (var f = d.next(); !f.done; f = d.next()) {
                f = f.value;
                var g = f === e ? c.Z ? "showing" : "hidden" : "disabled";
                f.mode !== g && (f.mode = g);
              }
            } else d = d.find(function(h) {
              return h.mode !== "disabled";
            }), d !== e && (d && (d.mode = "disabled", c.j.Ea(d, "cuechange"), c.u.remove(0, Infinity)), e && ur(c, e));
            Zq(c);
            mr(c);
          }
        }
      })();
    };
    function ur(a, b) {
      a.j.o(b, "cuechange", function() {
        a.u.remove(0, Math.max(0, a.h.currentTime - a.g.streaming.bufferBehind));
        var c = { periodStart: 0, segmentStart: 0, segmentEnd: a.h.duration, vttOffset: 0 }, d = [], e = Array.from(b.activeCues || []);
        e = t(e);
        for (var f = e.next(); !f.done; f = e.next()) {
          f = f.value;
          if (f.endTime === Infinity || f.endTime < f.startTime) f = null;
          else {
            var g = new se(f.startTime, f.endTime, f.text);
            g.line = typeof f.line === "number" ? f.line : null;
            f.lineAlign && (g.lineAlign = f.lineAlign);
            g.lineInterpretation = f.snapToLines ? xe : 1;
            g.position = typeof f.position === "number" ? f.position : null;
            f.positionAlign && (g.positionAlign = f.positionAlign);
            g.size = f.size;
            g.textAlign = f.align;
            f.vertical === "lr" ? g.writingMode = "vertical-lr" : f.vertical === "rl" && (g.writingMode = "vertical-rl");
            f.region && (g.region.id = f.region.id, g.region.height = f.region.lines, g.region.heightUnits = 2, g.region.regionAnchorX = f.region.regionAnchorX, g.region.regionAnchorY = f.region.regionAnchorY, g.region.scroll = f.region.scroll, g.region.viewportAnchorX = f.region.viewportAnchorX, g.region.viewportAnchorY = f.region.viewportAnchorY, g.region.viewportAnchorUnits = rd, g.region.width = f.region.width, g.region.widthUnits = rd);
            Fe(g);
            f = g;
          }
          f && ((g = a.g.mediaSource.modifyCueCallback) && g(f, null, c), d.push(f));
        }
        a.u.append(d);
      });
      b.mode = document.pictureInPictureElement ? "showing" : "hidden";
    }
    p.De = function(a, b, c) {
      function d() {
        var f = e.i.variants.find(function(h) {
          return h.id == a.id;
        });
        if (f && kg(f)) {
          var g = e.l.u;
          e.g.abr.enabled && (g.video != f.video || g.audio && f.audio && g.audio.language == f.audio.language && g.audio.channelsCount == f.audio.channelsCount && g.audio.label == f.audio.label) && bb("Changing tracks while abr manager is enabled will likely result in the selected track being overridden. Consider disabling abr before calling selectVariantTrack().");
          e.Da() ? fr(e, f, false, false, 0) : fr(e, f, false, b || false, c || 0);
          e.M.configure({
            language: f.language,
            role: f.audio && f.audio.roles && f.audio.roles[0] || "",
            channelCount: f.audio && f.audio.channelsCount ? f.audio.channelsCount : 0,
            Qc: f.video && f.video.hdr ? f.video.hdr : "",
            spatialAudio: f.audio && f.audio.spatialAudio ? f.audio.spatialAudio : false,
            videoLayout: f.video && f.video.videoLayout ? f.video.videoLayout : "",
            Zc: f.audio && f.audio.label ? f.audio.label : "",
            Yd: "",
            codecSwitchingStrategy: e.g.mediaSource.codecSwitchingStrategy,
            audioCodec: f.audio && f.audio.codecs ? f.audio.codecs : "",
            ae: g.audio && g.audio.codecs ? g.audio.codecs : "",
            $e: g.audio && g.audio.channelsCount ? g.audio.channelsCount : 0,
            preferredAudioCodecs: e.g.preferredAudioCodecs,
            preferredAudioChannelCount: e.g.preferredAudioChannelCount
          });
          dr(e);
        }
      }
      var e = this;
      b = b === void 0 ? false : b;
      c = c === void 0 ? 0 : c;
      if (this.i && this.G && (d(), !this.Da())) return;
      (function() {
        if (a.originalAudioId && e.h && e.h.audioTracks) {
          var f = Array.from(e.h.audioTracks);
          f = t(f);
          for (var g = f.next(); !g.done; g = f.next()) if (g = g.value, gg(g) == a.id) {
            Er(e, g);
            break;
          }
        }
      })();
    };
    p.Gj = function(a, b) {
      function c() {
        var e = d.M.getConfiguration();
        e.audioCodec = a.codecs || "";
        e.Zc = a.label || "";
        e.channelCount = a.channelsCount || 0;
        e.language = a.language;
        e.role = a.roles[0] || "";
        e.spatialAudio = a.spatialAudio;
        d.M.configure(e);
        qq(d, true, b, false, false);
      }
      var d = this;
      b = b === void 0 ? 0 : b;
      if (this.i && this.G && (c(), !this.Da())) return;
      (function() {
        if (d.h && d.h.audioTracks) {
          var e = zc(a.language), f = Array.from(d.h.audioTracks), g = null;
          f = t(f);
          for (var h = f.next(); !h.done; h = f.next()) {
            h = h.value;
            var k2 = h.language || "und";
            if (h.label == a.label && zc(k2) == e && h.kind == a.roles[0]) {
              g = h;
              break;
            }
          }
          g && Er(d, g);
        }
      })();
    };
    p.getAudioTracks = function() {
      if (this.i && !this.Da()) {
        var a = this.rb();
        if (!a.length) return [];
        var b = a.find(function(f) {
          return f.active;
        });
        if (!b) return [];
        var c = a;
        this.m != Xq || this.Da() || (c = a.filter(function(f) {
          return f.originalVideoId === b.originalVideoId && f.audioCodec;
        }));
        if (!c.length) return [];
        a = /* @__PURE__ */ new Map();
        c = t(c);
        for (var d = c.next(); !d.done; d = c.next()) {
          d = d.value;
          var e = d.originalAudioId;
          e || d.audioId == null || (e = String(d.audioId));
          e && a.set(e, {
            active: d.active,
            language: d.language,
            label: d.label,
            mimeType: d.audioMimeType,
            codecs: d.audioCodec,
            primary: d.primary,
            roles: d.audioRoles || [],
            accessibilityPurpose: d.accessibilityPurpose,
            channelsCount: d.channelsCount,
            audioSamplingRate: d.audioSamplingRate,
            spatialAudio: d.spatialAudio,
            originalLanguage: d.originalLanguage
          });
        }
        return Array.from(a.values());
      }
      return this.h && this.h.audioTracks ? Array.from(this.h.audioTracks).map(function(f) {
        var g = f.language;
        g = {
          active: f.enabled,
          language: zc(g || "und"),
          label: f.label,
          mimeType: null,
          codecs: null,
          primary: f.kind == "main",
          roles: [],
          accessibilityPurpose: null,
          channelsCount: null,
          audioSamplingRate: null,
          spatialAudio: false,
          originalLanguage: g
        };
        f.kind && g.roles.push(f.kind);
        f.configuration && (f.configuration.codec && (g.codecs = f.configuration.codec), f.configuration.sampleRate && (g.audioSamplingRate = f.configuration.sampleRate), f.configuration.numberOfChannels && (g.channelsCount = f.configuration.numberOfChannels));
        return g;
      }) : [];
    };
    p.Hj = function(a, b, c) {
      b = b === void 0 ? false : b;
      c = c === void 0 ? 0 : c;
      var d = this.rb();
      if (d.length) {
        var e = d.find(function(f) {
          return f.active;
        });
        e && (d = d.find(function(f) {
          return f.audioId === e.audioId && (f.videoBandwidth || f.bandwidth) == a.bandwidth && f.width == a.width && f.height == a.height && f.frameRate == a.frameRate && f.pixelAspectRatio == a.pixelAspectRatio && f.hdr == a.hdr && f.colorGamut == a.colorGamut && f.videoLayout == a.videoLayout && f.videoMimeType == a.mimeType && f.videoCodec == a.codecs;
        })) && !d.active && this.De(d, b, c);
      }
    };
    p.getVideoTracks = function() {
      if (this.m == ar || this.Da()) return [];
      var a = this.rb();
      if (!a.length) return [];
      var b = a.find(function(f) {
        return f.active;
      });
      if (!b) return [];
      var c = a.filter(function(f) {
        return f.originalAudioId === b.originalAudioId && f.audioId === b.audioId && f.audioGroupId === b.audioGroupId && f.videoCodec;
      });
      if (!c.length) return [];
      a = /* @__PURE__ */ new Map();
      c = t(c);
      for (var d = c.next(); !d.done; d = c.next()) {
        d = d.value;
        var e = d.originalVideoId;
        e || d.videoId == null || (e = String(d.videoId));
        e && a.set(e, { active: d.active, bandwidth: d.videoBandwidth || d.bandwidth, width: d.width, height: d.height, frameRate: d.frameRate, pixelAspectRatio: d.pixelAspectRatio, hdr: d.hdr, colorGamut: d.colorGamut, videoLayout: d.videoLayout, mimeType: d.videoMimeType, codecs: d.videoCodec });
      }
      return Array.from(a.values());
    };
    p.Ak = function() {
      return Fr(this.rb());
    };
    p.kl = function() {
      return Fr(this.vc());
    };
    p.zk = function() {
      return Array.from(Gr(this.rb()));
    };
    p.jl = function() {
      return Array.from(Gr(this.vc()));
    };
    p.Fj = function(a, b, c, d, e, f, g) {
      function h() {
        function l(u, w) {
          return u.video || w.video ? u.video && w.video ? Math.abs((u.video.height || 0) - (w.video.height || 0)) + Math.abs((u.video.width || 0) - (w.video.width || 0)) : Infinity : 0;
        }
        var m = k2.l.u;
        k2.M = k2.g.adaptationSetCriteriaFactory();
        k2.M.configure({ language: a, role: b || "", channelCount: c || 0, Qc: "", spatialAudio: f || false, videoLayout: "", Zc: g || "", Yd: "", codecSwitchingStrategy: k2.g.mediaSource.codecSwitchingStrategy, audioCodec: e || "", ae: m.audio && m.audio.codecs ? m.audio.codecs : "", $e: m.audio && m.audio.channelsCount ? m.audio.channelsCount : 0, preferredAudioCodecs: k2.g.preferredAudioCodecs, preferredAudioChannelCount: k2.g.preferredAudioChannelCount });
        var n = k2.M.create(k2.i.variants), q = null;
        n = t(n.values());
        for (var r = n.next(); !r.done; r = n.next()) r = r.value, kg(r) && (!q || l(q, m) > l(r, m)) && (q = r);
        q != m && (q ? (m = cg(q), k2.De(m, true, d || 0)) : qq(k2));
      }
      var k2 = this;
      c = c === void 0 ? 0 : c;
      d = d === void 0 ? 0 : d;
      e = e === void 0 ? "" : e;
      f = f === void 0 ? false : f;
      g = g === void 0 ? "" : g;
      if (this.i && this.G && (h(), !this.Da())) return;
      (function() {
        if (k2.h && k2.h.audioTracks) {
          var l = mg(k2.rb(), a, b || "", false)[0];
          l && k2.De(l);
        }
      })();
    };
    p.ai = function(a, b, c) {
      function d() {
        e.Sd = a;
        e.Zd = b || "";
        e.Oe = c || false;
        var f = mg(e.i.textStreams, e.Sd, e.Zd, e.Oe)[0] || null;
        f && f != e.l.C && (fo(e.C.h, f, false), e.g.streaming.alwaysStreamText || e.ld()) && (Zm(e.l, f), Zq(e), mr(e));
      }
      var e = this;
      c = c === void 0 ? false : c;
      if (this.i && this.G && (d(), !this.Da())) return;
      (function() {
        var f = mg(e.vc(), a, b || "", c || false)[0];
        f && e.fg(f);
      })();
    };
    p.om = function(a, b, c) {
      function d() {
        for (var f = null, g = t(e.i.variants), h = g.next(); !h.done; h = g.next()) if (h = h.value, h.audio.label == a) {
          f = h;
          break;
        }
        f != null && (e.M = e.g.adaptationSetCriteriaFactory(), e.M.configure({ language: f.language, role: "", channelCount: 0, Qc: "", spatialAudio: false, videoLayout: "", Yd: "", Zc: a, codecSwitchingStrategy: e.g.mediaSource.codecSwitchingStrategy, audioCodec: "", ae: "", $e: 0, preferredAudioCodecs: e.g.preferredAudioCodecs, preferredAudioChannelCount: e.g.preferredAudioChannelCount }), qq(e, b, c));
      }
      var e = this;
      b = b === void 0 ? true : b;
      c = c === void 0 ? 0 : c;
      if (this.i && this.G && (d(), !this.Da())) return;
      (function() {
        if (e.h && e.h.audioTracks) {
          var f = Array.from(e.h.audioTracks), g = null;
          f = t(f);
          for (var h = f.next(); !h.done; h = f.next()) h = h.value, h.label == a && (g = h);
          g && Er(e, g);
        }
      })();
    };
    p.ld = function() {
      var a = this.Z;
      return this.u ? this.u.isTextVisible() : a;
    };
    p.Ek = function() {
      return this.fb.map(function(a) {
        return dg(a);
      });
    };
    p.Dk = function(a) {
      Wc("getChapters", "Please use an getChaptersAsync.");
      if (!this.fb.length) return [];
      var b = zc(a);
      a = this.fb.filter(function(f) {
        return zc(f.language) == b;
      });
      if (!a.length) return [];
      var c = [], d = /* @__PURE__ */ new Set();
      a = t(a);
      for (var e = a.next(); !e.done; e = a.next()) e = e.value, e.segmentIndex && e.segmentIndex.Kb(function(f) {
        var g = f.T()[0], h = f.startTime + "-" + f.endTime + "-" + g;
        f = { id: h, title: g, startTime: f.startTime, endTime: f.endTime };
        d.has(h) || (c.push(f), d.add(h));
      });
      return c;
    };
    p.nh = function(a) {
      var b = this, c, d, e, f, g, h, k2;
      return P(function(l) {
        switch (l.g) {
          case 1:
            if (!b.fb.length) return l.return([]);
            c = zc(a);
            d = b.fb.filter(function(m) {
              return zc(m.language) == c;
            });
            if (!d.length) return l.return([]);
            e = [];
            f = /* @__PURE__ */ new Set();
            g = t(d);
            h = g.next();
          case 2:
            if (h.done) {
              l.B(4);
              break;
            }
            k2 = h.value;
            if (k2.segmentIndex) {
              l.B(5);
              break;
            }
            return G(l, k2.createSegmentIndex(), 5);
          case 5:
            k2.segmentIndex.Kb(function(m) {
              var n = m.T()[0], q = m.startTime + "-" + m.endTime + "-" + n;
              m = { id: q, title: n, startTime: m.startTime, endTime: m.endTime };
              f.has(q) || (e.push(m), f.add(q));
            });
            h = g.next();
            l.B(2);
            break;
          case 4:
            return l.return(e);
        }
      });
    };
    function rr(a) {
      return Array.from(a.h.textTracks).filter(function(b) {
        return b.kind != "metadata" && b.kind != "chapters" && b.label != "Shaka Player TextTrack";
      });
    }
    function sr(a) {
      return Array.from(a.h.textTracks).find(function(b) {
        return b.label == "Shaka Player TextTrack";
      });
    }
    function wr(a) {
      return Array.from(a.h.textTracks).filter(function(b) {
        return b.kind == "metadata";
      });
    }
    p.Fe = function(a) {
      a = !!a;
      this.Z != a && (this.Z = a, this.m == Xq ? (this.u.setTextVisibility(a), this.g.streaming.alwaysStreamText || (a ? this.l.C || (a = mg(this.i.textStreams, this.Sd, this.Zd, this.Oe), a.length > 0 && (Zm(this.l, a[0]), Zq(this), mr(this))) : Vm(this.l))) : this.h && this.h.src && this.h.textTracks && this.u.setTextVisibility(a), lr(this));
    };
    p.Zk = function() {
      if (this.G) var a = this.G.Xe();
      else {
        if (this.O == null) return /* @__PURE__ */ new Date();
        if (this.O instanceof Date) return this.O;
        a = this.O;
      }
      if (this.i && !this.Da()) {
        var b = this.i.presentationTimeline;
        return new Date(((b.m || b.i) + a) * 1e3);
      }
      return this.h && this.h.getStartDate ? (b = this.h.getStartDate(), isNaN(b.getTime()) ? null : new Date(b.getTime() + a * 1e3)) : null;
    };
    p.sh = function() {
      if (this.i && !this.Da()) {
        var a = this.i.presentationTimeline;
        a = a.m || a.i;
        return a === null ? null : new Date(a * 1e3);
      }
      return this.h && this.h.getStartDate ? (a = this.h.getStartDate(), isNaN(a.getTime()) ? null : a) : null;
    };
    p.wf = function() {
      return this.U() ? this.i ? this.i.presentationTimeline.wf() : null : null;
    };
    p.cc = function() {
      if (this.m == Xq) return this.H.cc();
      var a = { total: [], audio: [], video: [], text: [] };
      this.m == ar && (a.total = Lj(this.h.buffered));
      return a;
    };
    p.uf = function() {
      if (!this.h || !this.h.currentTime) return null;
      var a = this.sh().getTime() + this.h.currentTime * 1e3;
      return Math.floor(Date.now() - a);
    };
    p.getStats = function() {
      if (this.m != Xq && this.m != ar) return {
        width: NaN,
        height: NaN,
        currentCodecs: "",
        streamBandwidth: NaN,
        decodedFrames: NaN,
        droppedFrames: NaN,
        corruptedFrames: NaN,
        stallsDetected: NaN,
        gapsJumped: NaN,
        estimatedBandwidth: NaN,
        completionPercent: NaN,
        loadLatency: NaN,
        manifestTimeSeconds: NaN,
        drmTimeSeconds: NaN,
        playTime: NaN,
        pauseTime: NaN,
        bufferingTime: NaN,
        licenseTime: NaN,
        liveLatency: NaN,
        maxSegmentDuration: NaN,
        manifestSizeBytes: NaN,
        bytesDownloaded: NaN,
        nonFatalErrorCount: NaN,
        manifestPeriodCount: NaN,
        manifestGapCount: NaN,
        switchHistory: [],
        stateHistory: []
      };
      Wq(this);
      var a = this.h, b = a.currentTime / a.duration;
      isNaN(b) || this.U() || jo(this.C, Math.round(100 * b));
      this.G && (this.C.R = this.G.Ai(), this.C.S = this.G.Ci());
      a.getVideoPlaybackQuality && (b = a.getVideoPlaybackQuality(), ho(this.C, Number(b.droppedVideoFrames), Number(b.totalVideoFrames)), this.C.M = Number(b.corruptedVideoFrames));
      this.C.u = this.F ? ci(this.F) : NaN;
      io(this.C, a.videoWidth || NaN, a.videoHeight || NaN);
      this.C.l = "";
      this.U() && this.sh() != null && (a = this.uf() || 0, this.C.F = a / 1e3);
      b = this.rb().find(function(e) {
        return e.active;
      });
      a = this.vc().find(function(e) {
        return e.active;
      });
      if (b) {
        if (b.bandwidth) {
          var c = this.K ? this.K.i : 1, d = c * b.bandwidth;
          a && a.bandwidth && (d += c * a.bandwidth);
          this.C.C = d;
        }
        b.width && b.height && io(this.C, b.width || NaN, b.height || NaN);
        b = b.codecs;
        a && (b += "," + (a.codecs || a.mimeType));
        b && (this.C.l = b);
      }
      this.m != Xq || this.Da() || (this.i && (this.C.I = this.i.periodCount, this.C.H = this.i.gapCount, this.i.presentationTimeline && (this.C.K = this.i.presentationTimeline.h)), a = this.A.getBandwidthEstimate(), this.C.A = a);
      this.m == ar && ko(this.C, NaN);
      return lo(this.C);
    };
    p.be = function(a, b, c, d, e, f, g) {
      g = g === void 0 ? false : g;
      var h = this, k2, l, m, n, q, r, u, w, v, y, z, A;
      return P(function(C) {
        switch (C.g) {
          case 1:
            if (h.m != Xq && h.m != ar) throw new U(1, 7, 7004);
            c != "subtitles" && c != "captions" && bb("Using a kind value different of `subtitles` or `captions` can cause unwanted issues.");
            if (d) {
              C.B(2);
              break;
            }
            return G(C, Hr(h, a), 3);
          case 3:
            d = C.h;
          case 2:
            k2 = [];
            h.D && (k2 = h.D.getCuePoints());
            if (h.m != ar) {
              C.B(4);
              break;
            }
            l = Sb();
            g && l.Ga() === "WEBKIT" && (c = "forced");
            return G(C, Ir(h, a, b, c, d, f || "", k2), 5);
          case 5:
            m = C.h;
            if (m.track) return $q(h), C.return(ig(m.track));
            throw new U(1, 2, 2012);
          case 4:
            n = vc;
            q = h.ya();
            r = q.end - q.start;
            h.i && (r = h.i.presentationTimeline.getDuration());
            if (r == Infinity) throw new U(1, 4, 4033);
            if (!k2.length) {
              C.B(6);
              break;
            }
            return G(C, Jr(h, a, h.J, h.g.streaming.retryParameters), 7);
          case 7:
            u = C.h, w = Kr(h, u, d, k2), v = new Blob([w], { type: "text/vtt" }), a = Bk(v), d = "text/vtt";
          case 6:
            y = {
              id: h.Qe++,
              originalId: null,
              groupId: null,
              createSegmentIndex: function() {
                return Promise.resolve();
              },
              segmentIndex: am(0, r, [a]),
              mimeType: d || "",
              codecs: e || "",
              kind: c,
              encrypted: false,
              drmInfos: [],
              keyIds: /* @__PURE__ */ new Set(),
              language: b,
              originalLanguage: b,
              label: f || null,
              type: n.ab,
              primary: false,
              trickModeVideo: null,
              dependencyStream: null,
              emsgSchemeIdUris: null,
              roles: [],
              forced: !!g,
              channelsCount: null,
              audioSamplingRate: null,
              spatialAudio: false,
              closedCaptions: null,
              accessibilityPurpose: null,
              external: true,
              fastSwitching: false,
              fullMimeTypes: /* @__PURE__ */ new Set([ef(d || "", e || "")]),
              isAudioMuxedInVideo: false,
              baseOriginalId: null
            };
            z = ef(y.mimeType, y.codecs);
            A = vf(z);
            if (!A) throw new U(2, 2, 2014, d);
            h.i.textStreams.push(y);
            $q(h);
            return C.return(dg(y));
        }
      });
    };
    p.cf = function(a, b) {
      var c = this, d, e, f, g, h, k2, l, m, n, q, r, u, w, v, y, z, A, C;
      return P(function(D) {
        switch (D.g) {
          case 1:
            if (c.m != Xq && c.m != ar) throw new U(1, 7, 7004);
            if (b) {
              D.B(2);
              break;
            }
            return G(D, Hr(c, a), 3);
          case 3:
            b = D.h;
          case 2:
            if (b != "text/vtt") throw new U(1, 2, 2017, a);
            d = vc;
            e = c.ya();
            f = e.end - e.start;
            c.i && (f = c.i.presentationTimeline.getDuration());
            if (f == Infinity) throw new U(1, 4, 4045);
            return G(D, Jr(c, a, c.J, c.g.streaming.retryParameters), 4);
          case 4:
            g = D.h;
            h = uf(b);
            if (!h) throw new U(2, 2, 2014, b);
            k2 = h();
            l = {
              periodStart: 0,
              segmentStart: 0,
              segmentEnd: f,
              vttOffset: 0
            };
            m = Lb(g);
            n = k2.parseMedia(m, l, a, []);
            q = [];
            r = t(n);
            u = r.next();
            for (w = {}; !u.done; w = { vg: void 0, Cd: void 0 }, u = r.next()) w.Cd = u.value, w.vg = null, v = /* @__PURE__ */ function(F) {
              return function() {
                F.vg == null && (F.vg = nc([a], [F.Cd.payload]));
                return F.vg || [];
              };
            }(w), y = new Cj(w.Cd.startTime, w.Cd.endTime, v, 0, null, null, 0, 0, Infinity), w.Cd.payload.includes("#xywh") && (z = w.Cd.payload.split("#xywh=")[1].split(","), z.length === 4 && y.jg({ height: parseInt(z[3], 10), positionX: parseInt(z[0], 10), positionY: parseInt(z[1], 10), width: parseInt(
              z[2],
              10
            ) })), q.push(y);
            A = b;
            if (!q.length) {
              D.B(5);
              break;
            }
            return G(D, Jo(q[0].T()[0], c.J, c.g.manifest.retryParameters), 6);
          case 6:
            A = D.h;
          case 5:
            return C = {
              id: c.Qe++,
              originalId: null,
              groupId: null,
              createSegmentIndex: function() {
                return Promise.resolve();
              },
              segmentIndex: new Zl(q),
              mimeType: A || "",
              codecs: "",
              kind: "",
              encrypted: false,
              drmInfos: [],
              keyIds: /* @__PURE__ */ new Set(),
              language: "und",
              originalLanguage: null,
              label: null,
              type: d.yg,
              primary: false,
              trickModeVideo: null,
              dependencyStream: null,
              emsgSchemeIdUris: null,
              roles: [],
              forced: false,
              channelsCount: null,
              audioSamplingRate: null,
              spatialAudio: false,
              closedCaptions: null,
              tilesLayout: "1x1",
              accessibilityPurpose: null,
              external: true,
              fastSwitching: false,
              fullMimeTypes: /* @__PURE__ */ new Set([ef(A || "", "")]),
              isAudioMuxedInVideo: false,
              baseOriginalId: null
            }, c.m == ar ? c.Ve.push(C) : c.i.imageStreams.push(C), $q(c), D.return(eg(C));
        }
      });
    };
    p.bf = function(a, b, c) {
      var d = this, e, f, g, h, k2, l, m, n, q, r, u, w, v, y, z;
      return P(function(A) {
        switch (A.g) {
          case 1:
            if (d.m != Xq && d.m != ar) throw new U(1, 7, 7004);
            if (c) {
              A.B(2);
              break;
            }
            return G(A, Hr(d, a), 3);
          case 3:
            c = A.h;
          case 2:
            e = vc;
            f = d.ya();
            g = f.end - f.start;
            d.i && (g = d.i.presentationTimeline.getDuration());
            if (g == Infinity) throw new U(1, 4, 4054);
            return G(A, Jr(d, a, d.J, d.g.streaming.retryParameters), 4);
          case 4:
            h = A.h;
            k2 = uf(c);
            if (!k2) throw new U(2, 2, 2014, c);
            l = k2();
            m = { periodStart: 0, segmentStart: 0, segmentEnd: g, vttOffset: 0 };
            n = Lb(h);
            q = l.parseMedia(n, m, a, []);
            r = [];
            u = t(q);
            w = u.next();
            for (v = {}; !w.done; v = { nf: void 0 }, w = u.next()) v.nf = w.value, y = new Cj(v.nf.startTime, v.nf.endTime, /* @__PURE__ */ function(C) {
              return function() {
                return [C.nf.payload];
              };
            }(v), 0, null, null, 0, 0, Infinity), r.push(y);
            z = {
              id: d.Qe++,
              originalId: null,
              groupId: null,
              createSegmentIndex: function() {
                return Promise.resolve();
              },
              segmentIndex: new Zl(r),
              mimeType: "text/plain",
              codecs: "",
              kind: "",
              encrypted: false,
              drmInfos: [],
              keyIds: /* @__PURE__ */ new Set(),
              language: b,
              originalLanguage: b,
              label: null,
              type: e.ab,
              primary: false,
              trickModeVideo: null,
              dependencyStream: null,
              emsgSchemeIdUris: null,
              roles: [],
              forced: false,
              channelsCount: null,
              audioSamplingRate: null,
              spatialAudio: false,
              closedCaptions: null,
              accessibilityPurpose: null,
              external: true,
              fastSwitching: false,
              fullMimeTypes: /* @__PURE__ */ new Set([ef("text/plain", "")]),
              isAudioMuxedInVideo: false,
              baseOriginalId: null
            };
            d.fb.push(z);
            $q(d);
            return A.return(dg(z));
        }
      });
    };
    function Hr(a, b) {
      var c;
      return P(function(d) {
        switch (d.g) {
          case 1:
            return sa(d, 2), G(d, Jo(b, a.J, a.g.streaming.retryParameters), 4);
          case 4:
            c = d.h;
            ua(d, 3);
            break;
          case 2:
            va(d);
          case 3:
            if (c) return d.return(c);
            throw new U(1, 2, 2011, b);
        }
      });
    }
    function Ir(a, b, c, d, e, f, g) {
      var h, k2, l, m;
      return P(function(n) {
        if (n.g == 1) return e != "text/vtt" || g.length ? G(n, Jr(a, b, a.J, a.g.streaming.retryParameters), 3) : n.B(2);
        n.g != 2 && (h = n.h, k2 = Kr(a, h, e, g), l = new Blob([k2], { type: "text/vtt" }), b = Bk(l), e = "text/vtt");
        m = document.createElement("track");
        a: {
          var q = a.L, r = b;
          try {
            if (!q.g.enabled) {
              var u = r;
              break a;
            }
            var w = wp(q);
            w.ot = Kp;
            w.su = true;
            var v = Ap(w);
            u = Bp(r, v);
            break a;
          } catch (y) {
            cb("CMCD_TEXT_TRACK_ERROR", "Could not generate text track CMCD data.", y);
            u = r;
            break a;
          }
          u = void 0;
        }
        m.src = u;
        m.label = f;
        m.kind = d;
        m.srclang = c;
        a.h.getAttribute("crossorigin") || a.h.setAttribute("crossorigin", "anonymous");
        a.h.appendChild(m);
        a.Cg.push(m);
        return n.return(m);
      });
    }
    function Jr(a, b, c, d) {
      var e, f, g;
      return P(function(h) {
        if (h.g == 1) {
          e = gh;
          f = ah([b], d);
          f.method = "GET";
          var k2 = a.L;
          try {
            k2.g.enabled && Cp(k2, f, { ot: Kp, su: true });
          } catch (l) {
            cb("CMCD_TEXT_ERROR", "Could not generate text CMCD data.", l);
          }
          return G(h, c.request(e, f).promise, 2);
        }
        g = h.h;
        return h.return(g.data);
      });
    }
    function Kr(a, b, c, d) {
      var e = uf(c);
      if (e) return c = e(), a = { periodStart: 0, segmentStart: 0, segmentEnd: a.h.duration, vttOffset: 0 }, b = Lb(b), b = c.parseMedia(b, a, null, []), kp(b, d);
      throw new U(2, 2, 2014, c);
    }
    p.um = function(a, b) {
      this.ua.width = a;
      this.ua.height = b;
    };
    p.Xh = function(a) {
      if (this.m == Xq) {
        var b = this.l;
        a = a === void 0 ? 0.1 : a;
        if (b.l.g) b = false;
        else if (b.D) b = false;
        else {
          for (var c = t(b.h.values()), d = c.next(); !d.done; d = c.next()) d = d.value, !d.oe || d.$a || d.Fb || (d.oe = false, Um(b, d, a));
          b = true;
        }
      } else b = false;
      return b;
    };
    p.qh = function() {
      bb("Shaka Player's internal Manifest structure is NOT covered by semantic versioning compatibility guarantees.  It may change at any time!  Please consider filing a feature request for whatever you use getManifest() for.");
      return this.i;
    };
    p.Vk = function() {
      return this.Ec;
    };
    p.Nk = function() {
      var a = { video: null, audio: null, text: null };
      if (this.m != Xq) return a;
      var b = this.l.u, c = this.h.currentTime;
      b = t([b.video, b.audio, this.l.C]);
      for (var d = b.next(); !d.done; d = b.next()) if ((d = d.value) && d.segmentIndex) {
        var e = d.segmentIndex.find(c);
        e = d.segmentIndex.get(e);
        e = { codecs: e.codecs || d.codecs, mimeType: e.mimeType || d.mimeType, bandwidth: e.bandwidth || d.bandwidth };
        d.type == "video" ? (e.width = d.width, e.height = d.height, a.video = e) : d.type == "audio" ? a.audio = e : d.type == tc && (a.text = e);
      }
      return a;
    };
    function kq(a) {
      var b = Vn();
      b.streaming.failureCallback = function(c) {
        if (a.U()) {
          var d = null;
          c.code == 1001 || c.code == 1002 ? (d = 1, a.g.streaming.lowLatencyMode && (d = 0.1)) : c.code == 1003 && (d = 0.1);
          d != null && (c.severity = 1, a.Xh(d));
        }
      };
      b.textDisplayFactory = function() {
        var c = Sb();
        return a.Re && (document.fullscreenEnabled || c.Ga() !== "WEBKIT") ? new ap(a.h, a.Re) : "track" in document.createElement("track") ? new Wo(a) : new $o();
      };
      return b;
    }
    p.ji = function(a) {
      this.Re = a;
    };
    function Oq(a, b) {
      for (var c = /* @__PURE__ */ new Set(), d = t(b.textStreams), e = d.next(); !e.done; e = d.next()) e = e.value, e.mimeType != "application/cea-608" && e.mimeType != "application/cea-708" || c.add(e.originalId);
      d = t(b.variants);
      for (e = d.next(); !e.done; e = d.next()) if ((e = e.value.video) && e.closedCaptions) {
        for (var f = t(e.closedCaptions.keys()), g = f.next(); !g.done; g = f.next()) if (g = g.value, !c.has(g)) {
          var h = g.startsWith("CC") ? "application/cea-608" : "application/cea-708", k2 = new bm(), l = e.closedCaptions.get(g);
          h = {
            id: a.Qe++,
            originalId: g,
            groupId: null,
            createSegmentIndex: function() {
              return Promise.resolve();
            },
            segmentIndex: k2,
            mimeType: h,
            codecs: "",
            kind: "caption",
            encrypted: false,
            drmInfos: [],
            keyIds: /* @__PURE__ */ new Set(),
            language: l,
            originalLanguage: l,
            label: null,
            type: tc,
            primary: false,
            trickModeVideo: null,
            dependencyStream: null,
            emsgSchemeIdUris: null,
            roles: e.roles,
            forced: false,
            channelsCount: null,
            audioSamplingRate: null,
            spatialAudio: false,
            closedCaptions: null,
            accessibilityPurpose: null,
            external: false,
            fastSwitching: false,
            fullMimeTypes: /* @__PURE__ */ new Set([ef(h, "")]),
            isAudioMuxedInVideo: false,
            baseOriginalId: null
          };
          b.textStreams.push(h);
          c.add(g);
        }
      }
    }
    function kr(a, b) {
      var c, d, e, f, g;
      return P(function(h) {
        if (h.g == 1) return c = a.audio, d = a.video, e = function(k2, l) {
          var m, n, q;
          return P(function(r) {
            if (r.g == 1) return k2 ? k2.segmentIndex ? r.B(2) : G(r, k2.createSegmentIndex(), 2) : r.return(null);
            n = (m = k2.segmentIndex.dc(l)) ? m.next().value : null;
            if (!n) return r.return(null);
            q = n.startTime;
            return r.return(q);
          });
        }, G(h, e(c, b), 2);
        if (h.g != 3) return f = h.h, G(h, e(d, b), 3);
        g = h.h;
        return g != null && f != null ? h.return(Math.max(g, f)) : g != null ? h.return(g) : f != null ? h.return(f) : h.return(b);
      });
    }
    function Dq(a) {
      var b = a.Bf();
      if (a.C && a.P && a.G) {
        if (a.g.streaming.rebufferingGoal == 0) {
          var c = a.K;
          c.j = false;
          fm(c);
        } else c = a.K, c.j = b, fm(c);
        a.L && (c = a.L, b || c.A || (c.A = true), c.A && b && (c.D = true), c.G = b);
        Wq(a);
        c = a.g.streaming.liveSync.dynamicTargetLatency.maxAttempts;
        if (a.g.streaming.liveSync.dynamicTargetLatency.enabled && b && a.Ze < c) {
          c = a.g.streaming.liveSync.dynamicTargetLatency.maxLatency;
          var d = a.g.streaming.liveSync.targetLatencyTolerance, e = a.g.streaming.liveSync.dynamicTargetLatency.rebufferIncrement;
          a.S && (a.S = Math.min(a.S + ++a.Ze * e, c - d));
        }
      }
      b = (/* @__PURE__ */ new Map()).set("buffering", b);
      a.dispatchEvent(tq("buffering", b));
    }
    function Yq(a, b) {
      a.kc.Ta();
      a.kc.o(a.h, "timeupdate", function() {
        var c = a.h.currentTime, d = a.ya(), e = a.U(), f = e ? a.g.streaming.safeSeekOffset : 0;
        b > 0 ? (!e || b >= 1) && Math.floor(c) >= Math.floor(d.end) && a.zd() : Math.floor(c) <= Math.floor(d.start + f) && a.zd();
      });
    }
    function Wq(a) {
      if (a.C && a.P) {
        var b = a.C.g, c = "playing";
        a.P.g == xi ? c = "buffering" : a.isEnded() ? c = "ended" : a.h.paused && (c = "paused");
        var d = c;
        if (b.g == null) b.g = { timestamp: Date.now() / 1e3, state: d, duration: 0 }, b = true;
        else {
          var e = Date.now() / 1e3;
          b.g.duration = e - b.g.timestamp;
          b.g.state == d ? b = false : (b.h.push(b.g), b.g = { timestamp: e, state: d, duration: 0 }, b = true);
        }
        b && (c = (/* @__PURE__ */ new Map()).set("newstate", c), a.dispatchEvent(tq("statechanged", c)));
      }
    }
    function or(a) {
      var b = a.h.playbackRate, c = a.U();
      if (a.g.streaming.vodDynamicPlaybackRate && !c) {
        var d = a.g.streaming.vodDynamicPlaybackRateLowBufferRate, e = a.Wi();
        e <= a.g.streaming.vodDynamicPlaybackRateBufferRatio ? b != d && a.Xc(d, false) : e == 1 && b !== a.K.fd() && a.zd();
      }
      if (c && (c = a.ya(), Number.isFinite(c.end) && !(a.h.currentTime < c.start || a.h.paused))) {
        d = a.g.streaming.liveSync.targetLatencyTolerance;
        e = a.g.streaming.liveSync.dynamicTargetLatency.enabled;
        var f = a.g.streaming.liveSync.dynamicTargetLatency.stabilityThreshold;
        if (a.g.streaming.liveSync && a.g.streaming.liveSync.enabled) {
          var g = a.g.streaming.liveSync.targetLatency;
          var h = g + d;
          var k2 = Math.max(0, g - d);
          var l = a.g.streaming.liveSync.maxPlaybackRate;
          var m = a.g.streaming.liveSync.minPlaybackRate;
        } else a.i && a.i.serviceDescription && (g = a.i.serviceDescription.targetLatency, a.i.serviceDescription.targetLatency != null ? h = a.i.serviceDescription.targetLatency + d : a.i.serviceDescription.maxLatency != null && (h = a.i.serviceDescription.maxLatency), a.i.serviceDescription.targetLatency != null ? k2 = Math.max(0, a.i.serviceDescription.targetLatency - d) : a.i.serviceDescription.minLatency != null && (k2 = a.i.serviceDescription.minLatency), l = a.i.serviceDescription.maxPlaybackRate || a.g.streaming.liveSync.maxPlaybackRate, m = a.i.serviceDescription.minPlaybackRate || a.g.streaming.liveSync.minPlaybackRate);
        a.S || typeof g !== "number" || (a.S = g);
        var n = a.g.streaming.liveSync.dynamicTargetLatency.maxAttempts;
        e && a.jc && a.S !== null && typeof g === "number" && a.Ze < n && Date.now() - a.jc > f * 1e3 && (f = a.g.streaming.liveSync.dynamicTargetLatency.minLatency, a.S = Math.max(a.S - (g - f) / 2, f + d), a.jc = Date.now());
        e && a.S !== null && (h = a.S + d, k2 = a.S - d);
        g = c.end - a.h.currentTime;
        d = 0;
        a.m == ar && (e = a.h.buffered, e.length > 0 && (d = e.end(e.length - 1), d = Math.max(l, d - c.end)));
        c = a.g.streaming.liveSync.panicMode;
        e = a.g.streaming.liveSync.panicThreshold * 1e3;
        f = Date.now() - a.P.h;
        c && !m && (m = a.g.streaming.liveSync.minPlaybackRate);
        c && m && f <= e ? b != m && a.Xc(m, false) : h != void 0 && l && g - d > h ? (b != l && a.Xc(l, false), a.jc = null) : k2 != void 0 && m && g - d < k2 ? (b != m && a.Xc(m, false), a.jc = null) : b !== a.K.fd() && (a.zd(), a.jc = Date.now());
      }
    }
    function pr(a) {
      if (a.h) {
        var b = function(e, f) {
          var g = g === void 0 ? Number.EPSILON : g;
          if (e === f) g = true;
          else {
            var h = Math.abs(e - f);
            g = h <= g ? true : g !== Number.EPSILON ? Math.abs(h - g) <= Number.EPSILON : false;
          }
          return (g || f > e) && a.Bg < e ? (a.Bg = e, true) : false;
        }, c = a.ya();
        c = c.end - c.start;
        c = c > 0 ? a.h.currentTime / c : 0;
        if (!isNaN(c)) {
          c *= 100;
          if (b(0, c)) var d = tq("started");
          else if (b(25, c)) d = tq("firstquartile");
          else if (b(50, c)) d = tq("midpoint");
          else if (b(75, c)) d = tq("thirdquartile");
          else {
            if (b(100, c) || c > 100) d = tq("complete");
            a.g && a.g.playRangeEnd != Infinity && a.isEnded() && a.h.pause();
          }
          d && a.dispatchEvent(d);
        }
      }
    }
    function dr(a) {
      try {
        Di(a.Pe, a.i);
      } catch (c) {
        return Bq(a, c), false;
      }
      var b = lg(a.i.variants);
      b = a.M.create(b);
      a.A.setVariants(Array.from(b.values()));
      return true;
    }
    function qq(a, b, c, d, e) {
      b = b === void 0 ? true : b;
      c = c === void 0 ? 0 : c;
      d = d === void 0 ? false : d;
      e = e === void 0 ? true : e;
      var f;
      (f = dr(a) ? a.A.chooseVariant() : null) && fr(a, f, e, b, c, d);
    }
    function fr(a, b, c, d, e, f) {
      f = f === void 0 ? false : f;
      var g = a.l.u;
      if (b == g) d && Ym(a.l, b, d, e, true);
      else {
        var h = a.C.h;
        h.h != b && (h.h = b, h.g.push({ timestamp: Date.now() / 1e3, id: b.id, type: "variant", fromAdaptation: c, bandwidth: b.bandwidth }));
        Ym(a.l, b, d, e, f, c);
        d = null;
        g && (d = cg(g));
        g = cg(b);
        g.active = true;
        if (a.R && (e = a.R, b = b.video)) {
          b.dependencyStream && (b = b.dependencyStream);
          f = 0;
          h = -1;
          switch (b.mimeType) {
            case "video/webm":
              f = 1;
              break;
            case "video/mp4":
              f = 2;
          }
          switch (a.rh()) {
            case "DASH":
              h = 1;
              break;
            case "HLS":
              h = 0;
          }
          e.g && (e.g.setLevelSwitching(
            b.id,
            true
          ), e.g.setContainerFormat(f), e.j || e.g.setStreamingFormat(h));
        }
        c ? (c = (/* @__PURE__ */ new Map()).set("oldTrack", d).set("newTrack", g), c = tq("adaptation", c), Lr(a, c)) : Mr(a, d, g);
        Nr(a, d, g);
      }
    }
    function Er(a, b) {
      var c = Array.from(a.h.audioTracks).find(function(e) {
        return e.enabled;
      });
      b.enabled = true;
      if (c) {
        b.id !== c.id && (c.enabled = false);
        var d = Ar(a);
        c = jg(c, d);
        b = jg(b, d);
        Mr(a, c, b);
        Nr(a, c, b);
      }
    }
    function Ar(a) {
      return a.h && a.h.videoTracks ? Array.from(a.h.videoTracks).find(function(b) {
        return b.selected;
      }) : null;
    }
    function $q(a) {
      var b = tq("trackschanged");
      Lr(a, b);
      Or(a);
    }
    function Mr(a, b, c) {
      b = (/* @__PURE__ */ new Map()).set("oldTrack", b).set("newTrack", c);
      b = tq("variantchanged", b);
      Lr(a, b);
    }
    function Nr(a, b, c) {
      var d = false;
      b && b.audioId == c.audioId && b.audioGroupId == c.audioGroupId || (d = true);
      d && Or(a);
    }
    function Or(a) {
      var b = tq("audiotrackschanged");
      Lr(a, b);
    }
    function Zq(a) {
      var b = tq("textchanged");
      Lr(a, b);
    }
    function lr(a) {
      var b = tq("texttrackvisibility");
      Lr(a, b);
    }
    function nr(a) {
      a.g.abr.enabled || pq(a);
      var b = (/* @__PURE__ */ new Map()).set("newStatus", a.g.abr.enabled);
      Lr(a, tq("abrstatuschanged", b));
    }
    function mr(a) {
      var b = a.vc().find(function(c) {
        return c.active;
      });
      b && a.u && a.u.setTextLanguage && a.u.setTextLanguage(b.language);
    }
    function pq(a, b) {
      b = b === void 0 ? true : b;
      if (a.m == Xq) {
        a.Se.stop();
        for (var c = t(a.i.variants), d = c.next(); !d.done; d = c.next()) d.value.disabledUntilTime = 0;
        b && dr(a);
      }
    }
    p.disableStream = function(a, b) {
      if (!this.g.abr.enabled || this.m === uq || !navigator.onLine || b == 0 || !this.i) return false;
      if (this.i.variants.some(function(h) {
        var k2 = h[a.type];
        return k2 && k2.id !== a.id && !h.disabledUntilTime ? a.type == "audio" ? a.language === k2.language : true : false;
      })) {
        for (var c = false, d = false, e = t(this.i.variants), f = e.next(); !f.done; f = e.next()) {
          f = f.value;
          var g = f[a.type];
          g && (g.id === a.id ? (f.disabledUntilTime = Date.now() / 1e3 + b, c = true) : g.trickModeVideo && g.trickModeVideo.id == a.id && (d = true));
        }
        if (!c && d) return false;
        this.Se.za(1);
        b = this.cc().video.reduce(function(h, k2) {
          return h + k2.end - k2.start;
        }, 0);
        qq(this, false, b, true, false);
        return true;
      }
      return false;
    };
    function Bq(a, b) {
      var c, d, e, f, g;
      return P(function(h) {
        switch (h.g) {
          case 1:
            if (a.m == uq) return h.return();
            b.severity === 1 && a.C.L++;
            c = true;
            if (!(a.aa && a.i && a.l) || b.code != 3016 && b.code != 3014 && b.code != 3015 && b.code != 3024 && b.code != 3018) {
              h.B(2);
              break;
            }
            d = Sb();
            if (d.Ga() === "WEBKIT" && b.code == 3016) return h.return();
            sa(h, 3);
            return G(h, nn(a.l), 5);
          case 5:
            e = h.h;
            c = !e;
            e && (f = tq("mediasourcerecovered"), a.dispatchEvent(f));
            ua(h, 2);
            break;
          case 3:
            va(h), c = true;
          case 2:
            if (!c) return h.return();
            b.severity === 2 && pq(a, false);
            g = tq("error", (/* @__PURE__ */ new Map()).set(
              "detail",
              b
            ));
            a.dispatchEvent(g);
            g.defaultPrevented && (b.handled = true);
            H(h);
        }
      });
    }
    p.addFont = function(a, b) {
      return Vj(a, b);
    };
    function Qq(a, b, c, d) {
      d = d === void 0 ? a : d;
      a = (/* @__PURE__ */ new Map()).set("detail", { schemeIdUri: c.schemeIdUri, value: c.value, startTime: c.startTime, endTime: c.endTime, id: c.id, timescale: c.timescale, eventElement: c.eventElement, eventNode: c.eventNode });
      d.dispatchEvent(tq(b, a));
    }
    function Rq(a, b, c, d) {
      d = d === void 0 ? false : d;
      b = (/* @__PURE__ */ new Map()).set("mediaQuality", { bandwidth: b.bandwidth, audioSamplingRate: b.audioSamplingRate, codecs: b.codecs, contentType: b.contentType, frameRate: b.frameRate, height: b.height, mimeType: b.mimeType, channelsCount: b.channelsCount, pixelAspectRatio: b.pixelAspectRatio, width: b.width, label: b.label, roles: b.roles, language: b.language }).set("position", c);
      a.dispatchEvent(tq(d ? "audiotrackchanged" : "mediaqualitychanged", b));
    }
    function Aq(a, b) {
      b = b === void 0 ? true : b;
      if (!a.h.error) return b ? new U(2, 3, 3016) : null;
      var c = a.h.error.code;
      if (!b && c == 1) return null;
      if (b = a.h.error.msExtendedCode) b < 0 && (b += 4294967296), b = b.toString(16);
      return new U(2, 3, 3016, c, b, a.h.error.message);
    }
    function Sq(a, b) {
      var c = tq("keystatuschanged");
      a.dispatchEvent(c);
      var d = Object.keys(b);
      d.length == 1 && d[0] == "" && (d = ["00"], b = { "00": b[""] });
      var e = d.length == 1 && d[0] == "00";
      c = false;
      if (d.length) {
        d = a.keySystem();
        for (var f = kh(a.g.drm.clearKeys), g = function(u, w) {
          u.allowedByKeySystem = true;
          w = t(w);
          for (var v = w.next(); !v.done; v = w.next()) if (v = v.value, (v = b[e ? "00" : v]) || a.F.L) u.allowedByKeySystem = u.allowedByKeySystem && !!v && !Ei.includes(v);
        }, h = t(a.i.variants), k2 = h.next(); !k2.done; k2 = h.next()) {
          k2 = k2.value;
          var l = og(k2);
          l = t(l);
          for (var m = l.next(); !m.done; m = l.next()) {
            m = m.value;
            var n = k2.allowedByKeySystem;
            if (m.keyIds.size) if (m.drmInfos.length && !f.size && a.i.type == "HLS") for (var q = t(m.drmInfos), r = q.next(); !r.done; r = q.next()) r = r.value, r.keySystem == d && (r.keyIds.size ? g(k2, r.keyIds) : g(k2, m.keyIds));
            else g(k2, m.keyIds);
            n != k2.allowedByKeySystem && (c = true);
          }
        }
      }
      if (c && ($q(a), !dr(a))) return;
      (c = a.l.u) && !c.allowedByKeySystem && qq(a);
    }
    function er(a, b, c) {
      b > 0 && (a.U() || a.Pj(b));
      b = a.getDuration();
      c < b && (a.U() || a.yb(c));
    }
    function Lr(a, b) {
      P(function(c) {
        if (c.g == 1) return G(c, Promise.resolve(), 2);
        a.m != uq && a.dispatchEvent(b);
        H(c);
      });
    }
    function Gr(a) {
      var b = /* @__PURE__ */ new Set();
      a = t(a);
      for (var c = a.next(); !c.done; c = a.next()) c = c.value, c.language ? b.add(zc(c.language)) : b.add("und");
      return b;
    }
    function Fr(a) {
      for (var b = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), d = 0; d < a.length; d++) {
        var e = a[d], f = "und", g = [];
        e.language && (f = zc(e.language));
        e.type == "variant" ? g = e.audioRoles : g = e.roles;
        g && g.length || (g = [""]);
        b.has(f) || b.set(f, /* @__PURE__ */ new Set());
        g = t(g);
        for (var h = g.next(); !h.done; h = g.next()) h = h.value, b.get(f).add(h), e.label && (c.has(f) || c.set(f, /* @__PURE__ */ new Map()), c.get(f).set(h, e.label));
      }
      var k2 = [];
      b.forEach(function(l, m) {
        l = t(l);
        for (var n = l.next(); !n.done; n = l.next()) {
          n = n.value;
          var q = null;
          c.has(m) && c.get(m).has(n) && (q = c.get(m).get(n));
          k2.push({
            language: m,
            role: n,
            label: q
          });
        }
      });
      return k2;
    }
    p.Da = function() {
      return this.h && this.h.remote ? this.h.remote.state != "disconnected" : false;
    };
    p.isEnded = function() {
      return !this.h || this.h.ended ? true : this.aa && !this.U() && this.h.currentTime >= this.ya().end;
    };
    S("shaka.Player", Y);
    Y.prototype.isEnded = Y.prototype.isEnded;
    Y.prototype.isRemotePlayback = Y.prototype.Da;
    Y.prototype.addFont = Y.prototype.addFont;
    Y.prototype.setVideoContainer = Y.prototype.ji;
    Y.prototype.getFetchedPlaybackInfo = Y.prototype.Nk;
    Y.prototype.getManifestParserFactory = Y.prototype.Vk;
    Y.prototype.getManifest = Y.prototype.qh;
    Y.prototype.retryStreaming = Y.prototype.Xh;
    Y.prototype.setMaxHardwareResolution = Y.prototype.um;
    Y.prototype.addChaptersTrack = Y.prototype.bf;
    Y.prototype.addThumbnailsTrack = Y.prototype.cf;
    Y.prototype.addTextTrackAsync = Y.prototype.be;
    Y.prototype.getStats = Y.prototype.getStats;
    Y.prototype.getBufferedInfo = Y.prototype.cc;
    Y.prototype.getSegmentAvailabilityDuration = Y.prototype.wf;
    Y.prototype.getPresentationStartTimeAsDate = Y.prototype.sh;
    Y.prototype.getPlayheadTimeAsDate = Y.prototype.Zk;
    Y.prototype.setTextTrackVisibility = Y.prototype.Fe;
    Y.prototype.getChaptersAsync = Y.prototype.nh;
    Y.prototype.getChapters = Y.prototype.Dk;
    Y.prototype.getChaptersTracks = Y.prototype.Ek;
    Y.prototype.isTextTrackVisible = Y.prototype.ld;
    Y.prototype.selectVariantsByLabel = Y.prototype.om;
    Y.prototype.selectTextLanguage = Y.prototype.ai;
    Y.prototype.selectAudioLanguage = Y.prototype.Fj;
    Y.prototype.getTextLanguages = Y.prototype.jl;
    Y.prototype.getAudioLanguages = Y.prototype.zk;
    Y.prototype.getTextLanguagesAndRoles = Y.prototype.kl;
    Y.prototype.getAudioLanguagesAndRoles = Y.prototype.Ak;
    Y.prototype.getVideoTracks = Y.prototype.getVideoTracks;
    Y.prototype.selectVideoTrack = Y.prototype.Hj;
    Y.prototype.getAudioTracks = Y.prototype.getAudioTracks;
    Y.prototype.selectAudioTrack = Y.prototype.Gj;
    Y.prototype.selectVariantTrack = Y.prototype.De;
    Y.prototype.selectTextTrack = Y.prototype.fg;
    Y.prototype.getThumbnails = Y.prototype.$i;
    Y.prototype.getAllThumbnails = Y.prototype.yk;
    Y.prototype.getImageTracks = Y.prototype.ph;
    Y.prototype.getTextTracks = Y.prototype.vc;
    Y.prototype.getVariantTracks = Y.prototype.rb;
    Y.prototype.cancelTrickPlay = Y.prototype.zd;
    Y.prototype.trickPlay = Y.prototype.Xc;
    Y.prototype.useTrickPlayTrackIfAvailable = Y.prototype.zi;
    Y.prototype.getPlaybackRate = Y.prototype.Ya;
    Y.prototype.isBuffering = Y.prototype.Bf;
    Y.prototype.getKeyStatuses = Y.prototype.tf;
    Y.prototype.getActiveSessionsMetadata = Y.prototype.mh;
    Y.prototype.getExpiration = Y.prototype.ke;
    Y.prototype.drmInfo = Y.prototype.drmInfo;
    Y.prototype.keySystem = Y.prototype.keySystem;
    Y.prototype.isFullyLoaded = Y.prototype.Cl;
    Y.prototype.goToLive = Y.prototype.yl;
    Y.prototype.seekRange = Y.prototype.ya;
    Y.prototype.isVideoOnly = Y.prototype.Hh;
    Y.prototype.isAudioOnly = Y.prototype.Hd;
    Y.prototype.isInProgress = Y.prototype.kd;
    Y.prototype.isLive = Y.prototype.U;
    Y.prototype.getQueueManager = Y.prototype.uh;
    Y.prototype.getAdManager = Y.prototype.rf;
    Y.prototype.getAssetUri = Y.prototype.ed;
    Y.prototype.getNetworkingEngine = Y.prototype.Lb;
    Y.prototype.getMediaElement = Y.prototype.Yk;
    Y.prototype.getManifestType = Y.prototype.rh;
    Y.prototype.getLoadMode = Y.prototype.Rk;
    Y.prototype.resetConfiguration = Y.prototype.Aj;
    Y.prototype.getBufferFullness = Y.prototype.Wi;
    Y.prototype.getNonDefaultConfiguration = Y.prototype.Zi;
    Y.prototype.getConfigurationForLowLatency = Y.prototype.Hk;
    Y.prototype.getConfiguration = Y.prototype.getConfiguration;
    Y.prototype.configurationForLowLatency = Y.prototype.vk;
    Y.prototype.configure = Y.prototype.configure;
    Y.prototype.releaseAllMutexes = Y.prototype.bm;
    Y.prototype.destroyAllPreloads = Y.prototype.Vg;
    Y.prototype.preload = Y.prototype.preload;
    Y.prototype.detachAndSavePreload = Y.prototype.Si;
    Y.prototype.unloadAndSavePreload = Y.prototype.ym;
    Y.prototype.load = Y.prototype.load;
    Y.prototype.updateStartTime = Y.prototype.Cm;
    Y.prototype.unload = Y.prototype.rc;
    Y.prototype.detach = Y.prototype.detach;
    Y.prototype.attachCanvas = Y.prototype.Gi;
    Y.prototype.attach = Y.prototype.bc;
    Y.probeSupport = function(a) {
      a = a === void 0 ? true : a;
      var b, c, d, e, f, g, h;
      return P(function(k2) {
        switch (k2.g) {
          case 1:
            b = {};
            if (!a) {
              k2.B(2);
              break;
            }
            return G(k2, pi(), 3);
          case 3:
            b = k2.h;
          case 2:
            return c = Ii(), d = Ek(), e = Sb(), G(k2, e.tc(), 4);
          case 4:
            return f = k2.h, g = { manifest: c, media: d, drm: b, hardwareResolution: f }, h = wq, h.forEach(function(l, m) {
              g[m] = l();
            }), k2.return(g);
        }
      });
    };
    Y.isBrowserSupported = xq;
    Y.setQueueManagerFactory = function(a) {
      oq = a;
    };
    Y.setAdManagerFactory = function(a) {
      nq = a;
    };
    Y.registerSupportPlugin = vq;
    Y.prototype.destroy = Y.prototype.destroy;
    var uq = 0, jq = 1, Xq = 2, ar = 3;
    Y.LoadMode = { DESTROYED: uq, NOT_LOADED: jq, MEDIA_SOURCE: Xq, SRC_EQUALS: ar };
    Y.version = "v4.15.10";
    var Pr = ["4", "15"];
    Xc = new function(a) {
      this.g = a;
      this.i = Yc;
      this.h = Zc;
    }(new Vc(Number(Pr[0]), Number(Pr[1])));
    var wq = /* @__PURE__ */ new Map(), nq = null, oq = null;
    function Qr() {
      this.g = [];
      this.i = this.m = this.l = this.j = this.h = 0;
    }
    function Rr(a) {
      return a.g.length ? a.g.reduce(function(b, c) {
        return b + c;
      }, 0) / a.g.length : 0;
    }
    ;
    function Sr(a, b, c) {
      var d = this;
      this.g = a;
      this.h = b;
      this.m = c;
      this.i = false;
      this.j = this.h.getVolume();
      this.l = new Qc();
      this.l.o(this.h, google.ima.AdEvent.Type.PAUSED, function() {
        d.i = true;
      });
      this.l.o(this.h, google.ima.AdEvent.Type.RESUMED, function() {
        d.i = false;
      });
    }
    p = Sr.prototype;
    p.needsSkipUI = function() {
      return false;
    };
    p.isClientRendering = function() {
      return true;
    };
    p.hasCustomClick = function() {
      return true;
    };
    p.isUsingAnotherMediaElement = function() {
      return true;
    };
    p.getDuration = function() {
      return this.g.getDuration();
    };
    p.getMinSuggestedDuration = function() {
      return this.g.getMinSuggestedDuration();
    };
    p.getRemainingTime = function() {
      return this.h.getRemainingTime();
    };
    p.isPaused = function() {
      return this.i;
    };
    p.isSkippable = function() {
      return this.g.getSkipTimeOffset() >= 0;
    };
    p.getTimeUntilSkippable = function() {
      var a = this.g.getSkipTimeOffset();
      a = this.getRemainingTime() - a;
      return Math.max(a, 0);
    };
    p.canSkipNow = function() {
      return this.h.getAdSkippableState();
    };
    p.skip = function() {
      return this.h.skip();
    };
    p.pause = function() {
      return this.h.pause();
    };
    p.play = function() {
      return this.h.resume();
    };
    p.getVolume = function() {
      return this.h.getVolume();
    };
    p.setVolume = function(a) {
      this.m.volume = a;
      return this.h.setVolume(a);
    };
    p.isMuted = function() {
      return this.h.getVolume() == 0;
    };
    p.isLinear = function() {
      return this.g.isLinear();
    };
    p.resize = function(a, b) {
      this.h.resize(a, b);
    };
    p.setMuted = function(a) {
      (this.m.muted = a) ? (this.j = this.getVolume(), this.h.setVolume(0)) : this.h.setVolume(this.j);
    };
    p.getSequenceLength = function() {
      var a = this.g.getAdPodInfo();
      return a == null ? 1 : a.getTotalAds();
    };
    p.getPositionInSequence = function() {
      var a = this.g.getAdPodInfo();
      return a == null ? 1 : a.getAdPosition();
    };
    p.getTitle = function() {
      return this.g.getTitle();
    };
    p.getDescription = function() {
      return this.g.getDescription();
    };
    p.getVastMediaBitrate = function() {
      return this.g.getVastMediaBitrate();
    };
    p.getVastMediaHeight = function() {
      return this.g.getVastMediaHeight();
    };
    p.getVastMediaWidth = function() {
      return this.g.getVastMediaWidth();
    };
    p.getVastAdId = function() {
      return "";
    };
    p.getAdId = function() {
      return this.g.getAdId();
    };
    p.getCreativeAdId = function() {
      return this.g.getCreativeAdId();
    };
    p.getAdvertiserName = function() {
      return this.g.getAdvertiserName();
    };
    p.getMediaUrl = function() {
      return this.g.getMediaUrl();
    };
    p.getTimeOffset = function() {
      var a = this.g.getAdPodInfo();
      return a == null ? 0 : a.getTimeOffset();
    };
    p.getPodIndex = function() {
      var a = this.g.getAdPodInfo();
      return a == null ? 0 : a.getPodIndex();
    };
    p.release = function() {
      this.h = this.g = null;
    };
    S("shaka.ads.ClientSideAd", Sr);
    Sr.prototype.release = Sr.prototype.release;
    Sr.prototype.getPodIndex = Sr.prototype.getPodIndex;
    Sr.prototype.getTimeOffset = Sr.prototype.getTimeOffset;
    Sr.prototype.getMediaUrl = Sr.prototype.getMediaUrl;
    Sr.prototype.getAdvertiserName = Sr.prototype.getAdvertiserName;
    Sr.prototype.getCreativeAdId = Sr.prototype.getCreativeAdId;
    Sr.prototype.getAdId = Sr.prototype.getAdId;
    Sr.prototype.getVastAdId = Sr.prototype.getVastAdId;
    Sr.prototype.getVastMediaWidth = Sr.prototype.getVastMediaWidth;
    Sr.prototype.getVastMediaHeight = Sr.prototype.getVastMediaHeight;
    Sr.prototype.getVastMediaBitrate = Sr.prototype.getVastMediaBitrate;
    Sr.prototype.getDescription = Sr.prototype.getDescription;
    Sr.prototype.getTitle = Sr.prototype.getTitle;
    Sr.prototype.getPositionInSequence = Sr.prototype.getPositionInSequence;
    Sr.prototype.getSequenceLength = Sr.prototype.getSequenceLength;
    Sr.prototype.setMuted = Sr.prototype.setMuted;
    Sr.prototype.resize = Sr.prototype.resize;
    Sr.prototype.isLinear = Sr.prototype.isLinear;
    Sr.prototype.isMuted = Sr.prototype.isMuted;
    Sr.prototype.setVolume = Sr.prototype.setVolume;
    Sr.prototype.getVolume = Sr.prototype.getVolume;
    Sr.prototype.play = Sr.prototype.play;
    Sr.prototype.pause = Sr.prototype.pause;
    Sr.prototype.skip = Sr.prototype.skip;
    Sr.prototype.canSkipNow = Sr.prototype.canSkipNow;
    Sr.prototype.getTimeUntilSkippable = Sr.prototype.getTimeUntilSkippable;
    Sr.prototype.isSkippable = Sr.prototype.isSkippable;
    Sr.prototype.isPaused = Sr.prototype.isPaused;
    Sr.prototype.getRemainingTime = Sr.prototype.getRemainingTime;
    Sr.prototype.getMinSuggestedDuration = Sr.prototype.getMinSuggestedDuration;
    Sr.prototype.getDuration = Sr.prototype.getDuration;
    Sr.prototype.isUsingAnotherMediaElement = Sr.prototype.isUsingAnotherMediaElement;
    Sr.prototype.hasCustomClick = Sr.prototype.hasCustomClick;
    Sr.prototype.isClientRendering = Sr.prototype.isClientRendering;
    Sr.prototype.needsSkipUI = Sr.prototype.needsSkipUI;
    function Tr() {
    }
    function Ur(a, b) {
      var c = [];
      a = t(Sd(a, "Ad"));
      for (var d = a.next(); !d.done; d = a.next()) if (d = Xd(d.value, "InLine")) {
        if (d = Xd(d, "Creatives")) {
          d = t(Sd(d, "Creative"));
          for (var e = d.next(); !e.done; e = d.next()) {
            e = e.value;
            var f = Xd(e, "Linear");
            f && Vr(c, b, f);
            if (e = Xd(e, "NonLinearAds")) {
              e = Sd(e, "NonLinear");
              e = t(e);
              for (var g = e.next(); !g.done; g = e.next()) a: {
                f = c;
                var h = b, k2 = g.value, l = Xd(k2, "StaticResource");
                if (l) g = l.attributes.creativeType;
                else {
                  l = Xd(k2, "HTMLResource");
                  if (!l) break a;
                  g = "text/html";
                }
                if (l = Ud(l)) {
                  g === "text/html" && (l = "data:text/html;charset=UTF-8," + encodeURIComponent(l));
                  var m = $d(k2, "width", fe) || $d(k2, "expandedWidth", fe), n = $d(k2, "height", fe) || $d(k2, "expandedHeight", fe);
                  if (m || n) {
                    var q = null;
                    (k2 = k2.attributes.minSuggestedDuration) && (q = Fd(k2));
                    k2 = 0;
                    h != null && (k2 = h);
                    f.push({
                      id: null,
                      groupId: null,
                      startTime: k2,
                      endTime: null,
                      uri: l,
                      mimeType: g,
                      isSkippable: false,
                      skipOffset: null,
                      skipFor: null,
                      canJump: false,
                      resumeOffset: 0,
                      playoutLimit: q,
                      once: true,
                      pre: h == null,
                      post: h == Infinity,
                      timelineRange: false,
                      loop: false,
                      overlay: { viewport: { x: 0, y: 0 }, topLeft: { x: 0, y: 0 }, size: { x: m || 0, y: n || 0 } },
                      displayOnBackground: false,
                      currentVideo: null,
                      background: null
                    });
                  }
                }
              }
            }
          }
        }
      }
      return c;
    }
    function Vr(a, b, c) {
      var d = 0;
      b != null && (d = b);
      var e = null;
      c.attributes.skipoffset && (e = Fd(c.attributes.skipoffset), isNaN(e) && (e = null));
      if (c = Xd(c, "MediaFiles")) {
        var f = Sd(c, "MediaFile");
        c = f;
        f = f.filter(function(h) {
          return h.attributes.delivery == "streaming";
        });
        f.length && (c = f);
        c = c.sort(function(h, k2) {
          return (parseInt(k2.attributes.height, 10) || 0) - (parseInt(h.attributes.height, 10) || 0);
        });
        c = t(c);
        for (f = c.next(); !f.done; f = c.next()) if (f = f.value, !f.attributes.apiFramework) {
          var g = Ud(f);
          if (g) {
            a.push({
              id: null,
              groupId: null,
              startTime: d,
              endTime: null,
              uri: g,
              mimeType: f.attributes.type || null,
              isSkippable: e != null,
              skipOffset: e,
              skipFor: null,
              canJump: false,
              resumeOffset: 0,
              playoutLimit: null,
              once: true,
              pre: b == null,
              post: b == Infinity,
              timelineRange: false,
              loop: false,
              overlay: null,
              displayOnBackground: false,
              currentVideo: null,
              background: null
            });
            break;
          }
        }
      }
    }
    function Wr(a) {
      var b = [];
      a = t(Sd(a, "vmap:AdBreak"));
      for (var c = a.next(); !c.done; c = a.next()) {
        var d = c.value, e = d.attributes.timeOffset;
        e && (c = null, e == "start" ? c = null : e == "end" ? c = Infinity : c = Fd(e), (d = Xd(d, "vmap:AdSource")) && (d = Xd(d, "vmap:AdTagURI")) && (d = Td(d)) && b.push({ time: c, uri: d }));
      }
      return b;
    }
    S("shaka.ads.Utils", Tr);
    Tr.ADS_LOADED = "ads-loaded";
    Tr.AD_STARTED = "ad-started";
    Tr.AD_FIRST_QUARTILE = "ad-first-quartile";
    Tr.AD_MIDPOINT = "ad-midpoint";
    Tr.AD_THIRD_QUARTILE = "ad-third-quartile";
    Tr.AD_COMPLETE = "ad-complete";
    Tr.AD_STOPPED = "ad-stopped";
    Tr.AD_SKIPPED = "ad-skipped";
    Tr.AD_VOLUME_CHANGED = "ad-volume-changed";
    Tr.AD_MUTED = "ad-muted";
    Tr.AD_PAUSED = "ad-paused";
    Tr.AD_RESUMED = "ad-resumed";
    Tr.AD_SKIP_STATE_CHANGED = "ad-skip-state-changed";
    Tr.CUEPOINTS_CHANGED = "ad-cue-points-changed";
    Tr.IMA_AD_MANAGER_LOADED = "ima-ad-manager-loaded";
    Tr.IMA_STREAM_MANAGER_LOADED = "ima-stream-manager-loaded";
    Tr.AD_CLICKED = "ad-clicked";
    Tr.AD_PROGRESS = "ad-progress";
    Tr.AD_BUFFERING = "ad-buffering";
    Tr.AD_IMPRESSION = "ad-impression";
    Tr.AD_DURATION_CHANGED = "ad-duration-changed";
    Tr.AD_CLOSED = "ad-closed";
    Tr.AD_LOADED = "ad-loaded";
    Tr.ALL_ADS_COMPLETED = "all-ads-completed";
    Tr.AD_LINEAR_CHANGED = "ad-linear-changed";
    Tr.AD_METADATA = "ad-metadata";
    Tr.AD_RECOVERABLE_ERROR = "ad-recoverable-error";
    Tr.AD_ERROR = "ad-error";
    Tr.AD_BREAK_READY = "ad-break-ready";
    Tr.AD_INTERACTION = "ad-interaction";
    Tr.AD_CONTENT_PAUSE_REQUESTED = "ad-content-pause-requested";
    Tr.AD_CONTENT_RESUME_REQUESTED = "ad-content-resume-requested";
    Tr.AD_CONTENT_ATTACH_REQUESTED = "ad-content-attach-requested";
    function Xr(a, b, c, d, e) {
      var f = this;
      this.A = a;
      this.i = b;
      this.G = false;
      this.C = this.u = null;
      this.H = NaN;
      this.l = e;
      this.j = null;
      this.h = new Qc();
      google.ima.settings.setLocale(c);
      google.ima.settings.setDisableCustomPlaybackForIOS10Plus(true);
      this.F = new google.ima.AdDisplayContainer(this.A, this.i);
      this.F.initialize();
      this.m = new google.ima.AdsLoader(this.F);
      this.m.getSettings().setPlayerType("shaka-player");
      this.m.getSettings().setPlayerVersion("v4.15.10");
      this.g = null;
      this.D = d || new google.ima.AdsRenderingSettings();
      this.h.o(
        this.m,
        google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,
        function(g) {
          Yr(f, g);
        }
      );
      this.h.o(this.m, google.ima.AdErrorEvent.Type.AD_ERROR, function(g) {
        Zr(f, g);
      });
      this.h.o(this.i, "ended", function() {
        f.m.contentComplete();
      });
      this.h.qa(this.i, "play", function() {
        f.G = true;
      });
    }
    Xr.prototype.configure = function(a) {
      this.u = a;
    };
    Xr.prototype.stop = function() {
      this.g && this.g.stop();
      this.A && Sj(this.A);
    };
    Xr.prototype.release = function() {
      this.stop();
      this.C && this.C.disconnect();
      this.h && this.h.release();
      this.g && this.g.destroy();
      this.m.destroy();
      this.F.destroy();
    };
    function Zr(a, b) {
      b.getError();
      b = (/* @__PURE__ */ new Map()).set("originalEvent", b);
      a.l(new T("ad-error", b));
      $r(a, null);
      a.l(new T("ad-cue-points-changed", (/* @__PURE__ */ new Map()).set("cuepoints", [])));
    }
    function Yr(a, b) {
      a.l(new T("ads-loaded", (/* @__PURE__ */ new Map()).set("loadTime", Date.now() / 1e3 - a.H)));
      if (a.u.customPlayheadTracker) {
        var c = { currentTime: a.i.currentTime };
        a.g = b.getAdsManager(c, a.D);
        a.i.muted ? a.g.setVolume(0) : a.g.setVolume(a.i.volume);
        a.h.o(a.i, "timeupdate", function() {
          a.i.duration && (c.currentTime = a.i.currentTime);
        });
        a.h.o(a.i, "volumechange", function() {
          a.j && (a.j.setVolume(a.i.volume), a.i.muted && a.j.setMuted(true));
        });
      } else a.g = b.getAdsManager(a.i, a.D);
      a.l(new T("ima-ad-manager-loaded", (/* @__PURE__ */ new Map()).set(
        "imaAdManager",
        a.g
      )));
      var d = a.g.getCuePoints();
      if (d.length) {
        b = [];
        d = t(d);
        for (var e = d.next(); !e.done; e = d.next()) b.push({ start: e.value, end: null });
        a.l(new T("ad-cue-points-changed", (/* @__PURE__ */ new Map()).set("cuepoints", b)));
      }
      as(a);
      try {
        a.g.init(a.i.offsetWidth, a.i.offsetHeight), a.h.o(a.i, "loadeddata", function() {
          a.g.resize(a.i.offsetWidth, a.i.offsetHeight);
        }), "ResizeObserver" in window2 ? (a.C = new ResizeObserver(function() {
          a.g.resize(a.i.offsetWidth, a.i.offsetHeight);
        }), a.C.observe(a.i)) : a.h.o(document, "fullscreenchange", function() {
          a.g.resize(
            a.i.offsetWidth,
            a.i.offsetHeight
          );
        }), a.G || a.u.skipPlayDetection ? a.g.start() : a.h.qa(a.i, "play", function() {
          a.G = true;
          a.g.start();
        });
      } catch (f) {
        $r(a, null);
      }
    }
    function as(a) {
      function b(c, d) {
        c = (/* @__PURE__ */ new Map()).set("originalEvent", c);
        a.l(new T(d, c));
      }
      a.h.o(a.g, google.ima.AdErrorEvent.Type.AD_ERROR, function(c) {
        Zr(a, c);
      });
      a.h.o(a.g, google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED, function(c) {
        bs(a, c);
      });
      a.h.o(a.g, google.ima.AdEvent.Type.STARTED, function(c) {
        bs(a, c);
      });
      a.h.o(a.g, google.ima.AdEvent.Type.FIRST_QUARTILE, function(c) {
        b(c, "ad-first-quartile");
      });
      a.h.o(a.g, google.ima.AdEvent.Type.MIDPOINT, function(c) {
        b(c, "ad-midpoint");
      });
      a.h.o(
        a.g,
        google.ima.AdEvent.Type.THIRD_QUARTILE,
        function(c) {
          b(c, "ad-third-quartile");
        }
      );
      a.h.o(a.g, google.ima.AdEvent.Type.COMPLETE, function(c) {
        b(c, "ad-complete");
      });
      a.h.o(a.g, google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED, function(c) {
        $r(a, c);
      });
      a.h.o(a.g, google.ima.AdEvent.Type.ALL_ADS_COMPLETED, function(c) {
        $r(a, c);
      });
      a.h.o(a.g, google.ima.AdEvent.Type.SKIPPED, function(c) {
        b(c, "ad-skipped");
      });
      a.h.o(a.g, google.ima.AdEvent.Type.VOLUME_CHANGED, function(c) {
        b(c, "ad-volume-changed");
      });
      a.h.o(a.g, google.ima.AdEvent.Type.VOLUME_MUTED, function(c) {
        b(c, "ad-muted");
      });
      a.h.o(a.g, google.ima.AdEvent.Type.PAUSED, function(c) {
        a.j && (a.j.i = true, b(c, "ad-paused"));
      });
      a.h.o(a.g, google.ima.AdEvent.Type.RESUMED, function(c) {
        a.j && (a.j.i = false, b(c, "ad-resumed"));
      });
      a.h.o(a.g, google.ima.AdEvent.Type.SKIPPABLE_STATE_CHANGED, function(c) {
        a.j && b(c, "ad-skip-state-changed");
      });
      a.h.o(a.g, google.ima.AdEvent.Type.CLICK, function(c) {
        b(c, "ad-clicked");
      });
      a.h.o(a.g, google.ima.AdEvent.Type.AD_PROGRESS, function(c) {
        b(c, "ad-progress");
      });
      a.h.o(a.g, google.ima.AdEvent.Type.AD_BUFFERING, function(c) {
        b(c, "ad-buffering");
      });
      a.h.o(a.g, google.ima.AdEvent.Type.IMPRESSION, function(c) {
        b(c, "ad-impression");
      });
      a.h.o(a.g, google.ima.AdEvent.Type.DURATION_CHANGE, function(c) {
        b(c, "ad-duration-changed");
      });
      a.h.o(a.g, google.ima.AdEvent.Type.USER_CLOSE, function(c) {
        b(c, "ad-closed");
      });
      a.h.o(a.g, google.ima.AdEvent.Type.LOADED, function(c) {
        b(c, "ad-loaded");
      });
      a.h.o(a.g, google.ima.AdEvent.Type.ALL_ADS_COMPLETED, function(c) {
        b(c, "all-ads-completed");
      });
      a.h.o(a.g, google.ima.AdEvent.Type.LINEAR_CHANGED, function(c) {
        b(c, "ad-linear-changed");
      });
      a.h.o(
        a.g,
        google.ima.AdEvent.Type.AD_METADATA,
        function(c) {
          b(c, "ad-metadata");
        }
      );
      a.h.o(a.g, google.ima.AdEvent.Type.LOG, function(c) {
        b(c, "ad-recoverable-error");
      });
      a.h.o(a.g, google.ima.AdEvent.Type.AD_BREAK_READY, function(c) {
        b(c, "ad-break-ready");
      });
      a.h.o(a.g, google.ima.AdEvent.Type.INTERACTION, function(c) {
        b(c, "ad-interaction");
      });
    }
    function bs(a, b) {
      var c = b.getAd();
      c ? (a.j = new Sr(c, a.g, a.i), b.type != google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED || a.u.supportsMultipleMediaElements || a.l(new T("ad-content-pause-requested")), b = (/* @__PURE__ */ new Map()).set("ad", a.j).set("sdkAdObject", c).set("originalEvent", b), a.l(new T("ad-started", b)), a.j.isLinear() && (a.A.setAttribute("ad-active", "true"), a.u.customPlayheadTracker || a.i.pause(), a.i.muted ? (b = a.j, b.j = a.i.volume, b.h.setVolume(0)) : a.j.setVolume(a.i.volume))) : bb("The IMA SDK fired a " + b.type + " event with no associated ad. Unable to play ad!");
    }
    function $r(a, b) {
      b && b.type == google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED && !a.u.supportsMultipleMediaElements && a.l(new T("ad-content-resume-requested"));
      a.l(new T("ad-stopped", (/* @__PURE__ */ new Map()).set("originalEvent", b)));
      a.j && a.j.isLinear() && (a.A.removeAttribute("ad-active"), a.u.customPlayheadTracker || a.i.ended || a.i.play());
    }
    ;
    function cs(a, b, c, d, e, f) {
      this.g = a;
      this.i = b;
      this.j = (this.h = b.isSkippable) ? b.skipOffset || 0 : b.skipOffset;
      this.l = b.skipFor;
      this.C = c;
      this.u = d;
      this.m = e;
      this.A = f;
      this.D = b.overlay;
    }
    p = cs.prototype;
    p.needsSkipUI = function() {
      return true;
    };
    p.isClientRendering = function() {
      return true;
    };
    p.hasCustomClick = function() {
      return false;
    };
    p.isUsingAnotherMediaElement = function() {
      return this.A;
    };
    p.getDuration = function() {
      var a = this.g.duration;
      return isNaN(a) ? -1 : a;
    };
    p.getMinSuggestedDuration = function() {
      return this.getDuration();
    };
    p.getRemainingTime = function() {
      var a = this.g.duration;
      return isNaN(a) ? -1 : a - this.g.currentTime;
    };
    p.isPaused = function() {
      return this.g.paused;
    };
    p.isSkippable = function() {
      return this.h && this.l != null ? this.getDuration() - this.getRemainingTime() < this.j + this.l : this.h;
    };
    p.getTimeUntilSkippable = function() {
      if (this.isSkippable()) {
        var a = this.getRemainingTime() + this.j - this.getDuration();
        return Math.max(a, 0);
      }
      return Math.max(this.getRemainingTime(), 0);
    };
    p.canSkipNow = function() {
      return this.h && this.getTimeUntilSkippable() == 0;
    };
    p.skip = function() {
      this.canSkipNow() && this.C();
    };
    p.pause = function() {
      return this.g.pause();
    };
    p.play = function() {
      return this.g.play();
    };
    p.getVolume = function() {
      return this.g.volume;
    };
    p.setVolume = function(a) {
      this.g.volume = a;
    };
    p.isMuted = function() {
      return this.g.muted;
    };
    p.isLinear = function() {
      return this.D == null;
    };
    p.resize = function() {
    };
    p.setMuted = function(a) {
      this.g.muted = a;
    };
    p.getSequenceLength = function() {
      return this.u;
    };
    p.getPositionInSequence = function() {
      return this.m;
    };
    p.getTitle = function() {
      return "";
    };
    p.getDescription = function() {
      return "";
    };
    p.getVastMediaBitrate = function() {
      return 0;
    };
    p.getVastMediaHeight = function() {
      return 0;
    };
    p.getVastMediaWidth = function() {
      return 0;
    };
    p.getVastAdId = function() {
      return "";
    };
    p.getAdId = function() {
      return this.i.id || "";
    };
    p.getCreativeAdId = function() {
      return "";
    };
    p.getAdvertiserName = function() {
      return "";
    };
    p.getMediaUrl = function() {
      return this.i.uri;
    };
    p.getTimeOffset = function() {
      return 0;
    };
    p.getPodIndex = function() {
      return 0;
    };
    p.release = function() {
      this.g = null;
    };
    S("shaka.ads.InterstitialAd", cs);
    cs.prototype.release = cs.prototype.release;
    cs.prototype.getPodIndex = cs.prototype.getPodIndex;
    cs.prototype.getTimeOffset = cs.prototype.getTimeOffset;
    cs.prototype.getMediaUrl = cs.prototype.getMediaUrl;
    cs.prototype.getAdvertiserName = cs.prototype.getAdvertiserName;
    cs.prototype.getCreativeAdId = cs.prototype.getCreativeAdId;
    cs.prototype.getAdId = cs.prototype.getAdId;
    cs.prototype.getVastAdId = cs.prototype.getVastAdId;
    cs.prototype.getVastMediaWidth = cs.prototype.getVastMediaWidth;
    cs.prototype.getVastMediaHeight = cs.prototype.getVastMediaHeight;
    cs.prototype.getVastMediaBitrate = cs.prototype.getVastMediaBitrate;
    cs.prototype.getDescription = cs.prototype.getDescription;
    cs.prototype.getTitle = cs.prototype.getTitle;
    cs.prototype.getPositionInSequence = cs.prototype.getPositionInSequence;
    cs.prototype.getSequenceLength = cs.prototype.getSequenceLength;
    cs.prototype.setMuted = cs.prototype.setMuted;
    cs.prototype.resize = cs.prototype.resize;
    cs.prototype.isLinear = cs.prototype.isLinear;
    cs.prototype.isMuted = cs.prototype.isMuted;
    cs.prototype.setVolume = cs.prototype.setVolume;
    cs.prototype.getVolume = cs.prototype.getVolume;
    cs.prototype.play = cs.prototype.play;
    cs.prototype.pause = cs.prototype.pause;
    cs.prototype.skip = cs.prototype.skip;
    cs.prototype.canSkipNow = cs.prototype.canSkipNow;
    cs.prototype.getTimeUntilSkippable = cs.prototype.getTimeUntilSkippable;
    cs.prototype.isSkippable = cs.prototype.isSkippable;
    cs.prototype.isPaused = cs.prototype.isPaused;
    cs.prototype.getRemainingTime = cs.prototype.getRemainingTime;
    cs.prototype.getMinSuggestedDuration = cs.prototype.getMinSuggestedDuration;
    cs.prototype.getDuration = cs.prototype.getDuration;
    cs.prototype.isUsingAnotherMediaElement = cs.prototype.isUsingAnotherMediaElement;
    cs.prototype.hasCustomClick = cs.prototype.hasCustomClick;
    cs.prototype.isClientRendering = cs.prototype.isClientRendering;
    cs.prototype.needsSkipUI = cs.prototype.needsSkipUI;
    function ds(a, b, c) {
      this.g = a;
      this.j = b;
      this.h = c;
      this.i = a.overlay == null;
    }
    p = ds.prototype;
    p.needsSkipUI = function() {
      return true;
    };
    p.isClientRendering = function() {
      return true;
    };
    p.hasCustomClick = function() {
      return false;
    };
    p.isUsingAnotherMediaElement = function() {
      return false;
    };
    p.getDuration = function() {
      return -1;
    };
    p.getMinSuggestedDuration = function() {
      return this.getDuration();
    };
    p.getRemainingTime = function() {
      return -1;
    };
    p.isPaused = function() {
      return false;
    };
    p.isSkippable = function() {
      return false;
    };
    p.getTimeUntilSkippable = function() {
      return 0;
    };
    p.canSkipNow = function() {
      return false;
    };
    p.skip = function() {
    };
    p.pause = function() {
    };
    p.play = function() {
    };
    p.getVolume = function() {
      return 1;
    };
    p.setVolume = function() {
    };
    p.isMuted = function() {
      return false;
    };
    p.isLinear = function() {
      return this.i;
    };
    p.resize = function() {
    };
    p.setMuted = function() {
    };
    p.getSequenceLength = function() {
      return this.j;
    };
    p.getPositionInSequence = function() {
      return this.h;
    };
    p.getTitle = function() {
      return "";
    };
    p.getDescription = function() {
      return "";
    };
    p.getVastMediaBitrate = function() {
      return 0;
    };
    p.getVastMediaHeight = function() {
      return 0;
    };
    p.getVastMediaWidth = function() {
      return 0;
    };
    p.getVastAdId = function() {
      return "";
    };
    p.getAdId = function() {
      return this.g.id || "";
    };
    p.getCreativeAdId = function() {
      return "";
    };
    p.getAdvertiserName = function() {
      return "";
    };
    p.getMediaUrl = function() {
      return this.g.uri;
    };
    p.getTimeOffset = function() {
      return 0;
    };
    p.getPodIndex = function() {
      return 0;
    };
    p.release = function() {
    };
    S("shaka.ads.InterstitialStaticAd", ds);
    ds.prototype.release = ds.prototype.release;
    ds.prototype.getPodIndex = ds.prototype.getPodIndex;
    ds.prototype.getTimeOffset = ds.prototype.getTimeOffset;
    ds.prototype.getMediaUrl = ds.prototype.getMediaUrl;
    ds.prototype.getAdvertiserName = ds.prototype.getAdvertiserName;
    ds.prototype.getCreativeAdId = ds.prototype.getCreativeAdId;
    ds.prototype.getAdId = ds.prototype.getAdId;
    ds.prototype.getVastAdId = ds.prototype.getVastAdId;
    ds.prototype.getVastMediaWidth = ds.prototype.getVastMediaWidth;
    ds.prototype.getVastMediaHeight = ds.prototype.getVastMediaHeight;
    ds.prototype.getVastMediaBitrate = ds.prototype.getVastMediaBitrate;
    ds.prototype.getDescription = ds.prototype.getDescription;
    ds.prototype.getTitle = ds.prototype.getTitle;
    ds.prototype.getPositionInSequence = ds.prototype.getPositionInSequence;
    ds.prototype.getSequenceLength = ds.prototype.getSequenceLength;
    ds.prototype.setMuted = ds.prototype.setMuted;
    ds.prototype.resize = ds.prototype.resize;
    ds.prototype.isLinear = ds.prototype.isLinear;
    ds.prototype.isMuted = ds.prototype.isMuted;
    ds.prototype.setVolume = ds.prototype.setVolume;
    ds.prototype.getVolume = ds.prototype.getVolume;
    ds.prototype.play = ds.prototype.play;
    ds.prototype.pause = ds.prototype.pause;
    ds.prototype.skip = ds.prototype.skip;
    ds.prototype.canSkipNow = ds.prototype.canSkipNow;
    ds.prototype.getTimeUntilSkippable = ds.prototype.getTimeUntilSkippable;
    ds.prototype.isSkippable = ds.prototype.isSkippable;
    ds.prototype.isPaused = ds.prototype.isPaused;
    ds.prototype.getRemainingTime = ds.prototype.getRemainingTime;
    ds.prototype.getMinSuggestedDuration = ds.prototype.getMinSuggestedDuration;
    ds.prototype.getDuration = ds.prototype.getDuration;
    ds.prototype.isUsingAnotherMediaElement = ds.prototype.isUsingAnotherMediaElement;
    ds.prototype.hasCustomClick = ds.prototype.hasCustomClick;
    ds.prototype.isClientRendering = ds.prototype.isClientRendering;
    ds.prototype.needsSkipUI = ds.prototype.needsSkipUI;
    function es(a, b, c, d) {
      var e = this;
      this.M = null;
      this.D = a;
      this.F = b;
      this.g = c;
      this.H = null;
      this.C = true;
      this.h = this.g;
      this.i = d;
      this.S = /* @__PURE__ */ new Set();
      this.I = /* @__PURE__ */ new Set();
      this.G = /* @__PURE__ */ new Map();
      this.L = /* @__PURE__ */ new Map();
      this.j = new Y();
      fs(this);
      this.J = new Qc();
      this.l = new Qc();
      this.K = false;
      this.$ = this.u = this.A = this.m = null;
      this.aa = false;
      this.P = -1;
      this.Z = function() {
        if (!e.K && e.m && !e.F.Da()) {
          e.m = e.g.currentTime;
          var f = gs(e);
          f && hs(e, f, 1, 1, Date.now());
        }
      };
      this.V = function() {
        if (!(e.K || e.m || e.F.Da())) {
          e.m = e.g.currentTime;
          var f = gs(e, true);
          f || (f = gs(e));
          f && hs(e, f, 1, 1, Date.now());
        }
      };
      this.ea = function() {
        if (!e.K && e.m && !e.F.Da()) {
          var f = e.g.currentTime;
          e.A && !e.A.pre && !e.A.post && f < (e.A.endTime || e.A.startTime) && (e.A = null);
        }
      };
      this.R = new Cf(this.Z);
      this.O = new Cf(function() {
        var f, g, h, k2, l, m, n, q, r, u, w;
        return P(function(v) {
          switch (v.g) {
            case 1:
              if (!e.I.size || e.m == null) {
                v.B(0);
                break;
              }
              f = e.F.m;
              if (f == uq || f == jq) return v.return();
              g = false;
              h = Array.from(e.I);
              k2 = e.F.ya();
              l = t(h);
              m = l.next();
            case 3:
              if (m.done) {
                v.B(5);
                break;
              }
              n = m.value;
              if (n == e.A) {
                v.B(4);
                break;
              }
              q = n.endTime || n.startTime;
              if (!(k2.start - q >= 1)) {
                r = n.startTime - e.m;
                r > 0 && r <= 10 && (!e.G.has(n) && is(n) && e.G.set(n, e.j.preload(n.uri, null, n.mimeType || void 0)), js(e, n));
                v.B(4);
                break;
              }
              if (!e.G.has(n)) {
                v.B(7);
                break;
              }
              return G(v, e.G.get(n), 8);
            case 8:
              (u = v.h) && u.destroy(), e.G.delete(n);
            case 7:
              ks(e, n), w = JSON.stringify(n), e.S.has(w) && e.S.delete(w), e.I.delete(n), ls(e), n.overlay || (g = true);
            case 4:
              m = l.next();
              v.B(3);
              break;
            case 5:
              g && ms(e), H(v);
          }
        });
      });
      this.configure(this.F.getConfiguration().ads);
    }
    p = es.prototype;
    p.configure = function(a) {
      this.M = a;
      ns(this);
    };
    function os(a) {
      if (!a.aa && a.I.size) {
        a.J.o(a.g, "playing", a.V);
        a.J.o(a.g, "timeupdate", a.V);
        a.J.o(a.g, "seeked", a.ea);
        a.J.o(a.g, "ended", a.Z);
        if ("requestVideoFrameCallback" in a.g && !ps()) {
          var b = a.g, c = function() {
            a.P != -1 && (a.Z(), a.P != -1 && (a.P = b.requestVideoFrameCallback(c)));
          };
          a.P = b.requestVideoFrameCallback(c);
        } else a.R.za(0.025);
        a.O && a.O.za(1);
        a.aa = true;
      }
    }
    function ls(a) {
      a.aa && !a.I.size && (a.J.Ea(a.g, "playing", a.V), a.J.Ea(a.g, "timeupdate", a.V), a.J.Ea(a.g, "seeked", a.ea), a.J.Ea(a.g, "ended", a.Z), a.P != -1 && (a.g.cancelVideoFrameCallback(a.P), a.P = -1), a.R && a.R.stop(), a.O && a.O.stop(), a.aa = false);
    }
    function ns(a) {
      if (a.D && a.M && !a.K) {
        var b = a.M.supportsMultipleMediaElements, c = a.g;
        c.webkitPresentationMode && c.webkitPresentationMode !== "inline" && (b = false);
        a.C == b && (a.C = !b, a.C ? (a.h = a.g, a.H && (a.H.parentElement && a.D.removeChild(a.H), a.H = null)) : (a.H || (b = document.createElement(a.g.tagName), b.autoplay = true, b.style.position = "absolute", b.style.top = "0", b.style.left = "0", b.style.width = "100%", b.style.height = "100%", b.style.display = "none", b.setAttribute("playsinline", ""), a.H = b), a.h = a.H));
      } else a.C = true;
    }
    p.stop = function() {
      this.l && this.l.Ta();
      this.S.clear();
      this.I.clear();
      this.j.Vg();
      if (this.G.size) {
        var a = Array.from(this.G.values());
        a = t(a);
        for (var b = a.next(); !b.done; b = a.next()) (b = b.value) && b.then(function(c) {
          c && c.destroy();
        });
      }
      this.G.clear();
      if (this.L.size) for (a = Array.from(this.L.keys()), a = t(a), b = a.next(); !b.done; b = a.next()) ks(this, b.value);
      this.L.clear();
      this.j.detach();
      this.K = false;
      this.A = this.m = null;
      this.C = true;
      this.h = this.g;
      this.H = null;
      qs(this);
      ls(this);
      this.D && Sj(this.D);
      this.u && (this.u.stop(), this.u = null);
    };
    p.release = function() {
      this.stop();
      this.J && this.J.release();
      this.l && this.l.release();
      this.R && (this.R.stop(), this.R = null);
      this.O && (this.O.stop(), this.O = null);
      this.j.destroy();
    };
    p.Vb = function() {
      return this.j;
    };
    function rs(a, b) {
      var c;
      P(function(d) {
        if (d.g == 1) return fs(a), G(d, ss(a, b), 2);
        c = d.h;
        c.length ? ts(a, c) : bb("Unsupported HLS interstitial", b);
        H(d);
      });
    }
    function us(a, b) {
      var c = Xd(b.eventNode, "OverlayEvent"), d = c.attributes.uri, e = c.attributes.mimeType, f = c.attributes.loop == "true", g = $d(c, "z", fe);
      if (d && g != 0) {
        var h = null, k2 = Xd(c, "Background");
        if (k2) {
          var l = k2.attributes.uri;
          l ? h = "center / contain no-repeat url('" + l + "')" : h = Ud(k2);
        }
        k2 = 1920;
        l = 1080;
        var m = Xd(c, "Viewport");
        if (m) {
          k2 = $d(m, "x", fe);
          if (k2 == null) return;
          l = $d(m, "y", fe);
          if (l == null) return;
        }
        var n = { viewport: { x: k2, y: l }, topLeft: { x: 0, y: 0 }, size: { x: k2, y: l } }, q = Xd(c, "Overlay");
        if (m && q) {
          var r = Xd(q, "TopLeft"), u = Xd(q, "Size");
          if (r && u) {
            q = $d(r, "x", fe);
            if (q == null) return;
            r = $d(r, "y", fe);
            if (r == null) return;
            var w = $d(u, "x", fe);
            if (w == null) return;
            u = $d(u, "y", fe);
            if (u == null) return;
            n.topLeft.x = q;
            n.topLeft.y = r;
            n.size.x = w;
            n.size.y = u;
          }
        }
        q = null;
        c = Xd(c, "Squeeze");
        if (m && c && (u = Xd(c, "TopLeft"), c = Xd(c, "Size"), u && c)) {
          m = $d(u, "x", fe);
          if (m == null) return;
          q = $d(u, "y", fe);
          if (q == null) return;
          u = $d(c, "x", fe);
          if (u == null) return;
          c = $d(c, "y", fe);
          if (c == null) return;
          q = { viewport: { x: k2, y: l }, topLeft: { x: m, y: q }, size: { x: u, y: c } };
        }
        ts(a, [{
          id: b.id,
          groupId: null,
          startTime: b.startTime,
          endTime: b.endTime,
          uri: d,
          mimeType: e,
          isSkippable: false,
          skipOffset: null,
          skipFor: null,
          canJump: true,
          resumeOffset: null,
          playoutLimit: null,
          once: false,
          pre: false,
          post: false,
          timelineRange: true,
          loop: f,
          overlay: n,
          displayOnBackground: g == -1,
          currentVideo: q,
          background: h
        }]);
      }
    }
    p.addAdUrlInterstitial = function(a) {
      var b = this, c, d, e, f, g, h, k2, l, m;
      return P(function(n) {
        if (n.g == 1) return c = { type: 12 }, G(n, vs(b, a, c), 2);
        if (n.g != 3) {
          d = n.h;
          e = Kd(d, "VAST,vmap:VMAP");
          if (!e) throw new U(2, 10, 10007);
          f = [];
          if (e.tagName == "VAST") return f = Ur(e, b.m), n.B(3);
          if (e.tagName != "vmap:VMAP") return n.B(3);
          g = function(q) {
            var r, u;
            return P(function(w) {
              if (w.g == 1) return G(w, vs(b, q.uri, c), 2);
              r = w.h;
              u = Kd(r, "VAST");
              if (!u) throw new U(2, 10, 10007);
              f.push.apply(f, x(Ur(u, q.time)));
              H(w);
            });
          };
          h = [];
          k2 = t(Wr(e));
          for (l = k2.next(); !l.done; l = k2.next()) m = l.value, h.push(g(m));
          return h.length ? G(n, Promise.all(h), 3) : n.B(3);
        }
        ts(b, f);
        H(n);
      });
    };
    function ts(a, b) {
      var c, d, e, f, g, h, k2, l;
      P(function(m) {
        switch (m.g) {
          case 1:
            c = false, d = t(b), e = d.next();
          case 2:
            if (e.done) {
              m.B(4);
              break;
            }
            f = e.value;
            if (!f.uri) {
              bb("Missing URL in interstitial", f);
              m.B(3);
              break;
            }
            if (f.mimeType) {
              m.B(5);
              break;
            }
            sa(m, 6);
            g = a.j.Lb();
            return G(m, Jo(f.uri, g, a.F.getConfiguration().streaming.retryParameters), 8);
          case 8:
            f.mimeType = m.h;
            ua(m, 5);
            break;
          case 6:
            va(m);
          case 5:
            h = f.id || JSON.stringify(f);
            if (a.S.has(h)) {
              m.B(3);
              break;
            }
            f.loop && !f.overlay && bb("Loop is only supported in overlay interstitials", f);
            f.overlay || (c = true);
            a.S.add(h);
            a.I.add(f);
            k2 = false;
            f.pre && a.m == null ? k2 = true : f.startTime != 0 || f.canJump ? a.m != null && (l = f.startTime - a.m, l > 0 && l <= 10 && (k2 = true)) : k2 = true;
            k2 && (!a.G.has(f) && is(f) && a.G.set(f, a.j.preload(f.uri, null, f.mimeType || void 0)), js(a, f));
          case 3:
            e = d.next();
            m.B(2);
            break;
          case 4:
            c && ms(a), os(a), H(m);
        }
      });
    }
    function gs(a, b, c) {
      b = b === void 0 ? false : b;
      c = c === void 0 ? null : c;
      var d = 0, e = null;
      if (a.I.size && a.m != null) {
        var f = a.g.ended, g = Array.from(a.I).sort(function(n, q) {
          return q.startTime - n.startTime;
        }), h = g;
        h = b ? g.filter(function(n) {
          return n.pre;
        }) : f ? g.filter(function(n) {
          return n.post;
        }) : g.filter(function(n) {
          return !n.pre && !n.post;
        });
        g = t(h);
        for (h = g.next(); !h.done; h = g.next()) {
          h = h.value;
          var k2 = false;
          if (b) k2 = h.pre;
          else if (f) k2 = h.post;
          else if (!h.pre && !h.post) {
            var l = a.m - Math.round(h.startTime * 1e3) / 1e3, m = 1;
            a.M.allowStartInMiddleOfInterstitial && h.endTime && h.endTime != Infinity && (m = h.endTime - h.startTime);
            (l > 0 || l == 0 && a.m == 0) && (l <= m || !h.canJump) && (k2 = c == null && a.A && !a.A.pre && !a.A.post && a.A.startTime >= h.startTime ? false : true);
          }
          k2 && (!a.A || h.startTime >= a.A.startTime) && (d == (c || 0) ? e = h : e && !h.canJump && Math.round(h.startTime * 1e3) / 1e3 - Math.round(e.startTime * 1e3) / 1e3 > 1e-3 && (e = h, d = 0), d++);
        }
      }
      return e;
    }
    function hs(a, b, c, d, e, f) {
      f = f === void 0 ? 0 : f;
      a.A = b;
      ns(a);
      a.C || !a.D || a.h.parentElement || a.D.appendChild(a.h);
      d == 1 && c == 1 && (c = Array.from(a.I).filter(function(g) {
        return b.pre ? g.pre == b.pre : b.post ? g.post == b.post : Math.abs(g.startTime - b.startTime) < 1e-3;
      }).length);
      b.once && (f++, a.I.delete(b), ls(a), b.overlay || ms(a));
      b.mimeType && (b.mimeType.startsWith("image/") || b.mimeType === "text/html") ? b.overlay ? ws(a, b, c, d, f) : bb("Unsupported interstitial", b) : a.C && b.overlay ? bb("Unsupported interstitial", b) : xs(a, b, c, d, e, f);
    }
    function ws(a, b, c, d, e) {
      function f() {
        a.u && (a.u.stop(), a.u = null);
        a.D.removeChild(k2);
        qs(a, b);
        a.i(new T("ad-stopped"));
        a.l.Ta();
        var q = gs(a, b.pre, d - e);
        q ? hs(a, q, c, ++d, Date.now(), e) : a.K = false;
      }
      a.K = true;
      var g = b.overlay, h = b.mimeType == "text/html" ? "iframe" : "img", k2 = document.createElement(h);
      k2.style.objectFit = "contain";
      k2.style.position = "absolute";
      k2.style.border = "none";
      ys(a, b);
      a.i(new T("ad-started", (/* @__PURE__ */ new Map()).set("ad", new ds(b, c, d))));
      h == "iframe" ? k2.src = b.uri : (k2.src = b.uri, k2.onerror = function(q) {
        a.i(new T("ad-error", (/* @__PURE__ */ new Map()).set(
          "originalEvent",
          q
        )));
        f();
      });
      var l = g.viewport, m = g.topLeft;
      g = g.size;
      l.x == 0 && l.y == 0 ? (k2.width = b.overlay.size.x, k2.height = b.overlay.size.y, k2.style.bottom = "10%", k2.style.left = "0", k2.style.right = "0", k2.style.width = "100%", b.overlay.size.y || h != "iframe" || (k2.style.height = "auto")) : (k2.style.height = g.y / l.y * 100 + "%", k2.style.left = m.x / l.x * 100 + "%", k2.style.top = m.y / l.y * 100 + "%", k2.style.width = g.x / l.x * 100 + "%");
      a.D.appendChild(k2);
      var n = Date.now();
      a.u && a.u.stop();
      a.u = new Cf(function() {
        b.playoutLimit && (Date.now() - n) / 1e3 > b.playoutLimit ? (a.i(new T("ad-complete")), f()) : b.endTime && a.g.currentTime > b.endTime ? (a.i(new T("ad-complete")), f()) : a.g.currentTime < b.startTime && (a.i(new T("ad-skipped")), f());
      });
      b.playoutLimit && !b.endTime ? a.u.Y(b.playoutLimit) : b.endTime && a.u.za(0.025);
      a.l.o(a.g, "seeked", function() {
        var q = a.g.currentTime;
        if (q < b.startTime || b.endTime && q > b.endTime) a.u && a.u.stop(), a.i(new T("ad-skipped")), f();
      });
    }
    function xs(a, b, c, d, e, f) {
      var g, h, k2, l, m, n, q, r, u, w, v, y, z, A, C, D, F, B, E, I;
      P(function(J) {
        switch (J.g) {
          case 1:
            g = Date.now();
            a.K = true;
            h = false;
            k2 = function() {
              if (!a.C && !b.overlay && b.resumeOffset == null) if (b.timelineRange && b.endTime && b.endTime != Infinity) a.g.currentTime != b.endTime && (a.g.currentTime = b.endTime);
              else {
                var K = Date.now();
                a.g.currentTime += (K - e) / 1e3;
                e = K;
              }
            };
            l = function(K) {
              var L, M;
              return P(function(N) {
                if (N.g == 1) {
                  k2();
                  L = gs(a, b.pre, d - f);
                  if (K && b.groupId) for (; L && L.groupId == b.groupId; ) d++, L = gs(a, b.pre, d - f);
                  a.u && (!b.groupId || L && L.groupId != b.groupId) && (a.u.stop(), a.u = null);
                  qs(a, b);
                  if (L && !L.overlay) return N.B(2);
                  b.post && (a.m = null, a.A = null);
                  return a.C ? G(N, a.j.detach(), 4) : G(N, a.j.rc(), 4);
                }
                N.g != 2 && (a.C && (M = b.resumeOffset, M == null && (M = b.timelineRange && b.endTime && b.endTime != Infinity ? b.endTime - (a.m || 0) : (Date.now() - e) / 1e3), a.i(new T("ad-content-resume-requested", (/* @__PURE__ */ new Map()).set("offset", M)))), a.i(new T("ad-stopped")), a.l.Ta(), a.K = false, a.C ? ms(a) : (a.h.style.display = "none", k2(), a.g.ended || a.g.play()));
                ns(a);
                L && (a.i(new T("ad-stopped")), a.l.Ta(), hs(a, L, c, ++d, e, f));
                H(N);
              });
            };
            m = function(K) {
              return P(function(L) {
                if (h) return L.return();
                h = true;
                a.i(new T("ad-error", (/* @__PURE__ */ new Map()).set("originalEvent", K)));
                return G(L, l(false), 0);
              });
            };
            n = function() {
              return P(function(K) {
                if (K.g == 1) {
                  if (h) return K.return();
                  h = true;
                  return G(K, l(false), 2);
                }
                a.i(new T("ad-complete"));
                H(K);
              });
            };
            a.$ = function() {
              return P(function(K) {
                if (h) return K.return();
                h = true;
                a.i(new T("ad-skipped"));
                return G(K, l(true), 0);
              });
            };
            q = new cs(a.h, b, a.$, c, d, !a.C);
            a.C || (q.setMuted(a.g.muted), q.setVolume(a.g.volume));
            a.i(new T(
              "ad-started",
              (/* @__PURE__ */ new Map()).set("ad", q)
            ));
            (r = q.canSkipNow()) && a.i(new T("ad-skip-state-changed"));
            a.l.qa(a.j, "error", m);
            a.l.o(a.h, "timeupdate", function() {
              if (a.h.duration) {
                var K = q.canSkipNow();
                r != K && q.getRemainingTime() > 0 && q.getDuration() > 0 && a.i(new T("ad-skip-state-changed"));
                r = K;
              }
            });
            a.l.qa(a.j, "firstquartile", function() {
              k2();
              a.i(new T("ad-first-quartile"));
            });
            a.l.qa(a.j, "midpoint", function() {
              k2();
              a.i(new T("ad-midpoint"));
            });
            a.l.qa(a.j, "thirdquartile", function() {
              k2();
              a.i(new T("ad-third-quartile"));
            });
            a.l.qa(
              a.j,
              "complete",
              n
            );
            a.l.o(a.h, "play", function() {
              a.i(new T("ad-resumed"));
            });
            a.l.o(a.h, "pause", function() {
              var K = a.j.getConfiguration();
              a.h.currentTime >= K.playRangeEnd ? n() : a.i(new T("ad-paused"));
            });
            a.l.o(a.h, "volumechange", function() {
              a.h.muted ? a.i(new T("ad-muted")) : a.i(new T("ad-volume-changed"));
            });
            if (!a.C || d != 1) {
              J.B(2);
              break;
            }
            a.i(new T("ad-content-pause-requested", (/* @__PURE__ */ new Map()).set("saveLivePosition", true)));
            u = new Mg();
            w = function(K) {
              return P(function(L) {
                if (L.g == 1) return K.state != "detach" ? L.B(0) : ps() ? G(
                  L,
                  new Promise(function(M) {
                    return new Cf(M).Y(0.1);
                  }),
                  3
                ) : L.B(3);
                u.resolve();
                a.l.Ea(a.F, "onstatechange", w);
                H(L);
              });
            };
            a.l.o(a.F, "onstatechange", w);
            return G(J, u, 2);
          case 2:
            return ys(a, b), a.C || (a.h.style.display = "", b.overlay ? (a.h.loop = b.loop, v = b.overlay.viewport, y = b.overlay.topLeft, z = b.overlay.size, a.h.style.height = z.y / v.y * 100 + "%", a.h.style.left = y.x / v.x * 100 + "%", a.h.style.top = y.y / v.y * 100 + "%", a.h.style.width = z.x / v.x * 100 + "%") : (a.g.pause(), b.resumeOffset != null && b.resumeOffset != 0 && (a.g.currentTime += b.resumeOffset), a.h.loop = false, a.h.style.height = "100%", a.h.style.left = "0", a.h.style.top = "0", a.h.style.width = "100%")), sa(J, 4), fs(a), b.startTime && b.endTime && b.endTime != Infinity && b.startTime != b.endTime && (A = b.endTime - b.startTime, A > 0 && a.j.configure("playRangeEnd", A)), b.playoutLimit && !a.u && (a.u = new Cf(function() {
              a.$();
            }).Y(b.playoutLimit), a.j.configure("playRangeEnd", b.playoutLimit)), G(J, a.j.bc(a.h), 6);
          case 6:
            return C = null, a.M.allowStartInMiddleOfInterstitial && a.m != null && (D = a.m - b.startTime, Math.abs(D) > 0.25 && (C = D)), a.G.has(b) ? G(J, a.G.get(b), 10) : G(J, a.j.load(b.uri, C, b.mimeType || void 0), 8);
          case 10:
            return F = J.h, a.G.delete(b), F ? G(J, a.j.load(F), 8) : G(J, a.j.load(b.uri, C, b.mimeType || void 0), 8);
          case 8:
            a.h.play();
            B = (Date.now() - g) / 1e3;
            a.i(new T("ads-loaded", (/* @__PURE__ */ new Map()).set("loadTime", B)));
            a.C && a.g.play();
            b.overlay && (E = function() {
              var K = a.g.currentTime - b.startTime;
              Math.abs(K - a.h.currentTime) > 0.1 && (a.h.currentTime = K);
            }, a.l.qa(a.h, "playing", E), a.l.o(a.g, "seeking", E), a.l.o(a.g, "seeked", function() {
              var K = a.g.currentTime;
              (K < b.startTime || b.endTime && K > b.endTime) && a.$();
            }));
            ua(J, 0);
            break;
          case 4:
            I = va(J);
            if (!a.K) return J.return();
            m(I);
            H(J);
        }
      });
    }
    function ys(a, b) {
      b.displayOnBackground && (a.g.style.zIndex = "1");
      if (b.currentVideo != null) {
        var c = b.currentVideo;
        a.g.style.transformOrigin = "top left";
        var d = true, e = [], f = c.topLeft.x / c.viewport.x * 100;
        f > 0 && f <= 100 && (e.push("translateX(" + f + "%)"), d = false);
        f = c.topLeft.y / c.viewport.y * 100;
        f > 0 && f <= 100 && (e.push("translateY(" + f + "%)"), d = false);
        f = c.size.x / c.viewport.x;
        f < 1 && e.push("scaleX(" + f + ")");
        c = c.size.y / c.viewport.y;
        f < 1 && e.push("scaleY(" + c + ")");
        e.length && (a.g.style.transform = e.join(" "));
        d && (a.g.style.transition = "transform 250ms");
      }
      a.D && (a.D.style.pointerEvents = "none", b.background && (a.D.style.background = b.background));
      a.H && (a.H.style.background = b.overlay ? "" : "rgb(0, 0, 0)");
    }
    function qs(a, b) {
      if (!b || b.displayOnBackground) a.g.style.zIndex = "";
      b && b.currentVideo == null || (a.g.style.transformOrigin = "", a.g.style.transition = "", a.g.style.transform = "");
      a.D && (a.D.style.pointerEvents = "", !b || b.background) && (a.D.style.background = "");
      a.H && (a.H.style.background = "");
    }
    function ss(a, b) {
      var c, d, e, f, g, h, k2, l, m, n, q, r, u, w, v, y, z, A, C, D, F, B, E, I, J, K, L, M, N, O, Q, R, V, Ba, aa, Oa, La, Ja, Ea, ya, Fa, Da;
      return P(function(za) {
        switch (za.g) {
          case 1:
            c = [];
            if (!b) return za.return(c);
            d = b.values.find(function(Ca) {
              return Ca.key == "X-ASSET-URI";
            });
            e = b.values.find(function(Ca) {
              return Ca.key == "X-ASSET-LIST";
            });
            if (!d && !e) return za.return(c);
            f = null;
            if (g = b.values.find(function(Ca) {
              return Ca.key == "ID";
            })) f = g.data;
            h = f == null ? Math.floor(b.startTime * 10) / 10 : b.startTime;
            (k2 = b.endTime) && b.endTime != Infinity && typeof b.endTime == "number" && (k2 = f == null ? Math.floor(b.endTime * 10) / 10 : b.endTime);
            l = b.values.find(function(Ca) {
              return Ca.key == "X-RESTRICT";
            });
            n = m = true;
            l && l.data && (q = l.data, m = !q.includes("SKIP"), n = !q.includes("JUMP"));
            r = m ? 0 : null;
            if (u = b.values.find(function(Ca) {
              return Ca.key == "X-ENABLE-SKIP-AFTER";
            })) w = u.data, r = parseFloat(w), isNaN(r) && (r = m ? 0 : null);
            v = null;
            if (y = b.values.find(function(Ca) {
              return Ca.key == "X-ENABLE-SKIP-FOR";
            })) z = y.data, v = parseFloat(z), isNaN(r) && (v = null);
            A = null;
            if (C = b.values.find(function(Ca) {
              return Ca.key == "X-RESUME-OFFSET";
            })) D = C.data, A = parseFloat(D), isNaN(A) && (A = null);
            F = null;
            if (B = b.values.find(function(Ca) {
              return Ca.key == "X-PLAYOUT-LIMIT";
            })) E = B.data, F = parseFloat(E), isNaN(F) && (F = null);
            K = J = I = false;
            if (L = b.values.find(function(Ca) {
              return Ca.key == "CUE";
            })) M = L.data, I = M.includes("ONCE"), J = M.includes("PRE"), K = M.includes("POST");
            N = false;
            (O = b.values.find(function(Ca) {
              return Ca.key == "X-TIMELINE-OCCUPIES";
            })) ? (Q = O.data, N = Q.includes("RANGE")) : !C && a.F.U() && (N = !J && !K);
            if (d) {
              R = d.data;
              if (!R) return za.return(c);
              c.push({
                id: f,
                groupId: null,
                startTime: h,
                endTime: k2,
                uri: R,
                mimeType: null,
                isSkippable: m,
                skipOffset: r,
                skipFor: v,
                canJump: n,
                resumeOffset: A,
                playoutLimit: F,
                once: I,
                pre: J,
                post: K,
                timelineRange: N,
                loop: false,
                overlay: null,
                displayOnBackground: false,
                currentVideo: null,
                background: null
              });
              za.B(2);
              break;
            }
            if (!e) {
              za.B(2);
              break;
            }
            V = e.data;
            if (!V) return za.return(c);
            sa(za, 4);
            Ba = { type: 11 };
            return G(za, vs(a, V, Ba), 6);
          case 6:
            aa = za.h;
            Oa = Xb(aa);
            La = JSON.parse(Oa);
            if (Ja = La["SKIP-CONTROL"]) Ea = Ja["ENABLE-SKIP-AFTER"], typeof Ea == "number" && (r = parseFloat(Ea), isNaN(Ea) && (r = m ? 0 : null)), ya = Ja["ENABLE-SKIP-FOR"], typeof ya == "number" && (v = parseFloat(ya), isNaN(ya) && (v = null));
            for (Fa = 0; Fa < La.ASSETS.length; Fa++) Da = La.ASSETS[Fa], Da.URI && c.push({ id: f + "_shaka_asset_" + Fa, groupId: f, startTime: h, endTime: k2, uri: Da.URI, mimeType: null, isSkippable: m, skipOffset: r, skipFor: v, canJump: n, resumeOffset: A, playoutLimit: F, once: I, pre: J, post: K, timelineRange: N, loop: false, overlay: null, displayOnBackground: false, currentVideo: null, background: null });
            ua(za, 2);
            break;
          case 4:
            va(za);
          case 2:
            return za.return(c);
        }
      });
    }
    function ms(a) {
      for (var b = [], c = t(a.I), d = c.next(), e = {}; !d.done; e = { Gc: void 0 }, d = c.next()) d = d.value, d.overlay || (e.Gc = { start: d.startTime, end: null }, d.pre ? (e.Gc.start = 0, e.Gc.end = null) : d.post ? (e.Gc.start = -1, e.Gc.end = null) : d.timelineRange && (e.Gc.end = d.endTime), b.find(/* @__PURE__ */ function(f) {
        return function(g) {
          return f.Gc.start == g.start && f.Gc.end == g.end;
        };
      }(e)) || b.push(e.Gc));
      a.i(new T("ad-cue-points-changed", (/* @__PURE__ */ new Map()).set("cuepoints", b)));
    }
    function fs(a) {
      a.j.configure(a.F.Zi());
      a.j.configure("ads.disableHLSInterstitial", true);
      a.j.configure("ads.disableDASHInterstitial", true);
      a.j.configure("playRangeEnd", Infinity);
      $g(a.F.Lb(), a.j.Lb());
    }
    function vs(a, b, c) {
      var d, e, f;
      return P(function(g) {
        if (g.g == 1) return d = ah([b], Kg()), e = a.F.Lb().request(7, d, c), G(g, e.promise, 2);
        f = g.h;
        return g.return(f.data);
      });
    }
    function is(a) {
      return (a = a.mimeType) ? !a.startsWith("image/") && a !== "text/html" : true;
    }
    function ps() {
      var a = Sb().Ka();
      return a == "TV" || a == "CONSOLE" || a == "CAST" ? true : false;
    }
    function js(a, b) {
      if (!(a.L.has(b) || a.M && !a.M.allowPreloadOnDomElements)) {
        var c = function(f) {
          var g = document.createElement("link");
          g.rel = "preload";
          g.href = f;
          g.as = "image";
          document.head.appendChild(g);
          return g;
        }, d = [];
        if (b.background) {
          var e = b.background.match(/url\(('|")?([^'"()]+)('|")\)?/);
          e && d.push(c(e[2]));
        }
        b.mimeType.startsWith("image/") && d.push(c(b.uri));
        a.L.set(b, d);
      }
    }
    function ks(a, b) {
      if (a.L.has(b)) {
        var c = a.L.get(b);
        c = t(c);
        for (var d = c.next(); !d.done; d = c.next()) d = d.value, d.parentNode.removeChild(d);
        a.L.delete(b);
      }
    }
    ;
    function zs(a, b, c, d, e) {
      this.h = a;
      this.j = Fd(this.h.skipOffset);
      this.g = e;
      this.i = b;
      this.l = c;
      this.u = d;
      this.m = false;
    }
    p = zs.prototype;
    p.needsSkipUI = function() {
      return true;
    };
    p.isClientRendering = function() {
      return false;
    };
    p.hasCustomClick = function() {
      return false;
    };
    p.isUsingAnotherMediaElement = function() {
      return false;
    };
    p.getDuration = function() {
      return this.h.durationInSeconds;
    };
    p.getMinSuggestedDuration = function() {
      return this.getDuration();
    };
    p.getRemainingTime = function() {
      return this.h.startTimeInSeconds + this.h.durationInSeconds - this.g.currentTime;
    };
    p.isPaused = function() {
      return this.g.paused;
    };
    p.isSkippable = function() {
      return typeof this.j == "number" ? true : false;
    };
    p.getTimeUntilSkippable = function() {
      if (typeof this.j != "number") return this.getRemainingTime();
      var a = this.getRemainingTime() + this.j - this.getDuration();
      return Math.max(a, 0);
    };
    p.canSkipNow = function() {
      return this.getTimeUntilSkippable() == 0;
    };
    p.skip = function() {
      this.m = true;
      this.g.currentTime += this.getRemainingTime();
    };
    p.pause = function() {
      return this.g.pause();
    };
    p.play = function() {
      return this.g.play();
    };
    p.getVolume = function() {
      return this.g.volume;
    };
    p.setVolume = function(a) {
      this.g.volume = a;
    };
    p.isMuted = function() {
      return this.g.muted;
    };
    p.isLinear = function() {
      return this.u;
    };
    p.resize = function() {
    };
    p.setMuted = function(a) {
      this.g.muted = a;
    };
    p.getSequenceLength = function() {
      return this.l ? this.l : 1;
    };
    p.getPositionInSequence = function() {
      return this.i ? this.i : 1;
    };
    p.getTitle = function() {
      return this.h.adTitle;
    };
    p.getDescription = function() {
      return "";
    };
    p.getVastMediaBitrate = function() {
      return 0;
    };
    p.getVastMediaHeight = function() {
      return 0;
    };
    p.getVastMediaWidth = function() {
      return 0;
    };
    p.getVastAdId = function() {
      return this.h.vastAdId || "";
    };
    p.getAdId = function() {
      return this.h.adId;
    };
    p.getCreativeAdId = function() {
      return this.h.creativeId;
    };
    p.getAdvertiserName = function() {
      return "";
    };
    p.getMediaUrl = function() {
      return null;
    };
    p.getTimeOffset = function() {
      return 0;
    };
    p.getPodIndex = function() {
      return 0;
    };
    p.release = function() {
      this.l = this.i = this.g = this.h = null;
    };
    S("shaka.ads.MediaTailorAd", zs);
    zs.prototype.release = zs.prototype.release;
    zs.prototype.getPodIndex = zs.prototype.getPodIndex;
    zs.prototype.getTimeOffset = zs.prototype.getTimeOffset;
    zs.prototype.getMediaUrl = zs.prototype.getMediaUrl;
    zs.prototype.getAdvertiserName = zs.prototype.getAdvertiserName;
    zs.prototype.getCreativeAdId = zs.prototype.getCreativeAdId;
    zs.prototype.getAdId = zs.prototype.getAdId;
    zs.prototype.getVastAdId = zs.prototype.getVastAdId;
    zs.prototype.getVastMediaWidth = zs.prototype.getVastMediaWidth;
    zs.prototype.getVastMediaHeight = zs.prototype.getVastMediaHeight;
    zs.prototype.getVastMediaBitrate = zs.prototype.getVastMediaBitrate;
    zs.prototype.getDescription = zs.prototype.getDescription;
    zs.prototype.getTitle = zs.prototype.getTitle;
    zs.prototype.getPositionInSequence = zs.prototype.getPositionInSequence;
    zs.prototype.getSequenceLength = zs.prototype.getSequenceLength;
    zs.prototype.setMuted = zs.prototype.setMuted;
    zs.prototype.resize = zs.prototype.resize;
    zs.prototype.isLinear = zs.prototype.isLinear;
    zs.prototype.isMuted = zs.prototype.isMuted;
    zs.prototype.setVolume = zs.prototype.setVolume;
    zs.prototype.getVolume = zs.prototype.getVolume;
    zs.prototype.play = zs.prototype.play;
    zs.prototype.pause = zs.prototype.pause;
    zs.prototype.skip = zs.prototype.skip;
    zs.prototype.canSkipNow = zs.prototype.canSkipNow;
    zs.prototype.getTimeUntilSkippable = zs.prototype.getTimeUntilSkippable;
    zs.prototype.isSkippable = zs.prototype.isSkippable;
    zs.prototype.isPaused = zs.prototype.isPaused;
    zs.prototype.getRemainingTime = zs.prototype.getRemainingTime;
    zs.prototype.getMinSuggestedDuration = zs.prototype.getMinSuggestedDuration;
    zs.prototype.getDuration = zs.prototype.getDuration;
    zs.prototype.isUsingAnotherMediaElement = zs.prototype.isUsingAnotherMediaElement;
    zs.prototype.hasCustomClick = zs.prototype.hasCustomClick;
    zs.prototype.isClientRendering = zs.prototype.isClientRendering;
    zs.prototype.needsSkipUI = zs.prototype.needsSkipUI;
    function As(a, b, c, d) {
      this.D = a;
      this.K = b;
      this.h = c;
      this.l = null;
      this.P = NaN;
      this.i = d;
      this.J = false;
      this.C = null;
      this.j = [];
      this.M = [];
      this.L = this.F = this.g = null;
      this.G = /* @__PURE__ */ new Map();
      this.m = [];
      this.A = [];
      this.H = "";
      this.O = true;
      this.I = "";
      this.u = new Qc();
    }
    As.prototype.stop = function() {
      for (var a = t(this.m), b = a.next(); !b.done; b = a.next()) b = b.value, this.u.Ea(b.target, b.type, b.listener);
      Bs(this);
      this.m = [];
      this.A = [];
      this.H = "";
      this.O = true;
      this.I = "";
      this.C = null;
      this.j = [];
      this.M = [];
      this.G.clear();
    };
    As.prototype.release = function() {
      this.stop();
      this.u && this.u.release();
    };
    As.prototype.onManifestUpdated = function(a) {
      this.J = a;
      this.H != "" && (Cs(this, this.H, this.O), this.O = false);
    };
    As.prototype.getCuePoints = function() {
      for (var a = [], b = t(this.j), c = b.next(); !c.done; c = b.next()) {
        c = t(c.value.ads);
        for (var d = c.next(); !d.done; d = c.next()) d = d.value, a.push({ start: d.startTimeInSeconds, end: d.startTimeInSeconds + d.durationInSeconds });
      }
      return a;
    };
    function Ds(a, b, c) {
      var d, e, f, g, h, k2, l, m, n, q, r, u;
      P(function(w) {
        if (w.g == 1) return d = { type: 7 }, e = ah([b], Kg()), e.method = "POST", c && (f = JSON.stringify(c), e.body = ac(f)), g = a.K.request(7, e, d), sa(w, 2), G(w, g.promise, 4);
        if (w.g != 2) {
          h = w.h;
          k2 = Xb(h.data);
          l = JSON.parse(k2);
          if (l.manifestUrl && l.trackingUrl) m = new rb(b), n = new rb(l.trackingUrl), a.H = m.resolve(n).toString(), q = Date.now() / 1e3, r = q - a.P, a.i(new T("ads-loaded", (/* @__PURE__ */ new Map()).set("loadTime", r))), u = new rb(l.manifestUrl), a.l.resolve(m.resolve(u).toString()), a.l = null;
          else throw Error("Insufficient data from MediaTailor.");
          return ua(w, 0);
        }
        va(w);
        if (!a.I.length) return a.l.reject("MediaTailor request returned an error and there was no backup asset uri provided."), a.l = null, w.return();
        a.l.resolve(a.I);
        a.l = null;
        H(w);
      });
    }
    function Cs(a, b, c) {
      var d, e, f, g, h, k2, l, m, n, q, r, u, w, v, y, z;
      P(function(A) {
        if (A.g == 1) return d = { type: 8 }, e = ah([b], Kg()), f = a.K.request(7, e, d), sa(A, 2), G(A, f.promise, 4);
        if (A.g != 2) {
          g = A.h;
          h = [];
          k2 = Xb(g.data);
          l = JSON.parse(k2);
          if (l.avails.length > 0) {
            if (JSON.stringify(a.j) != JSON.stringify(l.avails)) {
              a.j = l.avails;
              m = t(a.j);
              for (n = m.next(); !n.done; n = m.next()) for (q = n.value, r = t(q.nonLinearAdsList), u = r.next(); !u.done; u = r.next()) for (w = u.value, v = t(w.nonLinearAdList), y = v.next(); !y.done; y = v.next()) z = y.value, Es(a, z);
              h = a.getCuePoints();
              a.i(new T("ad-cue-points-changed", (/* @__PURE__ */ new Map()).set("cuepoints", h)));
            }
          } else a.j.length && a.i(new T("ad-cue-points-changed", (/* @__PURE__ */ new Map()).set("cuepoints", h))), Bs(a), a.j = [];
          c && (a.J || h.length > 0) && Fs(a);
          return ua(A, 0);
        }
        va(A);
        H(A);
      });
    }
    function Es(a, b) {
      var c, d, e, f, g, h, k2, l, m;
      P(function(n) {
        if (n.g == 1) {
          if (!b.staticResource) return n.return();
          c = Gs(b);
          if (d = a.G.get(c)) return n.return();
          e = { type: 9 };
          f = ah([b.staticResource], Kg());
          g = a.K.request(7, f, e);
          sa(n, 2);
          a.G.set(c, []);
          return G(n, g.promise, 4);
        }
        if (n.g != 2) return h = n.h, k2 = Xb(h.data), l = JSON.parse(k2), m = l.apps, a.G.set(c, m), ua(n, 0);
        va(n);
        a.G.delete(c);
        H(n);
      });
    }
    function Gs(a) {
      return [a.adId, a.adParameters, a.adSystem, a.adTitle, a.creativeAdId, a.creativeId, a.creativeSequence, a.height, a.width, a.staticResource].join("");
    }
    function Fs(a) {
      Hs(a);
      a.J || (Is(a), a.u.o(a.h, "seeked", function() {
        Is(a);
      }), a.u.o(a.h, "ended", function() {
        Bs(a);
      }));
      a.u.o(a.h, "timeupdate", function() {
        Hs(a);
      });
    }
    function Is(a) {
      var b = a.h.currentTime;
      if (b != 0 && a.C == null) {
        for (var c, d, e = t(a.j), f = e.next(); !f.done; f = e.next()) {
          f = f.value;
          for (var g = t(f.ads), h = g.next(); !h.done; h = g.next()) if (h = h.value, !d) h.startTimeInSeconds < b && (d = h, c = f);
          else if (h.startTimeInSeconds < b && h.startTimeInSeconds > d.startTimeInSeconds + d.durationInSeconds) {
            d = h;
            c = f;
            break;
          }
        }
        c && d && !a.M.includes(d.adId) && (a.C = b, a.h.currentTime = c.startTimeInSeconds);
      }
    }
    function Hs(a) {
      if (a.h.duration && (a.g || a.j.length)) {
        var b = a.h.currentTime, c = false;
        if (a.g) {
          c = true;
          var d = a.F, e = d.startTimeInSeconds + 0.5 * d.durationInSeconds, f = d.startTimeInSeconds + 0.75 * d.durationInSeconds;
          b >= d.startTimeInSeconds + 0.25 * d.durationInSeconds && !a.A.includes("firstQuartile") ? (a.A.push("firstQuartile"), Js(a, "firstQuartile")) : b >= e && !a.A.includes("midpoint") ? (a.A.push("midpoint"), Js(a, "midpoint")) : b >= f && !a.A.includes("thirdQuartile") && (a.A.push("thirdQuartile"), Js(a, "thirdQuartile"));
          d = a.g.getRemainingTime();
          e = a.g.getDuration();
          a.g.canSkipNow() && d > 0 && e > 0 && Js(a, "skipStateChanged");
          e > 0 && (d <= 0 || d > e) && Bs(a);
        }
        if (!a.g || !a.g.isLinear()) {
          a: for (d = t(a.j), e = d.next(); !e.done; e = d.next()) {
            e = e.value;
            if (a.g && a.g.isLinear()) break;
            for (f = 0; f < e.ads.length; f++) {
              var g = e.ads[f], h = g.startTimeInSeconds + g.durationInSeconds;
              if (g.startTimeInSeconds <= b && h > b) {
                if (a.M.includes(g.adId)) {
                  if (a.h.ended) continue;
                  a.h.currentTime = h;
                  break a;
                }
                Bs(a);
                a.L = e;
                a.g = new zs(g, f + 1, e.ads.length, true, a.h);
                a.F = g;
                f === 0 && Js(a, "breakStart");
                Ks(a);
                break;
              }
            }
          }
          if (!a.g) for (d = t(a.j), e = d.next(); !e.done; e = d.next()) {
            e = e.value;
            if (a.g) break;
            for (f = 0; f < e.nonLinearAdsList.length; f++) if (g = e.nonLinearAdsList[f], g.nonLinearAdList.length) {
              h = e.startTimeInSeconds;
              var k2 = a.G.get(Gs(g.nonLinearAdList[0]));
              if (h <= b && k2 && k2.length) {
                Bs(a);
                h = a;
                k2 = t(k2);
                for (var l = k2.next(); !l.done; l = k2.next()) if (l = l.value, l.data.source.length) {
                  var m = document.createElement("img");
                  m.src = l.data.source[0].url;
                  m.style.top = (l.placeholder.top || 0) + "%";
                  m.style.height = 100 - (l.placeholder.top || 0) + "%";
                  m.style.left = (l.placeholder.left || 0) + "%";
                  m.style.maxWidth = 100 - (l.placeholder.left || 0) + "%";
                  m.style.objectFit = "contain";
                  m.style.position = "absolute";
                  h.D.appendChild(m);
                }
                a.L = e;
                a.g = new zs(g, f + 1, e.ads.length, false, a.h);
                a.F = g;
                f === 0 && Js(a, "breakStart");
                Ks(a);
                break;
              }
            }
          }
          c && !a.g && (b = a.h.currentTime, a.C && a.C > b && (a.h.currentTime = a.C), a.C = null);
        }
      }
    }
    function Bs(a) {
      if (a.g) {
        for (; a.D.lastChild; ) a.D.removeChild(a.D.firstChild);
        a.J || a.M.push(a.F.adId);
        var b = a.g.m;
        (b === void 0 ? 0 : b) ? Js(a, "skip") : Js(a, "complete");
        b = t(a.m);
        for (var c = b.next(); !c.done; c = b.next()) c = c.value, a.u.Ea(c.target, c.type, c.listener);
        a.m = [];
        a.A = [];
        b = a.g.getPositionInSequence();
        c = a.g.getSequenceLength();
        b === c && Js(a, "breakEnd");
        a.g = null;
        a.F = null;
        a.L = null;
      }
    }
    function Ks(a) {
      var b = false;
      a.h.paused ? b = true : (Js(a, "impression"), Js(a, "start"));
      a.m.push({ target: a.h, type: "volumechange", listener: function() {
        a.h.muted && Js(a, "mute");
      } });
      a.m.push({ target: a.h, type: "volumechange", listener: function() {
        a.h.muted || Js(a, "unmute");
      } });
      a.m.push({ target: a.h, type: "play", listener: function() {
        b ? (Js(a, "impression"), Js(a, "start"), b = false) : Js(a, "resume");
      } });
      a.m.push({ target: a.h, type: "pause", listener: function() {
        Js(a, "pause");
      } });
      for (var c = t(a.m), d = c.next(); !d.done; d = c.next()) d = d.value, a.u.o(
        d.target,
        d.type,
        d.listener
      );
    }
    function Js(a, b) {
      var c = a.F.trackingEvents.find(function(f) {
        return f.eventType == b;
      });
      c || (c = a.L.adBreakTrackingEvents.find(function(f) {
        return f.eventType == b;
      }));
      if (c) {
        var d = { type: 10 };
        c = t(c.beaconUrls);
        for (var e = c.next(); !e.done; e = c.next()) (e = e.value) && e != "" && (e = ah([e], Kg()), e.method = "POST", a.K.request(7, e, d));
      }
      switch (b) {
        case "impression":
          a.i(new T("ad-impression"));
          break;
        case "start":
          a.i(new T("ad-started", (/* @__PURE__ */ new Map()).set("ad", a.g)));
          break;
        case "mute":
          a.i(new T("ad-muted"));
          break;
        case "unmute":
          a.i(new T("ad-volume-changed"));
          break;
        case "resume":
          a.i(new T("ad-resumed"));
          break;
        case "pause":
          a.i(new T("ad-paused"));
          break;
        case "firstQuartile":
          a.i(new T("ad-first-quartile"));
          break;
        case "midpoint":
          a.i(new T("ad-midpoint"));
          break;
        case "thirdQuartile":
          a.i(new T("ad-third-quartile"));
          break;
        case "complete":
          a.i(new T("ad-complete"));
          a.i(new T("ad-stopped"));
          break;
        case "skip":
          a.i(new T("ad-skipped"));
          a.i(new T("ad-stopped"));
          break;
        case "breakStart":
          a.D.setAttribute("ad-active", "true");
          break;
        case "breakEnd":
          a.D.removeAttribute("ad-active");
          break;
        case "skipStateChanged":
          a.i(new T("ad-skip-state-changed"));
      }
    }
    ;
    function Ls(a, b) {
      this.g = a;
      this.i = null;
      this.h = b;
    }
    p = Ls.prototype;
    p.needsSkipUI = function() {
      return true;
    };
    p.isClientRendering = function() {
      return false;
    };
    p.hasCustomClick = function() {
      return true;
    };
    p.isUsingAnotherMediaElement = function() {
      return false;
    };
    p.getDuration = function() {
      return this.i ? this.i.duration : -1;
    };
    p.getMinSuggestedDuration = function() {
      return this.getDuration();
    };
    p.getRemainingTime = function() {
      return this.i ? this.i.duration - this.i.currentTime : -1;
    };
    p.isPaused = function() {
      return this.h.paused;
    };
    p.isSkippable = function() {
      return this.g.isSkippable();
    };
    p.getTimeUntilSkippable = function() {
      var a = this.g.getSkipTimeOffset();
      a = this.getRemainingTime() - a;
      return Math.max(a, 0);
    };
    p.canSkipNow = function() {
      return this.getTimeUntilSkippable() == 0;
    };
    p.skip = function() {
      this.h.currentTime += this.getRemainingTime();
    };
    p.pause = function() {
      return this.h.pause();
    };
    p.play = function() {
      return this.h.play();
    };
    p.getVolume = function() {
      return this.h.volume;
    };
    p.setVolume = function(a) {
      this.h.volume = a;
    };
    p.isMuted = function() {
      return this.h.muted;
    };
    p.isLinear = function() {
      return true;
    };
    p.resize = function() {
    };
    p.setMuted = function(a) {
      this.h.muted = a;
    };
    p.getSequenceLength = function() {
      var a = this.g.getAdPodInfo();
      return a == null ? 1 : a.getTotalAds();
    };
    p.getPositionInSequence = function() {
      var a = this.g.getAdPodInfo();
      return a == null ? 1 : a.getAdPosition();
    };
    p.getTitle = function() {
      return this.g.getTitle();
    };
    p.getDescription = function() {
      return this.g.getDescription();
    };
    p.getVastMediaBitrate = function() {
      return 0;
    };
    p.getVastMediaHeight = function() {
      return this.g.getVastMediaHeight();
    };
    p.getVastMediaWidth = function() {
      return this.g.getVastMediaWidth();
    };
    p.getVastAdId = function() {
      return "";
    };
    p.getAdId = function() {
      return this.g.getAdId();
    };
    p.getCreativeAdId = function() {
      return this.g.getCreativeAdId();
    };
    p.getAdvertiserName = function() {
      return this.g.getAdvertiserName();
    };
    p.getMediaUrl = function() {
      return null;
    };
    p.getTimeOffset = function() {
      var a = this.g.getAdPodInfo();
      return a == null ? 0 : a.getTimeOffset();
    };
    p.getPodIndex = function() {
      var a = this.g.getAdPodInfo();
      return a == null ? 0 : a.getPodIndex();
    };
    p.release = function() {
      this.h = this.i = this.g = null;
    };
    S("shaka.ads.ServerSideAd", Ls);
    Ls.prototype.release = Ls.prototype.release;
    Ls.prototype.getPodIndex = Ls.prototype.getPodIndex;
    Ls.prototype.getTimeOffset = Ls.prototype.getTimeOffset;
    Ls.prototype.getMediaUrl = Ls.prototype.getMediaUrl;
    Ls.prototype.getAdvertiserName = Ls.prototype.getAdvertiserName;
    Ls.prototype.getCreativeAdId = Ls.prototype.getCreativeAdId;
    Ls.prototype.getAdId = Ls.prototype.getAdId;
    Ls.prototype.getVastAdId = Ls.prototype.getVastAdId;
    Ls.prototype.getVastMediaWidth = Ls.prototype.getVastMediaWidth;
    Ls.prototype.getVastMediaHeight = Ls.prototype.getVastMediaHeight;
    Ls.prototype.getVastMediaBitrate = Ls.prototype.getVastMediaBitrate;
    Ls.prototype.getDescription = Ls.prototype.getDescription;
    Ls.prototype.getTitle = Ls.prototype.getTitle;
    Ls.prototype.getPositionInSequence = Ls.prototype.getPositionInSequence;
    Ls.prototype.getSequenceLength = Ls.prototype.getSequenceLength;
    Ls.prototype.setMuted = Ls.prototype.setMuted;
    Ls.prototype.resize = Ls.prototype.resize;
    Ls.prototype.isLinear = Ls.prototype.isLinear;
    Ls.prototype.isMuted = Ls.prototype.isMuted;
    Ls.prototype.setVolume = Ls.prototype.setVolume;
    Ls.prototype.getVolume = Ls.prototype.getVolume;
    Ls.prototype.play = Ls.prototype.play;
    Ls.prototype.pause = Ls.prototype.pause;
    Ls.prototype.skip = Ls.prototype.skip;
    Ls.prototype.canSkipNow = Ls.prototype.canSkipNow;
    Ls.prototype.getTimeUntilSkippable = Ls.prototype.getTimeUntilSkippable;
    Ls.prototype.isSkippable = Ls.prototype.isSkippable;
    Ls.prototype.isPaused = Ls.prototype.isPaused;
    Ls.prototype.getRemainingTime = Ls.prototype.getRemainingTime;
    Ls.prototype.getMinSuggestedDuration = Ls.prototype.getMinSuggestedDuration;
    Ls.prototype.getDuration = Ls.prototype.getDuration;
    Ls.prototype.isUsingAnotherMediaElement = Ls.prototype.isUsingAnotherMediaElement;
    Ls.prototype.hasCustomClick = Ls.prototype.hasCustomClick;
    Ls.prototype.isClientRendering = Ls.prototype.isClientRendering;
    Ls.prototype.needsSkipUI = Ls.prototype.needsSkipUI;
    function Ms(a, b, c, d) {
      var e = this;
      this.A = a;
      this.l = b;
      this.j = null;
      this.G = NaN;
      this.i = d;
      this.H = false;
      this.C = this.m = this.u = null;
      this.D = "";
      this.F = [];
      this.h = new Qc();
      a = new google.ima.dai.api.UiSettings();
      a.setLocale(c);
      this.g = new google.ima.dai.api.StreamManager(this.l, this.A, a);
      this.i(new T("ima-stream-manager-loaded", (/* @__PURE__ */ new Map()).set("imaStreamManager", this.g)));
      this.h.o(this.g, google.ima.dai.api.StreamEvent.Type.LOADED, function(f) {
        Ns(e, f);
      });
      this.h.o(this.g, google.ima.dai.api.StreamEvent.Type.ERROR, function() {
        e.D.length ? e.j.resolve(e.D) : e.j.reject("IMA Stream request returned an error and there was no backup asset uri provided.");
        e.j = null;
      });
      this.h.o(this.g, google.ima.dai.api.StreamEvent.Type.AD_BREAK_STARTED, function() {
      });
      this.h.o(this.g, google.ima.dai.api.StreamEvent.Type.STARTED, function(f) {
        f = f.getAd();
        e.m = new Ls(f, e.l);
        e.C && (e.m.i = e.C);
        e.i(new T("ad-started", (/* @__PURE__ */ new Map()).set("ad", e.m)));
        e.A.setAttribute("ad-active", "true");
      });
      this.h.o(this.g, google.ima.dai.api.StreamEvent.Type.AD_BREAK_ENDED, function() {
        e.A.removeAttribute("ad-active");
        var f = e.l.currentTime;
        e.u && e.u > f && (e.l.currentTime = e.u, e.u = null);
      });
      this.h.o(this.g, google.ima.dai.api.StreamEvent.Type.AD_PROGRESS, function(f) {
        e.C = f.getStreamData().adProgressData;
        e.m && (e.m.i = e.C);
      });
      this.h.o(this.g, google.ima.dai.api.StreamEvent.Type.FIRST_QUARTILE, function() {
        e.i(new T("ad-first-quartile"));
      });
      this.h.o(this.g, google.ima.dai.api.StreamEvent.Type.MIDPOINT, function() {
        e.i(new T("ad-midpoint"));
      });
      this.h.o(this.g, google.ima.dai.api.StreamEvent.Type.THIRD_QUARTILE, function() {
        e.i(new T("ad-third-quartile"));
      });
      this.h.o(this.g, google.ima.dai.api.StreamEvent.Type.COMPLETE, function() {
        e.i(new T("ad-complete"));
        e.i(new T("ad-stopped"));
        e.A.removeAttribute("ad-active");
        e.m = null;
      });
      this.h.o(this.g, google.ima.dai.api.StreamEvent.Type.SKIPPED, function() {
        e.i(new T("ad-skipped"));
        e.i(new T("ad-stopped"));
      });
      this.h.o(this.g, google.ima.dai.api.StreamEvent.Type.CUEPOINTS_CHANGED, function(f) {
        var g = f.getStreamData();
        f = [];
        g = t(g.cuepoints);
        for (var h = g.next(); !h.done; h = g.next()) h = h.value, f.push({ start: h.start, end: h.end });
        e.F = f;
        e.i(new T("ad-cue-points-changed", (/* @__PURE__ */ new Map()).set("cuepoints", f)));
      });
    }
    p = Ms.prototype;
    p.configure = function() {
    };
    p.stop = function() {
      this.D = "";
      this.u = null;
      this.F = [];
    };
    p.release = function() {
      this.stop();
      this.h && this.h.release();
    };
    p.onCueMetadataChange = function(a) {
      if (a.key && a.data) {
        var b = {};
        b[a.key] = a.data;
        this.g.onTimedMetadata(b);
      }
    };
    p.getCuePoints = function() {
      return this.F;
    };
    function Ns(a, b) {
      a.i(new T("ads-loaded", (/* @__PURE__ */ new Map()).set("loadTime", Date.now() / 1e3 - a.G)));
      b = b.getStreamData().url;
      a.j.resolve(b);
      a.j = null;
      a.H || a.h.o(a.l, "seeked", function() {
        var c = a.l.currentTime;
        if (c != 0) {
          a.g.streamTimeForContentTime(c);
          var d = a.g.previousCuePointForStreamTime(c);
          d && !d.played && (a.u = c, a.l.currentTime = d.start);
        }
      });
    }
    ;
    function Os() {
      lb.call(this);
      this.h = this.i = this.j = this.g = null;
      this.m = new Qr();
      this.u = navigator.language;
      this.l = null;
    }
    ma(Os, lb);
    p = Os.prototype;
    p.setLocale = function(a) {
      this.u = a;
    };
    p.configure = function(a) {
      this.l = a;
      this.g && this.g.configure(this.l);
      this.j && this.j.configure(this.l);
      this.h && this.h.configure(this.l);
    };
    p.initInterstitial = function(a, b, c) {
      var d = this;
      this.g && this.g.release();
      this.g = new es(a, b, c, function(e) {
        return Ps(d, e);
      });
      this.g.configure(this.l);
    };
    p.initClientSide = function(a, b, c) {
      var d = this;
      if (!window2.google || !google.ima || !google.ima.AdsLoader) throw new U(2, 10, 1e4);
      this.j && this.j.release();
      this.j = new Xr(a, b, this.u, c, function(e) {
        return Ps(d, e);
      });
      this.j.configure(this.l);
    };
    p.release = function() {
      this.g && (this.g.release(), this.g = null);
      this.j && (this.j.release(), this.j = null);
      this.i && (this.i.release(), this.i = null);
      this.h && (this.h.release(), this.h = null);
      lb.prototype.release.call(this);
    };
    p.onAssetUnload = function() {
      this.g && this.g.stop();
      this.j && this.j.stop();
      this.i && this.i.stop();
      this.h && this.h.stop();
      this.dispatchEvent(new T("ad-stopped"));
      this.dispatchEvent(new T("ad-content-attach-requested"));
      this.m = new Qr();
    };
    p.requestClientSideAds = function(a) {
      if (!this.j) throw new U(1, 10, 10001);
      var b = this.j;
      b.g && b.g.destroy();
      b.m && b.m.contentComplete();
      b.H = Date.now() / 1e3;
      b.m.requestAds(a);
    };
    p.updateClientSideAdsRenderingSettings = function(a) {
      if (!this.j) throw new U(1, 10, 10001);
      var b = this.j;
      b.D = a;
      b.g && b.g.updateAdsRenderingSettings(b.D);
    };
    p.initMediaTailor = function(a, b, c) {
      var d = this;
      this.i && this.i.release();
      this.i = new As(a, b, c, function(e) {
        return Ps(d, e);
      });
    };
    p.requestMediaTailorStream = function(a, b, c) {
      if (!this.i) throw new U(1, 10, 10005);
      var d = this.i;
      c = c === void 0 ? "" : c;
      d.l ? a = Promise.reject(new U(1, 10, 10004)) : (d.l = new Mg(), Ds(d, a, b), d.I = c || "", d.P = Date.now() / 1e3, a = d.l);
      return a;
    };
    p.addMediaTailorTrackingUrl = function(a) {
      if (!this.i) throw new U(1, 10, 10005);
      var b = this.i;
      b.H = a;
      b.i(new T("ads-loaded", (/* @__PURE__ */ new Map()).set("loadTime", 0)));
    };
    p.initServerSide = function(a, b) {
      var c = this;
      if (!window2.google || !google.ima || !google.ima.dai) throw new U(2, 10, 10002);
      this.h && this.h.release();
      this.h = new Ms(a, b, this.u, function(d) {
        return Ps(c, d);
      });
      this.h.configure(this.l);
    };
    p.requestServerSideStream = function(a, b) {
      b = b === void 0 ? "" : b;
      if (!this.h) throw new U(1, 10, 10003);
      a.adTagParameters || (a.adTagParameters = {});
      var c = a.adTagParameters;
      (c.mpt || c.mpv) && bb('You have attempted to set "mpt" and/or "mpv" parameters of the ad tag. Please note that those parameters are used for Shaka adoption tracking and will be overridden.');
      a.adTagParameters.mpt = "shaka-player";
      a.adTagParameters.mpv = "v4.15.10";
      c = this.h;
      c.j ? a = Promise.reject(new U(1, 10, 10004)) : (a instanceof google.ima.dai.api.LiveStreamRequest && (c.H = true), c.j = new Mg(), c.g.requestStream(a), c.D = b || "", c.G = Date.now() / 1e3, a = c.j);
      return a;
    };
    p.replaceServerSideAdTagParameters = function(a) {
      if (!this.h) throw new U(1, 10, 10003);
      (a.mpt || a.mpv) && bb('You have attempted to set "mpt" and/or "mpv" parameters of the ad tag. Please note that those parameters are used for Shaka adoption tracking and will be overridden.');
      a.mpt = "Shaka Player";
      a.mpv = "v4.15.10";
      this.h.g.replaceAdTagParameters(a);
    };
    p.getServerSideCuePoints = function() {
      Wc("AdManager.getServerSideCuePoints", "Please use getCuePoints function.");
      return this.getCuePoints();
    };
    p.getCuePoints = function() {
      var a = [];
      this.h && (a = a.concat(this.h.getCuePoints()));
      this.i && (a = a.concat(this.i.getCuePoints()));
      return a;
    };
    p.getStats = function() {
      var a = this.m;
      return { loadTimes: a.g, averageLoadTime: Rr(a), started: a.h, overlayAds: a.j, playedCompletely: a.l, skipped: a.m, errors: a.i };
    };
    p.onManifestUpdated = function(a) {
      if (this.i) this.i.onManifestUpdated(a);
    };
    p.onDashTimedMetadata = function(a) {
      this.h && a.schemeIdUri == "urn:google:dai:2018" && this.h.g.processMetadata(a.schemeIdUri, a.eventNode ? a.eventNode.attributes.messageData : null, a.startTime);
    };
    p.onHlsTimedMetadata = function(a, b) {
      this.h && this.h.g.processMetadata("ID3", a.data, b);
    };
    p.onCueMetadataChange = function(a) {
      if (this.h) this.h.onCueMetadataChange(a);
    };
    p.onHLSInterstitialMetadata = function(a, b, c) {
      this.l && this.l.disableHLSInterstitial || (this.g || this.initInterstitial(null, a, b), this.g && rs(this.g, c));
    };
    p.onDASHInterstitialMetadata = function(a, b, c) {
      if (!this.l || !this.l.disableDASHInterstitial) {
        var d = c.schemeIdUri;
        if (d == "urn:mpeg:dash:event:alternativeMPD:insert:2025" || d == "urn:mpeg:dash:event:alternativeMPD:replace:2025") {
          if (this.g || this.initInterstitial(null, a, b), this.g && (a = this.g, b = c.schemeIdUri == "urn:mpeg:dash:event:alternativeMPD:replace:2025", d = c.schemeIdUri == "urn:mpeg:dash:event:alternativeMPD:insert:2025", b || d)) {
            for (var e = c.startTime, f = c.endTime, g = null, h = 0, k2, l = t(c.eventNode.children), m = l.next(); !m.done; m = l.next()) if (m = m.value, m.tagName == "AlternativeMPD") {
              if (m = m.attributes.uri) {
                k2 = m;
                break;
              }
            } else if (m.tagName == "InsertPresentation" || m.tagName == "ReplacePresentation") {
              var n = m.attributes.url;
              if (n) {
                k2 = n;
                (l = $d(m, "maxDuration", fe)) && (g = l / c.timescale);
                (l = $d(m, "returnOffset", fe)) && (h = l / c.timescale);
                b && h && (f = e + h);
                break;
              }
            }
            k2 && ts(a, [{ id: c.id, groupId: null, startTime: e, endTime: f, uri: k2, mimeType: null, isSkippable: false, skipOffset: null, skipFor: null, canJump: true, resumeOffset: d ? h : null, playoutLimit: g, once: false, pre: false, post: false, timelineRange: b && !d, loop: false, overlay: null, displayOnBackground: false, currentVideo: null, background: null }]);
          }
        } else (d == "urn:mpeg:dash:event:2012" || d == "urn:scte:dash:scte214-events") && c.eventNode && Xd(c.eventNode, "OverlayEvent") && (this.g || this.initInterstitial(null, a, b), this.g && us(this.g, c));
      }
    };
    p.addCustomInterstitial = function(a) {
      if (!this.g) throw new U(1, 10, 10006);
      ts(this.g, [a]);
    };
    p.addAdUrlInterstitial = function(a) {
      if (!this.g) throw new U(1, 10, 10006);
      return this.g.addAdUrlInterstitial(a);
    };
    p.getInterstitialPlayer = function() {
      if (!this.g) throw new U(1, 10, 10006);
      return this.g.Vb();
    };
    function Ps(a, b) {
      if (b && b.type) switch (b.type) {
        case "ads-loaded":
          a.m.g.push(b.loadTime);
          break;
        case "ad-started":
          a.m.h++;
          var c = b.ad;
          c && !c.isLinear() && a.m.j++;
          break;
        case "ad-complete":
          a.m.l++;
          break;
        case "ad-skipped":
          a.m.m++;
          break;
        case "ad-error":
          a.m.i++;
      }
      a.dispatchEvent(b);
    }
    S("shaka.ads.AdManager", Os);
    Os.prototype.getInterstitialPlayer = Os.prototype.getInterstitialPlayer;
    Os.prototype.addAdUrlInterstitial = Os.prototype.addAdUrlInterstitial;
    Os.prototype.addCustomInterstitial = Os.prototype.addCustomInterstitial;
    Os.prototype.onDASHInterstitialMetadata = Os.prototype.onDASHInterstitialMetadata;
    Os.prototype.onHLSInterstitialMetadata = Os.prototype.onHLSInterstitialMetadata;
    Os.prototype.onCueMetadataChange = Os.prototype.onCueMetadataChange;
    Os.prototype.onHlsTimedMetadata = Os.prototype.onHlsTimedMetadata;
    Os.prototype.onDashTimedMetadata = Os.prototype.onDashTimedMetadata;
    Os.prototype.onManifestUpdated = Os.prototype.onManifestUpdated;
    Os.prototype.getStats = Os.prototype.getStats;
    Os.prototype.getCuePoints = Os.prototype.getCuePoints;
    Os.prototype.getServerSideCuePoints = Os.prototype.getServerSideCuePoints;
    Os.prototype.replaceServerSideAdTagParameters = Os.prototype.replaceServerSideAdTagParameters;
    Os.prototype.requestServerSideStream = Os.prototype.requestServerSideStream;
    Os.prototype.initServerSide = Os.prototype.initServerSide;
    Os.prototype.addMediaTailorTrackingUrl = Os.prototype.addMediaTailorTrackingUrl;
    Os.prototype.requestMediaTailorStream = Os.prototype.requestMediaTailorStream;
    Os.prototype.initMediaTailor = Os.prototype.initMediaTailor;
    Os.prototype.updateClientSideAdsRenderingSettings = Os.prototype.updateClientSideAdsRenderingSettings;
    Os.prototype.requestClientSideAds = Os.prototype.requestClientSideAds;
    Os.prototype.onAssetUnload = Os.prototype.onAssetUnload;
    Os.prototype.release = Os.prototype.release;
    Os.prototype.initClientSide = Os.prototype.initClientSide;
    Os.prototype.initInterstitial = Os.prototype.initInterstitial;
    Os.prototype.configure = Os.prototype.configure;
    Os.prototype.setLocale = Os.prototype.setLocale;
    Os.ADS_LOADED = "ads-loaded";
    Os.AD_STARTED = "ad-started";
    Os.AD_FIRST_QUARTILE = "ad-first-quartile";
    Os.AD_MIDPOINT = "ad-midpoint";
    Os.AD_THIRD_QUARTILE = "ad-third-quartile";
    Os.AD_COMPLETE = "ad-complete";
    Os.AD_STOPPED = "ad-stopped";
    Os.AD_SKIPPED = "ad-skipped";
    Os.AD_VOLUME_CHANGED = "ad-volume-changed";
    Os.AD_MUTED = "ad-muted";
    Os.AD_PAUSED = "ad-paused";
    Os.AD_RESUMED = "ad-resumed";
    Os.AD_SKIP_STATE_CHANGED = "ad-skip-state-changed";
    Os.CUEPOINTS_CHANGED = "ad-cue-points-changed";
    Os.IMA_AD_MANAGER_LOADED = "ima-ad-manager-loaded";
    Os.IMA_STREAM_MANAGER_LOADED = "ima-stream-manager-loaded";
    Os.AD_CLICKED = "ad-clicked";
    Os.AD_PROGRESS = "ad-progress";
    Os.AD_BUFFERING = "ad-buffering";
    Os.AD_IMPRESSION = "ad-impression";
    Os.AD_DURATION_CHANGED = "ad-duration-changed";
    Os.AD_CLOSED = "ad-closed";
    Os.AD_LOADED = "ad-loaded";
    Os.ALL_ADS_COMPLETED = "all-ads-completed";
    Os.AD_LINEAR_CHANGED = "ad-linear-changed";
    Os.AD_METADATA = "ad-metadata";
    Os.AD_RECOVERABLE_ERROR = "ad-recoverable-error";
    Os.AD_ERROR = "ad-error";
    Os.AD_BREAK_READY = "ad-break-ready";
    Os.AD_INTERACTION = "ad-interaction";
    Os.AD_CONTENT_PAUSE_REQUESTED = "ad-content-pause-requested";
    Os.AD_CONTENT_RESUME_REQUESTED = "ad-content-resume-requested";
    Os.AD_CONTENT_ATTACH_REQUESTED = "ad-content-attach-requested";
    nq = function() {
      return new Os();
    };
    function Qs(a) {
      return JSON.stringify(a, function(b, c) {
        if (typeof c != "function") {
          if (c instanceof Event || c instanceof T) {
            var d = {};
            for (e in c) (b = c[e]) && typeof b == "object" ? e == "detail" && (d[e] = b) : e in Event || (d[e] = b);
            return d;
          }
          if (c instanceof Error) {
            var e = /* @__PURE__ */ new Set(["name", "message", "stack"]);
            for (d in c) e.add(d);
            d = t(Object.getOwnPropertyNames(c));
            for (b = d.next(); !b.done; b = d.next()) e.add(b.value);
            d = {};
            e = t(e);
            for (b = e.next(); !b.done; b = e.next()) b = b.value, d[b] = c[b];
            c = { __type__: "Error", contents: d };
          } else if (c instanceof TimeRanges) {
            e = { __type__: "TimeRanges", length: c.length, start: [], end: [] };
            c = t(Lj(c));
            for (d = c.next(); !d.done; d = c.next()) d = d.value, b = d.end, e.start.push(d.start), e.end.push(b);
            c = e;
          } else c = ArrayBuffer.isView(c) && c.BYTES_PER_ELEMENT === 1 ? { __type__: "Uint8Array", entries: Array.from(c) } : typeof c == "number" ? isNaN(c) ? "NaN" : isFinite(c) ? c : c < 0 ? "-Infinity" : "Infinity" : c;
          return c;
        }
      });
    }
    function Rs(a) {
      return JSON.parse(a, function(b, c) {
        if (c == "NaN") var d = NaN;
        else if (c == "-Infinity") d = -Infinity;
        else if (c == "Infinity") d = Infinity;
        else if (c && typeof c == "object" && c.__type__ == "TimeRanges") d = Ss(c);
        else if (c && typeof c == "object" && c.__type__ == "Uint8Array") d = new Uint8Array(c.entries);
        else if (c && typeof c == "object" && c.__type__ == "Error") {
          b = c.contents;
          c = Error(b.message);
          for (d in b) c[d] = b[d];
          d = c;
        } else d = c;
        return d;
      });
    }
    function Ss(a) {
      return { length: a.length, start: function(b) {
        return a.start[b];
      }, end: function(b) {
        return a.end[b];
      } };
    }
    var Ts = "ended play playing pause pausing ratechange seeked seeking timeupdate volumechange".split(" "), Us = "buffered currentTime duration ended loop muted paused playbackRate seeking videoHeight videoWidth volume".split(" "), Vs = ["loop", "playbackRate"], Ws = ["pause", "play"], Xs = (/* @__PURE__ */ new Map()).set("getAssetUri", 2).set("getAudioLanguages", 4).set("getAudioLanguagesAndRoles", 4).set("getBufferFullness", 1).set("getBufferedInfo", 2).set("getExpiration", 2).set("getKeyStatuses", 2).set("getPlaybackRate", 2).set(
      "getTextLanguages",
      4
    ).set("getTextLanguagesAndRoles", 4).set("isAudioOnly", 10).set("isBuffering", 1).set("isInProgress", 1).set("isLive", 10).set("isTextTrackVisible", 1).set("isVideoOnly", 10).set("keySystem", 10).set("seekRange", 1).set("getLoadMode", 10).set("getManifestType", 10).set("isFullyLoaded", 1).set("isEnded", 1), Ys = (/* @__PURE__ */ new Map()).set("getConfiguration", 4).set("getConfigurationForLowLatency", 4).set("getStats", 5).set("getAudioTracks", 2).set("getChaptersTracks", 2).set("getImageTracks", 2).set("getVideoTracks", 2).set(
      "getTextTracks",
      2
    ).set("getVariantTracks", 2), Zs = (/* @__PURE__ */ new Map()).set("getPlayheadTimeAsDate", 1).set("getPresentationStartTimeAsDate", 20).set("getSegmentAvailabilityDuration", 20), $s = [["getConfiguration", "configure", "getConfigurationForLowLatency", "configurationForLowLatency"]], at = [["isTextTrackVisible", "setTextTrackVisibility"]], bt = "cancelTrickPlay configure configurationForLowLatency getChapters resetConfiguration retryStreaming selectAudioLanguage selectAudioTrack selectTextLanguage selectTextTrack selectVariantTrack selectVariantsByLabel selectVideoTrack setTextTrackVisibility trickPlay updateStartTime goToLive useTrickPlayTrackIfAvailable".split(" "), ct = "addChaptersTrack addTextTrackAsync addThumbnailsTrack getAllThumbnails getChaptersAsync getThumbnails attach attachCanvas detach load unload".split(" ");
    function dt(a, b, c, d, e, f, g) {
      var h = this;
      this.H = a;
      this.K = g;
      this.l = new Cf(b);
      this.L = c;
      this.A = false;
      this.C = d;
      this.G = e;
      this.M = f;
      this.i = this.m = false;
      this.J = "";
      this.u = null;
      this.D = function() {
        return et(h);
      };
      this.F = function(k2, l) {
        k2 = Rs(l);
        switch (k2.type) {
          case "event":
            var m = k2.targetName, n = Ya(k2.event);
            h.C(m, n);
            break;
          case "update":
            m = k2.update;
            for (n in m) {
              k2 = h.g[n] || {};
              for (var q in m[n]) k2[q] = m[n][q];
            }
            h.A && (h.L(), h.A = false);
            break;
          case "asyncComplete":
            if (q = k2.id, n = k2.error, l = k2.res, k2 = h.h.get(q), h.h.delete(q), k2) if (n) {
              q = new U(
                n.severity,
                n.category,
                n.code
              );
              for (m in n) q[m] = n[m];
              k2.reject(q);
            } else k2.resolve(l);
        }
      };
      this.g = { video: {}, player: {} };
      this.I = 0;
      this.h = /* @__PURE__ */ new Map();
      this.j = null;
      ft.add(this);
    }
    p = dt.prototype;
    p.destroy = function() {
      ft.delete(this);
      gt(this);
      ht && it(this);
      this.l && (this.l.stop(), this.l = null);
      this.G = this.C = null;
      this.i = this.m = false;
      this.F = this.D = this.j = this.h = this.g = this.u = null;
      return Promise.resolve();
    };
    p.Qa = function() {
      return this.i;
    };
    p.Yf = function() {
      return this.J;
    };
    p.init = function() {
      if (this.H.length) if (window2.chrome && chrome.cast && chrome.cast.isAvailable) {
        this.m = true;
        this.l.La();
        var a = new chrome.cast.SessionRequest(this.H, [], null, this.K, null);
        a = new chrome.cast.ApiConfig(a, function(b) {
          for (var c = t(ft), d = c.next(); !d.done; d = c.next()) {
            d = d.value;
            var e = b;
            d.j = new Mg();
            d.A = true;
            jt(d, e);
          }
        }, function(b) {
          for (var c = t(ft), d = c.next(); !d.done; d = c.next()) d = d.value, kt = b == "available", d.l.La();
        }, "origin_scoped");
        chrome.cast.initialize(a, function() {
        }, function() {
        });
        kt && this.l.Y(lt);
        (a = ht) && a.status != chrome.cast.SessionStatus.STOPPED ? (this.j = new Mg(), this.A = true, jt(this, a)) : ht = null;
      } else window2.__onGCastApiAvailable !== mt && (nt = window2.__onGCastApiAvailable || null, window2.__onGCastApiAvailable = mt);
    };
    p.bi = function(a) {
      this.u = a;
      this.i && ot(this, { type: "appData", appData: this.u });
    };
    p.cast = function() {
      var a = this;
      return P(function(b) {
        if (!a.m) throw new U(1, 8, 8e3);
        if (!kt) throw new U(1, 8, 8001);
        if (a.i) throw new U(1, 8, 8002);
        a.j = new Mg();
        chrome.cast.requestSession(function(c) {
          return jt(a, c);
        }, function(c) {
          return pt(a, c);
        });
        return G(b, a.j, 0);
      });
    };
    function qt(a) {
      a.i && chrome.cast.requestSession(function(b) {
        return jt(a, b);
      }, function(b) {
        return pt(a, b);
      });
    }
    p.Fd = function() {
      if (this.i) {
        gt(this);
        if (ht) {
          it(this);
          try {
            ht.stop(function() {
            }, function() {
            });
          } catch (a) {
          }
          ht = null;
        }
        et(this);
      }
    };
    p.get = function(a, b) {
      var c = this;
      if (a == "video") {
        if (Ws.includes(b)) return function() {
          return c.xj.apply(c, [a, b].concat(x(Na.apply(0, arguments))));
        };
      } else if (a == "player") {
        if (Zs.has(b) && !this.get("player", "isLive")()) return function() {
        };
        if (bt.includes(b)) return function() {
          return c.xj.apply(c, [a, b].concat(x(Na.apply(0, arguments))));
        };
        if (ct.includes(b)) return function() {
          return c.dm.apply(c, [a, b].concat(x(Na.apply(0, arguments))));
        };
        if (Xs.has(b) || Ys.has(b)) return function() {
          return c.g[a][b];
        };
      }
      return this.g[a][b];
    };
    p.set = function(a, b, c) {
      this.g[a][b] = c;
      ot(this, { type: "set", targetName: a, property: b, value: c });
    };
    function jt(a, b) {
      var c = a.M();
      ht = b;
      b.addUpdateListener(a.D);
      b.addMessageListener("urn:x-cast:com.google.shaka.v2", a.F);
      et(a);
      ot(a, { type: "init", initState: c, appData: a.u });
      a.j.resolve();
    }
    function pt(a, b) {
      var c = 8003;
      switch (b.code) {
        case "cancel":
          c = 8004;
          break;
        case "timeout":
          c = 8005;
          break;
        case "receiver_unavailable":
          c = 8006;
      }
      a.j.reject(new U(2, 8, c, b));
    }
    p.xj = function(a, b) {
      ot(this, { type: "call", targetName: a, methodName: b, args: Na.apply(2, arguments) });
    };
    p.dm = function(a, b) {
      var c = Na.apply(2, arguments), d = new Mg(), e = this.I.toString();
      this.I++;
      this.h.set(e, d);
      try {
        ot(this, { type: "asyncCall", targetName: a, methodName: b, args: c, id: e });
      } catch (f) {
        d.reject(f);
      }
      return d;
    };
    function it(a) {
      var b = ht;
      b.removeUpdateListener(a.D);
      b.removeMessageListener("urn:x-cast:com.google.shaka.v2", a.F);
    }
    function et(a) {
      var b = ht ? ht.status == "connected" : false;
      if (a.i && !b) {
        a.G();
        for (var c in a.g) a.g[c] = {};
        gt(a);
      }
      a.i = b;
      a.J = b ? ht.receiver.friendlyName : "";
      a.l.La();
    }
    function gt(a) {
      if (a.h) for (var b = t(a.h.keys()), c = b.next(); !c.done; c = b.next()) {
        c = c.value;
        var d = a.h.get(c);
        a.h.delete(c);
        d.reject(new U(1, 7, 7e3));
      }
    }
    function ot(a, b) {
      b = Qs(b);
      var c = ht;
      try {
        c.sendMessage("urn:x-cast:com.google.shaka.v2", b, function() {
        }, eb);
      } catch (d) {
        throw b = new U(2, 8, 8005, d), c = new T("error", (/* @__PURE__ */ new Map()).set("detail", b)), a.C("player", c), a.Fd(), b;
      }
    }
    var lt = 0.02, kt = false, ht = null, nt = null, ft = /* @__PURE__ */ new Set();
    function mt(a) {
      nt ? window2.__onGCastApiAvailable = nt : delete window2.__onGCastApiAvailable;
      nt = null;
      if (a) for (var b = t(ft), c = b.next(); !c.done; c = b.next()) c.value.init();
      typeof window2.__onGCastApiAvailable === "function" && window2.__onGCastApiAvailable(a);
    }
    ;
    function rt(a, b, c, d) {
      d = d === void 0 ? false : d;
      lb.call(this);
      var e = this;
      this.i = a;
      this.h = b;
      this.l = this.u = this.m = this.A = this.j = null;
      this.I = c;
      this.H = d;
      this.F = [];
      this.D = [];
      this.C = [];
      this.G = /* @__PURE__ */ new Map();
      this.g = null;
      window2.chrome ? (this.g = new dt(c, function() {
        return st(e);
      }, function() {
        return tt(e);
      }, function(f, g) {
        return ut(e, f, g);
      }, function() {
        return vt(e);
      }, function() {
        return wt(e);
      }, d), xt(this)) : (this.j = this.i, this.A = this.h);
    }
    ma(rt, lb);
    p = rt.prototype;
    p.destroy = function(a) {
      this.g && (a === void 0 ? 0 : a) && this.g.Fd();
      this.l && (this.l.release(), this.l = null);
      a = [];
      this.h && (a.push(this.h.destroy()), this.h = null);
      this.g && (a.push(this.g.destroy()), this.g = null);
      this.A = this.j = this.i = null;
      lb.prototype.release.call(this);
      return Promise.all(a);
    };
    p.Pc = function() {
      return this.j;
    };
    p.Vb = function() {
      return this.A;
    };
    p.Kg = function() {
      return this.g ? this.g.m && kt : false;
    };
    p.Qa = function() {
      return this.g ? this.g.Qa() : false;
    };
    p.Yf = function() {
      return this.g ? this.g.Yf() : "";
    };
    p.cast = function() {
      var a = this;
      return P(function(b) {
        return b.g == 1 ? a.g ? G(b, a.g.cast(), 2) : b.return() : a.h ? G(b, a.h.rc(), 0) : b.return();
      });
    };
    p.bi = function(a) {
      this.g && this.g.bi(a);
    };
    p.Vj = function() {
      this.g && qt(this.g);
    };
    p.Fd = function() {
      this.g && this.g.Fd();
    };
    p.Mi = function(a, b) {
      b = b === void 0 ? false : b;
      var c = this;
      return P(function(d) {
        if (d.g == 1) {
          if (a == c.I && b == c.H) return d.return();
          c.I = a;
          c.H = b;
          if (!c.g) return d.return();
          c.g.Fd();
          return G(d, c.g.destroy(), 2);
        }
        c.g = null;
        c.g = new dt(a, function() {
          return st(c);
        }, function() {
          return tt(c);
        }, function(e, f) {
          return ut(c, e, f);
        }, function() {
          return vt(c);
        }, function() {
          return wt(c);
        }, b);
        c.g.init();
        H(d);
      });
    };
    function xt(a) {
      a.g.init();
      a.l = new Qc();
      for (var b = t(Ts), c = b.next(); !c.done; c = b.next()) a.l.o(a.i, c.value, function(f) {
        a.g.Qa() || (f = Ya(f), a.m.dispatchEvent(f));
      });
      for (var d in Za) a.l.o(a.h, Za[d], function(f) {
        a.g.Qa() || a.u.dispatchEvent(f);
      });
      a.j = {};
      b = {};
      for (var e in a.i) b = { ue: b.ue }, b.ue = e, Object.defineProperty(a.j, b.ue, { configurable: false, enumerable: true, get: /* @__PURE__ */ function(f) {
        return function() {
          return yt(a, f.ue);
        };
      }(b), set: /* @__PURE__ */ function(f) {
        return function(g) {
          var h = f.ue;
          a.g.Qa() ? a.g.set("video", h, g) : a.i[h] = g;
        };
      }(b) });
      a.A = {};
      zt(
        a,
        function(f) {
          Object.defineProperty(a.A, f, { configurable: false, enumerable: true, get: function() {
            return At(a, f);
          } });
        }
      );
      Bt(a);
      a.m = new lb();
      a.m.Ue = a.j;
      a.u = new lb();
      a.u.Ue = a.A;
      a.l.o(a.h, "unloading", function() {
        a.g && a.g.Qa() || Ct(a);
      });
    }
    function Bt(a) {
      var b = /* @__PURE__ */ new Map();
      zt(a, function(c, d) {
        b.has(d) ? (d = b.get(d), c.length < d.length ? a.G.set(c, d) : a.G.set(d, c)) : b.set(d, c);
      });
    }
    function zt(a, b) {
      function c(k2) {
        return k2 == "constructor" || typeof d[k2] != "function" ? false : !e.has(k2);
      }
      var d = a.h, e = /* @__PURE__ */ new Set(), f;
      for (f in d) c(f) && (e.add(f), b(f, d[f]));
      a = Object.getPrototypeOf(d);
      for (f = Object.getPrototypeOf({}); a && a != f; ) {
        for (var g = t(Object.getOwnPropertyNames(a)), h = g.next(); !h.done; h = g.next()) h = h.value, c(h) && (e.add(h), b(h, d[h]));
        a = Object.getPrototypeOf(a);
      }
    }
    function wt(a) {
      var b = { video: {}, player: {}, playerAfterLoad: {}, manifest: a.h.ed(), startTime: null, addThumbnailsTrackCalls: a.F, addTextTrackAsyncCalls: a.D, addChaptersTrackCalls: a.C };
      a.i.pause();
      for (var c = t(Vs), d = c.next(); !d.done; d = c.next()) d = d.value, b.video[d] = a.i[d];
      a.i.ended || (b.startTime = a.i.currentTime);
      c = t($s);
      for (d = c.next(); !d.done; d = c.next()) {
        var e = d.value;
        d = e[1];
        e = a.h[e[0]]();
        b.player[d] = e;
      }
      c = t(at);
      for (d = c.next(); !d.done; d = c.next()) e = d.value, d = e[1], e = a.h[e[0]](), b.playerAfterLoad[d] = e;
      return b;
    }
    function st(a) {
      var b = new T("caststatuschanged");
      a.dispatchEvent(b);
    }
    function tt(a) {
      var b = new T(a.j.paused ? "pause" : "play");
      a.m.dispatchEvent(b);
    }
    function vt(a) {
      for (var b = t($s), c = b.next(); !c.done; c = b.next()) {
        var d = c.value;
        c = d[1];
        d = a.g.get("player", d[0])();
        a.h[c](d);
      }
      var e = a.F, f = a.D, g = a.C;
      Ct(a);
      var h = a.g.get("player", "getAssetUri")();
      d = a.g.get("video", "ended");
      b = Promise.resolve();
      var k2 = a.i.autoplay;
      c = null;
      d || (c = a.g.get("video", "currentTime"));
      var l;
      (d = a.g.get("player", "getTextTracks")()) && d.length && (l = d.find(function(q) {
        return q.active;
      }));
      var m = a.g.get("player", "isTextTrackVisible")();
      h && (a.i.autoplay = false, b = a.h.load(h, c));
      var n = {};
      c = t(Vs);
      for (d = c.next(); !d.done; d = c.next()) d = d.value, n[d] = a.g.get("video", d);
      b.then(function() {
        if (a.i) {
          for (var q = t(e), r = q.next(); !r.done; r = q.next()) {
            r = r.value;
            var u;
            (u = a.Vb()).cf.apply(u, x(r));
          }
          q = t(f);
          for (u = q.next(); !u.done; u = q.next()) {
            u = u.value;
            var w;
            (w = a.Vb()).be.apply(w, x(u));
          }
          w = t(g);
          for (q = w.next(); !q.done; q = w.next()) {
            q = q.value;
            var v;
            (v = a.Vb()).bf.apply(v, x(q));
          }
          v = t(Vs);
          for (w = v.next(); !w.done; w = v.next()) w = w.value, a.i[w] = n[w];
          v = t(at);
          for (w = v.next(); !w.done; w = v.next()) q = w.value, w = q[1], q = a.g.get("player", q[0])(), a.h[w](q);
          a.h.Fe(m);
          l && a.h.ai(l.language, l.roles, l.forced);
          a.i.autoplay = k2;
          h && a.i.play();
        }
      }, function(q) {
        q = (/* @__PURE__ */ new Map()).set("detail", q);
        q = new T("error", q);
        a.h.dispatchEvent(q);
      });
    }
    function yt(a, b) {
      if (b == "addEventListener") return function(d, e, f) {
        return a.m.addEventListener(d, e, f);
      };
      if (b == "removeEventListener") return function(d, e, f) {
        return a.m.removeEventListener(d, e, f);
      };
      if (a.g.Qa() && Object.keys(a.g.g.video).length == 0) {
        var c = a.i[b];
        if (typeof c != "function") return c;
      }
      return a.g.Qa() ? a.g.get("video", b) : (b = a.i[b], typeof b == "function" && (b = b.bind(a.i)), b);
    }
    function At(a, b, c) {
      c = c === void 0 ? false : c;
      a.G.has(b) && (b = a.G.get(b));
      if (b == "addEventListener") return function(d, e, f) {
        return a.u.addEventListener(d, e, f);
      };
      if (b == "removeEventListener") return function(d, e, f) {
        return a.u.removeEventListener(d, e, f);
      };
      if (b == "getMediaElement") return function() {
        return a.j;
      };
      if (b == "getSharedConfiguration") return a.g.get("player", "getConfiguration");
      if (b == "getNetworkingEngine") return function() {
        return a.h.Lb();
      };
      if (b == "getDrmEngine") return function() {
        return a.h.F;
      };
      if (b == "getAdManager") return function() {
        return a.h.rf();
      };
      if (b == "getQueueManager") return function() {
        return a.h.uh();
      };
      if (b == "setVideoContainer") return function(d) {
        return a.h.ji(d);
      };
      if (!c) {
        if (b == "addThumbnailsTrack") return function() {
          var d = Na.apply(0, arguments);
          a.F.push(d);
          return At(a, b, true).apply(null, x(d));
        };
        if (b == "addTextTrackAsync") return function() {
          var d = Na.apply(0, arguments);
          a.D.push(d);
          return At(a, b, true).apply(null, x(d));
        };
        if (b == "addChaptersTrack") return function() {
          var d = Na.apply(0, arguments);
          a.C.push(d);
          return At(a, b, true).apply(null, x(d));
        };
      }
      if (a.g.Qa()) {
        if (b == "getManifest" || b == "drmInfo") return function() {
          bb(b + "() does not work while casting!");
          return null;
        };
        if (b == "attach" || b == "detach") return function() {
          bb(b + "() does not work while casting!");
          return Promise.resolve();
        };
        if (b == "getChapters") return function() {
          bb(b + "() does not work while casting!");
          return [];
        };
      }
      return a.g.Qa() && Object.keys(a.g.g.video).length == 0 && (Xs.has(b) || Ys.has(b)) || !a.g.Qa() ? a.h[b].bind(a.h) : a.g.get("player", b);
    }
    function ut(a, b, c) {
      a.g.Qa() && (b == "video" ? a.m.dispatchEvent(c) : b == "player" && (c.type == "unloading" && Ct(a), a.u.dispatchEvent(c)));
    }
    function Ct(a) {
      a.F = [];
      a.D = [];
      a.C = [];
    }
    S("shaka.cast.CastProxy", rt);
    rt.prototype.changeReceiverId = rt.prototype.Mi;
    rt.prototype.forceDisconnect = rt.prototype.Fd;
    rt.prototype.suggestDisconnect = rt.prototype.Vj;
    rt.prototype.setAppData = rt.prototype.bi;
    rt.prototype.cast = rt.prototype.cast;
    rt.prototype.receiverName = rt.prototype.Yf;
    rt.prototype.isCasting = rt.prototype.Qa;
    rt.prototype.canCast = rt.prototype.Kg;
    rt.prototype.getPlayer = rt.prototype.Vb;
    rt.prototype.getVideo = rt.prototype.Pc;
    rt.prototype.destroy = rt.prototype.destroy;
    function Dt(a, b, c, d) {
      lb.call(this);
      var e = this;
      this.h = a;
      this.g = b;
      this.j = new Qc();
      this.I = { video: a, player: b };
      this.G = c || function() {
      };
      this.J = d || function(f) {
        return f;
      };
      this.i = null;
      this.H = false;
      this.u = true;
      this.m = 0;
      this.D = false;
      this.C = true;
      this.A = this.l = null;
      this.F = new Cf(function() {
        Et(e);
      });
      Ft(this);
    }
    ma(Dt, lb);
    p = Dt.prototype;
    p.isConnected = function() {
      return this.H;
    };
    p.Dl = function() {
      return this.u;
    };
    p.rm = function(a) {
      this.i = a;
    };
    p.tk = function() {
      this.i = null;
    };
    p.sm = function(a) {
      this.i || (this.i = { metadataType: cast.receiver.media.MetadataType.GENERIC });
      this.i.title = a;
    };
    p.qm = function(a) {
      this.i || (this.i = { metadataType: cast.receiver.media.MetadataType.GENERIC });
      this.i.images = [{ url: a }];
    };
    p.pm = function(a) {
      this.i || (this.i = {});
      this.i.artist = a;
      this.i.metadataType = cast.receiver.media.MetadataType.MUSIC_TRACK;
    };
    p.destroy = function() {
      var a = this, b, c;
      return P(function(d) {
        if (d.g == 1) return a.j && (a.j.release(), a.j = null), b = [], a.g && (b.push(a.g.destroy()), a.g = null), a.F && (a.F.stop(), a.F = null), a.h = null, a.I = null, a.G = null, a.H = false, a.u = true, a.l = null, a.A = null, lb.prototype.release.call(a), G(d, Promise.all(b), 2);
        c = cast.receiver.CastReceiverManager.getInstance();
        c.stop();
        H(d);
      });
    };
    function Ft(a) {
      var b = cast.receiver.CastReceiverManager.getInstance();
      b.onSenderConnected = function() {
        return Gt(a);
      };
      b.onSenderDisconnected = function() {
        return Gt(a);
      };
      b.onSystemVolumeChanged = function() {
        var e = cast.receiver.CastReceiverManager.getInstance().getSystemVolume();
        e && Ht(a, { type: "update", update: { video: { volume: e.level, muted: e.muted } } }, a.l);
        Ht(a, { type: "event", targetName: "video", event: { type: "volumechange" } }, a.l);
      };
      a.A = b.getCastMessageBus("urn:x-cast:com.google.cast.media");
      a.A.onMessage = function(e) {
        return It(
          a,
          e
        );
      };
      a.l = b.getCastMessageBus("urn:x-cast:com.google.shaka.v2");
      a.l.onMessage = function(e) {
        return Jt(a, e);
      };
      b.start();
      b = t(Ts);
      for (var c = b.next(); !c.done; c = b.next()) a.j.o(a.h, c.value, function(e) {
        return Kt(a, "video", e);
      });
      for (var d in Za) a.j.o(a.g, Za[d], function(e) {
        return Kt(a, "player", e);
      });
      a.j.o(a.h, "loadeddata", function() {
        a.D = true;
      });
      a.j.o(a.g, "loading", function() {
        a.u = false;
        Lt(a);
      });
      a.j.o(a.h, "playing", function() {
        a.u = false;
        Lt(a);
      });
      a.j.o(a.h, "pause", function() {
        Lt(a);
      });
      a.j.o(a.g, "unloading", function() {
        a.u = true;
        Lt(a);
      });
      a.j.o(a.h, "ended", function() {
        new Cf(function() {
          a.h && a.h.ended && (a.u = true, Lt(a));
        }).Y(Mt);
      });
    }
    function Gt(a) {
      a.m = 0;
      a.C = true;
      a.H = cast.receiver.CastReceiverManager.getInstance().getSenders().length != 0;
      Lt(a);
    }
    function Lt(a) {
      var b;
      P(function(c) {
        if (c.g == 1) return G(c, Promise.resolve(), 2);
        if (!a.g) return c.return();
        b = new T("caststatuschanged");
        a.dispatchEvent(b);
        Nt(a) || Ot(a);
        H(c);
      });
    }
    function Pt(a, b, c) {
      var d, e, f, g, h, k2, l, m, n, q, r, u, w, v, y, z, A, C, D;
      P(function(F) {
        switch (F.g) {
          case 1:
            for (d in b.player) e = b.player[d], a.g[d](e);
            a.G(c);
            f = a.h.autoplay;
            return b.manifest ? (a.h.autoplay = false, sa(F, 5), G(F, a.g.load(b.manifest, b.startTime), 7)) : G(F, Promise.resolve(), 3);
          case 7:
            if (b.addThumbnailsTrackCalls) for (g = t(b.addThumbnailsTrackCalls), h = g.next(); !h.done; h = g.next()) k2 = h.value, a.g.cf.apply(a.g, x(k2));
            if (b.addTextTrackAsyncCalls) for (l = t(b.addTextTrackAsyncCalls), m = l.next(); !m.done; m = l.next()) n = m.value, a.g.be.apply(a.g, x(n));
            if (b.addChaptersTrackCalls) for (q = t(b.addChaptersTrackCalls), r = q.next(); !r.done; r = q.next()) u = r.value, a.g.bf.apply(a.g, x(u));
            ua(F, 3);
            break;
          case 5:
            return w = va(F), v = (/* @__PURE__ */ new Map()).set("detail", w), y = new T("error", v), a.g && a.g.dispatchEvent(y), F.return();
          case 3:
            if (!a.g) return F.return();
            for (z in b.video) A = b.video[z], a.h[z] = A;
            for (C in b.playerAfterLoad) D = b.playerAfterLoad[C], a.g[C](D);
            a.h.autoplay = f;
            b.manifest && (a.h.play(), Ot(a));
            H(F);
        }
      });
    }
    function Kt(a, b, c) {
      a.g && (Et(a), Ht(a, { type: "event", targetName: b, event: c }, a.l));
    }
    function Et(a) {
      a.F.Y(Qt);
      for (var b = { video: {}, player: {} }, c = t(Us), d = c.next(); !d.done; d = c.next()) d = d.value, b.video[d] = a.h[d];
      a.g.U() && Zs.forEach(function(e, f) {
        a.m % e == 0 && (b.player[f] = a.g[f]());
      });
      Xs.forEach(function(e, f) {
        a.m % e == 0 && (b.player[f] = a.g[f]());
      });
      if (c = cast.receiver.CastReceiverManager.getInstance().getSystemVolume()) b.video.volume = c.level, b.video.muted = c.muted;
      Ht(a, { type: "update", update: b }, a.l);
      Ys.forEach(function(e, f) {
        a.m % e == 0 && (e = { player: {} }, e.player[f] = a.g[f](), Ht(
          a,
          { type: "update", update: e },
          a.l
        ));
      });
      a.D && (a.m += 1);
      Nt(a);
    }
    function Nt(a) {
      return a.C && (a.h.duration || a.g.U()) ? (Rt(a), a.C = false, true) : false;
    }
    function Rt(a, b) {
      var c = { contentId: a.g.ed(), streamType: a.g.U() ? "LIVE" : "BUFFERED", contentType: "" };
      a.g.U() || (c.duration = a.h.duration);
      a.i && (c.metadata = a.i);
      Ot(a, b === void 0 ? 0 : b, c);
    }
    function Jt(a, b) {
      var c = Rs(b.data);
      switch (c.type) {
        case "init":
          a.m = 0;
          a.D = false;
          a.C = true;
          Pt(a, c.initState, c.appData);
          Et(a);
          break;
        case "appData":
          a.G(c.appData);
          break;
        case "set":
          var d = c.targetName, e = c.property;
          c = c.value;
          if (d == "video") {
            if (b = cast.receiver.CastReceiverManager.getInstance(), e == "volume") {
              b.setSystemVolumeLevel(c);
              break;
            } else if (e == "muted") {
              b.setSystemVolumeMuted(c);
              break;
            }
          }
          a.I[d][e] = c;
          break;
        case "call":
          d = a.I[c.targetName];
          d[c.methodName].apply(d, c.args);
          break;
        case "asyncCall":
          d = c.targetName;
          e = c.methodName;
          d == "player" && e == "load" && (a.m = 0, a.D = false);
          var f = c.id, g = b.senderId;
          b = a.I[d];
          c = b[e].apply(b, c.args);
          d == "player" && e == "load" && (c = c.then(function() {
            a.C = true;
          }));
          c.then(function(h) {
            return St(a, g, f, null, h);
          }, function(h) {
            return St(a, g, f, h, null);
          });
      }
    }
    function It(a, b) {
      var c = Rs(b.data);
      switch (c.type) {
        case "PLAY":
          a.h.play();
          Ot(a);
          break;
        case "PAUSE":
          a.h.pause();
          Ot(a);
          break;
        case "SEEK":
          b = c.currentTime;
          var d = c.resumeState;
          b != null && (a.h.currentTime = Number(b));
          d && d == "PLAYBACK_START" ? (a.h.play(), Ot(a)) : d && d == "PLAYBACK_PAUSE" && (a.h.pause(), Ot(a));
          break;
        case "STOP":
          a.g.rc().then(function() {
            a.g && Ot(a);
          });
          break;
        case "GET_STATUS":
          Rt(a, Number(c.requestId));
          break;
        case "VOLUME":
          d = c.volume;
          b = d.level;
          d = d.muted;
          var e = a.h.volume, f = a.h.muted;
          b != null && (a.h.volume = Number(b));
          d != null && (a.h.muted = d);
          e == a.h.volume && f == a.h.muted || Ot(a);
          break;
        case "LOAD":
          a.m = 0;
          a.D = false;
          a.C = false;
          b = c.media;
          d = c.currentTime;
          e = a.J(b.contentId);
          f = c.autoplay || true;
          a.G(b.customData);
          f && (a.h.autoplay = true);
          a.g.load(e, d).then(function() {
            a.g && Rt(a);
          }).catch(function(g) {
            var h = "LOAD_FAILED";
            g.category == 7 && g.code == 7e3 && (h = "LOAD_CANCELLED");
            Ht(a, { requestId: Number(c.requestId), type: h }, a.A);
          });
          break;
        default:
          Ht(a, { requestId: Number(c.requestId), type: "INVALID_REQUEST", reason: "INVALID_COMMAND" }, a.A);
      }
    }
    function St(a, b, c, d, e) {
      a.g && Ht(a, { type: "asyncComplete", id: c, error: d, res: e }, a.l, b);
    }
    function Ht(a, b, c, d) {
      a.H && (a = Qs(b), d ? c.getCastChannel(d).send(a) : c.broadcast(a));
    }
    function Ot(a, b, c) {
      c = c === void 0 ? null : c;
      var d = { mediaSessionId: 0, playbackRate: a.h.playbackRate, playerState: a.u ? Tt : a.g.Bf() ? Ut : a.h.paused ? Vt : Wt, currentTime: a.h.currentTime, supportedMediaCommands: 63, volume: { level: a.h.volume, muted: a.h.muted } };
      c && (d.media = c);
      Ht(a, { requestId: b === void 0 ? 0 : b, type: "MEDIA_STATUS", status: [d] }, a.A);
    }
    S("shaka.cast.CastReceiver", Dt);
    Dt.prototype.destroy = Dt.prototype.destroy;
    Dt.prototype.setContentArtist = Dt.prototype.pm;
    Dt.prototype.setContentImage = Dt.prototype.qm;
    Dt.prototype.setContentTitle = Dt.prototype.sm;
    Dt.prototype.clearContentMetadata = Dt.prototype.tk;
    Dt.prototype.setContentMetadata = Dt.prototype.rm;
    Dt.prototype.isIdle = Dt.prototype.Dl;
    Dt.prototype.isConnected = Dt.prototype.isConnected;
    var Qt = 0.5, Mt = 5, Tt = "IDLE", Wt = "PLAYING", Ut = "BUFFERING", Vt = "PAUSED";
    function Xt(a, b, c, d, e) {
      if (d >= e) return null;
      for (var f = -1, g = -1, h = 0; h < c.length; h++) if (c[h].some(function(C) {
        return C != null && C.g.trim() != "";
      })) {
        f = h;
        break;
      }
      for (h = c.length - 1; h >= 0; h--) if (c[h].some(function(C) {
        return C != null && C.g.trim() != "";
      })) {
        g = h;
        break;
      }
      if (f === -1 || g === -1) return null;
      for (var k2 = h = false, l = "white", m = "black", n = Yt(d, e, h, k2, l, m); f <= g; f++) {
        for (var q = c[f], r = -1, u = -1, w = 0; w < q.length; w++) if (q[w] != null && q[w].g.trim() !== "") {
          r = w;
          break;
        }
        for (w = q.length - 1; w >= 0; w--) if (q[w] != null && q[w].g.trim() !== "") {
          u = w;
          break;
        }
        if (r === -1 || u === -1) q = Zt(d, e), a.nestedCues.push(q);
        else {
          for (; r <= u; r++) if (w = q[r]) {
            var v = w.l, y = w.i, z = w.j, A = w.h;
            if (v != h || y != k2 || z != l || A != m) n.payload && a.nestedCues.push(n), n = Yt(d, e, v, y, z, A), h = v, k2 = y, l = z, m = A;
            n.payload += w.g;
          } else n.payload += " ";
          n.payload && a.nestedCues.push(n);
          f !== g && (n = Zt(d, e), a.nestedCues.push(n));
          n = Yt(d, e, h, k2, l, m);
        }
      }
      return a.nestedCues.length ? { cue: a, stream: b } : null;
    }
    function Yt(a, b, c, d, e, f) {
      a = new se(a, b, "");
      c && a.textDecoration.push(Re);
      d && (a.fontStyle = Qe);
      a.color = e;
      a.backgroundColor = f;
      return a;
    }
    function Zt(a, b) {
      a = new se(a, b, "");
      a.lineBreak = true;
      return a;
    }
    function $t(a, b, c, d, e) {
      this.g = a;
      this.l = b;
      this.i = c;
      this.h = d;
      this.j = e;
    }
    ;
    function au(a, b) {
      this.i = [];
      this.g = 1;
      this.h = 0;
      this.F = a;
      this.D = b;
      this.j = this.m = false;
      this.l = "white";
      this.u = "black";
      this.A = this.C = null;
      bu(this);
    }
    function cu(a, b, c) {
      var d = "CC" + ((a.F << 1 | a.D) + 1), e = new se(b, c, "");
      e.lineInterpretation = 1;
      var f = du.get(a.g);
      f && (e.line = f);
      a.A != null && a.C != null && (e.position = 10 + Math.min(70, a.A * 10) + a.C * 2.5);
      (b = Xt(e, d, a.i, b, c)) && a.g + b.cue.nestedCues.length - 3 > 15 && (f = du.get(a.g + 3 - b.cue.nestedCues.length)) && (e.line = f);
      return b;
    }
    function bu(a) {
      eu(a, 0, 15);
      a.g = 1;
    }
    function fu(a, b, c) {
      if (!(c < 32 || c > 127)) {
        var d = "";
        switch (b) {
          case 0:
            d = gu.has(c) ? gu.get(c) : String.fromCharCode(c);
            break;
          case 1:
            d = hu.get(c);
            break;
          case 2:
            a.i[a.g].pop();
            d = iu.get(c);
            break;
          case 3:
            a.i[a.g].pop(), d = ju.get(c);
        }
        d && a.i[a.g].push(new $t(d, a.m, a.j, a.u, a.l));
      }
    }
    function ku(a, b, c, d) {
      if (!(c < 0 || b < 0)) if (b >= c) for (--d; d >= 0; d--) a.i[b + d] = a.i[c + d].map(function(f) {
        return f;
      });
      else for (var e = 0; e < d; e++) a.i[b + e] = a.i[c + e].map(function(f) {
        return f;
      });
    }
    function eu(a, b, c) {
      for (var d = 0; d <= c; d++) a.i[b + d] = [];
    }
    var gu = /* @__PURE__ */ new Map([[39, "\u2019"], [42, "\xE1"], [92, "\xE9"], [92, "\xE9"], [94, "\xED"], [95, "\xF3"], [96, "\xFA"], [123, "\xE7"], [124, "\xF7"], [125, "\xD1"], [126, "\xF1"], [127, "\u2588"]]), hu = /* @__PURE__ */ new Map([[48, "\xAE"], [49, "\xB0"], [50, "\xBD"], [51, "\xBF"], [52, "\u2122"], [53, "\xA2"], [54, "\xA3"], [55, "\u266A"], [56, "\xE0"], [57, " "], [58, "\xE8"], [59, "\xE2"], [60, "\xEA"], [61, "\xEE"], [62, "\xF4"], [63, "\xFB"]]), iu = /* @__PURE__ */ new Map([
      [32, "\xC1"],
      [33, "\xC9"],
      [34, "\xD3"],
      [35, "\xDA"],
      [36, "\xDC"],
      [37, "\xFC"],
      [38, "\u2018"],
      [39, "\xA1"],
      [40, "*"],
      [41, "'"],
      [42, "\u2500"],
      [43, "\xA9"],
      [44, "\u2120"],
      [45, "\xB7"],
      [46, "\u201C"],
      [47, "\u201D"],
      [48, "\xC0"],
      [49, "\xC2"],
      [50, "\xC7"],
      [51, "\xC8"],
      [52, "\xCA"],
      [53, "\xCB"],
      [54, "\xEB"],
      [55, "\xCE"],
      [56, "\xCF"],
      [57, "\xEF"],
      [58, "\xD4"],
      [59, "\xD9"],
      [60, "\xF9"],
      [61, "\xDB"],
      [62, "\xAB"],
      [63, "\xBB"]
    ]), ju = /* @__PURE__ */ new Map([
      [32, "\xC3"],
      [33, "\xE3"],
      [34, "\xCD"],
      [35, "\xCC"],
      [36, "\xEC"],
      [37, "\xD2"],
      [38, "\xF2"],
      [39, "\xD5"],
      [40, "\xF5"],
      [41, "{"],
      [42, "}"],
      [43, "\\"],
      [44, "^"],
      [45, "_"],
      [46, "|"],
      [47, "~"],
      [48, "\xC4"],
      [49, "\xE4"],
      [50, "\xD6"],
      [51, "\xF6"],
      [52, "\xDF"],
      [53, "\xA5"],
      [54, "\xA4"],
      [55, "\u2502"],
      [56, "\xC5"],
      [57, "\xE5"],
      [58, "\xD8"],
      [59, "\xF8"],
      [60, "\u250C"],
      [61, "\u2510"],
      [62, "\u2514"],
      [63, "\u2518"]
    ]), du = /* @__PURE__ */ new Map([[1, 10], [2, 15.33], [3, 20.66], [4, 26], [5, 31.33], [6, 36.66], [7, 42], [8, 47.33], [9, 52.66], [10, 58], [11, 63.33], [12, 68.66], [13, 74], [14, 79.33], [15, 84.66]]);
    function lu(a, b) {
      this.h = 0;
      this.u = new au(a, b);
      this.i = new au(a, b);
      this.g = this.j = new au(a, b);
      this.l = 0;
      this.m = null;
    }
    function mu(a, b, c) {
      a.g = a.i;
      var d = a.g, e = null;
      a.h !== 3 && a.h !== 4 && (e = cu(d, a.l, c), c = a.i, c.g = c.h > 0 ? c.h : 0, eu(c, 0, 15), c = a.j, c.g = c.h > 0 ? c.h : 0, eu(c, 0, 15), d.g = 15);
      a.h = 3;
      d.h = b;
      return e;
    }
    function nu(a) {
      a.h = 1;
      a.g = a.j;
      a.g.h = 0;
    }
    function ou(a) {
      cb("Cea608DataChannel", "CEA-608 text mode entered, but is unsupported");
      a.g = a.u;
      a.h = 4;
    }
    var pu = "black green blue cyan red yellow magenta black".split(" "), qu = "white green blue cyan red yellow magenta white_italics".split(" ");
    function ru(a, b) {
      this.J = b;
      this.M = a;
      this.K = this.l = false;
      this.m = this.u = this.H = this.L = this.I = 0;
      this.G = 2;
      this.i = [];
      this.g = this.h = this.j = 0;
      this.F = this.C = false;
      this.D = "white";
      this.A = "black";
      su(this);
    }
    function su(a) {
      a.i = [];
      for (var b = 0; b < 16; b++) a.i.push(tu());
    }
    function tu() {
      for (var a = [], b = 0; b < 42; b++) a.push(null);
      return a;
    }
    function uu(a, b) {
      vu(a) && (a.i[a.h][a.g] = new $t(b, a.F, a.C, a.A, a.D), a.g++);
    }
    function vu(a) {
      var b = a.g < a.m && a.g >= 0;
      return a.h < a.u && a.h >= 0 && b;
    }
    ru.prototype.isVisible = function() {
      return this.l;
    };
    function wu(a) {
      for (var b = 0, c = 1; c < 16; c++, b++) a.i[b] = a.i[c];
      for (c = 0; c < 1; c++, b++) a.i[b] = tu();
    }
    function xu(a, b, c) {
      var d = new se(a.j, b, "");
      d.textAlign = a.G === 0 ? "left" : a.G === 1 ? "right" : ue;
      var e = d.region;
      a.J && (e.id += "svc" + a.J);
      e.id += "win" + a.M;
      e.height = a.u;
      e.width = a.m;
      e.heightUnits = 2;
      e.widthUnits = 2;
      e.viewportAnchorX = a.I;
      e.viewportAnchorY = a.L;
      e.viewportAnchorUnits = a.K ? rd : 2;
      switch (a.H) {
        case 0:
          e.regionAnchorX = 0;
          e.regionAnchorY = 0;
          break;
        case 1:
          e.regionAnchorX = 50;
          e.regionAnchorY = 0;
          break;
        case 2:
          e.regionAnchorX = 100;
          e.regionAnchorY = 0;
          break;
        case 3:
          e.regionAnchorX = 0;
          e.regionAnchorY = 50;
          break;
        case 4:
          e.regionAnchorX = 50;
          e.regionAnchorY = 50;
          break;
        case 5:
          e.regionAnchorX = 100;
          e.regionAnchorY = 50;
          break;
        case 6:
          e.regionAnchorX = 0;
          e.regionAnchorY = 100;
          break;
        case 7:
          e.regionAnchorX = 50;
          e.regionAnchorY = 100;
          break;
        case 8:
          e.regionAnchorX = 100, e.regionAnchorY = 100;
      }
      if (c = Xt(d, "svc" + c, a.i, a.j, b)) a.j = b;
      return c;
    }
    ru.prototype.display = function() {
      this.l = true;
    };
    function yu() {
      this.i = [];
      this.h = null;
      this.g = 0;
    }
    function zu(a, b) {
      b.type === 3 ? (a.g = (b.value & 63) * 2 - 1, a.h = []) : a.h && (a.g > 0 && (a.h.push(b), a.g--), a.g === 0 && (a.i.push(new Au(a.h)), a.h = null, a.g = 0));
    }
    function Au(a) {
      this.g = 0;
      this.h = a;
    }
    Au.prototype.Pa = function() {
      return this.g < this.h.length;
    };
    Au.prototype.Ua = function() {
      return this.g;
    };
    function Bu(a) {
      if (!a.Pa()) throw new U(2, 2, 3e3);
      return a.h[a.g++];
    }
    Au.prototype.skip = function(a) {
      if (this.g + a > this.h.length) throw new U(2, 2, 3e3);
      this.g += a;
    };
    Au.prototype.Cj = function(a) {
      if (this.g - a < 0) throw new U(2, 2, 3e3);
      this.g -= a;
    };
    function Cu(a) {
      this.i = a;
      this.h = [null, null, null, null, null, null, null, null];
      this.g = null;
    }
    function Du(a, b, c, d) {
      if (!a.g) return [];
      if (c == 24) return c = Bu(b).value, d = Bu(b).value, c = function(f) {
        return f.map(function(g) {
          return ("0" + (g & 255).toString(16)).slice(-2);
        }).join("");
      }([c, d]), uu(a.g, String.fromCharCode(parseInt(c, 16))), [];
      b = a.g;
      var e = null;
      switch (c) {
        case 8:
          !vu(b) || b.g <= 0 && b.h <= 0 || (b.g <= 0 ? (b.g = b.m - 1, b.h--) : b.g--, b.i[b.h][b.g] = null);
          break;
        case 13:
          b.isVisible() && (e = xu(b, d, a.i));
          b.h + 1 >= b.u ? wu(b) : b.h++;
          b.g = 0;
          break;
        case 14:
          b.isVisible() && (e = xu(b, d, a.i));
          b.i[b.h] = tu();
          b.g = 0;
          break;
        case 12:
          b.isVisible() && (e = xu(b, d, a.i)), su(b), b.h = 0, b.g = 0;
      }
      return e ? [e] : [];
    }
    function Eu(a, b, c, d) {
      if (c >= 128 && c <= 135) d = c & 7, a.h[d] && (a.g = a.h[d]);
      else {
        if (c === 136) {
          c = Bu(b).value;
          b = [];
          c = t(Fu(a, c));
          for (var e = c.next(); !e.done; e = c.next()) {
            e = a.h[e.value];
            if (e.isVisible()) {
              var f = xu(e, d, a.i);
              f && b.push(f);
            }
            su(e);
          }
          return b;
        }
        if (c === 137) for (b = Bu(b).value, b = t(Fu(a, b)), c = b.next(); !c.done; c = b.next()) c = a.h[c.value], c.isVisible() || (c.j = d), c.display();
        else {
          if (c === 138) {
            c = Bu(b).value;
            b = null;
            c = t(Fu(a, c));
            for (e = c.next(); !e.done; e = c.next()) e = a.h[e.value], e.isVisible() && (b = xu(e, d, a.i)), e.l = false;
            return b ? [b] : [];
          }
          if (c === 139) {
            c = Bu(b).value;
            b = null;
            c = t(Fu(a, c));
            for (e = c.next(); !e.done; e = c.next()) e = a.h[e.value], e.isVisible() ? b = xu(e, d, a.i) : e.j = d, e.l = !e.l;
            return b ? [b] : [];
          }
          if (c === 140) return b = Bu(b).value, Gu(a, b, d);
          if (c === 143) return d = Gu(a, 255, d), Hu(a), d;
          if (c === 144) b.skip(1), d = Bu(b).value, a.g && (a.g.C = (d & 128) > 0, a.g.F = (d & 64) > 0);
          else if (c === 145) d = Bu(b).value, c = Bu(b).value, b.skip(1), a.g && (b = Iu((c & 48) >> 4, (c & 12) >> 2, c & 3), a.g.D = Iu((d & 48) >> 4, (d & 12) >> 2, d & 3), a.g.A = b);
          else if (c === 146) d = Bu(b).value, b = Bu(b).value, a.g && (a = a.g, a.h = d & 15, a.g = b & 63);
          else if (c === 151) b.skip(1), b.skip(1), d = Bu(b).value, b.skip(1), a.g && (a.g.G = d & 3);
          else if (c >= 152 && c <= 159) {
            c = (c & 15) - 8;
            e = a.h[c] !== null;
            e || (f = new ru(c, a.i), f.j = d, a.h[c] = f);
            d = Bu(b).value;
            f = Bu(b).value;
            var g = Bu(b).value, h = Bu(b).value, k2 = Bu(b).value;
            b = Bu(b).value;
            e && (b & 7) === 0 || (b = a.h[c], b.h = 0, b.g = 0, b.F = false, b.C = false, b.D = "white", b.A = "black");
            b = a.h[c];
            b.l = (d & 32) > 0;
            b.L = f & 127;
            b.I = g;
            b.H = (h & 240) >> 4;
            b.K = (f & 128) > 0;
            b.u = (h & 15) + 1;
            b.m = (k2 & 63) + 1;
            a.g = a.h[c];
          }
        }
      }
      return [];
    }
    function Fu(a, b) {
      for (var c = [], d = 0; d < 8; d++) (b & 1) === 1 && a.h[d] && c.push(d), b >>= 1;
      return c;
    }
    function Gu(a, b, c) {
      var d = [];
      b = t(Fu(a, b));
      for (var e = b.next(); !e.done; e = b.next()) {
        e = e.value;
        var f = a.h[e];
        f.isVisible() && (f = xu(f, c, a.i)) && d.push(f);
        a.h[e] = null;
      }
      return d;
    }
    function Hu(a) {
      a.g = null;
      a.h = [null, null, null, null, null, null, null, null];
    }
    function Iu(a, b, c) {
      var d = { 0: 0, 1: 0, 2: 1, 3: 1 };
      a = d[a];
      b = d[b];
      c = d[c];
      return Ju[a << 2 | b << 1 | c];
    }
    var Ku = /* @__PURE__ */ new Map([[32, " "], [33, "\xA0"], [37, "\u2026"], [42, "\u0160"], [44, "\u0152"], [48, "\u2588"], [49, "\u2018"], [50, "\u2019"], [51, "\u201C"], [52, "\u201D"], [53, "\u2022"], [57, "\u2122"], [58, "\u0161"], [60, "\u0153"], [61, "\u2120"], [63, "\u0178"], [118, "\u215B"], [119, "\u215C"], [120, "\u215D"], [121, "\u215E"], [122, "\u2502"], [123, "\u2510"], [124, "\u2514"], [125, "\u2500"], [126, "\u2518"], [127, "\u250C"]]), Ju = "black blue green cyan red magenta yellow white".split(" ");
    function Lu() {
      this.h = [];
      this.g = [];
      this.i = new yu();
      this.l = 0;
      this.m = /* @__PURE__ */ new Map([["CC1", new lu(0, 0)], ["CC2", new lu(0, 1)], ["CC3", new lu(1, 0)], ["CC4", new lu(1, 1)]]);
      this.A = this.u = 0;
      this.j = /* @__PURE__ */ new Map();
      this.D = true;
      this.C = /* @__PURE__ */ new Set();
      Mu(this);
    }
    Lu.prototype.clear = function() {
      this.l = 0;
      this.h = [];
      this.g = [];
      var a = this.i;
      a.i = [];
      a.h = [];
      a.g = 0;
      Mu(this);
      a = t(this.j.values());
      for (var b = a.next(); !b.done; b = a.next()) Hu(b.value);
    };
    function Mu(a) {
      a.u = 0;
      a.A = 0;
      for (var b = t(a.m.values()), c = b.next(); !c.done; c = b.next()) c = c.value, c.h = 0, c.g = c.j, c.m = null, bu(c.i), bu(c.j), bu(c.u);
      a.D = true;
    }
    Lu.prototype.extract = function(a, b) {
      if (this.D) {
        for (var c = t(this.m.values()), d = c.next(); !d.done; d = c.next()) d.value.l = b;
        this.D = false;
      }
      a = new mh(a, 0);
      if (!(a.getLength() < 8) && a.ba() === 181 && a.Ha() === 49 && a.X() === 1195456820 && a.ba() === 3 && (c = a.ba(), (c & 64) !== 0)) for (c &= 31, a.skip(1), d = 0; d < c; d++) {
        var e = a.ba(), f = (e & 4) >> 2, g = a.ba(), h = a.ba();
        f && (e &= 3, e === 0 || e === 1 ? this.h.push({ pts: b, type: e, Hb: g, sc: h, order: this.h.length }) : (this.g.push({ pts: b, type: e, value: g, order: this.g.length }), this.g.push({ pts: b, type: 2, value: h, order: this.g.length })));
      }
    };
    Lu.prototype.decode = function() {
      function a(e, f) {
        return e.pts - f.pts || e.order - f.order;
      }
      var b = [];
      this.h.sort(a);
      this.g.sort(a);
      for (var c = t(this.h), d = c.next(); !d.done; d = c.next()) (d = Nu(this, d.value)) && b.push(d);
      c = t(this.g);
      for (d = c.next(); !d.done; d = c.next()) zu(this.i, d.value);
      c = t(this.i.i);
      for (d = c.next(); !d.done; d = c.next()) d = Ou(this, d.value), b.push.apply(b, x(d));
      this.i.i = [];
      this.h = [];
      this.g = [];
      return b;
    };
    function Nu(a, b) {
      var c = b.type;
      if ((b.Hb & 112) === 16) {
        var d = b.Hb >> 3 & 1;
        c === 0 ? a.u = d : a.A = d;
      }
      d = "CC" + ((c << 1 | (c ? a.A : a.u)) + 1);
      c = a.m.get(d);
      if (b.Hb === 255 && b.sc === 255 || !b.Hb && !b.sc || !Pu(b.Hb) || !Pu(b.sc)) return ++a.l >= 45 && Mu(a), null;
      a.l = 0;
      b.Hb &= 127;
      b.sc &= 127;
      var e = b.Hb;
      if (e >= 1 && e <= 15 || !b.Hb && !b.sc) return null;
      e = null;
      if ((b.Hb & 112) === 16) a: {
        a.C.add(d), d = b.Hb;
        a = b.sc;
        if (c.m === (d << 8 | a)) c.m = null;
        else if (c.m = d << 8 | a, (d & 240) === 16 && (a & 192) === 64) {
          b = [11, 11, 1, 2, 3, 4, 12, 13, 14, 15, 5, 6, 7, 8, 9, 10][(d & 7) << 1 | a >> 5 & 1];
          d = "white";
          e = false;
          var f = null;
          var g = a > 95 ? a - 96 : a - 64;
          g <= 13 ? d = qu[Math.floor(g / 2)] : g <= 15 ? e = true : f = Math.floor((g - 16) / 2);
          a = (a & 1) === 1;
          c.h !== 4 && (g = c.g, c.h === 3 && b !== g.g && (c = 1 + b - g.h, ku(g, c, 1 + g.g - g.h, g.h), eu(g, 0, c - 1), eu(g, b + 1, 15 - b)), g.g = b, g.m = a, g.j = e, g.l = d, g.A = f, g.u = "black");
        } else if ((d & 247) === 17 && (a & 240) === 32) c.g.m = false, c.g.j = false, c.g.l = "white", fu(c.g, 0, 32), d = false, b = qu[(a & 14) >> 1], b === "white_italics" && (b = "white", d = true), c.g.m = (a & 1) === 1, c.g.j = d, c.g.l = b;
        else if ((d & 247) === 16 && (a & 240) === 32 || (d & 247) === 23 && (a & 255) === 45) b = "black", (d & 7) === 0 && (b = pu[(a & 14) >> 1]), c.g.u = b;
        else if ((d & 247) === 17 && (a & 240) === 48) fu(c.g, 1, a);
        else if ((d & 246) === 18 && (a & 224) === 32) fu(c.g, d & 1 ? 3 : 2, a);
        else {
          if ((d & 246) === 20 && (a & 240) === 32) {
            a = b.pts;
            d = null;
            switch (b.sc) {
              case 32:
                nu(c);
                break;
              case 33:
                c = c.g;
                c.i[c.g].pop();
                break;
              case 37:
                d = mu(c, 2, a);
                break;
              case 38:
                d = mu(c, 3, a);
                break;
              case 39:
                d = mu(c, 4, a);
                break;
              case 40:
                fu(c.g, 0, 32);
                break;
              case 41:
                c.h = 2;
                c.g = c.i;
                c.g.h = 0;
                c.l = a;
                break;
              case 42:
                bu(c.u);
                ou(c);
                break;
              case 43:
                ou(c);
                break;
              case 44:
                b = c.i;
                d = null;
                c.h !== 4 && (d = cu(b, c.l, a));
                eu(b, 0, 15);
                break;
              case 45:
                b = c.g;
                c.h !== 3 ? d = null : (d = cu(b, c.l, a), e = b.g - b.h + 1, ku(b, e - 1, e, b.h), eu(b, 0, e - 1), eu(b, b.g, 15 - b.g), c.l = a);
                break;
              case 46:
                eu(c.j, 0, 15);
                break;
              case 47:
                b = null, c.h !== 4 && (b = cu(c.i, c.l, a)), d = c.j, c.j = c.i, c.i = d, nu(c), c.l = a, d = b;
            }
            e = d;
            break a;
          }
          (d == 23 || d == 31) && a >= 33 && a <= 35 && (c.g.C = a - 32);
        }
        e = null;
      }
      else a = b.sc, fu(c.g, 0, b.Hb), fu(c.g, 0, a);
      return e;
    }
    function Ou(a, b) {
      var c = [];
      try {
        for (; b.Pa(); ) {
          var d = Bu(b).value, e = (d & 224) >> 5, f = d & 31;
          e === 7 && f != 0 && (e = Bu(b).value & 63);
          if (e != 0) {
            a.C.add("svc" + e);
            a.j.has(e) || a.j.set(e, new Cu(e));
            for (var g = a.j.get(e), h = b.Ua(); b.Ua() - h < f; ) {
              e = g;
              var k2 = b, l = Bu(k2), m = l.value, n = l.pts;
              if (m === 16) {
                var q = Bu(k2);
                m = m << 16 | q.value;
              }
              if (m >= 0 && m <= 31) var r = Du(e, k2, m, n);
              else if (m >= 128 && m <= 159) r = Eu(e, k2, m, n);
              else {
                if (m >= 4096 && m <= 4127) e = k2, k2 = m & 255, k2 >= 8 && k2 <= 15 ? e.skip(1) : k2 >= 16 && k2 <= 23 ? e.skip(2) : k2 >= 24 && k2 <= 31 && e.skip(3);
                else if (m >= 4224 && m <= 4255) e = k2, k2 = m & 255, k2 >= 128 && k2 <= 135 ? e.skip(4) : k2 >= 136 && k2 <= 143 && e.skip(5);
                else if (m >= 32 && m <= 127) k2 = m, e.g && (k2 === 127 ? uu(e.g, "\u266A") : uu(e.g, String.fromCharCode(k2)));
                else if (m >= 160 && m <= 255) e.g && uu(e.g, String.fromCharCode(m));
                else if (m >= 4128 && m <= 4223) {
                  if (k2 = m & 255, e.g) if (Ku.has(k2)) {
                    var u = Ku.get(k2);
                    uu(e.g, u);
                  } else uu(e.g, "_");
                } else m >= 4256 && m <= 4351 && e.g && ((m & 255) != 160 ? uu(e.g, "_") : uu(e.g, "[CC]"));
                r = [];
              }
              c.push.apply(c, x(r));
            }
          }
        }
      } catch (w) {
        if (w instanceof U && w.code === 3e3) cb("CEA708_INVALID_DATA", "Buffer read out of bounds / invalid CEA-708 Data.");
        else throw w;
      }
      return c;
    }
    function Pu(a) {
      for (var b = 0; a; ) b ^= a & 1, a >>= 1;
      return b === 1;
    }
    Lu.prototype.getStreams = function() {
      return Array.from(this.C);
    };
    S("shaka.cea.CeaDecoder", Lu);
    nd = function() {
      return new Lu();
    };
    function Qu(a) {
      for (var b = [], c = a, d = a = 0; d < c.length; ) a == 2 && c[d] == 3 ? (a = 0, c = [].concat(x(c)), c.splice(d, 1), c = new Uint8Array(c)) : c[d] == 0 ? a++ : a = 0, d++;
      a = c;
      for (d = 0; d < a.length; ) {
        for (c = 0; a[d] == 255; ) c += 255, d++;
        c += a[d++];
        for (var e = 0; a[d] == 255; ) e += 255, d++;
        e += a[d++];
        c == 4 && b.push(a.subarray(d, d + e));
        d += e;
      }
      return b;
    }
    ;
    function Ru() {
      this.j = /* @__PURE__ */ new Map();
      this.i = this.h = 0;
      this.g = Su;
    }
    Ru.prototype.init = function(a) {
      function b(f) {
        f = f.name;
        Tu.has(f) && (c.g = Tu.get(f));
      }
      var c = this, d = [], e = [];
      new ph().box("moov", uh).box("mvex", uh).W("trex", function(f) {
        var g = f.reader;
        g.skip(4);
        g.skip(4);
        f = g.X();
        g = g.X();
        c.h = f;
        c.i = g;
      }).box("trak", uh).W("tkhd", function(f) {
        var g = f.reader;
        f = f.version;
        f == 1 ? (g.skip(8), g.skip(8)) : (g.skip(4), g.skip(4));
        var h = g.X();
        f == 1 ? g.skip(8) : g.skip(4);
        g.skip(4);
        g.skip(8);
        g.skip(2);
        g.skip(2);
        g.skip(2);
        g.skip(2);
        g.skip(36);
        g.Ha();
        g.Ha();
        g.Ha();
        g.Ha();
        d.push(h);
      }).box("mdia", uh).W(
        "mdhd",
        function(f) {
          f = Oi(f.reader, f.version);
          e.push(f.timescale);
        }
      ).box("minf", uh).box("stbl", uh).W("stsd", wh).box("avc1", b).box("avc3", b).box("dvav", b).box("dva1", b).box("hev1", b).box("hvc1", b).box("dvh1", b).box("dvhe", b).box("vvc1", b).box("vvi1", b).box("dvc1", b).box("dvi1", b).box("encv", xh).box("sinf", uh).box("frma", function(f) {
        f = Ri(f.reader).codec;
        Tu.has(f) && (c.g = Tu.get(f));
      }).parse(a, true, true);
      if (!d.length || !e.length || d.length != e.length) throw new U(2, 2, 2010);
      this.g == Su && bb("Unable to determine bitstream format for CEA parsing!");
      d.forEach(function(f, g) {
        c.j.set(f, e[g]);
      });
    };
    Ru.prototype.parse = function(a) {
      var b = this;
      if (this.g == Su) return [];
      var c = [], d = 0, e = [];
      new ph().box("moof", function(f) {
        d = f.start;
        e = [];
        uh(f);
      }).box("traf", function(f) {
        e.push({ baseMediaDecodeTime: null, ge: b.h, ie: b.i, tj: [], timescale: 9e4 });
        uh(f);
      }).W("trun", function(f) {
        var g = e[e.length - 1];
        f = Pi(f.reader, f.version, f.flags);
        g.tj.push(f);
      }).W("tfhd", function(f) {
        var g = e[e.length - 1];
        f = Mi(f.reader, f.flags);
        g.ge = f.ge || b.h;
        g.ie = f.ie || b.i;
        f = f.trackId;
        b.j.has(f) && (g.timescale = b.j.get(f));
      }).W("tfdt", function(f) {
        var g = e[e.length - 1];
        f = Ni(f.reader, f.version);
        g.baseMediaDecodeTime = f.baseMediaDecodeTime;
      }).box("mdat", function(f) {
        for (var g = d - f.start - 8, h = f.reader.Ua(), k2 = t(e), l = k2.next(); !l.done; l = k2.next()) l = l.value, l.baseMediaDecodeTime === null ? bb("Unable to find base media decode time for CEA captions!") : (f.reader.seek(h), Uu(b, f.reader, l.baseMediaDecodeTime, l.timescale, l.ge, l.ie, g, l.tj, c));
      }).parse(a, false, true);
      return c;
    };
    function Uu(a, b, c, d, e, f, g, h, k2) {
      var l = 0, m = f, n = h.map(function(u) {
        return u.Zh;
      });
      n = [].concat.apply([], x(n));
      n.length && (m = n[0].sampleSize || f);
      for (b.skip(g + h[0].Ug); b.Pa(); ) {
        g = b.X();
        var q = b.ba(), r = null;
        r = false;
        h = 1;
        switch (a.g) {
          case Vu:
            r = q & 31;
            r = r == 6;
            break;
          case Wu:
            h = 2;
            b.skip(1);
            r = q >> 1 & 63;
            r = r == 39 || r == 40;
            break;
          case Xu:
            h = 2;
            b.skip(1);
            r = q >> 1 & 63;
            r = r == 23 || r == 24;
            break;
          default:
            return;
        }
        if (r) for (q = 0, l < n.length && (q = n[l].cg || 0), q = (c + q) / d, h = t(Qu(b.$b(g - h))), r = h.next(); !r.done; r = h.next()) k2.push({ packet: r.value, pts: q });
        else try {
          b.skip(g - h);
        } catch (u) {
          break;
        }
        m -= g + 4;
        m == 0 && (c = l < n.length ? c + (n[l].$h || e) : c + e, l++, l < n.length ? m = n[l].sampleSize || f : m = f);
      }
    }
    S("shaka.cea.Mp4CeaParser", Ru);
    var Su = 0, Vu = 1, Wu = 2, Xu = 3, Tu = (/* @__PURE__ */ new Map()).set("avc1", Vu).set("avc3", Vu).set("dvav", Vu).set("dva1", Vu).set("hev1", Wu).set("hvc1", Wu).set("dvh1", Wu).set("dvhe", Wu).set("vvc1", Xu).set("vvi1", Xu).set("dvc1", Xu).set("dvi1", Xu);
    od("video/mp4", function() {
      return new Ru();
    });
    function Yu() {
      this.g = null;
    }
    Yu.prototype.init = function() {
    };
    Yu.prototype.parse = function(a) {
      this.g ? this.g.clearData() : this.g = new pk();
      var b = [];
      a = Lb(a);
      if (!xk(a)) return b;
      a = this.g.parse(a);
      var c = a.je(), d = a.xf();
      a = [];
      switch (c.video) {
        case "avc":
          a.push(6);
          break;
        case "hvc":
          a.push(39), a.push(40);
      }
      if (!a.length) return b;
      c = t(d);
      for (d = c.next(); !d.done; d = c.next()) if (d = d.value, a.includes(d.type) && d.time != null) for (var e = t(Qu(d.data)), f = e.next(); !f.done; f = e.next()) b.push({ packet: f.value, pts: d.time });
      return b;
    };
    S("shaka.cea.TsCeaParser", Yu);
    od("video/mp2t", function() {
      return new Yu();
    });
    function Zu(a) {
      var b = 0, c = Pb(a), d = c.getUint32(b, true);
      if (d != a.byteLength) return [];
      a: {
        a = b + 4 + 2;
        for (b = []; a < c.byteLength - 1; ) {
          d = c.getUint16(a, true);
          a += 2;
          var e = c.getUint16(a, true);
          a += 2;
          if ((e & 1) != 0 || e + a > c.byteLength) {
            c = [];
            break a;
          }
          var f = Lb(c, a, e);
          b.push({ type: d, value: f });
          a += e;
        }
        c = b;
      }
      return c;
    }
    function $u(a) {
      a = jc(Td(a));
      a = Zu(a).filter(function(b) {
        return b.type === av;
      })[0];
      if (!a) return null;
      a = Yb(a.value, true);
      return (a = Ld(a, "WRMHEADER")) ? a : null;
    }
    function bv(a) {
      try {
        var b = $u(a);
        if (b) a: {
          for (var c = t(Vd(b, "DATA")), d = c.next(); !d.done; d = c.next()) {
            var e = d.value;
            if (e.children) for (var f = t(e.children), g = f.next(); !g.done; g = f.next()) {
              var h = g.value;
              if (h.tagName == "LA_URL") {
                var k2 = Td(h);
                break a;
              }
            }
          }
          k2 = "";
        }
        else k2 = "";
        return k2;
      } catch (l) {
        return "";
      }
    }
    var av = 1;
    function cv(a, b, c) {
      var d = dv(a), e = null;
      a = [];
      var f = [], g = null, h = new Set(d.map(function(l) {
        return l.keyId;
      }));
      h.delete(null);
      var k2 = "cenc";
      if (h.size > 1) throw new U(2, 4, 4010);
      if (!b) {
        f = d.filter(function(l) {
          return l.Td == "urn:mpeg:dash:sea:2012";
        });
        if (f.length > 1) throw new U(2, 4, 4050);
        f.length && (g = ev(f[0]));
        (f = d.find(function(l) {
          return l.Td == "urn:mpeg:dash:mp4protection:2011";
        })) && f.encryptionScheme && (k2 = f.encryptionScheme);
        f = d.filter(function(l) {
          return l.Td == "urn:mpeg:dash:mp4protection:2011" ? (e = l.init || e, false) : l.Td != "urn:mpeg:dash:sea:2012";
        });
        f.length && (a = fv(e, k2, f, c, h), a.length == 0 && (a = [oc("", k2, e)]));
      }
      if (d.length && !g && (b || !f.length)) for (a = [], b = t(Object.values(c)), c = b.next(); !c.done; c = b.next()) c = c.value, c != "org.w3.clearkey" && a.push(oc(c, k2, e));
      if (h = Array.from(h)[0] || null) for (k2 = t(a), b = k2.next(); !b.done; b = k2.next()) for (b = t(b.value.initData), c = b.next(); !c.done; c = b.next()) c.value.keyId = h;
      return { Qi: h, Qn: e, drmInfos: a, Hg: g, Vi: true };
    }
    function gv(a, b, c, d) {
      var e = cv(a, c, d);
      if (b.Vi) {
        a = b.drmInfos.length == 1 && !b.drmInfos[0].keySystem;
        c = e.drmInfos.length == 0;
        if (b.drmInfos.length == 0 || a && !c) b.drmInfos = e.drmInfos;
        b.Vi = false;
      } else if (e.drmInfos.length > 0 && (b.drmInfos = b.drmInfos.filter(function(f) {
        return e.drmInfos.some(function(g) {
          return g.keySystem == f.keySystem;
        });
      }), b.drmInfos.length == 0)) throw new U(2, 4, 4008);
      return e.Qi || b.Qi;
    }
    function hv(a) {
      var b = Yd(a.node, "https://dashif.org/CPS", "Laurl");
      if (b && (b = Td(b))) return b;
      if ((b = Yd(a.node, "urn:microsoft:playready", "pro")) && Td(b)) return bv(b);
      if (a = Yd(a.node, "urn:mpeg:cenc:2013", "pssh")) {
        if (a = Td(a)) {
          b = jc(a);
          a = 8;
          b = Pb(b);
          var c = b.getUint8(a);
          a += 20;
          c > 0 && (a += 4 + 16 * b.getUint32(a));
          a = Lb(b, a + 4);
          a = hc(a);
          a = Ld("<pro>" + a + "</pro>");
          return bv(a);
        }
      }
      return "";
    }
    function fv(a, b, c, d, e) {
      var f = [];
      c = t(c);
      for (var g = c.next(); !g.done; g = c.next()) {
        g = g.value;
        var h = d[g.Td];
        if (h) {
          var k2;
          if ((k2 = Yd(g.node, "urn:microsoft:playready", "pro")) && Td(k2)) {
            k2 = Td(k2);
            k2 = jc(k2);
            var l = new Uint8Array([154, 4, 240, 121, 152, 64, 66, 134, 171, 146, 230, 91, 224, 136, 95, 149]);
            k2 = [{ initData: Bh(k2, l, /* @__PURE__ */ new Set(), 0), initDataType: "cenc", keyId: g.keyId }];
          } else k2 = null;
          l = null;
          if (g.Td === "urn:uuid:e2719d58-a985-b3c9-781a-b030af78d30e") {
            l = g;
            var m = e;
            if (m.size == 0) l = null;
            else {
              var n = new Uint8Array([
                16,
                119,
                239,
                236,
                192,
                178,
                77,
                2,
                172,
                227,
                60,
                30,
                82,
                226,
                251,
                75
              ]), q = new Uint8Array([]);
              l = [{ initData: Bh(q, n, m, 1), initDataType: "cenc", keyId: l.keyId }];
            }
          }
          k2 = oc(h, b, g.init || a || k2 || l);
          if (h = iv.get(h)) k2.licenseServerUri = h(g);
          f.push(k2);
        }
      }
      return f;
    }
    function dv(a) {
      var b = [];
      a = t(a);
      for (var c = a.next(); !c.done; c = a.next()) (c = jv(c.value)) && b.push(c);
      return b;
    }
    function jv(a) {
      var b = a.attributes.schemeIdUri, c = ae(a, "urn:mpeg:cenc:2013", "default_KID"), d = Zd(a, "urn:mpeg:cenc:2013", "pssh").map(Ud), e = a.attributes.value;
      if (!b) return null;
      b = b.toLowerCase();
      if (c && (c = c.replace(/-/g, "").toLowerCase(), c.includes(" "))) throw new U(2, 4, 4009);
      var f = [];
      try {
        f = d.map(function(g) {
          return { initDataType: "cenc", initData: jc(g), keyId: null };
        });
      } catch (g) {
        throw new U(2, 4, 4007);
      }
      return { node: a, Td: b, keyId: c, init: f.length > 0 ? f : null, encryptionScheme: e };
    }
    function ev(a) {
      if (!window2.crypto || !window2.crypto.subtle) throw bb("Web Crypto API is not available to decrypt AES-128. (Web Crypto only exists in secure origins like https)"), new U(2, 4, 4042);
      var b = Yd(a.node, "urn:mpeg:dash:schema:sea:2012", "SegmentEncryption");
      if (!b) throw new U(2, 4, 4051);
      if (b.attributes.schemeIdUri != "urn:mpeg:dash:sea:aes128-cbc:2013") throw new U(2, 4, 4051);
      b = Yd(a.node, "urn:mpeg:dash:schema:sea:2012", "CryptoPeriod");
      if (!b) throw new U(2, 4, 4051);
      a = b.attributes.IV;
      b = dc(b.attributes.keyUriTemplate);
      if (!a || !b) throw new U(2, 4, 4051);
      a = kc(a.substr(2));
      if (a.byteLength != 16) throw new U(2, 4, 4048);
      return { Jl: b, iv: a };
    }
    var iv = (/* @__PURE__ */ new Map()).set("com.apple.fps", function(a) {
      if ("apple" === window2.shakaMediaKeysPolyfill) throw new U(2, 4, 4054);
      if (a = Yd(a.node, "https://dashif.org/CPS", "Laurl")) {
        if (a = Td(a)) return a;
      }
      return "";
    }).set("com.widevine.alpha", function(a) {
      var b = Yd(a.node, "https://dashif.org/CPS", "Laurl");
      return b && (b = Td(b)) ? b : (a = Yd(a.node, "urn:microsoft", "laurl")) ? dc(a.attributes.licenseUrl) || "" : "";
    }).set("com.microsoft.playready", hv).set("com.microsoft.playready.recommendation", hv).set(
      "com.microsoft.playready.software",
      hv
    ).set("com.microsoft.playready.hardware", hv).set("org.w3.clearkey", function(a) {
      var b = Yd(a.node, "https://dashif.org/CPS", "Laurl");
      return b && (b = Td(b)) ? b : (a = Yd(a.node, "http://dashif.org/guidelines/clearKey", "Laurl")) && a.attributes.Lic_type === "EME-1.0" && a && (a = Td(a)) ? a : "";
    });
    function kv(a, b, c, d, e, f) {
      var g = (/* @__PURE__ */ new Map()).set("RepresentationID", b).set("Number", c).set("SubNumber", d).set("Bandwidth", e).set("Time", f);
      return a.replace(/\$(RepresentationID|Number|SubNumber|Bandwidth|Time)?(?:%0([0-9]+)([diouxX]))?\$/g, function(h, k2, l, m) {
        if (h == "$$") return "$";
        var n = g.get(k2);
        if (n == null) return h;
        k2 == "RepresentationID" && l && (l = void 0);
        k2 == "Time" && typeof n != "bigint" && (Math.abs(n - Math.round(n)) >= 0.2 && bb("Calculated $Time$ values must be close to integers"), n = Math.round(n));
        switch (m) {
          case void 0:
          case "d":
          case "i":
          case "u":
            h = n.toString();
            break;
          case "o":
            h = n.toString(8);
            break;
          case "x":
            h = n.toString(16);
            break;
          case "X":
            h = n.toString(16).toUpperCase();
            break;
          default:
            h = n.toString();
        }
        l = window2.parseInt(l, 10) || 1;
        return Array(Math.max(0, l - h.length) + 1).join("0") + h;
      });
    }
    function lv(a, b) {
      var c = mv(a, b, "timescale"), d = 1;
      c && (d = ge(c) || 1);
      c = mv(a, b, "duration");
      var e = (c = ge(c || "")) ? c / d : null, f = mv(a, b, "startNumber"), g = Number(mv(a, b, "presentationTimeOffset")) || 0, h = he(f || "");
      if (f == null || h == null) h = 1;
      f = null;
      if (b = nv(a, b, "SegmentTimeline")) {
        b = Sd(b, "S");
        f = d;
        a = a.ra.duration || Infinity;
        for (var k2 = h, l = [], m = -g, n = 0; n < b.length; ++n) {
          var q = b[n], r = b[n + 1], u = $d(q, "t", he), w = $d(q, "d", he), v = $d(q, "r", fe);
          q = $d(q, "k", fe) || 0;
          u != null && (u -= g);
          if (w) {
            u = u != null ? u : m;
            v = v || 0;
            if (v < 0) if (r) {
              r = $d(r, "t", he);
              if (r == null) break;
              else if (u >= r) break;
              v = Math.ceil((r - u) / w) - 1;
            } else {
              if (a == Infinity) break;
              else if (u / f >= a) break;
              v = Math.ceil((a * f - u) / w) - 1;
            }
            l.length > 0 && u != m && (l[l.length - 1].end = u / f);
            for (r = 0; r <= v; ++r) m = u + w, l.push({ start: u / f, end: m / f, xi: u, Cc: q, nm: l.length + k2 }), u = m;
          }
        }
        f = l;
      }
      return { timescale: d, og: c, ob: e, Ge: h, Qb: g / d || 0, vd: g, timeline: f };
    }
    function ov(a, b) {
      return [b(a.N), b(a.wa), b(a.Aa)].filter(Ff);
    }
    function mv(a, b, c) {
      b = ov(a, b);
      a = null;
      b = t(b);
      for (var d = b.next(); !d.done && !(a = d.value.attributes[c]); d = b.next()) ;
      return a;
    }
    function nv(a, b, c) {
      b = ov(a, b);
      a = null;
      b = t(b);
      for (var d = b.next(); !d.done && !(a = Xd(d.value, c)); d = b.next()) ;
      return a;
    }
    function pv(a, b, c, d, e, f) {
      for (var g = ae(a, "http://www.w3.org/1999/xlink", "href"), h = ae(a, "http://www.w3.org/1999/xlink", "actuate") || "onRequest", k2 = t(Object.keys(a.attributes)), l = k2.next(); !l.done; l = k2.next()) {
        l = l.value;
        var m = l.split(":"), n = Nd("http://www.w3.org/1999/xlink");
        m[0] == n && delete a.attributes[l];
      }
      if (f >= 5) return Og(new U(2, 4, 4028));
      if (h != "onLoad") return Og(new U(2, 4, 4027));
      var q = nc([d], [g]);
      return e.request(0, ah(q, b)).cb(function(r) {
        r = Kd(r.data, a.tagName);
        if (!r) return Og(new U(2, 4, 4001, g));
        for (a.children = []; r.children.length; ) {
          var u = r.children.shift();
          a.children.push(u);
        }
        u = t(Object.keys(r.attributes));
        for (var w = u.next(); !w.done; w = u.next()) w = w.value, a.attributes[w] = r.attributes[w];
        return qv(a, b, c, q[0], e, f + 1);
      });
    }
    function qv(a, b, c, d, e, f) {
      f = f === void 0 ? 0 : f;
      if (ae(a, "http://www.w3.org/1999/xlink", "href")) {
        var g = pv(a, b, c, d, e, f);
        c && (g = g.cb(void 0, function() {
          return qv(a, b, c, d, e, f);
        }));
        return g;
      }
      g = [];
      for (var h = t(Rd(a)), k2 = h.next(), l = {}; !k2.done; l = { ce: void 0 }, k2 = h.next()) l.ce = k2.value, ae(l.ce, "http://www.w3.org/1999/xlink", "href") == "urn:mpeg:dash:resolve-to-zero:2013" ? a.children = a.children.filter(/* @__PURE__ */ function(m) {
        return function(n) {
          return n !== m.ce;
        };
      }(l)) : l.ce.tagName != "SegmentTimeline" && g.push(qv(l.ce, b, c, d, e, f));
      return Sg(g).cb(function() {
        return a;
      });
    }
    ;
    function rv(a, b, c, d, e, f, g) {
      var h, k2 = new ph().W("sidx", function(l) {
        h = sv(b, d, e, f, g, c, l);
      });
      a && k2.parse(a);
      if (h) return h;
      throw new U(2, 3, 3004);
    }
    function sv(a, b, c, d, e, f, g) {
      var h = [];
      g.reader.skip(4);
      var k2 = g.reader.X();
      if (k2 == 0) throw new U(2, 3, 3005);
      if (g.version == 0) {
        var l = g.reader.X();
        var m = g.reader.X();
      } else l = g.reader.Qd(), m = g.reader.Qd();
      g.reader.skip(2);
      var n = g.reader.Ha();
      a = a + g.size + m;
      for (m = 0; m < n; m++) {
        var q = g.reader.X(), r = (q & 2147483648) >>> 31;
        q &= 2147483647;
        var u = g.reader.X();
        g.reader.skip(4);
        if (r == 1) throw new U(2, 3, 3006);
        h.push(new Cj(l / k2 + c, (l + u) / k2 + c, function() {
          return f;
        }, a, a + q - 1, b, c, d, e));
        l += u;
        a += q;
      }
      g.parser.stop();
      return h;
    }
    ;
    function tv(a) {
      this.h = Pb(a);
      this.g = new mh(this.h, 0);
    }
    tv.prototype.Pa = function() {
      return this.g.Pa();
    };
    function uv(a) {
      var b = vv(a);
      if (b.length > 7) throw new U(2, 3, 3002);
      var c = 0;
      b = t(b);
      for (var d = b.next(); !d.done; d = b.next()) c = 256 * c + d.value;
      b = vv(a);
      a: {
        d = t(wv);
        for (var e = d.next(); !e.done; e = d.next()) if (Kb(b, new Uint8Array(e.value))) {
          d = true;
          break a;
        }
        d = false;
      }
      if (d) b = a.h.byteLength - a.g.Ua();
      else {
        if (b.length == 8 && b[1] & 224) throw new U(2, 3, 3001);
        for (e = d = 0; e < b.length; e++) {
          var f = b[e];
          d = e == 0 ? f & (1 << 8 - b.length) - 1 : 256 * d + f;
        }
        b = d;
      }
      b = a.g.Ua() + b <= a.h.byteLength ? b : a.h.byteLength - a.g.Ua();
      d = Pb(a.h, a.g.Ua(), b);
      a.g.skip(b);
      return new xv(
        c,
        d
      );
    }
    function vv(a) {
      var b = a.g.Ua(), c = a.g.ba();
      if (c == 0) throw new U(2, 3, 3002);
      c = 8 - Math.floor(Math.log2(c));
      a.g.skip(c - 1);
      return Lb(a.h, b, c);
    }
    var wv = [[255], [127, 255], [63, 255, 255], [31, 255, 255, 255], [15, 255, 255, 255, 255], [7, 255, 255, 255, 255, 255], [3, 255, 255, 255, 255, 255, 255], [1, 255, 255, 255, 255, 255, 255, 255]];
    function xv(a, b) {
      this.id = a;
      this.g = b;
    }
    function yv(a) {
      if (a.g.byteLength > 8) throw new U(2, 3, 3002);
      if (a.g.byteLength == 8 && a.g.getUint8(0) & 224) throw new U(2, 3, 3001);
      for (var b = 0, c = 0; c < a.g.byteLength; c++) {
        var d = a.g.getUint8(c);
        b = 256 * b + d;
      }
      return b;
    }
    ;
    function zv(a, b, c, d, e, f, g, h, k2) {
      function l() {
        return e;
      }
      var m = [];
      a = new tv(a.g);
      for (var n = null, q = null; a.Pa(); ) {
        var r = uv(a);
        if (r.id == 187) {
          var u = Av(r);
          u && (r = c * u.Bm, u = b + u.am, n != null && m.push(new Cj(n + g, r + g, l, q, u - 1, f, g, h, k2)), n = r, q = u);
        }
      }
      n != null && m.push(new Cj(n + g, d + g, l, q, null, f, g, h, k2));
      return m;
    }
    function Av(a) {
      var b = new tv(a.g);
      a = uv(b);
      if (a.id != 179) throw new U(2, 3, 3013);
      a = yv(a);
      b = uv(b);
      if (b.id != 183) throw new U(2, 3, 3012);
      b = new tv(b.g);
      for (var c = 0; b.Pa(); ) {
        var d = uv(b);
        if (d.id == 241) {
          c = yv(d);
          break;
        }
      }
      return { Bm: a, am: c };
    }
    ;
    function Bv(a, b, c) {
      b = nv(a, b, "Initialization");
      if (!b) return null;
      var d = a.N.kb(), e = b.attributes.sourceURL;
      e && (d = nc(d, [dc(e)], a.Sb()));
      e = 0;
      var f = null;
      if (b = $d(b, "range", ee)) e = b.start, f = b.end;
      c = new Aj(function() {
        return d;
      }, e, f, Cv(a), null, null, c, a.wa.encrypted);
      c.codecs = a.N.codecs;
      c.mimeType = a.N.mimeType;
      a.ra && !a.ra.Cf && (c.g = a.ra.start + a.ra.duration);
      return c;
    }
    function Dv(a, b, c) {
      var d = Number(mv(a, Ev, "presentationTimeOffset")) || 0, e = mv(a, Ev, "timescale"), f = 1;
      e && (f = ge(e) || 1);
      var g = d / f || 0, h = Bv(a, Ev, c);
      Fv(a, h);
      var k2 = Id(a);
      return { endTime: -1, timeline: -1, dd: function() {
        var l = nv(k2, Ev, "RepresentationIndex");
        var m = k2.N.kb();
        l && (l = dc(l.attributes.sourceURL)) && (m = nc(m, [l], k2.Sb()));
        l = Gv(k2);
        return Hv(k2, b, h, m, l.start, l.end, g);
      }, timescale: f };
    }
    function Hv(a, b, c, d, e, f, g) {
      var h, k2, l, m, n, q, r, u, w, v, y, z, A, C, D, F, B, E;
      return P(function(I) {
        if (I.g == 1) return h = a.presentationTimeline, k2 = !a.Jb || !a.ra.Cf, l = a.ra.start, m = a.ra.duration, n = a.N.mimeType.split("/")[1], q = b, r = null, u = [q(d, e, f, false), n == "webm" ? q(c.T(), c.startByte, c.endByte, true) : null], q = null, G(I, Promise.all(u), 2);
        w = I.h;
        v = w[0];
        y = w[1] || null;
        z = null;
        A = l - g;
        C = l;
        D = m ? l + m : Infinity;
        if (n == "mp4") var J = rv(v, e, d, c, A, C, D);
        else {
          J = v;
          var K = new tv(y);
          if (uv(K).id != 440786851) throw new U(2, 3, 3008);
          var L = uv(K);
          if (L.id != 408125543) throw new U(
            2,
            3,
            3009
          );
          K = L.g.byteOffset;
          L = new tv(L.g);
          for (var M = null; L.Pa(); ) {
            var N = uv(L);
            if (N.id == 357149030) {
              M = N;
              break;
            }
          }
          if (!M) throw new U(2, 3, 3010);
          M = new tv(M.g);
          N = 1e6;
          for (L = null; M.Pa(); ) {
            var O = uv(M);
            if (O.id == 2807729) N = yv(O);
            else if (O.id == 17545) if (O.g.byteLength == 4) L = O.g.getFloat32(0);
            else if (O.g.byteLength == 8) L = O.g.getFloat64(0);
            else throw new U(2, 3, 3003);
          }
          if (L == null) throw new U(2, 3, 3011);
          M = N / 1e9;
          L *= M;
          J = uv(new tv(J));
          if (J.id != 475249515) throw new U(2, 3, 3007);
          J = zv(J, K, M, L, d, c, A, C, D);
        }
        z = J;
        F = t(z);
        for (B = F.next(); !B.done; B = F.next()) E = B.value, E.codecs = a.N.codecs, E.mimeType = a.N.mimeType, E.bandwidth = a.bandwidth;
        h.ye(z);
        r = new Zl(z);
        k2 && r.Ed(C, D, true);
        return I.return(r);
      });
    }
    function Ev(a) {
      return a.Ud;
    }
    function Gv(a) {
      var b = nv(a, Ev, "RepresentationIndex");
      a = mv(a, Ev, "indexRange");
      a = ee(a || "");
      b && (a = $d(b, "range", ee, a));
      return a;
    }
    function Fv(a, b) {
      Iv(a, b);
      if (!Gv(a)) throw new U(2, 4, 4002);
    }
    function Iv(a, b) {
      var c = a.N.mimeType.split("/")[1];
      if (a.N.contentType != tc && c != "mp4" && c != "webm") throw new U(2, 4, 4006);
      if (c == "webm" && !b) throw new U(2, 4, 4005);
    }
    function Cv(a) {
      var b = a.N;
      return { bandwidth: a.bandwidth, audioSamplingRate: b.audioSamplingRate, codecs: b.codecs, contentType: b.contentType, frameRate: b.frameRate || null, height: b.height || null, mimeType: b.mimeType, channelsCount: b.Pf, pixelAspectRatio: b.pixelAspectRatio || null, width: b.width || null, label: a.wa.label || null, roles: a.roles || null, language: a.wa.language || null };
    }
    ;
    function Jv(a, b, c) {
      var d = Bv(a, Kv, c), e = Lv(a);
      if (!e.ob && !e.timeline && e.Ld.length > 1) throw new U(2, 4, 4002);
      if (!e.ob && !a.ra.duration && !e.timeline && e.Ld.length == 1) throw new U(2, 4, 4002);
      if (e.timeline && e.timeline.length == 0) throw new U(2, 4, 4002);
      var f = null, g = null;
      a.Aa.id && a.N.id && (g = b.get(a.Aa.id + "," + a.N.id)) && (f = g.segmentIndex);
      var h = Mv(a.ra.start, a.ra.duration, a.N.kb, e, d, c, a.N.mimeType, a.N.codecs, a.bandwidth, a.Sb);
      b = !f;
      f ? f.we(h, a.presentationTimeline.Nb()) : f = new Zl(h);
      a.presentationTimeline.ye(h);
      a.Jb && a.ra.Cf || f.Ed(a.ra.start, a.ra.duration ? a.ra.start + a.ra.duration : Infinity, b);
      g && (g.segmentIndex = f);
      return { endTime: -1, timeline: -1, dd: function() {
        f && f.getNumReferences() != 0 || f.Kf(h);
        return Promise.resolve(f);
      }, timescale: e.timescale };
    }
    function Kv(a) {
      return a.Fc;
    }
    function Lv(a) {
      var b = Nv(a);
      a = lv(a, Kv);
      var c = a.Ge;
      c == 0 && (c = 1);
      var d = 0;
      a.ob ? d = a.ob * (c - 1) : a.timeline && a.timeline.length > 0 && (d = a.timeline[0].start);
      return { ob: a.ob, startTime: d, Ge: c, Qb: a.Qb, timescale: a.timescale, timeline: a.timeline, Ld: b };
    }
    function Mv(a, b, c, d, e, f, g, h, k2, l) {
      var m = d.Ld.length;
      d.timeline && d.timeline.length != d.Ld.length && (m = Math.min(d.timeline.length, d.Ld.length));
      for (var n = a - d.Qb, q = b ? a + b : Infinity, r = [], u = d.startTime, w = {}, v = 0; v < m; w = { qg: void 0, dg: void 0 }, v++) {
        w.dg = d.Ld[v];
        var y = u;
        u = void 0;
        u = d.ob != null ? y + d.ob : d.timeline ? d.timeline[v].end : y + b;
        w.qg = null;
        w = new Cj(a + y, a + u, /* @__PURE__ */ function(z) {
          return function() {
            z.qg == null && (z.qg = nc(c(), [z.dg.Ql], l()));
            return z.qg;
          };
        }(w), w.dg.start, w.dg.end, e, n, a, q, [], "", null, null, Dj, f);
        w.codecs = h;
        w.mimeType = g;
        w.bandwidth = k2;
        r.push(w);
      }
      return r;
    }
    function Nv(a) {
      return [a.N.Fc, a.wa.Fc, a.Aa.Fc].filter(Ff).map(function(b) {
        return Sd(b, "SegmentURL");
      }).reduce(function(b, c) {
        return b.length > 0 ? b : c;
      }).map(function(b) {
        b.attributes.indexRange && !a.Ch && (a.Ch = true);
        var c = dc(b.attributes.media);
        b = $d(b, "mediaRange", ee, { start: 0, end: null });
        return { Ql: c, start: b.start, end: b.end };
      });
    }
    ;
    function Ov(a, b, c, d, e, f, g, h, k2, l) {
      k2 || a.N.zf || (a.N.zf = mv(a, Pv, "initialization"));
      var m = a.N.zf ? Qv(a, g) : null, n = Rv(a);
      Sv(n);
      var q = Id(a);
      if (n.re) return Iv(a, m), { endTime: -1, timeline: -1, dd: function() {
        var y = kv(n.re, q.N.originalId, null, null, q.bandwidth || null, null);
        y = nc(q.N.kb(), [y]);
        return Hv(q, b, m, y, 0, null, n.Qb);
      }, timescale: n.timescale };
      if (n.ob) return d || a.wa.contentType === "image" || a.wa.contentType === "text" || (d = a.ra.start, l = a.Aa.id, c = a.ra.duration, l = (l = l != null && f.get(l) || c) ? d + l : Infinity, a.presentationTimeline.Lh(n.ob), a.presentationTimeline.rj(d, l)), { endTime: -1, timeline: -1, dd: function() {
        return Tv(q, n, e, m, f, g, h, a.N.eg);
      }, timescale: n.timescale };
      var r = null;
      d = d = null;
      a.Aa.id && a.N.id && (d = a.Aa.id + "," + a.N.id, d = c.get(d)) && (r = d.segmentIndex);
      var u = a.ra.start, w = a.ra.duration ? u + a.ra.duration : Infinity;
      if (r) l = r, Uv(l, n, u, w, m, a.Jb), l.ib(a.presentationTimeline.Nb());
      else {
        c = 0;
        k2 = -1;
        if (a.Aa.id != null && a.N.id != null) {
          var v = l.get(a.Aa.id);
          if (v) k2 = v.timeline;
          else for (l = t(l.values()), v = l.next(); !v.done; v = l.next()) if (v = v.value, Math.abs(n.Qb - v.endTime) <= wc && v.Uh.includes(a.N.id)) {
            k2 = v.timeline;
            break;
          } else v.timeline >= c && (c = v.timeline + 1);
        }
        k2 == -1 && (k2 = c);
        r = new Vv(a.Jb, n, a.N.originalId, a.bandwidth, a.N.kb, a.Sb, u, w, m, g, a.N.eg, k2);
      }
      n.timeline && a.wa.contentType !== "image" && a.wa.contentType !== "text" && a.presentationTimeline.sj(r.h ? r.h.timeline : [], u);
      d && a.Jb && (d.segmentIndex = r);
      d = (d = (d = n.timeline) && d[d.length - 1]) ? d.end + n.Qb : -1;
      l = -1;
      r instanceof Vv && (l = r.mf());
      return { endTime: d, timeline: l, dd: function() {
        r instanceof Vv && r.getNumReferences() == 0 && Uv(
          r,
          n,
          u,
          w,
          m,
          a.Jb
        );
        return Promise.resolve(r);
      }, timescale: n.timescale };
    }
    function Pv(a) {
      return a.Tc;
    }
    function Rv(a) {
      var b = lv(a, Pv), c = mv(a, Pv, "media"), d = mv(a, Pv, "index"), e = mv(a, Pv, "k"), f = 0;
      e && (f = parseInt(e, 10));
      return { og: b.og, ob: b.ob, timescale: b.timescale, Ge: b.Ge, Qb: b.Qb, vd: b.vd, timeline: b.timeline, hc: c && dc(c), re: d, mimeType: a.N.mimeType, codecs: a.N.codecs, bandwidth: a.bandwidth, Rl: f };
    }
    function Sv(a) {
      var b = a.re ? 1 : 0;
      b += a.timeline ? 1 : 0;
      b += a.ob ? 1 : 0;
      if (b == 0) throw new U(2, 4, 4002);
      b != 1 && (a.re && (a.timeline = null), a.og = null, a.ob = null);
      if (!a.re && !a.hc) throw new U(2, 4, 4002);
    }
    function Tv(a, b, c, d, e, f, g, h) {
      function k2(L) {
        var M = L - v, N = M * w, O = b.og, Q = M * O;
        "BigInt" in window2 && Q > Number.MAX_SAFE_INTEGER && (Q = BigInt(M) * BigInt(O));
        N += q;
        M = N + w;
        O = Math.min(M, m());
        var R = [], V = b.Rl;
        if (V) for (var Ba = (O - N) / V, aa = {}, Oa = 0; Oa < V; aa = { Tj: void 0 }, Oa++) {
          var La = N + Ba * Oa, Ja = La + Ba;
          aa.Tj = Oa;
          aa = new Cj(La, Ja, /* @__PURE__ */ function(Ea) {
            return function() {
              var ya = kv(y, A, L, Ea.Tj, z, Q);
              return nc(C(), [ya], D());
            };
          }(aa), 0, null, d, F, q, m(), [], "", null, null, Dj, f);
          aa.codecs = a.N.codecs;
          aa.mimeType = a.N.mimeType;
          h == 0 ? Oa > 0 && aa.Jd() : Oa % h != 0 && aa.Jd();
          R.push(aa);
        }
        N = new Cj(N, O, function() {
          if (V) return [];
          var Ea = kv(y, A, L, null, z, Q);
          return nc(C(), [Ea], D());
        }, 0, null, d, F, q, m(), R, "", null, null, Dj, f, R.length > 0);
        N.codecs = a.N.codecs;
        N.mimeType = a.N.mimeType;
        N.bandwidth = a.bandwidth;
        N.j = M;
        return N;
      }
      function l() {
        var L = [Math.max(n.Nb(), q), Math.min(n.Mc(), m())].map(function(M) {
          return M - q;
        });
        L = [Math.ceil(L[0] / w), Math.ceil(L[1] / w) - 1];
        a.N.zb && L[1]++;
        return L.map(function(M) {
          return M + v;
        });
      }
      function m() {
        var L = r != null && e.get(r) || u;
        return L ? q + L : Infinity;
      }
      var n = a.presentationTimeline, q = a.ra.start, r = a.Aa.id, u = a.ra.duration, w = b.ob, v = b.Ge, y = b.hc, z = a.bandwidth || null, A = a.N.originalId, C = a.N.kb, D = a.Sb, F = q - b.Qb, B = l();
      c = a.Jb ? Math.max(B[0], B[1] - c + 1) : B[0];
      g = g || B[1];
      B = [];
      for (var E = c; E <= g; ++E) {
        var I = k2(E);
        B.push(I);
      }
      var J = new Zl(B);
      B = n.Mc() < m();
      E = n.U();
      if (B || E) {
        var K = Math.max(c, g + 1);
        c = w;
        a.N.zb && (c = 0.1);
        J.pg(c, function() {
          var L = n.Nb();
          J.ib(L);
          var M = t(l());
          M.next();
          M = M.next().value;
          for (var N = []; K <= M; ) {
            var O = k2(K);
            N.push(O);
            K++;
          }
          return L > m() && !N.length ? null : N;
        });
      }
      return Promise.resolve(J);
    }
    function Qv(a, b) {
      var c = a.N.zf;
      c || (c = mv(a, Pv, "initialization"));
      if (!c) return null;
      c = dc(c);
      var d = a.N.originalId, e = a.bandwidth || null, f = a.N.kb, g = a.Sb;
      b = new Aj(function() {
        var h = kv(c, d, null, null, e, null);
        return nc(f(), [h], g());
      }, 0, null, Cv(a), null, null, b, a.wa.encrypted);
      b.codecs = a.N.codecs;
      b.mimeType = a.N.mimeType;
      a.ra && !a.ra.Cf && (b.g = a.ra.start + a.ra.duration);
      return b;
    }
    function Vv(a, b, c, d, e, f, g, h, k2, l, m, n) {
      Zl.call(this, []);
      this.F = a;
      this.h = b;
      this.H = c;
      this.D = d;
      this.G = e;
      this.J = f;
      this.j = g;
      this.l = h;
      this.A = k2;
      this.C = l;
      this.I = m;
      this.K = n;
      Wv(this);
    }
    ma(Vv, Zl);
    p = Vv.prototype;
    p.getNumReferences = function() {
      return this.h ? this.h.timeline.length : 0;
    };
    p.release = function() {
      Zl.prototype.release.call(this);
      this.h = null;
    };
    p.ib = function(a) {
      if (this.h) {
        for (var b = 0, c = this.h.timeline, d = 0; d < c.length; d += 1) if (c[d].end + this.j <= a) b += 1;
        else break;
        b > 0 && (this.h.timeline = c.slice(b), this.g.length >= b && (this.g = this.g.slice(b)), this.i += b, this.getNumReferences() === 0 && this.release());
      }
    };
    function Uv(a, b, c, d, e, f) {
      Xv(a, e);
      a.F = f;
      if (a.h) {
        a.h.vd !== b.vd && (a.h.timeline = b.timeline, a.h.vd = b.vd, a.h.Qb = b.Qb);
        a.h.hc !== b.hc && (a.h.hc = b.hc);
        c = a.h.timeline;
        if (c.length) {
          var g = c[c.length - 1];
          b = b.timeline.filter(function(h) {
            return h.end > g.end;
          });
        } else b = b.timeline.slice();
        b.length > 0 && a.h.timeline.push.apply(a.h.timeline, x(b));
        a.l !== d && (a.l = d);
      } else a.h = b, a.j = c, a.l = d;
      Wv(a);
    }
    function Xv(a, b) {
      if (a.A !== b) {
        a.A = b;
        a = t(a.g);
        for (var c = a.next(); !c.done; c = a.next()) (c = c.value) && Fj(c, b);
      }
    }
    function Wv(a) {
      if (a.h && !a.u) {
        for (var b = [], c = t(a.h.timeline), d = c.next(); !d.done; d = c.next()) d = d.value, d.start >= a.l || d.end <= 0 || b.push(d);
        a.h.timeline = b;
        a.ib(a.j);
      }
    }
    p.find = function(a) {
      if (this.h && this.h.timeline && this.h.timeline.length && a < this.h.timeline[0].start + this.j) return this.i;
      if (!this.h) return null;
      var b = this.h.timeline;
      if (a < this.j || a >= this.l) return null;
      for (var c = b.length - 1, d = 0; d < b.length; d++) {
        var e = b[d], f = e.start + this.j;
        e = d < c ? b[d + 1].start + this.j : this.l === Infinity ? e.end + this.j : this.l;
        if (a >= f && a < e) return d + this.i;
      }
      return null;
    };
    p.get = function(a) {
      var b = this;
      a -= this.i;
      if (a < 0 || a >= this.getNumReferences() || !this.h) return null;
      var c = this.g[a];
      if (!c) {
        c = this.h.timeline[a];
        var d = c.nm, e = c.xi + this.h.vd, f = this.j - this.h.Qb, g = this.j + c.end, h = g;
        a === this.getNumReferences() - 1 && this.l !== Infinity && (h = this.F && Math.abs(h - this.l) > 0.1 ? Math.min(h, this.l) : this.l);
        var k2 = this.h.codecs, l = this.h.mimeType, m = this.h.bandwidth, n = [], q = false;
        c.Cc && this.h && this.h.hc && (q = this.h.hc.includes("$SubNumber$"));
        if (q) {
          q = (c.end - c.start) / c.Cc;
          for (var r = {}, u = 0; u < c.Cc; r = {
            rg: void 0,
            Uj: void 0
          }, u++) {
            var w = c.start + q * u, v = w + q;
            r.Uj = u;
            r.rg = null;
            r = new Cj(this.j + w, this.j + v, /* @__PURE__ */ function(y) {
              return function() {
                if (!b.h) return [];
                y.rg == null && (y.rg = Yv(b.h.hc, b.H, d, b.D, e, y.Uj, b.G, b.J));
                return y.rg;
              };
            }(r), 0, null, this.A, f, this.j, this.l, [], "", null, null, Dj, this.C);
            r.codecs = k2;
            r.mimeType = l;
            r.bandwidth = m;
            this.I == 0 ? u > 0 && r.Jd() : u % this.I != 0 && r.Jd();
            n.push(r);
          }
        }
        c = new Cj(
          this.j + c.start,
          h,
          function() {
            return n.length > 0 || !b.h ? [] : Yv(b.h.hc, b.H, d, b.D, e, null, b.G, b.J);
          },
          0,
          null,
          this.A,
          f,
          this.j,
          this.l,
          n,
          "",
          null,
          null,
          Dj,
          this.C,
          n.length > 0
        );
        c.codecs = k2;
        c.mimeType = l;
        c.j = g;
        c.bandwidth = m;
        this.g[a] = c;
      }
      return c;
    };
    p.Kb = function(a) {
      Wv(this);
      for (var b = 0; b < this.getNumReferences(); b++) {
        var c = this.get(b + this.i);
        c && a(c);
      }
    };
    function Yv(a, b, c, d, e, f, g, h) {
      a = kv(a, b, c, f, d || null, e);
      return nc(g(), [a], h()).map(function(k2) {
        return k2.toString();
      });
    }
    p.mf = function() {
      return this.K;
    };
    function Zv(a) {
      this.u = null;
      this.C = a;
      this.H = new Ug();
      this.i = [];
      this.h = null;
      this.m = [];
      this.D = null;
      this.G = [];
      this.F = 300;
      this.l = /* @__PURE__ */ new Map();
      this.j = /* @__PURE__ */ new Map();
      this.g = null;
      this.A = "UNKNOWN";
    }
    Zv.prototype.configure = function(a) {
      this.u = a;
    };
    Zv.prototype.destroy = function() {
      this.C = this.u = null;
      this.i = [];
      this.h = null;
      this.m = [];
      this.G = [];
      this.l.clear();
      this.g != null && (this.g.stop(), this.g = null);
      return this.H.destroy();
    };
    Zv.prototype.setManifestType = function(a) {
      this.A = a;
    };
    function $v(a, b) {
      var c, d, e, f, g, h, k2;
      return P(function(l) {
        if (l.g == 1) return c = nc(a.i, [aw(a, b)]), d = ah(c, a.u.retryParameters), e = a.C.networkingEngine.request(8, d), Vg(a.H, e), sa(l, 2), G(l, e.promise, 4);
        if (l.g != 2) return f = l.h, g = Xb(f.data), h = JSON.parse(g), h.VERSION == 1 && bw(a, h, f.uri), ua(l, 0);
        if ((k2 = va(l)) && k2.code == 7001) return l.return();
        a.g != null && (a.g.stop(), a.g = null);
        a.g = new Cf(function() {
          $v(a, b);
        });
        a.g.Y(a.F);
        H(l);
      });
    }
    function aw(a, b) {
      if (!a.m.length) return b;
      b = new rb(b);
      var c = a.D || a.m[0], d = Math.round(a.C.getBandwidthEstimate()), e = b.g;
      a.A == "DASH" ? (e.add("_DASH_pathway", c), e.add("_DASH_throughput", String(d))) : a.A == "HLS" && (e.add("_HLS_pathway", c), e.add("_HLS_throughput", String(d)));
      Ib(e) && wb(b, e);
      return b.toString();
    }
    function bw(a, b, c) {
      a.g != null && (a.g.stop(), a.g = null);
      var d = b["RELOAD-URI"] || c;
      a.g = new Cf(function() {
        $v(a, d);
      });
      if (c = b.TTL) a.F = c;
      a.g.Y(a.F);
      a.m = b["PATHWAY-PRIORITY"] || [];
      a.G = b["PATHWAY-CLONES"] || [];
    }
    function cw(a, b, c, d) {
      var e = a.l.get(b);
      e || (e = /* @__PURE__ */ new Map());
      e.set(c, d);
      a.l.set(b, e);
    }
    Zv.prototype.banLocation = function(a) {
      this.j.set(a, Date.now() + 6e4);
    };
    function dw(a, b, c) {
      c = c === void 0 ? false : c;
      b = a.l.get(b) || /* @__PURE__ */ new Map();
      for (var d = [], e = t(a.m), f = e.next(), g = {}; !f.done; g = { Nd: void 0 }, f = e.next()) if (g.Nd = f.value, f = b.get(g.Nd)) d.push({ Qh: g.Nd, location: f });
      else if (f = a.G.find(/* @__PURE__ */ function(k2) {
        return function(l) {
          return l.Zm == k2.Nd;
        };
      }(g))) {
        var h = b.get(f["BASE-ID"]);
        h && (f["URI-REPLACEMENT"].hk ? (h = new rb(h), tb(h, f["URI-REPLACEMENT"].hk), d.push({ Qh: g.Nd, location: h.toString() })) : d.push({ Qh: g.Nd, location: h }));
      }
      e = Date.now();
      g = t(a.j.keys());
      for (f = g.next(); !f.done; f = g.next()) f = f.value, h = a.j.get(f), e > h && a.j.delete(f);
      d = d.filter(function(k2) {
        for (var l = t(a.j.keys()), m = l.next(); !m.done; m = l.next()) if (m.value.includes(new rb(k2.location).Ib)) return false;
        return true;
      });
      d.length && (a.D = d[0].Qh);
      d = d.map(function(k2) {
        return k2.location;
      });
      if (!d.length && a.h) {
        for (e = t(a.h.split(",")), g = e.next(); !g.done; g = e.next()) if (g = b.get(g.value)) a.D = a.h, d.push(g);
      }
      if (!d.length) for (b = t(b.values()), e = b.next(); !e.done; e = b.next()) d.push(e.value);
      return c ? d : nc(a.i, d);
    }
    ;
    function ew() {
      this.l = [];
      this.h = [];
      this.g = [];
      this.j = [];
      this.i = [];
      this.A = this.u = false;
      this.m = /* @__PURE__ */ new Set();
    }
    p = ew.prototype;
    p.release = function() {
      for (var a = t(this.h.concat(this.g, this.j, this.i)), b = a.next(); !b.done; b = a.next()) b = b.value, b.segmentIndex && b.segmentIndex.release();
      this.h = [];
      this.g = [];
      this.j = [];
      this.i = [];
      this.l = [];
      this.A = this.u = false;
      this.m.clear();
    };
    p.vl = function() {
      return this.l;
    };
    p.wh = function() {
      return this.j.slice();
    };
    p.Ok = function() {
      return this.i;
    };
    p.Ri = function(a, b) {
      if (a) {
        if (a.type == "audio") for (var c = t(this.h), d = c.next(); !d.done; d = c.next()) d = d.value, d.matchedStreams = d.matchedStreams.filter(function(e) {
          return e !== a;
        });
        else if (a.type == "video") for (c = t(this.g), d = c.next(); !d.done; d = c.next()) d = d.value, d.matchedStreams = d.matchedStreams.filter(function(e) {
          return e !== a;
        }), d.trickModeVideo && (d.trickModeVideo.matchedStreams = d.trickModeVideo.matchedStreams.filter(function(e) {
          return e !== a;
        })), d.dependencyStream && (d.dependencyStream.matchedStreams = d.dependencyStream.matchedStreams.filter(function(e) {
          return e !== a;
        }));
        else if (a.type == tc) for (c = t(this.j), d = c.next(); !d.done; d = c.next()) d = d.value, d.matchedStreams = d.matchedStreams.filter(function(e) {
          return e !== a;
        });
        else if (a.type == "image") for (c = t(this.i), d = c.next(); !d.done; d = c.next()) d = d.value, d.matchedStreams = d.matchedStreams.filter(function(e) {
          return e !== a;
        });
        a.segmentIndex && a.closeSegmentIndex();
        this.m.delete(b);
      }
    };
    function fw(a, b) {
      var c = [], d = [], e = [], f = [];
      a = t(a);
      for (var g = a.next(); !g.done; g = a.next()) {
        var h = g.value;
        g = new Map(h.audioStreams.map(function(n) {
          return [gw(n), n];
        }));
        var k2 = new Map(h.videoStreams.map(function(n) {
          return [hw(n), n];
        })), l = new Map(h.textStreams.map(function(n) {
          return [iw(n), n];
        }));
        h = new Map(h.imageStreams.map(function(n) {
          return [jw(n), n];
        }));
        if (b) {
          var m = kw(tc);
          l.set(iw(m), m);
          m = kw("image");
          h.set(jw(m), m);
        }
        c.push(g);
        d.push(k2);
        e.push(l);
        f.push(h);
      }
      return { Hi: c, ek: d, Zj: e, dj: f };
    }
    p.Og = function(a, b, c) {
      c = c === void 0 ? false : c;
      var d = this, e, f, g, h, k2, l, m, n, q, r, u, w, v, y, z, A, C, D, F, B, E, I, J, K, L, M, N, O, Q, R, V, Ba;
      return P(function(aa) {
        if (aa.g == 1) {
          e = vc;
          if (!b && a.length == 1) return f = fw(a, false), g = f.Hi, h = f.ek, k2 = f.Zj, l = f.dj, d.h = Array.from(g[0].values()), d.g = Array.from(h[0].values()), d.j = Array.from(k2[0].values()), d.i = Array.from(l[0].values()), aa.B(2);
          m = c ? d.m.size : 0;
          n = -1;
          for (q = 0; q < a.length; q++) r = a[q], d.m.has(r.id) || (d.m.add(r.id), n == -1 && (n = q));
          if (n == -1) return aa.return();
          u = fw(a, true);
          w = u.Hi;
          v = u.ek;
          y = u.Zj;
          z = u.dj;
          return G(aa, Promise.all([lw(d, d.h, w, n, mw, nw, m), lw(d, d.g, v, n, mw, nw, m), lw(d, d.j, y, n, mw, nw, m), lw(d, d.i, z, n, mw, nw, m)]), 2);
        }
        A = 0;
        C = [];
        if (d.g.length && d.h.length) for (K = t(d.h), L = K.next(); !L.done; L = K.next()) for (M = L.value, N = t(d.g), O = N.next(); !O.done; O = N.next()) Q = O.value, R = Ag(M.drmInfos, Q.drmInfos), M.drmInfos.length && Q.drmInfos.length && !R.length || (V = (M.bandwidth || 0) + (Q.bandwidth || 0), M.dependencyStream && (V += M.dependencyStream.bandwidth || 0), Q.dependencyStream && (V += Q.dependencyStream.bandwidth || 0), Ba = A++, C.push({ id: Ba, language: M.language, disabledUntilTime: 0, primary: M.primary, audio: M, video: Q, bandwidth: V, drmInfos: R, allowedByApplication: true, allowedByKeySystem: true, decodingInfos: [] }));
        else for (D = d.g.length ? d.g : d.h, F = t(D), B = F.next(); !B.done; B = F.next()) E = B.value, I = A++, J = E.bandwidth || 0, E.dependencyStream && (J += E.dependencyStream.bandwidth || 0), C.push({
          id: I,
          language: E.language,
          disabledUntilTime: 0,
          primary: E.primary,
          audio: E.type == e.na ? E : null,
          video: E.type == e.Ja ? E : null,
          bandwidth: J,
          drmInfos: E.drmInfos,
          allowedByApplication: true,
          allowedByKeySystem: true,
          decodingInfos: []
        });
        d.l = C;
        H(aa);
      });
    };
    function ow(a) {
      var b, c, d, e, f, g, h, k2, l, m, n, q, r, u, w, v, y, z, A, C, D, F, B, E, I, J, K, L, M, N;
      return P(function(O) {
        switch (O.g) {
          case 1:
            b = vc;
            if (a.length == 1) return O.return(a[0]);
            c = a.map(function(Q) {
              return new Map(Q.filter(function(R) {
                return R.type === b.na;
              }).map(function(R) {
                return [gw(R), R];
              }));
            });
            d = a.map(function(Q) {
              return new Map(Q.filter(function(R) {
                return R.type === b.Ja;
              }).map(function(R) {
                return [hw(R), R];
              }));
            });
            e = a.map(function(Q) {
              return new Map(Q.filter(function(R) {
                return R.type === b.ab;
              }).map(function(R) {
                return [
                  iw(R),
                  R
                ];
              }));
            });
            f = a.map(function(Q) {
              return new Map(Q.filter(function(R) {
                return R.type === b.yg;
              }).map(function(R) {
                return [jw(R), R];
              }));
            });
            g = t(e);
            for (h = g.next(); !h.done; h = g.next()) k2 = h.value, l = pw(b.ab), k2.set(iw(l), l);
            m = t(f);
            for (n = m.next(); !n.done; n = m.next()) q = n.value, r = pw(b.yg), q.set(jw(r), r);
            u = new ew();
            return G(O, lw(u, [], c, 0, qw, rw, 0), 2);
          case 2:
            return w = O.h, G(O, lw(u, [], d, 0, qw, rw, 0), 3);
          case 3:
            return v = O.h, G(O, lw(u, [], e, 0, qw, rw, 0), 4);
          case 4:
            return y = O.h, G(O, lw(u, [], f, 0, qw, rw, 0), 5);
          case 5:
            z = O.h;
            A = 0;
            if (v.length && w.length) for (E = t(w), I = E.next(); !I.done; I = E.next()) for (J = I.value, K = t(v), L = K.next(); !L.done; L = K.next()) M = L.value, N = A++, M.variantIds.push(N), J.variantIds.push(N);
            else for (C = v.concat(w), D = t(C), F = D.next(); !F.done; F = D.next()) B = F.value, B.variantIds = [A++];
            return O.return(v.concat(w).concat(y).concat(z));
        }
      });
    }
    function lw(a, b, c, d, e, f, g) {
      var h, k2, l, m, n, q, r, u, w, v, y, z, A, C, D, F, B, E, I, J;
      return P(function(K) {
        switch (K.g) {
          case 1:
            h = [];
            for (k2 = 0; k2 < c.length; k2++) k2 >= d ? h.push(new Set(c[k2].values())) : h.push(/* @__PURE__ */ new Set());
            l = t(b);
            m = l.next();
          case 2:
            if (m.done) {
              K.B(4);
              break;
            }
            n = m.value;
            return G(K, sw(a, n, c, d, f, h, g), 5);
          case 5:
            q = K.h;
            if (!q) throw new U(2, 4, 4037);
            m = l.next();
            K.B(2);
            break;
          case 4:
            r = t(h);
            for (u = r.next(); !u.done; u = r.next()) for (w = u.value, v = t(w), y = v.next(); !y.done; y = v.next()) z = y.value, (A = tw(a, z, c, e, f, h)) && b.push(A);
            C = t(h);
            for (D = C.next(); !D.done; D = C.next()) for (F = D.value, B = t(F), E = B.next(), I = {}; !E.done; I = { li: void 0 }, E = B.next()) if (I.li = E.value, !uw(I.li) && (J = b.some(/* @__PURE__ */ function(L) {
              return function(M) {
                return vw(a, L.li, M);
              };
            }(I)))) throw new U(2, 4, 4037);
            return K.return(b);
        }
      });
    }
    function sw(a, b, c, d, e, f, g) {
      return P(function(h) {
        if (h.g == 1) return ww(a, c, b, g > 0), b.matchedStreams ? b.segmentIndex ? G(h, xw(b, d + g), 2) : h.B(2) : h.return(false);
        yw(b, d, e, f, g);
        return h.return(true);
      });
    }
    function xw(a, b) {
      var c, d, e, f, g, h;
      return P(function(k2) {
        if (k2.g == 1) {
          c = [];
          d = a.matchedStreams;
          for (e = b; e < d.length; e++) f = d[e], c.push(f.createSegmentIndex()), f.trickModeVideo && !f.trickModeVideo.segmentIndex && c.push(f.trickModeVideo.createSegmentIndex()), f.dependencyStream && !f.dependencyStream.segmentIndex && c.push(f.dependencyStream.createSegmentIndex());
          return G(k2, Promise.all(c), 2);
        }
        if (a.segmentIndex instanceof bm) for (g = b; g < d.length; g++) h = d[g], h.segmentIndex && a.segmentIndex.h.push(h.segmentIndex);
        H(k2);
      });
    }
    function tw(a, b, c, d, e, f) {
      if (uw(b)) return null;
      var g = d(b);
      ww(a, c, g);
      g.createSegmentIndex && (g.createSegmentIndex = function() {
        return P(function(h) {
          if (g.segmentIndex) return h.B(0);
          g.segmentIndex = new bm();
          return G(h, xw(g, 0), 0);
        });
      });
      if (!g.matchedStreams || !g.matchedStreams.length) return null;
      yw(g, 0, e, f, 0);
      return g;
    }
    function yw(a, b, c, d, e) {
      var f = a.matchedStreams;
      for (b += e; b < f.length; b++) {
        var g = f[b];
        c(a, g);
        var h = true;
        a.type == "audio" && Fc(a.language, g.language) == 0 && (h = false);
        if (h && (d[b - e].delete(g), g.fullMimeTypes)) for (g = t(g.fullMimeTypes.values()), h = g.next(); !h.done; h = g.next()) a.fullMimeTypes.add(h.value);
      }
    }
    function mw(a) {
      var b = Object.assign({}, a);
      b.originalId = null;
      b.createSegmentIndex = function() {
        return Promise.resolve();
      };
      b.closeSegmentIndex = function() {
        b.segmentIndex && (b.segmentIndex.release(), b.segmentIndex = null);
        if (b.matchedStreams) for (var c = t(b.matchedStreams), d = c.next(); !d.done; d = c.next()) d = d.value, d.segmentIndex && (d.segmentIndex.release(), d.segmentIndex = null);
      };
      b.roles = b.roles.slice();
      b.segmentIndex = null;
      b.emsgSchemeIdUris = [];
      b.keyIds = new Set(a.keyIds);
      b.closedCaptions = a.closedCaptions ? new Map(a.closedCaptions) : null;
      b.trickModeVideo = null;
      b.dependencyStream = null;
      return b;
    }
    function qw(a) {
      var b = Object.assign({}, a);
      b.roles = b.roles.slice();
      b.keyIds = new Set(a.keyIds);
      b.segments = [];
      b.variantIds = [];
      b.closedCaptions = a.closedCaptions ? new Map(a.closedCaptions) : null;
      return b;
    }
    function nw(a, b) {
      function c(g, h) {
        g || (g = []);
        h = t(h);
        for (var k2 = h.next(); !k2.done; k2 = h.next()) k2 = k2.value, g.includes(k2) || g.push(k2);
        return g;
      }
      a.roles = c(a.roles, b.roles);
      b.emsgSchemeIdUris && (a.emsgSchemeIdUris = c(a.emsgSchemeIdUris, b.emsgSchemeIdUris));
      for (var d = t(b.keyIds), e = d.next(); !e.done; e = d.next()) a.keyIds.add(e.value);
      a.originalId == null ? a.originalId = b.originalId : (d = b.originalId || "") && !a.originalId.endsWith(d) && (a.originalId += "," + d);
      d = Ag(a.drmInfos, b.drmInfos);
      if (b.drmInfos.length && a.drmInfos.length && !d.length) throw new U(
        2,
        4,
        4038
      );
      a.drmInfos = d;
      a.encrypted = a.encrypted || b.encrypted;
      if (b.closedCaptions) for (a.closedCaptions || (a.closedCaptions = /* @__PURE__ */ new Map()), d = t(b.closedCaptions), e = d.next(); !e.done; e = d.next()) {
        var f = t(e.value);
        e = f.next().value;
        f = f.next().value;
        a.closedCaptions.set(e, f);
      }
      a.bandwidth && b.bandwidth && (a.bandwidth = Math.max(a.bandwidth, b.bandwidth));
      b.trickModeVideo ? (a.trickModeVideo || (a.trickModeVideo = mw(b.trickModeVideo), a.trickModeVideo.matchedStreams = [], a.trickModeVideo.createSegmentIndex = function() {
        if (a.trickModeVideo.segmentIndex) return Promise.resolve();
        for (var g = new bm(), h = t(a.trickModeVideo.matchedStreams), k2 = h.next(); !k2.done; k2 = h.next()) g.h.push(k2.value.segmentIndex);
        a.trickModeVideo.segmentIndex = g;
        return Promise.resolve();
      }), a.trickModeVideo.matchedStreams.push(b.trickModeVideo), nw(a.trickModeVideo, b.trickModeVideo)) : a.trickModeVideo && (a.trickModeVideo.matchedStreams.push(b), nw(a.trickModeVideo, b));
      b.dependencyStream ? (a.dependencyStream || (a.dependencyStream = mw(b.dependencyStream), a.dependencyStream.matchedStreams = [], a.dependencyStream.createSegmentIndex = function() {
        if (a.dependencyStream.segmentIndex) return Promise.resolve();
        for (var g = new bm(), h = t(a.dependencyStream.matchedStreams), k2 = h.next(); !k2.done; k2 = h.next()) g.h.push(k2.value.segmentIndex);
        a.dependencyStream.segmentIndex = g;
        return Promise.resolve();
      }), a.dependencyStream.matchedStreams.push(b.dependencyStream), nw(a.dependencyStream, b.dependencyStream)) : a.dependencyStream && (a.dependencyStream.matchedStreams.push(b), nw(a.dependencyStream, b));
    }
    function rw(a, b) {
      var c = a.roles;
      c || (c = []);
      for (var d = t(b.roles), e = d.next(); !e.done; e = d.next()) e = e.value, c.includes(e) || c.push(e);
      a.roles = c;
      c = t(b.keyIds);
      for (d = c.next(); !d.done; d = c.next()) a.keyIds.add(d.value);
      a.encrypted = a.encrypted && b.encrypted;
      a.segments.push.apply(a.segments, x(b.segments));
      if (b.closedCaptions) for (a.closedCaptions || (a.closedCaptions = /* @__PURE__ */ new Map()), b = t(b.closedCaptions), c = b.next(); !c.done; c = b.next()) d = t(c.value), c = d.next().value, d = d.next().value, a.closedCaptions.set(c, d);
    }
    function ww(a, b, c, d) {
      d = (d === void 0 ? 0 : d) ? c.matchedStreams : [];
      b = t(b);
      for (var e = b.next(); !e.done; e = b.next()) {
        e = zw(a, e.value, c);
        if (!e) return;
        d.push(e);
      }
      c.matchedStreams = d;
    }
    function zw(a, b, c) {
      var d = { audio: gw, video: hw, text: iw, image: jw }[c.type], e = null, f = d(c);
      if (b.has(f)) e = b.get(f);
      else {
        f = { audio: function(l, m) {
          return vw(a, l, m);
        }, video: function(l, m) {
          return vw(a, l, m);
        }, text: Aw, image: Bw }[c.type];
        for (var g = { audio: Cw, video: Dw, text: Ew, image: Fw }[c.type], h = t(b.values()), k2 = h.next(); !k2.done; k2 = h.next()) k2 = k2.value, !f(c, k2) || c.fastSwitching != k2.fastSwitching || e && !g(c, e, k2) || (e = k2);
      }
      a.A && !uw(e) && b.delete(d(e));
      return e;
    }
    function Gw(a, b) {
      return a.mimeType != b.mimeType ? false : Hw(a.codecs) === Hw(b.codecs);
    }
    p.Ij = function(a) {
      this.u = a;
    };
    p.Oj = function(a) {
      this.A = a;
    };
    function vw(a, b, c) {
      return !Gw(b, c) && !a.u || b.drmInfos && !yg(b.drmInfos, c.drmInfos) ? false : true;
    }
    function Aw(a, b) {
      return b.language ? a.forced !== b.forced || Fc(a.language, b.language) == 0 || b.kind != a.kind ? false : true : true;
    }
    function Bw() {
      return true;
    }
    function Cw(a, b, c) {
      var d = Iw(a, b, c);
      if (d === Jw) return true;
      if (d === Kw) return false;
      d = Fc(a.language, b.language);
      var e = Fc(a.language, c.language);
      if (e > d) return true;
      if (e < d) return false;
      if (b.label !== c.label) {
        if (a.label === b.label) return false;
        if (a.label === c.label) return true;
      }
      if (a.roles.length) {
        d = b.roles.filter(function(f) {
          return a.roles.includes(f);
        });
        e = c.roles.filter(function(f) {
          return a.roles.includes(f);
        });
        if (e.length > d.length) return true;
        if (e.length < d.length) return false;
        if (c.roles.length !== b.roles.length) return c.roles.length < b.roles.length;
      } else {
        if (!c.roles.length && b.roles.length) return true;
        if (c.roles.length && !b.roles.length) return false;
      }
      if (!b.primary && c.primary) return true;
      if (b.primary && !c.primary) return false;
      d = Lw(a.channelsCount, b.channelsCount, c.channelsCount);
      if (d == Jw) return true;
      if (d == Kw) return false;
      d = Lw(a.audioSamplingRate, b.audioSamplingRate, c.audioSamplingRate);
      return d == Jw ? true : d == Kw ? false : a.bandwidth && Mw(a.bandwidth, b.bandwidth, c.bandwidth) == Jw ? true : false;
    }
    function Dw(a, b, c) {
      var d = Iw(a, b, c);
      if (d === Jw) return true;
      if (d === Kw) return false;
      d = Lw(a.width * a.height, b.width * b.height, c.width * c.height);
      if (d == Jw) return true;
      if (d == Kw) return false;
      if (a.frameRate) {
        d = Lw(a.frameRate, b.frameRate, c.frameRate);
        if (d == Jw) return true;
        if (d == Kw) return false;
      }
      return a.bandwidth && Mw(a.bandwidth, b.bandwidth, c.bandwidth) == Jw ? true : false;
    }
    function Ew(a, b, c) {
      var d = Fc(a.language, b.language), e = Fc(a.language, c.language);
      if (e > d) return true;
      if (e < d) return false;
      if (!b.primary && c.primary) return true;
      if (b.primary && !c.primary) return false;
      if (b.label !== c.label) {
        if (a.label === b.label) return false;
        if (a.label === c.label) return true;
      }
      if (a.roles.length) {
        d = b.roles.filter(function(f) {
          return a.roles.includes(f);
        });
        e = c.roles.filter(function(f) {
          return a.roles.includes(f);
        });
        if (e.length > d.length) return true;
        if (e.length < d.length) return false;
      } else {
        if (!c.roles.length && b.roles.length) return true;
        if (c.roles.length && !b.roles.length) return false;
      }
      return c.mimeType != a.mimeType || c.codecs != a.codecs || b.mimeType == a.mimeType && b.codecs == a.codecs ? false : true;
    }
    function Fw(a, b, c) {
      return Lw(a.width * a.height, b.width * b.height, c.width * c.height) == Jw ? true : false;
    }
    function pw(a) {
      return { id: 0, originalId: "", groupId: null, primary: false, type: a, mimeType: "", codecs: "", language: "", originalLanguage: null, label: null, width: null, height: null, encrypted: false, keyIds: /* @__PURE__ */ new Set(), segments: [], variantIds: [], roles: [], forced: false, channelsCount: null, audioSamplingRate: null, spatialAudio: false, closedCaptions: null, external: false, fastSwitching: false, isAudioMuxedInVideo: false, baseOriginalId: null };
    }
    function kw(a) {
      return {
        id: 0,
        originalId: "",
        groupId: null,
        createSegmentIndex: function() {
          return Promise.resolve();
        },
        segmentIndex: new Zl([]),
        mimeType: "",
        codecs: "",
        encrypted: false,
        drmInfos: [],
        keyIds: /* @__PURE__ */ new Set(),
        language: "",
        originalLanguage: null,
        label: null,
        type: a,
        primary: false,
        trickModeVideo: null,
        dependencyStream: null,
        emsgSchemeIdUris: null,
        roles: [],
        forced: false,
        channelsCount: null,
        audioSamplingRate: null,
        spatialAudio: false,
        closedCaptions: null,
        accessibilityPurpose: null,
        external: false,
        fastSwitching: false,
        fullMimeTypes: /* @__PURE__ */ new Set(),
        isAudioMuxedInVideo: false,
        baseOriginalId: null
      };
    }
    function Lw(a, b, c) {
      if (b == a && a != c) return Kw;
      if (c == a && a != b) return Jw;
      if (b > a) {
        if (c <= a || c - a < b - a) return Jw;
        if (c - a > b - a) return Kw;
      } else {
        if (c > a) return Kw;
        if (a - c < a - b) return Jw;
        if (a - c > a - b) return Kw;
      }
      return Nw;
    }
    function Iw(a, b, c) {
      var d = a.mimeType === b.mimeType && a.codecs === b.codecs, e = a.mimeType === c.mimeType && a.codecs === c.codecs;
      if (d && !e) return Kw;
      if (!d && e) return Jw;
      b = Gw(a, b);
      a = Gw(a, c);
      return b && !a ? Kw : !b && a ? Jw : Nw;
    }
    function Mw(a, b, c) {
      b = Math.abs(a - b);
      a = Math.abs(a - c);
      return a < b ? Jw : b < a ? Kw : Nw;
    }
    function uw(a) {
      switch (a.type) {
        case tc:
          return !a.language;
        case "image":
          return !a.tilesLayout;
        default:
          return false;
      }
    }
    function hw(a) {
      return Ow([a.fastSwitching, a.width, a.frameRate, a.codecs, a.mimeType, a.label, a.roles, a.closedCaptions ? Array.from(a.closedCaptions.entries()) : null, a.bandwidth, a.dependencyStream ? a.dependencyStream.baseOriginalId : null, Array.from(a.keyIds)]);
    }
    function gw(a) {
      return Ow([a.fastSwitching, a.channelsCount, a.language, a.bandwidth, a.label, a.codecs, a.mimeType, a.roles, a.audioSamplingRate, a.primary, a.dependencyStream ? a.dependencyStream.baseOriginalId : null, Array.from(a.keyIds)]);
    }
    function iw(a) {
      return Ow([a.language, a.label, a.codecs, a.mimeType, a.bandwidth, a.roles]);
    }
    function jw(a) {
      return Ow([a.width, a.codecs, a.mimeType]);
    }
    function Ow(a) {
      return JSON.stringify(a);
    }
    function Hw(a) {
      if (!Pw.has(a)) {
        var b = kf(a);
        Pw.set(a, b);
      }
      return Pw.get(a);
    }
    S("shaka.util.PeriodCombiner", ew);
    ew.prototype.setUseStreamOnce = ew.prototype.Oj;
    ew.prototype.setAllowMultiTypeVariants = ew.prototype.Ij;
    ew.prototype.combinePeriods = ew.prototype.Og;
    ew.prototype.deleteStream = ew.prototype.Ri;
    ew.prototype.getImageStreams = ew.prototype.Ok;
    ew.prototype.getTextStreams = ew.prototype.wh;
    ew.prototype.getVariants = ew.prototype.vl;
    var Jw = 1, Nw = 0, Kw = -1, Pw = /* @__PURE__ */ new Map();
    function Qw(a, b) {
      var c = new DOMParser(), d = Rw.value()(a);
      a = null;
      try {
        a = c.parseFromString(d, "text/xml");
      } catch (e) {
        return null;
      }
      c = a.documentElement;
      if (!c || c.getElementsByTagName("parsererror").length || c.tagName != b) return null;
      if (!("createNodeIterator" in document)) return c;
      for (b = document.createNodeIterator(a, NodeFilter.SHOW_ALL); a = b.nextNode(); ) if (a instanceof HTMLElement || a instanceof SVGElement) return null;
      return c;
    }
    function Sw(a, b) {
      try {
        var c = $b(a);
        return Qw(c, b);
      } catch (d) {
        return null;
      }
    }
    var Rw = new Rb(function() {
      if (typeof trustedTypes !== "undefined") {
        var a = trustedTypes.createPolicy("shaka-player#xml", { createHTML: function(b) {
          return b;
        } });
        return function(b) {
          return a.createHTML(b);
        };
      }
      return function(b) {
        return b;
      };
    });
    function Tw() {
      var a = this;
      this.j = this.g = null;
      this.C = [];
      this.h = null;
      this.va = 1;
      this.H = [];
      this.l = { Mf: "", type: "", profiles: [], Ac: null, zb: 0, kb: null, Ae: 0 };
      this.A = /* @__PURE__ */ new Map();
      this.D = /* @__PURE__ */ new Map();
      this.u = /* @__PURE__ */ new Map();
      this.F = /* @__PURE__ */ new Map();
      this.sa = /* @__PURE__ */ new Map();
      this.m = new ew();
      this.K = 0;
      this.ua = new Nc(5);
      this.L = new Cf(function() {
        if (a.J && !a.g.continueLoadingWhenPaused && (a.I.Ea(a.J, "timeupdate"), a.J.paused)) {
          a.I.qa(a.J, "timeupdate", function() {
            return Uw(a);
          });
          return;
        }
        Uw(a);
      });
      this.P = new Ug();
      this.O = null;
      this.G = [];
      this.$ = Infinity;
      this.oa = false;
      this.i = null;
      this.M = 0;
      this.R = false;
      this.I = new Qc();
      this.J = null;
      this.S = false;
      this.Z = "";
      this.ea = function() {
        return false;
      };
      this.V = [];
      this.aa = /* @__PURE__ */ new Set();
    }
    p = Tw.prototype;
    p.configure = function(a, b) {
      var c = this.j && a.updatePeriod != this.g.updatePeriod && a.updatePeriod >= 0;
      this.g = a;
      b && (this.ea = b);
      c && this.h && this.h.presentationTimeline.U() && this.L.La();
      this.i && this.i.configure(this.g);
      this.m && (this.m.Ij(this.g.dash.multiTypeVariantsAllowed && fd()), this.m.Oj(this.g.dash.useStreamOnceInPeriodFlattening));
    };
    p.start = function(a, b) {
      var c = this, d;
      return P(function(e) {
        if (e.g == 1) return c.oa = b.isLowLatencyMode(), c.C = [a], c.j = b, G(e, Vw(c), 2);
        d = e.h;
        c.j && Ww(c, d);
        if (!c.j) throw new U(2, 7, 7001);
        return e.return(c.h);
      });
    };
    p.stop = function() {
      for (var a = t(this.u.values()), b = a.next(); !b.done; b = a.next()) b = b.value, b.segmentIndex && b.segmentIndex.release();
      this.m && this.m.release();
      this.g = this.j = null;
      this.C = [];
      this.h = null;
      this.u.clear();
      this.F.clear();
      this.A.clear();
      this.D.clear();
      this.l = { Mf: "", type: "", profiles: [], Ac: null, zb: 0, kb: null, Ae: 0 };
      this.m = null;
      this.L != null && (this.L.stop(), this.L = null);
      this.i && this.i.destroy();
      this.I && (this.I.release(), this.I = null);
      this.aa.clear();
      return this.P.destroy();
    };
    p.update = function() {
      var a = this, b;
      return P(function(c) {
        if (c.g == 1) return sa(c, 2), G(c, Vw(a), 4);
        if (c.g != 2) return ua(c, 0);
        b = va(c);
        if (!a.j || !b) return c.return();
        a.j.onError(b);
        H(c);
      });
    };
    p.onExpirationUpdated = function() {
    };
    p.onInitialVariantChosen = function(a) {
      if (this.h && this.h.presentationTimeline.U()) {
        var b = a.video || a.audio;
        if (b && b.segmentIndex) {
          a = this.h.presentationTimeline.Mc();
          var c = b.segmentIndex.find(a);
          c != null && (b = b.segmentIndex.get(c)) && (this.K = b.endTime - a, Ww(this, 0));
        }
      }
    };
    p.banLocation = function(a) {
      this.i && this.i.banLocation(a);
    };
    p.setMediaElement = function(a) {
      this.J = a;
    };
    function Vw(a) {
      var b, c, d, e, f, g, h, k2, l, m, n;
      return P(function(q) {
        if (q.g == 1) return b = 4, c = "MPD", d = Xw(a), e = a.C, d.length ? (e = d, c = "Patch", b = 6) : a.C.length > 1 && a.i && (f = dw(a.i, "Location", true), f.length && (e = f)), g = ah(e, a.g.retryParameters), h = Date.now(), G(q, Yw(a, g, 0, { type: b }), 2);
        if (q.g != 3) {
          k2 = q.h;
          if (!a.j) return q.return(0);
          k2.uri && k2.uri != k2.originalUri && !a.C.includes(k2.uri) && a.C.unshift(k2.uri);
          l = new rb(k2.uri);
          a.Z = l.g.toString();
          return G(q, Zw(a, k2.data, k2.uri, c), 3);
        }
        m = Date.now();
        n = (m - h) / 1e3;
        a.ua.sample(1, n);
        a.aa.clear();
        return q.return(n);
      });
    }
    function Zw(a, b, c, d) {
      var e, f, g, h, k2, l, m, n, q, r, u;
      return P(function(w) {
        if (w.g == 1) {
          e = b;
          f = a.g.dash.manifestPreprocessor;
          g = Wn;
          if (f != g) {
            Wc("manifest.dash.manifestPreprocessor configuration", "Please Use manifest.dash.manifestPreprocessorTXml instead.");
            h = Sw(e, d);
            if (!h) throw new U(2, 4, 4001, c);
            f(h);
            e = ac(h.outerHTML);
          }
          k2 = Kd(e, d);
          if (!k2) throw new U(2, 4, 4001, c);
          l = a.g.dash.manifestPreprocessorTXml;
          m = Xn;
          l != m && l(k2);
          if (d === "Patch") return w.return($w(a, k2));
          if (n = a.g.dash.disableXlinkProcessing) return w.return(ax(a, k2, c));
          q = a.g.dash.xlinkFailGracefully;
          r = qv(k2, a.g.retryParameters, q, c, a.j.networkingEngine);
          Vg(a.P, r);
          return G(w, r.promise, 2);
        }
        u = w.h;
        return w.return(ax(a, u, c));
      });
    }
    function ax(a, b, c) {
      var d, e, f, g, h, k2, l, m, n, q, r, u, w, v, y, z, A, C, D, F, B, E, I, J, K, L, M, N, O, Q, R, V, Ba, aa, Oa, La, Ja, Ea, ya, Fa, Da, za, Ca, fb, hb, ib, xb, vb, Va, Wd, Lc, Ee, Ad, xg, Dk, ai;
      return P(function(gd) {
        switch (gd.g) {
          case 1:
            a.i && a.i.l.clear();
            d = [c];
            e = [];
            f = /* @__PURE__ */ new Map();
            g = Sd(b, "Location");
            h = t(g);
            for (k2 = h.next(); !k2.done; k2 = h.next()) if (l = k2.value, m = l.attributes.serviceLocation, n = Ud(l)) q = nc(d, [n])[0], m && (a.i ? cw(a.i, "Location", m, q) : f.set(m, q)), e.push(q);
            a.i ? (r = dw(a.i, "Location", true), r.length > 0 && (d = a.C = r)) : e.length && (d = a.C = e);
            a.l.Mf = b.attributes.id || "";
            a.l.Ae = $d(b, "publishTime", ce) || 0;
            a.H = Sd(b, "PatchLocation");
            u = Promise.resolve();
            if ((w = Xd(b, "ContentSteering")) && a.j) {
              v = w.attributes.defaultServiceLocation;
              if (a.i) a.i.i = d, a.i.h = v;
              else if (a.i = new Zv(a.j), a.i.configure(a.g), a.i.setManifestType("DASH"), a.i.i = d, a.i.h = v, y = Ud(w)) (z = $d(w, "queryBeforeStart", ke, false)) ? u = $v(a.i, y) : $v(a.i, y);
              A = t(f.keys());
              for (C = A.next(); !C.done; C = A.next()) D = C.value, F = f.get(D), cw(a.i, "Location", D, F);
            }
            B = Sd(b, "BaseURL");
            E = false;
            if (a.i) for (I = t(B), J = I.next(); !J.done; J = I.next()) K = J.value, L = K.attributes.serviceLocation, M = Ud(K), L && M && (cw(a.i, "BaseURL", L, M), E = true);
            a.V.splice(0);
            E && a.i || (N = B.map(Ud), a.V.push.apply(a.V, x(nc(d, N))));
            O = a.i;
            Q = a.V;
            R = function() {
              return O && E ? dw(O, "BaseURL") : Q.slice();
            };
            a.l.kb = R;
            V = 0;
            B && B.length && (V = $d(B[0], "availabilityTimeOffset", je) || 0);
            a.l.zb = V;
            a.K = $d(b, "minimumUpdatePeriod", de, -1);
            Ba = $d(b, "availabilityStartTime", ce);
            aa = $d(b, "timeShiftBufferDepth", de);
            Oa = a.g.dash.ignoreSuggestedPresentationDelay;
            La = null;
            Oa || (La = $d(b, "suggestedPresentationDelay", de));
            Ja = a.g.dash.ignoreMaxSegmentDuration;
            Ea = null;
            Ja || (Ea = $d(b, "maxSegmentDuration", de));
            ya = b.attributes.type || "static";
            a.h && a.h.presentationTimeline && (a.S = a.h.presentationTimeline.U() && ya == "static");
            a.l.type = ya;
            if (a.h) for (Fa = a.h.presentationTimeline, Da = Fa.Nb(), za = t(a.u.values()), Ca = za.next(); !Ca.done; Ca = za.next()) fb = Ca.value, fb.segmentIndex && fb.segmentIndex.ib(Da);
            else hb = a.g.dash.ignoreMinBufferTime, ib = 0, hb || (ib = $d(b, "minBufferTime", de) || 0), xb = 0, xb = La != null ? Math.min(La, aa || Infinity) : a.g.defaultPresentationDelay > 0 ? a.g.defaultPresentationDelay : Math.min(ib * 1.5, aa || Infinity), Fa = new Al(Ba, xb, a.g.dash.autoCorrectDrift);
            Fa.rd(ya == "static");
            (vb = Fa.U()) && !isNaN(a.g.availabilityWindowOverride) && (aa = a.g.availabilityWindowOverride);
            aa == null && (aa = Infinity);
            Fa.hg(aa);
            Va = b.attributes.profiles || "";
            a.l.profiles = Va.split(",");
            Wd = { Jb: ya != "static", presentationTimeline: Fa, Aa: null, ra: null, wa: null, N: null, bandwidth: 0, Ch: false, zb: V, Ac: null, profiles: Va.split(","), roles: null, Sb: function() {
              return "";
            } };
            return G(gd, u, 2);
          case 2:
            a.M = 0;
            Lc = bx(a, Wd, R, b, false);
            Ee = Lc.duration;
            Ad = Lc.periods;
            (ya != "static" || a.S) && Lc.Ti || Fa.yb(Ee || Infinity);
            a.R && a.oa && Fa.Jj(a.$);
            Fa.Lh(Ea || 1);
            a.R && a.oa && (xg = La != null ? La : a.g.defaultPresentationDelay, Fa.ci(xg));
            if (!a.h) return G(gd, a.m.Og(Ad, Wd.Jb), 6);
            a.h.periodCount = Ad.length;
            a.h.gapCount = a.M;
            return G(gd, cx(a, Ad, false), 4);
          case 6:
            a.h = {
              presentationTimeline: Fa,
              variants: a.m.l,
              textStreams: a.m.wh(),
              imageStreams: a.m.i,
              offlineSessionIds: [],
              sequenceMode: a.g.dash.sequenceMode,
              ignoreManifestTimestampsInSegmentsMode: false,
              type: "DASH",
              serviceDescription: dx(b),
              nextUrl: ex(b),
              periodCount: Ad.length,
              gapCount: a.M,
              isLowLatency: a.R,
              startTime: null
            };
            if (!Fa.ck()) {
              gd.B(7);
              break;
            }
            Dk = Sd(b, "UTCTiming");
            return G(gd, fx(a, R, Dk), 8);
          case 8:
            ai = gd.h;
            if (!a.j) return gd.return();
            Fa.Kj(ai);
          case 7:
            Fa.If(), a.m && !a.h.presentationTimeline.U() && a.m.release();
          case 4:
            a.j.makeTextStreamsForClosedCaptions(a.h), gx(a), hx(a, Ad), H(gd);
        }
      });
    }
    function cx(a, b, c) {
      var d;
      return P(function(e) {
        if (e.g == 1) return G(e, a.m.Og(b, true, c), 2);
        a.h.variants = a.m.l;
        d = a.m.wh();
        d.length > 0 && (a.h.textStreams = d);
        a.h.imageStreams = a.m.i;
        a.j.filter(a.h);
        H(e);
      });
    }
    function $w(a, b) {
      var c, d, e, f, g, h, k2, l, m, n, q, r, u, w, v, y, z, A, C, D, F, B, E, I, J, K, L;
      return P(function(M) {
        if (M.g == 1) {
          c = b.attributes.mpdId;
          d = $d(b, "originalPublishTime", ce);
          if (!c || c !== a.l.Mf || d !== a.l.Ae) throw a.H = [], new U(1, 4, 4052);
          e = [];
          f = [];
          g = /* @__PURE__ */ new Set();
          h = t(Rd(b));
          for (k2 = h.next(); !k2.done; k2 = h.next()) if (l = k2.value, m = me(l.attributes.sel || ""), n = m[m.length - 1], q = Ud(l) || "", n.name === "MPD") if (n.Ic === "mediaPresentationDuration") {
            r = Ud(l) || "";
            var N = de(r);
            if (N != null) {
              a.l.Ac = N;
              for (var O = t(a.A.values()), Q = O.next(); !Q.done; Q = O.next()) Q.value.Ac = N;
            }
          } else if (n.Ic === "type") {
            a.h.presentationTimeline.rd(q == "static");
            a.l.type = q;
            N = t(a.A.values());
            for (O = N.next(); !O.done; O = N.next()) O.value.Jb = q == "dynamic";
            q == "static" && (a.K = -1);
          } else n.Ic === "publishTime" ? a.l.Ae = ce(q) || 0 : n.Ic === null && l.tagName === "add" && f.push(l);
          else if (n.name === "PatchLocation") ne(a.H, l);
          else if (n.name === "Period") l.tagName === "add" ? f.push(l) : l.tagName === "remove" && n.id && ix(a, n.id);
          else if (n.name === "SegmentTemplate") {
            O = me(l.attributes.sel || "");
            N = O[O.length - 1];
            if (N.Ic) {
              O = jx(a, O);
              Q = Ud(l) || "";
              for (var R = t(O), V = R.next(); !V.done; V = R.next()) V = a.A.get(V.value), pe(V.N.Tc, l.tagName, N.Ic, Q);
              N = O;
            } else N = [];
            u = N;
            w = t(u);
            for (v = w.next(); !v.done; v = w.next()) y = v.value, g.add(y);
          } else if (n.name === "SegmentTimeline" || n.name === "S") {
            N = me(l.attributes.sel || "");
            N = jx(a, N);
            O = t(N);
            for (Q = O.next(); !Q.done; Q = O.next()) Q = a.A.get(Q.value), Q = nv(Q, Pv, "SegmentTimeline"), R = Sd(Q, "S"), ne(R, l), Q.children = R;
            z = N;
            A = t(z);
            for (C = A.next(); !C.done; C = A.next()) D = C.value, g.add(D);
          }
          F = t(g);
          for (B = F.next(); !B.done; B = F.next()) E = B.value, kx(
            a,
            E
          );
          I = t(f);
          for (J = I.next(); !J.done; J = I.next()) K = J.value, e.push.apply(e, x(lx(a, K)));
          if (!e.length) return M.B(2);
          a.h.periodCount += e.length;
          a.h.gapCount = a.M;
          return G(M, cx(a, e, true), 2);
        }
        a.l.type == "static" && (L = a.l.Ac, a.h.presentationTimeline.yb(L || Infinity));
        H(M);
      });
    }
    function lx(a, b) {
      return bx(a, { Jb: a.l.type == "dynamic", presentationTimeline: a.h.presentationTimeline, Aa: null, ra: null, wa: null, N: null, bandwidth: 0, Ch: false, zb: a.l.zb, profiles: a.l.profiles, Ac: a.l.Ac, roles: null, Sb: function() {
        return "";
      } }, a.l.kb, b, true).periods;
    }
    function ix(a, b) {
      a.h.periodCount--;
      for (var c = t(a.A.keys()), d = c.next(); !d.done; d = c.next()) if (d = d.value, d.startsWith(b)) {
        var e = a.A.get(d);
        nv(e, Pv, "SegmentTimeline").children = [];
        kx(a, d);
        a.A.delete(d);
      }
      a.G = a.G.filter(function(f) {
        return f !== b;
      });
    }
    function jx(a, b) {
      var c = "", d = "", e = -1, f = "";
      b = t(b);
      for (var g = b.next(); !g.done; g = b.next()) g = g.value, g.name === "Period" ? c = g.id : g.name === "AdaptationSet" ? (d = g.id, g.position !== null && (e = g.position)) : g.name === "Representation" && (f = g.id);
      b = [];
      if (f) b.push(c + "," + f);
      else if (d) for (e = t(a.A.values()), a = e.next(); !a.done; a = e.next()) a = a.value, a.Aa.id === c && a.wa.id === d && a.N.id && b.push(c + "," + a.N.id);
      else if (e > -1) for (d = t(a.A.values()), a = d.next(); !a.done; a = d.next()) a = a.value, a.Aa.id === c && a.wa.position === e && a.N.id && b.push(c + "," + a.N.id);
      return b;
    }
    function kx(a, b) {
      var c = a.A.get(b), d = a.u.get(b);
      d.segmentIndex && d.segmentIndex.ib(a.h.presentationTimeline.Nb());
      try {
        var e = Ov(c, function(f, g, h, k2) {
          return mx(a, f, g, h, k2);
        }, a.u, true, a.g.dash.initialSegmentLimit, a.sa, c.N.aesKey, null, true, a.D);
        d.createSegmentIndex = function() {
          return P(function(f) {
            if (f.g == 1) return d.segmentIndex ? f.B(0) : G(f, e.dd(), 3);
            d.segmentIndex = f.h;
            H(f);
          });
        };
      } catch (f) {
        if (b = c.N.contentType, b != tc && b != "application" && b != "image" || f.code != 4002) throw f;
      }
    }
    function dx(a) {
      var b = Xd(a, "ServiceDescription");
      if (!b) return null;
      a = Xd(b, "Latency");
      b = Xd(b, "PlaybackRate");
      if (!a && !b) return null;
      var c = {};
      a && ("target" in a.attributes && (c.targetLatency = parseInt(a.attributes.target, 10) / 1e3), "max" in a.attributes && (c.maxLatency = parseInt(a.attributes.max, 10) / 1e3), "min" in a.attributes && (c.minLatency = parseInt(a.attributes.min, 10) / 1e3));
      b && ("max" in b.attributes && (c.maxPlaybackRate = parseFloat(b.attributes.max)), "min" in b.attributes && (c.minPlaybackRate = parseFloat(b.attributes.min)));
      return c;
    }
    function ex(a) {
      a = Sd(a, "SupplementalProperty");
      if (!a.length) return null;
      a = t(a);
      for (var b = a.next(); !b.done; b = a.next()) if (b = b.value, b.attributes.schemeIdUri == "urn:mpeg:dash:chaining:2016") return b.attributes.value;
      return null;
    }
    function bx(a, b, c, d, e) {
      var f = b.Ac;
      f || (f = $d(d, "mediaPresentationDuration", de), a.l.Ac = f);
      var g = 0;
      a.h && a.h.presentationTimeline && a.S && (g = a.h.presentationTimeline.ec());
      var h = [], k2 = g;
      d = Sd(d, "Period");
      for (var l = 0; l < d.length; l++) {
        var m = d[l], n = d[l + 1], q = $d(m, "start", de, k2), r = m.attributes.id, u = $d(m, "duration", de);
        q = l == 0 && q == 0 && a.S ? g : q;
        var w = null;
        if (n) {
          var v = $d(n, "start", de);
          v != null && (w = v - q + g);
        } else f != null && (w = f - q + g);
        v = wc;
        w && u && Math.abs(w - u) > v && w > u && a.M++;
        w == null && (w = u);
        if (!(a.O !== null && r !== null && q !== null && q < a.O) || a.G.includes(r) || l + 1 == d.length) {
          q !== null && (a.O === null || q > a.O) && (a.O = q);
          k2 = nx(a, b, c, { start: q, duration: w, node: m, Cf: w == null || !n });
          h.push(k2);
          b.Aa.id && w && a.sa.set(b.Aa.id, w);
          if (w == null) {
            k2 = null;
            break;
          }
          k2 = q + w;
        }
      }
      if (e) for (b = t(h), c = b.next(); !c.done; c = b.next()) c = c.value.id, a.G.includes(c) || a.G.push(c);
      else a.G = h.map(function(y) {
        return y.id;
      });
      return f != null ? { periods: h, duration: f + g, Ti: false } : { periods: h, duration: k2, Ti: true };
    }
    function gx(a) {
      var b = Array.from(a.F.keys()).filter(function(h) {
        return !a.G.includes(h);
      });
      b = t(b);
      for (var c = b.next(); !c.done; c = b.next()) {
        c = c.value;
        for (var d = true, e = t(a.F.get(c)), f = e.next(); !f.done; f = e.next()) {
          f = f.value;
          var g = a.u.get(f);
          g && (g.segmentIndex && g.segmentIndex.getNumReferences() != 0 ? d = false : (a.m && a.m.Ri(g, c), a.u.delete(f)));
        }
        d && a.F.delete(c);
      }
    }
    function hx(a, b) {
      b = new Set(b.map(function(e) {
        return e.id;
      }));
      for (var c = t(a.D.keys()), d = c.next(); !d.done; d = c.next()) d = d.value, b.has(d) || a.D.delete(d);
    }
    function nx(a, b, c, d) {
      b.Aa = ox(a, d.node, null, c);
      b.ra = d;
      b.Aa.zb = b.zb;
      b.Aa.id || (b.Aa.id = "__shaka_period_" + d.start);
      var e = Sd(d.node, "EventStream");
      c = b.presentationTimeline.Nb();
      e = t(e);
      for (var f = e.next(); !f.done; f = e.next()) px(a, d.start, d.duration, f.value, c);
      c = Sd(d.node, "SupplementalProperty");
      c = t(c);
      for (e = c.next(); !e.done; e = c.next()) if (e = e.value, e.attributes.schemeIdUri == "urn:mpeg:dash:urlparam:2014" && (e = qx(a, e))) b.Sb = e;
      c = Sd(d.node, "AdaptationSet").map(function(r, u) {
        return rx(a, b, u, r);
      }).filter(Ff);
      if (b.Jb) {
        e = [];
        f = t(c);
        for (var g = f.next(); !g.done; g = f.next()) {
          g = t(g.value.gm);
          for (var h = g.next(); !h.done; h = g.next()) e.push(h.value);
        }
        if (e.length != new Set(e).size) throw new U(2, 4, 4018);
      }
      e = /* @__PURE__ */ new Map();
      f = t(c);
      for (g = f.next(); !g.done; g = f.next()) for (g = t(g.value.xk), h = g.next(); !h.done; h = g.next()) {
        var k2 = t(h.value);
        h = k2.next().value;
        k2 = k2.next().value;
        e.set(h, k2);
      }
      if (e.size) for (f = null, g = t(c), h = g.next(); !h.done; h = g.next()) {
        h = h.value;
        k2 = [];
        for (var l = t(h.streams), m = l.next(), n = {}; !m.done; n = { mi: void 0 }, m = l.next()) if (n.mi = m.value, e.has(n.mi.originalId)) {
          f || (f = Sd(d.node, "AdaptationSet").map(function(r, u) {
            return rx(a, b, u, r);
          }).filter(Ff));
          m = t(f);
          for (var q = m.next(); !q.done; q = m.next()) if (q = q.value.streams.find(/* @__PURE__ */ function(r) {
            return function(u) {
              return u.originalId == r.mi.originalId;
            };
          }(n))) q.dependencyStream = e.get(q.originalId), q.originalId += q.dependencyStream.originalId, k2.push(q);
        }
        k2.length && h.streams.push.apply(h.streams, x(k2));
      }
      d = c.filter(function(r) {
        return !r.wi;
      });
      c = c.filter(function(r) {
        return r.wi;
      });
      if (!a.g.disableIFrames) {
        for (c = t(c), e = c.next(); !e.done; e = c.next()) for (e = e.value, f = e.wi.split(" "), g = t(d), h = g.next(); !h.done; h = g.next()) if (h = h.value, f.includes(h.id)) for (h = t(h.streams), k2 = h.next(); !k2.done; k2 = h.next()) pg(k2.value, e.streams);
      }
      c = sx(a.g.disableAudio, d, "audio");
      e = sx(a.g.disableVideo, d, "video");
      f = sx(a.g.disableText, d, tc);
      d = sx(a.g.disableThumbnails, d, "image");
      if (e.length === 0 && c.length === 0) throw new U(2, 4, 4004);
      return { id: b.Aa.id, audioStreams: c, videoStreams: e, textStreams: f, imageStreams: d };
    }
    function sx(a, b, c) {
      return a || !b.length ? [] : b.reduce(function(d, e) {
        if (e.contentType != c) return d;
        d.push.apply(d, x(e.streams));
        return d;
      }, []);
    }
    function rx(a, b, c, d) {
      function e(L) {
        var M = L.attributes["dvb:fontFamily"];
        L = L.attributes["dvb:url"];
        M && L && (L = nc(b.wa.kb(), [L], b.Sb()), a.j.addFont(M, L[0]));
      }
      function f(L) {
        switch (L) {
          case 1:
          case 5:
          case 6:
          case 7:
            return "srgb";
          case 9:
            return "rec2020";
          case 11:
          case 12:
            return "p3";
        }
      }
      function g(L) {
        switch (L) {
          case 1:
          case 6:
          case 13:
          case 14:
          case 15:
            return "SDR";
          case 16:
            return "PQ";
          case 18:
            return "HLG";
        }
      }
      b.wa = ox(a, d, b.Aa, null);
      b.wa.position = c;
      var h = false;
      c = Sd(d, "Role");
      var k2 = c.map(function(L) {
        return L.attributes.value;
      }).filter(Ff), l = void 0, m = b.wa.contentType == tc;
      m && (l = "subtitle");
      c = t(c);
      for (var n = c.next(); !n.done; n = c.next()) {
        n = n.value;
        var q = n.attributes.schemeIdUri;
        if (q == null || q == "urn:mpeg:dash:role:2011") switch (n = n.attributes.value, n) {
          case "main":
            h = true;
            break;
          case "caption":
          case "subtitle":
            l = n;
        }
      }
      var r = Sd(d, "EssentialProperty");
      c = null;
      var u = false;
      n = null;
      q = false;
      r = t(r);
      for (var w = r.next(); !w.done; w = r.next()) {
        w = w.value;
        var v = w.attributes.schemeIdUri;
        if (v == "http://dashif.org/guidelines/trickmode") c = w.attributes.value;
        else if (v == "urn:mpeg:mpegB:cicp:TransferCharacteristics") var y = g(parseInt(w.attributes.value, 10));
        else if (v == "urn:mpeg:mpegB:cicp:ColourPrimaries") var z = f(parseInt(w.attributes.value, 10));
        else v != "urn:mpeg:mpegB:cicp:MatrixCoefficients" && (v == "urn:mpeg:dash:ssr:2023" && a.g.dash.enableFastSwitching ? u = true : v == "urn:dvb:dash:fontdownload:2014" ? e(w) : v == "urn:mpeg:dash:urlparam:2014" ? (n = qx(a, w)) || (q = true) : q = true);
      }
      if (q) return null;
      var A = null;
      q = Sd(d, "SupplementalProperty");
      q = t(q);
      for (r = q.next(); !r.done; r = q.next()) r = r.value, w = r.attributes.schemeIdUri, w == "http://dashif.org/guidelines/last-segment-number" ? A = parseInt(r.attributes.value, 10) - 1 : w == "urn:mpeg:mpegB:cicp:TransferCharacteristics" ? y = g(parseInt(r.attributes.value, 10)) : w == "urn:mpeg:mpegB:cicp:ColourPrimaries" ? z = f(parseInt(r.attributes.value, 10)) : w == "urn:dvb:dash:fontdownload:2014" ? e(r) : w == "urn:mpeg:dash:urlparam:2014" && (n = qx(a, r));
      n && (b.Sb = n);
      n = Sd(d, "Accessibility");
      var C = /* @__PURE__ */ new Map(), D;
      n = t(n);
      for (q = n.next(); !q.done; q = n.next()) if (r = q.value, q = r.attributes.schemeIdUri, r = r.attributes.value, q != "urn:scte:dash:cc:cea-608:2015" || a.g.disableText) if (q != "urn:scte:dash:cc:cea-708:2015" || a.g.disableText) q == "urn:mpeg:dash:role:2011" ? r != null && (k2.push(r), r == "captions" && (l = "caption")) : q == "urn:tva:metadata:cs:AudioPurposeCS:2007" && (r == "1" ? D = "visually impaired" : r == "2" ? D = "hard of hearing" : r == "9" && (D = "spoken subtitles"));
      else if (q = 1, r != null) for (r = t(r.split(";")), w = r.next(); !w.done; w = r.next()) {
        v = w.value;
        var F = w = void 0;
        v.includes("=") ? (v = v.split("="), w = "svc" + v[0], F = v[1].split(",")[0].split(":").pop()) : (w = "svc" + q, q++, F = v);
        C.set(w, zc(F));
      }
      else C.set("svc1", "und");
      else if (q = 1, r != null) for (r = r.split(";"), w = t(r), v = w.next(); !v.done; v = w.next()) {
        F = v.value;
        var B = v = void 0;
        F.includes("=") ? (F = F.split("="), v = F[0].startsWith("CC") ? F[0] : "CC" + F[0], B = F[1] || "und") : (v = "CC" + q, r.length == 2 ? q += 2 : q++, B = F);
        C.set(v, zc(B));
      }
      else C.set("CC1", "und");
      n = Sd(d, "ContentProtection");
      var E = cv(n, a.g.ignoreDrmInfo, a.g.dash.keySystemsByURI);
      b.wa.encrypted = n.length > 0;
      var I = zc(b.wa.language || "und"), J = b.wa.label, K = /* @__PURE__ */ new Map();
      d = Sd(d, "Representation");
      if (!a.g.ignoreSupplementalCodecs) {
        n = [];
        q = t(d);
        for (r = q.next(); !r.done; r = q.next()) if (w = r.value, r = ae(w, "urn:scte:dash:scte214-extensions", "supplementalCodecs")) w = Hd(w), w.attributes.codecs = r.split(" ").join(","), w.attributes.id && (w.attributes.supplementalId = w.attributes.id + "_supplementalCodecs"), n.push(w);
        d.push.apply(d, x(n));
      }
      n = d.map(function(L) {
        var M = tx(a, b, E, l, I, J, h, k2, C, L, D, A);
        return M && (M.hdr = M.hdr || y, M.colorGamut = M.colorGamut || z, M.fastSwitching = u, L = L.attributes.dependencyId) ? (M.baseOriginalId = L, K.set(L, M), null) : M;
      }).filter(function(L) {
        return !!L;
      });
      if (n.length == 0 && K.size == 0) {
        c = b.wa.contentType == "image";
        if (a.g.dash.ignoreEmptyAdaptationSet || m || c) return null;
        throw new U(2, 4, 4003);
      }
      if (!b.wa.contentType || b.wa.contentType == "application") for (b.wa.contentType = ux(n[0].mimeType, n[0].codecs), m = t(n), q = m.next(); !q.done; q = m.next()) q.value.type = b.wa.contentType;
      m = b.wa.id || "__fake__" + a.va++;
      q = t(n);
      for (r = q.next(); !r.done; r = q.next()) {
        r = r.value;
        w = t(E.drmInfos);
        for (v = w.next(); !v.done; v = w.next()) v = v.value, v.keyIds = v.keyIds && r.keyIds ? new Set([].concat(x(v.keyIds), x(r.keyIds))) : v.keyIds || r.keyIds;
        r.groupId = m;
      }
      d = d.map(function(L) {
        return L.attributes.supplementalId || L.attributes.id;
      }).filter(Ff);
      return { id: m, contentType: b.wa.contentType, language: I, Rn: h, streams: n, drmInfos: E.drmInfos, wi: c, gm: d, xk: K };
    }
    function qx(a, b) {
      if ((b = Yd(b, "urn:mpeg:dash:schema:urlparam:2014", "UrlQueryInfo")) && $d(b, "useMPDUrlQuery", ke, false)) {
        var c = b.attributes.queryTemplate;
        if (c) return function() {
          return c == "$querypart$" ? a.Z : c.split("&").map(function(d) {
            if (d == "$querypart$") return a.Z;
            var e = /\$query:(.*?)\$/g.exec(d);
            if (e && e.length == 2) {
              e = e[1];
              var f = new zb(a.Z).get(e);
              if (f.length) return e + "=" + f[0];
            }
            return d;
          }).join("&");
        };
      }
      return null;
    }
    function tx(a, b, c, d, e, f, g, h, k2, l, m, n) {
      b.N = ox(a, l, b.wa, null);
      var q = b.N.id;
      a.$ = Math.min(a.$, b.N.zb);
      a.R = a.$ > 0;
      if (!vx(b.N)) return null;
      var r = b.ra.start;
      b.bandwidth = $d(l, "bandwidth", ge) || 0;
      b.roles = h;
      var u = Sd(l, "SupplementalProperty"), w = Sd(l, "EssentialProperty"), v = Sd(l, "ContentProtection");
      l = null;
      var y = w.find(function(O) {
        return O.attributes.schemeIdUri == "urn:mpeg:dash:urlparam:2014";
      });
      y ? l = qx(a, y) : (y = u.find(function(O) {
        return O.attributes.schemeIdUri == "urn:mpeg:dash:urlparam:2014";
      })) && (l = qx(a, y));
      l && (b.Sb = l);
      y = b.N.contentType;
      l = y == tc || y == "application";
      y = y == "image";
      v.length && (b.wa.encrypted = true);
      try {
        var z = void 0;
        if (c.Hg) {
          var A = b.N.kb, C = b.Sb, D = nc(A(), [c.Hg.Jl], C()), F = ah(D, a.g.retryParameters);
          z = { bitsKey: 128, blockCipherMode: "CBC", iv: c.Hg.iv, firstMediaSequenceNumber: 0, fetchKey: function() {
            var O, Q, R;
            return P(function(V) {
              if (V.g == 1) return G(V, Yw(a, F, 6), 2);
              if (V.g != 3) {
                O = V.h;
                if (!O.data || O.data.byteLength != 16) throw new U(2, 4, 4049);
                Q = { name: "AES-CBC" };
                R = z;
                return G(V, window2.crypto.subtle.importKey(
                  "raw",
                  O.data,
                  Q,
                  true,
                  ["decrypt"]
                ), 3);
              }
              R.cryptoKey = V.h;
              z.fetchKey = void 0;
              H(V);
            });
          } };
        }
        b.N.aesKey = z;
        A = function(O, Q, R, V) {
          return mx(a, O, Q, R, V);
        };
        if (b.N.Ud) var B = Dv(b, A, z);
        else if (b.N.Fc) B = Jv(b, a.u, z);
        else if (b.N.Tc) B = Ov(b, A, a.u, !!a.h, a.g.dash.initialSegmentLimit, a.sa, z, n, false, a.D);
        else {
          var E = b.ra.duration || 0, I = b.N.kb, J = b.N.mimeType, K = b.N.codecs;
          B = { endTime: -1, timeline: -1, dd: function() {
            var O = am(r, E, I());
            O.Kb(function(Q) {
              Q.mimeType = J;
              Q.codecs = K;
            });
            return Promise.resolve(O);
          }, timescale: 1 };
        }
      } catch (O) {
        if ((l || y) && O.code == 4002) return null;
        throw O;
      }
      n = gv(v, c, a.g.ignoreDrmInfo, a.g.dash.keySystemsByURI);
      n = new Set(n ? [n] : []);
      v = false;
      u.some(function(O) {
        return O.attributes.schemeIdUri == "tag:dolby.com,2018:dash:EC3_ExtensionType:2018" && O.attributes.value == "JOC";
      }) && (v = true);
      u = false;
      l && (u = h.includes("forced_subtitle") || h.includes("forced-subtitle"));
      var L;
      if (y && ((w = w.find(function(O) {
        return ["http://dashif.org/thumbnail_tile", "http://dashif.org/guidelines/thumbnail_tile"].includes(O.attributes.schemeIdUri);
      })) && (L = w.attributes.value), !L)) return null;
      var M;
      l = b.N.codecs;
      b.profiles.includes("http://dashif.org/guidelines/dash-if-uhd#hevc-hdr-pq10") && (l.includes("hvc1.2.4.L153.B0") || l.includes("hev1.2.4.L153.B0")) && (M = "PQ");
      w = b.N.id ? b.Aa.id + "," + b.N.id : "";
      a.H.length && q && a.A.set(b.Aa.id + "," + q, wx(b));
      b.N.Wf && xx(a, b.N.Wf, B, b.presentationTimeline);
      B.endTime != -1 && b.Aa.id != null && b.N.id != null && ((q = a.D.get(b.Aa.id)) ? (q.endTime = B.endTime, q.Uh.includes(b.N.id) || q.Uh.push(b.N.id), a.D.set(b.Aa.id, q)) : a.D.set(b.Aa.id, { endTime: B.endTime, timeline: B.timeline, Uh: [b.N.id] }));
      var N = w && a.u.has(w) ? a.u.get(w) : {
        id: a.va++,
        originalId: b.N.id,
        groupId: null,
        createSegmentIndex: function() {
          return Promise.resolve();
        },
        closeSegmentIndex: function() {
          N.segmentIndex && (N.segmentIndex.release(), N.segmentIndex = null);
        },
        segmentIndex: null,
        mimeType: b.N.mimeType,
        codecs: l,
        frameRate: b.N.frameRate,
        pixelAspectRatio: b.N.pixelAspectRatio,
        bandwidth: b.bandwidth,
        width: b.N.width,
        height: b.N.height,
        kind: d,
        encrypted: c.drmInfos.length > 0,
        drmInfos: c.drmInfos,
        keyIds: n,
        language: e,
        originalLanguage: b.wa.language,
        label: f,
        type: b.wa.contentType,
        primary: g,
        trickModeVideo: null,
        dependencyStream: null,
        emsgSchemeIdUris: b.N.emsgSchemeIdUris,
        roles: h,
        forced: u,
        channelsCount: b.N.Pf,
        audioSamplingRate: b.N.audioSamplingRate,
        spatialAudio: v,
        closedCaptions: k2,
        hdr: M,
        colorGamut: void 0,
        videoLayout: void 0,
        tilesLayout: L,
        accessibilityPurpose: m,
        external: false,
        fastSwitching: false,
        fullMimeTypes: /* @__PURE__ */ new Set([ef(b.N.mimeType, b.N.codecs)]),
        isAudioMuxedInVideo: false,
        baseOriginalId: null
      };
      N.createSegmentIndex = function() {
        var O;
        return P(function(Q) {
          if (Q.g == 1) {
            if (N.segmentIndex) return Q.B(0);
            O = N;
            return G(Q, B.dd(), 3);
          }
          O.segmentIndex = Q.h;
          H(Q);
        });
      };
      w && b.Jb && !a.u.has(w) && (b = b.Aa.id || "", a.F.has(b) || a.F.set(b, []), a.u.set(w, N), a.F.get(b).push(w));
      return N;
    }
    function xx(a, b, c, d) {
      if (!a.aa.has(b)) {
        a.aa.add(b);
        var e = $d(b, "presentationTime", he) || 0, f = Xd(b, "UTCTiming"), g;
        if (g = f && f.attributes.schemeIdUri) f = f.attributes.schemeIdUri, g = !(f === "urn:mpeg:dash:utc:http-ntp:2014" || f === "urn:mpeg:dash:utc:ntp:2014" || f === "urn:mpeg:dash:utc:sntp:2014");
        g ? b = ($d(b, "wallClockTime", ce) || 0) * 1e3 : (b = $d(b, "wallClockTime", he) || 0, b = dk(b));
        c = new Date(b - e / c.timescale * 1e3);
        e = c.getTime() / 1e3;
        isNaN(e) || (d.u || d.ei(e), d = (/* @__PURE__ */ new Map()).set("detail", { wallClockTime: b, programStartDate: c }), d = new T(
          "prft",
          d
        ), a.j.onEvent(d));
      }
    }
    function wx(a) {
      function b(c) {
        if (!c) return null;
        c = Id(c);
        c.Ud = null;
        c.Fc = null;
        c.Tc = re(c.Tc);
        c.Wf = null;
        return c;
      }
      a = Id(a);
      a.Aa = b(a.Aa);
      a.wa = b(a.wa);
      a.N = b(a.N);
      a.ra && (a.ra = Id(a.ra), a.ra.node = null);
      return a;
    }
    function Uw(a) {
      var b, c;
      return P(function(d) {
        switch (d.g) {
          case 1:
            return b = 0, sa(d, 2), G(d, Vw(a), 4);
          case 4:
            b = d.h;
            ua(d, 3);
            break;
          case 2:
            if (c = va(d), a.j) {
              if (a.g.raiseFatalErrorOnManifestUpdateRequestFailure) return a.j.onError(c), d.return();
              c.severity = 1;
              a.j.onError(c);
            }
          case 3:
            if (!a.j) return d.return();
            a.j.onManifestUpdated();
            Ww(a, b);
            H(d);
        }
      });
    }
    function Ww(a, b) {
      if (!(a.K < 0)) {
        var c = a.K;
        a.g.updatePeriod >= 0 && (c = a.g.updatePeriod);
        a.L.Y(Math.max(c - b, Oc(a.ua)));
      }
    }
    function ox(a, b, c, d) {
      c = c || { contentType: "", mimeType: "", codecs: "", emsgSchemeIdUris: [], frameRate: void 0, pixelAspectRatio: void 0, Pf: null, audioSamplingRate: null, zb: 0, eg: 1, encrypted: false };
      d = d || c.kb;
      var e = b.attributes.id, f = b.attributes.supplementalId, g = Sd(b, "BaseURL"), h, k2 = false;
      if (a.i) for (var l = t(g), m = l.next(); !m.done; m = l.next()) {
        var n = m.value;
        m = n.attributes.serviceLocation;
        n = Ud(n);
        m && n && (cw(a.i, e, m, n), k2 = true);
      }
      k2 && a.i || (h = g.map(Ud));
      var q = a.i;
      a = b.attributes.contentType || c.contentType;
      l = b.attributes.mimeType || c.mimeType;
      m = Fm([b.attributes.codecs || c.codecs]).join(",");
      n = $d(b, "frameRate", le) || c.frameRate;
      var r = b.attributes.sar || c.pixelAspectRatio, u = yx(Sd(b, "InbandEventStream"), c.emsgSchemeIdUris), w = Sd(b, "AudioChannelConfiguration");
      w = zx(w) || c.Pf;
      var v = $d(b, "audioSamplingRate", he) || c.audioSamplingRate;
      a || (a = ux(l, m));
      var y = Xd(b, "SegmentBase"), z = Xd(b, "SegmentTemplate"), A = y ? $d(y, "availabilityTimeOffset", je) || 0 : 0, C = z ? $d(z, "availabilityTimeOffset", je) || 0 : 0, D = g && g.length ? $d(g[0], "availabilityTimeOffset", je) || 0 : 0;
      A = c.zb + D + A + C;
      C = null;
      (D = Xd(b, "SegmentSequenceProperties")) && (D = $d(D, "cadence", ge)) && (C = D);
      D = b.attributes.label;
      var F = Sd(b, "Label");
      F && F.length && (F = F[0], Td(F) && (D = Td(F)));
      return {
        kb: function() {
          return nc(d(), g.length ? q && k2 ? dw(q, e) : h ? h : [] : []);
        },
        Ud: y || c.Ud,
        Fc: Xd(b, "SegmentList") || c.Fc,
        Tc: z || c.Tc,
        Wf: Xd(b, "ProducerReferenceTime") || c.Wf,
        width: $d(b, "width", he) || c.width,
        height: $d(b, "height", he) || c.height,
        contentType: a,
        mimeType: l,
        codecs: m,
        frameRate: n,
        pixelAspectRatio: r,
        emsgSchemeIdUris: u,
        id: f || e,
        originalId: e,
        language: b.attributes.lang,
        Pf: w,
        audioSamplingRate: v,
        zb: A,
        zf: null,
        eg: C || c.eg,
        label: D || null,
        encrypted: false
      };
    }
    function yx(a, b) {
      b = b.slice();
      a = t(a);
      for (var c = a.next(); !c.done; c = a.next()) c = c.value.attributes.schemeIdUri, b.includes(c) || b.push(c);
      return b;
    }
    function zx(a) {
      a = t(a);
      for (var b = a.next(); !b.done; b = a.next()) {
        b = b.value;
        var c = b.attributes.schemeIdUri;
        if (c && (b = b.attributes.value)) switch (c) {
          case "urn:mpeg:dash:outputChannelPositionList:2012":
            return b.trim().split(/ +/).length;
          case "urn:mpeg:dash:23003:3:audio_channel_configuration:2011":
          case "urn:dts:dash:audio_channel_configuration:2012":
            b = parseInt(b, 10);
            if (!b) continue;
            return b;
          case "tag:dolby.com,2015:dash:audio_channel_configuration:2015":
            c = [2, 1, 2, 2, 2, 2, 1, 2, 2, 1, 1, 1, 1, 2, 1, 1, 2, 2];
            b = parseInt(
              b,
              16
            );
            if (!b) continue;
            for (var d = 0, e = 0; e < c.length; e++) b & 1 << e && (d += c[e]);
            if (d) return d;
            continue;
          case "tag:dolby.com,2014:dash:audio_channel_configuration:2011":
          case "urn:dolby:dash:audio_channel_configuration:2011":
            c = [1, 1, 1, 1, 1, 2, 2, 1, 1, 2, 2, 2, 1, 2, 1, 1].reverse();
            b = parseInt(b, 16);
            if (!b) continue;
            for (e = d = 0; e < c.length; e++) b & 1 << e && (d += c[e]);
            if (d) return d;
            continue;
          case "urn:mpeg:mpegB:cicp:ChannelConfiguration":
            if (c = [0, 1, 2, 3, 4, 5, 6, 8, 2, 3, 4, 7, 8, 24, 8, 12, 10, 12, 14, 12, 14], (b = parseInt(b, 10)) && b > 0 && b < c.length) return c[b];
        }
      }
      return null;
    }
    function vx(a) {
      var b = a.Ud ? 1 : 0;
      b += a.Fc ? 1 : 0;
      b += a.Tc ? 1 : 0;
      if (b == 0) return a.contentType == tc || a.contentType == "application" ? true : false;
      b != 1 && (a.Ud && (a.Fc = null), a.Tc = null);
      return true;
    }
    function Ax(a, b, c, d) {
      var e, f, g, h, k2, l, m;
      return P(function(n) {
        if (n.g == 1) return e = [dc(c)], f = nc(b(), e), g = ah(f, a.g.retryParameters), g.method = d, h = a.j.networkingEngine.request(4, g, { isPreload: a.ea() }), Vg(a.P, h), G(n, h.promise, 2);
        k2 = n.h;
        if (d == "HEAD") {
          if (!k2.headers || !k2.headers.date) return n.return(0);
          l = k2.headers.date;
        } else l = Xb(k2.data);
        m = Date.parse(l);
        return isNaN(m) ? n.return(0) : n.return(m - Date.now());
      });
    }
    function fx(a, b, c) {
      var d, e, f, g, h, k2, l, m;
      return P(function(n) {
        switch (n.g) {
          case 1:
            d = c.map(function(q) {
              return { scheme: q.attributes.schemeIdUri, value: q.attributes.value };
            }), e = a.g.dash.clockSyncUri, !d.length && e && d.push({ scheme: "urn:mpeg:dash:utc:http-head:2014", value: e }), f = t(d), g = f.next();
          case 2:
            if (g.done) {
              n.B(4);
              break;
            }
            h = g.value;
            sa(n, 5);
            k2 = h.scheme;
            l = h.value;
            switch (k2) {
              case "urn:mpeg:dash:utc:http-head:2014":
              case "urn:mpeg:dash:utc:http-head:2012":
                return n.B(7);
              case "urn:mpeg:dash:utc:http-xsdate:2014":
              case "urn:mpeg:dash:utc:http-iso:2014":
              case "urn:mpeg:dash:utc:http-xsdate:2012":
              case "urn:mpeg:dash:utc:http-iso:2012":
                return n.B(8);
              case "urn:mpeg:dash:utc:direct:2014":
              case "urn:mpeg:dash:utc:direct:2012":
                return m = Date.parse(l), n.return(isNaN(m) ? 0 : m - Date.now());
              case "urn:mpeg:dash:utc:http-ntp:2014":
              case "urn:mpeg:dash:utc:ntp:2014":
              case "urn:mpeg:dash:utc:sntp:2014":
                bb("NTP UTCTiming scheme is not supported");
                break;
              default:
                bb("Unrecognized scheme in UTCTiming element", k2);
            }
            n.B(9);
            break;
          case 7:
            return G(n, Ax(a, b, l, "HEAD"), 10);
          case 10:
            return n.return(n.h);
          case 8:
            return G(n, Ax(a, b, l, "GET"), 11);
          case 11:
            return n.return(n.h);
          case 9:
            ua(
              n,
              3
            );
            break;
          case 5:
            va(n);
          case 3:
            g = f.next();
            n.B(2);
            break;
          case 4:
            return bb("A UTCTiming element should always be given in live manifests! This content may not play on clients with bad clocks!"), n.return(0);
        }
      });
    }
    function px(a, b, c, d, e) {
      var f = d.attributes.schemeIdUri || "", g = d.attributes.value || "", h = $d(d, "timescale", he) || 1, k2 = $d(d, "presentationTimeOffset", he) || 0;
      d = t(Sd(d, "Event"));
      for (var l = d.next(); !l.done; l = d.next()) {
        l = l.value;
        var m = $d(l, "presentationTime", he) || 0, n = $d(l, "duration", he) || 0;
        m = Math.max((m - k2) / h + b, b);
        n = m + n / h;
        c != null && (m = Math.min(m, b + c), n = Math.min(n, b + c));
        n < e || (l = { schemeIdUri: f, value: g, startTime: m, endTime: n, id: l.attributes.id || "", timescale: h, eventElement: qe(l), eventNode: re(l) }, a.j.onTimelineRegionAdded(l));
      }
    }
    function mx(a, b, c, d, e) {
      var f, g, h, k2;
      return P(function(l) {
        if (l.g == 1) return f = gh, g = e ? 0 : 1, h = Jm(b, c, d, a.g.retryParameters), G(l, Yw(a, h, f, { type: g }), 2);
        k2 = l.h;
        return l.return(k2.data);
      });
    }
    function ux(a, b) {
      b = ef(a, b);
      return vf(b) ? tc : a.split("/")[0];
    }
    function Yw(a, b, c, d) {
      d || (d = {});
      d.isPreload = a.ea();
      b = a.j.networkingEngine.request(c, b, d);
      Vg(a.P, b);
      return b.promise;
    }
    function Xw(a) {
      var b = a.l.Ae;
      if (!a.l.Mf || !b || !a.H.length) return [];
      var c = Date.now() / 1e3, d = a.H.filter(function(e) {
        e = he(e.attributes.ttl);
        return !e || b + e > c;
      }).map(Ud).filter(Ff);
      return d.length ? nc(a.C, d) : [];
    }
    S("shaka.dash.DashParser", Tw);
    Gi("application/dash+xml", function() {
      return new Tw();
    });
    Gi("video/vnd.mpeg.dash.mpd", function() {
      return new Tw();
    });
    function Bx() {
    }
    S("shaka.dependencies", Bx);
    Bx.has = function(a) {
      return Cx.has(a);
    };
    Bx.add = function(a, b) {
      if (!Dx[a]) throw Error(a + " is not supported");
      a == Ex ? Wc("mux.js", "mux.js is no longer used in Shaka Player.") : Cx.set(a, function() {
        return b;
      });
    };
    var Ex = "muxjs", Dx = { Sn: Ex, ISOBoxer: "ISOBoxer" };
    Bx.Allowed = Dx;
    var Cx = /* @__PURE__ */ new Map([["ISOBoxer", function() {
      return window2.ISOBoxer;
    }]]);
    function Fx() {
      this.j = new Rb(function() {
        return ["Oculus", "Quest"].some(function(a) {
          return navigator.userAgent.includes(a.toLowerCase());
        }) ? "VR" : navigator.userAgent.match(/Smart( ?|_)TV/i) || navigator.userAgent.match(/Android ?TV/i) ? "TV" : navigator.userAgentData ? navigator.userAgentData.mobile ? "MOBILE" : "DESKTOP" : /(?:iPhone|iPad|iPod)/.test(navigator.userAgent) ? "MOBILE" : navigator.userAgentData && navigator.userAgentData.platform ? navigator.userAgentData.platform.toLowerCase() == "android" ? "MOBILE" : "DESKTOP" : navigator.userAgent.includes("Android") ? "MOBILE" : "DESKTOP";
      });
      this.l = new Rb(function() {
        return navigator.vendor.includes("Apple") && (navigator.userAgent.includes("Version/") || navigator.userAgent.includes("OS/")) ? "WEBKIT" : navigator.userAgent.includes("Edge/") ? "EDGE" : navigator.userAgent.includes("Chrome/") ? "CHROMIUM" : navigator.userAgent.includes("Firefox/") ? "GECKO" : "UNKNOWN";
      });
    }
    function Ji() {
      var a = window2.ManagedMediaSource || window2.MediaSource;
      return a && a.isTypeSupported ? true : false;
    }
    p = Fx.prototype;
    p.mc = function() {
      return !!navigator.mediaCapabilities;
    };
    p.Ka = function() {
      return this.j.value();
    };
    p.Ga = function() {
      return this.l.value();
    };
    p.Rd = function() {
      return false;
    };
    p.yj = function() {
      return false;
    };
    p.Af = function() {
      return false;
    };
    p.zj = function() {
      return false;
    };
    p.Ce = function() {
      return false;
    };
    p.td = function() {
      return true;
    };
    p.ud = function() {
      return true;
    };
    p.He = function() {
      return true;
    };
    p.Ej = function() {
      return 0;
    };
    p.tc = function() {
      return Promise.resolve({ width: Infinity, height: Infinity });
    };
    p.Qj = function() {
      return false;
    };
    p.ki = function() {
      return false;
    };
    p.bb = function(a) {
      var b = this.Ka();
      if (b === "TV" || b === "CONSOLE" || b === "CAST") a.ads.customPlayheadTracker = true, a.ads.skipPlayDetection = true, a.ads.supportsMultipleMediaElements = false;
      return a;
    };
    p.oi = function() {
      return !!window2.indexedDB;
    };
    p.wj = function() {
      return [];
    };
    function Tn(a) {
      Sb();
      return window2.matchMedia !== void 0 && window2.matchMedia("(color-gamut: p3)").matches ? a ? "HLG" : "PQ" : "SDR";
    }
    p.kg = function() {
      return false;
    };
    p.mj = function() {
      return false;
    };
    p.Yh = function() {
      return false;
    };
    p.lg = function() {
      return true;
    };
    p.nj = function() {
      return false;
    };
    p.Yj = function() {
      return true;
    };
    p.sd = function() {
      return false;
    };
    p.Kh = function(a) {
      return a === "com.apple.fps";
    };
    p.toString = function() {
      return "Device: " + this.Ub() + " v" + this.Fa() + "; Type: " + this.Ka();
    };
    function Gx() {
      Fx.call(this);
      this.g = new Rb(function() {
        var a = navigator.userAgent.match(/Version\/(\d+)/);
        return a ? parseInt(a[1], 10) : (a = navigator.userAgent.match(/OS (\d+)(?:_\d+)?/)) ? parseInt(a[1], 10) : null;
      });
      this.h = new Rb(function() {
        return /(?:iPhone|iPad|iPod)/.test(navigator.userAgent) || navigator.maxTouchPoints > 1 ? "xr" in navigator ? "APPLE_VR" : "MOBILE" : "xr" in navigator ? "APPLE_VR" : "DESKTOP";
      });
    }
    ma(Gx, Fx);
    p = Gx.prototype;
    p.Fa = function() {
      return this.g.value();
    };
    p.Ub = function() {
      return "Apple Browser";
    };
    p.Ka = function() {
      return this.h.value();
    };
    p.Ga = function() {
      return "WEBKIT";
    };
    p.mc = function() {
      return false;
    };
    p.Rd = function(a, b) {
      return b === "audio";
    };
    p.Af = function() {
      return true;
    };
    p.zj = function(a) {
      return a === "audio";
    };
    p.bb = function(a) {
      Fx.prototype.bb.call(this, a);
      a.abr.minTimeToSwitch = 0.5;
      return a;
    };
    p.kg = function() {
      return true;
    };
    (navigator.vendor || "").includes("Apple") && (/(?:iPhone|iPad|iPod)/.test(navigator.userAgent) || navigator.maxTouchPoints > 1 || navigator.userAgentData && navigator.userAgentData.platform && navigator.userAgentData.platform.toLowerCase() == "macos" || navigator.platform && navigator.platform.toLowerCase().includes("mac")) && (Ub = function() {
      return new Gx();
    });
    function Hx() {
      if (!Ix()) throw Error("Not a Chromecast device!");
      Fx.call(this);
      this.h = new Rb(function() {
        var a = navigator.userAgent.match(/Chrome\/(\d+)/);
        return a ? parseInt(a[1], 10) : null;
      });
      this.g = new Rb(function() {
        var a = navigator.userAgentData && navigator.userAgentData.platform || navigator.userAgent;
        a = a.toLowerCase();
        return a.includes("android") ? Jx : a.includes("fuchsia") ? Kx : Lx;
      });
    }
    ma(Hx, Fx);
    p = Hx.prototype;
    p.Fa = function() {
      return this.h.value();
    };
    p.Ub = function() {
      return "Chromecast with " + this.g.value();
    };
    p.Ka = function() {
      return "CAST";
    };
    p.Ga = function() {
      return "CHROMIUM";
    };
    p.mc = function() {
      return Fx.prototype.mc.call(this) && this.g.value() !== Lx;
    };
    p.ud = function() {
      return this.g.value() !== Lx;
    };
    p.Ej = function() {
      switch (this.g.value()) {
        case Jx:
          return 0;
        case Kx:
          return 3;
        default:
          return 1;
      }
    };
    p.tc = function() {
      var a, b, c, d, e;
      return P(function(f) {
        switch (f.g) {
          case 1:
            a = window2.cast && cast.__platform__ && cast.__platform__.canDisplayType;
            b = { width: 1280, height: 720 };
            sa(f, 2);
            if (!(c = a)) {
              f.B(4);
              break;
            }
            return G(f, cast.__platform__.canDisplayType('video/mp4; codecs="avc1.640028"; width=3840; height=2160'), 5);
          case 5:
            c = f.h;
          case 4:
            if (c) {
              b.width = 3840;
              b.height = 2160;
              f.B(6);
              break;
            }
            if (!(d = a)) {
              f.B(7);
              break;
            }
            return G(f, cast.__platform__.canDisplayType('video/mp4; codecs="avc1.640028"; width=1920; height=1080'), 8);
          case 8:
            d = f.h;
          case 7:
            d && (b.width = 1920, b.height = 1080);
          case 6:
            ua(f, 3);
            break;
          case 2:
            e = va(f), ab("Failed to check canDisplayType:", e);
          case 3:
            return f.return(b);
        }
      });
    };
    p.bb = function(a) {
      Fx.prototype.bb.call(this, a);
      a.streaming.stallSkip = 0;
      return a;
    };
    p.oi = function() {
      return false;
    };
    p.sd = function() {
      return true;
    };
    function Ix() {
      return navigator.userAgent.includes("CrKey") && !navigator.userAgent.includes("VIZIO SmartCast");
    }
    var Jx = "Android", Kx = "Fuchsia", Lx = "Linux";
    Ix() && (Ub = function() {
      return new Hx();
    });
    function Mx() {
      Fx.call(this);
      var a = this;
      this.i = new Rb(function() {
        var b = navigator.userAgent.match(/(Chrome|Firefox)\/(\d+)/);
        return b ? parseInt(b[2], 10) : null;
      });
      this.g = new Rb(function() {
        return navigator.userAgent.match(/Edge?\//) ? "Edge" : navigator.userAgent.includes("Chrome") ? "Chrome" : navigator.userAgent.includes("Firefox") ? "Firefox" : "Unknown";
      });
      this.h = new Rb(function() {
        return navigator.userAgentData && navigator.userAgentData.platform ? navigator.userAgentData.platform.toLowerCase() == "windows" : navigator.platform ? navigator.platform.toLowerCase().includes("win32") : false;
      });
      this.A = new Rb(function() {
        return navigator.userAgent.match(/Edge?\//) ? !a.h.value() : true;
      });
      this.u = new Rb(function() {
        return navigator.userAgent.includes("sony.hbbtv.tv");
      });
      this.m = new Rb(function() {
        return navigator.userAgentData && navigator.userAgentData.platform ? navigator.userAgentData.platform.toLowerCase() == "android" : navigator.userAgent.includes("Android") ? true : false;
      });
    }
    ma(Mx, Fx);
    p = Mx.prototype;
    p.Fa = function() {
      return this.i.value();
    };
    p.Ub = function() {
      return this.g.value();
    };
    p.Rd = function(a) {
      return Bg(a) ? this.g.value() === "Edge" && this.h.value() : false;
    };
    p.yj = function() {
      return this.g.value() === "Edge" && this.h.value();
    };
    p.Af = function() {
      return this.g.value() === "Edge" && this.h.value();
    };
    p.ud = function() {
      return this.A.value();
    };
    p.bb = function(a) {
      Fx.prototype.bb.call(this, a);
      if (this.h.value()) switch (this.g.value()) {
        case "Firefox":
          a.drm.keySystemsMapping = { "com.microsoft.playready": "com.microsoft.playready.recommendation" };
          break;
        case "Chrome":
          a.drm.keySystemsMapping = { "com.microsoft.playready": "com.microsoft.playready.recommendation.3000", "com.microsoft.playready.recommendation": "com.microsoft.playready.recommendation.3000" };
      }
      this.m.value() && (a.drm.defaultAudioRobustnessForWidevine = "", a.drm.defaultVideoRobustnessForWidevine = "");
      return a;
    };
    p.Yh = function() {
      return this.g.value() === "Edge" || this.u.value();
    };
    p.sd = function() {
      if (this.Ga() === "GECKO") {
        var a = this.Fa();
        return a !== null ? a >= 100 : Fx.prototype.sd.call(this);
      }
      return Fx.prototype.sd.call(this);
    };
    p.Kh = function(a) {
      return this.Ga() === "GECKO" ? a.startsWith("com.microsoft.playready.recommendation") : Fx.prototype.Kh.call(this, a);
    };
    Vb = function() {
      return new Mx();
    };
    function Nx() {
      Fx.apply(this, arguments);
    }
    ma(Nx, Fx);
    p = Nx.prototype;
    p.Fa = function() {
      return null;
    };
    p.Ub = function() {
      return "Hisense";
    };
    p.Ka = function() {
      return "TV";
    };
    p.mc = function() {
      return false;
    };
    p.tc = function() {
      var a = { width: 1920, height: 1080 }, b = null;
      if (window2.Hisense_Get4KSupportState) try {
        b = window2.Hisense_Get4KSupportState();
      } catch (c) {
      }
      b == null && (b = navigator.userAgent.includes("UHD"));
      b && (a.width = 3840, a.height = 2160);
      return Promise.resolve(a);
    };
    p.bb = function(a) {
      Fx.prototype.bb.call(this, a);
      a.streaming.stallSkip = 0;
      return a;
    };
    if (navigator.userAgent.includes("Hisense") || navigator.userAgent.includes("VIDAA")) Ub = function() {
      return new Nx();
    };
    function Ox() {
      Fx.call(this);
      this.g = new Rb(function() {
        var a = navigator.userAgent.match(/PlayStation (\d+)/);
        return a ? parseInt(a[1], 10) : null;
      });
    }
    ma(Ox, Fx);
    p = Ox.prototype;
    p.Ub = function() {
      return "PlayStation";
    };
    p.Ka = function() {
      return "CONSOLE";
    };
    p.Ga = function() {
      return "WEBKIT";
    };
    p.Fa = function() {
      return this.g.value();
    };
    p.mc = function() {
      return false;
    };
    p.td = function() {
      return false;
    };
    p.ud = function() {
      return false;
    };
    p.ki = function() {
      return this.Fa() === 4;
    };
    p.tc = function() {
      var a, b, c, d, e;
      return P(function(f) {
        switch (f.g) {
          case 1:
            return a = { width: 1920, height: 1080 }, b = false, sa(f, 2), G(f, window2.msdk.device.getDisplayInfo(), 4);
          case 4:
            c = f.h;
            b = c.resolution === "4K";
            ua(f, 3);
            break;
          case 2:
            return va(f), sa(f, 5), G(f, window2.msdk.device.getDisplayInfoImmediate(), 7);
          case 7:
            d = f.h;
            b = d.resolution === "4K";
            ua(f, 3);
            break;
          case 5:
            e = va(f), bb("PlayStation: Failed to get the display info:", e);
          case 3:
            return b && (a.width = 3840, a.height = 2160), f.return(a);
        }
      });
    };
    p.bb = function(a) {
      Fx.prototype.bb.call(this, a);
      this.Fa() === 4 && a.drm.preferredKeySystems.push("com.microsoft.playready");
      a.streaming.clearDecodingCache = true;
      return a;
    };
    p.Yh = function() {
      return this.Fa() === 4;
    };
    p.lg = function() {
      return this.Fa() !== 4;
    };
    navigator.userAgent.includes("PlayStation") && (Ub = function() {
      return new Ox();
    });
    function Px() {
      Fx.call(this);
      var a = navigator.userAgent.match(/Tizen (\d+).(\d+)/);
      this.g = a ? parseInt(a[1], 10) : null;
      this.h = a ? parseInt(a[2], 10) : null;
    }
    ma(Px, Fx);
    p = Px.prototype;
    p.Fa = function() {
      return this.g;
    };
    p.Ub = function() {
      return "Tizen";
    };
    p.Ga = function() {
      return "CHROMIUM";
    };
    p.Ka = function() {
      return "TV";
    };
    p.Rd = function() {
      return true;
    };
    p.Ce = function() {
      return this.Fa() === 3;
    };
    p.mc = function() {
      return false;
    };
    p.td = function() {
      var a = this.Fa();
      return a !== null ? a >= 4 : Fx.prototype.td.call(this);
    };
    p.ud = function() {
      return false;
    };
    p.He = function() {
      return this.g && this.h ? this.g === 5 ? this.h >= 5 : this.g > 5 : Fx.prototype.He.call(this);
    };
    p.tc = function() {
      var a = window2.devicePixelRatio;
      a = { width: window2.screen.width * a > 1920 ? 3840 : 1920, height: window2.screen.height * a > 1080 ? 2160 : 1080 };
      try {
        if (webapis.systeminfo && webapis.systeminfo.getMaxVideoResolution) {
          var b = webapis.systeminfo.getMaxVideoResolution();
          a.width = b.width;
          a.height = b.height;
        } else webapis.productinfo.is8KPanelSupported && webapis.productinfo.is8KPanelSupported() ? (a.width = 7680, a.height = 4320) : webapis.productinfo.isUdPanelSupported && webapis.productinfo.isUdPanelSupported() && (a.width = 3840, a.height = 2160);
      } catch (c) {
        bb("Tizen: Error detecting screen size, default screen size 1920x1080.");
      }
      return Promise.resolve(a);
    };
    p.bb = function(a) {
      Fx.prototype.bb.call(this, a);
      a.drm.ignoreDuplicateInitData = this.Fa() !== 2;
      this.Fa() === 3 && (a.streaming.crossBoundaryStrategy = "reset_to_encrypted");
      a.streaming.shouldFixTimestampOffset = true;
      a.streaming.stallSkip = 0;
      a.streaming.gapPadding = 2;
      return a;
    };
    p.wj = function() {
      var a = [];
      this.g !== null && this.g < 5 && a.push("opus");
      return a;
    };
    p.mj = function() {
      return true;
    };
    p.nj = function() {
      return this.Fa() === 3;
    };
    navigator.userAgent.includes("Tizen") && (Ub = function() {
      return new Px();
    });
    function Qx() {
      Fx.apply(this, arguments);
    }
    ma(Qx, Fx);
    Qx.prototype.Fa = function() {
      return null;
    };
    Qx.prototype.Ub = function() {
      return "Vizio";
    };
    Qx.prototype.Ka = function() {
      return "TV";
    };
    Qx.prototype.mc = function() {
      return false;
    };
    navigator.userAgent.includes("VIZIO SmartCast") && (Ub = function() {
      return new Qx();
    });
    function Rx() {
      Fx.call(this);
      this.i = new Rb(function() {
        return navigator.userAgent.includes("DT_STB_BCM") || navigator.userAgent.includes("Sky_STB");
      });
      this.h = new Rb(function() {
        return navigator.userAgent.includes("SOPOpenBrowser");
      });
      this.g = new Rb(function() {
        if (navigator.userAgent.includes("DT_STB_BCM")) return 11;
        var a = navigator.userAgent.match(/Version\/(\d+)/);
        return a ? parseInt(a[1], 10) : (a = navigator.userAgent.match(/OS (\d+)(?:_\d+)?/)) ? parseInt(a[1], 10) : null;
      });
    }
    ma(Rx, Fx);
    p = Rx.prototype;
    p.Fa = function() {
      return this.g.value();
    };
    p.Ub = function() {
      return "WebKit STB";
    };
    p.Ka = function() {
      return "TV";
    };
    p.Ga = function() {
      return "WEBKIT";
    };
    p.mc = function() {
      return false;
    };
    p.td = function() {
      var a = this.g.value();
      return a !== null ? a >= 15 : true;
    };
    p.Rd = function() {
      return this.h.value();
    };
    p.tc = function() {
      return Promise.resolve({ width: window2.screen.width * window2.devicePixelRatio, height: window2.screen.height * window2.devicePixelRatio });
    };
    p.lg = function() {
      return !this.i.value();
    };
    if (navigator.userAgent.includes("SOPOpenBrowser") || navigator.userAgent.includes("DT_STB_BCM") || navigator.userAgent.includes("Sky_STB") || !(!(navigator.vendor || "").includes("Apple") || /(?:iPhone|iPad|iPod)/.test(navigator.userAgent) || navigator.maxTouchPoints > 1 || navigator.userAgentData && navigator.userAgentData.platform && navigator.userAgentData.platform.toLowerCase() == "macos" || navigator.platform && navigator.platform.toLowerCase().includes("mac"))) Ub = function() {
      return new Rx();
    };
    function Sx() {
      Fx.call(this);
      this.g = Tx();
    }
    ma(Sx, Fx);
    p = Sx.prototype;
    p.Fa = function() {
      return this.g;
    };
    p.Ub = function() {
      return "WebOS";
    };
    p.Ka = function() {
      return "TV";
    };
    p.Ga = function() {
      return "CHROMIUM";
    };
    p.mc = function() {
      return false;
    };
    p.td = function() {
      var a = this.Fa();
      return a !== null ? a > 3 : Fx.prototype.td.call(this);
    };
    p.ud = function() {
      var a = this.Fa();
      return a !== null ? a > 6 : Fx.prototype.ud.call(this);
    };
    p.He = function() {
      var a = this.Fa();
      return a !== null ? a > 3 : Fx.prototype.He.call(this);
    };
    p.tc = function() {
      var a = { width: 1920, height: 1080 };
      try {
        var b = JSON.parse(window2.PalmSystem.deviceInfo);
        a.width = Math.max(1920, b.screenWidth);
        a.height = Math.max(1080, b.screenHeight);
      } catch (c) {
        bb("WebOS: Error detecting screen size, default screen size 1920x1080.");
      }
      return Promise.resolve(a);
    };
    p.bb = function(a) {
      Fx.prototype.bb.call(this, a);
      this.Fa() === 3 && (a.streaming.crossBoundaryStrategy = "reset");
      a.streaming.shouldFixTimestampOffset = true;
      a.streaming.stallSkip = 0;
      return a;
    };
    function Tx() {
      var a = null, b = navigator.userAgent.match(/Chrome\/(\d+)/);
      b && (a = parseInt(b[1], 10));
      switch (a) {
        case 38:
          return 3;
        case 53:
          return 4;
        case 68:
          return 5;
        case 79:
          return 6;
        case 87:
          return 22;
        case 94:
          return 23;
        case 108:
          return 24;
        case 120:
          return 25;
        default:
          return null;
      }
    }
    p.Yj = function() {
      return false;
    };
    p.sd = function() {
      var a = this.Fa();
      return a !== null ? a >= 6 : Fx.prototype.sd.call(this);
    };
    navigator.userAgent.includes("Web0S") && (Ub = function() {
      return new Sx();
    });
    function Ux() {
      Fx.call(this);
      this.g = navigator.userAgent.includes("Edge/");
      var a = navigator.userAgent.match(/Edge?\/(\d+)/);
      this.h = a ? parseInt(a[1], 10) : null;
    }
    ma(Ux, Fx);
    p = Ux.prototype;
    p.Fa = function() {
      return this.h;
    };
    p.Ub = function() {
      return "Xbox";
    };
    p.Ka = function() {
      return "CONSOLE";
    };
    p.Ga = function() {
      return this.g ? "EDGE" : "CHROMIUM";
    };
    p.Rd = function() {
      return true;
    };
    p.Af = function() {
      return true;
    };
    p.Qj = function() {
      return this.g;
    };
    p.tc = function() {
      var a = { width: 1920, height: 1080 }, b = Vx();
      if (b) try {
        var c = new b.Media.Protection.ProtectionCapabilities(), d = b.Media.Protection.ProtectionCapabilityResult;
        b = null;
        do
          b = c.isTypeSupported('video/mp4;codecs="hvc1,mp4a";features="decode-res-x=3840,decode-res-y=2160,decode-bitrate=20000,decode-fps=30,decode-bpc=10,display-res-x=3840,display-res-y=2160,display-bpc=8"', "com.microsoft.playready.recommendation");
        while (b === d.maybe);
        b === d.probably && (a.width = 3840, a.height = 2160);
      } catch (e) {
        bb("Xbox: Error detecting screen size, default screen size 1920x1080.");
      }
      return Promise.resolve(a);
    };
    p.bb = function(a) {
      Fx.prototype.bb.call(this, a);
      a.drm.parseInbandPsshEnabled = this.g;
      a.drm.preferredKeySystems.push("com.microsoft.playready");
      this.g && (a.streaming.gapPadding = 0.01);
      return a;
    };
    p.oi = function() {
      return false;
    };
    function Vx() {
      var a = null;
      try {
        a = typeof Windows !== "undefined" ? Windows : chrome.webview.hostObjects.sync.Windows;
      } catch (b) {
      }
      return a;
    }
    if (navigator.userAgent.includes("Xbox One") || Vx() !== null) Ub = function() {
      return new Ux();
    };
    function Wx(a, b, c) {
      this.type = a;
      this.ma = b;
      this.segments = c || null;
    }
    function Xx(a, b, c, d) {
      this.id = a;
      this.name = b;
      this.attributes = c;
      this.value = d === void 0 ? null : d;
    }
    Xx.prototype.toString = function(a) {
      function b(e) {
        return e.name + "=" + (isNaN(Number(e.value)) ? '"' + e.value + '"' : e.value);
      }
      var c = "#" + this.name, d = this.attributes ? this.attributes.filter(function(e) {
        return a ? !a.has(e.name) : true;
      }).map(b) : [];
      this.value && d.unshift(this.value);
      d.length > 0 && (c += ":" + d.join(","));
      return c;
    };
    function Yx(a, b) {
      if (b) return a.toString();
      b = (/* @__PURE__ */ new Set()).add("AUDIO").add("VIDEO").add("SUBTITLES").add("PATHWAY-ID").add("GROUP-ID").add("URI");
      return a.toString(b);
    }
    function Zx(a, b) {
      a = a.attributes.filter(function(c) {
        return c.name == b;
      });
      return a.length ? a[0] : null;
    }
    function $x(a, b, c) {
      return (a = Zx(a, b)) ? a.value : c || null;
    }
    function ay(a, b) {
      a = Zx(a, b);
      if (!a) throw new U(2, 4, 4023, b);
      return a.value;
    }
    function by(a, b, c) {
      c = c === void 0 ? [] : c;
      this.ma = b;
      this.g = a;
      this.Cc = c;
    }
    function cy(a, b) {
      this.name = a;
      this.value = b;
    }
    ;
    function dy(a, b) {
      return a.filter(function(c) {
        return c.name == b;
      });
    }
    function ey(a, b) {
      return a.filter(function(c) {
        return ay(c, "TYPE") == b;
      });
    }
    function fy(a, b) {
      a = t(a);
      for (var c = a.next(); !c.done; c = a.next()) if (c = c.value, c.name === b) return c;
      return null;
    }
    function gy(a, b, c) {
      c = c === void 0 ? 0 : c;
      return (a = fy(a, b)) ? Number(a.value) : c;
    }
    function hy(a, b, c) {
      return b ? iy(a, [b], c) : [];
    }
    function iy(a, b, c) {
      if (!b.length) return [];
      var d = b;
      c && c.size && (d = b.map(function(e) {
        return jy(e, c);
      }));
      return nc(a, d);
    }
    function jy(a, b) {
      if (!b || !b.size) return a;
      a = String(a).replace(/%7B/g, "{").replace(/%7D/g, "}");
      var c = a.match(/{\$\w*}/g);
      if (c) {
        c = t(c);
        for (var d = c.next(); !d.done; d = c.next()) {
          d = d.value;
          var e = d.slice(2, d.length - 1), f = b.get(e);
          if (f) a = a.replace(d, f);
          else throw new U(2, 4, 4039, e);
        }
      }
      return a;
    }
    ;
    function ky() {
      this.g = 0;
    }
    function ly(a, b) {
      b = Xb(b);
      b = b.replace(/\r\n|\r(?=[^\n]|$)/gm, "\n").trim();
      var c = b.split(/\n+/m);
      if (!/^#EXTM3U($|[ \t\n])/m.test(c[0])) throw new U(2, 4, 4015);
      b = 0;
      for (var d = true, e = t(c), f = e.next(); !f.done; f = e.next()) if (f = f.value, /^#(?!EXT)/m.test(f) || d) d = false;
      else if (f = my(a, f), --a.g, ny.includes(f.name)) {
        b = 1;
        break;
      } else f.name == "EXT-X-STREAM-INF" && (d = true);
      e = [];
      d = true;
      for (f = 0; f < c.length; f++) {
        var g = c[f], h = c[f + 1];
        if (/^#(?!EXT)/m.test(g) || d) d = false;
        else {
          g = my(a, g);
          if (oy.includes(g.name)) {
            if (b != 1) throw new U(2, 4, 4017);
            g = c.splice(f, c.length - f);
            c = [];
            d = [];
            f = [];
            h = null;
            g = t(g);
            for (var k2 = g.next(); !k2.done; k2 = g.next()) k2 = k2.value, /^(#EXT)/.test(k2) ? (k2 = my(a, k2), ny.includes(k2.name) ? e.push(k2) : k2.name == "EXT-X-MAP" ? h = k2 : k2.name == "EXT-X-PART" ? f.push(k2) : k2.name == "EXT-X-PRELOAD-HINT" ? $x(k2, "TYPE") == "PART" ? f.push(k2) : $x(k2, "TYPE") == "MAP" && (k2.name = "EXT-X-MAP", h = k2) : d.push(k2)) : /^#(?!EXT)/m.test(k2) || (k2 = k2.trim(), h && d.push(h), c.push(new by(k2, d, f)), d = [], f = []);
            f.length && (h && d.push(h), c.push(new by("", d, f)));
            return new Wx(b, e, c);
          }
          e.push(g);
          g.name == "EXT-X-STREAM-INF" && (g.attributes.push(new cy("URI", h)), d = true);
        }
      }
      return new Wx(b, e);
    }
    function my(a, b) {
      a = a.g++;
      var c = b.match(/^#(EXT[^:]*)(?::(.*))?$/);
      if (!c) throw new U(2, 4, 4016, b);
      b = c[1];
      var d = c[2];
      c = [];
      var e;
      if (d) {
        d = new xd(d);
        var f;
        (f = zd(d, /^([^,=]+)(?:,|$)/g)) && (e = f[1]);
        for (var g = /([^=]+)=(?:"([^"]*)"|([^",]*))(?:,|$)/g; f = zd(d, g); ) c.push(new cy(f[1], f[2] || f[3])), yd(d);
      }
      return new Xx(a, b, c, e);
    }
    var ny = "EXT-X-TARGETDURATION EXT-X-MEDIA-SEQUENCE EXT-X-DISCONTINUITY-SEQUENCE EXT-X-PLAYLIST-TYPE EXT-X-I-FRAMES-ONLY EXT-X-ENDLIST EXT-X-SERVER-CONTROL EXT-X-SKIP EXT-X-PART-INF EXT-X-DATERANGE".split(" "), oy = "EXTINF EXT-X-BYTERANGE EXT-X-DISCONTINUITY EXT-X-PROGRAM-DATE-TIME EXT-X-KEY EXT-X-DATERANGE EXT-X-MAP EXT-X-GAP EXT-X-TILES".split(" ");
    function py() {
    }
    function qy(a, b) {
      try {
        var c = ry(a);
        return Qg({ uri: a, originalUri: a, data: c.data, headers: { "content-type": c.contentType }, originalRequest: b });
      } catch (d) {
        return Og(d);
      }
    }
    function ry(a) {
      var b = a.split(":");
      if (b.length < 2 || b[0] != "data") throw new U(2, 1, 1004, a);
      b = b.slice(1).join(":").split(",");
      if (b.length < 2) throw new U(2, 1, 1004, a);
      var c = b[0];
      a = window2.decodeURIComponent(b.slice(1).join(","));
      b = c.split(";");
      c = b[0];
      var d = false;
      b.length > 1 && b[b.length - 1] == "base64" && (d = true, b.pop());
      var e;
      d ? e = jc(a) : e = ac(a);
      return { data: e, contentType: c };
    }
    S("shaka.net.DataUriPlugin", py);
    py.parse = qy;
    Xg("data", qy);
    function sy() {
      var a = this;
      this.g = this.h = null;
      this.H = 1;
      this.C = /* @__PURE__ */ new Map();
      this.K = /* @__PURE__ */ new Map();
      this.D = /* @__PURE__ */ new Map();
      this.D.set("video", /* @__PURE__ */ new Map());
      this.D.set("audio", /* @__PURE__ */ new Map());
      this.D.set(tc, /* @__PURE__ */ new Map());
      this.D.set("image", /* @__PURE__ */ new Map());
      this.jc = (/* @__PURE__ */ new Map()).set("com.apple.streamingkeydelivery", function(b, c, d) {
        return ty(a, b, c, d);
      }).set("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed", function(b) {
        var c = ay(b, "METHOD");
        if (["SAMPLE-AES", "SAMPLE-AES-CTR"].includes(c)) {
          var d = "cenc";
          c == "SAMPLE-AES" && (d = "cbcs");
          c = ay(b, "URI");
          c = ry(c.split("?")[0]);
          c = Lb(c.data);
          d = oc("com.widevine.alpha", d, [{ initDataType: "cenc", initData: c }]);
          (b = $x(b, "KEYID")) && d.keyIds.add(b.toLowerCase().substr(2));
          b = Promise.resolve(d);
        } else b = Promise.resolve(null);
        return b;
      }).set("com.microsoft.playready", function(b) {
        var c = ay(b, "METHOD");
        if (["SAMPLE-AES", "SAMPLE-AES-CTR"].includes(c)) {
          var d = "cenc";
          c == "SAMPLE-AES" && (d = "cbcs");
          b = ay(b, "URI");
          b = ry(b.split("?")[0]);
          b = Lb(b.data);
          c = new Uint8Array([154, 4, 240, 121, 152, 64, 66, 134, 171, 146, 230, 91, 224, 136, 95, 149]);
          c = Bh(b, c, /* @__PURE__ */ new Set(), 0);
          d = oc(
            "com.microsoft.playready",
            d,
            [{ initDataType: "cenc", initData: c }]
          );
          if (b = Ld(["<PLAYREADY>", ic(b), "</PLAYREADY>"].join("\n"))) d.licenseServerUri = bv(b);
          d = Promise.resolve(d);
        } else d = Promise.resolve(null);
        return d;
      }).set("urn:uuid:3d5e6d35-9b9a-41e8-b843-dd3c6e72c42c", function(b) {
        var c = ay(b, "METHOD");
        if (["SAMPLE-AES", "SAMPLE-AES-CTR"].includes(c)) {
          var d = "cenc";
          c == "SAMPLE-AES" && (d = "cbcs");
          c = ay(b, "URI");
          c = ry(c.split("?")[0]);
          c = Lb(c.data);
          d = oc("com.huawei.wiseplay", d, [{ initDataType: "cenc", initData: c }]);
          (b = $x(b, "KEYID")) && d.keyIds.add(b.toLowerCase().substr(2));
          b = Promise.resolve(d);
        } else b = Promise.resolve(null);
        return b;
      });
      this.Za = /* @__PURE__ */ new Set();
      this.i = /* @__PURE__ */ new Map();
      this.l = null;
      this.G = "";
      this.hb = new ky();
      this.L = -1;
      this.$ = Infinity;
      this.Z = this.Ec = this.Va = false;
      this.F = new Cf(function() {
        if (a.S && !a.g.continueLoadingWhenPaused && (a.R.Ea(a.S, "timeupdate"), a.S.paused)) {
          a.R.qa(a.S, "timeupdate", function() {
            return uy(a);
          });
          return;
        }
        uy(a);
      });
      this.va = vy;
      this.m = null;
      this.Oa = 0;
      this.u = Infinity;
      this.Ma = this.Ia = this.P = 0;
      this.V = new Ug();
      this.I = /* @__PURE__ */ new Map();
      this.J = /* @__PURE__ */ new Map();
      this.ua = /* @__PURE__ */ new Map();
      this.ea = /* @__PURE__ */ new Map();
      this.M = /* @__PURE__ */ new Map();
      this.oa = /* @__PURE__ */ new Map();
      this.sa = /* @__PURE__ */ new Map();
      this.kc = this.aa = false;
      this.fb = new Nc(5);
      this.j = null;
      this.O = true;
      this.R = new Qc();
      this.A = this.S = null;
      this.Ob = function() {
        return false;
      };
    }
    p = sy.prototype;
    p.configure = function(a, b) {
      var c = this.h && a.updatePeriod != this.g.updatePeriod && a.updatePeriod >= 0;
      this.g = a;
      b && (this.Ob = b);
      this.j && this.j.configure(this.g);
      c && this.m && this.m.presentationTimeline.U() && this.F.La();
    };
    p.start = function(a, b) {
      var c = this, d;
      return P(function(e) {
        return e.g == 1 ? (c.h = b, c.aa = b.isLowLatencyMode(), G(e, wy(c, [a]).promise, 2)) : e.g != 3 ? (d = e.h, c.G = d.uri, G(e, xy(c, d.data), 3)) : e.return(c.m);
      });
    };
    p.stop = function() {
      this.F && (this.F.stop(), this.F = null);
      var a = [];
      this.V && (a.push(this.V.destroy()), this.V = null);
      this.g = this.h = null;
      this.Za.clear();
      this.m = null;
      this.i.clear();
      this.K.clear();
      this.J.clear();
      this.C.clear();
      this.ua.clear();
      this.ea.clear();
      this.M.clear();
      this.oa.clear();
      this.sa.clear();
      this.j && this.j.destroy();
      this.R && (this.R.release(), this.R = null);
      return Promise.all(a);
    };
    p.update = function() {
      var a = this, b, c, d, e, f, g, h, k2, l, m, n, q;
      return P(function(r) {
        if (r.g == 1) {
          if (!yy(a)) return r.return();
          b = [];
          c = Array.from(a.i.values());
          a.u = Infinity;
          a.m.gapCount = 0;
          d = c.filter(function(u) {
            return u.stream.segmentIndex;
          });
          e = t(d);
          for (f = e.next(); !f.done; f = e.next()) g = f.value, b.push(zy(a, g));
          return G(r, Promise.all(b), 2);
        }
        Ay(a, d.map(function(u) {
          return u.stream;
        }));
        h = d.some(function(u) {
          return u.me == 0;
        });
        d.length && !h && (k2 = By, Cy(a, k2.ik), l = d.map(function(u) {
          return u.zc;
        }), a.l.yb(Math.min.apply(Math, x(l))), a.h.updateDuration());
        h && Dy(a);
        m = t(d);
        for (n = m.next(); !n.done; n = m.next()) q = n.value, q.stream.isAudioMuxedInVideo || !q.stream.segmentIndex || fg(q.stream.segmentIndex) || a.h.disableStream(q.stream);
        H(r);
      });
    };
    function Ey(a, b) {
      return yy(a) ? a.D.get(b.type) : b.Jf;
    }
    function zy(a, b) {
      var c, d, e, f, g, h, k2, l, m, n, q, r, u, w, v, y, z, A, C, D, F, B, E, I, J, K, L, M, N, O, Q, R, V, Ba, aa, Oa, La;
      return P(function(Ja) {
        switch (Ja.g) {
          case 1:
            if (b.stream.isAudioMuxedInVideo) return Ja.return();
            c = [];
            d = t(b.T());
            for (e = d.next(); !e.done; e = d.next()) f = e.value, g = new rb(f), h = g.g, b.jf && (b.Yb >= 0 && h.add("_HLS_msn", String(b.Yb)), b.Zb >= 0 && h.add("_HLS_part", String(b.Zb))), b.kf && h.add("_HLS_skip", "YES"), Ib(h) && wb(g, yb(h.toString())), c.push(g.toString());
            sa(Ja, 2);
            return G(Ja, wy(a, c, true).promise, 4);
          case 4:
            k2 = Ja.h;
            ua(
              Ja,
              3
            );
            break;
          case 2:
            throw l = va(Ja), a.h && a.h.disableStream(b.stream), l;
          case 3:
            if (!b.stream.segmentIndex) return Ja.return();
            m = ly(a.hb, k2.data);
            if (m.type != 1) throw new U(2, 4, 4017);
            n = k2.uri;
            n == k2.originalUri || b.T().includes(n) || b.Zf.push(n);
            q = dy(m.ma, "EXT-X-DEFINE");
            r = Fy(a, q, n);
            u = b.stream;
            w = Ey(a, b);
            return G(Ja, Gy(a, m, u.mimeType, b.T, r), 5);
          case 5:
            v = Ja.h;
            y = v.keyIds;
            z = v.drmInfos;
            A = v.encrypted;
            C = v.Fi;
            u.encrypted || !A || C || (u.encrypted = true);
            D = function(Ea, ya) {
              return Ea.size === ya.size && [].concat(x(Ea)).every(function(Fa) {
                return ya.has(Fa);
              });
            };
            D(u.keyIds, y) || (u.keyIds = y, u.drmInfos = z, a.h.newDrmInfo(u));
            F = Hy(a, m, w, r, b.T, b.type);
            B = F.segments;
            if (E = F.bandwidth) u.bandwidth = E;
            I = nm(u);
            J = t(B);
            for (K = J.next(); !K.done; K = J.next()) L = K.value, L.ha && (L.ha.Kd = I);
            u.segmentIndex.we(B, a.l.Nb());
            B.length && (M = gy(m.ma, "EXT-X-MEDIA-SEQUENCE", 0), O = (N = fy(m.ma, "EXT-X-SKIP")) ? Number($x(N, "SKIPPED-SEGMENTS")) : 0, Q = Iy(M, B), R = Q.Yb, V = Q.Zb, b.Yb = R + O, b.Zb = V, Ba = w.get(M), u.segmentIndex.ib(Ba));
            if (aa = fg(u.segmentIndex)) b.md = aa.startTime, Oa = B[B.length - 1], b.zc = Oa.endTime;
            if (La = fy(m.ma, "EXT-X-ENDLIST")) b.me = true;
            Jy(a, m);
            Ky(a, m.ma, u.type, r, b.T);
            H(Ja);
        }
      });
    }
    p.onExpirationUpdated = function() {
    };
    p.onInitialVariantChosen = function() {
    };
    p.banLocation = function(a) {
      this.j && this.j.banLocation(a);
    };
    p.setMediaElement = function(a) {
      this.S = a;
    };
    function Ly(a, b, c) {
      c = c === void 0 ? false : c;
      for (var d = a.L == -1, e = t(b), f = e.next(); !f.done; f = e.next()) {
        f = f.value;
        var g = f.stream.segmentIndex, h = Ey(a, f);
        if (g = fg(g)) {
          h = t(h);
          for (var k2 = h.next(); !k2.done; k2 = h.next()) {
            k2 = t(k2.value);
            var l = k2.next().value;
            if (k2.next().value == g.startTime) {
              d && (a.L = Math.max(a.L, l));
              f.Wg = l;
              break;
            }
          }
        }
      }
      if (!(a.L < 0)) {
        for (b = t(b), d = b.next(); !d.done; d = b.next()) if (d = d.value, My(a, d.type) || c) {
          if (e = d.stream.segmentIndex) {
            if (f = a.L - d.Wg, f > 0 && (e.g.splice(0, f), e = fg(e))) e = -e.startTime, d.stream.segmentIndex.offset(e), Ny(a, d, e);
          }
        }
      }
    }
    function Oy(a, b) {
      if (a.$ == Infinity) {
        b = t(b);
        for (var c = b.next(); !c.done; c = b.next()) c = fg(c.value.stream.segmentIndex), c != null && c.h != null && (a.$ = Math.min(a.$, c.h));
      }
      b = a.$;
      if (b != Infinity) {
        c = t(a.i.values());
        for (var d = c.next(); !d.done; d = c.next()) if (d = d.value, !My(a, d.type)) {
          var e = d.stream.segmentIndex;
          if (e != null) {
            var f = fg(e);
            if (f) if (f.h == null) ab("Missing EXT-X-PROGRAM-DATE-TIME for stream", d.T(), "Expect AV sync issues!");
            else for (Ny(a, d, f.h - b - f.startTime), d = t(e), e = d.next(); !e.done; e = d.next()) e.value.pi(b);
          }
        }
      }
    }
    function Ny(a, b, c) {
      if (!(Math.abs(c) < 1e-3)) {
        b.md += c;
        b.zc += c;
        a = Ey(a, b);
        for (var d = t(a), e = d.next(); !e.done; e = d.next()) {
          var f = t(e.value);
          e = f.next().value;
          f = f.next().value;
          a.set(e, f + c);
        }
        b.T();
      }
    }
    function xy(a, b) {
      var c, d, e, f, g, h, k2, l, m, n, q, r, u, w, v, y, z, A, C, D, F, B, E, I, J, K, L, M, N, O, Q, R, V, Ba, aa, Oa, La, Ja, Ea, ya, Fa, Da, za;
      return P(function(Ca) {
        switch (Ca.g) {
          case 1:
            c = vc;
            d = ly(a.hb, b);
            e = dy(d.ma, "EXT-X-DEFINE");
            f = [];
            g = [];
            h = [];
            a.l = new Al(null, 0);
            a.l.rd(true);
            k2 = function() {
              return [a.G];
            };
            l = null;
            m = /* @__PURE__ */ new Map();
            if (d.type == 1) return a.O = false, R = dy(d.ma, "EXT-X-DEFINE"), m = Fy(a, R, a.G), l = c.Ja, V = "", Ba = /* @__PURE__ */ new Map(), G(Ca, Py(a, a.H++, m, d, k2, "", l, V, true, "Media Playlist", null, Ba, null, false, null, false), 7);
            Qy(a, e);
            n = dy(d.ma, "EXT-X-MEDIA");
            q = dy(
              d.ma,
              "EXT-X-STREAM-INF"
            );
            r = dy(d.ma, "EXT-X-IMAGE-STREAM-INF");
            u = dy(d.ma, "EXT-X-I-FRAME-STREAM-INF");
            w = dy(d.ma, "EXT-X-SESSION-KEY");
            v = dy(d.ma, "EXT-X-SESSION-DATA");
            y = dy(d.ma, "EXT-X-CONTENT-STEERING");
            Ry(a, v);
            return G(Ca, Sy(a, y), 4);
          case 4:
            if (!a.g.ignoreSupplementalCodecs) {
              z = [];
              A = t(q);
              C = A.next();
              for (D = {}; !C.done; D = { Wj: void 0 }, C = A.next()) if (F = C.value, B = $x(F, "SUPPLEMENTAL-CODECS")) D.Wj = B.split(/\s*,\s*/).map(function(fb) {
                return fb.split("/")[0];
              }), E = F.attributes.map(/* @__PURE__ */ function(fb) {
                return function(hb) {
                  var ib = hb.name, xb = hb.value;
                  ib == "CODECS" && (xb = fb.Wj.join(","), hb = hb.value.split(","), hb.length > 1 && (hb = rc("audio", hb)) && (xb += "," + hb));
                  return new cy(ib, xb);
                };
              }(D)), z.push(new Xx(F.id, F.name, E, null));
              q.push.apply(q, x(z));
              I = [];
              J = t(u);
              K = J.next();
              for (L = {}; !K.done; L = { Xj: void 0 }, K = J.next()) if (M = K.value, N = $x(M, "SUPPLEMENTAL-CODECS")) L.Xj = N.split(/\s*,\s*/).map(function(fb) {
                return fb.split("/")[0];
              }), O = M.attributes.map(/* @__PURE__ */ function(fb) {
                return function(hb) {
                  var ib = hb.name;
                  hb = hb.value;
                  ib == "CODECS" && (hb = fb.Xj.join(","));
                  return new cy(
                    ib,
                    hb
                  );
                };
              }(L)), I.push(new Xx(M.id, M.name, O, null));
              u.push.apply(u, x(I));
            }
            Ty(a, q);
            Uy(a, n);
            Q = Vy(a, u);
            return G(Ca, Wy(a, q, w, n, k2, a.C, Q), 5);
          case 5:
            return f = Ca.h, g = Xy(a, n), G(Ca, Yy(a, r, u), 6);
          case 6:
            h = Ca.h;
            Ca.B(3);
            break;
          case 7:
            aa = Ca.h, a.i.set(a.G, aa), aa.stream && (Oa = nm(aa.stream), aa.stream.segmentIndex.Kb(function(fb) {
              fb.ha && (fb.ha.Kd = Oa);
            })), l = aa.stream.type, La = true, a.g.disableAudio && aa.type == "audio" ? La = false : a.g.disableVideo && aa.type == "video" && !aa.stream.codecs.includes(",") && (La = false), La && f.push({
              id: 0,
              language: zc(V || "und"),
              disabledUntilTime: 0,
              primary: true,
              audio: aa.type == "audio" ? aa.stream : null,
              video: aa.type == "video" ? aa.stream : null,
              bandwidth: aa.stream.bandwidth || 0,
              allowedByApplication: true,
              allowedByKeySystem: true,
              decodingInfos: []
            });
          case 3:
            if (!a.h) throw new U(2, 7, 7001);
            Zy(a, d);
            d.type == 1 && (yy(a) && ($y(a, d), Ja = a.u, a.F.Y(Ja)), Ea = Array.from(a.i.values()), az(a, Ea), Dy(a), Ky(a, d.ma, l, m, k2));
            a.m = {
              presentationTimeline: a.l,
              variants: f,
              textStreams: g,
              imageStreams: h,
              offlineSessionIds: [],
              sequenceMode: a.g.hls.sequenceMode,
              ignoreManifestTimestampsInSegmentsMode: a.g.hls.ignoreManifestTimestampsInSegmentsMode,
              type: "HLS",
              serviceDescription: null,
              nextUrl: null,
              periodCount: 1,
              gapCount: 0,
              isLowLatency: false,
              startTime: a.A
            };
            if (a.Z || !a.g.hls.disableCodecGuessing) {
              Ca.B(8);
              break;
            }
            ya = [];
            Fa = t(a.m.variants);
            for (Da = Fa.next(); !Da.done; Da = Fa.next()) za = Da.value, za.audio && za.audio.codecs === "" && ya.push(za.audio.createSegmentIndex()), za.video && za.video.codecs === "" && ya.push(za.video.createSegmentIndex());
            return G(Ca, Promise.all(ya), 8);
          case 8:
            a.h.makeTextStreamsForClosedCaptions(a.m), H(Ca);
        }
      });
    }
    function bz(a, b) {
      var c, d, e, f, g, h, k2, l, m, n, q, r, u, w, v, y, z, A;
      return P(function(C) {
        if (C.g == 1) {
          c = Dm(a.g.hls.mediaPlaylistFullMimeType);
          if (!b.length) return C.return(c);
          d = cz(a, b);
          e = d.segment;
          f = d.segmentIndex;
          g = e.T();
          h = g[0];
          k2 = new rb(h);
          l = k2.xb.split(".").pop();
          return (m = dz.get(l)) ? C.return(Dm(m)) : G(C, Promise.all([ez(a, e.ha, 0), ez(a, e, f)]), 2);
        }
        n = C.h;
        q = n[1].mimeType;
        r = n[0].data;
        u = n[1].data;
        w = "mp4 mp4a m4s m4i m4a m4f cmfa mp4v m4v cmfv fmp4".split(" ");
        v = ["audio/mp4", "video/mp4", "video/iso.segment"];
        y = e.ha || v.includes(q);
        if (!y && xk(Lb(u))) {
          var D = u, F = a.g.disableAudio, B = a.g.disableVideo, E = a.g.disableText;
          var I = Lb(D);
          var J = new pk().parse(I), K = J.je();
          I = J.xh();
          var L = [], M = false, N = false;
          if (!F) switch (K.audio) {
            case "aac":
            case "aac-loas":
              J.Bb().length && (L.push("mp4a.40.2"), M = true);
              break;
            case "mp3":
              J.Bb().length && (L.push("mp4a.40.34"), M = true);
              break;
            case "ac3":
              J.Bb().length && (L.push("ac-3"), M = true);
              break;
            case "ec3":
              J.Bb().length && (L.push("ec-3"), M = true);
              break;
            case "opus":
              J.Bb().length && (L.push("opus"), M = true);
          }
          if (!B) switch (K.video) {
            case "avc":
              I.codec ? L.push(I.codec) : L.push("avc1.42E01E");
              N = true;
              break;
            case "hvc":
              I.codec ? L.push(I.codec) : L.push("hvc1.1.6.L93.90");
              N = true;
              break;
            case "av1":
              L.push("av01.0.01M.08"), N = true;
          }
          if (L.length) {
            F = M && !N;
            B = /* @__PURE__ */ new Map();
            if (N && !E) {
              E = new ld("video/mp2t");
              E.Tf(D);
              D = t(E.zg());
              for (N = D.next(); !N.done; N = D.next()) N = N.value, B.set(N, N);
              E.$d();
            }
            I = { type: F ? "audio" : "video", mimeType: "video/mp2t", codecs: L.join(", "), language: null, height: I.height, width: I.width, channelCount: null, sampleRate: null, closedCaptions: B, Ke: null, colorGamut: null, frameRate: I.frameRate };
          } else I = null;
          if (z = I) return C.return(z);
        } else if (y || w.includes(l)) {
          if (A = Em(r, u, a.g.disableText)) return C.return(A);
        }
        return q ? C.return(Dm(q)) : C.return(c);
      });
    }
    function ez(a, b, c) {
      var d, e, f, g, h, k2;
      return P(function(l) {
        switch (l.g) {
          case 1:
            if (!b) return l.return({ mimeType: null, data: null });
            d = gh;
            e = Jm(b.T(), b.Nc(), b.Lc(), a.g.retryParameters);
            f = b instanceof Cj ? 1 : 0;
            return G(l, fz(a, e, d, { type: f }).promise, 2);
          case 2:
            g = l.h;
            h = g.data;
            if (!b.aesKey) {
              l.B(3);
              break;
            }
            return G(l, Im(h, b.aesKey, c), 4);
          case 4:
            h = l.h;
          case 3:
            return b instanceof Cj ? b.Ee(h, true) : b.Ee(h), (k2 = g.headers["content-type"]) && (k2 = k2.split(";")[0].toLowerCase()), l.return({ mimeType: k2, data: h });
        }
      });
    }
    function Dy(a) {
      if (yy(a)) {
        if (a.va == gz) {
          for (var b = Infinity, c = Infinity, d = t(a.i.values()), e = d.next(); !e.done; e = d.next()) e = e.value, e.stream.segmentIndex && e.stream.type != "text" && !e.stream.isAudioMuxedInVideo && (b = Math.min(b, e.zc), c = Math.min(c, e.md));
          b = b - c || 0;
          isNaN(a.g.availabilityWindowOverride) || (b = a.g.availabilityWindowOverride);
          a.l.hg(b);
        }
      } else a.l.yb(hz(a));
      if (!a.l.u) for (b = t(a.i.values()), c = b.next(); !c.done; c = b.next()) c = c.value, !c.stream.segmentIndex || c.type != "audio" && c.type != "video" || (c = fg(c.stream.segmentIndex)) && c.h && a.l.ei(c.h);
      a.l.If();
    }
    function Qy(a, b) {
      var c = new rb(a.G).g;
      b = t(b);
      for (var d = b.next(); !d.done; d = b.next()) {
        var e = d.value;
        d = $x(e, "NAME");
        var f = $x(e, "VALUE");
        e = $x(e, "QUERYPARAM");
        d && f && (a.C.has(d) || a.C.set(d, f));
        e && (d = c.get(e)[0]) && !a.C.has(d) && a.C.set(e, d);
      }
    }
    function Fy(a, b, c) {
      c = new rb(c).g;
      var d = /* @__PURE__ */ new Map();
      b = t(b);
      for (var e = b.next(); !e.done; e = b.next()) {
        var f = e.value, g = $x(f, "NAME"), h = $x(f, "VALUE");
        e = $x(f, "QUERYPARAM");
        f = $x(f, "IMPORT");
        g && h && (d.has(g) || d.set(g, h));
        e && (g = c.get(e)[0]) && !d.has(g) && d.set(e, g);
        f && (e = a.C.get(f)) && d.set(f, e);
      }
      return d;
    }
    function Ty(a, b) {
      b = t(b);
      for (var c = b.next(); !c.done; c = b.next()) {
        var d = c.value, e = $x(d, "AUDIO");
        c = $x(d, "VIDEO");
        var f = $x(d, "SUBTITLES");
        d = iz(a, d);
        if (f) {
          var g = rc(tc, d);
          a.J.set(f, g);
          ud(d, g);
        }
        e && (f = rc("audio", d), f || (f = a.g.hls.defaultAudioCodec), a.J.set(e, f));
        c && (e = rc("video", d), e || (e = a.g.hls.defaultVideoCodec), a.J.set(c, e));
      }
    }
    function Ry(a, b) {
      b = t(b);
      for (var c = b.next(); !c.done; c = b.next()) {
        var d = c.value, e = $x(d, "DATA-ID");
        c = $x(d, "URI");
        var f = $x(d, "LANGUAGE");
        d = $x(d, "VALUE");
        e = (/* @__PURE__ */ new Map()).set("id", e);
        c && e.set("uri", hy([a.G], c, a.C)[0]);
        f && e.set("language", f);
        d && e.set("value", d);
        c = new T("sessiondata", e);
        if (a.h) a.h.onEvent(c);
      }
    }
    function Sy(a, b) {
      var c, d, e, f, g, h;
      return P(function(k2) {
        if (!a.h || !a.g) return k2.return();
        d = t(b);
        for (e = d.next(); !e.done; e = d.next()) if (f = e.value, g = $x(f, "PATHWAY-ID"), h = $x(f, "SERVER-URI"), g && h) {
          a.j = new Zv(a.h);
          a.j.configure(a.g);
          a.j.i = [a.G];
          a.j.setManifestType("HLS");
          a.j.h = g;
          c = $v(a.j, h);
          break;
        }
        return G(k2, c, 0);
      });
    }
    function Xy(a, b) {
      var c = ey(b, "SUBTITLES");
      b = c.map(function(g) {
        if (a.g.disableText) return null;
        try {
          return jz(a, [g], /* @__PURE__ */ new Map()).stream;
        } catch (h) {
          if (a.g.hls.ignoreTextStreamFailures) return null;
          throw h;
        }
      });
      c = t(c);
      for (var d = c.next(); !d.done; d = c.next()) {
        var e = ay(d.value, "GROUP-ID");
        if (d = a.J.get(e)) {
          if (e = a.K.get(e)) {
            e = t(e);
            for (var f = e.next(); !f.done; f = e.next()) f = f.value, f.stream.codecs = d, f.stream.mimeType = kz(tc, d) || lz(tc), mz(f.stream);
          }
        }
      }
      return b.filter(function(g) {
        return g;
      });
    }
    function mz(a) {
      var b = /* @__PURE__ */ new Set([ef(a.mimeType, a.codecs)]);
      a.segmentIndex && a.segmentIndex.Kb(function(c) {
        c.mimeType && b.add(ef(c.mimeType, a.codecs));
      });
      a.fullMimeTypes = b;
    }
    function Yy(a, b, c) {
      var d, e;
      return P(function(f) {
        if (f.g == 1) return d = b.map(function(g) {
          var h, k2, l;
          return P(function(m) {
            if (m.g == 1) {
              if (h = a.g.disableThumbnails) return m.return(null);
              sa(m, 2);
              return G(m, nz(a, g), 4);
            }
            if (m.g != 2) return k2 = m.h, m.return(k2.stream);
            l = va(m);
            if (a.g.hls.ignoreImageStreamFailures) return m.return(null);
            throw l;
          });
        }).concat(c.map(function(g) {
          if (a.g.disableThumbnails) return null;
          try {
            var h = oz(a, g);
            return h.stream.type !== "image" ? null : h.stream;
          } catch (k2) {
            if (a.g.hls.ignoreImageStreamFailures) return null;
            throw k2;
          }
        })), G(f, Promise.all(d), 2);
        e = f.h;
        return f.return(e.filter(function(g) {
          return g;
        }));
      });
    }
    function pz(a, b, c) {
      b = b.filter(function(h) {
        var k2 = $x(h, "URI") || "";
        h = $x(h, "TYPE");
        return h != "SUBTITLES" && (k2 != "" || h == "AUDIO");
      });
      var d = {};
      b = t(b);
      for (var e = b.next(); !e.done; e = b.next()) {
        e = e.value;
        var f = Yx(e, !a.j);
        d[f] ? d[f].push(e) : d[f] = [e];
      }
      for (var g in d) jz(a, d[g], c, false);
    }
    function Vy(a, b) {
      return b.map(function(c) {
        c = oz(a, c);
        return c.stream.type !== "video" ? null : c.stream;
      }).filter(function(c) {
        return c;
      });
    }
    function Wy(a, b, c, d, e, f, g) {
      var h, k2, l, m, n, q, r, u, w, v, y, z, A, C, D, F, B, E, I, J, K, L, M, N, O, Q, R, V, Ba, aa, Oa, La, Ja, Ea, ya, Fa;
      return P(function(Da) {
        switch (Da.g) {
          case 1:
            h = [];
            k2 = /* @__PURE__ */ new Set();
            if (a.g.ignoreDrmInfo || !(c.length > 0)) {
              Da.B(2);
              break;
            }
            l = t(c);
            m = l.next();
          case 3:
            if (m.done) {
              Da.B(2);
              break;
            }
            n = m.value;
            q = ay(n, "METHOD");
            r = $x(n, "KEYFORMAT") || "identity";
            u = null;
            if (q == "NONE") {
              Da.B(4);
              break;
            }
            if (qz(q)) {
              w = hy(e(), ay(n, "URI"), f);
              v = w.sort().join("");
              a.M.has(v) || (y = ah(w, a.g.retryParameters), z = fz(a, y, 6).promise, a.M.set(v, z));
              Da.B(4);
              break;
            }
            if (r == "identity") return G(Da, rz(a, n, "", e, null, f), 12);
            A = a.jc.get(r);
            if (!A) {
              C = null;
              Da.B(10);
              break;
            }
            return G(Da, A(n, "", null), 11);
          case 11:
            C = Da.h;
          case 10:
            u = C;
            Da.B(6);
            break;
          case 12:
            u = Da.h;
          case 6:
            if (u) {
              if (u.keyIds) for (D = t(u.keyIds), F = D.next(); !F.done; F = D.next()) B = F.value, k2.add(B);
              h.push(u);
            }
          case 4:
            m = l.next();
            Da.B(3);
            break;
          case 2:
            E = {};
            I = t(b);
            for (J = I.next(); !J.done; J = I.next()) K = J.value, L = Yx(K, !a.j), E[L] ? E[L].push(K) : E[L] = [K];
            M = [];
            for (N in E) O = E[N], Q = O[0], R = $x(Q, "FRAME-RATE"), V = Number($x(Q, "AVERAGE-BANDWIDTH")) || Number(ay(
              Q,
              "BANDWIDTH"
            )), Ba = $x(Q, "RESOLUTION"), aa = t(Ba ? Ba.split("x") : [null, null]), Oa = aa.next().value, La = aa.next().value, Ja = $x(Q, "VIDEO-RANGE"), (Ea = $x(Q, "REQ-VIDEO-LAYOUT")) && Ea.includes(",") && (ya = Ea.split(",").filter(function(za) {
              return za == "CH-STEREO" || za == "CH-MONO";
            }), Ea = ya[0]), Ea = Ea || "CH-MONO", Fa = sz(a, O, d), M.push.apply(M, x(tz(a, Fa.audio, Fa.video, V, Oa, La, R, Ja, Ea, h, k2, g)));
            return Da.return(M.filter(function(za) {
              return za != null;
            }));
        }
      });
    }
    function sz(a, b, c) {
      for (var d = { audio: [], video: [] }, e = /* @__PURE__ */ new Map(), f = [], g = false, h = false, k2 = t(b), l = k2.next(); !l.done; l = k2.next()) {
        var m = l.value;
        l = $x(m, "AUDIO");
        var n = $x(m, "VIDEO"), q = l || n;
        q && (f.includes(q) || f.push(q), (m = $x(m, "PATHWAY-ID")) && e.set(q, m), l ? g = true : n && (h = true));
      }
      f.length && c.length && (c = c.filter(function(u) {
        return f.includes(ay(u, "GROUP-ID"));
      }), pz(a, c, e));
      c = (e = f.sort().join(",")) && a.K.has(e) ? a.K.get(e) : [];
      g ? d.audio.push.apply(d.audio, x(c)) : h && d.video.push.apply(d.video, x(c));
      g = false;
      var r = b.map(function(u) {
        return ay(
          u,
          "URI"
        );
      });
      l = d.audio.find(function(u) {
        return u && u.T().find(function(w) {
          return r.includes(w);
        });
      });
      h = iz(a, b[0]);
      c = rc("video", h);
      (k2 = rc("audio", h)) && !c ? (l = "audio", g = d.audio.length > 0) : !d.audio.length && !d.video.length && k2 && c ? (l = "video", h = [[c, k2].join()]) : d.audio.length && l ? (l = "audio", g = true) : l = d.video.length && !d.audio.length ? "audio" : "video";
      g || (a = uz(a, b, h, l), e && (a.stream.groupId = e), d[a.stream.type] = [a]);
      return d;
    }
    function iz(a, b) {
      b = $x(b, "CODECS") || "";
      a.Z = b.length > 0;
      a.Z || a.g.hls.disableCodecGuessing || (b = [], a.g.disableVideo || b.push(a.g.hls.defaultVideoCodec), a.g.disableAudio || b.push(a.g.hls.defaultAudioCodec), b = b.join(","));
      return Fm(b.split(/\s*,\s*/));
    }
    function tz(a, b, c, d, e, f, g, h, k2, l, m, n) {
      for (var q = t(c), r = q.next(); !r.done; r = q.next()) vz(r.value.stream, e, f, g, h, k2, null);
      e = a.g.disableVideo;
      if (!c.length || e) c = [null];
      e && (b = b.filter(function(y) {
        return !y.stream.isAudioMuxedInVideo;
      }));
      e = a.g.disableAudio;
      if (!b.length || e) b = [null];
      e = [];
      b = t(b);
      for (f = b.next(); !f.done; f = b.next()) for (f = f.value, g = t(c), h = g.next(); !h.done; h = g.next()) {
        var u = h.value;
        if (h = f ? f.stream : null) h.drmInfos = l, h.keyIds = m;
        if (k2 = u ? u.stream : null) k2.drmInfos = l, k2.keyIds = m, a.g.disableIFrames || pg(k2, n);
        k2 && !h && (k2.bandwidth = d);
        !k2 && h && (h.bandwidth = d);
        q = f ? f.stream.drmInfos : null;
        r = u ? u.stream.drmInfos : null;
        u = u ? u.T().sort().join(",") : "";
        var w = f ? f.T().sort().join(",") : "", v = [];
        h && h.codecs && v.push(h.codecs);
        k2 && k2.codecs && v.push(k2.codecs);
        u = [u, w, v.sort()].join("-");
        h && k2 && !yg(q, r) || a.Za.has(u) || (h = { id: a.H++, language: h ? h.language : "und", disabledUntilTime: 0, primary: !!h && h.primary || !!k2 && k2.primary, audio: h, video: k2, bandwidth: d, allowedByApplication: true, allowedByKeySystem: true, decodingInfos: [] }, e.push(h), a.Za.add(u));
      }
      return e;
    }
    function Uy(a, b) {
      b = ey(b, "CLOSED-CAPTIONS");
      a.O = b.length == 0;
      b = t(b);
      for (var c = b.next(); !c.done; c = b.next()) {
        var d = c.value, e = $x(d, "LANGUAGE");
        c = zc(e || "und");
        e || (e = $x(d, "NAME")) && (c = e);
        e = ay(d, "GROUP-ID");
        d = ay(d, "INSTREAM-ID").replace("SERVICE", "svc");
        a.I.get(e) || a.I.set(e, /* @__PURE__ */ new Map());
        a.I.get(e).set(d, c);
      }
    }
    function jz(a, b, c, d) {
      d = d === void 0 ? true : d;
      for (var e = [], f = [], g = /* @__PURE__ */ new Map(), h = t(b), k2 = h.next(); !k2.done; k2 = h.next()) {
        var l = k2.value;
        k2 = d ? ay(l, "URI") : $x(l, "URI") || "shaka://hls-muxed";
        l = ay(l, "GROUP-ID");
        e.push(k2);
        f.push(l);
        g.set(l, k2);
      }
      d = f.sort().join(",");
      k2 = b[0];
      b = "";
      h = ay(k2, "TYPE").toLowerCase();
      h == "subtitles" && (h = tc);
      if (h == tc) b = $x(k2, "CODECS") || "";
      else for (f = t(f), l = f.next(); !l.done; l = f.next()) if (l = l.value, a.J.has(l)) {
        b = a.J.get(l);
        break;
      }
      f = e.sort().join(",");
      if (a.i.has(f)) return a.i.get(f);
      l = a.H++;
      if (a.j) {
        g = t(g);
        for (var m = g.next(); !m.done; m = g.next()) {
          var n = t(m.value);
          m = n.next().value;
          n = n.next().value;
          (m = c.get(m)) && cw(a.j, l, m, n);
        }
      }
      c = $x(k2, "LANGUAGE");
      g = $x(k2, "NAME");
      m = $x(k2, "DEFAULT") == "YES";
      h == "audio" ? n = (n = $x(k2, "CHANNELS")) ? parseInt(n.split("/")[0], 10) : null : n = null;
      var q;
      h == "audio" ? (q = $x(k2, "CHANNELS")) ? (q = q.split("/"), q = q.length != 2 ? false : q[1] === "JOC" || q[1].includes("ATMOS")) : q = false : q = false;
      var r = $x(k2, "CHARACTERISTICS"), u = $x(k2, "FORCED") == "YES";
      h == "audio" ? k2 = (k2 = $x(k2, "SAMPLE-RATE")) ? parseInt(k2, 10) : null : k2 = null;
      e = wz(
        a,
        l,
        e,
        b,
        h,
        c,
        m,
        g,
        n,
        null,
        r,
        u,
        k2,
        q
      );
      e.stream && (e.stream.groupId = d);
      a.K.has(d) ? a.K.get(d).push(e) : a.K.set(d, [e]);
      a.i.set(f, e);
      return e;
    }
    function nz(a, b) {
      var c, d, e, f, g, h, k2, l, m, n;
      return P(function(q) {
        if (q.g == 1) {
          c = ay(b, "URI");
          d = $x(b, "CODECS", "jpeg") || "";
          if (a.i.has(c)) return q.return(a.i.get(c));
          e = $x(b, "LANGUAGE");
          f = $x(b, "NAME");
          g = $x(b, "CHARACTERISTICS");
          h = wz(a, a.H++, [c], d, "image", e, false, f, null, null, g, false, null, false);
          return (k2 = $x(b, "RESOLUTION")) ? G(q, h.stream.createSegmentIndex(), 3) : q.B(2);
        }
        q.g != 2 && (l = fg(h.stream.segmentIndex), m = l.tilesLayout) && (h.stream.width = Number(k2.split("x")[0]) * Number(m.split("x")[0]), h.stream.height = Number(k2.split("x")[1]) * Number(m.split("x")[1]));
        if (n = $x(b, "BANDWIDTH")) h.stream.bandwidth = Number(n);
        a.i.set(c, h);
        return q.return(h);
      });
    }
    function oz(a, b) {
      var c = "video", d = ay(b, "URI"), e = $x(b, "CODECS") || "";
      e == "mjpg" && (c = "image");
      if (a.i.has(d)) return a.i.get(d);
      var f = $x(b, "LANGUAGE"), g = $x(b, "NAME"), h = $x(b, "CHARACTERISTICS");
      c = wz(a, a.H++, [d], e, c, f, false, g, null, null, h, false, null, false);
      e = $x(b, "RESOLUTION");
      f = t(e ? e.split("x") : [null, null]);
      e = f.next().value;
      f = f.next().value;
      c.stream.width = Number(e) || void 0;
      c.stream.height = Number(f) || void 0;
      if (b = $x(b, "BANDWIDTH")) c.stream.bandwidth = Number(b);
      a.i.set(d, c);
      return c;
    }
    function uz(a, b, c, d) {
      for (var e = a.H++, f = [], g = t(b), h = g.next(); !h.done; h = g.next()) {
        var k2 = h.value;
        h = ay(k2, "URI");
        k2 = $x(k2, "PATHWAY-ID");
        a.j && k2 && cw(a.j, e, k2, h);
        f.push(h);
      }
      g = f.sort().join(",") + c.sort().join(",");
      if (a.i.has(g)) return a.i.get(g);
      h = f.join(",");
      a: {
        b = $x(b[0], "CLOSED-CAPTIONS");
        if (d == "video") {
          if (a.g.disableText) {
            a.O = false;
            b = null;
            break a;
          }
          if (b) {
            if (b != "NONE") {
              b = a.I.get(b);
              break a;
            }
            a.O = false;
          } else if (!b && a.I.size) for (b = t(a.I.keys()), b = b.next(); !b.done; b = b.next()) {
            b = a.I.get(b.value);
            break a;
          }
        }
        b = null;
      }
      c = qc(d, c);
      d = wz(a, e, f, c, d, null, false, h, null, b, null, false, null, false);
      a.i.set(g, d);
      return d;
    }
    function wz(a, b, c, d, e, f, g, h, k2, l, m, n, q, r) {
      function u(C) {
        var D, F, B, E, I, J, K, L, M, N, O, Q, R, V, Ba, aa, Oa, La, Ja, Ea;
        return P(function(ya) {
          switch (ya.g) {
            case 1:
              return D = vc, sa(ya, 2), G(ya, C.promise, 4);
            case 4:
              F = ya.h;
              if (C.aborted) return ya.return();
              B = F.uri;
              B != F.originalUri && (E = y.T(), E.includes(B) || y.Zf.push(B));
              I = ly(a.hb, F.data);
              if (I.type != 1) throw new U(2, 4, 4017);
              J = dy(I.ma, "EXT-X-DEFINE");
              K = Fy(a, J, B);
              L = false;
              (!a.Z && a.g.hls.disableCodecGuessing || a.O && e == D.Ja && !a.g.hls.disableClosedCaptionsDetection) && I.segments.length > 0 && (a.O = false, L = true);
              M = !a.Z && a.g.hls.disableCodecGuessing;
              N = yy(a);
              return G(ya, Py(a, 0, K, I, w, d, e, f, g, h, k2, l, m, n, q, r, void 0, L, M), 5);
            case 5:
              O = ya.h;
              if (C.aborted) return ya.return();
              Q = O.stream;
              Zy(a, I);
              yy(a) && !N && $y(a, I);
              y.md = O.md;
              y.zc = O.zc;
              y.kf = O.kf;
              y.jf = O.jf;
              y.me = O.me;
              y.Jf = O.Jf;
              y.Yb = O.Yb;
              y.Zb = O.Zb;
              v.segmentIndex = Q.segmentIndex;
              v.encrypted = Q.encrypted;
              v.drmInfos = Q.drmInfos;
              v.keyIds = Q.keyIds;
              v.mimeType = Q.mimeType;
              v.bandwidth = v.bandwidth || Q.bandwidth;
              v.codecs = v.codecs || Q.codecs;
              v.closedCaptions = v.closedCaptions || Q.closedCaptions;
              v.width = v.width || Q.width;
              v.height = v.height || Q.height;
              v.hdr = v.hdr || Q.hdr;
              v.colorGamut = v.colorGamut || Q.colorGamut;
              v.frameRate = v.frameRate || Q.frameRate;
              v.language == "und" && Q.language != "und" && (v.language = Q.language);
              v.language = v.language || Q.language;
              v.channelsCount = v.channelsCount || Q.channelsCount;
              v.audioSamplingRate = v.audioSamplingRate || Q.audioSamplingRate;
              mz(v);
              v.drmInfos.length && a.h.newDrmInfo(v);
              R = false;
              if (!l && v.closedCaptions || l && v.closedCaptions && l.size != v.closedCaptions.size) R = true;
              a.m && R && a.h.makeTextStreamsForClosedCaptions(a.m);
              e == D.ab && (V = fg(Q.segmentIndex)) && V.ha && (v.mimeType = "application/mp4", mz(v));
              Ba = nm(v);
              v.segmentIndex.Kb(function(Fa) {
                Fa.ha && (Fa.ha.Kd = Ba);
              });
              xz(a) && (a.Ec ? az(a, [y]) : (a.Ec = true, aa = Array.from(a.i.values()), Oa = aa.filter(function(Fa) {
                return Fa.stream.segmentIndex;
              }), az(a, Oa), Dy(a), La = a.u, La > 0 && a.F.Y(La)));
              Ky(a, I.ma, v.type, K, w);
              a.m && (a.m.startTime = a.A);
              ua(ya, 0);
              break;
            case 2:
              Ja = va(ya);
              v.closeSegmentIndex();
              if (Ja.code === 7001) return ya.return();
              Ea = a.h.disableStream(v);
              if (!Ea) throw Ja;
              H(ya);
          }
        });
      }
      function w() {
        return a.j && c.length > 1 ? dw(a.j, b) : y.Zf.concat(iy([a.G], c, a.C));
      }
      var v = Mz(a, d, e, f, g, h, k2, l, m, n, q, r);
      c.includes("shaka://hls-muxed") && (v.isAudioMuxedInVideo = true, v.mimeType = "video/mp2t", mz(v));
      var y = { stream: v, type: e, Zf: [], md: 0, zc: 0, Jf: /* @__PURE__ */ new Map(), kf: false, jf: false, me: false, Wg: -1, Yb: -1, Zb: -1, T: w }, z = null, A;
      v.createSegmentIndex = function() {
        if (z) return z;
        if (v.isAudioMuxedInVideo) return v.segmentIndex = new Zl([]), Promise.resolve();
        A = wy(a, y.T(), true);
        return z = new Promise(function(C) {
          C(u(A));
        });
      };
      v.closeSegmentIndex = function() {
        z && !v.segmentIndex && A.abort();
        v.segmentIndex && (v.segmentIndex.release(), v.segmentIndex = null);
        z = null;
      };
      return y;
    }
    function hz(a) {
      var b = Infinity;
      a = t(a.i.values());
      for (var c = a.next(); !c.done; c = a.next()) c = c.value, c.stream.segmentIndex && c.stream.type != "text" && !c.stream.isAudioMuxedInVideo && (b = Math.min(b, c.zc));
      return b;
    }
    function Ay(a, b) {
      var c = [];
      b = t(b);
      for (var d = b.next(); !d.done; d = b.next()) d = d.value, d.segmentIndex && d.segmentIndex.Kb(function(e) {
        c.push(e);
      });
      a.l.ye(c);
    }
    function az(a, b) {
      if (!yy(a)) for (var c = hz(a), d = t(b), e = d.next(); !e.done; e = d.next()) e.value.stream.segmentIndex.Ed(0, c);
      Ay(a, b.map(function(f) {
        return f.stream;
      }));
      d = Array.from(a.i.values()).filter(function(f) {
        return f.stream.segmentIndex;
      });
      c = d.some(function(f) {
        return f.stream.type == "audio";
      });
      e = d.some(function(f) {
        return f.stream.type == "video";
      });
      d = yy(a) && !a.Va;
      c = !yy(a) && a.Va && !(c && e);
      a.g.hls.ignoreManifestProgramDateTime || d || c ? Ly(a, b, d) : (Oy(a, b), a.g.hls.ignoreManifestProgramDateTimeForTypes.length > 0 && Ly(
        a,
        b
      ));
    }
    function My(a, b) {
      return a.g.hls.ignoreManifestProgramDateTime ? true : a.g.hls.ignoreManifestProgramDateTimeForTypes.includes(b);
    }
    function xz(a) {
      if (!a.m) return false;
      var b = [], c = [];
      a = t(a.m.variants);
      for (var d = a.next(); !d.done; d = a.next()) d = d.value, d.video && b.push(d.video), d.audio && c.push(d.audio);
      return b.length > 0 && !b.some(function(e) {
        return e.segmentIndex;
      }) || c.length > 0 && !c.some(function(e) {
        return e.segmentIndex;
      }) ? false : true;
    }
    function Py(a, b, c, d, e, f, g, h, k2, l, m, n, q, r, u, w, v, y, z) {
      y = y === void 0 ? true : y;
      z = z === void 0 ? true : z;
      var A, C, D, F, B, E, I, J, K, L, M, N, O, Q, R, V, Ba, aa, Oa, La, Ja, Ea, ya, Fa, Da, za, Ca, fb, hb;
      return P(function(ib) {
        switch (ib.g) {
          case 1:
            A = d.segments || [];
            C = A.every(function(xb) {
              return fy(xb.ma, "EXT-X-GAP") ? true : false;
            });
            if (!A.length || C) throw new U(2, 4, 4053);
            Nz(a, d);
            yy(a) && Jy(a, d);
            D = yy(a) ? a.D.get(g) : /* @__PURE__ */ new Map();
            F = Hy(a, d, D, c, e, g);
            B = F.segments;
            E = F.bandwidth;
            M = L = K = J = I = null;
            if (!(B.length > 0 && y)) {
              ib.B(2);
              break;
            }
            return G(ib, bz(a, B), 3);
          case 3:
            N = ib.h, g != N.type && yy(a) && (a.D.set(N.type, a.D.get(g)), a.D.set(g, /* @__PURE__ */ new Map())), g = N.type, h = N.language, m = N.channelCount, u = N.sampleRate, a.g.disableText || (n = N.closedCaptions), J = N.height, I = N.width, K = N.Ke, L = N.colorGamut, M = N.frameRate, z && (v = N.mimeType, f = N.codecs);
          case 2:
            if (v) {
              ib.B(4);
              break;
            }
            return G(ib, Oz(a, g, f, B), 5);
          case 5:
            v = ib.h, g != tc || f || v != "application/mp4" || !B[0] || B[0].ha || (v = "text/vtt");
          case 4:
            return G(ib, Gy(a, d, v, e, c), 6);
          case 6:
            O = ib.h;
            Q = O.drmInfos;
            R = O.keyIds;
            V = O.encrypted;
            Ba = O.Fi;
            if (V && !Q.length && !Ba) throw new U(
              2,
              4,
              4026
            );
            aa = Mz(a, f, g, h, k2, l, m, n, q, r, u, w);
            aa.encrypted = V && !Ba;
            aa.drmInfos = Q;
            aa.keyIds = R;
            aa.mimeType = v;
            E && (aa.bandwidth = E);
            mz(aa);
            g == "video" && (I || J || K || L) && vz(aa, I, J, M, K, null, L);
            yy(a) && Jy(a, d);
            Oa = B[0].startTime;
            La = B[B.length - 1];
            Ja = La.endTime;
            Ea = new Zl(B);
            aa.segmentIndex = Ea;
            Fa = (ya = fy(d.ma, "EXT-X-SERVER-CONTROL")) ? Zx(ya, "CAN-SKIP-UNTIL") != null : false;
            Da = ya ? Zx(ya, "CAN-BLOCK-RELOAD") != null : false;
            za = gy(d.ma, "EXT-X-MEDIA-SEQUENCE", 0);
            Ca = Iy(za, B);
            fb = Ca.Yb;
            hb = Ca.Zb;
            return ib.return({
              stream: aa,
              type: g,
              Zf: [],
              T: e,
              md: Oa,
              zc: Ja,
              kf: Fa,
              jf: Da,
              me: false,
              Wg: -1,
              Yb: fb,
              Zb: hb,
              Jf: D
            });
        }
      });
    }
    function Iy(a, b) {
      a = a + b.length - 1;
      var c = -1;
      if (!b.length) return a++, { Yb: a, Zb: c };
      b = b[b.length - 1];
      var d = b.g;
      if (!b.g.length) return a++, b.m && (c = 0), { Yb: a, Zb: c };
      c = d.length - 1;
      d[d.length - 1].isPreload() || (a++, c = 0);
      return { Yb: a, Zb: c };
    }
    function Mz(a, b, c, d, e, f, g, h, k2, l, m, n) {
      var q = kz(c, b) || lz(c), r = [];
      if (k2) {
        k2 = t(k2.split(","));
        for (var u = k2.next(); !u.done; u = k2.next()) r.push(u.value);
      }
      k2 = void 0;
      u = null;
      c == tc ? k2 = r.includes("public.accessibility.transcribes-spoken-dialog") && r.includes("public.accessibility.describes-music-and-sound") ? "caption" : "subtitle" : r.includes("public.accessibility.describes-video") && (u = "visually impaired");
      r.length || k2 !== "subtitle" || r.push("subtitle");
      a = {
        id: a.H++,
        originalId: f,
        groupId: null,
        createSegmentIndex: function() {
          return Promise.resolve();
        },
        segmentIndex: null,
        mimeType: q,
        codecs: b,
        kind: c == tc ? "subtitle" : void 0,
        encrypted: false,
        drmInfos: [],
        keyIds: /* @__PURE__ */ new Set(),
        language: zc(d || "und"),
        originalLanguage: d,
        label: f,
        type: c,
        primary: e,
        trickModeVideo: null,
        dependencyStream: null,
        emsgSchemeIdUris: null,
        frameRate: void 0,
        pixelAspectRatio: void 0,
        width: void 0,
        height: void 0,
        bandwidth: void 0,
        roles: r,
        forced: l,
        channelsCount: g,
        audioSamplingRate: m,
        spatialAudio: n,
        closedCaptions: h,
        hdr: void 0,
        colorGamut: void 0,
        videoLayout: void 0,
        tilesLayout: void 0,
        accessibilityPurpose: u,
        external: false,
        fastSwitching: false,
        fullMimeTypes: /* @__PURE__ */ new Set(),
        isAudioMuxedInVideo: false,
        baseOriginalId: null
      };
      mz(a);
      return a;
    }
    function Gy(a, b, c, d, e) {
      var f, g, h, k2, l, m, n, q, r, u, w, v, y, z, A, C, D, F, B, E, I, J, K, L, M, N, O, Q, R;
      return P(function(V) {
        switch (V.g) {
          case 1:
            f = /* @__PURE__ */ new Map();
            if (!a.g.ignoreDrmInfo && b.segments) {
              for (g = t(b.segments), h = g.next(); !h.done; h = g.next()) if (k2 = h.value, l = dy(k2.ma, "EXT-X-KEY"), m = null, l.length) for (m = Pz(a, b, k2.ma, d, e), n = t(l), q = n.next(); !q.done; q = n.next()) r = q.value, f.set(r, m);
            }
            w = u = false;
            v = [];
            y = /* @__PURE__ */ new Set();
            z = t(f);
            A = z.next();
          case 2:
            if (A.done) {
              V.B(4);
              break;
            }
            C = A.value;
            D = t(C);
            F = D.next().value;
            B = D.next().value;
            E = F;
            I = B;
            J = ay(E, "METHOD");
            if (J == "NONE") {
              V.B(3);
              break;
            }
            u = true;
            K = $x(E, "KEYFORMAT") || "identity";
            L = null;
            if (qz(J)) {
              w = true;
              V.B(3);
              break;
            }
            if (K == "identity") return G(V, rz(a, E, c, d, I, e), 11);
            M = a.jc.get(K);
            if (!M) {
              N = null;
              V.B(9);
              break;
            }
            return G(V, M(E, c, I), 10);
          case 10:
            N = V.h;
          case 9:
            L = N;
            V.B(6);
            break;
          case 11:
            L = V.h;
          case 6:
            if (L) {
              if (L.keyIds) for (O = t(L.keyIds), Q = O.next(); !Q.done; Q = O.next()) R = Q.value, y.add(R);
              v.push(L);
            }
          case 3:
            A = z.next();
            V.B(2);
            break;
          case 4:
            return V.return({ drmInfos: v, keyIds: y, encrypted: u, Fi: w });
        }
      });
    }
    function Qz(a, b, c, d, e) {
      if (!window2.crypto || !window2.crypto.subtle) throw bb("Web Crypto API is not available to decrypt AES. (Web Crypto only exists in secure origins like https)"), new U(2, 4, 4042);
      var f = 0, g = $x(b, "IV", "");
      if (g) {
        var h = kc(g.substr(2));
        if (h.byteLength != 16) throw new U(2, 4, 4048);
      } else f = gy(c.ma, "EXT-X-MEDIA-SEQUENCE", 0);
      var k2 = hy(d(), ay(b, "URI"), e), l = k2.sort().join("");
      c = b.toString() + "-" + f + "-" + l;
      if (!a.ea.has(c)) {
        var m = { bitsKey: 128, blockCipherMode: "CBC", iv: h, firstMediaSequenceNumber: f };
        switch (ay(
          b,
          "METHOD"
        )) {
          case "AES-256":
            m.bitsKey = 256;
            break;
          case "AES-256-CTR":
            m.bitsKey = 256, m.blockCipherMode = "CTR";
        }
        m.fetchKey = function() {
          var n, q, r, u;
          return P(function(w) {
            if (w.g == 1) return a.M.has(l) || (n = ah(k2, a.g.retryParameters), q = fz(a, n, 6).promise, a.M.set(l, q)), G(w, a.M.get(l), 2);
            if (w.g != 3) {
              r = w.h;
              if (!r.data || r.data.byteLength != m.bitsKey / 8) throw new U(2, 4, 4049);
              u = { name: m.blockCipherMode == "CTR" ? "AES-CTR" : "AES-CBC", length: m.bitsKey };
              return G(w, window2.crypto.subtle.importKey("raw", r.data, u, true, ["decrypt"]), 3);
            }
            m.cryptoKey = w.h;
            m.fetchKey = void 0;
            H(w);
          });
        };
        a.ea.set(c, m);
      }
      return a.ea.get(c);
    }
    function Zy(a, b) {
      a.A == null && (b = fy(b.ma, "EXT-X-START")) && (a.A = Number(ay(b, "TIME-OFFSET")));
    }
    function Nz(a, b) {
      var c = fy(b.ma, "EXT-X-PLAYLIST-TYPE");
      b = fy(b.ma, "EXT-X-ENDLIST");
      b = c && c.value == "VOD" || b;
      c = c && c.value == "EVENT" && !b;
      c = !b && !c;
      b ? Cy(a, vy) : c ? Cy(a, gz) : Cy(a, Rz);
    }
    function Jy(a, b) {
      var c = Infinity, d = b.segments;
      if (d.length) for (var e = d.length - 1; e >= 0; ) {
        var f = fy(d[e].ma, "EXTINF");
        if (f) {
          c = Number(f.value.split(",")[0]);
          break;
        }
        e--;
      }
      d = fy(b.ma, "EXT-X-TARGETDURATION");
      if (!d) throw new U(2, 4, 4024, "EXT-X-TARGETDURATION");
      d = Number(d.value);
      if (e = fy(b.ma, "EXT-X-PART-INF")) a.P = Number(ay(e, "PART-TARGET"));
      b = fy(b.ma, "EXT-X-SERVER-CONTROL");
      a.aa && a.P ? (a.u = a.kc ? a.P * 5 <= c ? Math.min(a.P, a.u) : Math.min(c, a.u) : Math.min(a.P, a.u), a.Ma = b ? Number(ay(b, "PART-HOLD-BACK")) : 0) : (a.u = Math.min(c, a.u), c = b ? Zx(b, "HOLD-BACK") : null, a.Ia = c ? Number(c.value) : 0);
      a.Oa = Math.max(d, a.Oa);
    }
    function $y(a, b) {
      var c = 0;
      if (a.g.defaultPresentationDelay) c = a.g.defaultPresentationDelay;
      else if (a.Ma) c = a.Ma;
      else if (a.Ia) c = a.Ia;
      else for (var d = b.segments.length, e = d - Math.min(d, a.g.hls.liveSegmentsDelay); e < d; e++) {
        var f = fy(b.segments[e].ma, "EXTINF");
        c = f ? c + Number(f.value.split(",")[0]) : c + a.Oa;
      }
      a.A && a.A < 0 && (c = Math.min(-a.A, c), a.A += c);
      a.l.Nj(0);
      a.l.ci(c);
      a.l.rd(false);
    }
    function Pz(a, b, c, d, e) {
      var f = fy(c, "EXT-X-MAP");
      if (!f) return null;
      var g = ay(f, "URI"), h = hy(d(), g, e);
      g = [h.toString(), $x(f, "BYTERANGE", "")].join("-");
      if (!a.ua.has(g)) {
        var k2 = void 0, l = null, m = false;
        c = t(c);
        for (var n = c.next(); !n.done; n = c.next()) n = n.value, n.name == "EXT-X-KEY" ? (m = ay(n, "METHOD"), qz(m) && n.id < f.id ? (m = false, k2 = Qz(a, n, b, d, e)) : m = m != "NONE") : n.name == "EXT-X-BYTERANGE" && n.id < f.id && (l = n);
        b = Sz(h, f, l, k2, m);
        a.ua.set(g, b);
      }
      return a.ua.get(g);
    }
    function Sz(a, b, c, d, e) {
      var f = 0, g = null;
      b = $x(b, "BYTERANGE");
      !b && c && (b = c.value);
      b && (f = b.split("@"), g = Number(f[0]), f = Number(f[1]), g = f + g - 1, d && (c = g + 1 - f, c % 16 && (g += 16 - c % 16)));
      return new Aj(function() {
        return a;
      }, f, g, null, null, null, d, e);
    }
    function Tz(a, b, c, d, e, f, g, h, k2) {
      function l(V) {
        V = new rb(V).xb.split(".").pop();
        var Ba = Uz.get(g).get(V);
        Ba || (Ba = dz.get(V));
        return Ba;
      }
      var m = d.ma, n = fy(m, "EXTINF"), q = 0, r = 0, u = null;
      d.Cc.length && (a.m.isLowLatency = true);
      var w = null;
      if (!a.g.hls.ignoreManifestProgramDateTime) {
        var v = fy(m, "EXT-X-PROGRAM-DATE-TIME");
        v && v.value && (w = ce(v.value), a.Va = true);
      }
      var y = Dj;
      fy(m, "EXT-X-GAP") && (a.m.gapCount++, y = 2);
      if (!n) {
        if (d.Cc.length == 0) throw new U(2, 4, 4024, "EXTINF");
        if (!a.aa) return null;
      }
      var z = [];
      v = false;
      var A = null, C = false, D = false;
      if (a.aa && d.Cc.length) {
        q = b && window2.ReadableStream && a.g.hls.allowLowLatencyByteRangeOptimization;
        for (var F = w, B = {}, E = 0; E < d.Cc.length; B = { sg: void 0, Sf: void 0 }, E++) {
          var I = d.Cc[E], J = E == 0 ? c : z[z.length - 1], K = E == 0 ? e : J.endTime, L = Number($x(I, "DURATION")) || a.P;
          if (L) {
            var M = K + L, N = 0, O = null;
            I.name == "EXT-X-PRELOAD-HINT" ? (N = (N = $x(I, "BYTERANGE-START")) ? Number(N) : 0, (J = $x(I, "BYTERANGE-LENGTH")) ? O = N + Number(J) - 1 : N && (O = Number.MAX_SAFE_INTEGER)) : (N = $x(I, "BYTERANGE"), O = t(Vz(J, N)), N = O.next().value, O = O.next().value);
            B.Sf = $x(I, "URI");
            if (B.Sf) {
              J = Dj;
              $x(I, "GAP") == "YES" && (a.m.gapCount++, J = 2, C = true);
              B.sg = null;
              var Q = /* @__PURE__ */ function(V) {
                return function() {
                  V.sg == null && (V.sg = hy(h(), V.Sf, f));
                  return V.sg;
                };
              }(B);
              q && N >= 0 && O != null && (A = Q, v = true);
              K = new Cj(K, M, Q, N, O, b, 0, 0, Infinity, [], "", null, F, J, k2);
              I.name == "EXT-X-PRELOAD-HINT" && (K.Jh(), D = true);
              $x(I, "INDEPENDENT") != "YES" && E > 0 && K.Jd();
              if (B = l(B.Sf)) K.mimeType = B, Wz.has(B) && (K.ha = null);
              z.push(K);
              F && (F += L);
            }
          }
        }
      }
      if (n) {
        n = Number(n.value.split(",")[0]);
        if (n == 0) return null;
        q = e + n;
      } else if (z.length) q = z[z.length - 1].endTime;
      else return null;
      v && (C || z[0].startByte != 0 ? (v = false, A = null) : z = []);
      (n = fy(m, "EXT-X-BYTERANGE")) ? (u = t(Vz(c, n.value)), r = u.next().value, u = u.next().value) : z.length && (r = z[0].startByte, u = z[z.length - 1].endByte);
      c = "";
      n = null;
      g == "image" && (c = "1x1", m = fy(m, "EXT-X-TILES")) && (c = ay(m, "LAYOUT"), (m = $x(m, "DURATION")) && (n = Number(m)));
      var R = null;
      b = new Cj(e, q, function() {
        if (A) return A();
        R == null && (R = hy(h(), d.g, f));
        return R || [];
      }, r, u, b, 0, 0, Infinity, z, c, n, w, y, k2, z.length > 0 && !!d.g);
      if (e = l(d.g)) b.mimeType = e, Wz.has(e) && (b.ha = null);
      v && (a.kc = true, b.jj(), D && b.Jh());
      return b;
    }
    function Vz(a, b) {
      var c = 0, d = null;
      b && (c = b.split("@"), b = Number(c[0]), c = c[1] ? Number(c[1]) : a.endByte + 1, d = c + b - 1);
      return [c, d];
    }
    function Ky(a, b, c, d, e) {
      if (c == "video" || c == "audio") {
        var f = a.l.m;
        if (f && !My(a, c)) for (b = dy(b, "EXT-X-DATERANGE"), b = b.filter(function(J) {
          return Zx(J, "START-DATE") != null;
        }).sort(function(J, K) {
          J = ay(J, "START-DATE");
          K = ay(K, "START-DATE");
          return J < K ? -1 : J > K ? 1 : 0;
        }), c = 0; c < b.length; c++) {
          var g = b[c];
          try {
            var h = ay(g, "START-DATE"), k2 = ce(h);
            if (!isNaN(k2)) {
              var l = Math.max(0, k2 - f), m = null, n = $x(g, "END-DATE");
              if (n) {
                var q = ce(n);
                if (!isNaN(q) && (m = q - f, m < 0)) continue;
              }
              if (m == null) {
                var r = $x(g, "DURATION") || $x(g, "PLANNED-DURATION");
                if (r) {
                  var u = parseFloat(r);
                  isNaN(u) || (m = l + u);
                  if (k2 - f + u < 0) continue;
                }
              }
              var w = $x(g, "CLASS") || "com.apple.quicktime.HLS", v = $x(g, "END-ON-NEXT") == "YES";
              if (m == null && v) {
                for (var y = c + 1; y < b.length; y++) {
                  var z = $x(b[y], "CLASS") || "com.apple.quicktime.HLS";
                  if (w == z) {
                    var A = ay(b[y], "START-DATE"), C = ce(A);
                    if (!isNaN(C) && C && C > k2) {
                      m = Math.max(0, C - f);
                      break;
                    }
                  }
                }
                if (m == null) continue;
              }
              y = ["CLASS", "START-DATE", "END-DATE", "DURATION", "END-ON-NEXT"];
              for (var D = [], F = t(g.attributes), B = F.next(); !B.done; B = F.next()) {
                var E = B.value;
                if (!y.includes(E.name)) {
                  var I = jy(E.value, d);
                  if (E.name == "X-ASSET-URI" || E.name == "X-ASSET-LIST") I = hy(e(), E.value, d)[0];
                  D.push({ key: E.name, description: "", data: I, mimeType: null, pictureType: null });
                }
              }
              if (D.length > 1) a.h.onMetadata(w, l, m, D);
            }
          } catch (J) {
          }
        }
      }
    }
    function Hy(a, b, c, d, e, f) {
      var g = b.segments, h = void 0, k2 = gy(b.ma, "EXT-X-DISCONTINUITY-SEQUENCE", -1), l = gy(b.ma, "EXT-X-MEDIA-SEQUENCE", 0), m = fy(b.ma, "EXT-X-SKIP"), n = m ? Number($x(m, "SKIPPED-SEGMENTS")) : 0, q = l + n, r = 0;
      yy(a) && c.has(q) && (r = c.get(q));
      r === 0 && a.va == gz && c.size > 0 && !c.has(q) && a.l.i != null && (r = a.l.Nb());
      var u = [], w = null;
      m = [];
      for (var v = 0; v < g.length; v++) {
        var y = g[v], z = v == 0 ? r : w.endTime;
        q = l + n + v;
        fy(y.ma, "EXT-X-DISCONTINUITY") && (k2++, w && w.ha && (w.ha.g = z));
        var A = t(y.ma);
        for (var C = A.next(); !C.done; C = A.next()) C = C.value, C.name == "EXT-X-KEY" && (qz(ay(C, "METHOD")) ? h = Qz(a, C, b, e, d) : h = void 0);
        c.set(q, z);
        A = Pz(a, b, y.ma, e, d);
        if (z = Tz(a, A, w, y, z, d, f, e, h)) (w = gy(y.ma, "EXT-X-BITRATE")) ? m.push({ bitrate: w, duration: z.endTime - z.startTime }) : m.length && (w = m.pop(), w.duration += z.endTime - z.startTime, m.push(w)), w = z, z.i = k2, My(a, f) && a.L != null && q < a.L || u.push(z);
      }
      b = void 0;
      m.length && (b = m.reduce(function(D, F) {
        return D + F.duration;
      }, 0), b = Math.round(m.reduce(function(D, F) {
        return D + F.bitrate * F.duration;
      }, 0) / b * 1e3));
      if (m = u.some(function(D) {
        return D.h != null;
      })) {
        for (c = {}, d = 0; d < u.length; c = { qf: void 0, pf: void 0, ef: void 0, od: void 0, df: void 0 }, d++) if (c.od = u[d], c.od.h == null) for (c.pf = 0, c.qf = d, e = /* @__PURE__ */ function(D) {
          return function() {
            var F = u[D.qf];
            if (F) {
              if (F.h != null) return F.h + D.pf;
              D.pf -= F.endTime - F.startTime;
              D.qf += 1;
            }
            return null;
          };
        }(c), c.df = 0, c.ef = d, g = /* @__PURE__ */ function(D) {
          return function() {
            var F = u[D.ef];
            if (F) {
              F != D.od && (D.df += F.endTime - F.startTime);
              if (F.h != null) return F.h + D.df;
              --D.ef;
            }
            return null;
          };
        }(c); c.od.h == null; ) c.od.h = g(), c.od.h == null && (c.od.h = e());
      }
      if (m) for (c = t(u), d = c.next(); !d.done; d = c.next()) for (e = d.value, d = e.h, e = t(e.g), g = e.next(); !g.done; g = e.next()) g = g.value, g.h = d, d += g.endTime - g.startTime;
      c = a.$;
      if (m && c != Infinity && !My(a, f)) for (a = t(u), f = a.next(); !f.done; f = a.next()) f.value.pi(c);
      return { segments: u, bandwidth: b };
    }
    function kz(a, b) {
      if (a == tc) {
        if (b == "vtt" || b == "wvtt") return "text/vtt";
        if (b && b !== "") return "application/mp4";
      }
      return a != "image" || b && b != "jpeg" ? a == "audio" && b == "mp4a.40.34" ? "audio/mpeg" : b == "mjpg" ? "application/mp4" : null : "image/jpeg";
    }
    function lz(a) {
      return a == tc ? "text/vtt" : Uz.get(a).get("mp4");
    }
    function cz(a, b) {
      a = yy(a) ? Math.trunc((b.length - 1) / 2) : 0;
      for (var c = b[a]; c.Oc() == 2 && a + 1 < b.length; ) a++, c = b[a];
      return { segment: c, segmentIndex: a };
    }
    function Oz(a, b, c, d) {
      var e, f, g, h, k2, l, m, n, q, r, u, w, v;
      return P(function(y) {
        switch (y.g) {
          case 1:
            e = gh;
            f = cz(a, d);
            g = f.segment;
            if (g.status == 2) return y.return(lz(b));
            h = g.T();
            k2 = new rb(h[0]);
            l = k2.xb.split(".").pop();
            m = Uz.get(b);
            if ((n = m.get(l)) || (n = dz.get(l)) || (n = kz(b, c))) return y.return(n);
            r = 1;
            u = ah(h, a.g.retryParameters);
            sa(y, 2);
            u.method = "HEAD";
            return G(y, fz(a, u, e, { type: r }).promise, 4);
          case 4:
            w = y.h;
            q = w.headers["content-type"];
            ua(y, 3);
            break;
          case 2:
            v = va(y);
            if (!v || v.code != 1002 && v.code != 1001) {
              y.B(3);
              break;
            }
            u.method = "GET";
            a.g.hls.allowRangeRequestsToGuessMimeType && (u.headers.Range = "bytes=0-0");
            return G(y, fz(a, u, e, { type: r }).promise, 6);
          case 6:
            w = y.h, q = w.headers["content-type"];
          case 3:
            if (!q) {
              y.B(7);
              break;
            }
            n = q.toLowerCase().split(";")[0];
            if (n != "application/octet-stream") {
              y.B(8);
              break;
            }
            if (w.data.byteLength) {
              y.B(9);
              break;
            }
            u.method = "GET";
            return G(y, fz(a, u, e, { type: r }).promise, 10);
          case 10:
            w = y.h;
          case 9:
            xk(Lb(w.data)) && (n = "video/mp2t");
          case 8:
            if (n != "application/octet-stream") return y.return(n);
          case 7:
            return y.return(lz(b));
        }
      });
    }
    function vz(a, b, c, d, e, f, g) {
      a && (a.width = Number(b) || void 0, a.height = Number(c) || void 0, a.frameRate = Number(d) || void 0, a.hdr = e || void 0, a.videoLayout = f || void 0, a.colorGamut = g || void 0);
    }
    function wy(a, b, c) {
      return fz(a, ah(b, a.g.retryParameters), 0, { type: c ? 2 : 3 });
    }
    function uy(a) {
      var b, c, d, e, f, g;
      return P(function(h) {
        switch (h.g) {
          case 1:
            if (!a.h) return h.return();
            sa(h, 2);
            b = Date.now();
            return G(h, a.update(), 4);
          case 4:
            c = Date.now();
            yy(a) && (d = (c - b) / 1e3, a.fb.sample(1, d), e = a.g.updatePeriod > 0 ? a.g.updatePeriod : a.u, f = Math.max(0, e - Oc(a.fb)), a.F.Y(f));
            ua(h, 3);
            break;
          case 2:
            g = va(h);
            if (!a.h) return h.return();
            if (a.g.raiseFatalErrorOnManifestUpdateRequestFailure) return a.h.onError(g), h.return();
            g.severity = 1;
            a.h.onError(g);
            a.F.Y(0.1);
          case 3:
            if (!a.h) return h.return();
            a.h.onManifestUpdated();
            H(h);
        }
      });
    }
    function yy(a) {
      return a.va != vy;
    }
    function Cy(a, b) {
      a.va = b;
      a.l && a.l.rd(!yy(a));
      yy(a) || a.F.stop();
    }
    function fz(a, b, c, d) {
      if (!a.V) throw new U(2, 7, 7001);
      d || (d = {});
      d.isPreload = a.Ob();
      b = a.h.networkingEngine.request(c, b, d);
      Vg(a.V, b);
      return b;
    }
    function qz(a) {
      return a == "AES-128" || a == "AES-256" || a == "AES-256-CTR";
    }
    function ty(a, b, c, d) {
      var e, f, g, h, k2, l;
      return P(function(m) {
        if (m.g == 1) {
          if (c == "video/mp2t") throw new U(2, 4, 4040);
          if ("apple" === window2.shakaMediaKeysPolyfill) throw new U(2, 4, 4041);
          e = ay(b, "METHOD");
          f = ["SAMPLE-AES", "SAMPLE-AES-CTR"];
          if (!f.includes(e)) return m.return(null);
          g = "cenc";
          e == "SAMPLE-AES" && (g = "cbcs");
          h = ay(b, "URI");
          k2 = oc("com.apple.fps", g, [{ initDataType: "sinf", initData: new Uint8Array(0), keyId: null }], h);
          var n = new rb(h).Ib.replace(/-/g, "").toLowerCase();
          return (l = n.length === 32 && /^[0-9a-f]+$/.test(n) ? n : null) || !d ? m.B(2) : G(m, Xz(a, d), 3);
        }
        m.g != 2 && (l = m.h);
        l && k2.keyIds.add(l);
        return m.return(k2);
      });
    }
    function rz(a, b, c, d, e, f) {
      var g, h, k2, l, m, n, q, r, u, w, v, y;
      return P(function(z) {
        switch (z.g) {
          case 1:
            if (c == "video/mp2t") throw new U(2, 4, 4040);
            if ("apple" === window2.shakaMediaKeysPolyfill) throw new U(2, 4, 4041);
            g = ay(b, "METHOD");
            h = ["SAMPLE-AES", "SAMPLE-AES-CTR"];
            if (!h.includes(g)) return z.return(null);
            k2 = hy(d(), ay(b, "URI"), f);
            if (k2[0].startsWith("data:text/plain;base64,")) {
              l = lc(jc(k2[0].split("data:text/plain;base64,").pop()));
              z.B(2);
              break;
            }
            m = k2.sort().join("");
            a.oa.has(m) || (n = ah(k2, a.g.retryParameters), q = fz(a, n, 6).promise, a.oa.set(m, q));
            return G(z, a.oa.get(m), 3);
          case 3:
            r = z.h, l = lc(r.data);
          case 2:
            u = "00000000000000000000000000000000";
            if (!e) {
              z.B(4);
              break;
            }
            return G(z, Xz(a, e), 5);
          case 5:
            (w = z.h) && (u = w);
          case 4:
            return v = /* @__PURE__ */ new Map(), v.set(u, l), y = "cenc", g == "SAMPLE-AES" && (y = "cbcs"), z.return(pc(v, y));
        }
      });
    }
    function Xz(a, b) {
      var c, d, e, f;
      return P(function(g) {
        if (g.g == 1) {
          c = null;
          if (a.sa.has(b)) return c = a.sa.get(b), g.B(2);
          d = Jm(b.T(), b.Nc(), b.Lc(), a.g.retryParameters);
          e = gh;
          return G(g, fz(a, d, e, { type: 0 }).promise, 3);
        }
        g.g != 2 && (f = g.h, b.Ee(f.data), c = Hm(f.data), a.sa.set(b, c));
        return g.return(c);
      });
    }
    S("shaka.hls.HlsParser", sy);
    var dz = (/* @__PURE__ */ new Map()).set("aac", "audio/aac").set("ac3", "audio/ac3").set("ec3", "audio/ec3").set("mp3", "audio/mpeg"), Yz = (/* @__PURE__ */ new Map()).set("mp4", "audio/mp4").set("mp4a", "audio/mp4").set("m4s", "audio/mp4").set("m4i", "audio/mp4").set("m4a", "audio/mp4").set("m4f", "audio/mp4").set("cmfa", "audio/mp4").set("ts", "video/mp2t").set("tsa", "video/mp2t"), Zz = (/* @__PURE__ */ new Map()).set("mp4", "video/mp4").set("mp4v", "video/mp4").set("m4s", "video/mp4").set("m4i", "video/mp4").set("m4v", "video/mp4").set("m4f", "video/mp4").set("cmfv", "video/mp4").set(
      "ts",
      "video/mp2t"
    ).set("tsv", "video/mp2t"), $z = (/* @__PURE__ */ new Map()).set("mp4", "application/mp4").set("m4s", "application/mp4").set("m4i", "application/mp4").set("m4f", "application/mp4").set("cmft", "application/mp4").set("vtt", "text/vtt").set("webvtt", "text/vtt").set("ttml", "application/ttml+xml"), aA = (/* @__PURE__ */ new Map()).set("jpg", "image/jpeg").set("png", "image/png").set("svg", "image/svg+xml").set("webp", "image/webp").set("avif", "image/avif"), Uz = (/* @__PURE__ */ new Map()).set("audio", Yz).set("video", Zz).set("text", $z).set("image", aA), Wz = new Set(["video/mp2t"].concat(x(ff))), vy = "VOD", Rz = "EVENT", gz = "LIVE", By = { ik: vy, Tm: Rz, dn: gz };
    Gi("application/x-mpegurl", function() {
      return new sy();
    });
    Gi("application/vnd.apple.mpegurl", function() {
      return new sy();
    });
    function bA(a) {
      return bv(a);
    }
    var cA = (/* @__PURE__ */ new Map()).set("com.microsoft.playready", bA).set("com.microsoft.playready.recommendation", bA).set("com.microsoft.playready.software", bA).set("com.microsoft.playready.hardware", bA);
    function dA() {
      var a = this;
      this.h = this.g = null;
      this.l = [];
      this.j = null;
      this.A = 1;
      this.i = null;
      this.F = new Nc(5);
      this.u = new Cf(function() {
        eA(a);
      });
      this.D = new Ug();
      this.m = /* @__PURE__ */ new Map();
      this.C = function() {
        return false;
      };
    }
    p = dA.prototype;
    p.configure = function(a, b) {
      this.g = a;
      b && (this.C = b);
    };
    p.start = function(a, b) {
      var c = this;
      return P(function(d) {
        if (d.g == 1) return c.l = [a], c.h = b, G(d, fA(c), 2);
        if (!c.h) throw new U(2, 7, 7001);
        return d.return(c.j);
      });
    };
    function eA(a) {
      var b;
      P(function(c) {
        switch (c.g) {
          case 1:
            return sa(c, 2), G(c, fA(a), 4);
          case 4:
            ua(c, 3);
            break;
          case 2:
            b = va(c), a.h && (b.severity = 1, a.h.onError(b));
          case 3:
            if (!a.h) return c.return();
            H(c);
        }
      });
    }
    p.stop = function() {
      this.g = this.h = null;
      this.l = [];
      this.j = null;
      this.u != null && (this.u.stop(), this.u = null);
      this.m.clear();
      return this.D.destroy();
    };
    p.update = function() {
      var a = this, b;
      return P(function(c) {
        if (c.g == 1) return sa(c, 2), G(c, fA(a), 4);
        if (c.g != 2) return ua(c, 0);
        b = va(c);
        if (!a.h || !b) return c.return();
        a.h.onError(b);
        H(c);
      });
    };
    p.onExpirationUpdated = function() {
    };
    p.onInitialVariantChosen = function() {
    };
    p.banLocation = function() {
    };
    p.setMediaElement = function() {
    };
    function fA(a) {
      var b, c, d, e, f, g, h;
      return P(function(k2) {
        if (k2.g == 1) return b = ah(a.l, a.g.retryParameters), c = a.h.networkingEngine, d = Date.now(), e = c.request(0, b, { type: 5, isPreload: a.C() }), Vg(a.D, e), G(k2, e.promise, 2);
        f = k2.h;
        if (!a.h) return k2.return();
        f.uri && !a.l.includes(f.uri) && a.l.unshift(f.uri);
        var l = f.uri, m = f.data, n = a.g.mss.manifestPreprocessor;
        if (n != Wn) {
          Wc("manifest.mss.manifestPreprocessor configuration", "Please Use manifest.mss.manifestPreprocessorTXml instead.");
          m = Sw(m, "SmoothStreamingMedia");
          if (!m) throw new U(
            2,
            4,
            4046,
            l
          );
          n(m);
          m = ac(m.outerHTML);
        }
        var q = Kd(m, "SmoothStreamingMedia");
        if (!q) throw new U(2, 4, 4046, l);
        l = a.g.mss.manifestPreprocessorTXml;
        l != Xn && l(q);
        a.i || (a.i = new Al(null, 0));
        if (l = $d(q, "IsLive", ke, false)) throw new U(2, 4, 4047);
        a.i.rd(!l);
        n = $d(q, "TimeScale", he, 1e7);
        m = $d(q, "DVRWindowLength", he);
        l && (m === 0 || isNaN(m)) && (m = Infinity);
        var r = $d(q, "CanSeek", ke, false);
        m === 0 && r && (m = Infinity);
        r = null;
        m && m > 0 && (r = m / n);
        l && !isNaN(a.g.availabilityWindowOverride) && (r = a.g.availabilityWindowOverride);
        r == null && (r = Infinity);
        a.i.hg(r);
        m = $d(q, "Duration", he, Infinity);
        l || a.i.yb(m / n);
        l = { variants: [], textStreams: [], timescale: n, duration: m / n };
        var u;
        r = Sd(q, "Protection");
        n = a.g.mss.keySystemsBySystemId;
        m = [];
        r = t(r);
        for (u = r.next(); !u.done; u = r.next()) m = m.concat(Sd(u.value, "ProtectionHeader"));
        if (m.length) {
          r = [];
          for (u = 0; u < m.length; u++) {
            var w = m[u], v = w.attributes.SystemID.toLowerCase(), y = n[v];
            if (y) {
              var z;
              a: {
                if (z = $u(w)) {
                  z = t(Vd(z, "DATA"));
                  for (var A = z.next(); !A.done; A = z.next()) if (A = Xd(A.value, "KID")) {
                    z = jc(Td(A));
                    z = new Uint8Array([
                      z[3],
                      z[2],
                      z[1],
                      z[0],
                      z[5],
                      z[4],
                      z[7],
                      z[6]
                    ].concat(x(z.slice(8))));
                    z = lc(z);
                    break a;
                  }
                }
                z = null;
              }
              A = jc(Td(w));
              v = kc(v.replace(/-/g, ""));
              v = [{ initData: Bh(A, v, /* @__PURE__ */ new Set(), 0), initDataType: "cenc", keyId: z }];
              v = oc(y, "cenc", v);
              z && v.keyIds.add(z);
              if (y = cA.get(y)) v.licenseServerUri = y(w);
              r.push(v);
            }
          }
          n = r;
        } else n = [];
        u = n;
        r = [];
        n = [];
        m = [];
        q = Sd(q, "StreamIndex");
        q = t(q);
        for (w = q.next(); !w.done; w = q.next()) {
          w = w.value;
          y = Sd(w, "QualityLevel");
          v = l.timescale;
          z = l.duration;
          A = Sd(w, "c");
          for (var C = [], D = 0, F = 0; F < A.length; ++F) {
            var B = A[F], E = A[F + 1], I = $d(B, "t", he), J = $d(
              B,
              "d",
              he
            );
            B = $d(B, "r", fe);
            if (!J) break;
            I = I != null ? I : D;
            (B = B || 0) && B--;
            if (B < 0) if (E) {
              E = $d(E, "t", he);
              if (E == null) break;
              else if (I >= E) break;
              B = Math.ceil((E - I) / J) - 1;
            } else {
              if (z == Infinity) break;
              else if (I / v >= z) break;
              B = Math.ceil((z * v - I) / J) - 1;
            }
            for (E = 0; E <= B; ++E) D = I + J, C.push({ start: I / v, end: D / v, xi: I }), I = D;
          }
          v = C;
          y = t(y);
          for (z = y.next(); !z.done; z = y.next()) (z = gA(a, w, z.value, v, u, l)) && (z.type != "audio" || a.g.disableAudio ? z.type != "video" || a.g.disableVideo ? z.type != tc || a.g.disableText || m.push(z) : n.push(z) : r.push(z));
        }
        q = [];
        r = t(r.length > 0 ? r : [null]);
        for (u = r.next(); !u.done; u = r.next()) for (u = u.value, w = t(n.length > 0 ? n : [null]), C = w.next(); !C.done; C = w.next()) y = q, v = y.push, z = a, A = u, C = C.value, F = 0, A && A.bandwidth && A.bandwidth > 0 && (F += A.bandwidth), C && C.bandwidth && C.bandwidth > 0 && (F += C.bandwidth), z = { id: z.A++, language: A ? A.language : "und", disabledUntilTime: 0, primary: !!A && A.primary || !!C && C.primary, audio: A, video: C, bandwidth: F, allowedByApplication: true, allowedByKeySystem: true, decodingInfos: [] }, v.call(y, z);
        l.variants = q;
        l.textStreams = m;
        a.j ? (a.j.variants = l.variants, a.j.textStreams = l.textStreams, a.h.filter(a.j)) : (a.j = { presentationTimeline: a.i, variants: l.variants, textStreams: l.textStreams, imageStreams: [], offlineSessionIds: [], sequenceMode: a.g.mss.sequenceMode, ignoreManifestTimestampsInSegmentsMode: false, type: "MSS", serviceDescription: null, nextUrl: null, periodCount: 1, gapCount: 0, isLowLatency: false, startTime: null }, a.i.If());
        Promise.resolve();
        g = Date.now();
        h = (g - d) / 1e3;
        a.F.sample(1, h);
        H(k2);
      });
    }
    function gA(a, b, c, d, e, f) {
      var g = b.attributes.Type;
      if (g !== "audio" && g !== "video" && g !== "text") return bb("Ignoring unrecognized type:", g), null;
      var h = b.attributes.Language, k2 = a.A++, l = $d(c, "Bitrate", ge), m = $d(c, "MaxWidth", ge), n = $d(c, "MaxHeight", ge), q = $d(c, "Channels", ge), r = $d(c, "SamplingRate", ge), u = f.duration;
      d.length && (u = d[d.length - 1].end - d[0].start);
      var w = a.i.getDuration();
      a.i.yb(Math.min(u, w));
      var v = {
        id: k2,
        originalId: b.attributes.Name || String(k2),
        groupId: null,
        createSegmentIndex: function() {
          return Promise.resolve();
        },
        closeSegmentIndex: function() {
          return Promise.resolve();
        },
        segmentIndex: null,
        mimeType: "",
        codecs: "",
        frameRate: void 0,
        pixelAspectRatio: void 0,
        bandwidth: l || 0,
        width: m || void 0,
        height: n || void 0,
        kind: "",
        encrypted: e.length > 0,
        drmInfos: e,
        keyIds: /* @__PURE__ */ new Set(),
        language: zc(h || "und"),
        originalLanguage: h,
        label: "",
        type: "",
        primary: false,
        trickModeVideo: null,
        dependencyStream: null,
        emsgSchemeIdUris: [],
        roles: [],
        forced: false,
        channelsCount: q,
        audioSamplingRate: r,
        spatialAudio: false,
        closedCaptions: null,
        hdr: void 0,
        colorGamut: void 0,
        videoLayout: void 0,
        tilesLayout: void 0,
        matchedStreams: [],
        mssPrivateData: { duration: u, timescale: f.timescale, codecPrivateData: null },
        accessibilityPurpose: null,
        external: false,
        fastSwitching: false,
        fullMimeTypes: /* @__PURE__ */ new Set(),
        isAudioMuxedInVideo: false,
        baseOriginalId: null
      };
      if (e = b.attributes.Subtype) (e = hA.get(e)) && v.roles.push(e), e === "main" && (v.primary = true);
      e = c.attributes.FourCC;
      if (e === null || e === "") e = b.attributes.FourCC;
      if (!e) {
        if (g === "audio") e = "AAC";
        else if (g === "video") return bb('FourCC is not defined whereas it is required for a QualityLevel element for a StreamIndex of type "video"'), null;
      }
      if (!iA.includes(e.toUpperCase())) return bb("Codec not supported:", e), null;
      c = jA(c, g, e, v);
      v.mssPrivateData.codecPrivateData = c;
      switch (g) {
        case "audio":
          if (!c) return bb("Quality unsupported without CodecPrivateData", g), null;
          v.type = "audio";
          v.mimeType = "mss/audio/mp4";
          v.codecs = kA(e, c);
          break;
        case "video":
          if (!c) return bb("Quality unsupported without CodecPrivateData", g), null;
          v.type = "video";
          v.mimeType = "mss/video/mp4";
          v.codecs = lA(c);
          break;
        case "text":
          if (v.type = tc, v.mimeType = "application/mp4", e === "TTML" || e === "DFXP") v.codecs = "stpp";
      }
      v.fullMimeTypes.add(ef(v.mimeType, v.codecs));
      v.createSegmentIndex = function() {
        if (v.segmentIndex) return Promise.resolve();
        if (a.m.has(v.id)) var y = a.m.get(v.id);
        else y = [], v.type == "video" && (y = v.mssPrivateData.codecPrivateData.split("00000001").slice(1)), y = { id: v.id, type: v.type, codecs: v.codecs, encrypted: v.encrypted, timescale: v.mssPrivateData.timescale, duration: v.mssPrivateData.duration, Gb: y, Na: new Uint8Array([]), Xa: new Uint8Array([]), eb: 0, gb: 0, data: null, stream: v }, y = Wi(new Vi([y])), a.m.set(v.id, y);
        y = mA(a, new Aj(function() {
          return [];
        }, 0, null, nm(v), v.mssPrivateData.timescale, y, null, v.encrypted), v, b, d);
        v.segmentIndex = new Zl(y);
        return Promise.resolve();
      };
      v.closeSegmentIndex = function() {
        v.segmentIndex && (v.segmentIndex.release(), v.segmentIndex = null);
      };
      return v;
    }
    function jA(a, b, c, d) {
      if (a = a.attributes.CodecPrivateData) return a;
      if (b !== "audio") return null;
      b = d.channelsCount || 2;
      a = d.audioSamplingRate || 44100;
      var e = { 96e3: 0, 88200: 1, 64e3: 2, 48e3: 3, 44100: 4, 32e3: 5, 24e3: 6, 22050: 7, 16e3: 8, 12e3: 9, 11025: 10, 8e3: 11, 7350: 12 };
      d = e[a];
      if (c === "AACH") return c = new Uint8Array(4), a = e[a * 2], c[0] = 40 | d >> 1, c[1] = d << 7 | b << 3 | a >> 1, c[2] = a << 7 | 8, c[3] = 0, b = new Uint16Array(2), b[0] = (c[0] << 8) + c[1], b[1] = (c[2] << 8) + c[3], b[0].toString(16) + b[1].toString(16);
      c = new Uint8Array(2);
      c[0] = 16 | d >> 1;
      c[1] = d << 7 | b << 3;
      b = new Uint16Array(1);
      b[0] = (c[0] << 8) + c[1];
      return b[0].toString(16);
    }
    function kA(a, b) {
      var c = 0;
      a === "AACH" && (c = 5);
      b ? c === 0 && (c = (parseInt(b.substr(0, 2), 16) & 248) >> 3) : (c = 2, a === "AACH" && (c = 5));
      return "mp4a.40." + c;
    }
    function lA(a) {
      var b = /00000001[0-9]7/.exec(a);
      return b.length && a ? "avc1." + a.substr(a.indexOf(b[0]) + 10, 6) : "";
    }
    function mA(a, b, c, d, e) {
      var f = d.attributes.Url.replace("{bitrate}", String(c.bandwidth));
      d = [];
      e = t(e);
      for (var g = e.next(), h = {}; !g.done; h = { mg: void 0 }, g = e.next()) h.mg = g.value, d.push(new Cj(h.mg.start, h.mg.end, /* @__PURE__ */ function(k2) {
        return function() {
          return nc(a.l, [f.replace("{start time}", String(k2.mg.xi))]);
        };
      }(h), 0, null, b, 0, 0, c.mssPrivateData.duration));
      return d;
    }
    S("shaka.mss.MssParser", dA);
    var iA = "AAC AACL AACH AACP AVC1 H264 TTML DFXP".split(" "), hA = (/* @__PURE__ */ new Map()).set("CAPT", "main").set("SUBT", "alternate").set("DESC", "main");
    Gi("application/vnd.ms-sstr+xml", function() {
      return new dA();
    });
    function nA(a, b, c, d, e, f, g) {
      if (c >= 200 && c <= 299 && c != 202 || c == 304) return { uri: e || d, originalUri: d, data: b, status: c, headers: a, fromCache: !!a["x-shaka-from-cache"], originalRequest: f };
      f = null;
      try {
        f = $b(b);
      } catch (h) {
      }
      throw new U(c == 401 || c == 403 ? 2 : 1, 1, 1001, d, c, f, a, g, e || d);
    }
    ;
    function oA() {
    }
    function pA(a, b, c, d, e, f) {
      var g = new qA();
      kh(b.headers).forEach(function(m, n) {
        g.append(n, m);
      });
      var h = new rA(), k2 = { Ki: false, bk: false };
      a = sA(a, b, c, { body: b.body || void 0, headers: g, method: b.method, signal: h.signal, credentials: b.allowCrossSiteCredentials ? "include" : void 0 }, k2, d, e, b.streamDataCallback, f.minBytesForProgressEvents || 0);
      a = new Ng(a, function() {
        k2.Ki = true;
        h.abort();
        return Promise.resolve();
      });
      if (b = b.retryParameters.timeout) {
        var l = new Cf(function() {
          k2.bk = true;
          h.abort();
        });
        l.Y(b / 1e3);
        a.finally(function() {
          l.stop();
        });
      }
      return a;
    }
    function sA(a, b, c, d, e, f, g, h, k2) {
      var l, m, n, q, r, u, w, v, y, z, A, C, D, F, B;
      return P(function(E) {
        switch (E.g) {
          case 1:
            return l = tA, m = uA, q = new ArrayBuffer(0), u = r = 0, w = {}, v = Date.now(), sa(E, 2), G(E, l(a, d), 4);
          case 4:
            n = E.h;
            w = vA(n.headers);
            g(w);
            if (d.method == "HEAD") {
              E.B(5);
              break;
            }
            z = (y = n.headers.get("Content-Length")) ? parseInt(y, 10) : 0;
            if (!n.body) return G(E, n.arrayBuffer(), 9);
            A = n.clone().body.getReader();
            C = function(I) {
              function J() {
                var K, L, M, N;
                return P(function(O) {
                  switch (O.g) {
                    case 1:
                      return sa(O, 2), G(O, A.read(), 4);
                    case 4:
                      K = O.h;
                      ua(O, 3);
                      break;
                    case 2:
                      return va(O), O.return();
                    case 3:
                      if (K.done) {
                        O.B(5);
                        break;
                      }
                      r += K.value.byteLength;
                      if (!h) {
                        O.B(5);
                        break;
                      }
                      return G(O, h(K.value), 5);
                    case 5:
                      L = Date.now();
                      M = r - u;
                      if (L - v > 100 && M >= k2 || K.done) N = K.done ? 0 : z - r, f(L - v, M, N), u = r, v = L;
                      K.done ? I.close() : (I.enqueue(K.value), J());
                      H(O);
                  }
                });
              }
              J();
            };
            new m({ start: C });
            return G(E, n.arrayBuffer(), 8);
          case 8:
            q = E.h;
            E.B(5);
            break;
          case 9:
            q = E.h, D = Date.now(), f(D - v, q.byteLength, 0);
          case 5:
            b.headers.Range && (F = b.headers.Range.replace("bytes=", "").split("-").filter(function(I) {
              return I;
            }).map(function(I) {
              return parseInt(
                I,
                10
              );
            }), F.length == 2 && q.byteLength != F[1] - F[0] + 1 && bb("Payload length does not match range requested bytes", b, n));
            ua(E, 3);
            break;
          case 2:
            B = va(E);
            if (e.Ki) throw new U(1, 1, 7001, a, c);
            if (e.bk) throw new U(1, 1, 1003, a, c);
            throw new U(1, 1, 1002, a, B, c);
          case 3:
            return E.return(nA(w, q, n.status, a, n.url, b, c));
        }
      });
    }
    function vA(a) {
      var b = {};
      a.forEach(function(c, d) {
        b[d.trim()] = c;
      });
      return b;
    }
    function wA() {
      if (window2.ReadableStream) try {
        new ReadableStream({});
      } catch (a) {
        return false;
      }
      else return false;
      if (window2.Response) {
        if (!new Response("").body) return false;
      } else return false;
      return !(!window2.fetch || "polyfill" in window2.fetch || !window2.AbortController);
    }
    S("shaka.net.HttpFetchPlugin", oA);
    oA.isSupported = wA;
    oA.parse = pA;
    var tA = window2.fetch, rA = window2.AbortController, uA = window2.ReadableStream, qA = window2.Headers;
    wA() && (Xg("http", pA, 2, true), Xg("https", pA, 2, true), Xg("blob", pA, 2, true));
    function xA() {
    }
    function yA(a, b, c, d, e, f) {
      var g = new zA(), h = Date.now(), k2 = 0, l = new Promise(function(m, n) {
        g.open(b.method, a, true);
        g.responseType = "arraybuffer";
        g.timeout = b.retryParameters.timeout;
        g.withCredentials = b.allowCrossSiteCredentials;
        var q = {};
        g.onabort = function() {
          n(new U(1, 1, 7001, a, c));
        };
        g.onreadystatechange = function() {
          if (g.readyState === XMLHttpRequest.HEADERS_RECEIVED) {
            var u = g.getAllResponseHeaders().trim().split("\r\n"), w = {};
            u = t(u);
            for (var v = u.next(); !v.done; v = u.next()) v = v.value.split(": "), w[v[0].toLowerCase()] = v.slice(1).join(": ");
            q = w;
            e(q);
          }
        };
        g.onload = function(u) {
          var w = g.response;
          try {
            d(Date.now() - h, u.loaded - k2, 0);
            var v = nA(q, w, g.status, a, g.responseURL, b, c);
            m(v);
          } catch (y) {
            n(y);
          }
        };
        g.onerror = function(u) {
          n(new U(1, 1, 1002, a, u, c));
        };
        g.ontimeout = function() {
          n(new U(1, 1, 1003, a, c));
        };
        g.onprogress = function(u) {
          var w = Date.now(), v = f.minBytesForProgressEvents || 0, y = u.loaded - k2;
          if (w - h > 100 && y >= v || u.lengthComputable && u.loaded == u.total) d(w - h, y, g.readyState == 4 ? 0 : u.total - u.loaded), k2 = u.loaded, h = w;
        };
        for (var r in b.headers) g.setRequestHeader(
          r.toLowerCase(),
          b.headers[r]
        );
        g.send(b.body);
      });
      return new Ng(l, function() {
        g.abort();
        return Promise.resolve();
      });
    }
    S("shaka.net.HttpXHRPlugin", xA);
    xA.parse = yA;
    var zA = window2.XMLHttpRequest;
    Xg("http", yA, 1, true);
    Xg("https", yA, 1, true);
    Xg("blob", yA, 1, true);
    function AA(a, b, c, d, e) {
      this.g = a;
      this.i = b;
      this.groupId = c;
      this.h = d;
      this.j = e;
    }
    function BA(a) {
      var b = a.fc(false);
      return b ? ic(b) : a.T().map(function(c) {
        return "{" + encodeURI(c.split("#xywh=")[0]) + "}";
      }).join("") + ":" + a.startByte + ":" + a.endByte;
    }
    function CA(a, b) {
      return Jm(a.g.T(), a.g.startByte, a.g.endByte, b.streaming.retryParameters);
    }
    ;
    function DA() {
      this.g = this.j = this.i = 0;
      this.h = /* @__PURE__ */ new Map();
      this.l = 0;
    }
    function EA(a, b) {
      a.i += b;
      var c = a.l;
      a.l++;
      a.h.set(c, b);
      return c;
    }
    DA.prototype.close = function(a, b) {
      if (this.h.has(a)) {
        var c = this.h.get(a);
        this.h.delete(a);
        this.j += c;
        this.g += b;
      }
    };
    function FA(a) {
      return a.i == 0 ? 0 : a.j / a.i;
    }
    ;
    function GA(a) {
      var b = this;
      this.A = a;
      this.i = /* @__PURE__ */ new Map();
      this.h = new ih(function() {
        return HA(b).catch(function() {
        });
      });
      this.j = [];
      this.u = function() {
      };
      this.m = function() {
      };
      this.g = new DA();
      this.l = false;
    }
    GA.prototype.destroy = function() {
      return this.h.destroy();
    };
    function IA(a, b, c) {
      a.u = b;
      a.m = c;
    }
    function HA(a) {
      a.l = true;
      var b = a.j.map(function(c) {
        return c();
      });
      a.j = [];
      return Promise.all(b);
    }
    GA.prototype.queue = function(a, b, c, d, e) {
      var f = this;
      jh(this.h);
      var g = (this.i.get(a) || Promise.resolve()).then(function() {
        var h, k2, l, m, n, q, r;
        return P(function(u) {
          if (u.g == 1) return G(u, JA(f, b), 2);
          h = u.h;
          if (f.h.g) throw new U(2, 9, 7001);
          if (d) for (m in k2 = Lb(h), l = new Ah(k2), l.data) n = Number(m), q = l.data[n], r = l.g[n], f.m(q, r);
          f.g.close(c, h.byteLength);
          f.u(FA(f.g), f.g.g);
          return u.return(e(h));
        });
      });
      this.i.set(a, g);
      return g;
    };
    function KA(a, b, c, d, e, f) {
      jh(a.h);
      var g = (a.i.get(b) || Promise.resolve()).then(function() {
        if (a.h.g) throw new U(2, 9, 7001);
        if (e) {
          var h = Lb(c);
          h = new Ah(h);
          for (var k2 in h.data) {
            var l = Number(k2);
            a.m(h.data[l], h.g[l]);
          }
        }
        a.g.close(d, c.byteLength);
        a.u(FA(a.g), a.g.g);
        return f(c);
      });
      a.i.set(b, g);
    }
    function LA(a) {
      return P(function(b) {
        return b.g == 1 ? G(b, Promise.all(a.i.values()), 2) : b.return(a.g.g);
      });
    }
    function JA(a, b) {
      var c, d, e, f;
      return P(function(g) {
        if (g.g == 1) return c = gh, d = a.A.request(c, b), e = function() {
          return d.abort();
        }, a.j.push(e), G(g, d.promise, 2);
        f = g.h;
        ud(a.j, e);
        return g.return(f.data);
      });
    }
    ;
    function MA(a, b) {
      var c = this;
      this.i = a;
      this.h = a.objectStore(b);
      this.g = new Mg();
      a.onabort = function(d) {
        d.preventDefault();
        c.g.reject();
      };
      a.onerror = function(d) {
        d.preventDefault();
        c.g.reject();
      };
      a.oncomplete = function() {
        c.g.resolve();
      };
    }
    MA.prototype.abort = function() {
      var a = this;
      return P(function(b) {
        if (b.g == 1) {
          try {
            a.i.abort();
          } catch (c) {
          }
          sa(b, 2);
          return G(b, a.g, 4);
        }
        if (b.g != 2) return ua(b, 0);
        va(b);
        H(b);
      });
    };
    function NA(a, b) {
      return new Promise(function(c, d) {
        var e = a.h.openCursor();
        e.onerror = d;
        e.onsuccess = function() {
          var f;
          return P(function(g) {
            if (g.g == 1) {
              if (e.result == null) return c(), g.return();
              f = e.result;
              return G(g, b(f.key, f.value, f), 2);
            }
            f.continue();
            H(g);
          });
        };
      });
    }
    MA.prototype.store = function() {
      return this.h;
    };
    MA.prototype.promise = function() {
      return this.g;
    };
    function OA(a) {
      this.h = a;
      this.g = [];
    }
    OA.prototype.destroy = function() {
      return Promise.all(this.g.map(function(a) {
        return a.abort();
      }));
    };
    function PA(a, b) {
      return QA(a, b, "readwrite");
    }
    function QA(a, b, c) {
      c = a.h.transaction([b], c);
      var d = new MA(c, b);
      a.g.push(d);
      d.promise().then(function() {
        ud(a.g, d);
      }, function() {
        ud(a.g, d);
      });
      return d;
    }
    ;
    function RA(a, b, c) {
      this.h = new OA(a);
      this.i = b;
      this.g = c;
    }
    p = RA.prototype;
    p.destroy = function() {
      return this.h.destroy();
    };
    p.hasFixedKeySpace = function() {
      return true;
    };
    p.addSegments = function() {
      return SA(this.i);
    };
    p.removeSegments = function(a, b) {
      return TA(this, this.i, a, b);
    };
    p.getSegments = function(a) {
      var b = this, c;
      return P(function(d) {
        if (d.g == 1) return G(d, UA(b, b.i, a), 2);
        c = d.h;
        return d.return(c.map(function(e) {
          return b.Pi(e);
        }));
      });
    };
    p.addManifests = function() {
      return SA(this.g);
    };
    p.updateManifest = function() {
      return Promise.reject(new U(2, 9, 9016, "Cannot modify values in " + this.g));
    };
    function VA(a, b, c) {
      a = PA(a.h, a.g);
      var d = a.store();
      d.get(b).onsuccess = function() {
        d.put(c, b);
      };
      return a.promise();
    }
    p.updateManifestExpiration = function(a, b) {
      var c = PA(this.h, this.g), d = c.store();
      d.get(a).onsuccess = function(e) {
        if (e = e.target.result) e.expiration = b, d.put(e, a);
      };
      return c.promise();
    };
    p.removeManifests = function(a, b) {
      return TA(this, this.g, a, b);
    };
    p.getManifests = function(a) {
      var b = this, c;
      return P(function(d) {
        if (d.g == 1) return G(d, UA(b, b.g, a), 2);
        c = d.h;
        return d.return(Promise.all(c.map(function(e) {
          return b.ee(e);
        })));
      });
    };
    p.getAllManifests = function() {
      var a = this, b, c;
      return P(function(d) {
        return d.g == 1 ? (b = QA(a.h, a.g, "readonly"), c = /* @__PURE__ */ new Map(), G(d, NA(b, function(e, f) {
          var g;
          return P(function(h) {
            if (h.g == 1) return G(h, a.ee(f), 2);
            g = h.h;
            c.set(e, g);
            H(h);
          });
        }), 2)) : d.g != 3 ? G(d, b.promise(), 3) : d.return(c);
      });
    };
    p.Pi = function(a) {
      return a;
    };
    p.ee = function(a) {
      return Promise.resolve(a);
    };
    function SA(a) {
      return Promise.reject(new U(2, 9, 9011, "Cannot add new value to " + a));
    }
    p.add = function(a, b) {
      var c = this, d, e, f, g, h, k2, l;
      return P(function(m) {
        if (m.g == 1) {
          d = PA(c.h, a);
          e = d.store();
          f = [];
          g = t(b);
          h = g.next();
          for (k2 = {}; !h.done; k2 = { Vh: void 0 }, h = g.next()) l = h.value, k2.Vh = e.add(l), k2.Vh.onsuccess = /* @__PURE__ */ function(n) {
            return function() {
              f.push(n.Vh.result);
            };
          }(k2);
          return G(m, d.promise(), 2);
        }
        return m.return(f);
      });
    };
    function TA(a, b, c, d) {
      a = PA(a.h, b);
      b = a.store();
      c = t(c);
      for (var e = c.next(), f = {}; !e.done; f = { Ih: void 0 }, e = c.next()) f.Ih = e.value, b.delete(f.Ih).onsuccess = /* @__PURE__ */ function(g) {
        return function() {
          return d(g.Ih);
        };
      }(f);
      return a.promise();
    }
    function UA(a, b, c) {
      var d, e, f, g, h, k2, l;
      return P(function(m) {
        if (m.g == 1) {
          d = QA(a.h, b, "readonly");
          e = d.store();
          f = {};
          g = [];
          h = t(c);
          k2 = h.next();
          for (l = {}; !k2.done; l = { ag: void 0, Ef: void 0 }, k2 = h.next()) l.Ef = k2.value, l.ag = e.get(l.Ef), l.ag.onsuccess = /* @__PURE__ */ function(n) {
            return function() {
              n.ag.result == void 0 && g.push(n.Ef);
              f[n.Ef] = n.ag.result;
            };
          }(l);
          return G(m, d.promise(), 2);
        }
        if (g.length) throw new U(2, 9, 9012, "Could not find values for " + g);
        return m.return(c.map(function(n) {
          return f[n];
        }));
      });
    }
    ;
    function WA(a) {
      this.g = new OA(a);
    }
    WA.prototype.destroy = function() {
      return this.g.destroy();
    };
    WA.prototype.getAll = function() {
      var a = this, b, c;
      return P(function(d) {
        return d.g == 1 ? (b = QA(a.g, "session-ids", "readonly"), c = [], G(d, NA(b, function(e, f) {
          c.push(f);
        }), 2)) : d.g != 3 ? G(d, b.promise(), 3) : d.return(c);
      });
    };
    WA.prototype.add = function(a) {
      var b = PA(this.g, "session-ids"), c = b.store();
      a = t(a);
      for (var d = a.next(); !d.done; d = a.next()) c.add(d.value);
      return b.promise();
    };
    WA.prototype.remove = function(a) {
      var b = this, c;
      return P(function(d) {
        return d.g == 1 ? (c = PA(b.g, "session-ids"), G(d, NA(c, function(e, f, g) {
          a.includes(f.sessionId) && g.delete();
        }), 2)) : G(d, c.promise(), 0);
      });
    };
    function XA() {
      this.g = /* @__PURE__ */ new Map();
    }
    XA.prototype.destroy = function() {
      for (var a = [], b = t(this.g.values()), c = b.next(); !c.done; c = b.next()) a.push(c.value.destroy());
      this.g.clear();
      return Promise.all(a);
    };
    XA.prototype.init = function() {
      var a = this;
      YA.forEach(function(e, f) {
        (e = e()) && a.g.set(f, e);
      });
      for (var b = [], c = t(this.g.values()), d = c.next(); !d.done; d = c.next()) b.push(d.value.init());
      return Promise.all(b);
    };
    function ZA(a) {
      var b = null;
      a.g.forEach(function(c, d) {
        c.getCells().forEach(function(e, f) {
          e.hasFixedKeySpace() || b || (b = { path: { Xb: d, jb: f }, jb: e });
        });
      });
      if (b) return b;
      throw new U(2, 9, 9013, "Could not find a cell that supports add-operations");
    }
    function $A(a, b) {
      a.g.forEach(function(c, d) {
        c.getCells().forEach(function(e, f) {
          b({ Xb: d, jb: f }, e);
        });
      });
    }
    function aB(a, b, c) {
      a = a.g.get(b);
      if (!a) throw new U(2, 9, 9013, "Could not find mechanism with name " + b);
      b = a.getCells().get(c);
      if (!b) throw new U(2, 9, 9013, "Could not find cell with name " + c);
      return b;
    }
    function bB(a, b) {
      a.g.forEach(function(c) {
        b(c.getEmeSessionCell());
      });
    }
    function cB(a) {
      var b = Array.from(a.g.keys());
      if (!b.length) throw new U(2, 9, 9e3, "No supported storage mechanisms found");
      return a.g.get(b[0]).getEmeSessionCell();
    }
    function dB(a) {
      var b, c, d;
      return P(function(e) {
        return e.g == 1 ? (b = Array.from(a.g.values()), c = b.length > 0, c || (d = YA, d.forEach(function(f) {
          (f = f()) && b.push(f);
        })), G(e, Promise.all(b.map(function(f) {
          return f.erase();
        })), 2)) : c ? e.B(0) : G(e, Promise.all(b.map(function(f) {
          return f.destroy();
        })), 0);
      });
    }
    function eB(a, b) {
      YA.set(a, b);
    }
    S("shaka.offline.StorageMuxer", XA);
    XA.unregister = function(a) {
      YA.delete(a);
    };
    XA.register = eB;
    XA.prototype.destroy = XA.prototype.destroy;
    var YA = /* @__PURE__ */ new Map();
    function fB() {
      RA.apply(this, arguments);
    }
    ma(fB, RA);
    fB.prototype.updateManifestExpiration = function(a, b) {
      var c = this, d, e, f;
      return P(function(g) {
        d = PA(c.h, c.g);
        e = d.store();
        f = new Mg();
        e.get(a).onsuccess = function(h) {
          (h = h.target.result) ? (h.expiration = b, e.put(h), f.resolve()) : f.reject(new U(2, 9, 9012, "Could not find values for " + a));
        };
        return G(g, Promise.all([d.promise(), f]), 0);
      });
    };
    fB.prototype.ee = function(a) {
      var b, c, d, e, f, g;
      return P(function(h) {
        if (h.g == 1) {
          b = [];
          for (c = 0; c < a.periods.length; ++c) d = c == a.periods.length - 1 ? a.duration : a.periods[c + 1].startTime, e = d - a.periods[c].startTime, f = gB(a.periods[c], e), b.push(f);
          return G(h, ow(b), 2);
        }
        g = h.h;
        return h.return({ creationTime: 0, originalManifestUri: a.originalManifestUri, duration: a.duration, size: a.size, expiration: a.expiration == null ? Infinity : a.expiration, streams: g, sessionIds: a.sessionIds, drmInfo: a.drmInfo, appMetadata: a.appMetadata, sequenceMode: false });
      });
    };
    function gB(a, b) {
      hB(a);
      for (var c = t(a.streams), d = c.next(); !d.done; d = c.next()) ;
      return a.streams.map(function(e) {
        return iB(e, a.startTime, b);
      });
    }
    function iB(a, b, c) {
      var d = a.initSegmentUri ? jB(a.initSegmentUri) : null, e = b + a.presentationTimeOffset, f = b + c;
      return { id: a.id, originalId: null, groupId: null, primary: a.primary, type: a.contentType, mimeType: a.mimeType, codecs: a.codecs, frameRate: a.frameRate, pixelAspectRatio: void 0, hdr: void 0, colorGamut: void 0, videoLayout: void 0, kind: a.kind, language: a.language, originalLanguage: a.language || null, label: a.label, width: a.width, height: a.height, initSegmentKey: d, encrypted: a.encrypted, keyIds: /* @__PURE__ */ new Set([a.keyId]), segments: a.segments.map(function(g) {
        var h = jB(g.uri);
        return { startTime: b + g.startTime, endTime: b + g.endTime, dataKey: h, initSegmentKey: d, appendWindowStart: b, appendWindowEnd: f, timestampOffset: e, tilesLayout: "", mimeType: null, codecs: null, thumbnailSprite: null };
      }), variantIds: a.variantIds, roles: [], forced: false, audioSamplingRate: null, channelsCount: null, spatialAudio: false, closedCaptions: null, tilesLayout: void 0, external: false, fastSwitching: false, isAudioMuxedInVideo: false };
    }
    fB.prototype.Pi = function(a) {
      return { data: a.data };
    };
    function jB(a) {
      var b;
      if ((b = /^offline:[0-9]+\/[0-9]+\/([0-9]+)$/.exec(a)) || (b = /^offline:segment\/([0-9]+)$/.exec(a))) return Number(b[1]);
      throw new U(2, 9, 9004, "Could not parse uri " + a);
    }
    function hB(a) {
      var b = a.streams.filter(function(h) {
        return h.contentType == "audio";
      });
      a = a.streams.filter(function(h) {
        return h.contentType == "video";
      });
      if (!b.every(function(h) {
        return h.variantIds;
      }) || !a.every(function(h) {
        return h.variantIds;
      })) {
        for (var c = t(b), d = c.next(); !d.done; d = c.next()) d.value.variantIds = [];
        c = t(a);
        for (d = c.next(); !d.done; d = c.next()) d.value.variantIds = [];
        c = 0;
        if (a.length && !b.length) {
          d = c++;
          for (var e = t(a), f = e.next(); !f.done; f = e.next()) f.value.variantIds.push(d);
        }
        if (!a.length && b.length) for (d = c++, e = t(b), f = e.next(); !f.done; f = e.next()) f.value.variantIds.push(d);
        if (a.length && b.length) for (b = t(b), d = b.next(); !d.done; d = b.next()) for (d = d.value, e = t(a), f = e.next(); !f.done; f = e.next()) {
          f = f.value;
          var g = c++;
          d.variantIds.push(g);
          f.variantIds.push(g);
        }
      }
    }
    ;
    function kB() {
      RA.apply(this, arguments);
    }
    ma(kB, RA);
    kB.prototype.ee = function(a) {
      var b, c, d, e, f, g;
      return P(function(h) {
        if (h.g == 1) {
          b = [];
          for (c = 0; c < a.periods.length; ++c) {
            d = c == a.periods.length - 1 ? a.duration : a.periods[c + 1].startTime;
            e = d - a.periods[c].startTime;
            for (var k2 = a.periods[c], l = [], m = t(k2.streams), n = m.next(); !n.done; n = m.next()) n = n.value, n.variantIds.length != 0 && l.push(lB(n, k2.startTime, k2.startTime + e));
            f = l;
            b.push(f);
          }
          return G(h, ow(b), 2);
        }
        g = h.h;
        return h.return({ appMetadata: a.appMetadata, creationTime: 0, drmInfo: a.drmInfo, duration: a.duration, expiration: a.expiration == null ? Infinity : a.expiration, originalManifestUri: a.originalManifestUri, sessionIds: a.sessionIds, size: a.size, streams: g, sequenceMode: false });
      });
    };
    function lB(a, b, c) {
      return { id: a.id, originalId: a.originalId, groupId: null, primary: a.primary, type: a.contentType, mimeType: a.mimeType, codecs: a.codecs, frameRate: a.frameRate, pixelAspectRatio: a.pixelAspectRatio, hdr: void 0, colorGamut: void 0, videoLayout: void 0, kind: a.kind, language: a.language, originalLanguage: a.language || null, label: a.label, width: a.width, height: a.height, encrypted: a.encrypted, keyIds: /* @__PURE__ */ new Set([a.keyId]), segments: a.segments.map(function(d) {
        return {
          startTime: b + d.startTime,
          endTime: b + d.endTime,
          initSegmentKey: a.initSegmentKey,
          appendWindowStart: b,
          appendWindowEnd: c,
          timestampOffset: b - a.presentationTimeOffset,
          dataKey: d.dataKey,
          tilesLayout: "",
          mimeType: null,
          codecs: null,
          thumbnailSprite: null
        };
      }), variantIds: a.variantIds, roles: [], forced: false, audioSamplingRate: null, channelsCount: null, spatialAudio: false, closedCaptions: null, tilesLayout: void 0, external: false, fastSwitching: false, isAudioMuxedInVideo: false };
    }
    ;
    function mB() {
      RA.apply(this, arguments);
    }
    ma(mB, RA);
    p = mB.prototype;
    p.hasFixedKeySpace = function() {
      return false;
    };
    p.addSegments = function(a) {
      return this.add(this.i, a);
    };
    p.addManifests = function(a) {
      return this.add(this.g, a);
    };
    p.updateManifest = function(a, b) {
      return VA(this, a, b);
    };
    p.ee = function(a) {
      a.expiration == null && (a.expiration = Infinity);
      return Promise.resolve(a);
    };
    function nB() {
      this.m = this.j = this.i = this.h = this.g = this.l = null;
    }
    p = nB.prototype;
    p.init = function() {
      var a = this, b = new Mg(), c = false, d = new Cf(function() {
        c = true;
        b.reject(new U(2, 9, 9017));
      });
      typeof oB === "number" && oB > 0 && d.Y(oB);
      var e = window2.indexedDB.open("shaka_offline_db", 5);
      e.onsuccess = function() {
        if (!c) {
          d.stop();
          var f = e.result;
          a.l = f;
          var g = f.objectStoreNames;
          g = g.contains("manifest") && g.contains("segment") ? new fB(f, "segment", "manifest") : null;
          a.g = g;
          g = f.objectStoreNames;
          g = g.contains("manifest-v2") && g.contains("segment-v2") ? new kB(f, "segment-v2", "manifest-v2") : null;
          a.h = g;
          g = f.objectStoreNames;
          g = g.contains("manifest-v3") && g.contains("segment-v3") ? new kB(f, "segment-v3", "manifest-v3") : null;
          a.i = g;
          g = f.objectStoreNames;
          g = g.contains("manifest-v5") && g.contains("segment-v5") ? new mB(f, "segment-v5", "manifest-v5") : null;
          a.j = g;
          f = f.objectStoreNames.contains("session-ids") ? new WA(f) : null;
          a.m = f;
          b.resolve();
        }
      };
      e.onupgradeneeded = function() {
        for (var f = e.result, g = t(["segment-v5", "manifest-v5", "session-ids"]), h = g.next(); !h.done; h = g.next()) h = h.value, f.objectStoreNames.contains(h) || f.createObjectStore(h, { autoIncrement: true });
      };
      e.onerror = function(f) {
        c || (d.stop(), b.reject(new U(2, 9, 9001, e.error)), f.preventDefault());
      };
      return b;
    };
    p.destroy = function() {
      var a = this;
      return P(function(b) {
        switch (b.g) {
          case 1:
            if (!a.g) {
              b.B(2);
              break;
            }
            return G(b, a.g.destroy(), 2);
          case 2:
            if (!a.h) {
              b.B(4);
              break;
            }
            return G(b, a.h.destroy(), 4);
          case 4:
            if (!a.i) {
              b.B(6);
              break;
            }
            return G(b, a.i.destroy(), 6);
          case 6:
            if (!a.j) {
              b.B(8);
              break;
            }
            return G(b, a.j.destroy(), 8);
          case 8:
            if (!a.m) {
              b.B(10);
              break;
            }
            return G(b, a.m.destroy(), 10);
          case 10:
            a.l && a.l.close(), H(b);
        }
      });
    };
    p.getCells = function() {
      var a = /* @__PURE__ */ new Map();
      this.g && a.set("v1", this.g);
      this.h && a.set("v2", this.h);
      this.i && a.set("v3", this.i);
      this.j && a.set("v5", this.j);
      return a;
    };
    p.getEmeSessionCell = function() {
      return this.m;
    };
    p.erase = function() {
      var a = this;
      return P(function(b) {
        switch (b.g) {
          case 1:
            if (!a.g) {
              b.B(2);
              break;
            }
            return G(b, a.g.destroy(), 2);
          case 2:
            if (!a.h) {
              b.B(4);
              break;
            }
            return G(b, a.h.destroy(), 4);
          case 4:
            if (!a.i) {
              b.B(6);
              break;
            }
            return G(b, a.i.destroy(), 6);
          case 6:
            if (!a.j) {
              b.B(8);
              break;
            }
            return G(b, a.j.destroy(), 8);
          case 8:
            return a.l && a.l.close(), G(b, pB(), 10);
          case 10:
            return a.l = null, a.g = null, a.h = null, a.i = null, a.j = null, G(b, a.init(), 0);
        }
      });
    };
    function pB() {
      var a = new Mg(), b = window2.indexedDB.deleteDatabase("shaka_offline_db");
      b.onblocked = function() {
      };
      b.onsuccess = function() {
        a.resolve();
      };
      b.onerror = function(c) {
        a.reject(new U(2, 9, 9001, b.error));
        c.preventDefault();
      };
      return a;
    }
    var oB = 5;
    S("shaka.offline.indexeddb.StorageMechanismOpenTimeout", oB);
    eB("idb", function() {
      return Sb().oi() ? new nB() : null;
    });
    function qB(a, b, c, d) {
      this.g = a;
      this.i = b;
      this.h = c;
      this.l = d;
      this.j = ["offline:", a, "/", b, "/", c, "/", d].join("");
    }
    qB.prototype.Xb = function() {
      return this.i;
    };
    qB.prototype.jb = function() {
      return this.h;
    };
    qB.prototype.key = function() {
      return this.l;
    };
    qB.prototype.toString = function() {
      return this.j;
    };
    function rB(a) {
      a = /^offline:([a-z]+)\/([^/]+)\/([^/]+)\/([0-9]+)$/.exec(a);
      if (a == null) return null;
      var b = a[1];
      if (b != "manifest" && b != "segment") return null;
      var c = a[2];
      if (!c) return null;
      var d = a[3];
      return d && b != null ? new qB(b, c, d, Number(a[4])) : null;
    }
    ;
    function sB(a, b) {
      this.h = a;
      this.g = b;
    }
    function tB(a, b) {
      var c = new Al(null, 0);
      c.yb(b.duration);
      var d = b.streams.filter(function(l) {
        return l.type == "audio";
      }), e = b.streams.filter(function(l) {
        return l.type == "video";
      });
      d = uB(a, d, e, c);
      e = b.streams.filter(function(l) {
        return l.type == tc;
      }).map(function(l) {
        return vB(a, l, c);
      });
      var f = b.streams.filter(function(l) {
        return l.type == "image";
      }).map(function(l) {
        return vB(a, l, c);
      }), g = b.drmInfo ? [b.drmInfo] : [];
      if (b.drmInfo) for (var h = t(d.values()), k2 = h.next(); !k2.done; k2 = h.next()) k2 = k2.value, k2.audio && k2.audio.encrypted && (k2.audio.drmInfos = g), k2.video && k2.video.encrypted && (k2.video.drmInfos = g);
      return { presentationTimeline: c, offlineSessionIds: b.sessionIds, variants: Array.from(d.values()), textStreams: e, imageStreams: f, sequenceMode: b.sequenceMode || false, ignoreManifestTimestampsInSegmentsMode: false, type: b.type || "UNKNOWN", serviceDescription: null, nextUrl: null, periodCount: 1, gapCount: 0, isLowLatency: false, startTime: null };
    }
    function uB(a, b, c, d) {
      for (var e = /* @__PURE__ */ new Set(), f = t(b), g = f.next(); !g.done; g = f.next()) {
        g = t(g.value.variantIds);
        for (var h = g.next(); !h.done; h = g.next()) e.add(h.value);
      }
      f = t(c);
      for (g = f.next(); !g.done; g = f.next()) for (g = t(g.value.variantIds), h = g.next(); !h.done; h = g.next()) e.add(h.value);
      f = /* @__PURE__ */ new Map();
      e = t(e);
      for (g = e.next(); !g.done; g = e.next()) g = g.value, f.set(g, { id: g, language: "", disabledUntilTime: 0, primary: false, audio: null, video: null, bandwidth: 0, allowedByApplication: true, allowedByKeySystem: true, decodingInfos: [] });
      b = t(b);
      for (e = b.next(); !e.done; e = b.next()) for (g = e.value, e = vB(a, g, d), g = t(g.variantIds), h = g.next(); !h.done; h = g.next()) h = f.get(h.value), h.language = e.language, h.primary = h.primary || e.primary, h.audio = e;
      c = t(c);
      for (b = c.next(); !b.done; b = c.next()) for (e = b.value, b = vB(a, e, d), e = t(e.variantIds), g = e.next(); !g.done; g = e.next()) g = f.get(g.value), g.primary = g.primary || b.primary, g.video = b;
      return f;
    }
    function vB(a, b, c) {
      var d = b.segments.map(function(e) {
        return wB(a, e, b);
      });
      c.ye(d);
      return { id: b.id, originalId: b.originalId, groupId: b.groupId, createSegmentIndex: function() {
        return Promise.resolve();
      }, segmentIndex: new Zl(d), mimeType: b.mimeType, codecs: b.codecs, width: b.width || void 0, height: b.height || void 0, frameRate: b.frameRate, pixelAspectRatio: b.pixelAspectRatio, hdr: b.hdr, colorGamut: b.colorGamut, videoLayout: b.videoLayout, kind: b.kind, encrypted: b.encrypted, drmInfos: [], keyIds: b.keyIds, language: b.language, originalLanguage: b.originalLanguage || null, label: b.label, type: b.type, primary: b.primary, trickModeVideo: null, dependencyStream: null, emsgSchemeIdUris: null, roles: b.roles, forced: b.forced, channelsCount: b.channelsCount, audioSamplingRate: b.audioSamplingRate, spatialAudio: b.spatialAudio, closedCaptions: b.closedCaptions, tilesLayout: b.tilesLayout, mssPrivateData: b.mssPrivateData, accessibilityPurpose: null, external: b.external, fastSwitching: b.fastSwitching, fullMimeTypes: /* @__PURE__ */ new Set([ef(b.mimeType, b.codecs)]), isAudioMuxedInVideo: false, baseOriginalId: null };
    }
    function wB(a, b, c) {
      var d = new qB("segment", a.h, a.g, b.dataKey);
      a = new Cj(b.startTime, b.endTime, function() {
        return [d.toString()];
      }, 0, null, b.initSegmentKey != null ? xB(a, b.initSegmentKey) : null, b.timestampOffset, b.appendWindowStart, b.appendWindowEnd, [], b.tilesLayout || "");
      a.mimeType = b.mimeType || c.mimeType || "";
      a.codecs = b.codecs || c.codecs || "";
      b.thumbnailSprite && a.jg(b.thumbnailSprite);
      return a;
    }
    function xB(a, b) {
      var c = new qB("segment", a.h, a.g, b);
      return new Aj(function() {
        return [c.toString()];
      }, 0, null);
    }
    ;
    function yB() {
      this.g = null;
    }
    p = yB.prototype;
    p.configure = function() {
    };
    p.start = function(a, b) {
      var c = this, d, e, f, g, h, k2, l;
      return P(function(m) {
        switch (m.g) {
          case 1:
            d = rB(a);
            c.g = d;
            if (d == null || d.g != "manifest") throw new U(2, 1, 9004, a);
            e = new XA();
            ta(m, 2);
            return G(m, e.init(), 4);
          case 4:
            return G(m, aB(e, d.Xb(), d.jb()), 5);
          case 5:
            return f = m.h, G(m, f.getManifests([d.key()]), 6);
          case 6:
            return g = m.h, h = g[0], k2 = new sB(d.Xb(), d.jb()), l = tB(k2, h), b.makeTextStreamsForClosedCaptions(l), m.return(l);
          case 2:
            return wa(m), G(m, e.destroy(), 7);
          case 7:
            xa(m, 0);
        }
      });
    };
    p.stop = function() {
      return Promise.resolve();
    };
    p.update = function() {
    };
    p.onExpirationUpdated = function(a, b) {
      var c = this, d, e, f, g, h, k2, l;
      return P(function(m) {
        switch (m.g) {
          case 1:
            return d = c.g, e = new XA(), sa(m, 2, 3), G(m, e.init(), 5);
          case 5:
            return G(m, aB(e, d.Xb(), d.jb()), 6);
          case 6:
            return f = m.h, G(m, f.getManifests([d.key()]), 7);
          case 7:
            g = m.h;
            h = g[0];
            k2 = h.sessionIds.includes(a);
            l = h.expiration == void 0 || h.expiration > b;
            if (!k2 || !l) {
              m.B(3);
              break;
            }
            return G(m, f.updateManifestExpiration(d.key(), b), 3);
          case 3:
            return wa(m), G(m, e.destroy(), 10);
          case 10:
            xa(m, 0);
            break;
          case 2:
            va(m), m.B(3);
        }
      });
    };
    p.onInitialVariantChosen = function() {
    };
    p.banLocation = function() {
    };
    p.setMediaElement = function() {
    };
    Gi("application/x-offline-manifest", function() {
      return new yB();
    });
    function zB() {
    }
    function AB(a, b) {
      var c = rB(a);
      c && c.g == "manifest" ? (a = { uri: a, originalUri: a, data: new ArrayBuffer(0), headers: { "content-type": "application/x-offline-manifest" }, originalRequest: b }, a = Qg(a)) : a = c && c.g == "segment" ? BB(c.key(), c, b) : Og(new U(2, 1, 9004, a));
      return a;
    }
    function BB(a, b, c) {
      var d = new XA();
      return Qg(void 0).cb(function() {
        return d.init();
      }).cb(function() {
        return aB(d, b.Xb(), b.jb());
      }).cb(function(e) {
        return e.getSegments([b.key()]);
      }).cb(function(e) {
        return { uri: b, data: e[0].data, headers: {}, originalRequest: c };
      }).finally(function() {
        return d.destroy();
      });
    }
    S("shaka.offline.OfflineScheme", zB);
    zB.plugin = AB;
    Xg("offline", AB);
    function CB(a, b, c) {
      var d, e, f, g, h, k2;
      return P(function(l) {
        switch (l.g) {
          case 1:
            d = [];
            for (var m = [], n = t(c), q = n.next(); !q.done; q = n.next()) {
              q = q.value;
              for (var r = false, u = t(m), w = u.next(); !w.done; w = u.next()) if (w = w.value, DB(w.info, q)) {
                w.sessionIds.push(q.sessionId);
                r = true;
                break;
              }
              r || m.push({ info: q, sessionIds: [q.sessionId] });
            }
            e = t(m);
            f = e.next();
          case 2:
            if (f.done) {
              l.B(4);
              break;
            }
            g = f.value;
            h = EB(a, b, g);
            return G(l, h, 5);
          case 5:
            k2 = l.h;
            d = d.concat(k2);
            f = e.next();
            l.B(2);
            break;
          case 4:
            return l.return(d);
        }
      });
    }
    function EB(a, b, c) {
      var d, e;
      return P(function(f) {
        switch (f.g) {
          case 1:
            return d = new Ch({ Bc: b, onError: function() {
            }, Qf: function() {
            }, onExpirationUpdated: function() {
            }, onEvent: function() {
            } }), sa(f, 2), d.configure(a), G(f, Kh(d, c.info.keySystem, c.info.licenseUri, c.info.serverCertificate, c.info.audioCapabilities, c.info.videoCapabilities), 4);
          case 4:
            ua(f, 3);
            break;
          case 2:
            return va(f), G(f, d.destroy(), 5);
          case 5:
            return f.return([]);
          case 3:
            return e = [], G(f, Promise.all(c.sessionIds.map(function(g) {
              return P(function(h) {
                if (h.g == 1) return sa(h, 2), G(h, Wh(d, g), 4);
                if (h.g != 2) return e.push(g), ua(h, 0);
                va(h);
                H(h);
              });
            })), 6);
          case 6:
            return G(f, d.destroy(), 7);
          case 7:
            return f.return(e);
        }
      });
    }
    function DB(a, b) {
      function c(d, e) {
        return d.robustness == e.robustness && d.contentType == e.contentType;
      }
      return a.keySystem == b.keySystem && a.licenseUri == b.licenseUri && vd(a.audioCapabilities, b.audioCapabilities, c) && vd(a.videoCapabilities, b.videoCapabilities, c);
    }
    ;
    function FB(a, b, c) {
      var d = b.presentationTimeline.getDuration();
      b = GB(b);
      return { offlineUri: null, originalManifestUri: a, duration: d, size: 0, expiration: Infinity, tracks: b, appMetadata: c, isIncomplete: false };
    }
    function HB(a, b) {
      var c = tB(new sB(a.Xb(), a.jb()), b), d = b.appMetadata || {};
      c = GB(c);
      return { offlineUri: a.toString(), originalManifestUri: b.originalManifestUri, duration: b.duration, size: b.size, expiration: b.expiration, tracks: c, appMetadata: d, isIncomplete: b.isIncomplete || false };
    }
    function GB(a) {
      var b = [], c = lg(a.variants);
      c = t(c);
      for (var d = c.next(); !d.done; d = c.next()) b.push(cg(d.value));
      a = t(a.textStreams);
      for (c = a.next(); !c.done; c = a.next()) b.push(dg(c.value));
      return b;
    }
    ;
    function IB() {
      this.g = /* @__PURE__ */ new Map();
    }
    function JB(a, b) {
      var c = b.audio, d = b.video;
      c && !d && a.g.set(c.id, c.bandwidth || b.bandwidth);
      !c && d && a.g.set(d.id, d.bandwidth || b.bandwidth);
      if (c && d) {
        var e = c.bandwidth || 393216, f = d.bandwidth || b.bandwidth - e;
        f <= 0 && (f = b.bandwidth);
        a.g.set(c.id, e);
        a.g.set(d.id, f);
      }
    }
    function KB(a, b) {
      a.g.set(b.id, b.bandwidth || 2048);
    }
    function LB(a, b) {
      a = a.g.get(b);
      a == null && (a = 0);
      return a;
    }
    ;
    function MB(a) {
      var b = this;
      if (a && a.constructor != Y) throw new U(2, 9, 9008);
      this.g = this.h = null;
      a ? (this.h = a.g, this.g = a.Lb()) : (this.h = Vn(), this.g = new Wg(), this.g.configure(this.h.networking));
      this.i = [];
      this.l = [];
      var c = !a;
      this.j = new ih(function() {
        var d, e, f, g, h;
        return P(function(k2) {
          switch (k2.g) {
            case 1:
              return G(k2, Promise.all(b.l.map(function(l) {
                return HA(l);
              })), 2);
            case 2:
              d = function() {
              };
              e = [];
              f = t(b.i);
              for (g = f.next(); !g.done; g = f.next()) h = g.value, e.push(h.then(d, d));
              return G(k2, Promise.all(e), 3);
            case 3:
              if (!c) {
                k2.B(4);
                break;
              }
              return G(k2, b.g.destroy(), 4);
            case 4:
              b.h = null, b.g = null, H(k2);
          }
        });
      });
      this.m = 1e9;
    }
    function NB() {
      if (Ji(Sb())) a: {
        var a = t(YA.values());
        for (var b = a.next(); !b.done; b = a.next()) if (b = b.value, b = b()) {
          b.destroy();
          a = true;
          break a;
        }
        a = false;
      }
      else a = false;
      return a;
    }
    p = MB.prototype;
    p.destroy = function() {
      return this.j.destroy();
    };
    p.configure = function(a, b) {
      arguments.length == 2 && typeof a == "string" && (a = Bn(a, b));
      return $n(this.h, a);
    };
    p.getConfiguration = function() {
      var a = Vn();
      $n(a, this.h, Vn());
      return a;
    };
    p.Lb = function() {
      return this.g;
    };
    p.store = function(a, b, c, d, e) {
      var f = this, g = this.getConfiguration(), h = new GA(this.g);
      this.l.push(h);
      b = OB(this, a, b || {}, d || [], e || [], function() {
        var k2;
        return P(function(l) {
          if (l.g == 1) return c ? l.B(2) : G(l, Jo(a, f.g, g.manifest.retryParameters), 3);
          l.g != 2 && (c = l.h);
          k2 = Li(a, c || null);
          return l.return(k2());
        });
      }, g, h);
      b = new Ng(b, function() {
        return HA(h);
      });
      b.finally(function() {
        ud(f.l, h);
      });
      return PB(this, b);
    };
    function OB(a, b, c, d, e, f, g, h) {
      var k2, l, m, n, q, r, u, w, v, y, z, A, C, D, F, B, E, I, J, K, L, M, N, O;
      return P(function(Q) {
        switch (Q.g) {
          case 1:
            return QB(), l = k2 = null, m = new XA(), r = q = n = null, sa(Q, 2, 3), G(Q, f(), 5);
          case 5:
            return k2 = Q.h, G(Q, RB(a, b, k2, g), 6);
          case 6:
            u = Q.h;
            SB(a);
            w = !u.presentationTimeline.U() && !u.presentationTimeline.kd();
            if (!w) throw new U(2, 9, 9005, b);
            v = t(d);
            y = v.next();
          case 7:
            if (y.done) {
              Q.B(9);
              break;
            }
            z = y.value;
            return G(Q, TB(a, z, u), 10);
          case 10:
            A = Q.h;
            u.imageStreams.push(A);
            SB(a);
            y = v.next();
            Q.B(7);
            break;
          case 9:
            C = t(e), D = C.next();
          case 11:
            if (D.done) return Mh(g.drm.clearKeys, u.variants), E = u.variants.some(function(R) {
              if (R.audio) {
                for (var V = t(R.audio.drmInfos), Ba = V.next(); !Ba.done; Ba = V.next()) if (Ba.value.licenseServerUri.startsWith("data:")) return true;
              }
              if (R.video) {
                for (R = t(R.video.drmInfos), V = R.next(); !V.done; V = R.next()) if (V.value.licenseServerUri.startsWith("data:")) return true;
              }
              return false;
            }), I = g.offline.usePersistentLicense, E && (I = false), G(Q, a.Bd(u, function(R) {
              r = r || R;
            }, g, I), 15);
            F = D.value;
            return G(
              Q,
              UB(a, u, F.uri, F.language, F.kind, F.mime, F.codecs),
              14
            );
          case 14:
            B = Q.h;
            u.textStreams.push(B);
            SB(a);
            D = C.next();
            Q.B(11);
            break;
          case 15:
            l = Q.h;
            SB(a);
            if (r) throw r;
            return G(Q, VB(u, l, g, I), 16);
          case 16:
            return G(Q, m.init(), 17);
          case 17:
            return SB(a), G(Q, ZA(m), 18);
          case 18:
            return n = Q.h, SB(a), J = WB(l, u, b, c, g, h, I), K = J.Ll, L = J.ti, G(Q, n.jb.addManifests([K]), 19);
          case 19:
            M = Q.h;
            SB(a);
            q = M[0];
            SB(a);
            if (r) throw r;
            return G(Q, XB(a, L, q, K, h, g, n.jb, u, l, I), 20);
          case 20:
            return SB(a), YB(u, K, l, I), G(Q, n.jb.updateManifest(q, K), 21);
          case 21:
            return SB(a), N = new qB(
              "manifest",
              n.path.Xb,
              n.path.jb,
              q
            ), Q.return(HB(N, K));
          case 3:
            return wa(Q), G(Q, m.destroy(), 22);
          case 22:
            if (!k2) {
              Q.B(23);
              break;
            }
            return G(Q, k2.stop(), 23);
          case 23:
            if (!l) {
              Q.B(25);
              break;
            }
            return G(Q, l.destroy(), 25);
          case 25:
            xa(Q, 0);
            break;
          case 2:
            O = va(Q);
            if (q == null) {
              Q.B(27);
              break;
            }
            return G(Q, ZB(q), 27);
          case 27:
            throw r || O;
        }
      });
    }
    function XB(a, b, c, d, e, f, g, h, k2, l) {
      var m, n, q, r, u, w, v, y, z, A, C;
      return P(function(D) {
        switch (D.g) {
          case 1:
            m = {};
            n = 0;
            q = function() {
              if (a.j.g || e.l) throw new U(2, 9, 7001);
            };
            r = function(F, B) {
              var E, I, J, K, L, M, N, O, Q;
              return P(function(R) {
                if (R.g == 1) {
                  E = t(F);
                  I = E.next();
                  for (J = {}; !I.done; J = { uc: void 0 }, I = E.next()) J.uc = I.value, q(), K = CA(J.uc, f), L = J.uc.i, M = J.uc.h, N = /* @__PURE__ */ function(V) {
                    return function(Ba) {
                      var aa, Oa, La, Ja;
                      return P(function(Ea) {
                        switch (Ea.g) {
                          case 1:
                            aa = V.uc.g;
                            Oa = aa.fc(false);
                            if (!aa.aesKey || Oa) {
                              Ea.B(2);
                              break;
                            }
                            return G(Ea, Im(
                              Ba,
                              aa.aesKey,
                              V.uc.j
                            ), 3);
                          case 3:
                            Ba = Ea.h;
                          case 2:
                            return La = BA(aa), G(Ea, g.addSegments([{ data: Ba }]), 4);
                          case 4:
                            Ja = Ea.h, q(), m[La] = Ja[0], n += Ba.byteLength, H(Ea);
                        }
                      });
                    };
                  }(J), O = J.uc.g, (Q = O.fc(false)) ? KA(e, J.uc.groupId, Q, L, M, N) : e.queue(J.uc.groupId, K, L, M, N);
                  return G(R, LA(e), 2);
                }
                q();
                if (!B || e.l) return R.B(0);
                YB(h, d, k2, l);
                return G(R, g.updateManifest(c, d), 0);
              });
            };
            u = false;
            sa(D, 2);
            if (!$B(h) || !u || aC(h)) {
              D.B(4);
              break;
            }
            return G(D, r(b.filter(function(F) {
              return F.h;
            }), true), 5);
          case 5:
            return q(), b = b.filter(function(F) {
              return !F.h;
            }), w = m, v = n, m = {}, n = 0, G(D, bC(g, c, d, w, v, function() {
              return SB(a);
            }), 6);
          case 6:
            q();
          case 4:
            if (u) {
              D.B(7);
              break;
            }
            return G(D, r(b, false), 8);
          case 8:
            return q(), y = m, z = n, m = {}, n = 0, G(D, bC(g, c, d, y, z, function() {
              return q();
            }), 9);
          case 9:
            q();
          case 7:
            ua(D, 0);
            break;
          case 2:
            return A = va(D), C = Object.values(m), G(D, g.removeSegments(C, function() {
            }), 10);
          case 10:
            throw A;
        }
      });
    }
    function ZB(a) {
      var b, c, d, e;
      return P(function(f) {
        switch (f.g) {
          case 1:
            return b = new XA(), G(f, b.init(), 2);
          case 2:
            return G(f, ZA(b), 3);
          case 3:
            return c = f.h, d = new qB("manifest", c.path.Xb, c.path.jb, a), G(f, b.destroy(), 4);
          case 4:
            return e = new MB(), G(f, e.remove(d.toString()), 0);
        }
      });
    }
    function bC(a, b, c, d, e, f) {
      var g, h, k2, l, m, n, q, r, u, w, v;
      return P(function(y) {
        switch (y.g) {
          case 1:
            g = false;
            sa(y, 2);
            h = true;
            k2 = t(c.streams);
            for (l = k2.next(); !l.done; l = k2.next()) for (m = l.value, n = t(m.segments), q = n.next(); !q.done; q = n.next()) r = q.value, u = r.pendingSegmentRefId ? d[r.pendingSegmentRefId] : null, u != null && (r.dataKey = u, r.pendingSegmentRefId = void 0), u = r.pendingInitSegmentRefId ? d[r.pendingInitSegmentRefId] : null, u != null && (r.initSegmentKey = u, r.pendingInitSegmentRefId = void 0), r.pendingSegmentRefId && (h = false), r.pendingInitSegmentRefId && (h = false);
            c.size += e;
            h && (c.isIncomplete = false);
            return G(y, a.updateManifest(b, c), 4);
          case 4:
            g = true;
            f();
            ua(y, 0);
            break;
          case 2:
            return w = va(y), G(y, ZB(b), 5);
          case 5:
            if (g) {
              y.B(6);
              break;
            }
            v = Object.values(d);
            return G(y, a.removeSegments(v, function() {
            }), 6);
          case 6:
            throw w;
        }
      });
    }
    function VB(a, b, c, d) {
      var e, f, g, h, k2, l, m, n, q, r, u, w, v, y, z, A, C, D, F, B, E, I, J, K, L, M, N, O, Q, R;
      return P(function(V) {
        switch (V.g) {
          case 1:
            return e = { width: Infinity, height: Infinity }, Kf(a, c.restrictions, e), G(V, Nf(b, a, d, c.drm.preferredKeySystems, c.drm.keySystemsMapping), 2);
          case 2:
            f = [];
            g = c.preferredDecodingAttributes;
            h = c.preferredVideoCodecs;
            k2 = c.preferredAudioCodecs;
            l = c.preferredTextFormats;
            If(a, h, k2, g, l);
            m = t(a.variants);
            for (n = m.next(); !n.done; n = m.next()) q = n.value, f.push(cg(q));
            r = t(a.textStreams);
            for (u = r.next(); !u.done; u = r.next()) w = u.value, f.push(dg(w));
            v = t(a.imageStreams);
            for (y = v.next(); !y.done; y = v.next()) z = y.value, f.push(eg(z));
            return G(V, c.offline.trackSelectionCallback(f), 3);
          case 3:
            A = V.h;
            C = a.presentationTimeline.getDuration();
            D = 0;
            F = t(A);
            for (B = F.next(); !B.done; B = F.next()) E = B.value, I = E.bandwidth * C / 8, D += I;
            sa(V, 4);
            return G(V, c.offline.downloadSizeCallback(D), 6);
          case 6:
            J = V.h;
            if (!J) throw new U(2, 9, 9014);
            ua(V, 5);
            break;
          case 4:
            K = va(V);
            if (K instanceof U) throw K;
            throw new U(2, 9, 9015);
          case 5:
            L = /* @__PURE__ */ new Set();
            M = /* @__PURE__ */ new Set();
            N = /* @__PURE__ */ new Set();
            O = t(A);
            for (Q = O.next(); !Q.done; Q = O.next()) R = Q.value, R.type == "variant" && L.add(R.id), R.type == "text" && M.add(R.id), R.type == "image" && N.add(R.id);
            a.variants = a.variants.filter(function(Ba) {
              return L.has(Ba.id);
            });
            a.textStreams = a.textStreams.filter(function(Ba) {
              return M.has(Ba.id);
            });
            a.imageStreams = a.imageStreams.filter(function(Ba) {
              return N.has(Ba.id);
            });
            cC(a);
            H(V);
        }
      });
    }
    function WB(a, b, c, d, e, f, g) {
      var h = FB(c, b, d), k2 = e.offline.progressCallback;
      IA(f, function(u, w) {
        h.size = w;
        k2(h, u);
      }, function(u, w) {
        l && g && m == w && Sh(a, "cenc", u);
      });
      var l = $B(b) && !aC(b), m = null;
      l && (m = dC.get(a.g.keySystem));
      for (var n = new IB(), q = t(b.textStreams), r = q.next(); !r.done; r = q.next()) n.g.set(r.value.id, 52);
      q = t(b.imageStreams);
      for (r = q.next(); !r.done; r = q.next()) KB(n, r.value);
      q = t(b.variants);
      for (r = q.next(); !r.done; r = q.next()) JB(n, r.value);
      f = eC(f, n, b, e);
      e = f.streams;
      f = f.ti;
      (n = a.g) && g && (n.initData = []);
      return { Ll: {
        creationTime: Date.now(),
        originalManifestUri: c,
        duration: b.presentationTimeline.getDuration(),
        size: 0,
        expiration: a.ke(),
        streams: e,
        sessionIds: g ? bi(a) : [],
        drmInfo: n,
        appMetadata: d,
        isIncomplete: true,
        sequenceMode: b.sequenceMode,
        type: b.type
      }, ti: f };
    }
    function $B(a) {
      return a.variants.some(function(b) {
        var c = b.audio && b.audio.encrypted;
        return b.video && b.video.encrypted || c;
      });
    }
    function aC(a) {
      return a.variants.some(function(b) {
        return (b.video ? b.video.drmInfos : []).concat(b.audio ? b.audio.drmInfos : []).some(function(c) {
          return c.initData && c.initData.length;
        });
      });
    }
    function YB(a, b, c, d) {
      b.expiration = c.ke();
      c = bi(c);
      b.sessionIds = d ? c : [];
      if ($B(a) && d && !c.length) throw new U(2, 9, 9007);
    }
    p.remove = function(a) {
      return fC(this, gC(this, a));
    };
    function gC(a, b) {
      var c, d, e, f, g, h;
      return P(function(k2) {
        switch (k2.g) {
          case 1:
            QB();
            c = rB(b);
            if (c == null || c.g != "manifest") throw new U(2, 9, 9004, b);
            d = c;
            e = new XA();
            ta(k2, 2);
            return G(k2, e.init(), 4);
          case 4:
            return G(k2, aB(e, d.Xb(), d.jb()), 5);
          case 5:
            return f = k2.h, G(k2, f.getManifests([d.key()]), 6);
          case 6:
            return g = k2.h, h = g[0], G(k2, Promise.all([hC(a, h, e), iC(f, d, h)]), 2);
          case 2:
            return wa(k2), G(k2, e.destroy(), 8);
          case 8:
            xa(k2, 0);
        }
      });
    }
    function jC(a, b) {
      for (var c = [], d = t(a.streams), e = d.next(); !e.done; e = d.next()) e = e.value, b && e.type == "video" ? c.push({ contentType: ef(e.mimeType, e.codecs), robustness: a.drmInfo.videoRobustness }) : b || e.type != "audio" || c.push({ contentType: ef(e.mimeType, e.codecs), robustness: a.drmInfo.audioRobustness });
      return c;
    }
    function hC(a, b, c) {
      return P(function(d) {
        return G(d, kC(a.g, a.h.drm, c, b), 0);
      });
    }
    function iC(a, b, c) {
      function d() {
      }
      var e = lC(c);
      HB(b, c);
      return Promise.all([a.removeSegments(e, d), a.removeManifests([b.key()], d)]);
    }
    p.fm = function() {
      return fC(this, mC(this));
    };
    function mC(a) {
      var b, c, d, e, f, g, h, k2, l, m;
      return P(function(n) {
        switch (n.g) {
          case 1:
            return QB(), b = a.g, c = a.h.drm, d = new XA(), e = false, ta(n, 2), G(n, d.init(), 4);
          case 4:
            f = [], bB(d, function(q) {
              return f.push(q);
            }), g = t(f), h = g.next();
          case 5:
            if (h.done) {
              n.B(2);
              break;
            }
            k2 = h.value;
            return G(n, k2.getAll(), 8);
          case 8:
            return l = n.h, G(n, CB(c, b, l), 9);
          case 9:
            return m = n.h, G(n, k2.remove(m), 10);
          case 10:
            m.length != l.length && (e = true);
            h = g.next();
            n.B(5);
            break;
          case 2:
            return wa(n), G(n, d.destroy(), 11);
          case 11:
            xa(n, 3);
            break;
          case 3:
            return n.return(!e);
        }
      });
    }
    p.list = function() {
      return fC(this, nC());
    };
    function nC() {
      var a, b, c;
      return P(function(d) {
        switch (d.g) {
          case 1:
            return QB(), a = [], b = new XA(), ta(d, 2), G(d, b.init(), 4);
          case 4:
            return c = Promise.resolve(), $A(b, function(e, f) {
              c = c.then(function() {
                var g;
                return P(function(h) {
                  if (h.g == 1) return G(h, f.getAllManifests(), 2);
                  g = h.h;
                  g.forEach(function(k2, l) {
                    k2 = HB(new qB("manifest", e.Xb, e.jb, l), k2);
                    a.push(k2);
                  });
                  H(h);
                });
              });
            }), G(d, c, 2);
          case 2:
            return wa(d), G(d, b.destroy(), 6);
          case 6:
            xa(d, 3);
            break;
          case 3:
            return d.return(a);
        }
      });
    }
    function RB(a, b, c, d) {
      var e, f, g, h, k2;
      return P(function(l) {
        if (l.g == 1) return e = null, f = a.g, g = {
          networkingEngine: f,
          filter: function() {
            return Promise.resolve();
          },
          makeTextStreamsForClosedCaptions: function() {
          },
          onTimelineRegionAdded: function() {
          },
          onEvent: function() {
          },
          onError: function(m) {
            e = m;
          },
          isLowLatencyMode: function() {
            return false;
          },
          updateDuration: function() {
          },
          newDrmInfo: function() {
          },
          onManifestUpdated: function() {
          },
          getBandwidthEstimate: function() {
            return d.abr.defaultBandwidthEstimate;
          },
          onMetadata: function() {
          },
          disableStream: function() {
          },
          addFont: function() {
          }
        }, c.configure(d.manifest), SB(a), G(l, c.start(b, g), 2);
        if (l.g != 3) return h = l.h, SB(a), k2 = oC(h), G(l, Promise.all(mb(k2, function(m) {
          return m.createSegmentIndex();
        })), 3);
        SB(a);
        if (e) throw e;
        return l.return(h);
      });
    }
    function TB(a, b, c) {
      var d, e, f, g, h, k2, l, m, n, q, r, u, w, v, y;
      return P(function(z) {
        switch (z.g) {
          case 1:
            return G(z, pC(a, b), 2);
          case 2:
            d = z.h;
            if (d != "text/vtt") throw new U(1, 2, 2017, b);
            return G(z, qC(b, a.g, a.h.streaming.retryParameters), 3);
          case 3:
            e = z.h;
            f = uf(d);
            if (!f) throw new U(2, 2, 2014, d);
            g = f();
            h = { periodStart: 0, segmentStart: 0, segmentEnd: c.presentationTimeline.getDuration(), vttOffset: 0 };
            k2 = Lb(e);
            l = g.parseMedia(k2, h, b, []);
            m = [];
            n = t(l);
            q = n.next();
            for (r = {}; !q.done; r = { ug: void 0, Dd: void 0 }, q = n.next()) r.Dd = q.value, r.ug = null, u = /* @__PURE__ */ function(A) {
              return function() {
                A.ug == null && (A.ug = nc([b], [A.Dd.payload]));
                return A.ug || [];
              };
            }(r), w = new Cj(r.Dd.startTime, r.Dd.endTime, u, 0, null, null, 0, 0, Infinity), r.Dd.payload.includes("#xywh") && (v = r.Dd.payload.split("#xywh=")[1].split(","), v.length === 4 && w.jg({ height: parseInt(v[3], 10), positionX: parseInt(v[0], 10), positionY: parseInt(v[1], 10), width: parseInt(v[2], 10) })), m.push(w);
            y = d;
            if (!m.length) {
              z.B(4);
              break;
            }
            return G(z, Jo(m[0].T()[0], a.g, a.h.manifest.retryParameters), 5);
          case 5:
            y = z.h;
          case 4:
            return z.return({
              id: a.m++,
              originalId: null,
              groupId: null,
              createSegmentIndex: function() {
                return Promise.resolve();
              },
              segmentIndex: new Zl(m),
              mimeType: y || "",
              codecs: "",
              kind: "",
              encrypted: false,
              drmInfos: [],
              keyIds: /* @__PURE__ */ new Set(),
              language: "und",
              originalLanguage: null,
              label: null,
              type: "image",
              primary: false,
              trickModeVideo: null,
              dependencyStream: null,
              emsgSchemeIdUris: null,
              roles: [],
              forced: false,
              channelsCount: null,
              audioSamplingRate: null,
              spatialAudio: false,
              closedCaptions: null,
              tilesLayout: "1x1",
              accessibilityPurpose: null,
              external: true,
              fastSwitching: false,
              fullMimeTypes: /* @__PURE__ */ new Set([ef(y || "", "")]),
              isAudioMuxedInVideo: false,
              baseOriginalId: null
            });
        }
      });
    }
    function UB(a, b, c, d, e, f, g) {
      var h, k2, l;
      return P(function(m) {
        if (m.g == 1) return f ? m.B(2) : G(m, pC(a, c), 3);
        m.g != 2 && (f = m.h);
        h = {
          id: a.m++,
          originalId: null,
          groupId: null,
          createSegmentIndex: function() {
            return Promise.resolve();
          },
          segmentIndex: am(0, b.presentationTimeline.getDuration(), [c]),
          mimeType: f || "",
          codecs: g || "",
          kind: e,
          encrypted: false,
          drmInfos: [],
          keyIds: /* @__PURE__ */ new Set(),
          language: d,
          originalLanguage: d,
          label: null,
          type: tc,
          primary: false,
          trickModeVideo: null,
          dependencyStream: null,
          emsgSchemeIdUris: null,
          roles: [],
          forced: false,
          channelsCount: null,
          audioSamplingRate: null,
          spatialAudio: false,
          closedCaptions: null,
          accessibilityPurpose: null,
          external: true,
          fastSwitching: false,
          fullMimeTypes: /* @__PURE__ */ new Set([ef(f || "", g || "")]),
          isAudioMuxedInVideo: false,
          baseOriginalId: null
        };
        k2 = ef(h.mimeType, h.codecs);
        l = vf(k2);
        if (!l) throw new U(2, 2, 2014, f);
        return m.return(h);
      });
    }
    function pC(a, b) {
      var c;
      return P(function(d) {
        switch (d.g) {
          case 1:
            return sa(d, 2), G(d, Jo(b, a.g, a.h.streaming.retryParameters), 4);
          case 4:
            c = d.h;
            ua(d, 3);
            break;
          case 2:
            va(d);
          case 3:
            if (c) return d.return(c);
            throw new U(1, 2, 2011, b);
        }
      });
    }
    function qC(a, b, c) {
      var d, e, f;
      return P(function(g) {
        if (g.g == 1) return d = gh, e = ah([a], c), e.method = "GET", G(g, b.request(d, e).promise, 2);
        f = g.h;
        return g.return(f.data);
      });
    }
    p.Bd = function(a, b, c, d) {
      var e = this, f;
      return P(function(g) {
        return g.g == 1 ? (f = new Ch({ Bc: e.g, onError: b, Qf: function() {
        }, onExpirationUpdated: function() {
        }, onEvent: function() {
        } }), f.configure(c.drm), G(g, Hh(f, a.variants, d), 2)) : g.g != 3 ? G(g, Uh(f), 3) : g.return(f);
      });
    };
    function eC(a, b, c, d) {
      var e = /* @__PURE__ */ new Map(), f = oC(c), g = /* @__PURE__ */ new Map();
      f = t(f);
      for (var h = f.next(); !h.done; h = f.next()) {
        h = h.value;
        var k2 = rC(a, b, c, h, d, e);
        g.set(h.id, k2);
      }
      a = t(c.variants);
      for (b = a.next(); !b.done; b = a.next()) b = b.value, b.audio && g.get(b.audio.id).variantIds.push(b.id), b.video && g.get(b.video.id).variantIds.push(b.id);
      return { streams: Array.from(g.values()), ti: Array.from(e.values()) };
    }
    function rC(a, b, c, d, e, f) {
      var g = {
        id: d.id,
        originalId: d.originalId,
        groupId: d.groupId,
        primary: d.primary,
        type: d.type,
        mimeType: d.mimeType,
        codecs: d.codecs,
        frameRate: d.frameRate,
        pixelAspectRatio: d.pixelAspectRatio,
        hdr: d.hdr,
        colorGamut: d.colorGamut,
        videoLayout: d.videoLayout,
        kind: d.kind,
        language: d.language,
        originalLanguage: d.originalLanguage,
        label: d.label,
        width: d.width || null,
        height: d.height || null,
        encrypted: d.encrypted,
        keyIds: d.keyIds,
        segments: [],
        variantIds: [],
        roles: d.roles,
        forced: d.forced,
        channelsCount: d.channelsCount,
        audioSamplingRate: d.audioSamplingRate,
        spatialAudio: d.spatialAudio,
        closedCaptions: d.closedCaptions,
        tilesLayout: d.tilesLayout,
        mssPrivateData: d.mssPrivateData,
        external: d.external,
        fastSwitching: d.fastSwitching,
        isAudioMuxedInVideo: d.isAudioMuxedInVideo
      }, h = e.offline.numberOfParallelDownloads, k2 = h === 0 ? d.id : 0;
      sC(d, c.presentationTimeline.Nb(), function(l, m) {
        var n = BA(l), q = void 0;
        if (!f.has(n)) {
          var r = l.endTime - l.startTime;
          r = LB(b, d.id) * r;
          r = EA(a.g, r);
          f.set(n, new AA(l, r, k2, false, m));
        }
        l.ha && (q = BA(l.ha), f.has(q) || (r = LB(
          b,
          d.id
        ) * 0.5, r = EA(a.g, r), f.set(q, new AA(l.ha, r, k2, true, m))));
        g.segments.push({ pendingInitSegmentRefId: q, initSegmentKey: q ? 0 : null, startTime: l.startTime, endTime: l.endTime, appendWindowStart: l.appendWindowStart, appendWindowEnd: l.appendWindowEnd, timestampOffset: l.timestampOffset, tilesLayout: l.tilesLayout, pendingSegmentRefId: n, dataKey: 0, mimeType: l.mimeType, codecs: l.codecs, thumbnailSprite: l.thumbnailSprite });
        h !== 0 && (k2 = (k2 + 1) % h);
      });
      return g;
    }
    function sC(a, b, c) {
      b = a.segmentIndex.find(b);
      if (b != null) for (var d = a.segmentIndex.get(b); d; ) c(d, b), d = a.segmentIndex.get(++b);
    }
    function SB(a) {
      if (a.j.g) throw new U(2, 9, 7001);
    }
    function QB() {
      if (!NB()) throw new U(2, 9, 9e3);
    }
    function fC(a, b) {
      return P(function(c) {
        if (c.g == 1) return a.i.push(b), ta(c, 2), G(c, b, 4);
        if (c.g != 2) return c.return(c.h);
        wa(c);
        ud(a.i, b);
        return xa(c, 0);
      });
    }
    function PB(a, b) {
      var c = b.promise;
      a.i.push(c);
      return b.finally(function() {
        ud(a.i, c);
      });
    }
    function lC(a) {
      var b = /* @__PURE__ */ new Set();
      a = t(a.streams);
      for (var c = a.next(); !c.done; c = a.next()) {
        c = t(c.value.segments);
        for (var d = c.next(); !d.done; d = c.next()) d = d.value, d.initSegmentKey != null && b.add(d.initSegmentKey), b.add(d.dataKey);
      }
      return Array.from(b);
    }
    function kC(a, b, c, d) {
      var e, f, g;
      return P(function(h) {
        if (h.g == 1) {
          if (!d.drmInfo) return h.return();
          e = cB(c);
          f = d.sessionIds.map(function(k2) {
            return { sessionId: k2, keySystem: d.drmInfo.keySystem, licenseUri: d.drmInfo.licenseServerUri, serverCertificate: d.drmInfo.serverCertificate, audioCapabilities: jC(d, false), videoCapabilities: jC(d, true) };
          });
          return G(h, CB(b, a, f), 2);
        }
        return h.g != 3 ? (g = h.h, G(h, e.remove(g), 3)) : G(h, e.add(f.filter(function(k2) {
          return !g.includes(k2.sessionId);
        })), 0);
      });
    }
    function oC(a) {
      for (var b = /* @__PURE__ */ new Set(), c = t(a.variants), d = c.next(); !d.done; d = c.next()) d = d.value, d.audio && b.add(d.audio), d.video && b.add(d.video);
      c = t(a.textStreams);
      for (d = c.next(); !d.done; d = c.next()) b.add(d.value);
      a = t(a.imageStreams);
      for (c = a.next(); !c.done; c = a.next()) b.add(c.value);
      return b;
    }
    function cC(a) {
      a.variants.map(function(f) {
        return f.video;
      });
      var b = new Set(a.variants.map(function(f) {
        return f.audio;
      }));
      a = a.textStreams;
      for (var c = t(b), d = c.next(); !d.done; d = c.next()) {
        d = t(b);
        for (var e = d.next(); !e.done; e = d.next()) ;
      }
      b = t(a);
      for (c = b.next(); !c.done; c = b.next()) for (c = t(a), d = c.next(); !d.done; d = c.next()) ;
    }
    S("shaka.offline.Storage", MB);
    MB.deleteAll = function() {
      var a;
      return P(function(b) {
        return b.g == 1 ? (a = new XA(), ta(b, 2), G(b, dB(a), 2)) : b.g != 5 ? (wa(b), G(b, a.destroy(), 5)) : xa(b, 0);
      });
    };
    MB.prototype.list = MB.prototype.list;
    MB.prototype.removeEmeSessions = MB.prototype.fm;
    MB.prototype.remove = MB.prototype.remove;
    MB.prototype.store = MB.prototype.store;
    MB.prototype.getNetworkingEngine = MB.prototype.Lb;
    MB.prototype.getConfiguration = MB.prototype.getConfiguration;
    MB.prototype.configure = MB.prototype.configure;
    MB.prototype.destroy = MB.prototype.destroy;
    MB.support = NB;
    var dC = (/* @__PURE__ */ new Map()).set("org.w3.clearkey", "1077efecc0b24d02ace33c1e52e2fb4b").set("com.widevine.alpha", "edef8ba979d64acea3c827dcd51d21ed").set("com.microsoft.playready", "9a04f07998404286ab92e65be0885f95").set("com.microsoft.playready.recommendation", "9a04f07998404286ab92e65be0885f95").set("com.microsoft.playready.software", "9a04f07998404286ab92e65be0885f95").set("com.microsoft.playready.hardware", "9a04f07998404286ab92e65be0885f95").set("com.huawei.wiseplay", "3d5e6d359b9a41e8b843dd3c6e72c42c");
    vq("offline", NB);
    function tC() {
    }
    function uC() {
      for (var a = t(vC), b = a.next(); !b.done; b = a.next()) {
        b = b.value;
        try {
          b.callback();
        } catch (c) {
          bb("Error installing polyfill!", c);
        }
      }
    }
    function wC(a, b) {
      a = { priority: b || 0, callback: a };
      for (b = 0; b < vC.length; b++) if (vC[b].priority < a.priority) {
        vC.splice(b, 0, a);
        return;
      }
      vC.push(a);
    }
    S("shaka.polyfill", tC);
    tC.register = wC;
    tC.installAll = uC;
    var vC = [];
    function xC() {
    }
    function yC() {
      if (!Object.getOwnPropertyDescriptor(Element.prototype, "ariaHidden")) for (var a = t(["ariaHidden", "ariaLabel", "ariaPressed", "ariaSelected"]), b = a.next(); !b.done; b = a.next()) zC(b.value);
    }
    function zC(a) {
      var b = "aria-" + a.toLowerCase().replace(/^aria/, "");
      Object.defineProperty(Element.prototype, a, { get: function() {
        return this.getAttribute(b);
      }, set: function(c) {
        c == null || c == void 0 ? this.removeAttribute(b) : this.setAttribute(b, c);
      } });
    }
    tC.Aria = xC;
    xC.install = yC;
    wC(yC);
    function AC(a, b, c) {
      this.g = a;
      this.i = b || null;
      this.h = c || null;
      this.keySystem = a.keySystem;
    }
    AC.prototype.getConfiguration = function() {
      var a = this.g.getConfiguration();
      if (a.videoCapabilities) for (var b = t(a.videoCapabilities), c = b.next(); !c.done; c = b.next()) c.value.encryptionScheme = this.i;
      if (a.audioCapabilities) for (b = t(a.audioCapabilities), c = b.next(); !c.done; c = b.next()) c.value.encryptionScheme = this.h;
      return a;
    };
    AC.prototype.createMediaKeys = function() {
      return this.g.createMediaKeys();
    };
    function BC(a) {
      if (a.startsWith("com.apple")) return "cbcs";
      if (a.startsWith("com.widevine") || a.startsWith("com.microsoft") || a.startsWith("com.chromecast") || a.startsWith("org.w3") || a.startsWith("com.huawei")) return "cenc";
      bb("EmeEncryptionSchemePolyfill: Unknown key system:", a, "Please contribute!");
      return null;
    }
    function CC(a) {
      if (!a) return false;
      a = a.getConfiguration();
      var b = a.audioCapabilities && a.audioCapabilities[0];
      return (a = a.videoCapabilities && a.videoCapabilities[0] || b) && a.encryptionScheme !== void 0 ? true : false;
    }
    function DC(a, b) {
      return !a || a == b || (a == "cbcs" || a == "cbcs-1-9") && Sb().sd() ? true : false;
    }
    ;
    function EC() {
    }
    var FC;
    function GC() {
      Sb().lg() && !FC && !navigator.emeEncryptionSchemePolyfilled && navigator.requestMediaKeySystemAccess && MediaKeySystemAccess.prototype.getConfiguration && (FC = navigator.requestMediaKeySystemAccess, navigator.requestMediaKeySystemAccess = HC, navigator.emeEncryptionSchemePolyfilled = true);
    }
    function HC(a, b) {
      var c = this, d, e;
      return P(function(f) {
        if (f.g == 1) return G(f, FC.call(c, a, b), 2);
        d = f.h;
        if (e = CC(d)) return navigator.requestMediaKeySystemAccess = FC, f.return(d);
        navigator.requestMediaKeySystemAccess = IC;
        return f.return(IC.call(c, a, b));
      });
    }
    function IC(a, b) {
      var c = this, d, e, f, g, h, k2, l, m, n, q, r, u;
      return P(function(w) {
        if (w.g == 1) {
          d = BC(a);
          e = [];
          f = t(b);
          for (g = f.next(); !g.done; g = f.next()) h = g.value, k2 = JC(h.videoCapabilities, d), l = JC(h.audioCapabilities, d), h.videoCapabilities && h.videoCapabilities.length && !k2.length || h.audioCapabilities && h.audioCapabilities.length && !l.length || (m = Object.assign({}, h), m.videoCapabilities = k2, m.audioCapabilities = l, e.push(m));
          if (!e.length) throw n = Error("Unsupported keySystem or supportedConfigurations."), n.name = "NotSupportedError", n.code = DOMException.NOT_SUPPORTED_ERR, n;
          return G(w, FC.call(c, a, e), 2);
        }
        q = w.h;
        u = r = null;
        e[0] && (e[0].videoCapabilities && (r = e[0].videoCapabilities[0].encryptionScheme), e[0].audioCapabilities && (u = e[0].audioCapabilities[0].encryptionScheme));
        return w.return(new AC(q, r, u));
      });
    }
    function JC(a, b) {
      return a ? a.filter(function(c) {
        return DC(c.encryptionScheme, b);
      }) : a;
    }
    tC.EmeEncryptionScheme = EC;
    EC.install = GC;
    wC(GC);
    function KC() {
    }
    function LC() {
      if (window2.Document) {
        var a = Element.prototype;
        a.requestFullscreen = a.requestFullscreen || a.mozRequestFullScreen || a.msRequestFullscreen || a.webkitRequestFullscreen;
        a = Document.prototype;
        a.exitFullscreen = a.exitFullscreen || a.mozCancelFullScreen || a.msExitFullscreen || a.webkitCancelFullScreen;
        "fullscreenElement" in document || (Object.defineProperty(document, "fullscreenElement", { get: function() {
          return document.mozFullScreenElement || document.msFullscreenElement || document.webkitCurrentFullScreenElement || document.webkitFullscreenElement;
        } }), Object.defineProperty(document, "fullscreenEnabled", { get: function() {
          return document.mozFullScreenEnabled || document.msFullscreenEnabled || document.webkitFullscreenEnabled;
        } }));
        document.addEventListener("webkitfullscreenchange", MC);
        document.addEventListener("webkitfullscreenerror", MC);
        document.addEventListener("mozfullscreenchange", MC);
        document.addEventListener("mozfullscreenerror", MC);
        document.addEventListener("MSFullscreenChange", MC);
        document.addEventListener("MSFullscreenError", MC);
      }
    }
    function MC(a) {
      var b = a.type.replace(/^(webkit|moz|MS)/, "").toLowerCase(), c = document.createEvent("Event");
      c.initEvent(b, a.bubbles, a.cancelable);
      a.target.dispatchEvent(c);
    }
    tC.Fullscreen = KC;
    KC.install = LC;
    wC(LC);
    function NC() {
    }
    var OC;
    function PC() {
      Sb().lg() && !OC && !navigator.mediaCapabilitiesEncryptionSchemePolyfilled && navigator.mediaCapabilities && (OC = navigator.mediaCapabilities.decodingInfo, navigator.mediaCapabilities.decodingInfo = QC, navigator.mediaCapabilitiesEncryptionSchemePolyfilled = true);
    }
    function QC(a) {
      var b = this, c, d, e;
      return P(function(f) {
        switch (f.g) {
          case 1:
            return G(f, OC.call(b, a), 2);
          case 2:
            c = f.h;
            if (!c.supported || !a.keySystemConfiguration) return f.return(c);
            d = c.keySystemAccess;
            if (e = CC(d)) return navigator.mediaCapabilities.decodingInfo = OC, f.return(c);
            navigator.mediaCapabilities.decodingInfo = RC;
            if (d) {
              f.B(3);
              break;
            }
            return G(f, SC(a), 4);
          case 4:
            return c.keySystemAccess = f.h, f.return(c);
          case 3:
            return f.return(RC.call(b, a));
        }
      });
    }
    function RC(a) {
      var b = this, c, d, e, f, g, h, k2;
      return P(function(l) {
        switch (l.g) {
          case 1:
            return d = c = null, !a.keySystemConfiguration || (e = a.keySystemConfiguration, f = e.keySystem, d = e.audio && e.audio.encryptionScheme, c = e.video && e.video.encryptionScheme, g = BC(f), h = { powerEfficient: false, smooth: false, supported: false, keySystemAccess: null, configuration: a }, DC(d, g) && DC(c, g)) ? G(l, OC.call(b, a), 2) : l.return(h);
          case 2:
            k2 = l.h;
            if (k2.keySystemAccess) {
              k2.keySystemAccess = new AC(k2.keySystemAccess, c, d);
              l.B(3);
              break;
            }
            if (!a.keySystemConfiguration) {
              l.B(3);
              break;
            }
            return G(l, SC(a), 5);
          case 5:
            k2.keySystemAccess = l.h;
          case 3:
            return l.return(k2);
        }
      });
    }
    function SC(a) {
      var b, c;
      return P(function(d) {
        if (d.g == 1) {
          var e = a.keySystemConfiguration, f = [], g = [];
          e.audio && f.push({ robustness: e.audio.robustness || "", contentType: a.audio.contentType, encryptionScheme: e.audio.encryptionScheme });
          e.video && g.push({ robustness: e.video.robustness || "", contentType: a.video.contentType, encryptionScheme: e.video.encryptionScheme });
          e = { initDataTypes: e.initDataType ? [e.initDataType] : [], distinctiveIdentifier: e.distinctiveIdentifier, persistentState: e.persistentState, sessionTypes: e.sessionTypes };
          f.length && (e.audioCapabilities = f);
          g.length && (e.videoCapabilities = g);
          b = e;
          return G(d, navigator.requestMediaKeySystemAccess(a.keySystemConfiguration.keySystem, [b]), 2);
        }
        c = d.h;
        return d.return(c);
      });
    }
    tC.MCapEncryptionScheme = NC;
    NC.install = PC;
    wC(PC, -2);
    function TC() {
    }
    function UC() {
      Sb().mc() || (navigator.mediaCapabilities || (navigator.mediaCapabilities = {}), TC.originalMcap = navigator.mediaCapabilities, navigator.mediaCapabilities.decodingInfo = VC);
    }
    function VC(a) {
      var b, c, d, e, f, g, h, k2, l, m, n;
      return P(function(q) {
        switch (q.g) {
          case 1:
            b = { supported: false, powerEfficient: true, smooth: true, keySystemAccess: null, configuration: a };
            Sb();
            c = a.video;
            d = a.audio;
            if (a.type != "media-source") {
              if (a.type == "file") {
                if (c && (e = c.contentType, f = Ki().canPlayType(e) != "", !f) || d && (g = d.contentType, h = Ki().canPlayType(g) != "", !h)) return q.return(b);
              } else return q.return(b);
              q.B(2);
              break;
            }
            if (!Ji()) return q.return(b);
            if (!c) {
              q.B(3);
              break;
            }
            return G(q, WC(c), 4);
          case 4:
            if (k2 = q.h, !k2) return q.return(b);
          case 3:
            if (d) {
              var r = Sb().Ka(), u = d.contentType;
              r === "CAST" && d.spatialRendering && (u += "; spatialRendering=true");
              l = dd(u);
              if (!l) return q.return(b);
            }
          case 2:
            if (!a.keySystemConfiguration) return b.supported = true, q.return(b);
            m = a.keySystemConfiguration;
            return G(q, XC(c, d, m), 6);
          case 6:
            if (n = q.h) b.supported = true, b.keySystemAccess = n;
          case 5:
            return q.return(b);
        }
      });
    }
    function WC(a) {
      var b, c, d;
      return P(function(e) {
        return e.g == 1 ? (b = Sb(), c = b.Ka(), c !== "CAST" ? e.B(2) : G(e, YC(a), 3)) : e.g != 2 ? (d = e.h, e.return(d)) : e.return(dd(a.contentType));
      });
    }
    function XC(a, b, c) {
      var d, e, f, g, h, k2, l, m, n, q, r;
      return P(function(u) {
        switch (u.g) {
          case 1:
            d = [];
            e = [];
            c.audio && (f = { robustness: c.audio.robustness || "", contentType: b.contentType }, Sb().mj() && b.contentType.includes('codecs="ac-3"') && (f.contentType = 'audio/mp4; codecs="ec-3"'), c.audio.encryptionScheme && (f.encryptionScheme = c.audio.encryptionScheme), d.push(f));
            c.video && (g = { robustness: c.video.robustness || "", contentType: a.contentType }, c.video.encryptionScheme && (g.encryptionScheme = c.video.encryptionScheme), e.push(g));
            h = { initDataTypes: [c.initDataType], distinctiveIdentifier: c.distinctiveIdentifier, persistentState: c.persistentState, sessionTypes: c.sessionTypes };
            d.length && (h.audioCapabilities = d);
            e.length && (h.videoCapabilities = e);
            k2 = a ? a.contentType : "";
            l = b ? b.contentType : "";
            m = nf(k2) + ";" + mf(k2);
            n = nf(l) + ";" + mf(l);
            q = c.keySystem;
            r = null;
            sa(u, 2);
            if (Ig.has(m + "#" + n + "#" + q)) {
              r = Ig.get(m + "#" + n + "#" + q) || null;
              u.B(4);
              break;
            }
            return G(u, navigator.requestMediaKeySystemAccess(c.keySystem, [h]), 5);
          case 5:
            r = u.h, Ig.set(m + "#" + n + "#" + q, r);
          case 4:
            ua(
              u,
              3
            );
            break;
          case 2:
            va(u);
          case 3:
            return u.return(r);
        }
      });
    }
    function YC(a) {
      var b, c, d, e, f;
      return P(function(g) {
        if (g.g == 1) {
          if (!(window2.cast && cast.__platform__ && cast.__platform__.canDisplayType)) return g.return(dd(a.contentType));
          b = a.contentType;
          a.width && a.height && a.width > 1280 && a.height > 720 && (b += "; width=" + a.width + "; height=" + a.height);
          a.framerate && (c = Math.round(a.framerate), c < 24 || c > 30) && (b += "; framerate=" + a.framerate);
          d = a.transferFunction || "";
          switch (d) {
            case "":
            case "srgb":
              break;
            case "pq":
              b += "; eotf=smpte2084";
              break;
            case "hlg":
              b += "; eotf=arib-std-b67";
              break;
            default:
              return g.return(false);
          }
          e = false;
          f = ZC;
          return f.has(b) ? (e = f.get(b), g.B(2)) : G(g, cast.__platform__.canDisplayType(b), 3);
        }
        g.g != 2 && (e = g.h, f.set(b, e));
        return g.return(e);
      });
    }
    tC.MediaCapabilities = TC;
    TC.install = UC;
    TC.originalMcap = null;
    var ZC = /* @__PURE__ */ new Map();
    wC(UC, -1);
    function $C() {
    }
    function aD() {
      var a = Sb(), b = a.Ga() === "WEBKIT" ? a.Fa() : null;
      (window2.MediaSource || window2.ManagedMediaSource) && b && window2.MediaSource && (b <= 12 ? (bD(), cD()) : b <= 15 && bD());
      a = t(a.wj());
      for (b = a.next(); !b.done; b = a.next()) dD(b.value);
      (window2.MediaSource || window2.ManagedMediaSource) && eD();
      window2.MediaSource && MediaSource.isTypeSupported('video/webm; codecs="vp9"') && !MediaSource.isTypeSupported('video/webm; codecs="vp09.00.10.08"') && fD();
    }
    function bD() {
      var a = MediaSource.prototype.addSourceBuffer;
      MediaSource.prototype.addSourceBuffer = function() {
        var b = a.apply(this, Na.apply(0, arguments));
        b.abort = function() {
        };
        return b;
      };
    }
    function cD() {
      var a = SourceBuffer.prototype.remove;
      SourceBuffer.prototype.remove = function(b, c) {
        return a.call(this, b, c - 1e-3);
      };
    }
    function eD() {
      if (window2.MediaSource) {
        var a = MediaSource.isTypeSupported.bind(MediaSource);
        MediaSource.isTypeSupported = function(c) {
          return jf(c) != "mp2t" && a(c);
        };
      }
      if (window2.ManagedMediaSource) {
        var b = ManagedMediaSource.isTypeSupported.bind(ManagedMediaSource);
        window2.ManagedMediaSource.isTypeSupported = function(c) {
          return jf(c) != "mp2t" && b(c);
        };
      }
    }
    function dD(a) {
      var b = MediaSource.isTypeSupported.bind(MediaSource);
      MediaSource.isTypeSupported = function(d) {
        return mf(d) != a && b(d);
      };
      if (window2.ManagedMediaSource) {
        var c = ManagedMediaSource.isTypeSupported.bind(ManagedMediaSource);
        window2.ManagedMediaSource.isTypeSupported = function(d) {
          return mf(d) != a && c(d);
        };
      }
    }
    function fD() {
      var a = MediaSource.isTypeSupported;
      Sb().Yj() && (MediaSource.isTypeSupported = function(b) {
        var c = b.split(/ *; */), d = c.findIndex(function(g) {
          return g.startsWith("codecs=");
        });
        if (d < 0) return a(b);
        var e = c[d].replace("codecs=", "").replace(/"/g, "").split(/\s*,\s*/), f = e.findIndex(function(g) {
          return g.startsWith("vp09");
        });
        f >= 0 && (e[f] = "vp9", c[d] = 'codecs="' + e.join(",") + '"', b = c.join("; "));
        return a(b);
      });
    }
    tC.MediaSource = $C;
    $C.install = aD;
    wC(aD);
    function gD() {
    }
    function hD() {
      screen.orientation && screen.orientation.unlock || (screen.orientation != void 0 ? iD() : window2.orientation != void 0 && jD());
    }
    function iD() {
      screen.orientation.lock === void 0 && (screen.orientation.lock = function() {
        return Promise.resolve();
      });
      screen.orientation.unlock === void 0 && (screen.orientation.unlock = function() {
      });
    }
    function jD() {
      function a() {
        switch (window2.orientation) {
          case -90:
            b.type = "landscape-secondary";
            b.angle = 270;
            break;
          case 0:
            b.type = "portrait-primary";
            b.angle = 0;
            break;
          case 90:
            b.type = "landscape-primary";
            b.angle = 90;
            break;
          case 180:
            b.type = "portrait-secondary", b.angle = 180;
        }
      }
      var b = new kD();
      screen.orientation = b;
      a();
      window2.addEventListener("orientationchange", function() {
        a();
        var c = new T("change");
        b.dispatchEvent(c);
      });
    }
    tC.Orientation = gD;
    gD.install = hD;
    function kD() {
      lb.call(this);
      this.type = "";
      this.angle = 0;
    }
    ma(kD, lb);
    kD.prototype.lock = function(a) {
      function b(d) {
        return screen.lockOrientation ? screen.lockOrientation(d) : screen.mozLockOrientation ? screen.mozLockOrientation(d) : screen.msLockOrientation ? screen.msLockOrientation(d) : false;
      }
      var c = false;
      switch (a) {
        case "natural":
          c = b("default");
          break;
        case "any":
          c = true;
          this.unlock();
          break;
        default:
          c = b(a);
      }
      if (c) return Promise.resolve();
      a = Error("screen.orientation.lock() is not available on this device");
      a.name = "NotSupportedError";
      a.code = DOMException.NOT_SUPPORTED_ERR;
      return Promise.reject(a);
    };
    kD.prototype.unlock = function() {
      screen.unlockOrientation ? screen.unlockOrientation() : screen.mozUnlockOrientation ? screen.mozUnlockOrientation() : screen.msUnlockOrientation && screen.msUnlockOrientation();
    };
    wC(hD);
    function lD() {
    }
    var mD, nD, oD, pD, qD, rD;
    function sD(a) {
      if (window2.HTMLVideoElement && window2.WebKitMediaKeys && window2.shakaMediaKeysPolyfill != tD) {
        if (a === void 0 ? 0 : a) mD = true, nD = Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype, "mediaKeys"), oD = HTMLMediaElement.prototype.setMediaKeys, pD = window2.MediaKeys, qD = window2.MediaKeySystemAccess, rD = navigator.requestMediaKeySystemAccess;
        delete HTMLMediaElement.prototype.mediaKeys;
        HTMLMediaElement.prototype.mediaKeys = null;
        HTMLMediaElement.prototype.setMediaKeys = uD;
        window2.MediaKeys = vD;
        window2.MediaKeySystemAccess = wD;
        navigator.requestMediaKeySystemAccess = xD;
        window2.shakaMediaKeysPolyfill = tD;
        Vf.clear();
        Ig.clear();
      }
    }
    function xD(a, b) {
      try {
        var c = new wD(a, b);
        return Promise.resolve(c);
      } catch (d) {
        return Promise.reject(d);
      }
    }
    function uD(a) {
      var b = this.mediaKeys;
      b && b != a && yD(b, null);
      delete this.mediaKeys;
      return (this.mediaKeys = a) ? yD(a, this) : Promise.resolve();
    }
    function zD(a) {
      a = Lb(a.initData);
      if (Pb(a).getUint32(0, true) + 4 != a.byteLength) throw new RangeError("Malformed FairPlay init data");
      a = Yb(a.subarray(4), true);
      a = ac(a);
      var b = new Event("encrypted");
      b.initDataType = "skd";
      b.initData = Mb(a);
      this.dispatchEvent(b);
    }
    tC.PatchedMediaKeysApple = lD;
    lD.uninstall = function() {
      window2.shakaMediaKeysPolyfill == tD && mD && (mD = false, Object.defineProperty(HTMLMediaElement.prototype, "mediaKeys", nD), HTMLMediaElement.prototype.setMediaKeys = oD, window2.MediaKeys = pD, window2.MediaKeySystemAccess = qD, navigator.requestMediaKeySystemAccess = rD, nD = rD = oD = qD = pD = null, window2.shakaMediaKeysPolyfill = "", Vf.clear(), Ig.clear());
    };
    lD.install = sD;
    function wD(a, b) {
      this.keySystem = a;
      if (a.startsWith("com.apple.fps")) for (a = t(b), b = a.next(); !b.done; b = a.next()) {
        var c = b.value;
        if (c.persistentState == "required") b = null;
        else {
          b = { audioCapabilities: [], videoCapabilities: [], persistentState: "optional", distinctiveIdentifier: "optional", initDataTypes: c.initDataTypes, sessionTypes: ["temporary"], label: c.label };
          var d = false, e = false;
          if (c.audioCapabilities) for (var f = t(c.audioCapabilities), g = f.next(); !g.done; g = f.next()) g = g.value, g.contentType && (d = true, WebKitMediaKeys.isTypeSupported(
            this.keySystem,
            g.contentType.split(";")[0]
          ) && (b.audioCapabilities.push(g), e = true));
          if (c.videoCapabilities) for (c = t(c.videoCapabilities), f = c.next(); !f.done; f = c.next()) f = f.value, f.contentType && (d = true, WebKitMediaKeys.isTypeSupported(this.keySystem, f.contentType.split(";")[0]) && (b.videoCapabilities.push(f), e = true));
          d || (e = WebKitMediaKeys.isTypeSupported(this.keySystem, "video/mp4"));
          b = e ? b : null;
        }
        if (b) {
          this.g = b;
          return;
        }
      }
      a = Error("Unsupported keySystem");
      a.name = "NotSupportedError";
      a.code = DOMException.NOT_SUPPORTED_ERR;
      throw a;
    }
    wD.prototype.createMediaKeys = function() {
      var a = new vD(this.keySystem);
      return Promise.resolve(a);
    };
    wD.prototype.getConfiguration = function() {
      return this.g;
    };
    function vD(a) {
      this.h = new WebKitMediaKeys(a);
      this.g = new Qc();
    }
    vD.prototype.createSession = function(a) {
      a = a || "temporary";
      if (a != "temporary") throw new TypeError("Session type " + a + " is unsupported on this platform.");
      return new AD(this.h, a);
    };
    vD.prototype.setServerCertificate = function() {
      return Promise.resolve(false);
    };
    function yD(a, b) {
      a.g.Ta();
      if (!b) return Promise.resolve();
      a.g.o(b, "webkitneedkey", zD);
      try {
        return Il(b, HTMLMediaElement.HAVE_METADATA, a.g, function() {
          b.webkitSetMediaKeys(a.h);
        }), Promise.resolve();
      } catch (c) {
        return Promise.reject(c);
      }
    }
    vD.prototype.getStatusForPolicy = function() {
      return Promise.resolve("usable");
    };
    function AD(a) {
      lb.call(this);
      this.i = null;
      this.l = a;
      this.g = this.h = null;
      this.j = new Qc();
      this.sessionId = "";
      this.expiration = NaN;
      this.closed = new Mg();
      this.keyStatuses = new BD();
      this.onkeystatuseschange = null;
    }
    ma(AD, lb);
    p = AD.prototype;
    p.generateRequest = function(a, b) {
      var c = this;
      this.h = new Mg();
      try {
        var d = this.l.createSession("video/mp4", Lb(b));
        this.i = d;
        this.sessionId = d.sessionId || "";
        this.j.o(this.i, "webkitkeymessage", function(e) {
          c.h && (c.h.resolve(), c.h = null);
          e = (/* @__PURE__ */ new Map()).set("messageType", c.keyStatuses.Oc() == void 0 ? "license-request" : "license-renewal").set("message", Mb(e.message));
          e = new T("message", e);
          c.dispatchEvent(e);
        });
        this.j.o(d, "webkitkeyadded", function() {
          c.g && (CD(c, "usable"), c.g.resolve(), c.g = null);
        });
        this.j.o(
          d,
          "webkitkeyerror",
          function() {
            var e = Error("EME PatchedMediaKeysApple key error");
            e.errorCode = c.i.error;
            if (c.h != null) c.h.reject(e), c.h = null;
            else if (c.g != null) c.g.reject(e), c.g = null;
            else switch (c.i.error.code) {
              case WebKitMediaKeyError.MEDIA_KEYERR_OUTPUT:
              case WebKitMediaKeyError.MEDIA_KEYERR_HARDWARECHANGE:
                CD(c, "output-not-allowed");
                break;
              default:
                CD(c, "internal-error");
            }
          }
        );
        CD(this, "status-pending");
      } catch (e) {
        this.h.reject(e);
      }
      return this.h;
    };
    p.load = function() {
      return Promise.reject(Error("MediaKeySession.load not yet supported"));
    };
    p.update = function(a) {
      this.g = new Mg();
      try {
        this.i.update(Lb(a));
      } catch (b) {
        this.g.reject(b);
      }
      return this.g;
    };
    p.close = function() {
      try {
        this.i.close(), this.closed.resolve(), this.j.Ta();
      } catch (a) {
        this.closed.reject(a);
      }
      return this.closed;
    };
    p.remove = function() {
      return Promise.reject(Error("MediaKeySession.remove is only applicable for persistent licenses, which are not supported on this platform"));
    };
    function CD(a, b) {
      var c = a.keyStatuses;
      c.size = b == void 0 ? 0 : 1;
      c.g = b;
      b = new T("keystatuseschange");
      a.dispatchEvent(b);
      if (a.onkeystatuseschange) a.onkeystatuseschange(b);
    }
    function BD() {
      this.size = 0;
      this.g = void 0;
    }
    p = BD.prototype;
    p.Oc = function() {
      return this.g;
    };
    p.forEach = function(a) {
      this.g && a(this.g, Dg.value());
    };
    p.get = function(a) {
      if (this.has(a)) return this.g;
    };
    p.has = function(a) {
      var b = Dg.value();
      return this.g && Kb(a, b) ? true : false;
    };
    p.entries = function() {
    };
    p.keys = function() {
    };
    p.values = function() {
    };
    var tD = "apple";
    wC(function() {
      window2.HTMLVideoElement && window2.WebKitMediaKeys && (navigator.requestMediaKeySystemAccess && MediaKeySystemAccess.prototype.getConfiguration || sD());
    });
    function DD() {
    }
    function ED() {
      if (window2.MediaKeys) {
        var a = Sb();
        MediaKeys.prototype.setServerCertificate && a.He() || (MediaKeys.prototype.setServerCertificate = FD);
      }
    }
    function FD() {
      return Promise.resolve(false);
    }
    tC.PatchedMediaKeysCert = DD;
    DD.install = ED;
    wC(ED);
    function GD() {
    }
    function HD() {
      if (!(!window2.HTMLVideoElement || navigator.requestMediaKeySystemAccess && MediaKeySystemAccess.prototype.getConfiguration)) {
        if (HTMLMediaElement.prototype.webkitGenerateKeyRequest) ID = "webkit";
        else if (!HTMLMediaElement.prototype.generateKeyRequest) return;
        navigator.requestMediaKeySystemAccess = JD;
        delete HTMLMediaElement.prototype.mediaKeys;
        HTMLMediaElement.prototype.mediaKeys = null;
        HTMLMediaElement.prototype.setMediaKeys = KD;
        window2.MediaKeys = LD;
        window2.MediaKeySystemAccess = MD;
        window2.shakaMediaKeysPolyfill = ND;
      }
    }
    function OD(a) {
      var b = ID;
      return b ? b + a.charAt(0).toUpperCase() + a.slice(1) : a;
    }
    function JD(a, b) {
      try {
        var c = new MD(a, b);
        return Promise.resolve(c);
      } catch (d) {
        return Promise.reject(d);
      }
    }
    function KD(a) {
      var b = this.mediaKeys;
      b && b != a && PD(b, null);
      delete this.mediaKeys;
      (this.mediaKeys = a) && PD(a, this);
      return Promise.resolve();
    }
    tC.PatchedMediaKeysWebkit = GD;
    GD.install = HD;
    function MD(a, b) {
      this.g = this.keySystem = a;
      var c = false;
      a == "org.w3.clearkey" && (this.g = "webkit-org.w3.clearkey", c = false);
      var d = false;
      var e = document.getElementsByTagName("video");
      e = e.length ? e[0] : document.createElement("video");
      b = t(b);
      for (var f = b.next(); !f.done; f = b.next()) {
        f = f.value;
        var g = { audioCapabilities: [], videoCapabilities: [], persistentState: "optional", distinctiveIdentifier: "optional", initDataTypes: f.initDataTypes, sessionTypes: ["temporary"], label: f.label }, h = false;
        if (f.audioCapabilities) for (var k2 = t(f.audioCapabilities), l = k2.next(); !l.done; l = k2.next()) l = l.value, l.contentType && (h = true, e.canPlayType(l.contentType.split(";")[0], this.g) && (g.audioCapabilities.push(l), d = true));
        if (f.videoCapabilities) for (k2 = t(f.videoCapabilities), l = k2.next(); !l.done; l = k2.next()) l = l.value, l.contentType && (h = true, e.canPlayType(l.contentType, this.g) && (g.videoCapabilities.push(l), d = true));
        h || (d = e.canPlayType("video/mp4", this.g) || e.canPlayType("video/webm", this.g));
        f.persistentState == "required" && (c ? (g.persistentState = "required", g.sessionTypes = ["persistent-license"]) : d = false);
        if (d) {
          this.h = g;
          return;
        }
      }
      c = "Unsupported keySystem";
      if (a == "org.w3.clearkey" || a == "com.widevine.alpha") c = "None of the requested configurations were supported.";
      a = Error(c);
      a.name = "NotSupportedError";
      a.code = DOMException.NOT_SUPPORTED_ERR;
      throw a;
    }
    MD.prototype.createMediaKeys = function() {
      var a = new LD(this.g);
      return Promise.resolve(a);
    };
    MD.prototype.getConfiguration = function() {
      return this.h;
    };
    function LD(a) {
      this.l = a;
      this.h = null;
      this.g = new Qc();
      this.i = [];
      this.j = /* @__PURE__ */ new Map();
    }
    function PD(a, b) {
      a.h = b;
      a.g.Ta();
      var c = ID;
      b && (a.g.o(b, c + "needkey", function(d) {
        var e = new CustomEvent("encrypted");
        e.initDataType = "cenc";
        e.initData = Mb(d.initData);
        a.h.dispatchEvent(e);
      }), a.g.o(b, c + "keymessage", function(d) {
        var e = QD(a, d.sessionId);
        e && (d = (/* @__PURE__ */ new Map()).set("messageType", e.keyStatuses.Oc() == void 0 ? "licenserequest" : "licenserenewal").set("message", d.message), d = new T("message", d), e.h && (e.h.resolve(), e.h = null), e.dispatchEvent(d));
      }), a.g.o(b, c + "keyadded", function(d) {
        (d = QD(a, d.sessionId)) && d.ready();
      }), a.g.o(b, c + "keyerror", function(d) {
        var e = QD(a, d.sessionId);
        if (e) {
          var f = Error("EME v0.1b key error"), g = d.errorCode;
          g.systemCode = d.systemCode;
          f.errorCode = g;
          !d.sessionId && e.h ? (d.systemCode == 45 && (f.message = "Unsupported session type."), e.h.reject(f), e.h = null) : d.sessionId && e.g ? (e.g.reject(f), e.g = null) : (f = d.systemCode, d.errorCode.code == MediaKeyError.MEDIA_KEYERR_OUTPUT ? RD(e, "output-restricted") : f == 1 ? RD(e, "expired") : RD(e, "internal-error"));
        }
      }));
    }
    LD.prototype.createSession = function(a) {
      a = a || "temporary";
      if (a != "temporary" && a != "persistent-license") throw new TypeError("Session type " + a + " is unsupported on this platform.");
      var b = this.h || document.createElement("video");
      b.src || (b.src = "about:blank");
      a = new SD(b, this.l, a);
      this.i.push(a);
      return a;
    };
    LD.prototype.setServerCertificate = function() {
      return Promise.resolve(false);
    };
    LD.prototype.getStatusForPolicy = function() {
      return Promise.resolve("usable");
    };
    function QD(a, b) {
      var c = a.j.get(b);
      return c ? c : (c = a.i.shift()) ? (c.sessionId = b, a.j.set(b, c), c) : null;
    }
    function SD(a, b, c) {
      lb.call(this);
      this.j = a;
      this.m = false;
      this.g = this.h = null;
      this.i = b;
      this.l = c;
      this.sessionId = "";
      this.expiration = NaN;
      this.closed = new Mg();
      this.keyStatuses = new TD();
      this.onkeystatuseschange = null;
    }
    ma(SD, lb);
    p = SD.prototype;
    p.ready = function() {
      RD(this, "usable");
      this.g && this.g.resolve();
      this.g = null;
    };
    function UD(a, b, c) {
      if (a.m) return Promise.reject(Error("The session is already initialized."));
      a.m = true;
      try {
        if (a.l == "persistent-license") if (c) var d = Lb(ac("LOAD_SESSION|" + c));
        else {
          var e = ac("PERSISTENT|");
          d = mc(e, b);
        }
        else d = Lb(b);
      } catch (g) {
        return Promise.reject(g);
      }
      a.h = new Mg();
      var f = OD("generateKeyRequest");
      try {
        a.j[f](a.i, d);
      } catch (g) {
        if (g.name != "InvalidStateError") return a.h = null, Promise.reject(g);
        new Cf(function() {
          try {
            a.j[f](a.i, d);
          } catch (h) {
            a.h.reject(h), a.h = null;
          }
        }).Y(0.01);
      }
      return a.h;
    }
    function VD(a, b, c) {
      if (a.g) a.g.then(function() {
        return VD(a, b, c);
      }).catch(function() {
        return VD(a, b, c);
      });
      else {
        a.g = b;
        if (a.i == "webkit-org.w3.clearkey") {
          var d = Xb(c);
          var e = JSON.parse(d);
          e.keys[0].kty != "oct" && (a.g.reject(Error("Response is not a valid JSON Web Key Set.")), a.g = null);
          d = jc(e.keys[0].k);
          e = jc(e.keys[0].kid);
        } else d = Lb(c), e = null;
        var f = OD("addKey");
        try {
          a.j[f](a.i, d, e, a.sessionId);
        } catch (g) {
          a.g.reject(g), a.g = null;
        }
      }
    }
    function RD(a, b) {
      var c = a.keyStatuses;
      c.size = b == void 0 ? 0 : 1;
      c.g = b;
      b = new T("keystatuseschange");
      a.dispatchEvent(b);
      if (a.onkeystatuseschange) a.onkeystatuseschange(b);
    }
    p.generateRequest = function(a, b) {
      return UD(this, b, null);
    };
    p.load = function(a) {
      return this.l == "persistent-license" ? UD(this, null, a) : Promise.reject(Error("Not a persistent session."));
    };
    p.update = function(a) {
      var b = new Mg();
      VD(this, b, a);
      return b;
    };
    p.close = function() {
      if (this.l != "persistent-license") {
        if (!this.sessionId) return this.closed.reject(Error("The session is not callable.")), this.closed;
        var a = OD("cancelKeyRequest");
        try {
          this.j[a](this.i, this.sessionId);
        } catch (b) {
        }
      }
      this.closed.resolve();
      return this.closed;
    };
    p.remove = function() {
      return this.l != "persistent-license" ? Promise.reject(Error("Not a persistent session.")) : this.close();
    };
    function TD() {
      this.size = 0;
      this.g = void 0;
    }
    p = TD.prototype;
    p.Oc = function() {
      return this.g;
    };
    p.forEach = function(a) {
      this.g && a(this.g, Dg.value());
    };
    p.get = function(a) {
      if (this.has(a)) return this.g;
    };
    p.has = function(a) {
      var b = Dg.value();
      return this.g && Kb(a, b) ? true : false;
    };
    p.entries = function() {
    };
    p.keys = function() {
    };
    p.values = function() {
    };
    var ID = "", ND = "webkit";
    wC(HD);
    function WD() {
    }
    function XD() {
      if (window2.HTMLVideoElement) {
        var a = HTMLVideoElement.prototype;
        a.requestPictureInPicture && document.exitPictureInPicture || !a.webkitSupportsPresentationMode || (document.pictureInPictureEnabled = true, document.pictureInPictureElement = null, a.requestPictureInPicture = YD, Object.defineProperty(a, "disablePictureInPicture", { get: ZD, set: $D, enumerable: true, configurable: true }), document.exitPictureInPicture = aE, document.addEventListener("webkitpresentationmodechanged", bE, true));
      }
    }
    function bE(a) {
      a = a.target;
      if (a.webkitPresentationMode == "picture-in-picture") {
        document.pictureInPictureElement = a;
        var b = new Event("enterpictureinpicture");
        a.dispatchEvent(b);
      } else document.pictureInPictureElement == a && (document.pictureInPictureElement = null), b = new Event("leavepictureinpicture"), a.dispatchEvent(b);
    }
    function YD() {
      return this.webkitSupportsPresentationMode("picture-in-picture") ? (this.webkitSetPresentationMode("picture-in-picture"), document.pictureInPictureElement = this, Promise.resolve()) : Promise.reject(Error("PiP not allowed by video element"));
    }
    function aE() {
      var a = document.pictureInPictureElement;
      return a ? (a.webkitSetPresentationMode("inline"), document.pictureInPictureElement = null, Promise.resolve()) : Promise.reject(Error("No picture in picture element found"));
    }
    function ZD() {
      return this.hasAttribute("disablePictureInPicture") ? true : !this.webkitSupportsPresentationMode("picture-in-picture");
    }
    function $D(a) {
      a ? this.setAttribute("disablePictureInPicture", "") : this.removeAttribute("disablePictureInPicture");
    }
    tC.PiPWebkit = WD;
    WD.install = XD;
    wC(XD);
    function cE() {
    }
    function dE() {
      window2.crypto && ("randomUUID" in window2.crypto || (window2.crypto.randomUUID = eE));
    }
    function eE() {
      var a = URL.createObjectURL(new Blob()), b = a.toString();
      URL.revokeObjectURL(a);
      return b.substr(b.lastIndexOf("/") + 1);
    }
    tC.RandomUUID = cE;
    cE.install = dE;
    wC(dE);
    function fE() {
    }
    function gE() {
      var a = Symbol.prototype;
      "description" in a || Object.defineProperty(a, "description", { get: hE });
    }
    function hE() {
      var a = /\((.*)\)/.exec(this.toString());
      return a ? a[1] : void 0;
    }
    tC.Symbol = fE;
    fE.install = gE;
    wC(gE);
    function iE() {
    }
    function jE() {
      for (var a = t([Uint8Array, Uint8ClampedArray, Uint16Array, Uint32Array, Int8Array, Int16Array, Int32Array, Float32Array, Float64Array]), b = a.next(); !b.done; b = a.next()) b = b.value, b.prototype.indexOf || (b.prototype.indexOf = kE), b.prototype.lastIndexOf || (b.prototype.lastIndexOf = lE), b.prototype.includes || (b.prototype.includes = mE);
    }
    function kE(a, b) {
      return Array.prototype.indexOf.call(this, a, b);
    }
    function lE(a, b) {
      return Array.prototype.lastIndexOf.call(this, a, b);
    }
    function mE(a, b) {
      return this.indexOf(a, b) !== -1;
    }
    tC.TypedArray = iE;
    iE.install = jE;
    wC(jE);
    function nE() {
    }
    function oE() {
      if (window2.HTMLMediaElement) {
        var a = HTMLMediaElement.prototype.play;
        HTMLMediaElement.prototype.play = function() {
          var b = a.apply(this);
          b && b.catch(function() {
          });
          return b;
        };
      }
    }
    tC.VideoPlayPromise = nE;
    nE.install = oE;
    wC(oE);
    function pE() {
    }
    function qE() {
      if (window2.HTMLVideoElement) {
        var a = HTMLVideoElement.prototype;
        !a.getVideoPlaybackQuality && ("webkitDroppedFrameCount" in a || typeof Ki().webkitDroppedFrameCount === "number") && (a.getVideoPlaybackQuality = rE);
      }
    }
    function rE() {
      return { droppedVideoFrames: this.webkitDroppedFrameCount, totalVideoFrames: this.webkitDecodedFrameCount, corruptedVideoFrames: 0, creationTime: NaN, totalFrameDelay: 0 };
    }
    tC.VideoPlaybackQuality = pE;
    pE.install = qE;
    wC(qE);
    function sE() {
    }
    function tE() {
      if (!window2.VTTCue && window2.TextTrackCue) {
        var a = null, b = TextTrackCue.length;
        if (b == 3) a = uE;
        else if (b == 6) a = vE;
        else {
          try {
            var c = !!uE(1, 2, "");
          } catch (d) {
            c = false;
          }
          c && (a = uE);
        }
        a && (window2.VTTCue = function(d, e, f) {
          return a(d, e, f);
        });
      }
    }
    function uE(a, b, c) {
      return new window2.TextTrackCue(a, b, c);
    }
    function vE(a, b, c) {
      return new window2.TextTrackCue(a + "-" + b + "-" + c, a, b, c);
    }
    tC.VTTCue = sE;
    sE.install = tE;
    wC(tE);
    function wE(a) {
      lb.call(this);
      this.h = a;
      this.l = null;
      this.g = [];
      this.i = -1;
      this.j = null;
      this.m = new Qc();
    }
    ma(wE, lb);
    p = wE.prototype;
    p.destroy = function() {
      var a = this;
      return P(function(b) {
        if (b.g == 1) return G(b, a.removeAllItems(), 2);
        a.h = null;
        a.m && (a.m.release(), a.m = null);
        lb.prototype.release.call(a);
        H(b);
      });
    };
    p.configure = function(a) {
      this.l = a;
    };
    p.getConfiguration = function() {
      return this.l;
    };
    p.getCurrentItem = function() {
      return this.g.length && this.i >= 0 && this.i < this.g.length ? this.g[this.i] : null;
    };
    p.getCurrentItemIndex = function() {
      return this.i;
    };
    p.getItems = function() {
      return this.g.slice();
    };
    p.insertItems = function(a) {
      this.g.push.apply(this.g, x(a));
      this.dispatchEvent(new T("itemsinserted"));
    };
    p.removeAllItems = function() {
      var a = this;
      return P(function(b) {
        switch (b.g) {
          case 1:
            a.m.Ta();
            if (!(a.g.length && a.i >= 0)) {
              b.B(2);
              break;
            }
            return G(b, a.h.rc(), 2);
          case 2:
            if (!a.j) {
              b.B(4);
              break;
            }
            if (a.j.Vf.A) {
              b.B(5);
              break;
            }
            return G(b, a.j.Vf.destroy(), 5);
          case 5:
            a.j = null;
          case 4:
            a.g = [], a.i = -1, a.dispatchEvent(new T("itemsremoved")), H(b);
        }
      });
    };
    p.playItem = function(a) {
      var b = this, c, d, e, f, g, h, k2, l, m, n, q, r, u, w;
      return P(function(v) {
        if (v.g == 1) {
          b.m.Ta();
          if (!b.g.length || a >= b.g.length) throw new U(2, 7, 7007);
          c = b.g[a];
          b.i != a && (b.i = a, b.dispatchEvent(new T("currentitemchanged")));
          d = b.h.h;
          e = b.l ? b.l.preloadNextUrlWindow : 0;
          e > 0 && (f = false, b.m.o(d, "timeupdate", function() {
            var y, z, A, C;
            return P(function(D) {
              switch (D.g) {
                case 1:
                  if (b.j || b.g.length <= 1 || f || b.h.U() || !d.duration) return D.return();
                  y = b.h.ya().end - d.currentTime;
                  if (isNaN(y)) {
                    D.B(0);
                    break;
                  }
                  if (!(y <= e)) {
                    D.B(0);
                    break;
                  }
                  z = b.l && b.l.repeatMode;
                  A = null;
                  b.i + 1 < b.g.length ? A = b.g[b.i + 1] : z == 1 && (A = b.g[0]);
                  if (!A) {
                    D.B(0);
                    break;
                  }
                  f = true;
                  C = null;
                  sa(D, 5);
                  return G(D, b.h.preload(A.manifestUri, A.startTime, A.mimeType, A.config), 7);
                case 7:
                  C = D.h;
                  ua(D, 6);
                  break;
                case 5:
                  va(D), C = null;
                case 6:
                  b.j = { item: A, Vf: C }, f = false, H(D);
              }
            });
          }));
          b.m.o(b.h, "complete", function() {
            var y = b.l && b.l.repeatMode, z = false;
            if (y == 2) z = true;
            else {
              var A = b.i + 1;
              A < b.g.length ? b.playItem(A) : y == 1 && (b.g.length == 1 ? z = true : b.playItem(0));
            }
            z && (d.paused ? (d.currentTime = b.h.ya().start, d.play()) : b.m.o(
              d,
              "paused",
              function() {
                d.currentTime = b.h.ya().start;
                d.play();
              }
            ));
          });
          c.config && (b.h.Aj(), b.h.configure(c.config));
          g = c.manifestUri;
          b.j && b.j.item == c && b.j.Vf && (g = b.j.Vf);
          return G(v, b.h.load(g, c.startTime, c.mimeType), 2);
        }
        b.j = null;
        if (c.extraText) for (h = t(c.extraText), k2 = h.next(); !k2.done; k2 = h.next()) l = k2.value, l.mime ? b.h.be(l.uri, l.language, l.kind, l.mime, l.codecs) : b.h.be(l.uri, l.language, l.kind);
        if (c.extraThumbnail) for (m = t(c.extraThumbnail), n = m.next(); !n.done; n = m.next()) q = n.value, b.h.cf(q);
        if (c.extraChapter) for (r = t(c.extraChapter), u = r.next(); !u.done; u = r.next()) w = u.value, b.h.bf(w.uri, w.language, w.mime);
        H(v);
      });
    };
    S("shaka.queue.QueueManager", wE);
    wE.prototype.playItem = wE.prototype.playItem;
    wE.prototype.removeAllItems = wE.prototype.removeAllItems;
    wE.prototype.insertItems = wE.prototype.insertItems;
    wE.prototype.getItems = wE.prototype.getItems;
    wE.prototype.getCurrentItemIndex = wE.prototype.getCurrentItemIndex;
    wE.prototype.getCurrentItem = wE.prototype.getCurrentItem;
    wE.prototype.getConfiguration = wE.prototype.getConfiguration;
    wE.prototype.configure = wE.prototype.configure;
    wE.prototype.destroy = wE.prototype.destroy;
    oq = function(a) {
      return new wE(a);
    };
    function xE() {
    }
    xE.prototype.parseInit = function() {
    };
    xE.prototype.setSequenceMode = function() {
    };
    xE.prototype.setManifestType = function() {
    };
    xE.prototype.parseMedia = function(a, b) {
      var c = null, d = [];
      a = Xb(a).split(/\r?\n/);
      a = t(a);
      for (var e = a.next(); !e.done; e = a.next()) if ((e = e.value) && !/^\s+$/.test(e) && (e = yE.exec(e))) {
        var f = zE.exec(e[1]);
        f = parseInt(f[1], 10) * 60 + parseFloat(f[2].replace(",", "."));
        e = new se(f, b.segmentEnd ? b.segmentEnd : f + 2, e[2]);
        c && (c.endTime = f, d.push(c));
        c = e;
      }
      c && d.push(c);
      return d;
    };
    S("shaka.text.LrcTextParser", xE);
    xE.prototype.parseMedia = xE.prototype.parseMedia;
    xE.prototype.setManifestType = xE.prototype.setManifestType;
    xE.prototype.setSequenceMode = xE.prototype.setSequenceMode;
    xE.prototype.parseInit = xE.prototype.parseInit;
    var yE = /^\[(\d{1,2}:\d{1,2}(?:[.,]\d{1,3})?)\](.*)/, zE = /^(\d+):(\d{1,2}(?:[.,]\d{1,3})?)$/;
    rf("application/x-subtitle-lrc", function() {
      return new xE();
    });
    function AE() {
    }
    AE.prototype.parseInit = function() {
    };
    AE.prototype.setSequenceMode = function() {
    };
    AE.prototype.setManifestType = function() {
    };
    AE.prototype.parseMedia = function(a, b, c, d) {
      var e = Xb(a);
      a = [];
      if (e == "") return a;
      var f = Ld(e, "tt", true);
      if (!f) throw new U(2, 2, 2005, "Failed to parse TTML.");
      e = Vd(f, "body")[0];
      if (!e) return [];
      var g = be(f, BE, "frameRate"), h = be(f, BE, "subFrameRate"), k2 = be(f, BE, "frameRateMultiplier"), l = be(f, BE, "tickRate"), m = be(f, BE, "cellResolution"), n = f.attributes["xml:space"] || "default", q = be(f, CE, "extent");
      if (n != "default" && n != "preserve") throw new U(2, 2, 2005, "Invalid xml:space value: " + n);
      n = n == "default";
      g = new DE(g, h, k2, l);
      m = EE(m);
      h = Vd(f, "metadata")[0];
      h = (h ? h.children : []).filter(function(w) {
        return w != "\n";
      });
      k2 = Vd(f, "style");
      f = Vd(f, "region");
      l = [];
      for (var r = t(f), u = r.next(); !u.done; u = r.next()) (u = FE(u.value, k2, q)) && l.push(u);
      if (Sd(e, "p").length) throw new U(2, 2, 2001, "<p> can only be inside <div> in TTML");
      q = t(Sd(e, "div"));
      for (r = q.next(); !r.done; r = q.next()) if (Sd(r.value, "span").length) throw new U(2, 2, 2001, "<span> can only be inside <p> in TTML");
      if (b = GE(e, b, g, h, k2, f, l, n, m, null, false, c, d)) b.backgroundColor || (b.backgroundColor = "transparent"), a.push(b);
      return a;
    };
    function GE(a, b, c, d, e, f, g, h, k2, l, m, n, q) {
      var r = l;
      if (Qd(a)) {
        if (!m) return null;
        var u = { tagName: "span", children: [Td(a)], attributes: {}, parent: null };
      } else u = a;
      for (var w = null, v = t(HE), y = v.next(); !y.done && !(w = IE(u, "backgroundImage", d, "#", y.value)[0]); y = v.next()) ;
      v = null;
      y = be(u, HE, "backgroundImage");
      var z = /^(urn:)(mpeg:[a-z0-9][a-z0-9-]{0,31}:)(subs:)([0-9]+)$/;
      if (y && z.test(y)) {
        v = parseInt(y.split(":").pop(), 10) - 1;
        if (v >= q.length) return null;
        v = q[v];
      } else n && y && !y.startsWith("#") && (z = new rb(n), y = new rb(y), (y = z.resolve(y).toString()) && (v = y));
      if (a.tagName == "p" || w || v) m = true;
      a = m;
      y = (u.attributes["xml:space"] || (h ? "default" : "preserve")) == "default";
      z = u.children.every(Qd);
      h = [];
      if (!z) for (var A = t(u.children), C = A.next(); !C.done; C = A.next()) (C = GE(C.value, b, c, d, e, f, g, y, k2, u, m, n, q)) && h.push(C);
      d = l != null;
      n = Td(u);
      n = u.children.length && n && /\S/.test(n);
      A = u.attributes.begin || u.attributes.end || u.attributes.dur;
      if (!(A || n || u.tagName == "br" || h.length != 0 || d && !y)) return null;
      q = JE(u, c);
      n = q.start;
      for (q = q.end; r && r.tagName && r.tagName != "tt"; ) q = KE(r, c, n, q), n = q.start, q = q.end, r = r.parent;
      n == null && (n = 0);
      n += b.periodStart;
      q = q == null ? Infinity : q + b.periodStart;
      n = Math.max(n, b.segmentStart);
      q = Math.min(q, b.segmentEnd);
      if (!A && h.length > 0) for (n = Infinity, q = 0, b = t(h), c = b.next(); !c.done; c = b.next()) c = c.value, n = Math.min(n, c.startTime), q = Math.max(q, c.endTime);
      if (u.tagName == "br") return e = new se(n, q, ""), e.lineBreak = true, e;
      b = "";
      z && (b = dc(Td(u) || ""), y && (b = b.replace(/\s+/g, " ")));
      b = new se(n, q, b);
      b.nestedCues = h;
      m || (b.isContainer = true);
      k2 && (b.cellResolution = k2);
      k2 = IE(u, "region", f, "")[0];
      if (u.attributes.region && k2 && k2.attributes["xml:id"]) {
        var D = k2.attributes["xml:id"];
        b.region = g.filter(function(F) {
          return F.id == D;
        })[0];
      }
      g = k2;
      l && d && !u.attributes.region && !u.attributes.style && (g = IE(l, "region", f, "")[0]);
      LE(b, u, g, w, v, e, a, h.length == 0);
      return b;
    }
    function FE(a, b, c) {
      var d = new qd(), e = a.attributes["xml:id"];
      if (!e) return null;
      d.id = e;
      e = null;
      c && (e = ME.exec(c) || NE.exec(c));
      c = e ? Number(e[1]) : null;
      e = e ? Number(e[2]) : null;
      var f, g = OE(a, b, "extent");
      if (g) {
        var h = (f = ME.exec(g)) || NE.exec(g);
        h != null && (d.width = Number(h[1]), d.height = Number(h[2]), f || (c != null && (d.width = d.width * 100 / c), e != null && (d.height = d.height * 100 / e)), d.widthUnits = f || c != null ? rd : 0, d.heightUnits = f || e != null ? rd : 0);
      }
      if (a = OE(a, b, "origin")) {
        if (h = (f = ME.exec(a)) || NE.exec(a), h != null) d.viewportAnchorX = Number(h[1]), d.viewportAnchorY = Number(h[2]), f ? g || (d.width = 100 - d.viewportAnchorX, d.widthUnits = rd, d.height = 100 - d.viewportAnchorY, d.heightUnits = rd) : (e != null && (d.viewportAnchorY = d.viewportAnchorY * 100 / e), c != null && (d.viewportAnchorX = d.viewportAnchorX * 100 / c)), d.viewportAnchorUnits = f || c != null ? rd : 0;
      }
      return d;
    }
    function PE(a) {
      var b = a.match(/rgba\(([^)]+)\)/);
      return b && (b = b[1].split(","), b.length == 4) ? (b[3] = String(Number(b[3]) / 255), "rgba(" + b.join(",") + ")") : a;
    }
    function LE(a, b, c, d, e, f, g, h) {
      g = g || h;
      QE(b, c, f, "direction", g) == "rtl" && (a.direction = "rtl");
      h = QE(b, c, f, "writingMode", g);
      h == "tb" || h == "tblr" ? a.writingMode = "vertical-lr" : h == "tbrl" ? a.writingMode = "vertical-rl" : h == "rltb" || h == "rl" ? a.direction = "rtl" : h && (a.direction = ve);
      (h = QE(b, c, f, "textAlign", true)) ? (a.positionAlign = RE.get(h), a.lineAlign = SE.get(h), a.textAlign = Se[h.toUpperCase()]) : a.textAlign = ue;
      if (h = QE(b, c, f, "displayAlign", true)) a.displayAlign = Te[h.toUpperCase()];
      if (h = QE(b, c, f, "color", g)) a.color = PE(h);
      if (h = QE(
        b,
        c,
        f,
        "backgroundColor",
        g
      )) a.backgroundColor = PE(h);
      if (h = QE(b, c, f, "border", g)) a.border = h;
      if (h = QE(b, c, f, "fontFamily", g)) switch (h) {
        case "monospaceSerif":
          a.fontFamily = "Courier New,Liberation Mono,Courier,monospace";
          break;
        case "proportionalSansSerif":
          a.fontFamily = "Arial,Helvetica,Liberation Sans,sans-serif";
          break;
        case "sansSerif":
          a.fontFamily = "sans-serif";
          break;
        case "monospaceSansSerif":
          a.fontFamily = "Consolas,monospace";
          break;
        case "proportionalSerif":
          a.fontFamily = "serif";
          break;
        default:
          a.fontFamily = h.split(",").filter(function(k2) {
            return k2 != "default";
          }).join(",");
      }
      (h = QE(b, c, f, "fontWeight", g)) && h == "bold" && (a.fontWeight = Pe);
      h = QE(b, c, f, "wrapOption", g);
      a.wrapLine = h && h == "noWrap" ? false : true;
      (h = QE(b, c, f, "lineHeight", g)) && h.match(TE) && (a.lineHeight = h);
      (h = QE(b, c, f, "fontSize", g)) && (h.match(TE) || h.match(UE)) && (a.fontSize = h);
      if (h = QE(b, c, f, "fontStyle", g)) a.fontStyle = Ve[h.toUpperCase()];
      d ? (e = d.attributes.imageType || d.attributes.imagetype, h = d.attributes.encoding, d = Td(d).trim(), e == "PNG" && h == "Base64" && d && (a.backgroundImage = "data:image/png;base64," + d)) : e && (a.backgroundImage = e);
      if (d = QE(b, c, f, "textOutline", g)) d = d.split(" "), d[0].match(TE) ? a.textStrokeColor = a.color : (a.textStrokeColor = PE(d[0]), d.shift()), d[0] && d[0].match(TE) ? a.textStrokeWidth = d[0] : a.textStrokeColor = "";
      (d = QE(b, c, f, "letterSpacing", g)) && d.match(TE) && (a.letterSpacing = d);
      (d = QE(b, c, f, "linePadding", g)) && d.match(TE) && (a.linePadding = d);
      if (d = QE(b, c, f, "opacity", g)) a.opacity = parseFloat(d);
      (d = OE(c, f, "textDecoration")) && VE(a, d);
      (d = WE(b, f, "textDecoration")) && VE(a, d);
      if (d = QE(b, c, f, "textCombine", g)) a.textCombineUpright = d;
      switch (QE(b, c, f, "ruby", g)) {
        case "container":
          a.rubyTag = "ruby";
          break;
        case "text":
          a.rubyTag = "rt";
      }
    }
    function VE(a, b) {
      b = t(b.split(" "));
      for (var c = b.next(); !c.done; c = b.next()) switch (c.value) {
        case "underline":
          a.textDecoration.includes(Re) || a.textDecoration.push(Re);
          break;
        case "noUnderline":
          a.textDecoration.includes(Re) && ud(a.textDecoration, Re);
          break;
        case "lineThrough":
          a.textDecoration.includes("lineThrough") || a.textDecoration.push("lineThrough");
          break;
        case "noLineThrough":
          a.textDecoration.includes("lineThrough") && ud(a.textDecoration, "lineThrough");
          break;
        case "overline":
          a.textDecoration.includes("overline") || a.textDecoration.push("overline");
          break;
        case "noOverline":
          a.textDecoration.includes("overline") && ud(a.textDecoration, "overline");
      }
    }
    function QE(a, b, c, d, e) {
      e = e === void 0 ? true : e;
      return (a = WE(a, c, d)) ? a : e ? OE(b, c, d) : null;
    }
    function OE(a, b, c) {
      if (!a) return null;
      var d = be(a, CE, c);
      return d ? d : XE(a, b, c);
    }
    function WE(a, b, c) {
      var d = be(a, CE, c);
      return d ? d : XE(a, b, c);
    }
    function XE(a, b, c) {
      a = IE(a, "style", b, "");
      for (var d = null, e = 0; e < a.length; e++) {
        var f = ae(a[e], "urn:ebu:tt:style", c);
        f || (f = be(a[e], CE, c));
        f || (f = WE(a[e], b, c));
        f && (d = f);
      }
      return d;
    }
    function IE(a, b, c, d, e) {
      var f = [];
      if (!a || c.length < 1) return f;
      var g = a;
      for (a = null; !a && !(a = e ? ae(g, e, b) : g.attributes[b]) && (g = g.parent, g); ) ;
      if (b = a) {
        for (b = t(b.split(" ")), e = b.next(); !e.done; e = b.next()) for (e = e.value, a = t(c), g = a.next(); !g.done; g = a.next()) if (g = g.value, d + g.attributes["xml:id"] == e) {
          f.push(g);
          break;
        }
      }
      return f;
    }
    function KE(a, b, c, d) {
      a = JE(a, b);
      c == null ? c = a.start : a.start != null && (c += a.start);
      d == null ? d = a.end : a.start != null && (d += a.start);
      return { start: c, end: d };
    }
    function JE(a, b) {
      var c = YE(a.attributes.begin, b), d = YE(a.attributes.end, b);
      a = YE(a.attributes.dur, b);
      d == null && a != null && (d = c + a);
      return { start: c, end: d };
    }
    function YE(a, b) {
      var c = null;
      if (ZE.test(a)) {
        a = ZE.exec(a);
        c = Number(a[1]);
        var d = Number(a[2]), e = Number(a[3]), f = Number(a[4]);
        f += (Number(a[5]) || 0) / b.h;
        e += f / b.frameRate;
        c = e + d * 60 + c * 3600;
      } else if ($E.test(a)) c = aF($E, a);
      else if (bF.test(a)) c = aF(bF, a);
      else if (cF.test(a)) a = cF.exec(a), c = Number(a[1]) / b.frameRate;
      else if (dF.test(a)) a = dF.exec(a), c = Number(a[1]) / b.g;
      else if (eF.test(a)) c = aF(eF, a);
      else if (a) throw new U(2, 2, 2001, "Could not parse cue time range in TTML");
      return c;
    }
    function aF(a, b) {
      a = a.exec(b);
      return a == null || a[0] == "" ? null : (Number(a[4]) || 0) / 1e3 + (Number(a[3]) || 0) + (Number(a[2]) || 0) * 60 + (Number(a[1]) || 0) * 3600;
    }
    function EE(a) {
      return a ? (a = /^(\d+) (\d+)$/.exec(a)) ? { columns: parseInt(a[1], 10), rows: parseInt(a[2], 10) } : null : null;
    }
    S("shaka.text.TtmlTextParser", AE);
    AE.prototype.parseMedia = AE.prototype.parseMedia;
    AE.prototype.setManifestType = AE.prototype.setManifestType;
    AE.prototype.setSequenceMode = AE.prototype.setSequenceMode;
    AE.prototype.parseInit = AE.prototype.parseInit;
    function DE(a, b, c, d) {
      this.frameRate = Number(a) || 30;
      this.h = Number(b) || 1;
      this.g = Number(d);
      this.g == 0 && (this.g = a ? this.frameRate * this.h : 1);
      c && (a = /^(\d+) (\d+)$/g.exec(c)) && (this.frameRate *= Number(a[1]) / Number(a[2]));
    }
    var ME = /^(\d{1,2}(?:\.\d+)?|100(?:\.0+)?)% (\d{1,2}(?:\.\d+)?|100(?:\.0+)?)%$/, UE = /^(\d{1,4}(?:\.\d+)?|100)%$/, TE = /^(\d+px|\d+em|\d*\.?\d+c)$/, NE = /^(\d+)px (\d+)px$/, ZE = /^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/, $E = /^(?:(\d{2,}):)?(\d{2}):(\d{2})$/, bF = /^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d+)$/, cF = /^(\d*(?:\.\d*)?)f$/, dF = /^(\d*(?:\.\d*)?)t$/, eF = RegExp("^(?:(\\d*(?:\\.\\d*)?)h)?(?:(\\d*(?:\\.\\d*)?)m)?(?:(\\d*(?:\\.\\d*)?)s)?(?:(\\d*(?:\\.\\d*)?)ms)?$"), SE = (/* @__PURE__ */ new Map()).set("left", ye).set("center", "center").set(
      "right",
      "end"
    ).set("start", ye).set("end", "end"), RE = (/* @__PURE__ */ new Map()).set("left", "line-left").set("center", "center").set("right", "line-right"), BE = ["http://www.w3.org/ns/ttml#parameter", "http://www.w3.org/2006/10/ttaf1#parameter"], CE = ["http://www.w3.org/ns/ttml#styling", "http://www.w3.org/2006/10/ttaf1#styling"], HE = ["http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt", "http://www.smpte-ra.org/schemas/2052-1/2013/smpte-tt"];
    rf("application/ttml+xml", function() {
      return new AE();
    });
    function fF() {
      this.g = new AE();
    }
    fF.prototype.parseInit = function(a) {
      var b = false;
      new ph().box("moov", uh).box("trak", uh).box("mdia", uh).box("minf", uh).box("stbl", uh).W("stsd", wh).box("stpp", function(c) {
        b = true;
        c.parser.stop();
      }).parse(a);
      if (!b) throw new U(2, 2, 2007);
    };
    fF.prototype.setSequenceMode = function() {
    };
    fF.prototype.setManifestType = function() {
    };
    fF.prototype.parseMedia = function(a, b, c) {
      var d = [], e = null, f = [], g = /* @__PURE__ */ new Map(), h = [];
      new ph().box("moof", uh).box("traf", uh).W("tfhd", function(y) {
        e = Mi(y.reader, y.flags).ie;
      }).W("trun", function(y) {
        y = Pi(y.reader, y.version, y.flags);
        y = t(y.Zh);
        for (var z = y.next(); !z.done; z = y.next()) h.push(z.value.sampleSize || e || 0);
      }).W("subs", function(y) {
        for (var z = y.reader, A = z.X(), C = -1, D = 0; D < A; D++) {
          var F = z.X();
          C += F;
          F = z.Ha();
          for (var B = [], E = 0; E < F; E++) y.version == 1 ? B.push(z.X()) : B.push(z.Ha()), z.ba(), z.ba(), z.X();
          g.set(C, B);
        }
      }).box(
        "mdat",
        zh(function(y) {
          f.push(y);
        })
      ).parse(a, false);
      if (f.length == 0) throw new U(2, 2, 2007);
      for (var k2 = mc.apply(ec, x(f)), l = 0, m = 0; m < h.length; m++) {
        var n = Lb(k2, l, h[m]);
        l += h[m];
        var q = g.get(m);
        if (q && q.length) {
          n = Lb(n, 0, q[0]);
          for (var r = [], u = q[0], w = 1; w < q.length; w++) {
            var v = Lb(a, u, q[w]);
            v = hc(v);
            r.push("data:image/png;base64," + v);
            u += q[w];
          }
          d = d.concat(this.g.parseMedia(n, b, c, r));
        } else d = d.concat(this.g.parseMedia(n, b, c, []));
      }
      return d;
    };
    S("shaka.text.Mp4TtmlParser", fF);
    fF.prototype.parseMedia = fF.prototype.parseMedia;
    fF.prototype.setManifestType = fF.prototype.setManifestType;
    fF.prototype.setSequenceMode = fF.prototype.setSequenceMode;
    fF.prototype.parseInit = fF.prototype.parseInit;
    rf('application/mp4; codecs="stpp"', function() {
      return new fF();
    });
    rf('application/mp4; codecs="stpp.ttml"', function() {
      return new fF();
    });
    rf('application/mp4; codecs="stpp.ttml.im1i"', function() {
      return new fF();
    });
    rf('application/mp4; codecs="stpp.ttml.im1t"', function() {
      return new fF();
    });
    rf('application/mp4; codecs="stpp.ttml.im2i"', function() {
      return new fF();
    });
    rf('application/mp4; codecs="stpp.ttml.im2t"', function() {
      return new fF();
    });
    rf('application/mp4; codecs="stpp.ttml.etd1"', function() {
      return new fF();
    });
    rf('application/mp4; codecs="stpp.ttml.etd1|im1t"', function() {
      return new fF();
    });
    rf('application/mp4; codecs="stpp.ttml.im1t|etd1"', function() {
      return new fF();
    });
    rf('application/mp4; codecs="stpp.TTML.im1t"', function() {
      return new fF();
    });
    function gF() {
      this.g = "UNKNOWN";
    }
    gF.prototype.parseInit = function() {
    };
    gF.prototype.setSequenceMode = function() {
    };
    gF.prototype.setManifestType = function(a) {
      this.g = a;
    };
    gF.prototype.parseMedia = function(a, b) {
      a = Xb(a);
      a = a.replace(/\r\n|\r(?=[^\n]|$)/gm, "\n");
      var c = a.split(/\n{2,}/m);
      if (!/^WEBVTT($|[ \t\n])/m.test(c[0])) throw new U(2, 2, 2e3);
      a = b.vttOffset;
      if (this.g == "HLS") if (c[0].includes("X-TIMESTAMP-MAP")) {
        var d = c[0];
        a = d.match(/LOCAL:((?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3}))/m);
        d = d.match(/MPEGTS:(\d+)/m);
        if (!a || !d) throw new U(2, 2, 2e3);
        a = Fd(a[1]);
        if (a == null) throw new U(2, 2, 2e3);
        d = Number(d[1]);
        for (var e = b.segmentStart - b.periodStart; e >= 95443.7176888889; ) e -= 95443.7176888889, d += 8589934592;
        a = b.periodStart + d / 9e4 - a;
      } else b.periodStart && b.vttOffset == b.periodStart && (a = 0);
      b = [];
      d = t(c[0].split("\n"));
      for (e = d.next(); !e.done; e = d.next()) if (e = e.value, /^Region:/.test(e)) {
        e = new xd(e);
        var f = new qd();
        Bd(e);
        yd(e);
        for (var g = Bd(e); g; ) {
          var h = f, k2 = g;
          (g = /^id=(.*)$/.exec(k2)) ? h.id = g[1] : (g = /^width=(\d{1,2}|100)%$/.exec(k2)) ? h.width = Number(g[1]) : (g = /^lines=(\d+)$/.exec(k2)) ? (h.height = Number(g[1]), h.heightUnits = 2) : (g = /^regionanchor=(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(k2)) ? (h.regionAnchorX = Number(g[1]), h.regionAnchorY = Number(g[2])) : (g = /^viewportanchor=(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(k2)) ? (h.viewportAnchorX = Number(g[1]), h.viewportAnchorY = Number(g[2])) : /^scroll=up$/.exec(k2) && (h.scroll = "up");
          yd(e);
          g = Bd(e);
        }
        b.push(f);
      }
      d = /* @__PURE__ */ new Map();
      Ie(d);
      e = [];
      c = t(c.slice(1));
      for (f = c.next(); !f.done; f = c.next()) {
        f = f.value.split("\n");
        if ((f.length != 1 || f[0]) && !/^NOTE($|[ \t])/.test(f[0]) && f[0] == "STYLE") {
          h = [];
          g = -1;
          for (k2 = 1; k2 < f.length; k2++) f[k2].includes("::cue") && (h.push([]), g = h.length - 1), g != -1 && (h[g].push(f[k2]), f[k2].includes("}") && (g = -1));
          h = t(h);
          for (g = h.next(); !g.done; g = h.next()) {
            var l = g.value;
            g = "global";
            (k2 = l[0].match(/\((.*)\)/)) && (g = k2.pop());
            k2 = l.slice(1, -1);
            l[0].includes("}") && (l = /\{(.*?)\}/.exec(l[0])) && (k2 = l[1].split(";"));
            (l = d.get(g)) || (l = new se(0, 0, ""));
            for (var m = false, n = 0; n < k2.length; n++) {
              var q = /^\s*([^:]+):\s*(.*)/.exec(k2[n]);
              if (q) {
                var r = q[2].trim().replace(";", "");
                switch (q[1].trim()) {
                  case "background-color":
                  case "background":
                    m = true;
                    l.backgroundColor = r;
                    break;
                  case "color":
                    m = true;
                    l.color = r;
                    break;
                  case "font-family":
                    m = true;
                    l.fontFamily = r;
                    break;
                  case "font-size":
                    m = true;
                    l.fontSize = r;
                    break;
                  case "font-weight":
                    if (parseInt(r, 10) >= 700 || r == "bold") m = true, l.fontWeight = Pe;
                    break;
                  case "font-style":
                    switch (r) {
                      case "normal":
                        m = true;
                        l.fontStyle = Be;
                        break;
                      case "italic":
                        m = true;
                        l.fontStyle = Qe;
                        break;
                      case "oblique":
                        m = true, l.fontStyle = "oblique";
                    }
                    break;
                  case "opacity":
                    m = true;
                    l.opacity = parseFloat(r);
                    break;
                  case "text-combine-upright":
                    m = true;
                    l.textCombineUpright = r;
                    break;
                  case "text-shadow":
                    m = true;
                    l.textShadow = r;
                    break;
                  case "white-space":
                    m = true, l.wrapLine = r != "noWrap";
                }
              }
            }
            m && d.set(
              g,
              l
            );
          }
        }
        l = f;
        m = a;
        if (l.length == 1 && !l[0] || /^NOTE($|[ \t])/.test(l[0]) || l[0] == "STYLE" || l[0] == "REGION") f = null;
        else if (f = null, l[0].includes("-->") || (f = l[0], l.splice(0, 1)), h = new xd(l[0]), g = Dd(h), n = zd(h, /[ \t]+--\x3e[ \t]+/g), k2 = Dd(h), g == null || n == null || k2 == null) bb("Failed to parse VTT time code. Cue skipped:", f, l), f = null;
        else {
          g += m;
          k2 += m;
          m = l.slice(1).join("\n").trim();
          d.has("global") ? (l = d.get("global").clone(), l.startTime = g, l.endTime = k2, l.payload = m) : l = new se(g, k2, m);
          yd(h);
          for (g = Bd(h); g; ) hF(l, g, b), yd(h), g = Bd(h);
          Fe(l, d);
          f != null && (l.id = f);
          f = l;
        }
        f && e.push(f);
      }
      return e;
    };
    function hF(a, b, c) {
      var d;
      if (d = /^align:(start|middle|center|end|left|right)$/.exec(b)) b = d[1], b == "middle" ? a.textAlign = ue : a.textAlign = Se[b.toUpperCase()];
      else if (d = /^vertical:(lr|rl)$/.exec(b)) a.writingMode = d[1] == "lr" ? "vertical-lr" : "vertical-rl";
      else if (d = /^size:([\d.]+)%$/.exec(b)) a.size = Number(d[1]);
      else if (d = /^position:([\d.]+)%(?:,(line-left|line-right|middle|center|start|end|auto))?$/.exec(b)) a.position = Number(d[1]), d[2] && (b = d[2], a.positionAlign = b == "line-left" || b == "start" ? "line-left" : b == "line-right" || b == "end" ? "line-right" : b == "center" || b == "middle" ? "center" : te);
      else if (d = /^region:(.*)$/.exec(b)) {
        if (b = iF(c, d[1])) a.region = b;
      } else if (c = /^line:([\d.]+)%(?:,(start|end|center))?$/.exec(b)) a.lineInterpretation = 1, a.line = Number(c[1]), c[2] && (a.lineAlign = Ue[c[2].toUpperCase()]);
      else if (c = /^line:(-?\d+)(?:,(start|end|center))?$/.exec(b)) a.lineInterpretation = xe, a.line = Number(c[1]), c[2] && (a.lineAlign = Ue[c[2].toUpperCase()]);
    }
    function iF(a, b) {
      a = a.filter(function(c) {
        return c.id == b;
      });
      return a.length ? a[0] : null;
    }
    S("shaka.text.VttTextParser", gF);
    gF.prototype.parseMedia = gF.prototype.parseMedia;
    gF.prototype.setManifestType = gF.prototype.setManifestType;
    gF.prototype.setSequenceMode = gF.prototype.setSequenceMode;
    gF.prototype.parseInit = gF.prototype.parseInit;
    rf("text/vtt", function() {
      return new gF();
    });
    rf('text/vtt; codecs="vtt"', function() {
      return new gF();
    });
    rf('text/vtt; codecs="wvtt"', function() {
      return new gF();
    });
    function jF() {
      this.g = null;
    }
    jF.prototype.parseInit = function(a) {
      var b = this, c = false;
      new ph().box("moov", uh).box("trak", uh).box("mdia", uh).W("mdhd", function(d) {
        d = Oi(d.reader, d.version);
        b.g = d.timescale;
      }).box("minf", uh).box("stbl", uh).W("stsd", wh).box("wvtt", function() {
        c = true;
      }).parse(a);
      if (!this.g) throw new U(2, 2, 2008);
      if (!c) throw new U(2, 2, 2008);
    };
    jF.prototype.setSequenceMode = function() {
    };
    jF.prototype.setManifestType = function() {
    };
    jF.prototype.parseMedia = function(a, b) {
      if (!a.length) return [];
      if (!this.g) throw new U(2, 2, 2008);
      var c = 0, d = [], e, f = [], g = false, h = false, k2 = false, l = null;
      new ph().box("moof", uh).box("traf", uh).W("tfdt", function(A) {
        g = true;
        c = Ni(A.reader, A.version).baseMediaDecodeTime;
      }).W("tfhd", function(A) {
        l = Mi(A.reader, A.flags).ge;
      }).W("trun", function(A) {
        h = true;
        d = Pi(A.reader, A.version, A.flags).Zh;
      }).box("mdat", zh(function(A) {
        k2 = true;
        e = A;
      })).parse(a, false);
      if (!k2 && !g && !h) throw new U(2, 2, 2008);
      a = c;
      for (var m = new mh(e, 0), n = t(d), q = n.next(); !q.done; q = n.next()) {
        q = q.value;
        var r = q.$h || l, u = q.cg ? c + q.cg : a;
        a = u + (r || 0);
        var w = 0;
        do {
          var v = m.X();
          w += v;
          var y = m.X(), z = null;
          th(y) == "vttc" ? v > 8 && (z = m.$b(v - 8)) : m.skip(v - 8);
          r && z && (v = kF(z, b.periodStart + u / this.g, b.periodStart + a / this.g), f.push(v));
        } while (q.sampleSize && w < q.sampleSize);
      }
      return f.filter(Ff);
    };
    function kF(a, b, c) {
      var d, e, f;
      new ph().box("payl", zh(function(g) {
        d = Xb(g);
      })).box("iden", zh(function(g) {
        e = Xb(g);
      })).box("sttg", zh(function(g) {
        f = Xb(g);
      })).parse(a);
      return d ? lF(d, e, f, b, c) : null;
    }
    function lF(a, b, c, d, e) {
      a = new se(d, e, a);
      Fe(a);
      b && (a.id = b);
      if (c) for (b = new xd(c), c = Bd(b); c; ) hF(a, c, []), yd(b), c = Bd(b);
      return a;
    }
    S("shaka.text.Mp4VttParser", jF);
    jF.prototype.parseMedia = jF.prototype.parseMedia;
    jF.prototype.setManifestType = jF.prototype.setManifestType;
    jF.prototype.setSequenceMode = jF.prototype.setSequenceMode;
    jF.prototype.parseInit = jF.prototype.parseInit;
    rf('application/mp4; codecs="wvtt"', function() {
      return new jF();
    });
    function mF() {
    }
    mF.prototype.parseInit = function() {
    };
    mF.prototype.setSequenceMode = function() {
    };
    mF.prototype.setManifestType = function() {
    };
    mF.prototype.parseMedia = function(a) {
      var b = Xb(a).replace(/\r+/g, "");
      b = b.trim();
      a = [];
      if (b == "") return a;
      b = t(b.split("\n\n"));
      for (var c = b.next(); !c.done; c = b.next()) {
        c = c.value.split("\n");
        var d = new xd(c[0]), e = Dd(d), f = zd(d, /,/g);
        d = Dd(d);
        if (e == null || f == null || d == null) throw new U(2, 2, 2001, "Could not parse cue time range in SubViewer");
        a.push(new se(e, d, c.slice(1).join("\n").trim()));
      }
      return a;
    };
    S("shaka.text.SbvTextParser", mF);
    mF.prototype.parseMedia = mF.prototype.parseMedia;
    mF.prototype.setManifestType = mF.prototype.setManifestType;
    mF.prototype.setSequenceMode = mF.prototype.setSequenceMode;
    mF.prototype.parseInit = mF.prototype.parseInit;
    rf("text/x-subviewer", function() {
      return new mF();
    });
    function nF() {
      this.g = new gF();
    }
    nF.prototype.parseInit = function() {
    };
    nF.prototype.setSequenceMode = function() {
    };
    nF.prototype.setManifestType = function() {
    };
    nF.prototype.parseMedia = function(a, b, c) {
      a = Xb(a);
      a = oF(a);
      a = Lb(ac(a));
      return this.g.parseMedia(a, b, c, []);
    };
    function oF(a) {
      var b = "WEBVTT\n\n";
      if (a == "") return b;
      a = a.replace(/\r+/g, "");
      a = a.trim();
      a = t(a.split("\n\n"));
      for (var c = a.next(); !c.done; c = a.next()) c = c.value.split(/\n/), c[0].match(/\d+/) && c.shift(), c[0] = c[0].replace(/,/g, "."), b += c.join("\n").replace(/{b}/g, "<b>").replace(/{\/b}/g, "</b>").replace(/{i}/g, "<i>").replace(/{\/i}/g, "</i>").replace(/{u}/g, "<u>").replace(/{\/u}/g, "</u>") + "\n\n";
      return b;
    }
    S("shaka.text.SrtTextParser", nF);
    nF.srt2webvtt = oF;
    nF.prototype.parseMedia = nF.prototype.parseMedia;
    nF.prototype.setManifestType = nF.prototype.setManifestType;
    nF.prototype.setSequenceMode = nF.prototype.setSequenceMode;
    nF.prototype.parseInit = nF.prototype.parseInit;
    rf("text/srt", function() {
      return new nF();
    });
    function pF() {
    }
    pF.prototype.parseInit = function() {
    };
    pF.prototype.setSequenceMode = function() {
    };
    pF.prototype.setManifestType = function() {
    };
    pF.prototype.parseMedia = function(a) {
      var b = "", c = "", d = null, e = null;
      e = Xb(a).split(/\r?\n\s*\r?\n/);
      a = t(e);
      for (e = a.next(); !e.done; e = a.next()) {
        var f = e.value;
        e = f;
        if (f = qF.exec(f)) d = f[1], e = f[2];
        d == "V4 Styles" || d == "V4+ Styles" ? (b = e, b = c ? b + ("\n" + e) : e) : d == "Events" && (c = c ? c + ("\n" + e) : e);
      }
      d = [];
      e = null;
      b = t(b.split(/\r?\n/));
      for (a = b.next(); !a.done; a = b.next()) if (a = a.value, !/^\s*;/.test(a) && (f = rF.exec(a))) {
        if (a = f[1].trim(), f = f[2].trim(), a == "Format") e = f.split(sF);
        else if (a == "Style") {
          a = f.split(sF);
          f = {};
          for (var g = 0; g < e.length && g < a.length; g++) f[e[g]] = a[g];
          d.push(f);
        }
      }
      e = [];
      b = null;
      c = t(c.split(/\r?\n/));
      f = c.next();
      for (a = {}; !f.done; a = { Sj: void 0 }, f = c.next()) if (f = f.value, !/^\s*;/.test(f) && (g = rF.exec(f))) {
        if (f = g[1].trim(), g = g[2].trim(), f == "Format") b = g.split(sF);
        else if (f == "Dialogue") {
          g = g.split(sF);
          f = {};
          for (var h = 0; h < b.length && h < g.length; h++) f[b[h]] = g[h];
          h = tF(f.Start);
          var k2 = tF(f.End);
          g = new se(h, k2, g.slice(b.length - 1).join(",").replace(/\\N/g, "\n").replace(/\{[^}]+\}/g, ""));
          a.Sj = f.Style;
          (a = d.find(/* @__PURE__ */ function(l) {
            return function(m) {
              return m.Name == l.Sj;
            };
          }(a))) && uF(g, a);
          e.push(g);
        }
      }
      return e;
    };
    function uF(a, b) {
      var c = b.Fontname;
      c && (a.fontFamily = c);
      if (c = b.Fontsize) a.fontSize = c + "px";
      if (c = b.PrimaryColour) {
        if (c = vF(c)) a.color = c;
      }
      if (c = b.BackColour) {
        if (c = vF(c)) a.backgroundColor = c;
      }
      b.Bold && (a.fontWeight = Pe);
      b.Italic && (a.fontStyle = Qe);
      b.Underline && a.textDecoration.push(Re);
      if (c = b.Spacing) a.letterSpacing = c + "px";
      if (c = b.Alignment) switch (parseInt(c, 10)) {
        case 1:
          a.displayAlign = ze;
          a.textAlign = "start";
          break;
        case 2:
          a.displayAlign = ze;
          a.textAlign = ue;
          break;
        case 3:
          a.displayAlign = ze;
          a.textAlign = "end";
          break;
        case 5:
          a.displayAlign = "before";
          a.textAlign = "start";
          break;
        case 6:
          a.displayAlign = "before";
          a.textAlign = ue;
          break;
        case 7:
          a.displayAlign = "before";
          a.textAlign = "end";
          break;
        case 9:
          a.displayAlign = "center";
          a.textAlign = "start";
          break;
        case 10:
          a.displayAlign = "center";
          a.textAlign = ue;
          break;
        case 11:
          a.displayAlign = "center", a.textAlign = "end";
      }
      if (b = b.AlphaLevel) a.opacity = parseFloat(b);
    }
    function vF(a) {
      a = parseInt(a.replace("&H", ""), 16);
      return a >= 0 ? "rgba(" + (a & 255) + "," + (a >> 8 & 255) + "," + (a >> 16 & 255) + "," + (a >> 24 & 255 ^ 255) / 255 + ")" : null;
    }
    function tF(a) {
      a = wF.exec(a);
      return (a[1] ? parseInt(a[1].replace(":", ""), 10) : 0) * 3600 + parseInt(a[2], 10) * 60 + parseFloat(a[3]);
    }
    S("shaka.text.SsaTextParser", pF);
    pF.prototype.parseMedia = pF.prototype.parseMedia;
    pF.prototype.setManifestType = pF.prototype.setManifestType;
    pF.prototype.setSequenceMode = pF.prototype.setSequenceMode;
    pF.prototype.parseInit = pF.prototype.parseInit;
    var qF = /^\s*\[([^\]]+)\]\r?\n([\s\S]*)/, rF = /^\s*([^:]+):\s*(.*)/, sF = /\s*,\s*/, wF = /^(\d+:)?(\d{1,2}):(\d{1,2}(?:[.]\d{1,3})?)?$/;
    rf("text/x-ssa", function() {
      return new pF();
    });
    function xF(a, b) {
      var c = a[b + 1] & 1 ? 7 : 9;
      return b + c <= a.length && (a = ((a[b + 3] & 3) << 11 | a[b + 4] << 3 | (a[b + 5] & 224) >>> 5) - c, a > 0) ? { qe: c, xa: a } : null;
    }
    function yF(a, b) {
      var c = [96e3, 88200, 64e3, 48e3, 44100, 32e3, 24e3, 22050, 16e3, 12e3, 11025, 8e3, 7350], d = (a[b + 2] & 60) >>> 2;
      if (d > c.length - 1) return null;
      var e = ((a[b + 2] & 192) >>> 6) + 1, f = (a[b + 2] & 1) << 2;
      f |= (a[b + 3] & 192) >>> 6;
      return { sampleRate: c[d], channelCount: f, codec: "mp4a.40." + e };
    }
    function zF(a, b) {
      if (b + 1 < a.length && a[b] === 255 && (a[b + 1] & 246) === 240) {
        var c = a[b + 1] & 1 ? 7 : 9;
        if (b + c >= a.length) return false;
        var d = (a[b + 3] & 3) << 11 | a[b + 4] << 3 | (a[b + 5] & 224) >>> 5;
        if (d <= c) return false;
        b += d;
        return b === a.length || b + 1 < a.length && a[b] === 255 && (a[b + 1] & 246) === 240;
      }
      return false;
    }
    function AF(a, b) {
      switch (a) {
        case "mp4a.40.2":
          if (b === 1) return new Uint8Array([0, 200, 0, 128, 35, 128]);
          if (b === 2) return new Uint8Array([33, 0, 73, 144, 2, 25, 0, 35, 128]);
          if (b === 3) return new Uint8Array([0, 200, 0, 128, 32, 132, 1, 38, 64, 8, 100, 0, 142]);
          if (b === 4) return new Uint8Array([0, 200, 0, 128, 32, 132, 1, 38, 64, 8, 100, 0, 128, 44, 128, 8, 2, 56]);
          if (b === 5) return new Uint8Array([0, 200, 0, 128, 32, 132, 1, 38, 64, 8, 100, 0, 130, 48, 4, 153, 0, 33, 144, 2, 56]);
          if (b === 6) return new Uint8Array([
            0,
            200,
            0,
            128,
            32,
            132,
            1,
            38,
            64,
            8,
            100,
            0,
            130,
            48,
            4,
            153,
            0,
            33,
            144,
            2,
            0,
            178,
            0,
            32,
            8,
            224
          ]);
          break;
        default:
          if (b === 1) return new Uint8Array([1, 64, 34, 128, 163, 78, 230, 128, 186, 8, 0, 0, 0, 28, 6, 241, 193, 10, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 94]);
          if (b === 2 || b === 3) return new Uint8Array([1, 64, 34, 128, 163, 94, 230, 128, 186, 8, 0, 0, 0, 0, 149, 0, 6, 241, 161, 10, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 94]);
      }
      return null;
    }
    ;
    function BF(a) {
      this.j = a;
      this.h = 0;
      this.g = /* @__PURE__ */ new Map();
      this.i = null;
    }
    p = BF.prototype;
    p.destroy = function() {
      this.g.clear();
    };
    p.isSupported = function(a) {
      return a.toLowerCase().split(";")[0] == "audio/aac" ? dd(this.convertCodecs("audio", a)) : false;
    };
    p.convertCodecs = function(a, b) {
      return b.toLowerCase().split(";")[0] == "audio/aac" ? 'audio/mp4; codecs="' + (of(b) || "mp4a.40.2") + '"' : b;
    };
    p.getOriginalMimeType = function() {
      return this.j;
    };
    p.transmux = function(a, b, c, d) {
      for (var e = Lb(a), f = ck(e), g = f.length; g < e.length && !zF(e, g); g++) ;
      a = c.endTime * 1e3;
      f = bk(f);
      f.length && c && (f = f.find(function(m) {
        return m.description === "com.apple.streaming.transportStreamTimestamp";
      })) && (a = f.data);
      f = yF(e, g);
      if (!f) return Promise.reject(new U(2, 3, 3018, c ? c.T()[0] : null));
      b.audioSamplingRate = f.sampleRate;
      b.channelsCount = f.channelCount;
      for (var h = []; g < e.length; ) {
        var k2 = xF(e, g);
        if (!k2) return Promise.reject(new U(2, 3, 3018, c ? c.T()[0] : null));
        var l = k2.qe + k2.xa;
        g + l <= e.length && h.push({ data: e.subarray(g + k2.qe, g + l), size: k2.xa, duration: 1024, Ab: 0, flags: { Cb: 0, ub: 0, sb: 0, pb: 0, qb: 2, Db: 0 } });
        g += l;
      }
      e = f.sampleRate;
      a = Math.floor(a * e / 1e3);
      d = { id: b.id, type: "audio", codecs: f.codec, encrypted: b.encrypted && b.drmInfos.length > 0, timescale: e, duration: d, Gb: [], Na: new Uint8Array([]), Xa: new Uint8Array([]), eb: 0, gb: 0, data: { sequenceNumber: this.h, baseMediaDecodeTime: a, Eb: h }, stream: b };
      d = new Vi([d]);
      c = b.id + "_" + c.i;
      this.g.has(c) ? b = this.g.get(c) : (b = Wi(d), this.g.set(c, b));
      c = this.i !== b;
      d = qj(d);
      this.i = b;
      this.h++;
      return c ? (b = mc(b, d), Promise.resolve(b)) : Promise.resolve(d);
    };
    S("shaka.transmuxer.AacTransmuxer", BF);
    BF.prototype.transmux = BF.prototype.transmux;
    BF.prototype.getOriginalMimeType = BF.prototype.getOriginalMimeType;
    BF.prototype.convertCodecs = BF.prototype.convertCodecs;
    BF.prototype.isSupported = BF.prototype.isSupported;
    BF.prototype.destroy = BF.prototype.destroy;
    Xe("audio/aac", function() {
      return new BF("audio/aac");
    }, cf);
    function CF(a, b) {
      if (b + 8 > a.length || a[b] !== 11 || a[b + 1] !== 119) return null;
      var c = a[b + 4] >> 6;
      if (c >= 3) return null;
      var d = a[b + 4] & 63, e = [
        64,
        69,
        96,
        64,
        70,
        96,
        80,
        87,
        120,
        80,
        88,
        120,
        96,
        104,
        144,
        96,
        105,
        144,
        112,
        121,
        168,
        112,
        122,
        168,
        128,
        139,
        192,
        128,
        140,
        192,
        160,
        174,
        240,
        160,
        175,
        240,
        192,
        208,
        288,
        192,
        209,
        288,
        224,
        243,
        336,
        224,
        244,
        336,
        256,
        278,
        384,
        256,
        279,
        384,
        320,
        348,
        480,
        320,
        349,
        480,
        384,
        417,
        576,
        384,
        418,
        576,
        448,
        487,
        672,
        448,
        488,
        672,
        512,
        557,
        768,
        512,
        558,
        768,
        640,
        696,
        960,
        640,
        697,
        960,
        768,
        835,
        1152,
        768,
        836,
        1152,
        896,
        975,
        1344,
        896,
        976,
        1344,
        1024,
        1114,
        1536,
        1024,
        1115,
        1536,
        1152,
        1253,
        1728,
        1152,
        1254,
        1728,
        1280,
        1393,
        1920,
        1280,
        1394,
        1920
      ][d * 3 + c] * 2;
      if (b + e > a.length) return null;
      var f = a[b + 6] >> 5, g = 0;
      f === 2 ? g += 2 : (f & 1 && f !== 1 && (g += 2), f & 4 && (g += 2));
      g = (a[b + 6] << 8 | a[b + 7]) >> 12 - g & 1;
      var h = a[b + 5] & 7;
      a = new Uint8Array([c << 6 | a[b + 5] >> 3 << 1 | h >> 2, (h & 3) << 6 | f << 3 | g << 2 | d >> 4, d << 4 & 224]);
      return { sampleRate: [48e3, 44100, 32e3][c], channelCount: [2, 1, 2, 3, 3, 4, 4, 5][f] + g, Na: a, xa: e };
    }
    function DF(a, b) {
      if (a[b] === 11 && a[b + 1] === 119) {
        var c = 0, d = 5;
        b += d;
        for (var e, f; d > 0; ) {
          f = a[b];
          var g = Math.min(d, 8), h = 8 - g;
          e = 4278190080 >>> 24 + h << h;
          e = (f & e) >> h;
          c = c ? c << g | e : e;
          b += 1;
          d -= g;
        }
        if (c < 16) return true;
      }
      return false;
    }
    ;
    function EF(a) {
      this.j = a;
      this.h = 0;
      this.g = /* @__PURE__ */ new Map();
      this.i = null;
    }
    p = EF.prototype;
    p.destroy = function() {
      this.g.clear();
    };
    p.isSupported = function(a) {
      return a.toLowerCase().split(";")[0] == "audio/ac3" ? dd(this.convertCodecs("audio", a)) : false;
    };
    p.convertCodecs = function(a, b) {
      return b.toLowerCase().split(";")[0] == "audio/ac3" ? Sb().Ce() ? 'audio/mp4; codecs="ec-3"' : 'audio/mp4; codecs="ac-3"' : b;
    };
    p.getOriginalMimeType = function() {
      return this.j;
    };
    p.transmux = function(a, b, c, d) {
      a = Lb(a);
      for (var e = ck(a), f = e.length; f < a.length && !DF(a, f); f++) ;
      var g = c.endTime * 1e3;
      e = bk(e);
      e.length && c && (e = e.find(function(m) {
        return m.description === "com.apple.streaming.transportStreamTimestamp";
      })) && (g = e.data);
      e = 0;
      for (var h = new Uint8Array([]), k2 = []; f < a.length; ) {
        var l = CF(a, f);
        if (!l) return Promise.reject(new U(2, 3, 3018, c ? c.T()[0] : null));
        b.audioSamplingRate = l.sampleRate;
        b.channelsCount = l.channelCount;
        e = l.sampleRate;
        h = l.Na;
        k2.push({
          data: a.subarray(f, f + l.xa),
          size: l.xa,
          duration: 1536,
          Ab: 0,
          flags: { Cb: 0, ub: 0, sb: 0, pb: 0, qb: 2, Db: 0 }
        });
        f += l.xa;
      }
      a = Math.floor(g * e / 1e3);
      d = { id: b.id, type: "audio", codecs: "ac-3", encrypted: b.encrypted && b.drmInfos.length > 0, timescale: e, duration: d, Gb: [], Na: h, Xa: new Uint8Array([]), eb: 0, gb: 0, data: { sequenceNumber: this.h, baseMediaDecodeTime: a, Eb: k2 }, stream: b };
      d = new Vi([d]);
      c = b.id + "_" + c.i;
      this.g.has(c) ? b = this.g.get(c) : (b = Wi(d), this.g.set(c, b));
      c = this.i !== b;
      d = qj(d);
      this.i = b;
      this.h++;
      return c ? (b = mc(b, d), Promise.resolve(b)) : Promise.resolve(d);
    };
    S("shaka.transmuxer.Ac3Transmuxer", EF);
    EF.prototype.transmux = EF.prototype.transmux;
    EF.prototype.getOriginalMimeType = EF.prototype.getOriginalMimeType;
    EF.prototype.convertCodecs = EF.prototype.convertCodecs;
    EF.prototype.isSupported = EF.prototype.isSupported;
    EF.prototype.destroy = EF.prototype.destroy;
    Xe("audio/ac3", function() {
      return new EF("audio/ac3");
    }, cf);
    function FF(a, b) {
      if (b + 8 > a.length || (a[b] << 8 | a[b + 1] << 0) !== 2935) return null;
      var c = new ek(a.subarray(b + 2));
      gk(c, 2);
      gk(c, 3);
      var d = hk(c, 11) + 1 << 1, e = hk(c, 2);
      if (e == 3) {
        e = hk(c, 2);
        e = [24e3, 22060, 16e3][e];
        var f = 3;
      } else e = [48e3, 44100, 32e3][e], f = hk(c, 2);
      var g = hk(c, 3), h = hk(c, 1);
      c = hk(c, 5);
      if (b + d > a.byteLength) return null;
      a = Math.floor(d * e / ([1, 2, 3, 6][f] * 16));
      a = new Uint8Array([(a & 8160) >> 5, (a & 31) << 3, e << 6 | c << 1 | 0, 0 | g << 1 | h << 0, 0]);
      return { sampleRate: e, channelCount: [2, 1, 2, 3, 3, 4, 4, 5][g] + h, Na: a, xa: d };
    }
    ;
    function GF(a) {
      this.j = a;
      this.h = 0;
      this.g = /* @__PURE__ */ new Map();
      this.i = null;
    }
    p = GF.prototype;
    p.destroy = function() {
      this.g.clear();
    };
    p.isSupported = function(a) {
      return a.toLowerCase().split(";")[0] == "audio/ec3" ? dd(this.convertCodecs("audio", a)) : false;
    };
    p.convertCodecs = function(a, b) {
      return b.toLowerCase().split(";")[0] == "audio/ec3" ? 'audio/mp4; codecs="ec-3"' : b;
    };
    p.getOriginalMimeType = function() {
      return this.j;
    };
    p.transmux = function(a, b, c, d) {
      a = Lb(a);
      for (var e = ck(a), f = e.length; f < a.length && (a[f] << 8 | a[f + 1] << 0) !== 2935; f++) ;
      var g = c.endTime * 1e3;
      e = bk(e);
      e.length && c && (e = e.find(function(m) {
        return m.description === "com.apple.streaming.transportStreamTimestamp";
      })) && (g = e.data);
      e = 0;
      for (var h = new Uint8Array([]), k2 = []; f < a.length; ) {
        var l = FF(a, f);
        if (!l) return Promise.reject(new U(2, 3, 3018, c ? c.T()[0] : null));
        b.audioSamplingRate = l.sampleRate;
        b.channelsCount = l.channelCount;
        e = l.sampleRate;
        h = l.Na;
        k2.push({
          data: a.subarray(f, f + l.xa),
          size: l.xa,
          duration: 1536,
          Ab: 0,
          flags: { Cb: 0, ub: 0, sb: 0, pb: 0, qb: 2, Db: 0 }
        });
        f += l.xa;
      }
      a = Math.floor(g * e / 1e3);
      d = { id: b.id, type: "audio", codecs: "ec-3", encrypted: b.encrypted && b.drmInfos.length > 0, timescale: e, duration: d, Gb: [], Na: h, Xa: new Uint8Array([]), eb: 0, gb: 0, data: { sequenceNumber: this.h, baseMediaDecodeTime: a, Eb: k2 }, stream: b };
      d = new Vi([d]);
      c = b.id + "_" + c.i;
      this.g.has(c) ? b = this.g.get(c) : (b = Wi(d), this.g.set(c, b));
      c = this.i !== b;
      d = qj(d);
      this.i = b;
      this.h++;
      return c ? (b = mc(b, d), Promise.resolve(b)) : Promise.resolve(d);
    };
    S("shaka.transmuxer.Ec3Transmuxer", GF);
    GF.prototype.transmux = GF.prototype.transmux;
    GF.prototype.getOriginalMimeType = GF.prototype.getOriginalMimeType;
    GF.prototype.convertCodecs = GF.prototype.convertCodecs;
    GF.prototype.isSupported = GF.prototype.isSupported;
    GF.prototype.destroy = GF.prototype.destroy;
    Xe("audio/ec3", function() {
      return new GF("audio/ec3");
    }, cf);
    function HF(a) {
      if (!a.length) return null;
      var b = a.find(function(w) {
        return w.type == 7;
      });
      a = a.find(function(w) {
        return w.type == 8;
      });
      if (!b || !a) return null;
      var c = new ek(b.data), d = mk(c);
      mk(c);
      mk(c);
      jk(c);
      if (IF.includes(d) && (d = X(c), d === 3 && gk(c, 1), jk(c), jk(c), gk(c, 1), lk(c))) {
        d = d !== 3 ? 8 : 12;
        for (var e = 0; e < d; e++) lk(c) && (e < 6 ? nk(c, 16) : nk(c, 64));
      }
      jk(c);
      d = X(c);
      if (d === 0) X(c);
      else if (d === 1) for (gk(c, 1), jk(c), jk(c), d = X(c), e = 0; e < d; e++) jk(c);
      jk(c);
      gk(c, 1);
      var f = X(c), g = X(c), h = hk(c, 1);
      h === 0 && gk(c, 1);
      gk(c, 1);
      var k2 = 0, l = 0, m = 0, n = 0;
      lk(c) && (k2 = X(c), l = X(c), m = X(c), n = X(c));
      e = d = 1;
      if (lk(c) && lk(c)) {
        var q = mk(c), r = [1, 12, 10, 16, 40, 24, 20, 32, 80, 18, 15, 64, 160, 4, 3, 2], u = [1, 11, 11, 11, 33, 11, 11, 11, 33, 11, 11, 33, 99, 3, 2, 1];
        q > 0 && q <= 16 ? (d = r[q - 1], e = u[q - 1]) : q === 255 && (d = hk(c, 16), e = hk(c, 16));
      }
      c = (2 - h) * (g + 1) * 16 - m * 2 - n * 2;
      f = (f + 1) * 16 - k2 * 2 - l * 2;
      k2 = [];
      b = b.fullData;
      k2.push(b.byteLength >>> 8 & 255);
      k2.push(b.byteLength & 255);
      k2 = k2.concat.apply(k2, x(b));
      b = [];
      a = a.fullData;
      b.push(a.byteLength >>> 8 & 255);
      b.push(a.byteLength & 255);
      b = b.concat.apply(b, x(a));
      a = new Uint8Array([
        1,
        k2[3],
        k2[4],
        k2[5],
        255,
        225
      ].concat(k2, [1], b));
      return { height: c, width: f, Xa: a, eb: d, gb: e };
    }
    function JF(a) {
      function b(u) {
        e = { data: new Uint8Array([]), frame: false, isKeyframe: false, pts: u.pts, dts: u.dts, nalus: [] };
      }
      function c() {
        if (e && e.nalus.length && e.frame) {
          for (var u = [], w = t(e.nalus), v = w.next(); !v.done; v = w.next()) {
            v = v.value;
            var y = v.fullData.byteLength, z = new Uint8Array(4);
            z[0] = y >> 24 & 255;
            z[1] = y >> 16 & 255;
            z[2] = y >> 8 & 255;
            z[3] = y & 255;
            u.push(z);
            u.push(v.fullData);
          }
          e.data = mc.apply(ec, x(u));
          d.push(e);
        }
      }
      for (var d = [], e = null, f = false, g = 0; g < a.length; g++) {
        var h = a[g], k2 = h.nalus, l = false;
        e && k2.length && !f && (c(), b(h));
        k2 = t(h.nalus);
        for (var m = k2.next(); !m.done; m = k2.next()) {
          m = m.value;
          var n = false;
          switch (m.type) {
            case 1:
              var q = false;
              n = true;
              var r = m.data;
              l && r.length > 4 && (r = ok(new ek(r)), r === 2 || r === 4 || r === 7 || r === 9) && (q = true);
              q && e && e.frame && !e.isKeyframe && (c(), e = null);
              e || b(h);
              e.frame = true;
              e.isKeyframe = q;
              break;
            case 5:
              n = true;
              e && e.frame && !e.isKeyframe && (c(), e = null);
              e || b(h);
              e.frame = true;
              e.isKeyframe = true;
              break;
            case 6:
              n = true;
              break;
            case 7:
              l = n = true;
              break;
            case 8:
              n = true;
              break;
            case 9:
              f = n = true;
              e && e.frame && (c(), e = null);
              e || b(h);
              break;
            case 12:
              n = true;
              break;
            default:
              n = false;
          }
          e && n && e.nalus.push(m);
        }
      }
      c();
      return d;
    }
    var IF = [100, 110, 122, 244, 44, 83, 86, 118, 128, 138, 139, 134];
    function KF(a) {
      if (!a.length) return null;
      var b = a.find(function(g) {
        return g.type == 32;
      }), c = a.find(function(g) {
        return g.type == 33;
      }), d = a.find(function(g) {
        return g.type == 34;
      });
      if (!b || !c || !d) return null;
      var e = LF(b.fullData);
      a = MF(c.fullData);
      var f = NF(d.fullData);
      b = OF(b.fullData, c.fullData, d.fullData, { Mh: e.Mh, ri: e.ri, jh: a.jh, kh: a.kh, dh: a.dh, ih: a.ih, eh: a.eh, fh: a.fh, gh: a.gh, hh: a.hh, Xg: a.Xg, Yg: a.Yg, Zg: a.Zg, $g: a.$g, ah: a.ah, bh: a.bh, Pg: a.Pg, Lf: a.Lf, Ng: a.Ng, Jg: a.Jg, Ig: a.Ig, Oh: f.Oh });
      return {
        height: a.height,
        width: a.width,
        Xa: b,
        eb: a.lm,
        gb: a.jm
      };
    }
    function LF(a) {
      var b = new ek(a, true);
      mk(b);
      mk(b);
      hk(b, 4);
      hk(b, 2);
      hk(b, 6);
      a = hk(b, 3);
      b = lk(b);
      return { Mh: a + 1, ri: b };
    }
    function MF(a) {
      a = new ek(a, true);
      mk(a);
      mk(a);
      var b = 0, c = 0, d = 0, e = 0;
      hk(a, 4);
      var f = hk(a, 3);
      lk(a);
      for (var g = hk(a, 2), h = hk(a, 1), k2 = hk(a, 5), l = mk(a), m = mk(a), n = mk(a), q = mk(a), r = mk(a), u = mk(a), w = mk(a), v = mk(a), y = mk(a), z = mk(a), A = mk(a), C = [], D = [], F = 0; F < f; F++) C.push(lk(a)), D.push(lk(a));
      if (f > 0) for (F = f; F < 8; F++) hk(a, 2);
      for (F = 0; F < f; F++) C[F] && hk(a, 88), D[F] && mk(a);
      X(a);
      C = X(a);
      C == 3 && hk(a, 1);
      D = X(a);
      F = X(a);
      lk(a) && (b += X(a), c += X(a), d += X(a), e += X(a));
      var B = X(a), E = X(a), I = X(a);
      if (lk(a)) for (var J = 0; J <= f; J++) X(a), X(a), X(a);
      else X(a), X(a), X(a);
      X(a);
      X(a);
      X(a);
      X(a);
      X(a);
      X(a);
      if (lk(a) && lk(a)) for (J = 0; J < 4; J++) for (var K = 0; K < (J === 3 ? 2 : 6); K++) if (lk(a)) {
        var L = Math.min(64, 1 << 4 + (J << 1));
        J > 1 && kk(a);
        for (var M = 0; M < L; M++) kk(a);
      } else X(a);
      lk(a);
      lk(a);
      lk(a) && (mk(a), X(a), X(a), lk(a));
      J = X(a);
      for (L = K = 0; L < J; L++) if (M = false, L !== 0 && (M = lk(a)), M) {
        L === J && X(a);
        lk(a);
        X(a);
        for (var N = M = 0; N <= K; N++) {
          var O = lk(a), Q = false;
          O || (Q = lk(a));
          (O || Q) && M++;
        }
        K = M;
      } else {
        N = X(a);
        M = X(a);
        K = N + M;
        for (O = 0; O < N; O++) X(a), lk(a);
        for (N = 0; N < M; N++) X(a), lk(a);
      }
      if (lk(a)) for (J = X(a), K = 0; K < J; K++) {
        for (L = 0; L < I + 4; L++) hk(a, 1);
        hk(a, 1);
      }
      J = I = 1;
      K = 0;
      lk(a);
      lk(a);
      if (lk(a)) {
        lk(a) && (L = mk(a), M = [1, 12, 10, 16, 40, 24, 20, 32, 80, 18, 15, 64, 160, 4, 3, 2], N = [1, 11, 11, 11, 33, 11, 11, 11, 33, 11, 11, 33, 99, 3, 2, 1], L > 0 && L <= 16 ? (I = M[L - 1], J = N[L - 1]) : L === 255 && (I = hk(a, 16), J = hk(a, 16)));
        lk(a) && lk(a);
        lk(a) && (hk(a, 3), lk(a), lk(a) && (mk(a), mk(a), mk(a)));
        lk(a) && (X(a), X(a));
        lk(a);
        lk(a);
        lk(a);
        if (L = lk(a)) X(a), X(a), X(a), X(a);
        if (lk(a) && (hk(a, 32), hk(a, 32), lk(a) && X(a), lk(a))) {
          N = false;
          L = lk(a);
          M = lk(a);
          if (L || M) {
            if (N = lk(a)) mk(a), hk(a, 5), lk(a), hk(a, 5);
            hk(a, 4);
            hk(a, 4);
            N && hk(a, 4);
            hk(a, 5);
            hk(a, 5);
            hk(a, 5);
          }
          for (O = 0; O <= f; O++) {
            var R = true;
            Q = 1;
            lk(a) || (R = lk(a));
            var V = false;
            R ? X(a) : V = lk(a);
            V || (Q = X(a) + 1);
            if (L) {
              for (R = 0; R < Q; R++) X(a), X(a), N && (X(a), X(a));
              lk(a);
            }
            if (M) {
              for (R = 0; R < Q; R++) X(a), X(a), N && (X(a), X(a));
              lk(a);
            }
          }
        }
        lk(a) && (lk(a), lk(a), lk(a), K = X(a), X(a), X(a), X(a), X(a));
      }
      return { dh: A, jh: g, kh: h, ih: k2, eh: l, fh: m, gh: n, hh: q, Xg: r, Yg: u, Zg: w, $g: v, ah: y, bh: z, Lf: K, Pg: 0, Ng: C, Jg: B, Ig: E, width: D - (b + c) * (C === 1 || C === 2 ? 2 : 1), height: F - (d + e) * (C === 1 ? 2 : 1), lm: I, jm: J };
    }
    function NF(a) {
      var b = new ek(a, true);
      mk(b);
      mk(b);
      X(b);
      X(b);
      lk(b);
      lk(b);
      hk(b, 3);
      lk(b);
      lk(b);
      X(b);
      X(b);
      kk(b);
      lk(b);
      lk(b);
      lk(b) && X(b);
      kk(b);
      kk(b);
      lk(b);
      lk(b);
      lk(b);
      lk(b);
      a = lk(b);
      b = lk(b);
      var c = 1;
      b && a ? c = 0 : b ? c = 3 : a && (c = 2);
      return { Oh: c };
    }
    function OF(a, b, c, d) {
      var e = new Uint8Array(23 + (5 + a.byteLength) + (5 + b.byteLength) + (5 + c.byteLength));
      e[0] = 1;
      e[1] = (d.jh & 3) << 6 | (d.kh ? 1 : 0) << 5 | d.ih & 31;
      e[2] = d.eh;
      e[3] = d.fh;
      e[4] = d.gh;
      e[5] = d.hh;
      e[6] = d.Xg;
      e[7] = d.Yg;
      e[8] = d.Zg;
      e[9] = d.$g;
      e[10] = d.ah;
      e[11] = d.bh;
      e[12] = d.dh;
      e[13] = 240 | (d.Lf & 3840) >> 8;
      e[14] = d.Lf & 255;
      e[15] = 252 | d.Oh & 3;
      e[16] = 252 | d.Ng & 3;
      e[17] = 248 | d.Jg & 7;
      e[18] = 248 | d.Ig & 7;
      e[19] = 0;
      e[20] = 0;
      e[21] = (d.Pg & 3) << 6 | (d.Mh & 7) << 3 | (d.ri ? 1 : 0) << 2 | 3;
      e[22] = 3;
      e[23] = 160;
      e[24] = 0;
      e[25] = 1;
      e[26] = (a.byteLength & 65280) >> 8;
      e[27] = (a.byteLength & 255) >> 0;
      e.set(a, 28);
      e[23 + (5 + a.byteLength)] = 161;
      e[23 + (5 + a.byteLength) + 1] = 0;
      e[23 + (5 + a.byteLength) + 2] = 1;
      e[23 + (5 + a.byteLength) + 3] = (b.byteLength & 65280) >> 8;
      e[23 + (5 + a.byteLength) + 4] = (b.byteLength & 255) >> 0;
      e.set(b, 23 + (5 + a.byteLength) + 5);
      e[23 + (5 + a.byteLength + 5 + b.byteLength)] = 162;
      e[23 + (5 + a.byteLength + 5 + b.byteLength) + 1] = 0;
      e[23 + (5 + a.byteLength + 5 + b.byteLength) + 2] = 1;
      e[23 + (5 + a.byteLength + 5 + b.byteLength) + 3] = (c.byteLength & 65280) >> 8;
      e[23 + (5 + a.byteLength + 5 + b.byteLength) + 4] = (c.byteLength & 255) >> 0;
      e.set(c, 23 + (5 + a.byteLength + 5 + b.byteLength) + 5);
      return e;
    }
    ;
    function PF(a, b) {
      var c = a[b + 1] >> 3 & 3, d = a[b + 1] >> 1 & 3, e = a[b + 2] >> 4 & 15, f = a[b + 2] >> 2 & 3;
      if (c !== 1 && e !== 0 && e !== 15 && f !== 3) {
        var g = a[b + 3] >> 6;
        e = QF[(c === 3 ? 3 - d : d === 3 ? 3 : 4) * 14 + e - 1] * 1e3;
        f = RF[(c === 3 ? 0 : c === 2 ? 1 : 2) * 3 + f];
        c = SF[c][d];
        var h = TF[d], k2 = Math.floor(c * e / f + (a[b + 2] >> 1 & 1)) * h, l = (navigator.userAgent || "").match(/Chrome\/(\d+)/i);
        (l = l ? parseInt(l[1], 10) : 0) && l <= 87 && d === 2 && e >= 224e3 && g === 0 && (a[b + 3] |= 128);
        return { sampleRate: f, channelCount: g === 3 ? 1 : 2, xa: k2, im: c * 8 * h };
      }
      return null;
    }
    function UF(a, b) {
      return a[b] === 255 && (a[b + 1] & 224) === 224 && (a[b + 1] & 6) !== 0;
    }
    function VF(a, b) {
      if (b + 1 < a.length && UF(a, b)) {
        var c = PF(a, b), d = 4;
        c && c.xa && (d = c.xa);
        b += d;
        return b === a.length || b + 1 < a.length && UF(a, b);
      }
      return false;
    }
    var QF = [32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448, 32, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 32, 48, 56, 64, 80, 96, 112, 128, 144, 160, 176, 192, 224, 256, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160], RF = [44100, 48e3, 32e3, 22050, 24e3, 16e3, 11025, 12e3, 8e3], SF = [[0, 72, 144, 12], [0, 0, 0, 0], [0, 72, 144, 12], [0, 144, 144, 12]], TF = [0, 1, 1, 4];
    function WF(a) {
      this.j = a;
      this.h = 0;
      this.g = /* @__PURE__ */ new Map();
      this.i = null;
    }
    p = WF.prototype;
    p.destroy = function() {
      this.g.clear();
    };
    p.isSupported = function(a) {
      return a.toLowerCase().split(";")[0] == "audio/mpeg" ? dd(this.convertCodecs("audio", a)) : false;
    };
    p.convertCodecs = function(a, b) {
      return b.toLowerCase().split(";")[0] == "audio/mpeg" ? 'audio/mp4; codecs="mp3"' : b;
    };
    p.getOriginalMimeType = function() {
      return this.j;
    };
    p.transmux = function(a, b, c, d) {
      for (var e = Lb(a), f = ck(e).length; f < e.length && !VF(e, f); f++) ;
      var g;
      for (a = []; f < e.length; ) {
        var h = PF(e, f);
        if (!h) return Promise.reject(new U(2, 3, 3018, c ? c.T()[0] : null));
        g || (g = h);
        f + h.xa <= e.length && a.push({ data: e.subarray(f, f + h.xa), size: h.xa, duration: 1152, Ab: 0, flags: { Cb: 0, ub: 0, sb: 0, pb: 0, qb: 2, Db: 0 } });
        f += h.xa;
      }
      if (!g) return Promise.reject(new U(2, 3, 3018, c ? c.T()[0] : null));
      e = g.im * 9e4 / g.sampleRate * this.h;
      d = {
        id: b.id,
        type: "audio",
        codecs: "mp3",
        encrypted: b.encrypted && b.drmInfos.length > 0,
        timescale: g.sampleRate,
        duration: d,
        Gb: [],
        Na: new Uint8Array([]),
        Xa: new Uint8Array([]),
        eb: 0,
        gb: 0,
        data: { sequenceNumber: this.h, baseMediaDecodeTime: e, Eb: a },
        stream: b
      };
      d = new Vi([d]);
      c = b.id + "_" + c.i;
      this.g.has(c) ? b = this.g.get(c) : (b = Wi(d), this.g.set(c, b));
      c = this.i !== b;
      d = qj(d);
      this.i = b;
      this.h++;
      return c ? (b = mc(b, d), Promise.resolve(b)) : Promise.resolve(d);
    };
    S("shaka.transmuxer.Mp3Transmuxer", WF);
    WF.prototype.transmux = WF.prototype.transmux;
    WF.prototype.getOriginalMimeType = WF.prototype.getOriginalMimeType;
    WF.prototype.convertCodecs = WF.prototype.convertCodecs;
    WF.prototype.isSupported = WF.prototype.isSupported;
    WF.prototype.destroy = WF.prototype.destroy;
    Xe("audio/mpeg", function() {
      return new WF("audio/mpeg");
    }, cf);
    function XF(a) {
      this.h = a;
      this.g = null;
    }
    p = XF.prototype;
    p.destroy = function() {
    };
    p.isSupported = function(a) {
      if (a.toLowerCase().split(";")[0] != "video/mp2t") return false;
      var b = of(a).split(","), c = rc("audio", b);
      b = rc("video", b);
      return !c || b || kf(c) != "mp3" ? false : dd(this.convertCodecs("audio", a));
    };
    p.convertCodecs = function(a, b) {
      return b.toLowerCase().split(";")[0] == "video/mp2t" ? "audio/mpeg" : b;
    };
    p.getOriginalMimeType = function() {
      return this.h;
    };
    p.transmux = function(a, b, c, d, e) {
      this.g ? this.g.clearData() : this.g = new pk();
      this.g.gg(c.i);
      a = Lb(a);
      a = this.g.parse(a);
      if (a.je().audio != "mp3" || e != "audio") return Promise.reject(new U(2, 3, 3018, c ? c.T()[0] : null));
      c = new Uint8Array([]);
      e = t(a.Bb());
      for (a = e.next(); !a.done; a = e.next()) if (a = a.value.data) for (b = 0; b < a.length; ) (d = PF(a, b)) ? (b + d.xa <= a.length && (c = mc(c, a.subarray(b, b + d.xa))), b += d.xa) : b++;
      return Promise.resolve(c);
    };
    S("shaka.transmuxer.MpegTsTransmuxer", XF);
    XF.prototype.transmux = XF.prototype.transmux;
    XF.prototype.getOriginalMimeType = XF.prototype.getOriginalMimeType;
    XF.prototype.convertCodecs = XF.prototype.convertCodecs;
    XF.prototype.isSupported = XF.prototype.isSupported;
    XF.prototype.destroy = XF.prototype.destroy;
    Xe("video/mp2t", function() {
      return new XF("video/mp2t");
    }, bf);
    /*
     @license
     MSS Transmuxer
     Copyright 2015 Dash Industry Forum
     SPDX-License-Identifier: BSD-3-Clause
    */
    function YF(a) {
      this.h = a;
      (this.g = Cx.get("ISOBoxer")()) && ZF(this);
    }
    function ZF(a) {
      function b() {
        this._procFullBox();
        this.flags & 1 && (this._procField("AlgorithmID", "uint", 24), this._procField("IV_size", "uint", 8), this._procFieldArray("KID", 16, "uint", 8));
        this._procField("sample_count", "uint", 32);
        this._procEntries("entry", this.sample_count, function(c) {
          this._procEntryField(c, "InitializationVector", "data", 8);
          this.flags & 2 && (this._procEntryField(c, "NumberOfEntries", "uint", 16), this._procSubEntries(c, "clearAndCryptedData", c.NumberOfEntries, function(d) {
            this._procEntryField(
              d,
              "BytesOfClearData",
              "uint",
              16
            );
            this._procEntryField(d, "BytesOfEncryptedData", "uint", 32);
          }));
        });
      }
      a.g.addBoxProcessor("saio", function() {
        this._procFullBox();
        this.flags & 1 && (this._procField("aux_info_type", "uint", 32), this._procField("aux_info_type_parameter", "uint", 32));
        this._procField("entry_count", "uint", 32);
        this._procFieldArray("offset", this.entry_count, "uint", this.version === 1 ? 64 : 32);
      });
      a.g.addBoxProcessor("saiz", function() {
        this._procFullBox();
        this.flags & 1 && (this._procField("aux_info_type", "uint", 32), this._procField(
          "aux_info_type_parameter",
          "uint",
          32
        ));
        this._procField("default_sample_info_size", "uint", 8);
        this._procField("sample_count", "uint", 32);
        this.default_sample_info_size === 0 && this._procFieldArray("sample_info_size", this.sample_count, "uint", 8);
      });
      a.g.addBoxProcessor("senc", b);
      a.g.addBoxProcessor("uuid", function() {
        for (var c = true, d = 0; d < 16; d++) this.usertype[d] !== $F[d] && (c = false);
        c && (this._parsing && (this.type = "sepiff"), b.call(this));
      });
    }
    p = YF.prototype;
    p.destroy = function() {
    };
    p.isSupported = function(a, b) {
      var c = a.startsWith("mss/");
      if (!this.g || !c) return false;
      if (b) return dd(this.convertCodecs(b, a));
      b = this.convertCodecs("audio", a);
      a = this.convertCodecs("video", a);
      return dd(b) || dd(a);
    };
    p.convertCodecs = function(a, b) {
      return b.replace("mss/", "");
    };
    p.getOriginalMimeType = function() {
      return this.h;
    };
    p.transmux = function(a, b, c) {
      if (!c) return Promise.resolve(Lb(a));
      if (!b.mssPrivateData) return Promise.reject(new U(2, 3, 3020, c ? c.T()[0] : null));
      try {
        var d, e = this.g.parseBuffer(a), f = e.fetch("tfhd");
        f.track_ID = b.id + 1;
        var g = e.fetch("tfdt"), h = e.fetch("traf");
        g === null && (g = this.g.createFullBox("tfdt", h, f), g.version = 1, g.flags = 0, g.baseMediaDecodeTime = Math.floor(c.startTime * b.mssPrivateData.timescale));
        var k2 = e.fetch("trun"), l = e.fetch("tfxd");
        l && l._parent.boxes.splice(l._parent.boxes.indexOf(l), 1);
        var m = e.fetch("tfrf");
        m && m._parent.boxes.splice(m._parent.boxes.indexOf(m), 1);
        var n = e.fetch("sepiff");
        if (n !== null) {
          n.type = "senc";
          n.usertype = void 0;
          var q = e.fetch("saio");
          if (q === null) {
            q = this.g.createFullBox("saio", h);
            q.version = 0;
            q.flags = 0;
            q.entry_count = 1;
            q.offset = [0];
            var r = this.g.createFullBox("saiz", h);
            r.version = 0;
            r.flags = 0;
            r.sample_count = n.sample_count;
            r.default_sample_info_size = 0;
            r.sample_info_size = [];
            if (n.flags & 2) for (d = 0; d < n.sample_count; d += 1) r.sample_info_size[d] = 10 + 6 * n.entry[d].NumberOfEntries;
            else r.default_sample_info_size = 8;
          }
        }
        f.flags &= 16777214;
        f.flags |= 131072;
        k2.flags |= 1;
        var u = e.fetch("moof");
        k2.data_offset = u.getLength() + 8;
        var w = e.fetch("saio");
        w !== null && (w.offset[0] = aG(u, "traf") + aG(h, "senc") + 16);
        var v = Lb(e.write());
        return Promise.resolve(v);
      } catch (y) {
        return y instanceof U ? Promise.reject(y) : Promise.reject(new U(2, 3, 3022, c ? c.T()[0] : null));
      }
    };
    function aG(a, b) {
      for (var c = 8, d = 0; d < a.boxes.length && a.boxes[d].type !== b; d++) c += a.boxes[d].size;
      return c;
    }
    S("shaka.transmuxer.MssTransmuxer", YF);
    YF.prototype.transmux = YF.prototype.transmux;
    YF.prototype.getOriginalMimeType = YF.prototype.getOriginalMimeType;
    YF.prototype.convertCodecs = YF.prototype.convertCodecs;
    YF.prototype.isSupported = YF.prototype.isSupported;
    YF.prototype.destroy = YF.prototype.destroy;
    var $F = new Uint8Array([162, 57, 79, 82, 90, 155, 79, 20, 162, 68, 108, 66, 124, 100, 141, 244]);
    Xe("mss/audio/mp4", function() {
      return new YF("mss/audio/mp4");
    }, cf);
    Xe("mss/video/mp4", function() {
      return new YF("mss/video/mp4");
    }, cf);
    function bG(a) {
      this.m = a;
      this.g = 0;
      this.j = /* @__PURE__ */ new Map();
      this.l = this.i = this.h = null;
    }
    p = bG.prototype;
    p.destroy = function() {
      this.j.clear();
      this.i && this.i.destroy();
    };
    p.isSupported = function(a, b) {
      if (a.toLowerCase().split(";")[0] != "video/mp2t") return false;
      var c = a;
      b && (c = this.convertCodecs(b, a));
      var d = of(c).split(",");
      c = rc("audio", d);
      d = rc("video", d);
      if (c && (c = kf(c), !cG.includes(c)) || d && (c = kf(d), !dG.includes(c))) return false;
      if (b) return dd(this.convertCodecs(b, a));
      b = this.convertCodecs("audio", a);
      a = this.convertCodecs("video", a);
      return dd(b) || dd(a);
    };
    p.convertCodecs = function(a, b) {
      return b.toLowerCase().split(";")[0] == "video/mp2t" ? (b = of(b).replace("mp4a.40.34", "mp3").split(",").map(function(c) {
        return Yf(c, "audio/mp4");
      }).map(Zf).join(","), a == "audio" ? 'audio/mp4; codecs="' + b + '"' : 'video/mp4; codecs="' + b + '"') : b;
    };
    p.getOriginalMimeType = function() {
      return this.m;
    };
    p.transmux = function(a, b, c, d, e) {
      var f = Lb(a);
      if (e == "audio" && !xk(f)) {
        for (var g = ck(f), h = g.length; h < f.length; h++) if (VF(f, h)) return Promise.reject(new U(2, 3, 3018, c ? c.T()[0] : null));
        for (h = g.length; h < f.length; h++) if (zF(f, h)) return this.i || (this.i = new BF("audio/aac")), this.i.transmux(a, b, c, d, e);
        return Promise.reject(new U(2, 3, 3018, c ? c.T()[0] : null));
      }
      this.h ? this.h.clearData() : this.h = new pk();
      this.h.gg(c.i);
      var k2 = this.h.parse(f), l = [], m = k2.je();
      try {
        var n = null;
        if (e == "video") {
          switch (m.video) {
            case "avc":
              var q = [], r = null, u = k2.hd(), w = JF(u);
              if (!w.length) throw new U(2, 3, 3023, c ? c.T()[0] : null);
              for (var v = 0; v < w.length; v++) {
                var y = w[v];
                r == null && (r = y.dts);
                var z = void 0;
                z = v + 1 < w.length ? (w[v + 1].dts || 0) - (y.dts || 0) : w.length > 1 ? (y.dts || 0) - (w[v - 1].dts || 0) : (c.endTime - c.startTime) * 9e4;
                q.push({ data: y.data, size: y.data.byteLength, duration: z, Ab: Math.round((y.pts || 0) - (y.dts || 0)), flags: { Cb: 0, ub: 0, sb: 0, pb: 0, qb: y.isKeyframe ? 2 : 1, Db: y.isKeyframe ? 0 : 1 } });
              }
              for (var A = [], C = t(u), D = C.next(); !D.done; D = C.next()) A.push.apply(A, x(D.value.nalus));
              var F = HF(A);
              if (!F || r == null) throw new U(2, 3, 3018, c ? c.T()[0] : null);
              b.height = F.height;
              b.width = F.width;
              n = { id: b.id, type: "video", codecs: "avc1", encrypted: b.encrypted && b.drmInfos.length > 0, timescale: 9e4, duration: d, Gb: [], Na: new Uint8Array([]), Xa: F.Xa, eb: F.eb, gb: F.gb, data: { sequenceNumber: this.g, baseMediaDecodeTime: r, Eb: q }, stream: b };
              break;
            case "hvc":
              var B = [], E = null, I = [], J = k2.hd();
              if (!J.length) throw new U(2, 3, 3023, c ? c.T()[0] : null);
              for (var K = 0; K < J.length; K++) {
                var L = J[K], M = L.nalus;
                I.push.apply(I, x(M));
                for (var N = false, O = [], Q = false, R = t(M), V = R.next(); !V.done; V = R.next()) {
                  var Ba = V.value;
                  switch (Ba.type) {
                    case 1:
                    case 0:
                      var aa = Q = true;
                      break;
                    case 19:
                    case 20:
                    case 21:
                      N = aa = Q = true;
                      break;
                    case 32:
                      aa = true;
                      break;
                    case 33:
                      aa = true;
                      break;
                    case 34:
                      aa = true;
                      break;
                    case 35:
                      Q = aa = true;
                      break;
                    case 39:
                    case 40:
                      aa = true;
                      break;
                    default:
                      aa = false;
                  }
                  if (Q && aa) {
                    var Oa = Ba.fullData.byteLength, La = new Uint8Array(4);
                    La[0] = Oa >> 24 & 255;
                    La[1] = Oa >> 16 & 255;
                    La[2] = Oa >> 8 & 255;
                    La[3] = Oa & 255;
                    O.push(La);
                    O.push(Ba.fullData);
                  }
                }
                var Ja = O.length ? { data: mc.apply(ec, x(O)), isKeyframe: N } : null;
                if (Ja) {
                  E == null && L.dts != null && (E = L.dts);
                  var Ea = void 0;
                  Ea = K + 1 < J.length ? (J[K + 1].dts || 0) - (L.dts || 0) : J.length > 1 ? (L.dts || 0) - (J[K - 1].dts || 0) : (c.endTime - c.startTime) * 9e4;
                  B.push({ data: Ja.data, size: Ja.data.byteLength, duration: Ea, Ab: Math.round((L.pts || 0) - (L.dts || 0)), flags: { Cb: 0, ub: 0, sb: 0, pb: 0, qb: Ja.isKeyframe ? 2 : 1, Db: Ja.isKeyframe ? 0 : 1 } });
                }
              }
              var ya = KF(I);
              if (!ya || E == null) throw new U(2, 3, 3018, c ? c.T()[0] : null);
              b.height = ya.height;
              b.width = ya.width;
              n = {
                id: b.id,
                type: "video",
                codecs: "hvc1",
                encrypted: b.encrypted && b.drmInfos.length > 0,
                timescale: 9e4,
                duration: d,
                Gb: [],
                Na: new Uint8Array([]),
                Xa: ya.Xa,
                eb: ya.eb,
                gb: ya.gb,
                data: { sequenceNumber: this.g, baseMediaDecodeTime: E, Eb: B },
                stream: b
              };
          }
          n && (l.push(n), n = null);
        }
        if (e == "audio") {
          switch (m.audio) {
            case "aac":
              for (var Fa = [], Da, za = null, Ca = null, fb = null, hb = t(k2.Bb()), ib = hb.next(); !ib.done; ib = hb.next()) {
                var xb = ib.value, vb = xb.data;
                if (vb) {
                  var Va = 0;
                  if (Ca == -1 && fb) vb = mc(fb, xb.data), Ca = null;
                  else if (Ca != null && fb) {
                    Va = Math.max(0, Ca);
                    var Wd = mc(fb, vb.subarray(0, Va));
                    Fa.push({ data: Wd, size: Wd.byteLength, duration: 1024, Ab: 0, flags: {
                      Cb: 0,
                      ub: 0,
                      sb: 0,
                      pb: 0,
                      qb: 2,
                      Db: 0
                    } });
                    Ca = fb = null;
                  }
                  Da = yF(vb, Va);
                  if (!Da) throw new U(2, 3, 3018, c ? c.T()[0] : null);
                  b.audioSamplingRate = Da.sampleRate;
                  b.channelsCount = Da.channelCount;
                  za == null && xb.pts !== null && (za = xb.pts);
                  for (; Va < vb.length; ) {
                    var Lc = xF(vb, Va);
                    if (!Lc) {
                      fb = vb.subarray(Va, vb.length);
                      Ca = -1;
                      break;
                    }
                    var Ee = Lc.qe + Lc.xa;
                    Ca = Math.max(0, Va + Ee - vb.length);
                    Ca != 0 ? fb = vb.subarray(Va + Lc.qe, Va + Ee) : Va + Ee <= vb.length && Fa.push({ data: vb.subarray(Va + Lc.qe, Va + Ee), size: Lc.xa, duration: 1024, Ab: 0, flags: { Cb: 0, ub: 0, sb: 0, pb: 0, qb: 2, Db: 0 } });
                    Va += Ee;
                  }
                }
              }
              if (!Da || za == null) {
                if (!k2.hd().length) throw new U(2, 3, 3018, c ? c.T()[0] : null);
                za = c.startTime * 9e4;
                var Ad = rc("audio", b.codecs.split(","));
                if (!Ad || !b.channelsCount || !b.audioSamplingRate) throw new U(2, 3, 3018, c ? c.T()[0] : null);
                Da = { sampleRate: b.audioSamplingRate, channelCount: b.channelsCount, codec: Ad };
                var xg = AF(Ad, b.channelsCount);
                if (!xg) throw new U(2, 3, 3018, c ? c.T()[0] : null);
                for (var Dk = za + (c.endTime - c.startTime) * 9e4, ai = za; ai < Dk; ) Fa.push({ data: xg, size: xg.byteLength, duration: 1024, Ab: 0, flags: {
                  Cb: 0,
                  ub: 0,
                  sb: 0,
                  pb: 0,
                  qb: 2,
                  Db: 0
                } }), ai += 1024 / Da.sampleRate * 9e4;
              }
              var gd = Da.sampleRate, OJ = za / 9e4 * gd;
              n = { id: b.id, type: "audio", codecs: Da.codec, encrypted: b.encrypted && b.drmInfos.length > 0, timescale: gd, duration: d, Gb: [], Na: new Uint8Array([]), Xa: new Uint8Array([]), eb: 0, gb: 0, data: { sequenceNumber: this.g, baseMediaDecodeTime: OJ, Eb: Fa }, stream: b };
              break;
            case "ac3":
              for (var yz = [], ll = 0, Np = new Uint8Array([]), ml = null, zz = t(k2.Bb()), Op = zz.next(); !Op.done; Op = zz.next()) {
                var Pp = Op.value, Qp = Pp.data;
                ml == null && Pp.pts !== null && (ml = Pp.pts);
                for (var Eg = 0; Eg < Qp.length; ) {
                  var Ge = CF(Qp, Eg);
                  Ge ? (b.audioSamplingRate = Ge.sampleRate, b.channelsCount = Ge.channelCount, ll = Ge.sampleRate, Np = Ge.Na, yz.push({ data: Qp.subarray(Eg, Eg + Ge.xa), size: Ge.xa, duration: 1536, Ab: 0, flags: { Cb: 0, ub: 0, sb: 0, pb: 0, qb: 2, Db: 0 } }), Eg += Ge.xa) : Eg++;
                }
              }
              if (ll == 0 || Np.byteLength == 0 || ml == null) throw new U(2, 3, 3018, c ? c.T()[0] : null);
              var PJ = ml / 9e4 * ll;
              n = { id: b.id, type: "audio", codecs: "ac-3", encrypted: b.encrypted && b.drmInfos.length > 0, timescale: ll, duration: d, Gb: [], Na: Np, Xa: new Uint8Array([]), eb: 0, gb: 0, data: {
                sequenceNumber: this.g,
                baseMediaDecodeTime: PJ,
                Eb: yz
              }, stream: b };
              break;
            case "ec3":
              for (var Az = [], nl = 0, Rp = new Uint8Array([]), ol = null, Bz = t(k2.Bb()), Sp = Bz.next(); !Sp.done; Sp = Bz.next()) {
                var Tp = Sp.value, Up = Tp.data;
                ol == null && Tp.pts !== null && (ol = Tp.pts);
                for (var Fg = 0; Fg < Up.length; ) {
                  var He = FF(Up, Fg);
                  He ? (b.audioSamplingRate = He.sampleRate, b.channelsCount = He.channelCount, nl = He.sampleRate, Rp = He.Na, Az.push({ data: Up.subarray(Fg, Fg + He.xa), size: He.xa, duration: 1536, Ab: 0, flags: { Cb: 0, ub: 0, sb: 0, pb: 0, qb: 2, Db: 0 } }), Fg += He.xa) : Fg++;
                }
              }
              if (nl == 0 || Rp.byteLength == 0 || ol == null) throw new U(2, 3, 3018, c ? c.T()[0] : null);
              var QJ = ol / 9e4 * nl;
              n = { id: b.id, type: "audio", codecs: "ec-3", encrypted: b.encrypted && b.drmInfos.length > 0, timescale: nl, duration: d, Gb: [], Na: Rp, Xa: new Uint8Array([]), eb: 0, gb: 0, data: { sequenceNumber: this.g, baseMediaDecodeTime: QJ, Eb: Az }, stream: b };
              break;
            case "mp3":
              for (var Cz = [], pl, ql = null, Dz = t(k2.Bb()), Vp = Dz.next(); !Vp.done; Vp = Dz.next()) {
                var Wp = Vp.value, mi = Wp.data;
                if (mi) {
                  ql == null && Wp.pts !== null && (ql = Wp.pts);
                  for (var sf = 0; sf < mi.length; ) {
                    var Gg = PF(mi, sf);
                    Gg ? (pl || (pl = Gg), sf + Gg.xa <= mi.length && Cz.push({ data: mi.subarray(sf, sf + Gg.xa), size: Gg.xa, duration: 1152, Ab: 0, flags: { Cb: 0, ub: 0, sb: 0, pb: 0, qb: 2, Db: 0 } }), sf += Gg.xa) : sf++;
                  }
                }
              }
              if (!pl || ql == null) throw new U(2, 3, 3018, c ? c.T()[0] : null);
              var Ez = pl.sampleRate, RJ = ql / 9e4 * Ez;
              n = { id: b.id, type: "audio", codecs: "mp3", encrypted: b.encrypted && b.drmInfos.length > 0, timescale: Ez, duration: d, Gb: [], Na: new Uint8Array([]), Xa: new Uint8Array([]), eb: 0, gb: 0, data: { sequenceNumber: this.g, baseMediaDecodeTime: RJ, Eb: Cz }, stream: b };
              break;
            case "opus":
              var Fz = [], rl = null, Cd = k2.H;
              if (!Cd) throw new U(2, 3, 3018, c ? c.T()[0] : null);
              var fc = [];
              switch (Cd.pk) {
                case 1:
                case 2:
                  fc = [0];
                  break;
                case 0:
                  fc = [255, 1, 1, 0, 1];
                  break;
                case 128:
                  fc = [255, 2, 0, 0, 1];
                  break;
                case 3:
                  fc = [1, 2, 1, 0, 2, 1];
                  break;
                case 4:
                  fc = [1, 2, 2, 0, 1, 2, 3];
                  break;
                case 5:
                  fc = [1, 3, 2, 0, 4, 1, 2, 3];
                  break;
                case 6:
                  fc = [1, 4, 2, 0, 4, 1, 2, 3, 5];
                  break;
                case 7:
                  fc = [1, 4, 2, 0, 4, 1, 2, 3, 5, 6];
                  break;
                case 8:
                  fc = [1, 5, 3, 0, 6, 1, 2, 3, 4, 5, 7];
                  break;
                case 130:
                  fc = [1, 1, 2, 0, 1];
                  break;
                case 131:
                  fc = [1, 1, 3, 0, 1, 2];
                  break;
                case 132:
                  fc = [1, 1, 4, 0, 1, 2, 3];
                  break;
                case 133:
                  fc = [
                    1,
                    1,
                    5,
                    0,
                    1,
                    2,
                    3,
                    4
                  ];
                  break;
                case 134:
                  fc = [1, 1, 6, 0, 1, 2, 3, 4, 5];
                  break;
                case 135:
                  fc = [1, 1, 7, 0, 1, 2, 3, 4, 5, 6];
                  break;
                case 136:
                  fc = [1, 1, 8, 0, 1, 2, 3, 4, 5, 6, 7];
              }
              var Gz = new Uint8Array([0, Cd.channelCount, 0, 0, Cd.sampleRate >>> 24 & 255, Cd.sampleRate >>> 17 & 255, Cd.sampleRate >>> 8 & 255, Cd.sampleRate >>> 0 & 255, 0, 0].concat(x(fc)));
              for (var Hz = Cd.sampleRate, Iz = t(k2.Bb()), Xp = Iz.next(); !Xp.done; Xp = Iz.next()) {
                var Yp = Xp.value, Hg = Yp.data;
                rl == null && Yp.pts !== null && (rl = Yp.pts);
                for (var ni = 0; ni < Hg.length; ) {
                  for (var SJ = (Hg[ni + 1] & 16) !== 0, TJ = (Hg[ni + 1] & 8) !== 0, ie = ni + 2, sl = 0; Hg[ie] === 255; ) sl += 255, ie += 1;
                  sl += Hg[ie];
                  ie += 1;
                  ie += SJ ? 2 : 0;
                  ie += TJ ? 2 : 0;
                  var Jz = Hg.slice(ie, ie + sl);
                  Fz.push({ data: Jz, size: Jz.byteLength, duration: 960, Ab: 0, flags: { Cb: 0, ub: 0, sb: 0, pb: 0, qb: 2, Db: 0 } });
                  ni = ie + sl;
                }
              }
              if (Gz.byteLength == 0 || rl == null) throw new U(2, 3, 3018, c ? c.T()[0] : null);
              b.audioSamplingRate = Cd.sampleRate;
              b.channelsCount = Cd.channelCount;
              var UJ = rl / 9e4 * Hz;
              n = {
                id: b.id,
                type: "audio",
                codecs: "opus",
                encrypted: b.encrypted && b.drmInfos.length > 0,
                timescale: Hz,
                duration: d,
                Gb: [],
                Na: Gz,
                Xa: new Uint8Array([]),
                eb: 0,
                gb: 0,
                data: { sequenceNumber: this.g, baseMediaDecodeTime: UJ, Eb: Fz },
                stream: b
              };
          }
          n && (l.push(n), n = null);
        }
      } catch (Zp) {
        return Zp && Zp.code == 3023 ? Promise.resolve(new Uint8Array([])) : Promise.reject(Zp);
      }
      if (!l.length) return Promise.reject(new U(2, 3, 3018, c ? c.T()[0] : null));
      var Kz = new Vi(l), $p = b.id + "_" + c.i;
      if (this.j.has($p)) var oi = this.j.get($p);
      else oi = Wi(Kz), this.j.set($p, oi);
      var VJ = this.l !== oi, Lz = qj(Kz);
      this.l = oi;
      this.g++;
      if (VJ) {
        var WJ = mc(oi, Lz);
        return Promise.resolve(WJ);
      }
      return Promise.resolve(Lz);
    };
    S("shaka.transmuxer.TsTransmuxer", bG);
    bG.prototype.transmux = bG.prototype.transmux;
    bG.prototype.getOriginalMimeType = bG.prototype.getOriginalMimeType;
    bG.prototype.convertCodecs = bG.prototype.convertCodecs;
    bG.prototype.isSupported = bG.prototype.isSupported;
    bG.prototype.destroy = bG.prototype.destroy;
    var cG = ["aac", "ac-3", "ec-3", "mp3", "opus"], dG = ["avc", "hevc"];
    Xe("video/mp2t", function() {
      return new bG("video/mp2t");
    }, af);
    function eG() {
    }
    ma(eG, En);
    S("shaka.util.FairPlayUtils", eG);
    function fG(a, b) {
      var c = this;
      this.parent = a;
      this.controls = b;
      this.eventManager = new Qc();
      this.localization = this.controls.ua;
      this.player = this.controls.Vb();
      this.video = this.controls.Pc();
      this.adManager = this.player.rf();
      this.ad = b.getAd();
      this.eventManager.o(this.adManager, "ad-started", function(d) {
        c.ad = d.ad;
      });
      this.eventManager.o(this.adManager, "ad-stopped", function() {
        c.ad = null;
      });
    }
    fG.prototype.release = function() {
      this.eventManager.release();
      this.ad = this.adManager = this.video = this.player = this.localization = this.eventManager = this.controls = this.parent = null;
    };
    S("shaka.ui.Element", fG);
    fG.prototype.release = fG.prototype.release;
    function gG(a) {
      return hG(a, "shaka-back-to-overflow-button");
    }
    function hG(a, b) {
      a = a.getElementsByClassName(b);
      return a.length ? a[0] : null;
    }
    function iG(a) {
      a && (a = hG(a, "shaka-chosen-item")) && a.parentElement.focus();
    }
    function jG() {
      var a = W("i");
      a.classList.add("material-icons-round");
      a.classList.add("shaka-chosen-item");
      a.textContent = "done";
      a.ariaHidden = "true";
      return a;
    }
    function kG(a, b) {
      a && (b ? a.classList.remove("shaka-hidden") : a.classList.add("shaka-hidden"));
    }
    function lG(a, b) {
      var c = Math.floor(a / 86400), d = Math.floor(a % 86400 / 3600), e = Math.floor(a / 60 % 60);
      a = Math.floor(a % 60);
      a < 10 && (a = "0" + a);
      a = e + ":" + a;
      b && (e < 10 && (a = "0" + a), a = d + ":" + a, c > 0 && (d < 10 && (a = "0" + a), a = c + ":" + a));
      return a;
    }
    ;
    function mG(a, b) {
      fG.call(this, a, b);
      var c = this;
      this.g = Oj();
      this.g.classList.add("shaka-ad-info");
      this.g.disabled = true;
      this.parent.appendChild(this.g);
      this.h = new Cf(function() {
        if (c.ad.isLinear()) {
          var d = "", e = c.ad.getSequenceLength();
          e > 1 && (d = c.ad.getPositionInSequence(), d = c.localization.resolve("AD_PROGRESS").replace("[AD_ON]", String(d)).replace("[NUM_ADS]", String(e)));
          var f = Math.round(c.ad.getRemainingTime()), g = c.ad.getDuration();
          f == -1 || g == -1 ? (c.g.textContent = d, kG(c.g, d != "")) : f > 0 ? (f = lG(g - f, false) + " / " + lG(
            g,
            false
          ), d = e > 1 ? d + ("\xA0\xA0" + f) : c.localization.resolve("AD_TIME").replace("[AD_TIME]", f), c.g.textContent = d, kG(c.g, d != "")) : (c.h.stop(), c.g.textContent = "");
        }
      });
      this.eventManager.o(this.localization, "locale-updated", function() {
      });
      this.eventManager.o(this.localization, "locale-changed", function() {
      });
      this.eventManager.o(this.adManager, "ad-started", function() {
        c.h.La();
        c.h.za(0.5);
      });
      this.eventManager.o(this.adManager, "ad-stopped", function() {
        c.h.stop();
        c.g.textContent = "";
      });
      this.ad && (this.h.La(), this.h.za(0.5));
    }
    ma(mG, fG);
    mG.prototype.release = function() {
      this.h.stop();
      this.h = null;
      fG.prototype.release.call(this);
    };
    S("shaka.ui.AdInfo", mG);
    function nG(a, b) {
      fG.call(this, a, b);
      var c = this;
      this.j = this.controls.g;
      this.h = this.controls.i;
      this.i = [];
      this.g = W("div");
      this.g.classList.add("shaka-no-propagation");
      this.g.classList.add("shaka-context-menu");
      this.g.classList.add("shaka-hidden");
      this.h.appendChild(this.g);
      this.eventManager.o(this.h, "contextmenu", function(d) {
        if (c.g.classList.contains("shaka-hidden")) {
          d.preventDefault();
          var e = c.h.getBoundingClientRect();
          c.g.style.left = d.clientX - e.left + "px";
          c.g.style.top = d.clientY - e.top + "px";
          kG(c.g, true);
        } else kG(
          c.g,
          false
        );
      });
      this.eventManager.o(window2, "click", function() {
        kG(c.g, false);
      });
      this.eventManager.o(this.g, "click", function() {
        kG(c.g, false);
      });
      oG(this);
    }
    ma(nG, fG);
    nG.prototype.release = function() {
      this.h = null;
      for (var a = t(this.i), b = a.next(); !b.done; b = a.next()) b.value.release();
      this.i = [];
      fG.prototype.release.call(this);
    };
    nG.prototype.Oi = function() {
      kG(this.g, false);
    };
    function pG(a, b) {
      qG.set(a, b);
    }
    function oG(a) {
      for (var b = t(a.j.contextMenuElements), c = b.next(); !c.done; c = b.next()) {
        c = c.value;
        var d = qG.get(c);
        d ? a.i.push(d.create(a.g, a.controls)) : bb("Unrecognized context menu element:", c);
      }
    }
    S("shaka.ui.ContextMenu", nG);
    nG.registerElement = pG;
    nG.prototype.closeMenu = nG.prototype.Oi;
    var qG = /* @__PURE__ */ new Map();
    function rG(a, b) {
      fG.call(this, a, b);
      var c = this;
      this.button = Oj();
      this.parent.appendChild(this.button);
      this.eventManager.o(this.localization, "locale-updated", function() {
        sG(c);
      });
      this.eventManager.o(this.localization, "locale-changed", function() {
        sG(c);
      });
      this.eventManager.o(this.video, "play", function() {
        sG(c);
        c.g();
      });
      this.eventManager.o(this.video, "pause", function() {
        sG(c);
        c.g();
      });
      this.eventManager.o(this.video, "seeking", function() {
        sG(c);
        c.g();
      });
      this.eventManager.o(this.player, "loaded", function() {
        sG(c);
        c.g();
      });
      this.eventManager.o(this.adManager, "ad-paused", function() {
        sG(c);
        c.g();
      });
      this.eventManager.o(this.adManager, "ad-resumed", function() {
        sG(c);
        c.g();
      });
      this.eventManager.o(this.adManager, "ad-started", function() {
        sG(c);
        c.g();
      });
      this.eventManager.o(this.adManager, "ad-stopped", function() {
        sG(c);
        c.g();
      });
      this.eventManager.o(this.button, "click", function() {
        c.controls.Ca() && tG(c.controls);
      });
      sG(this);
      this.g();
    }
    ma(rG, fG);
    rG.prototype.isPaused = function() {
      if (this.ad && this.ad.isLinear()) var a = this.ad.isPaused();
      else a = this.controls, a = a.C.paused && !a.S;
      return a;
    };
    rG.prototype.isEnded = function() {
      return this.ad && this.ad.isLinear() ? false : this.player ? this.player.isEnded() : true;
    };
    function sG(a) {
      if (a.isEnded() && a.video.duration) a.button.ariaLabel = a.localization.resolve("REPLAY");
      else {
        var b = a.isPaused() ? "PLAY" : "PAUSE";
        a.button.ariaLabel = a.localization.resolve(b);
      }
    }
    rG.prototype.g = function() {
      this.isEnded() && this.video.duration ? this.button.textContent = "replay" : this.button.textContent = this.isPaused() ? "play_arrow" : "pause";
    };
    S("shaka.ui.PlayButton", rG);
    function uG(a, b) {
      rG.call(this, a, b);
      this.button.classList.add("shaka-play-button");
      this.button.classList.add("shaka-no-propagation");
    }
    ma(uG, rG);
    uG.prototype.g = function() {
      this.isEnded() ? this.button.setAttribute("icon", "replay") : this.isPaused() ? this.button.setAttribute("icon", "play") : this.button.setAttribute("icon", "pause");
    };
    S("shaka.ui.BigPlayButton", uG);
    function vG(a, b) {
      fG.call(this, a, b);
      var c = this;
      this.u = null;
      this.j = this.D = false;
      this.C = this.A = null;
      this.l = new Cf(function() {
        parseInt(c.h.textContent, 10) === 0 && wG(c.controls, true);
        var d = parseInt(c.h.textContent, 10);
        d !== 0 && (c.video.currentTime = c.controls.oh() + d);
        c.g.style.opacity = "0";
        c.D = false;
        c.h.textContent = "0s";
      });
      this.g = W("div");
      this.g.classList.add("shaka-no-propagation");
      this.parent.appendChild(this.g);
      this.h = W("span");
      this.h.textContent = "0s";
      this.g.appendChild(this.h);
      this.i = W("span");
      this.i.classList.add("shaka-forward-rewind-container-icon");
      this.g.appendChild(this.i);
      this.m = false;
      this.eventManager.o(this.g, "touchstart", function(d) {
        c.controls.Ca() && (d.touches.length > 0 && (c.A = d.touches[0].clientX, c.C = d.touches[0].clientY), c.j = false);
      });
      this.eventManager.o(this.g, "touchmove", function(d) {
        if (d.touches.length > 0 && c.A != null && c.C != null) {
          var e = d.touches[0].clientX - c.A;
          d = d.touches[0].clientY - c.C;
          Math.sqrt(e * e + d * d) > 10 && (c.j = true);
        }
      });
      this.eventManager.o(this.g, "touchend", function(d) {
        if (c.controls.Ca() && !c.j) {
          if (c.controls.Hc()) d.preventDefault(), c.controls.Rc();
          else if (c.controls.g.tapSeekDistance > 0) {
            if (d.preventDefault(), d = c.controls.g.tapSeekDistance, !c.D) c.D = true, c.u = Date.now(), c.l.Y(0.5);
            else if (c.u + 500 > Date.now()) {
              c.l.stop();
              c.u = Date.now();
              var e = parseInt(c.h.textContent, 10);
              e = c.m ? e - d : e + d;
              c.h.textContent = e.toString() + "s";
              c.g.style.opacity = "1";
              c.l.Y(0.5);
            }
          }
        }
      });
    }
    ma(vG, fG);
    S("shaka.ui.HiddenSeekButton", vG);
    function xG(a, b) {
      vG.call(this, a, b);
      this.g.classList.add("shaka-fast-forward-container");
      this.i.textContent = "fast_forward";
      this.m = false;
    }
    ma(xG, vG);
    S("shaka.ui.HiddenFastForwardButton", xG);
    function yG(a, b) {
      vG.call(this, a, b);
      this.g.classList.add("shaka-rewind-container");
      this.i.textContent = "fast_rewind";
      this.m = true;
    }
    ma(yG, vG);
    S("shaka.ui.HiddenRewindButton", yG);
    function zG(a, b, c, d) {
      fG.call(this, a, b);
      var e = this;
      this.container = W("div");
      this.container.classList.add("shaka-range-container");
      this.container.classList.add.apply(this.container.classList, x(c));
      this.i = false;
      this.bar = document.createElement("input");
      this.G = new Cf(function() {
        e.onChangeEnd();
        e.i = false;
      });
      this.bar.classList.add("shaka-range-element");
      this.bar.classList.add.apply(this.bar.classList, x(d));
      this.bar.type = "range";
      this.bar.step = "any";
      this.bar.min = "0";
      this.bar.max = "1";
      this.bar.value = "0";
      this.bar.disabled = !this.controls.Ca();
      this.container.appendChild(this.bar);
      this.parent.appendChild(this.container);
      this.L = new Cf(function() {
        e.bar.disabled = false;
      });
      this.eventManager.o(this.controls, "showingui", function() {
        e.L.Y(0);
      });
      this.eventManager.o(this.controls, "hidingui", function() {
        e.L.stop();
        e.bar.disabled = true;
      });
      this.eventManager.o(this.bar, "mousedown", function(f) {
        e.bar.disabled || (e.i = true, e.onChangeStart(), f.stopPropagation());
      });
      this.eventManager.o(this.bar, "touchstart", function(f) {
        e.bar.disabled || (e.i = true, AG(e, f), e.onChangeStart(), f.stopPropagation());
      });
      this.eventManager.o(this.bar, "input", function() {
        e.onChange();
      });
      this.eventManager.o(this.bar, "touchmove", function(f) {
        e.i && (AG(e, f), e.onChange(), f.stopPropagation());
      });
      this.eventManager.o(this.bar, "touchend", function(f) {
        e.i && (e.i = false, AG(e, f), e.onChangeEnd(), f.stopPropagation());
      });
      this.eventManager.o(this.bar, "touchcancel", function(f) {
        e.i && (e.i = false, AG(e, f), e.onChangeEnd(), f.stopPropagation());
      });
      this.eventManager.o(this.bar, "mouseup", function(f) {
        e.i && (e.i = false, e.onChangeEnd(), f.stopPropagation());
      });
      this.eventManager.o(this.bar, "blur", function() {
        e.i && (e.i = false, e.onChangeEnd());
      });
      this.eventManager.o(this.bar, "contextmenu", function(f) {
        f.preventDefault();
        f.stopPropagation();
      });
    }
    ma(zG, fG);
    p = zG.prototype;
    p.release = function() {
      this.G && (this.G.stop(), this.G = null);
      fG.prototype.release.call(this);
    };
    p.setRange = function(a, b) {
      this.bar.min = a;
      this.bar.max = b;
    };
    p.onChangeStart = function() {
    };
    p.onChange = function() {
    };
    p.onChangeEnd = function() {
    };
    p.changeTo = function(a) {
      this.i || (this.i = true, this.onChangeStart());
      var b = parseFloat(this.bar.min), c = parseFloat(this.bar.max);
      this.bar.value = a > c ? c : a < b ? b : a;
      this.onChange();
      this.G.Y(0.5);
    };
    p.getValue = function() {
      return parseFloat(this.bar.value);
    };
    p.setValue = function(a) {
      this.i || (this.bar.value = a);
    };
    function BG(a, b) {
      var c = a.bar.getBoundingClientRect(), d = parseFloat(a.bar.min), e = parseFloat(a.bar.max);
      a = parseFloat(a.bar.step) || 1;
      var f = c.left + 6;
      c = c.right - 6;
      b = d + (Math.max(f, Math.min(c, b)) - f) / (c - f) * (e - d);
      b = Math.round((b - d) / a) * a + d;
      return b = Math.min(e, Math.max(d, b));
    }
    function AG(a, b) {
      b.preventDefault();
      a.bar.value = BG(a, b.changedTouches[0].clientX);
    }
    S("shaka.ui.RangeElement", zG);
    zG.prototype.setValue = zG.prototype.setValue;
    zG.prototype.getValue = zG.prototype.getValue;
    zG.prototype.changeTo = zG.prototype.changeTo;
    zG.prototype.onChangeEnd = zG.prototype.onChangeEnd;
    zG.prototype.onChange = zG.prototype.onChange;
    zG.prototype.onChangeStart = zG.prototype.onChangeStart;
    zG.prototype.setRange = zG.prototype.setRange;
    function CG(a, b) {
      zG.call(this, a, b, ["shaka-seek-bar-container"], ["shaka-seek-bar", "shaka-no-propagation", "shaka-show-controls-on-mouse-over"]);
      var c = this;
      this.F = W("div");
      this.F.classList.add("shaka-ad-markers");
      this.container.insertBefore(this.F, this.container.childNodes[0]);
      this.I = this.controls.g;
      this.C = new Cf(function() {
        var d = c.getValue();
        c.player.U() || d == c.video.duration && (d -= 1e-3);
        c.video.currentTime = d;
      });
      this.D = new Cf(function() {
        DG(c);
      });
      this.M = false;
      this.h = W("div");
      this.h.id = "shaka-player-ui-thumbnail-container";
      this.g = W("img");
      this.g.id = "shaka-player-ui-thumbnail-image";
      this.g.draggable = false;
      this.K = W("div");
      this.K.id = "shaka-player-ui-thumbnail-time-container";
      this.H = W("div");
      this.H.id = "shaka-player-ui-thumbnail-time";
      this.K.appendChild(this.H);
      this.h.appendChild(this.g);
      this.h.appendChild(this.K);
      this.container.appendChild(this.h);
      this.j = W("div");
      this.j.id = "shaka-player-ui-time-container";
      this.container.appendChild(this.j);
      this.l = this.u = null;
      this.J = false;
      this.A = new Cf(function() {
        EG(c);
      });
      this.m = [];
      this.eventManager.o(
        this.bar,
        "input",
        function() {
          c.controls.Rc();
        }
      );
      this.eventManager.o(this.localization, "locale-updated", function() {
        return FG(c);
      });
      this.eventManager.o(this.localization, "locale-changed", function() {
        return FG(c);
      });
      this.eventManager.o(this.adManager, "ad-started", function() {
        GG(c) || kG(c.container, false);
      });
      this.eventManager.o(this.adManager, "ad-stopped", function() {
        GG(c) && kG(c.container, true);
      });
      this.eventManager.o(this.adManager, "ad-cue-points-changed", function(d) {
        c.m = d.cuepoints;
        HG(c);
      });
      this.eventManager.o(
        this.player,
        "unloading",
        function() {
          c.m = [];
          HG(c);
          c.l && (c.l.abort(), c.l = null);
          c.u = null;
          EG(c);
          IG(c);
        }
      );
      this.eventManager.o(this.bar, "mousemove", function(d) {
        if (c.controls.Hc()) IG(c), EG(c);
        else {
          var e = BG(c, d.clientX), f = c.bar.getBoundingClientRect();
          d = Math.max(0, d.clientX - f.left);
          c.player.ph().length ? (IG(c), JG(c, d, e)) : (EG(c), KG(c, d, e));
        }
      });
      this.eventManager.o(this.container, "mouseleave", function() {
        IG(c);
        c.A.stop();
        c.A.Y(0.25);
      });
      this.setValue(this.video.currentTime);
      this.update();
      FG(this);
      this.ad && kG(this.container, false);
    }
    ma(CG, zG);
    p = CG.prototype;
    p.release = function() {
      this.C && (this.C.stop(), this.C = null, this.D.stop(), this.D = null);
      zG.prototype.release.call(this);
    };
    p.onChangeStart = function() {
      this.M = !this.video.paused;
      this.controls.ii(true);
      this.video.pause();
      this.A.stop();
      this.J = true;
    };
    p.onChange = function() {
      if (this.video.duration) if (this.update(), this.C.Y(0.125), this.player.ph().length && !this.controls.Hc()) {
        var a = parseFloat(this.bar.min), b = parseFloat(this.bar.max), c = this.bar.getBoundingClientRect(), d = Math.round(this.getValue());
        JG(this, (d - a) / ((b - a) / c.width), d);
      } else EG(this);
    };
    p.onChangeEnd = function() {
      this.C.La();
      this.controls.ii(false);
      this.M && this.video.play();
      this.J && (this.J = false, this.A.stop(), this.A.Y(0.25));
    };
    p.isShowing = function() {
      return !this.container.classList.contains("shaka-hidden");
    };
    p.update = function() {
      var a = this.I.seekBarColors, b = this.getValue(), c = this.video.buffered.length, d = c ? this.video.buffered.start(0) : 0, e = c ? this.video.buffered.end(c - 1) : 0;
      c = this.player.ya();
      var f = c.end - c.start;
      this.setRange(c.start, c.end);
      GG(this) ? (kG(this.container, true), d = (Math.max(d, c.start) - c.start) / f || 0, e = (Math.min(e, c.end) - c.start) / f || 0, b = (Math.min(Math.max(b, c.start), c.end) - c.start) / f || 0, this.container.style.background = "linear-gradient(" + ["to right", (this.I.showUnbufferedStart ? a.base : a.played) + " " + d * 100 + "%", a.played + " " + d * 100 + "%", a.played + " " + b * 100 + "%", a.buffered + " " + b * 100 + "%", a.buffered + " " + e * 100 + "%", a.base + " " + e * 100 + "%"].join() + ")") : kG(this.container, false);
    };
    function DG(a) {
      if (a.m.length) {
        for (var b = a.player.ya(), c = b.end - b.start, d = ["to right"], e = [], f = a.I.seekBarColors.adBreaks, g = false, h = t(a.m), k2 = h.next(); !k2.done; k2 = h.next()) if (k2 = k2.value, k2.start == -1 && !k2.end) g = true;
        else if (!k2.end && k2.start >= b.start || typeof k2.end == "number" && k2.end > b.start) {
          var l = (Math.max(k2.start, b.start) - b.start) / c || 0, m = l + 0.01;
          k2.end && (m = (k2.end - b.start) / c || 0);
          e.push({ start: l, end: m });
        }
        e = e.sort(function(n, q) {
          return n.start - q.start;
        });
        b = t(e);
        for (c = b.next(); !c.done; c = b.next()) c = c.value, d.push("transparent " + c.start * 100 + "%"), d.push(f + " " + c.start * 100 + "%"), d.push(f + " " + c.end * 100 + "%"), d.push("transparent " + c.end * 100 + "%");
        g && (d.push("transparent 99%"), d.push(f + " 99%"));
        a.F.style.background = "linear-gradient(" + d.join(",") + ")";
      } else a.F.style.background = "transparent", a.D.stop();
    }
    function HG(a) {
      function b() {
        DG(a);
        var c = a.player.ya();
        c = c.end - c.start;
        a.player.U() && c > 5 && a.D.za(0.25);
      }
      a.player.aa ? b() : a.eventManager.qa(a.player, "loaded", b);
    }
    function GG(a) {
      var b = a.player.ya();
      b = b.end - b.start;
      return a.player.U() && (b < 5 || !isFinite(b)) ? false : a.ad == null || !a.ad.isLinear();
    }
    function FG(a) {
      a.bar.ariaLabel = a.localization.resolve("SEEK");
    }
    function KG(a, b, c) {
      var d = a.j.clientWidth;
      a.j.style.width = "auto";
      a.j.style.height = "20px";
      a.j.style.top = "-30px";
      a.j.style.left = Math.min(a.bar.offsetWidth - d, Math.max(0, b - d / 2)) + "px";
      a.j.style.right = "";
      a.j.style.visibility = "visible";
      b = a.player.ya();
      a.player.U() ? (c = b.end - c, c < 1 ? (a.j.textContent = a.localization.resolve("LIVE"), a.j.style.left = "", a.j.style.right = "0px") : a.j.textContent = "-" + lG(c, c >= 3600)) : (c -= b.start, a.j.textContent = lG(c, c >= 3600));
    }
    function JG(a, b, c) {
      var d, e, f, g, h, k2, l, m, n, q, r, u, w, v, y, z, A, C;
      P(function(D) {
        switch (D.g) {
          case 1:
            c < 0 && (c = 0);
            d = false;
            a.m.length && (d = a.m.some(function(F) {
              return F.end ? c >= F.start && c <= F.end : false;
            }));
            if (d) return EG(a), KG(a, b, c), D.return();
            e = a.player.ya();
            f = Math.max(Math.ceil(e.start), Math.min(Math.floor(e.end), c));
            a.player.U() ? (g = e.end - c, a.H.textContent = g < 1 ? a.localization.resolve("LIVE") : "-" + lG(g, g >= 3600)) : a.H.textContent = lG(c, c >= 3600);
            return G(D, a.player.$i(null, f), 2);
          case 2:
            h = D.h;
            if (!h || !h.uris || !h.uris.length) return EG(a), KG(a, b, c), D.return();
            h.width < h.height ? a.h.classList.add("portrait-thumbnail") : a.h.classList.remove("portrait-thumbnail");
            k2 = -10;
            l = a.h.clientWidth;
            m = Math.floor(l * 9 / 16);
            a.h.style.height = m + "px";
            a.h.style.top = -(m - k2) + "px";
            n = Math.min(a.bar.offsetWidth - l, Math.max(0, b - l / 2));
            a.h.style.left = n + "px";
            a.h.style.visibility = "visible";
            q = h.uris[0].split("#xywh=")[0];
            if (a.u && q === a.u.uris[0].split("#xywh=")[0] && h.startByte == a.u.startByte && h.endByte == a.u.endByte) {
              D.B(3);
              break;
            }
            a.u = h;
            a.l && (a.l.abort(), a.l = null);
            if (h.codecs != "mjpg" && !q.startsWith("offline:")) {
              D.B(4);
              break;
            }
            a.g.src = 'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg"/>';
            sa(D, 5);
            r = gh;
            u = Jm(h.uris, h.startByte, h.endByte, a.player.getConfiguration().streaming.retryParameters);
            a.l = a.player.Lb().request(r, u, { type: 1 });
            return G(D, a.l.promise, 7);
          case 7:
            w = D.h;
            a.l = null;
            h.codecs == "mjpg" ? (v = new ph().box("mdat", zh(function(F) {
              q = URL.createObjectURL(new Blob([F], { type: "image/jpeg" }));
            })), v.parse(w.data, false)) : (y = h.mimeType || "image/jpeg", z = new Blob([w.data], { type: y }), q = URL.createObjectURL(z));
            ua(D, 4);
            break;
          case 5:
            A = va(D);
            if (A.code == 7001) return D.return();
            throw A;
          case 4:
            try {
              a.h.removeChild(a.g);
            } catch (F) {
            }
            a.g = W("img");
            a.g.id = "shaka-player-ui-thumbnail-image";
            a.g.draggable = false;
            a.g.src = q;
            a.g.onload = function() {
              q.startsWith("blob:") && URL.revokeObjectURL(q);
            };
            a.h.insertBefore(a.g, a.h.firstChild);
          case 3:
            C = l / h.width, h.imageHeight ? a.g.height = h.imageHeight : h.sprite || (a.g.style.height = "100%", a.g.style.objectFit = "contain"), h.imageWidth ? a.g.width = h.imageWidth : h.sprite || (a.g.style.width = "100%", a.g.style.objectFit = "contain"), a.g.style.left = "-" + C * h.positionX + "px", a.g.style.top = "-" + C * h.positionY + "px", a.g.style.transform = "scale(" + C + ")", a.g.style.transformOrigin = "left top", m = Math.floor(l * h.height / h.width), a.h.style.height = m + "px", a.h.style.top = -(m - k2) + "px", H(D);
        }
      });
    }
    function EG(a) {
      a.h.style.visibility = "hidden";
    }
    function IG(a) {
      a.j.style.visibility = "hidden";
    }
    S("shaka.ui.SeekBar", CG);
    function LG() {
    }
    LG.prototype.create = function(a, b) {
      return new CG(a, b);
    };
    CG.Factory = LG;
    function MG(a, b) {
      fG.call(this, a, b);
      var c = this;
      this.j = W("div");
      this.j.classList.add("shaka-skip-ad-container");
      this.parent.appendChild(this.j);
      this.h = W("div");
      this.h.classList.add("shaka-skip-ad-counter");
      kG(this.h, false);
      this.j.appendChild(this.h);
      this.g = Oj();
      this.g.classList.add("shaka-skip-ad-button");
      this.g.disabled = true;
      kG(this.g, false);
      this.g.classList.add("shaka-no-propagation");
      this.j.appendChild(this.g);
      NG(this);
      this.i = new Cf(function() {
        if (c.ad.isSkippable()) {
          var d = Math.round(c.ad.getTimeUntilSkippable());
          d > 0 ? c.h.textContent = d : (c.i.stop(), kG(c.h, false));
        } else OG(c);
      });
      this.eventManager.o(this.localization, "locale-updated", function() {
        NG(c);
      });
      this.eventManager.o(this.localization, "locale-changed", function() {
        NG(c);
      });
      this.eventManager.o(this.adManager, "ad-started", function() {
        PG(c);
      });
      this.eventManager.o(this.adManager, "ad-skip-state-changed", function() {
        c.ad.isSkippable() ? c.ad.canSkipNow() && (c.g.disabled = false, c.i.stop(), kG(c.h, false)) : OG(c);
      });
      this.eventManager.o(this.adManager, "ad-stopped", function() {
        OG(c);
      });
      this.eventManager.o(
        this.g,
        "click",
        function() {
          c.ad.skip();
        }
      );
      this.ad && PG(this);
    }
    ma(MG, fG);
    MG.prototype.release = function() {
      this.i.stop();
      this.i = null;
      fG.prototype.release.call(this);
    };
    function NG(a) {
      a.g.textContent = a.localization.resolve("SKIP_AD");
    }
    function PG(a) {
      a.ad.isSkippable() && a.ad.needsSkipUI() && (kG(a.g, true), kG(a.h, true), a.h.textContent = "", a.i.La(), a.i.za(0.5));
    }
    function OG(a) {
      a.i.stop();
      a.g.disabled = true;
      kG(a.g, false);
      kG(a.h, false);
    }
    S("shaka.ui.SkipAdButton", MG);
    /*
     @license
     glMatrix: https://github.com/toji/gl-matrix/
     Copyright 2015-2021, Brandon Jones, Colin MacKenzie IV
     SPDX-License-Identifier: MIT
    */
    function QG() {
      var a = new Float32Array(16);
      a[0] = 1;
      a[5] = 1;
      a[10] = 1;
      a[15] = 1;
      return a;
    }
    function RG(a, b, c) {
      b = 1 / Math.tan(b / 2);
      a[0] = b / c;
      a[1] = 0;
      a[2] = 0;
      a[3] = 0;
      a[4] = 0;
      a[5] = b;
      a[6] = 0;
      a[7] = 0;
      a[8] = 0;
      a[9] = 0;
      a[11] = -1;
      a[12] = 0;
      a[13] = 0;
      a[15] = 0;
      c = 1 / -99.9;
      a[10] = 100.1 * c;
      a[14] = 20 * c;
    }
    function SG(a, b, c) {
      var d = b[0], e = b[1], f = b[2], g = b[3], h = b[4], k2 = b[5], l = b[6], m = b[7], n = b[8], q = b[9], r = b[10], u = b[11], w = b[12], v = b[13], y = b[14];
      b = b[15];
      var z = c[0], A = c[1], C = c[2], D = c[3];
      a[0] = z * d + A * h + C * n + D * w;
      a[1] = z * e + A * k2 + C * q + D * v;
      a[2] = z * f + A * l + C * r + D * y;
      a[3] = z * g + A * m + C * u + D * b;
      z = c[4];
      A = c[5];
      C = c[6];
      D = c[7];
      a[4] = z * d + A * h + C * n + D * w;
      a[5] = z * e + A * k2 + C * q + D * v;
      a[6] = z * f + A * l + C * r + D * y;
      a[7] = z * g + A * m + C * u + D * b;
      z = c[8];
      A = c[9];
      C = c[10];
      D = c[11];
      a[8] = z * d + A * h + C * n + D * w;
      a[9] = z * e + A * k2 + C * q + D * v;
      a[10] = z * f + A * l + C * r + D * y;
      a[11] = z * g + A * m + C * u + D * b;
      z = c[12];
      A = c[13];
      C = c[14];
      D = c[15];
      a[12] = z * d + A * h + C * n + D * w;
      a[13] = z * e + A * k2 + C * q + D * v;
      a[14] = z * f + A * l + C * r + D * y;
      a[15] = z * g + A * m + C * u + D * b;
    }
    function TG(a, b) {
      var c = new Float32Array(3), d = b[0], e = b[1], f = b[2], g = b[4], h = b[5], k2 = b[6], l = b[8], m = b[9], n = b[10];
      c[0] = Math.sqrt(d * d + e * e + f * f);
      c[1] = Math.sqrt(g * g + h * h + k2 * k2);
      c[2] = Math.sqrt(l * l + m * m + n * n);
      k2 = 1 / c[0];
      l = 1 / c[1];
      m = 1 / c[2];
      g = b[0] * k2;
      c = b[1] * l;
      d = b[2] * m;
      e = b[4] * k2;
      h = b[5] * l;
      f = b[6] * m;
      k2 *= b[8];
      l *= b[9];
      b = b[10] * m;
      m = g + h + b;
      m > 0 ? (b = Math.sqrt(m + 1) * 2, a[3] = 0.25 * b, a[0] = (f - l) / b, a[1] = (k2 - d) / b, a[2] = (c - e) / b) : g > h && g > b ? (b = Math.sqrt(1 + g - h - b) * 2, a[3] = (f - l) / b, a[0] = 0.25 * b, a[1] = (c + e) / b, a[2] = (k2 + d) / b) : h > b ? (b = Math.sqrt(1 + h - g - b) * 2, a[3] = (k2 - d) / b, a[0] = (c + e) / b, a[1] = 0.25 * b, a[2] = (f + l) / b) : (b = Math.sqrt(1 + b - g - h) * 2, a[3] = (c - e) / b, a[0] = (k2 + d) / b, a[1] = (f + l) / b, a[2] = 0.25 * b);
    }
    function UG(a, b) {
      var c = b[0], d = b[1], e = b[2];
      b = b[3];
      var f = c + c, g = d + d, h = e + e;
      c *= f;
      var k2 = d * f;
      d *= g;
      var l = e * f, m = e * g;
      e *= h;
      f *= b;
      g *= b;
      b *= h;
      a[0] = 1 - d - e;
      a[1] = k2 + b;
      a[2] = l - g;
      a[3] = 0;
      a[4] = k2 - b;
      a[5] = 1 - c - e;
      a[6] = m + f;
      a[7] = 0;
      a[8] = l + g;
      a[9] = m - f;
      a[10] = 1 - c - d;
      a[11] = 0;
      a[12] = 0;
      a[13] = 0;
      a[14] = 0;
      a[15] = 1;
    }
    ;
    function VG() {
      var a = new Float32Array(4);
      a[3] = 1;
      return a;
    }
    function WG(a, b) {
      var c = b[0], d = b[1], e = b[2];
      b = b[3];
      var f = c * c + d * d + e * e + b * b;
      f > 0 && (f = 1 / Math.sqrt(f));
      a[0] = c * f;
      a[1] = d * f;
      a[2] = e * f;
      a[3] = b * f;
    }
    ;
    function XG(a) {
      var b = [], c = [], d = [], e = Math.PI;
      a = (a === void 0 ? 0 : a) ? e / 2 : e;
      for (var f = 0; f <= 100; f++) {
        var g = f * e / 100, h = Math.sin(g);
        g = Math.cos(g);
        for (var k2 = 0; k2 <= 100; k2++) {
          var l = k2 * 2 * a / 100;
          b.push(Math.sin(l) * h, g, Math.cos(l) * h);
          c.push(k2 / 100, f / 100);
        }
      }
      for (e = 0; e < 100; e++) for (a = 0; a < 100; a++) f = e * 101 + a, h = f + 100 + 1, d.push(f, h, f + 1), d.push(h, h + 1, f + 1);
      return { dk: b, $j: c, indices: d };
    }
    ;
    function YG(a, b, c, d, e) {
      this.i = a;
      this.sa = b;
      this.u = c;
      this.g = d;
      this.A = new Qc();
      this.M = VG();
      this.h = VG();
      this.ea = this.oa = this.aa = this.l = null;
      this.F = QG();
      this.J = QG();
      this.O = QG();
      this.Z = QG();
      this.D = null;
      this.P = false;
      this.K = this.C = null;
      this.ua = this.va = 0;
      this.$ = this.R = this.S = this.L = null;
      this.I = this.H = 0;
      this.j = 75;
      this.V = 0;
      this.m = e;
      this.G = -1;
      ZG(this);
    }
    YG.prototype.release = function() {
      this.G != -1 && (this.i.cancelVideoFrameCallback(this.G), this.G = -1);
      this.A && (this.A.release(), this.A = null);
      this.C && (this.C.stop(), this.C = null);
      this.K && (this.K.stop(), this.K = null);
    };
    YG.prototype.Wd = function() {
      (this.P = !this.P) || this.g.viewport(0, 0, this.u.width, this.u.height);
      $G(this, false);
    };
    function ZG(a) {
      aH(a);
      bH(a);
      cH(a);
      dH(a);
      eH(a);
      Il(a.i, HTMLMediaElement.HAVE_CURRENT_DATA, a.A, function() {
        a.i.readyState >= HTMLMediaElement.HAVE_ENOUGH_DATA && $G(a);
        if ("requestVideoFrameCallback" in a.i) {
          var b = function() {
            a.G != -1 && ($G(a), a.G != -1 && (a.G = a.i.requestVideoFrameCallback(b)));
          };
          a.G = a.i.requestVideoFrameCallback(b);
        } else {
          var c;
          a.A.o(a.i, "canplaythrough", function() {
            $G(a);
          });
          a.A.o(a.i, "playing", function() {
            a.C && a.C.stop();
            if (!c) {
              var d = a.sa.rb();
              d = t(d);
              for (var e = d.next(); !e.done; e = d.next()) (e = e.value.frameRate) && (!c || c < e) && (c = e);
            }
            c || (c = 60);
            $G(a);
            a.C = new Cf(function() {
              $G(a);
            }).La().za(1 / c);
          });
          a.A.o(a.i, "pause", function() {
            a.C && a.C.stop();
            a.C = null;
            $G(a);
          });
          a.A.o(a.i, "seeked", function() {
            $G(a);
          });
          a.A.o(document, "visibilitychange", function() {
            $G(a);
          });
        }
      });
    }
    function aH(a) {
      var b = a.F, c = [0, 0, 0], d = [1, 0, 0], e = [0, 1, 0], f = c[0], g = c[1];
      c = c[2];
      var h = e[0];
      var k2 = e[1];
      var l = e[2];
      var m = d[0];
      e = d[1];
      var n = d[2];
      if (Math.abs(f - m) < 1e-6 && Math.abs(g - e) < 1e-6 && Math.abs(c - n) < 1e-6) for (f = 0; f < 16; f++) b[f] = f % 5 == 0 ? 1 : 0;
      else {
        d = f - m;
        e = g - e;
        m = c - n;
        var q = 1 / Math.sqrt(d * d + e * e + m * m);
        d *= q;
        e *= q;
        m *= q;
        n = k2 * m - l * e;
        l = l * d - h * m;
        h = h * e - k2 * d;
        (q = Math.sqrt(n * n + l * l + h * h)) ? (q = 1 / q, n *= q, l *= q, h *= q) : h = l = n = 0;
        k2 = e * h - m * l;
        var r = m * n - d * h;
        var u = d * l - e * n;
        (q = Math.sqrt(k2 * k2 + r * r + u * u)) ? (q = 1 / q, k2 *= q, r *= q, u *= q) : u = r = k2 = 0;
        b[0] = n;
        b[1] = k2;
        b[2] = d;
        b[3] = 0;
        b[4] = l;
        b[5] = r;
        b[6] = e;
        b[7] = 0;
        b[8] = h;
        b[9] = u;
        b[10] = m;
        b[11] = 0;
        b[12] = -(n * f + l * g + h * c);
        b[13] = -(k2 * f + r * g + u * c);
        b[14] = -(d * f + e * g + m * c);
        b[15] = 1;
      }
      TG(a.M, a.F);
      a = b = a.Z;
      c = [4, 4, 4];
      f = c[0];
      g = c[1];
      c = c[2];
      b[0] = a[0] * f;
      b[1] = a[1] * f;
      b[2] = a[2] * f;
      b[3] = a[3] * f;
      b[4] = a[4] * g;
      b[5] = a[5] * g;
      b[6] = a[6] * g;
      b[7] = a[7] * g;
      b[8] = a[8] * c;
      b[9] = a[9] * c;
      b[10] = a[10] * c;
      b[11] = a[11] * c;
      b[12] = a[12];
      b[13] = a[13];
      b[14] = a[14];
      b[15] = a[15];
    }
    function bH(a) {
      fH(a);
      a.g.viewport(0, 0, a.g.drawingBufferWidth, a.g.drawingBufferHeight);
      a.g.clearColor(0, 0, 0, 1);
      a.g.enable(a.g.CULL_FACE);
      a.g.cullFace(a.g.FRONT);
      a.g.clear(a.g.COLOR_BUFFER_BIT);
    }
    function cH(a) {
      var b = gH(a, a.g.VERTEX_SHADER), c = gH(a, a.g.FRAGMENT_SHADER);
      a.l = a.g.createProgram();
      a.g.attachShader(a.l, b);
      a.g.attachShader(a.l, c);
      a.g.linkProgram(a.l);
      a.m == "cubemap" ? (a.S = a.g.getAttribLocation(a.l, "aVertexPosition"), a.R = a.g.getAttribLocation(a.l, "aTextureCoord")) : (a.S = a.g.getAttribLocation(a.l, "a_vPosition"), a.g.enableVertexAttribArray(a.S), a.R = a.g.getAttribLocation(a.l, "a_TexCoordinate"), a.g.enableVertexAttribArray(a.R));
    }
    function gH(a, b) {
      switch (b) {
        case a.g.VERTEX_SHADER:
          var c = a.m == "cubemap" ? "attribute vec4 aVertexPosition;\nattribute vec2 aTextureCoord;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nvarying highp vec2 vTextureCoord;\nvarying highp vec3 vLighting;\nvoid main(void) {\n  gl_Position = uProjectionMatrix * uModelViewMatrix * aVertexPosition;\n  vTextureCoord = aTextureCoord;\n}" : "attribute vec4 a_vPosition;\n// Per-vertex texture coordinate info\nattribute vec2 a_TexCoordinate;\nuniform mat4 u_VPMatrix;\n// Passed into the fragment shader.\nvarying vec2 v_TexCoordinate;\nvarying vec3 pass_position;\nvoid main()\n{\n gl_Position = u_VPMatrix * a_vPosition;\n // Pass through texture coord\n v_TexCoordinate = a_TexCoordinate;\n pass_position = a_vPosition.xyz;\n}";
          break;
        case a.g.FRAGMENT_SHADER:
          c = a.m == "cubemap" ? "varying highp vec2 vTextureCoord;\nuniform sampler2D uSampler;\nvoid main(void) {\n  highp vec4 texelColor = texture2D(uSampler, vTextureCoord);\n  gl_FragColor = vec4(texelColor.rgb , texelColor.a);\n}" : "precision highp float;\n#define PI 3.141592653589793238462643383279\nvarying vec2 v_TexCoordinate;\nvarying vec3 pass_position;\nuniform sampler2D uSampler;\nvoid main(void) {\nhighp float xValue =\n      (PI + atan(pass_position.z, pass_position.x)) / (2.0 * PI);\n vec2 tc = vec2(xValue, v_TexCoordinate.t);\n tc = vec2(tc.x , tc.y);\nhighp vec4 texelColor =\n      texture2D(uSampler, tc);\n  gl_FragColor = vec4(texelColor.rgb, texelColor.a);\n}";
          break;
        default:
          return null;
      }
      b = a.g.createShader(b);
      a.g.shaderSource(b, c);
      a.g.compileShader(b);
      return b;
    }
    function dH(a) {
      a.L = a.m == "cubemap" ? { dk: [-1, -1, -1, -1, -1, 1, -1, 1, 1, -1, 1, -1, -1, 1, -1, -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, 1, 1, -1, 1, 1, 1, 1, -1, 1, 1, 1, -1, -1, 1, 1, -1, 1, 1, 1, 1, -1, 1, -1, -1, -1, 1, -1, -1, 1, -1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, 1, 1, -1, 1, -1, -1], $j: [2 / 3, 0.5, 1 / 3, 0.5, 1 / 3, 0, 2 / 3, 0, 2 / 3, 0.5, 2 / 3, 0, 1, 0, 1, 0.5, 1, 1, 2 / 3, 1, 2 / 3, 0.5, 1, 0.5, 0, 0.5, 0, 0, 1 / 3, 0, 1 / 3, 0.5, 0, 0.5, 1 / 3, 0.5, 1 / 3, 1, 0, 1, 1 / 3, 1, 1 / 3, 0.5, 2 / 3, 0.5, 2 / 3, 1], indices: [0, 1, 2, 0, 2, 3, 4, 5, 6, 4, 6, 7, 8, 9, 10, 8, 10, 11, 12, 13, 14, 12, 14, 15, 16, 17, 18, 16, 18, 19, 20, 21, 22, 20, 22, 23] } : a.m == "halfequirectangular" ? XG(true) : XG();
      a.aa = a.g.createBuffer();
      a.g.bindBuffer(a.g.ARRAY_BUFFER, a.aa);
      a.g.bufferData(a.g.ARRAY_BUFFER, new Float32Array(a.L.dk), a.g.STATIC_DRAW);
      a.oa = a.g.createBuffer();
      a.g.bindBuffer(a.g.ARRAY_BUFFER, a.oa);
      a.g.bufferData(a.g.ARRAY_BUFFER, new Float32Array(a.L.$j), a.g.STATIC_DRAW);
      a.ea = a.g.createBuffer();
      a.g.bindBuffer(a.g.ELEMENT_ARRAY_BUFFER, a.ea);
      a.g.bufferData(a.g.ELEMENT_ARRAY_BUFFER, new Uint16Array(a.L.indices), a.g.STATIC_DRAW);
    }
    function eH(a) {
      a.$ = a.g.createTexture();
      a.g.bindTexture(a.g.TEXTURE_2D, a.$);
      a.g.texParameteri(a.g.TEXTURE_2D, a.g.TEXTURE_WRAP_S, a.g.CLAMP_TO_EDGE);
      a.g.texParameteri(a.g.TEXTURE_2D, a.g.TEXTURE_WRAP_T, a.g.CLAMP_TO_EDGE);
      a.g.texParameteri(a.g.TEXTURE_2D, a.g.TEXTURE_MIN_FILTER, a.g.NEAREST);
      a.g.texParameteri(a.g.TEXTURE_2D, a.g.TEXTURE_MAG_FILTER, a.g.NEAREST);
    }
    function $G(a, b) {
      b = b === void 0 ? true : b;
      var c = a.sa.m == Xq;
      if (!(!a.i || a.i.readyState < 2 || !c && a.i.playbackRate == 0)) {
        RG(a.J, a.j * Math.PI / 180, 1.5625);
        a.m == "cubemap" ? RG(a.J, a.j * Math.PI / 180, 2.5) : RG(a.J, a.j * Math.PI / 180, 1.5625);
        a.g.useProgram(a.l);
        a.g.clear(a.g.COLOR_BUFFER_BIT);
        fH(a);
        b && (a.g.activeTexture(a.g.TEXTURE0), a.g.bindTexture(a.g.TEXTURE_2D, a.$), a.g.pixelStorei(a.g.UNPACK_PREMULTIPLY_ALPHA_WEBGL, 0), a.g.texImage2D(a.g.TEXTURE_2D, 0, a.g.RGBA, a.g.RGBA, a.g.UNSIGNED_BYTE, a.i));
        if (a.m == "equirectangular" || a.m == "halfequirectangular") SG(a.O, a.F, a.Z), SG(a.O, a.J, a.O);
        a.g.bindBuffer(a.g.ARRAY_BUFFER, a.aa);
        a.g.vertexAttribPointer(a.S, 3, a.g.FLOAT, false, 0, 0);
        a.g.enableVertexAttribArray(a.S);
        a.g.bindBuffer(a.g.ARRAY_BUFFER, a.oa);
        a.g.vertexAttribPointer(a.R, 2, a.g.FLOAT, false, 0, 0);
        a.g.enableVertexAttribArray(a.R);
        a.g.bindBuffer(a.g.ELEMENT_ARRAY_BUFFER, a.ea);
        a.m == "cubemap" ? (a.g.uniformMatrix4fv(a.g.getUniformLocation(a.l, "uProjectionMatrix"), false, a.J), a.g.uniformMatrix4fv(
          a.g.getUniformLocation(a.l, "uModelViewMatrix"),
          false,
          a.O
        )) : a.g.uniformMatrix4fv(a.g.getUniformLocation(a.l, "u_VPMatrix"), false, a.O);
        a.g.uniform1i(a.g.getUniformLocation(a.l, "uSampler"), 0);
        a.P && a.g.viewport(0, 0, a.u.width / 2, a.u.height);
        a.g.drawElements(a.g.TRIANGLES, a.L.indices.length, a.g.UNSIGNED_SHORT, 0);
        a.P && (a.g.viewport(a.u.width / 2, 0, a.u.width / 2, a.u.height), a.g.drawElements(a.g.TRIANGLES, a.L.indices.length, a.g.UNSIGNED_SHORT, 0));
      }
    }
    function fH(a) {
      var b = a.i.videoWidth;
      b || (b = a.u.scrollWidth);
      var c = a.i.videoHeight;
      c || (c = a.u.scrollHeight);
      if (a.va !== b || a.ua !== c) {
        a.u.width = b;
        a.u.height = c;
        a.va = b;
        a.ua = c;
        var d = b / c, e = a.J, f = -d, g = 1 / (d - f);
        e[0] = 0 * g;
        e[1] = 0;
        e[2] = 0;
        e[3] = 0;
        e[4] = 0;
        e[5] = 0;
        e[6] = 0;
        e[7] = 0;
        e[8] = (d + f) * g;
        e[9] = 0;
        e[10] = -1;
        e[11] = -1;
        e[12] = 0;
        e[13] = 0;
        e[14] = -0;
        e[15] = 0;
        a.J = e;
        a.g.viewport(0, 0, b, c);
      }
    }
    function hH(a, b, c, d) {
      var e = Infinity, f = 90 * Math.PI / 180;
      a.m == "halfequirectangular" && (e = 90 * Math.PI / 180, f /= 2);
      var g = a.m == "cubemap" ? a.O : a.F;
      a.H += b;
      a.I += c;
      if (a.H < e && a.H > -e) {
        e = Math.sin(b);
        b = Math.cos(b);
        var h = g[0], k2 = g[1], l = g[2], m = g[3], n = g[8], q = g[9], r = g[10], u = g[11];
        g !== g && (g[4] = g[4], g[5] = g[5], g[6] = g[6], g[7] = g[7], g[12] = g[12], g[13] = g[13], g[14] = g[14], g[15] = g[15]);
        g[0] = h * b - n * e;
        g[1] = k2 * b - q * e;
        g[2] = l * b - r * e;
        g[3] = m * b - u * e;
        g[8] = h * e + n * b;
        g[9] = k2 * e + q * b;
        g[10] = l * e + r * b;
        g[11] = m * e + u * b;
      } else a.H -= b;
      a.I < f && a.I > -f ? (f = QG(), e = QG(), b = -1 * c, c = Math.sin(b), b = Math.cos(b), h = e[4], k2 = e[5], l = e[6], m = e[7], n = e[8], q = e[9], r = e[10], u = e[11], e !== f && (f[0] = e[0], f[1] = e[1], f[2] = e[2], f[3] = e[3], f[12] = e[12], f[13] = e[13], f[14] = e[14], f[15] = e[15]), f[4] = h * b + n * c, f[5] = k2 * b + q * c, f[6] = l * b + r * c, f[7] = m * b + u * c, f[8] = n * b - h * c, f[9] = q * b - k2 * c, f[10] = r * b - l * c, f[11] = u * b - m * c, SG(g, f, g)) : a.I -= c;
      c = QG();
      f = QG();
      e = Math.sin(d);
      d = Math.cos(d);
      b = f[0];
      h = f[1];
      k2 = f[2];
      l = f[3];
      m = f[4];
      n = f[5];
      q = f[6];
      r = f[7];
      f !== c && (c[8] = f[8], c[9] = f[9], c[10] = f[10], c[11] = f[11], c[12] = f[12], c[13] = f[13], c[14] = f[14], c[15] = f[15]);
      c[0] = b * d + m * e;
      c[1] = h * d + n * e;
      c[2] = k2 * d + q * e;
      c[3] = l * d + r * e;
      c[4] = m * d - b * e;
      c[5] = n * d - h * e;
      c[6] = q * d - k2 * e;
      c[7] = r * d - l * e;
      SG(g, c, g);
      $G(a, false);
    }
    function iH(a, b) {
      if (b === void 0 || b) TG(a.h, a.F), a.V = 0, a.D = VG(), a.D[0] = (a.h[0] - a.M[0]) / 20, a.D[1] = (a.h[1] - a.M[1]) / 20, a.D[2] = (a.h[2] - a.M[2]) / 20, a.D[3] = (a.h[3] - a.M[3]) / 20;
      a.h[0] -= a.D[0];
      a.h[1] -= a.D[1];
      a.h[2] -= a.D[2];
      a.h[3] -= a.D[3];
      b = QG();
      WG(a.h, a.h);
      UG(b, a.h);
      a.F = b;
      a.K && (a.K.stop(), a.K = null);
      a.V < 20 ? a.K = new Cf(function() {
        iH(a, false);
        a.H = 0;
        a.I = 0;
        a.V++;
        $G(a, false);
      }).Y(0.025) : (UG(b, a.M), a.F = b);
    }
    ;
    function jH(a, b, c, d, e) {
      lb.call(this);
      var f = this;
      this.i = a;
      this.l = b;
      this.G = c;
      this.K = d;
      this.A = e;
      this.u = new Qc();
      this.h = new Qc();
      this.C = kH(this.l);
      this.g = null;
      this.m = false;
      this.J = this.I = this.H = this.F = this.D = 0;
      this.j = null;
      this.u.o(d, "loading", function() {
        f.g && iH(f.g);
        lH(f);
      });
      this.u.o(d, "spatialvideoinfo", function(g) {
        g = g.detail;
        switch (g.projection) {
          case "rect":
            f.j = null;
            break;
          case "equi":
            f.j = "equirectangular";
            break;
          case "hequ":
            switch (g.hfov) {
              case 360:
                f.j = "equirectangular";
                break;
              case 180:
                f.j = "halfequirectangular";
                break;
              default:
                g.hfov == null ? f.j = "halfequirectangular" : f.j = null;
            }
            break;
          case "fish":
            f.j = "halfequirectangular";
            break;
          default:
            f.j = null;
        }
        lH(f);
      });
      this.u.o(d, "nospatialvideoinfo", function() {
        f.j = null;
        lH(f);
      });
      this.u.o(d, "unloading", function() {
        f.j = null;
        lH(f);
      });
      lH(this);
    }
    ma(jH, lb);
    p = jH.prototype;
    p.release = function() {
      this.u && (this.u.release(), this.u = null);
      this.h && (this.h.release(), this.h = null);
      this.g && (this.g.release(), this.g = null);
      lb.prototype.release.call(this);
    };
    p.configure = function(a) {
      this.A = a;
      lH(this);
    };
    p.Lg = function() {
      return this.l ? !!this.C : !!kH(document.createElement("canvas"));
    };
    p.Wb = function() {
      return !!this.g;
    };
    p.Wd = function() {
      this.g ? this.g.Wd() : bb("Not playing VR content");
    };
    p.Bh = function(a) {
      this.g ? hH(this.g, a * mH, 0, 0) : bb("Not playing VR content");
    };
    p.yh = function(a) {
      this.g ? hH(this.g, 0, a * mH, 0) : bb("Not playing VR content");
    };
    p.Ah = function(a) {
      this.g ? hH(this.g, 0, 0, a * mH) : bb("Not playing VR content");
    };
    function lH(a) {
      if (a.A.displayInVrMode || a.j) {
        a.l || (a.l = document.createElement("canvas"), a.l.classList.add("shaka-vr-canvas-container"), a.G.parentElement.insertBefore(a.l, a.G.nextElementSibling), a.C = kH(a.l));
        var b = a.j || a.A.defaultVrProjectionMode;
        a.g ? a.g.m != b && (a.h.Ta(), a.g.release(), nH(a, b)) : (a.l.style.display = "", nH(a, b), a.dispatchEvent(new T("vrstatuschanged", (/* @__PURE__ */ new Map()).set("newStatus", a.Wb()))));
      } else !a.A.displayInVrMode && !a.j && a.l && a.g && (a.l.style.display = "none", a.h.Ta(), a.g.release(), a.g = null, a.dispatchEvent(new T(
        "vrstatuschanged",
        (/* @__PURE__ */ new Map()).set("newStatus", a.Wb())
      )));
    }
    function nH(a, b) {
      a.C && a.l && (a.g = new YG(a.G, a.K, a.l, a.C, b), oH(a));
    }
    function kH(a) {
      if (!a) return null;
      var b = Sb().Ka();
      if (b == "TV" || b == "CONSOLE" || b == "CAST") return null;
      b = t(["webgl2", "webgl"]);
      for (var c = b.next(); !c.done; c = b.next()) if (c = a.getContext(c.value)) return c;
      return null;
    }
    function oH(a) {
      a.h.o(a.i, "mousedown", function(d) {
        if (!a.m) {
          var e = d.clientX;
          d = d.clientY;
          a.m = true;
          a.D = e;
          a.F = d;
        }
      });
      navigator.maxTouchPoints > 0 && a.h.o(a.i, "touchstart", function(d) {
        if (!a.m) {
          var e = d.touches[0].clientX;
          d = d.touches[0].clientY;
          a.m = true;
          a.D = e;
          a.F = d;
        }
      });
      a.h.o(a.i, "wheel", function(d) {
        if (!a.m) {
          var e = a.g, f = d.deltaY;
          f /= 50;
          e.j >= 20 && e.j <= 100 && (e.j += f);
          e.j < 20 ? e.j = 20 : e.j > 100 && (e.j = 100);
          $G(e, false);
          d.preventDefault();
          d.stopPropagation();
        }
      });
      a.h.o(a.i, "mousemove", function(d) {
        a.m && pH(a, d.clientX, d.clientY);
      });
      navigator.maxTouchPoints > 0 && a.h.o(a.i, "touchmove", function(d) {
        a.m && pH(a, d.touches[0].clientX, d.touches[0].clientY);
        d.preventDefault();
      });
      a.h.o(a.i, "mouseleave", function() {
        a.m = false;
      });
      a.h.o(a.i, "mouseup", function() {
        a.m = false;
      });
      navigator.maxTouchPoints > 0 && a.h.o(a.i, "touchend", function() {
        a.m = false;
      });
      var b = false;
      if (window2.DeviceOrientationEvent) if (typeof DeviceMotionEvent.requestPermission == "function") {
        var c = function() {
          DeviceMotionEvent.requestPermission().then(function(d) {
            d !== "granted" || b || (b = true, qH(a));
          });
        };
        DeviceMotionEvent.requestPermission().then(function(d) {
          a.h.Ea(
            a.i,
            "click",
            c
          );
          a.h.Ea(a.i, "mouseup", c);
          navigator.maxTouchPoints > 0 && a.h.Ea(a.i, "touchend", c);
          d !== "granted" ? (a.h.qa(a.i, "click", c), a.h.qa(a.i, "mouseup", c), navigator.maxTouchPoints > 0 && a.h.qa(a.i, "touchend", c)) : (b = true, qH(a));
        }).catch(function() {
          a.h.Ea(a.i, "click", c);
          a.h.Ea(a.i, "mouseup", c);
          navigator.maxTouchPoints > 0 && a.h.Ea(a.i, "touchend", c);
          a.h.qa(a.i, "click", c);
          a.h.qa(a.i, "mouseup", c);
          navigator.maxTouchPoints > 0 && a.h.qa(a.i, "touchend", c);
        });
      } else b = true, qH(a);
    }
    function qH(a) {
      a.h.o(window2, "deviceorientation", function(b) {
        if (a.g) {
          var c = (b.alpha || 0) - a.H, d = (b.beta || 0) - a.I, e = (b.gamma || 0) - a.J;
          if (Math.abs(c) > 10 || Math.abs(d) > 10 || Math.abs(e) > 5) d = e = c = 0;
          a.H = b.alpha || 0;
          a.I = b.beta || 0;
          a.J = b.gamma || 0;
          b = screen.orientation.angle;
          b == 90 || b == -90 ? hH(a.g, c * mH * -1, e * mH * -1, 0) : hH(a.g, c * mH * -1, d * mH, 0);
        }
      });
    }
    function pH(a, b, c) {
      var d = -0.6 * Math.PI / 180;
      hH(a.g, (b - a.D) * d, (c - a.F) * -1 * d, 0);
      a.D = b;
      a.F = c;
    }
    var mH = Math.PI / 180;
    function Z(a, b, c, d, e) {
      lb.call(this);
      var f = this;
      this.Z = true;
      this.g = e;
      this.F = new rt(c, a, this.g.castReceiverAppId, this.g.castAndroidReceiverCompatible);
      this.sa = true;
      this.C = this.F.Pc();
      this.m = c;
      this.u = this.F.Vb();
      this.$ = a;
      this.l = b;
      this.Ob = d;
      this.oa = this.u.rf();
      this.A = this.j = null;
      this.S = false;
      this.J = [];
      this.Va = [];
      this.Oa = false;
      this.K = new Cf(function() {
        f.l.classList.add("no-cursor");
        f.Oa = false;
        rH(f);
      });
      this.aa = new Cf(function() {
        f.i.removeAttribute("shown");
        sH(f);
        tH(f);
        f.V && f.V.Oi();
        f.O.Y(f.g.closeMenusDelay);
      });
      this.O = new Cf(function() {
        for (var g = t(f.J), h = g.next(); !h.done; h = g.next()) kG(h.value, false);
        f.g.enableTooltips && f.G.classList.add("shaka-tooltips-on");
      });
      this.va = new Cf(function() {
        f.Ca() && uH(f);
      });
      this.P = null;
      this.I = [];
      this.ua = vH();
      this.h = new Qc();
      this.D = null;
      this.configure(this.g);
      wH(this);
      xH(this);
      this.ea = /* @__PURE__ */ new Set();
      yH(this);
      this.va.za(this.g.refreshTickInSeconds);
      this.h.o(this.ua, "locale-changed", function(g) {
        g = g.locales[0];
        f.oa.setLocale(g);
        f.l.setAttribute("lang", g);
      });
      this.oa.initInterstitial(this.H, this.$, this.m);
      this.h.o(this.u, "texttrackvisibility", function() {
        tH(f);
      });
      this.h.o(this.u, "unloading", function() {
        f.j || (f.wc() && zH(f), f.Id() && f.Vc());
      });
    }
    ma(Z, lb);
    p = Z.prototype;
    p.destroy = function(a) {
      a = a === void 0 ? false : a;
      var b = this;
      return P(function(c) {
        switch (c.g) {
          case 1:
            if (document.pictureInPictureElement != b.m) {
              c.B(2);
              break;
            }
            return G(c, document.exitPictureInPicture(), 2);
          case 2:
            b.h && (b.h.release(), b.h = null);
            b.K && (b.K.stop(), b.K = null);
            b.aa && (b.aa.stop(), b.aa = null);
            b.O && (b.O.stop(), b.O = null);
            b.va && (b.va.stop(), b.va = null);
            b.D && (b.D.release(), b.D = null);
            AH(b);
            b.i && (b.l.removeChild(b.i), b.i = null);
            if (!b.F) {
              c.B(4);
              break;
            }
            return G(c, b.F.destroy(a), 5);
          case 5:
            b.F = null;
          case 4:
            b.L && (b.l.removeChild(b.L), b.L = null);
            b.H && (b.l.removeChild(b.H), b.H = null);
            if (!b.$) {
              c.B(6);
              break;
            }
            return G(c, b.$.destroy(), 7);
          case 7:
            b.$ = null;
          case 6:
            b.u = null, b.m = null, b.C = null, b.ua = null, b.ea.clear(), BH(b), lb.prototype.release.call(b), H(c);
        }
      });
    };
    function AH(a) {
      for (var b = t(a.I), c = b.next(); !c.done; c = b.next()) c.value.release();
      a.I = [];
    }
    function CH(a, b) {
      DH.set(a, b);
    }
    p.jk = function(a) {
      this.sa = a;
      yH(this);
    };
    p.Kl = function() {
      rH(this);
    };
    p.configure = function(a) {
      var b = this;
      this.g = a;
      this.F.Mi(a.castReceiverAppId, a.castAndroidReceiverCompatible);
      this.A && (this.A = null);
      this.Ma && (this.Ma = null);
      this.V && (this.V = null);
      this.D && this.D.configure(a);
      this.i ? (Sj(this.i), AH(this)) : (EH(this), FH(this), this.D = new jH(this.i, this.Ob, this.m, this.u, this.g));
      this.l.classList.add("shaka-video-container");
      this.m.classList.add("shaka-video");
      GH(this);
      this.g.addBigPlayButton && HH(this);
      this.g.customContextMenu && (this.V = new nG(this.G, this), this.I.push(this.V));
      this.L || IH(this);
      this.g.seekOnTaps && (JH(this), KH(this));
      this.Ia = W("div");
      this.Ia.classList.add("shaka-server-side-ad-container");
      this.i.appendChild(this.Ia);
      LH(this);
      this.J = Array.from(this.l.getElementsByClassName("shaka-settings-menu"));
      this.J.push.apply(this.J, x(Array.from(this.l.getElementsByClassName("shaka-overflow-menu"))));
      this.Va = Array.from(this.l.getElementsByClassName("shaka-show-controls-on-mouse-over"));
      rH(this);
      a = t(this.l.getElementsByClassName("shaka-no-propagation"));
      for (var c = a.next(); !c.done; c = a.next()) {
        c = c.value;
        var d = function(e) {
          return e.stopPropagation();
        };
        this.h.o(c, "click", d);
        this.h.o(c, "dblclick", d);
        navigator.maxTouchPoints > 0 && this.h.o(c, "touchend", function(e) {
          b.Ca() && e.stopPropagation();
        });
      }
    };
    p.di = function(a) {
      (this.Z = a) ? (this.l.setAttribute("shaka-controls", "true"), this.m.tabIndex = -1, this.m.controls = false) : this.l.removeAttribute("shaka-controls");
      rH(this);
    };
    p.Lj = function(a) {
      this.m.controls = a;
      this.m.tabIndex = a ? 0 : -1;
      a && this.di(false);
    };
    p.getAd = function() {
      return this.j;
    };
    p.Ck = function() {
      return this.F;
    };
    p.Uk = function() {
      return this.ua;
    };
    p.wl = function() {
      return this.l;
    };
    p.Pc = function() {
      return this.C;
    };
    p.Tk = function() {
      return this.m;
    };
    p.Vb = function() {
      return this.u;
    };
    p.Sk = function() {
      return this.$;
    };
    p.Jk = function() {
      return this.i;
    };
    p.il = function() {
      return this.Ia;
    };
    p.Fk = function() {
      return this.H;
    };
    p.Gk = function() {
      return this.g;
    };
    p.Hl = function() {
      return this.S;
    };
    p.ii = function(a) {
      (this.S = a) ? this.K.stop() : this.K.Y(3);
    };
    p.Bl = function() {
      return this.sa;
    };
    p.oh = function() {
      return this.A ? this.A.getValue() : this.C.currentTime;
    };
    p.Mj = function(a) {
      this.P = a;
    };
    p.Hc = function() {
      return this.J.some(function(a) {
        return !a.classList.contains("shaka-hidden");
      });
    };
    p.Rc = function() {
      this.O.La();
    };
    function MH(a) {
      return !document.fullscreenEnabled || a.m.webkitSupportsFullscreen && a.g.preferVideoFullScreenInVisionOS && Sb().Ka() == "APPLE_VR" ? false : true;
    }
    function NH(a) {
      return "documentPictureInPicture" in window2 && a.g.preferDocumentPictureInPicture;
    }
    p.se = function() {
      return this.F.Qa() ? false : MH(this) || (!this.j || !this.j.isUsingAnotherMediaElement()) && this.m.webkitSupportsFullscreen ? true : false;
    };
    p.wc = function() {
      if (MH(this)) return !!document.fullscreenElement;
      var a = this.m;
      return a.webkitSupportsFullscreen ? a.webkitDisplayingFullscreen : false;
    };
    function OH(a) {
      var b, c, d;
      return P(function(e) {
        switch (e.g) {
          case 1:
            sa(e, 2);
            if (!MH(a)) {
              b = a.m;
              b.webkitSupportsFullscreen && b.webkitEnterFullscreen();
              e.B(4);
              break;
            }
            if (!a.Id()) {
              e.B(5);
              break;
            }
            return G(e, a.Vc(), 6);
          case 6:
            if (!NH(a)) {
              e.B(5);
              break;
            }
            return G(e, new Promise(function(f) {
              new Cf(f).Y(0.05);
            }), 5);
          case 5:
            return c = a.g.fullScreenElement, G(e, c.requestFullscreen({ navigationUI: "hide" }), 9);
          case 9:
            if (!a.g.forceLandscapeOnFullscreen || !screen.orientation) {
              e.B(4);
              break;
            }
            sa(e, 11);
            return G(
              e,
              screen.orientation.lock("landscape"),
              13
            );
          case 13:
            ua(e, 4, 2);
            break;
          case 11:
            va(e, 2);
          case 4:
            ua(e, 0);
            break;
          case 2:
            d = va(e), a.dispatchEvent(new T("error", (/* @__PURE__ */ new Map()).set("detail", d))), H(e);
        }
      });
    }
    function zH(a) {
      var b;
      return P(function(c) {
        if (!MH(a)) return b = a.m, b.webkitSupportsFullscreen && b.webkitExitFullscreen(), c.B(0);
        screen.orientation && screen.orientation.unlock();
        return G(c, document.exitFullscreen(), 0);
      });
    }
    p.ng = function() {
      var a = this;
      return P(function(b) {
        return a.wc() ? G(b, zH(a), 0) : G(b, OH(a), 0);
      });
    };
    p.Df = function() {
      return this.F.Qa() ? false : document.pictureInPictureEnabled || NH(this) ? !this.m.disablePictureInPicture : false;
    };
    p.Id = function() {
      return !!(window2.documentPictureInPicture && window2.documentPictureInPicture.window || document.pictureInPictureElement);
    };
    p.Vc = function() {
      var a = this, b, c;
      return P(function(d) {
        switch (d.g) {
          case 1:
            sa(d, 2);
            if (NH(a)) {
              if (!a.wc()) {
                d.B(10);
                break;
              }
              return G(d, zH(a), 10);
            }
            return document.pictureInPictureElement ? G(d, document.exitPictureInPicture(), 5) : (a.wc() && zH(a), b = a.m, G(d, b.requestPictureInPicture(), 5));
          case 10:
            return G(d, PH(a), 5);
          case 5:
            ua(d, 0);
            break;
          case 2:
            c = va(d), a.dispatchEvent(new T("error", (/* @__PURE__ */ new Map()).set("detail", c))), H(d);
        }
      });
    };
    function PH(a) {
      var b, c, d, e, f, g;
      return P(function(h) {
        if (h.g == 1) {
          if (window2.documentPictureInPicture.window) return window2.documentPictureInPicture.window.close(), h.return();
          b = a.l;
          c = b.getBoundingClientRect();
          return G(h, window2.documentPictureInPicture.requestWindow({ width: c.width, height: c.height }), 2);
        }
        d = h.h;
        QH(d);
        e = b.parentNode || document.body;
        f = a.l.cloneNode(true);
        f.style.visibility = "hidden";
        f.style.height = getComputedStyle(b).height;
        e.appendChild(f);
        g = document.createElement("style");
        g.append("[data-shaka-player-container] {\n      width: 100% !important; max-height: 100%}");
        d.document.head.append(g);
        d.document.body.append(b);
        a.h.qa(d, "pagehide", function() {
          f.replaceWith(b);
        });
        H(h);
      });
    }
    function QH(a) {
      var b = [].concat(x(document.styleSheets)).map(function(d) {
        try {
          return [].concat(x(d.cssRules)).map(function(f) {
            return f.cssText;
          }).join("");
        } catch (f) {
          var e = document.createElement("link");
          e.rel = "stylesheet";
          e.type = d.type;
          e.media = d.media;
          e.href = d.href;
          a.document.head.appendChild(e);
        }
        return "";
      }).filter(Boolean).join("\n"), c = document.createElement("style");
      c.textContent = b;
      a.document.head.appendChild(c);
    }
    p.Rj = function() {
      kG(this.R, true);
      kG(this.H, true);
      this.j.hasCustomClick() ? this.i.setAttribute("ad-active", "true") : this.i.removeAttribute("ad-active");
    };
    p.aj = function() {
      kG(this.R, false);
      kG(this.H, false);
      this.i.removeAttribute("ad-active");
    };
    function tG(a) {
      if (a.Z) {
        if (a.j && (a.j && a.j.isPaused() ? a.j.play() : a.j && a.j.pause(), a.j.isLinear())) return;
        a.C.duration && (a.C.paused && !a.S ? (a.u.isEnded() && (a.C.currentTime = a.u.ya().start), a.C.play()) : a.C.pause());
      }
    }
    function EH(a) {
      a.i = W("div");
      a.i.classList.add("shaka-controls-container");
      a.l.appendChild(a.i);
      a.l.setAttribute("shaka-controls", "true");
      a.h.o(a.i, "touchend", function(b) {
        a.C.duration && (a.Ca() ? (a.P = Date.now(), wG(a, true)) : RH(a, b), b.cancelable && b.preventDefault());
      });
      a.h.o(a.i, "click", function() {
        wG(a);
      });
      a.h.o(a.i, "dblclick", function() {
        a.g.doubleClickForFullscreen && a.se() && a.ng();
      });
    }
    function HH(a) {
      var b = W("div");
      b.classList.add("shaka-play-button-container");
      a.i.appendChild(b);
      a.Ma = new uG(b, a);
      a.I.push(a.Ma);
    }
    function GH(a) {
      var b = W("div");
      b.classList.add("shaka-scrim-container");
      a.i.appendChild(b);
    }
    function SH(a) {
      a.R = W("div");
      a.R.classList.add("shaka-ad-controls");
      var b = a.j != null && a.j.isLinear();
      kG(a.R, b);
      a.M.appendChild(a.R);
      b = new MG(a.R, a);
      a.I.push(b);
    }
    function IH(a) {
      a.L = W("div");
      a.L.classList.add("shaka-spinner-container");
      a.l.appendChild(a.L);
      var b = W("div");
      b.classList.add("shaka-spinner");
      a.L.appendChild(b);
      b.insertAdjacentHTML("beforeend", '<svg focusable="false" stroke="currentColor"\n         viewBox="0 0 38 38" xmlns="http://www.w3.org/2000/svg"\n         width="50px" height="50px" class="q-spinner text-grey-9">\n      <g transform="translate(1 1)" stroke-width="6" fill="none"\n        fill-rule="evenodd">\n        <circle stroke-opacity=".5" cx="18" cy="18" r="16"></circle>\n        <path d="M34 18c0-9.94-8.06-16-16-16">\n          <animateTransform attributeName="transform" type="rotate"\n            from="0 18 18" to="360 18 18" dur="1s" repeatCount="indefinite">\n          </animateTransform>\n        </path>\n      </g>\n    </svg>');
    }
    function JH(a) {
      var b = W("div");
      b.classList.add("shaka-hidden-fast-forward-container");
      a.i.appendChild(b);
      a.Za = new xG(b, a);
      a.I.push(a.Za);
    }
    function KH(a) {
      var b = W("div");
      b.classList.add("shaka-hidden-rewind-container");
      a.i.appendChild(b);
      a.fb = new yG(b, a);
      a.I.push(a.fb);
    }
    function LH(a) {
      a.M = W("div");
      a.M.classList.add("shaka-bottom-controls");
      a.M.classList.add("shaka-no-propagation");
      a.i.appendChild(a.M);
      a.h.o(a.M, "click", function(e) {
        e.target.closest(".shaka-overflow-button") || a.Rc();
      });
      SH(a);
      TH(a);
      a.G = W("div");
      a.G.classList.add("shaka-controls-button-panel");
      a.G.classList.add("shaka-show-controls-on-mouse-over");
      a.g.enableTooltips && a.G.classList.add("shaka-tooltips-on");
      a.M.appendChild(a.G);
      for (var b = t(a.g.controlPanelElements), c = b.next(); !c.done; c = b.next()) if (c = c.value, DH.get(c)) {
        var d = DH.get(c).create(a.G, a);
        a.I.push(d);
        c == "time_and_duration" && (c = new mG(a.G, a), a.I.push(c));
      } else bb("Unrecognized control panel element requested:", c);
    }
    function TH(a) {
      if (a.g.addSeekBar) a.A = UH.create(a.M, a), a.I.push(a.A);
      else {
        for (var b = t(a.J), c = b.next(); !c.done; c = b.next()) c.value.classList.add("shaka-low-position");
        a = a.G;
        a.classList.contains("shaka-tooltips-on") && a.classList.add("shaka-tooltips-low-position");
      }
    }
    function FH(a) {
      a.H = W("div");
      a.H.classList.add("shaka-client-side-ad-container");
      kG(a.H, false);
      a.h.o(a.H, "click", function() {
        wG(a);
      });
      a.l.appendChild(a.H);
    }
    function wH(a) {
      a.h.o(a.u, "buffering", function() {
        VH(a);
      });
      VH(a);
      a.h.o(window2, "keydown", function(b) {
        WH(a, b);
      });
      a.h.o(window2, "click", function() {
        return a.Rc();
      });
      a.h.o(a, "submenuopen", function() {
        a.Rc();
      });
      a.h.o(a.C, "play", function() {
        rH(a);
      });
      a.h.o(a.C, "pause", function() {
        rH(a);
      });
      a.h.o(a.l, "mousemove", function(b) {
        RH(a, b);
      });
      a.h.o(a.l, "touchmove", function(b) {
        RH(a, b);
      }, { passive: true });
      a.h.o(a.l, "touchend", function(b) {
        RH(a, b);
      }, { passive: true });
      a.h.o(a.l, "mouseleave", function() {
        a.P || a.K.La();
      });
      a.h.o(a.l, "wheel", function(b) {
        RH(
          a,
          b
        );
      }, { passive: true });
      a.h.o(a.F, "caststatuschanged", function() {
        yH(a);
      });
      a.h.o(a.D, "vrstatuschanged", function() {
        a.dispatchEvent(new T("vrstatuschanged"));
      });
      a.h.o(a.l, "keydown", function(b) {
        var c = document.activeElement, d = c && c.classList ? c.classList.contains("shaka-volume-bar") : false, e = c && c.classList && c.classList.contains("shaka-seek-bar");
        a.i.contains(c) && RH(a, b);
        if (a.g.enableKeyboardPlaybackControls && a.u.ed()) {
          c = a.g.keyboardSeekDistance;
          var f = a.g.keyboardLargeSeekDistance;
          switch (b.key) {
            case "ArrowLeft":
              a.A && e && !d && c > 0 && (b.preventDefault(), XH(a, a.A.getValue() - c));
              break;
            case "ArrowRight":
              a.A && e && !d && c > 0 && (b.preventDefault(), XH(a, a.A.getValue() + c));
              break;
            case "PageDown":
              a.A && e && f > 0 && (b.preventDefault(), XH(a, a.A.getValue() - f));
              break;
            case "PageUp":
              a.A && e && f > 0 && (b.preventDefault(), XH(a, a.A.getValue() + f));
              break;
            case "Home":
              a.A && XH(a, a.u.ya().start);
              break;
            case "End":
              a.A && XH(a, a.u.ya().end);
              break;
            case "f":
              a.se() && a.ng();
              break;
            case "m":
              a.j && a.j.isLinear() ? a.j.setMuted(!a.j.isMuted()) : a.m.muted = !a.m.muted;
              break;
            case "p":
              a.Df() && a.Vc();
              break;
            case " ":
              e && tG(a);
          }
        }
      });
      a.h.o(a.l, "keyup", function(b) {
        a.ea.delete(b.key);
      });
      a.h.o(a.oa, "ad-started", function(b) {
        a.j = b.ad;
        a.Rj();
        VH(a);
      });
      a.h.o(a.oa, "ad-stopped", function() {
        a.j = null;
        a.aj();
        VH(a);
      });
      screen.orientation && a.h.o(screen.orientation, "change", function() {
        return P(function(b) {
          return G(b, YH(a), 0);
        });
      });
    }
    function xH(a) {
      if (a.g.setupMediaSession && navigator.mediaSession) {
        var b = function(f, g) {
          try {
            navigator.mediaSession.setActionHandler(f, function(h) {
              g(h);
            });
          } catch (h) {
          }
        }, c = function() {
          if (a.j && a.j.isLinear()) d();
          else {
            var f = a.u.ya(), g = f.end - f.start;
            f = parseFloat((a.C.currentTime - f.start).toFixed(2));
            a.u.U() && Math.abs(g - f) < 1 && (g = Infinity);
            try {
              navigator.mediaSession.setPositionState({ duration: Math.max(0, g), playbackRate: a.C.playbackRate, position: Math.max(0, f) });
            } catch (h) {
            }
          }
        }, d = function() {
          try {
            navigator.mediaSession.setPositionState();
          } catch (f) {
          }
        }, e = function(f) {
          var g = a.g.keyboardSeekDistance;
          switch (f.action) {
            case "pause":
              tG(a);
              break;
            case "play":
              tG(a);
              break;
            case "seekbackward":
              if (f.seekOffset && !isFinite(f.seekOffset)) break;
              a.j && a.j.isLinear() || XH(a, a.A.getValue() - (f.seekOffset || g));
              break;
            case "seekforward":
              if (f.seekOffset && !isFinite(f.seekOffset)) break;
              a.j && a.j.isLinear() || XH(a, a.A.getValue() + (f.seekOffset || g));
              break;
            case "seekto":
              if (f.seekTime && !isFinite(f.seekTime)) break;
              a.j && a.j.isLinear() || XH(a, a.u.ya().start + f.seekTime);
              break;
            case "stop":
              a.u.rc();
              break;
            case "enterpictureinpicture":
              a.j && a.j.isLinear() || a.Vc();
          }
        };
        b("pause", e);
        b("play", e);
        b("seekbackward", e);
        b("seekforward", e);
        b("seekto", e);
        b("stop", e);
        ("documentPictureInPicture" in window2 || document.pictureInPictureEnabled) && b("enterpictureinpicture", e);
        b = function() {
          a.u.U() || a.u.ya().start != 0 ? (c(), a.h.o(a.C, "timeupdate", c)) : d();
        };
        a.u.aa && b();
        a.h.o(a.u, "loaded", b);
        a.h.o(a.u, "unloading", function() {
          a.h.Ea(a.C, "timeupdate", c);
        });
        a.h.o(a.u, "metadata", function(f) {
          if (f = f.payload) {
            var g;
            f.key == "TIT2" && f.data && (g = f.data);
            var h;
            f.key == "APIC" && f.mimeType == "-->" && (h = f.data);
            g && (f = { title: g, artwork: [] }, navigator.mediaSession.metadata && (f = navigator.mediaSession.metadata, f.title = g), navigator.mediaSession.metadata = new MediaMetadata(f));
            h && (g = a.m, h != g.poster && (g.poster = h), g = { title: "", artwork: [{ src: h }] }, navigator.mediaSession.metadata && (g = navigator.mediaSession.metadata, g.artwork = [{ src: h }]), navigator.mediaSession.metadata = new MediaMetadata(g));
          }
        });
      }
    }
    function BH(a) {
      if (a.g.setupMediaSession && navigator.mediaSession) {
        try {
          navigator.mediaSession.setPositionState();
        } catch (b) {
        }
        a = function(b) {
          try {
            navigator.mediaSession.setActionHandler(b, null);
          } catch (c) {
          }
        };
        a("pause");
        a("play");
        a("seekbackward");
        a("seekforward");
        a("seekto");
        a("stop");
        a("enterpictureinpicture");
      }
    }
    function YH(a) {
      return P(function(b) {
        return a.C && a.C.readyState != 0 && !a.F.Qa() && a.g.enableFullscreenOnRotation && a.se() ? screen.orientation.type.includes("landscape") && !a.wc() ? G(b, OH(a), 0) : screen.orientation.type.includes("portrait") && a.wc() ? G(b, zH(a), 0) : b.B(0) : b.return();
      });
    }
    function RH(a, b) {
      b.type == "mousemove" && (a.i.classList.remove("shaka-keyboard-navigation"), rH(a));
      b.type == "touchstart" || b.type == "touchmove" || b.type == "touchend" || b.type == "keyup" ? a.P = Date.now() : a.P + 1e3 < Date.now() && (a.P = null);
      a.P && b.type == "mousemove" || (a.l.classList.remove("no-cursor"), a.Oa = true, a.O.stop(), a.Ca() || (uH(a), rH(a)), a.K.stop(), b.type != "touchend" && b.type != "wheel" && b.type != "keyup" && a.P || a.K.Y(3));
    }
    function ZH(a) {
      return window2.matchMedia("hover: hover").matches ? a.Va.some(function(b) {
        return b.matches(":hover");
      }) : false;
    }
    function tH(a) {
      var b = a.l.getElementsByClassName("shaka-text-container")[0];
      b && (a.Ca() ? b.style.bottom = a.M.clientHeight + "px" : b.style.bottom = "0px");
    }
    function rH(a) {
      var b = a.j ? a.j.isPaused() : false, c = a.C.paused && !a.S, d = a.i.classList.contains("shaka-keyboard-navigation");
      b || (!a.j || !a.j.isLinear()) && c || a.Oa || d || ZH(a) ? (uH(a), a.i.getAttribute("shown") == null && (a.i.setAttribute("shown", "true"), sH(a)), tH(a), a.aa.stop()) : a.aa.Y(a.g.fadeDelay);
      a.Hc() && a.G.classList.remove("shaka-tooltips-on");
    }
    function wG(a, b) {
      b = b === void 0 ? false : b;
      a.Z && !a.Wb() && (a.Hc() ? a.O.La() : a.g.singleClickForPlayAndPause ? tG(a) : b && a.Ca() && a.bj());
    }
    function yH(a) {
      var b = a.F.Qa();
      a.dispatchEvent(new T("caststatuschanged", (/* @__PURE__ */ new Map()).set("newStatus", b)));
      b ? a.i.getAttribute("casting") == null && (a.i.setAttribute("casting", "true"), sH(a)) : a.i.getAttribute("casting") != null && (a.i.removeAttribute("casting"), sH(a));
    }
    function VH(a) {
      a.Z && (a.j && a.j.isClientRendering() && a.j.isLinear() ? kG(a.L, false) : kG(a.L, a.u.Bf()));
    }
    p.Ca = function() {
      return this.Z ? this.i.getAttribute("shown") != null || this.i.getAttribute("casting") != null : false;
    };
    function sH(a) {
      a.Ca() ? a.dispatchEvent(new T("showingui")) : a.dispatchEvent(new T("hidingui"));
    }
    function XH(a, b) {
      a.C.currentTime = b;
      uH(a);
    }
    function uH(a) {
      if (a.A) if (a.A.setValue(a.C.currentTime), a.A.update(), a.A.isShowing()) {
        for (var b = t(a.J), c = b.next(); !c.done; c = b.next()) c.value.classList.remove("shaka-low-position");
        b = a.G;
        b.classList.contains("shaka-tooltips-on") && b.classList.remove("shaka-tooltips-low-position");
      } else {
        b = t(a.J);
        for (c = b.next(); !c.done; c = b.next()) c.value.classList.add("shaka-low-position");
        b = a.G;
        b.classList.contains("shaka-tooltips-on") && b.classList.add("shaka-tooltips-low-position");
      }
      a.dispatchEvent(new T("timeandseekrangeupdated"));
    }
    function WH(a, b) {
      a.ea.add(b.key);
      var c = a.Hc();
      b.key == "Tab" && (a.i.classList.add("shaka-keyboard-navigation"), rH(a), a.h.o(window2, "mousedown", function() {
        a.h.Ea(window2, "mousedown");
      }));
      b.key == "Escape" && a.O.La();
      c && a.ea.has("Tab") && $H(a, b);
    }
    function $H(a, b) {
      var c = a.J.filter(function(f) {
        return !f.classList.contains("shaka-hidden");
      });
      if (c.length) {
        var d = c[0];
        if (d.childNodes.length) {
          for (c = d.firstElementChild; c && c.classList.contains("shaka-hidden"); ) c = c.nextElementSibling;
          for (d = d.lastElementChild; d && d.classList.contains("shaka-hidden"); ) d = d.previousElementSibling;
          var e = document.activeElement;
          a.ea.has("Shift") ? e == c && (b.preventDefault(), d.focus()) : e == d && (b.preventDefault(), c.focus());
        }
      }
    }
    p.wm = function() {
      var a = new Event("mousemove", { bubbles: false, cancelable: false });
      RH(this, a);
    };
    p.bj = function() {
      this.K.La();
    };
    p.Lg = function() {
      return this.D.Lg();
    };
    p.Wb = function() {
      return this.D.Wb();
    };
    p.ul = function() {
      var a = this.D;
      if (a.g) {
        a = a.g;
        TG(a.h, a.F);
        var b = a.h;
        a = b[0];
        var c = b[1], d = b[2];
        b = b[3];
        var e = d * d, f = b * b;
        var g = a * a + c * c + e + f;
        var h = a * b - c * d;
        h > 0.499995 * g ? (g = Math.PI / 2, a = 2 * Math.atan2(c, a)) : h < -0.499995 * g ? (g = -Math.PI / 2, a = 2 * Math.atan2(c, a)) : (g = Math.asin(2 * (a * d - b * c)), a = Math.atan2(2 * (a * b + c * d), 1 - 2 * (e + f)));
        a = Math.acos(Math.cos(a) * Math.cos(g)) * 180 / Math.PI;
      } else bb("Not playing VR content"), a = null;
      return a;
    };
    p.rl = function() {
      var a = this.D;
      a.g ? a = a.g.j : (bb("Not playing VR content"), a = null);
      return a;
    };
    p.vm = function(a) {
      var b = this.D;
      b.g ? (a < 0 ? (bb("Field of view should be greater than 0"), a = 0) : a > 100 && (bb("Field of view should be less than 100"), a = 100), b = b.g, b.j = a, $G(b, false)) : bb("Not playing VR content");
    };
    p.Wd = function() {
      this.D.Wd();
    };
    p.Bh = function(a) {
      this.D.Bh(a);
    };
    p.yh = function(a) {
      this.D.yh(a);
    };
    p.Ah = function(a) {
      this.D.Ah(a);
    };
    function vH() {
      var a = new Ic("en");
      a.Wa("ar", /* @__PURE__ */ new Map([
        ["AD_DURATION", "\u0645\u062F\u0629 \u0627\u0644\u0625\u0639\u0644\u0627\u0646"],
        ["AD_PROGRESS", "\u0627\u0644\u0625\u0639\u0644\u0627\u0646 [AD_ON] \u0645\u0646 [NUM_ADS]"],
        ["AD_STATISTICS", "\u0625\u062D\u0635\u0627\u0621\u0627\u062A \u0627\u0644\u0625\u0639\u0644\u0627\u0646\u0627\u062A"],
        ["AD_TIME", "\u0627\u0644\u0625\u0639\u0644\u0627\u0646: [AD_TIME]"],
        ["AIRPLAY", "AirPlay"],
        ["AUTO_QUALITY", "\u062A\u0644\u0642\u0627\u0626\u064A"],
        ["BACK", "\u0631\u062C\u0648\u0639"],
        ["CAPTIONS", "\u0627\u0644\u062A\u0631\u062C\u0645\u0629 \u0648\u0627\u0644\u0634\u0631\u062D"],
        ["CAST", "\u0625\u0631\u0633\u0627\u0644..."],
        ["CHAPTERS", "\u0627\u0644\u0641\u0635\u0648\u0644"],
        ["DOWNLOAD_VIDEO_FRAME", "\u062D\u0641\u0638 \u0625\u0637\u0627\u0631 \u0627\u0644\u0641\u064A\u062F\u064A\u0648"],
        ["ENTER_LOOP_MODE", "\u062A\u0643\u0631\u0627\u0631 \u0627\u0644\u0641\u064A\u062F\u064A\u0648 \u0627\u0644\u062D\u0627\u0644\u064A"],
        ["ENTER_PICTURE_IN_PICTURE", '\u0627\u0644\u062F\u062E\u0648\u0644 \u0641\u064A \u0648\u0636\u0639 "\u0646\u0627\u0641\u0630\u0629 \u0636\u0645\u0646 \u0646\u0627\u0641\u0630\u0629"'],
        ["EXIT_FULL_SCREEN", "\u0625\u0646\u0647\u0627\u0621 \u0648\u0636\u0639 \u0645\u0644\u0621 \u0627\u0644\u0634\u0627\u0634\u0629"],
        ["EXIT_LOOP_MODE", "\u0625\u064A\u0642\u0627\u0641 \u062A\u0643\u0631\u0627\u0631 \u0627\u0644\u0641\u064A\u062F\u064A\u0648 \u0627\u0644\u062D\u0627\u0644\u064A"],
        ["EXIT_PICTURE_IN_PICTURE", '\u0627\u0644\u062E\u0631\u0648\u062C \u0645\u0646 \u0648\u0636\u0639 "\u0646\u0627\u0641\u0630\u0629 \u0636\u0645\u0646 \u0646\u0627\u0641\u0630\u0629"'],
        ["FAST_FORWARD", "\u062A\u0642\u062F\u064A\u0645 \u0633\u0631\u064A\u0639"],
        ["FULL_SCREEN", "\u0645\u0644\u0621 \u0627\u0644\u0634\u0627\u0634\u0629"],
        ["LANGUAGE", "\u0627\u0644\u0644\u063A\u0629"],
        ["LIVE", "\u0645\u0628\u0627\u0634\u0631"],
        ["LOOP", "\u062A\u0643\u0631\u0627\u0631"],
        ["MORE_SETTINGS", "\u0645\u0632\u064A\u062F \u0645\u0646 \u0627\u0644\u0625\u0639\u062F\u0627\u062F\u0627\u062A"],
        ["MULTIPLE_LANGUAGES", "\u0644\u063A\u0627\u062A \u0645\u062A\u0639\u062F\u062F\u0629"],
        ["MUTE", "\u0643\u062A\u0645 \u0627\u0644\u0635\u0648\u062A"],
        ["NOT_APPLICABLE", "\u063A\u064A\u0631 \u0633\u0627\u0631\u064D"],
        ["OFF", "\u0625\u064A\u0642\u0627\u0641"],
        ["ON", "\u062A\u0634\u063A\u064A\u0644"],
        ["PAUSE", "\u0625\u064A\u0642\u0627\u0641 \u0645\u0624\u0642\u062A"],
        ["PICTURE_IN_PICTURE", "\u0646\u0627\u0641\u0630\u0629 \u0636\u0645\u0646 \u0627\u0644\u0646\u0627\u0641\u0630\u0629"],
        ["PLAY", "\u0627\u0644\u062A\u0634\u063A\u064A\u0644"],
        ["PLAYBACK_RATE", "\u0633\u0631\u0639\u0629 \u0627\u0644\u062A\u0634\u063A\u064A\u0644"],
        ["QUALITY", "\u0627\u0644\u062C\u0648\u062F\u0629"],
        ["RECENTER_VR", "\u0625\u0639\u0627\u062F\u0629 \u0627\u0644\u062A\u0648\u0633\u064A\u0637"],
        ["REPLAY", "\u0625\u0639\u0627\u062F\u0629 \u0627\u0644\u062A\u0634\u063A\u064A\u0644"],
        ["RESOLUTION", "\u062F\u0631\u062C\u0629 \u0627\u0644\u062F\u0642\u0629"],
        ["REWIND", "\u062A\u0631\u062C\u064A\u0639"],
        ["SEEK", "\u0627\u0644\u0628\u062D\u062B \u0628\u0627\u0644\u062A\u0645\u0631\u064A\u0631"],
        ["SKIP_AD", "\u062A\u062E\u0637\u0651\u064A \u0627\u0644\u0625\u0639\u0644\u0627\u0646"],
        ["SKIP_TO_LIVE", "\u0627\u0644\u0627\u0646\u062A\u0642\u0627\u0644 \u0625\u0644\u0649 \u0628\u062B \u0645\u0628\u0627\u0634\u0631"],
        ["STATISTICS", "\u0627\u0644\u0625\u062D\u0635\u0627\u0621\u0627\u062A"],
        ["SUBTITLE_FORCED", "\u0639\u0631\u0636 \u0625\u062C\u0628\u0627\u0631\u064A"],
        ["SURROUND", "\u0635\u0648\u062A \u0645\u062D\u064A\u0637\u064A"],
        ["TOGGLE_STEREOSCOPIC", "\u0625\u064A\u0642\u0627\u0641 \u0627\u0644\u0639\u0631\u0636 \u0627\u0644\u0645\u062C\u0633\u0651\u0645 \u0623\u0648 \u062A\u0641\u0639\u064A\u0644\u0647"],
        ["UNDETERMINED_LANGUAGE", "\u063A\u064A\u0631 \u0645\u062D\u062F\u062F"],
        ["UNMUTE", "\u0625\u0639\u0627\u062F\u0629 \u0627\u0644\u0635\u0648\u062A"],
        ["UNRECOGNIZED_LANGUAGE", "\u063A\u064A\u0631 \u0645\u0639\u0631\u0648\u0641"],
        ["VOLUME", "\u0645\u0633\u062A\u0648\u0649 \u0627\u0644\u0635\u0648\u062A"]
      ]));
      a.Wa("de", /* @__PURE__ */ new Map([
        ["AD_DURATION", "Dauer der Werbeanzeige"],
        ["AD_PROGRESS", "Werbung\xA0[AD_ON] von\xA0[NUM_ADS]"],
        ["AD_STATISTICS", "Anzeigenstatistiken"],
        ["AD_TIME", "Werbeanzeige: [AD_TIME]"],
        ["AIRPLAY", "AirPlay"],
        ["AUTO_QUALITY", "Automatisch"],
        ["BACK", "Zur\xFCck"],
        ["CAPTIONS", "Untertitel"],
        ["CAST", "Streamen..."],
        ["CHAPTERS", "Kapitel"],
        [
          "DOWNLOAD_VIDEO_FRAME",
          "Videoframe speichern"
        ],
        ["ENTER_LOOP_MODE", "In Endlosschleife spielen"],
        ["ENTER_PICTURE_IN_PICTURE", "Bild im Bild aktivieren"],
        ["EXIT_FULL_SCREEN", "Vollbildmodus beenden"],
        ["EXIT_LOOP_MODE", "Endlosschleife stoppen"],
        ["EXIT_PICTURE_IN_PICTURE", "Bild im Bild beenden"],
        ["FAST_FORWARD", "Vorspulen"],
        ["FULL_SCREEN", "Vollbildmodus"],
        ["LANGUAGE", "Sprache"],
        ["LIVE", "Live"],
        ["LOOP", "Schleife"],
        ["MORE_SETTINGS", "Weitere Einstellungen"],
        ["MULTIPLE_LANGUAGES", "Mehrere Sprachen"],
        ["MUTE", "Stummschalten"],
        [
          "NOT_APPLICABLE",
          "Nicht zutreffend"
        ],
        ["OFF", "Aus"],
        ["ON", "Ein"],
        ["PAUSE", "Pause"],
        ["PICTURE_IN_PICTURE", "Bild im Bild"],
        ["PLAY", "Wiedergabe"],
        ["PLAYBACK_RATE", "Geschwindigkeit"],
        ["QUALITY", "Qualit\xE4t"],
        ["RECENTER_VR", "Zentrieren"],
        ["REPLAY", "Noch einmal wiedergeben"],
        ["RESOLUTION", "Aufl\xF6sung"],
        ["REWIND", "Zur\xFCckspulen"],
        ["SEEK", "Suche"],
        ["SKIP_AD", "\xDCberspringen"],
        ["SKIP_TO_LIVE", "Zum Live-Videostream wechseln"],
        ["STATISTICS", "Statistiken"],
        ["SUBTITLE_FORCED", "Erzwungen"],
        ["SURROUND", "Surround"],
        ["TOGGLE_STEREOSCOPIC", "Einstellung \u201Estereoskopisch\u201C ein\u2011/ausschalten"],
        ["UNDETERMINED_LANGUAGE", "Unbestimmt"],
        ["UNMUTE", "Stummschaltung aufheben"],
        ["UNRECOGNIZED_LANGUAGE", "Unbekannt"],
        ["VOLUME", "Lautst\xE4rke"]
      ]));
      a.Wa("en", /* @__PURE__ */ new Map([["AD_DURATION", "Ad duration"], ["AD_PROGRESS", "Ad [AD_ON] of [NUM_ADS]"], ["AD_STATISTICS", "Ad statistics"], ["AD_TIME", "Ad: [AD_TIME]"], ["AIRPLAY", "AirPlay"], ["AUTO_QUALITY", "Auto"], ["BACK", "Back"], ["CAPTIONS", "Captions"], ["CAST", "Cast..."], [
        "CHAPTERS",
        "Chapters"
      ], ["DOWNLOAD_VIDEO_FRAME", "Save video frame"], ["ENTER_LOOP_MODE", "Loop the current video"], ["ENTER_PICTURE_IN_PICTURE", "Enter Picture-in-Picture"], ["EXIT_FULL_SCREEN", "Exit full screen"], ["EXIT_LOOP_MODE", "Stop looping the current video"], ["EXIT_PICTURE_IN_PICTURE", "Exit Picture-in-Picture"], ["FAST_FORWARD", "Fast-forward"], ["FULL_SCREEN", "Full screen"], ["LANGUAGE", "Language"], ["LIVE", "Live"], ["LOOP", "Loop"], ["MORE_SETTINGS", "More settings"], ["MULTIPLE_LANGUAGES", "Multiple languages"], [
        "MUTE",
        "Mute"
      ], ["NOT_APPLICABLE", "Not applicable"], ["OFF", "Off"], ["ON", "On"], ["PAUSE", "Pause"], ["PICTURE_IN_PICTURE", "Picture-in-Picture"], ["PLAY", "Play"], ["PLAYBACK_RATE", "Playback speed"], ["QUALITY", "Quality"], ["RECENTER_VR", "Recenter"], ["REPLAY", "Replay"], ["RESOLUTION", "Resolution"], ["REWIND", "Rewind"], ["SEEK", "Seek"], ["SKIP_AD", "Skip Ad"], ["SKIP_NEXT", "Next"], ["SKIP_TO_LIVE", "Skip ahead to live"], ["STATISTICS", "Statistics"], ["SUBTITLE_FORCED", "Forced"], ["SURROUND", "Surround"], [
        "TOGGLE_STEREOSCOPIC",
        "Toggle stereoscopic"
      ], ["UNDETERMINED_LANGUAGE", "Undetermined"], ["UNMUTE", "Unmute"], ["UNRECOGNIZED_LANGUAGE", "Unrecognized"], ["VOLUME", "Volume"]]));
      a.Wa("en-GB", /* @__PURE__ */ new Map([
        ["AD_DURATION", "Ad duration"],
        ["AD_PROGRESS", "Ad [AD_ON] of [NUM_ADS]"],
        ["AD_STATISTICS", "Ad statistics"],
        ["AD_TIME", "Ad: [AD_TIME]"],
        ["AIRPLAY", "AirPlay"],
        ["AUTO_QUALITY", "Auto"],
        ["BACK", "Back"],
        ["CAPTIONS", "Captions"],
        ["CAST", "Cast..."],
        ["CHAPTERS", "Chapters"],
        ["DOWNLOAD_VIDEO_FRAME", "Save video frame"],
        ["ENTER_LOOP_MODE", "Loop the current video"],
        ["ENTER_PICTURE_IN_PICTURE", "Enter picture-in-picture"],
        ["EXIT_FULL_SCREEN", "Exit full screen"],
        ["EXIT_LOOP_MODE", "Stop looping the current video"],
        ["EXIT_PICTURE_IN_PICTURE", "Exit picture-in-picture"],
        ["FAST_FORWARD", "Fast-forward"],
        ["FULL_SCREEN", "Full screen"],
        ["LANGUAGE", "Language"],
        ["LIVE", "Live"],
        ["LOOP", "Loop"],
        ["MORE_SETTINGS", "More settings"],
        ["MULTIPLE_LANGUAGES", "Multiple languages"],
        ["MUTE", "Mute"],
        ["NOT_APPLICABLE", "Not applicable"],
        ["OFF", "Off"],
        ["ON", "On"],
        ["PAUSE", "Pause"],
        [
          "PICTURE_IN_PICTURE",
          "Picture-in-picture"
        ],
        ["PLAY", "Play"],
        ["PLAYBACK_RATE", "Playback speed"],
        ["QUALITY", "Quality"],
        ["RECENTER_VR", "Recentre"],
        ["REPLAY", "Replay"],
        ["RESOLUTION", "Resolution"],
        ["REWIND", "Rewind"],
        ["SEEK", "Seek"],
        ["SKIP_AD", "Skip ad"],
        ["SKIP_TO_LIVE", "Skip ahead to live"],
        ["STATISTICS", "Statistics"],
        ["SUBTITLE_FORCED", "Forced"],
        ["SURROUND", "Surround"],
        ["TOGGLE_STEREOSCOPIC", "Toggle stereoscopic"],
        ["UNDETERMINED_LANGUAGE", "Undetermined"],
        ["UNMUTE", "Unmute"],
        ["UNRECOGNIZED_LANGUAGE", "Unrecognised"],
        [
          "VOLUME",
          "volume"
        ]
      ]));
      a.Wa("es", /* @__PURE__ */ new Map([
        ["AD_DURATION", "Duraci\xF3n del anuncio"],
        ["AD_PROGRESS", "Anuncio [AD_ON] de [NUM_ADS]"],
        ["AD_STATISTICS", "Estad\xEDsticas del anuncio"],
        ["AD_TIME", "Anuncio: [AD_TIME]"],
        ["AIRPLAY", "AirPlay"],
        ["AUTO_QUALITY", "Autom\xE1tico"],
        ["BACK", "Atr\xE1s"],
        ["CAPTIONS", "Subt\xEDtulos"],
        ["CAST", "Enviar..."],
        ["CHAPTERS", "Cap\xEDtulos"],
        ["DOWNLOAD_VIDEO_FRAME", "Guardar fotograma"],
        ["ENTER_LOOP_MODE", "Reproducir en bucle el v\xEDdeo actual"],
        [
          "ENTER_PICTURE_IN_PICTURE",
          "Activar el modo imagen en imagen"
        ],
        ["EXIT_FULL_SCREEN", "Salir del modo de pantalla completa"],
        ["EXIT_LOOP_MODE", "Dejar de reproducir en bucle el v\xEDdeo actual"],
        ["EXIT_PICTURE_IN_PICTURE", "Salir del modo imagen en imagen"],
        ["FAST_FORWARD", "Avanzar r\xE1pidamente"],
        ["FULL_SCREEN", "Pantalla completa"],
        ["LANGUAGE", "Idioma"],
        ["LIVE", "En directo"],
        ["LOOP", "Reproducir en bucle"],
        ["MORE_SETTINGS", "M\xE1s ajustes"],
        ["MULTIPLE_LANGUAGES", "Varios idiomas"],
        ["MUTE", "Silenciar"],
        ["NOT_APPLICABLE", "No aplicable"],
        ["OFF", "Desactivado"],
        ["ON", "Activado"],
        ["PAUSE", "Pausar"],
        ["PICTURE_IN_PICTURE", "Imagen en imagen"],
        ["PLAY", "Reproducir"],
        ["PLAYBACK_RATE", "Velocidad de reproducci\xF3n"],
        ["QUALITY", "Calidad"],
        ["RECENTER_VR", "Volver a centrar"],
        ["REPLAY", "Volver a reproducir"],
        ["RESOLUTION", "Resoluci\xF3n"],
        ["REWIND", "Rebobinar"],
        ["SEEK", "Buscar"],
        ["SKIP_AD", "Saltar anuncio"],
        ["SKIP_NEXT", "Siguiente"],
        ["SKIP_TO_LIVE", "Ir al v\xEDdeo en directo"],
        ["STATISTICS", "Estad\xEDsticas"],
        ["SUBTITLE_FORCED", "Forzado"],
        ["SURROUND", "Envolvente"],
        ["TOGGLE_STEREOSCOPIC", "Activar/Desactivar estereosc\xF3pica"],
        ["UNDETERMINED_LANGUAGE", "Sin especificar"],
        ["UNMUTE", "Activar sonido"],
        ["UNRECOGNIZED_LANGUAGE", "No reconocida"],
        ["VOLUME", "Volumen"]
      ]));
      a.Wa("es-419", /* @__PURE__ */ new Map([
        ["AD_DURATION", "Duraci\xF3n del anuncio"],
        ["AD_PROGRESS", "Anuncio [AD_ON] de [NUM_ADS]"],
        ["AD_STATISTICS", "Estad\xEDsticas de anuncios"],
        ["AD_TIME", "Anuncio: [AD_TIME]"],
        ["AIRPLAY", "AirPlay"],
        ["AUTO_QUALITY", "Autom\xE1tico"],
        ["BACK", "Atr\xE1s"],
        ["CAPTIONS", "Subt\xEDtulos"],
        ["CAST", "Transmitir..."],
        ["CHAPTERS", "Cap\xEDtulos"],
        ["DOWNLOAD_VIDEO_FRAME", "Guardar fotograma"],
        ["ENTER_LOOP_MODE", "Repetir indefinidamente el video actual"],
        ["ENTER_PICTURE_IN_PICTURE", "Ingresar al modo de pantalla en pantalla"],
        ["EXIT_FULL_SCREEN", "Salir de pantalla completa"],
        ["EXIT_LOOP_MODE", "Detener la repetici\xF3n indefinida del video actual"],
        ["EXIT_PICTURE_IN_PICTURE", "Salir del modo de pantalla en pantalla"],
        ["FAST_FORWARD", "Avanzar"],
        [
          "FULL_SCREEN",
          "Pantalla completa"
        ],
        ["LANGUAGE", "Idioma"],
        ["LIVE", "En directo"],
        ["LOOP", "Repetir indefinidamente"],
        ["MORE_SETTINGS", "M\xE1s opciones de configuraci\xF3n"],
        ["MULTIPLE_LANGUAGES", "Varios idiomas"],
        ["MUTE", "Silenciar"],
        ["NOT_APPLICABLE", "No aplicable"],
        ["OFF", "Desactivado"],
        ["ON", "Activado"],
        ["PAUSE", "Detener"],
        ["PICTURE_IN_PICTURE", "Pantalla en pantalla"],
        ["PLAY", "Reproducir"],
        ["PLAYBACK_RATE", "Velocidad de reproducci\xF3n"],
        ["QUALITY", "Calidad"],
        ["RECENTER_VR", "Volver a centrar"],
        [
          "REPLAY",
          "Volver a reproducir"
        ],
        ["RESOLUTION", "Resoluci\xF3n"],
        ["REWIND", "Retroceder"],
        ["SEEK", "Buscar"],
        ["SKIP_AD", "Omitir anuncio"],
        ["SKIP_TO_LIVE", "Adelantar hasta la transmisi\xF3n en vivo"],
        ["STATISTICS", "Estad\xEDsticas"],
        ["SUBTITLE_FORCED", "Forzado"],
        ["SURROUND", "Sonido envolvente"],
        ["TOGGLE_STEREOSCOPIC", "Activar o desactivar el modo estereosc\xF3pico"],
        ["UNDETERMINED_LANGUAGE", "Sin especificar"],
        ["UNMUTE", "Dejar de silenciar"],
        ["UNRECOGNIZED_LANGUAGE", "No reconocida"],
        ["VOLUME", "Volumen"]
      ]));
      a.Wa("fr", /* @__PURE__ */ new Map([
        ["AD_DURATION", "Dur\xE9e de l'annonce"],
        ["AD_PROGRESS", "Annonce\xA0[AD_ON] sur\xA0[NUM_ADS]"],
        ["AD_STATISTICS", "Statistiques sur les annonces"],
        ["AD_TIME", "Annonce\xA0: [AD_TIME]"],
        ["AIRPLAY", "AirPlay"],
        ["AUTO_QUALITY", "Automatique"],
        ["BACK", "Retour"],
        ["CAPTIONS", "Sous-titres"],
        ["CAST", "Caster\u2026"],
        ["CHAPTERS", "Chapitres"],
        ["DOWNLOAD_VIDEO_FRAME", "T\xE9l\xE9charger l'image de la vid\xE9o"],
        ["ENTER_LOOP_MODE", "Lire en boucle la vid\xE9o en cours"],
        [
          "ENTER_PICTURE_IN_PICTURE",
          "Utiliser le mode Picture-in-Picture"
        ],
        ["EXIT_FULL_SCREEN", "Quitter le mode plein \xE9cran"],
        ["EXIT_LOOP_MODE", "Arr\xEAter la lecture en boucle de la vid\xE9o en cours"],
        ["EXIT_PICTURE_IN_PICTURE", "Quitter le mode\xA0PIP (Picture-in-picture)"],
        ["FAST_FORWARD", "Avance rapide"],
        ["FULL_SCREEN", "Plein \xE9cran"],
        ["LANGUAGE", "Langue"],
        ["LIVE", "En direct"],
        ["LOOP", "R\xE9p\xE9ter"],
        ["MORE_SETTINGS", "Plus de param\xE8tres"],
        ["MULTIPLE_LANGUAGES", "Plusieurs langues"],
        ["MUTE", "Couper le son"],
        ["NOT_APPLICABLE", "Non applicable"],
        ["OFF", "D\xE9sactiv\xE9e"],
        ["ON", "Activ\xE9e"],
        ["PAUSE", "Pause"],
        ["PICTURE_IN_PICTURE", "Picture-in-Picture"],
        ["PLAY", "Visionner"],
        ["PLAYBACK_RATE", "Vitesse de lecture"],
        ["QUALITY", "Qualit\xE9"],
        ["RECENTER_VR", "Recentrer"],
        ["REPLAY", "Revoir"],
        ["RESOLUTION", "R\xE9solution"],
        ["REWIND", "Retour arri\xE8re"],
        ["SEEK", "Chercher"],
        ["SKIP_AD", "Passer l'annonce"],
        ["SKIP_NEXT", "Suivante"],
        ["SKIP_TO_LIVE", "Acc\xE9der \xE0 la partie la plus r\xE9cente du direct"],
        ["STATISTICS", "Statistiques"],
        ["SUBTITLE_FORCED", "Forc\xE9"],
        ["SURROUND", "Surround"],
        ["TOGGLE_STEREOSCOPIC", "Activer/D\xE9sactiver le mode st\xE9r\xE9oscopique"],
        ["UNDETERMINED_LANGUAGE", "Langue ind\xE9termin\xE9e"],
        ["UNMUTE", "R\xE9activer le son"],
        ["UNRECOGNIZED_LANGUAGE", "Non reconnu"],
        ["VOLUME", "Volume"]
      ]));
      a.Wa("it", /* @__PURE__ */ new Map([
        ["AD_DURATION", "Durata dell'annuncio"],
        ["AD_PROGRESS", "Annuncio [AD_ON] di [NUM_ADS]"],
        ["AD_STATISTICS", "Statistiche sugli annunci"],
        ["AD_TIME", "Annuncio: [AD_TIME]"],
        ["AIRPLAY", "AirPlay"],
        ["AUTO_QUALITY", "Automatica"],
        ["BACK", "Indietro"],
        ["CAPTIONS", "Sottotitoli"],
        ["CAST", "Trasmetti..."],
        ["CHAPTERS", "Capitoli"],
        ["DOWNLOAD_VIDEO_FRAME", "Salva fotogramma"],
        ["ENTER_LOOP_MODE", "Riproduci in loop il video corrente"],
        ["ENTER_PICTURE_IN_PICTURE", "Attiva Picture in picture"],
        ["EXIT_FULL_SCREEN", "Esci da schermo intero"],
        ["EXIT_LOOP_MODE", "Interrompi riproduzione in loop del video corrente"],
        ["EXIT_PICTURE_IN_PICTURE", "Esci da Picture in picture"],
        ["FAST_FORWARD", "Avanti veloce"],
        ["FULL_SCREEN", "Schermo intero"],
        ["LANGUAGE", "Lingua"],
        ["LIVE", "Dal vivo"],
        ["LOOP", "Riproduci in loop"],
        ["MORE_SETTINGS", "Altre impostazioni"],
        ["MULTIPLE_LANGUAGES", "Pi\xF9 lingue"],
        ["MUTE", "Disattiva audio"],
        ["NOT_APPLICABLE", "Non applicabile"],
        ["OFF", "Disattivo"],
        ["ON", "Attivo"],
        ["PAUSE", "Metti in pausa"],
        ["PICTURE_IN_PICTURE", "Picture in picture"],
        ["PLAY", "Riproduci"],
        ["PLAYBACK_RATE", "Velocit\xE0 di riproduzione"],
        ["QUALITY", "Qualit\xE0"],
        ["RECENTER_VR", "Ricentra"],
        ["REPLAY", "Riproduci di nuovo"],
        ["RESOLUTION", "Risoluzione"],
        ["REWIND", "Riavvolgi"],
        ["SEEK", "Cerca"],
        ["SKIP_AD", "Salta annuncio"],
        ["SKIP_TO_LIVE", "Passa alla trasmissione dal vivo"],
        ["STATISTICS", "Statistiche"],
        ["SUBTITLE_FORCED", "Forzata"],
        ["SURROUND", "Surround"],
        ["TOGGLE_STEREOSCOPIC", "Pulsante di attivazione/disattivazione stereoscopico"],
        ["UNDETERMINED_LANGUAGE", "Indeterminata"],
        ["UNMUTE", "Riattiva audio"],
        ["UNRECOGNIZED_LANGUAGE", "Non riconosciuto"],
        ["VOLUME", "Volume"]
      ]));
      a.Wa("ja", /* @__PURE__ */ new Map([
        ["AD_DURATION", "\u5E83\u544A\u518D\u751F\u6642\u9593"],
        ["AD_PROGRESS", "[AD_ON] \u756A\u76EE\u306E\u5E83\u544A\uFF08\u5168 [NUM_ADS] \u500B\uFF09"],
        ["AD_STATISTICS", "\u5E83\u544A\u306E\u7D71\u8A08\u60C5\u5831"],
        ["AD_TIME", "\u5E83\u544A: [AD_TIME]"],
        ["AIRPLAY", "AirPlay"],
        ["AUTO_QUALITY", "\u81EA\u52D5"],
        ["BACK", "\u623B\u308B"],
        ["CAPTIONS", "\u5B57\u5E55"],
        ["CAST", "\u30AD\u30E3\u30B9\u30C8..."],
        ["CHAPTERS", "\u7AE0"],
        ["DOWNLOAD_VIDEO_FRAME", "\u52D5\u753B\u30D5\u30EC\u30FC\u30E0\u3092\u4FDD\u5B58"],
        ["ENTER_LOOP_MODE", "\u73FE\u5728\u306E\u52D5\u753B\u3092\u30EB\u30FC\u30D7\u518D\u751F"],
        ["ENTER_PICTURE_IN_PICTURE", "\u30D4\u30AF\u30C1\u30E3\u30FC \u30A4\u30F3 \u30D4\u30AF\u30C1\u30E3\u30FC\u3092\u958B\u59CB"],
        ["EXIT_FULL_SCREEN", "\u5168\u753B\u9762\u8868\u793A\u3092\u7D42\u4E86"],
        ["EXIT_LOOP_MODE", "\u73FE\u5728\u306E\u52D5\u753B\u306E\u30EB\u30FC\u30D7\u518D\u751F\u3092\u505C\u6B62"],
        ["EXIT_PICTURE_IN_PICTURE", "\u30D4\u30AF\u30C1\u30E3\u30FC \u30A4\u30F3 \u30D4\u30AF\u30C1\u30E3\u30FC\u3092\u7D42\u4E86"],
        ["FAST_FORWARD", "\u65E9\u9001\u308A"],
        ["FULL_SCREEN", "\u5168\u753B\u9762\u8868\u793A"],
        ["LANGUAGE", "\u8A00\u8A9E"],
        ["LIVE", "\u30E9\u30A4\u30D6"],
        ["LOOP", "\u30EB\u30FC\u30D7"],
        ["MORE_SETTINGS", "\u8A73\u7D30\u8A2D\u5B9A"],
        ["MULTIPLE_LANGUAGES", "\u591A\u8A00\u8A9E"],
        ["MUTE", "\u30DF\u30E5\u30FC\u30C8"],
        ["NOT_APPLICABLE", "\u8A72\u5F53\u306A\u3057"],
        ["OFF", "\u30AA\u30D5"],
        ["ON", "\u30AA\u30F3"],
        ["PAUSE", "\u4E00\u6642\u505C\u6B62"],
        ["PICTURE_IN_PICTURE", "\u30D4\u30AF\u30C1\u30E3\u30FC \u30A4\u30F3 \u30D4\u30AF\u30C1\u30E3\u30FC"],
        ["PLAY", "\u518D\u751F"],
        ["PLAYBACK_RATE", "\u518D\u751F\u901F\u5EA6"],
        ["QUALITY", "\u54C1\u8CEA"],
        ["RECENTER_VR", "\u4E2D\u5FC3\u3092\u518D\u8A2D\u5B9A"],
        ["REPLAY", "\u3082\u3046\u4E00\u5EA6\u518D\u751F"],
        ["RESOLUTION", "\u89E3\u50CF\u5EA6"],
        ["REWIND", "\u5DFB\u304D\u623B\u3057"],
        ["SEEK", "\u30B7\u30FC\u30AF\u518D\u751F"],
        ["SKIP_AD", "\u5E83\u544A\u3092\u30B9\u30AD\u30C3\u30D7"],
        ["SKIP_TO_LIVE", "\u30E9\u30A4\u30D6\u914D\u4FE1\u307E\u3067\u30B9\u30AD\u30C3\u30D7"],
        ["STATISTICS", "\u7D71\u8A08\u60C5\u5831"],
        ["SUBTITLE_FORCED", "\u5F37\u5236"],
        ["SURROUND", "\u30B5\u30E9\u30A6\u30F3\u30C9"],
        ["TOGGLE_STEREOSCOPIC", "\u7ACB\u4F53\u753B\u50CF\u3092\u5207\u308A\u66FF\u3048\u308B"],
        ["UNDETERMINED_LANGUAGE", "\u4E0D\u660E"],
        ["UNMUTE", "\u30DF\u30E5\u30FC\u30C8\u3092\u89E3\u9664"],
        ["UNRECOGNIZED_LANGUAGE", "\u4E0D\u660E"],
        ["VOLUME", "\u97F3\u91CF"]
      ]));
      a.Wa("ko", /* @__PURE__ */ new Map([
        ["AD_DURATION", "\uAD11\uACE0 \uAE30\uAC04"],
        ["AD_PROGRESS", "\uAD11\uACE0 [AD_ON]/[NUM_ADS]"],
        ["AD_STATISTICS", "\uAD11\uACE0 \uD1B5\uACC4"],
        ["AD_TIME", "\uAD11\uACE0: [AD_TIME]"],
        ["AIRPLAY", "AirPlay"],
        ["AUTO_QUALITY", "\uC790\uB3D9"],
        ["BACK", "\uB4A4\uB85C"],
        ["CAPTIONS", "\uC790\uB9C9"],
        ["CAST", "\uC804\uC1A1..."],
        ["CHAPTERS", "\uC7A5"],
        ["DOWNLOAD_VIDEO_FRAME", "\uB3D9\uC601\uC0C1 \uD504\uB808\uC784 \uC800\uC7A5"],
        ["ENTER_LOOP_MODE", "\uD604\uC7AC \uB3D9\uC601\uC0C1 \uBC18\uBCF5 \uC7AC\uC0DD"],
        ["ENTER_PICTURE_IN_PICTURE", "PIP \uBAA8\uB4DC \uC2DC\uC791"],
        ["EXIT_FULL_SCREEN", "\uC804\uCCB4\uD654\uBA74 \uB2EB\uAE30"],
        ["EXIT_LOOP_MODE", "\uD604\uC7AC \uB3D9\uC601\uC0C1 \uBC18\uBCF5 \uC7AC\uC0DD \uC911\uC9C0"],
        ["EXIT_PICTURE_IN_PICTURE", "PIP \uBAA8\uB4DC \uC885\uB8CC"],
        ["FAST_FORWARD", "\uBE68\uB9AC \uAC10\uAE30"],
        ["FULL_SCREEN", "\uC804\uCCB4\uD654\uBA74"],
        ["LANGUAGE", "\uC5B8\uC5B4"],
        ["LIVE", "\uC2E4\uC2DC\uAC04"],
        ["LOOP", "\uBC18\uBCF5 \uC7AC\uC0DD"],
        ["MORE_SETTINGS", "\uC124\uC815 \uB354\uBCF4\uAE30"],
        ["MULTIPLE_LANGUAGES", "\uC5EC\uB7EC \uC5B8\uC5B4"],
        ["MUTE", "\uC74C\uC18C\uAC70"],
        ["NOT_APPLICABLE", "\uD574\uB2F9 \uC0AC\uD56D \uC5C6\uC74C"],
        ["OFF", "\uC0AC\uC6A9 \uC548\uD568"],
        ["ON", "\uC0AC\uC6A9"],
        ["PAUSE", "\uC77C\uC2DC\uC911\uC9C0"],
        ["PICTURE_IN_PICTURE", "PIP \uBAA8\uB4DC"],
        ["PLAY", "\uC7AC\uC0DD"],
        ["PLAYBACK_RATE", "\uC7AC\uC0DD \uC18D\uB3C4"],
        ["QUALITY", "\uD488\uC9C8"],
        ["RECENTER_VR", "\uC911\uC2EC \uC7AC\uC124\uC815"],
        ["REPLAY", "\uB2E4\uC2DC\uBCF4\uAE30"],
        ["RESOLUTION", "\uD574\uC0C1\uB3C4"],
        ["REWIND", "\uB418\uAC10\uAE30"],
        ["SEEK", "\uCC3E\uAE30"],
        ["SKIP_AD", "\uAD11\uACE0 \uAC74\uB108\uB6F0\uAE30"],
        ["SKIP_TO_LIVE", "\uB77C\uC774\uBE0C \uB3D9\uC601\uC0C1\uC73C\uB85C \uAC74\uB108\uB6F0\uAE30"],
        ["STATISTICS", "\uD1B5\uACC4"],
        ["SUBTITLE_FORCED", "\uAC15\uC81C"],
        ["SURROUND", "\uC11C\uB77C\uC6B4\uB4DC"],
        ["TOGGLE_STEREOSCOPIC", "\uC785\uCCB4 \uBCF4\uAE30 \uC804\uD658"],
        ["UNDETERMINED_LANGUAGE", "\uBBF8\uC815"],
        ["UNMUTE", "\uC74C\uC18C\uAC70 \uD574\uC81C"],
        ["UNRECOGNIZED_LANGUAGE", "\uC54C \uC218 \uC5C6\uC74C"],
        ["VOLUME", "\uBCFC\uB968"]
      ]));
      a.Wa("nl", /* @__PURE__ */ new Map([
        ["AD_DURATION", "Advertentieduur"],
        ["AD_PROGRESS", "Advertentie [AD_ON] van [NUM_ADS]"],
        ["AD_STATISTICS", "Advertentiestatistieken"],
        ["AD_TIME", "Advertentie: [AD_TIME]"],
        ["AIRPLAY", "AirPlay"],
        ["AUTO_QUALITY", "Automatisch"],
        ["BACK", "Terug"],
        [
          "CAPTIONS",
          "Ondertiteling"
        ],
        ["CAST", "Casten..."],
        ["CHAPTERS", "Hoofdstukken"],
        ["DOWNLOAD_VIDEO_FRAME", "Videoframe opslaan"],
        ["ENTER_LOOP_MODE", "De huidige video lussen"],
        ["ENTER_PICTURE_IN_PICTURE", "Scherm-in-scherm openen"],
        ["EXIT_FULL_SCREEN", "Volledig scherm sluiten"],
        ["EXIT_LOOP_MODE", "De huidige video niet meer lussen"],
        ["EXIT_PICTURE_IN_PICTURE", "Scherm-in-scherm afsluiten"],
        ["FAST_FORWARD", "Vooruitspoelen"],
        ["FULL_SCREEN", "Volledig scherm"],
        ["LANGUAGE", "Taal"],
        ["LIVE", "Live"],
        ["LOOP", "Lussen"],
        [
          "MORE_SETTINGS",
          "Meer instellingen"
        ],
        ["MULTIPLE_LANGUAGES", "Meerdere talen"],
        ["MUTE", "Geluid uitzetten"],
        ["NOT_APPLICABLE", "Niet van toepassing"],
        ["OFF", "Uit"],
        ["ON", "Aan"],
        ["PAUSE", "Onderbreken"],
        ["PICTURE_IN_PICTURE", "Scherm-in-scherm"],
        ["PLAY", "Afspelen"],
        ["PLAYBACK_RATE", "Afspeelsnelheid"],
        ["QUALITY", "Kwaliteit"],
        ["RECENTER_VR", "Opnieuw centreren"],
        ["REPLAY", "Opnieuw afspelen"],
        ["RESOLUTION", "Resolutie"],
        ["REWIND", "Terugspoelen"],
        ["SEEK", "Zoeken"],
        ["SKIP_AD", "Advertentie overslaan"],
        ["SKIP_TO_LIVE", "Doorgaan naar live"],
        ["STATISTICS", "Statistieken"],
        ["SUBTITLE_FORCED", "Afgedwongen"],
        ["SURROUND", "Surround"],
        ["TOGGLE_STEREOSCOPIC", "Stereoscopisch aan-/uitzetten"],
        ["UNDETERMINED_LANGUAGE", "Onbepaald"],
        ["UNMUTE", "Geluid aanzetten"],
        ["UNRECOGNIZED_LANGUAGE", "Onbekend"],
        ["VOLUME", "Volume"]
      ]));
      a.Wa("pl", /* @__PURE__ */ new Map([
        ["AD_DURATION", "Czas trwania reklamy"],
        ["AD_PROGRESS", "Reklama\xA0[AD_ON] z\xA0[NUM_ADS]"],
        ["AD_STATISTICS", "Statystyki reklam"],
        ["AD_TIME", "Reklama: [AD_TIME]"],
        ["AIRPLAY", "AirPlay"],
        ["AUTO_QUALITY", "Automatycznie"],
        ["BACK", "Wstecz"],
        ["CAPTIONS", "Napisy"],
        ["CAST", "Przesy\u0142aj..."],
        ["CHAPTERS", "Rozdzia\u0142y"],
        ["DOWNLOAD_VIDEO_FRAME", "Zapisz klatk\u0119 filmu"],
        ["ENTER_LOOP_MODE", "Odtwarzaj bie\u017C\u0105cy film w\xA0p\u0119tli"],
        ["ENTER_PICTURE_IN_PICTURE", "W\u0142\u0105cz tryb obrazu w\xA0obrazie"],
        ["EXIT_FULL_SCREEN", "Zamknij pe\u0142ny ekran"],
        ["EXIT_LOOP_MODE", "Wy\u0142\u0105cz odtwarzanie bie\u017C\u0105cego filmu w\xA0p\u0119tli"],
        ["EXIT_PICTURE_IN_PICTURE", "Wy\u0142\u0105cz tryb obrazu w\xA0obrazie"],
        ["FAST_FORWARD", "Przewi\u0144 do przodu"],
        ["FULL_SCREEN", "Pe\u0142ny ekran"],
        ["LANGUAGE", "J\u0119zyk"],
        ["LIVE", "Na \u017Cywo"],
        ["LOOP", "Odtwarzaj w\xA0p\u0119tli"],
        ["MORE_SETTINGS", "Wi\u0119cej ustawie\u0144"],
        ["MULTIPLE_LANGUAGES", "Wiele j\u0119zyk\xF3w"],
        ["MUTE", "Wycisz"],
        ["NOT_APPLICABLE", "Nie dotyczy"],
        ["OFF", "Wy\u0142\u0105czone"],
        ["ON", "W\u0142\u0105czone"],
        ["PAUSE", "Wstrzymaj"],
        ["PICTURE_IN_PICTURE", "Obraz w\xA0obrazie"],
        ["PLAY", "Odtw\xF3rz"],
        ["PLAYBACK_RATE", "Szybko\u015B\u0107 odtwarzania"],
        ["QUALITY", "Jako\u015B\u0107"],
        ["RECENTER_VR", "Wy\u015Brodkuj"],
        ["REPLAY", "Odtw\xF3rz ponownie"],
        ["RESOLUTION", "Rozdzielczo\u015B\u0107"],
        ["REWIND", "Przewi\u0144 do ty\u0142u"],
        ["SEEK", "Szukaj"],
        ["SKIP_AD", "Pomi\u0144 reklam\u0119"],
        ["SKIP_NEXT", "Dalej"],
        ["SKIP_TO_LIVE", "Przejd\u017A do transmisji na \u017Cywo"],
        ["STATISTICS", "Statystyki"],
        ["SUBTITLE_FORCED", "Wymuszone"],
        ["SURROUND", "Przestrzenny"],
        ["TOGGLE_STEREOSCOPIC", "Prze\u0142\u0105cz tryb stereoskopowy"],
        ["UNDETERMINED_LANGUAGE", "Nie okre\u015Blono"],
        ["UNMUTE", "Wy\u0142\u0105cz wyciszenie"],
        ["UNRECOGNIZED_LANGUAGE", "Nierozpoznany"],
        ["VOLUME", "G\u0142o\u015Bno\u015B\u0107"]
      ]));
      a.Wa("pt-BR", /* @__PURE__ */ new Map([
        ["AD_DURATION", "Dura\xE7\xE3o do an\xFAncio"],
        ["AD_PROGRESS", "An\xFAncio [AD_ON] de [NUM_ADS]"],
        ["AD_STATISTICS", "Estat\xEDsticas de an\xFAncios"],
        ["AD_TIME", "An\xFAncio: [AD_TIME]"],
        ["AIRPLAY", "AirPlay"],
        ["AUTO_QUALITY", "Autom\xE1tica"],
        ["BACK", "Voltar"],
        ["CAPTIONS", "Legendas"],
        ["CAST", "Transmitir..."],
        ["CHAPTERS", "Cap\xEDtulos"],
        ["DOWNLOAD_VIDEO_FRAME", "Salvar frame do v\xEDdeo"],
        ["ENTER_LOOP_MODE", "Repetir o v\xEDdeo atual"],
        ["ENTER_PICTURE_IN_PICTURE", "Entrar no modo picture-in-picture"],
        ["EXIT_FULL_SCREEN", "Sair do modo tela cheia"],
        ["EXIT_LOOP_MODE", "Parar repeti\xE7\xE3o do v\xEDdeo atual"],
        ["EXIT_PICTURE_IN_PICTURE", "Sair de picture-in-picture"],
        ["FAST_FORWARD", "Avan\xE7ar"],
        ["FULL_SCREEN", "Tela cheia"],
        ["LANGUAGE", "Idioma"],
        ["LIVE", "Ao vivo"],
        ["LOOP", "Repetir"],
        ["MORE_SETTINGS", "Mais defini\xE7\xF5es"],
        ["MULTIPLE_LANGUAGES", "V\xE1rios idiomas"],
        ["MUTE", "Desativar som"],
        ["NOT_APPLICABLE", "N\xE3o relevante"],
        ["OFF", "Desativado"],
        ["ON", "Ativado"],
        ["PAUSE", "Pausar"],
        ["PICTURE_IN_PICTURE", "Picture-in-picture"],
        ["PLAY", "Reproduzir"],
        ["PLAYBACK_RATE", "Velocidade da reprodu\xE7\xE3o"],
        ["QUALITY", "Qualidade"],
        ["RECENTER_VR", "Centralizar"],
        ["REPLAY", "Repetir"],
        ["RESOLUTION", "Resolu\xE7\xE3o"],
        ["REWIND", "Voltar"],
        ["SEEK", "Procurar"],
        ["SKIP_AD", "Pular an\xFAncio"],
        ["SKIP_TO_LIVE", "Pular para transmiss\xE3o ao vivo"],
        ["STATISTICS", "Estat\xEDsticas"],
        ["SUBTITLE_FORCED", "Exibi\xE7\xE3o for\xE7ada"],
        ["SURROUND", "Surround"],
        ["TOGGLE_STEREOSCOPIC", "Alternar imagem estereosc\xF3pica"],
        ["UNDETERMINED_LANGUAGE", "Indeterminado"],
        ["UNMUTE", "Ativar som"],
        ["UNRECOGNIZED_LANGUAGE", "N\xE3o reconhecido"],
        ["VOLUME", "Volume"]
      ]));
      a.Wa("ru", /* @__PURE__ */ new Map([
        ["AD_DURATION", "\u041F\u0440\u043E\u0434\u043E\u043B\u0436\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C \u0440\u0435\u043A\u043B\u0430\u043C\u044B"],
        [
          "AD_PROGRESS",
          "\u0420\u0435\u043A\u043B\u0430\u043C\u0430 [AD_ON] \u0438\u0437 [NUM_ADS]"
        ],
        ["AD_STATISTICS", "\u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043A\u0430 \u043E\u0431\u044A\u044F\u0432\u043B\u0435\u043D\u0438\u0439"],
        ["AD_TIME", "\u0420\u0435\u043A\u043B\u0430\u043C\u0430: [AD_TIME]"],
        ["AIRPLAY", "AirPlay"],
        ["AUTO_QUALITY", "\u0410\u0432\u0442\u043E"],
        ["BACK", "\u041D\u0430\u0437\u0430\u0434"],
        ["CAPTIONS", "\u0421\u0443\u0431\u0442\u0438\u0442\u0440\u044B"],
        ["CAST", "\u0422\u0440\u0430\u043D\u0441\u043B\u0438\u0440\u043E\u0432\u0430\u0442\u044C..."],
        ["CHAPTERS", "\u042D\u043F\u0438\u0437\u043E\u0434\u044B"],
        ["DOWNLOAD_VIDEO_FRAME", "\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C \u043A\u0430\u0434\u0440 \u0432\u0438\u0434\u0435\u043E"],
        ["ENTER_LOOP_MODE", "\u0417\u0430\u0446\u0438\u043A\u043B\u0438\u0442\u044C \u0442\u0435\u043A\u0443\u0449\u0435\u0435 \u0432\u0438\u0434\u0435\u043E"],
        ["ENTER_PICTURE_IN_PICTURE", '\u041F\u0435\u0440\u0435\u0439\u0442\u0438 \u0432 \u0440\u0435\u0436\u0438\u043C "\u041A\u0430\u0440\u0442\u0438\u043D\u043A\u0430 \u0432 \u043A\u0430\u0440\u0442\u0438\u043D\u043A\u0435"'],
        ["EXIT_FULL_SCREEN", "\u041E\u0431\u044B\u0447\u043D\u044B\u0439 \u0440\u0435\u0436\u0438\u043C"],
        ["EXIT_LOOP_MODE", "\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C \u0437\u0430\u0446\u0438\u043A\u043B\u0438\u0432\u0430\u043D\u0438\u0435 \u0442\u0435\u043A\u0443\u0449\u0435\u0433\u043E \u0432\u0438\u0434\u0435\u043E"],
        ["EXIT_PICTURE_IN_PICTURE", '\u0412\u044B\u0439\u0442\u0438 \u0438\u0437 \u0440\u0435\u0436\u0438\u043C\u0430 "\u041A\u0430\u0440\u0442\u0438\u043D\u043A\u0430 \u0432 \u043A\u0430\u0440\u0442\u0438\u043D\u043A\u0435"'],
        ["FAST_FORWARD", "\u041F\u0435\u0440\u0435\u043C\u043E\u0442\u043A\u0430 \u0432\u043F\u0435\u0440\u0435\u0434"],
        ["FULL_SCREEN", "\u041F\u043E\u043B\u043D\u043E\u044D\u043A\u0440\u0430\u043D\u043D\u044B\u0439 \u0440\u0435\u0436\u0438\u043C"],
        ["LANGUAGE", "\u042F\u0437\u044B\u043A"],
        ["LIVE", "\u041F\u0440\u044F\u043C\u043E\u0439 \u044D\u0444\u0438\u0440"],
        ["LOOP", "\u0417\u0430\u0446\u0438\u043A\u043B\u0438\u0442\u044C"],
        ["MORE_SETTINGS", "\u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u044B\u0435 \u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438"],
        ["MULTIPLE_LANGUAGES", "\u041D\u0435\u0441\u043A\u043E\u043B\u044C\u043A\u043E \u044F\u0437\u044B\u043A\u043E\u0432"],
        ["MUTE", "\u041E\u0442\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u0437\u0432\u0443\u043A"],
        ["NOT_APPLICABLE", "\u041D\u0435\u043F\u0440\u0438\u043C\u0435\u043D\u0438\u043C\u043E"],
        ["OFF", "\u0412\u044B\u043A\u043B."],
        ["ON", "\u0412\u043A\u043B."],
        ["PAUSE", "\u041F\u0430\u0443\u0437\u0430"],
        ["PICTURE_IN_PICTURE", "\u041A\u0430\u0440\u0442\u0438\u043D\u043A\u0430 \u0432 \u043A\u0430\u0440\u0442\u0438\u043D\u043A\u0435"],
        ["PLAY", "\u0412\u043E\u0441\u043F\u0440\u043E\u0438\u0437\u0432\u0435\u0441\u0442\u0438"],
        ["PLAYBACK_RATE", "\u0421\u043A\u043E\u0440\u043E\u0441\u0442\u044C \u0432\u043E\u0441\u043F\u0440\u043E\u0438\u0437\u0432\u0435\u0434\u0435\u043D\u0438\u044F"],
        ["QUALITY", "\u041A\u0430\u0447\u0435\u0441\u0442\u0432\u043E"],
        ["RECENTER_VR", "\u0426\u0435\u043D\u0442\u0440\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0437\u0430\u043D\u043E\u0432\u043E"],
        ["REPLAY", "\u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u044C"],
        ["RESOLUTION", "\u0420\u0430\u0437\u0440\u0435\u0448\u0435\u043D\u0438\u0435"],
        ["REWIND", "\u041F\u0435\u0440\u0435\u043C\u043E\u0442\u0430\u0442\u044C \u043D\u0430\u0437\u0430\u0434"],
        ["SEEK", "\u041F\u0435\u0440\u0435\u043C\u043E\u0442\u043A\u0430"],
        ["SKIP_AD", "\u041F\u0440\u043E\u043F\u0443\u0441\u0442\u0438\u0442\u044C"],
        ["SKIP_TO_LIVE", "\u041F\u0440\u043E\u043F\u0443\u0441\u0442\u0438\u0442\u044C \u0438 \u043F\u0435\u0440\u0435\u0439\u0442\u0438 \u043A \u043F\u0440\u044F\u043C\u043E\u0439 \u0442\u0440\u0430\u043D\u0441\u043B\u044F\u0446\u0438\u0438"],
        ["STATISTICS", "\u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043A\u0430"],
        ["SUBTITLE_FORCED", "\u0421\u0443\u0431\u0442\u0438\u0442\u0440\u044B \u043F\u0440\u0438\u043D\u0443\u0434\u0438\u0442\u0435\u043B\u044C\u043D\u043E"],
        ["SURROUND", "\u041E\u0431\u044A\u0435\u043C\u043D\u044B\u0439 \u0437\u0432\u0443\u043A"],
        ["TOGGLE_STEREOSCOPIC", "\u0412\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u0438\u043B\u0438 \u043E\u0442\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u0441\u0442\u0435\u0440\u0435\u043E\u0441\u043A\u043E\u043F\u0438\u0447\u0435\u0441\u043A\u0438\u0439 \u0440\u0435\u0436\u0438\u043C"],
        ["UNDETERMINED_LANGUAGE", "\u041D\u0435 \u0443\u043A\u0430\u0437\u0430\u043D\u043E"],
        ["UNMUTE", "\u0412\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u0437\u0432\u0443\u043A"],
        ["UNRECOGNIZED_LANGUAGE", "\u041D\u0435 \u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043E"],
        ["VOLUME", "\u0413\u0440\u043E\u043C\u043A\u043E\u0441\u0442\u044C"]
      ]));
      a.Wa("th", /* @__PURE__ */ new Map([
        ["AD_DURATION", "\u0E23\u0E30\u0E22\u0E30\u0E40\u0E27\u0E25\u0E32\u0E42\u0E06\u0E29\u0E13\u0E32"],
        ["AD_PROGRESS", "\u0E42\u0E06\u0E29\u0E13\u0E32 [AD_ON] \u0E08\u0E32\u0E01 [NUM_ADS] \u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"],
        ["AD_STATISTICS", "\u0E2A\u0E16\u0E34\u0E15\u0E34\u0E42\u0E06\u0E29\u0E13\u0E32"],
        ["AD_TIME", "\u0E42\u0E06\u0E29\u0E13\u0E32: [AD_TIME]"],
        ["AIRPLAY", "AirPlay"],
        ["AUTO_QUALITY", "\u0E2D\u0E31\u0E15\u0E42\u0E19\u0E21\u0E31\u0E15\u0E34"],
        ["BACK", "\u0E01\u0E25\u0E31\u0E1A"],
        ["CAPTIONS", "\u0E04\u0E33\u0E1A\u0E23\u0E23\u0E22\u0E32\u0E22\u0E41\u0E17\u0E19\u0E40\u0E2A\u0E35\u0E22\u0E07"],
        ["CAST", "\u0E41\u0E04\u0E2A\u0E15\u0E4C..."],
        ["CHAPTERS", "\u0E1A\u0E17"],
        ["DOWNLOAD_VIDEO_FRAME", "\u0E1A\u0E31\u0E19\u0E17\u0E36\u0E01\u0E40\u0E1F\u0E23\u0E21\u0E27\u0E34\u0E14\u0E35\u0E42\u0E2D"],
        ["ENTER_LOOP_MODE", "\u0E27\u0E19\u0E0B\u0E49\u0E33\u0E27\u0E34\u0E14\u0E35\u0E42\u0E2D\u0E1B\u0E31\u0E08\u0E08\u0E38\u0E1A\u0E31\u0E19"],
        ["ENTER_PICTURE_IN_PICTURE", "\u0E40\u0E02\u0E49\u0E32\u0E2A\u0E39\u0E48\u0E01\u0E32\u0E23\u0E41\u0E2A\u0E14\u0E07\u0E20\u0E32\u0E1E\u0E0B\u0E49\u0E2D\u0E19\u0E20\u0E32\u0E1E"],
        ["EXIT_FULL_SCREEN", "\u0E2D\u0E2D\u0E01\u0E08\u0E32\u0E01\u0E01\u0E32\u0E23\u0E41\u0E2A\u0E14\u0E07\u0E41\u0E1A\u0E1A\u0E40\u0E15\u0E47\u0E21\u0E2B\u0E19\u0E49\u0E32\u0E08\u0E2D"],
        [
          "EXIT_LOOP_MODE",
          "\u0E2B\u0E22\u0E38\u0E14\u0E27\u0E19\u0E0B\u0E49\u0E33\u0E27\u0E34\u0E14\u0E35\u0E42\u0E2D\u0E1B\u0E31\u0E08\u0E08\u0E38\u0E1A\u0E31\u0E19"
        ],
        ["EXIT_PICTURE_IN_PICTURE", "\u0E2D\u0E2D\u0E01\u0E08\u0E32\u0E01\u0E01\u0E32\u0E23\u0E41\u0E2A\u0E14\u0E07\u0E20\u0E32\u0E1E\u0E0B\u0E49\u0E2D\u0E19\u0E20\u0E32\u0E1E"],
        ["FAST_FORWARD", "\u0E01\u0E23\u0E2D\u0E44\u0E1B\u0E02\u0E49\u0E32\u0E07\u0E2B\u0E19\u0E49\u0E32"],
        ["FULL_SCREEN", "\u0E40\u0E15\u0E47\u0E21\u0E2B\u0E19\u0E49\u0E32\u0E08\u0E2D"],
        ["LANGUAGE", "\u0E20\u0E32\u0E29\u0E32"],
        ["LIVE", "\u0E2A\u0E14"],
        ["LOOP", "\u0E25\u0E39\u0E1B"],
        ["MORE_SETTINGS", "\u0E01\u0E32\u0E23\u0E15\u0E31\u0E49\u0E07\u0E04\u0E48\u0E32\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E40\u0E15\u0E34\u0E21"],
        ["MULTIPLE_LANGUAGES", "\u0E2B\u0E25\u0E32\u0E22\u0E20\u0E32\u0E29\u0E32"],
        ["MUTE", "\u0E1B\u0E34\u0E14\u0E40\u0E2A\u0E35\u0E22\u0E07"],
        ["NOT_APPLICABLE", "\u0E44\u0E21\u0E48\u0E40\u0E01\u0E35\u0E48\u0E22\u0E27\u0E02\u0E49\u0E2D\u0E07"],
        ["OFF", "\u0E1B\u0E34\u0E14"],
        ["ON", "\u0E40\u0E1B\u0E34\u0E14"],
        ["PAUSE", "\u0E2B\u0E22\u0E38\u0E14\u0E0A\u0E31\u0E48\u0E27\u0E04\u0E23\u0E32\u0E27"],
        ["PICTURE_IN_PICTURE", "\u0E01\u0E32\u0E23\u0E41\u0E2A\u0E14\u0E07\u0E20\u0E32\u0E1E\u0E0B\u0E49\u0E2D\u0E19\u0E20\u0E32\u0E1E"],
        ["PLAY", "\u0E40\u0E25\u0E48\u0E19"],
        ["PLAYBACK_RATE", "\u0E04\u0E27\u0E32\u0E21\u0E40\u0E23\u0E47\u0E27\u0E43\u0E19\u0E01\u0E32\u0E23\u0E40\u0E25\u0E48\u0E19"],
        ["QUALITY", "\u0E04\u0E38\u0E13\u0E20\u0E32\u0E1E"],
        ["RECENTER_VR", "\u0E08\u0E31\u0E14\u0E01\u0E36\u0E48\u0E07\u0E01\u0E25\u0E32\u0E07\u0E43\u0E2B\u0E21\u0E48"],
        ["REPLAY", "\u0E40\u0E25\u0E48\u0E19\u0E0B\u0E49\u0E33"],
        ["RESOLUTION", "\u0E04\u0E27\u0E32\u0E21\u0E25\u0E30\u0E40\u0E2D\u0E35\u0E22\u0E14"],
        ["REWIND", "\u0E01\u0E23\u0E2D\u0E01\u0E25\u0E31\u0E1A"],
        ["SEEK", "\u0E04\u0E49\u0E19\u0E2B\u0E32"],
        ["SKIP_AD", "\u0E02\u0E49\u0E32\u0E21\u0E42\u0E06\u0E29\u0E13\u0E32"],
        ["SKIP_TO_LIVE", "\u0E02\u0E49\u0E32\u0E21\u0E44\u0E1B\u0E17\u0E35\u0E48\u0E01\u0E32\u0E23\u0E16\u0E48\u0E32\u0E22\u0E17\u0E2D\u0E14\u0E2A\u0E14"],
        ["STATISTICS", "\u0E2A\u0E16\u0E34\u0E15\u0E34"],
        ["SUBTITLE_FORCED", "\u0E1A\u0E31\u0E07\u0E04\u0E31\u0E1A"],
        ["SURROUND", "\u0E40\u0E0B\u0E2D\u0E23\u0E4C\u0E23\u0E32\u0E27\u0E14\u0E4C"],
        ["TOGGLE_STEREOSCOPIC", "\u0E40\u0E1B\u0E34\u0E14/\u0E1B\u0E34\u0E14\u0E1F\u0E35\u0E40\u0E08\u0E2D\u0E23\u0E4C\u0E2A\u0E32\u0E21\u0E21\u0E34\u0E15\u0E34"],
        ["UNDETERMINED_LANGUAGE", "\u0E44\u0E21\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14"],
        ["UNMUTE", "\u0E40\u0E1B\u0E34\u0E14\u0E40\u0E2A\u0E35\u0E22\u0E07"],
        ["UNRECOGNIZED_LANGUAGE", "\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01"],
        ["VOLUME", "\u0E23\u0E30\u0E14\u0E31\u0E1A\u0E40\u0E2A\u0E35\u0E22\u0E07"]
      ]));
      a.Wa("tr", /* @__PURE__ */ new Map([
        ["AD_DURATION", "Reklam s\xFCresi"],
        ["AD_PROGRESS", "[AD_ON]/[NUM_ADS] reklam"],
        ["AD_STATISTICS", "Reklam istatistikleri"],
        ["AD_TIME", "Reklam: [AD_TIME]"],
        ["AIRPLAY", "AirPlay"],
        ["AUTO_QUALITY", "Otomatik"],
        ["BACK", "Geri"],
        ["CAPTIONS", "Altyaz\u0131lar"],
        ["CAST", "Yay\u0131nla..."],
        ["CHAPTERS", "B\xF6l\xFCmler"],
        ["DOWNLOAD_VIDEO_FRAME", "Video karesini kaydet"],
        ["ENTER_LOOP_MODE", "Mevcut videoyu d\xF6ng\xFCye al"],
        ["ENTER_PICTURE_IN_PICTURE", "Pencere i\xE7inde Pencere moduna gir"],
        ["EXIT_FULL_SCREEN", "Tam ekrandan \xE7\u0131k"],
        ["EXIT_LOOP_MODE", "Mevcut videonun d\xF6ng\xFCs\xFCn\xFC durdur"],
        ["EXIT_PICTURE_IN_PICTURE", "Pencere \u0130\xE7inde Pencereden \xC7\u0131k"],
        ["FAST_FORWARD", "\u0130leri sar"],
        ["FULL_SCREEN", "Tam ekran"],
        ["LANGUAGE", "Dil"],
        ["LIVE", "Canl\u0131"],
        ["LOOP", "D\xF6ng\xFC"],
        ["MORE_SETTINGS", "Daha fazla ayar"],
        ["MULTIPLE_LANGUAGES", "Birden \xE7ok dil"],
        ["MUTE", "Sesi kapat"],
        ["NOT_APPLICABLE", "Ge\xE7erli de\u011Fil"],
        ["OFF", "Kapal\u0131"],
        ["ON", "A\xE7\u0131k"],
        ["PAUSE", "Duraklat"],
        ["PICTURE_IN_PICTURE", "Pencere \u0130\xE7inde Pencere"],
        ["PLAY", "Oynat"],
        ["PLAYBACK_RATE", "\xC7alma h\u0131z\u0131"],
        ["QUALITY", "Kalite"],
        ["RECENTER_VR", "Ortala"],
        ["REPLAY", "Tekrar Oynat"],
        ["RESOLUTION", "\xC7\xF6z\xFCn\xFCrl\xFCk"],
        ["REWIND", "Geri sar"],
        ["SEEK", "Ara"],
        ["SKIP_AD", "Reklam\u0131 Atla"],
        ["SKIP_TO_LIVE", "Canl\u0131 yay\u0131na atla"],
        ["STATISTICS", "\u0130statistikler"],
        ["SUBTITLE_FORCED", "Zorunlu"],
        ["SURROUND", "Surround"],
        [
          "TOGGLE_STEREOSCOPIC",
          "Stereoskopik modu a\xE7/kapat"
        ],
        ["UNDETERMINED_LANGUAGE", "Belirsiz"],
        ["UNMUTE", "Sesi a\xE7"],
        ["UNRECOGNIZED_LANGUAGE", "Tan\u0131nmayan"],
        ["VOLUME", "Ses"]
      ]));
      a.Wa("zh", /* @__PURE__ */ new Map([
        ["AD_DURATION", "\u5E7F\u544A\u6301\u7EED\u65F6\u95F4"],
        ["AD_PROGRESS", "\u5E7F\u544A [AD_ON]/[NUM_ADS]"],
        ["AD_STATISTICS", "\u5E7F\u544A\u7EDF\u8BA1\u4FE1\u606F"],
        ["AD_TIME", "\u5E7F\u544A\uFF1A[AD_TIME]"],
        ["AIRPLAY", "AirPlay"],
        ["AUTO_QUALITY", "\u81EA\u52A8"],
        ["BACK", "\u8FD4\u56DE"],
        ["CAPTIONS", "\u5B57\u5E55"],
        ["CAST", "\u6295\u653E\u2026"],
        ["CHAPTERS", "\u7AE0\u8282"],
        ["DOWNLOAD_VIDEO_FRAME", "\u4FDD\u5B58\u89C6\u9891\u5E27"],
        ["ENTER_LOOP_MODE", "\u5FAA\u73AF\u64AD\u653E\u5F53\u524D\u89C6\u9891"],
        ["ENTER_PICTURE_IN_PICTURE", "\u8FDB\u5165\u201C\u753B\u4E2D\u753B\u201D\u6A21\u5F0F"],
        ["EXIT_FULL_SCREEN", "\u9000\u51FA\u5168\u5C4F\u6A21\u5F0F"],
        ["EXIT_LOOP_MODE", "\u505C\u6B62\u5FAA\u73AF\u64AD\u653E\u5F53\u524D\u89C6\u9891"],
        ["EXIT_PICTURE_IN_PICTURE", "\u9000\u51FA\u201C\u753B\u4E2D\u753B\u201D\u6A21\u5F0F"],
        ["FAST_FORWARD", "\u5FEB\u8FDB"],
        ["FULL_SCREEN", "\u5168\u5C4F"],
        ["LANGUAGE", "\u8BED\u8A00"],
        ["LIVE", "\u76F4\u64AD"],
        ["LOOP", "\u5FAA\u73AF\u64AD\u653E"],
        ["MORE_SETTINGS", "\u66F4\u591A\u8BBE\u7F6E"],
        ["MULTIPLE_LANGUAGES", "\u591A\u79CD\u8BED\u8A00"],
        ["MUTE", "\u9759\u97F3"],
        ["NOT_APPLICABLE", "\u4E0D\u9002\u7528"],
        ["OFF", "\u5173\u95ED"],
        ["ON", "\u5F00\u542F"],
        ["PAUSE", "\u6682\u505C"],
        ["PICTURE_IN_PICTURE", "\u753B\u4E2D\u753B"],
        ["PLAY", "\u64AD\u653E"],
        ["PLAYBACK_RATE", "\u64AD\u653E\u901F\u5EA6"],
        ["QUALITY", "\u753B\u8D28"],
        [
          "RECENTER_VR",
          "\u91CD\u65B0\u7F6E\u4E2D"
        ],
        ["REPLAY", "\u91CD\u653E"],
        ["RESOLUTION", "\u5206\u8FA8\u7387"],
        ["REWIND", "\u5FEB\u9000"],
        ["SEEK", "\u8FDB\u5EA6"],
        ["SKIP_AD", "\u8DF3\u8FC7\u5E7F\u544A"],
        ["SKIP_TO_LIVE", "\u8DF3\u81F3\u5F53\u524D\u76F4\u64AD"],
        ["STATISTICS", "\u7EDF\u8BA1\u4FE1\u606F"],
        ["SUBTITLE_FORCED", "\u5DF2\u5F3A\u5236\u663E\u793A"],
        ["SURROUND", "\u73AF\u7ED5\u58F0"],
        ["TOGGLE_STEREOSCOPIC", "\u5207\u6362\u7ACB\u4F53\u58F0"],
        ["UNDETERMINED_LANGUAGE", "\u672A\u786E\u5B9A"],
        ["UNMUTE", "\u53D6\u6D88\u9759\u97F3"],
        ["UNRECOGNIZED_LANGUAGE", "\u65E0\u6CD5\u8BC6\u522B"],
        ["VOLUME", "\u97F3\u91CF"]
      ]));
      a.Wa("zh-TW", /* @__PURE__ */ new Map([
        ["AD_DURATION", "\u5EE3\u544A\u9577\u5EA6"],
        ["AD_PROGRESS", "\u5EE3\u544A [AD_ON]/[NUM_ADS]"],
        ["AD_STATISTICS", "\u5EE3\u544A\u7D71\u8A08\u8CC7\u6599"],
        ["AD_TIME", "\u5EE3\u544A\uFF1A[AD_TIME]"],
        ["AIRPLAY", "AirPlay"],
        ["AUTO_QUALITY", "\u81EA\u52D5"],
        ["BACK", "\u8FD4\u56DE"],
        ["CAPTIONS", "\u5B57\u5E55"],
        ["CAST", "\u6295\u653E..."],
        ["CHAPTERS", "\u7AE0\u7BC0"],
        ["DOWNLOAD_VIDEO_FRAME", "\u5132\u5B58\u5F71\u7247\u5F71\u683C"],
        ["ENTER_LOOP_MODE", "\u5FAA\u74B0\u64AD\u653E\u76EE\u524D\u7684\u5F71\u7247"],
        ["ENTER_PICTURE_IN_PICTURE", "\u9032\u5165\u5B50\u6BCD\u756B\u9762"],
        ["EXIT_FULL_SCREEN", "\u9000\u51FA\u5168\u87A2\u5E55\u6A21\u5F0F"],
        ["EXIT_LOOP_MODE", "\u505C\u6B62\u5FAA\u74B0\u64AD\u653E\u76EE\u524D\u7684\u5F71\u7247"],
        ["EXIT_PICTURE_IN_PICTURE", "\u96E2\u958B\u5B50\u6BCD\u756B\u9762"],
        ["FAST_FORWARD", "\u5FEB\u8F49"],
        ["FULL_SCREEN", "\u5168\u87A2\u5E55"],
        ["LANGUAGE", "\u8A9E\u8A00"],
        ["LIVE", "\u76F4\u64AD"],
        ["LOOP", "\u5FAA\u74B0\u64AD\u653E"],
        ["MORE_SETTINGS", "\u986F\u793A\u66F4\u591A\u8A2D\u5B9A"],
        ["MULTIPLE_LANGUAGES", "\u591A\u7A2E\u8A9E\u8A00"],
        ["MUTE", "\u975C\u97F3"],
        ["NOT_APPLICABLE", "\u4E0D\u9069\u7528"],
        ["OFF", "\u95DC\u9589"],
        ["ON", "\u958B\u555F"],
        ["PAUSE", "\u66AB\u505C"],
        ["PICTURE_IN_PICTURE", "\u5B50\u6BCD\u756B\u9762"],
        ["PLAY", "\u64AD\u653E"],
        ["PLAYBACK_RATE", "\u64AD\u653E\u901F\u5EA6"],
        ["QUALITY", "\u97F3\u8CEA"],
        ["RECENTER_VR", "\u91CD\u65B0\u7F6E\u4E2D"],
        ["REPLAY", "\u91CD\u64AD"],
        ["RESOLUTION", "\u89E3\u6790\u5EA6"],
        [
          "REWIND",
          "\u5012\u8F49"
        ],
        ["SEEK", "\u641C\u5C0B"],
        ["SKIP_AD", "\u7565\u904E\u5EE3\u544A"],
        ["SKIP_TO_LIVE", "\u8DF3\u81F3\u5F53\u524D\u76F4\u64AD"],
        ["STATISTICS", "\u7D71\u8A08\u8CC7\u6599"],
        ["SUBTITLE_FORCED", "\u5F37\u5236\u986F\u793A"],
        ["SURROUND", "\u74B0\u5834\u97F3\u6548"],
        ["TOGGLE_STEREOSCOPIC", "\u5207\u63DB\u7ACB\u9AD4\u5F71\u50CF"],
        ["UNDETERMINED_LANGUAGE", "\u4E0D\u660E"],
        ["UNMUTE", "\u53D6\u6D88\u975C\u97F3"],
        ["UNRECOGNIZED_LANGUAGE", "\u7121\u6CD5\u8FA8\u8B58"],
        ["VOLUME", "\u97F3\u91CF"]
      ]));
      a.Li(navigator.languages || []);
      return a;
    }
    S("shaka.ui.Controls", Z);
    Z.prototype.incrementRoll = Z.prototype.Ah;
    Z.prototype.incrementPitch = Z.prototype.yh;
    Z.prototype.incrementYaw = Z.prototype.Bh;
    Z.prototype.toggleStereoscopicMode = Z.prototype.Wd;
    Z.prototype.setVRFieldOfView = Z.prototype.vm;
    Z.prototype.getVRFieldOfView = Z.prototype.rl;
    Z.prototype.getVRNorth = Z.prototype.ul;
    Z.prototype.isPlayingVR = Z.prototype.Wb;
    Z.prototype.canPlayVR = Z.prototype.Lg;
    Z.prototype.hideUI = Z.prototype.bj;
    Z.prototype.showUI = Z.prototype.wm;
    Z.prototype.isOpaque = Z.prototype.Ca;
    Z.prototype.hideAdUI = Z.prototype.aj;
    Z.prototype.showAdUI = Z.prototype.Rj;
    Z.prototype.togglePiP = Z.prototype.Vc;
    Z.prototype.isPiPEnabled = Z.prototype.Id;
    Z.prototype.isPiPAllowed = Z.prototype.Df;
    Z.prototype.toggleFullScreen = Z.prototype.ng;
    Z.prototype.isFullScreenEnabled = Z.prototype.wc;
    Z.prototype.isFullScreenSupported = Z.prototype.se;
    Z.prototype.hideSettingsMenus = Z.prototype.Rc;
    Z.prototype.anySettingsMenusAreOpen = Z.prototype.Hc;
    Z.prototype.setLastTouchEventTime = Z.prototype.Mj;
    Z.prototype.getDisplayTime = Z.prototype.oh;
    Z.prototype.isCastAllowed = Z.prototype.Bl;
    Z.prototype.setSeeking = Z.prototype.ii;
    Z.prototype.isSeeking = Z.prototype.Hl;
    Z.prototype.getConfig = Z.prototype.Gk;
    Z.prototype.getClientSideAdContainer = Z.prototype.Fk;
    Z.prototype.getServerSideAdContainer = Z.prototype.il;
    Z.prototype.getControlsContainer = Z.prototype.Jk;
    Z.prototype.getLocalPlayer = Z.prototype.Sk;
    Z.prototype.getPlayer = Z.prototype.Vb;
    Z.prototype.getLocalVideo = Z.prototype.Tk;
    Z.prototype.getVideo = Z.prototype.Pc;
    Z.prototype.getVideoContainer = Z.prototype.wl;
    Z.prototype.getLocalization = Z.prototype.Uk;
    Z.prototype.getCastProxy = Z.prototype.Ck;
    Z.prototype.getAd = Z.prototype.getAd;
    Z.prototype.setEnabledNativeControls = Z.prototype.Lj;
    Z.prototype.setEnabledShakaControls = Z.prototype.di;
    Z.prototype.configure = Z.prototype.configure;
    Z.prototype.loadComplete = Z.prototype.Kl;
    Z.prototype.allowCast = Z.prototype.jk;
    Z.registerSeekBar = function(a) {
      UH = a;
    };
    Z.registerElement = CH;
    Z.prototype.destroy = Z.prototype.destroy;
    var DH = /* @__PURE__ */ new Map(), UH = new LG();
    function aI(a, b) {
      function c() {
        return bI(d);
      }
      fG.call(this, a, b);
      var d = this;
      this.m = this.controls.g;
      this.l = this.controls.i;
      this.u = this.controls.l;
      this.j = [];
      cI(this);
      this.g = W("div");
      this.g.classList.add("shaka-overflow-menu");
      this.g.classList.add("shaka-no-propagation");
      this.g.classList.add("shaka-show-controls-on-mouse-over");
      this.g.classList.add("shaka-hidden");
      this.l.appendChild(this.g);
      dI(this);
      this.eventManager.o(this.localization, "locale-updated", function() {
        eI(d);
      });
      this.eventManager.o(
        this.localization,
        "locale-changed",
        function() {
          eI(d);
        }
      );
      this.eventManager.o(this.adManager, "ad-started", function() {
        d.ad && d.ad.isLinear() && kG(d.h, false);
      });
      this.eventManager.o(this.adManager, "ad-stopped", function() {
        kG(d.h, true);
      });
      this.eventManager.o(this.controls, "submenuopen", function() {
        kG(d.g, false);
      });
      this.eventManager.o(this.g, "touchstart", function(e) {
        d.controls.Mj(Date.now());
        e.stopPropagation();
      });
      this.eventManager.o(this.h, "click", function() {
        d.controls.Ca() && fI(d);
      });
      eI(this);
      this.ad && this.ad.isLinear() && kG(this.h, false);
      this.i = null;
      window2.ResizeObserver ? (this.i = new ResizeObserver(c), this.i.observe(this.controls.l)) : this.eventManager.o(window2, "resize", c);
    }
    ma(aI, fG);
    aI.prototype.release = function() {
      this.l = null;
      for (var a = t(this.j), b = a.next(); !b.done; b = a.next()) b.value.release();
      this.j = [];
      this.i && (this.i.disconnect(), this.i = null);
      fG.prototype.release.call(this);
    };
    function gI(a, b) {
      hI.set(a, b);
    }
    function cI(a) {
      a.h = Oj();
      a.h.classList.add("shaka-overflow-menu-button");
      a.h.classList.add("shaka-no-propagation");
      a.h.classList.add("material-icons-round");
      a.h.classList.add("shaka-tooltip");
      a.h.textContent = "settings";
      var b = W("span");
      b.classList.add("shaka-overflow-quality-mark");
      b.style.display = "none";
      a.h.appendChild(b);
      a.parent.appendChild(a.h);
    }
    function dI(a) {
      for (var b = t(a.m.overflowMenuButtons), c = b.next(); !c.done; c = b.next()) c = c.value, hI.get(c) ? (c = hI.get(c), a.j.push(c.create(a.g, a.controls))) : bb("Unrecognized overflow menu element requested:", c);
    }
    function fI(a) {
      if (a.controls.Hc()) a.controls.Rc();
      else {
        kG(a.g, true);
        rH(a.controls);
        var b = function(c) {
          return c.classList.contains("shaka-hidden") == 0;
        };
        ob(a.g.childNodes, b) && pb(a.g.childNodes, b)[0].focus();
        bI(a);
      }
    }
    function eI(a) {
      a.h.ariaLabel = a.localization.resolve("MORE_SETTINGS");
    }
    function bI(a) {
      var b = a.g.getBoundingClientRect(), c = window2.getComputedStyle(a.g), d = parseFloat(c.paddingTop);
      c = parseFloat(c.paddingBottom);
      var e = a.u.getBoundingClientRect();
      a.g.style.maxHeight = b.bottom - e.top - d - c + "px";
    }
    S("shaka.ui.OverflowMenu", aI);
    aI.registerElement = gI;
    function iI() {
    }
    iI.prototype.create = function(a, b) {
      return new aI(a, b);
    };
    CH("overflow_menu", new iI());
    var hI = /* @__PURE__ */ new Map();
    function jI(a, b) {
      function c(e) {
        return d.i[e];
      }
      fG.call(this, a, b);
      var d = this;
      this.h = Oj();
      this.h.classList.add("shaka-ad-statistics-button");
      this.j = W("i");
      this.j.classList.add("material-icons-round");
      this.j.textContent = "insert_chart_outlined";
      this.h.appendChild(this.j);
      a = W("label");
      a.classList.add("shaka-overflow-button-label");
      a.classList.add("shaka-simple-overflow-button-label-inline");
      this.A = W("span");
      a.appendChild(this.A);
      this.m = W("span");
      this.m.classList.add("shaka-current-selection-span");
      a.appendChild(this.m);
      this.h.appendChild(a);
      this.parent.appendChild(this.h);
      this.g = W("div");
      this.g.classList.add("shaka-no-propagation");
      this.g.classList.add("shaka-show-controls-on-mouse-over");
      this.g.classList.add("shaka-ad-statistics-container");
      this.g.classList.add("shaka-hidden");
      this.controls.i.appendChild(this.g);
      this.D = [];
      this.i = this.adManager.getStats();
      kG(this.h, this.i.started > 0);
      this.u = /* @__PURE__ */ new Map();
      this.C = (/* @__PURE__ */ new Map()).set("loadTimes", function(e) {
        var f = 0;
        e = t(d.i[e]);
        for (var g = e.next(); !g.done; g = e.next()) f += parseFloat(g.value);
        return f;
      }).set("averageLoadTime", c).set("started", c).set("overlayAds", c).set("playedCompletely", c).set("skipped", c).set("errors", c);
      this.l = new Cf(function() {
        d.i = d.adManager.getStats();
        for (var e = t(d.D), f = e.next(); !f.done; f = e.next()) f = f.value, d.u.get(f).textContent = d.C.get(f)(f);
      });
      kI(this);
      lI(this);
      this.eventManager.o(this.localization, "locale-updated", function() {
        kI(d);
      });
      this.eventManager.o(this.localization, "locale-changed", function() {
        kI(d);
      });
      this.eventManager.o(this.h, "click", function() {
        d.controls.Ca() && (mI(d), kI(d));
      });
      this.eventManager.o(this.player, "loading", function() {
        kG(d.h, false);
      });
      this.eventManager.o(this.adManager, "ad-started", function() {
        kG(d.h, true);
      });
    }
    ma(jI, fG);
    function mI(a) {
      a.g.classList.contains("shaka-hidden") ? (a.j.textContent = "insert_chart", a.l.za(0.1), kG(a.g, true)) : (a.j.textContent = "insert_chart_outlined", a.l.stop(), kG(a.g, false));
    }
    function kI(a) {
      a.A.textContent = a.localization.resolve("AD_STATISTICS");
      a.h.ariaLabel = a.localization.resolve("AD_STATISTICS");
      a.m.textContent = a.localization.resolve(a.g.classList.contains("shaka-hidden") ? "OFF" : "ON");
    }
    function nI(a, b) {
      var c = W("div"), d = W("label");
      d.textContent = b + ":";
      c.appendChild(d);
      d = W("span");
      d.textContent = a.C.get(b)(b);
      c.appendChild(d);
      a.u.set(b, d);
      return c;
    }
    function lI(a) {
      var b = W("div");
      b.classList.add("shaka-no-propagation");
      b.classList.add("shaka-statistics-close");
      var c = W("i");
      c.classList.add("material-icons");
      c.classList.add("notranslate");
      c.classList.add("material-icons-round");
      c.textContent = "close";
      b.appendChild(c);
      a.g.appendChild(b);
      a.eventManager.o(c, "click", function() {
        mI(a);
      });
      b = t(a.controls.g.adStatisticsList);
      for (c = b.next(); !c.done; c = b.next()) c = c.value, c in a.i ? (a.g.appendChild(nI(a, c)), a.D.push(c)) : bb(
        "Unrecognized ad statistic element:",
        c
      );
    }
    jI.prototype.release = function() {
      this.l.stop();
      this.l = null;
      fG.prototype.release.call(this);
    };
    S("shaka.ui.AdStatisticsButton", jI);
    function oI() {
    }
    oI.prototype.create = function(a, b) {
      return new jI(a, b);
    };
    gI("ad_statistics", new oI());
    pG("ad_statistics", new oI());
    function pI(a, b) {
      fG.call(this, a, b);
      var c = this;
      this.g = Oj();
      this.g.classList.add("shaka-airplay-button");
      this.g.classList.add("shaka-tooltip");
      this.g.ariaPressed = "false";
      this.h = W("i");
      this.h.classList.add("material-icons-round");
      this.h.textContent = "airplay";
      this.g.appendChild(this.h);
      window2.WebKitPlaybackTargetAvailabilityEvent || this.g.classList.add("shaka-hidden");
      a = W("label");
      a.classList.add("shaka-overflow-button-label");
      a.classList.add("shaka-overflow-menu-only");
      this.j = W("span");
      a.appendChild(this.j);
      this.i = W("span");
      this.i.classList.add("shaka-current-selection-span");
      a.appendChild(this.i);
      this.g.appendChild(a);
      this.parent.appendChild(this.g);
      qI(this);
      rI(this);
      this.eventManager.o(this.localization, "locale-updated", function() {
        qI(c);
      });
      this.eventManager.o(this.localization, "locale-changed", function() {
        qI(c);
      });
      this.eventManager.o(this.g, "click", function() {
        c.controls.Ca() && c.controls.Pc().webkitShowPlaybackTargetPicker();
      });
      a = this.controls.Pc();
      this.eventManager.o(
        a,
        "webkitplaybacktargetavailabilitychanged",
        function(d) {
          var e = c.player.m == ar;
          kG(c.g, d.availability == "available" && e);
        }
      );
      this.eventManager.o(a, "webkitcurrentplaybacktargetiswirelesschanged", function() {
        rI(c);
      });
    }
    ma(pI, fG);
    function rI(a) {
      var b = a.controls.Pc();
      a.g.ariaPressed = b && b.webkitCurrentPlaybackTargetIsWireless ? "true" : "false";
    }
    function qI(a) {
      a.g.ariaLabel = a.localization.resolve("AIRPLAY");
      a.j.textContent = a.localization.resolve("AIRPLAY");
    }
    S("shaka.ui.AirPlayButton", pI);
    function sI() {
    }
    sI.prototype.create = function(a, b) {
      return new pI(a, b);
    };
    gI("airplay", new sI());
    CH("airplay", new sI());
    function tI(a, b) {
      fG.call(this, a, b);
      var c = this;
      this.g = document.createElement("canvas");
      this.g.style.position = "absolute";
      this.g.style.top = "0";
      this.g.style.left = "0";
      this.g.style.pointerEvents = "none";
      this.parent.appendChild(this.g);
      uI(this);
      this.i = this.h = null;
      window2.ResizeObserver ? (this.i = new ResizeObserver(function() {
        return uI(c);
      }), this.i.observe(this.parent)) : window2.addEventListener("resize", function() {
        return uI(c);
      });
    }
    ma(tI, fG);
    function vI(a) {
      return (a = a.g.getContext("2d")) ? a : null;
    }
    function uI(a) {
      a.g.width = a.parent.offsetWidth;
      a.g.height = a.parent.offsetHeight;
    }
    tI.prototype.ig = function(a, b) {
      a = { type: "static", text: a, position: "top-right", color: "rgba(255, 255, 255, 0.7)", size: 20, alpha: 0.7, interval: 2e3, skip: 500, displayDuration: 2e3, transitionDuration: 0.5 };
      b = Object.assign({}, a, b || a);
      if (b.type === "static") {
        if (a = vI(this)) {
          a.clearRect(0, 0, this.g.width, this.g.height);
          a.globalAlpha = b.alpha;
          a.fillStyle = b.color;
          a.font = b.size + "px Arial";
          var c = a.measureText(b.text);
          switch (b.position) {
            case "top-left":
              c = 20;
              var d = b.size + 20;
              break;
            case "top-right":
              c = this.g.width - c.width - 20;
              d = b.size + 20;
              break;
            case "bottom-left":
              c = 20;
              d = this.g.height - 20;
              break;
            case "bottom-right":
              c = this.g.width - c.width - 20;
              d = this.g.height - 20;
              break;
            default:
              c = (this.g.width - c.width) / 2, d = (this.g.height + b.size) / 2;
          }
          a.fillText(b.text, c, d);
        }
      } else b.type === "dynamic" && wI(this, b);
    };
    function wI(a, b) {
      function c() {
        if (a.h) {
          e.clearRect(0, 0, a.g.width, a.g.height);
          switch (h) {
            case "fadeIn":
              g = Math.min(b.alpha, g + l);
              g >= b.alpha && (h = "display");
              break;
            case "display":
              --k2 <= 0 && (h = "fadeOut");
              break;
            case "fadeOut":
              g = Math.max(0, g - l), g <= 0 && (h = "transition", f = d(), k2 = Math.round(b.displayDuration * 60), h = "fadeIn");
          }
          g > 0 && (e.globalAlpha = g, e.fillStyle = b.color, e.font = b.size + "px Arial", e.fillText(b.text, f.left, f.top));
          a.h && (a.h = requestAnimationFrame(c));
        }
      }
      function d() {
        e.font = b.size + "px Arial";
        var n = e.measureText(b.text).width, q = b.size;
        n = [{ left: 20, top: q + 20 }, { left: a.g.width - n - 20, top: q + 20 }, { left: 20, top: a.g.height - 20 }, { left: a.g.width - n - 20, top: a.g.height - 20 }, { left: (a.g.width - n) / 2, top: (a.g.height + q) / 2 }];
        q = n[m];
        m = (m + 1) % n.length;
        return q;
      }
      var e = a.g.getContext("2d"), f = { left: 0, top: 0 }, g = 0, h = "fadeIn", k2 = Math.round(b.displayDuration * 60), l = 1 / (Math.round(b.transitionDuration * 60) / 2), m = 0;
      f = d();
      a.h = requestAnimationFrame(c);
    }
    tI.prototype.$f = function() {
      this.h && (cancelAnimationFrame(this.h), this.h = null);
      var a = vI(this);
      a && a.clearRect(0, 0, this.g.width, this.g.height);
    };
    tI.prototype.release = function() {
      var a = this;
      this.g && this.g.parentNode && this.g.parentNode.removeChild(this.g);
      this.i ? (this.i.disconnect(), this.i = null) : window2.removeEventListener("resize", function() {
        return uI(a);
      });
      fG.prototype.release.call(this);
    };
    S("shaka.ui.Watermark", tI);
    tI.prototype.removeWatermark = tI.prototype.$f;
    tI.prototype.setTextWatermark = tI.prototype.ig;
    function xI(a, b, c, d) {
      d = d === void 0 ? null : d;
      this.j = a;
      this.l = b;
      this.h = yI(this);
      var e = "", f = false;
      b.dataset && b.dataset.shakaPlayerCastReceiverId ? (f = b.dataset, e = f.shakaPlayerCastReceiverId, f = f.shakaPlayerCastAndroidReceiverCompatible === "true") : c.dataset && c.dataset.shakaPlayerCastReceiverId && (f = c.dataset, e = f.shakaPlayerCastReceiverId, f = f.shakaPlayerCastAndroidReceiverCompatible === "true");
      e.length && (this.h.castReceiverAppId = e, this.h.castAndroidReceiverCompatible = f);
      b.dataset.shakaPlayerContainer = "";
      b.ui = this;
      this.Fh() && b.classList.add("shaka-mobile");
      this.g = new Z(a, b, c, d, this.h);
      c.controls || a.ji(b);
      b.ui = this;
      c.ui = this;
      this.i = null;
    }
    p = xI.prototype;
    p.destroy = function(a) {
      a = a === void 0 ? false : a;
      var b = this;
      return P(function(c) {
        if (c.g == 1) return b.g ? G(c, b.g.destroy(a), 2) : c.B(2);
        if (c.g != 4) return b.g = null, b.j ? G(c, b.j.destroy(), 4) : c.B(4);
        b.j = null;
        b.i = null;
        H(c);
      });
    };
    p.Fh = function() {
      return Sb().Ka() == "MOBILE";
    };
    p.Gh = function() {
      return Sb().Ka() == "TV";
    };
    p.getConfiguration = function() {
      var a = yI(this);
      An(a, this.h, yI(this), {}, "");
      return a;
    };
    p.configure = function(a, b) {
      arguments.length == 2 && typeof a == "string" && (a = Bn(a, b));
      var c = Object.assign({}, this.h);
      An(c, a, yI(this), {}, "");
      var d = Dn(c, this.h);
      if (Object.keys(d).length && (this.h = c, this.g.configure(this.h), this.g.dispatchEvent(new T("uiupdated")), (c = this.h.castSenderUrl) && this.h.castReceiverAppId && window2.chrome && !chrome.cast && !this.Gh())) {
        d = false;
        for (var e = t(document.getElementsByTagName("script")), f = e.next(); !f.done; f = e.next()) if (f.value.src === c) {
          d = true;
          break;
        }
        d || (d = document.createElement("script"), d.src = c, d.defer = true, document.head.appendChild(d));
      }
    };
    p.Ik = function() {
      return this.g;
    };
    p.tm = function(a) {
      this.g.di(a);
    };
    p.ig = function(a, b) {
      a && !this.i && this.l && this.g && (this.i = new tI(this.l, this.g));
      this.i && this.i.ig(a, b);
    };
    p.$f = function() {
      this.i && this.i.$f();
    };
    function yI(a) {
      var b = "play_pause skip_next mute volume time_and_duration spacer overflow_menu".split(" ");
      window2.chrome && b.push("cast");
      "remote" in HTMLMediaElement.prototype ? b.push("remote") : window2.WebKitPlaybackTargetAvailabilityEvent && b.push("airplay");
      b.push("fullscreen");
      b = {
        controlPanelElements: b,
        overflowMenuButtons: "captions quality language chapter picture_in_picture playback_rate recenter_vr toggle_stereoscopic save_video_frame".split(" "),
        statisticsList: "width height currentCodecs corruptedFrames decodedFrames droppedFrames drmTimeSeconds licenseTime liveLatency loadLatency bufferingTime manifestTimeSeconds estimatedBandwidth streamBandwidth maxSegmentDuration pauseTime playTime completionPercent manifestSizeBytes bytesDownloaded nonFatalErrorCount manifestPeriodCount manifestGapCount".split(" "),
        adStatisticsList: "loadTimes averageLoadTime started overlayAds playedCompletely skipped errors".split(" "),
        contextMenuElements: ["loop", "picture_in_picture", "save_video_frame", "statistics", "ad_statistics"],
        playbackRates: [0.5, 0.75, 1, 1.25, 1.5, 1.75, 2],
        fastForwardRates: [2, 4, 8, 1],
        rewindRates: [-1, -2, -4, -8],
        addSeekBar: true,
        addBigPlayButton: false,
        customContextMenu: false,
        castReceiverAppId: "",
        castAndroidReceiverCompatible: false,
        clearBufferOnQualityChange: true,
        showUnbufferedStart: false,
        seekBarColors: {
          base: "rgba(255, 255, 255, 0.3)",
          buffered: "rgba(255, 255, 255, 0.54)",
          played: "rgb(255, 255, 255)",
          adBreaks: "rgb(255, 204, 0)"
        },
        volumeBarColors: { base: "rgba(255, 255, 255, 0.54)", level: "rgb(255, 255, 255)" },
        qualityMarks: { 720: "", 1080: "HD", 1440: "2K", 2160: "4K", 4320: "8K" },
        trackLabelFormat: zI,
        textTrackLabelFormat: zI,
        fadeDelay: 0,
        closeMenusDelay: 2,
        doubleClickForFullscreen: true,
        singleClickForPlayAndPause: true,
        enableKeyboardPlaybackControls: true,
        enableFullscreenOnRotation: false,
        forceLandscapeOnFullscreen: false,
        enableTooltips: true,
        keyboardSeekDistance: 5,
        keyboardLargeSeekDistance: 60,
        fullScreenElement: a.l,
        preferDocumentPictureInPicture: true,
        showAudioChannelCountVariants: true,
        seekOnTaps: false,
        tapSeekDistance: 10,
        refreshTickInSeconds: 0.125,
        displayInVrMode: false,
        defaultVrProjectionMode: "equirectangular",
        setupMediaSession: true,
        preferVideoFullScreenInVisionOS: false,
        showAudioCodec: true,
        showVideoCodec: true,
        castSenderUrl: "/cast_sender.js"
      };
      if (a.Fh()) {
        b.addBigPlayButton = true;
        b.singleClickForPlayAndPause = false;
        b.seekOnTaps = true;
        b.enableTooltips = false;
        b.doubleClickForFullscreen = false;
        a = Sb();
        b.enableFullscreenOnRotation = a.Ga() !== "WEBKIT";
        b.forceLandscapeOnFullscreen = true;
        var c = ["play_pause", "skip_next", "volume"];
        b.controlPanelElements = b.controlPanelElements.filter(function(e) {
          return !c.includes(e);
        });
        b.overflowMenuButtons = b.overflowMenuButtons.filter(function(e) {
          return !c.includes(e);
        });
        b.contextMenuElements = b.contextMenuElements.filter(function(e) {
          return !c.includes(e);
        });
      } else if (a.Gh()) {
        b.addBigPlayButton = true;
        b.singleClickForPlayAndPause = false;
        b.enableTooltips = false;
        b.doubleClickForFullscreen = false;
        var d = "play_pause cast remote airplay volume save_video_frame".split(" ");
        b.controlPanelElements = b.controlPanelElements.filter(function(e) {
          return !d.includes(e);
        });
        b.overflowMenuButtons = b.overflowMenuButtons.filter(function(e) {
          return !d.includes(e);
        });
        b.contextMenuElements = b.contextMenuElements.filter(function(e) {
          return !d.includes(e);
        });
      }
      return b;
    }
    function AI() {
      var a, b, c, d, e, f, g, h, k2, l, m, n, q, r, u, w, v, y, z, A, C, D;
      return P(function(F) {
        switch (F.g) {
          case 1:
            uC();
            if (!xq()) return BI("shaka-ui-load-failed", CI), F.return();
            a = document.querySelectorAll("[data-shaka-player-container]");
            b = document.querySelectorAll("[data-shaka-player]");
            c = document.querySelectorAll("[data-shaka-player-canvas]");
            d = document.querySelectorAll("[data-shaka-player-vr-canvas]");
            if (!b.length && !a.length) {
              F.B(2);
              break;
            }
            if (b.length && !a.length) {
              e = t(b);
              for (f = e.next(); !f.done; f = e.next()) g = f.value, g.ui || (h = document.createElement("div"), k2 = g.parentElement, k2.replaceChild(h, g), h.appendChild(g), l = DI(h, c, d), m = l.hj, n = l.fk, EI(h, g, m, n));
              F.B(2);
              break;
            }
            q = t(a);
            r = q.next();
          case 4:
            if (r.done) {
              F.B(2);
              break;
            }
            u = r.value;
            if (u.ui) {
              F.B(5);
              break;
            }
            w = null;
            v = t(b);
            for (y = v.next(); !y.done; y = v.next()) if (z = y.value, z.parentElement == u) {
              w = z;
              break;
            }
            w || (w = document.createElement("video"), w.setAttribute("playsinline", ""), u.appendChild(w));
            A = DI(u, c, d);
            C = A.hj;
            D = A.fk;
            sa(F, 7);
            return G(F, EI(u, w, C, D), 9);
          case 9:
            ua(F, 5);
            break;
          case 7:
            return va(F), BI("shaka-ui-load-failed", FI), F.return();
          case 5:
            r = q.next();
            F.B(4);
            break;
          case 2:
            BI("shaka-ui-loaded"), H(F);
        }
      });
    }
    function BI(a, b) {
      var c = null;
      b != void 0 && (c = { reasonCode: b });
      a = new CustomEvent(a, { detail: c });
      document.dispatchEvent(a);
    }
    function EI(a, b, c, d) {
      var e, f, g, h, k2, l, m, n, q, r;
      return P(function(u) {
        switch (u.g) {
          case 1:
            e = new Y();
            f = new xI(e, a, b, d ? d : null);
            e.Gi(c);
            b.controls && f.g.Lj(true);
            g = [];
            if (h = b.getAttribute("src")) g.push(h), b.removeAttribute("src");
            k2 = t(b.getElementsByTagName("source"));
            for (l = k2.next(); !l.done; l = k2.next()) m = l.value, g.push(m.src), b.removeChild(m);
            return G(u, e.bc(b), 2);
          case 2:
            n = t(g), q = n.next();
          case 3:
            if (q.done) {
              u.B(0);
              break;
            }
            r = q.value;
            sa(u, 6);
            return G(u, f.g.Vb().load(r), 8);
          case 8:
            u.B(0);
            break;
          case 6:
            va(u);
          case 4:
            q = n.next(), u.B(3);
        }
      });
    }
    function DI(a, b, c) {
      var d = null;
      b = t(b);
      for (var e = b.next(); !e.done; e = b.next()) if (e = e.value, e.parentElement == a) {
        d = e;
        break;
      }
      d || (d = document.createElement("canvas"), d.classList.add("shaka-canvas-container"), a.appendChild(d));
      b = null;
      c = t(c);
      for (e = c.next(); !e.done; e = c.next()) if (e = e.value, e.parentElement == a) {
        b = e;
        break;
      }
      return { hj: d, fk: b };
    }
    S("shaka.ui.Overlay", xI);
    xI.prototype.removeWatermark = xI.prototype.$f;
    xI.prototype.setTextWatermark = xI.prototype.ig;
    xI.prototype.setEnabled = xI.prototype.tm;
    xI.prototype.getControls = xI.prototype.Ik;
    xI.prototype.configure = xI.prototype.configure;
    xI.prototype.getConfiguration = xI.prototype.getConfiguration;
    xI.prototype.isSmartTV = xI.prototype.Gh;
    xI.prototype.isMobile = xI.prototype.Fh;
    xI.prototype.destroy = xI.prototype.destroy;
    var zI = 0;
    xI.TrackLabelFormat = { LANGUAGE: zI, ROLE: 1, LANGUAGE_ROLE: 2, LABEL: 3 };
    var CI = 0, FI = 1;
    xI.FailReasonCode = { NO_BROWSER_SUPPORT: CI, PLAYER_FAILED_TO_LOAD: FI };
    document.readyState == "complete" ? P(function(a) {
      if (a.g == 1) return G(a, Promise.resolve(), 2);
      AI();
      H(a);
    }) : window2.addEventListener("load", AI);
    function GI(a, b, c, d, e, f, g, h) {
      function k2(J) {
        var K = "";
        J == "aac" ? K = "AAC" : J === "ac-3" ? K = "Dolby" : J === "ec-3" ? K = "DD+" : J === "ac-4" ? K = "Dolby AC-4" : J === "opus" ? K = "Opus" : J === "flac" && (K = "fLaC");
        return K ? " " + K : K;
      }
      function l(J) {
        var K = "";
        J >= 5 && (K = " " + e.resolve("SURROUND"));
        return K;
      }
      function m(J, K, L, M, N, O) {
        K = [J, K, O];
        g && M != null && K.push(M);
        h && n(J) && N && K.push(N);
        L && f == 3 && K.push(L);
        return K.join(": ");
      }
      function n(J) {
        return r.has(J) && r.get(J).size > 1;
      }
      for (var q = a.find(function(J) {
        return J.active == 1;
      }), r = /* @__PURE__ */ new Map(), u = t(a), w = u.next(); !w.done; w = u.next()) w = w.value, w.codecs && (r.has(w.language) || r.set(w.language, /* @__PURE__ */ new Set()), r.get(w.language).add(kf(w.codecs)));
      u = gG(b);
      Sj(b);
      b.appendChild(u);
      u = /* @__PURE__ */ new Set();
      q = q ? m(q.language, q.roles.join(", "), q.label, q.channelsCount, q.codecs && kf(q.codecs), q.spatialAudio) : "";
      a = t(a);
      var v = a.next();
      for (w = {}; !v.done; w = { ac: void 0 }, v = a.next()) {
        w.ac = v.value;
        v = w.ac.language;
        var y = w.ac.roles.join(", "), z = w.ac.label, A = w.ac.channelsCount, C = w.ac.codecs && kf(w.ac.codecs), D = w.ac.spatialAudio, F = m(v, y, z, A, C, D);
        if (!u.has(F)) {
          u.add(F);
          var B = Oj();
          B.addEventListener("click", /* @__PURE__ */ function(J) {
            return function() {
              c(J.ac);
            };
          }(w));
          var E = W("span");
          B.appendChild(E);
          E.textContent = HI(v, e);
          var I = "";
          h && g && D && (C == "ec-3" || C == "ac-4") ? I += " Dolby Atmos" : (h && n(v) && (I += k2(C)), g && (I += l(A)));
          switch (f) {
            case zI:
              E.textContent += I;
              break;
            case 1:
              E.textContent += I;
              y ? E.textContent = y : (bb("Track #" + JSON.stringify(w.ac) + " does not have a role, but the UI is configured to only show role."), E.textContent = "?");
              break;
            case 2:
              E.textContent += I;
              y && (E.textContent += ": " + y);
              break;
            case 3:
              z ? E.textContent = z : (bb("Track #" + JSON.stringify(w.ac) + " does not have a label, but the UI is configured to only show labels."), E.textContent = "?");
          }
          F == q && (B.appendChild(jG()), E.classList.add("shaka-chosen-item"), B.ariaSelected = "true", d.textContent = E.textContent);
          b.appendChild(B);
        }
      }
    }
    function II(a, b, c, d, e, f, g) {
      function h(A, C, D) {
        A = [A, C];
        D && g == 3 && A.push(D);
        return A.join(": ");
      }
      var k2 = a.find(function(A) {
        return A.active == 1;
      }), l = gG(b);
      Sj(b);
      b.appendChild(l);
      l = /* @__PURE__ */ new Set();
      k2 = k2 ? h(k2.language, k2.roles.join(", "), k2.label) : "";
      a = t(a);
      for (var m = a.next(), n = {}; !m.done; n = { Wc: void 0 }, m = a.next()) {
        n.Wc = m.value;
        m = n.Wc.language;
        var q = n.Wc.forced, r = f.resolve("SUBTITLE_FORCED"), u = n.Wc.roles.join(", "), w = n.Wc.label, v = h(m, u, w);
        if (!l.has(v)) {
          l.add(v);
          var y = Oj();
          y.addEventListener("click", /* @__PURE__ */ function(A) {
            return function() {
              c(A.Wc);
            };
          }(n));
          var z = W("span");
          y.appendChild(z);
          z.textContent = HI(m, f);
          switch (g) {
            case zI:
              q && (z.textContent += " (" + r + ")");
              break;
            case 1:
              u ? z.textContent = u : (bb("Track #" + n.Wc.id + " does not have a role, but the UI is configured to only show role."), z.textContent = "?");
              q && (z.textContent += " (" + r + ")");
              break;
            case 2:
              u && (z.textContent += ": " + u);
              q && (z.textContent += " (" + r + ")");
              break;
            case 3:
              w ? z.textContent = w : (bb("Track #" + n.Wc.id + " does not have a label, but the UI is configured to only show labels."), z.textContent = "?");
          }
          d && v == k2 && (y.appendChild(jG()), z.classList.add("shaka-chosen-item"), y.ariaSelected = "true", e.textContent = z.textContent);
          b.appendChild(y);
        }
      }
    }
    function HI(a, b) {
      if (!a && !b) return "";
      switch (a) {
        case "mul":
          return b.resolve("MULTIPLE_LANGUAGES");
        case "und":
          return b.resolve("UNDETERMINED_LANGUAGE");
        case "zxx":
          return b.resolve("NOT_APPLICABLE");
      }
      var c = Ec(a);
      return a in Lo ? Lo[a] : c in Lo ? Lo[c] + " (" + a + ")" : b.resolve("UNRECOGNIZED_LANGUAGE") + " (" + a + ")";
    }
    ;
    function JI(a, b, c) {
      function d() {
        return KI(e);
      }
      fG.call(this, a, b);
      var e = this;
      this.m = this.controls.l;
      LI(this, c);
      MI(this);
      NI(this);
      this.eventManager.o(this.button, "click", function() {
        e.controls.Ca() && (e.menu.classList.contains("shaka-hidden") ? (e.controls.dispatchEvent(new T("submenuopen")), kG(e.menu, true), iG(e.menu), KI(e)) : kG(e.menu, false));
      });
      this.j = null;
      window2.ResizeObserver ? (this.j = new ResizeObserver(d), this.j.observe(this.controls.l)) : this.eventManager.o(window2, "resize", d);
    }
    ma(JI, fG);
    JI.prototype.release = function() {
      this.j && (this.j.disconnect(), this.j = null);
      fG.prototype.release.call(this);
    };
    function LI(a, b) {
      a.button = Oj();
      a.button.classList.add("shaka-overflow-button");
      a.icon = W("i");
      a.icon.classList.add("material-icons-round");
      a.icon.textContent = b;
      a.button.appendChild(a.icon);
      b = W("label");
      b.classList.add("shaka-overflow-button-label");
      b.classList.add("shaka-overflow-menu-only");
      b.classList.add("shaka-overflow-button-label-inline");
      a.nameSpan = W("span");
      b.appendChild(a.nameSpan);
      a.currentSelection = W("span");
      a.currentSelection.classList.add("shaka-current-selection-span");
      b.appendChild(a.currentSelection);
      a.button.appendChild(b);
      a.parent.appendChild(a.button);
    }
    function MI(a) {
      a.menu = W("div");
      a.menu.classList.add("shaka-no-propagation");
      a.menu.classList.add("shaka-show-controls-on-mouse-over");
      a.menu.classList.add("shaka-settings-menu");
      a.menu.classList.add("shaka-hidden");
      a.backButton = Oj();
      a.backButton.classList.add("shaka-back-to-overflow-button");
      a.menu.appendChild(a.backButton);
      a.eventManager.o(a.backButton, "click", function() {
        a.controls.Rc();
      });
      var b = W("i");
      b.classList.add("material-icons-round");
      b.textContent = "close";
      a.backButton.appendChild(b);
      a.backSpan = W("span");
      a.backButton.appendChild(a.backSpan);
      a.controls.i.appendChild(a.menu);
    }
    function NI(a) {
      a.parent.classList.contains("shaka-overflow-menu") && (a.backButton.firstChild.textContent = "navigate_before", a.eventManager.o(a.menu, "click", function() {
        function b(c) {
          return c.classList.contains("shaka-hidden") == 0;
        }
        kG(a.menu, false);
        kG(a.parent, true);
        ob(a.parent.childNodes, b) && pb(a.parent.childNodes, b)[0].focus();
        rH(a.controls);
        KI(a);
      }));
    }
    function KI(a) {
      var b = a.menu.getBoundingClientRect(), c = window2.getComputedStyle(a.menu), d = parseFloat(c.paddingTop);
      c = parseFloat(c.paddingBottom);
      var e = a.m.getBoundingClientRect();
      a.menu.style.maxHeight = b.bottom - e.top - d - c + "px";
    }
    S("shaka.ui.SettingsMenu", JI);
    function OI(a, b) {
      JI.call(this, a, b, "language");
      var c = this;
      this.button.classList.add("shaka-language-button");
      this.button.classList.add("shaka-tooltip-status");
      this.menu.classList.add("shaka-audio-languages");
      this.eventManager.o(this.localization, "locale-updated", function() {
        PI(c);
      });
      this.eventManager.o(this.localization, "locale-changed", function() {
        PI(c);
      });
      this.eventManager.o(this.player, "loading", function() {
        QI(c);
      });
      this.eventManager.o(this.player, "loaded", function() {
        QI(c);
      });
      this.eventManager.o(
        this.player,
        "unloading",
        function() {
          QI(c);
        }
      );
      this.eventManager.o(this.player, "audiotrackschanged", function() {
        QI(c);
      });
      PI(this);
      QI(this);
    }
    ma(OI, JI);
    function QI(a) {
      var b = a.player.getAudioTracks() || [];
      GI(b, a.menu, function(c) {
        a.player.Gj(c);
        a.player.configure("preferredAudioLanguage", c.language);
        c.label && a.player.configure("preferredAudioLabel", c.label);
        c.channelsCount && a.player.configure("preferredAudioChannelCount", c.channelsCount);
        a.player.configure("preferSpatialAudio", c.spatialAudio);
      }, a.currentSelection, a.localization, a.controls.g.trackLabelFormat, a.controls.g.showAudioChannelCountVariants, a.controls.g.showAudioCodec);
      iG(a.menu);
      a.controls.dispatchEvent(new T("languageselectionupdated"));
      a.button.setAttribute("shaka-status", a.currentSelection.innerText);
      kG(a.button, a.menu.getElementsByTagName("button").length > 2);
    }
    function PI(a) {
      a.backButton.ariaLabel = a.localization.resolve("BACK");
      a.button.ariaLabel = a.localization.resolve("LANGUAGE");
      a.nameSpan.textContent = a.localization.resolve("LANGUAGE");
      a.backSpan.textContent = a.localization.resolve("LANGUAGE");
    }
    S("shaka.ui.AudioLanguageSelection", OI);
    function RI() {
    }
    RI.prototype.create = function(a, b) {
      return new OI(a, b);
    };
    gI("language", new RI());
    CH("language", new RI());
    function SI(a, b) {
      fG.call(this, a, b);
      var c = this;
      this.h = this.controls.F;
      this.g = Oj();
      this.g.classList.add("shaka-cast-button");
      this.g.classList.add("shaka-tooltip");
      this.g.ariaPressed = "false";
      this.i = W("i");
      this.i.classList.add("material-icons-round");
      this.i.textContent = "cast";
      this.g.appendChild(this.i);
      a = W("label");
      a.classList.add("shaka-overflow-button-label");
      a.classList.add("shaka-overflow-menu-only");
      a.classList.add("shaka-simple-overflow-button-label-inline");
      this.l = W("span");
      a.appendChild(this.l);
      this.j = W("span");
      this.j.classList.add("shaka-current-selection-span");
      a.appendChild(this.j);
      this.g.appendChild(a);
      this.parent.appendChild(this.g);
      TI(this);
      UI(this);
      this.eventManager.o(this.localization, "locale-updated", function() {
        TI(c);
      });
      this.eventManager.o(this.localization, "locale-changed", function() {
        TI(c);
      });
      this.eventManager.o(this.g, "click", function() {
        c.controls.Ca() && VI(c);
      });
      this.eventManager.o(this.controls, "caststatuschanged", function() {
        UI(c);
      });
    }
    ma(SI, fG);
    function VI(a) {
      var b;
      P(function(c) {
        if (c.g == 1) {
          if (a.h.Qa()) return a.h.Vj(), c.B(0);
          sa(c, 3);
          a.g.disabled = true;
          return G(c, a.h.cast(), 5);
        }
        if (c.g != 3) return a.g.disabled = false, ua(c, 0);
        b = va(c);
        a.g.disabled = false;
        b.code != 8004 && a.controls.dispatchEvent(new T("error", (/* @__PURE__ */ new Map()).set("detail", b)));
        H(c);
      });
    }
    function UI(a) {
      var b = a.h.Kg() && a.controls.sa, c = a.h.Qa();
      kG(a.g, b);
      a.i.textContent = c ? "cast_connected" : "cast";
      b && (a.g.ariaPressed = c ? "true" : "false");
      WI(a);
    }
    function WI(a) {
      a.j.textContent = a.h.Qa() ? a.h.Yf() : a.localization.resolve("OFF");
    }
    function TI(a) {
      a.g.ariaLabel = a.localization.resolve("CAST");
      a.l.textContent = a.localization.resolve("CAST");
      WI(a);
    }
    S("shaka.ui.CastButton", SI);
    function XI() {
    }
    XI.prototype.create = function(a, b) {
      return new SI(a, b);
    };
    gI("cast", new XI());
    CH("cast", new XI());
    function YI(a, b) {
      JI.call(this, a, b, "bookmarks");
      var c = this;
      this.button.classList.add("shaka-chapter-button");
      this.menu.classList.add("shaka-chapters");
      this.button.classList.add("shaka-tooltip-status");
      this.g = [];
      this.h = "und";
      this.eventManager.o(this.localization, "locale-updated", function() {
        ZI(c);
        $I(c);
      });
      this.eventManager.o(this.localization, "locale-changed", function() {
        ZI(c);
        $I(c);
      });
      this.eventManager.o(this.player, "unloading", function() {
        aJ(c);
        c.h = "und";
        c.g = [];
      });
      this.eventManager.o(
        this.player,
        "trackschanged",
        function() {
          $I(c);
        }
      );
      ZI(this);
      $I(this);
    }
    ma(YI, JI);
    function ZI(a) {
      a.backButton.ariaLabel = a.localization.resolve("BACK");
      a.button.ariaLabel = a.localization.resolve("CHAPTERS");
      a.nameSpan.textContent = a.localization.resolve("CHAPTERS");
      a.backSpan.textContent = a.localization.resolve("CHAPTERS");
    }
    function aJ(a) {
      var b = gG(a.menu);
      Sj(a.menu);
      a.menu.appendChild(b);
      kG(a.button, false);
    }
    function $I(a) {
      var b, c, d, e, f, g, h, k2, l, m, n, q, r, u;
      P(function(w) {
        switch (w.g) {
          case 1:
            b = function(v, y) {
              return !v && !y || v.id === y.id && v.title === y.title && v.startTime === y.startTime && v.endTime === y.endTime;
            }, c = "und", d = [], e = a.localization.g, f = t(Array.from(e)), g = f.next();
          case 2:
            if (g.done) {
              w.B(4);
              break;
            }
            c = h = g.value;
            if (!a.player) {
              w.B(5);
              break;
            }
            return G(w, a.player.nh(c), 6);
          case 6:
            d = w.h || [];
          case 5:
            if (d.length) {
              w.B(4);
              break;
            }
            g = f.next();
            w.B(2);
            break;
          case 4:
            if (d.length) {
              w.B(7);
              break;
            }
            c = "und";
            if (!a.player) {
              w.B(7);
              break;
            }
            return G(
              w,
              a.player.nh(c),
              9
            );
          case 9:
            d = w.h || [];
          case 7:
            k2 = c !== a.h;
            l = a.g.length !== d.length || !a.g.some(function(v, y) {
              y = d.at(y);
              return b(v, y) || d.some(function(z) {
                return b(v, z);
              });
            });
            a.h = c;
            a.g = d;
            if (!d.length) aJ(a);
            else if (k2 || l) {
              m = t(a.g);
              n = m.next();
              for (q = {}; !n.done; q = { Mg: void 0 }, n = m.next()) q.Mg = n.value, r = Oj(), u = W("span"), u.classList.add("shaka-chapter"), u.textContent = q.Mg.title, r.appendChild(u), a.eventManager.o(r, "click", /* @__PURE__ */ function(v) {
                return function() {
                  a.controls.Ca() && (a.video.currentTime = v.Mg.startTime);
                };
              }(q)), a.menu.appendChild(r);
              kG(a.button, true);
              iG(a.menu);
            }
            H(w);
        }
      });
    }
    S("shaka.ui.ChapterSelection", YI);
    function bJ() {
    }
    bJ.prototype.create = function(a, b) {
      return new YI(a, b);
    };
    gI("chapter", new bJ());
    CH("chapter", new bJ());
    function cJ(a, b) {
      fG.call(this, a, b);
      var c = this;
      this.g = Oj();
      this.g.classList.add("material-icons-round");
      this.g.classList.add("shaka-fast-forward-button");
      this.g.classList.add("shaka-tooltip-status");
      this.g.setAttribute("shaka-status", "1x");
      this.g.textContent = "fast_forward";
      this.parent.appendChild(this.g);
      dJ(this);
      this.h = this.controls.g.fastForwardRates;
      this.eventManager.o(this.localization, "locale-updated", function() {
        dJ(c);
      });
      this.eventManager.o(this.localization, "locale-changed", function() {
        dJ(c);
      });
      this.eventManager.o(this.g, "click", function() {
        if (c.controls.Ca() && c.video.duration) {
          var d = c.h.indexOf(c.player.Ya()) + 1;
          d = d != c.h.length ? c.h[d] : c.h[0];
          c.video.paused && c.video.play();
          c.player.Xc(d);
          c.g.setAttribute("shaka-status", d + "x");
        }
      });
      this.eventManager.o(this.player, "ratechange", function() {
        c.g.setAttribute("shaka-status", c.player.Ya() + "x");
      });
    }
    ma(cJ, fG);
    function dJ(a) {
      a.g.ariaLabel = a.localization.resolve("FAST_FORWARD");
    }
    S("shaka.ui.FastForwardButton", cJ);
    function eJ() {
    }
    eJ.prototype.create = function(a, b) {
      return new cJ(a, b);
    };
    CH("fast_forward", new eJ());
    function fJ(a, b) {
      fG.call(this, a, b);
      var c = this;
      this.h = this.controls.m;
      this.g = Oj();
      this.g.classList.add("shaka-fullscreen-button");
      this.g.classList.add("material-icons-round");
      this.g.classList.add("shaka-tooltip");
      gJ(this);
      this.g.textContent = "fullscreen";
      this.parent.appendChild(this.g);
      hJ(this);
      this.eventManager.o(this.localization, "locale-updated", function() {
        hJ(c);
      });
      this.eventManager.o(this.localization, "locale-changed", function() {
        hJ(c);
      });
      this.eventManager.o(this.g, "click", function() {
        return P(function(d) {
          return c.controls.Ca() ? G(d, c.controls.ng(), 0) : d.return();
        });
      });
      this.eventManager.o(document, "fullscreenchange", function() {
        c.g.textContent = c.controls.wc() ? "fullscreen_exit" : "fullscreen";
        hJ(c);
      });
      this.eventManager.o(this.h, "loadedmetadata", function() {
        gJ(c);
      });
      this.eventManager.o(this.h, "loadeddata", function() {
        gJ(c);
      });
      this.eventManager.o(this.adManager, "ad-started", function() {
        gJ(c);
      });
      this.eventManager.o(this.adManager, "ad-stopped", function() {
        gJ(c);
      });
    }
    ma(fJ, fG);
    function gJ(a) {
      a.controls.se() ? a.g.classList.remove("shaka-hidden") : a.g.classList.add("shaka-hidden");
    }
    function hJ(a) {
      var b = a.controls.wc() ? "EXIT_FULL_SCREEN" : "FULL_SCREEN";
      a.g.ariaLabel = a.localization.resolve(b);
    }
    S("shaka.ui.FullscreenButton", fJ);
    function iJ() {
    }
    iJ.prototype.create = function(a, b) {
      return new fJ(a, b);
    };
    CH("fullscreen", new iJ());
    function jJ(a, b) {
      fG.call(this, a, b);
      var c = this;
      this.g = Oj();
      this.g.classList.add("shaka-loop-button");
      this.g.classList.add("shaka-tooltip");
      this.i = W("i");
      this.i.classList.add("material-icons-round");
      this.i.textContent = "repeat";
      this.g.appendChild(this.i);
      a = W("label");
      a.classList.add("shaka-overflow-button-label");
      a.classList.add("shaka-overflow-menu-only");
      a.classList.add("shaka-simple-overflow-button-label-inline");
      this.l = W("span");
      this.l.textContent = this.localization.resolve("LOOP");
      a.appendChild(this.l);
      this.j = W("span");
      this.j.classList.add("shaka-current-selection-span");
      a.appendChild(this.j);
      this.g.appendChild(a);
      kJ(this);
      this.parent.appendChild(this.g);
      this.eventManager.o(this.localization, "locale-updated", function() {
        kJ(c);
      });
      this.eventManager.o(this.localization, "locale-changed", function() {
        kJ(c);
      });
      this.eventManager.o(this.g, "click", function() {
        c.controls.Ca() && (c.video.loop = !c.video.loop, c.h.La(), c.h.za(1));
      });
      this.m = this.video.loop;
      this.h = new Cf(function() {
        c.m != c.video.loop && (kJ(c), c.m = c.video.loop);
      });
      this.h.za(1);
      this.eventManager.o(this.player, "unloading", function() {
        lJ(c);
      });
      this.eventManager.o(this.player, "loaded", function() {
        lJ(c);
      });
      this.eventManager.o(this.player, "manifestupdated", function() {
        lJ(c);
      });
      this.eventManager.o(this.video, "durationchange", function() {
        lJ(c);
      });
    }
    ma(jJ, fG);
    jJ.prototype.release = function() {
      this.h.stop();
      this.h = null;
      fG.prototype.release.call(this);
    };
    function kJ(a) {
      a.l.textContent = a.localization.resolve("LOOP");
      a.j.textContent = a.localization.resolve(a.video.loop ? "ON" : "OFF");
      a.i.textContent = a.video.loop ? "repeat_on" : "repeat";
      a.g.ariaLabel = a.localization.resolve(a.video.loop ? "EXIT_LOOP_MODE" : "ENTER_LOOP_MODE");
    }
    function lJ(a) {
      kG(a.g, !a.player.U());
    }
    S("shaka.ui.LoopButton", jJ);
    function mJ() {
    }
    mJ.prototype.create = function(a, b) {
      return new jJ(a, b);
    };
    gI("loop", new mJ());
    CH("loop", new mJ());
    pG("loop", new mJ());
    function nJ(a, b) {
      fG.call(this, a, b);
      var c = this;
      this.g = Oj();
      this.g.classList.add("shaka-mute-button");
      this.g.classList.add("shaka-tooltip");
      this.h = W("i");
      this.h.classList.add("material-icons-round");
      this.h.textContent = "volume_up";
      this.g.appendChild(this.h);
      a = W("label");
      a.classList.add("shaka-overflow-button-label");
      a.classList.add("shaka-overflow-menu-only");
      this.i = W("span");
      this.i.textContent = this.localization.resolve("MUTE");
      a.appendChild(this.i);
      this.j = W("span");
      this.j.classList.add("shaka-current-selection-span");
      a.appendChild(this.j);
      this.g.appendChild(a);
      this.parent.appendChild(this.g);
      oJ(this);
      pJ(this);
      this.eventManager.o(this.localization, "locale-updated", function() {
        oJ(c);
      });
      this.eventManager.o(this.localization, "locale-changed", function() {
        oJ(c);
      });
      this.eventManager.o(this.g, "click", function() {
        c.controls.Ca() && (c.ad && c.ad.isLinear() ? c.ad.setMuted(!c.ad.isMuted()) : c.video.muted || c.video.volume != 0 ? c.video.muted = !c.video.muted : c.video.volume = 1);
      });
      this.eventManager.o(this.video, "volumechange", function() {
        oJ(c);
        pJ(c);
      });
      this.eventManager.o(this.player, "loading", function() {
        oJ(c);
        pJ(c);
      });
      this.eventManager.o(this.player, "loaded", function() {
        qJ(c);
      });
      this.eventManager.o(this.player, "unloading", function() {
        qJ(c);
      });
      this.eventManager.o(this.player, "trackschanged", function() {
        qJ(c);
      });
      this.eventManager.o(this.controls, "caststatuschanged", function() {
        oJ(c);
        pJ(c);
      });
      this.eventManager.o(this.adManager, "ad-volume-changed", function() {
        oJ(c);
        pJ(c);
      });
      this.eventManager.o(this.adManager, "ad-muted", function() {
        oJ(c);
        pJ(c);
      });
      this.eventManager.o(
        this.adManager,
        "ad-started",
        function() {
          qJ(c);
        }
      );
      this.eventManager.o(this.adManager, "ad-stopped", function() {
        c.ad = null;
        oJ(c);
        pJ(c);
        qJ(c);
      });
      qJ(this);
    }
    ma(nJ, fG);
    function oJ(a) {
      var b = a.ad ? a.ad.isMuted() ? "UNMUTE" : "MUTE" : a.video.muted || a.video.volume == 0 ? "UNMUTE" : "MUTE";
      a.g.ariaLabel = a.localization.resolve(b);
      a.i.textContent = a.localization.resolve(b);
    }
    function pJ(a) {
      var b = a.ad ? a.ad.isMuted() ? "volume_off" : "volume_up" : a.video.muted || a.video.volume == 0 ? "volume_off" : "volume_up";
      a.h.textContent = b;
    }
    function qJ(a) {
      var b = true;
      a.ad && a.ad.isLinear() ? b = true : a.player.Hh() && (b = false);
      kG(a.g, b);
    }
    S("shaka.ui.MuteButton", nJ);
    function rJ() {
    }
    rJ.prototype.create = function(a, b) {
      return new nJ(a, b);
    };
    gI("mute", new rJ());
    CH("mute", new rJ());
    pG("mute", new rJ());
    function sJ(a, b) {
      fG.call(this, a, b);
      var c = this;
      this.l = this.controls.m;
      this.g = Oj();
      this.g.classList.add("shaka-pip-button");
      this.g.classList.add("shaka-tooltip");
      this.i = W("i");
      this.i.classList.add("material-icons-round");
      this.i.textContent = "picture_in_picture_alt";
      this.g.appendChild(this.i);
      a = W("label");
      a.classList.add("shaka-overflow-button-label");
      a.classList.add("shaka-overflow-menu-only");
      a.classList.add("shaka-simple-overflow-button-label-inline");
      this.j = W("span");
      this.j.textContent = this.localization.resolve("PICTURE_IN_PICTURE");
      a.appendChild(this.j);
      this.h = W("span");
      this.h.classList.add("shaka-current-selection-span");
      a.appendChild(this.h);
      this.g.appendChild(a);
      tJ(this);
      this.parent.appendChild(this.g);
      this.controls.Df() || kG(this.g, false);
      this.eventManager.o(this.localization, "locale-updated", function() {
        tJ(c);
      });
      this.eventManager.o(this.localization, "locale-changed", function() {
        tJ(c);
      });
      this.eventManager.o(this.g, "click", function() {
        c.controls.Ca() && c.controls.Vc();
      });
      this.eventManager.o(this.l, "enterpictureinpicture", function() {
        uJ(c);
      });
      this.eventManager.o(this.l, "leavepictureinpicture", function() {
        vJ(c);
      });
      this.eventManager.o(this.controls, "caststatuschanged", function() {
        wJ(c);
      });
      this.eventManager.o(this.player, "trackschanged", function() {
        wJ(c);
      });
      "documentPictureInPicture" in window2 && this.eventManager.o(window2.documentPictureInPicture, "enter", function(d) {
        uJ(c);
        c.eventManager.qa(d.window, "pagehide", function() {
          vJ(c);
        });
      });
    }
    ma(sJ, fG);
    function uJ(a) {
      a.i.textContent = "branding_watermark";
      a.g.ariaLabel = a.localization.resolve("EXIT_PICTURE_IN_PICTURE");
      a.h.textContent = a.localization.resolve("ON");
    }
    function vJ(a) {
      a.i.textContent = "picture_in_picture_alt";
      a.g.ariaLabel = a.localization.resolve("ENTER_PICTURE_IN_PICTURE");
      a.h.textContent = a.localization.resolve("OFF");
    }
    function tJ(a) {
      a.j.textContent = a.localization.resolve("PICTURE_IN_PICTURE");
      var b = a.controls.Id();
      a.g.ariaLabel = a.localization.resolve(b ? "EXIT_PICTURE_IN_PICTURE" : "ENTER_PICTURE_IN_PICTURE");
      a.h.textContent = a.localization.resolve(b ? "ON" : "OFF");
    }
    function wJ(a) {
      P(function(b) {
        if (!a.controls.Df()) return kG(a.g, false), a.controls.Id() ? G(b, a.controls.Vc(), 0) : b.B(0);
        if (!a.player || !a.player.Hd()) return kG(a.g, true), b.B(0);
        kG(a.g, false);
        return a.controls.Id() ? G(b, a.controls.Vc(), 0) : b.B(0);
      });
    }
    S("shaka.ui.PipButton", sJ);
    function xJ() {
    }
    xJ.prototype.create = function(a, b) {
      return new sJ(a, b);
    };
    gI("picture_in_picture", new xJ());
    CH("picture_in_picture", new xJ());
    pG("picture_in_picture", new xJ());
    function yJ(a, b) {
      JI.call(this, a, b, "slow_motion_video");
      var c = this;
      this.button.classList.add("shaka-playbackrate-button");
      this.menu.classList.add("shaka-playback-rates");
      this.button.classList.add("shaka-tooltip-status");
      Array.from(a.classList).includes("shaka-overflow-menu") || (this.g = W("span"), this.g.classList.add("shaka-overflow-playback-rate-mark"), this.button.appendChild(this.g));
      this.eventManager.o(this.localization, "locale-updated", function() {
        zJ(c);
      });
      this.eventManager.o(
        this.localization,
        "locale-changed",
        function() {
          zJ(c);
        }
      );
      this.eventManager.o(this.player, "loaded", function() {
        AJ(c);
      });
      this.eventManager.o(this.player, "ratechange", function() {
        AJ(c);
      });
      zJ(this);
      BJ(this);
      AJ(this);
    }
    ma(yJ, JI);
    function zJ(a) {
      a.backButton.ariaLabel = a.localization.resolve("BACK");
      a.button.ariaLabel = a.localization.resolve("PLAYBACK_RATE");
      a.nameSpan.textContent = a.localization.resolve("PLAYBACK_RATE");
      a.backSpan.textContent = a.localization.resolve("PLAYBACK_RATE");
    }
    function AJ(a) {
      var b = a.player.Ya(), c = hG(a.menu, "material-icons-round shaka-chosen-item");
      if (c) {
        var d = c.parentElement;
        d.removeAttribute("aria-selected");
        d.getElementsByTagName("span")[0].classList.remove("shaka-chosen-item");
        d.removeChild(c);
      }
      if (c = Array.from(a.menu.querySelectorAll("span")).find(function(e) {
        return e.textContent == b + "x";
      })) d = c.parentElement, d.appendChild(jG()), d.ariaSelected = "true", c.classList.add("shaka-chosen-item");
      a.currentSelection.textContent = b + "x";
      a.button.setAttribute(
        "shaka-status",
        b + "x"
      );
      a.g && (a.g.textContent = b + "x");
    }
    function BJ(a) {
      for (var b = t(a.controls.g.playbackRates), c = b.next(), d = {}; !c.done; d = { Xf: void 0 }, c = b.next()) {
        d.Xf = c.value;
        c = Oj();
        var e = W("span");
        e.textContent = d.Xf + "x";
        c.appendChild(e);
        a.eventManager.o(c, "click", /* @__PURE__ */ function(f) {
          return function() {
            f.Xf == a.video.defaultPlaybackRate ? a.player.zd() : a.player.Xc(f.Xf, false);
          };
        }(d));
        a.menu.appendChild(c);
      }
      iG(a.menu);
    }
    S("shaka.ui.PlaybackRateSelection", yJ);
    function CJ() {
    }
    CJ.prototype.create = function(a, b) {
      return new yJ(a, b);
    };
    gI("playback_rate", new CJ());
    CH("playback_rate", new CJ());
    function DJ(a, b) {
      fG.call(this, a, b);
      var c = this;
      this.g = Oj();
      this.g.classList.add("shaka-current-time");
      EJ(this, "0:00");
      this.parent.appendChild(this.g);
      this.eventManager.o(this.g, "click", function() {
        c.controls.Ca() && c.player.U() && (c.video.currentTime = c.player.ya().end);
      });
      this.eventManager.o(this.player, "loading", function() {
        kG(c.g, true);
      });
      this.eventManager.o(this.controls, "timeandseekrangeupdated", function() {
        var d = c.controls.S, e = c.controls.oh(), f = c.player.ya(), g = f.end - f.start;
        isFinite(g) ? c.player.U() ? (e = Math.max(0, Math.floor(f.end - e)), g = g >= 3600, e >= 1 || d ? (EJ(c, "- " + lG(e, g)), c.g.disabled = false) : (EJ(c, c.localization.resolve("LIVE")), c.g.disabled = true)) : (d = g >= 3600, e = lG(Math.max(0, e - f.start), d), g && (e += " / " + lG(g, d)), EJ(c, e), c.g.disabled = true) : (EJ(c, c.localization.resolve("LIVE")), c.g.disabled = true);
      });
      this.eventManager.o(this.player, "trackschanged", function() {
        c.player.U() && (c.g.ariaLabel = c.localization.resolve("SKIP_TO_LIVE"));
      });
      this.eventManager.o(this.adManager, "ad-started", function() {
        kG(c.g, !c.ad.isLinear());
      });
      this.eventManager.o(this.adManager, "ad-stopped", function() {
        kG(c.g, true);
      });
    }
    ma(DJ, fG);
    function EJ(a, b) {
      b != a.g.textContent && (a.g.textContent = b);
    }
    S("shaka.ui.PresentationTimeTracker", DJ);
    function FJ() {
    }
    FJ.prototype.create = function(a, b) {
      return new DJ(a, b);
    };
    CH("time_and_duration", new FJ());
    function GJ(a, b) {
      fG.call(this, a, b);
      var c = this;
      this.g = Oj();
      this.g.classList.add("shaka-recenter-vr-button");
      this.g.classList.add("shaka-tooltip");
      this.g.ariaPressed = "false";
      this.h = W("i");
      this.h.classList.add("material-icons-round");
      this.h.textContent = "control_camera";
      this.g.appendChild(this.h);
      a = W("label");
      a.classList.add("shaka-overflow-button-label");
      a.classList.add("shaka-overflow-menu-only");
      this.j = W("span");
      a.appendChild(this.j);
      this.i = W("span");
      this.i.classList.add("shaka-current-selection-span");
      a.appendChild(this.i);
      this.g.appendChild(a);
      this.parent.appendChild(this.g);
      HJ(this);
      this.eventManager.o(this.localization, "locale-updated", function() {
        HJ(c);
      });
      this.eventManager.o(this.localization, "locale-changed", function() {
        HJ(c);
      });
      var d = this.controls.D;
      this.eventManager.o(this.g, "click", function() {
        c.controls.Ca() && (d.g ? iH(d.g) : bb("Not playing VR content"));
      });
      this.eventManager.o(d, "vrstatuschanged", function() {
        kG(c.g, c.controls.Wb());
      });
      kG(this.g, this.controls.Wb());
    }
    ma(GJ, fG);
    function HJ(a) {
      a.g.ariaLabel = a.localization.resolve("RECENTER_VR");
      a.j.textContent = a.localization.resolve("RECENTER_VR");
    }
    S("shaka.ui.RecenterVRButton", GJ);
    function IJ() {
    }
    IJ.prototype.create = function(a, b) {
      return new GJ(a, b);
    };
    gI("recenter_vr", new IJ());
    CH("recenter_vr", new IJ());
    function JJ(a, b) {
      fG.call(this, a, b);
      var c = this;
      this.j = Sb().kg();
      this.g = Oj();
      this.g.classList.add("shaka-remote-button");
      this.g.classList.add("shaka-tooltip");
      this.g.ariaPressed = "false";
      this.i = W("i");
      this.i.classList.add("material-icons-round");
      this.i.textContent = this.j ? "airplay" : "cast";
      this.g.appendChild(this.i);
      a = W("label");
      a.classList.add("shaka-overflow-button-label");
      a.classList.add("shaka-overflow-menu-only");
      this.m = W("span");
      a.appendChild(this.m);
      this.l = W("span");
      this.l.classList.add("shaka-current-selection-span");
      a.appendChild(this.l);
      this.g.appendChild(a);
      this.parent.appendChild(this.g);
      this.h = -1;
      KJ(this);
      kG(this.g, false);
      this.video.remote ? (this.eventManager.o(this.localization, "locale-updated", function() {
        KJ(c);
      }), this.eventManager.o(this.localization, "locale-changed", function() {
        KJ(c);
      }), this.eventManager.o(this.controls, "caststatuschanged", function() {
        LJ(c);
      }), this.eventManager.o(this.g, "click", function() {
        c.controls.Ca() && c.video.remote.prompt().catch(function() {
        });
      }), this.eventManager.o(
        this.video.remote,
        "connect",
        function() {
          LJ(c);
          MJ(c);
        }
      ), this.eventManager.o(this.video.remote, "connecting", function() {
        LJ(c);
        MJ(c);
      }), this.eventManager.o(this.video.remote, "disconnect", function() {
        LJ(c);
        MJ(c);
      }), this.eventManager.o(this.player, "loaded", function() {
        LJ(c);
      }), LJ(this, true), MJ(this)) : this.g.classList.add("shaka-hidden");
    }
    ma(JJ, fG);
    JJ.prototype.release = function() {
      this.video.remote && this.h != -1 && this.video.remote.cancelWatchAvailability(this.h).catch(function() {
      });
      fG.prototype.release.call(this);
    };
    function LJ(a, b) {
      b = b === void 0 ? false : b;
      var c, d;
      P(function(e) {
        switch (e.g) {
          case 1:
            if (a.controls.F.Kg() && a.controls.sa || !a.video.remote) {
              kG(a.g, false);
              a.h != -1 && (a.video.remote.cancelWatchAvailability(a.h), a.h = -1);
              e.B(0);
              break;
            }
            if (a.video.remote.state == "disconnected" || b) {
              c = function(f) {
                if (a.player) {
                  var g = a.video.disableRemotePlayback, h = true;
                  Sb().kg() && a.player.m == Xq && a.player.rh() != "HLS" && (h = false);
                  kG(a.g, h && f && !g);
                } else kG(a.g, false);
              };
              sa(e, 7);
              if (a.h == -1) {
                e.B(9);
                break;
              }
              return G(
                e,
                a.video.remote.cancelWatchAvailability(a.h),
                10
              );
            }
            kG(a.g, true);
            if (a.h == -1) {
              e.B(0);
              break;
            }
            return G(e, a.video.remote.cancelWatchAvailability(a.h), 6);
          case 6:
            a.h = -1;
            e.B(0);
            break;
          case 10:
            a.h = -1;
          case 9:
            ua(e, 8);
            break;
          case 7:
            va(e);
          case 8:
            return sa(e, 11), G(e, a.video.remote.watchAvailability(c), 13);
          case 13:
            d = e.h;
            a.h = d;
            ua(e, 0);
            break;
          case 11:
            va(e), c(true), H(e);
        }
      });
    }
    function KJ(a) {
      var b = a.j ? a.localization.resolve("AIRPLAY") : a.localization.resolve("CAST");
      a.g.ariaLabel = b;
      a.m.textContent = b;
    }
    function MJ(a) {
      a.j || (a.i.textContent = a.video.remote.state == "disconnected" ? "cast" : "cast_connected");
    }
    S("shaka.ui.RemoteButton", JJ);
    function NJ() {
    }
    NJ.prototype.create = function(a, b) {
      return new JJ(a, b);
    };
    gI("remote", new NJ());
    CH("remote", new NJ());
    function XJ(a, b) {
      JI.call(this, a, b, "tune");
      var c = this;
      this.button.classList.add("shaka-resolution-button");
      this.button.classList.add("shaka-tooltip-status");
      this.menu.classList.add("shaka-resolutions");
      this.h = W("span");
      this.h.classList.add("shaka-current-auto-quality");
      this.h.style.display = "none";
      this.i = W("sup");
      this.i.classList.add("shaka-current-quality-mark");
      this.i.style.display = "none";
      Array.from(a.classList).includes("shaka-overflow-menu") ? this.parent.parentElement && (this.g = Rj(this.parent.parentElement)) : (this.g = W("span"), this.g.classList.add("shaka-overflow-playback-rate-mark"), this.button.appendChild(this.g));
      a = W("span");
      this.button.childNodes[1].appendChild(a);
      a.appendChild(this.currentSelection);
      a.appendChild(this.h);
      a.appendChild(this.i);
      this.eventManager.o(this.localization, "locale-updated", function() {
        YJ(c);
      });
      this.eventManager.o(this.localization, "locale-changed", function() {
        YJ(c);
      });
      this.eventManager.o(this.player, "loading", function() {
        ZJ(c);
        $J(c);
      });
      this.eventManager.o(this.player, "loaded", function() {
        ZJ(c);
        $J(c);
      });
      this.eventManager.o(this.player, "unloading", function() {
        ZJ(c);
        $J(c);
      });
      this.eventManager.o(this.player, "variantchanged", function() {
        ZJ(c);
        $J(c);
      });
      this.eventManager.o(this.player, "trackschanged", function() {
        ZJ(c);
        $J(c);
      });
      this.eventManager.o(this.player, "abrstatuschanged", function() {
        ZJ(c);
        $J(c);
      });
      this.eventManager.o(this.player, "adaptation", function() {
        ZJ(c);
        $J(c);
      });
      ZJ(this);
    }
    ma(XJ, JI);
    function $J(a) {
      var b = a.player.getConfiguration().abr.enabled;
      if (a.player.Hd()) {
        a.i.textContent = "";
        a.i.style.display = "none";
        a.g && (a.g.textContent = "", a.g.style.display = "none");
        var c = a.player.rb() || [], d = c.find(function(e) {
          return e.active;
        });
        d && (b ? (a.h.textContent = d.bandwidth ? aK(a, d, c) : "Unknown", a.h.style.display = "") : a.h.style.display = "none");
      } else c = a.player.getVideoTracks() || [], (d = c.find(function(e) {
        return e.active;
      })) ? (b ? (a.h.textContent = d.height && d.width ? bK(a, d, c) : d.bandwidth ? Math.round(d.bandwidth / 1e3) + " kbits/s" : "Unknown", a.h.style.display = "") : a.h.style.display = "none", b = cK(a, d.width, d.height), a.i.textContent = b, a.i.style.display = b !== "" ? "" : "none", a.g && (a.g.textContent = b, a.g.style.display = b !== "" ? "" : "none")) : a.g && (b = a.player.getStats(), b = cK(a, b.width, b.height), a.g.textContent = b, a.g.style.display = b !== "" ? "" : "none");
    }
    function cK(a, b, c) {
      if (!b || !c) return "";
      c > b && (c = t([c, b]), b = c.next().value, c = c.next().value);
      b / c > 16 / 9 && (c = Math.round(b * 9 / 16));
      a = a.controls.g.qualityMarks;
      return c >= 8640 ? c + "p" : c >= 4320 ? a["4320"] : c >= 2160 ? a["2160"] : c >= 1440 ? a["1440"] : c >= 1080 ? a["1080"] : c >= 720 ? a["720"] : "";
    }
    function ZJ(a) {
      var b = gG(a.menu);
      Sj(a.menu);
      a.menu.appendChild(b);
      b = 0;
      b = a.player.Hd() ? dK(a) : eK(a);
      var c = Oj();
      c.classList.add("shaka-enable-abr-button");
      a.eventManager.o(c, "click", function() {
        a.player.configure({ abr: { enabled: true } });
        ZJ(a);
      });
      a.l = W("span");
      a.l.textContent = a.localization.resolve("AUTO_QUALITY");
      c.appendChild(a.l);
      a.player.getConfiguration().abr.enabled && (c.ariaSelected = "true", c.appendChild(jG()), a.l.classList.add("shaka-chosen-item"), a.currentSelection.textContent = a.localization.resolve("AUTO_QUALITY"));
      a.button.setAttribute("shaka-status", a.currentSelection.textContent);
      a.menu.appendChild(c);
      iG(a.menu);
      a.controls.dispatchEvent(new T("resolutionselectionupdated"));
      YJ(a);
      kG(a.button, b > 0);
    }
    function dK(a) {
      var b = [];
      a.player.m == ar || a.player.Da() || (b = a.player.rb() || []);
      var c = b.find(function(k2) {
        return k2.active;
      });
      c && (b = b.filter(function(k2) {
        if (k2.language != c.language || a.controls.g.showAudioChannelCountVariants && k2.channelsCount && c.channelsCount && k2.channelsCount != c.channelsCount) return false;
        var l = a.controls.g.trackLabelFormat;
        return (l == 1 || l == 2) && JSON.stringify(k2.audioRoles) != JSON.stringify(c.audioRoles) || l == 3 && k2.label != c.label || !k2.bandwidth ? false : true;
      }));
      b = b.filter(function(k2, l) {
        return b.findIndex(function(m) {
          return m.bandwidth == k2.bandwidth;
        }) == l;
      });
      b.sort(function(k2, l) {
        return l.bandwidth - k2.bandwidth;
      });
      for (var d = a.player.getConfiguration().abr.enabled, e = t(b), f = e.next(), g = {}; !f.done; g = { Ie: void 0 }, f = e.next()) {
        g.Ie = f.value;
        f = Oj();
        f.classList.add("explicit-resolution");
        a.eventManager.o(f, "click", /* @__PURE__ */ function(k2) {
          return function() {
            var l = k2.Ie;
            a.player.configure({ abr: { enabled: false } });
            a.player.De(l, a.controls.g.clearBufferOnQualityChange);
          };
        }(g));
        var h = W("span");
        h.textContent = g.Ie.bandwidth ? aK(a, g.Ie, b) : "Unknown";
        f.appendChild(h);
        d || g.Ie != c || (f.ariaSelected = "true", f.appendChild(jG()), h.classList.add("shaka-chosen-item"), a.currentSelection.textContent = h.textContent);
        a.menu.appendChild(f);
      }
      return b.length;
    }
    function eK(a) {
      var b = a.player.getVideoTracks() || [], c = b.find(function(m) {
        return m.active;
      });
      b = b.filter(function(m, n) {
        return b.findIndex(function(q) {
          var r = q.height == m.height && q.bandwidth == m.bandwidth && q.frameRate == m.frameRate && q.hdr == m.hdr && q.videoLayout == m.videoLayout;
          r && a.controls.g.showVideoCodec && q.codecs && m.codecs && (r = kf(q.codecs) == kf(m.codecs));
          return r;
        }) == n;
      });
      b.sort(function(m, n) {
        return n.height == m.height || m.height == null || n.height == null ? n.bandwidth - m.bandwidth : n.height - m.height;
      });
      for (var d = a.player.getConfiguration().abr.enabled, e = t(b), f = e.next(), g = {}; !f.done; g = { nc: void 0 }, f = e.next()) {
        g.nc = f.value;
        f = Oj();
        f.classList.add("explicit-resolution");
        a.eventManager.o(f, "click", /* @__PURE__ */ function(m) {
          return function() {
            var n = m.nc;
            a.player.configure({ abr: { enabled: false } });
            a.player.Hj(n, a.controls.g.clearBufferOnQualityChange);
          };
        }(g));
        var h = W("span");
        h.textContent = g.nc.height && g.nc.width ? bK(a, g.nc, b) : g.nc.bandwidth ? Math.round(g.nc.bandwidth / 1e3) + " kbits/s" : "Unknown";
        f.appendChild(h);
        var k2 = cK(a, g.nc.width, g.nc.height);
        if (k2 !== "") {
          var l = W("sup");
          l.classList.add("shaka-quality-mark");
          l.textContent = k2;
          f.appendChild(l);
        }
        d || g.nc != c || (f.ariaSelected = "true", f.appendChild(jG()), h.classList.add("shaka-chosen-item"), a.currentSelection.textContent = h.textContent);
        a.menu.appendChild(f);
      }
      return b.length;
    }
    function bK(a, b, c) {
      function d(l, m) {
        return l != m && l.height == m.height && l.hdr == m.hdr && Math.round(l.frameRate || 0) == Math.round(m.frameRate || 0);
      }
      var e = b.height || 0, f = b.width || 0;
      e > f && (e = t([e, f]), f = e.next().value, e = e.next().value);
      var g = e;
      f / e > 16 / 9 && (g = Math.round(f * 9 / 16));
      f = g + "p";
      e = /* @__PURE__ */ new Set();
      g = t(c);
      for (var h = g.next(); !h.done; h = g.next()) h = h.value, h.frameRate && e.add(Math.round(h.frameRate));
      e.size > 1 && (e = b.frameRate) && (e >= 50 || e <= 20) && (f += Math.round(b.frameRate));
      if (b.hdr == "PQ" || b.hdr == "HLG") f += " HDR";
      (b.videoLayout || "").includes("CH-STEREO") && (f += " 3D");
      if (c.some(function(l) {
        return d(b, l);
      }) && (c.some(function(l) {
        return d(b, l) && l.bandwidth == b.bandwidth;
      }) || (f += " (" + Math.round(b.bandwidth / 1e3) + " kbits/s)"), a.controls.g.showVideoCodec)) {
        var k2 = function(l) {
          var m = "";
          l && (l = kf(l), m = l.startsWith("dovi-") ? "Dolby Vision" : l.toUpperCase());
          return m ? " " + m : m;
        };
        c.some(function(l) {
          return d(b, l) && k2(l.codecs) != k2(b.codecs);
        }) && (f += k2(b.codecs));
      }
      return f;
    }
    function aK(a, b, c) {
      var d = Math.round(b.bandwidth / 1e3) + " kbits/s";
      if (a.controls.g.showAudioCodec) {
        var e = function(f) {
          var g = "";
          f && (g = kf(f).toUpperCase());
          return g ? " " + g : g;
        };
        c.some(function(f) {
          return e(f.codecs) != e(b.codecs);
        }) && (d += e(b.codecs));
      }
      return d;
    }
    function YJ(a) {
      var b = a.player.Hd() ? "QUALITY" : "RESOLUTION";
      a.button.ariaLabel = a.localization.resolve(b);
      a.backButton.ariaLabel = a.localization.resolve(b);
      a.backSpan.textContent = a.localization.resolve(b);
      a.nameSpan.textContent = a.localization.resolve(b);
      a.l.textContent = a.localization.resolve("AUTO_QUALITY");
      a.player.getConfiguration().abr.enabled && (a.currentSelection.textContent = a.localization.resolve("AUTO_QUALITY"));
    }
    S("shaka.ui.ResolutionSelection", XJ);
    function fK() {
    }
    fK.prototype.create = function(a, b) {
      return new XJ(a, b);
    };
    gI("quality", new fK());
    CH("quality", new fK());
    function gK(a, b) {
      fG.call(this, a, b);
      var c = this;
      this.g = Oj();
      this.g.classList.add("material-icons-round");
      this.g.classList.add("shaka-rewind-button");
      this.g.classList.add("shaka-tooltip-status");
      this.g.setAttribute("shaka-status", this.localization.resolve("OFF"));
      this.g.textContent = "fast_rewind";
      this.parent.appendChild(this.g);
      hK(this);
      this.h = this.controls.g.rewindRates;
      this.eventManager.o(this.localization, "locale-updated", function() {
        hK(c);
      });
      this.eventManager.o(this.localization, "locale-changed", function() {
        hK(c);
      });
      this.eventManager.o(this.g, "click", function() {
        if (c.controls.Ca() && c.video.duration) {
          var d = c.h.indexOf(c.player.Ya()) + 1;
          d = d != c.h.length ? c.h[d] : c.h[0];
          c.video.paused && c.video.play();
          c.player.Xc(d);
          c.g.setAttribute("shaka-status", d + "x");
        }
      });
      this.eventManager.o(this.player, "ratechange", function() {
        c.g.setAttribute("shaka-status", c.player.Ya() + "x");
      });
    }
    ma(gK, fG);
    function hK(a) {
      a.g.ariaLabel = a.localization.resolve("REWIND");
    }
    S("shaka.ui.RewindButton", gK);
    function iK() {
    }
    iK.prototype.create = function(a, b) {
      return new gK(a, b);
    };
    CH("rewind", new iK());
    function jK(a, b) {
      fG.call(this, a, b);
      var c = this;
      this.l = this.controls.F;
      this.g = Oj();
      this.g.classList.add("shaka-save.video-frame-button");
      this.g.classList.add("shaka-tooltip");
      this.h = W("i");
      this.h.classList.add("material-icons-round");
      this.h.textContent = "download";
      this.g.appendChild(this.h);
      a = W("label");
      a.classList.add("shaka-overflow-button-label");
      a.classList.add("shaka-overflow-menu-only");
      this.i = W("span");
      this.i.textContent = this.localization.resolve("DOWNLOAD_VIDEO_FRAME");
      a.appendChild(this.i);
      this.j = W("span");
      this.j.classList.add("shaka-current-selection-span");
      a.appendChild(this.j);
      this.g.appendChild(a);
      kK(this);
      this.parent.appendChild(this.g);
      this.eventManager.o(this.localization, "locale-updated", function() {
        kK(c);
      });
      this.eventManager.o(this.localization, "locale-changed", function() {
        kK(c);
      });
      this.eventManager.o(this.g, "click", function() {
        var d = document.createElement("canvas"), e = d.getContext("2d"), f = c.controls.m;
        d.width = f.videoWidth;
        d.height = f.videoHeight;
        e.drawImage(f, 0, 0, d.width, d.height);
        d = d.toDataURL("image/png");
        e = document.createElement("a");
        e.href = d;
        e.download = "videoframe_" + f.currentTime.toFixed(3) + ".png";
        e.click();
      });
      this.eventManager.o(this.controls.D, "vrstatuschanged", function() {
        lK(c);
      });
      this.eventManager.o(this.adManager, "ad-started", function() {
        lK(c);
      });
      this.eventManager.o(this.adManager, "ad-stopped", function() {
        lK(c);
      });
      this.eventManager.o(this.player, "unloading", function() {
        lK(c);
      });
      this.eventManager.o(this.player, "loaded", function() {
        lK(c);
      });
      this.eventManager.o(
        this.video,
        "play",
        function() {
          lK(c);
        }
      );
      this.eventManager.o(this.video, "pause", function() {
        lK(c);
      });
      this.eventManager.o(this.video, "seeking", function() {
        lK(c);
      });
      this.eventManager.o(this.controls, "caststatuschanged", function() {
        lK(c);
      });
      lK(this);
    }
    ma(jK, fG);
    function lK(a) {
      var b = true;
      a.controls.Wb() && (b = false);
      b && a.l.Qa() && (b = false);
      b && (a.player.drmInfo() || a.player.Hd()) && (b = false);
      b && a.ad && (b = false);
      b && a.video.remote && a.video.remote.state != "disconnected" && (b = false);
      kG(a.g, b);
    }
    function kK(a) {
      a.g.ariaLabel = a.localization.resolve("DOWNLOAD_VIDEO_FRAME");
      a.i.textContent = a.localization.resolve("DOWNLOAD_VIDEO_FRAME");
    }
    S("shaka.ui.SaveVideoFrameButton", jK);
    function mK() {
    }
    mK.prototype.create = function(a, b) {
      return new jK(a, b);
    };
    gI("save_video_frame", new mK());
    pG("save_video_frame", new mK());
    function nK(a, b) {
      fG.call(this, a, b);
      var c = this;
      if (this.h = this.player.uh()) this.g = Oj(), this.g.classList.add("shaka-skip-next-button"), this.g.classList.add("material-icons-round"), this.g.classList.add("shaka-tooltip"), this.g.textContent = "skip_next", this.parent.appendChild(this.g), oK(this), pK(this), this.eventManager.o(this.localization, "locale-updated", function() {
        oK(c);
      }), this.eventManager.o(this.localization, "locale-changed", function() {
        oK(c);
      }), this.eventManager.o(this.g, "click", function() {
        c.controls.Ca() && c.h.playItem(c.h.getCurrentItemIndex() + 1);
      }), this.eventManager.o(this.h, "currentitemchanged", function() {
        pK(c);
      }), this.eventManager.o(this.h, "itemsinserted", function() {
        pK(c);
      }), this.eventManager.o(this.h, "itemsremoved", function() {
        pK(c);
      }), this.eventManager.o(this.player, "loading", function() {
        pK(c);
      });
    }
    ma(nK, fG);
    function oK(a) {
      a.g.ariaLabel = a.localization.resolve("SKIP_NEXT");
    }
    function pK(a) {
      var b = a.h.getItems().length;
      b = b > 1 && a.h.getCurrentItemIndex() + 1 < b;
      kG(a.g, b);
    }
    S("shaka.ui.SkipNextButton", nK);
    function qK() {
    }
    qK.prototype.create = function(a, b) {
      return new nK(a, b);
    };
    CH("skip_next", new qK());
    function rK(a, b) {
      rG.call(this, a, b);
      this.button.classList.add("shaka-small-play-button");
      this.button.classList.add("material-icons-round");
      this.button.classList.add("shaka-tooltip");
    }
    ma(rK, rG);
    S("shaka.ui.SmallPlayButton", rK);
    function sK() {
    }
    sK.prototype.create = function(a, b) {
      return new rK(a, b);
    };
    CH("play_pause", new sK());
    function tK(a, b) {
      fG.call(this, a, b);
      a = W("div");
      a.classList.add("shaka-spacer");
      a.ariaHidden = "true";
      this.parent.appendChild(a);
    }
    ma(tK, fG);
    S("shaka.ui.Spacer", tK);
    function uK() {
    }
    uK.prototype.create = function(a, b) {
      return new tK(a, b);
    };
    CH("spacer", new uK());
    function vK(a, b) {
      function c(m) {
        m = parseInt(l.g[m], 10);
        return m > 2e9 ? (m / 1e9).toFixed(2) + "GB" : m > 1e6 ? (m / 1e6).toFixed(2) + "MB" : m > 1e3 ? (m / 1e3).toFixed(2) + "KB" : m + "B";
      }
      function d(m) {
        return l.g[m] + " (gaps)";
      }
      function e(m) {
        return lG(l.g[m], false) + " (m)";
      }
      function f(m) {
        return Math.round(l.g[m] / 1e3) + " (kbits/s)";
      }
      function g(m) {
        return l.g[m].toFixed(2) + " (s)";
      }
      function h(m) {
        return l.g[m] + " (frames)";
      }
      function k2(m) {
        return l.g[m] + " (px)";
      }
      fG.call(this, a, b);
      var l = this;
      this.i = Oj();
      this.i.classList.add("shaka-statistics-button");
      this.j = W("i");
      this.j.classList.add("material-icons-round");
      this.j.textContent = "insert_chart_outlined";
      this.i.appendChild(this.j);
      a = W("label");
      a.classList.add("shaka-overflow-button-label");
      a.classList.add("shaka-simple-overflow-button-label-inline");
      this.A = W("span");
      a.appendChild(this.A);
      this.m = W("span");
      this.m.classList.add("shaka-current-selection-span");
      a.appendChild(this.m);
      this.i.appendChild(a);
      this.parent.appendChild(this.i);
      this.h = W("div");
      this.h.classList.add("shaka-no-propagation");
      this.h.classList.add("shaka-show-controls-on-mouse-over");
      this.h.classList.add("shaka-statistics-container");
      this.h.classList.add("shaka-hidden");
      this.controls.i.appendChild(this.h);
      this.D = [];
      this.F = ["stateHistory", "switchHistory"];
      this.g = this.player.getStats();
      this.u = /* @__PURE__ */ new Map();
      this.C = (/* @__PURE__ */ new Map()).set("width", k2).set("height", k2).set("currentCodecs", function(m) {
        return l.g[m];
      }).set("completionPercent", function(m) {
        return l.g[m] + " (%)";
      }).set("bufferingTime", g).set("drmTimeSeconds", g).set("licenseTime", g).set("liveLatency", g).set("loadLatency", g).set(
        "manifestTimeSeconds",
        g
      ).set("estimatedBandwidth", f).set("streamBandwidth", f).set("maxSegmentDuration", g).set("pauseTime", e).set("playTime", e).set("corruptedFrames", h).set("decodedFrames", h).set("droppedFrames", h).set("stallsDetected", function(m) {
        return l.g[m] + " (stalls)";
      }).set("gapsJumped", d).set("manifestSizeBytes", c).set("bytesDownloaded", c).set("nonFatalErrorCount", function(m) {
        return l.g[m] + " (errors)";
      }).set("manifestPeriodCount", function(m) {
        return l.g[m] + " (periods)";
      }).set("manifestGapCount", d);
      this.l = new Cf(function() {
        l.g = l.player.getStats();
        for (var m = t(l.D), n = m.next(); !n.done; n = m.next()) {
          var q = n.value;
          n = l.u.get(q);
          n.textContent = l.C.get(q)(q);
          n && n.parentElement && (q = l.g[q], typeof q == "string" ? kG(n.parentElement, q != "") : kG(n.parentElement, !isNaN(q)));
        }
      });
      wK(this);
      xK(this);
      this.eventManager.o(this.localization, "locale-updated", function() {
        wK(l);
      });
      this.eventManager.o(this.localization, "locale-changed", function() {
        wK(l);
      });
      this.eventManager.o(this.i, "click", function() {
        yK(l);
        wK(l);
      });
    }
    ma(vK, fG);
    function yK(a) {
      a.h.classList.contains("shaka-hidden") ? (a.j.textContent = "insert_chart", a.l.za(0.1), kG(a.h, true)) : (a.j.textContent = "insert_chart_outlined", a.l.stop(), kG(a.h, false));
    }
    function wK(a) {
      a.A.textContent = a.localization.resolve("STATISTICS");
      a.i.ariaLabel = a.localization.resolve("STATISTICS");
      a.m.textContent = a.localization.resolve(a.h.classList.contains("shaka-hidden") ? "OFF" : "ON");
    }
    function zK(a, b) {
      var c = W("div"), d = W("label");
      d.textContent = b + ":";
      c.appendChild(d);
      d = W("span");
      d.textContent = a.C.get(b)(b);
      c.appendChild(d);
      a.u.set(b, d);
      return c;
    }
    function xK(a) {
      var b = W("div");
      b.classList.add("shaka-no-propagation");
      b.classList.add("shaka-statistics-close");
      var c = W("i");
      c.classList.add("material-icons");
      c.classList.add("notranslate");
      c.classList.add("material-icons-round");
      c.textContent = "close";
      b.appendChild(c);
      a.h.appendChild(b);
      a.eventManager.o(c, "click", function() {
        yK(a);
      });
      b = t(a.controls.g.statisticsList);
      for (c = b.next(); !c.done; c = b.next()) if (c = c.value, c in a.g && !a.F.includes(c)) {
        var d = zK(a, c);
        a.h.appendChild(d);
        a.D.push(c);
      } else bb(
        "Unrecognized statistic element:",
        c
      );
    }
    vK.prototype.release = function() {
      this.l.stop();
      this.l = null;
      fG.prototype.release.call(this);
    };
    S("shaka.ui.StatisticsButton", vK);
    function AK() {
    }
    AK.prototype.create = function(a, b) {
      return new vK(a, b);
    };
    gI("statistics", new AK());
    pG("statistics", new AK());
    function BK(a, b) {
      JI.call(this, a, b, "closed_caption");
      var c = this;
      this.button.classList.add("shaka-caption-button");
      this.button.classList.add("shaka-tooltip-status");
      this.menu.classList.add("shaka-text-languages");
      this.player && this.player.ld() ? this.button.ariaPressed = "true" : this.button.ariaPressed = "false";
      CK(this);
      this.eventManager.o(this.localization, "locale-updated", function() {
        DK(c);
        EK(c);
      });
      this.eventManager.o(this.localization, "locale-changed", function() {
        DK(c);
        EK(c);
      });
      this.eventManager.o(
        this.player,
        "loading",
        function() {
          FK(c);
          EK(c);
        }
      );
      this.eventManager.o(this.player, "loaded", function() {
        FK(c);
        EK(c);
      });
      this.eventManager.o(this.player, "unloading", function() {
        FK(c);
        EK(c);
      });
      this.eventManager.o(this.player, "texttrackvisibility", function() {
        FK(c);
        EK(c);
      });
      this.eventManager.o(this.player, "textchanged", function() {
        EK(c);
      });
      this.eventManager.o(this.player, "trackschanged", function() {
        EK(c);
      });
      FK(this);
      DK(this);
      EK(this);
    }
    ma(BK, JI);
    function CK(a) {
      var b = Oj();
      b.ariaSelected = "true";
      a.menu.appendChild(b);
      b.appendChild(jG());
      a.g = W("span");
      b.appendChild(a.g);
    }
    function FK(a) {
      a.player.ld() ? (a.icon.textContent = "closed_caption", a.button.ariaPressed = "true") : (a.icon.textContent = "closed_caption_disabled", a.button.ariaPressed = "false");
      a.controls.dispatchEvent(new T("captionselectionupdated"));
    }
    function EK(a) {
      var b = a.player.vc() || [];
      II(b, a.menu, function(d) {
        return GK(a, d);
      }, a.player.ld(), a.currentSelection, a.localization, a.controls.g.textTrackLabelFormat);
      var c = Oj();
      c.classList.add("shaka-turn-captions-off-button");
      a.eventManager.o(c, "click", function() {
        a.player.Fe(false);
        EK(a);
      });
      c.appendChild(a.g);
      a.menu.appendChild(c);
      a.player.ld() ? a.g.classList.remove("shaka-chosen-item") : (c.ariaSelected = "true", c.appendChild(jG()), a.g.classList.add("shaka-chosen-item"), a.currentSelection.textContent = a.localization.resolve("OFF"));
      a.button.setAttribute("shaka-status", a.currentSelection.textContent);
      iG(a.menu);
      a.controls.dispatchEvent(new T("captionselectionupdated"));
      kG(a.button, b.length > 0);
    }
    function GK(a, b) {
      return P(function(c) {
        if (c.g == 1) return a.player.fg(b), G(c, a.player.Fe(true), 2);
        a.player.configure("preferredTextLanguage", b.language);
        a.player.configure("preferForcedSubs", b.forced);
        H(c);
      });
    }
    function DK(a) {
      a.button.ariaLabel = a.localization.resolve("CAPTIONS");
      a.backButton.ariaLabel = a.localization.resolve("BACK");
      a.nameSpan.textContent = a.localization.resolve("CAPTIONS");
      a.backSpan.textContent = a.localization.resolve("CAPTIONS");
      a.g.textContent = a.localization.resolve("OFF");
    }
    S("shaka.ui.TextSelection", BK);
    function HK() {
    }
    HK.prototype.create = function(a, b) {
      return new BK(a, b);
    };
    gI("captions", new HK());
    CH("captions", new HK());
    function IK(a, b) {
      fG.call(this, a, b);
      var c = this;
      this.g = Oj();
      this.g.classList.add("shaka-toggle-stereoscopic-button");
      this.g.classList.add("shaka-tooltip");
      this.g.ariaPressed = "false";
      this.h = W("i");
      this.h.classList.add("material-icons-round");
      this.h.textContent = "3d_rotation";
      this.g.appendChild(this.h);
      a = W("label");
      a.classList.add("shaka-overflow-button-label");
      a.classList.add("shaka-overflow-menu-only");
      this.j = W("span");
      a.appendChild(this.j);
      this.i = W("span");
      this.i.classList.add("shaka-current-selection-span");
      a.appendChild(this.i);
      this.g.appendChild(a);
      this.parent.appendChild(this.g);
      JK(this);
      this.eventManager.o(this.localization, "locale-updated", function() {
        JK(c);
      });
      this.eventManager.o(this.localization, "locale-changed", function() {
        JK(c);
      });
      var d = this.controls.D;
      this.eventManager.o(this.g, "click", function() {
        c.controls.Ca() && d.Wd();
      });
      this.eventManager.o(d, "vrstatuschanged", function() {
        kG(c.g, c.controls.Wb());
      });
      kG(this.g, this.controls.Wb());
    }
    ma(IK, fG);
    function JK(a) {
      a.g.ariaLabel = a.localization.resolve("TOGGLE_STEREOSCOPIC");
      a.j.textContent = a.localization.resolve("TOGGLE_STEREOSCOPIC");
    }
    S("shaka.ui.ToggleStereoscopicButton", IK);
    function KK() {
    }
    KK.prototype.create = function(a, b) {
      return new IK(a, b);
    };
    gI("toggle_stereoscopic", new KK());
    CH("toggle_stereoscopic", new KK());
    function LK(a, b) {
      zG.call(this, a, b, ["shaka-volume-bar-container"], ["shaka-volume-bar"]);
      var c = this;
      this.g = this.controls.g;
      this.setRange(0, 100);
      this.eventManager.o(this.video, "volumechange", function() {
        return MK(c);
      });
      this.eventManager.o(this.player, "loading", function() {
        return MK(c);
      });
      this.eventManager.o(this.player, "loaded", function() {
        return NK(c);
      });
      this.eventManager.o(this.player, "unloading", function() {
        return NK(c);
      });
      this.eventManager.o(this.player, "trackschanged", function() {
        return NK(c);
      });
      this.eventManager.o(
        this.controls,
        "caststatuschanged",
        function() {
          return MK(c);
        }
      );
      this.eventManager.o(this.adManager, "ad-volume-changed", function() {
        return OK(c);
      });
      this.eventManager.o(this.adManager, "ad-muted", function() {
        return OK(c);
      });
      this.eventManager.o(this.adManager, "ad-started", function() {
        return NK(c);
      });
      this.eventManager.o(this.adManager, "ad-stopped", function() {
        NK(c);
        MK(c);
      });
      this.eventManager.o(this.localization, "locale-updated", function() {
        return PK(c);
      });
      this.eventManager.o(this.localization, "locale-changed", function() {
        return PK(c);
      });
      MK(this);
      PK(this);
      if (this.ad) this.onChange();
      NK(this);
    }
    ma(LK, zG);
    LK.prototype.onChange = function() {
      this.ad && this.ad.isLinear() ? this.ad.setVolume(this.getValue() / 100) : (this.video.volume = this.getValue() / 100, this.video.volume > 0 && (this.video.muted = false));
    };
    function MK(a) {
      a.video.muted ? a.setValue(0) : a.setValue(a.video.volume * 100);
      QK(a);
    }
    function OK(a) {
      var b = a.ad.getVolume();
      a.setValue(b * 100);
      QK(a);
    }
    function QK(a) {
      var b = a.g.volumeBarColors, c = ["to right"];
      c.push(b.level + a.getValue() + "%");
      c.push(b.base + a.getValue() + "%");
      c.push(b.base + "100%");
      a.container.style.background = "linear-gradient(" + c.join(",") + ")";
    }
    function PK(a) {
      a.bar.ariaLabel = a.localization.resolve("VOLUME");
    }
    function NK(a) {
      var b = true;
      a.ad && a.ad.isLinear() ? b = true : a.player.Hh() && (b = false);
      kG(a.container, b);
    }
    S("shaka.ui.VolumeBar", LK);
    function RK() {
    }
    RK.prototype.create = function(a, b) {
      return new LK(a, b);
    };
    CH("volume", new RK());
  }).call(exportTo, innerGlobal, innerGlobal, void 0);
  if (typeof exports != "undefined") for (var k in exportTo.shaka) exports[k] = exportTo.shaka[k];
  else if (typeof define == "function" && define.amd) define(function() {
    return exportTo.shaka;
  });
  else innerGlobal.shaka = exportTo.shaka;
})();
