(function(){var innerGlobal=typeof window!="undefined"?window:global;var exportTo={};(function(window,global){var n,aa="function"==typeof Object.defineProperties?Object.defineProperty:function(b,c,d){b!=Array.prototype&&b!=Object.prototype&&(b[c]=d.value)},ba="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global&&null!=global?global:this;function ca(){ca=function(){};ba.Symbol||(ba.Symbol=da)}var da=function(){var b=0;return function(c){return"jscomp_symbol_"+(c||"")+b++}}();
function ea(){ca();var b=ba.Symbol.iterator;b||(b=ba.Symbol.iterator=ba.Symbol("iterator"));"function"!=typeof Array.prototype[b]&&aa(Array.prototype,b,{configurable:!0,writable:!0,value:function(){return ha(this)}});ea=function(){}}function ha(b){var c=0;return ka(function(){return c<b.length?{done:!1,value:b[c++]}:{done:!0}})}function ka(b){ea();b={next:b};b[ba.Symbol.iterator]=function(){return this};return b}function q(b){ea();var c=b[Symbol.iterator];return c?c.call(b):ha(b)}
function la(b,c){if(c){for(var d=ba,e=b.split("."),f=0;f<e.length-1;f++){var g=e[f];g in d||(d[g]={});d=d[g]}e=e[e.length-1];f=d[e];g=c(f);g!=f&&null!=g&&aa(d,e,{configurable:!0,writable:!0,value:g})}}
la("Promise",function(b){function c(b){this.b=0;this.g=void 0;this.a=[];var c=this.c();try{b(c.resolve,c.reject)}catch(l){c.reject(l)}}function d(){this.a=null}function e(b){return b instanceof c?b:new c(function(c){c(b)})}if(b)return b;d.prototype.b=function(b){null==this.a&&(this.a=[],this.f());this.a.push(b)};d.prototype.f=function(){var b=this;this.c(function(){b.h()})};var f=ba.setTimeout;d.prototype.c=function(b){f(b,0)};d.prototype.h=function(){for(;this.a&&this.a.length;){var b=this.a;this.a=
[];for(var c=0;c<b.length;++c){var d=b[c];b[c]=null;try{d()}catch(m){this.g(m)}}}this.a=null};d.prototype.g=function(b){this.c(function(){throw b;})};c.prototype.c=function(){function b(b){return function(e){d||(d=!0,b.call(c,e))}}var c=this,d=!1;return{resolve:b(this.o),reject:b(this.f)}};c.prototype.o=function(b){if(b===this)this.f(new TypeError("A Promise cannot resolve to itself"));else if(b instanceof c)this.s(b);else{a:switch(typeof b){case "object":var d=null!=b;break a;case "function":d=!0;
break a;default:d=!1}d?this.m(b):this.h(b)}};c.prototype.m=function(b){var c=void 0;try{c=b.then}catch(l){this.f(l);return}"function"==typeof c?this.v(c,b):this.h(b)};c.prototype.f=function(b){this.i(2,b)};c.prototype.h=function(b){this.i(1,b)};c.prototype.i=function(b,c){if(0!=this.b)throw Error("Cannot settle("+b+", "+c+"): Promise already settled in state"+this.b);this.b=b;this.g=c;this.l()};c.prototype.l=function(){if(null!=this.a){for(var b=0;b<this.a.length;++b)g.b(this.a[b]);this.a=null}};
var g=new d;c.prototype.s=function(b){var c=this.c();b.Db(c.resolve,c.reject)};c.prototype.v=function(b,c){var d=this.c();try{b.call(c,d.resolve,d.reject)}catch(m){d.reject(m)}};c.prototype.then=function(b,d){function e(b,c){return"function"==typeof b?function(c){try{f(b(c))}catch(R){g(R)}}:c}var f,g,h=new c(function(b,c){f=b;g=c});this.Db(e(b,f),e(d,g));return h};c.prototype["catch"]=function(b){return this.then(void 0,b)};c.prototype.Db=function(b,c){function d(){switch(e.b){case 1:b(e.g);break;
case 2:c(e.g);break;default:throw Error("Unexpected state: "+e.b);}}var e=this;null==this.a?g.b(d):this.a.push(d)};c.resolve=e;c.reject=function(b){return new c(function(c,d){d(b)})};c.race=function(b){return new c(function(c,d){for(var f=q(b),g=f.next();!g.done;g=f.next())e(g.value).Db(c,d)})};c.all=function(b){var d=q(b),f=d.next();return f.done?e([]):new c(function(b,c){function g(c){return function(d){h[c]=d;k--;0==k&&b(h)}}var h=[],k=0;do h.push(void 0),k++,e(f.value).Db(g(h.length-1),c),f=d.next();
while(!f.done)})};return c});la("Promise.prototype.finally",function(b){return b?b: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;})})}});function ma(b){function c(c){return b.next(c)}function d(c){return b["throw"](c)}return new Promise(function(e,f){function g(b){b.done?e(b.value):Promise.resolve(b.value).then(c,d).then(g,f)}g(b.next())})}function t(b){return ma(b())}
function na(){this.g=!1;this.c=null;this.u=void 0;this.j=1;this.b=this.f=0;this.i=this.a=null}function oa(b){if(b.g)throw new TypeError("Generator is already running");b.g=!0}na.prototype.h=function(b){this.u=b};function pa(b,c){b.a={Rc:c,fd:!0};b.j=b.f||b.b}na.prototype["return"]=function(b){this.a={"return":b};this.j=this.b};function u(b,c,d){b.j=d;return{value:c}}na.prototype.B=function(b){this.j=b};function qa(b,c,d){b.f=c;void 0!=d&&(b.b=d)}function ra(b,c){b.f=0;b.b=c||0}
function sa(b,c){b.j=c;b.f=0}function ta(b){b.f=0;var c=b.a.Rc;b.a=null;return c}function ua(b){b.i=[b.a];b.f=0;b.b=0}function va(b,c){var d=b.i.splice(0)[0];(d=b.a=b.a||d)?d.fd?b.j=b.f||b.b:void 0!=d.B&&b.b<d.B?(b.j=d.B,b.a=null):b.j=b.b:b.j=c}function wa(b){this.a=new na;this.b=b}function xa(b,c){oa(b.a);var d=b.a.c;if(d)return ya(b,"return"in d?d["return"]:function(b){return{value:b,done:!0}},c,b.a["return"]);b.a["return"](c);return za(b)}
function ya(b,c,d,e){try{var f=c.call(b.a.c,d);if(!(f instanceof Object))throw new TypeError("Iterator result "+f+" is not an object");if(!f.done)return b.a.g=!1,f;var g=f.value}catch(h){return b.a.c=null,pa(b.a,h),za(b)}b.a.c=null;e.call(b.a,g);return za(b)}
function za(b){for(;b.a.j;)try{var c=b.b(b.a);if(c)return b.a.g=!1,{value:c.value,done:!1}}catch(d){b.a.u=void 0,pa(b.a,d)}b.a.g=!1;if(b.a.a){c=b.a.a;b.a.a=null;if(c.fd)throw c.Rc;return{value:c["return"],done:!0}}return{value:void 0,done:!0}}
function Aa(b){this.next=function(c){oa(b.a);b.a.c?c=ya(b,b.a.c.next,c,b.a.h):(b.a.h(c),c=za(b));return c};this["throw"]=function(c){oa(b.a);b.a.c?c=ya(b,b.a.c["throw"],c,b.a.h):(pa(b.a,c),c=za(b));return c};this["return"]=function(c){return xa(b,c)};ea();this[Symbol.iterator]=function(){return this}}function v(b,c){Aa.prototype=b.prototype;return new Aa(new wa(c))}function Ba(b,c){return Object.prototype.hasOwnProperty.call(b,c)}
la("WeakMap",function(b){function c(b){this.a=(g+=Math.random()+1).toString();if(b){ca();ea();b=q(b);for(var c;!(c=b.next()).done;)c=c.value,this.set(c[0],c[1])}}function d(b){Ba(b,f)||aa(b,f,{value:{}})}function e(b){var c=Object[b];c&&(Object[b]=function(b){d(b);return c(b)})}if(function(){if(!b||!Object.seal)return!1;try{var c=Object.seal({}),d=Object.seal({}),e=new b([[c,2],[d,3]]);if(2!=e.get(c)||3!=e.get(d))return!1;e["delete"](c);e.set(d,4);return!e.has(c)&&4==e.get(d)}catch(m){return!1}}())return b;
var f="$jscomp_hidden_"+Math.random();e("freeze");e("preventExtensions");e("seal");var g=0;c.prototype.set=function(b,c){d(b);if(!Ba(b,f))throw Error("WeakMap key fail: "+b);b[f][this.a]=c;return this};c.prototype.get=function(b){return Ba(b,f)?b[f][this.a]:void 0};c.prototype.has=function(b){return Ba(b,f)&&Ba(b[f],this.a)};c.prototype["delete"]=function(b){return Ba(b,f)&&Ba(b[f],this.a)?delete b[f][this.a]:!1};return c});
la("Map",function(b){function c(){var b={};return b.ta=b.next=b.head=b}function d(b,c){var d=b.a;return ka(function(){if(d){for(;d.head!=b.a;)d=d.ta;for(;d.next!=d.head;)return d=d.next,{done:!1,value:c(d)};d=null}return{done:!0,value:void 0}})}function e(b,c){var d=c&&typeof c;"object"==d||"function"==d?g.has(c)?d=g.get(c):(d=""+ ++h,g.set(c,d)):d="p_"+c;var e=b.b[d];if(e&&Ba(b.b,d))for(var f=0;f<e.length;f++){var k=e[f];if(c!==c&&k.key!==k.key||c===k.key)return{id:d,list:e,index:f,S:k}}return{id:d,
list:e,index:-1,S:void 0}}function f(b){this.b={};this.a=c();this.size=0;if(b){b=q(b);for(var d;!(d=b.next()).done;)d=d.value,this.set(d[0],d[1])}}if(function(){if(!b||"function"!=typeof b||!b.prototype.entries||"function"!=typeof Object.seal)return!1;try{var c=Object.seal({x:4}),d=new b(q([[c,"s"]]));if("s"!=d.get(c)||1!=d.size||d.get({x:4})||d.set({x:4},"t")!=d||2!=d.size)return!1;var e=d.entries(),f=e.next();if(f.done||f.value[0]!=c||"s"!=f.value[1])return!1;f=e.next();return f.done||4!=f.value[0].x||
"t"!=f.value[1]||!e.next().done?!1:!0}catch(r){return!1}}())return b;ca();ea();var g=new WeakMap;f.prototype.set=function(b,c){var d=e(this,b);d.list||(d.list=this.b[d.id]=[]);d.S?d.S.value=c:(d.S={next:this.a,ta:this.a.ta,head:this.a,key:b,value:c},d.list.push(d.S),this.a.ta.next=d.S,this.a.ta=d.S,this.size++);return this};f.prototype["delete"]=function(b){b=e(this,b);return b.S&&b.list?(b.list.splice(b.index,1),b.list.length||delete this.b[b.id],b.S.ta.next=b.S.next,b.S.next.ta=b.S.ta,b.S.head=
null,this.size--,!0):!1};f.prototype.clear=function(){this.b={};this.a=this.a.ta=c();this.size=0};f.prototype.has=function(b){return!!e(this,b).S};f.prototype.get=function(b){return(b=e(this,b).S)&&b.value};f.prototype.entries=function(){return d(this,function(b){return[b.key,b.value]})};f.prototype.keys=function(){return d(this,function(b){return b.key})};f.prototype.values=function(){return d(this,function(b){return b.value})};f.prototype.forEach=function(b,c){for(var d=this.entries(),e;!(e=d.next()).done;)e=
e.value,b.call(c,e[1],e[0],this)};f.prototype[Symbol.iterator]=f.prototype.entries;var h=0;return f});
la("Set",function(b){function c(b){this.a=new Map;if(b){b=q(b);for(var c;!(c=b.next()).done;)this.add(c.value)}this.size=this.a.size}if(function(){if(!b||"function"!=typeof b||!b.prototype.entries||"function"!=typeof Object.seal)return!1;try{var c=Object.seal({x:4}),e=new b(q([c]));if(!e.has(c)||1!=e.size||e.add(c)!=e||1!=e.size||e.add({x:4})!=e||2!=e.size)return!1;var f=e.entries(),g=f.next();if(g.done||g.value[0]!=c||g.value[1]!=c)return!1;g=f.next();return g.done||g.value[0]==c||4!=g.value[0].x||
g.value[1]!=g.value[0]?!1:f.next().done}catch(h){return!1}}())return b;ca();ea();c.prototype.add=function(b){this.a.set(b,b);this.size=this.a.size;return this};c.prototype["delete"]=function(b){b=this.a["delete"](b);this.size=this.a.size;return b};c.prototype.clear=function(){this.a.clear();this.size=0};c.prototype.has=function(b){return this.a.has(b)};c.prototype.entries=function(){return this.a.entries()};c.prototype.values=function(){return this.a.values()};c.prototype.keys=c.prototype.values;
c.prototype[Symbol.iterator]=c.prototype.values;c.prototype.forEach=function(b,c){var d=this;this.a.forEach(function(e){return b.call(c,e,e,d)})};return c});function Ca(b,c,d){b instanceof String&&(b=String(b));for(var e=b.length,f=0;f<e;f++){var g=b[f];if(c.call(d,g,f,b))return{bd:f,Kd:g}}return{bd:-1,Kd:void 0}}la("Array.prototype.findIndex",function(b){return b?b:function(b,d){return Ca(this,b,d).bd}});
function Da(b,c){ea();b instanceof String&&(b+="");var d=0,e={next:function(){if(d<b.length){var f=d++;return{value:c(f,b[f]),done:!1}}e.next=function(){return{done:!0,value:void 0}};return e.next()}};e[Symbol.iterator]=function(){return e};return e}la("Array.prototype.keys",function(b){return b?b:function(){return Da(this,function(b){return b})}});la("Object.is",function(b){return b?b:function(b,d){return b===d?0!==b||1/b===1/d:b!==b&&d!==d}});
la("Array.prototype.includes",function(b){return b?b:function(b,d){var c=this;c instanceof String&&(c=String(c));var f=c.length,g=d||0;for(0>g&&(g=Math.max(g+f,0));g<f;g++){var h=c[g];if(h===b||Object.is(h,b))return!0}return!1}});function Ea(b,c,d){if(null==b)throw new TypeError("The 'this' value for String.prototype."+d+" must not be null or undefined");if(c instanceof RegExp)throw new TypeError("First argument to String.prototype."+d+" must not be a regular expression");return b+""}
la("String.prototype.includes",function(b){return b?b:function(b,d){return-1!==Ea(this,b,"includes").indexOf(b,d||0)}});la("Array.from",function(b){return b?b:function(b,d,e){ea();d=null!=d?d:function(b){return b};var c=[],g=b[Symbol.iterator];if("function"==typeof g)for(b=g.call(b);!(g=b.next()).done;)c.push(d.call(e,g.value));else{g=b.length;for(var h=0;h<g;h++)c.push(d.call(e,b[h]))}return c}});la("Array.prototype.find",function(b){return b?b:function(b,d){return Ca(this,b,d).Kd}});
la("String.prototype.startsWith",function(b){return b?b:function(b,d){for(var c=Ea(this,b,"startsWith"),f=c.length,g=b.length,h=Math.max(0,Math.min(d|0,c.length)),k=0;k<g&&h<f;)if(c[h++]!=b[k++])return!1;return k>=g}});var Fa=this;Fa.a=!0;function y(b,c){var d=b.split("."),e=Fa;d[0]in e||!e.execScript||e.execScript("var "+d[0]);for(var f;d.length&&(f=d.shift());)d.length||void 0===c?e[f]?e=e[f]:e=e[f]={}:e[f]=c}
function Ga(b,c){function d(){}d.prototype=c.prototype;b.$f=c.prototype;b.prototype=new d;b.prototype.constructor=b;b.Wf=function(b,d,g){return c.prototype[d].apply(b,Array.prototype.slice.call(arguments,2))}};/*

 Copyright 2016 Google Inc.

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
*/
function Ha(b){this.c=Math.exp(Math.log(.5)/b);this.b=this.a=0}function Ia(b,c,d){var e=Math.pow(b.c,c);d=d*(1-e)+e*b.a;isNaN(d)||(b.a=d,b.b+=c)}function Ja(b){return b.a/(1-Math.pow(b.c,b.b))};function La(){this.b=new Ha(2);this.c=new Ha(5);this.a=0}La.prototype.getBandwidthEstimate=function(b){return 128E3>this.a?b:Math.min(Ja(this.b),Ja(this.c))};function Ma(){}function Na(){}function Oa(){}window.console&&window.console.log.bind&&(Na=console.warn.bind(console),Ma=console.error.bind(console));var Pa=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#(.*))?$/;function Qa(b){var c;b instanceof Qa?(Ra(this,b.ka),this.La=b.La,this.pa=b.pa,Sa(this,b.Za),this.da=b.da,Ta(this,b.a.clone()),this.Ea=b.Ea):b&&(c=String(b).match(Pa))?(Ra(this,c[1]||"",!0),this.La=Ua(c[2]||""),this.pa=Ua(c[3]||"",!0),Sa(this,c[4]),this.da=Ua(c[5]||"",!0),Ta(this,c[6]||"",!0),this.Ea=Ua(c[7]||"")):this.a=new Va(null)}n=Qa.prototype;n.ka="";n.La="";n.pa="";n.Za=null;n.da="";n.Ea="";
n.toString=function(){var b=[],c=this.ka;c&&b.push(Wa(c,$a,!0),":");if(c=this.pa){b.push("//");var d=this.La;d&&b.push(Wa(d,$a,!0),"@");b.push(encodeURIComponent(c).replace(/%25([0-9a-fA-F]{2})/g,"%$1"));c=this.Za;null!=c&&b.push(":",String(c))}if(c=this.da)this.pa&&"/"!=c.charAt(0)&&b.push("/"),b.push(Wa(c,"/"==c.charAt(0)?ab:bb,!0));(c=this.a.toString())&&b.push("?",c);(c=this.Ea)&&b.push("#",Wa(c,cb));return b.join("")};
n.resolve=function(b){var c=this.clone();"data"===c.ka&&(c=new Qa);var d=!!b.ka;d?Ra(c,b.ka):d=!!b.La;d?c.La=b.La:d=!!b.pa;d?c.pa=b.pa:d=null!=b.Za;var e=b.da;if(d)Sa(c,b.Za);else if(d=!!b.da){if("/"!=e.charAt(0))if(this.pa&&!this.da)e="/"+e;else{var f=c.da.lastIndexOf("/");-1!=f&&(e=c.da.substr(0,f+1)+e)}if(".."==e||"."==e)e="";else if(-1!=e.indexOf("./")||-1!=e.indexOf("/.")){f=0==e.lastIndexOf("/",0);e=e.split("/");for(var g=[],h=0;h<e.length;){var k=e[h++];"."==k?f&&h==e.length&&g.push(""):".."==
k?((1<g.length||1==g.length&&""!=g[0])&&g.pop(),f&&h==e.length&&g.push("")):(g.push(k),f=!0)}e=g.join("/")}}d?c.da=e:d=""!==b.a.toString();d?Ta(c,b.a.clone()):d=!!b.Ea;d&&(c.Ea=b.Ea);return c};n.clone=function(){return new Qa(this)};function Ra(b,c,d){b.ka=d?Ua(c,!0):c;b.ka&&(b.ka=b.ka.replace(/:$/,""))}function Sa(b,c){if(c){c=Number(c);if(isNaN(c)||0>c)throw Error("Bad port number "+c);b.Za=c}else b.Za=null}function Ta(b,c,d){c instanceof Va?b.a=c:(d||(c=Wa(c,db)),b.a=new Va(c))}
function Ua(b,c){return b?c?decodeURI(b):decodeURIComponent(b):""}function Wa(b,c,d){return"string"==typeof b?(b=encodeURI(b).replace(c,eb),d&&(b=b.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),b):null}function eb(b){b=b.charCodeAt(0);return"%"+(b>>4&15).toString(16)+(b&15).toString(16)}var $a=/[#\/\?@]/g,bb=/[#\?:]/g,ab=/[#\?]/g,db=/[#\?@]/g,cb=/#/g;function Va(b){this.a=b||null}n=Va.prototype;n.ca=null;n.Fb=null;
n.add=function(b,c){if(!this.ca&&(this.ca={},this.Fb=0,this.a))for(var d=this.a.split("&"),e=0;e<d.length;e++){var f=d[e].indexOf("="),g=null;if(0<=f){var h=d[e].substring(0,f);g=d[e].substring(f+1)}else h=d[e];h=decodeURIComponent(h.replace(/\+/g," "));g=g||"";this.add(h,decodeURIComponent(g.replace(/\+/g," ")))}this.a=null;(d=this.ca.hasOwnProperty(b)&&this.ca[b])||(this.ca[b]=d=[]);d.push(c);this.Fb++;return this};
n.toString=function(){if(this.a)return this.a;if(!this.ca)return"";var b=[],c;for(c in this.ca)for(var d=encodeURIComponent(c),e=this.ca[c],f=0;f<e.length;f++){var g=d;""!==e[f]&&(g+="="+encodeURIComponent(e[f]));b.push(g)}return this.a=b.join("&")};n.clone=function(){var b=new Va;b.a=this.a;if(this.ca){var c={},d;for(d in this.ca)c[d]=this.ca[d].concat();b.ca=c;b.Fb=this.Fb}return b};function z(){var b,c,d=new Promise(function(d,f){b=d;c=f});d.resolve=b;d.reject=c;return d}z.prototype.resolve=function(){};z.prototype.reject=function(){};function fb(b,c){var d=gb();this.i=null==b.maxAttempts?d.maxAttempts:b.maxAttempts;this.f=null==b.baseDelay?d.baseDelay:b.baseDelay;this.h=null==b.fuzzFactor?d.fuzzFactor:b.fuzzFactor;this.g=null==b.backoffFactor?d.backoffFactor:b.backoffFactor;this.a=0;this.b=this.f;if(this.c=void 0===c?!1:c)this.a=1}function ib(b){if(b.a>=b.i)if(b.c)b.a=1,b.b=b.f;else return Promise.reject();var c=new z;b.a?(window.setTimeout(c.resolve,b.b*(1+(2*Math.random()-1)*b.h)),b.b*=b.g):c.resolve();b.a++;return c}
function gb(){return{maxAttempts:2,baseDelay:1E3,backoffFactor:2,fuzzFactor:.5,timeout:0}};function B(b,c,d,e){for(var f=[],g=3;g<arguments.length;++g)f[g-3]=arguments[g];this.severity=b;this.category=c;this.code=d;this.data=f;this.handled=!1}y("shaka.util.Error",B);B.prototype.toString=function(){return"shaka.util.Error "+JSON.stringify(this,null,"  ")};B.Severity={RECOVERABLE:1,CRITICAL:2};B.Category={NETWORK:1,TEXT:2,MEDIA:3,MANIFEST:4,STREAMING:5,DRM:6,PLAYER:7,CAST:8,STORAGE:9};
B.Code={UNSUPPORTED_SCHEME:1E3,BAD_HTTP_STATUS:1001,HTTP_ERROR:1002,TIMEOUT:1003,MALFORMED_DATA_URI:1004,UNKNOWN_DATA_URI_ENCODING:1005,REQUEST_FILTER_ERROR:1006,RESPONSE_FILTER_ERROR:1007,MALFORMED_TEST_URI:1008,UNEXPECTED_TEST_REQUEST:1009,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,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,
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,UNPLAYABLE_PERIOD:4011,RESTRICTIONS_CANNOT_BE_MET:4012,NO_PERIODS:4014,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_COULD_NOT_GUESS_MIME_TYPE:4021,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,INVALID_STREAMS_CHOSEN:5005,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,LOAD_INTERRUPTED:7E3,OPERATION_ABORTED:7001,NO_VIDEO_ELEMENT:7002,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,STORE_ALREADY_IN_PROGRESS:9006,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};function C(b,c){this.promise=b;this.b=c;this.a=!1}y("shaka.util.AbortableOperation",C);function jb(b){return new C(Promise.reject(b),function(){return Promise.resolve()})}C.failed=jb;function kb(){var b=Promise.reject(new B(2,7,7001));b["catch"](function(){});return new C(b,function(){return Promise.resolve()})}C.aborted=kb;function lb(b){return new C(Promise.resolve(b),function(){return Promise.resolve()})}C.completed=lb;
function mb(b){return new C(b,function(){return b["catch"](function(){})})}C.notAbortable=mb;C.prototype.abort=function(){this.a=!0;return this.b()};C.prototype.abort=C.prototype.abort;function nb(b){return new C(Promise.all(b.map(function(b){return b.promise})),function(){return Promise.all(b.map(function(b){return b.abort()}))})}C.all=nb;C.prototype["finally"]=function(b){this.promise.then(function(){return b(!0)},function(){return b(!1)});return this};C.prototype["finally"]=C.prototype["finally"];
C.prototype.Z=function(b,c){function d(){f.reject(new B(2,7,7001));return e.abort()}var e=this,f=new z;this.promise.then(function(c){e.a?f.reject(new B(2,7,7001)):b?d=ob(b,c,f):f.resolve(c)},function(b){c?d=ob(c,b,f):f.reject(b)});return new C(f,function(){return d()})};C.prototype.chain=C.prototype.Z;
function ob(b,c,d){try{var e=b(c);if(e&&e.promise&&e.abort)return d.resolve(e.promise),function(){return e.abort()};d.resolve(e);return function(){return Promise.resolve(e).then(function(){})["catch"](function(){})}}catch(f){return d.reject(f),function(){return Promise.resolve()}}};function D(b,c){c=void 0===c?{}:c;for(var d in c)this[d]=c[d];this.defaultPrevented=this.cancelable=this.bubbles=!1;this.timeStamp=window.performance&&window.performance.now?window.performance.now():Date.now();this.type=b;this.isTrusted=!1;this.target=this.currentTarget=null;this.a=!1}D.prototype.preventDefault=function(){this.cancelable&&(this.defaultPrevented=!0)};D.prototype.stopImmediatePropagation=function(){this.a=!0};D.prototype.stopPropagation=function(){};function pb(){this.a={}}n=pb.prototype;n.push=function(b,c){this.a.hasOwnProperty(b)?this.a[b].push(c):this.a[b]=[c]};n.get=function(b){return(b=this.a[b])?b.slice():null};n.getAll=function(){var b=[],c;for(c in this.a)b.push.apply(b,this.a[c]);return b};n.remove=function(b,c){var d=this.a[b];if(d)for(var e=0;e<d.length;++e)d[e]==c&&(d.splice(e,1),--e)};n.forEach=function(b){for(var c in this.a)b(c,this.a[c])};function E(){this.Wb=new pb;this.yb=this}E.prototype.addEventListener=function(b,c){this.Wb.push(b,c)};E.prototype.removeEventListener=function(b,c){this.Wb.remove(b,c)};E.prototype.dispatchEvent=function(b){for(var c=this.Wb.get(b.type)||[],d=0;d<c.length;++d){b.target=this.yb;b.currentTarget=this.yb;var e=c[d];try{e.handleEvent?e.handleEvent(b):e.call(this,b)}catch(f){}if(b.a)break}return b.defaultPrevented};function qb(b){function c(b){switch(typeof b){case "undefined":case "boolean":case "number":case "string":case "symbol":case "function":return b;default:if(!b||b.buffer&&b.buffer.constructor==ArrayBuffer)return b;if(d.has(b))return null;var e=b.constructor==Array;if(b.constructor!=Object&&!e)return null;d.add(b);var g=e?[]:{},h;for(h in b)g[h]=c(b[h]);e&&(g.length=b.length);return g}}var d=new Set;return c(b)};function rb(b,c){return"number"===typeof b&&"number"===typeof c&&isNaN(b)&&isNaN(c)?!0:b===c}function sb(b,c){var d=b.indexOf(c);-1<d&&b.splice(d,1)}function ub(b,c){var d=0;b.forEach(function(b){d+=c(b)?1:0});return d}
function vb(b,c,d){d||(d=rb);if(b.length!=c.length)return!1;c=c.slice();var e={};b=q(b);for(var f=b.next();!f.done;e={item:e.item},f=b.next()){e.item=f.value;f=c.findIndex(function(b){return function(c){return d(b.item,c)}}(e));if(-1==f)return!1;c[f]=c[c.length-1];c.pop()}return 0==c.length};function wb(){this.a=[]}function xb(b,c){b.a.push(c["finally"](function(){sb(b.a,c)}))}wb.prototype.destroy=function(){var b=[];this.a.forEach(function(c){c.promise["catch"](function(){});b.push(c.abort())});this.a=[];return Promise.all(b)};function F(b){E.call(this);this.f=!1;this.g=new wb;this.a=new Set;this.b=new Set;this.c=b||null}Ga(F,E);y("shaka.net.NetworkingEngine",F);F.RequestType={MANIFEST:0,SEGMENT:1,LICENSE:2,APP:3,TIMING:4};F.PluginPriority={FALLBACK:1,PREFERRED:2,APPLICATION:3};var yb={};function zb(b,c,d){d=d||3;var e=yb[b];if(!e||d>=e.priority)yb[b]={priority:d,gf:c}}F.registerScheme=zb;F.unregisterScheme=function(b){delete yb[b]};F.prototype.hf=function(b){this.a.add(b)};F.prototype.registerRequestFilter=F.prototype.hf;
F.prototype.Lf=function(b){this.a["delete"](b)};F.prototype.unregisterRequestFilter=F.prototype.Lf;F.prototype.Zd=function(){this.a.clear()};F.prototype.clearAllRequestFilters=F.prototype.Zd;F.prototype.jf=function(b){this.b.add(b)};F.prototype.registerResponseFilter=F.prototype.jf;F.prototype.Mf=function(b){this.b["delete"](b)};F.prototype.unregisterResponseFilter=F.prototype.Mf;F.prototype.$d=function(){this.b.clear()};F.prototype.clearAllResponseFilters=F.prototype.$d;
function Ab(b,c){return{uris:b,method:"GET",body:null,headers:{},allowCrossSiteCredentials:!1,retryParameters:c,licenseRequestType:null}}F.prototype.destroy=function(){this.f=!0;this.a.clear();this.b.clear();return this.g.destroy()};F.prototype.destroy=F.prototype.destroy;
F.prototype.request=function(b,c){var d=this;if(this.f)return kb();c.method=c.method||"GET";c.headers=c.headers||{};c.retryParameters=c.retryParameters?qb(c.retryParameters):gb();c.uris=qb(c.uris);var e=Bb(this,b,c),f=e.Z(function(){return Cb(d,b,c,new fb(c.retryParameters,!1),0,null)}),g=f.Z(function(c){return Db(d,b,c)}),h=Date.now(),k=0;e.promise.then(function(){k=Date.now()-h},function(){});var l=0;f.promise.then(function(){l=Date.now()},function(){});e=g.Z(function(c){var e=Date.now()-l,f=c.response;
f.timeMs+=k;f.timeMs+=e;c.ze||!d.c||f.fromCache||1!=b||d.c(f.timeMs,f.data.byteLength);return f},function(b){b&&(b.severity=2);throw b;});xb(this.g,e);return e};F.prototype.request=F.prototype.request;function Bb(b,c,d){var e=lb(void 0),f={};b=q(b.a);for(var g=b.next();!g.done;f={wc:f.wc},g=b.next())f.wc=g.value,e=e.Z(function(b){return function(){return b.wc(c,d)}}(f));return e.Z(void 0,function(b){if(b&&7001==b.code)throw b;throw new B(2,1,1006,b);})}
function Cb(b,c,d,e,f,g){var h=new Qa(d.uris[f]),k=h.ka,l=!1;k||(k=location.protocol,k=k.slice(0,-1),Ra(h,k),d.uris[f]=h.toString());var m=(k=yb[k])?k.gf:null;if(!m)return jb(new B(2,1,1E3,h));var p;return mb(ib(e)).Z(function(){if(b.f)return kb();p=Date.now();return m(d.uris[f],d,c,function(d,e){b.c&&1==c&&(b.c(d,e),l=!0)})}).Z(function(b){void 0==b.timeMs&&(b.timeMs=Date.now()-p);return{response:b,ze:l}},function(h){if(h&&7001==h.code)throw h;if(b.f)return kb();if(h&&1==h.severity)return b.dispatchEvent(new D("retry",
{error:h instanceof B?h:null})),f=(f+1)%d.uris.length,Cb(b,c,d,e,f,h);throw h||g;})}function Db(b,c,d){var e=lb(void 0);b=q(b.b);for(var f=b.next();!f.done;f=b.next())e=e.Z(f.value.bind(null,c,d.response));return e.Z(function(){return d},function(b){if(b&&7001==b.code)throw b;var c=2;b instanceof B&&(c=b.severity);throw new B(c,1,1007,b);})};function Eb(){this.a=new pb}Eb.prototype.L=function(){Fb(this);this.a=null};function G(b,c,d,e){b.a&&(c=new Gb(c,d,e),b.a.push(d,c))}function Hb(b,c,d,e){G(b,c,d,function(b){this.ua(c,d);e(b)}.bind(b))}Eb.prototype.ua=function(b,c){if(this.a)for(var d=this.a.get(c)||[],e=0;e<d.length;++e){var f=d[e];f.target==b&&(f.ua(),this.a.remove(c,f))}};function Fb(b){if(b.a){for(var c=b.a.getAll(),d=0;d<c.length;++d)c[d].ua();b.a.a={}}}
function Gb(b,c,d){this.target=b;this.type=c;this.a=d;this.target.addEventListener(c,d,!1)}Gb.prototype.ua=function(){this.target.removeEventListener(this.type,this.a,!1);this.a=this.target=null};function Ib(b,c){for(var d=[],e=q(b),f=e.next();!f.done;f=e.next())d.push(c(f.value));return d}function Jb(b,c){for(var d=q(b),e=d.next();!e.done;e=d.next())if(!c(e.value))return!1;return!0};function Kb(b){var c=new Map;Object.keys(b).forEach(function(d){c.set(d,b[d])});return c}function Lb(b){var c={};b.forEach(function(b,e){c[e]=b});return c};function Mb(b,c){var d=b;c&&(d+='; codecs="'+c+'"');return d}function Nb(b){var c=[b.mimeType];Ob.forEach(function(d,e){var f=b[e];f&&c.push(d+'="'+f+'"')});return c.join(";")}function Pb(b){b=b.split(".");var c=b[0];b.pop();return[c,b.join(".")]}var Ob=(new Map).set("codecs","codecs").set("frameRate","framerate").set("bandwidth","bitrate").set("width","width").set("height","height").set("channelsCount","channels");function Qb(b){return(navigator.userAgent||"").includes(b)};function Rb(b){if(!b)return"";b=new Uint8Array(b);239==b[0]&&187==b[1]&&191==b[2]&&(b=b.subarray(3));b=escape(Sb(b));try{return decodeURIComponent(b)}catch(c){throw new B(2,2,2004);}}y("shaka.util.StringUtils.fromUTF8",Rb);
function Ub(b,c,d){if(!b)return"";if(!d&&0!=b.byteLength%2)throw new B(2,2,2004);if(b instanceof ArrayBuffer)var e=b;else d=new Uint8Array(b.byteLength),d.set(new Uint8Array(b)),e=d.buffer;b=Math.floor(b.byteLength/2);d=new Uint16Array(b);e=new DataView(e);for(var f=0;f<b;f++)d[f]=e.getUint16(2*f,c);return Sb(d)}y("shaka.util.StringUtils.fromUTF16",Ub);
function Vb(b){var c=new Uint8Array(b);if(239==c[0]&&187==c[1]&&191==c[2])return Rb(c);if(254==c[0]&&255==c[1])return Ub(c.subarray(2),!1);if(255==c[0]&&254==c[1])return Ub(c.subarray(2),!0);var d=function(b,c){return b.byteLength<=c||32<=b[c]&&126>=b[c]}.bind(null,c);if(0==c[0]&&0==c[2])return Ub(b,!1);if(0==c[1]&&0==c[3])return Ub(b,!0);if(d(0)&&d(1)&&d(2)&&d(3))return Rb(b);throw new B(2,2,2003);}y("shaka.util.StringUtils.fromBytesAutoDetect",Vb);
function Wb(b){b=encodeURIComponent(b);b=unescape(b);for(var c=new Uint8Array(b.length),d=0;d<b.length;++d)c[d]=b.charCodeAt(d);return c.buffer}y("shaka.util.StringUtils.toUTF8",Wb);function Sb(b){for(var c="",d=0;d<b.length;d+=16E3)c+=String.fromCharCode.apply(null,b.subarray(d,d+16E3));return c};function H(b){this.b=b;this.a=null}y("shaka.util.Timer",H);H.prototype.Jf=function(){null!=this.a&&(clearTimeout(this.a),this.a=null);this.b()};H.prototype.tick=H.prototype.Jf;H.prototype.start=function(b,c){function d(){e.b();e.a=c?setTimeout(d,f):null}var e=this,f=1E3*b;null!=this.a&&clearTimeout(this.a);this.a=setTimeout(d,f)};H.prototype.start=H.prototype.start;H.prototype.stop=function(){null!=this.a&&clearTimeout(this.a);this.a=null};H.prototype.stop=H.prototype.stop;function Xb(b,c){var d=Sb(b);c=void 0==c?!0:c;d=window.btoa(d).replace(/\+/g,"-").replace(/\//g,"_");return c?d:d.replace(/=*$/,"")}y("shaka.util.Uint8ArrayUtils.toBase64",Xb);function Yb(b){b=window.atob(b.replace(/-/g,"+").replace(/_/g,"/"));for(var c=new Uint8Array(b.length),d=0;d<b.length;++d)c[d]=b.charCodeAt(d);return c}y("shaka.util.Uint8ArrayUtils.fromBase64",Yb);function Zb(b){for(var c=new Uint8Array(b.length/2),d=0;d<b.length;d+=2)c[d/2]=window.parseInt(b.substr(d,2),16);return c}
y("shaka.util.Uint8ArrayUtils.fromHex",Zb);function $b(b){for(var c="",d=0;d<b.length;++d){var e=b[d].toString(16);1==e.length&&(e="0"+e);c+=e}return c}y("shaka.util.Uint8ArrayUtils.toHex",$b);function ac(b,c){if(!b&&!c)return!0;if(!b||!c||b.length!=c.length)return!1;for(var d=0;d<b.length;++d)if(b[d]!=c[d])return!1;return!0}y("shaka.util.Uint8ArrayUtils.equal",ac);
function bc(b){for(var c=[],d=0;d<arguments.length;++d)c[d]=arguments[d];for(var e=d=0;e<c.length;++e)d+=c[e].length;d=new Uint8Array(d);for(var f=e=0;f<c.length;++f)d.set(c[f],e),e+=c[f].length;return d}y("shaka.util.Uint8ArrayUtils.concat",bc);function cc(b){var c=this;this.v=b;this.s=new Set;this.m=this.h=null;this.R=!1;this.a=null;this.i=new Eb;this.b=new Map;this.o=[];this.l=new z;this.f=null;this.g=function(d){c.l.reject(d);b.onError(d)};this.va=new Map;this.$=new Map;this.P=new H(function(){return dc(c)});this.c=!1;this.na=new z;this.A=!1;this.D=[];this.oa=!1;this.M=new H(function(){return ec(c)});this.M.start(1,!0);this.l["catch"](function(){})}n=cc.prototype;
n.destroy=function(){var b=this;return t(function d(){return v(d,function(d){switch(d.j){case 1:if(b.c)return u(d,b.na,0);b.c=!0;return u(d,fc(b),4);case 4:b.na.resolve(),d.B(0)}})})};
function fc(b){return t(function d(){var e;return v(d,function(d){switch(d.j){case 1:return b.i.L(),b.i=null,b.l.reject(),b.M.stop(),b.M=null,b.P.stop(),b.P=null,e=Array.from(b.b.keys()),b.b.clear(),u(d,Promise.all(e.map(function(b){return Promise.resolve().then(function(){return t(function k(){return v(k,function(d){switch(d.j){case 1:return qa(d,2),u(d,gc(b),4);case 4:sa(d,0);break;case 2:ta(d),d.j=0}})})})})),2);case 2:if(!b.m){d.B(3);break}qa(d,4);return u(d,b.m.setMediaKeys(null),6);case 6:sa(d,
5);break;case 4:ta(d);case 5:b.m=null;case 3:b.a=null,b.s.clear(),b.h=null,b.o=[],b.f=null,b.g=null,b.v=null,d.j=0}})})}n.configure=function(b){this.f=b};function hc(b,c,d){b.o=[];b.A=d;return ic(b,c)}function jc(b,c,d){b.o=d;b.A=0<d.length;return ic(b,c)}
function kc(b,c,d,e,f,g){var h=new Map;h.set(c,{audioCapabilities:f,videoCapabilities:g,distinctiveIdentifier:"optional",persistentState:"required",sessionTypes:["persistent-license"],label:c,drmInfos:[{keySystem:c,licenseServerUri:d,distinctiveIdentifierRequired:!1,persistentStateRequired:!0,audioRobustness:"",videoRobustness:"",serverCertificate:e,initData:null,keyIds:null}]});return lc(b,h)}
function ic(b,c){var d=c.some(function(b){return 0<b.drmInfos.length});if(!d){var e=Kb(b.f.servers);mc(c,e)}var f=nc(b);if(f){var g=q(c);for(e=g.next();!e.done;e=g.next())e.value.drmInfos=[f]}f=q(c);for(e=f.next();!e.done;e=f.next())for(e=q(e.value.drmInfos),g=e.next();!g.done;g=e.next())oc(g.value,Kb(b.f.servers),Kb(b.f.advanced||{}));e=pc(b,c);if(!e.size)return b.R=!0,Promise.resolve();e=lc(b,e);return d?e:e["catch"](function(){})}
n.Cb=function(b){var c=this;if(!this.h)return Hb(this.i,b,"encrypted",function(){c.g(new B(2,6,6010))}),Promise.resolve();this.m=b;Hb(this.i,this.m,"play",function(){for(var b=0;b<c.D.length;b++)qc(c,c.D[b]);c.oa=!0;c.D=[]});b=this.m.setMediaKeys(this.h);b=b["catch"](function(b){return Promise.reject(new B(2,6,6003,b.message))});var d=rc(this);return Promise.all([b,d]).then(function(){if(c.c)return Promise.reject();sc(c);c.a.initData.length||c.o.length||G(c.i,c.m,"encrypted",function(b){return tc(c,
b.initDataType,new Uint8Array(b.initData))})})["catch"](function(b){if(!c.c)return Promise.reject(b)})};function rc(b){return t(function d(){var e;return v(d,function(d){switch(d.j){case 1:if(!(b.h&&b.a&&b.a.serverCertificate&&b.a.serverCertificate.length)){d.B(0);break}qa(d,3);return u(d,b.h.setServerCertificate(b.a.serverCertificate),5);case 5:sa(d,0);break;case 3:return e=ta(d),d["return"](Promise.reject(new B(2,6,6004,e.message)))}})})}
function uc(b,c){return t(function e(){var f,g,h;return v(e,function(e){switch(e.j){case 1:return u(e,vc(b,c),2);case 2:f=e.u;if(!f)return e["return"]();g=[];if(h=b.b.get(f))h.ma=new z,g.push(h.ma);g.push(f.remove());return u(e,Promise.all(g),0)}})})}function sc(b){var c=b.a?b.a.initData:[];c.forEach(function(c){return wc(b,c.initDataType,c.initData)});b.o.forEach(function(c){return vc(b,c)});c.length||b.o.length||b.l.resolve();return b.l}
function tc(b,c,d){var e=b.b.values();e=q(e);for(var f=e.next();!f.done;f=e.next())if(ac(d,f.value.initData))return;wc(b,c,d)}n.keySystem=function(){return this.a?this.a.keySystem:""};function xc(b,c){return Qb("Edge/")?!0:b.s.has(c)}function yc(b){b=b.b.keys();b=Ib(b,function(b){return b.sessionId});return Array.from(b)}n.Lb=function(){var b=Infinity,c=this.b.keys();c=q(c);for(var d=c.next();!d.done;d=c.next())d=d.value,isNaN(d.expiration)||(b=Math.min(b,d.expiration));return b};
function pc(b,c){for(var d=new Set,e=q(c),f=e.next();!f.done;f=e.next()){var g=q(f.value.drmInfos);for(f=g.next();!f.done;f=g.next())d.add(f.value)}e=q(d);for(f=e.next();!f.done;f=e.next())oc(f.value,Kb(b.f.servers),Kb(b.f.advanced||{}));g=b.A?"required":"optional";var h=b.A?["persistent-license"]:["temporary"];e=new Map;d=q(d);for(f=d.next();!f.done;f=d.next())f=f.value,e.set(f.keySystem,{audioCapabilities:[],videoCapabilities:[],distinctiveIdentifier:"optional",persistentState:g,sessionTypes:h,
label:f.keySystem,drmInfos:[]});d=q(c);for(f=d.next();!f.done;f=d.next()){f=f.value;g=f.audio;h=f.video;var k=g?Mb(g.mimeType,g.codecs):"",l=h?Mb(h.mimeType,h.codecs):"",m=q(f.drmInfos);for(f=m.next();!f.done;f=m.next()){f=f.value;var p=e.get(f.keySystem);p.drmInfos.push(f);f.distinctiveIdentifierRequired&&(p.distinctiveIdentifier="required");f.persistentStateRequired&&(p.persistentState="required");g&&p.audioCapabilities.push({robustness:f.audioRobustness||"",contentType:k});h&&p.videoCapabilities.push({robustness:f.videoRobustness||
"",contentType:l})}}return e}
function lc(b,c){if(1==c.size&&c.has(""))return Promise.reject(new B(2,6,6E3));for(var d=q(c.values()),e=d.next();!e.done;e=d.next())e=e.value,0==e.audioCapabilities.length&&delete e.audioCapabilities,0==e.videoCapabilities.length&&delete e.videoCapabilities;var f=d=new z;[!0,!1].forEach(function(b){var d=this;c.forEach(function(c,e){c.drmInfos.some(function(b){return!!b.licenseServerUri})==b&&(f=f["catch"](function(){if(!this.c)return navigator.requestMediaKeySystemAccess(e,[c])}.bind(d)))})}.bind(b));
f=f["catch"](function(){return Promise.reject(new B(2,6,6001))});f=f.then(function(b){if(this.c)return Promise.reject();this.s.clear();var d=b.getConfiguration(),e=d.videoCapabilities||[],f=q(d.audioCapabilities||[]);for(d=f.next();!d.done;d=f.next())this.s.add(d.value.contentType);e=q(e);for(d=e.next();!d.done;d=e.next())this.s.add(d.value.contentType);e=b.keySystem;d=c.get(b.keySystem);f=[];var g=[],p=[],r=[];zc(d.drmInfos,f,g,p,r);this.a={keySystem:e,licenseServerUri:f[0],distinctiveIdentifierRequired:"required"==
d.distinctiveIdentifier,persistentStateRequired:"required"==d.persistentState,audioRobustness:d.audioCapabilities?d.audioCapabilities[0].robustness:"",videoRobustness:d.videoCapabilities?d.videoCapabilities[0].robustness:"",serverCertificate:g[0],initData:p,keyIds:r};return this.a.licenseServerUri?b.createMediaKeys():Promise.reject(new B(2,6,6012))}.bind(b)).then(function(b){if(this.c)return Promise.reject();this.h=b;this.R=!0}.bind(b))["catch"](function(b){if(!this.c)return this.a=null,this.s.clear(),
b instanceof B?Promise.reject(b):Promise.reject(new B(2,6,6002,b.message))}.bind(b));d.reject();return f}
function nc(b){b=Kb(b.f.clearKeys);if(0==b.size)return null;var c=[],d=[];b.forEach(function(b,e){var f=Zb(e),g=Zb(b);f={kty:"oct",kid:Xb(f,!1),k:Xb(g,!1)};c.push(f);d.push(f.kid)});b=JSON.stringify({keys:c});var e=JSON.stringify({kids:d});e=[{initData:new Uint8Array(Wb(e)),initDataType:"keyids"}];return{keySystem:"org.w3.clearkey",licenseServerUri:"data:application/json;base64,"+window.btoa(b),distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,
initData:e,keyIds:[]}}
function vc(b,c){try{var d=b.h.createSession("persistent-license")}catch(g){var e=new B(2,6,6005,g.message);b.g(e);return Promise.reject(e)}G(b.i,d,"message",b.qd.bind(b));G(b.i,d,"keystatuseschange",b.md.bind(b));var f={initData:null,loaded:!1,pc:Infinity,ma:null};b.b.set(d,f);return d.load(c).then(function(b){if(this.c)return Promise.reject();if(b)return f.loaded=!0,Ac(this)&&this.l.resolve(),d;this.b["delete"](d);this.g(new B(2,6,6013))}.bind(b),function(b){this.c||(this.b["delete"](d),this.g(new B(2,
6,6005,b.message)))}.bind(b))}
function wc(b,c,d){try{var e=b.A?b.h.createSession("persistent-license"):b.h.createSession()}catch(f){b.g(new B(2,6,6005,f.message));return}G(b.i,e,"message",b.qd.bind(b));G(b.i,e,"keystatuseschange",b.md.bind(b));b.b.set(e,{initData:d,loaded:!1,pc:Infinity,ma:null});e.generateRequest(c,d.buffer)["catch"](function(c){if(!b.c){b.b["delete"](e);if(c.errorCode&&c.errorCode.systemCode){var d=c.errorCode.systemCode;0>d&&(d+=Math.pow(2,32));d="0x"+d.toString(16)}b.g(new B(2,6,6006,c.message,c,d))}})}
n.qd=function(b){this.f.delayLicenseRequestUntilPlayed&&this.m.paused&&!this.oa?this.D.push(b):qc(this,b)};
function qc(b,c){var d=c.target,e=b.b.get(d),f=b.a.licenseServerUri,g=b.f.advanced[b.a.keySystem];"individualization-request"==c.messageType&&g&&g.individualizationServer&&(f=g.individualizationServer);f=Ab([f],b.f.retryParameters);f.body=c.message;f.method="POST";f.licenseRequestType=c.messageType;"com.microsoft.playready"!=b.a.keySystem&&"com.chromecast.playready"!=b.a.keySystem||Bc(f);b.v.nb.request(2,f).promise.then(function(b){return this.c?Promise.reject():d.update(b.data).then(function(){var b=
this;this.v.onEvent(new D("drmsessionupdate"));e&&(e.ma&&e.ma.resolve(),Cc(Dc).then(function(){e.loaded=!0;Ac(b)&&b.l.resolve()}))}.bind(this))}.bind(b),function(b){this.c||(b=new B(2,6,6007,b),this.g(b),e&&e.ma&&e.ma.reject(b))}.bind(b))["catch"](function(b){this.c||(b=new B(2,6,6008,b.message),this.g(b),e&&e.ma&&e.ma.reject(b))}.bind(b))}
function Bc(b){var c=Ub(b.body,!0,!0);if(c.includes("PlayReadyKeyMessage")){c=(new DOMParser).parseFromString(c,"application/xml");for(var d=c.getElementsByTagName("HttpHeader"),e=0;e<d.length;++e)b.headers[d[e].querySelector("name").textContent]=d[e].querySelector("value").textContent;b.body=Yb(c.querySelector("Challenge").textContent).buffer}else b.headers["Content-Type"]="text/xml; charset=utf-8"}
n.md=function(b){b=b.target;var c=this.b.get(b),d=!1;b.keyStatuses.forEach(function(b,e){if("string"==typeof e){var f=e;e=b;b=f}if("com.microsoft.playready"==this.a.keySystem&&16==e.byteLength&&!Qb("Tizen")){f=new DataView(e);var g=f.getUint32(0,!0),l=f.getUint16(4,!0),m=f.getUint16(6,!0);f.setUint32(0,g,!1);f.setUint16(4,l,!1);f.setUint16(6,m,!1)}"com.microsoft.playready"==this.a.keySystem&&"status-pending"==b&&(b="usable");"status-pending"!=b&&(c.loaded=!0);"expired"==b&&(d=!0);f=$b(new Uint8Array(e));
this.va.set(f,b)}.bind(this));var e=b.expiration-Date.now();(0>e||d&&1E3>e)&&c&&!c.ma&&(this.b["delete"](b),b.close()["catch"](function(){}));Ac(this)&&(this.l.resolve(),this.P.start(Ec,!1))};function dc(b){var c=b.va,d=b.$;d.clear();c.forEach(function(b,c){return d.set(c,b)});c=Array.from(d.values());c.length&&c.every(function(b){return"expired"==b})&&b.g(new B(2,6,6014));b.v.qc(Lb(d))}
function Fc(){function b(b){return t(function h(){var c,f,m;return v(h,function(h){switch(h.j){case 1:return qa(h,2),u(h,navigator.requestMediaKeySystemAccess(b,d),4);case 4:return c=h.u,m=(f=c.getConfiguration().sessionTypes)?f.includes("persistent-license"):!1,Qb("Tizen 3")&&(m=!1),e.set(b,{persistentState:m}),u(h,c.createMediaKeys(),5);case 5:sa(h,0);break;case 2:ta(h),e.set(b,null),h.j=0}})})}var c=[{contentType:'video/mp4; codecs="avc1.42E01E"'},{contentType:'video/webm; codecs="vp8"'}],d=[{videoCapabilities:c,
persistentState:"required",sessionTypes:["persistent-license"]},{videoCapabilities:c}],e=new Map;c="org.w3.clearkey com.widevine.alpha com.microsoft.playready com.apple.fps.2_0 com.apple.fps.1_0 com.apple.fps com.adobe.primetime".split(" ").map(function(c){return b(c)});return Promise.all(c).then(function(){return Lb(e)})}
function Gc(b,c){var d=c.audio,e=c.video;if(d&&d.encrypted&&!xc(b,Mb(d.mimeType,d.codecs))||e&&e.encrypted&&!xc(b,Mb(e.mimeType,e.codecs)))return!1;var f=b.keySystem();return 0==c.drmInfos.length||c.drmInfos.some(function(b){return b.keySystem==f})}
function Hc(b,c){if(!b.length)return c;if(!c.length)return b;for(var d=[],e=0;e<b.length;e++)for(var f=0;f<c.length;f++)if(b[e].keySystem==c[f].keySystem){var g=b[e];f=c[f];var h=[];h=h.concat(g.initData||[]);h=h.concat(f.initData||[]);var k=[];k=k.concat(g.keyIds);k=k.concat(f.keyIds);d.push({keySystem:g.keySystem,licenseServerUri:g.licenseServerUri||f.licenseServerUri,distinctiveIdentifierRequired:g.distinctiveIdentifierRequired||f.distinctiveIdentifierRequired,persistentStateRequired:g.persistentStateRequired||
f.persistentStateRequired,videoRobustness:g.videoRobustness||f.videoRobustness,audioRobustness:g.audioRobustness||f.audioRobustness,serverCertificate:g.serverCertificate||f.serverCertificate,initData:h,keyIds:k});break}return d}function ec(b){b.b.forEach(function(c,d){var e=c.pc,f=d.expiration;isNaN(f)&&(f=Infinity);f!=e&&(b.v.onExpirationUpdated(d.sessionId,f),c.pc=f)})}function Ac(b){b=b.b.values();return Jb(b,function(b){return b.loaded})}
function Cc(b){return new Promise(function(c){return setTimeout(c,1E3*b)})}function mc(b,c){var d=[];c.forEach(function(b,c){d.push({keySystem:c,licenseServerUri:b,distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:[],keyIds:[]})});for(var e=q(b),f=e.next();!f.done;f=e.next())f.value.drmInfos=d}
function zc(b,c,d,e,f){b.forEach(function(b){c.includes(b.licenseServerUri)||c.push(b.licenseServerUri);b.serverCertificate&&(d.some(function(c){return ac(c,b.serverCertificate)})||d.push(b.serverCertificate));b.initData&&b.initData.forEach(function(b){e.some(function(c){return c.keyId&&c.keyId==b.keyId?!0:c.initDataType==b.initDataType&&ac(c.initData,b.initData)})||e.push(b)});if(b.keyIds)for(var g=0;g<b.keyIds.length;++g)f.includes(b.keyIds[g])||f.push(b.keyIds[g])})}
function oc(b,c,d){var e=b.keySystem;if(e){if(c=c.get(e))b.licenseServerUri=c;b.keyIds||(b.keyIds=[]);if(d=d.get(e))b.distinctiveIdentifierRequired||(b.distinctiveIdentifierRequired=d.distinctiveIdentifierRequired),b.persistentStateRequired||(b.persistentStateRequired=d.persistentStateRequired),b.videoRobustness||(b.videoRobustness=d.videoRobustness),b.audioRobustness||(b.audioRobustness=d.audioRobustness),b.serverCertificate||(b.serverCertificate=d.serverCertificate);window.cast&&window.cast.__platform__&&
"com.microsoft.playready"==b.keySystem&&(b.keySystem="com.chromecast.playready")}}function gc(b){return t(function d(){var e,f;return v(d,function(d){switch(d.j){case 1:return e=b.close().then(function(){return!0}),f=Cc(Ic).then(function(){return!1}),u(d,Promise.race([e,f]),2);case 2:d.j=0}})})}var Ic=1,Dc=5,Ec=.5;function Jc(){this.a=new muxjs.mp4.CaptionParser;this.g=[];this.f={}}Jc.prototype.init=function(b){var c=muxjs.mp4.probe;b=new Uint8Array(b);this.g=c.videoTrackIds(b);this.f=c.timescale(b);this.a.init()};Jc.prototype.b=function(b,c){var d=new Uint8Array(b);(d=this.a.parse(d,this.g,this.f))&&d.captions&&c(d.captions);this.a.clearParsedCaptions()};Jc.prototype.c=function(){this.a.resetCaptionStream()};function Kc(){}Kc.prototype.init=function(){};Kc.prototype.b=function(){};Kc.prototype.c=function(){};function Lc(b){return!b||1==b.length&&1E-6>b.end(0)-b.start(0)?null:b.length?b.end(b.length-1):null}function Qc(b,c,d){d=void 0===d?0:d;return!b||!b.length||1==b.length&&1E-6>b.end(0)-b.start(0)||c>b.end(b.length-1)?!1:c+d>=b.start(0)}function Rc(b,c){if(!b||!b.length||1==b.length&&1E-6>b.end(0)-b.start(0))return 0;for(var d=0,e=b.length-1;0<=e&&b.end(e)>c;--e)d+=b.end(e)-Math.max(b.start(e),c);return d}
function Sc(b){if(!b)return[];for(var c=[],d=0;d<b.length;d++)c.push({start:b.start(d),end:b.end(d)});return c};var I={ae:function(b,c){return b.reduce(function(b,c,f){return c["catch"](b.bind(null,f))}.bind(null,c),Promise.reject())},Xb:function(b,c){return b.concat(c)},ob:function(){},wa:function(b){return null!=b}};function Tc(b,c){if(0==c.length)return b;var d=c.map(function(b){return new Qa(b)});return b.map(function(b){return new Qa(b)}).map(function(b){return d.map(b.resolve.bind(b))}).reduce(I.Xb,[]).map(function(b){return b.toString()})}function Uc(b,c){return{keySystem:b,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:c||[],keyIds:[]}}var Vc={Rd:"video",Md:"audio",Oa:"text",Tf:"application"},Wc=1/15;function Xc(){this.a=new muxjs.mp4.Transmuxer({keepOriginalTimestamps:!0});this.b=null;this.g=[];this.c=[];this.f=!1;this.a.on("data",this.i.bind(this));this.a.on("done",this.h.bind(this))}Xc.prototype.destroy=function(){this.a.dispose();this.a=null;return Promise.resolve()};function Yc(b,c){return window.muxjs&&"mp2t"==b.split(";")[0].split("/")[1]?c?MediaSource.isTypeSupported(Zc(c,b)):MediaSource.isTypeSupported(Zc("audio",b))||MediaSource.isTypeSupported(Zc("video",b)):!1}
function Zc(b,c){var d=c.replace("mp2t","mp4");"audio"==b&&(d=d.replace("video","audio"));var e=/avc1\.(66|77|100)\.(\d+)/.exec(d);if(e){var f="avc1.",g=e[1],h=Number(e[2]);f=("66"==g?f+"4200":"77"==g?f+"4d00":f+"6400")+(h>>4).toString(16);f+=(h&15).toString(16);d=d.replace(e[0],f)}return d}function $c(b,c){b.f=!0;b.b=new z;b.g=[];b.c=[];var d=new Uint8Array(c);b.a.push(d);b.a.flush();b.f&&b.b.reject(new B(2,3,3018));return b.b}
Xc.prototype.i=function(b){this.c=b.captions;var c=new Uint8Array(b.data.byteLength+b.initSegment.byteLength);c.set(b.initSegment,0);c.set(b.data,b.initSegment.byteLength);this.g.push(c)};Xc.prototype.h=function(){var b={data:bc.apply(null,this.g),captions:this.c};this.b.resolve(b);this.f=!1};function ad(b){this.g=null;this.c=b;this.f=this.m=0;this.h=Infinity;this.b=this.a=null;this.l="";this.i=new Map}var bd={};y("shaka.text.TextEngine.registerParser",function(b,c){bd[b]=c});y("shaka.text.TextEngine.unregisterParser",function(b){delete bd[b]});function cd(b){return bd[b]||window.muxjs&&"application/cea-608"==b?!0:!1}ad.prototype.destroy=function(){this.c=this.g=null;this.i.clear();return Promise.resolve()};function dd(b,c){"application/cea-608"!=c&&(b.g=new bd[c])}
ad.prototype.ec=function(b){var c={periodStart:0,segmentStart:null,segmentEnd:0};try{return this.g.parseMedia(new Uint8Array(b),c)[0].startTime}catch(d){throw new B(2,2,2009,d);}};
function ed(b,c,d,e){return Promise.resolve().then(function(){if(this.g&&this.c)if(null==d||null==e)this.g.parseInit(new Uint8Array(c));else{var b={periodStart:this.m,segmentStart:d,segmentEnd:e};b=this.g.parseMedia(new Uint8Array(c),b).filter(function(b){return b.startTime>=this.f&&b.startTime<this.h}.bind(this));this.c.append(b);null==this.a&&(this.a=Math.max(d,this.f));this.b=Math.min(e,this.h)}}.bind(b))}
ad.prototype.remove=function(b,c){return Promise.resolve().then(function(){!this.c||!this.c.remove(b,c)||null==this.a||c<=this.a||b>=this.b||(b<=this.a&&c>=this.b?this.a=this.b=null:b<=this.a&&c<this.b?this.a=c:b>this.a&&c>=this.b&&(this.b=b))}.bind(this))};ad.prototype.Ud=function(b){this.c.append(b)};ad.prototype.appendCues=ad.prototype.Ud;
ad.prototype.Sb=function(b,c){this.l=b;var d=this.i.get(b);if(d)for(var e=q(d.keys()),f=e.next();!f.done;f=e.next())if(f=d.get(f.value))f=f.filter(function(b){return b.endTime<=c}),this.c.append(f)};ad.prototype.setSelectedClosedCaptionId=ad.prototype.Sb;
function fd(b,c,d,e,f){var g=d+" "+e,h=new Map;c=q(c);for(var k=c.next();!k.done;k=c.next()){var l=k.value;k=l.stream;h.has(k)||h.set(k,new Map);h.get(k).has(g)||h.get(k).set(g,[]);l.startTime+=f;l.endTime+=f;l.startTime>=b.f&&l.startTime<b.h&&(l=new gd(l.startTime,l.endTime,l.text),h.get(k).get(g).push(l),k==b.l&&b.c.append([l]))}f=q(h.keys());for(g=f.next();!g.done;g=f.next())for(g=g.value,b.i.has(g)||b.i.set(g,new Map),c=q(h.get(g).keys()),k=c.next();!k.done;k=c.next())k=k.value,l=h.get(g).get(k),
b.i.get(g).set(k,l);b.a=null==b.a?Math.max(d,b.f):Math.min(b.a,Math.max(d,b.f));b.b=Math.max(b.b,Math.min(e,b.h))};function hd(b,c,d){this.f=b;this.l=d;this.b={};this.a=null;this.c={};this.h=new Eb;this.s=!1;this.i={};this.m=c;b=this.o=new z;c=new MediaSource;Hb(this.h,c,"sourceopen",b.resolve);this.f.src=window.URL.createObjectURL(c);this.g=c}function id(b){var c=Mb(b.mimeType,b.codecs),d=Nb(b);return cd(c)||MediaSource.isTypeSupported(d)||Yc(c,b.type)}
function jd(){var b={};'video/mp4; codecs="avc1.42E01E",video/mp4; codecs="avc3.42E01E",video/mp4; codecs="hev1.1.6.L93.90",video/mp4; codecs="hvc1.1.6.L93.90",video/mp4; codecs="hev1.2.4.L153.B0"; eotf="smpte2084",video/mp4; codecs="hvc1.2.4.L153.B0"; eotf="smpte2084",video/mp4; codecs="vp9",video/mp4; codecs="vp09.00.10.08",audio/mp4; codecs="mp4a.40.2",audio/mp4; codecs="ac-3",audio/mp4; codecs="ec-3",audio/mp4; codecs="opus",audio/mp4; codecs="flac",video/webm; codecs="vp8",video/webm; codecs="vp9",video/webm; codecs="vp09.00.10.08",audio/webm; codecs="vorbis",audio/webm; codecs="opus",video/mp2t; codecs="avc1.42E01E",video/mp2t; codecs="avc3.42E01E",video/mp2t; codecs="hvc1.1.6.L93.90",video/mp2t; codecs="mp4a.40.2",video/mp2t; codecs="ac-3",video/mp2t; codecs="ec-3",text/vtt,application/mp4; codecs="wvtt",application/ttml+xml,application/mp4; codecs="stpp"'.split(",").forEach(function(c){b[c]=cd(c)||
MediaSource.isTypeSupported(c)||Yc(c);var d=c.split(";")[0];b[d]=b[d]||b[c]});return b}n=hd.prototype;
n.destroy=function(){var b=this;this.s=!0;var c=[],d;for(d in this.c){var e=this.c[d],f=e[0];this.c[d]=e.slice(0,1);f&&c.push(f.p["catch"](I.ob));for(f=1;f<e.length;++f)e[f].p["catch"](I.ob),e[f].p.reject()}this.a&&c.push(this.a.destroy());this.l&&c.push(this.l.destroy());for(var g in this.i)c.push(this.i[g].destroy());return Promise.all(c).then(function(){b.h&&(b.h.L(),b.h=null);b.f&&(b.f.removeAttribute("src"),b.f.load(),b.f=null);b.g=null;b.a=null;b.l=null;b.b={};b.i={};b.m=null;b.c={}})};
n.init=function(b,c){var d=this;return t(function f(){var g;return v(f,function(f){switch(f.j){case 1:return g=Vc,u(f,d.o,2);case 2:b.forEach(function(b,f){var h=Mb(b.mimeType,b.codecs);f==g.Oa?kd(d,h):(!c&&MediaSource.isTypeSupported(h)||!Yc(h,f)||(d.i[f]=new Xc,h=Zc(f,h)),h=d.g.addSourceBuffer(h),G(d.h,h,"error",d.Gf.bind(d,f)),G(d.h,h,"updateend",d.Xa.bind(d,f)),d.b[f]=h,d.c[f]=[])}),f.j=0}})})};function kd(b,c){b.a||(b.a=new ad(b.l));dd(b.a,c)}
function ld(b,c){if("text"==c)var d=b.a.a;else d=md(b,c),d=!d||1==d.length&&1E-6>d.end(0)-d.start(0)?null:1==d.length&&0>d.start(0)?0:d.length?d.start(0):null;return d}function nd(b,c){return"text"==c?b.a.b:Lc(md(b,c))}function od(b,c,d){if("text"==c)return b=b.a,null==b.b||b.b<d?0:b.b-Math.max(d,b.a);b=md(b,c);return Rc(b,d)}n.bc=function(){var b=this.a&&null!=this.a.a?[{start:this.a.a,end:this.a.b}]:[];return{total:Sc(this.f.buffered),audio:Sc(md(this,"audio")),video:Sc(md(this,"video")),text:b}};
function md(b,c){try{return b.b[c].buffered}catch(d){return null}}
function pd(b,c,d,e,f,g){if("text"==c)return ed(b.a,d,e,f);if(b.i[c])return $c(b.i[c],d).then(function(b){this.a||kd(this,"text/vtt");b.captions&&fd(this.a,b.captions,e,f,this.b.video.timestampOffset);return qd(this,c,this.Gd.bind(this,c,b.data.buffer))}.bind(b));g&&window.muxjs&&(b.a||kd(b,"text/vtt"),null==e&&null==f?b.m.init(d):b.m.b(d,function(c){c.length&&fd(b.a,c,e,f,b.b.video.timestampOffset)}));return qd(b,c,b.Gd.bind(b,c,d))}n.Sb=function(b){var c=nd(this,"video")||0;this.a.Sb(b,c)};
n.remove=function(b,c,d){return"text"==b?this.a.remove(c,d):qd(this,b,this.Hd.bind(this,b,c,d))};function rd(b,c){if("text"==c){if(!b.a)return Promise.resolve();b.m.c();return b.a.remove(0,Infinity)}return qd(b,c,b.Hd.bind(b,c,0,b.g.duration))}n.flush=function(b){return"text"==b?Promise.resolve():qd(this,b,this.ge.bind(this,b))};
function sd(b,c,d,e,f){return"text"==c?(b.a.m=d,b=b.a,b.f=e,b.h=f,Promise.resolve()):Promise.all([qd(b,c,b.Sd.bind(b,c)),qd(b,c,b.zf.bind(b,c,d)),qd(b,c,b.xf.bind(b,c,e,f))])}n.endOfStream=function(b){return td(this,function(){b?this.g.endOfStream(b):this.g.endOfStream()}.bind(this))};n.la=function(b){return td(this,function(){this.g.duration=b}.bind(this))};n.T=function(){return this.g.duration};n.Gd=function(b,c){this.b[b].appendBuffer(c)};
n.Hd=function(b,c,d){d<=c?this.Xa(b):this.b[b].remove(c,d)};n.Sd=function(b){var c=this.b[b].appendWindowStart,d=this.b[b].appendWindowEnd;this.b[b].abort();this.b[b].appendWindowStart=c;this.b[b].appendWindowEnd=d;this.Xa(b)};n.ge=function(b){this.f.currentTime-=.001;this.Xa(b)};n.zf=function(b,c){0>c&&(c+=.001);this.b[b].timestampOffset=c;this.Xa(b)};n.xf=function(b,c,d){this.b[b].appendWindowStart=0;this.b[b].appendWindowEnd=d;this.b[b].appendWindowStart=c;this.Xa(b)};
n.Gf=function(b){this.c[b][0].p.reject(new B(2,3,3014,this.f.error?this.f.error.code:0))};n.Xa=function(b){var c=this.c[b][0];c&&(c.p.resolve(),ud(this,b))};function qd(b,c,d){if(b.s)return Promise.reject();d={start:d,p:new z};b.c[c].push(d);if(1==b.c[c].length)try{d.start()}catch(e){"QuotaExceededError"==e.name?d.p.reject(new B(2,3,3017,c)):d.p.reject(new B(2,3,3015,e)),ud(b,c)}return d.p}
function td(b,c){if(b.s)return Promise.reject();var d=[],e;for(e in b.b){var f=new z,g={start:function(b){b.resolve()}.bind(null,f),p:f};b.c[e].push(g);d.push(f);1==b.c[e].length&&g.start()}return Promise.all(d).then(function(){try{c()}catch(l){var b=Promise.reject(new B(2,3,3015,l))}for(var d in this.b)ud(this,d);return b}.bind(b),function(){return Promise.reject()}.bind(b))}function ud(b,c){b.c[c].shift();var d=b.c[c][0];if(d)try{d.start()}catch(e){d.p.reject(new B(2,3,3015,e)),ud(b,c)}};function vd(b,c){b=J(b);c=J(c);return b.split("-")[0]==c.split("-")[0]}function wd(b,c){b=J(b);c=J(c);var d=b.split("-"),e=c.split("-");return d[0]==e[0]&&1==d.length&&2==e.length}function J(b){var c=b.split("-");b=c[0]||"";c=c[1]||"";b=b.toLowerCase();b=xd.get(b)||b;return(c=c.toUpperCase())?b+"-"+c:b}function yd(b){return b.language?J(b.language):b.audio&&b.audio.language?J(b.audio.language):b.video&&b.video.language?J(b.video.language):"und"}
function zd(b,c){for(var d=J(b),e=new Set,f=q(c),g=f.next();!g.done;g=f.next())e.add(J(g.value));f=q(e);for(g=f.next();!g.done;g=f.next())if(g=g.value,g==d)return g;f=q(e);for(g=f.next();!g.done;g=f.next())if(g=g.value,wd(g,d))return g;f=q(e);for(g=f.next();!g.done;g=f.next()){var h=g=g.value,k=d;h=J(h);k=J(k);h=h.split("-");k=k.split("-");if(2==h.length&&2==k.length&&h[0]==k[0])return g}e=q(e);for(g=e.next();!g.done;g=e.next())if(f=g.value,wd(d,f))return f;return null}
var xd=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"]]);var K={jc:function(b,c,d){function e(b,c,d){return b>=c&&b<=d}var f=b.video;return f&&f.width&&f.height&&!(e(f.width,c.minWidth,Math.min(c.maxWidth,d.width))&&e(f.height,c.minHeight,Math.min(c.maxHeight,d.height))&&e(f.width*f.height,c.minPixels,c.maxPixels))||!e(b.bandwidth,c.minBandwidth,c.maxBandwidth)?!1:!0},Lc:function(b,c,d){var e=!1;b.forEach(function(b){var f=b.allowedByApplication;b.allowedByApplication=K.jc(b,c,d);f!=b.allowedByApplication&&(e=!0)});return e},filterNewPeriod:function(b,
c,d,e){e.variants=e.variants.filter(function(e){if(b&&b.R&&!Gc(b,e))return!1;var f=e.audio;e=e.video;return f&&!id(f)||e&&!id(e)||f&&c&&!K.Mc(f,c)||e&&d&&!K.Mc(e,d)?!1:!0});e.textStreams=e.textStreams.filter(function(b){return cd(Mb(b.mimeType,b.codecs))})},Mc:function(b,c){return b.mimeType!=c.mimeType||b.codecs.split(".")[0]!=c.codecs.split(".")[0]?!1:!0},Gc:function(b){var c=b.audio,d=b.video,e=c?c.codecs:null,f=d?d.codecs:null,g=[];f&&g.push(f);e&&g.push(e);var h=[];d&&h.push(d.mimeType);c&&h.push(c.mimeType);
h=h[0]||null;var k=[];c&&k.push(c.kind);d&&k.push(d.kind);k=k[0]||null;var l=new Set;c&&c.roles.forEach(function(b){return l.add(b)});d&&d.roles.forEach(function(b){return l.add(b)});b={id:b.id,active:!1,type:"variant",bandwidth:b.bandwidth,language:b.language,label:null,kind:k,width:null,height:null,frameRate:null,mimeType:h,codecs:g.join(", "),audioCodec:e,videoCodec:f,primary:b.primary,roles:Array.from(l),videoId:null,audioId:null,channelsCount:null,audioBandwidth:null,videoBandwidth:null,originalVideoId:null,
originalAudioId:null,originalTextId:null};d&&(b.videoId=d.id,b.originalVideoId=d.originalId,b.width=d.width||null,b.height=d.height||null,b.frameRate=d.frameRate||null,b.videoBandwidth=d.bandwidth||null);c&&(b.audioId=c.id,b.originalAudioId=c.originalId,b.channelsCount=c.channelsCount,b.audioBandwidth=c.bandwidth||null,b.label=c.label);return b},Cc:function(b){return{id:b.id,active:!1,type:"text",bandwidth:0,language:b.language,label:b.label,kind:b.kind||null,width:null,height:null,frameRate:null,
mimeType:b.mimeType,codecs:b.codecs||null,audioCodec:null,videoCodec:null,primary:b.primary,roles:b.roles,videoId:null,audioId:null,channelsCount:null,audioBandwidth:null,videoBandwidth:null,originalVideoId:null,originalAudioId:null,originalTextId:b.originalId}},fe:function(b,c){for(var d=0;d<b.variants.length;d++)if(b.variants[d].id==c.id)return b.variants[d];return null},ee:function(b,c){for(var d=0;d<b.textStreams.length;d++)if(b.textStreams[d].id==c.id)return b.textStreams[d];return null},Ta:function(b){return b.allowedByApplication&&
b.allowedByKeySystem},pe:function(b){return b.filter(function(b){return K.Ta(b)})},Uc:function(b,c){var d=b.filter(function(b){return b.audio&&b.audio.channelsCount}).reduce(function(b,c){var d=c.audio.channelsCount;b[d]?b[d].push(c):b[d]=[c];return b},{}),e=Object.keys(d);if(0==e.length)return b;var f=e.filter(function(b){return b<=c});return f.length?d[Math.max.apply(null,f)]:d[Math.min.apply(null,e)]},Gb:function(b,c,d){var e=b,f=b.filter(function(b){return b.primary});f.length&&(e=f);var g=e.length?
e[0].language:"";e=e.filter(function(b){return b.language==g});if(c){var h=zd(J(c),b.map(function(b){return b.language}));h&&(e=b.filter(function(b){return J(b.language)==h}))}if(d){if(b=K.Tc(e,d),b.length)return b}else if(b=e.filter(function(b){return 0==b.roles.length}),b.length)return b;b=e.map(function(b){return b.roles}).reduce(I.Xb,[]);return b.length?K.Tc(e,b[0]):e},Tc:function(b,c){return b.filter(function(b){return b.roles.includes(c)})},ad:function(b,c,d){for(var e=0;e<d.length;e++)if(d[e].audio==
b&&d[e].video==c)return d[e];return null},Ib:function(b,c){for(var d=b.periods.length-1;0<d;--d)if(c+Wc>=b.periods[d].startTime)return d;return 0},de:function(b,c){for(var d=0;d<b.periods.length;++d)for(var e=b.periods[d],f=0;f<e.variants.length;++f)if(e.variants[f]==c)return d;return-1},Be:function(b){return"audio"==b.type},Ee:function(b){return"video"==b.type},Yc:function(b){var c=[];b.periods.forEach(function(b){b.variants.forEach(function(b){c.push(b)})});return c},we:function(b){var c=[];b.audio&&
c.push(b.audio);b.video&&c.push(b.video);return c},Yf:function(b){return K.Be(b)?"type=audio codecs="+b.codecs+" bandwidth="+b.bandwidth+" channelsCount="+b.channelsCount:K.Ee(b)?"type=video codecs="+b.codecs+" bandwidth="+b.bandwidth+" frameRate="+b.frameRate+" width="+b.width+" height="+b.height:"unexpected stream type"}};function L(){this.h=null;this.f=!1;this.b=new La;this.c=[];this.i=!1;this.a=this.g=null}y("shaka.abr.SimpleAbrManager",L);L.prototype.stop=function(){this.h=null;this.f=!1;this.c=[];this.g=null};L.prototype.stop=L.prototype.stop;L.prototype.init=function(b){this.h=b};L.prototype.init=L.prototype.init;
L.prototype.chooseVariant=function(){var b=Ad(this.a.restrictions,this.c),c=this.b.getBandwidthEstimate(this.a.defaultBandwidthEstimate);this.c.length&&!b.length&&(b=Ad(null,this.c),b=[b[0]]);for(var d=b[0]||null,e=0;e<b.length;++e){var f=b[e],g=(b[e+1]||{bandwidth:Infinity}).bandwidth/this.a.bandwidthUpgradeTarget;c>=f.bandwidth/this.a.bandwidthDowngradeTarget&&c<=g&&(d=f)}this.g=Date.now();return d};L.prototype.chooseVariant=L.prototype.chooseVariant;L.prototype.enable=function(){this.f=!0};
L.prototype.enable=L.prototype.enable;L.prototype.disable=function(){this.f=!1};L.prototype.disable=L.prototype.disable;L.prototype.segmentDownloaded=function(b,c){var d=this.b;if(!(16E3>c)){var e=8E3*c/b,f=b/1E3;d.a+=c;Ia(d.b,f,e);Ia(d.c,f,e)}if(null!=this.g&&this.f)a:{if(!this.i){if(!(128E3<=this.b.a))break a;this.i=!0}else if(Date.now()-this.g<1E3*this.a.switchInterval)break a;d=this.chooseVariant();this.b.getBandwidthEstimate(this.a.defaultBandwidthEstimate);this.h(d)}};
L.prototype.segmentDownloaded=L.prototype.segmentDownloaded;L.prototype.getBandwidthEstimate=function(){return this.b.getBandwidthEstimate(this.a.defaultBandwidthEstimate)};L.prototype.getBandwidthEstimate=L.prototype.getBandwidthEstimate;L.prototype.setVariants=function(b){this.c=b};L.prototype.setVariants=L.prototype.setVariants;L.prototype.configure=function(b){this.a=b};L.prototype.configure=L.prototype.configure;
function Ad(b,c){b&&(c=c.filter(function(c){return K.jc(c,b,{width:Infinity,height:Infinity})}));return c.sort(function(b,c){return b.bandwidth-c.bandwidth})};function Bd(b,c){this.a=b;this.b=c}Bd.prototype.toString=function(){return"v"+this.a+"."+this.b};function Cd(b,c){var d=new Bd(2,6),e=Dd,f=e.a,g=d.b-f.b;(0<(d.a-f.a||g)?e.c:e.b)(e.a,d,b,c)}function Ed(b,c,d,e){Na([d,"has been deprecated and will be removed in",c,". We are currently at version",b,". Additional information:",e].join(" "))}function Fd(b,c,d,e){Ma([d,"has been deprecated and has been removed in",c,". We are now at version",b,". Additional information:",e].join(""))}var Dd=null;var Gd="ended play playing pause pausing ratechange seeked seeking timeupdate volumechange".split(" "),Hd="buffered currentTime duration ended loop muted paused playbackRate seeking videoHeight videoWidth volume".split(" "),Id=["loop","playbackRate"],Jd=["pause","play"],Kd="adaptation buffering emsg error loading streaming texttrackvisibility timelineregionadded timelineregionenter timelineregionexit trackschanged unloading variantchanged textchanged".split(" "),Ld={getAssetUri:2,getAudioLanguages:2,
getAudioLanguagesAndRoles:2,getBufferedInfo:2,getConfiguration:2,getExpiration:2,getPlaybackRate:2,getTextLanguages:2,getTextLanguagesAndRoles:2,getTextTracks:2,getStats:5,getVariantTracks:2,isAudioOnly:10,isBuffering:1,isInProgress:1,isLive:10,isTextTrackVisible:1,keySystem:10,seekRange:1,usingEmbeddedTextTrack:2},Md={getPlayheadTimeAsDate:1,getPresentationStartTimeAsDate:20},Nd=[["getConfiguration","configure"]],Od=[["isTextTrackVisible","setTextTrackVisibility"]],Pd="addTextTrack cancelTrickPlay configure resetConfiguration retryStreaming selectAudioLanguage selectEmbeddedTextTrack selectTextLanguage selectTextTrack selectVariantTrack setTextTrackVisibility trickPlay".split(" "),
Qd=["attach","detach","load","unload"];
function Rd(b){return JSON.stringify(b,function(b,d){if("function"!=typeof d){if(d instanceof Event||d instanceof D){var c={},f;for(f in d){var g=d[f];g&&"object"==typeof g?"detail"==f&&(c[f]=g):f in Event||(c[f]=g)}return c}if(d instanceof TimeRanges)for(c={__type__:"TimeRanges",length:d.length,start:[],end:[]},f=0;f<d.length;++f)c.start.push(d.start(f)),c.end.push(d.end(f));else c=d instanceof Uint8Array?{__type__:"Uint8Array",entries:Array.from(d)}:"number"==typeof d?isNaN(d)?"NaN":isFinite(d)?
d:0>d?"-Infinity":"Infinity":d;return c}})}function Sd(b){return JSON.parse(b,function(b,d){return"NaN"==d?NaN:"-Infinity"==d?-Infinity:"Infinity"==d?Infinity:d&&"object"==typeof d&&"TimeRanges"==d.__type__?Td(d):d&&"object"==typeof d&&"Uint8Array"==d.__type__?new Uint8Array(d.entries):d})}function Td(b){return{length:b.length,start:function(c){return b.start[c]},end:function(c){return b.end[c]}}};function Ud(b,c,d,e,f,g){this.P=b;this.g=c;this.R=d;this.l=!1;this.D=e;this.M=f;this.v=g;this.b=this.h=!1;this.A="";this.i=null;this.m=this.kd.bind(this);this.o=this.Le.bind(this);this.a={video:{},player:{}};this.s=0;this.c={};this.f=null}var Vd=!1,Wd=null;n=Ud.prototype;n.destroy=function(){Xd(this);Wd&&Yd(this);this.M=this.D=this.g=null;this.b=this.h=!1;this.o=this.m=this.f=this.c=this.a=this.i=null;return Promise.resolve()};n.ba=function(){return this.b};n.uc=function(){return this.A};
n.init=function(){if(window.chrome&&chrome.cast&&chrome.cast.isAvailable){delete window.__onGCastApiAvailable;this.h=!0;this.g();var b=new chrome.cast.SessionRequest(this.P);b=new chrome.cast.ApiConfig(b,this.ld.bind(this),this.Re.bind(this),"origin_scoped");chrome.cast.initialize(b,function(){},function(){});Vd&&setTimeout(this.g.bind(this),20);(b=Wd)&&b.status!=chrome.cast.SessionStatus.STOPPED?this.ld(b):Wd=null}else window.__onGCastApiAvailable=function(b){b&&this.init()}.bind(this)};
n.yc=function(b){this.i=b;this.b&&Zd({type:"appData",appData:this.i})};n.cast=function(b){if(!this.h)return Promise.reject(new B(1,8,8E3));if(!Vd)return Promise.reject(new B(1,8,8001));if(this.b)return Promise.reject(new B(1,8,8002));this.f=new z;chrome.cast.requestSession(this.rc.bind(this,b),this.jd.bind(this));return this.f};n.Jb=function(){this.b&&(Xd(this),Wd&&(Yd(this),Wd.stop(function(){},function(){}),Wd=null))};
n.get=function(b,c){if("video"==b){if(Jd.includes(c))return this.xd.bind(this,b,c)}else if("player"==b){if(Md[c]&&!this.get("player","isLive")())return function(){};if(Pd.includes(c))return this.xd.bind(this,b,c);if(Qd.includes(c))return this.lf.bind(this,b,c);if(Ld[c])return this.ud.bind(this,b,c)}return this.ud(b,c)};n.set=function(b,c,d){this.a[b][c]=d;Zd({type:"set",targetName:b,property:c,value:d})};
n.rc=function(b,c){Wd=c;c.addUpdateListener(this.m);c.addMessageListener("urn:x-cast:com.google.shaka.v2",this.o);this.kd();Zd({type:"init",initState:b,appData:this.i});this.f.resolve()};n.jd=function(b){var c=8003;switch(b.code){case "cancel":c=8004;break;case "timeout":c=8005;break;case "receiver_unavailable":c=8006}this.f.reject(new B(2,8,c,b))};n.ud=function(b,c){return this.a[b][c]};
n.xd=function(b,c,d){for(var e=[],f=2;f<arguments.length;++f)e[f-2]=arguments[f];Zd({type:"call",targetName:b,methodName:c,args:e})};n.lf=function(b,c,d){for(var e=[],f=2;f<arguments.length;++f)e[f-2]=arguments[f];f=new z;var g=this.s.toString();this.s++;this.c[g]=f;Zd({type:"asyncCall",targetName:b,methodName:c,args:e,id:g});return f};n.ld=function(b){var c=this.v();this.f=new z;this.l=!0;this.rc(c,b)};n.Re=function(b){Vd="available"==b;this.g()};
function Yd(b){var c=Wd;c.removeUpdateListener(b.m);c.removeMessageListener("urn:x-cast:com.google.shaka.v2",b.o)}n.kd=function(){var b=Wd?"connected"==Wd.status:!1;if(this.b&&!b){this.M();for(var c in this.a)this.a[c]={};Xd(this)}this.A=(this.b=b)?Wd.receiver.friendlyName:"";this.g()};function Xd(b){for(var c in b.c){var d=b.c[c];delete b.c[c];d.reject(new B(1,7,7E3))}}
n.Le=function(b,c){var d=Sd(c);switch(d.type){case "event":var e=d.event;this.D(d.targetName,new D(e.type,e));break;case "update":e=d.update;for(var f in e){d=this.a[f]||{};for(var g in e[f])d[g]=e[f][g]}this.l&&(this.R(),this.l=!1);break;case "asyncComplete":if(f=d.id,d=d.error,g=this.c[f],delete this.c[f],g)if(d){f=new B(d.severity,d.category,d.code);for(e in d)f[e]=d[e];g.reject(f)}else g.resolve()}};function Zd(b){b=Rd(b);Wd.sendMessage("urn:x-cast:com.google.shaka.v2",b,function(){},Oa)};function M(b,c,d){E.call(this);this.c=b;this.b=c;this.i=this.g=this.f=this.l=this.h=null;this.a=new Ud(d,this.Bf.bind(this),this.Cf.bind(this),this.Df.bind(this),this.Ef.bind(this),this.Zc.bind(this));$d(this)}Ga(M,E);y("shaka.cast.CastProxy",M);M.prototype.destroy=function(b){b&&this.a&&this.a.Jb();this.i&&(this.i.L(),this.i=null);b=[];this.b&&(b.push(this.b.destroy()),this.b=null);this.a&&(b.push(this.a.destroy()),this.a=null);this.l=this.h=this.c=null;return Promise.all(b)};
M.prototype.destroy=M.prototype.destroy;M.prototype.ye=function(){return this.h};M.prototype.getVideo=M.prototype.ye;M.prototype.qe=function(){return this.l};M.prototype.getPlayer=M.prototype.qe;M.prototype.Wd=function(){return this.a?this.a.h&&Vd:!1};M.prototype.canCast=M.prototype.Wd;M.prototype.ba=function(){return this.a?this.a.ba():!1};M.prototype.isCasting=M.prototype.ba;M.prototype.uc=function(){return this.a?this.a.uc():""};M.prototype.receiverName=M.prototype.uc;
M.prototype.cast=function(){var b=this.Zc();return this.a.cast(b).then(function(){if(this.b)return this.b.wb()}.bind(this))};M.prototype.cast=M.prototype.cast;M.prototype.yc=function(b){this.a.yc(b)};M.prototype.setAppData=M.prototype.yc;M.prototype.If=function(){var b=this.a;if(b.b){var c=b.v();chrome.cast.requestSession(b.rc.bind(b,c),b.jd.bind(b))}};M.prototype.suggestDisconnect=M.prototype.If;M.prototype.Jb=function(){this.a.Jb()};M.prototype.forceDisconnect=M.prototype.Jb;
function $d(b){b.a.init();b.i=new Eb;Gd.forEach(function(b){G(this.i,this.c,b,this.Rf.bind(this))}.bind(b));Kd.forEach(function(b){G(this.i,this.b,b,this.ff.bind(this))}.bind(b));b.h={};for(var c in b.c)Object.defineProperty(b.h,c,{configurable:!1,enumerable:!0,get:b.Qf.bind(b,c),set:b.Sf.bind(b,c)});b.l={};for(var d in b.b)Object.defineProperty(b.l,d,{configurable:!1,enumerable:!0,get:b.td.bind(b,d)});b.f=new E;b.f.yb=b.h;b.g=new E;b.g.yb=b.l}n=M.prototype;
n.Zc=function(){var b={video:{},player:{},playerAfterLoad:{},manifest:this.b.ac(),startTime:null};this.c.pause();Id.forEach(function(c){b.video[c]=this.c[c]}.bind(this));this.c.ended||(b.startTime=this.c.currentTime);Nd.forEach(function(c){var d=c[1];c=this.b[c[0]]();b.player[d]=c}.bind(this));Od.forEach(function(c){var d=c[1];c=this.b[c[0]]();b.playerAfterLoad[d]=c}.bind(this));return b};n.Bf=function(){this.dispatchEvent(new D("caststatuschanged"))};
n.Cf=function(){this.f.dispatchEvent(new D(this.h.paused?"pause":"play"))};
n.Ef=function(){var b=this;Nd.forEach(function(b){var c=b[1];b=this.a.get("player",b[0])();this.b[c](b)}.bind(this));var c=this.a.get("player","getAssetUri")(),d=this.a.get("video","ended"),e=Promise.resolve(),f=this.c.autoplay,g=null;d||(g=this.a.get("video","currentTime"));c&&(this.c.autoplay=!1,e=this.b.load(c,g));var h={};Id.forEach(function(b){h[b]=this.a.get("video",b)}.bind(this));e.then(function(){b.c&&(Id.forEach(function(b){this.c[b]=h[b]}.bind(b)),Od.forEach(function(b){var c=b[1];b=this.a.get("player",
b[0])();this.b[c](b)}.bind(b)),b.c.autoplay=f,c&&b.c.play())},function(c){b.b.dispatchEvent(new D("error",{detail:c}))})};n.Qf=function(b){if("addEventListener"==b)return this.f.addEventListener.bind(this.f);if("removeEventListener"==b)return this.f.removeEventListener.bind(this.f);if(this.a.ba()&&0==Object.keys(this.a.a.video).length){var c=this.c[b];if("function"!=typeof c)return c}return this.a.ba()?this.a.get("video",b):(b=this.c[b],"function"==typeof b&&(b=b.bind(this.c)),b)};
n.Sf=function(b,c){this.a.ba()?this.a.set("video",b,c):this.c[b]=c};n.Rf=function(b){this.a.ba()||this.f.dispatchEvent(new D(b.type,b))};
n.td=function(b){if("addEventListener"==b)return this.g.addEventListener.bind(this.g);if("removeEventListener"==b)return this.g.removeEventListener.bind(this.g);if("getMediaElement"==b)return function(){return this.h}.bind(this);if("getSharedConfiguration"==b)return this.a.get("player","getConfiguration");if("getNetworkingEngine"==b)return this.b.hb.bind(this.b);if(this.a.ba()){if("getManifest"==b||"drmInfo"==b)return function(){Na(b+"() does not work while casting!");return null};if("getManifestUri"==
b)return Cd("getManifestUri",'Please use "getAssetUri" instead.'),this.td("getAssetUri");if("attach"==b||"detach"==b)return function(){Na(b+"() does not work while casting!");return Promise.resolve()}}return this.a.ba()&&0==Object.keys(this.a.a.video).length&&Ld[b]||!this.a.ba()?this.b[b].bind(this.b):this.a.get("player",b)};n.ff=function(b){this.a.ba()||this.g.dispatchEvent(b)};n.Df=function(b,c){this.a.ba()&&("video"==b?this.f.dispatchEvent(c):"player"==b&&this.g.dispatchEvent(c))};function ae(b,c,d,e){E.call(this);this.a=b;this.b=c;this.c=new Eb;this.v={video:b,player:c};this.A=d||function(){};this.D=e||function(b){return b};this.s=!1;this.h=!0;this.g=0;this.o=!1;this.l=!0;this.m=this.i=this.f=null;be(this)}Ga(ae,E);y("shaka.cast.CastReceiver",ae);ae.prototype.isConnected=function(){return this.s};ae.prototype.isConnected=ae.prototype.isConnected;ae.prototype.De=function(){return this.h};ae.prototype.isIdle=ae.prototype.De;
ae.prototype.destroy=function(){var b=this;return t(function d(){var e,f;return v(d,function(d){switch(d.j){case 1:return b.c&&(b.c.L(),b.c=null),e=[],b.b&&(e.push(b.b.destroy()),b.b=null),null!=b.m&&window.clearTimeout(b.m),b.a=null,b.v=null,b.A=null,b.s=!1,b.h=!0,b.f=null,b.i=null,b.m=null,u(d,Promise.all(e),2);case 2:f=cast.receiver.CastReceiverManager.getInstance(),f.stop(),d.j=0}})})};ae.prototype.destroy=ae.prototype.destroy;
function be(b){var c=cast.receiver.CastReceiverManager.getInstance();c.onSenderConnected=b.pd.bind(b);c.onSenderDisconnected=b.pd.bind(b);c.onSystemVolumeChanged=b.ce.bind(b);b.i=c.getCastMessageBus("urn:x-cast:com.google.cast.media");b.i.onMessage=b.He.bind(b);b.f=c.getCastMessageBus("urn:x-cast:com.google.shaka.v2");b.f.onMessage=b.Ue.bind(b);c.start();Gd.forEach(function(b){G(this.c,this.a,b,this.vd.bind(this,"video"))}.bind(b));Kd.forEach(function(b){G(this.c,this.b,b,this.vd.bind(this,"player"))}.bind(b));
cast.__platform__&&cast.__platform__.canDisplayType('video/mp4; codecs="avc1.640028"; width=3840; height=2160')?b.b.zc(3840,2160):b.b.zc(1920,1080);G(b.c,b.a,"loadeddata",function(){this.o=!0}.bind(b));G(b.c,b.b,"loading",function(){this.h=!1;ce(this)}.bind(b));G(b.c,b.a,"playing",function(){this.h=!1;ce(this)}.bind(b));G(b.c,b.a,"pause",function(){ce(this)}.bind(b));G(b.c,b.b,"unloading",function(){this.h=!0;ce(this)}.bind(b));G(b.c,b.a,"ended",function(){window.setTimeout(function(){this.a&&this.a.ended&&
(this.h=!0,ce(this))}.bind(this),5E3)}.bind(b))}n=ae.prototype;n.pd=function(){this.g=0;this.l=!0;this.s=0!=cast.receiver.CastReceiverManager.getInstance().getSenders().length;ce(this)};function ce(b){Promise.resolve().then(function(){this.b&&(this.dispatchEvent(new D("caststatuschanged")),de(this)||ee(this,0))}.bind(b))}
function fe(b,c,d){for(var e in c.player)b.b[e](c.player[e]);b.A(d);d=Promise.resolve();var f=b.a.autoplay;c.manifest&&(b.a.autoplay=!1,d=b.b.load(c.manifest,c.startTime));d.then(function(){if(b.b){for(var d in c.video)b.a[d]=c.video[d];for(var e in c.playerAfterLoad)b.b[e](c.playerAfterLoad[e]);b.a.autoplay=f;c.manifest&&(b.a.play(),ee(b,0))}},function(c){b.b.dispatchEvent(new D("error",{detail:c}))})}n.vd=function(b,c){this.b&&(this.sc(),ge(this,{type:"event",targetName:b,event:c},this.f))};
n.sc=function(){null!=this.m&&window.clearTimeout(this.m);this.m=window.setTimeout(this.sc.bind(this),500);var b={video:{},player:{}};Hd.forEach(function(c){b.video[c]=this.a[c]}.bind(this));if(this.b.U())for(var c in Md)0==this.g%Md[c]&&(b.player[c]=this.b[c]());for(var d in Ld)0==this.g%Ld[d]&&(b.player[d]=this.b[d]());if(c=cast.receiver.CastReceiverManager.getInstance().getSystemVolume())b.video.volume=c.level,b.video.muted=c.muted;this.o&&(this.g+=1);ge(this,{type:"update",update:b},this.f);de(this)};
function de(b){return b.l&&(b.a.duration||b.b.U())?(he(b),b.l=!1,!0):!1}function he(b){var c={contentId:b.b.ac(),streamType:b.b.U()?"LIVE":"BUFFERED",duration:b.a.duration,contentType:""};ee(b,0,c)}n.ce=function(){var b=cast.receiver.CastReceiverManager.getInstance().getSystemVolume();b&&ge(this,{type:"update",update:{video:{volume:b.level,muted:b.muted}}},this.f);ge(this,{type:"event",targetName:"video",event:{type:"volumechange"}},this.f)};
n.Ue=function(b){var c=Sd(b.data);switch(c.type){case "init":this.g=0;this.o=!1;this.l=!0;fe(this,c.initState,c.appData);this.sc();break;case "appData":this.A(c.appData);break;case "set":var d=c.targetName,e=c.property;c=c.value;if("video"==d){var f=cast.receiver.CastReceiverManager.getInstance();if("volume"==e){f.setSystemVolumeLevel(c);break}else if("muted"==e){f.setSystemVolumeMuted(c);break}}this.v[d][e]=c;break;case "call":d=this.v[c.targetName];d[c.methodName].apply(d,c.args);break;case "asyncCall":d=
c.targetName;e=c.methodName;"player"==d&&"load"==e&&(this.g=0,this.o=!1);f=c.id;b=b.senderId;var g=this.v[d];c=g[e].apply(g,c.args);"player"==d&&"load"==e&&(c=c.then(function(){this.l=!0}.bind(this)));c.then(this.Cd.bind(this,b,f,null),this.Cd.bind(this,b,f))}};
n.He=function(b){var c=Sd(b.data);switch(c.type){case "PLAY":this.a.play();ee(this,0);break;case "PAUSE":this.a.pause();ee(this,0);break;case "SEEK":b=c.currentTime;var d=c.resumeState;null!=b&&(this.a.currentTime=Number(b));d&&"PLAYBACK_START"==d?(this.a.play(),ee(this,0)):d&&"PLAYBACK_PAUSE"==d&&(this.a.pause(),ee(this,0));break;case "STOP":this.b.wb().then(function(){this.b&&ee(this,0)}.bind(this));break;case "GET_STATUS":ee(this,Number(c.requestId));break;case "VOLUME":d=c.volume;b=d.level;d=
d.muted;var e=this.a.volume,f=this.a.muted;null!=b&&(this.a.volume=Number(b));null!=d&&(this.a.muted=d);e==this.a.volume&&f==this.a.muted||ee(this,0);break;case "LOAD":this.g=0;this.l=this.o=!1;b=c.currentTime;d=this.D(c.media.contentId);this.a.autoplay=!0;this.b.load(d,b).then(function(){this.b&&he(this)}.bind(this))["catch"](function(b){var d="LOAD_FAILED";7==b.category&&7E3==b.code&&(d="LOAD_CANCELLED");ge(this,{requestId:Number(c.requestId),type:d},this.i)}.bind(this));break;default:ge(this,{requestId:Number(c.requestId),
type:"INVALID_REQUEST",reason:"INVALID_COMMAND"},this.i)}};n.Cd=function(b,c,d){this.b&&ge(this,{type:"asyncComplete",id:c,error:d},this.f,b)};function ge(b,c,d,e){b.s&&(b=Rd(c),e?d.getCastChannel(e).send(b):d.broadcast(b))}
function ee(b,c,d){var e=b.a.playbackRate;var f=ie;f=b.h?f.IDLE:b.b.ed()?f.Nd:b.a.paused?f.Pd:f.Qd;e={mediaSessionId:0,playbackRate:e,playerState:f,currentTime:b.a.currentTime,supportedMediaCommands:15,volume:{level:b.a.volume,muted:b.a.muted}};d&&(e.media=d);ge(b,{requestId:c,type:"MEDIA_STATUS",status:[e]},b.i)}var ie={IDLE:"IDLE",Qd:"PLAYING",Nd:"BUFFERING",Pd:"PAUSED"};var N={Hb:function(b,c){var d=N.N(b,c);return 1!=d.length?null:d[0]},Vc:function(b,c,d){b=N.Wc(b,c,d);return 1!=b.length?null:b[0]},N:function(b,c){return Array.prototype.filter.call(b.childNodes,function(b){return b instanceof Element&&b.tagName==c})},Wc:function(b,c,d){return Array.prototype.filter.call(b.childNodes,function(b){return b instanceof Element&&b.localName==d&&b.namespaceURI==c})},getAttributeNS:function(b,c,d){return b.hasAttributeNS(c,d)?b.getAttributeNS(c,d):null},Kb:function(b){return Array.prototype.every.call(b.childNodes,
function(b){return b.nodeType==Node.TEXT_NODE||b.nodeType==Node.CDATA_SECTION_NODE})?b.textContent.trim():null},G:function(b,c,d,e){e=void 0===e?null:e;var f=null;b=b.getAttribute(c);null!=b&&(f=d(b));return null==f?e:f},bf:function(b){if(!b)return null;/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(b)&&(b+="Z");b=Date.parse(b);return isNaN(b)?null:Math.floor(b/1E3)},sa:function(b){if(!b)return null;b=/^P(?:([0-9]*)Y)?(?:([0-9]*)M)?(?:([0-9]*)D)?(?:T(?:([0-9]*)H)?(?:([0-9]*)M)?(?:([0-9.]*)S)?)?$/.exec(b);
if(!b)return null;b=31536E3*Number(b[1]||null)+2592E3*Number(b[2]||null)+86400*Number(b[3]||null)+3600*Number(b[4]||null)+60*Number(b[5]||null)+Number(b[6]||null);return isFinite(b)?b:null},Qb:function(b){var c=/([0-9]+)-([0-9]+)/.exec(b);if(!c)return null;b=Number(c[1]);if(!isFinite(b))return null;c=Number(c[2]);return isFinite(c)?{start:b,end:c}:null},parseInt:function(b){b=Number(b);return 0===b%1?b:null},Pb:function(b){b=Number(b);return 0===b%1&&0<b?b:null},Ya:function(b){b=Number(b);return 0===
b%1&&0<=b?b:null},parseFloat:function(b){b=Number(b);return isNaN(b)?null:b},be:function(b){var c;b=(c=b.match(/^(\d+)\/(\d+)$/))?Number(c[1]/c[2]):Number(b);return isNaN(b)?null:b},sd:function(b,c){var d=new DOMParser;try{var e=d.parseFromString(b,"text/xml")}catch(g){}if(e&&e.documentElement.tagName==c)var f=e.documentElement;return f&&0<f.getElementsByTagName("parsererror").length?null:f},rd:function(b,c){try{var d=Rb(b);return N.sd(d,c)}catch(e){}}};var je=(new Map).set("urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b","org.w3.clearkey").set("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine.alpha").set("urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95","com.microsoft.playready").set("urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb","com.adobe.primetime");
function ke(b,c,d){var e=le(b),f=null;b=[];var g=[],h=new Set(e.map(function(b){return b.keyId}));h["delete"](null);if(1<h.size)throw new B(2,4,4010);d||(g=e.filter(function(b){return"urn:mpeg:dash:mp4protection:2011"==b.Ad?(f=b.init||f,!1):!0}),g.length&&(b=me(f,c,g),0==b.length&&(b=[Uc("",f)])));if(e.length&&(d||!g.length))for(b=[],c=q(je.values()),d=c.next();!d.done;d=c.next())d=d.value,"org.w3.clearkey"!=d&&b.push(Uc(d,f));if(h=Array.from(h)[0]||null)for(c=q(b),d=c.next();!d.done;d=c.next())for(d=
q(d.value.initData),e=d.next();!e.done;e=d.next())e.value.keyId=h;return{Oc:h,Xf:f,drmInfos:b,Xc:!0}}function ne(b,c,d,e){var f=ke(b,c,e);if(d.Xc){b=1==d.drmInfos.length&&!d.drmInfos[0].keySystem;c=0==f.drmInfos.length;if(0==d.drmInfos.length||b&&!c)d.drmInfos=f.drmInfos;d.Xc=!1}else if(0<f.drmInfos.length&&(d.drmInfos=d.drmInfos.filter(function(b){return f.drmInfos.some(function(c){return c.keySystem==b.keySystem})}),0==d.drmInfos.length))throw new B(2,4,4008);return f.Oc||d.Oc}
function oe(b){var c=0,d=(new DataView(b)).getUint32(c,!0);if(d!==b.byteLength)return[];c+=6;d=[];for(var e=new DataView(b);c<b.byteLength-1;){var f=e.getUint16(c,!0);c+=2;var g=e.getUint16(c,!0);c+=2;var h=new Uint8Array(b,c,g);d.push({type:f,value:h});c+=g}return d}function pe(b){return(b=b.querySelector("DATA > LA_URL"))?b.textContent:""}
function me(b,c,d){var e=[];d=q(d);for(var f=d.next();!f.done;f=d.next()){f=f.value;var g=je.get(f.Ad);if(g){var h=Uc(g,f.init||b);if(g=qe.get(g))h.licenseServerUri=g(f);e.push(h)}else for(f=c(f.node)||[],f=q(f),h=f.next();!h.done;h=f.next())e.push(h.value)}return e}
var qe=(new Map).set("com.widevine.alpha",function(b){return(b=N.Vc(b.node,"urn:microsoft","laurl"))?b.getAttribute("licenseUrl")||"":""}).set("com.microsoft.playready",function(b){b=N.Vc(b.node,"urn:microsoft:playready","pro");if(!b)return"";b=Yb(b.textContent);b=oe(b.buffer).filter(function(b){return 1===b.type})[0];if(!b)return"";b=Ub(b.value,!0);return(b=N.sd(b,"WRMHEADER"))?pe(b):""});function le(b){var c=[];b=q(b);for(var d=b.next();!d.done;d=b.next())(d=re(d.value))&&c.push(d);return c}
function re(b){var c=b.getAttribute("schemeIdUri"),d=N.getAttributeNS(b,"urn:mpeg:cenc:2013","default_KID"),e=N.Wc(b,"urn:mpeg:cenc:2013","pssh").map(N.Kb);if(!c)return null;c=c.toLowerCase();if(d&&(d=d.replace(/-/g,"").toLowerCase(),d.includes(" ")))throw new B(2,4,4009);var f=[];try{f=e.map(function(b){return{initDataType:"cenc",initData:Yb(b),keyId:null}})}catch(g){throw new B(2,4,4007);}return{node:b,Ad:c,keyId:d,init:0<f.length?f:null}};function se(b,c,d,e,f){var g={RepresentationID:c,Number:d,Bandwidth:e,Time:f};return b.replace(/\$(RepresentationID|Number|Bandwidth|Time)?(?:%0([0-9]+)([diouxX]))?\$/g,function(b,c,d,e){if("$$"==b)return"$";var f=g[c];if(null==f)return b;"RepresentationID"==c&&d&&(d=void 0);"Time"==c&&(f=Math.round(f));switch(e){case void 0:case "d":case "i":case "u":b=f.toString();break;case "o":b=f.toString(8);break;case "x":b=f.toString(16);break;case "X":b=f.toString(16).toUpperCase();break;default:b=f.toString()}d=
window.parseInt(d,10)||1;return Array(Math.max(0,d-b.length)+1).join("0")+b})}
function te(b,c){var d=ue(b,c,"timescale"),e=1;d&&(e=N.Pb(d)||1);d=ue(b,c,"duration");(d=N.Pb(d||""))&&(d/=e);var f=ue(b,c,"startNumber"),g=Number(ue(b,c,"presentationTimeOffset"))||0,h=N.Ya(f||"");if(null==f||null==h)h=1;var k=ve(b,c,"SegmentTimeline");f=null;if(k){f=e;var l=b.O.duration||Infinity;k=N.N(k,"S");for(var m=[],p=0,r=0;r<k.length;++r){var w=k[r],x=N.G(w,"t",N.Ya),A=N.G(w,"d",N.Ya);w=N.G(w,"r",N.parseInt);null!=x&&(x-=g);if(!A)break;x=null!=x?x:p;w=w||0;if(0>w)if(r+1<k.length){w=N.G(k[r+
1],"t",N.Ya);if(null==w)break;else if(x>=w)break;w=Math.ceil((w-x)/A)-1}else{if(Infinity==l)break;else if(x/f>=l)break;w=Math.ceil((l*f-x)/A)-1}0<m.length&&x!=p&&(m[m.length-1].end=x/f);for(var R=0;R<=w;++R)p=x+A,m.push({start:x/f,end:p/f,Nf:x}),x=p}f=m}return{timescale:e,V:d,Ka:h,ga:g/e||0,Fc:g,K:f}}function ue(b,c,d){return[c(b.w),c(b.Y),c(b.ea)].filter(I.wa).map(function(b){return b.getAttribute(d)}).reduce(function(b,c){return b||c})}
function ve(b,c,d){return[c(b.w),c(b.Y),c(b.ea)].filter(I.wa).map(function(b){return N.Hb(b,d)}).reduce(function(b,c){return b||c})}
function we(b,c,d,e,f,g){for(var h=N.getAttributeNS(b,"http://www.w3.org/1999/xlink","href"),k=N.getAttributeNS(b,"http://www.w3.org/1999/xlink","actuate")||"onRequest",l=0;l<b.attributes.length;l++){var m=b.attributes[l];"http://www.w3.org/1999/xlink"==m.namespaceURI&&(b.removeAttributeNS(m.namespaceURI,m.localName),--l)}if(5<=g)return jb(new B(2,4,4028));if("onLoad"!=k)return jb(new B(2,4,4027));var p=Tc([e],[h]);return f.request(0,Ab(p,c)).Z(function(e){e=N.rd(e.data,b.tagName);if(!e)return jb(new B(2,
4,4001,h));for(;b.childNodes.length;)b.removeChild(b.childNodes[0]);for(;e.childNodes.length;){var k=e.childNodes[0];e.removeChild(k);b.appendChild(k)}for(k=0;k<e.attributes.length;k++){var l=e.attributes[k].nodeName,m=e.getAttribute(l);b.setAttribute(l,m)}return xe(b,c,d,p[0],f,g+1)})}
function xe(b,c,d,e,f,g){g=void 0===g?0:g;if(N.getAttributeNS(b,"http://www.w3.org/1999/xlink","href")){var h=we(b,c,d,e,f,g);d&&(h=h.Z(void 0,function(){return xe(b,c,d,e,f,g)}));return h}h=[];for(var k=0;k<b.childNodes.length;k++){var l=b.childNodes[k];l instanceof Element&&("urn:mpeg:dash:resolve-to-zero:2013"==N.getAttributeNS(l,"http://www.w3.org/1999/xlink","href")?(b.removeChild(l),--k):"SegmentTimeline"!=l.tagName&&h.push(xe(l,c,d,e,f,g)))}return nb(h).Z(function(){return b})};function ye(b,c,d){this.c=b;this.b=c;this.a=d}y("shaka.media.InitSegmentReference",ye);ye.prototype.Yb=function(){return this.c()};ye.prototype.createUris=ye.prototype.Yb;ye.prototype.dc=function(){return this.b};ye.prototype.getStartByte=ye.prototype.dc;ye.prototype.cc=function(){return this.a};ye.prototype.getEndByte=ye.prototype.cc;function O(b,c,d,e,f,g){this.position=b;this.startTime=c;this.endTime=d;this.c=e;this.b=f;this.a=g}y("shaka.media.SegmentReference",O);O.prototype.X=function(){return this.position};
O.prototype.getPosition=O.prototype.X;O.prototype.ec=function(){return this.startTime};O.prototype.getStartTime=O.prototype.ec;O.prototype.ke=function(){return this.endTime};O.prototype.getEndTime=O.prototype.ke;O.prototype.Yb=function(){return this.c()};O.prototype.createUris=O.prototype.Yb;O.prototype.dc=function(){return this.b};O.prototype.getStartByte=O.prototype.dc;O.prototype.cc=function(){return this.a};O.prototype.getEndByte=O.prototype.cc;function P(b,c){this.H=b;this.b=c==ze;this.a=0}y("shaka.util.DataViewReader",P);var ze=1;P.Endianness={Uf:0,Vf:ze};P.prototype.ia=function(){return this.a<this.H.byteLength};P.prototype.hasMoreData=P.prototype.ia;P.prototype.X=function(){return this.a};P.prototype.getPosition=P.prototype.X;P.prototype.le=function(){return this.H.byteLength};P.prototype.getLength=P.prototype.le;P.prototype.fa=function(){try{var b=this.H.getUint8(this.a);this.a+=1;return b}catch(c){Ae()}};P.prototype.readUint8=P.prototype.fa;
P.prototype.qb=function(){try{var b=this.H.getUint16(this.a,this.b);this.a+=2;return b}catch(c){Ae()}};P.prototype.readUint16=P.prototype.qb;P.prototype.C=function(){try{var b=this.H.getUint32(this.a,this.b);this.a+=4;return b}catch(c){Ae()}};P.prototype.readUint32=P.prototype.C;P.prototype.wd=function(){try{var b=this.H.getInt32(this.a,this.b);this.a+=4;return b}catch(c){Ae()}};P.prototype.readInt32=P.prototype.wd;
P.prototype.$a=function(){try{if(this.b){var b=this.H.getUint32(this.a,!0);var c=this.H.getUint32(this.a+4,!0)}else c=this.H.getUint32(this.a,!1),b=this.H.getUint32(this.a+4,!1)}catch(d){Ae()}if(2097151<c)throw new B(2,3,3001);this.a+=8;return c*Math.pow(2,32)+b};P.prototype.readUint64=P.prototype.$a;P.prototype.Ia=function(b){this.a+b>this.H.byteLength&&Ae();var c=new Uint8Array(this.H.buffer,this.H.byteOffset+this.a,b);this.a+=b;return new Uint8Array(c)};P.prototype.readBytes=P.prototype.Ia;
P.prototype.I=function(b){this.a+b>this.H.byteLength&&Ae();this.a+=b};P.prototype.skip=P.prototype.I;P.prototype.zd=function(b){this.a<b&&Ae();this.a-=b};P.prototype.rewind=P.prototype.zd;P.prototype.seek=function(b){(0>b||b>this.H.byteLength)&&Ae();this.a=b};P.prototype.seek=P.prototype.seek;P.prototype.tc=function(){for(var b=this.a;this.ia()&&0!=this.H.getUint8(this.a);)this.a+=1;b=new Uint8Array(this.H.buffer,this.H.byteOffset+b,this.a-b);this.a+=1;return Rb(b)};
P.prototype.readTerminatedString=P.prototype.tc;function Ae(){throw new B(2,3,3E3);};function Q(){this.c=[];this.b=[];this.a=!1}y("shaka.util.Mp4Parser",Q);Q.prototype.F=function(b,c){var d=Be(b);this.c[d]=0;this.b[d]=c;return this};Q.prototype.box=Q.prototype.F;Q.prototype.aa=function(b,c){var d=Be(b);this.c[d]=1;this.b[d]=c;return this};Q.prototype.fullBox=Q.prototype.aa;Q.prototype.stop=function(){this.a=!0};Q.prototype.stop=Q.prototype.stop;
Q.prototype.parse=function(b,c){var d=new Uint8Array(b);d=new P(new DataView(d.buffer,d.byteOffset,d.byteLength),0);for(this.a=!1;d.ia()&&!this.a;)this.Ob(0,d,c)};Q.prototype.parse=Q.prototype.parse;
Q.prototype.Ob=function(b,c,d){var e=c.X(),f=c.C(),g=c.C();switch(f){case 0:f=c.H.byteLength-e;break;case 1:f=c.$a()}var h=this.b[g];if(h){var k=null,l=null;1==this.c[g]&&(l=c.C(),k=l>>>24,l&=16777215);g=e+f;d&&g>c.H.byteLength&&(g=c.H.byteLength);g-=c.X();c=0<g?c.Ia(g):new Uint8Array(0);c=new P(new DataView(c.buffer,c.byteOffset,c.byteLength),0);h({parser:this,partialOkay:d||!1,version:k,flags:l,reader:c,size:f,start:e+b})}else c.I(Math.min(e+f-c.X(),c.H.byteLength-c.X()))};
Q.prototype.parseNext=Q.prototype.Ob;function S(b){for(;b.reader.ia()&&!b.parser.a;)b.parser.Ob(b.start,b.reader,b.partialOkay)}Q.children=S;function Ce(b){for(var c=b.reader.C();0<c&&!b.parser.a;--c)b.parser.Ob(b.start,b.reader,b.partialOkay)}Q.sampleDescription=Ce;function De(b){return function(c){b(c.reader.Ia(c.reader.H.byteLength-c.reader.X()))}}Q.allData=De;function Be(b){for(var c=0,d=0;d<b.length;d++)c=c<<8|b.charCodeAt(d);return c}
function Ee(b){return String.fromCharCode(b>>24&255,b>>16&255,b>>8&255,b&255)}Q.typeToString=Ee;function Fe(b,c,d,e){var f,g=(new Q).aa("sidx",function(b){f=Ge(c,e,d,b)});b&&g.parse(b);if(f)return f;throw new B(2,3,3004);}
function Ge(b,c,d,e){var f=[];e.reader.I(4);var g=e.reader.C();if(0==g)throw new B(2,3,3005);if(0==e.version){var h=e.reader.C();var k=e.reader.C()}else h=e.reader.$a(),k=e.reader.$a();e.reader.I(2);var l=e.reader.qb();b=b+e.size+k;for(k=0;k<l;k++){var m=e.reader.C(),p=(m&2147483648)>>>31;m&=2147483647;var r=e.reader.C();e.reader.I(4);if(1==p)throw new B(2,3,3006);f.push(new O(f.length,h/g-c,(h+r)/g-c,function(){return d},b,b+m-1));h+=r;b+=m}e.parser.stop();return f};function T(b){this.a=b}y("shaka.media.SegmentIndex",T);T.prototype.destroy=function(){this.a=null;return Promise.resolve()};T.prototype.destroy=T.prototype.destroy;T.prototype.find=function(b){for(var c=this.a.length-1;0<=c;--c){var d=this.a[c];if(b>=d.startTime&&b<d.endTime)return d.position}return this.a.length&&b<this.a[0].startTime?this.a[0].position:null};T.prototype.find=T.prototype.find;
T.prototype.get=function(b){if(0==this.a.length)return null;b-=this.a[0].position;return 0>b||b>=this.a.length?null:this.a[b]};T.prototype.get=T.prototype.get;T.prototype.offset=function(b){for(var c=0;c<this.a.length;++c)this.a[c].startTime+=b,this.a[c].endTime+=b};T.prototype.offset=T.prototype.offset;
T.prototype.kc=function(b){for(var c=[],d=0,e=0;d<this.a.length&&e<b.length;){var f=this.a[d],g=b[e];f.startTime<g.startTime?(c.push(f),d++):(f.startTime>g.startTime?0==d&&c.push(g):(.1<Math.abs(f.endTime-g.endTime)?c.push(new O(f.position,g.startTime,g.endTime,g.c,g.b,g.a)):c.push(f),d++),e++)}for(;d<this.a.length;)c.push(this.a[d++]);if(c.length)for(d=c[c.length-1].position+1;e<b.length;)f=b[e++],f=new O(d++,f.startTime,f.endTime,f.c,f.b,f.a),c.push(f);else c=b;this.a=c};T.prototype.merge=T.prototype.kc;
T.prototype.Zb=function(b){for(var c=0;c<this.a.length;++c)if(this.a[c].endTime>b){this.a.splice(0,c);return}this.a=[]};T.prototype.evict=T.prototype.Zb;function He(b,c){for(;b.a.length;)if(b.a[b.a.length-1].startTime>=c)b.a.pop();else break;for(;b.a.length;)if(0>=b.a[0].endTime)b.a.shift();else break;if(0!=b.a.length){var d=b.a[b.a.length-1];b.a[b.a.length-1]=new O(d.position,d.startTime,c,d.c,d.b,d.a)}};function Ie(b){this.b=b;this.a=new P(b,0);Je||(Je=[new Uint8Array([255]),new Uint8Array([127,255]),new Uint8Array([63,255,255]),new Uint8Array([31,255,255,255]),new Uint8Array([15,255,255,255,255]),new Uint8Array([7,255,255,255,255,255]),new Uint8Array([3,255,255,255,255,255,255]),new Uint8Array([1,255,255,255,255,255,255,255])])}var Je;Ie.prototype.ia=function(){return this.a.ia()};
function Ke(b){var c=Le(b);if(7<c.length)throw new B(2,3,3002);for(var d=0,e=0;e<c.length;e++)d=256*d+c[e];c=d;d=Le(b);a:{for(e=0;e<Je.length;e++)if(ac(d,Je[e])){e=!0;break a}e=!1}if(e)d=b.b.byteLength-b.a.X();else{if(8==d.length&&d[1]&224)throw new B(2,3,3001);e=d[0]&(1<<8-d.length)-1;for(var f=1;f<d.length;f++)e=256*e+d[f];d=e}d=b.a.X()+d<=b.b.byteLength?d:b.b.byteLength-b.a.X();e=new DataView(b.b.buffer,b.b.byteOffset+b.a.X(),d);b.a.I(d);return new Me(c,e)}
function Le(b){var c=b.a.fa(),d;for(d=1;8>=d&&!(c&1<<8-d);d++);if(8<d)throw new B(2,3,3002);var e=new Uint8Array(d);e[0]=c;for(c=1;c<d;c++)e[c]=b.a.fa();return e}function Me(b,c){this.id=b;this.a=c}function Ne(b){if(8<b.a.byteLength)throw new B(2,3,3002);if(8==b.a.byteLength&&b.a.getUint8(0)&224)throw new B(2,3,3001);for(var c=0,d=0;d<b.a.byteLength;d++){var e=b.a.getUint8(d);c=256*c+e}return c};function Oe(){}
Oe.prototype.parse=function(b,c,d,e){var f;c=new Ie(new DataView(c));if(440786851!=Ke(c).id)throw new B(2,3,3008);var g=Ke(c);if(408125543!=g.id)throw new B(2,3,3009);c=g.a.byteOffset;g=new Ie(g.a);for(f=null;g.ia();){var h=Ke(g);if(357149030==h.id){f=h;break}}if(!f)throw new B(2,3,3010);g=new Ie(f.a);f=1E6;for(h=null;g.ia();){var k=Ke(g);if(2807729==k.id)f=Ne(k);else if(17545==k.id)if(h=k,4==h.a.byteLength)h=h.a.getFloat32(0);else if(8==h.a.byteLength)h=h.a.getFloat64(0);else throw new B(2,3,3003);
}if(null==h)throw new B(2,3,3011);g=f/1E9;f=h*g;b=Ke(new Ie(new DataView(b)));if(475249515!=b.id)throw new B(2,3,3007);return Pe(b,c,g,f,d,e)};function Pe(b,c,d,e,f,g){function h(){return f}var k=[];b=new Ie(b.a);for(var l=null,m=null;b.ia();){var p=Ke(b);if(187==p.id){var r=Qe(p);r&&(p=d*r.Of,r=c+r.kf,null!=l&&k.push(new O(k.length,l-g,p-g,h,m,r-1)),l=p,m=r)}}null!=l&&k.push(new O(k.length,l-g,e-g,h,m,null));return k}
function Qe(b){var c=new Ie(b.a);b=Ke(c);if(179!=b.id)throw new B(2,3,3013);b=Ne(b);c=Ke(c);if(183!=c.id)throw new B(2,3,3012);c=new Ie(c.a);for(var d=0;c.ia();){var e=Ke(c);if(241==e.id){d=Ne(e);break}}return{Of:b,kf:d}};function Re(b,c){var d=ve(b,c,"Initialization");if(!d)return null;var e=b.w.ha,f=d.getAttribute("sourceURL");f&&(e=Tc(b.w.ha,[f]));f=0;var g=null;if(d=N.G(d,"range",N.Qb))f=d.start,g=d.end;return new ye(function(){return e},f,g)}
function Se(b,c){var d=Number(ue(b,Te,"presentationTimeOffset"))||0,e=ue(b,Te,"timescale"),f=1;e&&(f=N.Pb(e)||1);d=d/f||0;e=Re(b,Te);var g=b.w.contentType;f=b.w.mimeType.split("/")[1];if("text"!=g&&"mp4"!=f&&"webm"!=f)throw new B(2,4,4006);if("webm"==f&&!e)throw new B(2,4,4005);g=ve(b,Te,"RepresentationIndex");var h=ue(b,Te,"indexRange"),k=b.w.ha;h=N.Qb(h||"");if(g){var l=g.getAttribute("sourceURL");l&&(k=Tc(b.w.ha,[l]));h=N.G(g,"range",N.Qb,h)}if(!h)throw new B(2,4,4002);f=Ue(b,c,e,k,h.start,h.end,
f,d);return{createSegmentIndex:f.createSegmentIndex,findSegmentPosition:f.findSegmentPosition,getSegmentReference:f.getSegmentReference,initSegmentReference:e,ga:d}}
function Ue(b,c,d,e,f,g,h,k){var l=b.presentationTimeline,m=!b.Pa||!b.O.fc,p=b.O.start,r=b.O.duration,w=c,x=null;return{createSegmentIndex:function(){var b=[w(e,f,g),"webm"==h?w(d.c(),d.b,d.a):null];w=null;return Promise.all(b).then(function(b){var c=b[0];b=b[1]||null;c="mp4"==h?Fe(c,f,e,k):(new Oe).parse(c,b,e,k);l.Wa(c,p);x=new T(c);m&&He(x,r)})},findSegmentPosition:function(b){return x.find(b)},getSegmentReference:function(b){return x.get(b)}}}function Te(b){return b.rb};function Ve(b,c){var d=Re(b,We);var e=Xe(b);var f=te(b,We),g=f.Ka;0==g&&(g=1);var h=0;f.V?h=f.V*(g-1):f.K&&0<f.K.length&&(h=f.K[0].start);e={V:f.V,startTime:h,Ka:g,ga:f.ga,K:f.K,Va:e};if(!e.V&&!e.K&&1<e.Va.length)throw new B(2,4,4002);if(!e.V&&!b.O.duration&&!e.K&&1==e.Va.length)throw new B(2,4,4002);if(e.K&&0==e.K.length)throw new B(2,4,4002);g=f=null;b.ea.id&&b.w.id&&(g=b.ea.id+","+b.w.id,f=c[g]);h=Ye(b.O.duration,e.Ka,b.w.ha,e);f?(f.kc(h),g=b.presentationTimeline.kb(),f.Zb(g-b.O.start)):(b.presentationTimeline.Wa(h,
b.O.start),f=new T(h),g&&b.Pa&&(c[g]=f));b.Pa&&b.O.fc||He(f,b.O.duration);return{createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:f.find.bind(f),getSegmentReference:f.get.bind(f),initSegmentReference:d,ga:e.ga}}function We(b){return b.za}
function Ye(b,c,d,e){var f=e.Va.length;e.K&&e.K.length!=e.Va.length&&(f=Math.min(e.K.length,e.Va.length));for(var g=[],h=e.startTime,k=0;k<f;k++){var l=e.Va[k],m=Tc(d,[l.Fe]),p=void 0;p=null!=e.V?h+e.V:e.K?e.K[k].end:h+b;g.push(new O(k+c,h,p,function(b){return b}.bind(null,m),l.start,l.end));h=p}return g}
function Xe(b){return[b.w.za,b.Y.za,b.ea.za].filter(I.wa).map(function(b){return N.N(b,"SegmentURL")}).reduce(function(b,d){return 0<b.length?b:d}).map(function(c){c.getAttribute("indexRange")&&!b.dd&&(b.dd=!0);var d=c.getAttribute("media");c=N.G(c,"mediaRange",N.Qb,{start:0,end:null});return{Fe:d,start:c.start,end:c.end}})};function Ze(b,c,d,e){var f=$e(b);var g=te(b,af);var h=ue(b,af,"media"),k=ue(b,af,"index");g={V:g.V,timescale:g.timescale,Ka:g.Ka,ga:g.ga,Fc:g.Fc,K:g.K,ic:h,mb:k};h=g.mb?1:0;h+=g.K?1:0;h+=g.V?1:0;if(0==h)throw new B(2,4,4002);1!=h&&(g.mb&&(g.K=null),g.V=null);if(!g.mb&&!g.ic)throw new B(2,4,4002);if(g.mb){d=b.w.mimeType.split("/")[1];if("mp4"!=d&&"webm"!=d)throw new B(2,4,4006);if("webm"==d&&!f)throw new B(2,4,4005);e=se(g.mb,b.w.id,null,b.bandwidth||null,null);e=Tc(b.w.ha,[e]);b=Ue(b,c,f,e,0,null,
d,g.ga)}else g.V?(e||(b.presentationTimeline.mc(g.V),b.presentationTimeline.nc(b.O.start)),b=bf(b,g)):(h=c=null,b.ea.id&&b.w.id&&(h=b.ea.id+","+b.w.id,c=d[h]),k=cf(b,g),e=!b.Pa||!b.O.fc,c?(e&&He(new T(k),b.O.duration),c.kc(k),d=b.presentationTimeline.kb(),c.Zb(d-b.O.start)):(b.presentationTimeline.Wa(k,b.O.start),c=new T(k),h&&b.Pa&&(d[h]=c)),e&&He(c,b.O.duration),b={createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:c.find.bind(c),getSegmentReference:c.get.bind(c)});return{createSegmentIndex:b.createSegmentIndex,
findSegmentPosition:b.findSegmentPosition,getSegmentReference:b.getSegmentReference,initSegmentReference:f,ga:g.ga}}function af(b){return b.tb}
function bf(b,c){var d=b.O.duration,e=c.V,f=c.Ka,g=c.timescale,h=c.ic,k=b.bandwidth||null,l=b.w.id,m=b.w.ha;return{createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(b){return 0>b||d&&b>=d?null:Math.floor(b/e)},getSegmentReference:function(b){var c=b*e,p=c+e;d&&(p=Math.min(p,d));return 0>p||d&&c>=d?null:new O(b,c,p,function(){var d=se(h,l,b+f,k,c*g);return Tc(m,[d])},0,null)}}}
function cf(b,c){for(var d=[],e=0;e<c.K.length;e++){var f=e+c.Ka;d.push(new O(f,c.K[e].start,c.K[e].end,function(b,c,d,e,f,p){b=se(b,c,f,d,p);return Tc(e,[b]).map(function(b){return b.toString()})}.bind(null,c.ic,b.w.id,b.bandwidth||null,b.w.ha,f,c.K[e].Nf+c.Fc),0,null))}return d}function $e(b){var c=ue(b,af,"initialization");if(!c)return null;var d=b.w.id,e=b.bandwidth||null,f=b.w.ha;return new ye(function(){var b=se(c,d,null,e,null);return Tc(f,[b])},0,null)};var df={},ef={};y("shaka.media.ManifestParser.registerParserByExtension",function(b,c){ef[b]=c});y("shaka.media.ManifestParser.registerParserByMime",function(b,c){df[b]=c});function ff(){var b={},c;for(c in df)b[c]=!0;for(var d in ef)b[d]=!0;["application/dash+xml","application/x-mpegurl","application/vnd.apple.mpegurl","application/vnd.ms-sstr+xml"].forEach(function(c){b[c]=!!df[c]});["mpd","m3u8","ism"].forEach(function(c){b[c]=!!ef[c]});return b}
function gf(b,c,d,e){return t(function g(){var h,k;return v(g,function(g){switch(g.j){case 1:return qa(g,2),u(g,hf(b,c,d,e),4);case 4:return h=g.u,g["return"](new h);case 2:throw k=ta(g),k.severity=2,k;}})})}
function hf(b,c,d,e){return t(function g(){var h,k,l,m,p,r,w,x,A,R;return v(g,function(g){switch(g.j){case 1:if(e&&(h=e.toLowerCase(),k=df[h]))return g["return"](k);l=new Qa(b);m=l.da.split("/");p=m.pop();r=p.split(".");return 1<r.length&&(w=r.pop().toLowerCase(),x=ef[w])?g["return"](x):u(g,jf(b,c,d),2);case 2:A=g.u;if(R=df[A])return g["return"](R);throw new B(2,4,4E3,b);}})})}
function jf(b,c,d){return t(function f(){var g,h,k;return v(f,function(f){switch(f.j){case 1:return g=Ab([b],d),g.method="HEAD",u(f,c.request(0,g).promise,2);case 2:return h=f.u,k=h.headers["content-type"],f["return"](k?k.toLowerCase():"")}})})};function U(b,c,d){this.f=b;this.Rb=c;this.h=this.g=Infinity;this.a=1;this.b=this.c=null;this.l=0;this.m=!0;this.i=0;this.o=void 0===d?!0:d}y("shaka.media.PresentationTimeline",U);U.prototype.T=function(){return this.g};U.prototype.getDuration=U.prototype.T;U.prototype.la=function(b){this.g=b};U.prototype.setDuration=U.prototype.la;U.prototype.se=function(){return this.f};U.prototype.getPresentationStartTime=U.prototype.se;U.prototype.Dd=function(b){this.l=b};U.prototype.setClockOffset=U.prototype.Dd;
U.prototype.ub=function(b){this.m=b};U.prototype.setStatic=U.prototype.ub;U.prototype.Ac=function(b){this.h=b};U.prototype.setSegmentAvailabilityDuration=U.prototype.Ac;U.prototype.yf=function(b){this.Rb=b};U.prototype.setDelay=U.prototype.yf;U.prototype.je=function(){return this.Rb};U.prototype.getDelay=U.prototype.je;
U.prototype.Wa=function(b,c){if(0!=b.length){var d=b[b.length-1].endTime+c;this.nc(b[0].startTime+c);this.a=b.reduce(function(b,c){return Math.max(b,c.endTime-c.startTime)},this.a);this.b=Math.max(this.b,d);null!=this.f&&this.o&&(this.f=(Date.now()+this.l)/1E3-this.b-this.a)}};U.prototype.notifySegments=U.prototype.Wa;U.prototype.nc=function(b){this.c=null==this.c?b:Math.min(this.c,b)};U.prototype.notifyMinSegmentStartTime=U.prototype.nc;U.prototype.mc=function(b){this.a=Math.max(this.a,b)};
U.prototype.notifyMaxSegmentDuration=U.prototype.mc;U.prototype.offset=function(b){null!=this.c&&(this.c+=b);null!=this.b&&(this.b+=b)};U.prototype.offset=U.prototype.offset;U.prototype.U=function(){return Infinity==this.g&&!this.m};U.prototype.isLive=U.prototype.U;U.prototype.Ga=function(){return Infinity!=this.g&&!this.m};U.prototype.isInProgress=U.prototype.Ga;U.prototype.kb=function(){if(Infinity==this.h)return this.i;var b=this.Sa()-this.h;return Math.max(this.i,b)};
U.prototype.getSegmentAvailabilityStart=U.prototype.kb;U.prototype.Fd=function(b){this.i=b};U.prototype.setUserSeekStart=U.prototype.Fd;U.prototype.Sa=function(){return this.U()||this.Ga()?Math.min(Math.max(0,(Date.now()+this.l)/1E3-this.a-this.f),this.g):this.g};U.prototype.getSegmentAvailabilityEnd=U.prototype.Sa;U.prototype.jb=function(b){var c=Math.max(this.c,this.i);if(Infinity==this.h)return c;var d=this.Sa()-this.h;b=Math.min(d+b,this.qa());return Math.max(c,b)};
U.prototype.getSafeSeekRangeStart=U.prototype.jb;U.prototype.Ra=function(){return this.jb(0)};U.prototype.getSeekRangeStart=U.prototype.Ra;U.prototype.qa=function(){var b=this.U()||this.Ga()?this.Rb:0;return Math.max(0,this.Sa()-b)};U.prototype.getSeekRangeEnd=U.prototype.qa;U.prototype.Jd=function(){return null==this.f||null!=this.b?!1:!0};U.prototype.usingPresentationStartTime=U.prototype.Jd;function kf(){this.b=this.a=null;this.h=[];this.c=null;this.l=[];this.i=1;this.m={};this.o=0;this.s=new Ha(5);this.g=null;this.f=new wb}y("shaka.dash.DashParser",kf);n=kf.prototype;n.configure=function(b){this.a=b};n.start=function(b,c){this.h=[b];this.b=c;return lf(this).then(function(b){this.b&&mf(this,b);return this.c}.bind(this))};n.stop=function(){this.a=this.b=null;this.h=[];this.c=null;this.l=[];this.m={};null!=this.g&&(window.clearTimeout(this.g),this.g=null);return this.f.destroy()};
n.update=function(){lf(this)["catch"](function(b){if(this.b)this.b.onError(b)}.bind(this))};n.onExpirationUpdated=function(){};function lf(b){var c=Date.now(),d=b.b.networkingEngine.request(0,Ab(b.h,b.a.retryParameters));xb(b.f,d);return d.promise.then(function(c){if(b.b)return nf(b,c.data,c.uri)}).then(function(){var d=(Date.now()-c)/1E3;Ia(b.s,1,d);return d})}
function nf(b,c,d){c=N.rd(c,"MPD");if(!c)throw new B(2,4,4001,d);c=xe(c,b.a.retryParameters,b.a.dash.xlinkFailGracefully,d,b.b.networkingEngine);xb(b.f,c);return c.promise.then(function(c){return of(b,c,d)})}
function of(b,c,d){return t(function f(){var g,h,k,l,m,p,r,w,x,A,R,X,Y,fa,ia,Ka,Xa,ja,mg,Mc,ng,og,pg,ak,qg,rg;return v(f,function(f){switch(f.j){case 1:l=I;m=N;p=[d];r=m.N(c,"Location").map(m.Kb).filter(l.wa);0<r.length&&(w=Tc(p,r),p=b.h=w);x=m.N(c,"BaseURL").map(m.Kb);A=Tc(p,x);(R=b.a.dash.ignoreMinBufferTime)||(X=m.G(c,"minBufferTime",m.sa));b.o=m.G(c,"minimumUpdatePeriod",m.sa,-1);Y=m.G(c,"availabilityStartTime",m.bf);fa=m.G(c,"timeShiftBufferDepth",m.sa);ia=m.G(c,"suggestedPresentationDelay",
m.sa);Ka=m.G(c,"maxSegmentDuration",m.sa);Xa=c.getAttribute("type")||"static";b.c?ja=b.c.presentationTimeline:(mg=Math.max(b.a.dash.defaultPresentationDelay,1.5*X),Mc=null!=ia?ia:mg,ja=new U(Y,Mc,b.a.dash.autoCorrectDrift));ng={Pa:"static"!=Xa,presentationTimeline:ja,ea:null,O:null,Y:null,w:null,bandwidth:0,dd:!1};for(var sg=ng,bk=A,Nc=N.G(c,"mediaPresentationDuration",N.sa),Oc=[],Ya=0,Tb=N.N(c,"Period"),tb=0;tb<Tb.length;tb++){var hb=Tb[tb];Ya=N.G(hb,"start",N.sa,Ya);var Pc=N.G(hb,"duration",N.sa),
Za=null;if(tb!=Tb.length-1){var tg=N.G(Tb[tb+1],"start",N.sa);null!=tg&&(Za=tg-Ya)}else null!=Nc&&(Za=Nc-Ya);null==Za&&(Za=Pc);hb=pf(b,sg,bk,{start:Ya,duration:Za,node:hb,fc:null==Za||tb==Tb.length-1});Oc.push(hb);Pc=sg.ea.id;b.l.includes(Pc)||(b.l.push(Pc),b.c&&(b.b.filterNewPeriod(hb),b.c.periods.push(hb)));if(null==Za){Ya=null;break}Ya+=Za}null==b.c&&b.b.filterAllPeriods(Oc);null!=Nc?(g=Oc,h=Nc,k=!1):(g=Oc,h=Ya,k=!0);og=h;pg=g;ja.ub("static"==Xa);"static"!=Xa&&k||ja.la(og||Infinity);(ak=ja.U())&&
!isNaN(b.a.availabilityWindowOverride)&&(fa=b.a.availabilityWindowOverride);null==fa&&(fa=Infinity);ja.Ac(fa);ja.mc(Ka||1);if(b.c){f.B(0);break}b.c={presentationTimeline:ja,periods:pg,offlineSessionIds:[],minBufferTime:X||0};if(!ja.Jd()){f.B(0);break}qg=m.N(c,"UTCTiming");return u(f,qf(b,A,qg),4);case 4:rg=f.u;if(!b.b)return f["return"]();ja.Dd(rg);f.j=0}})})}
function pf(b,c,d,e){c.ea=rf(e.node,null,d);c.O=e;c.ea.id||(c.ea.id="__shaka_period_"+e.start);N.N(e.node,"EventStream").forEach(b.df.bind(b,e.start,e.duration));d=N.N(e.node,"AdaptationSet").map(b.af.bind(b,c)).filter(I.wa);if(c.Pa){c=[];for(var f=q(d),g=f.next();!g.done;g=f.next()){g=q(g.value.nf);for(var h=g.next();!h.done;h=g.next())c.push(h.value)}if(c.length!=(new Set(c)).size)throw new B(2,4,4018);}var k=d.filter(function(b){return!b.Ec});d.filter(function(b){return b.Ec}).forEach(function(b){var c=
b.streams[0],d=b.Ec;k.forEach(function(b){b.id==d&&b.streams.forEach(function(b){b.trickModeVideo=c})})});c=sf(k,"video");f=sf(k,"audio");if(!c.length&&!f.length)throw new B(2,4,4004);f.length||(f=[null]);c.length||(c=[null]);d=[];for(g=0;g<f.length;g++)for(h=0;h<c.length;h++)tf(b,f[g],c[h],d);b=sf(k,"text");c=[];for(f=0;f<b.length;f++)c.push.apply(c,b[f].streams);return{startTime:e.start,textStreams:c,variants:d}}function sf(b,c){return b.filter(function(b){return b.contentType==c})}
function tf(b,c,d,e){if(c||d)if(c&&d){var f=c.drmInfos;var g=d.drmInfos;if(f.length&&g.length?0<Hc(f,g).length:1){g=Hc(c.drmInfos,d.drmInfos);for(var h=0;h<c.streams.length;h++)for(var k=0;k<d.streams.length;k++)f=(d.streams[k].bandwidth||0)+(c.streams[h].bandwidth||0),f={id:b.i++,language:c.language,primary:c.hc||d.hc,audio:c.streams[h],video:d.streams[k],bandwidth:f,drmInfos:g,allowedByApplication:!0,allowedByKeySystem:!0},e.push(f)}}else for(g=c||d,h=0;h<g.streams.length;h++)f=g.streams[h].bandwidth||
0,f={id:b.i++,language:g.language||"und",primary:g.hc,audio:c?g.streams[h]:null,video:d?g.streams[h]:null,bandwidth:f,drmInfos:g.drmInfos,allowedByApplication:!0,allowedByKeySystem:!0},e.push(f)}
n.af=function(b,c){b.Y=rf(c,b.ea,null);var d=!1,e=N.N(c,"Role"),f=e.map(function(b){return b.getAttribute("value")}).filter(I.wa),g=void 0,h="text"==b.Y.contentType;h&&(g="subtitle");for(var k=0;k<e.length;k++){var l=e[k].getAttribute("schemeIdUri");if(null==l||"urn:mpeg:dash:role:2011"==l)switch(l=e[k].getAttribute("value"),l){case "main":d=!0;break;case "caption":case "subtitle":g=l}}var m=null,p=!1;N.N(c,"EssentialProperty").forEach(function(b){"http://dashif.org/guidelines/trickmode"==b.getAttribute("schemeIdUri")?
m=b.getAttribute("value"):p=!0});k=N.N(c,"Accessibility");var r=new Map;e={};k=q(k);for(l=k.next();!l.done;e={gb:e.gb},l=k.next()){l=l.value;var w=l.getAttribute("schemeIdUri");if("urn:scte:dash:cc:cea-608:2015"==w||"urn:scte:dash:cc:cea-708:2015"==w)e.gb=1,l=l.getAttribute("value"),null!=l?l.split(";").forEach(function(b){return function(c){if(c.includes("=")){c=c.split("=");var d=c[0].startsWith("CC")?c[0]:"CC"+c[0];c=c[1].split(",")[0].split(":").pop()}else d="CC"+b.gb,b.gb+=2;r.set(d,J(c))}}(e)):
r.set("CC1","und")}if(p)return null;e=N.N(c,"ContentProtection");var x=ke(e,this.a.dash.customScheme,this.a.dash.ignoreDrmInfo);e=J(c.getAttribute("lang")||"und");l=c.getAttribute("label");k=N.N(c,"Representation");f=k.map(this.ef.bind(this,b,x,g,e,l,d,f,r)).filter(function(b){return!!b});if(0==f.length){if(h)return null;throw new B(2,4,4003);}b.Y.contentType&&"application"!=b.Y.contentType||(b.Y.contentType=uf(f[0].mimeType,f[0].codecs),f.forEach(function(c){c.type=b.Y.contentType}));f.forEach(function(b){x.drmInfos.forEach(function(c){b.keyId&&
c.keyIds.push(b.keyId)})});h=k.map(function(b){return b.getAttribute("id")}).filter(I.wa);return{id:b.Y.id||"__fake__"+this.i++,contentType:b.Y.contentType,language:e,hc:d,streams:f,drmInfos:x.drmInfos,Ec:m,nf:h}};
n.ef=function(b,c,d,e,f,g,h,k,l){b.w=rf(l,b.Y,null);if(!vf(b.w))return null;b.bandwidth=N.G(l,"bandwidth",N.Pb)||0;var m=b.w.contentType;m="text"==m||"application"==m;try{var p=this.pf.bind(this);if(b.w.rb)var r=Se(b,p);else if(b.w.za)r=Ve(b,this.m);else if(b.w.tb)r=Ze(b,p,this.m,!!this.c);else{var w=b.w.ha,x=b.O.duration||0;r={createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(b){return 0<=b&&b<x?1:null},getSegmentReference:function(b){return 1!=b?null:new O(1,0,x,function(){return w},
0,null)},initSegmentReference:null,ga:0}}}catch(A){if(m&&4002==A.code)return null;throw A;}l=N.N(l,"ContentProtection");l=ne(l,this.a.dash.customScheme,c,this.a.dash.ignoreDrmInfo);return{id:this.i++,originalId:b.w.id,createSegmentIndex:r.createSegmentIndex,findSegmentPosition:r.findSegmentPosition,getSegmentReference:r.getSegmentReference,initSegmentReference:r.initSegmentReference,presentationTimeOffset:r.ga,mimeType:b.w.mimeType,codecs:b.w.codecs,frameRate:b.w.frameRate,bandwidth:b.bandwidth,width:b.w.width,
height:b.w.height,kind:d,encrypted:0<c.drmInfos.length,keyId:l,language:e,label:f,type:b.Y.contentType,primary:g,trickModeVideo:null,emsgSchemeIdUris:b.w.emsgSchemeIdUris,roles:h,channelsCount:b.w.oc,closedCaptions:k}};n.Ff=function(){this.g=null;lf(this).then(function(b){this.b&&mf(this,b)}.bind(this))["catch"](function(b){this.b&&(b.severity=1,this.b.onError(b),mf(this,0))}.bind(this))};function mf(b,c){0>b.o||(b.g=window.setTimeout(b.Ff.bind(b),1E3*Math.max(3,b.o-c,Ja(b.s))))}
function rf(b,c,d){c=c||{contentType:"",mimeType:"",codecs:"",emsgSchemeIdUris:[],frameRate:void 0,oc:null};d=d||c.ha;var e=N.Ya,f=N.be,g=N.N(b,"BaseURL").map(N.Kb),h=b.getAttribute("contentType")||c.contentType,k=b.getAttribute("mimeType")||c.mimeType,l=b.getAttribute("codecs")||c.codecs;f=N.G(b,"frameRate",f)||c.frameRate;var m=N.N(b,"InbandEventStream"),p=c.emsgSchemeIdUris.slice();m=q(m);for(var r=m.next();!r.done;r=m.next())r=r.value.getAttribute("schemeIdUri"),p.includes(r)||p.push(r);m=N.N(b,
"AudioChannelConfiguration");m=wf(m)||c.oc;h||(h=uf(k,l));return{ha:Tc(d,g),rb:N.Hb(b,"SegmentBase")||c.rb,za:N.Hb(b,"SegmentList")||c.za,tb:N.Hb(b,"SegmentTemplate")||c.tb,width:N.G(b,"width",e)||c.width,height:N.G(b,"height",e)||c.height,contentType:h,mimeType:k,codecs:l,frameRate:f,emsgSchemeIdUris:p,id:b.getAttribute("id"),oc:m}}
function wf(b){for(var c=0;c<b.length;++c){var d=b[c],e=d.getAttribute("schemeIdUri");if(e&&(d=d.getAttribute("value")))switch(e){case "urn:mpeg:dash:outputChannelPositionList:2012":return d.trim().split(/ +/).length;case "urn:mpeg:dash:23003:3:audio_channel_configuration:2011":case "urn:dts:dash:audio_channel_configuration:2012":e=parseInt(d,10);if(!e)continue;return e;case "tag:dolby.com,2014:dash:audio_channel_configuration:2011":case "urn:dolby:dash:audio_channel_configuration:2011":if(e=parseInt(d,
16)){for(b=0;e;)e&1&&++b,e>>=1;return b}}}return null}function vf(b){var c=b.rb?1:0;c+=b.za?1:0;c+=b.tb?1:0;if(0==c)return"text"==b.contentType||"application"==b.contentType?!0:!1;1!=c&&(b.rb&&(b.za=null),b.tb=null);return!0}
function xf(b,c,d,e){c=Tc(c,[d]);c=Ab(c,b.a.retryParameters);c.method=e;c=b.b.networkingEngine.request(4,c);xb(b.f,c);return c.promise.then(function(b){if("HEAD"==e){if(!b.headers||!b.headers.date)return 0;b=b.headers.date}else b=Rb(b.data);b=Date.parse(b);return isNaN(b)?0:b-Date.now()})}
function qf(b,c,d){d=d.map(function(b){return{scheme:b.getAttribute("schemeIdUri"),value:b.getAttribute("value")}});var e=b.a.dash.clockSyncUri;!d.length&&e&&d.push({scheme:"urn:mpeg:dash:utc:http-head:2014",value:e});return I.ae(d,function(b){var d=b.scheme;b=b.value;switch(d){case "urn:mpeg:dash:utc:http-head:2014":case "urn:mpeg:dash:utc:http-head:2012":return xf(this,c,b,"HEAD");case "urn:mpeg:dash:utc:http-xsdate:2014":case "urn:mpeg:dash:utc:http-iso:2014":case "urn:mpeg:dash:utc:http-xsdate:2012":case "urn:mpeg:dash:utc:http-iso:2012":return xf(this,
c,b,"GET");case "urn:mpeg:dash:utc:direct:2014":case "urn:mpeg:dash:utc:direct:2012":return d=Date.parse(b),isNaN(d)?0:d-Date.now();case "urn:mpeg:dash:utc:http-ntp:2014":case "urn:mpeg:dash:utc:ntp:2014":case "urn:mpeg:dash:utc:sntp:2014":return Na("NTP UTCTiming scheme is not supported"),Promise.reject();default:return Na("Unrecognized scheme in UTCTiming element",d),Promise.reject()}}.bind(b))["catch"](function(){Na("A UTCTiming element should always be given in live manifests! This content may not play on clients with bad clocks!");
return 0})}n.df=function(b,c,d){var e=N.Ya,f=d.getAttribute("schemeIdUri")||"",g=d.getAttribute("value")||"",h=N.G(d,"timescale",e)||1;N.N(d,"Event").forEach(function(d){var k=N.G(d,"presentationTime",e)||0,m=N.G(d,"duration",e)||0;k=k/h+b;m=k+m/h;null!=c&&(k=Math.min(k,b+c),m=Math.min(m,b+c));d={schemeIdUri:f,value:g,startTime:k,endTime:m,id:d.getAttribute("id")||"",eventElement:d};this.b.onTimelineRegionAdded(d)}.bind(this))};
n.pf=function(b,c,d){b=Ab(b,this.a.retryParameters);null!=c&&(b.headers.Range="bytes="+c+"-"+(null!=d?d:""));c=this.b.networkingEngine.request(1,b);xb(this.f,c);return c.promise.then(function(b){return b.data})};function uf(b,c){return cd(Mb(b,c))?"text":b.split("/")[0]}ef.mpd=kf;df["application/dash+xml"]=kf;function yf(b,c,d,e){this.b=b;this.type=c;this.a=d;this.segments=e||null}function zf(b,c,d,e){this.id=b;this.name=c;this.a=d;this.value=void 0===e?null:e}zf.prototype.toString=function(){function b(b){return b.name+"="+(isNaN(Number(b.value))?'"'+b.value+'"':b.value)}var c="#"+this.name,d=this.a?this.a.map(b):[];this.value&&d.unshift(this.value);0<d.length&&(c+=":"+d.join(","));return c};function Af(b,c){this.name=b;this.value=c}
zf.prototype.getAttribute=function(b){var c=this.a.filter(function(c){return c.name==b});return c.length?c[0]:null};function Bf(b,c,d){return(b=b.getAttribute(c))?b.value:d||null}function Cf(b,c){this.b=c;this.a=b};function Df(b,c){return b.filter(function(b){return b.name==c})}function Ef(b,c){var d=Df(b,c);return d.length?d[0]:null}function Ff(b,c,d){return b.filter(function(b){var e=b.getAttribute("TYPE");b=b.getAttribute("GROUP-ID");return e.value==c&&b.value==d})};function Gf(b){this.b=b;this.a=0}function Hf(b){If(b,/[ \t]+/gm)}function If(b,c){c.lastIndex=b.a;var d=c.exec(b.b);d=null==d?null:{position:d.index,length:d[0].length,rf:d};if(b.a==b.b.length||null==d||d.position!=b.a)return null;b.a+=d.length;return d.rf}function Jf(b){return b.a==b.b.length?null:(b=If(b,/[^ \t\n]*/gm))?b[0]:null};function Kf(){this.a=0}
function Lf(b,c,d){c=Rb(c);c=c.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n").trim();var e=c.split(/\n+/m);if(!/^#EXTM3U($|[ \t\n])/m.test(e[0]))throw new B(2,4,4015);c=0;for(var f=1;f<e.length;f++)if(!/^#(?!EXT)/m.test(e[f])){var g=Mf(b,e[f]);--b.a;if(Nf.includes(g.name)){c=1;break}else"EXT-X-STREAM-INF"==g.name&&(f+=1)}f=[];for(g=1;g<e.length;)if(/^#(?!EXT)/m.test(e[g]))g+=1;else{var h=Mf(b,e[g]);if(Of.includes(h.name)){if(1!=c)throw new B(2,4,4017);e=e.splice(g,e.length-g);b=Pf(b,d,e,f);return new yf(d,
c,f,b)}f.push(h);g+=1;"EXT-X-STREAM-INF"==h.name&&(h.a.push(new Af("URI",e[g])),g+=1)}return new yf(d,c,f)}function Pf(b,c,d,e){var f=[],g=[];d.forEach(function(d){if(/^(#EXT)/.test(d))d=Mf(b,d),Nf.includes(d.name)?e.push(d):g.push(d);else{if(/^#(?!EXT)/m.test(d))return[];d=Tc([c],[d.trim()])[0];f.push(new Cf(d,g));g=[]}});return f}
function Mf(b,c){var d=b.a++,e=c.match(/^#(EXT[^:]*)(?::(.*))?$/);if(!e)throw new B(2,4,4016,c);var f=e[1],g=e[2];e=[];var h;if(g){g=new Gf(g);var k;(k=If(g,/^([^,=]+)(?:,|$)/g))&&(h=k[1]);for(var l=/([^=]+)=(?:"([^"]*)"|([^",]*))(?:,|$)/g;k=If(g,l);)e.push(new Af(k[1],k[2]||k[3]))}return new zf(d,f,e,h)}var Nf="EXT-X-TARGETDURATION EXT-X-MEDIA-SEQUENCE EXT-X-DISCONTINUITY-SEQUENCE EXT-X-PLAYLIST-TYPE EXT-X-MAP EXT-X-I-FRAMES-ONLY EXT-X-ENDLIST".split(" "),Of="EXTINF EXT-X-BYTERANGE EXT-X-DISCONTINUITY EXT-X-PROGRAM-DATE-TIME EXT-X-KEY EXT-X-DATERANGE".split(" ");function Qf(b){try{var c=Qf.parse(b);return lb({uri:b,data:c.data,headers:{"content-type":c.contentType}})}catch(d){return jb(d)}}y("shaka.net.DataUriPlugin",Qf);
Qf.parse=function(b){var c=b.split(":");if(2>c.length||"data"!=c[0])throw new B(2,1,1004,b);c=c.slice(1).join(":").split(",");if(2>c.length)throw new B(2,1,1004,b);var d=c[0];c=window.decodeURIComponent(c.slice(1).join(","));d=d.split(";");var e=null;1<d.length&&(e=d[1]);if("base64"==e)b=Yb(c).buffer;else{if(e)throw new B(2,1,1005,b);b=Wb(c)}return{data:b,contentType:d[0]}};zb("data",Qf);function Rf(){var b=this;this.g=this.c=null;this.$=1;this.D=new Map;this.R=new Set;this.a=new Map;this.b=null;this.v="";this.s=new Kf;this.o=0;this.i=new H(function(){Sf(b)});this.f=Tf;this.m=null;this.A=0;this.M=Infinity;this.h=new wb;this.P=[];this.l=new Map}y("shaka.hls.HlsParser",Rf);n=Rf.prototype;n.configure=function(b){this.g=b};
n.start=function(b,c){var d=this;return t(function f(){var g;return v(f,function(f){switch(f.j){case 1:return d.c=c,u(f,Uf(d,b),2);case 2:return g=f.u,d.v=g.uri,u(f,Vf(d,g.data),3);case 3:return 0<d.o&&d.i.start(d.o,!1),f["return"](d.m)}})})};n.stop=function(){this.i.stop();this.g=this.c=null;this.D.clear();this.R.clear();this.a.clear();this.m=null;return this.h.destroy()};
n.update=function(){if(this.f!=Wf.Ca){for(var b=[],c=q(this.a.values()),d=c.next();!d.done;d=c.next())b.push(Xf(this,d.value));return Promise.all(b)}};function Xf(b,c){Uf(b,c.Td).then(function(b){var d=Wf,f=Lf(this.s,b.data,b.uri);if(1!=f.type)throw new B(2,4,4017);b=Ef(f.a,"EXT-X-MEDIA-SEQUENCE");var g=c.stream;Yf(this,c.Tb,f,b?Number(b.value):0,g.mimeType,g.codecs).then(function(b){c.sb.a=b;b=b[b.length-1];Ef(f.a,"EXT-X-ENDLIST")&&(Zf(this,d.Ca),this.b.la(b.endTime))}.bind(this))}.bind(b))}
n.onExpirationUpdated=function(){};
function Vf(b,c){var d=Lf(b.s,c,b.v);if(0!=d.type)throw new B(2,4,4022);return $f(b,d).then(function(b){this.c.filterAllPeriods([b]);for(var c=Infinity,d=0,e=Infinity,k=q(this.a.values()),l=k.next();!l.done;l=k.next())l=l.value,c=Math.min(c,l.lc),d=Math.max(d,l.lc),"text"!=l.stream.type&&(e=Math.min(e,l.duration));this.f!=Wf.Ca?(this.b=new U(0,3*this.A),this.b.ub(!1)):(this.b=new U(null,0),this.b.ub(!0));ag(this);if(this.f!=Wf.Ca){this.o=this.M;this.f==Wf.Hc&&(c=this.b.Rb,isNaN(this.g.availabilityWindowOverride)||
(c=this.g.availabilityWindowOverride),this.b.Ac(c));for(c=0;95443.7176888889<=d;)c+=95443.7176888889,d-=95443.7176888889;if(c)for(d=q(this.a.values()),l=d.next();!l.done;l=d.next())e=l.value,95443.7176888889>e.lc&&(e.stream.presentationTimeOffset=-c,e.sb.offset(c))}else for(this.b.la(e),this.b.offset(-c),d=q(this.a.values()),l=d.next();!l.done;l=d.next())l=l.value,l.stream.presentationTimeOffset=c,l.sb.offset(-c),He(l.sb,e);this.m={presentationTimeline:this.b,periods:[b],offlineSessionIds:[],minBufferTime:0}}.bind(b))}
function $f(b,c){var d=c.a,e=Df(c.a,"EXT-X-MEDIA"),f=e.filter(function(b){return"SUBTITLES"==V(b,"TYPE")}.bind(b)).map(function(b){return bg(this,b)}.bind(b));e=e.filter(function(b){return"CLOSED-CAPTIONS"==V(b,"TYPE")});cg(b,e);return Promise.all(f).then(function(b){var e=Df(d,"EXT-X-STREAM-INF").map(function(b){return dg(this,b,c)}.bind(this));return Promise.all(e).then(function(c){return{startTime:0,variants:c.reduce(I.Xb,[]),textStreams:b}}.bind(this))}.bind(b))}
function dg(b,c,d){var e=Bf(c,"CODECS","avc1.42E01E,mp4a.40.2").split(/\s*,\s*/),f=c.getAttribute("RESOLUTION"),g=null,h=null,k=Bf(c,"FRAME-RATE"),l=Number(V(c,"BANDWIDTH"));if(f){var m=f.value.split("x");g=m[0];h=m[1]}d=Df(d.a,"EXT-X-MEDIA");d=d.filter(function(b){return"CLOSED-CAPTIONS"!=V(b,"TYPE")});d=d.filter(function(b){var c=Bf(b,"URI")||"";return"SUBTITLES"==(Bf(b,"TYPE")||"")||""!=c});var p=Bf(c,"AUDIO"),r=Bf(c,"VIDEO");p?d=Ff(d,"AUDIO",p):r&&(d=Ff(d,"VIDEO",r));if(m=eg("text",e)){var w=
Bf(c,"SUBTITLES");w&&(w=Ff(d,"SUBTITLES",w),w.length&&(b.D.get(w[0].id).stream.codecs=m));sb(e,m)}d=d.map(function(b){return fg(this,b,e)}.bind(b));var x=[],A=[];return Promise.all(d).then(function(b){p?x=b:r&&(A=b);b=!1;if(x.length||A.length)if(x.length)if(V(c,"URI")==x[0].Tb){var d="audio";b=!0}else d="video";else d="audio";else 1==e.length?(d=eg("video",e),d=f||k||d?"video":"audio"):(d="video",e=[e.join(",")]);return b?Promise.resolve():gg(this,c,e,d)}.bind(b)).then(function(b){b&&("audio"==b.stream.type?
x=[b]:A=[b]);A&&hg(A);x&&hg(x);return ig(this,x,A,l,g,h,k)}.bind(b))}function hg(b){b.forEach(function(b){var c=b.stream.codecs.split(",");c=c.filter(function(b){return"mp4a.40.34"!=b});b.stream.codecs=c.join(",")})}
function ig(b,c,d,e,f,g,h){d.forEach(function(b){if(b=b.stream)b.width=Number(f)||void 0,b.height=Number(g)||void 0,b.frameRate=Number(h)||void 0}.bind(b));c.length||(c=[null]);d.length||(d=[null]);for(var k=[],l=0;l<c.length;l++)for(var m=0;m<d.length;m++){var p=c[l]?c[l].stream:null,r=d[m]?d[m].stream:null,w=c[l]?c[l].drmInfos:null,x=d[m]?d[m].drmInfos:null,A=void 0;if(p&&r)if(w.length&&x.length?0<Hc(w,x).length:1)A=Hc(w,x);else continue;else p?A=w:r&&(A=x);w=(d[l]?d[l].Tb:"")+" - "+(c[l]?c[l].Tb:
"");b.R.has(w)||(p=jg(b,p,r,e,A),k.push(p),b.R.add(w))}return k}function jg(b,c,d,e,f){return{id:b.$++,language:c?c.language:"und",primary:!!c&&c.primary||!!d&&d.primary,audio:c,video:d,bandwidth:e,drmInfos:f,allowedByApplication:!0,allowedByKeySystem:!0}}function bg(b,c){V(c,"TYPE");return fg(b,c,[]).then(function(b){return b.stream})}
function cg(b,c){for(var d=q(c),e=d.next();!e.done;e=d.next()){e=e.value;V(e,"TYPE");var f=Bf(e,"LANGUAGE")||"und";f=J(f);var g=V(e,"GROUP-ID");e=V(e,"INSTREAM-ID");b.l.get(g)||b.l.set(g,new Map);b.l.get(g).set(e,f)}}
function fg(b,c,d){var e=V(c,"URI");if(b.a.has(e))return Promise.resolve(b.a.get(e));var f=V(c,"TYPE").toLowerCase();"subtitles"==f&&(f="text");var g=J(Bf(c,"LANGUAGE","und")),h=Bf(c,"NAME"),k=c.getAttribute("DEFAULT"),l=c.getAttribute("AUTOSELECT"),m=Bf(c,"CHANNELS");return kg(b,e,d,f,g,!!k||!!l,h,"audio"==f?lg(m):null,null).then(function(b){if(this.a.has(e))return this.a.get(e);this.D.set(c.id,b);this.a.set(e,b);return b}.bind(b))}
function lg(b){if(!b)return null;b=b.split("/")[0];return parseInt(b,10)}function gg(b,c,d,e){var f=V(c,"URI");if(b.a.has(f))return Promise.resolve(b.a.get(f));c=Bf(c,"CLOSED-CAPTIONS");var g=null;"video"==e&&c&&"NONE"!=c&&(g=b.l.get(c));return kg(b,f,d,e,"und",!1,null,null,g).then(function(b){if(this.a.has(f))return this.a.get(f);this.a.set(f,b);return b}.bind(b))}
function kg(b,c,d,e,f,g,h,k,l){var m=Tc([b.v],[c])[0],p,r="",w;return Uf(b,m).then(function(c){m=c.uri;p=Lf(b.s,c.data,m);if(1!=p.type)throw new B(2,4,4017);c=p;var f=Wf,g=Ef(c.a,"EXT-X-PLAYLIST-TYPE"),h=Ef(c.a,"EXT-X-ENDLIST");h=g&&"VOD"==g.value||h;g=g&&"EVENT"==g.value&&!h;g=!h&&!g;h?Zf(b,f.Ca):(g?Zf(b,f.Hc):Zf(b,f.Od),c=ug(c.a,"EXT-X-TARGETDURATION"),c=Number(c.value),b.A=Math.max(c,b.A),b.M=Math.min(c,b.M));if(1==d.length)r=d[0];else if(c=eg(e,d),null!=c)r=c;else throw new B(2,4,4025,d);return vg(b,
e,r,p)}).then(function(d){w=d;d=Ef(p.a,"EXT-X-MEDIA-SEQUENCE");return Yf(b,c,p,d?Number(d.value):0,w,r)}).then(function(d){var A=d[0].startTime,x=d[d.length-1].endTime,X=x-A;d=new T(d);var Y=wg(p),fa=void 0;"text"==e&&(fa="subtitle");var ia=[];p.segments.forEach(function(b){b=Df(b.b,"EXT-X-KEY");ia.push.apply(ia,b)});var Ka=!1,Xa=[],ja=null;ia.forEach(function(b){if("NONE"!=V(b,"METHOD")){Ka=!0;var c=V(b,"KEYFORMAT");if(b=(c=xg[c])?c(b):null)b.keyIds.length&&(ja=b.keyIds[0]),Xa.push(b)}});if(Ka&&
!Xa.length)throw new B(2,4,4026);return{stream:{id:b.$++,originalId:h,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:d.find.bind(d),getSegmentReference:d.get.bind(d),initSegmentReference:Y,presentationTimeOffset:0,mimeType:w,codecs:r,kind:fa,encrypted:Ka,keyId:ja,language:f,label:h,type:e,primary:g,trickModeVideo:null,emsgSchemeIdUris:null,frameRate:void 0,width:void 0,height:void 0,bandwidth:void 0,roles:[],channelsCount:k,closedCaptions:l},sb:d,drmInfos:Xa,Tb:c,Td:m,lc:A,Zf:x,
duration:X}})}function wg(b){var c=Df(b.a,"EXT-X-MAP");if(!c.length)return null;if(1<c.length)throw new B(2,4,4020);c=c[0];var d=V(c,"URI"),e=Tc([b.b],[d])[0];b=0;d=null;if(c=Bf(c,"BYTERANGE"))b=c.split("@"),c=Number(b[0]),b=Number(b[1]),d=b+c-1;return new ye(function(){return[e]},b,d)}
function yg(b,c,d,e){var f=c.b,g=c.a;c=ug(f,"EXTINF").value.split(",");c=e+Number(c[0]);var h=0,k=null;if(f=Ef(f,"EXT-X-BYTERANGE"))h=f.value.split("@"),f=Number(h[0]),h=h[1]?Number(h[1]):b.a+1,k=h+f-1;return new O(d,e,c,function(){return[g]},h,k)}function ag(b){b.b&&(b.P.forEach(function(c){b.b.Wa(c,0)}),b.P=[])}
function Yf(b,c,d,e,f,g){var h=d.segments,k=[],l=h[0].a,m=yg(null,h[0],e,0);d=wg(d);return zg(b,c,d,m,f,g).then(function(b){l.split("/").pop();for(var c=0;c<h.length;++c){var d=k[k.length-1];d=yg(d,h[c],e+c,0==c?b:d.endTime);k.push(d)}this.P.push(k);ag(this);return k}.bind(b))}
function Ag(b,c){var d=b.c.networkingEngine,e=Ab(c.c(),b.g.retryParameters),f={},g=c.b;f.Range="bytes="+g+"-"+(g+2048-1);var h={};if(0!=g||null!=c.a)g="bytes="+g+"-",null!=c.a&&(g+=c.a),h.Range=g;e.headers=f;f=d.request(1,e);xb(b.h,f);return f.promise["catch"](function(){Na("Unable to fetch a partial HLS segment! Falling back to a full segment request, which is expensive!  Your server should support Range requests and CORS preflights.",e.uris[0]);e.headers=h;var c=d.request(1,e);xb(b.h,c);return c.promise})}
function zg(b,c,d,e,f,g){if(b.m&&(c=b.a.get(c).sb.get(e.position)))return Promise.resolve(c.startTime);e=[Ag(b,e)];if("video/mp4"==f||"audio/mp4"==f)d?e.push(Ag(b,d)):e.push(e[0]);return Promise.all(e).then(function(b){if("video/mp4"==f||"audio/mp4"==f)return Bg(b[0].data,b[1].data);if("audio/mpeg"==f)return 0;if("video/mp2t"==f)return Cg(b[0].data);if("application/mp4"==f||f.startsWith("text/")){b=b[0].data;var c=Mb(f,g);if(cd(c)){var d=new ad(null);dd(d,c);b=d.ec(b)}else b=0;return b}throw new B(2,
4,4030);}.bind(b))}function Bg(b,c){var d=0;(new Q).F("moov",S).F("trak",S).F("mdia",S).aa("mdhd",function(b){b.reader.I(0==b.version?8:16);d=b.reader.C();b.parser.stop()}).parse(c,!0);if(!d)throw new B(2,4,4030);var e=0,f=!1;(new Q).F("moof",S).F("traf",S).aa("tfdt",function(b){e=(0==b.version?b.reader.C():b.reader.$a())/d;f=!0;b.parser.stop()}).parse(b,!0);if(!f)throw new B(2,4,4030);return e}
function Cg(b){function c(){throw new B(2,4,4030);}b=new P(new DataView(b),0);for(var d=0,e=0;;)if(d=b.X(),e=b.fa(),71!=e&&c(),b.qb()&16384||c(),e=(b.fa()&48)>>4,0!=e&&2!=e||c(),3==e&&(e=b.fa(),b.I(e)),1!=b.C()>>8)b.seek(d+188),e=b.fa(),71!=e&&(b.seek(d+192),e=b.fa()),71!=e&&(b.seek(d+204),e=b.fa()),71!=e&&c(),b.zd(1);else return b.I(3),d=b.fa()>>6,0!=d&&1!=d||c(),0==b.fa()&&c(),d=b.fa(),e=b.qb(),b=b.qb(),(1073741824*((d&14)>>1)+((e&65534)<<14|(b&65534)>>1))/9E4}
function eg(b,c){for(var d=Dg[b],e=0;e<d.length;e++)for(var f=0;f<c.length;f++)if(d[e].test(c[f].trim()))return c[f].trim();return"text"==b?"":null}
function vg(b,c,d,e){e=e.segments[0].a;var f=(new Qa(e)).da.split(".").pop(),g=Eg[c][f];if(g)return Promise.resolve(g);if("text"==c)return d&&"vtt"!=d?Promise.resolve("application/mp4"):Promise.resolve("text/vtt");c=Ab([e],b.g.retryParameters);c.method="HEAD";c=b.c.networkingEngine.request(1,c);xb(b.h,c);return c.promise.then(function(b){b=b.headers["content-type"];if(!b)throw new B(2,4,4021,f);return b.split(";")[0]})}
function V(b,c){var d=b.getAttribute(c);if(!d)throw new B(2,4,4023,c);return d.value}function ug(b,c){var d=Ef(b,c);if(!d)throw new B(2,4,4024,c);return d}function Uf(b,c){var d=b.c.networkingEngine.request(0,Ab([c],b.g.retryParameters));xb(b.h,d);return d.promise}
var Dg={audio:[/^vorbis$/,/^opus$/,/^flac$/,/^mp4a/,/^[ae]c-3$/],video:[/^avc/,/^hev/,/^hvc/,/^vp0?[89]/,/^av1$/],text:[/^vtt$/,/^wvtt/,/^stpp/]},Eg={audio:{mp4:"audio/mp4",m4s:"audio/mp4",m4i:"audio/mp4",m4a:"audio/mp4",ts:"video/mp2t"},video:{mp4:"video/mp4",m4s:"video/mp4",m4i:"video/mp4",m4v:"video/mp4",ts:"video/mp2t"},text:{mp4:"application/mp4",m4s:"application/mp4",m4i:"application/mp4",vtt:"text/vtt",ttml:"application/ttml+xml"}};
function Sf(b){t(function d(){var e;return v(d,function(d){switch(d.j){case 1:if(!b.c)return d["return"]();qa(d,2);return u(d,b.update(),4);case 4:b.i.start(b.o,!1);sa(d,0);break;case 2:e=ta(d),e.severity=1,b.c.onError(e),b.i.start(.1,!1),d.j=0}})})}function Zf(b,c){b.f=c;b.b&&b.b.ub(b.f==Wf.Ca);b.f!=Wf.Ca||b.i.stop()}
var xg={"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":function(b){var c=V(b,"METHOD");Cd("HLS SAMPLE-AES-CENC","SAMPLE-AES-CENC will no longer be supported, see Issue #1227");if(!["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].includes(c))return null;c=V(b,"URI");c=Qf.parse(c);c=new Uint8Array(c.data);c=Uc("com.widevine.alpha",[{initDataType:"cenc",initData:c}]);if(b=Bf(b,"KEYID"))c.keyIds=[b.substr(2).toLowerCase()];return c}},Tf="VOD",Wf={Ca:Tf,Od:"EVENT",Hc:"LIVE"};ef.m3u8=Rf;
df["application/x-mpegurl"]=Rf;df["application/vnd.apple.mpegurl"]=Rf;function Fg(){this.a=new Map}function Gg(b,c){b.a.has(c)||b.a.set(c,new Hg);return b.a.get(c)}function Hg(){this.text=this.variant=null};function Ig(b,c){this.a=b;this.b=new Set([b]);c=c||[];for(var d=q(c),e=d.next();!e.done;e=d.next())this.add(e.value)}Ig.prototype.add=function(b){return Jg(this.a,b)?(this.b.add(b),!0):!1};function Jg(b,c){var d;if(!(d=!!b.audio!=!!c.audio||!!b.video!=!!c.video||b.language!=c.language)&&(d=b.audio&&c.audio)){d=b.audio;var e=c.audio;d=!(d.channelsCount==e.channelsCount&&Kg(d,e)&&Lg(d.roles,e.roles))}!d&&(d=b.video&&c.video)&&(d=b.video,e=c.video,d=!(Kg(d,e)&&Lg(d.roles,e.roles)));return d?!1:!0}
Ig.prototype.values=function(){return this.b.values()};function Kg(b,c){if(b.mimeType!=c.mimeType)return!1;var d=b.codecs.split(",").map(function(b){return Pb(b)[0]}),e=c.codecs.split(",").map(function(b){return Pb(b)[0]});if(d.length!=e.length)return!1;d.sort();e.sort();for(var f=0;f<d.length;f++)if(d[f]!=e[f])return!1;return!0}
function Lg(b,c){var d=new Set(b),e=new Set(c);d["delete"]("main");e["delete"]("main");if(d.size!=e.size)return!1;d=q(d);for(var f=d.next();!f.done;f=d.next())if(!e.has(f.value))return!1;return!0};function Mg(b){this.a=b;this.b=new Ng(b.language,"",b.audio&&b.audio.channelsCount?b.audio.channelsCount:0)}Mg.prototype.create=function(b){var c=this,d=b.filter(function(b){return Jg(c.a,b)});return d.length?new Ig(d[0],d):this.b.create(b)};function Ng(b,c,d){this.c=b;this.b=c;this.a=d}
Ng.prototype.create=function(b){var c=[];c=Og(b,this.c);var d=b.filter(function(b){return b.primary});c=c.length?c:d.length?d:b;this.b&&(b=Pg(c,this.b),b.length&&(c=b));this.a&&(b=K.Uc(c,this.a),b.length&&(c=b));b=new Ig(c[0]);c=q(c);for(d=c.next();!d.done;d=c.next())d=d.value,Jg(b.a,d)&&b.add(d);return b};function Og(b,c){var d=J(c),e=zd(d,b.map(function(b){return yd(b)}));return e?b.filter(function(b){return e==yd(b)}):[]}
function Pg(b,c){return b.filter(function(b){var d=b.audio;b=b.video;return d&&0<=d.roles.indexOf(c)||b&&0<=b.roles.indexOf(c)})};function Qg(b){var c=this;this.c=b;this.a=new Set;this.b=new H(function(){Rg(c,!1)});this.b.start(.25,!0)}Qg.prototype.L=function(){this.b.stop();for(var b=q(this.a),c=b.next();!c.done;c=b.next())c.value.L();this.a.clear()};function Rg(b,c){for(var d=q(b.a),e=d.next();!e.done;e=d.next())e.value.g(b.c.currentTime,c)};function Sg(b,c,d){var e=this;this.c=Tg;this.f=.5;this.h=b;this.l=d;this.i=c;this.b=function(){};this.a=function(){};this.m=[{Ld:Tg,is:Ug,Pc:function(){return e.a()}},{Ld:Ug,is:Tg,Pc:function(){return e.b()}}];this.f>=this.h&&(Na("Rebuffering threshold is set too low!  This could cause poor buffering behavior during playback!"),this.f=this.h/2)}Sg.prototype.L=function(){this.b=function(){};this.a=function(){}};
Sg.prototype.g=function(b){var c=this.c==Ug?this.f:this.h;b=this.i(b);c=this.l()||b>=c?Ug:Tg;b=q(this.m);for(var d=b.next();!d.done;d=b.next())d=d.value,this.c==d.Ld&&c==d.is&&d.Pc();this.c=c};function Vg(b,c,d){b.b=c;b.a=d}var Tg=0,Ug=1;function Wg(b){this.g=b;this.f=Xg(b);this.a=b.a.currentTime;this.b=Date.now()/1E3;this.c=function(){}}function Yg(b,c){b.c=c}function Zg(b){this.a=b}function Xg(b){if(b.a.paused||0==b.a.playbackRate||null==b.a.buffered)var c=!1;else a:{c=b.a.buffered;b=b.a.currentTime;for(var d=0;d<c.length;d++){var e=c.start(d),f=c.end(d);if(!(b<e||b>f-.5)){c=!0;break a}}c=!1}return c};function $g(b,c,d,e){this.a=b;this.s=c;this.m=d;this.o=e;this.f=new Eb;this.b=null;this.h=!1;this.l=b.readyState;this.c=!1;this.v=new Wg(new Zg(b));Yg(this.v,function(){b.currentTime+=.1});this.g=!1;c=this.i.bind(this);G(this.f,b,"waiting",c);this.b=new H(c);this.b.start(.25,!0)}$g.prototype.L=function(){this.f&&(this.f.L(),this.f=null);null!=this.b&&(this.b.stop(),this.b=null);this.a=this.s=this.o=null};$g.prototype.pb=function(){this.g=!0;this.i()};
$g.prototype.i=function(){if(0!=this.a.readyState){if(this.a.seeking){if(!this.h)return}else this.h=!1;if(!this.a.paused){this.a.readyState!=this.l&&(this.c=!1,this.l=this.a.readyState);var b=this.m.smallGapLimit,c=this.a.currentTime,d=this.a.buffered;a:{if(d&&d.length&&!(1==d.length&&1E-6>d.end(0)-d.start(0))){var e=Qb("Edge/")||Qb("Trident/")||Qb("Tizen")||Qb("CrKey")?.5:.1;for(var f=0;f<d.length;f++)if(d.start(f)>c&&(0==f||d.end(f-1)-c<=e)){e=f;break a}}e=null}if(null==e){d=this.v;e=d.g;c=Xg(e);
e=e.a.currentTime;f=Date.now()/1E3;if(d.a!=e||d.f!=c)d.b=f,d.a=e,d.f=c;e=f-d.b;1<=e&&c&&d.c(d.a,e)}else if(0!=e||this.g){f=d.start(e);var g=this.s.qa();if(!(f>=g)){g=f-c;b=g<=b;var h=!1;.001>g||(b||this.c||(this.c=!0,c=new D("largegap",{currentTime:c,gapSize:g}),c.cancelable=!0,this.o(c),this.m.jumpLargeGaps&&!c.defaultPrevented&&(h=!0)),!b&&!h)||(0!=e&&d.end(e-1),this.a.currentTime=f)}}}}};function ah(b){this.c=b;this.a=null;this.b=function(){}}ah.prototype.L=function(){this.a=this.c=null;this.b=function(){}};ah.prototype.g=function(b){for(var c=this.a,d=this.c.periods[0],e=q(this.c.periods),f=e.next();!f.done;f=e.next())f=f.value,b>=f.startTime&&(d=f);b=d;c!=b&&this.b(b);this.a=b};function bh(b,c){b.b=c};function ch(b,c,d){this.a=b;this.i=c;this.h=d;this.c=new Eb;this.f=1;this.g=!1;this.b=null;0<b.readyState?this.nd():Hb(this.c,b,"loadedmetadata",this.nd.bind(this));G(this.c,b,"ratechange",this.Qe.bind(this))}n=ch.prototype;n.L=function(){this.c&&(this.c.L(),this.c=null);null!=this.b&&(this.b.stop(),this.b=null);this.a=this.i=null};function dh(b){return 0<b.a.readyState?b.a.currentTime:b.h}function eh(b,c){0<b.a.readyState?fh(b,b.a.currentTime,c):(b.h=c,setTimeout(b.i,0))}n.ib=function(){return this.f};
function gh(b,c){null!=b.b&&(b.b.stop(),b.b=null);b.f=c;b.a.playbackRate=b.g||0>c?0:c;!b.g&&0>c&&(b.b=new H(function(){b.a.currentTime+=c/4}),b.b.start(.25,!0))}n.Qe=function(){var b=this.g||0>this.f?0:this.f;this.a.playbackRate&&this.a.playbackRate!=b&&gh(this,this.a.playbackRate)};n.nd=function(){.001>Math.abs(this.a.currentTime-this.h)?this.od():(Hb(this.c,this.a,"seeking",this.od.bind(this)),this.a.currentTime=0==this.a.currentTime?this.h:this.a.currentTime)};
n.od=function(){var b=this;G(this.c,this.a,"seeking",function(){return b.i()})};function fh(b,c,d){function e(){!b.a||10<=f++||b.a.currentTime!=c||(b.a.currentTime=d,setTimeout(e,100))}b.a.currentTime=d;var f=0;setTimeout(e,100)};function hh(b,c,d,e,f,g,h){this.c=b;this.a=c;this.m=d;this.h=e;this.l=g;this.f=null;this.g=new $g(b,c,e,h);c=this.Se.bind(this);null==f?f=Infinity>this.a.T()?this.a.Ra():this.a.qa():0>f&&(f=this.a.qa()+f);f=ih(this,jh(this,f));this.b=new ch(b,c,f);this.f=new H(this.Pe.bind(this));this.f.start(.25,!0)}n=hh.prototype;n.L=function(){this.b&&(this.b.L(),this.b=null);this.g&&(this.g.L(),this.g=null);this.f&&(this.f.stop(),this.f=null);this.c=this.b=this.a=this.l=this.h=null};
function kh(b){var c=dh(b.b);0<b.c.readyState&&(b.c.paused||(c=jh(b,c)));return c}n.ib=function(){return this.b.ib()};n.pb=function(){this.g.pb()};n.Pe=function(){if(0!=this.c.readyState&&!this.c.paused){var b=this.c.currentTime,c=this.a.Ra(),d=this.a.qa();3>d-c&&(c=d-3);b<c&&(b=lh(this,b),this.c.currentTime=b)}};n.Se=function(){var b=this.g;b.h=!0;b.g=!1;b.c=!1;var c=dh(this.b);b=lh(this,c);if(.001<Math.abs(b-c)&&(c=(new Date).getTime()/1E3,!this.i||this.i<c-1)){this.i=c;eh(this.b,b);return}this.l()};
function ih(b,c){var d=b.a.T();return c>=d?d-b.h.durationBackoff:c}function lh(b,c){var d=Qc.bind(null,b.c.buffered),e=Math.max(b.m,b.h.rebufferingGoal),f=b.h.safeSeekOffset,g=b.a.Ra(),h=b.a.qa(),k=b.a.T();3>h-g&&(g=h-3);var l=b.a.jb(e),m=b.a.jb(f);e=b.a.jb(e+f);return c>=k?ih(b,c):c>h?h:c<g?d(m)?m:e:c>=l||d(c)?c:e}function jh(b,c){var d=b.a.Ra();if(c<d)return d;d=b.a.qa();return c>d?d:c};function mh(){this.b=function(){};this.a=new Set}mh.prototype.L=function(){this.b=function(){};this.a.clear()};function nh(b,c){b.b=c};function oh(b){var c=this;this.h=b;this.f=new Map;this.a=function(){};this.b=function(){};this.c=function(){};this.i=[{Na:null,Ma:ph,Fa:function(b,e){return c.a(b,e)}},{Na:qh,Ma:ph,Fa:function(b,e){return c.a(b,e)}},{Na:rh,Ma:ph,Fa:function(b,e){return c.a(b,e)}},{Na:ph,Ma:qh,Fa:function(b,e){return c.b(b,e)}},{Na:ph,Ma:rh,Fa:function(b,e){return c.b(b,e)}},{Na:qh,Ma:rh,Fa:function(b,e){return c.c(b,e)}},{Na:rh,Ma:qh,Fa:function(b,e){return c.c(b,e)}}]}
oh.prototype.L=function(){this.h=null;this.f.clear();this.a=function(){};this.b=function(){};this.c=function(){}};oh.prototype.g=function(b,c){for(var d=q(this.h.a),e=d.next();!e.done;e=d.next()){e=e.value;var f=this.f.get(e),g=b<e.startTime?qh:b>e.endTime?rh:ph;this.f.set(e,g);for(var h=q(this.i),k=h.next();!k.done;k=h.next())k=k.value,k.Na==f&&k.Ma==g&&k.Fa(e,c)}};function sh(b,c,d,e){b.a=c;b.b=d;b.c=e}var qh=1,ph=2,rh=3;function th(b,c){this.a=c;this.b=b;this.g=null;this.l=1;this.s=Promise.resolve();this.h=[];this.i=new Map;this.c=new Map;this.o=!1;this.D=null;this.A=this.f=this.m=!1;this.v=0}n=th.prototype;n.destroy=function(){for(var b=q(this.c.values()),c=b.next();!c.done;c=b.next())uh(c.value);this.c.clear();this.i.clear();this.g=this.h=this.s=this.b=this.a=null;this.f=!0;return Promise.resolve()};
n.configure=function(b){this.g=b;this.D=new fb({maxAttempts:Math.max(b.retryParameters.maxAttempts,2),baseDelay:b.retryParameters.baseDelay,backoffFactor:b.retryParameters.backoffFactor,fuzzFactor:b.retryParameters.fuzzFactor,timeout:0},!0)};
n.init=function(){var b=this;return t(function d(){var e,f,g;return v(d,function(d){switch(d.j){case 1:return e=b.a.Qa(),f=K.Ib(b.b,e),g=b.a.hd(b.b.periods[f]),g.variant||g.text?u(d,vh(b,g.variant?g.variant.audio:null,g.variant?g.variant.video:null,g.text,e),2):d["return"](Promise.reject(new B(2,5,5005)));case 2:if(b.f)return d["return"]();b.a&&b.a.Ie&&b.a.Ie();d.j=0}})})};function wh(b){return xh(b,"audio")}function yh(b){return xh(b,"video")}
function xh(b,c){var d=b.c.get(c);return d?d.ya||d.stream:null}function zh(b,c){return t(function e(){var f,g,h,k,l,m,p,r;return v(e,function(e){switch(e.j){case 1:return f=Vc,rd(b.a.J,f.Oa),b.v++,b.A=!1,g=b.v,h=b.a.J,k=new Map,l=new Set,k.set(f.Oa,c),l.add(c),u(e,h.init(k,!1),2);case 2:return b.f?e["return"]():u(e,Ah(b,l),3);case 3:if(b.f)return e["return"]();b.v!=g||b.c.has(f.Oa)||b.A||(m=b.a.Qa(),p=K.Ib(b.b,m),r=Bh(c,p,0),b.c.set(f.Oa,r),b.o&&Ch(b,r,0));e.j=0}})})}
function Dh(b,c){var d=b.c.get("video");if(d){var e=d.stream;if(e)if(c){var f=e.trickModeVideo;f&&!d.ya&&(Eh(b,f,!1,0),d.ya=e)}else if(e=d.ya)d.ya=null,Eh(b,e,!0,0)}}function Fh(b,c,d,e){c.video&&Eh(b,c.video,d,e);c.audio&&Eh(b,c.audio,d,e)}
function Eh(b,c,d,e){var f=b.c.get(c.type);if(!f&&"text"==c.type&&b.g.ignoreTextStreamFailures)zh(b,c);else if(f){var g=Gh(b,c);d&&g!=f.xa?Hh(b):(f.ya&&(c.trickModeVideo?(f.ya=c,c=c.trickModeVideo):f.ya=null),(g=b.h[g])&&g.ab&&(g=b.i.get(c.id))&&g.ab&&f.stream!=c&&("text"==c.type&&kd(b.a.J,Mb(c.mimeType,c.codecs)),f.stream=c,f.Nb=!0,d&&(f.Da?f.Ub=!0:f.Ha?(f.Ba=!0,f.Eb=e,f.Ub=!0):(uh(f),Ih(b,f,!0,e)))))}}
function Jh(b){var c=b.a.Qa(),d=b.g.smallGapLimit;Array.from(b.c.keys()).every(function(e){var f=b.a.J;"text"==e?(e=f.a,e=c>=e.a&&c<e.b):(e=md(f,e),e=Qc(e,c,d));return e})||Hh(b)}function Hh(b){b.c.forEach(function(c,d){c.Da||c.Ba||(c.Ha?(c.Ba=!0,c.Eb=0):null==ld(b.a.J,d)?null==c.Aa&&Ch(b,c,0):(uh(c),Ih(b,c,!1,0)))})}
function vh(b,c,d,e,f){return t(function h(){var k,l,m,p,r,w,x;return v(h,function(h){switch(h.j){case 1:return k=b.a.Qa(),l=K.Ib(b.b,k),m=Vc,p=new Map,r=new Set,c&&(p.set(m.Md,c),r.add(c)),d&&(p.set(m.Rd,d),r.add(d)),e&&(p.set(m.Oa,e),r.add(e)),w=b.a.J,x=b.g.forceTransmuxTS,u(h,w.init(p,x),2);case 2:if(b.f)return h["return"]();Kh(b);return u(h,Ah(b,r),3);case 3:if(b.f)return h["return"]();p.forEach(function(c,d){if(!b.c.has(d)){var e=Bh(c,l,f);b.c.set(d,e);Ch(b,e,0)}});h.j=0}})})}
function Bh(b,c,d){return{stream:b,type:b.type,Ua:null,ra:null,ya:null,Nb:!0,xa:c,endOfStream:!1,Ha:!1,Aa:null,Ba:!1,Eb:0,Ub:!1,Da:!1,vc:!1,lb:!1,yd:d}}
function Lh(b,c){var d=b.h[c];if(d)return d.promise;d={promise:new z,ab:!1};b.h[c]=d;for(var e=new Set,f=q(b.b.periods[c].variants),g=f.next();!g.done;g=f.next())g=g.value,g.video&&e.add(g.video),g.video&&g.video.trickModeVideo&&e.add(g.video.trickModeVideo),g.audio&&e.add(g.audio);f=q(b.b.periods[c].textStreams);for(g=f.next();!g.done;g=f.next())e.add(g.value);b.s=b.s.then(function(){if(!this.f)return Ah(this,e)}.bind(b)).then(function(){this.f||(this.h[c].promise.resolve(),this.h[c].ab=!0)}.bind(b))["catch"](function(b){this.f||
(this.h[c].promise["catch"](function(){}),this.h[c].promise.reject(),delete this.h[c],this.a.onError(b))}.bind(b));return d.promise}
function Ah(b,c){return t(function e(){var f,g,h,k,l,m,p;return v(e,function(e){switch(e.j){case 1:f=[];for(var r=q(c),x=r.next();!x.done;x=r.next())g=x.value,(h=b.i.get(g.id))?f.push(h.promise):(b.i.set(g.id,{promise:new z,ab:!1}),f.push(g.createSegmentIndex()));qa(e,2);return u(e,Promise.all(f),4);case 4:if(b.f)return e["return"]();sa(e,3);break;case 2:k=ta(e);if(b.f)return e["return"]();e=q(c);for(x=e.next();!x.done;x=e.next())l=x.value,b.i.get(l.id).promise["catch"](function(){}),b.i.get(l.id).promise.reject(),
b.i["delete"](l.id);throw k;case 3:r=q(c);for(x=r.next();!x.done;x=r.next())m=x.value,p=b.i.get(m.id),p.ab||(p.promise.resolve(),p.ab=!0);e.j=0}})})}function Kh(b){var c=b.b.presentationTimeline.T();Infinity>c?b.a.J.la(c):b.a.J.la(Math.pow(2,32))}
n.Hf=function(b){if(!this.f&&!b.Ha&&null!=b.Aa&&!b.Da)if(b.Aa=null,b.Ba)Ih(this,b,b.Ub,b.Eb);else{try{var c=Mh(this,b);null!=c&&(Ch(this,b,c),b.lb=!1)}catch(d){Nh(this,d);return}c=Array.from(this.c.values());Oh(this,b);c.every(function(b){return b.endOfStream})&&this.a.J.endOfStream().then(function(){if(!this.f){var b=this.a.J.T();b<this.b.presentationTimeline.T()&&this.b.presentationTimeline.la(b)}}.bind(this))}};
function Mh(b,c){function d(b){return"text"==b.type&&"application/cea-608"==b.stream.mimeType}if(d(c))return b.a.J.Sb(c.stream.originalId||""),null;var e=b.a.Qa(),f=Ph(b,c,e),g=Gh(b,c.stream),h=K.Ib(b.b,f),k=od(b.a.J,c.type,e),l=Math.max(b.b.minBufferTime||0,b.g.rebufferingGoal,b.g.bufferingGoal)*b.l;if(f>=b.b.presentationTimeline.T())return c.endOfStream=!0,"video"==c.type&&(f=b.c.get("text"))&&"application/cea-608"==f.stream.mimeType&&(f.endOfStream=!0),null;c.endOfStream=!1;c.xa=h;if(h!=g)return null;
if(k>=l)return.5;h=nd(b.a.J,c.type);h=Qh(b,c,e,h,g);if(!h)return 1;var m=Infinity;Array.from(b.c.values()).forEach(function(c){d(c)||(c=Ph(b,c,e),m=Math.min(m,c))});if(f>=m+b.b.presentationTimeline.a)return 1;c.yd=0;Rh(b,c,e,g,h);return null}function Ph(b,c,d){if(!c.Ua||!c.ra)return Math.max(d,c.yd);d=Gh(b,c.Ua);return b.b.periods[d].startTime+c.ra.endTime}
function Qh(b,c,d,e,f){if(c.ra&&c.stream==c.Ua)return Sh(b,c,f,c.ra.position+1);c.ra?(d=Gh(b,c.Ua),d=c.stream.findSegmentPosition(Math.max(0,b.b.periods[d].startTime+c.ra.endTime-b.b.periods[f].startTime))):d=c.stream.findSegmentPosition(Math.max(0,(e||d)-b.b.periods[f].startTime));if(null==d)return null;var g=null;null==e&&(g=Sh(b,c,f,Math.max(0,d-1)));return g||Sh(b,c,f,d)}
function Sh(b,c,d,e){d=b.b.periods[d];c=c.stream.getSegmentReference(e);if(!c)return null;e=b.b.presentationTimeline;b=e.kb();e=e.Sa();return d.startTime+c.endTime<b||d.startTime+c.startTime>e?null:c}
function Rh(b,c,d,e,f){var g=b.b.periods[e],h=c.stream,k=b.b.presentationTimeline.T(),l=b.b.periods[e+1];e=Th(b,c,e,Math.max(0,g.startTime-.1),l?l.startTime+.01:k);c.Ha=!0;c.Nb=!1;k=Uh(b,f);Promise.all([e,k]).then(function(b){if(!this.f&&!this.m)return Vh(this,c,d,g,h,f,b[1])}.bind(b)).then(function(){this.f||this.m||(c.Ha=!1,c.vc=!1,c.Ba||this.a.pb(),Ch(this,c,0),Wh(this,h))}.bind(b))["catch"](function(b){this.f||this.m||(c.Ha=!1,"text"==c.type&&this.g.ignoreTextStreamFailures?this.c["delete"]("text"):
3017==b.code?Xh(this,c,b):(c.lb=!0,b.severity=2,Nh(this,b)))}.bind(b))}function Xh(b,c,d){if(!Array.from(b.c.values()).some(function(b){return b!=c&&b.vc})){var e=Math.round(100*b.l);if(20<e)b.l-=.2;else if(4<e)b.l-=.04;else{c.lb=!0;b.m=!0;b.a.onError(d);return}c.vc=!0}Ch(b,c,4)}
function Th(b,c,d,e,f){if(!c.Nb)return Promise.resolve();d=sd(b.a.J,c.type,b.b.periods[d].startTime-c.stream.presentationTimeOffset,e,f);if(!c.stream.initSegmentReference)return d;b=Uh(b,c.stream.initSegmentReference).then(function(b){if(!this.f)return pd(this.a.J,c.type,b,null,null,c.stream.closedCaptions&&0<c.stream.closedCaptions.size)}.bind(b))["catch"](function(b){c.Nb=!0;return Promise.reject(b)});return Promise.all([d,b])}
function Vh(b,c,d,e,f,g,h){var k=f.closedCaptions&&0<f.closedCaptions.size;null!=f.emsgSchemeIdUris&&0<f.emsgSchemeIdUris.length&&(new Q).aa("emsg",b.cf.bind(b,e,g,f.emsgSchemeIdUris)).parse(h);return Yh(b,c,d).then(function(){if(!this.f)return pd(this.a.J,c.type,h,g.startTime+e.startTime,g.endTime+e.startTime,k)}.bind(b)).then(function(){if(!this.f)return c.Ua=f,c.ra=g,Promise.resolve()}.bind(b))}
n.cf=function(b,c,d,e){var f=e.reader.tc(),g=e.reader.tc(),h=e.reader.C(),k=e.reader.C(),l=e.reader.C(),m=e.reader.C();e=e.reader.Ia(e.reader.H.byteLength-e.reader.X());b=b.startTime+c.startTime+k/h;if(d.includes(f))if("urn:mpeg:dash:event:2012"==f)this.a.Je();else this.a.onEvent(new D("emsg",{detail:{startTime:b,endTime:b+l/h,schemeIdUri:f,value:g,timescale:h,presentationTimeDelta:k,eventDuration:l,id:m,messageData:e}}))};
function Yh(b,c,d){var e=Math.max(b.g.bufferBehind,b.b.presentationTimeline.a),f=ld(b.a.J,c.type);if(null==f)return Promise.resolve();d=d-f-e;return 0>=d?Promise.resolve():b.a.J.remove(c.type,f,f+d).then(function(){}.bind(b))}
function Wh(b,c){if(!b.o&&(b.o=Array.from(b.c.values()).every(function(b){return"text"==b.type?!0:!b.Ba&&!b.Da&&b.ra}),b.o)){var d=Gh(b,c);b.h[d]||Lh(b,d).then(function(){this.f||this.a.gd()}.bind(b))["catch"](I.ob);for(d=0;d<b.b.periods.length;++d)Lh(b,d)["catch"](I.ob);b.a.Ve&&b.a.Ve()}}
function Oh(b,c){var d=Gh(b,c.stream);if(c.xa!=d){var e=c.xa,f=Array.from(b.c.values());f.every(function(b){return b.xa==e})&&f.every(Zh)&&Lh(b,e).then(function(){if(!this.f&&f.every(function(b){var c=Zh(b),d=Gh(this,b.stream);return c&&b.xa==e&&d!=e}.bind(this))){var b=this.b.periods[e],c=this.a.hd(b),d=new Map;c.variant&&c.variant.video&&d.set("video",c.variant.video);c.variant&&c.variant.audio&&d.set("audio",c.variant.audio);c.text&&d.set("text",c.text);var l=q(this.c.keys());for(c=l.next();!c.done;c=
l.next())if(c=c.value,!d.has(c)&&"text"!=c){this.a.onError(new B(2,5,5005));return}l=q(Array.from(d.keys()));for(c=l.next();!c.done;c=l.next())if(c=c.value,!this.c.has(c))if("text"==c)vh(this,null,null,d.get("text"),b.startTime),d["delete"](c);else{this.a.onError(new B(2,5,5005));return}b=q(Array.from(this.c.keys()));for(c=b.next();!c.done;c=b.next())c=c.value,(l=d.get(c))?(Eh(this,l,!1,0),Ch(this,this.c.get(c),0)):this.c["delete"](c);this.a.gd()}}.bind(b))["catch"](I.ob)}}
function Zh(b){return!b.Ha&&null==b.Aa&&!b.Ba&&!b.Da}function Gh(b,c){for(var d=b.b.periods,e=0;e<d.length;e++){for(var f=d[e],g=new Set,h=q(f.variants),k=h.next();!k.done;k=h.next())k=k.value,k.audio&&g.add(k.audio),k.video&&g.add(k.video),k.video&&k.video.trickModeVideo&&g.add(k.video.trickModeVideo);f=q(f.textStreams);for(h=f.next();!h.done;h=f.next())g.add(h.value);if(g.has(c))return e}return-1}
function Uh(b,c){var d=Ab(c.c(),b.g.retryParameters);if(0!=c.b||null!=c.a){var e="bytes="+c.b+"-";null!=c.a&&(e+=c.a);d.headers.Range=e}return b.a.nb.request(1,d).promise.then(function(b){return b.data})}
function Ih(b,c,d,e){t(function g(){var h,k,l;return v(g,function(g){switch(g.j){case 1:return c.Ba=!1,c.Ub=!1,c.Eb=0,c.Da=!0,e?(k=b.a.Qa(),l=b.a.J.T(),h=b.a.J.remove(c.type,k+e,l)):h=rd(b.a.J,c.type).then(function(){if(!this.f&&d)return this.a.J.flush(c.type)}.bind(b)),u(g,h,2);case 2:if(b.f)return g["return"]();c.Ua=null;c.ra=null;c.Da=!1;c.endOfStream=!1;Ch(b,c,0);g.j=0}})})}function Ch(b,c,d){c.Aa=window.setTimeout(b.Hf.bind(b,c),1E3*d)}
function uh(b){null!=b.Aa&&(window.clearTimeout(b.Aa),b.Aa=null)}function Nh(b,c){ib(b.D).then(function(){this.f||(this.a.onError(c),c.handled||this.g.failureCallback(c))}.bind(b))};function $h(b,c,d,e,f,g){if(200<=d&&299>=d&&202!=d)return f&&(e=f),{uri:e,data:c,headers:b,fromCache:!!b["x-shaka-from-cache"]};f=null;try{f=Vb(c)}catch(h){}throw new B(401==d||403==d?2:1,1,1001,e,d,f,b,g);};function ai(b,c,d,e){var f=new ai.b;Kb(c.headers).forEach(function(b,c){f.append(c,b)});var g=new ai.a,h={body:c.body||void 0,headers:f,method:c.method,signal:g.signal,credentials:c.allowCrossSiteCredentials?"include":void 0},k={Nc:!1,Id:!1},l;c.retryParameters.timeout&&(l=setTimeout(function(){k.Id=!0;g.abort()},c.retryParameters.timeout));b=ai.h(b,d,h,k,l,e);return new C(b,function(){k.Nc=!0;g.abort();return Promise.resolve()})}y("shaka.net.HttpFetchPlugin",ai);
ai.h=function(b,c,d,e,f,g){return t(function k(){var l,m,p,r,w,x,A,R,X,Y,fa,ia;return v(k,function(k){switch(k.j){case 1:return l=ai.g,m=ai.c,x=w=0,A=Date.now(),qa(k,2,3),u(k,l(b,d),5);case 5:return p=k.u,R=p.clone().body.getReader(),X=function(b){function c(){return t(function Mc(){var d,e;return v(Mc,function(f){switch(f.j){case 1:return u(f,R.read(),2);case 2:d=f.u;d.done||(w+=d.value.byteLength);e=Date.now();if(100<e-A||d.done)g(e-A,w-x),x=w,A=e;d.done?b.close():(b.enqueue(d.value),c());f.j=0}})})}
c()},new m({start:X}),u(k,p.arrayBuffer(),6);case 6:r=k.u;case 3:ua(k);clearTimeout(f);va(k,4);break;case 2:Y=ta(k);if(e.Nc)throw new B(1,1,7001,b,c);if(e.Id)throw new B(1,1,1003,b,c);throw new B(1,1,1002,b,Y,c);case 4:return fa={},ia=p.headers,ia.forEach(function(b,c){fa[c.trim()]=b}),k["return"]($h(fa,r,p.status,b,p.url,c))}})})};ai.isSupported=function(){if(window.ReadableStream)try{new ReadableStream({})}catch(b){return!1}else return!1;return!(!window.fetch||!window.AbortController)};
ai.isSupported=ai.isSupported;ai.g=window.fetch;ai.a=window.AbortController;ai.c=window.ReadableStream;ai.b=window.Headers;ai.isSupported()&&(zb("http",ai,2),zb("https",ai,2));function bi(b,c,d,e){var f=new bi.f,g=Date.now(),h=0,k=new Promise(function(k,m){f.open(c.method,b,!0);f.responseType="arraybuffer";f.timeout=c.retryParameters.timeout;f.withCredentials=c.allowCrossSiteCredentials;f.onabort=function(){m(new B(1,1,7001,b,d))};f.onload=function(c){c=c.target;var e=c.getAllResponseHeaders().trim().split("\r\n"),f={};e=q(e);for(var g=e.next();!g.done;g=e.next())g=g.value.split(": "),f[g[0].toLowerCase()]=g.slice(1).join(": ");try{var h=$h(f,c.response,c.status,b,c.responseURL,
d);k(h)}catch(X){m(X)}};f.onerror=function(c){m(new B(1,1,1002,b,c,d))};f.ontimeout=function(){m(new B(1,1,1003,b,d))};f.onprogress=function(b){var c=Date.now();if(100<c-g||b.lengthComputable&&b.loaded==b.total)e(c-g,b.loaded-h),h=b.loaded,g=c};for(var l in c.headers)f.setRequestHeader(l.toLowerCase(),c.headers[l]);f.send(c.body)});return new C(k,function(){f.abort();return Promise.resolve()})}y("shaka.net.HttpXHRPlugin",bi);bi.f=window.XMLHttpRequest;zb("http",bi,1);zb("https",bi,1);function ci(b,c){this.i=b;this.c=new Map;this.g=!1;this.h=c;this.a=this.b=this.f=0}ci.prototype.destroy=function(){this.g=!0;return Promise.all(this.c.values()).then(function(){},function(){})};
function di(b,c,d,e,f){b.b+=e;var g=b.c.get(c)||Promise.resolve();b.c.set(c,g.then(function(){return t(function k(){var c,g;return v(k,function(k){switch(k.j){case 1:return u(k,ei(b,d),2);case 2:c=k.u;if(b.g)throw new B(2,9,7001);b.f+=e;b.a+=c.byteLength;g=b.b?b.f/b.b:0;b.h(g,b.a);return k["return"](f(c))}})})}))}function fi(b){return t(function d(){return v(d,function(d){switch(d.j){case 1:return u(d,Promise.all(b.c.values()),2);case 2:return d["return"](b.a)}})})}
function ei(b,c){return t(function e(){var f,g;return v(e,function(e){switch(e.j){case 1:return f=b.i.request(1,c),u(e,f.promise,2);case 2:return g=e.u,e["return"](g.data)}})})};function gi(b,c){var d=this;this.c=b;this.b=b.objectStore(c);this.a=new z;b.onabort=function(b){b.preventDefault();d.a.reject()};b.onerror=function(b){b.preventDefault();d.a.reject()};b.oncomplete=function(){d.a.resolve()}}gi.prototype.abort=function(){try{this.c.abort()}catch(b){}return this.a["catch"](function(){})};
function hi(b,c){return new Promise(function(d,e){var f=b.b.openCursor();f.onerror=e;f.onsuccess=function(b){b=b.target.result;if(!b)return d();c(b.key,b.value,b);b["continue"]()}})}gi.prototype.store=function(){return this.b};gi.prototype.promise=function(){return this.a};function ii(b){this.b=b;this.a=[]}ii.prototype.destroy=function(){return Promise.all(this.a.map(function(b){return b.abort()}))};function ji(b,c){return ki(b,c,"readonly")}function li(b,c){return ki(b,c,"readwrite")}function ki(b,c,d){d=b.b.transaction([c],d);var e=new gi(d,c);b.a.push(e);e.promise().then(function(){sb(b.a,e)},function(){sb(b.a,e)});return e};function mi(b){this.a=new ii(b)}mi.prototype.destroy=function(){return this.a.destroy()};mi.prototype.getAll=function(){var b=this;return t(function d(){var e,f;return v(d,function(d){switch(d.j){case 1:return e=ji(b.a,"session-ids"),f=[],u(d,hi(e,function(b,d){f.push(d)}),2);case 2:return u(d,e.promise(),3);case 3:return d["return"](f)}})})};mi.prototype.add=function(b){var c=li(this.a,"session-ids"),d=c.store();b=q(b);for(var e=b.next();!e.done;e=b.next())d.add(e.value);return c.promise()};
mi.prototype.remove=function(b){var c=this;return t(function e(){var f;return v(e,function(e){switch(e.j){case 1:return f=li(c.a,"session-ids"),u(e,hi(f,function(c,e,f){0<=b.indexOf(e.sessionId)&&f["delete"]()}),2);case 2:return u(e,f.promise(),0)}})})};function ni(){this.a=new Map}ni.prototype.destroy=function(){for(var b=[],c=q(this.a.values()),d=c.next();!d.done;d=c.next())b.push(d.value.destroy());this.a.clear();return Promise.all(b)};ni.prototype.init=function(){var b=this;oi.forEach(function(c,d){var e=c();e&&b.a.set(d,e)});for(var c=[],d=q(this.a.values()),e=d.next();!e.done;e=d.next())c.push(e.value.init());return Promise.all(c)};
function pi(b){var c=null;b.a.forEach(function(b,e){b.getCells().forEach(function(b,d){b.hasFixedKeySpace()||c||(c={path:{ja:e,W:d},W:b})})});if(c)return c;throw new B(2,9,9013,"Could not find a cell that supports add-operations");}function qi(b,c){b.a.forEach(function(b,e){b.getCells().forEach(function(b,d){c({ja:e,W:d},b)})})}
function ri(b,c,d){b=b.a.get(c);if(!b)throw new B(2,9,9013,"Could not find mechanism with name "+c);c=b.getCells().get(d);if(!c)throw new B(2,9,9013,"Could not find cell with name "+d);return c}function si(b,c){b.a.forEach(function(b){c(b.getEmeSessionCell())})}function ti(b){var c=Array.from(b.a.keys());if(!c.length)throw new B(2,9,9E3,"No supported storage mechanisms found");return b.a.get(c[0]).getEmeSessionCell()}
ni.prototype.erase=function(){var b=this;return t(function d(){var e,f,g;return v(d,function(d){switch(d.j){case 1:return e=Array.from(b.a.values()),f=0<e.length,f||(g=oi,g.forEach(function(b){(b=b())&&e.push(b)})),u(d,Promise.all(e.map(function(b){return b.erase()})),2);case 2:if(f)d.B(0);else return u(d,Promise.all(e.map(function(b){return b.destroy()})),0)}})})};function ui(b,c){oi.set(b,c)}y("shaka.offline.StorageMuxer.register",ui);y("shaka.offline.StorageMuxer.unregister",function(b){oi["delete"](b)});
function vi(){for(var b=q(oi.values()),c=b.next();!c.done;c=b.next())if(c=c.value,c=c())return c.destroy(),!0;return!1}var oi=new Map;function wi(b){this.a=new ii(b)}n=wi.prototype;n.destroy=function(){return this.a.destroy()};n.hasFixedKeySpace=function(){return!0};n.addSegments=function(){return xi("segment")};n.removeSegments=function(b,c){return yi(this,"segment",b,c)};n.getSegments=function(b){return zi(this,"segment",b).then(function(b){return b.map(Ai)})};n.addManifests=function(){return xi("manifest")};
n.updateManifestExpiration=function(b,c){var d=li(this.a,"manifest"),e=d.store(),f=new z;e.get(b).onsuccess=function(d){(d=d.target.result)?(d.expiration=c,e.put(d),f.resolve()):f.reject(new B(2,9,9012,"Could not find values for "+b))};return d.promise().then(function(){return f})};n.removeManifests=function(b,c){return yi(this,"manifest",b,c)};n.getManifests=function(b){return zi(this,"manifest",b).then(function(b){return b.map(Bi)})};
n.getAllManifests=function(){var b=this;return t(function d(){var e,f,g;return v(d,function(d){switch(d.j){case 1:return e=Bi,f=ji(b.a,"manifest"),g=new Map,u(d,hi(f,function(b,d){g.set(b,e(d))}),2);case 2:return u(d,f.promise(),3);case 3:return d["return"](g)}})})};function xi(b){return Promise.reject(new B(2,9,9011,"Cannot add new value to "+b))}function yi(b,c,d,e){b=li(b.a,c);var f=b.store();d.forEach(function(b){f["delete"](b).onsuccess=function(){return e(b)}});return b.promise()}
function zi(b,c,d){b=ji(b.a,c);var e=b.store(),f={},g=[];d.forEach(function(b){e.get(b).onsuccess=function(c){c=c.target.result;void 0==c&&g.push(b);f[b]=c}});return b.promise().then(function(){return g.length?Promise.reject(new B(2,9,9012,"Could not find values for "+g)):d.map(function(b){return f[b]})})}
function Bi(b){return{originalManifestUri:b.originalManifestUri,duration:b.duration,size:b.size,expiration:null==b.expiration?Infinity:b.expiration,periods:b.periods.map(Ci),sessionIds:b.sessionIds,drmInfo:b.drmInfo,appMetadata:b.appMetadata}}function Ci(b){Di(b);b.streams.forEach(function(){});return{startTime:b.startTime,streams:b.streams.map(Ei)}}
function Ei(b){var c=b.Ae?Fi(b.Ae):null;return{id:b.id,originalId:null,primary:b.primary,presentationTimeOffset:b.presentationTimeOffset,contentType:b.contentType,mimeType:b.mimeType,codecs:b.codecs,frameRate:b.frameRate,kind:b.kind,language:b.language,label:b.label,width:b.width,height:b.height,initSegmentKey:c,encrypted:b.encrypted,keyId:b.keyId,segments:b.segments.map(Gi),variantIds:b.variantIds}}function Gi(b){var c=Fi(b.uri);return{startTime:b.startTime,endTime:b.endTime,dataKey:c}}
function Ai(b){return{data:b.data}}function Fi(b){var c;if((c=/^offline:[0-9]+\/[0-9]+\/([0-9]+)$/.exec(b))||(c=/^offline:segment\/([0-9]+)$/.exec(b)))return Number(c[1]);throw new B(2,9,9004,"Could not parse uri "+b);}
function Di(b){var c=b.streams.filter(function(b){return"audio"==b.contentType}),d=b.streams.filter(function(b){return"video"==b.contentType});if(!c.every(function(b){return b.variantIds})||!d.every(function(b){return b.variantIds})){c.forEach(function(b){b.variantIds=[]});d.forEach(function(b){b.variantIds=[]});var e=0;if(d.length&&!c.length){var f=e++;d.forEach(function(b){b.variantIds.push(f)})}if(!d.length&&c.length){var g=e++;c.forEach(function(b){b.variantIds.push(g)})}d.length&&c.length&&c.forEach(function(b){d.forEach(function(c){var d=
e++;b.variantIds.push(d);c.variantIds.push(d)})})}};function Hi(b,c,d,e){this.a=new ii(b);this.c=c;this.b=d;this.f=e}n=Hi.prototype;n.destroy=function(){return this.a.destroy()};n.hasFixedKeySpace=function(){return this.f};n.addSegments=function(b){return Ii(this,this.c,b)};n.removeSegments=function(b,c){return Ji(this,this.c,b,c)};n.getSegments=function(b){return Ki(this,this.c,b)};n.addManifests=function(b){return Ii(this,this.b,b)};
n.updateManifestExpiration=function(b,c){var d=li(this.a,this.b),e=d.store();e.get(b).onsuccess=function(d){if(d=d.target.result)d.expiration=c,e.put(d,b)};return d.promise()};n.removeManifests=function(b,c){return Ji(this,this.b,b,c)};n.getManifests=function(b){return Ki(this,this.b,b)};
n.getAllManifests=function(){var b=this;return t(function d(){var e,f;return v(d,function(d){switch(d.j){case 1:return e=ji(b.a,b.b),f=new Map,u(d,hi(e,function(b,d){f.set(b,d)}),2);case 2:return u(d,e.promise(),3);case 3:return d["return"](f)}})})};
function Ii(b,c,d){if(b.f)return Promise.reject(new B(1,9,9011,"Cannot add new value to "+c));b=li(b.a,c);var e=b.store(),f=[];d.forEach(function(b){e.add(b).onsuccess=function(b){f.push(b.target.result)}});return b.promise().then(function(){return f})}function Ji(b,c,d,e){b=li(b.a,c);var f=b.store();d.forEach(function(b){f["delete"](b).onsuccess=function(){return e(b)}});return b.promise()}
function Ki(b,c,d){b=ji(b.a,c);var e=b.store(),f={},g=[];d.forEach(function(b){var c=e.get(b);c.onsuccess=function(){void 0==c.result&&g.push(b);f[b]=c.result}});return b.promise().then(function(){return g.length?Promise.reject(new B(1,9,9012,"Could not find values for "+g)):d.map(function(b){return f[b]})})};function Li(){this.g=this.c=this.b=this.a=this.f=null}n=Li.prototype;
n.init=function(){var b=this,c=new z,d=window.indexedDB.open("shaka_offline_db",4);d.onsuccess=function(d){d=d.target.result;b.f=d;var e=d.objectStoreNames;e=e.contains("manifest")&&e.contains("segment")?new wi(d):null;b.a=e;e=d.objectStoreNames;e=e.contains("manifest-v2")&&e.contains("segment-v2")?new Hi(d,"segment-v2","manifest-v2",!0):null;b.b=e;e=d.objectStoreNames;e=e.contains("manifest-v3")&&e.contains("segment-v3")?new Hi(d,"segment-v3","manifest-v3",!1):null;b.c=e;d=d.objectStoreNames.contains("session-ids")?
new mi(d):null;b.g=d;c.resolve()};d.onupgradeneeded=function(b){b=b.target.result;for(var c=q(["segment-v3","manifest-v3","session-ids"]),d=c.next();!d.done;d=c.next())d=d.value,b.objectStoreNames.contains(d)||b.createObjectStore(d,{autoIncrement:!0})};d.onerror=function(b){c.reject(new B(2,9,9001,d.error));b.preventDefault()};return c};
n.destroy=function(){var b=this;return t(function d(){return v(d,function(d){switch(d.j){case 1:if(!b.a){d.B(2);break}return u(d,b.a.destroy(),2);case 2:if(!b.b){d.B(4);break}return u(d,b.b.destroy(),4);case 4:if(!b.c){d.B(6);break}return u(d,b.c.destroy(),6);case 6:if(!b.g){d.B(8);break}return u(d,b.g.destroy(),8);case 8:b.f&&b.f.close(),d.j=0}})})};n.getCells=function(){var b=new Map;this.a&&b.set("v1",this.a);this.b&&b.set("v2",this.b);this.c&&b.set("v3",this.c);return b};n.getEmeSessionCell=function(){return this.g};
n.erase=function(){var b=this;return t(function d(){return v(d,function(d){switch(d.j){case 1:if(!b.a){d.B(2);break}return u(d,b.a.destroy(),2);case 2:if(!b.b){d.B(4);break}return u(d,b.b.destroy(),4);case 4:if(!b.c){d.B(6);break}return u(d,b.c.destroy(),6);case 6:return b.f&&b.f.close(),u(d,Mi(),8);case 8:return b.f=null,b.a=null,b.b=null,b.c=null,u(d,b.init(),0)}})})};
function Mi(){var b=new z,c=window.indexedDB.deleteDatabase("shaka_offline_db");c.onblocked=function(){};c.onsuccess=function(){b.resolve()};c.onerror=function(d){b.reject(new B(2,9,9001,c.error));d.preventDefault()};return b}ui("idb",function(){return window.indexedDB?new Li:null});function Ni(b,c,d,e){this.a=b;this.g=c;this.f=d;this.c=e;this.b=["offline:",b,"/",c,"/",d,"/",e].join("")}Ni.prototype.ja=function(){return this.g};Ni.prototype.W=function(){return this.f};Ni.prototype.key=function(){return this.c};Ni.prototype.toString=function(){return this.b};
function Oi(b){b=/^offline:([a-z]+)\/([^/]+)\/([^/]+)\/([0-9]+)$/.exec(b);if(null==b)return null;var c=b[1];if("manifest"!=c&&"segment"!=c)return null;var d=b[2];if(!d)return null;var e=b[3];return e&&null!=c?new Ni(c,d,e,Number(b[4])):null};function Pi(b,c){this.b=b;this.a=c}function Qi(b,c){var d=new U(null,0);d.la(c.duration);var e=c.periods.map(function(c){return Ri(b,c,d)}),f=c.drmInfo?[c.drmInfo]:[];c.drmInfo&&e.forEach(function(b){b.variants.forEach(function(b){b.drmInfos=f})});return{presentationTimeline:d,minBufferTime:2,offlineSessionIds:c.sessionIds,periods:e}}
function Ri(b,c,d){var e=c.streams.filter(function(b){return"audio"==b.contentType}),f=c.streams.filter(function(b){return"video"==b.contentType});e=Si(b,e,f);f=c.streams.filter(function(b){return"text"==b.contentType}).map(function(c){return Ti(b,c)});c.streams.forEach(function(e){e=e.segments.map(function(c,d){return Ui(b,d,c)});d.Wa(e,c.startTime)});return{startTime:c.startTime,variants:Array.from(e.values()),textStreams:f}}
function Si(b,c,d){for(var e=new Set,f=q(c),g=f.next();!g.done;g=f.next()){var h=q(g.value.variantIds);for(g=h.next();!g.done;g=h.next())e.add(g.value)}f=q(d);for(g=f.next();!g.done;g=f.next())for(h=q(g.value.variantIds),g=h.next();!g.done;g=h.next())e.add(g.value);f=new Map;e=q(e);for(g=e.next();!g.done;g=e.next())g=g.value,f.set(g,{id:g,language:"",primary:!1,audio:null,video:null,bandwidth:0,drmInfos:[],allowedByApplication:!0,allowedByKeySystem:!0});c=q(c);for(e=c.next();!e.done;e=c.next())for(e=
e.value,g=Ti(b,e),h=q(e.variantIds),e=h.next();!e.done;e=h.next())e=f.get(e.value),e.language=g.language,e.primary=e.primary||g.primary,e.audio=g;d=q(d);for(c=d.next();!c.done;c=d.next())for(e=c.value,c=Ti(b,e),g=q(e.variantIds),e=g.next();!e.done;e=g.next())e=f.get(e.value),e.primary=e.primary||c.primary,e.video=c;return f}
function Ti(b,c){var d=c.segments.map(function(c,d){return Ui(b,d,c)}),e=new T(d);d={id:c.id,originalId:c.originalId,createSegmentIndex:function(){return Promise.resolve()},findSegmentPosition:function(b){return e.find(b)},getSegmentReference:function(b){return e.get(b)},initSegmentReference:null,presentationTimeOffset:c.presentationTimeOffset,mimeType:c.mimeType,codecs:c.codecs,width:c.width||void 0,height:c.height||void 0,frameRate:c.frameRate||void 0,kind:c.kind,encrypted:c.encrypted,keyId:c.keyId,
language:c.language,label:c.label||null,type:c.contentType,primary:c.primary,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],channelsCount:null,closedCaptions:null};null!=c.initSegmentKey&&(d.initSegmentReference=Vi(b,c.initSegmentKey));return d}function Ui(b,c,d){var e=new Ni("segment",b.b,b.a,d.dataKey);return new O(c,d.startTime,d.endTime,function(){return[e.toString()]},0,null)}function Vi(b,c){var d=new Ni("segment",b.b,b.a,c);return new ye(function(){return[d.toString()]},0,null)};function Wi(b){this.a=!1;this.b=new z;this.c=b}Wi.prototype.destroy=function(){var b=this;if(this.a)return this.b;this.a=!0;return this.c().then(function(){b.b.resolve()},function(){b.b.resolve()})};function Xi(b,c){return t(function e(){return v(e,function(e){switch(e.j){case 1:return ra(e,2),u(e,Promise.resolve(c()),4);case 4:return e["return"](e.u);case 2:return ua(e),u(e,Promise.all(b.map(function(b){return b.destroy()})),5);case 5:va(e,0)}})})};function Yi(){this.a=null}n=Yi.prototype;n.configure=function(){};n.start=function(b){var c=Oi(b);this.a=c;if(null==c||"manifest"!=c.a)return Promise.reject(new B(2,1,9004,c));var d=new ni;return Xi([d],function(){return t(function f(){var b,h,k,l;return v(f,function(f){switch(f.j){case 1:return u(f,d.init(),2);case 2:return u(f,ri(d,c.ja(),c.W()),3);case 3:return b=f.u,u(f,b.getManifests([c.key()]),4);case 4:return h=f.u,k=h[0],l=new Pi(c.ja(),c.W()),f["return"](Qi(l,k))}})})})};n.stop=function(){return Promise.resolve()};
n.update=function(){};n.onExpirationUpdated=function(b,c){var d=this.a,e=new ni;return Xi([e],function(){return t(function g(){var h,k,l,m,p;return v(g,function(g){switch(g.j){case 1:return u(g,e.init(),2);case 2:return u(g,ri(e,d.ja(),d.W()),3);case 3:return h=g.u,u(g,h.getManifests([d.key()]),4);case 4:k=g.u;l=k[0];m=l.sessionIds.includes(b);p=void 0==l.expiration||l.expiration>c;if(m&&p)return u(g,h.updateManifestExpiration(d.key(),c),0);g.B(0)}})})})["catch"](function(){})};
df["application/x-offline-manifest"]=Yi;function Zi(b){var c=Oi(b);return c&&"manifest"==c.a?Zi.a(b):c&&"segment"==c.a?Zi.b(c.key(),c):jb(new B(2,1,9004,b))}y("shaka.offline.OfflineScheme",Zi);Zi.a=function(b){b={uri:b,data:new ArrayBuffer(0),headers:{"content-type":"application/x-offline-manifest"}};return lb(b)};
Zi.b=function(b,c){var d=new ni,e=Xi([d],function(){return t(function g(){var b,e,l;return v(g,function(g){switch(g.j){case 1:return u(g,d.init(),2);case 2:return u(g,ri(d,c.ja(),c.W()),3);case 3:return b=g.u,u(g,b.getSegments([c.key()]),4);case 4:return e=g.u,l=e[0],g["return"]({uri:c,data:l.data,headers:{}})}})})});return mb(e)};zb("offline",Zi);function $i(b,c,d){return t(function f(){var g,h,k,l,m,p;return v(f,function(f){switch(f.j){case 1:g=[];for(var r=[],x=q(d),A=x.next();!A.done;A=x.next()){A=A.value;for(var R=!1,X=q(r),Y=X.next();!Y.done;Y=X.next())if(Y=Y.value,aj(Y.info,A)){Y.sessionIds.push(A.sessionId);R=!0;break}R||r.push({info:A,sessionIds:[A.sessionId]})}h=q(r);k=h.next();case 2:if(k.done){f.B(4);break}l=k.value;m=bj(b,c,l);return u(f,m,5);case 5:p=f.u;g=g.concat(p);k=h.next();f.B(2);break;case 4:return f["return"](g)}})})}
function bj(b,c,d){return t(function f(){var g,h;return v(f,function(f){switch(f.j){case 1:return g=new cc({nb:c,onError:function(){},qc:function(){},onExpirationUpdated:function(){},onEvent:function(){}}),qa(f,2),g.configure(b),u(f,kc(g,d.info.keySystem,d.info.licenseUri,d.info.serverCertificate,d.info.audioCapabilities,d.info.videoCapabilities),4);case 4:sa(f,3);break;case 2:return ta(f),u(f,g.destroy(),5);case 5:return f["return"]([]);case 3:return qa(f,6),u(f,rc(g),8);case 8:sa(f,7);break;case 6:return ta(f),
u(f,g.destroy(),9);case 9:return f["return"]([]);case 7:return h=[],u(f,Promise.all(d.sessionIds.map(function(b){return t(function p(){return v(p,function(c){switch(c.j){case 1:return qa(c,2),u(c,uc(g,b),4);case 4:h.push(b);sa(c,0);break;case 2:ta(c),c.j=0}})})})),10);case 10:return u(f,g.destroy(),11);case 11:return f["return"](h)}})})}
function aj(b,c){function d(b,c){return b.robustness==c.robustness&&b.contentType==c.contentType}return b.keySystem==c.keySystem&&b.licenseUri==c.licenseUri&&vb(b.audioCapabilities,c.audioCapabilities,d)&&vb(b.videoCapabilities,c.videoCapabilities,d)};function cj(b,c,d,e,f){var g=f in e,h=!0,k;for(k in c){var l=f+"."+k,m=g?e[f]:d[k];g||k in d?void 0===c[k]?void 0===m||g?delete b[k]:b[k]=qb(m):m.constructor==Object&&c[k]&&c[k].constructor==Object?(b[k]||(b[k]=qb(m)),l=cj(b[k],c[k],m,e,l),h=h&&l):typeof c[k]!=typeof m||null==c[k]||c[k].constructor!=m.constructor?h=!1:b[k]=c[k]:h=!1}return h}y("shaka.util.ConfigUtils.mergeConfigObjects",cj);function dj(){var b=5E5,c=Infinity;navigator.connection&&navigator.connection.type&&(b=1E6*navigator.connection.downlink,navigator.connection.saveData&&(c=360));var d={trackSelectionCallback:function(b){return b},progressCallback:function(){},usePersistentLicense:!0},e={drm:{retryParameters:gb(),servers:{},clearKeys:{},advanced:{},delayLicenseRequestUntilPlayed:!1},manifest:{retryParameters:gb(),availabilityWindowOverride:NaN,dash:{customScheme:function(b){if(b)return null},clockSyncUri:"",ignoreDrmInfo:!1,
xlinkFailGracefully:!1,defaultPresentationDelay:10,ignoreMinBufferTime:!1,autoCorrectDrift:!0}},streaming:{retryParameters:gb(),failureCallback:function(){},rebufferingGoal:2,bufferingGoal:10,bufferBehind:30,ignoreTextStreamFailures:!1,alwaysStreamText:!1,startAtSegmentBoundary:!1,smallGapLimit:.5,jumpLargeGaps:!1,durationBackoff:1,forceTransmuxTS:!1,safeSeekOffset:5},offline:d,abrFactory:L,abr:{enabled:!0,defaultBandwidthEstimate:b,switchInterval:8,bandwidthUpgradeTarget:.85,bandwidthDowngradeTarget:.95,
restrictions:{minWidth:0,maxWidth:Infinity,minHeight:0,maxHeight:c,minPixels:0,maxPixels:Infinity,minBandwidth:0,maxBandwidth:Infinity}},preferredAudioLanguage:"",preferredTextLanguage:"",preferredVariantRole:"",preferredTextRole:"",preferredAudioChannelCount:2,restrictions:{minWidth:0,maxWidth:Infinity,minHeight:0,maxHeight:Infinity,minPixels:0,maxPixels:Infinity,minBandwidth:0,maxBandwidth:Infinity},playRangeStart:0,playRangeEnd:Infinity,textDisplayFactory:function(){return null}};d.trackSelectionCallback=
function(b){return ej(b,e.preferredAudioLanguage)};return e}function fj(b,c,d){return cj(b,c,d||dj(),{".drm.servers":"",".drm.clearKeys":"",".drm.advanced":{distinctiveIdentifierRequired:!1,persistentStateRequired:!1,videoRobustness:"",audioRobustness:"",serverCertificate:new Uint8Array(0),individualizationServer:""}},"")}
function ej(b,c){var d=b.filter(function(b){return"variant"==b.type}),e=[],f=zd(c,d.map(function(b){return b.language}));f&&(e=d.filter(function(b){return J(b.language)==f}));0==e.length&&(e=d.filter(function(b){return b.primary}));0==e.length&&(d.map(function(b){return b.language}),e=d);var g=e.filter(function(b){return b.height&&480>=b.height});g.length&&(g.sort(function(b,c){return c.height-b.height}),e=g.filter(function(b){return b.height==g[0].height}));d=[];if(e.length){var h=Math.floor(e.length/
2);e.sort(function(b,c){return b.bandwidth-c.bandwidth});d.push(e[h])}e=q(b);for(h=e.next();!h.done;h=e.next())h=h.value,"text"==h.type&&d.push(h);return d};function gj(b){this.c=b;this.a=null;this.b=[]}function hj(b){function c(b){return{timestamp:b.timestamp,state:b.state,duration:b.duration}}for(var d=[],e=q(b.b),f=e.next();!f.done;f=e.next())d.push(c(f.value));b.a&&d.push(c(b.a));return d}function ij(b,c){return c?"buffering":b.c.ended?"ended":b.c.paused?"paused":"playing"};function jj(){this.b=this.c=null;this.a=[]}function kj(b,c,d){b.b!=c&&(b.b=c,b.a.push({timestamp:Date.now()/1E3,id:c.id,type:"text",fromAdaptation:d,bandwidth:null}))};function lj(b){this.l=this.A=NaN;this.b=this.h=0;this.i=this.v=this.f=this.g=this.o=this.s=NaN;this.c=null;this.m=new gj(b);this.a=new jj}function mj(b,c){var d=Date.now()/1E3,e=null==b.c?0:d-b.c;c?b.b+=e:b.h+=e;b.c=d};function W(b,c){var d=this;E.call(this);this.f=null;this.fb=!1;this.o=new Eb;this.Vb=this.g=this.va=this.c=this.m=this.a=this.R=this.na=this.i=this.s=this.h=this.A=null;this.Kc=1E9;this.zb=new Set;this.cb=!1;this.oa=!0;this.M=this.Bb=this.$=null;this.Jc=!1;this.Ic=0;this.D=null;this.v=new Fg;this.b=nj(this);this.Ab={width:Infinity,height:Infinity};this.l=null;this.xb=new Ng(this.b.preferredAudioLanguage,this.b.preferredVariantRole,this.b.preferredAudioChannelCount);this.P=this.b.preferredTextLanguage;
this.bb=this.b.preferredTextRole;c&&c(this);this.A=oj(this);b&&this.Cb(b,!0);this.eb=new Wi(function(){d.o&&(d.o.L(),d.o=null);var b=[];d.A&&(b.push(d.A.destroy()),d.A=null);d.fb=!1;d.o=null;d.g=null;d.Vb=null;d.b=null;return Promise.all(b)});G(this.o,window,"online",function(){d.xc()})}Ga(W,E);y("shaka.Player",W);function pj(b){if(!b.$)return Promise.resolve();var c=Promise.resolve();b.m&&(c=b.m.stop(),b.m=null);return Promise.all([c,b.$()])}
W.prototype.destroy=function(){var b=this;return t(function d(){return v(d,function(d){switch(d.j){case 1:return u(d,b.detach(),2);case 2:return u(d,b.eb.destroy(),0)}})})};W.prototype.destroy=W.prototype.destroy;W.version="v2.5.0-beta3-uncompiled";var qj=["2","5"];Dd=new function(b){this.a=b;this.c=Ed;this.b=Fd}(new Bd(Number(qj[0]),Number(qj[1])));var rj=["output-restricted","internal-error"],sj={};W.registerSupportPlugin=function(b,c){sj[b]=c};
W.isBrowserSupported=function(){return!!window.Promise&&!!window.Uint8Array&&!!Array.prototype.forEach&&!!window.MediaSource&&!!MediaSource.isTypeSupported&&!!window.MediaKeys&&!!window.navigator&&!!window.navigator.requestMediaKeySystemAccess&&!!window.MediaKeySystemAccess&&!!window.MediaKeySystemAccess.prototype.getConfiguration};W.probeSupport=function(){return Fc().then(function(b){var c=ff(),d=jd();b={manifest:c,media:d,drm:b};for(var e in sj)b[e]=sj[e]();return b})};
W.prototype.Cb=function(b,c){var d=this;return t(function f(){return v(f,function(f){switch(f.j){case 1:void 0===c&&(c=!0);if(!d.f){f.B(2);break}return u(f,d.detach(),2);case 2:d.f=b;G(d.o,d.f,"error",d.We.bind(d));if(c)return d.s=tj(d),u(f,d.s.o,0);f.B(0)}})})};W.prototype.attach=W.prototype.Cb;W.prototype.detach=function(){var b=this;return t(function d(){return v(d,function(d){switch(d.j){case 1:return b.f?u(d,b.wb(!1),2):d["return"]();case 2:b.o.ua(b.f,"error"),b.f=null,d.j=0}})})};
W.prototype.detach=W.prototype.detach;function uj(b,c,d){return t(function f(){var g;return v(f,function(f){switch(f.j){case 1:return u(f,gf(c,b.A,b.b.manifest.retryParameters,d),2);case 2:return g=f.u,f["return"](g)}})})}
function vj(b){b.R=new mh;nh(b.R,function(c){wj(b,"timelineregionadded",c)});return b.m.start(b.va,{networkingEngine:b.A,filterNewPeriod:b.$b.bind(b),filterAllPeriods:b.Sc.bind(b),onTimelineRegionAdded:function(c){var d=b.R;a:{var e=q(d.a);for(var f=e.next();!f.done;f=e.next())if(f=f.value,f.schemeIdUri==c.schemeIdUri&&f.startTime==c.startTime&&f.endTime==c.endTime){e=f;break a}e=null}null==e&&(d.a.add(c),d.b(c))},onEvent:b.vb.bind(b),onError:b.Ja.bind(b)})}
function xj(b){function c(b){return b.video&&b.audio||b.video&&b.video.codecs.includes(",")}b.c.periods.some(function(b){return b.variants.some(c)})&&b.c.periods.forEach(function(b){b.variants=b.variants.filter(c)});if(0==b.c.periods.length)throw new B(2,4,4014);}
W.prototype.load=function(b,c,d){c=void 0===c?null:c;var e=this;return t(function g(){var h,k,l,m,p,r,w,x,A,R,X,Y,fa,ia,Ka;return v(g,function(g){switch(g.j){case 1:if(!e.f)throw new B(2,7,7002);k=new z;l=function(){h=new B(2,7,7E3);return k};e.dispatchEvent(new D("loading"));qa(g,2);m=e.f;p=e.wb();e.$=l;return u(g,p,4);case 4:e.l=new lj(m);e.l.g=Date.now()/1E3;G(e.o,m,"playing",function(){yj(e)});G(e.o,m,"pause",function(){yj(e)});G(e.o,m,"ended",function(){yj(e)});r=e.b.abrFactory;e.g&&e.Vb==r||
(e.Vb=r,e.g=new r,e.g.configure(e.b.abr));if(h)throw h;x=w=null;d&&("string"==typeof d?x=d:(Cd("Loading with a manifest parser factory","Please register a manifest parser and for the mime-type."),w=d));A=e;if(w){R=new w;g.B(5);break}return u(g,uj(e,b,x),6);case 6:R=g.u;case 5:return A.m=R,e.m.configure(e.b.manifest),e.va=b,u(g,vj(e),7);case 7:X=g.u;e.c=X;if(h)throw h;xj(e);Y=e;return u(g,zj(e,X),8);case 8:Y.h=g.u;if(h)throw h;e.Sc(e.c.periods);Aj(e,e.c.periods);e.xb=new Ng(e.b.preferredAudioLanguage,
e.b.preferredVariantRole,e.b.preferredAudioChannelCount);e.P=e.b.preferredTextLanguage;Bj(e.c.presentationTimeline,e.b.playRangeStart,e.b.playRangeEnd);return u(g,e.h.Cb(m),9);case 9:if(h)throw h;e.g.init(function(b,c,d){c=void 0===c?!1:c;d=void 0===d?0:d;Cj(e,e.c.periods[K.de(e.c,b)],b,!0);e.a&&(Fh(e.a,b,c,d),Dj(e))});e.s||(e.s=tj(e));e.i=new hh(e.f,e.c.presentationTimeline,e.c.minBufferTime||0,e.b.streaming,c,e.Af.bind(e),e.vb.bind(e));e.na=Ej(e);e.a=Fj(e);e.a.configure(e.b.streaming);Gj(e);e.dispatchEvent(new D("streaming"));
return u(g,e.a.init(),10);case 10:if(h)throw h;e.b.streaming.startAtSegmentBoundary&&(fa=Hj(e,kh(e.i)),eh(e.i.b,fa));e.c.periods.forEach(e.$b.bind(e));Ij(e);Dj(e);ia=Jj(e);ia.variants.some(function(b){return b.primary});Kj(e,ia.variants);Hb(e.o,m,"loadeddata",function(){e.l.f=Date.now()/1E3});if(h)throw h;e.$=null;sa(g,0);break;case 2:return Ka=ta(g),k.resolve(),e.$==l&&(e.$=null,e.dispatchEvent(new D("unloading"))),g["return"](Promise.reject(h||Ka))}})})};W.prototype.load=W.prototype.load;
function Gj(b){function c(b){var c="";b.video&&(c=Pb(b.video.codecs)[0]);var d="";b.audio&&(d=Pb(b.audio.codecs)[0]);return c+"-"+d}var d=b.c.periods.reduce(function(b,c){return b.concat(c.variants)},[]);d=K.Uc(d,b.b.preferredAudioChannelCount);var e=new pb;d.forEach(function(b){var d=c(b);e.push(d,b)});var f=null,g=Infinity;e.forEach(function(b,c){var d=0,e=0;c.forEach(function(b){d+=b.bandwidth||0;++e});var h=d/e;h<g&&(f=b,g=h)});b.c.periods.forEach(function(b){b.variants=b.variants.filter(function(b){return c(b)==
f?!0:!1})})}function zj(b,c){return t(function e(){var f,g,h;return v(e,function(e){switch(e.j){case 1:return f={nb:b.A,onError:function(c){b.Ja(c)},qc:function(c){Lj(b,c)},onExpirationUpdated:function(c,e){if(b.m&&b.m.onExpirationUpdated)b.m.onExpirationUpdated(c,e);b.dispatchEvent(new D("expirationupdated"))},onEvent:function(c){b.vb(c)}},g=new cc(f),g.configure(b.b.drm),h=K.Yc(c),u(e,jc(g,h,c.offlineSessionIds),2);case 2:return e["return"](g)}})})}
function oj(b){return new F(function(c,d){b.g&&b.g.segmentDownloaded(c,d)})}
function Ej(b){var c=new ah(b.c);bh(c,function(){Ij(b)});var d=new oh(b.R);sh(d,function(c){wj(b,"timelineregionenter",c)},function(c){wj(b,"timelineregionexit",c)},function(c,d){d||(wj(b,"timelineregionenter",c),wj(b,"timelineregionexit",c))});var e=new Sg(Math.max(b.c.minBufferTime,b.b.streaming.rebufferingGoal),function(c){return Rc(b.f.buffered,c)},function(){var c;a:if((c=b.f.ended)||(c=b.s,c=c.g?"ended"==c.g.readyState:!0),c)c=!0;else{if(b.c.presentationTimeline.U()&&(c=b.c.presentationTimeline.Sa(),
Lc(b.f.buffered)>=c)){c=!0;break a}c=!1}return c});Vg(e,function(){return Mj(b,!0)},function(){return Mj(b,!1)});var f=new Qg(b.f);f.a.add(c);f.a.add(d);f.a.add(e);return f}function tj(b){var c=window.muxjs?new Jc:new Kc,d=new b.b.textDisplayFactory;d.setTextVisibility(b.fb);return new hd(b.f,c,d)}function Fj(b){return new th(b.c,{Qa:function(){return kh(b.i)},J:b.s,nb:b.A,hd:b.Ge.bind(b),gd:b.Xd.bind(b),onError:b.Ja.bind(b),onEvent:b.vb.bind(b),Je:b.Ke.bind(b),pb:b.Te.bind(b)})}
W.prototype.configure=function(b,c){if(2==arguments.length&&"string"==typeof b){for(var d=b,e={},f=e,g=0,h=0;;){g=d.indexOf(".",g);if(0>g)break;if(0==g||"\\"!=d[g-1])h=d.substring(h,g).replace(/\\\./g,"."),f[h]={},f=f[h],h=g+1;g+=1}f[d.substring(h).replace(/\\\./g,".")]=c;b=e}d=fj(this.b,b,nj(this));Nj(this);return d};W.prototype.configure=W.prototype.configure;
function Nj(b){b.m&&b.m.configure(b.b.manifest);b.h&&b.h.configure(b.b.drm);if(b.a){b.a.configure(b.b.streaming);try{b.c.periods.forEach(b.$b.bind(b))}catch(f){b.Ja(f)}var c=wh(b.a),d=yh(b.a),e=Jj(b);c=K.ad(c,d,e.variants);b.g&&c&&c.allowedByApplication&&c.allowedByKeySystem?Kj(b,e.variants):Oj(b,e)}b.g&&(b.g.configure(b.b.abr),b.b.abr.enabled&&!b.oa?b.g.enable():b.g.disable())}W.prototype.getConfiguration=function(){var b=nj(this);fj(b,this.b,nj(this));return b};W.prototype.getConfiguration=W.prototype.getConfiguration;
W.prototype.qf=function(){for(var b in this.b)delete this.b[b];fj(this.b,nj(this),nj(this));Nj(this)};W.prototype.resetConfiguration=W.prototype.qf;W.prototype.oe=function(){return this.f};W.prototype.getMediaElement=W.prototype.oe;W.prototype.hb=function(){return this.A};W.prototype.getNetworkingEngine=W.prototype.hb;W.prototype.ac=function(){return this.va};W.prototype.getAssetUri=W.prototype.ac;W.prototype.ne=function(){Cd("getManifestUri",'Please use "getAssetUri" instead.');return this.va};
W.prototype.getManifestUri=W.prototype.ne;W.prototype.U=function(){return this.c?this.c.presentationTimeline.U():!1};W.prototype.isLive=W.prototype.U;W.prototype.Ga=function(){return this.c?this.c.presentationTimeline.Ga():!1};W.prototype.isInProgress=W.prototype.Ga;W.prototype.Ce=function(){if(!this.c||!this.c.periods.length)return!1;var b=this.c.periods[0].variants;return b.length?!b[0].video:!1};W.prototype.isAudioOnly=W.prototype.Ce;
W.prototype.sf=function(){var b=0,c=0;this.c&&(c=this.c.presentationTimeline,b=c.Ra(),c=c.qa());return{start:b,end:c}};W.prototype.seekRange=W.prototype.sf;W.prototype.keySystem=function(){return this.h?this.h.keySystem():""};W.prototype.keySystem=W.prototype.keySystem;W.prototype.drmInfo=function(){return this.h?this.h.a:null};W.prototype.drmInfo=W.prototype.drmInfo;W.prototype.Lb=function(){return this.h?this.h.Lb():Infinity};W.prototype.getExpiration=W.prototype.Lb;W.prototype.ed=function(){return this.cb};
W.prototype.isBuffering=W.prototype.ed;W.prototype.wb=function(b){var c=this;return t(function e(){return v(e,function(e){switch(e.j){case 1:if(c.eb.a)return e["return"]();void 0===b&&(b=!0);c.dispatchEvent(new D("unloading"));return u(e,pj(c),2);case 2:return c.Bb||(c.Bb=Pj(c).then(function(){Mj(c,!1);c.Bb=null})),u(e,c.Bb,3);case 3:if(b)return c.s=tj(c),u(e,c.s.o,0);e.B(0)}})})};W.prototype.unload=W.prototype.wb;W.prototype.ib=function(){return this.i?this.i.ib():0};
W.prototype.getPlaybackRate=W.prototype.ib;W.prototype.Kf=function(b){this.i&&gh(this.i.b,b);this.a&&Dh(this.a,1!=b)};W.prototype.trickPlay=W.prototype.Kf;W.prototype.Yd=function(){this.i&&gh(this.i.b,1);this.a&&Dh(this.a,!1)};W.prototype.cancelTrickPlay=W.prototype.Yd;W.prototype.xe=function(){for(var b=Qj(this),c=[],d=q(Rj(this)),e=d.next();!e.done;e=d.next()){e=e.value;var f=K.Gc(e);f.active=e==b;c.push(f)}return c};W.prototype.getVariantTracks=W.prototype.xe;
W.prototype.$c=function(){var b=Jj(this);if(null==b)b=null;else{if(!Gg(this.v,b).text){var c=K.Gb(b.textStreams,this.P,this.bb);c.length&&(c=c[0],Gg(this.v,b).text=c)}b=Gg(this.v,b).text}c=[];for(var d=q(Sj(this)),e=d.next();!e.done;e=d.next()){e=e.value;var f=K.Cc(e);f.active=e==b;c.push(f)}return c};W.prototype.getTextTracks=W.prototype.$c;W.prototype.Bd=function(b){var c=Jj(this);null!=c&&(b=K.ee(c,b))&&(Gg(this.v,c).text=b,kj(this.l.a,b,!1),Tj(this,b),this.P=b.language)};
W.prototype.selectTextTrack=W.prototype.Bd;W.prototype.uf=function(){Cd("selectEmbeddedTextTrack","If closed captions are signaled in the manifest, a text stream will be created to represent them. Please use SelectTextTrack.");var b=this.$c().filter(function(b){return"application/cea-608"==b.mimeType});0<b.length&&this.Bd(b[0])};W.prototype.selectEmbeddedTextTrack=W.prototype.uf;
W.prototype.Pf=function(){Cd("usingEmbeddedTextTrack","If closed captions are signaled in the manifest, a text stream will be created to represent them. There should be no reason to know if the player is playing embedded text.");var b=this.a?xh(this.a,"text"):null;return null!=b&&"application/cea-608"==b.mimeType};W.prototype.usingEmbeddedTextTrack=W.prototype.Pf;
W.prototype.wf=function(b,c,d){d=void 0===d?0:d;var e=Jj(this);null!=e&&(this.b.abr.enabled&&Na("Changing tracks while abr manager is enabled will likely result in the selected track being overriden. Consider disabling abr before calling selectVariantTrack()."),(b=K.fe(e,b))&&K.Ta(b)&&(Cj(this,e,b,!1),Uj(this,b,c,d),this.xb=new Mg(b),Kj(this,e.variants)))};W.prototype.selectVariantTrack=W.prototype.wf;
W.prototype.ie=function(){for(var b=[],c=q(Rj(this)),d=c.next();!d.done;d=c.next())b.push(d.value.audio);return Vj(b)};W.prototype.getAudioLanguagesAndRoles=W.prototype.ie;W.prototype.ve=function(){return Vj(Sj(this))};W.prototype.getTextLanguagesAndRoles=W.prototype.ve;W.prototype.he=function(){for(var b=[],c=q(Rj(this)),d=c.next();!d.done;d=c.next())b.push(d.value.audio);return Array.from(Wj(b))};W.prototype.getAudioLanguages=W.prototype.he;W.prototype.ue=function(){return Array.from(Wj(Sj(this)))};
W.prototype.getTextLanguages=W.prototype.ue;W.prototype.tf=function(b,c){var d=Jj(this);null!=d&&(this.xb=new Ng(b,c||"",0),Oj(this,d))};W.prototype.selectAudioLanguage=W.prototype.tf;W.prototype.vf=function(b,c){var d=Jj(this);null!=d&&(this.P=b,this.bb=c||"",Oj(this,d))};W.prototype.selectTextLanguage=W.prototype.vf;W.prototype.gc=function(){return this.fb};W.prototype.isTextTrackVisible=W.prototype.gc;
W.prototype.Ed=function(b){var c=this;return t(function e(){var f,g,h,k;return v(e,function(e){switch(e.j){case 1:if(b==c.fb)return e["return"]();c.s&&c.s.l.setTextVisibility(b);c.fb=b;Xj(c);if(c.b.streaming.alwaysStreamText||!c.a)return e["return"]();f=K;if(b){if(g=Jj(c),h=f.Gb(g.textStreams,c.P,c.bb),k=h[0])return u(e,zh(c.a,k),0)}else{var l=c.a;l.A=!0;var p=l.c.get("text");p&&(uh(p),l.c["delete"]("text"))}e.B(0)}})})};W.prototype.setTextTrackVisibility=W.prototype.Ed;
W.prototype.re=function(){return this.c?new Date(1E3*this.c.presentationTimeline.f+1E3*this.f.currentTime):null};W.prototype.getPlayheadTimeAsDate=W.prototype.re;W.prototype.te=function(){return this.c?new Date(1E3*this.c.presentationTimeline.f):null};W.prototype.getPresentationStartTimeAsDate=W.prototype.te;W.prototype.bc=function(){return this.s?this.s.bc():{total:[],audio:[],video:[],text:[]}};W.prototype.getBufferedInfo=W.prototype.bc;
W.prototype.getStats=function(){if(null==this.l)return{width:NaN,height:NaN,streamBandwidth:NaN,decodedFrames:NaN,droppedFrames:NaN,estimatedBandwidth:NaN,loadLatency:NaN,playTime:NaN,bufferingTime:NaN,switchHistory:[],stateHistory:[]};mj(this.l,this.cb);yj(this);var b=this.f;if(b.getVideoPlaybackQuality){b=b.getVideoPlaybackQuality();var c=this.l,d=Number(b.totalVideoFrames);c.s=Number(b.droppedVideoFrames);c.o=d}if(b=Qj(this))this.l.v=b.bandwidth;b&&b.video&&(c=this.l,d=b.video.height||NaN,c.A=
b.video.width||NaN,c.l=d);this.g&&(b=this.g.getBandwidthEstimate(),this.l.i=b);b=this.l;c=b.A;d=b.l;for(var e=b.v,f=b.o,g=b.s,h=b.i,k=b.f>b.g?b.f-b.g:NaN,l=b.h,m=b.b,p=[],r=q(b.a.a),w=r.next();!w.done;w=r.next())w=w.value,p.push({timestamp:w.timestamp,id:w.id,type:w.type,fromAdaptation:w.fromAdaptation,bandwidth:w.bandwidth});return{width:c,height:d,streamBandwidth:e,decodedFrames:f,droppedFrames:g,estimatedBandwidth:h,loadLatency:k,playTime:l,bufferingTime:m,switchHistory:p,stateHistory:hj(b.m)}};
W.prototype.getStats=W.prototype.getStats;
W.prototype.addTextTrack=function(b,c,d,e,f,g){var h=Jj(this);if(null==h)return Promise.reject();var k=this.c.periods.indexOf(h)+1,l=(k>=this.c.periods.length?this.c.presentationTimeline.T():this.c.periods[k].startTime)-h.startTime;if(Infinity==l)return Promise.reject(new B(1,4,4033));var m={id:this.Kc++,originalId:null,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(){return 1},getSegmentReference:function(c){return 1!=c?null:new O(1,0,l,function(){return[b]},0,null)},
initSegmentReference:null,presentationTimeOffset:0,mimeType:e,codecs:f||"",kind:d,encrypted:!1,keyId:null,language:c,label:g||null,type:"text",primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],channelsCount:null,closedCaptions:null};this.zb.add(m);h.textStreams.push(m);return zh(this.a,m).then(function(){if(!this.eb.a){var b=xh(this.a,"text");b&&(Gg(this.v,h).text=b);this.zb["delete"](m);Oj(this,h);Ij(this);return{id:m.id,active:!1,type:"text",bandwidth:0,language:c,label:g||null,kind:d,
width:null,height:null}}}.bind(this))};W.prototype.addTextTrack=W.prototype.addTextTrack;W.prototype.zc=function(b,c){this.Ab.width=b;this.Ab.height=c};W.prototype.setMaxHardwareResolution=W.prototype.zc;W.prototype.xc=function(){if(this.a){var b=this.a;if(b.f)b=!1;else if(b.m)b=!1;else{for(var c=q(b.c.values()),d=c.next();!d.done;d=c.next())d=d.value,d.lb&&(d.lb=!1,Ch(b,d,.1));b=!0}}else b=!1;return b};W.prototype.retryStreaming=W.prototype.xc;W.prototype.me=function(){return this.c};
W.prototype.getManifest=W.prototype.me;function Cj(b,c,d,e){Gg(b.v,c).variant=d;b=b.l.a;b.c!=d&&(b.c=d,b.a.push({timestamp:Date.now()/1E3,id:d.id,type:"variant",fromAdaptation:e,bandwidth:d.bandwidth}))}
function Pj(b){b.o&&(b.o.ua(b.f,"loadeddata"),b.o.ua(b.f,"playing"),b.o.ua(b.f,"pause"),b.o.ua(b.f,"ended"));b.na&&(b.na.L(),b.na=null);b.i&&(b.i.L(),b.i=null);var c=b.h,d=Promise.all([b.g?b.g.stop():null,b.s?b.s.destroy():null,b.a?b.a.destroy():null,b.m?b.m.stop():null]).then(function(){return c?c.destroy():null});b.R&&(b.R.L(),b.R=null);b.oa=!0;b.h=null;b.s=null;b.a=null;b.m=null;b.c=null;b.va=null;b.v.a.clear();b.zb.clear();b.l=null;return d}
function nj(b){var c=dj();c.streaming.failureCallback=function(c){var d=[1001,1002,1003];b.U()&&d.includes(c.code)&&(c.severity=1,b.xc())};c.textDisplayFactory=function(){return new Yj(b.f)};return c}
function Aj(b,c){for(var d=0;d<c.length;d++){for(var e=c[d],f=new Map,g=q(e.variants),h=g.next();!h.done;h=g.next())if(h=h.value,h.video&&h.video.closedCaptions){h=h.video;for(var k=q(h.closedCaptions.keys()),l=k.next();!l.done;l=k.next())if(l=l.value,!f.has(l)){var m={id:b.Kc++,originalId:l,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(){return null},getSegmentReference:function(){return null},initSegmentReference:null,presentationTimeOffset:0,mimeType:"application/cea-608",
codecs:"",kind:"caption",encrypted:!1,keyId:null,language:h.closedCaptions.get(l),label:null,type:"text",primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:h.roles,channelsCount:null,closedCaptions:null};f.set(l,m)}}f=q(f.values());for(g=f.next();!g.done;g=f.next())e.textStreams.push(g.value)}}n=W.prototype;
n.Sc=function(b){var c=this.a?wh(this.a):null,d=this.a?yh(this.a):null;b.forEach(K.filterNewPeriod.bind(null,this.h,c,d));c=ub(b,function(b){return b.variants.some(K.Ta)});if(0==c)throw new B(2,4,4032);if(c<b.length)throw new B(2,4,4011);b.forEach(function(b){K.Lc(b.variants,this.b.restrictions,this.Ab)&&this.a&&Jj(this)==b&&Ij(this);Zj(this,b.variants)}.bind(this))};
n.$b=function(b){var c=this.a?wh(this.a):null,d=this.a?yh(this.a):null;K.filterNewPeriod(this.h,c,d,b);c=b.variants;if(!c.some(K.Ta))throw new B(2,4,4011);Zj(this,b.variants);K.Lc(c,this.b.restrictions,this.Ab)&&this.a&&Jj(this)==b&&Ij(this);if(b=this.h?this.h.a:null)for(c=q(c),d=c.next();!d.done;d=c.next()){d=q(d.value.drmInfos);for(var e=d.next();!e.done;e=d.next())if(e=e.value,e.keySystem==b.keySystem){e=q(e.initData||[]);for(var f=e.next();!f.done;f=e.next())f=f.value,tc(this.h,f.initDataType,
f.initData)}}};function Uj(b,c,d,e){d=void 0===d?!1:d;e=void 0===e?0:e;b.oa?(b.M=c,b.Jc=d,b.Ic=e):(Fh(b.a,c,d,e),ck(b,new D("variantchanged")))}function Tj(b,c){b.oa?b.D=c:(Eh(b.a,c,!0,0),ck(b,new D("textchanged")))}function Hj(b,c){function d(b,c){if(!b)return null;var d=b.findSegmentPosition(c-g.startTime);return null==d?null:(d=b.getSegmentReference(d))?d.startTime+g.startTime:null}var e=wh(b.a),f=yh(b.a),g=Jj(b);e=d(e,c);f=d(f,c);return null!=f&&null!=e?Math.max(f,e):null!=f?f:null!=e?e:c}
function Mj(b,c){b.l&&mj(b.l,b.cb);b.cb=c;yj(b);if(b.i){var d=b.i.b;c!=d.g&&(d.g=c,gh(d,d.f))}b.dispatchEvent(new D("buffering",{buffering:c}))}function yj(b){if(b.l){var c=b.l.m,d=b.cb;null==c.a?c.a={timestamp:Date.now()/1E3,state:ij(c,d),duration:0}:(b=Date.now()/1E3,d=ij(c,d),c.a.duration=b-c.a.timestamp,c.a.state!=d&&(c.b.push(c.a),c.a={timestamp:b,state:d,duration:0}))}}n.Af=function(){this.na&&Rg(this.na,!0);this.a&&Jh(this.a)};
function Kj(b,c){try{Zj(b,c)}catch(e){return b.Ja(e),null}var d=c.filter(function(b){return K.Ta(b)});d=b.xb.create(d);b.g.setVariants(Array.from(d.values()));return b.g.chooseVariant()}function Oj(b,c){var d=Kj(b,c.variants);d&&(Cj(b,c,d,!0),Uj(b,d,!0));(d=K.Gb(c.textStreams,b.P,b.bb)[0]||null)&&(b.b.streaming.alwaysStreamText||b.gc())&&(Gg(b.v,c).text=d,kj(b.l.a,d,!0),Tj(b,d));Dj(b)}
n.Ge=function(b){try{this.oa=!0;this.g.disable();var c=Kj(this,b.variants),d=K.Gb(b.textStreams,this.P,this.bb)[0]||null;this.M&&(b.variants.includes(this.M)&&(c=this.M),this.M=null);this.D&&(b.textStreams.includes(this.D)&&(d=this.D),this.D=null);c&&Cj(this,b,c,!0);if(d){var e=d;Gg(this.v,b).text=e;kj(this.l.a,e,!0)}var f=this.a,g=f.c.get("video");if(g)var h=f.b.periods[g.xa];else{var k=f.c.get("audio");h=k?f.b.periods[k.xa]:null}var l=c?c.audio:null,m;if(m=!h&&l&&d){b=d;var p=J(this.b.preferredTextLanguage),
r=J(l.language),w=J(b.language);m=vd(w,p)&&!vd(r,w)}m&&(this.Ed(!0),Xj(this));return this.b.streaming.alwaysStreamText||this.gc()?{variant:c,text:d}:{variant:c,text:null}}catch(x){return this.Ja(x),{variant:null,text:null}}};n.Xd=function(){this.oa=!1;this.b.abr.enabled&&this.g.enable();this.M&&(Fh(this.a,this.M,this.Jc,this.Ic),this.M=null);this.D&&(Eh(this.a,this.D,!0,0),this.D=null)};n.Ke=function(){this.m&&this.m.update&&this.m.update()};n.Te=function(){this.i&&this.i.pb()};
function Dj(b){ck(b,new D("adaptation"))}function Ij(b){ck(b,new D("trackschanged"))}function Xj(b){b.dispatchEvent(new D("texttrackvisibility"))}n.Ja=function(b){if(!this.eb.a){var c=new D("error",{detail:b});this.dispatchEvent(c);c.defaultPrevented&&(b.handled=!0)}};n.vb=function(b){this.dispatchEvent(b)};function wj(b,c,d){b.vb(new D(c,{detail:{schemeIdUri:d.schemeIdUri,value:d.value,startTime:d.startTime,endTime:d.endTime,id:d.id,eventElement:d.eventElement}}))}
n.We=function(){if(this.f.error){var b=this.f.error.code;if(1!=b){var c=this.f.error.msExtendedCode;c&&(0>c&&(c+=Math.pow(2,32)),c=c.toString(16));this.Ja(new B(2,3,3016,b,c,this.f.error.message))}}};
function Lj(b,c){var d=Jj(b),e=!1,f=Object.keys(c),g=1==f.length&&"00"==f[0];f.length&&d.variants.forEach(function(b){K.we(b).forEach(function(d){var f=b.allowedByKeySystem;d.keyId&&(d=c[g?"00":d.keyId],b.allowedByKeySystem=!!d&&!rj.includes(d));f!=b.allowedByKeySystem&&(e=!0)})});f=wh(b.a);var h=yh(b.a);(f=K.ad(f,h,d.variants))&&!f.allowedByKeySystem&&Oj(b,d);e&&(Ij(b),Kj(b,d.variants))}function Bj(b,c,d){0<c&&(b.U()||b.Fd(c));d<b.T()&&(b.U()||b.la(d))}
function Zj(b,c){var d=b.h?Lb(b.h.$):{},e=Object.keys(d);e=e.length&&"00"==e[0];for(var f=!1,g=!1,h=[],k=[],l=q(c),m=l.next();!m.done;m=l.next()){m=m.value;var p=[];m.audio&&p.push(m.audio);m.video&&p.push(m.video);p=q(p);for(var r=p.next();!r.done;r=p.next())if(r=r.value,r.keyId){var w=d[e?"00":r.keyId];w?rj.includes(w)&&(k.includes(w)||k.push(w)):h.includes(r.keyId)||h.push(r.keyId)}m.allowedByApplication?m.allowedByKeySystem&&(f=!0):g=!0}if(!f)throw new B(2,4,4012,{hasAppRestrictions:g,missingKeys:h,
restrictedKeyStatuses:k});}function ck(b,c){t(function e(){return v(e,function(e){switch(e.j){case 1:return u(e,Promise.resolve(),2);case 2:b.eb.a||b.dispatchEvent(c),e.j=0}})})}function Wj(b){var c=new Set;b=q(b);for(var d=b.next();!d.done;d=b.next())(d=d.value)&&d.language?c.add(J(d.language)):c.add("und");return c}
function Vj(b){var c=new Map,d=[""];b=q(b);for(var e=b.next();!e.done;e=b.next()){var f=e.value;e="und";var g=d;f&&f.language&&(e=J(f.language));f&&f.roles.length&&(g=f.roles);c.has(e)||c.set(e,new Set);f=q(g);for(g=f.next();!g.done;g=f.next())g=g.value,c.get(e).add(g)}var h=[];c.forEach(function(b,c){for(var d=q(b),e=d.next();!e.done;e=d.next())h.push({language:c,role:e.value})});return h}function Rj(b){b=Jj(b);return null==b?[]:b.variants.filter(function(b){return K.Ta(b)})}
function Sj(b){var c=Jj(b);return null==c?[]:c.textStreams.filter(function(c){return!b.zb.has(c)})}function Jj(b){if(null==b.c||null==b.i)return null;var c=kh(b.i),d=null;b=q(b.c.periods);for(var e=b.next();!e.done;e=b.next())e=e.value,e.startTime<=c&&(d=e);return d}function Qj(b){var c=Jj(b);return c?Gg(b.v,c).variant:null};function dk(b,c,d){var e=void 0==c.expiration?Infinity:c.expiration,f=c.presentationTimeline.T();c=ek(c.periods[0]);return{offlineUri:null,originalManifestUri:b,duration:f,size:0,expiration:e,tracks:c,appMetadata:d}}function fk(b,c){var d=Ri(new Pi(b.ja(),b.W()),c.periods[0],new U(null,0)),e=c.appMetadata||{};d=ek(d);return{offlineUri:b.toString(),originalManifestUri:c.originalManifestUri,duration:c.duration,size:c.size,expiration:c.expiration,tracks:d,appMetadata:e}}
function ek(b){var c=[],d=K.pe(b.variants);d=q(d);for(var e=d.next();!e.done;e=d.next())c.push(K.Gc(e.value));b=q(b.textStreams);for(d=b.next();!d.done;d=b.next())c.push(K.Cc(d.value));return c};function gk(){this.a={}}function hk(b,c,d){d=d.endTime-d.startTime;return ik(b,c)*d}function ik(b,c){var d=b.a[c];null==d&&(d=0);return d};function jk(b,c){for(var d={width:Infinity,height:Infinity},e=q(b.periods),f=e.next();!f.done;f=e.next())f=f.value,f.variants=f.variants.filter(function(b){return K.jc(b,c,d)})}function kk(b){b=q(b.periods);for(var c=b.next();!c.done;c=b.next())c=c.value,c.variants=c.variants.filter(function(b){var c=!0;b.audio&&(c=c&&id(b.audio));b.video&&(c=c&&id(b.video));return c})}
function lk(b,c){for(var d=q(b.periods),e=d.next();!e.done;e=d.next())e=e.value,e.variants=e.variants.filter(function(b){return Gc(c,b)})}function mk(b){var c=new nk;b.periods.forEach(function(b,d){var e=ok(b.variants);if(0==d){e=q(e.a);for(var f=e.next();!f.done;f=e.next())c.add(f.value)}else pk(c,e)});b=q(b.periods);for(var d=b.next();!d.done;d=b.next())d=d.value,d.variants=d.variants.filter(function(b){return qk(c,new rk(b))})}
function sk(b,c){var d=new nk;b.periods.forEach(function(b,f){0<f&&(b.variants=b.variants.filter(function(b){return qk(d,new rk(b))}));c(b);d=ok(b.variants)})}function rk(b){var c=b.audio;b=b.video;this.b=c?c.mimeType:null;this.a=c?c.codecs.split(".")[0]:null;this.f=b?b.mimeType:null;this.c=b?b.codecs.split(".")[0]:null}function nk(){this.a=[]}nk.prototype.add=function(b){qk(this,b)||this.a.push(b)};function pk(b,c){b.a=b.a.filter(function(b){return qk(c,b)})}
function qk(b,c){return b.a.some(function(b){return c.b==b.b&&c.a==b.a&&c.f==b.f&&c.c==b.c})}function ok(b){var c=new nk;b=q(b);for(var d=b.next();!d.done;d=b.next())c.add(new rk(d.value));return c};function Z(b){var c=this;if(b&&b.constructor!=W)throw new B(2,9,9008);this.b=this.a=null;b?(this.a=b.b,this.b=b.hb()):(this.a=dj(),this.b=new F);this.g=!1;this.c=[];this.f=[];var d=!b;this.h=new Wi(function(){return t(function f(){var b;return v(f,function(f){switch(f.j){case 1:return b=function(){},u(f,Promise.all(c.f.map(function(c){return c.then(b,b)})),2);case 2:if(!d){f.B(3);break}return u(f,c.b.destroy(),3);case 3:c.a=null,c.b=null,f.j=0}})})})}y("shaka.offline.Storage",Z);
function tk(){return vi()}Z.support=tk;Z.prototype.destroy=function(){return this.h.destroy()};Z.prototype.destroy=Z.prototype.destroy;
Z.prototype.configure=function(b){var c=!1;null!=b.trackSelectionCallback&&(c=!0,b.offline=b.offline||{},b.offline.trackSelectionCallback=b.trackSelectionCallback);null!=b.progressCallback&&(c=!0,b.offline=b.offline||{},b.offline.progressCallback=b.progressCallback);null!=b.usePersistentLicense&&(c=!0,b.offline=b.offline||{},b.offline.usePersistentLicense=b.usePersistentLicense);c&&Cd("Storage.configure with OfflineConfig","Please configure storage with a player configuration.");return fj(this.a,
b)};Z.prototype.configure=Z.prototype.configure;Z.prototype.hb=function(){return this.b};Z.prototype.getNetworkingEngine=Z.prototype.hb;
Z.prototype.store=function(b,c,d){var e=this;return uk(this,vk(this,b,c||{},function(){return t(function g(){var c,k;return v(g,function(g){switch(g.j){case 1:return d&&"string"!=typeof d?(Cd("Storing with a manifest parser factory","Please register a manifest parser and for the mime-type."),c=d,g["return"](new c)):u(g,gf(b,e.b,e.a.manifest.retryParameters,d),2);case 2:return k=g.u,g["return"](k)}})})}))};Z.prototype.store=Z.prototype.store;
function vk(b,c,d,e){return t(function g(){var h,k,l,m,p,r,w,x,A,R;return v(g,function(g){switch(g.j){case 1:wk();if(b.g)return g["return"](Promise.reject(new B(2,9,9006)));b.g=!0;return u(g,xk(b,c,e),2);case 2:h=g.u;yk(b);k=!h.presentationTimeline.U()&&!h.presentationTimeline.Ga();if(!k)throw new B(2,9,9005,c);l=null;m=new ni;r=p=null;qa(g,3,4);return u(g,zk(b,h,function(b){r=r||b}),6);case 6:l=g.u;yk(b);if(r)throw r;Ak(b,h,l);return u(g,m.init(),7);case 7:return yk(b),u(g,pi(m),8);case 8:return p=
g.u,yk(b),u(g,Bk(b,p.W,l,h,c,d),9);case 9:w=g.u;yk(b);if(r)throw r;return u(g,p.W.addManifests([w]),10);case 10:return x=g.u,yk(b),A=new Ni("manifest",p.path.ja,p.path.W,x[0]),g["return"](fk(A,w));case 4:return ua(g),b.g=!1,b.c=[],u(g,m.destroy(),11);case 11:if(!l){g.B(12);break}return u(g,l.destroy(),12);case 12:va(g,0);break;case 3:R=ta(g);if(!p){g.B(14);break}return u(g,p.W.removeSegments(b.c,function(){}),14);case 14:throw r||R;}})})}
function Ak(b,c,d){jk(c,b.a.restrictions);kk(c);lk(c,d);mk(c);sk(c,function(c){for(var d=[],e=q(c.variants),h=e.next();!h.done;h=e.next())d.push(K.Gc(h.value));e=q(c.textStreams);for(h=e.next();!h.done;h=e.next())d.push(K.Cc(h.value));d=b.a.offline.trackSelectionCallback(d);var k=new Set,l=new Set;d=q(d);for(e=d.next();!e.done;e=d.next())e=e.value,"variant"==e.type&&k.add(e.id),"text"==e.type&&l.add(e.id);c.variants=c.variants.filter(function(b){return k.has(b.id)});c.textStreams=c.textStreams.filter(function(b){return l.has(b.id)})});
Ck(c)}function Bk(b,c,d,e,f,g){return t(function k(){var l,m,p,r;return v(k,function(k){switch(k.j){case 1:return l=dk(f,e,g),m=new ci(b.b,function(c,d){l.size=d;b.a.offline.progressCallback(l,c)}),ra(k,2),r=p=Dk(b,m,c,d,e,f,g),u(k,fi(m),4);case 4:return r.size=k.u,k["return"](p);case 2:return ua(k),u(k,m.destroy(),5);case 5:va(k,0)}})})}Z.prototype.remove=function(b){return uk(this,Ek(this,b))};Z.prototype.remove=Z.prototype.remove;
function Ek(b,c){wk();var d=Oi(c);if(null==d||"manifest"!=d.a)return Promise.reject(new B(2,9,9004,c));var e=new ni;return Xi([e],function(){return t(function g(){var c,k,l;return v(g,function(g){switch(g.j){case 1:return u(g,e.init(),2);case 2:return u(g,ri(e,d.ja(),d.W()),3);case 3:return c=g.u,u(g,c.getManifests([d.key()]),4);case 4:return k=g.u,l=k[0],u(g,Promise.all([Fk(b,l,e),Gk(b,c,d,l)]),0)}})})})}
function Hk(b,c){for(var d=[],e=q(b.periods),f=e.next();!f.done;f=e.next()){f=q(f.value.streams);for(var g=f.next();!g.done;g=f.next())g=g.value,c&&"video"==g.contentType?d.push({contentType:Mb(g.mimeType,g.codecs),robustness:b.drmInfo.videoRobustness}):c||"audio"!=g.contentType||d.push({contentType:Mb(g.mimeType,g.codecs),robustness:b.drmInfo.audioRobustness})}return d}function Fk(b,c,d){return t(function f(){return v(f,function(f){switch(f.j){case 1:return u(f,Ik(b.b,b.a.drm,d,c),0)}})})}
function Gk(b,c,d,e){function f(){k+=1;b.a.offline.progressCallback(l,k/h)}var g=Jk(e),h=g.length+1,k=0,l=fk(d,e);return Promise.all([c.removeSegments(g,f),c.removeManifests([d.key()],f)])}Z.prototype.mf=function(){return uk(this,Kk(this))};Z.prototype.removeEmeSessions=Z.prototype.mf;
function Kk(b){wk();var c=b.b,d=b.a.drm,e=new ni;return Xi([e],function(){return t(function g(){var b,k,l,m,p,r,w;return v(g,function(g){switch(g.j){case 1:return u(g,e.init(),2);case 2:b=!1,k=[],si(e,function(b){return k.push(b)}),l=q(k),m=l.next();case 3:if(m.done){g.B(5);break}p=m.value;return u(g,p.getAll(),6);case 6:return r=g.u,u(g,$i(d,c,r),7);case 7:return w=g.u,u(g,p.remove(w),8);case 8:w.length!=r.length&&(b=!0);m=l.next();g.B(3);break;case 5:return g["return"](!b)}})})})}
Z.prototype.list=function(){return uk(this,Lk())};Z.prototype.list=Z.prototype.list;
function Lk(){function b(b,d){return t(function h(){var e;return v(h,function(f){switch(f.j){case 1:return u(f,d.getAllManifests(),2);case 2:e=f.u,e.forEach(function(d,e){var f=fk(new Ni("manifest",b.ja,b.W,e),d);c.push(f)}),f.j=0}})})}wk();var c=[],d=new ni;return Xi([d],function(){return t(function f(){var c;return v(f,function(f){switch(f.j){case 1:return u(f,d.init(),2);case 2:return c=Promise.resolve(),qi(d,function(d,f){c=c.then(function(){return b(d,f)})}),u(f,c,0)}})})}).then(function(){return c})}
function xk(b,c,d){return t(function f(){var g,h,k,l,m,p;return v(f,function(f){switch(f.j){case 1:return g=null,h=b.b,k={networkingEngine:h,filterAllPeriods:function(){},filterNewPeriod:function(){},onTimelineRegionAdded:function(){},onEvent:function(){},onError:function(b){g=b}},u(f,d(),2);case 2:return l=f.u,l.configure(b.a.manifest),yk(b),ra(f,3),u(f,l.start(c,k),5);case 5:return m=f.u,yk(b),p=Mk(m),u(f,Promise.all(Array.from(p).map(function(b){return b.createSegmentIndex()})),6);case 6:yk(b);
if(g)throw g;return f["return"](m);case 3:return ua(f),u(f,l.stop(),7);case 7:va(f,0)}})})}function zk(b,c,d){return t(function f(){var g,h,k;return v(f,function(f){switch(f.j){case 1:return g=new cc({nb:b.b,onError:d,qc:function(){},onExpirationUpdated:function(){},onEvent:function(){}}),h=K.Yc(c),k=b.a,g.configure(k.drm),u(f,hc(g,h,k.offline.usePersistentLicense),2);case 2:return u(f,rc(g),3);case 3:return u(f,sc(g),4);case 4:return f["return"](g)}})})}
function Dk(b,c,d,e,f,g,h){var k=new gk,l=f.periods.map(function(e){return Nk(b,c,d,k,f,e)}),m=e.a,p=yc(e);if(m&&b.a.offline.usePersistentLicense){if(!p.length)throw new B(2,9,9007,g);m.initData=[]}return{originalManifestUri:g,duration:f.presentationTimeline.T(),size:0,expiration:e.Lb(),periods:l,sessionIds:b.a.offline.usePersistentLicense?p:[],drmInfo:m,appMetadata:h}}
function Nk(b,c,d,e,f,g){f.periods.forEach(function(b){b.variants.forEach(function(b){var c=b.audio,d=b.video;c&&!d&&(e.a[c.id]=c.bandwidth||b.bandwidth);!c&&d&&(e.a[d.id]=d.bandwidth||b.bandwidth);if(c&&d){var f=c.bandwidth||393216,g=d.bandwidth||b.bandwidth-f;0>=g&&(g=b.bandwidth);e.a[c.id]=f;e.a[d.id]=g}});b.textStreams.forEach(function(b){e.a[b.id]=52})});var h=Mk(f),k=new Map;h=q(h);for(var l=h.next();!l.done;l=h.next()){l=l.value;var m=Ok(b,c,d,e,f,l);k.set(l.id,m)}g.variants.forEach(function(b){b.audio&&
k.get(b.audio.id).variantIds.push(b.id);b.video&&k.get(b.video.id).variantIds.push(b.id)});return{startTime:g.startTime,streams:Array.from(k.values())}}
function Ok(b,c,d,e,f,g){var h={id:g.id,originalId:g.originalId,primary:g.primary,presentationTimeOffset:g.presentationTimeOffset||0,contentType:g.type,mimeType:g.mimeType,codecs:g.codecs,frameRate:g.frameRate,kind:g.kind,language:g.language,label:g.label,width:g.width||null,height:g.height||null,initSegmentKey:null,encrypted:g.encrypted,keyId:g.keyId,segments:[],variantIds:[]};f=f.presentationTimeline.kb();var k=g.id;Pk(g,f,function(f){di(c,k,Qk(b,f),hk(e,g.id,f),function(c){return d.addSegments([{data:c}]).then(function(c){b.c.push(c[0]);
h.segments.push({startTime:f.startTime,endTime:f.endTime,dataKey:c[0]})})})});(f=g.initSegmentReference)&&di(c,k,Qk(b,f),.5*ik(e,g.id),function(c){return d.addSegments([{data:c}]).then(function(c){b.c.push(c[0]);h.initSegmentKey=c[0]})});return h}function Pk(b,c,d){c=b.findSegmentPosition(c);for(var e=null==c?null:b.getSegmentReference(c);e;)d(e),e=b.getSegmentReference(++c)}function yk(b){if(b.h.a)throw new B(2,9,7001);}function wk(){if(!vi())throw new B(2,9,9E3);}
function Qk(b,c){var d=b.a.streaming.retryParameters;d=Ab(c.c(),d);if(0!=c.b||null!=c.a)d.headers.Range="bytes="+c.b+"-"+(null==c.a?"":c.a);return d}function uk(b,c){return t(function e(){return v(e,function(e){switch(e.j){case 1:return b.f.push(c),ra(e,2),u(e,c,4);case 4:return e["return"](e.u);case 2:ua(e),sb(b.f,c),va(e,0)}})})}
function Jk(b){var c=[];b.periods.forEach(function(b){b.streams.forEach(function(b){null!=b.initSegmentKey&&c.push(b.initSegmentKey);b.segments.forEach(function(b){c.push(b.dataKey)})})});return c}Z.deleteAll=function(){return t(function c(){var d;return v(c,function(c){switch(c.j){case 1:return d=new ni,ra(c,2),u(c,d.erase(),2);case 2:return ua(c),u(c,d.destroy(),5);case 5:va(c,0)}})})};
function Ik(b,c,d,e){return t(function g(){var h,k,l;return v(g,function(g){switch(g.j){case 1:if(!e.drmInfo)return g["return"]();h=ti(d);k=e.sessionIds.map(function(b){return{sessionId:b,keySystem:e.drmInfo.keySystem,licenseUri:e.drmInfo.licenseServerUri,serverCertificate:e.drmInfo.serverCertificate,audioCapabilities:Hk(e,!1),videoCapabilities:Hk(e,!0)}});return u(g,$i(c,b,k),2);case 2:return l=g.u,u(g,h.remove(l),3);case 3:return u(g,h.add(k.filter(function(b){return-1==l.indexOf(b.sessionId)})),
0)}})})}function Mk(b){var c=new Set;b=q(b.periods);for(var d=b.next();!d.done;d=b.next()){d=d.value;for(var e=q(d.textStreams),f=e.next();!f.done;f=e.next())c.add(f.value);d=q(d.variants);for(e=d.next();!e.done;e=d.next())e=e.value,e.audio&&c.add(e.audio),e.video&&c.add(e.video)}return c}function Ck(b){if(0==b.periods.length)throw new B(2,4,4014);b=q(b.periods);for(var c=b.next();!c.done;c=b.next())Rk(c.value)}
function Rk(b){b.variants.map(function(b){return b.video});var c=new Set(b.variants.map(function(b){return b.audio}));b=b.textStreams;for(var d=q(c),e=d.next();!e.done;e=d.next()){e=q(c);for(var f=e.next();!f.done;f=e.next());}c=q(b);for(d=c.next();!d.done;d=c.next())for(d=q(b),e=d.next();!e.done;e=d.next());}sj.offline=tk;y("shaka.polyfill.installAll",function(){for(var b=0;b<Sk.length;++b)Sk[b].Vd()});var Sk=[];function Tk(b,c){c=c||0;for(var d={priority:c,Vd:b},e=0;e<Sk.length;e++)if(Sk[e].priority<c){Sk.splice(e,0,d);return}Sk.push(d)}y("shaka.polyfill.register",Tk);function Uk(b){var c=b.type.replace(/^(webkit|moz|MS)/,"").toLowerCase();if("function"===typeof Event)var d=new Event(c,b);else d=document.createEvent("Event"),d.initEvent(c,b.bubbles,b.cancelable);b.target.dispatchEvent(d)}
Tk(function(){if(window.Document){var b=Element.prototype;b.requestFullscreen=b.requestFullscreen||b.mozRequestFullScreen||b.msRequestFullscreen||b.webkitRequestFullscreen;b=Document.prototype;b.exitFullscreen=b.exitFullscreen||b.mozCancelFullScreen||b.msExitFullscreen||b.webkitExitFullscreen;"fullscreenElement"in document||(Object.defineProperty(document,"fullscreenElement",{get:function(){return document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement}}),Object.defineProperty(document,
"fullscreenEnabled",{get:function(){return document.mozFullScreenEnabled||document.msFullscreenEnabled||document.webkitFullscreenEnabled}}));document.addEventListener("webkitfullscreenchange",Uk);document.addEventListener("webkitfullscreenerror",Uk);document.addEventListener("mozfullscreenchange",Uk);document.addEventListener("mozfullscreenerror",Uk);document.addEventListener("MSFullscreenChange",Uk);document.addEventListener("MSFullscreenError",Uk)}});Tk(function(){Qb("CrKey")&&delete window.indexedDB});var Vk;function Wk(b,c,d){if("input"==b)switch(this.type){case "range":b="change"}Vk.call(this,b,c,d)}Tk(function(){Qb("Trident/")&&HTMLInputElement.prototype.addEventListener!=Wk&&(Vk=HTMLInputElement.prototype.addEventListener,HTMLInputElement.prototype.addEventListener=Wk)});Tk(function(){});function Xk(){var b=MediaSource.prototype.addSourceBuffer;MediaSource.prototype.addSourceBuffer=function(c){for(var d=[],e=0;e<arguments.length;++e)d[e]=arguments[e];d=b.apply(this,d);d.abort=function(){};return d}}function Yk(){var b=SourceBuffer.prototype.remove;SourceBuffer.prototype.remove=function(c,d){return b.call(this,c,d-.001)}}
function Zk(){var b=MediaSource.prototype.endOfStream;MediaSource.prototype.endOfStream=function(c){for(var d=[],e=0;e<arguments.length;++e)d[e]=arguments[e];for(var h=e=0;h<this.sourceBuffers.length;++h){var k=this.sourceBuffers[h];k=k.buffered.end(k.buffered.length-1);e=Math.max(e,k)}if(!isNaN(this.duration)&&e<this.duration)for(this.cd=!0,e=0;e<this.sourceBuffers.length;++e)this.sourceBuffers[e].Qc=!1;return b.apply(this,d)};var c=!1,d=MediaSource.prototype.addSourceBuffer;MediaSource.prototype.addSourceBuffer=
function(b){for(var e=[],g=0;g<arguments.length;++g)e[g]=arguments[g];e=d.apply(this,e);e.mediaSource_=this;e.addEventListener("updateend",$k,!1);c||(this.addEventListener("sourceclose",al,!1),c=!0);return e}}function $k(b){var c=b.target,d=c.mediaSource_;if(d.cd){b.preventDefault();b.stopPropagation();b.stopImmediatePropagation();c.Qc=!0;for(b=0;b<d.sourceBuffers.length;++b)if(0==d.sourceBuffers[b].Qc)return;d.cd=!1}}
function al(b){b=b.target;for(var c=0;c<b.sourceBuffers.length;++c)b.sourceBuffers[c].removeEventListener("updateend",$k,!1);b.removeEventListener("sourceclose",al,!1)}function bl(){var b=MediaSource.isTypeSupported;MediaSource.isTypeSupported=function(c){return"mp2t"==c.split(/ *; */)[0].split("/")[1]?!1:b(c)}}function cl(){var b=MediaSource.isTypeSupported;MediaSource.isTypeSupported=function(c){return"opus"!=Pb(c)[0]&&b(c)}}
function dl(){var b=MediaSource.isTypeSupported,c=/^dv(?:he|av)\./;MediaSource.isTypeSupported=function(d){for(var e=d.split(/ *; */),f=e[0],g={},h=1;h<e.length;++h){var k=e[h].split("="),l=k[0];k=k[1].replace(/"(.*)"/,"$1");g[l]=k}e=g.codecs;if(!e)return b(d);var m=!1,p=!1;d=e.split(",").filter(function(b){if(c.test(b))return p=!0,!1;/^(hev|hvc)1\.2/.test(b)&&(m=!0);return!0});p&&(m=!1);g.codecs=d.join(",");m&&(g.eotf="smpte2084");for(var r in g)f+="; "+r+'="'+g[r]+'"';return cast.__platform__.canDisplayType(f)}}
Tk(function(){if(window.MediaSource)if(window.cast&&cast.__platform__&&cast.__platform__.canDisplayType)dl();else if(navigator.vendor&&navigator.vendor.includes("Apple")){var b=navigator.appVersion;bl();if(b.includes("Version/8"))window.MediaSource=null;else if(b.includes("Version/9"))Xk();else if(b.includes("Version/10"))Xk(),Zk();else if(b.includes("Version/11")||b.includes("Version/12"))Xk(),Yk()}else Qb("Tizen")&&cl()});function el(b){this.f=[];this.b=[];this.a=[];(new Q).aa("pssh",this.c.bind(this)).parse(b.buffer)}el.prototype.c=function(b){if(!(1<b.version)){var c=$b(b.reader.Ia(16)),d=[];if(0<b.version)for(var e=b.reader.C(),f=0;f<e;++f){var g=$b(b.reader.Ia(16));d.push(g)}e=b.reader.C();b.reader.I(e);this.b.push.apply(this.b,d);this.f.push(c);this.a.push({start:b.start,end:b.start+b.size-1})}};function fl(b,c){try{var d=new gl(b,c);return Promise.resolve(d)}catch(e){return Promise.reject(e)}}
function gl(b,c){this.keySystem=b;for(var d=!1,e=0;e<c.length;++e){var f=c[e],g={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:f.initDataTypes,sessionTypes:["temporary"],label:f.label},h=!1;if(f.audioCapabilities)for(var k=0;k<f.audioCapabilities.length;++k){var l=f.audioCapabilities[k];if(l.contentType){h=!0;var m=l.contentType.split(";")[0];MSMediaKeys.isTypeSupported(this.keySystem,m)&&(g.audioCapabilities.push(l),d=!0)}}if(f.videoCapabilities)for(k=
0;k<f.videoCapabilities.length;++k)l=f.videoCapabilities[k],l.contentType&&(h=!0,m=l.contentType.split(";")[0],MSMediaKeys.isTypeSupported(this.keySystem,m)&&(g.videoCapabilities.push(l),d=!0));h||(d=MSMediaKeys.isTypeSupported(this.keySystem,"video/mp4"));"required"==f.persistentState&&(d=!1);if(d){this.a=g;return}}d=Error("Unsupported keySystem");d.name="NotSupportedError";d.code=DOMException.NOT_SUPPORTED_ERR;throw d;}gl.prototype.createMediaKeys=function(){var b=new hl(this.keySystem);return Promise.resolve(b)};
gl.prototype.getConfiguration=function(){return this.a};function il(b){var c=this.mediaKeys;c&&c!=b&&jl(c,null);delete this.mediaKeys;return(this.mediaKeys=b)?jl(b,this):Promise.resolve()}function hl(b){this.a=new MSMediaKeys(b);this.b=new Eb}hl.prototype.createSession=function(b){b=b||"temporary";if("temporary"!=b)throw new TypeError("Session type "+b+" is unsupported on this platform.");return new kl(this.a,b)};hl.prototype.setServerCertificate=function(){return Promise.resolve(!1)};
function jl(b,c){function d(){c.msSetMediaKeys(e.a);c.removeEventListener("loadedmetadata",d)}Fb(b.b);if(!c)return Promise.resolve();G(b.b,c,"msneedkey",ll);var e=b;try{return 1<=c.readyState?c.msSetMediaKeys(b.a):c.addEventListener("loadedmetadata",d),Promise.resolve()}catch(f){return Promise.reject(f)}}function kl(b){E.call(this);this.c=null;this.g=b;this.b=this.a=null;this.f=new Eb;this.sessionId="";this.expiration=NaN;this.closed=new z;this.keyStatuses=new ml}Ga(kl,E);n=kl.prototype;
n.generateRequest=function(b,c){this.a=new z;try{this.c=this.g.createSession("video/mp4",new Uint8Array(c),null),G(this.f,this.c,"mskeymessage",this.Oe.bind(this)),G(this.f,this.c,"mskeyadded",this.Me.bind(this)),G(this.f,this.c,"mskeyerror",this.Ne.bind(this)),nl(this,"status-pending")}catch(d){this.a.reject(d)}return this.a};n.load=function(){return Promise.reject(Error("MediaKeySession.load not yet supported"))};n.update=function(b){this.b=new z;try{this.c.update(new Uint8Array(b))}catch(c){this.b.reject(c)}return this.b};
n.close=function(){try{this.c.close(),this.closed.resolve(),Fb(this.f)}catch(b){this.closed.reject(b)}return this.closed};n.remove=function(){return Promise.reject(Error("MediaKeySession.remove is only applicable for persistent licenses, which are not supported on this platform"))};function ll(b){if(b.initData){var c=document.createEvent("CustomEvent");c.initCustomEvent("encrypted",!1,!1,null);c.initDataType="cenc";c.initData=ol(b.initData);this.dispatchEvent(c)}}
function ol(b){if(!b)return b;var c=new el(b);if(1>=c.a.length)return b;for(var d=[],e=0;e<c.a.length;e++)d.push(b.subarray(c.a[e].start,c.a[e].end+1));b=[];c={};e=q(d);for(d=e.next();!d.done;c={Mb:c.Mb},d=e.next())c.Mb=d.value,b.some(function(b){return function(c){return ac(c,b.Mb)}}(c))||b.push(c.Mb);c=0;e=q(b);for(d=e.next();!d.done;d=e.next())c+=d.value.length;c=new Uint8Array(c);e=0;b=q(b);for(d=b.next();!d.done;d=b.next())d=d.value,c.set(d,e),e+=d.length;return c}
n.Oe=function(b){this.a&&(this.a.resolve(),this.a=null);this.dispatchEvent(new D("message",{messageType:void 0==this.keyStatuses.a?"license-request":"license-renewal",message:b.message.buffer}))};n.Me=function(){this.a?(nl(this,"usable"),this.a.resolve(),this.a=null):this.b&&(nl(this,"usable"),this.b.resolve(),this.b=null)};
n.Ne=function(){var b=Error("EME PatchedMediaKeysMs key error");b.errorCode=this.c.error;if(null!=this.a)this.a.reject(b),this.a=null;else if(null!=this.b)this.b.reject(b),this.b=null;else switch(this.c.error.code){case MSMediaKeyError.MS_MEDIA_KEYERR_OUTPUT:case MSMediaKeyError.MS_MEDIA_KEYERR_HARDWARECHANGE:nl(this,"output-not-allowed");break;default:nl(this,"internal-error")}};function nl(b,c){var d=b.keyStatuses;d.size=void 0==c?0:1;d.a=c;b.dispatchEvent(new D("keystatuseschange"))}
function ml(){this.size=0;this.a=void 0}var pl;n=ml.prototype;n.forEach=function(b){this.a&&b(this.a,pl)};n.get=function(b){if(this.has(b))return this.a};n.has=function(b){var c=pl;return this.a&&ac(new Uint8Array(b),new Uint8Array(c))?!0:!1};n.entries=function(){};n.keys=function(){};n.values=function(){};
Tk(function(){!window.HTMLVideoElement||!window.MSMediaKeys||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration||(pl=(new Uint8Array([0])).buffer,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=il,window.MediaKeys=hl,window.MediaKeySystemAccess=gl,navigator.requestMediaKeySystemAccess=fl)});function ql(){return Promise.reject(Error("The key system specified is not supported."))}function rl(b){return null==b?Promise.resolve():Promise.reject(Error("MediaKeys not supported."))}function sl(){throw new TypeError("Illegal constructor.");}sl.prototype.createSession=function(){};sl.prototype.setServerCertificate=function(){};function tl(){throw new TypeError("Illegal constructor.");}tl.prototype.getConfiguration=function(){};tl.prototype.createMediaKeys=function(){};
Tk(function(){!window.HTMLVideoElement||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration||(navigator.requestMediaKeySystemAccess=ql,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=rl,window.MediaKeys=sl,window.MediaKeySystemAccess=tl)},-10);var ul="";function vl(b){var c=ul;return c?c+b.charAt(0).toUpperCase()+b.slice(1):b}function wl(b,c){try{var d=new xl(b,c);return Promise.resolve(d)}catch(e){return Promise.reject(e)}}function yl(b){var c=this.mediaKeys;c&&c!=b&&zl(c,null);delete this.mediaKeys;(this.mediaKeys=b)&&zl(b,this);return Promise.resolve()}
function xl(b,c){this.a=this.keySystem=b;var d=!1;"org.w3.clearkey"==b&&(this.a="webkit-org.w3.clearkey",d=!1);var e=!1;var f=document.getElementsByTagName("video");f=f.length?f[0]:document.createElement("video");for(var g=0;g<c.length;++g){var h=c[g],k={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:h.initDataTypes,sessionTypes:["temporary"],label:h.label},l=!1;if(h.audioCapabilities)for(var m=0;m<h.audioCapabilities.length;++m){var p=
h.audioCapabilities[m];if(p.contentType){l=!0;var r=p.contentType.split(";")[0];f.canPlayType(r,this.a)&&(k.audioCapabilities.push(p),e=!0)}}if(h.videoCapabilities)for(m=0;m<h.videoCapabilities.length;++m)p=h.videoCapabilities[m],p.contentType&&(l=!0,f.canPlayType(p.contentType,this.a)&&(k.videoCapabilities.push(p),e=!0));l||(e=f.canPlayType("video/mp4",this.a)||f.canPlayType("video/webm",this.a));"required"==h.persistentState&&(d?(k.persistentState="required",k.sessionTypes=["persistent-license"]):
e=!1);if(e){this.b=k;return}}d="Unsupported keySystem";if("org.w3.clearkey"==b||"com.widevine.alpha"==b)d="None of the requested configurations were supported.";d=Error(d);d.name="NotSupportedError";d.code=DOMException.NOT_SUPPORTED_ERR;throw d;}xl.prototype.createMediaKeys=function(){var b=new Al(this.a);return Promise.resolve(b)};xl.prototype.getConfiguration=function(){return this.b};function Al(b){this.g=b;this.b=null;this.a=new Eb;this.c=[];this.f={}}
function zl(b,c){b.b=c;Fb(b.a);var d=ul;c&&(G(b.a,c,d+"needkey",b.$e.bind(b)),G(b.a,c,d+"keymessage",b.Ze.bind(b)),G(b.a,c,d+"keyadded",b.Xe.bind(b)),G(b.a,c,d+"keyerror",b.Ye.bind(b)))}n=Al.prototype;n.createSession=function(b){b=b||"temporary";if("temporary"!=b&&"persistent-license"!=b)throw new TypeError("Session type "+b+" is unsupported on this platform.");var c=this.b||document.createElement("video");c.src||(c.src="about:blank");b=new Bl(c,this.g,b);this.c.push(b);return b};
n.setServerCertificate=function(){return Promise.resolve(!1)};n.$e=function(b){var c=document.createEvent("CustomEvent");c.initCustomEvent("encrypted",!1,!1,null);c.initDataType="webm";c.initData=b.initData;this.b.dispatchEvent(c)};n.Ze=function(b){var c=Cl(this,b.sessionId);c&&(b=new D("message",{messageType:void 0==c.keyStatuses.a?"licenserequest":"licenserenewal",message:b.message}),c.b&&(c.b.resolve(),c.b=null),c.dispatchEvent(b))};
n.Xe=function(b){if(b=Cl(this,b.sessionId))Dl(b,"usable"),b.a&&b.a.resolve(),b.a=null};
n.Ye=function(b){var c=Cl(this,b.sessionId);if(c){var d=Error("EME v0.1b key error");d.errorCode=b.errorCode;d.errorCode.systemCode=b.systemCode;!b.sessionId&&c.b?(d.method="generateRequest",45==b.systemCode&&(d.message="Unsupported session type."),c.b.reject(d),c.b=null):b.sessionId&&c.a?(d.method="update",c.a.reject(d),c.a=null):(d=b.systemCode,b.errorCode.code==MediaKeyError.MEDIA_KEYERR_OUTPUT?Dl(c,"output-restricted"):1==d?Dl(c,"expired"):Dl(c,"internal-error"))}};
function Cl(b,c){var d=b.f[c];return d?d:(d=b.c.shift())?(d.sessionId=c,b.f[c]=d):null}function Bl(b,c,d){E.call(this);this.f=b;this.h=!1;this.a=this.b=null;this.c=c;this.g=d;this.sessionId="";this.expiration=NaN;this.closed=new z;this.keyStatuses=new El}Ga(Bl,E);
function Fl(b,c,d){if(b.h)return Promise.reject(Error("The session is already initialized."));b.h=!0;try{if("persistent-license"==b.g)if(d)var e=new Uint8Array(Wb("LOAD_SESSION|"+d));else{var f=Wb("PERSISTENT|"),g=new Uint8Array(f.byteLength+c.byteLength);g.set(new Uint8Array(f),0);g.set(new Uint8Array(c),f.byteLength);e=g}else e=new Uint8Array(c)}catch(k){return Promise.reject(k)}b.b=new z;var h=vl("generateKeyRequest");try{b.f[h](b.c,e)}catch(k){if("InvalidStateError"!=k.name)return b.b=null,Promise.reject(k);
setTimeout(function(){try{this.f[h](this.c,e)}catch(l){this.b.reject(l),this.b=null}}.bind(b),10)}return b.b}n=Bl.prototype;
n.Bc=function(b,c){if(this.a)this.a.then(this.Bc.bind(this,b,c))["catch"](this.Bc.bind(this,b,c));else{this.a=b;if("webkit-org.w3.clearkey"==this.c){var d=Rb(c);var e=JSON.parse(d);"oct"!=e.keys[0].kty&&(this.a.reject(Error("Response is not a valid JSON Web Key Set.")),this.a=null);d=Yb(e.keys[0].k);e=Yb(e.keys[0].kid)}else d=new Uint8Array(c),e=null;var f=vl("addKey");try{this.f[f](this.c,d,e,this.sessionId)}catch(g){this.a.reject(g),this.a=null}}};
function Dl(b,c){var d=b.keyStatuses;d.size=void 0==c?0:1;d.a=c;b.dispatchEvent(new D("keystatuseschange"))}n.generateRequest=function(b,c){return Fl(this,c,null)};n.load=function(b){return"persistent-license"==this.g?Fl(this,null,b):Promise.reject(Error("Not a persistent session."))};n.update=function(b){var c=new z;this.Bc(c,b);return c};
n.close=function(){if("persistent-license"!=this.g){if(!this.sessionId)return this.closed.reject(Error("The session is not callable.")),this.closed;var b=vl("cancelKeyRequest");try{this.f[b](this.c,this.sessionId)}catch(c){}}this.closed.resolve();return this.closed};n.remove=function(){return"persistent-license"!=this.g?Promise.reject(Error("Not a persistent session.")):this.close()};function El(){this.size=0;this.a=void 0}var Gl;n=El.prototype;n.forEach=function(b){this.a&&b(this.a,Gl)};n.get=function(b){if(this.has(b))return this.a};
n.has=function(b){var c=Gl;return this.a&&ac(new Uint8Array(b),new Uint8Array(c))?!0:!1};n.entries=function(){};n.keys=function(){};n.values=function(){};
Tk(function(){if(!(!window.HTMLVideoElement||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration)){if(HTMLMediaElement.prototype.webkitGenerateKeyRequest)ul="webkit";else if(!HTMLMediaElement.prototype.generateKeyRequest)return;Gl=(new Uint8Array([0])).buffer;navigator.requestMediaKeySystemAccess=wl;delete HTMLMediaElement.prototype.mediaKeys;HTMLMediaElement.prototype.mediaKeys=null;HTMLMediaElement.prototype.setMediaKeys=yl;window.MediaKeys=Al;window.MediaKeySystemAccess=
xl}});Tk(function(){if(window.HTMLMediaElement){var b=HTMLMediaElement.prototype.play;HTMLMediaElement.prototype.play=function(){var c=b.apply(this);c&&c["catch"](function(){});return c}}});function Hl(){return{droppedVideoFrames:this.webkitDroppedFrameCount,totalVideoFrames:this.webkitDecodedFrameCount,corruptedVideoFrames:0,creationTime:NaN,totalFrameDelay:0}}Tk(function(){if(window.HTMLVideoElement){var b=HTMLVideoElement.prototype;!b.getVideoPlaybackQuality&&"webkitDroppedFrameCount"in b&&(b.getVideoPlaybackQuality=Hl)}});function Il(b,c,d){return new window.TextTrackCue(b,c,d)}function Jl(b,c,d){return new window.TextTrackCue(b+"-"+c+"-"+d,b,c,d)}Tk(function(){if(!window.VTTCue&&window.TextTrackCue){var b=TextTrackCue.length;if(3==b)window.VTTCue=Il;else if(6==b)window.VTTCue=Jl;else{try{var c=!!Il(1,2,"")}catch(d){c=!1}c&&(window.VTTCue=Il)}}});function gd(b,c,d){this.startTime=b;this.direction=Kl;this.endTime=c;this.payload=d;this.region=new Ll;this.position=null;this.positionAlign=Ml;this.size=100;this.textAlign=Nl;this.writingMode=Ol;this.lineInterpretation=Pl;this.line=null;this.lineHeight="";this.lineAlign=Ql;this.displayAlign=Rl;this.fontSize=this.backgroundColor=this.color="";this.fontWeight=Sl;this.fontStyle=Tl;this.fontFamily="";this.textDecoration=[];this.wrapLine=!0;this.id=""}y("shaka.text.Cue",gd);var Ml="auto";
gd.positionAlign={LEFT:"line-left",RIGHT:"line-right",CENTER:"center",AUTO:Ml};var Nl="center",Ul={LEFT:"left",RIGHT:"right",CENTER:Nl,START:"start",END:"end"};gd.textAlign=Ul;var Rl="after",Vl={BEFORE:"before",CENTER:"center",AFTER:Rl};gd.displayAlign=Vl;var Kl="ltr";gd.direction={HORIZONTAL_LEFT_TO_RIGHT:Kl,HORIZONTAL_RIGHT_TO_LEFT:"rtl"};var Ol="horizontal-tb";gd.writingMode={HORIZONTAL_TOP_TO_BOTTOM:Ol,VERTICAL_LEFT_TO_RIGHT:"vertical-lr",VERTICAL_RIGHT_TO_LEFT:"vertical-rl"};var Pl=0;
gd.lineInterpretation={LINE_NUMBER:Pl,PERCENTAGE:1};var Ql="start",Wl={CENTER:"center",START:Ql,END:"end"};gd.lineAlign=Wl;var Sl=400;gd.fontWeight={NORMAL:Sl,BOLD:700};var Tl="normal",Xl={NORMAL:Tl,ITALIC:"italic",OBLIQUE:"oblique"};gd.fontStyle=Xl;gd.textDecoration={UNDERLINE:"underline",LINE_THROUGH:"lineThrough",OVERLINE:"overline"};
function Ll(){this.id="";this.regionAnchorY=this.regionAnchorX=this.viewportAnchorY=this.viewportAnchorX=0;this.height=this.width=100;this.viewportAnchorUnits=this.widthUnits=this.heightUnits=Yl;this.scroll=Zl}y("shaka.text.CueRegion",Ll);var Yl=1;Ll.units={PX:0,PERCENTAGE:Yl,LINES:2};var Zl="";Ll.scrollMode={NONE:Zl,UP:"up"};function $l(){}$l.prototype.parseInit=function(){};
$l.prototype.parseMedia=function(b,c){var d=Rb(b),e=[],f=new DOMParser,g=null;try{g=f.parseFromString(d,"text/xml")}catch(R){throw new B(2,2,2005);}if(g){if(f=g.getElementsByTagName("tt")[0]){g=N.getAttributeNS(f,"http://www.w3.org/ns/ttml#parameter","frameRate");var h=N.getAttributeNS(f,"http://www.w3.org/ns/ttml#parameter","subFrameRate");var k=N.getAttributeNS(f,"http://www.w3.org/ns/ttml#parameter","frameRateMultiplier");var l=N.getAttributeNS(f,"http://www.w3.org/ns/ttml#parameter","tickRate");
d=f.getAttribute("xml:space")||"default"}else throw new B(2,2,2005);if("default"!=d&&"preserve"!=d)throw new B(2,2,2005);d="default"==d;g=new am(g,h,k,l);h=bm(f.getElementsByTagName("styling")[0]);k=bm(f.getElementsByTagName("layout")[0]);l=[];for(var m=0;m<k.length;m++){var p=k[m],r=h;var w=new Ll;var x=p.getAttribute("xml:id");if(x){w.id=x;var A;if(A=cm(p,r,"extent"))A=(x=dm.exec(A))||em.exec(A),null!=A&&(w.width=Number(A[1]),w.height=Number(A[2]),w.widthUnits=x?Yl:0,w.heightUnits=x?Yl:0);if(p=
cm(p,r,"origin"))A=(x=dm.exec(p))||em.exec(p),null!=A&&(w.viewportAnchorX=Number(A[1]),w.viewportAnchorY=Number(A[2]),w.viewportAnchorUnits=x?Yl:0)}else w=null;w&&l.push(w)}f=bm(f.getElementsByTagName("body")[0]);for(m=0;m<f.length;m++)(w=fm(f[m],c.periodStart,g,h,k,l,d))&&e.push(w)}return e};
var dm=/^(\d{1,2}|100)% (\d{1,2}|100)%$/,gm=/^(\d+px|\d+em)$/,em=/^(\d+)px (\d+)px$/,hm=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,im=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,jm=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d{2,})$/,km=/^(\d*(?:\.\d*)?)f$/,lm=/^(\d*(?:\.\d*)?)t$/,mm=/^(?:(\d*(?:\.\d*)?)h)?(?:(\d*(?:\.\d*)?)m)?(?:(\d*(?:\.\d*)?)s)?(?:(\d*(?:\.\d*)?)ms)?$/,nm={left:Ql,center:"center",right:"end",start:Ql,end:"end"},om={left:"line-left",center:"center",right:"line-right"};
function bm(b){var c=[];if(!b)return c;for(var d=b.childNodes,e=0;e<d.length;e++){var f="span"==d[e].nodeName&&"p"==b.nodeName;d[e].nodeType!=Node.ELEMENT_NODE||"br"==d[e].nodeName||f||(f=bm(d[e]),c=c.concat(f))}c.length||c.push(b);return c}function pm(b,c){for(var d=b.childNodes,e=0;e<d.length;e++)if("br"==d[e].nodeName&&0<e)d[e-1].textContent+="\n";else if(0<d[e].childNodes.length)pm(d[e],c);else if(c){var f=d[e].textContent.trim();f=f.replace(/\s+/g," ");d[e].textContent=f}}
function fm(b,c,d,e,f,g,h){if(!b.hasAttribute("begin")&&!b.hasAttribute("end")&&/^\s*$/.test(b.textContent))return null;pm(b,h);h=qm(b.getAttribute("begin"),d);var k=qm(b.getAttribute("end"),d);d=qm(b.getAttribute("dur"),d);var l=b.textContent;null==k&&null!=d&&(k=h+d);if(null==h||null==k)throw new B(2,2,2001);c=new gd(h+c,k+c,l);if((f=rm(b,"region",f))&&f.getAttribute("xml:id")){var m=f.getAttribute("xml:id");g=g.filter(function(b){return b.id==m});c.region=g[0]}sm(c,b,f,e);return c}
function sm(b,c,d,e){"rtl"==tm(c,d,e,"direction")&&(b.direction="rtl");var f=tm(c,d,e,"writingMode");"tb"==f||"tblr"==f?b.writingMode="vertical-lr":"tbrl"==f?b.writingMode="vertical-rl":"rltb"==f||"rl"==f?b.direction="rtl":f&&(b.direction=Kl);if(f=tm(c,d,e,"textAlign"))b.positionAlign=om[f],b.lineAlign=nm[f],b.textAlign=Ul[f.toUpperCase()];if(f=tm(c,d,e,"displayAlign"))b.displayAlign=Vl[f.toUpperCase()];if(f=tm(c,d,e,"color"))b.color=f;if(f=tm(c,d,e,"backgroundColor"))b.backgroundColor=f;if(f=tm(c,
d,e,"fontFamily"))b.fontFamily=f;(f=tm(c,d,e,"fontWeight"))&&"bold"==f&&(b.fontWeight=700);(f=tm(c,d,e,"wrapOption"))&&"noWrap"==f&&(b.wrapLine=!1);(f=tm(c,d,e,"lineHeight"))&&f.match(gm)&&(b.lineHeight=f);(f=tm(c,d,e,"fontSize"))&&f.match(gm)&&(b.fontSize=f);if(f=tm(c,d,e,"fontStyle"))b.fontStyle=Xl[f.toUpperCase()];(d=cm(d,e,"textDecoration"))&&um(b,d);(c=vm(c,e,"textDecoration"))&&um(b,c)}
function um(b,c){for(var d=c.split(" "),e=0;e<d.length;e++)switch(d[e]){case "underline":b.textDecoration.includes("underline")||b.textDecoration.push("underline");break;case "noUnderline":b.textDecoration.includes("underline")&&sb(b.textDecoration,"underline");break;case "lineThrough":b.textDecoration.includes("lineThrough")||b.textDecoration.push("lineThrough");break;case "noLineThrough":b.textDecoration.includes("lineThrough")&&sb(b.textDecoration,"lineThrough");break;case "overline":b.textDecoration.includes("overline")||
b.textDecoration.push("overline");break;case "noOverline":b.textDecoration.includes("overline")&&sb(b.textDecoration,"overline")}}function tm(b,c,d,e){return(b=vm(b,d,e))?b:cm(c,d,e)}function cm(b,c,d){for(var e=bm(b),f=0;f<e.length;f++){var g=N.getAttributeNS(e[f],"http://www.w3.org/ns/ttml#styling",d);if(g)return g}return(b=rm(b,"style",c))?N.getAttributeNS(b,"http://www.w3.org/ns/ttml#styling",d):null}
function vm(b,c,d){return(b=rm(b,"style",c))?N.getAttributeNS(b,"http://www.w3.org/ns/ttml#styling",d):null}function rm(b,c,d){if(!b||1>d.length)return null;var e=null,f=b;for(b=null;f&&!(b=f.getAttribute(c))&&(f=f.parentNode,f instanceof Element););if(c=b)for(b=0;b<d.length;b++)if(d[b].getAttribute("xml:id")==c){e=d[b];break}return e}
function qm(b,c){var d=null;if(hm.test(b)){d=hm.exec(b);var e=Number(d[1]),f=Number(d[2]),g=Number(d[3]),h=Number(d[4]);h+=(Number(d[5])||0)/c.b;g+=h/c.frameRate;d=g+60*f+3600*e}else im.test(b)?d=wm(im,b):jm.test(b)?d=wm(jm,b):km.test(b)?(d=km.exec(b),d=Number(d[1])/c.frameRate):lm.test(b)?(d=lm.exec(b),d=Number(d[1])/c.a):mm.test(b)&&(d=wm(mm,b));return d}
function wm(b,c){var d=b.exec(c);return null==d||""==d[0]?null:(Number(d[4])||0)/1E3+(Number(d[3])||0)+60*(Number(d[2])||0)+3600*(Number(d[1])||0)}function am(b,c,d,e){this.frameRate=Number(b)||30;this.b=Number(c)||1;this.a=Number(e);0==this.a&&(this.a=b?this.frameRate*this.b:1);d&&(b=/^(\d+) (\d+)$/g.exec(d))&&(this.frameRate*=b[1]/b[2])}bd["application/ttml+xml"]=$l;function xm(){this.a=new $l}xm.prototype.parseInit=function(b){var c=!1;(new Q).F("moov",S).F("trak",S).F("mdia",S).F("minf",S).F("stbl",S).aa("stsd",Ce).F("stpp",function(b){c=!0;b.parser.stop()}).parse(b);if(!c)throw new B(2,2,2007);};xm.prototype.parseMedia=function(b,c){var d=!1,e=[];(new Q).F("mdat",De(function(b){d=!0;e=e.concat(this.a.parseMedia(b,c))}.bind(this))).parse(b);if(!d)throw new B(2,2,2007);return e};bd['application/mp4; codecs="stpp"']=xm;
bd['application/mp4; codecs="stpp.TTML.im1t"']=xm;function ym(){}ym.prototype.parseInit=function(){};
ym.prototype.parseMedia=function(b,c){var d=Rb(b);d=d.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n");d=d.split(/\n{2,}/m);if(!/^WEBVTT($|[ \t\n])/m.test(d[0]))throw new B(2,2,2E3);var e=c.segmentStart;if(null==e&&(e=0,d[0].includes("X-TIMESTAMP-MAP"))){var f=d[0].match(/LOCAL:((?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3}))/m),g=d[0].match(/MPEGTS:(\d+)/m);f&&g&&(e=zm(new Gf(f[1])),e=c.periodStart+(Number(g[1])/9E4-e))}g=[];var h=d[0].split("\n");for(f=1;f<h.length;f++)if(/^Region:/.test(h[f])){var k=new Gf(h[f]),
l=new Ll;Jf(k);Hf(k);for(var m=Jf(k);m;){var p=l,r=m;(m=/^id=(.*)$/.exec(r))?p.id=m[1]:(m=/^width=(\d{1,2}|100)%$/.exec(r))?p.width=Number(m[1]):(m=/^lines=(\d+)$/.exec(r))?(p.height=Number(m[1]),p.heightUnits=2):(m=/^regionanchor=(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(r))?(p.regionAnchorX=Number(m[1]),p.regionAnchorY=Number(m[2])):(m=/^viewportanchor=(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(r))?(p.viewportAnchorX=Number(m[1]),p.viewportAnchorY=Number(m[2])):/^scroll=up$/.exec(r)&&(p.scroll="up");Hf(k);
m=Jf(k)}g.push(l)}f=[];for(k=1;k<d.length;k++){h=d[k].split("\n");m=h;r=e;h=g;if(1==m.length&&!m[0]||/^NOTE($|[ \t])/.test(m[0])||"STYLE"==m[0])h=null;else{l=null;m[0].includes("--\x3e")||(l=m[0],m.splice(0,1));p=new Gf(m[0]);var w=zm(p),x=If(p,/[ \t]+--\x3e[ \t]+/g),A=zm(p);if(null==w||null==x||null==A)throw new B(2,2,2001);m=new gd(w+r,A+r,m.slice(1).join("\n").trim());Hf(p);for(r=Jf(p);r;)Am(m,r,h),Hf(p),r=Jf(p);null!=l&&(m.id=l);h=m}h&&f.push(h)}return f};
function Am(b,c,d){var e;if(e=/^align:(start|middle|center|end|left|right)$/.exec(c))c=e[1],"middle"==c?b.textAlign=Nl:b.textAlign=Ul[c.toUpperCase()];else if(e=/^vertical:(lr|rl)$/.exec(c))b.writingMode="lr"==e[1]?"vertical-lr":"vertical-rl";else if(e=/^size:([\d.]+)%$/.exec(c))b.size=Number(e[1]);else if(e=/^position:([\d.]+)%(?:,(line-left|line-right|center|start|end))?$/.exec(c))b.position=Number(e[1]),e[2]&&(c=e[2],b.positionAlign="line-left"==c||"start"==c?"line-left":"line-right"==c||"end"==
c?"line-right":"center");else if(e=/^region:(.*)$/.exec(c)){if(c=Bm(d,e[1]))b.region=c}else if(d=/^line:([\d.]+)%(?:,(start|end|center))?$/.exec(c))b.lineInterpretation=1,b.line=Number(d[1]),d[2]&&(b.lineAlign=Wl[d[2].toUpperCase()]);else if(d=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(c))b.lineInterpretation=Pl,b.line=Number(d[1]),d[2]&&(b.lineAlign=Wl[d[2].toUpperCase()])}function Bm(b,c){var d=b.filter(function(b){return b.id==c});return d.length?d[0]:null}
function zm(b){b=If(b,/(?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3})/g);if(null==b)return null;var c=Number(b[2]),d=Number(b[3]);return 59<c||59<d?null:Number(b[4])/1E3+d+60*c+3600*(Number(b[1])||0)}bd["text/vtt"]=ym;bd['text/vtt; codecs="vtt"']=ym;function Cm(){this.a=null}Cm.prototype.parseInit=function(b){var c=!1;(new Q).F("moov",S).F("trak",S).F("mdia",S).aa("mdhd",function(b){0==b.version?(b.reader.I(4),b.reader.I(4),this.a=b.reader.C(),b.reader.I(4)):(b.reader.I(8),b.reader.I(8),this.a=b.reader.C(),b.reader.I(8));b.reader.I(4)}.bind(this)).F("minf",S).F("stbl",S).aa("stsd",Ce).F("wvtt",function(){c=!0}).parse(b);if(!this.a)throw new B(2,2,2008);if(!c)throw new B(2,2,2008);};
Cm.prototype.parseMedia=function(b,c){var d=this;if(!this.a)throw new B(2,2,2008);var e=0,f=[],g,h=[],k=!1,l=!1,m=!1,p=null;(new Q).F("moof",S).F("traf",S).aa("tfdt",function(b){k=!0;e=0==b.version?b.reader.C():b.reader.$a()}).aa("tfhd",function(b){var c=b.flags;b=b.reader;b.I(4);c&1&&b.I(8);c&2&&b.I(4);p=c&8?b.C():null}).aa("trun",function(b){l=!0;var c=b.version,d=b.flags;b=b.reader;var e=b.C();d&1&&b.I(4);d&4&&b.I(4);for(var g=[],h=0;h<e;h++){var k={duration:null,sampleSize:null,Dc:null};d&256&&
(k.duration=b.C());d&512&&(k.sampleSize=b.C());d&1024&&b.I(4);d&2048&&(k.Dc=0==c?b.C():b.wd());g.push(k)}f=g}).F("mdat",De(function(b){m=!0;g=b})).parse(b);if(!m&&!k&&!l)throw new B(2,2,2008);var r=e,w=new DataView(g.buffer,g.byteOffset,g.byteLength),x=new P(w,0);f.forEach(function(b){var f=b.duration||p,g=b.Dc?e+b.Dc:r;r=g+(f||0);var k=0;do{var l=x.C();k+=l;var m=x.C(),w=null;"vttc"==Ee(m)?8<l&&(w=x.Ia(l-8)):x.I(l-8);f&&w&&h.push(Dm(w,c.periodStart+g/d.a,c.periodStart+r/d.a))}while(b.sampleSize&&
k<b.sampleSize)});return h.filter(I.wa)};function Dm(b,c,d){var e,f,g;(new Q).F("payl",De(function(b){e=Rb(b)})).F("iden",De(function(b){f=Rb(b)})).F("sttg",De(function(b){g=Rb(b)})).parse(b);return e?Em(e,f,g,c,d):null}function Em(b,c,d,e,f){b=new gd(e,f,b);c&&(b.id=c);if(d)for(c=new Gf(d),d=Jf(c);d;)Am(b,d,[]),Hf(c),d=Jf(c);return b}bd['application/mp4; codecs="wvtt"']=Cm;function Yj(b){this.a=null;for(var c=0;c<b.textTracks.length;++c){var d=b.textTracks[c];d.mode="disabled";"Shaka Player TextTrack"==d.label&&(this.a=d)}this.a||(this.a=b.addTextTrack("subtitles","Shaka Player TextTrack"));this.a.mode="hidden"}y("shaka.text.SimpleTextDisplayer",Yj);Yj.prototype.remove=function(b,c){if(!this.a)return!1;Fm(this.a,function(d){return d.startTime<c&&d.endTime>b});return!0};Yj.prototype.remove=Yj.prototype.remove;
Yj.prototype.append=function(b){for(var c=Gm,d=[],e=0;e<b.length;e++){var f=c(b[e]);f&&d.push(f)}d.slice().sort(function(b,c){return b.startTime!=c.startTime?b.startTime-c.startTime:b.endTime!=c.endTime?b.endTime-c.startTime:d.indexOf(c)-d.indexOf(b)}).forEach(function(b){this.a.addCue(b)}.bind(this))};Yj.prototype.append=Yj.prototype.append;Yj.prototype.destroy=function(){this.a&&Fm(this.a,function(){return!0});this.a=null;return Promise.resolve()};Yj.prototype.destroy=Yj.prototype.destroy;
Yj.prototype.isTextVisible=function(){return"showing"==this.a.mode};Yj.prototype.isTextVisible=Yj.prototype.isTextVisible;Yj.prototype.setTextVisibility=function(b){this.a.mode=b?"showing":"hidden"};Yj.prototype.setTextVisibility=Yj.prototype.setTextVisibility;
function Gm(b){if(b.startTime>=b.endTime)return null;var c=new VTTCue(b.startTime,b.endTime,b.payload);c.lineAlign=b.lineAlign;c.positionAlign=b.positionAlign;c.size=b.size;try{c.align=b.textAlign}catch(d){}"center"==b.textAlign&&"center"!=c.align&&(c.align="middle");"vertical-lr"==b.writingMode?c.vertical="lr":"vertical-rl"==b.writingMode&&(c.vertical="rl");1==b.lineInterpretation&&(c.snapToLines=!1);null!=b.line&&(c.line=b.line);null!=b.position&&(c.position=b.position);return c}
function Fm(b,c){var d=b.mode;b.mode="showing"==d?"showing":"hidden";for(var e=b.cues,f=e.length-1;0<=f;f--){var g=e[f];g&&c(g)&&b.removeCue(g)}b.mode=d};}).call(exportTo,innerGlobal,innerGlobal);if(typeof exports!="undefined")for(var k in exportTo.shaka)exports[k]=exportTo.shaka[k];else if(typeof define!="undefined"&&define.amd)define(function(){return exportTo.shaka});else innerGlobal.shaka=exportTo.shaka})();

//# sourceMappingURL=shaka-player.compiled.map