shaka-player
Version:
DASH/EME video player library
129 lines (128 loc) • 397 kB
JavaScript
/*
@license
Shaka Player
Copyright 2016 Google LLC
SPDX-License-Identifier: Apache-2.0
*/
(function(){var innerGlobal=typeof window!="undefined"?window:global;var exportTo={};(function(window,global,module){/*
Copyright The Closure Library Authors.
SPDX-License-Identifier: Apache-2.0
*/
var r;function aa(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}}var ba="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(a==Array.prototype||a==Object.prototype)return a;a[b]=c.value;return a};
function ca(a){a=["object"==typeof globalThis&&globalThis,a,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];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=ca(this);function fa(a,b){if(b)a:{for(var c=ea,d=a.split("."),e=0;e<d.length-1;e++){var f=d[e];if(!(f in c))break a;c=c[f]}d=d[d.length-1];e=c[d];f=b(e);f!=e&&null!=f&&ba(c,d,{configurable:!0,writable:!0,value:f})}}
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;ba(this,"description",{configurable:!0,writable:!0,value:g})}if(a)return a;c.prototype.toString=function(){return this.g};var d="jscomp_symbol_"+(1E9*Math.random()>>>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]];"function"===typeof d&&"function"!=typeof d.prototype[a]&&ba(d.prototype,a,{configurable:!0,writable:!0,value:function(){return ha(aa(this))}})}return a});function ha(a){a={next:a};a[Symbol.iterator]=function(){return this};return a}
function t(a){var b="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return b?b.call(a):{next:aa(a)}}function ia(a){if(!(a instanceof Array)){a=t(a);for(var b,c=[];!(b=a.next()).done;)c.push(b.value);a=c}return a}var ja="function"==typeof Object.create?Object.create:function(a){function b(){}b.prototype=a;return new b},ka;
if("function"==typeof Object.setPrototypeOf)ka=Object.setPrototypeOf;else{var la;a:{var ma={a:!0},na={};try{na.__proto__=ma;la=na.a;break a}catch(a){}la=!1}ka=la?function(a,b){a.__proto__=b;if(a.__proto__!==b)throw new TypeError(a+" is not extensible");return a}:null}var oa=ka;
function pa(a,b){a.prototype=ja(b.prototype);a.prototype.constructor=a;if(oa)oa(a,b);else for(var c in b)if("prototype"!=c)if(Object.defineProperties){var d=Object.getOwnPropertyDescriptor(b,c);d&&Object.defineProperty(a,c,d)}else a[c]=b[c];a.sg=b.prototype}function qa(){this.o=!1;this.l=null;this.h=void 0;this.g=1;this.j=this.m=0;this.u=this.i=null}function ra(a){if(a.o)throw new TypeError("Generator is already running");a.o=!0}qa.prototype.s=function(a){this.h=a};
function ta(a,b){a.i={Ud:b,ae:!0};a.g=a.m||a.j}qa.prototype["return"]=function(a){this.i={"return":a};this.g=this.j};function u(a,b,c){a.g=c;return{value:b}}qa.prototype.A=function(a){this.g=a};function z(a){a.g=0}function A(a,b,c){a.m=b;void 0!=c&&(a.j=c)}function ua(a){a.m=0;a.j=2}function va(a,b){a.g=b;a.m=0}function F(a){a.m=0;var b=a.i.Ud;a.i=null;return b}function wa(a){a.u=[a.i];a.m=0;a.j=0}
function xa(a,b){var c=a.u.splice(0)[0];(c=a.i=a.i||c)?c.ae?a.g=a.m||a.j:void 0!=c.A&&a.j<c.A?(a.g=c.A,a.i=null):a.g=a.j:a.g=b}function ya(a){this.g=new qa;this.h=a}function za(a,b){ra(a.g);var c=a.g.l;if(c)return Ba(a,"return"in c?c["return"]:function(d){return{value:d,done:!0}},b,a.g["return"]);a.g["return"](b);return Ca(a)}
function Ba(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.o=!1,e;var f=e.value}catch(g){return a.g.l=null,ta(a.g,g),Ca(a)}a.g.l=null;d.call(a.g,f);return Ca(a)}
function Ca(a){for(;a.g.g;)try{var b=a.h(a.g);if(b)return a.g.o=!1,{value:b.value,done:!1}}catch(c){a.g.h=void 0,ta(a.g,c)}a.g.o=!1;if(a.g.i){b=a.g.i;a.g.i=null;if(b.ae)throw b.Ud;return{value:b["return"],done:!0}}return{value:void 0,done:!0}}
function Da(a){this.next=function(b){ra(a.g);a.g.l?b=Ba(a,a.g.l.next,b,a.g.s):(a.g.s(b),b=Ca(a));return b};this["throw"]=function(b){ra(a.g);a.g.l?b=Ba(a,a.g.l["throw"],b,a.g.s):(ta(a.g,b),b=Ca(a));return b};this["return"]=function(b){return za(a,b)};this[Symbol.iterator]=function(){return this}}
function Ea(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 L(a){return Ea(new Da(new ya(a)))}function Fa(){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.o=!1;var h=this.j();try{g(h.resolve,h.reject)}catch(k){h.reject(k)}}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(null==this.g){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 k=
g[h];g[h]=null;try{k()}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){k||(k=!0,l.call(h,m))}}var h=this,k=!1;return{resolve:g(this.D),reject:g(this.l)}};b.prototype.D=function(g){if(g===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(g instanceof b)this.G(g);else{a:switch(typeof g){case "object":var h=null!=g;break a;case "function":h=!0;break a;default:h=!1}h?this.C(g):this.m(g)}};
b.prototype.C=function(g){var h=void 0;try{h=g.then}catch(k){this.l(k);return}"function"==typeof h?this.J(h,g):this.m(g)};b.prototype.l=function(g){this.s(2,g)};b.prototype.m=function(g){this.s(1,g)};b.prototype.s=function(g,h){if(0!=this.h)throw Error("Cannot settle("+g+", "+h+"): Promise already settled in state"+this.h);this.h=g;this.i=h;2===this.h&&this.F();this.u()};b.prototype.F=function(){var g=this;e(function(){if(g.B()){var h=ea.console;"undefined"!==typeof h&&h.error(g.i)}},1)};b.prototype.B=
function(){if(this.o)return!1;var g=ea.CustomEvent,h=ea.Event,k=ea.dispatchEvent;if("undefined"===typeof k)return!0;"function"===typeof g?g=new g("unhandledrejection",{cancelable:!0}):"function"===typeof h?g=new h("unhandledrejection",{cancelable:!0}):(g=ea.document.createEvent("CustomEvent"),g.initCustomEvent("unhandledrejection",!1,!0,g));g.promise=this;g.reason=this.i;return k(g)};b.prototype.u=function(){if(null!=this.g){for(var g=0;g<this.g.length;++g)f.h(this.g[g]);this.g=null}};var f=new c;
b.prototype.G=function(g){var h=this.j();g.pc(h.resolve,h.reject)};b.prototype.J=function(g,h){var k=this.j();try{g.call(h,k.resolve,k.reject)}catch(l){k.reject(l)}};b.prototype.then=function(g,h){function k(p,q){return"function"==typeof p?function(v){try{l(p(v))}catch(y){m(y)}}:q}var l,m,n=new b(function(p,q){l=p;m=q});this.pc(k(g,l),k(h,m));return n};b.prototype["catch"]=function(g){return this.then(void 0,g)};b.prototype.pc=function(g,h){function k(){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;null==this.g?f.h(k):this.g.push(k);this.o=!0};b.resolve=d;b.reject=function(g){return new b(function(h,k){k(g)})};b.race=function(g){return new b(function(h,k){for(var l=t(g),m=l.next();!m.done;m=l.next())d(m.value).pc(h,k)})};b.all=function(g){var h=t(g),k=h.next();return k.done?d([]):new b(function(l,m){function n(v){return function(y){p[v]=y;q--;0==q&&l(p)}}var p=[],q=0;do p.push(void 0),q++,d(k.value).pc(n(p.length-1),m),k=h.next();
while(!k.done)})};return b});function Ga(a,b){return Object.prototype.hasOwnProperty.call(a,b)}
fa("WeakMap",function(a){function b(k){this.g=(h+=Math.random()+1).toString();if(k){k=t(k);for(var l;!(l=k.next()).done;)l=l.value,this.set(l[0],l[1])}}function c(){}function d(k){var l=typeof k;return"object"===l&&null!==k||"function"===l}function e(k){if(!Ga(k,g)){var l=new c;ba(k,g,{value:l})}}function f(k){var l=Object[k];l&&(Object[k]=function(m){if(m instanceof c)return m;Object.isExtensible(m)&&e(m);return l(m)})}if(function(){if(!a||!Object.seal)return!1;try{var k=Object.seal({}),l=Object.seal({}),
m=new a([[k,2],[l,3]]);if(2!=m.get(k)||3!=m.get(l))return!1;m["delete"](k);m.set(l,4);return!m.has(k)&&4==m.get(l)}catch(n){return!1}}())return a;var g="$jscomp_hidden_"+Math.random();f("freeze");f("preventExtensions");f("seal");var h=0;b.prototype.set=function(k,l){if(!d(k))throw Error("Invalid WeakMap key");e(k);if(!Ga(k,g))throw Error("WeakMap key fail: "+k);k[g][this.g]=l;return this};b.prototype.get=function(k){return d(k)&&Ga(k,g)?k[g][this.g]:void 0};b.prototype.has=function(k){return d(k)&&
Ga(k,g)&&Ga(k[g],this.g)};b.prototype["delete"]=function(k){return d(k)&&Ga(k,g)&&Ga(k[g],this.g)?delete k[g][this.g]:!1};return b});
fa("Map",function(a){function b(){var h={};return h.Qa=h.next=h.head=h}function c(h,k){var l=h.g;return ha(function(){if(l){for(;l.head!=h.g;)l=l.Qa;for(;l.next!=l.head;)return l=l.next,{done:!1,value:k(l)};l=null}return{done:!0,value:void 0}})}function d(h,k){var l=k&&typeof k;"object"==l||"function"==l?f.has(k)?l=f.get(k):(l=""+ ++g,f.set(k,l)):l="p_"+k;var m=h.h[l];if(m&&Ga(h.h,l))for(var n=0;n<m.length;n++){var p=m[n];if(k!==k&&p.key!==p.key||k===p.key)return{id:l,list:m,index:n,fa:p}}return{id:l,
list:m,index:-1,fa:void 0}}function e(h){this.h={};this.g=b();this.size=0;if(h){h=t(h);for(var k;!(k=h.next()).done;)k=k.value,this.set(k[0],k[1])}}if(function(){if(!a||"function"!=typeof a||!a.prototype.entries||"function"!=typeof Object.seal)return!1;try{var h=Object.seal({x:4}),k=new a(t([[h,"s"]]));if("s"!=k.get(h)||1!=k.size||k.get({x:4})||k.set({x:4},"t")!=k||2!=k.size)return!1;var l=k.entries(),m=l.next();if(m.done||m.value[0]!=h||"s"!=m.value[1])return!1;m=l.next();return m.done||4!=m.value[0].x||
"t"!=m.value[1]||!l.next().done?!1:!0}catch(n){return!1}}())return a;var f=new WeakMap;e.prototype.set=function(h,k){h=0===h?0:h;var l=d(this,h);l.list||(l.list=this.h[l.id]=[]);l.fa?l.fa.value=k:(l.fa={next:this.g,Qa:this.g.Qa,head:this.g,key:h,value:k},l.list.push(l.fa),this.g.Qa.next=l.fa,this.g.Qa=l.fa,this.size++);return this};e.prototype["delete"]=function(h){h=d(this,h);return h.fa&&h.list?(h.list.splice(h.index,1),h.list.length||delete this.h[h.id],h.fa.Qa.next=h.fa.next,h.fa.next.Qa=h.fa.Qa,
h.fa.head=null,this.size--,!0):!1};e.prototype.clear=function(){this.h={};this.g=this.g.Qa=b();this.size=0};e.prototype.has=function(h){return!!d(this,h).fa};e.prototype.get=function(h){return(h=d(this,h).fa)&&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,k){for(var l=this.entries(),
m;!(m=l.next()).done;)m=m.value,h.call(k,m[1],m[0],this)};e.prototype[Symbol.iterator]=e.prototype.entries;var g=0;return e});
fa("Set",function(a){function b(c){this.g=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||"function"!=typeof a||!a.prototype.entries||"function"!=typeof Object.seal)return!1;try{var c=Object.seal({x:4}),d=new a(t([c]));if(!d.has(c)||1!=d.size||d.add(c)!=d||1!=d.size||d.add({x:4})!=d||2!=d.size)return!1;var e=d.entries(),f=e.next();if(f.done||f.value[0]!=c||f.value[1]!=c)return!1;f=e.next();return f.done||f.value[0]==c||4!=f.value[0].x||
f.value[1]!=f.value[0]?!1:e.next().done}catch(g){return!1}}())return a;b.prototype.add=function(c){c=0===c?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});function Ha(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{Zd:e,se:f}}return{Zd:-1,se:void 0}}fa("Array.prototype.findIndex",function(a){return a?a:function(b,c){return Ha(this,b,c).Zd}});
fa("Object.is",function(a){return a?a:function(b,c){return b===c?0!==b||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,f=c||0;for(0>f&&(f=Math.max(f+e,0));f<e;f++){var g=d[f];if(g===b||Object.is(g,b))return!0}return!1}});
function Ja(a,b,c){if(null==a)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-1!==Ja(this,b,"includes").indexOf(b,c||0)}});fa("Array.prototype.find",function(a){return a?a:function(b,c){return Ha(this,b,c).se}});
fa("String.prototype.startsWith",function(a){return a?a:function(b,c){for(var d=Ja(this,b,"startsWith"),e=d.length,f=b.length,g=Math.max(0,Math.min(c|0,d.length)),h=0;h<f&&g<e;)if(d[g++]!=b[h++])return!1;return h>=f}});function Ka(a,b){a instanceof String&&(a+="");var c=0,d=!1,e={next:function(){if(!d&&c<a.length){var f=c++;return{value:b(f,a[f]),done:!1}}d=!0;return{done:!0,value:void 0}}};e[Symbol.iterator]=function(){return e};return e}
fa("Array.prototype.keys",function(a){return a?a:function(){return Ka(this,function(b){return b})}});var Na="function"==typeof Object.assign?Object.assign:function(a,b){for(var c=1;c<arguments.length;c++){var d=arguments[c];if(d)for(var e in d)Ga(d,e)&&(a[e]=d[e])}return a};fa("Object.assign",function(a){return a||Na});
fa("Array.from",function(a){return a?a:function(b,c,d){c=null!=c?c:function(h){return h};var e=[],f="undefined"!=typeof Symbol&&Symbol.iterator&&b[Symbol.iterator];if("function"==typeof f){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("Array.prototype.values",function(a){return a?a:function(){return Ka(this,function(b,c){return c})}});
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 Ka(this,function(b,c){return[b,c]})}});
fa("String.prototype.repeat",function(a){return a?a:function(b){var c=Ja(this,null,"repeat");if(0>b||1342177279<b)throw new RangeError("Invalid count value");b|=0;for(var d="";b;)if(b&1&&(d+=c),b>>>=1)c+=c;return d}});fa("Object.values",function(a){return a?a:function(b){var c=[],d;for(d in b)Ga(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("Math.trunc",function(a){return a?a:function(b){b=Number(b);if(isNaN(b)||Infinity===b||-Infinity===b||0===b)return b;var c=Math.floor(Math.abs(b));return 0>b?-c:c}});fa("Object.entries",function(a){return a?a:function(b){var c=[],d;for(d in b)Ga(b,d)&&c.push([d,b[d]]);return c}});var Oa=this||self;
function M(a,b){var c=a.split("."),d=Oa;c[0]in d||"undefined"==typeof d.execScript||d.execScript("var "+c[0]);for(var e;c.length&&(e=c.shift());)c.length||void 0===b?d[e]&&d[e]!==Object.prototype[e]?d=d[e]:d=d[e]={}:d[e]=b};/*
@license
Shaka Player
Copyright 2016 Google LLC
SPDX-License-Identifier: Apache-2.0
*/
function Pa(a){this.i=Math.exp(Math.log(.5)/a);this.h=this.g=0}Pa.prototype.sample=function(a,b){var c=Math.pow(this.i,a);c=b*(1-c)+c*this.g;isNaN(c)||(this.g=c,this.h+=a)};function Ra(a){return a.g/(1-Math.pow(a.i,a.h))};function Sa(){this.h=new Pa(2);this.i=new Pa(5);this.g=0}Sa.prototype.sample=function(a,b){if(!(16E3>b)){var c=8E3*b/a,d=a/1E3;this.g+=b;this.h.sample(d,c);this.i.sample(d,c)}};Sa.prototype.getBandwidthEstimate=function(a){return 128E3>this.g?a:Math.min(Ra(this.h),Ra(this.i))};function Ta(){}function Ua(){}function Va(){}function Wa(a){var b=Fa.apply(1,arguments);Xa.has(a)||(Xa.add(a),Va.apply(Ta,ia(b)))}function Ya(){}function Za(){}function $a(){}function ab(){}var Xa=new Set;if(window.console&&window.console.log.bind){var cb={},db=(cb[1]=console.error.bind(console),cb[2]=console.warn.bind(console),cb[3]=console.info.bind(console),cb[4]=console.log.bind(console),cb[5]=console.debug.bind(console),cb[6]=console.debug.bind(console),cb);Va=db[2];Ua=db[1]};function eb(a,b){return"number"===typeof a&&"number"===typeof b&&isNaN(a)&&isNaN(b)?!0:a===b}function fb(a,b){var c=a.indexOf(b);-1<c&&a.splice(c,1)}function gb(a,b,c){c||(c=eb);if(a.length!=b.length)return!1;b=b.slice();var d={};a=t(a);for(var e=a.next();!e.done;d={Qc:d.Qc},e=a.next()){d.Qc=e.value;e=b.findIndex(function(f){return function(g){return c(f.Qc,g)}}(d));if(-1==e)return!1;b[e]=b[b.length-1];b.pop()}return 0==b.length}
function hb(a,b,c){c||(c=eb);if(a.length!=b.length)return!1;for(var d=0;d<a.length;d++)if(!c(a[d],b[d]))return!1;return!0};function ib(a,b,c){this.startTime=a;this.direction=jb;this.endTime=b;this.payload=c;this.region=new kb;this.position=null;this.positionAlign=lb;this.size=0;this.textAlign=mb;this.writingMode=nb;this.lineInterpretation=ob;this.line=null;this.lineHeight="";this.lineAlign=pb;this.displayAlign=qb;this.fontSize=this.border=this.backgroundImage=this.backgroundColor=this.color="";this.fontWeight=rb;this.fontStyle=sb;this.linePadding=this.letterSpacing=this.fontFamily="";this.opacity=1;this.textDecoration=
[];this.wrapLine=!0;this.id="";this.nestedCues=[];this.spacer=this.lineBreak=this.isContainer=!1;this.cellResolution={columns:32,rows:15}}ib.prototype.clone=function(){var a=new ib(0,0,""),b;for(b in this)a[b]=this[b],a[b]&&a[b].constructor==Array&&(a[b]=a[b].slice());return a};
function tb(a,b){if(a.startTime!=b.startTime||a.endTime!=b.endTime||a.payload!=b.payload)return!1;for(var c in a)if("startTime"!=c&&"endTime"!=c&&"payload"!=c)if("nestedCues"==c){if(!hb(a.nestedCues,b.nestedCues,tb))return!1}else if("region"==c||"cellResolution"==c)for(var d in a[c]){if(a[c][d]!=b[c][d])return!1}else if(Array.isArray(a[c])){if(!hb(a[c],b[c]))return!1}else if(a[c]!=b[c])return!1;return!0}M("shaka.text.Cue",ib);var lb="auto";
ib.positionAlign={LEFT:"line-left",RIGHT:"line-right",CENTER:"center",AUTO:lb};var mb="center",ub={LEFT:"left",RIGHT:"right",CENTER:mb,START:"start",END:"end"};ib.textAlign=ub;var qb="after",vb={BEFORE:"before",CENTER:"center",AFTER:qb};ib.displayAlign=vb;var jb="ltr";ib.direction={HORIZONTAL_LEFT_TO_RIGHT:jb,HORIZONTAL_RIGHT_TO_LEFT:"rtl"};var nb="horizontal-tb";ib.writingMode={HORIZONTAL_TOP_TO_BOTTOM:nb,VERTICAL_LEFT_TO_RIGHT:"vertical-lr",VERTICAL_RIGHT_TO_LEFT:"vertical-rl"};var ob=0;
ib.lineInterpretation={LINE_NUMBER:ob,PERCENTAGE:1};var pb="start",wb={CENTER:"center",START:pb,END:"end"};ib.lineAlign=wb;var xb={white:"#FFF",lime:"#0F0",cyan:"#0FF",red:"#F00",yellow:"#FF0",magenta:"#F0F",blue:"#00F",black:"#000"};ib.defaultTextColor=xb;var yb={bg_white:"#FFF",bg_lime:"#0F0",bg_cyan:"#0FF",bg_red:"#F00",bg_yellow:"#FF0",bg_magenta:"#F0F",bg_blue:"#00F",bg_black:"#000"};ib.defaultTextBackgroundColor=yb;var rb=400;ib.fontWeight={NORMAL:rb,BOLD:700};
var sb="normal",zb={NORMAL:sb,ITALIC:"italic",OBLIQUE:"oblique"};ib.fontStyle=zb;ib.textDecoration={UNDERLINE:"underline",LINE_THROUGH:"lineThrough",OVERLINE:"overline"};function kb(){this.id="";this.regionAnchorY=this.regionAnchorX=this.viewportAnchorY=this.viewportAnchorX=0;this.height=this.width=100;this.viewportAnchorUnits=this.widthUnits=this.heightUnits=Ab;this.scroll=Bb}M("shaka.text.CueRegion",kb);var Ab=1;kb.units={PX:0,PERCENTAGE:Ab,LINES:2};var Bb="";kb.scrollMode={NONE:Bb,UP:"up"};function Cb(){}function Db(a,b){if(!a&&!b)return!0;if(!a||!b||a.byteLength!=b.byteLength)return!1;if(Eb(a)==Eb(b)&&(a.byteOffset||0)==(b.byteOffset||0))return!0;for(var c=Fb(a),d=Fb(b),e=0;e<a.byteLength;e++)if(c[e]!=d[e])return!1;return!0}function Eb(a){return a instanceof ArrayBuffer?a:a.buffer}function Gb(a){return a instanceof ArrayBuffer?a:0==a.byteOffset&&a.byteLength==a.buffer.byteLength?a.buffer:(new Uint8Array(a)).buffer}
function Fb(a,b,c){c=void 0===c?Infinity:c;return Hb(a,void 0===b?0:b,c,Uint8Array)}function Ib(a,b,c){c=void 0===c?Infinity:c;return Hb(a,void 0===b?0:b,c,DataView)}function Hb(a,b,c,d){var e=(a.byteOffset||0)+a.byteLength;b=Math.max(0,Math.min((a.byteOffset||0)+b,e));return new d(Eb(a),b,Math.min(b+Math.max(c,0),e)-b)}M("shaka.util.BufferUtils",Cb);Cb.toDataView=Ib;Cb.toUint8=Fb;Cb.toArrayBuffer=Gb;Cb.equal=Db;function Jb(a,b){this.g=a;this.h=b}Jb.prototype.toString=function(){return"v"+this.g+"."+this.h};function Kb(a,b){var c=new Jb(4,0),d=Lb,e=d.g,f=c.h-e.h;(0<(c.g-e.g||f)?d.i:d.h)(d.g,c,a,b)}function Mb(a,b,c,d){Va([c,"has been deprecated and will be removed in",b,". We are currently at version",a,". Additional information:",d].join(" "))}function Nb(a,b,c,d){Ua([c,"has been deprecated and has been removed in",b,". We are now at version",a,". Additional information:",d].join(""))}var Lb=null;function Ob(a,b){return a.concat(b)}function Pb(){}function Qb(a){return null!=a}function Rb(a){var b=Object.create(a.prototype||Object.prototype);try{var c=a.call(b);c||(Kb("Factories requiring new","Factories should be plain functions"),c=b)}catch(d){Kb("Factories requiring new","Factories should be plain functions"),c=new a}return c};function Sb(){}M("shaka.dependencies",Sb);Sb.has=function(a){return Tb.has(a)};Sb.add=function(a,b){if(!Ub[a])throw Error(a+" is not supported");Tb.set(a,function(){return b})};var Ub={muxjs:"muxjs"};Sb.Allowed=Ub;var Tb=new Map([["muxjs",function(){return window.muxjs}]]);function N(a,b,c){var d=Fa.apply(3,arguments);this.severity=a;this.category=b;this.code=c;this.data=d;this.handled=!1}N.prototype.toString=function(){return"shaka.util.Error "+JSON.stringify(this,null," ")};M("shaka.util.Error",N);N.Severity={RECOVERABLE:1,CRITICAL:2};N.Category={NETWORK:1,TEXT:2,MEDIA:3,MANIFEST:4,STREAMING:5,DRM:6,PLAYER:7,CAST:8,STORAGE:9,ADS:10};
N.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,INVALID_TEXT_HEADER:2E3,INVALID_TEXT_CUE:2001,UNABLE_TO_DETECT_ENCODING:2003,BAD_ENCODING:2004,INVALID_XML:2005,INVALID_MP4_TTML:2007,INVALID_MP4_VTT:2008,UNABLE_TO_EXTRACT_CUE_START_TIME:2009,INVALID_MP4_CEA:2010,TEXT_COULD_NOT_GUESS_MIME_TYPE:2011,CANNOT_ADD_EXTERNAL_TEXT_TO_SRC_EQUALS:2012,
TEXT_ONLY_WEBVTT_SRC_EQUALS:2013,MISSING_TEXT_PLUGIN:2014,CHAPTERS_TRACK_FAILED:2015,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,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_MASTER_PLAYLIST_NOT_PROVIDED:4022,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,HLS_COULD_NOT_PARSE_SEGMENT_START_TIME:4030,
CONTENT_UNSUPPORTED_BY_BROWSER:4032,CANNOT_ADD_EXTERNAL_TEXT_TO_LIVE_STREAM:4033,HLS_AES_128_ENCRYPTION_NOT_SUPPORTED:4034,HLS_INTERNAL_SKIP_STREAM:4035,NO_VARIANTS:4036,PERIOD_FLATTENING_FAILED:4037,INCONSISTENT_DRM_ACROSS_PERIODS:4038,HLS_VARIABLE_NOT_FOUND:4039,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,LOAD_INTERRUPTED:7E3,OPERATION_ABORTED:7001,NO_VIDEO_ELEMENT:7002,OBJECT_DESTROYED:7003,CONTENT_NOT_LOADED:7004,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,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};/*
@license
Copyright 2008 The Closure Library Authors
SPDX-License-Identifier: Apache-2.0
*/
var Vb=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#(.*))?$");/*
@license
Copyright 2006 The Closure Library Authors
SPDX-License-Identifier: Apache-2.0
*/
function Wb(a){var b;a instanceof Wb?(Xb(this,a.Aa),this.lb=a.lb,this.Da=a.Da,Yb(this,a.zb),this.ua=a.ua,Zb(this,a.g.clone()),this.ab=a.ab):a&&(b=String(a).match(Vb))?(Xb(this,b[1]||"",!0),this.lb=$b(b[2]||""),this.Da=$b(b[3]||"",!0),Yb(this,b[4]),this.ua=$b(b[5]||"",!0),Zb(this,b[6]||"",!0),this.ab=$b(b[7]||"")):this.g=new ac(null)}r=Wb.prototype;r.Aa="";r.lb="";r.Da="";r.zb=null;r.ua="";r.ab="";
r.toString=function(){var a=[],b=this.Aa;b&&a.push(bc(b,cc,!0),":");if(b=this.Da){a.push("//");var c=this.lb;c&&a.push(bc(c,cc,!0),"@");a.push(encodeURIComponent(b).replace(/%25([0-9a-fA-F]{2})/g,"%$1"));b=this.zb;null!=b&&a.push(":",String(b))}if(b=this.ua)this.Da&&"/"!=b.charAt(0)&&a.push("/"),a.push(bc(b,"/"==b.charAt(0)?dc:ec,!0));(b=this.g.toString())&&a.push("?",b);(b=this.ab)&&a.push("#",bc(b,fc));return a.join("")};
r.resolve=function(a){var b=this.clone();"data"===b.Aa&&(b=new Wb);var c=!!a.Aa;c?Xb(b,a.Aa):c=!!a.lb;c?b.lb=a.lb:c=!!a.Da;c?b.Da=a.Da:c=null!=a.zb;var d=a.ua;if(c)Yb(b,a.zb);else if(c=!!a.ua){if("/"!=d.charAt(0))if(this.Da&&!this.ua)d="/"+d;else{var e=b.ua.lastIndexOf("/");-1!=e&&(d=b.ua.substr(0,e+1)+d)}if(".."==d||"."==d)d="";else if(-1!=d.indexOf("./")||-1!=d.indexOf("/.")){e=0==d.lastIndexOf("/",0);d=d.split("/");for(var f=[],g=0;g<d.length;){var h=d[g++];"."==h?e&&g==d.length&&f.push(""):".."==
h?((1<f.length||1==f.length&&""!=f[0])&&f.pop(),e&&g==d.length&&f.push("")):(f.push(h),e=!0)}d=f.join("/")}}c?b.ua=d:c=""!==a.g.toString();c?Zb(b,a.g.clone()):c=!!a.ab;c&&(b.ab=a.ab);return b};r.clone=function(){return new Wb(this)};function Xb(a,b,c){a.Aa=c?$b(b,!0):b;a.Aa&&(a.Aa=a.Aa.replace(/:$/,""))}function Yb(a,b){if(b){b=Number(b);if(isNaN(b)||0>b)throw Error("Bad port number "+b);a.zb=b}else a.zb=null}function Zb(a,b,c){b instanceof ac?a.g=b:(c||(b=bc(b,gc)),a.g=new ac(b))}
function $b(a,b){return a?b?decodeURI(a):decodeURIComponent(a):""}function bc(a,b,c){return null!=a?(a=encodeURI(a).replace(b,hc),c&&(a=a.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),a):null}function hc(a){a=a.charCodeAt(0);return"%"+(a>>4&15).toString(16)+(a&15).toString(16)}var cc=/[#\/\?@]/g,ec=/[#\?:]/g,dc=/[#\?]/g,gc=/[#\?@]/g,fc=/#/g;function ac(a){this.g=a||null}r=ac.prototype;r.sa=null;r.rc=null;
r.add=function(a,b){if(!this.sa&&(this.sa={},this.rc=0,this.g))for(var c=this.g.split("&"),d=0;d<c.length;d++){var e=c[d].indexOf("="),f=null;if(0<=e){var g=c[d].substring(0,e);f=c[d].substring(e+1)}else g=c[d];g=decodeURIComponent(g.replace(/\+/g," "));f=f||"";this.add(g,decodeURIComponent(f.replace(/\+/g," ")))}this.g=null;(c=this.sa.hasOwnProperty(a)&&this.sa[a])||(this.sa[a]=c=[]);c.push(b);this.rc++;return this};
r.toString=function(){if(this.g)return this.g;if(!this.sa)return"";var a=[],b;for(b in this.sa)for(var c=encodeURIComponent(b),d=this.sa[b],e=0;e<d.length;e++){var f=c;""!==d[e]&&(f+="="+encodeURIComponent(d[e]));a.push(f)}return this.g=a.join("&")};r.clone=function(){var a=new ac;a.g=this.g;if(this.sa){var b={},c;for(c in this.sa)b[c]=this.sa[c].concat();a.sa=b;a.rc=this.rc}return a};function ic(a,b){if(0==b.length)return a;var c=b.map(function(d){return new Wb(d)});return a.map(function(d){return new Wb(d)}).map(function(d){return c.map(function(e){return d.resolve(e)})}).reduce(Ob,[]).map(function(d){return d.toString()})}function jc(a,b){return{keySystem:a,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,serverCertificateUri:"",sessionType:"",initData:b||[],keyIds:new Set}}
function kc(a,b){if(1==b.length)return b[0];var c=lc(a,b);if(null!=c)return c;throw new N(2,4,4025,b);}function lc(a,b){for(var c=t(mc[a]),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==nc?"":null}var nc="text",oc={Ma:"video",Ya:"audio",Y:nc,Jb:"image",Qf:"application"},mc={audio:[/^vorbis$/,/^opus$/,/^flac$/,/^mp4a/,/^[ae]c-3$/],video:[/^avc/,/^hev/,/^hvc/,/^vp0?[89]/,/^av01/],text:[/^vtt$/,/^wvtt/,/^stpp/]};function pc(){var a,b,c=new Promise(function(d,e){a=d;b=e});c.resolve=a;c.reject=b;return c}pc.prototype.resolve=function(){};pc.prototype.reject=function(){};function qc(a){this.h=a;this.g=void 0}qc.prototype.value=function(){void 0==this.g&&(this.g=this.h());return this.g};function rc(){}function sc(a){if(!a)return"";a=Fb(a);239==a[0]&&187==a[1]&&191==a[2]&&(a=a.subarray(3));a=(new TextDecoder).decode(a);a.includes("\ufffd")&&Ua('Decoded string contains an "unknown character" codepoint. That probably means the UTF8 encoding was incorrect!');return a}function tc(a,b,c){if(!a)return"";if(!c&&0!=a.byteLength%2)throw new N(2,2,2004);c=Math.floor(a.byteLength/2);var d=new Uint16Array(c);a=Ib(a);for(var e=0;e<c;e++)d[e]=a.getUint16(2*e,b);return uc.value()(d)}
function vc(a){function b(d){return c.byteLength<=d||32<=c[d]&&126>=c[d]}if(!a)return"";var c=Fb(a);if(239==c[0]&&187==c[1]&&191==c[2])return sc(c);if(254==c[0]&&255==c[1])return tc(c.subarray(2),!1);if(255==c[0]&&254==c[1])return tc(c.subarray(2),!0);if(0==c[0]&&0==c[2])return tc(a,!1);if(0==c[1]&&0==c[3])return tc(a,!0);if(b(0)&&b(1)&&b(2)&&b(3))return sc(a);throw new N(2,2,2003);}function wc(a){var b=new TextEncoder;return Gb(b.encode(a))}
function xc(a,b){for(var c=new ArrayBuffer(2*a.length),d=new DataView(c),e=0;e<a.length;++e)d.setUint16(2*e,a.charCodeAt(e),b);return c}M("shaka.util.StringUtils",rc);rc.resetFromCharCode=function(){uc.g=void 0};rc.toUTF16=xc;rc.toUTF8=wc;rc.fromBytesAutoDetect=vc;rc.fromUTF16=tc;rc.fromUTF8=sc;
var uc=new qc(function(){function a(c){try{var d=new Uint8Array(c);return 0<String.fromCharCode.apply(null,d).length}catch(e){return!1}}for(var b={Ta:65536};0<b.Ta;b={Ta:b.Ta},b.Ta/=2)if(a(b.Ta))return function(c){return function(d){for(var e="",f=0;f<d.length;f+=c.Ta)e+=String.fromCharCode.apply(null,d.subarray(f,f+c.Ta));return e}}(b);return null});function yc(){}function zc(a){a=Fb(a);a=uc.value()(a);return btoa(a)}function Ac(a,b){b=void 0==b?!0:b;var c=zc(a).replace(/\+/g,"-").replace(/\//g,"_");return b?c:c.replace(/[=]*$/,"")}function Bc(a){a=window.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 Dc(a){for(var b=a.length/2,c=new Uint8Array(b),d=0;d<b;d++)c[d]=window.parseInt(a.substr(2*d,2),16);return c}
function Ec(a){var b=Fb(a);a="";b=t(b);for(var c=b.next();!c.done;c=b.next())c=c.value,c=c.toString(16),1==c.length&&(c="0"+c),a+=c;return a}function Fc(){for(var a=Fa.apply(0,arguments),b=0,c=t(a),d=c.next();!d.done;d=c.next())b+=d.value.byteLength;b=new Uint8Array(b);c=0;a=t(a);for(d=a.next();!d.done;d=a.next())d=d.value,b.set(Fb(d),c),c+=d.byteLength;return b}M("shaka.util.Uint8ArrayUtils",yc);yc.concat=Fc;yc.toHex=Ec;yc.fromHex=Dc;yc.fromBase64=Bc;yc.toBase64=Ac;yc.toStandardBase64=zc;
yc.equal=function(a,b){Kb("shaka.util.Uint8ArrayUtils.equal","Please use shaka.util.BufferUtils.equal instead.");return Db(a,b)};function Gc(){var a=this;this.o=Tb.get("muxjs")();this.g=new this.o.mp4.Transmuxer({keepOriginalTimestamps:!0});this.h=null;this.m=[];this.j=[];this.i=[];this.l=!1;this.g.on("data",function(b){a.j=b.captions;a.i=b.metadata;a.m.push(Fc(b.initSegment,b.data))});this.g.on("done",function(){var b={data:Fc.apply(yc,ia(a.m)),captions:a.j,metadata:a.i};a.h.resolve(b);a.l=!1})}Gc.prototype.destroy=function(){this.g.dispose();this.g=null;return Promise.resolve()};
function Hc(a,b){if(!Tb.get("muxjs")()||!Ic(a))return!1;if(b)return MediaSource.isTypeSupported(Jc(b,a));var c=Jc("audio",a),d=Jc("video",a);return MediaSource.isTypeSupported(c)||MediaSource.isTypeSupported(d)}function Ic(a){return"mp2t"==a.toLowerCase().split(";")[0].split("/")[1]}
function Jc(a,b){var c=b.replace(/mp2t/i,"mp4");"audio"==a&&(c=c.replace("video","audio"));var d=/avc1\.(66|77|100)\.(\d+)/.exec(c);if(d){var e="avc1.",f=d[1],g=Number(d[2]);e=("66"==f?e+"4200":"77"==f?e+"4d00":e+"6400")+(g>>4).toString(16);e+=(g&15).toString(16);c=c.replace(d[0],e)}return c}function Kc(a,b){a.l=!0;a.h=new pc;a.m=[];a.j=[];a.i=[];var c=Fb(b);a.g.push(c);a.g.flush();a.l&&a.h.reject(new N(2,3,3018));return a.h};function Lc(a,b){var c=a;b&&(c+='; codecs="'+b+'"');return c}function Mc(a,b,c){a=Lc(a,b);if(Ic(a)){if(Tb.get("muxjs")())return Jc(c,a)}else if("audio"==c)return a.replace("video","audio");return a}
function Nc(a){var b=Oc(a);a=b[0];b=b[1].toLowerCase();switch(!0){case "mp4a"===a&&"69"===b:case "mp4a"===a&&"6b"===b:return"mp3";case "mp4a"===a&&"66"===b:case "mp4a"===a&&"67"===b:case "mp4a"===a&&"68"===b:case "mp4a"===a&&"40.2"===b:case "mp4a"===a&&"40.02"===b:case "mp4a"===a&&"40.5"===b:case "mp4a"===a&&"40.05"===b:case "mp4a"===a&&"40.29"===b:case "mp4a"===a&&"40.42"===b:return"aac";case "mp4a"===a&&"a5"===b:return"ac-3";case "mp4a"===a&&"a6"===b:return"ec-3";case "mp4a"===a&&"b2"===b:return"dtsx";
case "mp4a"===a&&"a9"===b:return"dtsc";case "avc1"===a:case "avc3"===a:return"avc";case "hvc1"===a:case "hev1"===a:return"hevc";case "dvh1"===a:case "dvhe"===a:return"dovi"}return a}function Pc(a){a=a.split(/ *; */);a.shift();return(a=a.find(function(b){return b.startsWith("codecs=")}))?a.split("=")[1].replace(/^"|"$/g,""):""}function Oc(a){a=a.split(".");var b=a[0];a.shift();return[b,a.join(".")]}
(new Map).set("codecs","codecs").set("frameRate","framerate").set("bandwidth","bitrate").set("width","width").set("height","height").set("channelsCount","channels");function Qc(a){this.l=null;this.i=a;this.j=this.u=0;this.m=Infinity;this.h=this.g=null;this.s="";this.o=new Map}function Rc(a){return Sc[a]||"application/cea-608"==a||"application/cea-708"==a?!0:!1}Qc.prototype.destroy=function(){this.i=this.l=null;this.o.clear();return Promise.resolve()};
function Tc(a,b,c,d){var e,f,g;return L(function(h){if(1==h.g)return u(h,Promise.resolve(),2);if(!a.l||!a.i)return h["return"]();if(null==c||null==d)return a.l.parseInit(Fb(b)),h["return"]();e={periodStart:a.u,segmentStart:c,segmentEnd:d};f=a.l.parseMedia(Fb(b),e);g=f.filter(function(k){return k.startTime>=a.j&&k.startTime<a.m});a.i.append(g);null==a.g&&(a.g=Math.max(c,a.j));a.h=Math.min(d,a.m);z(h)})}
Qc.prototype.remove=function(a,b){var c=this;return L(function(d){if(1==d.g)return u(d,Promise.resolve(),2);!c.i||!c.i.remove(a,b)||null==c.g||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));z(d)})};function Uc(a,b,c){a.j=b;a.m=c}function Vc(a,b,c){a.s=b;if(b=a.o.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.i.append(e)}
function Wc(a){var b=[];a=t(a);for(var c=a.next();!c.done;c=a.next())c=c.value,b.push({stream:c.stream,cue:new ib(c.startTime,c.endTime,c.text)});return b}function Xc(a,b,c){b.startTime+=c;b.endTime+=c;b=t(b.nestedCues);for(var d=b.next();!d.done;d=b.next())Xc(a,d.value,c)}
function Yc(a,b,c,d,e){var f=c+" "+d,g=new Map;b=t(b);for(var h=b.next();!h.done;h=b.next()){var k=h.value;h=k.stream;k=k.cue;g.has(h)||g.set(h,new Map);g.get(h).has(f)||g.get(h).set(f,[]);Xc(a,k,e);k.startTime>=a.j&&k.startTime<a.m&&(g.get(h).get(f).push(k),h==a.s&&a.i.append([k]))}e=t(g.keys());for(f=e.next();!f.done;f=e.next())for(f=f.value,a.o.has(f)||a.o.set(f,new Map),b=t(g.get(f).keys()),h=b.next();!h.done;h=b.next())h=h.value,k=g.get(f).get(h),a.o.get(f).set(h,k);a.g=null==a.g?Math.max(c,
a.j):Math.min(a.g,Math.max(c,a.j));a.h=Math.max(a.h,Math.min(d,a.m))}M("shaka.text.TextEngine",Qc);Qc.prototype.destroy=Qc.prototype.destroy;Qc.findParser=function(a){return Sc[a]};Qc.unregisterParser=function(a){delete Sc[a]};Qc.registerParser=function(a,b){Sc[a]=b};var Sc={};function Zc(a,b){a=$c(a);b=$c(b);return a.split("-")[0]==b.split("-")[0]}function ad(a,b){a=$c(a);b=$c(b);var c=a.split("-"),d=b.split("-");return c[0]==d[0]&&1==c.length&&2==d.length}function bd(a,b){a=$c(a);b=$c(b);var c=a.split("-"),d=b.split("-");return 2==c.length&&2==d.length&&c[0]==d[0]}function $c(a){var b=a.split("-");a=b[0]||"";b=b[1]||"";a=a.toLowerCase();a=cd.get(a)||a;return(b=b.toUpperCase())?a+"-"+b:a}function dd(a,b){a=$c(a);b=$c(b);return b==a?4:ad(b,a)?3:bd(b,a)?2:ad(a,b)?1:0}
function ed(a){return a.language?$c(a.language):a.audio&&a.audio.language?$c(a.audio.language):a.video&&a.video.language?$c(a.video.language):"und"}
function fd(a,b){for(var c=$c(a),d=new Set,e=t(b),f=e.next();!f.done;f=e.next())d.add($c(f.value));e=t(d);for(f=e.next();!f.done;f=e.next())if(f=f.value,f==c)return f;e=t(d);for(f=e.next();!f.done;f=e.next())if(f=f.value,ad(f,c))return f;e=t(d);for(f=e.next();!f.done;f=e.next())if(f=f.value,bd(f,c))return f;d=t(d);for(f=d.next();!f.done;f=d.next())if(f=f.value,ad(c,f))return f;return null}
var cd=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 gd(){this.g={}}r=gd.prototype;r.push=function(a,b){this.g.hasOwnProperty(a)?this.g[a].push(b):this.g[a]=[b]};r.get=function(a){return(a=this.g[a])?a.slice():null};r.remove=function(a,b){a in this.g&&(this.g[a]=this.g[a].filter(function(c){return c!=b}),0==this.g[a].length&&delete this.g[a])};function hd(a,b){for(var c in a.g)b(c,a.g[c])}r.size=function(){return Object.keys(this.g).length};r.keys=function(){return Object.keys(this.g)};function id(a){this.h=a;this.g=null}id.prototype.R=function(a){var b=this;this.stop();var c=!0,d=null;this.g=function(){window.clearTimeout(d);c=!1};d=window.setTimeout(function(){c&&b.h()},1E3*a);return this};id.prototype.stop=function(){this.g&&(this.g(),this.g=null)};function O(a){this.h=a;this.g=null}O.prototype.Db=function(){this.stop();this.h();return this};O.prototype.R=function(a){var b=this;this.stop();this.g=(new id(function(){b.h()})).R(a);return this};O.prototype.ya=function(a){var b=this;this.stop();this.g=(new id(function(){b.g.R(a);b.h()})).R(a);return this};O.prototype.stop=function(){this.g&&(this.g.stop(),this.g=null)};M("shaka.util.Timer",O);O.prototype.stop=O.prototype.stop;O.prototype.tickEvery=O.prototype.ya;O.prototype.tickAfter=O.prototype.R;
O.prototype.tickNow=O.prototype.Db;function kd(){return window.MediaSource&&MediaSource.isTypeSupported?!0:!1}function ld(a){return""!=md().canPlayType(a)}function nd(){return od("Xbox One")}function pd(){return od("Tizen")}function qd(){return od("CrKey")}function rd(){return!!navigator.vendor&&navigator.vendor.includes("Apple")&&!pd()}function sd(){if(!rd())return null;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}
function od(a){return(navigator.userAgent||"").includes(a)}function md(){if(td)return td;ud||(ud=new O(function(){td=null}));(td=document.getElementsByTagName("video")[0]||document.getElementsByTagName("audio")[0])||(td=document.createElement("video"));ud.R(1);return td}var ud=null,td=null;function vd(a,b,c,d,e){var f=a.variants;if(b.length||c.length)f=wd(f,b,c);f=xd(f,d);b=yd(f);b=zd(b);var g=Ad(b,e);a.variants=a.variants.filter(function(h){return Bd(h)==g?!0:!1})}function yd(a){var b=new gd;a=t(a);for(var c=a.next();!c.done;c=a.next()){c=c.value;var d=Bd(c);b.push(d,c)}return b}
function zd(a){var b=0,c=new Map,d=a.size();hd(a,function(e,f){for(var g=t(f),h=g.next();!h.done;h=g.next()){h=h.value;var k=h.video;if(k&&k.width&&k.height){k=k.width*k.height*(k.frameRate||1);c.has(k)||c.set(k,new gd);var l=c.get(k);l.push(e,h);l.size()===d&&(b=Math.max(b,k))}}});return b?c.get(b):a}
function wd(a,b,c){var d={};b=t(b);for(var e=b.next();!e.done;d={ad:d.ad},e=b.next())if(d.ad=e.value,e=a.filter(function(f){return function(g){return g.video&&g.video.codecs.startsWith(f.ad)}}(d)),e.length){a=e;break}d={};c=t(c);for(b=c.next();!b.done;d={Nc:d.Nc},b=c.next())if(d.Nc=b.value,b=a.filter(function(f){return function(g){return g.audio&&g.audio.codecs.startsWith(f.Nc)}}(d)),b.length){a=b;break}return a}
function Ad(a,b){for(var c=t(b),d=c.next();!d.done;d=c.next())if(d=d.value,d==Cd||d==Dd){if(a=Ed(a,d),1==a.size())return a.keys()[0]}else if(d==Fd)break;return Gd(a)}function Ed(a,b){var c=0,d=new gd;hd(a,function(e,f){for(var g=0,h=0,k=t(f),l=k.next();!l.done;l=k.next())l=l.value,l.decodingInfos.length&&(g+=l.decodingInfos[0][b]?1:0,h++);g/=h;g>c?(d.g={},d.push(e,f),c=g):g==c&&d.push(e,f)});return d}
function Gd(a){var b="",c=Infinity;hd(a,function(d,e){for(var f=0,g=0,h=t(e),k=h.next();!k.done;k=h.next())f+=k.value.bandwidth||0,++g;f/=g;f<c&&(b=d,c=f)});return b}function Bd(a){var b="";a.video&&(b=Nc(a.video.codecs));var c="";a.audio&&(c=Nc(a.audio.codecs));return b+"-"+c}function Hd(a,b,c){a.variants=a.variants.filter(function(d){return Id(d,b,c)})}
function Id(a,b,c){function d(f,g,h){return f>=g&&f<=h}var e=a.video;return e&&e.width&&e.height&&(!d(e.width,b.minWidth,Math.min(b.maxWidth,c.width))||!d(e.height,b.minHeight,Math.min(b.maxHeight,c.height))||!d(e.width*e.height,b.minPixels,b.maxPixels))||a&&a.video&&a.video.frameRate&&!d(a.video.frameRate,b.minFrameRate,b.maxFrameRate)||!d(a.bandwidth,b.minBandwidth,b.maxBandwidth)?!1:!0}
function Jd(a,b){return L(function(c){if(1==c.g)return u(c,Kd(b,0<b.offlineSessionIds.length),2);Ld(a,b);Md(b);Nd(b);z(c)})}
function Kd(a,b){return L(function(c){if(1==c.g)return u(c,Od(a.variants,b,!1),2);a.variants=a.variants.filter(function(d){var e=d.video;if(e){var f=Pd(e.codecs);if(e.codecs.includes(",")){var g=e.codecs.split(",");f=kc("video",g);g=kc("audio",g);g=Mc(e.mimeType,g,"audio");if(!MediaSource.isTypeSupported(g))return!1}f=Mc(e.mimeType,f,"video");if(!MediaSource.isTypeSupported(f))return!1}if(f=d.audio)if(g=Qd(f.codecs),f=Mc(f.mimeType,g,"audio"),!MediaSource.isTypeSupported(f))return!1;if(nd()&&e&&(e.width&&
1920<e.width||e.height&&1080<e.height)&&e.codecs.includes("avc1."))return Za(Rd(d)),!1;(e=d.decodingInfos.some(function(h){return h.supported}))||Za(Rd(d));return e});z(c)})}
function Od(a,b,c){var d,e,f,g,h,k,l,m,n,p,q;return L(function(v){if(d=a.some(function(y){return y.decodingInfos.length}))return v["return"]();e=navigator.mediaCapabilities;f=[];g=function(y,x){var w;return L(function(D){if(1==D.g)return A(D,2),u(D,e.decodingInfo(x),4);if(2!=D.g)return w=D.h,y.decodingInfos.push(w),va(D,0);F(D);JSON.stringify(x);z(D)})};h=t(a);for(k=h.next();!k.done;k=h.next())for(l=k.value,m=Sd(l,b,c),n=t(m),p=n.next();!p.done;p=n.next())q=p.value,f.push(g(l,q));return u(v,Promise.all(f),
0)})}
function Sd(a,b,c){var d=a.audio,e=a.video;c={type:c?"file":"media-source"};if(e){var f=e.codecs;if(e.codecs.includes(",")){var g=e.codecs.split(",");f=kc("video",g);f=Pd(f);g=kc("audio",g);g=Mc(e.mimeType,g,"audio");c.audio={contentType:g,channels:2,bitrate:a.bandwidth||1,samplerate:1,spatialRendering:!1}}f=Pd(f);f=Mc(e.mimeType,f,"video");c.video={contentType:f,width:e.width||1,height:e.height||1,bitrate:e.bandwidth||a.bandwidth||1,framerate:e.frameRate||1};if(e.hdr)switch(e.hdr){case "SDR":c.video.transferFunction="srgb";
break;case "PQ":c.video.transferFunction="pq";break;case "HLG":c.video.transferFunction="hlg"}}d&&(f=Qd(d.codecs),f=Mc(d.mimeType,f,"audio"),c.audio={contentType:f,channels:d.channelsCount||2,bitrate:d.bandwidth||a.bandwidth||1,samplerate:d.audioSamplingRate||1,spatialRendering:d.spatialAudio});g=(a.video?a.video.drmInfos:[]).concat(a.audio?a.audio.drmInfos:[]);if(!g.length)return[c];a=[];f=new Map;g=t(g);for(var h=g.next();!h.done;h=g.next()){var k=h.value;f.get(k.keySystem)||f.set(k.keySystem,[]);
f.get(k.keySystem).push(k)}g=b?"required":"optional";b=b?["persistent-license"]:["temporary"];k=t(f.keys());for(var l=k.next();!l.done;l=k.next()){var m=l.value;l=Object.assign({},c);var n=f.get(m);m={keySystem:m,initDataType:"cenc",persistentState:g,distinctiveIdentifier:"optional",sessionTypes:b};n=t(n);for(h=n.next();!h.done;h=n.next()){h=h.value;if(h.initData&&h.initData.length){for(var p=new Set,q=t(h.initData),v=q.next();!v.done;v=q.next())p.add(v.value.initDataType);m.initDataType=h.initData[0].initDataType}h.distinctiveIdentifierRequired&&
(m.distinctiveIdentifier="required");h.persistentStateRequired&&(m.persistentState="required");h.sessionType&&(m.sessionTypes=[h.sessionType]);d&&(m.audio?m.audio.robustness=m.audio.robustness||h.audioRobustness:m.audio={robustness:h.audioRobustness});e&&(m.video?m.video.robustness=m.video.robustness||h.videoRobustness:m.video={robustness:h.videoRobustness})}l.keySystemConfiguration=m;a.push(l)}return a}function Qd(a){return pd()?"ac-3"==a.toLowerCase()?"ec-3":a:a}
function Pd(a){return"vp9"==a?"vp09.00.10.08":a}function Ld(a,b){b.variants=b.variants.filter(function(c){var d=c.audio;c=c.video;return d&&a&&a.audio&&!Td(d,a.audio)||c&&a&&a.video&&!Td(c,a.video)?!1:!0})}function Md(a){a.textStreams=a.textStreams.filter(function(b){return Rc(Lc(b.mimeType,b.codecs))})}function Nd(a){a.imageStreams=a.imageStreams.filter(functi