UNPKG

shaka-player

Version:
123 lines (122 loc) 651 kB
/* @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){/* @license Shaka Player Copyright 2016 Google LLC SPDX-License-Identifier: Apache-2.0 */ /* Copyright The Closure Library Authors. SPDX-License-Identifier: Apache-2.0 */ var q;function aa(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}}var ca="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 da(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=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&&null!=b&&ca(c,a,{configurable:!0,writable:!0,value:b})}} 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:!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]&&ca(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 r(a){var b="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return b?b.call(a):{next:aa(a)}}function v(a){if(!(a instanceof Array)){a=r(a);for(var b,c=[];!(b=a.next()).done;)c.push(b.value);a=c}return a}var ia="function"==typeof Object.create?Object.create:function(a){function b(){}b.prototype=a;return new b},ja; if("function"==typeof Object.setPrototypeOf)ja=Object.setPrototypeOf;else{var ka;a:{var la={a:!0},ma={};try{ma.__proto__=la;ka=ma.a;break a}catch(a){}ka=!1}ja=ka?function(a,b){a.__proto__=b;if(a.__proto__!==b)throw new TypeError(a+" is not extensible");return a}:null}var na=ja; function oa(a,b){a.prototype=ia(b.prototype);a.prototype.constructor=a;if(na)na(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.Vk=b.prototype}function pa(){this.s=!1;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.s)throw new TypeError("Generator is already running");a.s=!0}pa.prototype.B=function(a){this.h=a}; function ra(a,b){a.i={Ng:b,Wg:!0};a.g=a.m||a.j}pa.prototype.return=function(a){this.i={return:a};this.g=this.j};function C(a,b,c){a.g=c;return{value:b}}pa.prototype.F=function(a){this.g=a};function E(a){a.g=0}function ta(a,b,c){a.m=b;void 0!=c&&(a.j=c)}function va(a){a.m=0;a.j=2}function wa(a,b,c){a.g=b;a.m=c||0}function xa(a,b){a.m=b||0;b=a.i.Ng;a.i=null;return b}function ya(a){a.C=[a.i];a.m=0;a.j=0} function za(a,b){var c=a.C.splice(0)[0];(c=a.i=a.i||c)?c.Wg?a.g=a.m||a.j:void 0!=c.F&&a.j<c.F?(a.g=c.F,a.i=null):a.g=a.j:a.g=b}function Ba(a){this.g=new pa;this.h=a}function Ca(a,b){qa(a.g);var c=a.g.l;if(c)return Ea(a,"return"in c?c["return"]:function(d){return{value:d,done:!0}},b,a.g.return);a.g.return(b);return Fa(a)} function Ea(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.s=!1,e;var f=e.value}catch(g){return a.g.l=null,ra(a.g,g),Fa(a)}a.g.l=null;d.call(a.g,f);return Fa(a)}function Fa(a){for(;a.g.g;)try{var b=a.h(a.g);if(b)return a.g.s=!1,{value:b.value,done:!1}}catch(c){a.g.h=void 0,ra(a.g,c)}a.g.s=!1;if(a.g.i){b=a.g.i;a.g.i=null;if(b.Wg)throw b.Ng;return{value:b.return,done:!0}}return{value:void 0,done:!0}} function Ga(a){this.next=function(b){qa(a.g);a.g.l?b=Ea(a,a.g.l.next,b,a.g.B):(a.g.B(b),b=Fa(a));return b};this.throw=function(b){qa(a.g);a.g.l?b=Ea(a,a.g.l["throw"],b,a.g.B):(ra(a.g,b),b=Fa(a));return b};this.return=function(b){return Ca(a,b)};this[Symbol.iterator]=function(){return this}}function Ha(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 J(a){return Ha(new Ga(new Ba(a)))}function Ia(){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.s=!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.H),reject:g(this.l)}};b.prototype.H=function(g){if(g===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(g instanceof b)this.J(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.G(g):this.m(g)}}; b.prototype.G=function(g){var h=void 0;try{h=g.then}catch(k){this.l(k);return}"function"==typeof h?this.K(h,g):this.m(g)};b.prototype.l=function(g){this.B(2,g)};b.prototype.m=function(g){this.B(1,g)};b.prototype.B=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.I();this.C()};b.prototype.I=function(){var g=this;e(function(){if(g.D()){var h=ea.console;"undefined"!==typeof h&&h.error(g.i)}},1)};b.prototype.D= function(){if(this.s)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.C=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.J=function(g){var h=this.j();g.Td(h.resolve,h.reject)};b.prototype.K=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,t){return"function"==typeof p?function(u){try{l(p(u))}catch(x){m(x)}}:t}var l,m,n=new b(function(p,t){l=p;m=t});this.Td(k(g,l),k(h,m));return n};b.prototype.catch=function(g){return this.then(void 0,g)};b.prototype.Td=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.s=!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=r(g),m=l.next();!m.done;m=l.next())d(m.value).Td(h,k)})};b.all=function(g){var h=r(g),k=h.next();return k.done?d([]):new b(function(l,m){function n(u){return function(x){p[u]=x;t--;0==t&&l(p)}}var p=[],t=0;do p.push(void 0),t++,d(k.value).Td(n(p.length-1),m),k=h.next(); while(!k.done)})};return b});function Ja(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=r(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(!Ja(k,g)){var l=new c;ca(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(!Ja(k,g))throw Error("WeakMap key fail: "+k);k[g][this.g]=l;return this};b.prototype.get=function(k){return d(k)&&Ja(k,g)?k[g][this.g]:void 0};b.prototype.has=function(k){return d(k)&&Ja(k, g)&&Ja(k[g],this.g)};b.prototype.delete=function(k){return d(k)&&Ja(k,g)&&Ja(k[g],this.g)?delete k[g][this.g]:!1};return b}); fa("Map",function(a){function b(){var h={};return h.Jb=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.Jb;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&&Ja(h.h,l))for(h=0;h<m.length;h++){var n=m[h];if(k!==k&&n.key!==n.key||k===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.h={};this.g=b();this.size=0;if(h){h=r(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(r([[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.entry?l.entry.value=k:(l.entry={next:this.g,Jb:this.g.Jb,head:this.g,key:h,value:k},l.list.push(l.entry),this.g.Jb.next=l.entry,this.g.Jb=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.h[h.id],h.entry.Jb.next=h.entry.next, h.entry.next.Jb=h.entry.Jb,h.entry.head=null,this.size--,!0):!1};e.prototype.clear=function(){this.h={};this.g=this.g.Jb=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,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});function La(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 La(this,function(b){return b})}}); fa("Set",function(a){function b(c){this.g=new Map;if(c){c=r(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(r([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});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}}); function Oa(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{Ug:e,v:f}}return{Ug:-1,v:void 0}}fa("Array.prototype.findIndex",function(a){return a?a:function(b,c){return Oa(this,b,c).Ug}});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;c=c||0;for(0>c&&(c=Math.max(c+e,0));c<e;c++){var f=d[c];if(f===b||Object.is(f,b))return!0}return!1}});function Pa(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!==Pa(this,b,"includes").indexOf(b,c||0)}});fa("Array.prototype.find",function(a){return a?a:function(b,c){return Oa(this,b,c).v}});fa("String.prototype.startsWith",function(a){return a?a:function(b,c){var d=Pa(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!1;return g>=f}}); fa("Array.prototype.values",function(a){return a?a:function(){return La(this,function(b,c){return c})}});var Qa="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)Ja(d,e)&&(a[e]=d[e])}return a};fa("Object.assign",function(a){return a||Qa}); 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 La(this,function(b,c){return[b,c]})}}); fa("String.prototype.repeat",function(a){return a?a:function(b){var c=Pa(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("Number.isNaN",function(a){return a?a:function(b){return"number"===typeof b&&isNaN(b)}});fa("Number.isFinite",function(a){return a?a:function(b){return"number"!==typeof b?!1:!isNaN(b)&&Infinity!==b&&-Infinity!==b}}); fa("Object.values",function(a){return a?a:function(b){var c=[],d;for(d in b)Ja(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("Number.MAX_SAFE_INTEGER",function(){return 9007199254740991});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)Ja(b,d)&&c.push([d,b[d]]);return c}});var Ra=this||self;function L(a,b){a=a.split(".");var c=Ra;a[0]in c||"undefined"==typeof c.execScript||c.execScript("var "+a[0]);for(var d;a.length&&(d=a.shift());)a.length||void 0===b?c[d]&&c[d]!==Object.prototype[d]?c=c[d]:c=c[d]={}:c[d]=b};var shaka={};function O(a,b){if(b)if(b instanceof Map)for(var c=r(b.keys()),d=c.next();!d.done;d=c.next())d=d.value,Object.defineProperty(this,d,{value:b.get(d),writable:!0,enumerable:!0});else for(c in b)Object.defineProperty(this,c,{value:b[c],writable:!0,enumerable:!0});this.defaultPrevented=this.cancelable=this.bubbles=!1;this.timeStamp=window.performance&&window.performance.now?window.performance.now():Date.now();this.type=a;this.isTrusted=!1;this.target=this.currentTarget=null;this.g=!1} function Sa(a){var b=new O(a.type),c;for(c in a)Object.defineProperty(b,c,{value:a[c],writable:!0,enumerable:!0});return b}O.prototype.preventDefault=function(){this.cancelable&&(this.defaultPrevented=!0)};O.prototype.stopImmediatePropagation=function(){this.g=!0};O.prototype.stopPropagation=function(){};L("shaka.util.FakeEvent",O); var Ua={sj:"abrstatuschanged",tj:"adaptation",uj:"buffering",xj:"downloadfailed",yj:"downloadheadersreceived",zj:"drmsessionupdate",Gj:"emsg",hk:"prft",Error:"error",Hj:"expirationupdated",Kj:"gapjumped",Mj:"keystatuschanged",Pj:"loaded",Qj:"loading",Vj:"manifestparsed",Wj:"manifestupdated",Xj:"mediaqualitychanged",Metadata:"metadata",bk:"onstatechange",ck:"onstateidle",pk:"ratechange",wk:"segmentappended",xk:"sessiondata",yk:"stalldetected",zk:"statechanged",Ak:"streaming",Bk:"textchanged",Ck:"texttrackvisibility", Dk:"timelineregionadded",Ek:"timelineregionenter",Fk:"timelineregionexit",Gk:"trackschanged",Lk:"unloading",Ok:"variantchanged"};function Va(){}function Wa(){}function Ya(){}function Za(a){var b=Ia.apply(1,arguments);$a.has(a)||($a.add(a),Ya.apply(Va,v(b)))}function ab(){}function bb(){}function cb(){}function db(){}var $a=new Set;window.console&&(Ya=function(){return console.warn.apply(console,v(Ia.apply(0,arguments)))},Wa=function(){console.error.apply(console,v(Ia.apply(0,arguments)))});function eb(){this.g={}}q=eb.prototype;q.push=function(a,b){this.g.hasOwnProperty(a)?this.g[a].push(b):this.g[a]=[b]};q.get=function(a){return(a=this.g[a])?a.slice():null};q.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])};q.forEach=function(a){for(var b in this.g)a(b,this.g[b])};q.size=function(){return Object.keys(this.g).length};q.keys=function(){return Object.keys(this.g)};function fb(){this.qa=new eb;this.ze=this}fb.prototype.addEventListener=function(a,b){this.qa&&this.qa.push(a,b)};fb.prototype.removeEventListener=function(a,b){this.qa&&this.qa.remove(a,b)};fb.prototype.dispatchEvent=function(a){if(!this.qa)return!0;var b=this.qa.get(a.type)||[],c=this.qa.get("All");c&&(b=b.concat(c));b=r(b);for(c=b.next();!c.done;c=b.next()){c=c.value;a.target=this.ze;a.currentTarget=this.ze;try{c.handleEvent?c.handleEvent(a):c.call(this,a)}catch(d){}if(a.g)break}return a.defaultPrevented}; fb.prototype.release=function(){this.qa=null};function gb(a,b){var c=[];a=r(a);for(var d=a.next();!d.done;d=a.next())c.push(b(d.value));return c}function hb(a,b){a=r(a);for(var c=a.next();!c.done;c=a.next())if(!b(c.value))return!1;return!0}function ib(a,b){a=r(a);for(var c=a.next();!c.done;c=a.next())if(b(c.value))return!0;return!1}function jb(a,b){var c=[];a=r(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 kb=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#(.*))?$");/* @license Copyright 2006 The Closure Library Authors SPDX-License-Identifier: Apache-2.0 */ function lb(a){var b;a instanceof lb?(mb(this,a.qb),this.rc=a.rc,this.vb=a.vb,nb(this,a.Jc),this.Qa=a.Qa,ob(this,a.g.clone()),this.Zb=a.Zb):a&&(b=String(a).match(kb))?(mb(this,b[1]||"",!0),this.rc=qb(b[2]||""),this.vb=qb(b[3]||"",!0),nb(this,b[4]),this.Qa=qb(b[5]||"",!0),ob(this,b[6]||"",!0),this.Zb=qb(b[7]||"")):this.g=new rb(null)}q=lb.prototype;q.qb="";q.rc="";q.vb="";q.Jc=null;q.Qa="";q.Zb=""; q.toString=function(){var a=[],b=this.qb;b&&a.push(sb(b,tb,!0),":");if(b=this.vb){a.push("//");var c=this.rc;c&&a.push(sb(c,tb,!0),"@");a.push(encodeURIComponent(b).replace(/%25([0-9a-fA-F]{2})/g,"%$1"));b=this.Jc;null!=b&&a.push(":",String(b))}if(b=this.Qa)this.vb&&"/"!=b.charAt(0)&&a.push("/"),a.push(sb(b,"/"==b.charAt(0)?ub:vb,!0));(b=this.g.toString())&&a.push("?",b);(b=this.Zb)&&a.push("#",sb(b,wb));return a.join("")}; q.resolve=function(a){var b=this.clone();"data"===b.qb&&(b=new lb);var c=!!a.qb;c?mb(b,a.qb):c=!!a.rc;c?b.rc=a.rc:c=!!a.vb;c?b.vb=a.vb:c=null!=a.Jc;var d=a.Qa;if(c)nb(b,a.Jc);else if(c=!!a.Qa){if("/"!=d.charAt(0))if(this.vb&&!this.Qa)d="/"+d;else{var e=b.Qa.lastIndexOf("/");-1!=e&&(d=b.Qa.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.Qa=d:c=""!==a.g.toString();c?ob(b,a.g.clone()):c=!!a.Zb;c&&(b.Zb=a.Zb);return b};q.clone=function(){return new lb(this)};function mb(a,b,c){a.qb=c?qb(b,!0):b;a.qb&&(a.qb=a.qb.replace(/:$/,""))}function nb(a,b){if(b){b=Number(b);if(isNaN(b)||0>b)throw Error("Bad port number "+b);a.Jc=b}else a.Jc=null}function ob(a,b,c){b instanceof rb?a.g=b:(c||(b=sb(b,xb)),a.g=new rb(b))} function qb(a,b){return a?b?decodeURI(a):decodeURIComponent(a):""}function sb(a,b,c){return null!=a?(a=encodeURI(a).replace(b,yb),c&&(a=a.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),a):null}function yb(a){a=a.charCodeAt(0);return"%"+(a>>4&15).toString(16)+(a&15).toString(16)}var tb=/[#\/\?@]/g,vb=/[#\?:]/g,ub=/[#\?]/g,xb=/[#\?@]/g,wb=/#/g;function rb(a){this.g=a||null} function zb(a){if(!a.La&&(a.La={},a.fd=0,a.g))for(var b=a.g.split("&"),c=0;c<b.length;c++){var d=b[c].indexOf("="),e=null;if(0<=d){var f=b[c].substring(0,d);e=b[c].substring(d+1)}else f=b[c];f=decodeURIComponent(f.replace(/\+/g," "));e=e||"";a.add(f,decodeURIComponent(e.replace(/\+/g," ")))}}q=rb.prototype;q.La=null;q.fd=null;q.add=function(a,b){zb(this);this.g=null;var c=this.La.hasOwnProperty(a)?this.La[a]:null;c||(this.La[a]=c=[]);c.push(b);this.fd++;return this}; q.set=function(a,b){zb(this);this.g=null;this.La.hasOwnProperty(a)?this.La[a]=[b]:this.add(a,b);return this};q.toString=function(){if(this.g)return this.g;if(!this.La)return"";var a=[],b;for(b in this.La)for(var c=encodeURIComponent(b),d=this.La[b],e=0;e<d.length;e++){var f=c;""!==d[e]&&(f+="="+encodeURIComponent(d[e]));a.push(f)}return this.g=a.join("&")};q.clone=function(){var a=new rb;a.g=this.g;if(this.La){var b={},c;for(c in this.La)b[c]=this.La[c].concat();a.La=b;a.fd=this.fd}return a};function P(a,b,c){var d=Ia.apply(3,arguments);this.severity=a;this.category=b;this.code=c;this.data=d;this.handled=!1;this.message="Shaka Error "+this.code;if(Ab)try{throw Error(this.message||"Shaka Error");}catch(e){this.stack=e.stack}}P.prototype.toString=function(){return"shaka.util.Error "+JSON.stringify(this,null," ")};L("shaka.util.Error",P);var Ab=!0;P.Severity={RECOVERABLE:1,CRITICAL:2};P.Category={NETWORK:1,TEXT:2,MEDIA:3,MANIFEST:4,STREAMING:5,DRM:6,PLAYER:7,CAST:8,STORAGE:9,ADS:10}; P.Code={UNSUPPORTED_SCHEME:1E3,BAD_HTTP_STATUS:1001,HTTP_ERROR:1002,TIMEOUT:1003,MALFORMED_DATA_URI:1004,REQUEST_FILTER_ERROR:1006,RESPONSE_FILTER_ERROR:1007,MALFORMED_TEST_URI:1008,UNEXPECTED_TEST_REQUEST:1009,ATTEMPTS_EXHAUSTED:1010,SEGMENT_MISSING:1011,INVALID_TEXT_HEADER:2E3,INVALID_TEXT_CUE:2001,UNABLE_TO_DETECT_ENCODING:2003,BAD_ENCODING:2004,INVALID_XML:2005,INVALID_MP4_TTML:2007,INVALID_MP4_VTT:2008,UNABLE_TO_EXTRACT_CUE_START_TIME:2009,INVALID_MP4_CEA:2010,TEXT_COULD_NOT_GUESS_MIME_TYPE:2011, CANNOT_ADD_EXTERNAL_TEXT_TO_SRC_EQUALS:2012,TEXT_ONLY_WEBVTT_SRC_EQUALS:2013,MISSING_TEXT_PLUGIN:2014,CHAPTERS_TRACK_FAILED:2015,CANNOT_ADD_EXTERNAL_THUMBNAILS_TO_SRC_EQUALS:2016,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_CODEC_UNKNOWN:3021,MSS_TRANSMUXING_FAILED:3022,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,STREAMING_ENGINE_STARTUP_INVALID_STATE:5006,NO_RECOGNIZED_KEY_SYSTEMS:6E3,REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE:6001,FAILED_TO_CREATE_CDM:6002,FAILED_TO_ATTACH_TO_VIDEO:6003,INVALID_SERVER_CERTIFICATE:6004,FAILED_TO_CREATE_SESSION:6005,FAILED_TO_GENERATE_LICENSE_REQUEST:6006,LICENSE_REQUEST_FAILED:6007,LICENSE_RESPONSE_REJECTED:6008,ENCRYPTED_CONTENT_WITHOUT_DRM_INFO:6010, NO_LICENSE_SERVER_GIVEN:6012,OFFLINE_SESSION_REMOVED:6013,EXPIRED:6014,SERVER_CERTIFICATE_REQUIRED:6015,INIT_DATA_TRANSFORM_ERROR:6016,SERVER_CERTIFICATE_REQUEST_FAILED:6017,MIN_HDCP_VERSION_NOT_MATCH:6018,ERROR_CHECKING_HDCP_VERSION:6019,LOAD_INTERRUPTED:7E3,OPERATION_ABORTED:7001,NO_VIDEO_ELEMENT:7002,OBJECT_DESTROYED:7003,CONTENT_NOT_LOADED:7004,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};function Bb(a,b){return a.concat(b)}function Cb(){}function Db(a){return null!=a};function Eb(a,b){if(0==b.length)return a;if(1==a.length&&1==b.length)return a=new lb(a[0]),b=new lb(b[0]),[a.resolve(b).toString()];var c=b.map(function(d){return new lb(d)});return a.map(function(d){var e=new lb(d);return c.map(function(f){return e.resolve(f).toString()})}).reduce(Bb,[])} function Fb(a,b){return{keySystem:a,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,serverCertificateUri:"",sessionType:"",initData:b||[],keyIds:new Set}}function Ib(a,b){if(1==b.length)return b[0];a=Jb(a,b);if(null!=a)return a;throw new P(2,4,4025,b);} function Jb(a,b){for(var c=r(Kb[a]),d=c.next();!d.done;d=c.next()){d=d.value;for(var e=r(b),f=e.next();!f.done;f=e.next())if(f=f.value,d.test(f.trim()))return f.trim()}return a==Lb?"":null}var Lb="text",Mb={ya:"video",Y:"audio",sa:Lb,bd:"image",pj:"application"},Kb={audio:[/^vorbis$/,/^Opus$/,/^opus$/,/^fLaC$/,/^flac$/,/^mp4a/,/^[ae]c-3$/,/^ac-4$/,/^dts[cex]$/],video:[/^avc/,/^hev/,/^hvc/,/^vp0?[89]/,/^av01/,/^dvh/],text:[/^vtt$/,/^wvtt/,/^stpp/]};function Nb(){}function Ob(a,b){a=Pb(a);b=Pb(b);return a.split("-")[0]==b.split("-")[0]}function Qb(a,b){a=Pb(a);b=Pb(b);a=a.split("-");b=b.split("-");return a[0]==b[0]&&1==a.length&&2==b.length}function Rb(a,b){a=Pb(a);b=Pb(b);a=a.split("-");b=b.split("-");return 2==a.length&&2==b.length&&a[0]==b[0]}function Pb(a){var b=a.split("-x-"),c=b[0].split("-");a=c[0]||"";c=c[1]||"";b=b[1]?"x-"+b[1]:"";a=a.toLowerCase();a=Sb.get(a)||a;c=c.toUpperCase();return(c?a+"-"+c:a)+(b?"-"+b:"")} function Tb(a,b){var c=Ub(a),d=Ub(b);return a!=c&&b!=d&&c==d}function Vb(a,b){a=Pb(a);b=Pb(b);return b==a?4:Qb(b,a)?3:Rb(b,a)?2:Qb(a,b)?1:0}function Ub(a){var b=a.indexOf("-");a=0<=b?a.substring(0,b):a;a=a.toLowerCase();return a=Sb.get(a)||a}function Wb(a){return a.language?Pb(a.language):a.audio&&a.audio.language?Pb(a.audio.language):a.video&&a.video.language?Pb(a.video.language):"und"} function Xb(a,b){a=Pb(a);var c=new Set,d=r(b);for(b=d.next();!b.done;b=d.next())c.add(Pb(b.value));d=r(c);for(b=d.next();!b.done;b=d.next())if(b=b.value,b==a)return b;d=r(c);for(b=d.next();!b.done;b=d.next())if(b=b.value,Qb(b,a))return b;d=r(c);for(b=d.next();!b.done;b=d.next())if(b=b.value,Rb(b,a))return b;c=r(c);for(b=c.next();!b.done;b=c.next())if(b=b.value,Qb(a,b))return b;return null}L("shaka.util.LanguageUtils",Nb);Nb.findClosestLocale=Xb;Nb.getLocaleForVariant=Wb; Nb.getLocaleForText=function(a){return Pb(a.language||"und")};Nb.getBase=Ub;Nb.relatedness=Vb;Nb.areSiblings=Tb;Nb.normalize=Pb;Nb.isSiblingOf=Rb;Nb.isParentOf=Qb;Nb.areLanguageCompatible=Ob;Nb.areLocaleCompatible=function(a,b){a=Pb(a);b=Pb(b);return a==b}; var Sb=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 Yb(a){fb.call(this);this.j=Pb(a);this.i=new Map;this.g=new Set;this.h=new Map}oa(Yb,fb);q=Yb.prototype;q.release=function(){fb.prototype.release.call(this)}; q.Fg=function(a){var b=this;this.g.clear();a=r(a);for(var c=a.next();!c.done;c=a.next())this.g.add(Pb(c.value));Zb(this);a=jb(this.g,function(d){return!b.h.has(d)});a.length&&this.dispatchEvent(new O("unknown-locales",(new Map).set("locales",a)));a=jb(this.g,function(d){return b.h.has(d)});a=(new Map).set("locales",a.length?a:[this.j]);this.dispatchEvent(new O("locale-changed",a))}; q.na=function(a,b,c){a=Pb(a);void 0===c&&(c=$b);var d=this.h.get(a)||new Map;b.forEach(function(e,f){d.has(f)&&c!=$b||d.set(f,e)});this.h.set(a,d);Zb(this);this.dispatchEvent(new O("locale-updated"));return this};q.$i=function(a){for(var b=r(a.keys()),c=b.next();!c.done;c=b.next())c=c.value,a.set(c,this.resolve(c))};q.resolve=function(a){var b=this.i.get(a);if(b)return b;a=(new Map).set("locales",Array.from(this.g)).set("missing",a);this.dispatchEvent(new O("unknown-localization",a));return""}; function Zb(a){for(var b=a.h,c=a.j,d=a.g,e=new Set,f={},g=r(d),h=g.next();!h.done;f={vc:f.vc},h=g.next()){f.vc=h.value;e.add(f.vc);e.add(Ub(f.vc));h=jb(b.keys(),function(l){return function(m){return Tb(m,l.vc)}}(f));h.sort();var k=r(h);for(h=k.next();!h.done;h=k.next())e.add(h.value);h=jb(b.keys(),function(l){return function(m){return Ub(m)==l.vc}}(f));h.sort();k=r(h);for(h=k.next();!h.done;h=k.next())e.add(h.value)}e.add(c);c=[];e=r(e);for(h=e.next();!h.done;h=e.next())(h=b.get(h.value))&&c.push(h); c.reverse();a.i.clear();b=r(c);for(h=b.next();!h.done;h=b.next())h.value.forEach(function(l,m){a.i.set(m,l)});b=a.i.keys();e=new Set;c=r(a.g);for(h=c.next();!h.done;h=c.next())h=a.h.get(h.value)||new Map,ac(h,b,e);0<e.size&&(d=(new Map).set("locales",Array.from(d)).set("missing",Array.from(e)),a.dispatchEvent(new O("missing-localizations",d)))}function ac(a,b,c){b=r(b);for(var d=b.next();!d.done;d=b.next())d=d.value,a.get(d)||c.add(d)}L("shaka.ui.Localization",Yb);Yb.prototype.resolve=Yb.prototype.resolve; Yb.prototype.resolveDictionary=Yb.prototype.$i;Yb.prototype.insert=Yb.prototype.na;Yb.prototype.changeLocale=Yb.prototype.Fg;Yb.prototype.release=Yb.prototype.release;var $b=1;Yb.ConflictResolution={USE_OLD:0,USE_NEW:$b};Yb.UNKNOWN_LOCALES="unknown-locales";Yb.UNKNOWN_LOCALIZATION="unknown-localization";Yb.MISSING_LOCALIZATIONS="missing-localizations";Yb.LOCALE_CHANGED="locale-changed";Yb.LOCALE_UPDATED="locale-updated";var bc={Nj:"LANGUAGE",vk:"STATISTICS",fk:"PLAY",Ik:"UNDETERMINED_LANGUAGE",oj:"AIRPLAY",Sj:"MORE_SETTINGS",Kk:"UNRECOGNIZED_LANGUAGE",wh:"LIVE",lk:"RESOLUTION",nj:"AD_TIME",Tj:"MULTIPLE_LANGUAGES",$j:"ON",kk:"REPLAY",AD_PROGRESS:"AD_PROGRESS",mj:"AD_DURATION",wj:"CAST",Yj:"NOT_APPLICABLE",dk:"PAUSE",Ej:"EXIT_LOOP_MODE",rk:"SKIP_AD",vj:"CAPTIONS",Oj:"LOOP",Bj:"ENTER_PICTURE_IN_PICTURE",Ij:"FAST_FORWARD",Zj:"OFF",ek:"PICTURE_IN_PICTURE",Uj:"MUTE",nk:"REWIND",qk:"SEEK",ik:"QUALITY",qj:"AUTO_QUALITY", Aj:"ENTER_LOOP_MODE",yh:"SUBTITLE_FORCED",Dj:"EXIT_FULL_SCREEN",Nk:"VOLUME",tk:"SKIP_TO_LIVE",Jj:"FULL_SCREEN",Fj:"EXIT_PICTURE_IN_PICTURE",BACK:"BACK",Jk:"UNMUTE",gk:"PLAYBACK_RATE"};function cc(a){this.g=Math.exp(Math.log(.5)/a);this.i=this.h=0}cc.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 dc(a){return a.h/(1-Math.pow(a.g,a.i))};function ec(){this.h=new cc(2);this.j=new cc(5);this.g=0;this.i=128E3;this.l=16E3}ec.prototype.configure=function(a){this.i=a.minTotalBytes;this.l=a.minBytes;this.h.g=Math.exp(Math.log(.5)/a.fastHalfLife);this.j.g=Math.exp(Math.log(.5)/a.slowHalfLife)};ec.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)}};ec.prototype.getBandwidthEstimate=function(a){return this.g<this.i?a:Math.min(dc(this.h),dc(this.j))};L("shaka.config.CodecSwitchingStrategy",{jk:"reload",xh:"smooth"});function fc(a){if(gc.has(a))return gc.get(a);var b=MediaSource.isTypeSupported(a);gc.set(a,b);return b}function hc(){return!!window.SourceBuffer&&!!SourceBuffer.prototype&&!!SourceBuffer.prototype.changeType}var gc=new Map;function ic(){}ic.prototype.extract=function(){};ic.prototype.decode=function(){return[]};ic.prototype.clear=function(){};function jc(){}jc.prototype.init=function(){};jc.prototype.parse=function(){return[]};function kc(){}function lc(a,b){if(!a&&!b)return!0;if(!a||!b||a.byteLength!=b.byteLength)return!1;if(mc(a)==mc(b)&&(a.byteOffset||0)==(b.byteOffset||0))return!0;var c=nc(a);b=nc(b);for(var d=0;d<a.byteLength;d++)if(c[d]!=b[d])return!1;return!0}function mc(a){return a instanceof ArrayBuffer?a:a.buffer}function oc(a){return a instanceof ArrayBuffer?a:0==a.byteOffset&&a.byteLength==a.buffer.byteLength?a.buffer:(new Uint8Array(a)).buffer} function nc(a,b,c){c=void 0===c?Infinity:c;return pc(a,void 0===b?0:b,c,Uint8Array)}function qc(a,b,c){c=void 0===c?Infinity:c;return pc(a,void 0===b?0:b,c,DataView)}function pc(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(mc(a),b,Math.min(b+Math.max(c,0),e)-b)}L("shaka.util.BufferUtils",kc);kc.toDataView=qc;kc.toUint8=nc;kc.toArrayBuffer=oc;kc.equal=lc;function rc(){}rc.prototype.init=function(){};rc.prototype.j=function(){};rc.prototype.i=function(){};L("shaka.media.IClosedCaptionParser",rc);function sc(a){this.h=new jc;if(a=tc[a.toLowerCase()])this.h=a();this.g=new ic;if(a=uc)this.g=a()}sc.prototype.init=function(a){this.h.init(a)};sc.prototype.j=function(a){a=this.h.parse(a);a=r(a);for(var b=a.next();!b.done;b=a.next()){b=b.value;var c=nc(b.packet);0<c.length&&this.g.extract(c,b.pts)}return this.g.decode()};sc.prototype.i=function(){this.g.clear()}; L("shaka.media.ClosedCaptionParser",sc);sc.findDecoder=function(){return uc};sc.unregisterDecoder=function(){uc=null};sc.registerDecoder=function(a){uc=a};sc.findParser=function(a){return tc[a]};sc.unregisterParser=function(a){delete tc[a]};sc.registerParser=function(a,b){tc[a]=b};var tc={},uc=null;function vc(a,b){return"number"===typeof a&&"number"===typeof b&&isNaN(a)&&isNaN(b)?!0:a===b}function wc(a,b){b=a.indexOf(b);-1<b&&a.splice(b,1)}function xc(a,b,c){c||(c=vc);if(a.length!=b.length)return!1;b=b.slice();var d={};a=r(a);for(var e=a.next();!e.done;d={Me:d.Me},e=a.next()){d.Me=e.value;e=b.findIndex(function(f){return function(g){return c(f.Me,g)}}(d));if(-1==e)return!1;b[e]=b[b.length-1];b.pop()}return 0==b.length} function yc(a,b,c){c||(c=vc);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 zc(a,b,c){this.startTime=a;this.endTime=b;this.payload=c;this.region=new Ac;this.position=null;this.positionAlign=Bc;this.size=0;this.textAlign=Cc;this.direction=Dc;this.writingMode=Ec;this.lineInterpretation=Fc;this.line=null;this.lineHeight="";this.lineAlign=Gc;this.displayAlign=Hc;this.fontSize=this.border=this.backgroundImage=this.backgroundColor=this.color="";this.fontWeight=Ic;this.fontStyle=Jc;this.linePadding=this.letterSpacing=this.fontFamily="";this.opacity=1;this.textCombineUpright= "";this.textDecoration=[];this.textStrokeWidth=this.textStrokeColor=this.textShadow="";this.wrapLine=!0;this.id="";this.nestedCues=[];this.lineBreak=this.isContainer=!1;this.rubyTag=null;this.cellResolution={Kh:32,rows:15}}function Kc(a,b){a=new zc(a,b,"");a.lineBreak=!0;return a}zc.prototype.clone=function(){var a=new zc(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 Lc(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(!yc(a.nestedCues,b.nestedCues,Lc))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(!yc(a[c],b[c]))return!1}else if(a[c]!=b[c])return!1;return!0}L("shaka.text.Cue",zc);zc.equal=Lc;zc.prototype.clone=zc.prototype.clone;var Bc="auto"; zc.positionAlign={LEFT:"line-left",RIGHT:"line-right",CENTER:"center",AUTO:Bc};var Cc="center",Mc={LEFT:"left",RIGHT:"right",CENTER:Cc,START:"start",END:"end"};zc.textAlign=Mc;var Hc="after",Nc={BEFORE:"before",CENTER:"center",AFTER:Hc};zc.displayAlign=Nc;var Dc="ltr";zc.direction={HORIZONTAL_LEFT_TO_RIGHT:Dc,HORIZONTAL_RIGHT_TO_LEFT:"rtl"};var Ec="horizontal-tb";zc.writingMode={HORIZONTAL_TOP_TO_BOTTOM:Ec,VERTICAL_LEFT_TO_RIGHT:"vertical-lr",VERTICAL_RIGHT_TO_LEFT:"vertical-rl"};var Fc=0; zc.lineInterpretation={LINE_NUMBER:Fc,PERCENTAGE:1};var Gc="start",Oc={CENTER:"center",START:Gc,END:"end"};zc.lineAlign=Oc;var Pc={white:"white",lime:"lime",cyan:"cyan",red:"red",yellow:"yellow",magenta:"magenta",blue:"blue",black:"black"};zc.defaultTextColor=Pc;var Qc={bg_white:"white",bg_lime:"lime",bg_cyan:"cyan",bg_red:"red",bg_yellow:"yellow",bg_magenta:"magenta",bg_blue:"blue",bg_black:"black"};zc.defaultTextBackgroundColor=Qc;var Ic=400;zc.fontWeight={NORMAL:Ic,BOLD:700}; var Jc="normal",Rc={NORMAL:Jc,ITALIC:"italic",OBLIQUE:"oblique"};zc.fontStyle=Rc;zc.textDecoration={UNDERLINE:"underline",LINE_THROUGH:"lineThrough",OVERLINE:"overline"};function Ac(){this.id="";this.regionAnchorY=this.regionAnchorX=this.viewportAnchorY=this.viewportAnchorX=0;this.height=this.width=100;this.viewportAnchorUnits=this.widthUnits=this.heightUnits=Sc;this.scroll=Tc}L("shaka.text.CueRegion",Ac);var Sc=1;Ac.units={PX:0,PERCENTAGE:Sc,LINES:2};var Tc="";Ac.scrollMode={NONE:Tc,UP:"up"};function Uc(){}Uc.prototype.destroy=function(){};function Vc(a,b,c){Wc[a.toLowerCase().split(";")[0]+"-"+c]={priority:c,ye:b}}function Xc(a,b){for(var c=a.toLowerCase().split(";")[0],d=r([Yc,Zc,$c,ad]),e=d.next();!e.done;e=d.next())if(e=Wc[c+"-"+e.value]){var f=e.ye(),g=f.isSupported(a,b);f.destroy();if(g)return e.ye}return null}L("shaka.transmuxer.TransmuxerEngine",Uc);Uc.findTransmuxer=Xc;Uc.unregisterTransmuxer=function(a,b){delete Wc[a.toLowerCase().split(";")[0]+"-"+b]}; Uc.registerTransmuxer=Vc;Uc.prototype.destroy=Uc.prototype.destroy;var Wc={},ad=1,$c=2,Zc=3,Yc=4;Uc.PluginPriority={FALLBACK:ad,PREFERRED_SECONDARY:$c,PREFERRED:Zc,APPLICATION:Yc};function bd(){}function cd(a,b){var c=a;b&&!dd.includes(a)&&(c+='; codecs="'+b+'"');return c}function ed(a,b){b&&(a+='; codecs="'+b+'"');return a}function fd(a,b,c){var d=cd(a,b);b=ed(a,b);Xc(b)?(a=Xc(b))?(a=a(),c=a.convertCodecs(c,b),a.destroy()):c=b:c="video/mp2t"!=a&&"audio"==c?d.replace("video","audio"):d;return c} function gd(a){var b=hd(a);a=b[0];b=b[1].toLowerCase();switch(!0){case "mp4a"===a&&"69"===b:case "mp4a"===a&&"6b"===b:case "mp4a"===a&&"40.34"===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 id(a){return a.split(";")[0]}function jd(a){a=a.split(/ *; */);a.shift();return(a=a.find(function(b){return b.startsWith("codecs=")}))?a.split("=")[1].replace(/^"|"$/g,""):""}function hd(a){a=a.split(".");var b=a[0];a.shift();return[b,a.join(".")]}L("shaka.util.MimeUtils",bd); bd.getFullTypeWithAllCodecs=ed;bd.getFullType=cd;(new Map).set("codecs","codecs").set("frameRate","framerate").set("bandwidth","bitrate").set("width","width").set("height","height").set("channelsCount","channels");var dd=["audio/aac","audio/ac3","audio/ec3","audio/mpeg"];function kd(a){this.i=null;this.j=a;this.C=!1;this.l=this.B=0;this.m=Infinity;this.h=this.g=null;this.D="";this.s=new Map}function ld(a){return md[a]?!0:"application/cea-608"==a||"application/cea-708"==a?!!uc:!1}kd.prototype.destroy=function(){this.j=this.i=null;this.s.clear();return Promise.resolve()}; function od(a,b,c,d){var e,f,g,h;return J(function(k){if(1==k.g)return C(k,Promise.resolve(),2);if(!a.i||!a.j)return k.return();if(null==c||null==d)return a.i.parseInit(nc(b)),k.return();e=a.C?c:a.B;f={periodStart:a.B,segmentStart:c,segmentEnd:d,vttOffset:e};g=a.i.parseMedia(nc(b),f);h=g.filter(function(l){return l.startTime>=a.l&&l.startTime<a.m});a.j.append(h);null==a.g&&(a.g=Math.max(c,a.l));a.h=Math.min(d,a.m);E(k)})} kd.prototype.remove=function(a,b){var c=this;return J(function(d){if(1==d.g)return C(d,Promise.resolve(),2);!c.j||!c.j.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));E(d)})};function pd(a,b,c){a.l=b;a.m=c}function qd(a,b,c){a.D=b;if(b=a.s.get(b))for(var d=r(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 rd(a,b,c){b.startTime+=c;b.endTime+=c;b=r(b.nestedCues);for(var d=b.next();!d.done;d=b.next())rd(a,d.value,c)} function sd(a,b,c,d,e){var f=c+" "+d,g=new Map;b=r(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,[]);rd(a,k,e);k.startTime>=a.l&&k.startTime<a.m&&(g.get(h).get(f).push(k),h==a.D&&a.j.append([k]))}e=r(g.keys());for(f=e.next();!f.done;f=e.next())for(f=f.value,a.s.has(f)||a.s.set(f,new Map),b=r(g.get(f).keys()),h=b.next();!h.done;h=b.next())h=h.value,k=g.get(f).get(h),a.s.get(f).set(h,k);a.g=null==a.g?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))}L("shaka.text.TextEngine",kd);kd.prototype.destroy=kd.prototype.destroy;kd.findParser=function(a){return md[a]};kd.unregisterParser=function(a){delete md[a]};kd.registerParser=function(a,b){md[a]=b};var md={};function td(a){this.h=a;this.g=null}td.prototype.S=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};td.prototype.stop=function(){this.g&&(this.g(),this.g=null)};function ud(a){this.h=a;this.g=null}ud.prototype.Ha=function(){this.stop();this.h();return this};ud.prototype.S=function(a){var b=this;this.stop();this.g=(new td(function(){b.h()})).S(a);return this};ud.prototype.ka=function(a){var b=this;this.stop();this.g=(new td(function(){b.g.S(a);b.h()})).S(a);return this};ud.prototype.stop=function(){this.g&&(this.g.stop(),this.g=null)};L("shaka.util.Timer",ud);ud.prototype.stop=ud.prototype.stop;ud.prototype.tickEvery=ud.prototype.ka; ud.prototype.tickAfter=ud.prototype.S;ud.prototype.tickNow=ud.prototype.Ha;function vd(){return window.MediaSource&&MediaSource.isTypeSupported?!0:!1}function wd(a){return""!=xd().canPlayType(a)}function yd(){return navigator.userAgent.match(/Edge?\//)?!0:!1}function zd(){return Ad("Xbox One")}function Bd(){return Ad("Tizen")}function Cd(){return Ad("Tizen 3")}function Dd(){return Ad("Tizen 2")}function Ed(){return Ad("Web0S")&&Ad("Chrome/38.0.2125.122 Safari/537.36")} function Fd(){return!!navigator.vendor&&navigator.vendor.includes("Apple")&&!Bd()&&!Ad("PC=EOS")&&!Ad("VirginMedia")&&!Ad("SOPOpenBrowser")&&!Gd()&&!Ad("AFT")}function Gd(){return Ad("PlayStation 4")}function Hd(){if(!Fd())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 Ad(a){return(navigator.userAgent||"").includes(a)} function xd(){if(Id)return Id;Jd||(Jd=new ud(function(){Id=null}));(Id=document.getElementsByTagName("video")[0]||document.getElementsByTagName("audio")[0])||(Id=document.createElement("video"));Jd.S(1);return Id}var Jd=null,Id=null;function Kd(){} function Ld(a,b,c,d,e){var f=a.variants;if(b.length||c.length)f=Md(f,b,c);if(e.length){b=new eb;c=r(f);for(f=c.next();!f.done;f=c.next())f=f.value,b.push(String(f.video.width||0),f);var g=[];b.forEach(function(t,u){t=0;var x=[],w={};u=r(u);for(var y=u.next();!y.done;w={$c:w.$c},y=u.next())w.$c=y.value,y=e.filter(function(z){return function(A){return z.$c.decodingInfos[0][A]}}(w)).length,y>t?(t=y,x=[w.$c]):y==t&&x.push(w.$c);g.push.apply(g,v(x))});f=g}d&&(f=Nd(f,d));b=new Set;d=new Set;c=r(f);for(f= c.next();!f.done;f=c.next())f=f.value,f.audio&&b.add(f.audio),f.video&&d.add(f.video);b=Array.from(b).sort(function(t,u){return t.bandwidth-u.bandwidth});f=new Map;b=r(b);for(var h=b.next();!h.done;h=b.next())c=h.value,h=c.language+(c.channelsCount||0)+c.roles.join(",")+c.label,f.has(h)?f.get(h).bandwidth>c.bandwidth&&f.set(h,c):f.set(h,c);f=[].concat(v(f