/* @license Shaka Player Copyright 2016 Google LLC SPDX-License-Identifier: Apache-2.0 */ (function(){var innerGlobal=typeof window!="undefined"?window:global;var exportTo={};(function(window,global,module){/* Copyright The Closure Library Authors. SPDX-License-Identifier: Apache-2.0 */ var p;function aa(a){var b=0;return function(){return bf&&(f=Math.max(f+e,0));f=f}});var Ra=this||self;function K(a,b){var c=a.split("."),d=Ra;c[0]in d||"undefined"==typeof d.execScript||d.execScript("var "+c[0]);for(var e;c.length&&(e=c.shift());)c.length||void 0===b?d[e]&&d[e]!==Object.prototype[e]?d=d[e]:d=d[e]={}:d[e]=b};/* @license Shaka Player Copyright 2016 Google LLC SPDX-License-Identifier: Apache-2.0 */ function Va(a){this.c=Math.exp(Math.log(.5)/a);this.b=this.a=0}function Wa(a,b,c){var d=Math.pow(a.c,b);c=c*(1-d)+d*a.a;isNaN(c)||(a.a=c,a.b+=b)}function Xa(a){return a.a/(1-Math.pow(a.c,a.b))};function Ya(){this.b=new Va(2);this.c=new Va(5);this.a=0}Ya.prototype.getBandwidthEstimate=function(a){return 128E3>this.a?a:Math.min(Xa(this.b),Xa(this.c))};function Za(){}function $a(){}function ab(){}function bb(a,b){for(var c=[],d=1;db)throw Error("Bad port number "+b);a.ob=b}else a.ob=null}function rb(a,b,c){b instanceof tb?a.a=b:(c||(b=ub(b,zb)),a.a=new tb(b))} function sb(a,b){return a?b?decodeURI(a):decodeURIComponent(a):""}function ub(a,b,c){return null!=a?(a=encodeURI(a).replace(b,Ab),c&&(a=a.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),a):null}function Ab(a){a=a.charCodeAt(0);return"%"+(a>>4&15).toString(16)+(a&15).toString(16)}var vb=/[#\/\?@]/g,xb=/[#\?:]/g,wb=/[#\?]/g,zb=/[#\?@]/g,yb=/#/g;function tb(a){this.a=a||null}p=tb.prototype;p.ga=null;p.ac=null; p.add=function(a,b){if(!this.ga&&(this.ga={},this.ac=0,this.a))for(var c=this.a.split("&"),d=0;d=a.j)if(a.c)a.a=1,a.b=a.f;else throw new M(N,Fb,Gb);b=a.a;a.a++;if(0==b)return d["return"]();c=a.b*(1+(2*Math.random()-1)*a.h);return t(d,new Promise(function(e){(new L(e)).R(c/1E3)}),2)}a.b*=a.g;w(d)})}function Db(){return{maxAttempts:2,baseDelay:1E3,backoffFactor:2,fuzzFactor:.5,timeout:0}};function M(a,b,c,d){for(var e=[],f=3;f=d.priority)ic[a]={priority:c,He:b}}p=fc.prototype;p.Je=function(a){this.a.add(a)};p.bf=function(a){this.a["delete"](a)};p.be=function(){this.a.clear()};p.Ke=function(a){this.b.add(a)};p.cf=function(a){this.b["delete"](a)};p.ce=function(){this.b.clear()}; function jc(a,b){return{uris:a,method:"GET",body:null,headers:{},allowCrossSiteCredentials:!1,retryParameters:b,licenseRequestType:null,sessionId:null}}p.destroy=function(){this.f=!0;this.a.clear();this.b.clear();return this.g.destroy()}; p.request=function(a,b){var c=this,d=new kc;if(this.f){var e=Promise.reject(new M(N,Fb,7001));e["catch"](function(){});return new lc(e,function(){return Promise.resolve()},d)}b.method=b.method||"GET";b.headers=b.headers||{};b.retryParameters=b.retryParameters?Zb(b.retryParameters):Db();b.uris=Zb(b.uris);e=mc(this,a,b);var f=e.U(function(){return nc(c,a,b,new Cb(b.retryParameters,!1),0,null,d)}),g=f.U(function(n){return oc(c,a,n)}),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(){});var m=g.U(function(n){var r=Date.now()-l,u=n.response;u.timeMs+=k;u.timeMs+=r;n.Ae||!c.c||u.fromCache||a!=pc||c.c(u.timeMs,u.data.byteLength);return u},function(n){n&&(n.severity=N);throw n;});e=new lc(m.promise,function(){return m.abort()},d);ec(this.g,e);return e}; function mc(a,b,c){var d=Lb(void 0),e={};a=q(a.a);for(var f=a.next();!f.done;e={uc:e.uc},f=a.next())e.uc=f.value,d=d.U(function(g){return function(){c.body&&(c.body=Sb(c.body));return g.uc(b,c)}}(e));return d.U(void 0,function(g){if(g instanceof M&&7001==g.code)throw g;throw new M(N,1,1006,g);})} function nc(a,b,c,d,e,f,g){var h=new ob(c.uris[e]),k=h.ra,l=!1;k||(k=location.protocol,k=k.slice(0,-1),pb(h,k),c.uris[e]=h.toString());k=k.toLowerCase();var m=(k=ic[k])?k.He:null;if(!m)return Jb(new M(N,1,1E3,h));var n;return Mb(Eb(d)).U(function(){if(a.f)return Kb();n=Date.now();return m(c.uris[e],c,b,function(r,u,v){a.c&&b==pc&&(a.c(r,u),l=!0,g.a=v)})}).U(function(r){void 0==r.timeMs&&(r.timeMs=Date.now()-n);return{response:r,Ae:l}},function(r){if(a.f)return Kb();if(r instanceof M){if(7001==r.code)throw r; if(r.code==Gb)throw f;if(1==r.severity){var u=new R("retry",{error:r});a.dispatchEvent(u);e=(e+1)%c.uris.length;return nc(a,b,c,d,e,r,g)}}throw r;})} function oc(a,b,c){var d=Lb(void 0),e={};a=q(a.b);for(var f=a.next();!f.done;e={vc:e.vc},f=a.next())e.vc=f.value,d=d.U(function(g){return function(){var h=c.response;h.data&&(h.data=Sb(h.data));return g.vc(b,h)}}(e));return d.U(function(){return c},function(g){var h=N;if(g instanceof M){if(7001==g.code)throw g;h=g.severity}throw new M(h,1,1007,g);})}K("shaka.net.NetworkingEngine",fc);fc.prototype.request=fc.prototype.request;fc.prototype.destroy=fc.prototype.destroy;fc.makeRequest=jc; fc.defaultRetryParameters=function(){return Db()};fc.prototype.clearAllResponseFilters=fc.prototype.ce;fc.prototype.unregisterResponseFilter=fc.prototype.cf;fc.prototype.registerResponseFilter=fc.prototype.Ke;fc.prototype.clearAllRequestFilters=fc.prototype.be;fc.prototype.unregisterRequestFilter=fc.prototype.bf;fc.prototype.registerRequestFilter=fc.prototype.Je;fc.unregisterScheme=function(a){delete ic[a]};fc.registerScheme=gc;function kc(){this.a=0}fc.NumBytesRemainingClass=kc; function lc(a,b,c){Ib.call(this,a,b);this.b=c}sa(lc,Ib);fc.PendingRequest=lc;var pc=1;fc.RequestType={MANIFEST:0,SEGMENT:pc,LICENSE:2,APP:3,TIMING:4};var hc=3;fc.PluginPriority={FALLBACK:1,PREFERRED:2,APPLICATION:hc};var ic={};function qc(a){this.a=!1;this.b=new Hb;this.c=a}qc.prototype.destroy=function(){var a=this;if(this.a)return this.b;this.a=!0;return this.c().then(function(){a.b.resolve()},function(){a.b.resolve()})};function rc(a,b){if(a.a){if(b instanceof M&&7003==b.code)throw b;throw new M(N,Fb,7003,b);}};function sc(){this.a=new Wb}p=sc.prototype;p.release=function(){this.Wa();this.a=null};p.o=function(a,b,c,d){this.a&&(a=new tc(a,b,c,d),this.a.push(b,a))};p.ha=function(a,b,c,d){function e(g){f.oa(a,b,e);c(g)}var f=this;this.o(a,b,e,d)};p.oa=function(a,b,c){if(this.a){var d=this.a.get(b)||[];d=q(d);for(var e=d.next();!e.done;e=d.next())e=e.value,e.target!=a||c!=e.listener&&c||(e.oa(),this.a.remove(b,e))}}; p.Wa=function(){if(this.a){var a=this.a,b=[],c;for(c in a.a)b.push.apply(b,ka(a.a[c]));a=q(b);for(b=a.next();!b.done;b=a.next())b.value.oa();this.a.a={}}};K("shaka.util.EventManager",sc);sc.prototype.removeAll=sc.prototype.Wa;sc.prototype.unlisten=sc.prototype.oa;sc.prototype.listenOnce=sc.prototype.ha;sc.prototype.listen=sc.prototype.o;sc.prototype.release=sc.prototype.release;function tc(a,b,c,d){this.target=a;this.type=b;this.listener=c;this.a=uc(a,d);this.target.addEventListener(b,c,this.a)} tc.prototype.oa=function(){this.target.removeEventListener(this.type,this.listener,this.a);this.listener=this.target=null;this.a=!1};function uc(a,b){if(void 0==b)return!1;if("boolean"==typeof b)return b;var c=new Set(["passive","capture"]);Object.keys(b).filter(function(d){return!c.has(d)});return vc(a)?b:b.capture||!1} function vc(a){var b=wc;if(void 0==b){b=!1;try{var c={},d={get:function(){b=!0;return!1}};Object.defineProperty(c,"passive",d);Object.defineProperty(c,"capture",d);d=function(){};a.addEventListener("test",d,c);a.removeEventListener("test",d,c)}catch(e){b=!1}wc=b}return b||!1}var wc=void 0;function xc(){}function yc(a){a=zc(a);return(new ob(a)).qa}function Ac(a,b,c){function d(h){Vb(f).setUint32(g,h.byteLength,!0);g+=4;f.set(Q(h),g);g+=h.byteLength}if(!c||!c.byteLength)throw new M(N,6,6015);var e;"string"==typeof b?e=Bc(b,!0):e=b;a=zc(a);a=Bc(a,!0);var f=new Uint8Array(12+a.byteLength+e.byteLength+c.byteLength),g=0;d(a);d(e);d(c);return f}K("shaka.util.FairPlayUtils",xc);xc.initDataTransform=Ac;xc.defaultGetContentId=yc;function Cc(a){this.b=a;this.a=void 0}Cc.prototype.value=function(){void 0==this.a&&(this.a=this.b());return this.a};function Dc(a,b){this.a=a;this.b=b}Dc.prototype.toString=function(){return"v"+this.a+"."+this.b};function Ec(a,b){var c=new Dc(4,0),d=Fc,e=d.a,f=c.b-e.b;(0<(c.a-e.a||f)?d.c:d.b)(d.a,c,a,b)}function Gc(a,b,c,d){ab([c,"has been deprecated and will be removed in",b,". We are currently at version",a,". Additional information:",d].join(" "))}function Hc(a,b,c,d){$a([c,"has been deprecated and has been removed in",b,". We are now at version",a,". Additional information:",d].join(""))}var Fc=null;function Ic(a,b){return a.concat(b)}function Jc(){}function Kc(a){return null!=a}function Lc(a){var b=Object.create(a.prototype||Object.prototype);a=a.call(b);a||(Ec("Factories requiring new","Factories should be plain functions"),a=b);return a};function Mc(a,b){if(0==b.length)return a;var c=b.map(function(d){return new ob(d)});return a.map(function(d){return new ob(d)}).map(function(d){return c.map(function(e){return d.resolve(e)})}).reduce(Ic,[]).map(function(d){return d.toString()})}function Nc(a,b){return{keySystem:a,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:b||[],keyIds:new Set}} var Oc={Ba:"video",cb:"audio",$:"text",pf:"image",ff:"application"};function Pc(a){for(var b=new Map,c=q(Object.keys(a)),d=c.next();!d.done;d=c.next())d=d.value,b.set(d,a[d]);return b}function Qc(a){var b={};a.forEach(function(c,d){b[d]=c});return b};function Rc(a,b){var c=a;b&&(c+='; codecs="'+b+'"');return c}function Sc(a){var b=[a.mimeType];Tc.forEach(function(c,d){var e=a[d];e&&b.push(c+'="'+e+'"')});return b.join(";")}function Uc(a){a=a.split(".");var b=a[0];a.pop();return[b,a.join(".")]}var Tc=(new Map).set("codecs","codecs").set("frameRate","framerate").set("bandwidth","bitrate").set("width","width").set("height","height").set("channelsCount","channels");function Vc(){return window.MediaSource&&MediaSource.isTypeSupported?!0:!1}function Wc(a){return""!=Xc().canPlayType(a)}function Yc(){return!!navigator.vendor&&navigator.vendor.includes("Apple")&&!Zc("Tizen")}function $c(){if(!Yc())return null;var a=navigator.userAgent.match(/Version\/(\d+)/);return a?parseInt(a[1],10):(a=navigator.userAgent.match(/OS (\d+)(?:_\d+)?/))?parseInt(a[1],10):null}function Zc(a){return(navigator.userAgent||"").includes(a)} function Xc(){if(ad)return ad;bd||(bd=new L(function(){ad=null}));(ad=document.getElementsByTagName("video")[0]||document.getElementsByTagName("audio")[0])||(ad=document.createElement("video"));bd.R(1);return ad}var bd=null,ad=null;function cd(){}function dd(a){if(!a)return"";a=Q(a);239==a[0]&&187==a[1]&&191==a[2]&&(a=a.subarray(3));a=ed(a);a=escape(a);try{return decodeURIComponent(a)}catch(b){throw new M(N,2,2004);}}function fd(a,b,c){if(!a)return"";if(!c&&0!=a.byteLength%2)throw new M(N,2,2004);var d=Math.floor(a.byteLength/2);c=new Uint16Array(d);a=Vb(a);d=q(kb(d));for(var e=d.next();!e.done;e=d.next())e=e.value,c[e]=a.getUint16(2*e,b);return ed(c)} function zc(a){function b(d){return c.byteLength<=d||32<=c[d]&&126>=c[d]}if(!a)return"";var c=Q(a);if(239==c[0]&&187==c[1]&&191==c[2])return dd(c);if(254==c[0]&&255==c[1])return fd(c.subarray(2),!1);if(255==c[0]&&254==c[1])return fd(c.subarray(2),!0);if(0==c[0]&&0==c[2])return fd(a,!1);if(0==c[1]&&0==c[3])return fd(a,!0);if(b(0)&&b(1)&&b(2)&&b(3))return dd(a);throw new M(N,2,2003);} function gd(a){a=encodeURIComponent(a);var b=unescape(a);a=new Uint8Array(b.length);b=q(mb(b));for(var c=b.next();!c.done;c=b.next())c=c.value,a[c.Y]=c.item.charCodeAt(0);return Sb(a)}function Bc(a,b){for(var c=new ArrayBuffer(2*a.length),d=new DataView(c),e=q(mb(a)),f=e.next();!f.done;f=e.next())f=f.value,d.setUint16(2*f.Y,f.item.charCodeAt(0),b);return c}function ed(a){return hd.value()(a)}K("shaka.util.StringUtils",cd);cd.resetFromCharCode=function(){hd.a=void 0};cd.toUTF16=Bc;cd.toUTF8=gd; cd.fromBytesAutoDetect=zc;cd.fromUTF16=fd;cd.fromUTF8=dd;var hd=new Cc(function(){function a(c){try{var d=new Uint8Array(c);return 0g&&(g+=Math.pow(2,32));g="0x"+g.toString(16)}a.g(new M(N,6,6006,e.message,e,g))}})}function Qd(a,b,c){"skd"==b&&(b=c.serverCertificate,c=yc(a),a=Ac(a,c,b));return a} function Dd(a,b){var c,d,e,f,g,h,k,l,m,n,r,u,v,z;E(function(A){switch(A.a){case 1:return c=b.target,a.i.logLicenseExchange&&kd(b.message),d=a.f.get(c),e=a.c.licenseServerUri,f=a.i.advanced[a.c.keySystem],"individualization-request"==b.messageType&&f&&f.individualizationServer&&(e=f.individualizationServer),g=jc([e],a.i.retryParameters),g.body=b.message,g.method="POST",g.licenseRequestType=b.messageType,g.sessionId=c.sessionId,"com.microsoft.playready"!=a.c.keySystem&&"com.chromecast.playready"!=a.c.keySystem|| Rd(g),h=Date.now(),x(A,2),l=a.s.lb.request(2,g),t(A,l.promise,4);case 4:k=A.b;xa(A,3);break;case 2:return m=y(A),n=new M(N,6,6007,m),a.g(n),d&&d.ya&&d.ya.reject(n),A["return"]();case 3:if(a.D.a)return A["return"]();a.G+=(Date.now()-h)/1E3;a.i.logLicenseExchange&&kd(k.data);x(A,5);return t(A,c.update(k.data),7);case 7:xa(A,6);break;case 5:return r=y(A),u=new M(N,6,6008,r.message),a.g(u),d&&d.ya&&d.ya.reject(u),A["return"]();case 6:v=new R("drmsessionupdate"),a.s.onEvent(v),d&&(d.ya&&d.ya.resolve(), z=new L(function(){d.loaded=!0;Pd(a)&&a.j.resolve()}),z.R(Sd)),w(A)}})} function Rd(a){var b=fd(a.body,!0,!0);if(b.includes("PlayReadyKeyMessage")){b=(new DOMParser).parseFromString(b,"application/xml");for(var c=q(b.getElementsByTagName("HttpHeader")),d=c.next();!d.done;d=c.next())d=d.value,a.headers[d.getElementsByTagName("name")[0].textContent]=d.getElementsByTagName("value")[0].textContent;a.body=ld(b.getElementsByTagName("Challenge")[0].textContent)}else a.headers["Content-Type"]="text/xml; charset=utf-8"} function Od(a,b){var c=b.target,d=a.f.get(c),e=!1;c.keyStatuses.forEach(function(g,h){if("string"==typeof h){var k=h;h=g;g=k}if(!("com.microsoft.playready"!=a.c.keySystem||16!=h.byteLength||Zc("Tizen")||Zc("VITIS")||Zc("Web0S")||Zc("TiVo"))){k=Vb(h);var l=k.getUint32(0,!0),m=k.getUint16(4,!0),n=k.getUint16(6,!0);k.setUint32(0,l,!1);k.setUint16(4,m,!1);k.setUint16(6,n,!1)}"com.microsoft.playready"==a.c.keySystem&&"status-pending"==g&&(g="usable");"status-pending"!=g&&(d.loaded=!0);"expired"==g&&(e= !0);k=nd(h);a.ca.set(k,g)});var f=c.expiration-Date.now();(0>f||e&&1E3>f)&&d&&!d.ya&&(a.f["delete"](c),c.close()["catch"](function(){}));Pd(a)&&(a.j.resolve(),a.I.R(Td))}function qd(a){var b=a.ca,c=a.T;c.clear();b.forEach(function(d,e){return c.set(e,d)});b=Array.from(c.values());b.length&&b.every(function(d){return"expired"==d})&&a.g(new M(N,6,6014));a.s.hc(Qc(c))} function Ud(){var a,b,c,d,e,f,g,h;return E(function(k){return 1==k.a?(a="org.w3.clearkey com.widevine.alpha com.microsoft.playready com.apple.fps.3_0 com.apple.fps.2_0 com.apple.fps.1_0 com.apple.fps com.adobe.primetime".split(" "),b=[{contentType:'video/mp4; codecs="avc1.42E01E"'},{contentType:'video/webm; codecs="vp8"'}],c={videoCapabilities:b},d={videoCapabilities:b,persistentState:"required",sessionTypes:["persistent-license"]},e=[d,c],f=new Map,g=function(l){var m,n,r;return E(function(u){switch(u.a){case 1:return x(u, 2),t(u,navigator.requestMediaKeySystemAccess(l,e),4);case 4:return m=u.b,r=(n=m.getConfiguration().sessionTypes)?n.includes("persistent-license"):!1,Zc("Tizen 3")&&(r=!1),f.set(l,{persistentState:r}),t(u,m.createMediaKeys(),5);case 5:xa(u,0);break;case 2:y(u),f.set(l,null),w(u)}})},h=a.map(function(l){return g(l)}),t(k,Promise.all(h),2)):k["return"](Qc(f))})} function td(a){var b;return E(function(c){b=Array.from(a.f.keys());a.f.clear();return t(c,Promise.all(b.map(function(d){return E(function(e){if(1==e.a)return x(e,2),t(e,Promise.all([d.close(),d.closed]),4);if(2!=e.a)return xa(e,0);y(e);w(e)})})),0)})} function Vd(a,b){var c=b.audio,d=b.video;if(c&&c.encrypted&&!Ld(a,Rc(c.mimeType,c.codecs))||d&&d.encrypted&&!Ld(a,Rc(d.mimeType,d.codecs)))return!1;var e=Kd(a.c);c=(d?d.drmInfos:[]).concat(c?c.drmInfos:[]);return 0==c.length||c.some(function(f){return f.keySystem==e})} function Wd(a,b){if(!a.length)return b;if(!b.length)return a;for(var c=[],d=q(a),e=d.next();!e.done;e=d.next()){e=e.value;for(var f=q(b),g=f.next();!g.done;g=f.next())if(g=g.value,e.keySystem==g.keySystem){f=[];f=f.concat(e.initData||[]);f=f.concat(g.initData||[]);var h=e.keyIds&&g.keyIds?new Set(ka(e.keyIds).concat(ka(g.keyIds))):e.keyIds||g.keyIds;c.push({keySystem:e.keySystem,licenseServerUri:e.licenseServerUri||g.licenseServerUri,distinctiveIdentifierRequired:e.distinctiveIdentifierRequired|| g.distinctiveIdentifierRequired,persistentStateRequired:e.persistentStateRequired||g.persistentStateRequired,videoRobustness:e.videoRobustness||g.videoRobustness,audioRobustness:e.audioRobustness||g.audioRobustness,serverCertificate:e.serverCertificate||g.serverCertificate,initData:f,keyIds:h});break}}return c}function rd(a){a.f.forEach(function(b,c){var d=b.Uc,e=c.expiration;isNaN(e)&&(e=Infinity);e!=d&&(a.s.onExpirationUpdated(c.sessionId,e),b.Uc=e)})} function Pd(a){a=a.f.values();return ib(a,function(b){return b.loaded})}function Ad(a,b){var c=[];b.forEach(function(f,g){c.push({keySystem:g,licenseServerUri:f,distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:[],keyIds:new Set})});for(var d=q(a),e=d.next();!e.done;e=d.next())e=e.value,e.video&&e.video.encrypted&&(e.video.drmInfos=c),e.audio&&e.audio.encrypted&&(e.audio.drmInfos=c)} function Nd(a,b){var c=[],d=[],e=[],f=new Set;Xd(b.drmInfos,c,d,e,f);return{keySystem:a,licenseServerUri:c[0],distinctiveIdentifierRequired:"required"==b.distinctiveIdentifier,persistentStateRequired:"required"==b.persistentState,audioRobustness:(b.audioCapabilities?b.audioCapabilities[0].robustness:"")||"",videoRobustness:(b.videoCapabilities?b.videoCapabilities[0].robustness:"")||"",serverCertificate:d[0],initData:e,keyIds:f}} function Xd(a,b,c,d,e){var f={};a=q(a);for(var g=a.next();!g.done;f={la:f.la},g=a.next()){f.la=g.value;b.includes(f.la.licenseServerUri)||b.push(f.la.licenseServerUri);f.la.serverCertificate&&(c.some(function(l){return function(m){return Qb(m,l.la.serverCertificate)}}(f))||c.push(f.la.serverCertificate));if(f.la.initData){g={};for(var h=q(f.la.initData),k=h.next();!k.done;g={Qb:g.Qb},k=h.next())g.Qb=k.value,d.some(function(l){return function(m){var n=l.Qb;return m.keyId&&m.keyId==n.keyId?!0:m.initDataType== n.initDataType&&Qb(m.initData,n.initData)}}(g))||d.push(g.Qb)}if(f.la.keyIds)for(g=q(f.la.keyIds),h=g.next();!h.done;h=g.next())e.add(h.value)}} function Bd(a,b,c){if(a.keySystem&&("org.w3.clearkey"!=a.keySystem||!a.licenseServerUri)){b.size&&(b=b.get(a.keySystem)||"",a.licenseServerUri=b);a.keyIds||(a.keyIds=new Set);if(c=c.get(a.keySystem))a.distinctiveIdentifierRequired||(a.distinctiveIdentifierRequired=c.distinctiveIdentifierRequired),a.persistentStateRequired||(a.persistentStateRequired=c.persistentStateRequired),a.videoRobustness||(a.videoRobustness=c.videoRobustness),a.audioRobustness||(a.audioRobustness=c.audioRobustness),a.serverCertificate|| (a.serverCertificate=c.serverCertificate);window.cast&&window.cast.__platform__&&"com.microsoft.playready"==a.keySystem&&(a.keySystem="com.chromecast.playready")}}var Sd=5,Td=.5,Yd=new Cc(function(){return Sb(new Uint8Array([0]))});function Zd(){this.a=new muxjs.mp4.CaptionParser;this.g=[];this.f={}}Zd.prototype.init=function(a){var b=muxjs.mp4.probe;a=Q(a);this.g=b.videoTrackIds(a);this.f=b.timescale(a);this.a.init()};Zd.prototype.b=function(a,b){var c=Q(a);(c=this.a.parse(c,this.g,this.f))&&c.captions&&b(c.captions);this.a.clearParsedCaptions()};Zd.prototype.c=function(){this.a.resetCaptionStream()};function $d(){}$d.prototype.init=function(){};$d.prototype.b=function(){};$d.prototype.c=function(){};function ae(a){return!a||1==a.length&&1E-6>a.end(0)-a.start(0)?null:a.length?a.end(a.length-1):null}function be(a,b,c){c=void 0===c?0:c;return!a||!a.length||1==a.length&&1E-6>a.end(0)-a.start(0)||b>a.end(a.length-1)?!1:b+c>=a.start(0)}function ce(a,b){if(!a||!a.length||1==a.length&&1E-6>a.end(0)-a.start(0))return 0;for(var c=0,d=q(de(a)),e=d.next();!e.done;e=d.next()){var f=e.value;e=f.start;f=f.end;f>b&&(c+=f-Math.max(e,b))}return c} function ee(a,b){if(!a||!a.length||1==a.length&&1E-6>a.end(0)-a.start(0))return null;var c=Zc("Edge/")||Zc("Trident/")||Zc("Tizen")||Zc("CrKey")?.5:.1,d=de(a).findIndex(function(e,f,g){return e.start>b&&(0==f||g[f-1].end-b<=c)});return 0<=d?d:null}function de(a){if(!a)return[];for(var b=[],c=q(kb(a.length)),d=c.next();!d.done;d=c.next())d=d.value,b.push({start:a.start(d),end:a.end(d)});return b};function fe(){var a=this;this.a=new muxjs.mp4.Transmuxer({keepOriginalTimestamps:!0});this.b=null;this.h=[];this.c=[];this.g=[];this.f=!1;this.a.on("data",function(b){a.c=b.captions;a.g=b.metadata;a.h.push(od(b.initSegment,b.data))});this.a.on("done",function(){var b={data:od.apply(id,ka(a.h)),captions:a.c,metadata:a.g};a.b.resolve(b);a.f=!1})}fe.prototype.destroy=function(){this.a.dispose();this.a=null;return Promise.resolve()}; function ge(a,b){if(!window.muxjs||"mp2t"!=a.toLowerCase().split(";")[0].split("/")[1])return!1;if(b)return MediaSource.isTypeSupported(he(b,a));var c=he("audio",a),d=he("video",a);return MediaSource.isTypeSupported(c)||MediaSource.isTypeSupported(d)} function he(a,b){var c=b.replace(/mp2t/i,"mp4");"audio"==a&&(c=c.replace("video","audio"));var d=/avc1\.(66|77|100)\.(\d+)/.exec(c);if(d){var e="avc1.",f=d[1],g=Number(d[2]);e=("66"==f?e+"4200":"77"==f?e+"4d00":e+"6400")+(g>>4).toString(16);e+=(g&15).toString(16);c=c.replace(d[0],e)}return c}function ie(a,b){a.f=!0;a.b=new Hb;a.h=[];a.c=[];a.g=[];var c=Q(b);a.a.push(c);a.a.flush();a.f&&a.b.reject(new M(N,3,3018));return a.b};function je(a,b,c){this.startTime=a;this.direction=ke;this.endTime=b;this.payload=c;this.region=new le;this.position=null;this.positionAlign=me;this.size=0;this.textAlign=ne;this.writingMode=oe;this.lineInterpretation=pe;this.line=null;this.lineHeight="";this.lineAlign=qe;this.displayAlign=re;this.fontSize=this.border=this.backgroundImage=this.backgroundColor=this.color="";this.fontWeight=se;this.fontStyle=te;this.linePadding=this.letterSpacing=this.fontFamily="";this.opacity=1;this.textDecoration= [];this.wrapLine=!0;this.id="";this.nestedCues=[];this.spacer=!1;this.cellResolution={columns:32,rows:15}}K("shaka.text.Cue",je);var me="auto";je.positionAlign={LEFT:"line-left",RIGHT:"line-right",CENTER:"center",AUTO:me};var ne="center",ue={LEFT:"left",RIGHT:"right",CENTER:ne,START:"start",END:"end"};je.textAlign=ue;var re="after",ve={BEFORE:"before",CENTER:"center",AFTER:re};je.displayAlign=ve;var ke="ltr";je.direction={HORIZONTAL_LEFT_TO_RIGHT:ke,HORIZONTAL_RIGHT_TO_LEFT:"rtl"};var oe="horizontal-tb"; je.writingMode={HORIZONTAL_TOP_TO_BOTTOM:oe,VERTICAL_LEFT_TO_RIGHT:"vertical-lr",VERTICAL_RIGHT_TO_LEFT:"vertical-rl"};var pe=0;je.lineInterpretation={LINE_NUMBER:pe,PERCENTAGE:1};var qe="start",we={CENTER:"center",START:qe,END:"end"};je.lineAlign=we;var se=400;je.fontWeight={NORMAL:se,BOLD:700};var te="normal",xe={NORMAL:te,ITALIC:"italic",OBLIQUE:"oblique"};je.fontStyle=xe;je.textDecoration={UNDERLINE:"underline",LINE_THROUGH:"lineThrough",OVERLINE:"overline"}; function le(){this.id="";this.regionAnchorY=this.regionAnchorX=this.viewportAnchorY=this.viewportAnchorX=0;this.height=this.width=100;this.viewportAnchorUnits=this.widthUnits=this.heightUnits=ye;this.scroll=ze}K("shaka.text.CueRegion",le);var ye=1;le.units={PX:0,PERCENTAGE:ye,LINES:2};var ze="";le.scrollMode={NONE:ze,UP:"up"};function Ae(a){this.l=null;this.c=a;this.f=this.v=0;this.g=Infinity;this.b=this.a=null;this.j="";this.h=new Map}function Be(a){return Ce[a]||window.muxjs&&"application/cea-608"==a?!0:!1}Ae.prototype.destroy=function(){this.c=this.l=null;this.h.clear();return Promise.resolve()}; function De(a,b,c,d){var e,f,g;return E(function(h){if(1==h.a)return t(h,Promise.resolve(),2);if(!a.l||!a.c)return h["return"]();if(null==c||null==d)return a.l.parseInit(Q(b)),h["return"]();e={periodStart:a.v,segmentStart:c,segmentEnd:d};f=a.l.parseMedia(Q(b),e);g=f.filter(function(k){return k.startTime>=a.f&&k.startTime=c.b||(a<=c.a&&b>=c.b?c.a=c.b=null:a<=c.a&&bc.a&&b>=c.b&&(c.b=a));w(d)})};function Ee(a,b,c){a.f=b;a.g=c}function Fe(a,b,c){a.j=b;if(b=a.h.get(b))for(var d=q(b.keys()),e=d.next();!e.done;e=d.next())(e=b.get(e.value).filter(function(f){return f.endTime<=c}))&&a.c.append(e)} function Ge(a,b,c,d,e){var f=c+" "+d,g=new Map;b=q(b);for(var h=b.next();!h.done;h=b.next()){var k=h.value;h=k.stream;g.has(h)||g.set(h,new Map);g.get(h).has(f)||g.get(h).set(f,[]);k.startTime+=e;k.endTime+=e;k.startTime>=a.f&&k.startTimec.end(0)-c.start(0)?null:1==c.length&&0>c.start(0)?0:c.length?c.start(0):null;return c}function Re(a,b){return"text"==b?a.c.b:ae(Qe(a,b))}function Se(a,b,c){if("text"==b)return a=a.c,null==a.b||a.b=e?Ne(a,b):a.f[b].remove(0,e)}),0)})}p.flush=function(a){var b=this,c;return E(function(d){c=Oc;return a==c.$?d["return"]():t(d,Ue(b,a,function(){b.a.currentTime-=.001;Ne(b,a)}),0)})}; function Xe(a,b,c,d,e){var f;return E(function(g){f=Oc;return b==f.$?(a.c.v=c,Ee(a.c,d,e),g["return"]()):t(g,Promise.all([Ue(a,b,function(){var h=a.f[b].appendWindowStart,k=a.f[b].appendWindowEnd;a.f[b].abort();a.f[b].appendWindowStart=h;a.f[b].appendWindowEnd=k;Ne(a,b)}),Ue(a,b,function(){var h=c;0>h&&(h+=.001);a.f[b].timestampOffset=h;Ne(a,b)}),Ue(a,b,function(){a.f[b].appendWindowStart=0;a.f[b].appendWindowEnd=e;a.f[b].appendWindowStart=d;Ne(a,b)})]),0)})} p.endOfStream=function(a){var b=this;return E(function(c){return t(c,Ye(b,function(){Oe(b)||(a?b.j.endOfStream(a):b.j.endOfStream())}),0)})};p.wa=function(a){var b=this;return E(function(c){return t(c,Ye(b,function(){b.j.duration=a}),0)})};p.getDuration=function(){return this.j.duration};function Ne(a,b){var c=a.g[b][0];c&&(c.p.resolve(),Ze(a,b))}function Ue(a,b,c){rc(a.D);c={start:c,p:new Hb};a.g[b].push(c);1==a.g[b].length&&$e(a,b);return c.p} function Ye(a,b){var c,d,e,f,g,h;return E(function(k){switch(k.a){case 1:rc(a.D);c=[];d={};for(e in a.f)d.ub=new Hb,f={start:function(l){return function(){return l.ub.resolve()}}(d),p:d.ub},a.g[e].push(f),c.push(d.ub),1==a.g[e].length&&f.start(),d={ub:d.ub};x(k,2);return t(k,Promise.all(c),4);case 4:xa(k,3);break;case 2:throw g=y(k),g;case 3:try{b()}catch(l){throw new M(N,3,3015,l);}finally{for(h in a.f)Ze(a,h)}w(k)}})}function Ze(a,b){a.g[b].shift();$e(a,b)} function $e(a,b){var c=a.g[b][0];if(c)try{c.start()}catch(d){"QuotaExceededError"==d.name?c.p.reject(new M(N,3,3017,b)):c.p.reject(new M(N,3,3015,d)),Ze(a,b)}}var Ke=window.URL.createObjectURL;function af(a,b){a=bf(a);b=bf(b);return a.split("-")[0]==b.split("-")[0]}function cf(a,b){a=bf(a);b=bf(b);var c=a.split("-"),d=b.split("-");return c[0]==d[0]&&1==c.length&&2==d.length}function df(a,b){a=bf(a);b=bf(b);var c=a.split("-"),d=b.split("-");return 2==c.length&&2==d.length&&c[0]==d[0]}function bf(a){var b=a.split("-");a=b[0]||"";b=b[1]||"";a=a.toLowerCase();a=ef.get(a)||a;return(b=b.toUpperCase())?a+"-"+b:a}function ff(a,b){a=bf(a);b=bf(b);return b==a?4:cf(b,a)?3:df(b,a)?2:cf(a,b)?1:0} function gf(a){return a.language?bf(a.language):a.audio&&a.audio.language?bf(a.audio.language):a.video&&a.video.language?bf(a.video.language):"und"} function hf(a,b){for(var c=bf(a),d=new Set,e=q(b),f=e.next();!f.done;f=e.next())d.add(bf(f.value));e=q(d);for(f=e.next();!f.done;f=e.next())if(f=f.value,f==c)return f;e=q(d);for(f=e.next();!f.done;f=e.next())if(f=f.value,cf(f,c))return f;e=q(d);for(f=e.next();!f.done;f=e.next())if(f=f.value,df(f,c))return f;d=q(d);for(f=d.next();!f.done;f=d.next())if(f=f.value,cf(c,f))return f;return null} var ef=new Map([["aar","aa"],["abk","ab"],["afr","af"],["aka","ak"],["alb","sq"],["amh","am"],["ara","ar"],["arg","an"],["arm","hy"],["asm","as"],["ava","av"],["ave","ae"],["aym","ay"],["aze","az"],["bak","ba"],["bam","bm"],["baq","eu"],["bel","be"],["ben","bn"],["bih","bh"],["bis","bi"],["bod","bo"],["bos","bs"],["bre","br"],["bul","bg"],["bur","my"],["cat","ca"],["ces","cs"],["cha","ch"],["che","ce"],["chi","zh"],["chu","cu"],["chv","cv"],["cor","kw"],["cos","co"],["cre","cr"],["cym","cy"],["cze", "cs"],["dan","da"],["deu","de"],["div","dv"],["dut","nl"],["dzo","dz"],["ell","el"],["eng","en"],["epo","eo"],["est","et"],["eus","eu"],["ewe","ee"],["fao","fo"],["fas","fa"],["fij","fj"],["fin","fi"],["fra","fr"],["fre","fr"],["fry","fy"],["ful","ff"],["geo","ka"],["ger","de"],["gla","gd"],["gle","ga"],["glg","gl"],["glv","gv"],["gre","el"],["grn","gn"],["guj","gu"],["hat","ht"],["hau","ha"],["heb","he"],["her","hz"],["hin","hi"],["hmo","ho"],["hrv","hr"],["hun","hu"],["hye","hy"],["ibo","ig"],["ice", "is"],["ido","io"],["iii","ii"],["iku","iu"],["ile","ie"],["ina","ia"],["ind","id"],["ipk","ik"],["isl","is"],["ita","it"],["jav","jv"],["jpn","ja"],["kal","kl"],["kan","kn"],["kas","ks"],["kat","ka"],["kau","kr"],["kaz","kk"],["khm","km"],["kik","ki"],["kin","rw"],["kir","ky"],["kom","kv"],["kon","kg"],["kor","ko"],["kua","kj"],["kur","ku"],["lao","lo"],["lat","la"],["lav","lv"],["lim","li"],["lin","ln"],["lit","lt"],["ltz","lb"],["lub","lu"],["lug","lg"],["mac","mk"],["mah","mh"],["mal","ml"],["mao", "mi"],["mar","mr"],["may","ms"],["mkd","mk"],["mlg","mg"],["mlt","mt"],["mon","mn"],["mri","mi"],["msa","ms"],["mya","my"],["nau","na"],["nav","nv"],["nbl","nr"],["nde","nd"],["ndo","ng"],["nep","ne"],["nld","nl"],["nno","nn"],["nob","nb"],["nor","no"],["nya","ny"],["oci","oc"],["oji","oj"],["ori","or"],["orm","om"],["oss","os"],["pan","pa"],["per","fa"],["pli","pi"],["pol","pl"],["por","pt"],["pus","ps"],["que","qu"],["roh","rm"],["ron","ro"],["rum","ro"],["run","rn"],["rus","ru"],["sag","sg"],["san", "sa"],["sin","si"],["slk","sk"],["slo","sk"],["slv","sl"],["sme","se"],["smo","sm"],["sna","sn"],["snd","sd"],["som","so"],["sot","st"],["spa","es"],["sqi","sq"],["srd","sc"],["srp","sr"],["ssw","ss"],["sun","su"],["swa","sw"],["swe","sv"],["tah","ty"],["tam","ta"],["tat","tt"],["tel","te"],["tgk","tg"],["tgl","tl"],["tha","th"],["tib","bo"],["tir","ti"],["ton","to"],["tsn","tn"],["tso","ts"],["tuk","tk"],["tur","tr"],["twi","tw"],["uig","ug"],["ukr","uk"],["urd","ur"],["uzb","uz"],["ven","ve"],["vie", "vi"],["vol","vo"],["wel","cy"],["wln","wa"],["wol","wo"],["xho","xh"],["yid","yi"],["yor","yo"],["zha","za"],["zho","zh"],["zul","zu"]]);function jf(a,b){function c(l){var m="";l.video&&(m=Uc(l.video.codecs)[0]);var n="";l.audio&&(n=Uc(l.audio.codecs)[0]);return m+"-"+n}var d=kf(a.variants,b),e=new Wb;d=q(d);for(var f=d.next();!f.done;f=d.next()){f=f.value;var g=c(f);e.push(g,f)}var h=null,k=Infinity;Xb(e,function(l,m){for(var n=0,r=0,u=q(m),v=u.next();!v.done;v=u.next())n+=v.value.bandwidth||0,++r;n/=r;n=g&&f<=h}var e=a.video;return e&&e.width&&e.height&&(!d(e.width,b.minWidth,Math.min(b.maxWidth,c.width))||!d(e.height,b.minHeight,Math.min(b.maxHeight,c.height))||!d(e.width*e.height,b.minPixels,b.maxPixels))||a&&a.video&&a.video.frameRate&&!d(a.video.frameRate,b.minFrameRate,b.maxFrameRate)||!d(a.bandwidth,b.minBandwidth,b.maxBandwidth)?!1:!0} function mf(a,b,c){c.variants=c.variants.filter(function(d){if(a&&a.M&&!Vd(a,d))return!1;var e=d.audio;d=d.video;return e&&!Le(e)||d&&!Le(d)||e&&b&&b.audio&&!nf(e,b.audio)||d&&b&&b.video&&!nf(d,b.video)?!1:!0});c.textStreams=c.textStreams.filter(function(d){return Be(Rc(d.mimeType,d.codecs))})}function nf(a,b){return a.mimeType!=b.mimeType||a.codecs.split(".")[0]!=b.codecs.split(".")[0]?!1:!0} function of(a){var b=a.audio,c=a.video,d=b?b.codecs:null,e=c?c.codecs:null,f=[];e&&f.push(e);d&&f.push(d);var g=[];c&&g.push(c.mimeType);b&&g.push(b.mimeType);g=g[0]||null;var h=[];b&&h.push(b.kind);c&&h.push(c.kind);h=h[0]||null;var k=new Set;if(b)for(var l=q(b.roles),m=l.next();!m.done;m=l.next())k.add(m.value);if(c)for(l=q(c.roles),m=l.next();!m.done;m=l.next())k.add(m.value);a={id:a.id,active:!1,type:"variant",bandwidth:a.bandwidth,language:a.language,label:null,kind:h,width:null,height:null, frameRate:null,pixelAspectRatio:null,mimeType:g,codecs:f.join(", "),audioCodec:d,videoCodec:e,primary:a.primary,roles:Array.from(k),audioRoles:null,videoId:null,audioId:null,channelsCount:null,audioSamplingRate:null,audioBandwidth:null,videoBandwidth:null,originalVideoId:null,originalAudioId:null,originalTextId:null};c&&(a.videoId=c.id,a.originalVideoId=c.originalId,a.width=c.width||null,a.height=c.height||null,a.frameRate=c.frameRate||null,a.pixelAspectRatio=c.pixelAspectRatio||null,a.videoBandwidth= c.bandwidth||null);b&&(a.audioId=b.id,a.originalAudioId=b.originalId,a.channelsCount=b.channelsCount,a.audioSamplingRate=b.audioSamplingRate,a.audioBandwidth=b.bandwidth||null,a.label=b.label,a.audioRoles=b.roles);return a} function pf(a){return{id:a.id,active:!1,type:"text",bandwidth:0,language:a.language,label:a.label,kind:a.kind||null,width:null,height:null,frameRate:null,pixelAspectRatio:null,mimeType:a.mimeType,codecs:a.codecs||null,audioCodec:null,videoCodec:null,primary:a.primary,roles:a.roles,audioRoles:null,videoId:null,audioId:null,channelsCount:null,audioSamplingRate:null,audioBandwidth:null,videoBandwidth:null,originalVideoId:null,originalAudioId:null,originalTextId:a.originalId}} function qf(a){a.__shaka_id||(a.__shaka_id=rf++);return a.__shaka_id}function sf(a){var b=tf(a);b.active=a.enabled;b.type="variant";b.originalAudioId=a.id;"main"==a.kind&&(b.primary=!0);a.kind&&(b.roles=[a.kind],b.audioRoles=[a.kind]);return b} function tf(a){return{id:qf(a),active:!1,type:"",bandwidth:0,language:bf(a.language),label:a.label,kind:a.kind,width:null,height:null,frameRate:null,pixelAspectRatio:null,mimeType:null,codecs:null,audioCodec:null,videoCodec:null,primary:!1,roles:[],audioRoles:null,videoId:null,audioId:null,channelsCount:null,audioSamplingRate:null,audioBandwidth:null,videoBandwidth:null,originalVideoId:null,originalAudioId:null,originalTextId:null}} function uf(a){return a.allowedByApplication&&a.allowedByKeySystem}function vf(a){return a.filter(function(b){return uf(b)})} function kf(a,b){var c=a.filter(function(g){return g.audio&&g.audio.channelsCount}),d=new Map;c=q(c);for(var e=c.next();!e.done;e=c.next()){e=e.value;var f=e.audio.channelsCount;d.has(f)||d.set(f,[]);d.get(f).push(e)}c=Array.from(d.keys());if(0==c.length)return a;e=c.filter(function(g){return g<=b});return e.length?d.get(Math.max.apply(Math,ka(e))):d.get(Math.min.apply(Math,ka(c)))} function wf(a,b,c){var d=a,e=a.filter(function(h){return h.primary});e.length&&(d=e);var f=d.length?d[0].language:"";d=d.filter(function(h){return h.language==f});if(b){var g=hf(bf(b),a.map(function(h){return h.language}));g&&(d=a.filter(function(h){return bf(h.language)==g}))}if(c){if(a=xf(d,c),a.length)return a}else if(a=d.filter(function(h){return 0==h.roles.length}),a.length)return a;a=d.map(function(h){return h.roles}).reduce(Ic,[]);return a.length?xf(d,a[0]):d} function xf(a,b){return a.filter(function(c){return c.roles.includes(b)})}var rf=0;function yf(){this.h=null;this.c=!1;this.a=new Ya;this.b=[];this.g=1;this.j=!1;this.i=this.f=null}p=yf.prototype;p.stop=function(){this.h=null;this.c=!1;this.b=[];this.g=1;this.f=null};p.init=function(a){this.h=a}; p.chooseVariant=function(){var a=zf(this.i.restrictions,this.b),b=this.a.getBandwidthEstimate(this.i.defaultBandwidthEstimate);this.b.length&&!a.length&&(a=zf(null,this.b),a=[a[0]]);var c=a[0]||null;a=q(mb(a));for(var d=a.next();!d.done;d=a.next()){var e=d.value;d=e.item;var f=isNaN(this.g)?1:Math.abs(this.g);e=f*(e.next||{bandwidth:Infinity}).bandwidth/this.i.bandwidthUpgradeTarget;b>=f*d.bandwidth/this.i.bandwidthDowngradeTarget&&b<=e&&(c=d)}this.f=Date.now();return c}; p.enable=function(){this.c=!0};p.disable=function(){this.c=!1};p.segmentDownloaded=function(a,b){var c=this.a;if(!(16E3>b)){var d=8E3*b/a,e=a/1E3;c.a+=b;Wa(c.b,e,d);Wa(c.c,e,d)}if(null!=this.f&&this.c)a:{if(!this.j){if(!(128E3<=this.a.a))break a;this.j=!0}else if(Date.now()-this.f<1E3*this.i.switchInterval)break a;c=this.chooseVariant();this.a.getBandwidthEstimate(this.i.defaultBandwidthEstimate);c&&this.h(c)}};p.getBandwidthEstimate=function(){return this.a.getBandwidthEstimate(this.i.defaultBandwidthEstimate)}; p.setVariants=function(a){this.b=a};p.playbackRateChanged=function(a){this.g=a};p.configure=function(a){this.i=a};function zf(a,b){a&&(b=b.filter(function(c){return lf(c,a,{width:Infinity,height:Infinity})}));return b.sort(function(c,d){return c.bandwidth-d.bandwidth})}K("shaka.abr.SimpleAbrManager",yf);yf.prototype.configure=yf.prototype.configure;yf.prototype.playbackRateChanged=yf.prototype.playbackRateChanged;yf.prototype.setVariants=yf.prototype.setVariants; yf.prototype.getBandwidthEstimate=yf.prototype.getBandwidthEstimate;yf.prototype.segmentDownloaded=yf.prototype.segmentDownloaded;yf.prototype.disable=yf.prototype.disable;yf.prototype.enable=yf.prototype.enable;yf.prototype.chooseVariant=yf.prototype.chooseVariant;yf.prototype.init=yf.prototype.init;yf.prototype.stop=yf.prototype.stop;function Af(a,b){this.a=a;this.b=new Set([a]);b=b||[];for(var c=q(b),d=c.next();!d.done;d=c.next())this.add(d.value)}Af.prototype.add=function(a){return Bf(this.a,a)?(this.b.add(a),!0):!1};function Bf(a,b){var c;if(!(c=!!a.audio!=!!b.audio||!!a.video!=!!b.video||a.language!=b.language)&&(c=a.audio&&b.audio)){c=a.audio;var d=b.audio;c=!(c.channelsCount==d.channelsCount&&Cf(c,d)&&Df(c.roles,d.roles))}!c&&(c=a.video&&b.video)&&(c=a.video,d=b.video,c=!(Cf(c,d)&&Df(c.roles,d.roles)));return c?!1:!0} Af.prototype.values=function(){return this.b.values()};function Cf(a,b){if(a.mimeType!=b.mimeType)return!1;var c=a.codecs.split(",").map(function(g){return Uc(g)[0]}),d=b.codecs.split(",").map(function(g){return Uc(g)[0]});if(c.length!=d.length)return!1;c.sort();d.sort();for(var e=q(kb(c.length)),f=e.next();!f.done;f=e.next())if(f=f.value,c[f]!=d[f])return!1;return!0} function Df(a,b){var c=new Set(a),d=new Set(b);c["delete"]("main");d["delete"]("main");if(c.size!=d.size)return!1;c=q(c);for(var e=c.next();!e.done;e=c.next())if(!d.has(e.value))return!1;return!0};function Ef(a){this.a=a;this.b=new Ff(a.language,"",a.audio&&a.audio.channelsCount?a.audio.channelsCount:0,"")}Ef.prototype.create=function(a){var b=this,c=a.filter(function(d){return Bf(b.a,d)});return c.length?new Af(c[0],c):this.b.create(a)};function Ff(a,b,c,d,e){this.f=a;this.c=b;this.a=c;this.b=void 0===d?"":d;this.g=void 0===e?"":e} Ff.prototype.create=function(a){var b=[];b=Gf(a,this.f);var c=a.filter(function(d){return d.primary});b=b.length?b:c.length?c:a;this.c&&(a=Hf(b,this.c,this.g),a.length&&(b=a));this.a&&(a=kf(b,this.a),a.length&&(b=a));this.b&&(a=If(b,this.b),a.length&&(b=a));a=new Af(b[0]);b=q(b);for(c=b.next();!c.done;c=b.next())c=c.value,Bf(a.a,c)&&a.add(c);return a};function Gf(a,b){var c=bf(b),d=hf(c,a.map(function(e){return gf(e)}));return d?a.filter(function(e){return d==gf(e)}):[]} function Hf(a,b,c){return a.filter(function(d){if(c){var e=d[c];return e&&e.roles.includes(b)}e=d.audio;d=d.video;return e&&e.roles.includes(b)||d&&d.roles.includes(b)})}function If(a,b){return a.filter(function(c){return c.audio?c.audio.label.toLowerCase()==b.toLowerCase():!1})};function Jf(){this.a=Kf;this.b=(new Map).set(Kf,2).set(Lf,1)}function Mf(a,b,c){a.b.set(Kf,c).set(Lf,b)}var Lf=0,Kf=1;function Nf(){}function Of(a,b,c,d){var e,f,g,h;return E(function(k){if(1==k.a){if(d&&(e=Pf[d.toLowerCase()]))return k["return"](e);if(f=Qf(a))if(g=Rf[f])return k["return"](g);return d?k.u(2):t(k,Sf(a,b,c),3)}if(2!=k.a&&(d=k.b)&&(h=Pf[d]))return k["return"](h);throw new M(N,4,4E3,a);})} function Sf(a,b,c){var d,e,f;return E(function(g){if(1==g.a)return d=jc([a],c),d.method="HEAD",t(g,b.request(0,d).promise,2);e=g.b;f=e.headers["content-type"];return g["return"](f?f.toLowerCase().split(";").shift():"")})}function Qf(a){a=(new ob(a)).ia.split("/").pop().split(".");return 1==a.length?"":a.pop().toLowerCase()}K("shaka.media.ManifestParser",Nf);Nf.unregisterParserByMime=function(a){delete Pf[a]};Nf.registerParserByMime=function(a,b){Pf[a]=b}; Nf.registerParserByExtension=function(a,b){Rf[a]=b};var Pf={},Rf={};function Tf(a){var b=this;this.a=a;this.f=!1;this.b=this.a.dc();this.c=new L(function(){b.a.Dd(.25*b.b)})}Tf.prototype.release=function(){this.c&&(this.c.stop(),this.c=null);this.a=null};Tf.prototype.set=function(a){this.b=a;Uf(this)};function Uf(a){a.c.stop();var b=a.f?0:a.b;if(0<=b)try{a.a.dc()!=b&&a.a.fd(b);return}catch(c){}a.c.xa(.25);0!=a.a.dc()&&a.a.fd(0)};function Vf(a,b){this.g=a;this.h=Wf(a);this.a=a.a.currentTime;this.f=Date.now()/1E3;this.b=!1;this.j=b;this.c=function(){}}Vf.prototype.release=function(){this.g=null;this.c=function(){}};function Xf(a,b){a.c=b}function Yf(a){this.a=a}function Wf(a){if(a.a.paused||0==a.a.playbackRate||0==a.a.buffered.length)var b=!1;else a:{b=a.a.currentTime;a=q(de(a.a.buffered));for(var c=a.next();!c.done;c=a.next())if(c=c.value,!(bc.end-.5)){b=!0;break a}b=!1}return b};function Zf(a,b,c,d,e){var f=this;this.a=a;this.w=b;this.i=c;this.v=e;this.b=new sc;this.j=!1;this.l=a.readyState;this.f=!1;this.c=d;this.h=!1;this.b.o(a,"waiting",function(){return $f(f)});this.g=(new L(function(){$f(f)})).xa(.25)}Zf.prototype.release=function(){this.b&&(this.b.release(),this.b=null);null!=this.g&&(this.g.stop(),this.g=null);this.c&&(this.c.release(),this.c=null);this.a=this.w=this.v=null};Zf.prototype.Vc=function(){this.h=!0;$f(this)}; function $f(a){if(0!=a.a.readyState){if(a.a.seeking){if(!a.j)return}else a.j=!1;if(!a.a.paused){a.a.readyState!=a.l&&(a.f=!1,a.l=a.a.readyState);var b=a.i.smallGapLimit,c=a.a.currentTime,d=a.a.buffered,e=ee(d,c);if(null==e){if(a.c){a=a.c;d=a.g;e=Wf(d);var f=d.a.currentTime;c=Date.now()/1E3;if(a.a!=f||a.h!=e)a.f=c,a.a=f,a.h=e,a.b=!1;f=c-a.f;f>=a.j&&e&&!a.b&&(a.c(a.a,f),a.b=!0,a.a=d.a.currentTime)}}else if(0!=e||a.h)if(f=d.start(e),!(f>=a.w.Da())){var g=f-c;b=g<=b;var h=!1;.001>g||(b||a.f||(a.f=!0, c=new R("largegap",{currentTime:c,gapSize:g}),c.cancelable=!0,a.v(c),a.i.jumpLargeGaps&&!c.defaultPrevented&&(h=!0)),!b&&!h)||(0!=e&&d.end(e-1),a.a.currentTime=f)}}}};function ag(a,b,c,d){b==HTMLMediaElement.HAVE_NOTHING||a.readyState>=b?d():(b=bg.get(b),c.ha(a,b,d))}var bg=new Map([[HTMLMediaElement.HAVE_METADATA,"loadedmetadata"],[HTMLMediaElement.HAVE_CURRENT_DATA,"loadeddata"],[HTMLMediaElement.HAVE_FUTURE_DATA,"canplay"],[HTMLMediaElement.HAVE_ENOUGH_DATA,"canplaythrough"]]);function cg(a,b,c){var d=this;this.a=a;this.g=b;this.f=c;this.h=!1;this.b=new sc;this.c=new dg(a);ag(this.a,HTMLMediaElement.HAVE_METADATA,this.b,function(){eg(d,d.f)})}cg.prototype.release=function(){this.b&&(this.b.release(),this.b=null);null!=this.c&&(this.c.release(),this.c=null);this.g=function(){};this.a=null};function fg(a){return a.h?a.a.currentTime:a.f}function gg(a,b){0Math.abs(a.a.currentTime-b)?ig(a):(a.b.ha(a.a,"seeking",function(){ig(a)}),hg(a.c,0==a.a.currentTime?b:a.a.currentTime))}function ig(a){a.h=!0;a.b.o(a.a,"seeking",function(){return a.g()})}function dg(a){var b=this;this.b=a;this.h=10;this.g=this.f=this.c=0;this.a=new L(function(){0>=b.c?b.a.stop():b.b.currentTime!=b.f?b.a.stop():(b.b.currentTime=b.g,b.c--)})}dg.prototype.release=function(){this.a&&(this.a.stop(),this.a=null);this.b=null}; function hg(a,b){a.f=a.b.currentTime;a.g=b;a.c=a.h;a.b.currentTime=b;a.a.xa(.1)};function jg(a){function b(){null==c.c?c.f=!0:(c.b.ha(c.a,"seeking",function(){c.f=!0}),c.a.currentTime=Math.max(0,c.a.currentTime+c.c))}var c=this;this.a=a;this.f=!1;this.c=null;this.b=new sc;ag(this.a,HTMLMediaElement.HAVE_CURRENT_DATA,this.b,function(){b()})}jg.prototype.release=function(){this.b&&(this.b.release(),this.b=null);this.a=null};jg.prototype.l=function(a){this.c=this.f?this.c:a};jg.prototype.g=function(){return(this.f?this.a.currentTime:this.c)||0};jg.prototype.v=function(){}; function kg(a,b,c,d,e,f){var g=this;this.b=a;this.a=b.presentationTimeline;this.C=b.minBufferTime||0;this.i=c;this.w=e;this.j=null;this.f=new Zf(a,b.presentationTimeline,c,lg(a,c),f);this.c=new cg(a,function(){a:{var h=g.f;h.j=!0;h.h=!1;h.f=!1;var k=fg(g.c);h=mg(g,k);if(.001l-k&&(k=l-3);ha.a.getDuration()?a.a.ib():a.a.Da():0>b&&(b=a.a.Da()+b);return pg(a,og(a,b))}kg.prototype.v=function(){this.f.Vc()};function pg(a,b){var c=a.a.getDuration();return b>=c?c-a.i.durationBackoff:b}function mg(a,b){var c=Math.max(a.C,a.i.rebufferingGoal),d=a.i.safeSeekOffset,e=a.a.ib(),f=a.a.Da(),g=a.a.getDuration();3>f-e&&(e=f-3);var h=a.a.Eb(c),k=a.a.Eb(d);c=a.a.Eb(c+d);return b>=g?pg(a,b):b>f?f:b=h||be(a.b.buffered,b)?b:c} function og(a,b){var c=a.a.ib();if(bc?c:b}function lg(a,b){if(!b.stallEnabled)return null;var c=b.stallSkip,d=new Vf(new Yf(a),b.stallThreshold);Xf(d,function(){a.currentTime+=c});return d};function qg(a){var b=this;this.c=a;this.a=new Set;this.b=(new L(function(){rg(b,!1)})).xa(.25)}qg.prototype.release=function(){this.b.stop();for(var a=q(this.a),b=a.next();!b.done;b=a.next())b.value.release();this.a.clear()}; function rg(a,b){for(var c=q(a.a),d=c.next();!d.done;d=c.next()){d=d.value;for(var e=a.c.currentTime,f=b,g=q(d.g.a),h=g.next();!h.done;h=g.next()){h=h.value;var k=d.f.get(h),l=eh.endTime?tg:ug;d.f.set(h,l);for(var m=q(d.h),n=m.next();!n.done;n=m.next())n=n.value,n.$a==k&&n.Za==l&&n.Ra(h,f)}}};function vg(){this.b=function(){};this.a=new Set}vg.prototype.release=function(){this.b=function(){};this.a.clear()};function wg(a,b){a.b=b};function xg(a){var b=this;this.g=a;this.f=new Map;this.a=function(){};this.b=function(){};this.c=function(){};this.h=[{$a:null,Za:ug,Ra:function(c,d){return b.a(c,d)}},{$a:sg,Za:ug,Ra:function(c,d){return b.a(c,d)}},{$a:tg,Za:ug,Ra:function(c,d){return b.a(c,d)}},{$a:ug,Za:sg,Ra:function(c,d){return b.b(c,d)}},{$a:ug,Za:tg,Ra:function(c,d){return b.b(c,d)}},{$a:sg,Za:tg,Ra:function(c,d){return b.c(c,d)}},{$a:tg,Za:sg,Ra:function(c,d){return b.c(c,d)}}]} xg.prototype.release=function(){this.g=null;this.f.clear();this.a=function(){};this.b=function(){};this.c=function(){}};function yg(a,b,c,d){a.a=b;a.b=c;a.c=d}var sg=1,ug=2,tg=3;function zg(a,b,c){this.c=a;this.b=b;this.a=c}zg.prototype.Ic=function(){return this.b};zg.prototype.Hc=function(){return this.a};K("shaka.media.InitSegmentReference",zg);zg.prototype.getEndByte=zg.prototype.Hc;zg.prototype.getStartByte=zg.prototype.Ic;function Ag(a,b,c,d,e,f,g,h,k){this.startTime=a;this.endTime=b;this.c=c;this.b=d;this.a=e;this.f=f;this.timestampOffset=g;this.appendWindowStart=h;this.appendWindowEnd=k}Ag.prototype.ve=function(){return this.startTime};Ag.prototype.ie=function(){return this.endTime}; Ag.prototype.Ic=function(){return this.b};Ag.prototype.Hc=function(){return this.a};K("shaka.media.SegmentReference",Ag);Ag.prototype.getEndByte=Ag.prototype.Hc;Ag.prototype.getStartByte=Ag.prototype.Ic;Ag.prototype.getEndTime=Ag.prototype.ie;Ag.prototype.getStartTime=Ag.prototype.ve;ea();ia();function S(a){this.a=a;this.b=null;this.c=0}p=S.prototype;p.destroy=function(){Ec("shaka.media.SegmentIndex","Please use release() instead of destroy().");this.release();return Promise.resolve()};p.release=function(){this.a=[];this.b&&this.b.stop();this.b=null};p.find=function(a){for(var b=this.a.length-1;0<=b;--b){var c=this.a[b];if(a>=c.startTime&&aa||a>=this.a.length?null:this.a[a]};p.offset=function(a){for(var b=q(this.a),c=b.next();!c.done;c=b.next())c=c.value,c.startTime+=a,c.endTime+=a,c.timestampOffset+=a};p.kb=function(a){var b=this.a[this.a.length-1],c=[];c=this.a.length?a.filter(function(d){return d.startTime>=b.startTime}):a;b&&c.length&&c[0].startTime==b.startTime&&this.a.pop();this.a.push.apply(this.a,ka(c))}; p.Na=function(a){var b=this.a.length;this.a=this.a.filter(function(c){return c.endTime>a});this.c+=b-this.a.length};p.Ja=function(a,b){for(;this.a.length;)if(this.a[this.a.length-1].startTime>=b)this.a.pop();else break;for(;this.a.length;)if(this.a[0].endTime<=a)this.a.shift(),this.c++;else break;if(0!=this.a.length){var c=this.a[this.a.length-1];this.a[this.a.length-1]=new Ag(c.startTime,b,c.c,c.b,c.a,c.f,c.timestampOffset,c.appendWindowStart,c.appendWindowEnd)}}; p.mc=function(a,b){var c=this;this.b&&this.b.stop();this.b=new L(function(){var d=b();c.a.push.apply(c.a,ka(d));0==c.a.length&&(c.b.stop(),c.b=null)});this.b.xa(a)};S.prototype[Symbol.iterator]=function(){return new Bg(this)};function Cg(a,b,c){return new S([new Ag(a,a+b,function(){return c},0,null,null,a,a,a+b)])}K("shaka.media.SegmentIndex",S);S.forSingleSegment=Cg;S.prototype.updateEvery=S.prototype.mc;S.prototype.fit=S.prototype.Ja;S.prototype.evict=S.prototype.Na;S.prototype.merge=S.prototype.kb; S.prototype.offset=S.prototype.offset;S.prototype.get=S.prototype.get;S.prototype.find=S.prototype.find;S.prototype.release=S.prototype.release;S.prototype.destroy=S.prototype.destroy;function Bg(a){this.b=a;this.a=this.b.find(0)||0}Bg.prototype.seek=function(a){a=this.b.find(a);if(null==a)return this.a=Math.pow(2,31),null;this.a=a;return this.b.get(this.a++)};Bg.prototype.current=function(){return this.b.get(this.a-1)};Bg.prototype.next=function(){var a=this.b.get(this.a++);return{value:a,done:!a}}; K("shaka.media.SegmentIterator",Bg);Bg.prototype.next=Bg.prototype.next;Bg.prototype.current=Bg.prototype.current;Bg.prototype.seek=Bg.prototype.seek;function Fg(){S.call(this,[]);this.f=[]}sa(Fg,S);p=Fg.prototype;p.clone=function(){var a=new Fg;a.f=this.f.slice();return a};p.release=function(){for(var a=q(this.f),b=a.next();!b.done;b=a.next())b.value.release();this.f=[]}; p.find=function(a){for(var b=0,c=q(this.f),d=c.next();!d.done;d=c.next()){d=d.value;var e=d.find(a);if(null!=e)return e+b;b+=d.c+d.a.length}return null};p.get=function(a){for(var b=0,c=q(this.f),d=c.next();!d.done;d=c.next()){d=d.value;var e=d.get(a-b);if(e)return e;b+=d.c+d.a.length}return null};p.offset=function(){};p.kb=function(){};p.Na=function(){};p.Ja=function(){};p.mc=function(){};K("shaka.media.MetaSegmentIndex",Fg);Fg.prototype.updateEvery=Fg.prototype.mc;Fg.prototype.fit=Fg.prototype.Ja; Fg.prototype.evict=Fg.prototype.Na;Fg.prototype.merge=Fg.prototype.kb;Fg.prototype.offset=Fg.prototype.offset;Fg.prototype.get=Fg.prototype.get;Fg.prototype.find=Fg.prototype.find;Fg.prototype.release=Fg.prototype.release;function T(a,b){this.P=Vb(a);this.a=b==Gg;this.B=0}p=T.prototype;p.sa=function(){return this.Bthis.P.byteLength)throw Hg();var b=Q(this.P,this.B,a);this.B+=a;return b}; p.skip=function(a){if(this.B+a>this.P.byteLength)throw Hg();this.B+=a};p.Jd=function(a){if(this.Ba||a>this.P.byteLength)throw Hg();this.B=a};p.Xc=function(){for(var a=this.B;this.sa()&&0!=this.P.getUint8(this.B);)this.B+=1;a=Q(this.P,a,this.B-a);this.B+=1;return dd(a)};function Hg(){return new M(N,3,3E3)}K("shaka.util.DataViewReader",T);T.prototype.readTerminatedString=T.prototype.Xc;T.prototype.seek=T.prototype.seek;T.prototype.rewind=T.prototype.Jd; T.prototype.skip=T.prototype.skip;T.prototype.readBytes=T.prototype.Va;T.prototype.readUint64=T.prototype.pb;T.prototype.readInt32=T.prototype.Hd;T.prototype.readUint32=T.prototype.J;T.prototype.readUint16=T.prototype.Kb;T.prototype.readUint8=T.prototype.na;T.prototype.getLength=T.prototype.je;T.prototype.getPosition=T.prototype.te;T.prototype.hasMoreData=T.prototype.sa;var Gg=1;T.Endianness={BIG_ENDIAN:0,LITTLE_ENDIAN:Gg};function Ig(){this.c=[];this.b=[];this.a=!1}p=Ig.prototype;p.K=function(a,b){var c=Jg(a);this.c[c]=Kg;this.b[c]=b;return this};p.ea=function(a,b){var c=Jg(a);this.c[c]=Lg;this.b[c]=b;return this};p.stop=function(){this.a=!0};p.parse=function(a,b){var c=new T(a,0);for(this.a=!1;c.sa()&&!this.a;)this.jc(0,c,b)}; p.jc=function(a,b,c){var d=b.B,e=b.J(),f=b.J();switch(e){case 0:e=b.P.byteLength-d;break;case 1:e=b.pb()}var g=this.b[f];if(g){var h=null,k=null;this.c[f]==Lg&&(k=b.J(),h=k>>>24,k&=16777215);f=d+e;c&&f>b.P.byteLength&&(f=b.P.byteLength);f-=b.B;b=0>24&255,a>>16&255,a>>8&255,a&255)}K("shaka.util.Mp4Parser",Ig);Ig.typeToString=Pg;Ig.allData=Og;Ig.sampleDescription=Ng;Ig.children=Mg;Ig.prototype.parseNext=Ig.prototype.jc;Ig.prototype.parse=Ig.prototype.parse;Ig.prototype.stop=Ig.prototype.stop;Ig.prototype.fullBox=Ig.prototype.ea;Ig.prototype.box=Ig.prototype.K;var Kg=0,Lg=1;function Qg(a,b,c,d){a=jc(a,d);if(0!=b||null!=c)a.headers.Range=c?"bytes="+b+"-"+c:"bytes="+b+"-";return a};function Rg(a,b){var c=this;this.s=b;this.m=a;this.i=null;this.f=1;this.c=this.b=null;this.a=new Map;this.h=!1;this.j=null;this.g=!1;this.D=new qc(function(){return Sg(c)})}Rg.prototype.destroy=function(){return this.D.destroy()};function Sg(a){var b,c,d,e;return E(function(f){if(1==f.a){b=[];c=q(a.a.values());for(d=c.next();!d.done;d=c.next())e=d.value,Tg(e),b.push(Ug(e));return t(f,Promise.all(b),2)}a.a.clear();a.s=null;a.m=null;a.i=null;w(f)})} Rg.prototype.configure=function(a){this.i=a;this.j=new Cb({maxAttempts:Math.max(a.retryParameters.maxAttempts,2),baseDelay:a.retryParameters.baseDelay,backoffFactor:a.retryParameters.backoffFactor,fuzzFactor:a.retryParameters.fuzzFactor,timeout:0},!0)};Rg.prototype.start=function(){var a=this;return E(function(b){if(1==b.a)return t(b,Vg(a),2);rc(a.D);a.h=!0;w(b)})}; function Wg(a,b){var c,d,e,f,g,h;E(function(k){switch(k.a){case 1:return c=Oc,x(k,2),t(k,We(a.s.L,c.$),4);case 4:xa(k,3);break;case 2:if(d=y(k),a.s)a.s.onError(d);case 3:e=Rc(b.mimeType,b.codecs);Me(a.s.L,e);f=a.s.L.h;if(g=f.isTextVisible()||a.i.alwaysStreamText)h=Xg(b),a.a.set(c.$,h),Yg(a,h,0);w(k)}})}function Zg(a){var b=a.a.get("text");b&&(Tg(b),Ug(b)["catch"](function(){}),a.a["delete"]("text"))} function $g(a,b){var c=a.a.get("video");if(c){var d=c.stream;if(d)if(b){var e=d.trickModeVideo;e&&!c.Xa&&(ah(a,e,!1,0,!1),c.Xa=d)}else if(d=c.Xa)c.Xa=null,ah(a,d,!0,0,!1)}}function bh(a,b,c,d){c=void 0===c?!1:c;d=void 0===d?0:d;a.b=b;a.h&&(b.video&&ah(a,b.video,c,d,!1),b.audio&&ah(a,b.audio,c,d,!1))}function ch(a,b){a.c=b;a.h&&ah(a,b,!0,0,!1)} function ah(a,b,c,d,e){var f=a.a.get(b.type);f||"text"!=b.type?f&&(f.Xa&&(b.trickModeVideo?(f.Xa=b,b=b.trickModeVideo):f.Xa=null),f.stream!=b||e)&&("text"==b.type&&Me(a.s.L,Rc(b.mimeType,b.codecs)),f.stream=b,f.stream.segmentIndex?(ea(),ia(),f.va=f.stream.segmentIndex[Symbol.iterator]()):f.va=null,c&&(f.zb?f.oc=!0:f.Ua?(f.rb=!0,f.$b=d,f.oc=!0):(Tg(f),dh(a,f,!0,d)["catch"](function(g){if(a.s)a.s.onError(g)}))),eh(a,f)["catch"](function(g){if(a.s)a.s.onError(g)})):Wg(a,b)} function eh(a,b){var c,d;return E(function(e){if(1==e.a){if(!b.Ea)return e["return"]();c=b.stream;d=b.Ea;return c.segmentIndex?e.u(2):t(e,c.createSegmentIndex(),2)}if(b.Ea!=d||b.stream!=c)return e["return"]();ea();ia();b.va=b.stream.segmentIndex[Symbol.iterator]();var f=a.s.cc();var g=Re(a.s.L,b.type),h=fh(a,b,f,g),k=h?h.a?h.a-h.b:null:null;h&&!k&&(k=(h.endTime-h.startTime)*(b.stream.bandwidth||0)/8);k?((h=h.f)&&(k+=(h.a?h.a-h.b:null)||0),h=a.s.getBandwidthEstimate(),f=8*k/h<(g||0)-f-Math.max(a.m.minBufferTime|| 0,a.i.rebufferingGoal)||b.Ea.b.a>k?!0:!1):f=!1;f&&b.Ea.abort();w(e)})}function gh(a,b){b.zb||b.rb||(b.Ua?(b.rb=!0,b.$b=0):null==Pe(a.s.L,b.type)?null==b.Ha&&Yg(a,b,0):(Tg(b),dh(a,b,!1,0)["catch"](function(c){if(a.s)a.s.onError(c)})))} function Vg(a){var b,c,d,e,f,g,h,k,l,m;return E(function(n){if(1==n.a){b=Oc;if(!a.b)throw new M(N,5,5006);c=new Map;d=new Set;a.b.audio&&(c.set(b.cb,a.b.audio),d.add(a.b.audio));a.b.video&&(c.set(b.Ba,a.b.video),d.add(a.b.video));a.c&&(c.set(b.$,a.c),d.add(a.c));e=a.s.L;f=a.i.forceTransmuxTS;return t(n,e.init(c,f),2)}rc(a.D);var r=a.m.presentationTimeline.getDuration();Infinity>r?a.s.L.wa(r):a.s.L.wa(Math.pow(2,32));g=q(c.keys());for(h=g.next();!h.done;h=g.next())k=h.value,l=c.get(k),a.a.has(k)|| (m=Xg(l),a.a.set(k,m),Yg(a,m,0));w(n)})}function Xg(a){ea();ia();var b=a.segmentIndex?a.segmentIndex[Symbol.iterator]():null;return{stream:a,type:a.type,Hb:null,va:b,La:null,Oc:null,Pc:null,Nc:null,Mc:null,Xa:null,endOfStream:!1,Ua:!1,Ha:null,rb:!1,$b:0,oc:!1,zb:!1,Zc:!1,Fb:!1,Ea:null}} Rg.prototype.Ib=function(a){var b=this,c,d,e,f;return E(function(g){switch(g.a){case 1:rc(b.D);if(a.Ua||null==a.Ha||a.zb)return g["return"]();a.Ha=null;if(!a.rb){g.u(2);break}return t(g,dh(b,a,a.oc,a.$b),3);case 3:return g["return"]();case 2:if(a.stream.segmentIndex){g.u(4);break}c=a.stream;return t(g,a.stream.createSegmentIndex(),5);case 5:if(c!=a.stream)return null==a.Ha&&Yg(b,a,0),g["return"]();hh(a)||(ea(),ia(),a.va=a.stream.segmentIndex[Symbol.iterator]());case 4:try{d=ih(b,a),null!=d&&(Yg(b, a,d),a.Fb=!1)}catch(h){return jh(b,h),g["return"]()}e=Array.from(b.a.values());if(!b.h||!e.every(function(h){return h.endOfStream})){g.u(0);break}return t(g,b.s.L.endOfStream(),7);case 7:rc(b.D),f=b.s.L.getDuration(),0!=f&&f=a.m.presentationTimeline.getDuration())return b.endOfStream=!0,"video"==b.type&&(c=a.a.get("text"))&&hh(c)&&(c.endOfStream=!0),null;b.endOfStream=!1;if(e>=f)return.5;e=Re(a.s.L,b.type);e=fh(a,b,c,e);if(!e||!kh(a,e))return 1;f=Infinity;var g=Array.from(a.a.values());g=q(g);for(var h=g.next();!h.done;h= g.next())h=h.value,hh(h)||(f=Math.min(f,h.Hb&&h.La?h.La.endTime:c));if(d>=f+a.m.presentationTimeline.a)return 1;lh(a,b,c,e)["catch"](function(){});return null}function fh(a,b,c,d){if(b.stream==b.Hb)return b.va.current();if(b.La)return b.va.seek(b.La.endTime);if(d)return b.va.seek(d);(d=b.va.seek(Math.max(c-a.i.inaccurateManifestTolerance,0)))&&kh(a,d)||(d=b.va.seek(c));return d}function kh(a,b){var c=a.m.presentationTimeline,d=c.Ka();return b.endTimed?!1:!0} function lh(a,b,c,d){var e,f,g,h,k,l;return E(function(m){switch(m.a){case 1:return e=Oc,f=b.stream,b.Ua=!0,g=mh(a,b,d),h=nh(a,b,d),x(m,2),t(m,Promise.all([g,h]),4);case 4:return k=m.b,rc(a.D),a.g?m["return"]():t(m,oh(a,b,c,f,d,k[1]),5);case 5:rc(a.D);if(a.g)return m["return"]();b.Ua=!1;b.Zc=!1;a.s.L.bc();b.rb||a.s.Vc();Yg(a,b,0);xa(m,0);break;case 2:l=y(m);rc(a.D,l);if(a.g)return m["return"]();b.Ua=!1;b.type==e.$&&a.i.ignoreTextStreamFailures?a.a["delete"](e.$):7001==l.code?(b.Ua=!1,b.Ha=null,Yg(a, b,0)):3017==l.code?ph(a,b,l):(b.Fb=!0,l.severity=N,jh(a,l));w(m)}})}function ph(a,b,c){if(!Array.from(a.a.values()).some(function(e){return e!=b&&e.Zc})){var d=Math.round(100*a.f);if(20=g?h["return"]():t(h,a.s.L.remove(b.type,e,e+g),2)}rc(a.D);w(h)})}function hh(a){return a&&"text"==a.type&&"application/cea-608"==a.stream.mimeType} function nh(a,b,c){var d,e,f,g;return E(function(h){if(1==h.a)return d=pc,e=Qg(c.c(),c.b,c.a,a.i.retryParameters),f=a.s.lb.request(d,e),b.Ea=f,t(h,f.promise,2);g=h.b;b.Ea=null;return h["return"](g.data)})} function dh(a,b,c,d){var e,f;return E(function(g){if(1==g.a)return b.rb=!1,b.oc=!1,b.$b=0,b.zb=!0,d?(e=a.s.cc(),f=a.s.L.getDuration(),t(g,a.s.L.remove(b.type,e+d,f),3)):t(g,We(a.s.L,b.type),4);if(3!=g.a)return rc(a.D),c?t(g,a.s.L.flush(b.type),3):g.u(3);rc(a.D);b.Hb=null;b.La=null;b.zb=!1;b.endOfStream=!1;Yg(a,b,0);w(g)})} function Yg(a,b,c){b.Ha=(new Bb(function(){var d;return E(function(e){if(1==e.a)return x(e,2),t(e,a.Ib(b),4);if(2!=e.a)return xa(e,0);d=y(e);if(a.s)a.s.onError(d);w(e)})})).R(c)}function Tg(a){null!=a.Ha&&(a.Ha.stop(),a.Ha=null)}function Ug(a){return E(function(b){return a.Ea?t(b,a.Ea.abort(),0):b.u(0)})}function jh(a,b){E(function(c){if(1==c.a)return t(c,Eb(a.j),2);rc(a.D);a.s.onError(b);b.handled||a.i.failureCallback(b);w(c)})};function sh(a,b){var c=th(),d=this;this.h=b;this.c=a;this.f=c;this.j=null;this.g=[];this.b=this.a=null;this.l=Promise.resolve().then(function(){return uh(d)});this.D=new qc(function(){return vh(d)})}sh.prototype.destroy=function(){return this.D.destroy()};function vh(a){var b,c,d;return E(function(e){if(1==e.a)return a.b&&a.b.abort(),wh(a),t(e,a.l,2);a.a&&a.a.ta.Ta();b=q(a.g);for(c=b.next();!c.done;c=b.next())d=c.value,d.ta.Ta();a.a=null;a.g=[];a.h=null;w(e)})} function xh(a,b){var c={nb:function(){},fc:function(){},Ta:function(){},onError:function(){},ic:function(){},Jf:function(){}};a.g.push({create:b,ta:c});a.b&&a.b.abort();wh(a);return c} function uh(a){return E(function(b){if(a.D.a)b=b.u(0);else{if(0==a.g.length||a.a&&!a.a.Qa)var c=!1;else{a.a&&(a.a.ta.Ta(),a.a=null);c=a.g.shift();var d=c.create(a.f);d?(c.ta.nb(),a.a={node:d.node,payload:d.payload,Qa:d.Qa,ta:c.ta}):c.ta.ic();c=!0}c?c=Promise.resolve():a.a?c=yh(a):(a.h.Fe(a.c),a.j=new Hb,c=a.j);b=t(b,c,1)}return b})} function yh(a){var b,c;return E(function(d){switch(d.a){case 1:return a.c=a.h.pe(a.c,a.f,a.a.node,a.a.payload),x(d,2),a.b=a.h.ee(a.c,a.f,a.a.payload),t(d,a.b.promise,4);case 4:a.b=null;a.c==a.a.node&&(a.a.ta.fc(),a.a=null);xa(d,0);break;case 2:b=y(d);if(7001==b.code)a.a.ta.Ta();else a.a.ta.onError(b);a.a=null;a.b=null;c=a;return t(d,a.h.handleError(a.f,b),5);case 5:c.c=d.b,w(d)}})}function wh(a){a.j&&(a.j.resolve(),a.j=null)};function zh(a){this.a=null;for(var b=q(Array.from(a.textTracks)),c=b.next();!c.done;c=b.next())c=c.value,c.mode="disabled","Shaka Player TextTrack"==c.label&&(this.a=c);this.a||(this.a=a.addTextTrack("subtitles","Shaka Player TextTrack"));this.a.mode="hidden"}p=zh.prototype;p.remove=function(a,b){if(!this.a)return!1;Ah(this.a,function(c){return c.startTimea});return!0}; p.append=function(a){var b=[];a=q(a);for(var c=a.next();!c.done;c=a.next())c=c.value,c.nestedCues.length?b=b.concat(c.nestedCues):b.push(c);var d=[];a=this.a.cues?Array.from(this.a.cues):[];c={};b=q(b);for(var e=b.next();!e.done;c={bb:c.bb},e=b.next())c.bb=e.value,a.some(function(f){return function(g){return g.startTime==f.bb.startTime&&g.endTime==f.bb.endTime&&g.text==f.bb.payload?!0:!1}}(c))||(e=Bh(c.bb))&&d.push(e);b=d.slice().sort(function(f,g){return f.startTime!=g.startTime?f.startTime-g.startTime: f.endTime!=g.endTime?f.endTime-g.startTime:d.indexOf(g)-d.indexOf(f)});b=q(b);for(c=b.next();!c.done;c=b.next())this.a.addCue(c.value)};p.destroy=function(){this.a&&(Ah(this.a,function(){return!0}),this.a.mode="disabled");this.a=null;return Promise.resolve()};p.isTextVisible=function(){return"showing"==this.a.mode};p.setTextVisibility=function(a){this.a.mode=a?"showing":"hidden"}; function Bh(a){if(a.startTime>=a.endTime)return null;var b=new VTTCue(a.startTime,a.endTime,a.payload);b.lineAlign=a.lineAlign;b.positionAlign=a.positionAlign;a.size&&(b.size=a.size);try{b.align=a.textAlign}catch(c){}"center"==a.textAlign&&"center"!=b.align&&(b.align="middle");"vertical-lr"==a.writingMode?b.vertical="lr":"vertical-rl"==a.writingMode&&(b.vertical="rl");1==a.lineInterpretation&&(b.snapToLines=!1);null!=a.line&&(b.line=a.line);null!=a.position&&(b.position=a.position);return b} function Ah(a,b){var c=a.mode;a.mode="showing"==c?"showing":"hidden";for(var d=q(Array.from(a.cues)),e=d.next();!e.done;e=d.next())(e=e.value)&&b(e)&&a.removeCue(e);a.mode=c}K("shaka.text.SimpleTextDisplayer",zh);zh.prototype.setTextVisibility=zh.prototype.setTextVisibility;zh.prototype.isTextVisible=zh.prototype.isTextVisible;zh.prototype.destroy=zh.prototype.destroy;zh.prototype.append=zh.prototype.append;zh.prototype.remove=zh.prototype.remove;function Ch(){}K("shaka.util.Dom",Ch);Ch.removeAllChildren=function(a){for(;a.firstChild;)a.removeChild(a.firstChild)};function Dh(a,b){var c=this;this.h=!1;this.f=[];this.a=a;this.g=b;this.b=document.createElement("div");this.b.classList.add("shaka-text-container");this.g.appendChild(this.b);this.j=(new L(function(){Eh(c)})).xa(.25);this.c=new Map}p=Dh.prototype; p.append=function(a){var b={};a=q(a);for(var c=a.next();!c.done;b={ab:b.ab},c=a.next())b.ab=c.value,this.f.some(function(d){return function(e){return e.payload==d.ab.payload&&e.startTime==d.ab.startTime&&e.endTime==d.ab.endTime?!0:!1}}(b))||this.f.push(b.ab);Eh(this)};p.destroy=function(){this.g.removeChild(this.b);this.b=null;this.h=!1;this.f=[];this.j&&this.j.stop();this.c.clear()}; p.remove=function(a,b){if(!this.b)return!1;this.f=this.f.filter(function(c){return c.startTime=b});Eh(this);return!0};p.isTextVisible=function(){return this.h};p.setTextVisibility=function(a){this.h=a}; function Eh(a){function b(g){return a.f.includes(g)&&a.h&&g.startTime<=c&&g.endTime>=c}for(var c=a.a.currentTime,d=q(a.c.keys()),e=d.next();!e.done;e=d.next())if(e=e.value,!b(e)){var f=a.c.get(e);a.b.removeChild(f);a.c["delete"](e)}d=new Set(a.c.values());e=q(Array.from(a.b.childNodes));for(f=e.next();!f.done;f=e.next())f=f.value,d.has(f)||a.b.removeChild(f);d=a.f.filter(function(g){return b(g)&&!a.c.has(g)}).sort(function(g,h){return g.startTime!=h.startTime?g.startTime-h.startTime:g.endTime-h.endTime}); d=q(d);for(e=d.next();!e.done;e=d.next())Fh(a,a.b,e.value)}function Gh(a,b,c){var d=document.createElement("span");c.spacer?d.style.display="block":Hh(a,d,c,!0);b.appendChild(d);return d}function Fh(a,b,c){if(c.nestedCues.length){var d=document.createElement("p");d.style.width="100%";Hh(a,d,c,!1);for(var e=0;ee)break;if(0==e||"\\"!=a[e-1])f=a.substring(f,e).replace(/\\\./g,"."),d[f]={},d=d[f],f=e+1;e+=1}d[a.substring(f).replace(/\\\./g,".")]=b;return c}K("shaka.util.ConfigUtils",Jh);Jh.convertToConfigObject=Lh;Jh.mergeConfigObjects=Kh;function Mh(){} function Nh(){var a=1E6,b=Infinity;navigator.connection&&(a=1E6*navigator.connection.downlink,navigator.connection.saveData&&(b=360));var c={retryParameters:Db(),servers:{},clearKeys:{},advanced:{},delayLicenseRequestUntilPlayed:!1,initDataTransform:Qd,logLicenseExchange:!1,updateExpirationTime:1},d={retryParameters:Db(),availabilityWindowOverride:NaN,disableAudio:!1,disableVideo:!1,disableText:!1,defaultPresentationDelay:0,lowLatencyMode:!1,dash:{clockSyncUri:"",ignoreDrmInfo:!1,xlinkFailGracefully:!1,ignoreMinBufferTime:!1, autoCorrectDrift:!0,initialSegmentLimit:1E3,ignoreSuggestedPresentationDelay:!1,ignoreEmptyAdaptationSet:!1},hls:{ignoreTextStreamFailures:!1,useFullSegmentsForStartTime:!1}},e={retryParameters:Db(),failureCallback:function(h){return[h]},rebufferingGoal:2,bufferingGoal:10,bufferBehind:30,ignoreTextStreamFailures:!1,alwaysStreamText:!1,startAtSegmentBoundary:!1,smallGapLimit:.5,jumpLargeGaps:!1,durationBackoff:1,forceTransmuxTS:!1,safeSeekOffset:5,stallEnabled:!0,stallThreshold:1,stallSkip:.1,useNativeHlsOnSafari:!0, inaccurateManifestTolerance:2};Zc("Web0S")&&(e.stallEnabled=!1);var f={trackSelectionCallback:function(h){return E(function(k){return k["return"](h)})},progressCallback:function(h,k){return[h,k]},usePersistentLicense:!0},g={drm:c,manifest:d,streaming:e,offline:f,abrFactory:function(){return new yf},abr:{enabled:!0,defaultBandwidthEstimate:a,switchInterval:8,bandwidthUpgradeTarget:.85,bandwidthDowngradeTarget:.95,restrictions:{minWidth:0,maxWidth:Infinity,minHeight:0,maxHeight:b,minPixels:0,maxPixels:Infinity, minFrameRate:0,maxFrameRate:Infinity,minBandwidth:0,maxBandwidth:Infinity}},preferredAudioLanguage:"",preferredTextLanguage:"",preferredVariantRole:"",preferredTextRole:"",preferredAudioChannelCount:2,restrictions:{minWidth:0,maxWidth:Infinity,minHeight:0,maxHeight:Infinity,minPixels:0,maxPixels:Infinity,minFrameRate:0,maxFrameRate:Infinity,minBandwidth:0,maxBandwidth:Infinity},playRangeStart:0,playRangeEnd:Infinity,textDisplayFactory:function(){return null}};f.trackSelectionCallback=function(h){return E(function(k){return k["return"](Oh(h, g.preferredAudioLanguage))})};return g}function Ph(a,b,c){var d={".drm.servers":"",".drm.clearKeys":"",".drm.advanced":{distinctiveIdentifierRequired:!1,persistentStateRequired:!1,videoRobustness:"",audioRobustness:"",serverCertificate:new Uint8Array(0),individualizationServer:""}};return Kh(a,b,c||Nh(),d,"")} function Oh(a,b){var c=a.filter(function(h){return"variant"==h.type}),d=[],e=hf(b,c.map(function(h){return h.language}));e&&(d=c.filter(function(h){return bf(h.language)==e}));0==d.length&&(d=c.filter(function(h){return h.primary}));0==d.length&&(c.map(function(h){return h.language}),d=c);var f=d.filter(function(h){return h.height&&480>=h.height});f.length&&(f.sort(function(h,k){return k.height-h.height}),d=f.filter(function(h){return h.height==f[0].height}));c=[];if(d.length){var g=Math.floor(d.length/ 2);d.sort(function(h,k){return h.bandwidth-k.bandwidth});c.push(d[g])}d=q(a);for(g=d.next();!g.done;g=d.next())g=g.value,"text"==g.type&&c.push(g);return c}K("shaka.util.PlayerConfiguration",Mh);Mh.mergeConfigObjects=Ph;function Qh(){this.a=null;this.b=[]}function Rh(a,b){if(null==a.a)a.a={timestamp:Date.now()/1E3,state:b,duration:0};else{var c=Date.now()/1E3;a.a.duration=c-a.a.timestamp;a.a.state!=b&&(a.b.push(a.a),a.a={timestamp:c,state:b,duration:0})}}function Sh(a,b){var c=0;a.a&&a.a.state==b&&(c+=a.a.duration);for(var d=q(a.b),e=d.next();!e.done;e=d.next())e=e.value,c+=e.state==b?e.duration:0;return c} function Th(a){function b(f){return{timestamp:f.timestamp,state:f.state,duration:f.duration}}for(var c=[],d=q(a.b),e=d.next();!e.done;e=d.next())c.push(b(e.value));a.a&&c.push(b(a.a));return c};function Uh(){this.b=this.c=null;this.a=[]}function Vh(a,b,c){a.c!=b&&(a.c=b,a.a.push({timestamp:Date.now()/1E3,id:b.id,type:"variant",fromAdaptation:c,bandwidth:b.bandwidth}))}function Wh(a,b,c){a.b!=b&&(a.b=b,a.a.push({timestamp:Date.now()/1E3,id:b.id,type:"text",fromAdaptation:c,bandwidth:null}))};function Xh(){this.g=this.h=this.w=this.l=this.C=this.c=this.v=this.f=this.G=this.H=this.I=this.j=this.M=NaN;this.b=new Qh;this.a=new Uh};function U(a,b){Yb.call(this);var c=this;this.g=Yh;this.Yb=this.a=null;this.T=!1;this.b=new sc;this.yc=this.j=this.wb=this.m=this.Wb=this.l=this.c=this.Xb=this.C=this.Tb=this.w=this.za=this.v=this.G=this.h=this.N=null;this.od=1E9;this.i=Zh(this);this.Ec={width:Infinity,height:Infinity};this.f=null;this.xb=new Ff(this.i.preferredAudioLanguage,this.i.preferredVariantRole,this.i.preferredAudioChannelCount);this.ca=this.i.preferredTextLanguage;this.Ub=this.i.preferredTextRole;this.zc=[];b&&b(this);this.N= $h(this);this.H=null;ai&&(this.H=Lc(ai));this.b.o(window,"online",function(){c.$c()});this.da={name:"detach"};this.Ca={name:"attach"};this.M={name:"unload"};this.pc={name:"manifest-parser"};this.Dc={name:"manifest"};this.pa={name:"media-source"};this.Ac={name:"drm-engine"};this.I={name:"load"};this.Fc={name:"src-equals-drm-engine"};this.Aa={name:"src-equals"};var d=new Map;d.set(this.Ca,function(e,f){return Mb(bi(c,e,f))});d.set(this.da,function(e){e.A&&(c.b.oa(e.A,"error"),e.A=null);c.a=null;e=Promise.resolve(); return Mb(e)});d.set(this.M,function(e){return Mb(ci(c,e))});d.set(this.pa,function(e){e=di(c,e);return Mb(e)});d.set(this.pc,function(e,f){var g=ei(c,e,f);return Mb(g)});d.set(this.Dc,function(e){return fi(c,e)});d.set(this.Ac,function(){var e=gi(c);return Mb(e)});d.set(this.I,function(e,f){return Mb(hi(c,e,f))});d.set(this.Fc,function(e){e=ii(c,e);return Mb(e)});d.set(this.Aa,function(e,f){return ji(c,e,f)});this.W=new sh(this.da,{pe:function(e,f,g,h){var k=null;e==c.da&&(k=g==c.da?c.da:c.Ca);e== c.Ca&&(k=g==c.da||f.A!=h.A?c.da:g==c.Ca?c.Ca:g==c.pa||g==c.I?c.pa:g==c.Aa?c.Fc:null);e==c.pa&&(k=g==c.I&&f.A==h.A?c.pc:c.M);e==c.pc&&(k=ki(c.I,c.Dc,c.M,g,f,h));e==c.Dc&&(k=ki(c.I,c.Ac,c.M,g,f,h));e==c.Ac&&(k=ki(c.I,c.I,c.M,g,f,h));e==c.Fc&&(k=g==c.Aa&&f.A==h.A?c.Aa:c.M);if(e==c.I||e==c.Aa)k=c.M;e==c.M&&(k=h.A&&f.A==h.A?c.Ca:c.da);return k},ee:function(e,f,g){c.dispatchEvent(li(mi,{state:e.name}));return d.get(e)(f,g)},handleError:function(e){return E(function(f){return 1==f.a?t(f,ci(c,e),2):f["return"](e.A? c.Ca:c.da)})},Fe:function(e){c.dispatchEvent(li(ni,{state:e.name}))}});a&&this.yb(a,!0)}sa(U,Yb);function li(a,b){return new R(a,b)}p=U.prototype; p.destroy=function(){var a=this,b;return E(function(c){switch(c.a){case 1:if(a.g==oi)return c["return"]();a.g=oi;b=xh(a.W,function(){return{node:a.da,payload:th(),Qa:!1}});return t(c,new Promise(function(d){b.nb=function(){};b.fc=function(){d()};b.Ta=function(){d()};b.onError=function(){d()};b.ic=function(){d()}}),2);case 2:return t(c,a.W.destroy(),3);case 3:a.b&&(a.b.release(),a.b=null);a.yc=null;a.j=null;a.i=null;a.f=null;a.Yb=null;if(!a.N){c.u(0);break}return t(c,a.N.destroy(),5);case 5:a.N=null, w(c)}})};p.yb=function(a,b){b=void 0===b?!0:b;if(this.g==oi)return Promise.reject(pi());var c=th();c.A=a;Vc()||(b=!1);var d=b?this.pa:this.Ca,e=xh(this.W,function(){return{node:d,payload:c,Qa:!1}});e.nb=function(){};return qi(e)};p.detach=function(){var a=this;if(this.g==oi)return Promise.reject(pi());var b=xh(this.W,function(){return{node:a.da,payload:th(),Qa:!1}});b.nb=function(){};return qi(b)}; p.ld=function(a){var b=this;a=void 0===a?!0:a;if(this.g==oi)return Promise.reject(pi());Vc()||(a=!1);var c=th(),d=xh(this.W,function(e){var f=e.A&&a?b.pa:e.A?b.Ca:b.da;c.A=e.A;return{node:f,payload:c,Qa:!1}});d.nb=function(){};return qi(d)}; p.load=function(a,b,c){var d=this;if(this.g==oi)return Promise.reject(pi());this.dispatchEvent(li(ri));var e=th();e.uri=a;e.hd=Date.now()/1E3;c&&(e.mimeType=c);void 0!==b&&(e.startTime=b);var f=si(this,e)?this.Aa:this.I,g=xh(this.W,function(h){if(null==h.A)return null;e.A=h.A;return{node:f,payload:e,Qa:!0}});this.f=new Xh;g.nb=function(){};return new Promise(function(h,k){g.ic=function(){return k(new M(N,Fb,7002))};g.fc=function(){h();d.dispatchEvent(li(ti))};g.Ta=function(){return k(pi())};g.onError= function(l){return k(l)}})}; function si(a,b){if(!Vc())return!0;var c=b.mimeType,d=b.uri||"";c||(c={mp4:"video/mp4",m4v:"video/mp4",m4a:"audio/mp4",webm:"video/webm",weba:"audio/webm",mkv:"video/webm",ts:"video/mp2t",ogv:"video/ogg",ogg:"audio/ogg",mpg:"video/mpeg",mpeg:"video/mpeg",m3u8:"application/x-mpegurl",mp3:"audio/mpeg",aac:"audio/aac",flac:"audio/flac",wav:"audio/wav"}[Qf(d)]);return c?""==(b.A||Xc()).canPlayType(c)?!1:Vc()&&(c in Pf||Qf(d)in Rf)?Yc()&&a.i.streaming.useNativeHlsOnSafari:!0:!1} function bi(a,b,c){null==b.A&&(b.A=c.A,a.b.o(b.A,"error",function(){var d=ui(a);d&&vi(a,d)}));a.a=b.A;return Promise.resolve()} function ci(a,b){var c,d,e,f,g,h,k,l,m;return E(function(n){switch(n.a){case 1:return a.g!=oi&&(a.g=Yh),c=a.zc.map(function(r){return r()}),a.zc=[],t(n,Promise.all(c),2);case 2:a.dispatchEvent(li(wi));b.mimeType=null;b.startTime=null;b.uri=null;b.A&&(a.b.oa(b.A,"loadedmetadata"),a.b.oa(b.A,"playing"),a.b.oa(b.A,"pause"),a.b.oa(b.A,"ended"),a.b.oa(b.A,"ratechange"));a.za&&(a.za.release(),a.za=null);a.Tb&&(a.Tb.stop(),a.Tb=null);if(!a.l){n.u(3);break}return t(n,a.l.stop(),4);case 4:a.l=null,a.Wb=null; case 3:if(!a.j){n.u(5);break}return t(n,a.j.stop(),5);case 5:if(!a.c){n.u(7);break}return t(n,a.c.destroy(),8);case 8:a.c=null;case 7:a.w&&(a.w.release(),a.w=null);a.v&&(a.v.release(),a.v=null);if(!a.G){n.u(9);break}return t(n,a.G.destroy(),10);case 10:a.G=null;case 9:if(a.H)a.H.onAssetUnload();if(!b.A||!b.A.src){n.u(11);break}return t(n,new Promise(function(r){return(new L(r)).R(.1)}),12);case 12:b.A.removeAttribute("src"),b.A.load();case 11:if(!a.h){n.u(13);break}return t(n,a.h.destroy(),14);case 14:a.h= null;case 13:a.wb=null;a.C=null;if(a.m){d=q(a.m.variants);for(e=d.next();!e.done;e=d.next())for(f=e.value,g=q([f.audio,f.video]),h=g.next();!h.done;h=g.next())(k=h.value)&&k.segmentIndex&&k.segmentIndex.release();l=q(a.m.textStreams);for(h=l.next();!h.done;h=l.next())m=h.value,m.segmentIndex&&m.segmentIndex.release()}a.m=null;a.f=new Xh;a.Bc=null;xi(a);w(n)}})} function di(a,b){var c,d,e,f,g;return E(function(h){if(1==h.a)return c=window.muxjs?new Zd:new $d,d=a.i.textDisplayFactory,e=Lc(d),a.Bc=d,f=function(k,l){if(a.H)a.H.onHlsTimedMetadata(k,l)},g=new He(b.A,c,e,f),t(h,g.w,2);a.G=g;w(h)})} function ei(a,b,c){var d,e,f,g;return E(function(h){if(1==h.a)return b.mimeType=c.mimeType,b.uri=c.uri,d=b.uri,e=a.N,a.wb=d,f=a,t(h,Of(d,e,a.i.manifest.retryParameters,b.mimeType),2);f.Wb=h.b;a.l=Lc(a.Wb);g=Zb(a.i.manifest);c.A&&"AUDIO"===c.A.nodeName&&(g.disableVideo=!0);a.l.configure(g);w(h)})} function fi(a,b){var c=b.uri,d=a.N;a.Xb=new vg;wg(a.Xb,function(g){yi(a,zi,g);if(a.H)a.H.onDashTimedMetadata(g)});var e={networkingEngine:d,filter:function(g){return E(function(h){return h["return"](a.fb(g))})},onTimelineRegionAdded:function(g){var h=a.Xb;a:{var k=q(h.a);for(var l=k.next();!l.done;l=k.next())if(l=l.value,l.schemeIdUri==g.schemeIdUri&&l.id==g.id&&l.startTime==g.startTime&&l.endTime==g.endTime){k=l;break a}k=null}null==k&&(h.a.add(g),h.b(g))},onEvent:function(g){return a.dispatchEvent(g)}, onError:function(g){return vi(a,g)}},f=Date.now()/1E3;return new Ib(function(){var g,h,k,l;return E(function(m){if(1==m.a)return g=a,t(m,a.l.start(c,e),2);g.m=m.b;h=li(Ai);a.dispatchEvent(h);if(0==a.m.variants.length)throw new M(N,4,4036);Bi(a.m);k=Date.now()/1E3;l=k-f;a.f.v=l;w(m)})}(),function(){return a.l.stop()})} function gi(a){var b,c;return E(function(d){if(1==d.a)return b=Date.now()/1E3,c=!0,a.h=Ci(a,{lb:a.N,onError:function(e){vi(a,e)},hc:function(e){Di(a,e)},onExpirationUpdated:function(e,f){Ei(a,e,f)},onEvent:function(e){a.dispatchEvent(e);e.type==Fi&&c&&(c=!1,a.f.c=Date.now()/1E3-b)}}),a.h.configure(a.i.drm),t(d,wd(a.h,a.m.variants,a.m.offlineSessionIds),2);a.fb(a.m);w(d)})} function hi(a,b,c){var d,e,f,g,h,k,l,m,n,r;return E(function(u){switch(u.a){case 1:return b.startTime=c.startTime,d=b.A,e=b.uri,a.wb=e,a.w=new Tf({dc:function(){return b.A.playbackRate},fd:function(v){b.A.playbackRate=v},Dd:function(v){b.A.currentTime+=v}}),f=function(){return Gi(a)},g=function(){return Hi(a)},a.b.o(d,"playing",f),a.b.o(d,"pause",f),a.b.o(d,"ended",f),a.b.o(d,"ratechange",g),h=a.i.abrFactory,a.j&&a.yc==h||(a.yc=h,a.j=Lc(h),"function"!=typeof a.j.playbackRateChanged&&(Ec("AbrManager", "Please use an AbrManager with playbackRateChanged function."),a.j.playbackRateChanged=function(){}),a.j.configure(a.i.abr)),Ii(a),a.xb=new Ff(a.i.preferredAudioLanguage,a.i.preferredVariantRole,a.i.preferredAudioChannelCount),a.ca=a.i.preferredTextLanguage,Ji(a.m.presentationTimeline,a.i.playRangeStart,a.i.playRangeEnd),t(u,a.h.yb(d),2);case 2:a.j.init(function(v,z,A){z=void 0===z?!1:z;A=void 0===A?0:A;a.c&&v!=a.c.b&&(Vh(a.f.a,v,!0),bh(a.c,v,z,A),Ki(a))});a.v=Li(a,b.startTime);a.za=Mi(a);k=Math.max(a.m.minBufferTime, a.i.streaming.rebufferingGoal);Ni(a,k);jf(a.m,a.i.preferredAudioChannelCount);a.c=Oi(a);a.c.configure(a.i.streaming);a.g=Pi;a.dispatchEvent(li(Qi));l=Ri(a)?a.j.chooseVariant():null;Vh(a.f.a,l,!0);bh(a.c,l,!1,0);(m=wf(a.m.textStreams,a.ca,a.Ub)[0]||null)&&Wh(a.f.a,m,!0);m?(l.audio&&Si(a,l.audio,m)&&(a.T=!0),a.T&&a.G.h.setTextVisibility(!0),Ti(a)):a.T=!1;m&&(a.i.streaming.alwaysStreamText||a.Lc())&&ch(a.c,m);if(!a.i.streaming.startAtSegmentBoundary){u.u(3);break}n=a.v.g();return t(u,Ui(l,n),4);case 4:r= u.b,a.v.l(r);case 3:return t(u,a.c.start(),5);case 5:a.i.abr.enabled&&(a.j.enable(),Vi(a)),a.fb(a.m),Wi(a),Ki(a),Ri(a),a.m.variants.some(function(v){return v.primary}),a.b.ha(d,"loadedmetadata",function(){a.f.f=Date.now()/1E3-c.hd}),w(u)}})} function ii(a,b){var c,d,e,f;return E(function(g){return 1==g.a?(c=Oc,d=Date.now()/1E3,e=!0,a.h=Ci(a,{lb:a.N,onError:function(h){vi(a,h)},hc:function(h){Di(a,h)},onExpirationUpdated:function(h,k){Ei(a,h,k)},onEvent:function(h){a.dispatchEvent(h);h.type==Fi&&e&&(e=!1,a.f.c=Date.now()/1E3-d)}}),a.h.configure(a.i.drm),f={id:0,language:"und",primary:!1,audio:null,video:{id:0,originalId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:null,mimeType:"video/mp4",codecs:"",encrypted:!0, drmInfos:[],keyIds:new Set,language:"und",label:null,type:c.Ba,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],channelsCount:null,audioSamplingRate:null,closedCaptions:null},bandwidth:100,allowedByApplication:!0,allowedByKeySystem:!0},t(g,wd(a.h,[f],[]),2)):t(g,a.h.yb(b.A),0)})} function ji(a,b,c){function d(){return Gi(a)}b.uri=c.uri;b.startTime=c.startTime;a.wb=b.uri;a.v=new jg(b.A);null!=b.startTime&&a.v.l(b.startTime);a.w=new Tf({dc:function(){return b.A.playbackRate},fd:function(g){b.A.playbackRate=g},Dd:function(g){b.A.currentTime+=g}});Ni(a,a.i.streaming.rebufferingGoal);a.b.o(b.A,"playing",d);a.b.o(b.A,"pause",d);a.b.o(b.A,"ended",d);a.b.o(b.A,"ratechange",function(){return Hi(a)});"none"!=a.a.preload&&a.b.ha(a.a,"loadedmetadata",function(){a.f.f=Date.now()/1E3-c.hd}); a.a.audioTracks&&(a.b.o(a.a.audioTracks,"addtrack",function(){return Wi(a)}),a.b.o(a.a.audioTracks,"removetrack",function(){return Wi(a)}),a.b.o(a.a.audioTracks,"change",function(){return Wi(a)}));a.a.textTracks&&(a.b.o(a.a.textTracks,"addtrack",function(g){Wi(a);Xi(a,g)}),a.b.o(a.a.textTracks,"removetrack",function(){return Wi(a)}),a.b.o(a.a.textTracks,"change",function(){return Wi(a)}));b.A.src=b.uri;a.g=Yi;a.dispatchEvent(li(Qi));var e=new Hb;ag(a.a,HTMLMediaElement.HAVE_METADATA,a.b,function(){e.resolve()}); var f=!1;a.zc.push(function(){f=!0});ag(a.a,HTMLMediaElement.HAVE_CURRENT_DATA,a.b,function(){var g;return E(function(h){if(1==h.a){if(f)return h["return"]();Zi(a);g=$i(a);return g.find(function(k){return"disabled"!=k.mode})?h.u(2):t(h,new Promise(function(k){a.b.ha(a.a.textTracks,"change",k);(new L(k)).R(1)}),2)}if(f)return h["return"]();aj(a);w(h)})});a.a.error?e.reject(ui(a)):"none"==a.a.preload&&(ab('With