/* @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 q;function aa(a){var b=0;return function(){return b>>0)+"_",e=0;return b}); ia("Symbol.iterator",function(a){if(a)return a;a=Symbol("Symbol.iterator");for(var b="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),c=0;cf&&(f=Math.max(f+e,0));f=f}}); function Oa(a,b){a instanceof String&&(a+="");var c=0,d=!1,e={next:function(){if(!d&&cb||1342177279>>=1)c+=c;return d}});ia("Number.isNaN",function(a){return a?a:function(b){return"number"===typeof b&&isNaN(b)}});ia("Object.values",function(a){return a?a:function(b){var c=[],d;for(d in b)Ja(b,d)&&c.push(b[d]);return c}});ia("Math.log2",function(a){return a?a:function(b){return Math.log(b)/Math.LN2}}); ia("Object.entries",function(a){return a?a:function(b){var c=[],d;for(d in b)Ja(b,d)&&c.push([d,b[d]]);return c}});var Qa=this||self;function M(a,b){var c=a.split("."),d=Qa;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 Sa(a){this.g=Math.exp(Math.log(.5)/a);this.i=this.h=0}Sa.prototype.sample=function(a,b){var c=Math.pow(this.g,a);c=b*(1-c)+c*this.h;isNaN(c)||(this.h=c,this.i+=a)};function Ta(a){return a.h/(1-Math.pow(a.g,a.i))};function Ua(){this.h=new Sa(2);this.j=new Sa(5);this.g=0;this.i=128E3;this.l=16E3}Ua.prototype.configure=function(a){this.i=a.minTotalBytes;this.l=a.minBytes;this.h.g=Math.exp(Math.log(.5)/a.fastHalfLife);this.j.g=Math.exp(Math.log(.5)/a.slowHalfLife)};Ua.prototype.sample=function(a,b){if(!(bb)throw Error("Bad port number "+b);a.Kb=b}else a.Kb=null}function fc(a,b,c){b instanceof hc?a.g=b:(c||(b=ic(b,nc)),a.g=new hc(b))} function gc(a,b){return a?b?decodeURI(a):decodeURIComponent(a):""}function ic(a,b,c){return null!=a?(a=encodeURI(a).replace(b,oc),c&&(a=a.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),a):null}function oc(a){a=a.charCodeAt(0);return"%"+(a>>4&15).toString(16)+(a&15).toString(16)}var jc=/[#\/\?@]/g,lc=/[#\?:]/g,kc=/[#\?]/g,nc=/[#\?@]/g,mc=/#/g;function hc(a){this.g=a||null} function pc(a){if(!a.na&&(a.na={},a.Bc=0,a.g))for(var b=a.g.split("&"),c=0;c=c[d]}if(!a)return"";var c=Lb(a);if(239==c[0]&&187==c[1]&&191==c[2])return Ac(c);if(254==c[0]&&255==c[1])return Bc(c.subarray(2),!1);if(255==c[0]&&254==c[1])return Bc(c.subarray(2),!0);if(0==c[0]&&0==c[2])return Bc(a,!1);if(0==c[1]&&0==c[3])return Bc(a,!0);if(b(0)&&b(1)&&b(2)&&b(3))return Ac(a);throw new N(2,2,2003);}function Ec(a){var b=new TextEncoder;return Mb(b.encode(a))} function Fc(a,b){for(var c=new ArrayBuffer(2*a.length),d=new DataView(c),e=r(Gb(a)),f=e.next();!f.done;f=e.next())f=f.value,d.setUint16(2*f.ca,f.item.charCodeAt(0),b);return c}M("shaka.util.StringUtils",zc);zc.resetFromCharCode=function(){Cc.g=void 0};zc.toUTF16=Fc;zc.toUTF8=Ec;zc.fromBytesAutoDetect=Dc;zc.fromUTF16=Bc;zc.fromUTF8=Ac; var Cc=new yc(function(){function a(c){try{var d=new Uint8Array(c);return 0>4).toString(16);e+=(g&15).toString(16);c=c.replace(d[0],e)}return c}function Rc(a,b){a.l=!0;a.h=new xc;a.m=[];a.j=[];a.i=[];var c=Lb(b);a.g.push(c);a.g.flush();a.l&&a.h.reject(new N(2,3,3018));return a.h};function Sc(a,b){var c=a;b&&(c+='; codecs="'+b+'"');return c}function Tc(a,b,c){a=Sc(a,b);return Zb.get("muxjs")()&&Pc(a)?Qc(c,a):a}function Uc(a){a=a.split(".");var b=a[0];a.pop();return b}function Vc(a){a=a.split(/ *; */);a.shift();return(a=a.find(function(b){return b.startsWith("codecs=")}))?a.split("=")[1].replace(/^"|"$/g,""):""}(new Map).set("codecs","codecs").set("frameRate","framerate").set("bandwidth","bitrate").set("width","width").set("height","height").set("channelsCount","channels");function Wc(a){this.j=null;this.i=a;this.l=this.u=0;this.m=Infinity;this.h=this.g=null;this.s="";this.o=new Map}function Xc(a){return Yc[a]||"application/cea-608"==a||"application/cea-708"==a?!0:!1}Wc.prototype.destroy=function(){this.i=this.j=null;this.o.clear();return Promise.resolve()}; function Zc(a,b,c,d){var e,f,g;return K(function(h){if(1==h.g)return u(h,Promise.resolve(),2);if(!a.j||!a.i)return h["return"]();if(null==c||null==d)return a.j.parseInit(Lb(b)),h["return"]();e={periodStart:a.u,segmentStart:c,segmentEnd:d};f=a.j.parseMedia(Lb(b),e);g=f.filter(function(k){return k.startTime>=a.l&&k.startTime=c.h||(a<=c.g&&b>=c.h?c.g=c.h=null:a<=c.g&&bc.g&&b>=c.h&&(c.h=a));z(d)})};function $c(a,b,c){a.l=b;a.m=c}function ad(a,b,c){a.s=b;if(b=a.o.get(b))for(var d=r(b.keys()),e=d.next();!e.done;e=d.next())(e=b.get(e.value).filter(function(f){return f.endTime<=c}))&&a.i.append(e)} function bd(a){var b=[];a=r(a);for(var c=a.next();!c.done;c=a.next())c=c.value,b.push({stream:c.stream,cue:new jb(c.startTime,c.endTime,c.text)});return b}function cd(a,b,c){b.startTime+=c;b.endTime+=c;b=r(b.nestedCues);for(var d=b.next();!d.done;d=b.next())cd(a,d.value,c)} function dd(a,b,c,d,e){var f=c+" "+d,g=new Map;b=r(b);for(var h=b.next();!h.done;h=b.next()){var k=h.value;h=k.stream;k=k.cue;g.has(h)||g.set(h,new Map);g.get(h).has(f)||g.get(h).set(f,[]);cd(a,k,e);k.startTime>=a.l&&k.startTimec?(d.g={},d.push(e,f),c=g):g==c&&d.push(e,f)});return d} function Ld(a){var b="",c=Infinity;pd(a,function(d,e){for(var f=0,g=0,h=r(e),k=h.next();!k.done;k=h.next())f+=k.value.bandwidth||0,++g;f/=g;f=g&&f<=h}var e=a.video;return e&&e.width&&e.height&&(!d(e.width,b.minWidth,Math.min(b.maxWidth,c.width))||!d(e.height,b.minHeight,Math.min(b.maxHeight,c.height))||!d(e.width*e.height,b.minPixels,b.maxPixels))||a&&a.video&&a.video.frameRate&&!d(a.video.frameRate,b.minFrameRate,b.maxFrameRate)||!d(a.bandwidth,b.minBandwidth,b.maxBandwidth)?!1:!0} function Od(a,b){return K(function(c){if(1==c.g)return u(c,Pd(b,0=g&&b<=f&&c.bandwidth!=e.bandwidth&&(c=e)}this.m=Date.now();return c}; q.enable=function(){this.j=!0};q.disable=function(){this.j=!1};q.segmentDownloaded=function(a,b){this.h.sample(a,b);if(null!=this.m&&this.j)a:{if(!this.s){var c=this.h;if(!(c.g>=c.i))break a;this.s=!0}else if(Date.now()-this.m<1E3*this.g.switchInterval)break a;c=this.chooseVariant();this.h.getBandwidthEstimate(qe(this));c&&this.l(c)}};q.getBandwidthEstimate=function(){return this.h.getBandwidthEstimate(this.g.defaultBandwidthEstimate)};q.setVariants=function(a){this.i=a}; q.playbackRateChanged=function(a){this.o=a};q.configure=function(a){this.g=a;this.h&&this.g&&this.h.configure(this.g.advanced)};function qe(a){var b=a.g.defaultBandwidthEstimate;navigator.connection&&navigator.connection.downlink&&a.g.useNetworkInformation&&(b=1E6*navigator.connection.downlink);return b}function pe(a,b){a&&(b=b.filter(function(c){return Nd(c,a,{width:Infinity,height:Infinity})}));return b.sort(function(c,d){return c.bandwidth-d.bandwidth})}M("shaka.abr.SimpleAbrManager",oe); oe.prototype.configure=oe.prototype.configure;oe.prototype.playbackRateChanged=oe.prototype.playbackRateChanged;oe.prototype.setVariants=oe.prototype.setVariants;oe.prototype.getBandwidthEstimate=oe.prototype.getBandwidthEstimate;oe.prototype.segmentDownloaded=oe.prototype.segmentDownloaded;oe.prototype.disable=oe.prototype.disable;oe.prototype.enable=oe.prototype.enable;oe.prototype.chooseVariant=oe.prototype.chooseVariant;oe.prototype.init=oe.prototype.init;oe.prototype.stop=oe.prototype.stop;function re(a,b){this.h=a;this.g=new Set([a]);b=b||[];for(var c=r(b),d=c.next();!d.done;d=c.next())this.add(d.value)}re.prototype.add=function(a){return se(this.h,a)?(this.g.add(a),!0):!1}; function se(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||2=a.l)if(a.i)a.g=1,a.h=a.j;else throw new N(2,7,1010);b=a.g;a.g++;if(0==b)return d["return"]();c=a.h*(1+(2*Math.random()-1)*a.o);return u(d,new Promise(function(e){(new O(e)).R(c/1E3)}),2)}a.h*=a.m;z(d)})}function Fe(){return{maxAttempts:2,baseDelay:1E3,backoffFactor:2,fuzzFactor:.5,timeout:3E4,stallTimeout:5E3,connectionTimeout:1E4}};function He(a,b){this.promise=a;this.i=b;this.g=!1}function Ie(a){return new He(Promise.reject(a),function(){return Promise.resolve()})}function Je(){var a=Promise.reject(new N(2,7,7001));a["catch"](function(){});return new He(a,function(){return Promise.resolve()})}function Ke(a){return new He(Promise.resolve(a),function(){return Promise.resolve()})}function Le(a){return new He(a,function(){return a["catch"](function(){})})}He.prototype.abort=function(){this.g=!0;return this.i()}; function Me(a){return new He(Promise.all(a.map(function(b){return b.promise})),function(){return Promise.all(a.map(function(b){return b.abort()}))})}He.prototype["finally"]=function(a){this.promise.then(function(){return a(!0)},function(){return a(!1)});return this}; He.prototype.aa=function(a,b){function c(h){return function(k){if(e.g&&h)f.reject(g);else{var l=h?a:b;l?d=Ne(l,k,f):(h?f.resolve:f.reject)(k)}}}function d(){f.reject(g);return e.abort()}var e=this,f=new xc,g=new N(2,7,7001);this.promise.then(c(!0),c(!1));return new He(f,function(){return d()})}; function Ne(a,b,c){try{var d=a(b);if(d&&d.promise&&d.abort)return c.resolve(d.promise),function(){return d.abort()};c.resolve(d);return function(){return Promise.resolve(d).then(function(){},function(){})}}catch(e){return c.reject(e),function(){return Promise.resolve()}}}M("shaka.util.AbortableOperation",He);He.prototype.chain=He.prototype.aa;He.prototype["finally"]=He.prototype["finally"];He.all=Me;He.prototype.abort=He.prototype.abort;He.notAbortable=Le;He.completed=Ke;He.aborted=Je;He.failed=Ie;function P(a,b){if(b)if(b instanceof Map)for(var c=r(b.keys()),d=c.next();!d.done;d=c.next())d=d.value,Object.defineProperty(this,d,{value:b.get(d),writable:!0,enumerable:!0});else for(c in b)Object.defineProperty(this,c,{value:b[c],writable:!0,enumerable:!0});this.defaultPrevented=this.cancelable=this.bubbles=!1;this.timeStamp=window.performance&&window.performance.now?window.performance.now():Date.now();this.type=a;this.isTrusted=!1;this.target=this.currentTarget=null;this.g=!1} function Oe(a){var b=new P(a.type),c;for(c in a)Object.defineProperty(b,c,{value:a[c],writable:!0,enumerable:!0});return b}P.prototype.preventDefault=function(){this.cancelable&&(this.defaultPrevented=!0)};P.prototype.stopImmediatePropagation=function(){this.g=!0};P.prototype.stopPropagation=function(){};M("shaka.util.FakeEvent",P);function R(){this.ga=new od;this.Cc=this}R.prototype.addEventListener=function(a,b){this.ga&&this.ga.push(a,b)};R.prototype.removeEventListener=function(a,b){this.ga&&this.ga.remove(a,b)};R.prototype.dispatchEvent=function(a){if(!this.ga)return!0;var b=this.ga.get(a.type)||[],c=this.ga.get("All");c&&(b=b.concat(c));b=r(b);for(c=b.next();!c.done;c=b.next()){c=c.value;a.target=this.Cc;a.currentTarget=this.Cc;try{c.handleEvent?c.handleEvent(a):c.call(this,a)}catch(d){}if(a.g)break}return a.defaultPrevented}; R.prototype.release=function(){this.ga=null};function Pe(a){function b(d){switch(typeof d){case "undefined":case "boolean":case "number":case "string":case "symbol":case "function":return d;default:if(!d||d.buffer&&d.buffer.constructor==ArrayBuffer)return d;if(c.has(d))return null;var e=d.constructor==Array;if(d.constructor!=Object&&!e)return null;c.add(d);var f=e?[]:{},g;for(g in d)f[g]=b(d[g]);e&&(f.length=d.length);return f}}var c=new Set;return b(a)}function Qe(a){var b={},c;for(c in a)b[c]=a[c];return b};function Re(){this.g=[]}function Se(a,b){a.g.push(b["finally"](function(){gb(a.g,b)}))}Re.prototype.destroy=function(){for(var a=[],b=r(this.g),c=b.next();!c.done;c=b.next())c=c.value,c.promise["catch"](function(){}),a.push(c.abort());this.g=[];return Promise.all(a)};function Te(a,b,c){R.call(this);this.i=!1;this.m=new Re;this.g=new Set;this.h=new Set;this.l=a||null;this.j=b||null;this.s=c||null;this.o=!1}ra(Te,R);q=Te.prototype;q.Od=function(a){this.o=a};function Ue(a,b,c,d){c=c||Ve;var e=We[a];if(!e||c>=e.priority)We[a]={priority:c,Hf:b,Jf:void 0===d?!1:d}}q.Kf=function(a){this.g.add(a)};q.ag=function(a){this.g["delete"](a)};q.Oe=function(){this.g.clear()};q.Lf=function(a){this.h.add(a)};q.bg=function(a){this.h["delete"](a)};q.Pe=function(){this.h.clear()}; function Xe(a,b,c){return{uris:a,method:"GET",body:null,headers:{},allowCrossSiteCredentials:!1,retryParameters:b,licenseRequestType:null,sessionId:null,drmInfo:null,initData:null,initDataType:null,streamDataCallback:void 0===c?null:c}}q.destroy=function(){this.i=!0;this.g.clear();this.h.clear();R.prototype.release.call(this);return this.m.destroy()}; q.request=function(a,b){var c=this,d=new Ye;if(this.i){var e=Promise.reject(new N(2,7,7001));e["catch"](function(){});return new Ze(e,function(){return Promise.resolve()},d)}b.method=b.method||"GET";b.headers=b.headers||{};b.retryParameters=b.retryParameters?Pe(b.retryParameters):Fe();b.uris=Pe(b.uris);e=$e(this,a,b);var f=e.aa(function(){return af(c,a,b,new Ee(b.retryParameters,!1),0,null,d)}),g=f.aa(function(n){return bf(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.aa(function(n){var p=Date.now()-l,t=n.response;t.timeMs+=k;t.timeMs+=p;n.wf||!c.l||t.fromCache||a!=cf||c.l(t.timeMs,t.data.byteLength);return t},function(n){n&&(n.severity=2);throw n;});e=new Ze(m.promise,function(){return m.abort()},d);Se(this.m,e);return e}; function $e(a,b,c){var d=Ke(void 0),e={};a=r(a.g);for(var f=a.next();!f.done;e={dd:e.dd},f=a.next())e.dd=f.value,d=d.aa(function(g){return function(){c.body&&(c.body=Mb(c.body));return g.dd(b,c)}}(e));return d.aa(void 0,function(g){if(g instanceof N&&7001==g.code)throw g;throw new N(2,1,1006,g);})} function af(a,b,c,d,e,f,g){a.o&&(c.uris[e]=c.uris[e].replace("http://","https://"));var h=new cc(c.uris[e]),k=h.Fa,l=!1;k||(k=location.protocol,k=k.slice(0,-1),dc(h,k),c.uris[e]=h.toString());k=k.toLowerCase();var m=(k=We[k])?k.Hf:null;if(!m)return Ie(new N(2,1,1E3,h));var n=k.Jf,p=null,t=null,v=!1,y=!1,x;return Le(Ge(d)).aa(function(){if(a.i)return Je();x=Date.now();var w=m(c.uris[e],c,b,function(A,E,G){p&&p.stop();t&&t.R(D/1E3);a.l&&b==cf&&(a.l(A,E),l=!0,g.g=G)},function(A){a.j&&a.j(A,c,b);y=!0}); if(!n)return w;var C=c.retryParameters.connectionTimeout;C&&(p=new O(function(){v=!0;w.abort()}),p.R(C/1E3));var D=c.retryParameters.stallTimeout;D&&(t=new O(function(){v=!0;w.abort()}));return w}).aa(function(w){p&&p.stop();t&&t.stop();void 0==w.timeMs&&(w.timeMs=Date.now()-x);var C={response:w,wf:l};!y&&a.j&&a.j(w.headers,c,b);return C},function(w){p&&p.stop();t&&t.stop();if(a.s){var C=null,D=0;w instanceof N&&(C=w,1001==w.code&&(D=w.data[1]));a.s(c,C,D,v)}if(a.i)return Je();v&&(w=new N(1,1,1003, c.uris[e],b));if(w instanceof N){if(7001==w.code)throw w;if(1010==w.code)throw f;if(1==w.severity)return C=(new Map).set("error",w),C=new P("retry",C),a.dispatchEvent(C),e=(e+1)%c.uris.length,af(a,b,c,d,e,w,g)}throw w;})} function bf(a,b,c){var d=Ke(void 0),e={};a=r(a.h);for(var f=a.next();!f.done;e={ed:e.ed},f=a.next())e.ed=f.value,d=d.aa(function(g){return function(){var h=c.response;h.data&&(h.data=Mb(h.data));return g.ed(b,h)}}(e));return d.aa(function(){return c},function(g){var h=2;if(g instanceof N){if(7001==g.code)throw g;h=g.severity}throw new N(h,1,1007,g);})}M("shaka.net.NetworkingEngine",Te);Te.prototype.request=Te.prototype.request;Te.prototype.destroy=Te.prototype.destroy;Te.makeRequest=Xe; Te.defaultRetryParameters=function(){return Fe()};Te.prototype.clearAllResponseFilters=Te.prototype.Pe;Te.prototype.unregisterResponseFilter=Te.prototype.bg;Te.prototype.registerResponseFilter=Te.prototype.Lf;Te.prototype.clearAllRequestFilters=Te.prototype.Oe;Te.prototype.unregisterRequestFilter=Te.prototype.ag;Te.prototype.registerRequestFilter=Te.prototype.Kf;Te.unregisterScheme=function(a){delete We[a]};Te.registerScheme=Ue;Te.prototype.setForceHTTPS=Te.prototype.Od;function Ye(){this.g=0} Te.NumBytesRemainingClass=Ye;function Ze(a,b,c){He.call(this,a,b);this.h=c}ra(Ze,He);Te.PendingRequest=Ze;var cf=1;Te.RequestType={MANIFEST:0,SEGMENT:cf,LICENSE:2,APP:3,TIMING:4,SERVER_CERTIFICATE:5};var Ve=3;Te.PluginPriority={FALLBACK:1,PREFERRED:2,APPLICATION:Ve};var We={};function df(a){this.g=!1;this.h=new xc;this.i=a}df.prototype.destroy=function(){var a=this;if(this.g)return this.h;this.g=!0;return this.i().then(function(){a.h.resolve()},function(){a.h.resolve()})};function ef(a,b){if(a.g){if(b instanceof N&&7003==b.code)throw b;throw new N(2,7,7003,b);}};function ff(){this.g=new od}q=ff.prototype;q.release=function(){this.nb();this.g=null};q.A=function(a,b,c,d){this.g&&(a=new gf(a,b,c,d),this.g.push(b,a))};q.ta=function(a,b,c,d){function e(g){f.Da(a,b,e);c(g)}var f=this;this.A(a,b,e,d)};q.Da=function(a,b,c){if(this.g){var d=this.g.get(b)||[];d=r(d);for(var e=d.next();!e.done;e=d.next())e=e.value,e.target!=a||c!=e.listener&&c||(e.Da(),this.g.remove(b,e))}}; q.nb=function(){if(this.g){var a=this.g,b=[],c;for(c in a.g)b.push.apply(b,ka(a.g[c]));a=r(b);for(b=a.next();!b.done;b=a.next())b.value.Da();this.g.g={}}};M("shaka.util.EventManager",ff);ff.prototype.removeAll=ff.prototype.nb;ff.prototype.unlisten=ff.prototype.Da;ff.prototype.listenOnce=ff.prototype.ta;ff.prototype.listen=ff.prototype.A;ff.prototype.release=ff.prototype.release;function gf(a,b,c,d){this.target=a;this.type=b;this.listener=c;this.g=hf(a,d);this.target.addEventListener(b,c,this.g)} gf.prototype.Da=function(){this.target.removeEventListener(this.type,this.listener,this.g);this.listener=this.target=null;this.g=!1};function hf(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 jf(a)?b:b.capture||!1} function jf(a){var b=kf;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}kf=b}return b||!1}var kf=void 0;function lf(){}function mf(a){a=Dc(a);return(new cc(a)).Ha}function nf(a,b,c){function d(h){Ob(f).setUint32(g,h.byteLength,!0);g+=4;f.set(Lb(h),g);g+=h.byteLength}if(!c||!c.byteLength)throw new N(2,6,6015);var e;"string"==typeof b?e=Fc(b,!0):e=b;a=Dc(a);a=Fc(a,!0);var f=new Uint8Array(12+a.byteLength+e.byteLength+c.byteLength),g=0;d(a);d(e);d(c);return f}M("shaka.util.FairPlayUtils",lf); lf.commonFairPlayResponse=function(a,b){if(2===a){try{var c=Ac(b.data)}catch(f){return}var d=!1;c=c.trim();""===c.substr(0,5)&&""===c.substr(-6)&&(c=c.slice(5,-6),d=!0);try{var e=JSON.parse(c);e.ckc&&(c=e.ckc,d=!0);e.CkcMessage&&(c=e.CkcMessage,d=!0);e.License&&(c=e.License,d=!0)}catch(f){}d&&(b.data=Mb(Jc(c)))}};lf.spcFairPlayRequest=function(a,b){if(2===a){var c=Lb(b.body);c=Ic(c);b.headers["Content-Type"]="application/x-www-form-urlencoded";b.body=Ec("spc="+c)}}; lf.initDataTransform=nf;lf.defaultGetContentId=mf;lf.isFairPlaySupported=function(){var a;return K(function(b){if(1==b.g)return a={initDataTypes:["cenc","sinf","skd"],videoCapabilities:[{contentType:'video/mp4; codecs="avc1.42E01E"'}]},B(b,2),u(b,navigator.requestMediaKeySystemAccess("com.apple.fps",[a]),4);if(2!=b.g)return b["return"](!0);F(b);return b["return"](!1)})};function of(a){for(var b=new Map,c=r(Object.keys(a)),d=c.next();!d.done;d=c.next())d=d.value,b.set(d,a[d]);return b}function pf(a){var b={};a.forEach(function(c,d){b[d]=c});return b}function qf(a,b){if(a||b){if(a&&!b||b&&!a)return!1}else return!0;if(a.size!=b.size)return!1;for(var c=r(a),d=c.next();!d.done;d=c.next()){var e=r(d.value);d=e.next().value;e=e.next().value;if(!b.has(d))return!1;d=b.get(d);if(d!=e||void 0==d)return!1}return!0};function rf(a,b){var c=this;b=void 0===b?1:b;this.D=a;this.H=new Set;this.j=this.s=null;this.pa=this.fa=!1;this.J=0;this.g=null;this.o=new ff;this.i=new Map;this.C=[];this.u=new xc;this.h=null;this.m=function(d){c.u.reject(d);a.onError(d)};this.qa=new Map;this.ga=new Map;this.X=new O(function(){return sf(c)});this.N=!1;this.L=[];this.V=!1;this.ha=(new O(function(){tf(c)})).Ca(b);this.u["catch"](function(){});this.l=new df(function(){return uf(c)});this.$=!1;this.G=null}q=rf.prototype;q.destroy=function(){return this.l.destroy()}; function uf(a){return K(function(b){switch(b.g){case 1:return a.o.release(),a.o=null,a.u.reject(),a.ha.stop(),a.ha=null,a.X.stop(),a.X=null,u(b,vf(a),2);case 2:if(!a.j){b.B(3);break}B(b,4);return u(b,a.j.setMediaKeys(null),6);case 6:wa(b,5);break;case 4:F(b);case 5:a.j=null;case 3:a.g=null,a.H.clear(),a.s=null,a.C=[],a.h=null,a.m=function(){},a.D=null,a.$=!1,a.G=null,z(b)}})}q.configure=function(a){this.h=a};function wf(a,b,c){a.pa=!0;a.C=[];a.N=c;return xf(a,b)} function yf(a,b,c){a.C=c;a.N=0h&&(h+=Math.pow(2,32));h="0x"+h.toString(16)}a.m(new N(2,6,6006,f.message,f,h))}})}function Yf(a,b,c){"skd"==b&&(b=c.serverCertificate,c=mf(a),a=nf(a,c,b));return a} function Lf(a,b){var c,d,e,f,g,h,k,l,m,n,p,t,v,y;K(function(x){switch(x.g){case 1:return c=b.target,a.h.logLicenseExchange&&Ic(b.message),d=a.i.get(c),e=a.g.licenseServerUri,f=a.h.advanced[a.g.keySystem],"individualization-request"==b.messageType&&f&&f.individualizationServer&&(e=f.individualizationServer),g=Xe([e],a.h.retryParameters),g.body=b.message,g.method="POST",g.licenseRequestType=b.messageType,g.sessionId=c.sessionId,g.drmInfo=a.g,d&&(g.initData=d.initData,g.initDataType=d.initDataType), Rf(a.g.keySystem)&&Zf(g),h=Date.now(),B(x,2),l=a.D.lb.request(2,g),u(x,l.promise,4);case 4:k=x.h;wa(x,3);break;case 2:return m=F(x),n=new N(2,6,6007,m),a.m(n),d&&d.La&&d.La.reject(n),x["return"]();case 3:if(a.l.g)return x["return"]();a.J+=(Date.now()-h)/1E3;a.h.logLicenseExchange&&Ic(k.data);B(x,5);return u(x,c.update(k.data),7);case 7:wa(x,6);break;case 5:return p=F(x),t=new N(2,6,6008,p.message),a.m(t),d&&d.La&&d.La.reject(t),x["return"]();case 6:v=new P("drmsessionupdate"),a.D.onEvent(v),d&&(d.La&& d.La.resolve(),y=new O(function(){d.loaded=!0;Xf(a)&&a.u.resolve()}),y.R($f)),z(x)}})} function Zf(a){var b=Bc(a.body,!0,!0);if(b.includes("PlayReadyKeyMessage")){b=(new DOMParser).parseFromString(b,"application/xml");for(var c=r(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=Jc(b.getElementsByTagName("Challenge")[0].textContent)}else a.headers["Content-Type"]="text/xml; charset=utf-8"} function Wf(a,b){var c=b.target,d=a.i.get(c),e=!1;c.keyStatuses.forEach(function(g,h){if("string"==typeof h){var k=h;h=g;g=k}if(Rf(a.g.keySystem)&&16==h.byteLength&&navigator.userAgent.match(/Edge?\//)){k=Ob(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)}"status-pending"!=g&&(d.loaded=!0);"expired"==g&&(e=!0);k=Lc(h);a.qa.set(k,g)});var f=c.expiration-Date.now();(0>f||e&&1E3>f)&&d&&!d.La&&(a.i["delete"](c),c.close()["catch"](function(){})); Xf(a)&&(a.u.resolve(),a.X.R(ag))}function sf(a){var b=a.qa,c=a.ga;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.m(new N(2,6,6014));a.D.Nc(pf(c))} function bg(){var a,b,c,d,e,f,g,h;return K(function(k){return 1==k.g?(a="org.w3.clearkey com.widevine.alpha com.microsoft.playready com.microsoft.playready.recommendation 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={initDataTypes:["cenc"],videoCapabilities:b},d={videoCapabilities:b,persistentState:"required",sessionTypes:["persistent-license"]},e=[d, c],f=new Map,g=function(l){var m,n,p;return K(function(t){switch(t.g){case 1:B(t,2);if("org.w3.clearkey"===l&&xd())throw Error("Unsupported keySystem");return u(t,navigator.requestMediaKeySystemAccess(l,e),4);case 4:return m=t.h,p=(n=m.getConfiguration().sessionTypes)?n.includes("persistent-license"):!1,vd("Tizen 3")&&(p=!1),f.set(l,{persistentState:p}),u(t,m.createMediaKeys(),5);case 5:wa(t,0);break;case 2:F(t),f.set(l,null),z(t)}})},h=a.map(function(l){return g(l)}),u(k,Promise.all(h),2)):k["return"](pf(f))})} function cg(a){var b;return K(function(c){if(1==c.g)return b=new Promise(function(d,e){(new O(e)).R(dg)}),B(c,2),u(c,Promise.race([Promise.all([a.close(),a.closed]),b]),4);if(2!=c.g)return wa(c,0);F(c);z(c)})} function vf(a){var b;return K(function(c){b=Array.from(a.i.entries());a.i.clear();return u(c,Promise.all(b.map(function(d){d=r(d);var e=d.next().value,f=d.next().value;return K(function(g){if(1==g.g)return B(g,2),a.pa||a.C.includes(e.sessionId)||"persistent-license"!==f.type?u(g,cg(e),5):u(g,e.remove(),5);if(2!=g.g)return wa(g,0);F(g);z(g)})})),0)})} function eg(a,b){if(!a.length)return b;if(!b.length)return a;for(var c=[],d=r(a),e=d.next();!e.done;e=d.next()){e=e.value;for(var f={},g=r(b),h=g.next();!h.done;f={Ea:f.Ea},h=g.next())if(h=h.value,e.keySystem==h.keySystem){f.Ea=[];f.Ea=f.Ea.concat(e.initData||[]);f.Ea=f.Ea.concat(h.initData||[]);f.Ea=f.Ea.filter(function(k){return function(l,m){return void 0===l.keyId||m===k.Ea.findIndex(function(n){return n.keyId===l.keyId})}}(f));g=e.keyIds&&h.keyIds?new Set([].concat(ka(e.keyIds),ka(h.keyIds))): e.keyIds||h.keyIds;c.push({keySystem:e.keySystem,licenseServerUri:e.licenseServerUri||h.licenseServerUri,distinctiveIdentifierRequired:e.distinctiveIdentifierRequired||h.distinctiveIdentifierRequired,persistentStateRequired:e.persistentStateRequired||h.persistentStateRequired,videoRobustness:e.videoRobustness||h.videoRobustness,audioRobustness:e.audioRobustness||h.audioRobustness,serverCertificate:e.serverCertificate||h.serverCertificate,serverCertificateUri:e.serverCertificateUri||h.serverCertificateUri, initData:f.Ea,keyIds:g});break}}return c}function Gf(a){return(a.video?a.video.drmInfos:[]).concat(a.audio?a.audio.drmInfos:[])}function tf(a){a.i.forEach(function(b,c){var d=b.Ed,e=c.expiration;isNaN(e)&&(e=Infinity);e!=d&&(a.D.onExpirationUpdated(c.sessionId,e),b.Ed=e)})}function Xf(a){a=a.i.values();return Eb(a,function(b){return b.loaded})} function Ff(a,b){var c=[];b.forEach(function(f,g){c.push({keySystem:g,licenseServerUri:f,distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,serverCertificateUri:"",initData:[],keyIds:new Set})});for(var d=r(a),e=d.next();!e.done;e=d.next())e=e.value,e.video&&(e.video.drmInfos=c),e.audio&&(e.audio.drmInfos=c)} function Vf(a,b,c,d,e,f){var g={};a=r(a);for(var h=a.next();!h.done;g={oa:g.oa},h=a.next()){g.oa=h.value;b.includes(g.oa.licenseServerUri)||b.push(g.oa.licenseServerUri);d.includes(g.oa.serverCertificateUri)||d.push(g.oa.serverCertificateUri);g.oa.serverCertificate&&(c.some(function(m){return function(n){return Ib(n,m.oa.serverCertificate)}}(g))||c.push(g.oa.serverCertificate));if(g.oa.initData){h={};for(var k=r(g.oa.initData),l=k.next();!l.done;h={sc:h.sc},l=k.next())h.sc=l.value,e.some(function(m){return function(n){var p= m.sc;return n.keyId&&n.keyId==p.keyId?!0:n.initDataType==p.initDataType&&Ib(n.initData,p.initData)}}(h))||e.push(h.sc)}if(g.oa.keyIds)for(h=r(g.oa.keyIds),k=h.next();!k.done;k=h.next())f.add(k.value)}} function Hf(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),c.sessionType&&(a.sessionType=c.sessionType),a.serverCertificateUri||(a.serverCertificateUri=c.serverCertificateUri);window.cast&&window.cast.__platform__&&"com.microsoft.playready"==a.keySystem&&(a.keySystem="com.chromecast.playready")}}var dg=1,$f=5,ag=.5,fg=new yc(function(){return Mb(new Uint8Array([0]))});function gg(){}function hg(a,b,c,d){var e,f,g,h;return K(function(k){if(1==k.g){if(d&&(e=ig[d.toLowerCase()]))return k["return"](e);if(f=jg(a))if(g=kg[f])return k["return"](g);return d?k.B(2):u(k,lg(a,b,c),3)}if(2!=k.g&&(d=k.h)&&(h=ig[d]))return k["return"](h);throw new N(2,4,4E3,a);})} function lg(a,b,c){var d,e,f;return K(function(g){if(1==g.g)return d=Xe([a],c),d.method="HEAD",u(g,b.request(0,d).promise,2);e=g.h;f=e.headers["content-type"];return g["return"](f?f.toLowerCase().split(";").shift():"")})}function jg(a){a=(new cc(a)).va.split("/").pop().split(".");return 1==a.length?"":a.pop().toLowerCase()}M("shaka.media.ManifestParser",gg);gg.unregisterParserByMime=function(a){delete ig[a]};gg.registerParserByMime=function(a,b){ig[a]=b}; gg.registerParserByExtension=function(a,b){kg[a]=b};var ig={},kg={};function mg(a,b){this.P=Ob(a);this.h=b==ng;this.g=0}q=mg.prototype;q.ma=function(){return this.gthis.P.byteLength)throw og();var b=Lb(this.P,this.g,a);this.g+=a;return b}; q.skip=function(a){if(this.g+a>this.P.byteLength)throw og();this.g+=a};q.Rf=function(a){if(this.ga||a>this.P.byteLength)throw og();this.g=a};q.jc=function(){for(var a=this.g;this.ma()&&0!=this.P.getUint8(this.g);)this.g+=1;a=Lb(this.P,a,this.g-a);this.g+=1;return Ac(a)};function og(){return new N(2,3,3E3)}M("shaka.util.DataViewReader",mg);mg.prototype.readTerminatedString=mg.prototype.jc;mg.prototype.seek=mg.prototype.seek;mg.prototype.rewind=mg.prototype.Rf; mg.prototype.skip=mg.prototype.skip;mg.prototype.readBytes=mg.prototype.$a;mg.prototype.readUint64=mg.prototype.Lb;mg.prototype.readInt32=mg.prototype.re;mg.prototype.readUint32=mg.prototype.M;mg.prototype.readUint16=mg.prototype.Gd;mg.prototype.readUint8=mg.prototype.Sa;mg.prototype.getLength=mg.prototype.af;mg.prototype.getPosition=mg.prototype.ba;mg.prototype.hasMoreData=mg.prototype.ma;var ng=1;mg.Endianness={BIG_ENDIAN:0,LITTLE_ENDIAN:ng};function pg(){this.i=[];this.h=[];this.g=!1}q=pg.prototype;q.box=function(a,b){var c=qg(a);this.i[c]=rg;this.h[c]=b;return this};q.S=function(a,b){var c=qg(a);this.i[c]=sg;this.h[c]=b;return this};q.stop=function(){this.g=!0};q.parse=function(a,b,c){a=new mg(a,0);for(this.g=!1;a.ma()&&!this.g;)this.Pc(0,a,b,c)}; q.Pc=function(a,b,c,d){var e=b.ba();if(d&&e+8>b.P.byteLength)this.g=!0;else{var f=b.M(),g=b.M(),h=!1;switch(f){case 0:f=b.P.byteLength-e;break;case 1:if(d&&b.ba()+8>b.P.byteLength){this.g=!0;return}f=b.Lb();h=!0}var k=this.h[g];if(k){var l=null,m=null;if(this.i[g]==sg){if(d&&b.ba()+4>b.P.byteLength){this.g=!0;return}m=b.M();l=m>>>24;m&=16777215}g=e+f;c&&g>b.P.byteLength&&(g=b.P.byteLength);d&&g>b.P.byteLength?this.g=!0:(d=g-b.ba(),b=0>24&255,a>>16&255,a>>8&255,a&255)}function ug(a){return 8+(a.has64BitSize?8:0)+(null!=a.flags?4:0)}M("shaka.util.Mp4Parser",pg);pg.headerSize=ug;pg.typeToString=xg;pg.allData=wg;pg.sampleDescription=vg;pg.children=tg;pg.prototype.parseNext=pg.prototype.Pc;pg.prototype.parse=pg.prototype.parse;pg.prototype.stop=pg.prototype.stop; pg.prototype.fullBox=pg.prototype.S;pg.prototype.box=pg.prototype.box;var rg=0,sg=1;function yg(a){function b(){d=!0}function c(l){f.push(l);tg(l)}a=Lb(a);var d=!1,e,f=[],g=[];(new pg).box("moov",c).box("trak",c).box("mdia",c).box("minf",c).box("stbl",c).S("stsd",function(l){e=l;f.push(l);vg(l)}).S("encv",b).S("enca",b).S("avc1",function(l){g.push({box:l,hc:1701733238})}).S("avc3",function(l){g.push({box:l,hc:1701733238})}).S("ac-3",function(l){g.push({box:l,hc:1701733217})}).S("ec-3",function(l){g.push({box:l,hc:1701733217})}).S("mp4a",function(l){g.push({box:l,hc:1701733217})}).parse(a); if(d)return a;if(0==g.length||!e)throw cb(Lc(a)),new N(2,3,3019);g.reverse();for(var h=r(g),k=h.next();!k.done;k=h.next())k=k.value,a=zg(a,e,k.box,f,k.hc);return a} function zg(a,b,c,d,e){var f=Ag.value(),g=a.subarray(c.start,c.start+c.size),h=Ob(g),k=new Uint8Array(c.size+f.byteLength);k.set(g,0);g=Ob(k);g.setUint32(4,e);k.set(f,c.size);e=h.getUint32(4);g.setUint32(c.size+16,e);Bg(k,0,k.byteLength);e=new Uint8Array(a.byteLength+k.byteLength);c=vd("Xbox One")?c.start:c.start+c.size;f=a.subarray(c);e.set(a.subarray(0,c));e.set(k,c);e.set(f,c+k.byteLength);a=r(d);for(d=a.next();!d.done;d=a.next())d=d.value,Bg(e,d.start,d.size+k.byteLength);k=Ob(e,b.start);b=ug(b); a=k.getUint32(b);k.setUint32(b,a+1);return e}function Bg(a,b,c){a=Ob(a,b);b=a.getUint32(0);0!=b&&(1==b?(a.setUint32(8,c>>32),a.setUint32(12,c&4294967295)):a.setUint32(0,c))}var Ag=new yc(function(){return new Uint8Array([0,0,0,80,115,105,110,102,0,0,0,12,102,114,109,97,0,0,0,0,0,0,0,20,115,99,104,109,0,0,0,0,99,101,110,99,0,1,0,0,0,0,0,40,115,99,104,105,0,0,0,32,116,101,110,99,0,0,0,0,0,0,1,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])});function Cg(a,b,c,d,e){if(d>=e)return null;for(var f=-1,g=-1,h=0;hc||127=c)for(--d;0<=d;d--)a.i[b+d]=a.i[c+d].map(function(f){return f});else for(var e=0;eb;b++)a.i.push(gh())}function gh(){for(var a=[],b=0;42>b;b++)a.push(null);return a}function hh(a,b){ih(a)&&(a.i[a.h][a.g]=new Fg(b,a.u,a.o,a.m,a.s),a.g++)}function ih(a){var b=a.gthis.h.length)throw new N(2,2,3E3);this.g+=a};function qh(a){this.i=a;this.h=[null,null,null,null,null,null,null,null];this.g=null} function rh(a,b,c,d){if(128<=c&&135>=c)d=c&7,a.h[d]&&(a.g=a.h[d]);else{if(136===c){c=ph(b).value;b=null;c=r(sh(a,c));for(var e=c.next();!e.done;e=c.next())e=a.h[e.value],e.isVisible()&&(b=jh(e,d,a.i)),fh(e);return b}if(137===c)for(b=ph(b).value,b=r(sh(a,b)),c=b.next();!c.done;c=b.next())c=a.h[c.value],c.isVisible()||(c.j=d),c.l=!0;else{if(138===c){c=ph(b).value;b=null;c=r(sh(a,c));for(e=c.next();!e.done;e=c.next())e=a.h[e.value],e.isVisible()&&(b=jh(e,d,a.i)),e.l=!1;return b}if(139===c){c=ph(b).value; b=null;c=r(sh(a,c));for(e=c.next();!e.done;e=c.next())e=a.h[e.value],e.isVisible()?b=jh(e,d,a.i):e.j=d,e.l=!e.l;return b}if(140===c)return b=ph(b).value,th(a,b,d);if(143===c)return d=th(a,255,d),uh(a),d;if(144===c)b.skip(1),d=ph(b).value,a.g&&(a.g.o=0<(d&128),a.g.u=0<(d&64));else if(145===c)d=ph(b).value,c=ph(b).value,b.skip(1),a.g&&(b=vh((c&48)>>4,(c&12)>>2,c&3),a.g.s=vh((d&48)>>4,(d&12)>>2,d&3),a.g.m=b);else if(146===c)d=ph(b).value,b=ph(b).value,a.g&&(a=a.g,a.h=d&15,a.g=b&63);else if(151===c)b.skip(1), b.skip(1),d=ph(b).value,b.skip(1),a.g&&(a.g.D=d&3);else if(152<=c&&159>=c){c=(c&15)-8;e=null!==a.h[c];if(!e){var f=new dh;f.j=d;a.h[c]=f}d=ph(b).value;ph(b);ph(b);f=ph(b).value;var g=ph(b).value;b=ph(b).value;e&&0===(b&7)||(b=a.h[c],b.h=0,b.g=0,b.u=!1,b.o=!1,b.s="white",b.m="black");b=a.h[c];b.l=0<(d&32);b.G=(f&15)+1;b.C=(g&63)+1;a.g=a.h[c]}}}return null}function sh(a,b){for(var c=[],d=0;8>d;d++)1===(b&1)&&a.h[d]&&c.push(d),b>>=1;return c} function th(a,b,c){var d=null;b=r(sh(a,b));for(var e=b.next();!e.done;e=b.next()){e=e.value;var f=a.h[e];f.isVisible()&&(d=jh(f,c,a.i));a.h[e]=null}return d}function uh(a){a.g=null;a.h=[null,null,null,null,null,null,null,null]}function vh(a,b,c){var d={0:0,1:0,2:1,3:1};a=d[a];b=d[b];c=d[c];return wh[a<<2|b<<1|c]} var xh=new Map([[32," "],[33,"\u00a0"],[37,"\u2026"],[42,"\u0160"],[44,"\u0152"],[48,"\u2588"],[49,"\u2018"],[50,"\u2019"],[51,"\u201c"],[52,"\u201d"],[53,"\u2022"],[57,"\u2122"],[58,"\u0161"],[60,"\u0153"],[61,"\u2120"],[63,"\u0178"],[118,"\u215b"],[119,"\u215c"],[120,"\u215d"],[121,"\u215e"],[122,"\u2502"],[123,"\u2510"],[124,"\u2514"],[125,"\u2500"],[126,"\u2518"],[127,"\u250c"]]),wh="black blue green cyan red magenta yellow white".split(" ");function yh(){this.h=[];this.g=[];this.i=new mh;this.l=0;this.s=new Map([["CC1",new Ug(0,0)],["CC2",new Ug(0,1)],["CC3",new Ug(1,0)],["CC4",new Ug(1,1)]]);this.o=this.m=0;this.j=new Map;zh(this)}function zh(a){a.m=0;a.o=0;a=r(a.s.values());for(var b=a.next();!b.done;b=a.next())b=b.value,b.h=2,b.g=b.i,b.m=null,Hg(b.i),Hg(b.l),Hg(b.o)} function Ah(a){function b(f,g){return f.pts-g.pts||f.order-g.order}var c=[];a.h.sort(b);a.g.sort(b);for(var d=r(a.h),e=d.next();!e.done;e=d.next())(e=Bh(a,e.value))&&c.push(e);d=r(a.g);for(e=d.next();!e.done;e=d.next())nh(a.i,e.value);d=r(a.i.i);for(e=d.next();!e.done;e=d.next())e=Ch(a,e.value),c.push.apply(c,ka(e));a.i.i=[];a.h=[];a.g=[];return c} function Bh(a,b){var c=b.type;if(16===(b.xa&112)){var d=b.xa>>3&1;0===c?a.m=d:a.o=d}c=a.s.get("CC"+(c<<1|(c?a.o:a.m)+1));if(255===b.xa&&255===b.Oa||!b.xa&&!b.Oa||!Dh(b.xa)||!Dh(b.Oa))return 45<=++a.l&&zh(a),null;a.l=0;b.xa&=127;b.Oa&=127;if(!b.xa&&!b.Oa)return null;d=null;if(16===(b.xa&112))a:{var e=b.xa;d=b.Oa;if(c.m===(e<<8|d))c.m=null;else if(c.m=e<<8|d,16===(e&240)&&64===(d&192)){e=[11,11,1,2,3,4,12,13,14,15,5,6,7,8,9,10][(e&7)<<1|d>>5&1];var f=(d&30)>>1,g="white",h=!1;7>f?g=ch[f]:7===f&&(h=!0); d=1===(d&1);if(c.h!==Yg){f=c.g;if(c.h===Xg&&e!==f.g){var k=1+e-f.h;Tg(f,k,1+f.g-f.h,f.h);Jg(f,0,k-1);Jg(f,e+1,15-e)}f.g=e;c.g.m=d;c.g.j=h;c.g.l=g;c.g.o="black"}}else if(17===(e&247)&&32===(d&240))c.g.m=!1,c.g.j=!1,c.g.l="white",Kg(c.g,Lg,32),g=!1,e=ch[(d&14)>>1],"white_italics"===e&&(e="white",g=!0),c.g.m=1===(d&1),c.g.j=g,c.g.l=e;else if(16===(e&247)&&32===(d&240)||23===(e&247)&&45===(d&255))g="black",0===(e&7)&&(g=bh[(d&14)>>1]),c.g.o=g;else if(17===(e&247)&&48===(d&240))Kg(c.g,Ng,d);else if(18=== (e&246)&&32===(d&224))Kg(c.g,e&1?Rg:Pg,d);else if(20===(e&246)&&32===(d&240)){d=b.pts;e=null;switch(b.Oa){case 32:Zg(c);break;case 33:c=c.g;c.i[c.g].pop();break;case 37:e=Wg(c,2,d);break;case 38:e=Wg(c,3,d);break;case 39:e=Wg(c,4,d);break;case 40:Kg(c.g,Lg,32);break;case 41:c.h=2;c.g=c.i;c.g.h=0;c.j=d;break;case 42:Hg(c.o);ah(c);break;case 43:ah(c);break;case 44:e=c.i;g=null;c.h!==Yg&&(g=Ig(e,c.j,d));Jg(e,0,15);e=g;break;case 45:e=c.g;c.h!==Xg?e=null:(g=Ig(e,c.j,d),h=e.g-e.h+1,Tg(e,h-1,h,e.h),Jg(e, 0,h-1),Jg(e,e.g,15-e.g),c.j=d,e=g);break;case 46:Jg(c.l,0,15);break;case 47:e=null,c.h!==Yg&&(e=Ig(c.i,c.j,d)),g=c.l,c.l=c.i,c.i=g,Zg(c),c.j=d}d=e;break a}d=null}else e=b.Oa,Kg(c.g,Lg,b.xa),Kg(c.g,Lg,e);return d} function Ch(a,b){var c=[];try{for(;b.ma();){var d=ph(b).value,e=(d&224)>>5,f=d&31;7===e&&0!=f&&(e=ph(b).value&63);if(0!=e){a.j.has(e)||a.j.set(e,new qh(e));for(var g=a.j.get(e),h=b.ba();b.ba()-h=l){var p=m;if(g.g){var t=g.g;e=null;switch(l){case 8:!ih(t)||0>=t.g&&0>=t.h||(0>=t.g?(t.g=t.C-1,t.h--):t.g--,t.i[t.h][t.g]=null);break;case 13:t.isVisible()&&(e=jh(t,p,g.i));if(t.h+1>=t.G){p=t;for(var v=0,y=1;15>y;y++, v++)p.i[v]=p.i[y];for(y=0;1>y;y++,v++)p.i[v]=gh()}else t.h++;t.g=0;break;case 14:t.isVisible()&&(e=jh(t,p,g.i));t.i[t.h]=gh();t.g=0;break;case 12:t.isVisible()&&(e=jh(t,p,g.i)),fh(t),p=t,p.h=0,p.g=0}var x=e}else x=null}else if(128<=l&&159>=l)x=rh(g,e,l,m);else{if(4096<=l&&4127>=l)p=l&255,8<=p&&15>=p?e.skip(1):16<=p&&23>=p?e.skip(2):24<=p&&31>=p&&e.skip(3);else if(4224<=l&&4255>=l)p=l&255,128<=p&&135>=p?e.skip(4):136<=p&&143>=p&&e.skip(5);else if(32<=l&&127>=l)e=l,g.g&&(127===e?hh(g.g,"\u266a"):hh(g.g, String.fromCharCode(e)));else if(160<=l&&255>=l)g.g&&hh(g.g,String.fromCharCode(l));else if(4128<=l&&4223>=l){if(e=l&255,g.g)if(xh.has(e)){var w=xh.get(e);hh(g.g,w)}else hh(g.g,"_")}else 4256<=l&&4351>=l&&g.g&&(160!=(l&255)?hh(g.g,"_"):hh(g.g,"[CC]"));x=null}(e=x)&&c.push(e)}}}}catch(C){if(C instanceof N&&3E3===C.code)Ya("CEA708_INVALID_DATA","Buffer read out of bounds / invalid CEA-708 Data.");else throw C;}return c}function Dh(a){for(var b=0;a;)b^=a&1,a>>=1;return 1===b};function Eh(a,b){var c=null,d=null,e=a.M();b&1&&a.skip(8);b&2&&a.skip(4);b&8&&(c=a.M());b&16&&(d=a.M());return{trackId:e,de:c,Re:d}}function Fh(a,b){return{Yd:1==b?a.Lb():a.M()}}function Gh(a,b){1==b?(a.skip(8),a.skip(8)):(a.skip(4),a.skip(4));return{timescale:a.M()}} function Hh(a,b,c){var d=a.M(),e=[];c&1&&a.skip(4);c&4&&a.skip(4);for(var f=r(Fb(d)),g=f.next();!g.done;g=f.next())g={Kd:null,sampleSize:null,Rc:null},c&256&&(g.Kd=a.M()),c&512&&(g.sampleSize=a.M()),c&1024&&a.skip(4),c&2048&&(g.Rc=0==b?a.M():a.re()),e.push(g);return{Og:d,te:e}};function Ih(){this.i=new Map;this.h=this.g=0} Ih.prototype.init=function(a){var b=this,c=[],d=[];(new pg).box("moov",tg).box("mvex",tg).S("trex",function(e){var f=e.reader;f.skip(4);f.skip(4);e=f.M();f=f.M();b.g=e;b.h=f}).box("trak",tg).S("tkhd",function(e){var f=e.reader;1==e.version?(f.skip(8),f.skip(8)):(f.skip(4),f.skip(4));e=f.M();c.push(e)}).box("mdia",tg).S("mdhd",function(e){e=Gh(e.reader,e.version);d.push(e.timescale)}).parse(a,!0);if(!c.length||!d.length||c.length!=d.length)throw new N(2,2,2010);c.forEach(function(e,f){b.i.set(e,d[f])})}; Ih.prototype.parse=function(a){var b=this,c=[],d=this.g,e=this.h,f=[],g=null,h=9E4;(new pg).box("moof",tg).box("traf",tg).S("trun",function(k){f=Hh(k.reader,k.version,k.flags).te}).S("tfhd",function(k){k=Eh(k.reader,k.flags);d=k.de||b.g;e=k.Re||b.h;k=k.trackId;b.i.has(k)&&(h=b.i.get(k))}).S("tfdt",function(k){g=Fh(k.reader,k.version).Yd}).box("mdat",function(k){if(null===g)throw new N(2,2,2010);k=k.reader;var l=g,m=h,n=d,p=e,t=f,v=0,y=p;for(t.length&&(y=t[0].sampleSize||p);k.ma();){var x=k.M();if(6== (k.Sa()&31)){var w=0;t.length>v&&(w=t[v].Rc||0);w=(l+w)/m;for(var C=[],D,A=k.$a(x-1),E=D=0;Ev?l+(t[v].Kd||n):l+n,v++,y=t.length> v?t[v].sampleSize||p:p)}}).parse(a,!1);return c};function Jh(){this.h=new Ih;this.g=new yh}Jh.prototype.init=function(a){this.h.init(a)}; function Kh(a,b){var c=a.h.parse(b);c=r(c);for(var d=c.next();!d.done;d=c.next()){var e=d.value,f=Lb(e.Gf);if(0>2,m=f.Sa(),n=f.Sa();l&&(k&=3,0===k||1===k?d.h.push({pts:e,type:k,xa:m,Oa:n,order:d.h.length}):(d.g.push({pts:e,type:k,value:m,order:d.g.length}),d.g.push({pts:e,type:2,value:n,order:d.g.length})))}}}}return Ah(a.g)} ;function Lh(a){return!a||1==a.length&&1E-6>a.end(0)-a.start(0)?null:a.length?a.end(a.length-1):null}function Mh(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 Nh(a,b){if(!a||!a.length||1==a.length&&1E-6>a.end(0)-a.start(0))return 0;for(var c=0,d=r(Oh(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 Ph(a,b,c){if(!a||!a.length||1==a.length&&1E-6>a.end(0)-a.start(0))return null;a=Oh(a).findIndex(function(d,e,f){return d.start>b&&(0==e||f[e-1].end-b<=c)});return 0<=a?a:null}function Oh(a){if(!a)return[];for(var b=[],c=r(Fb(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 Qh(a,b,c,d){var e=this;this.j=a;this.l=c;this.h={};this.H={};this.g=null;this.J=d||function(){};this.i={};this.o=new ff;this.s={};this.u=b;this.D=new xc;this.m=Rh(this,this.D);this.C=new df(function(){return Sh(e)});this.G=""}function Rh(a,b){var c=new MediaSource;a.o.ta(c,"sourceopen",function(){URL.revokeObjectURL(a.G);b.resolve()});a.G=Th(c);a.j.src=a.G;return c}q=Qh.prototype;q.destroy=function(){return this.C.destroy()}; function Sh(a){var b,c,d,e,f,g,h,k;return K(function(l){if(1==l.g){b=[];for(c in a.i)for(d=a.i[c],e=d[0],a.i[c]=d.slice(0,1),e&&b.push(e.p["catch"](Vb)),f=r(d.slice(1)),g=f.next();!g.done;g=f.next())h=g.value,h.p.reject(new N(2,7,7003,void 0));a.g&&b.push(a.g.destroy());a.l&&b.push(a.l.destroy());for(k in a.s)b.push(a.s[k].destroy());return u(l,Promise.all(b),2)}a.o&&(a.o.release(),a.o=null);a.j&&(a.j.removeAttribute("src"),a.j.load(),a.j=null);a.m=null;a.g=null;a.l=null;a.h={};a.s={};a.u=null;a.i= {};z(l)})} q.init=function(a,b,c){c=void 0===c?!1:c;var d=this,e,f,g,h,k,l,m;return K(function(n){if(1==n.g)return e=wc,u(n,d.D,2);f={};g=r(a.keys());for(h=g.next();!h.done;f={ra:f.ra},h=g.next())f.ra=h.value,k=a.get(f.ra),l=Sc(k.mimeType,k.codecs),f.ra==e.Y?Uh(d,l,c):(!b&&MediaSource.isTypeSupported(l)||!Oc(l,f.ra)||(d.s[f.ra]=new Nc,l=Qc(f.ra,l)),m=d.m.addSourceBuffer(l),c&&(m.mode=Vh),d.o.A(m,"error",function(p){return function(){d.i[p.ra][0].p.reject(new N(2,3,3014,d.j.error?d.j.error.code:0))}}(f)),d.o.A(m, "updateend",function(p){return function(){return Wh(d,p.ra)}}(f)),d.h[f.ra]=m,d.H[f.ra]=l,d.i[f.ra]=[]);z(n)})};function Uh(a,b,c){a.g||(a.g=new Wc(a.l));a=a.g;"application/cea-608"!=b&&"application/cea-708"!=b&&(a.j=Xb(Yc[b]),a.j.setSequenceMode?a.j.setSequenceMode(c):Xa('Text parsers should have a "setSequenceMode" method!'))}function Xh(a){return a.m?"ended"==a.m.readyState:!0} function Yh(a,b){if(b==vc)var c=a.g.g;else c=Zh(a,b),c=!c||1==c.length&&1E-6>c.end(0)-c.start(0)?null:1==c.length&&0>c.start(0)?0:c.length?c.start(0):null;return c}function $h(a,b){return b==vc?a.g.h:Lh(Zh(a,b))}function ai(a,b,c){if(b==vc)return a=a.g,null==a.h||a.hC&&(C+=.001);a.h[b].timestampOffset=C;Wh(a,b)}));if(b==k.Y)return u(w,Zc(a.g,c,d,e),0);if(a.s[b])return u(w,Rc(a.s[b],c),10);if(f)return a.g||Uh(a,"text/vtt",h||!1),null==d&&null==e?a.u.init(c):(m=Kh(a.u,c),m.length&&(n=a.h[k.Na].timestampOffset,dd(a.g,m,d,e,n))),c=fi(a,c,d,b),u(w,ei(a,b,function(){a.h[b].appendBuffer(c)}),0);c=fi(a,c,d,b);return u(w,ei(a, b,function(){a.h[b].appendBuffer(c)}),0)}p=w.h;a.g||Uh(a,"text/vtt",h||!1);p.metadata&&(t=a.h[b].timestampOffset,a.J(p.metadata,t,e));p.captions&&p.captions.length&&(v=a.h[k.Na].timestampOffset,y=bd(p.captions),dd(a.g,y,d,e,v));x=p.data;x=fi(a,x,d,b);return u(w,ei(a,b,function(){a.h[b].appendBuffer(x)}),0)})}function gi(a,b){var c=$h(a,"video")||0;ad(a.g,b,c)}function hi(a){a.g&&ad(a.g,"",0)} q.remove=function(a,b,c){var d=this,e;return K(function(f){e=wc;return a==e.Y?u(f,d.g.remove(b,c),0):u(f,ei(d,a,function(){c<=b?Wh(d,a):d.h[a].remove(b,c)}),0)})};function ii(a,b){var c;return K(function(d){c=wc;return b==c.Y?a.g?u(d,a.g.remove(0,Infinity),0):d["return"]():u(d,ei(a,b,function(){var e=a.m.duration;0>=e?Wh(a,b):a.h[b].remove(0,e)}),0)})}q.flush=function(a){var b=this,c;return K(function(d){c=wc;return a==c.Y?d["return"]():u(d,ei(b,a,function(){b.j.currentTime-=.001;Wh(b,a)}),0)})}; function ji(a,b,c,d,e,f){var g;return K(function(h){g=wc;return b==g.Y?(f||(a.g.u=c),$c(a.g,d,e),h["return"]()):u(h,Promise.all([ei(a,b,function(){var k=a.h[b].appendWindowStart,l=a.h[b].appendWindowEnd;a.h[b].abort();a.h[b].appendWindowStart=k;a.h[b].appendWindowEnd=l;Wh(a,b)}),f?Promise.resolve():ei(a,b,function(){var k=c;0>k&&(k+=.001);a.h[b].timestampOffset=k;Wh(a,b)}),ei(a,b,function(){a.h[b].appendWindowStart=0;a.h[b].appendWindowEnd=e;a.h[b].appendWindowStart=d;Wh(a,b)})]),0)})} q.endOfStream=function(a){var b=this;return K(function(c){return u(c,ki(b,function(){Xh(b)||(a?b.m.endOfStream(a):b.m.endOfStream())}),0)})};q.Ka=function(a){var b=this;return K(function(c){return u(c,ki(b,function(){b.m.duration=a}),0)})};q.getDuration=function(){return this.m.duration};function Wh(a,b){var c=a.i[b][0];c&&(c.p.resolve(),li(a,b))}function ei(a,b,c){ef(a.C);c={start:c,p:new xc};a.i[b].push(c);1==a.i[b].length&&mi(a,b);return c.p} function ki(a,b){var c,d,e,f,g,h;return K(function(k){switch(k.g){case 1:ef(a.C);c=[];d={};for(e in a.h)d.Rb=new xc,f={start:function(l){return function(){return l.Rb.resolve()}}(d),p:d.Rb},a.i[e].push(f),c.push(d.Rb),1==a.i[e].length&&f.start(),d={Rb:d.Rb};B(k,2);return u(k,Promise.all(c),4);case 4:wa(k,3);break;case 2:throw g=F(k),g;case 3:try{b()}catch(l){throw new N(2,3,3015,l);}finally{for(h in a.h)li(a,h)}z(k)}})}function li(a,b){a.i[b].shift();mi(a,b)} function mi(a,b){var c=a.i[b][0];if(c)try{c.start()}catch(d){"QuotaExceededError"==d.name?c.p.reject(new N(2,3,3017,b)):c.p.reject(new N(2,3,3015,d)),li(a,b)}}function fi(a,b,c,d){var e=a.j.mediaKeys;null==c&&e&&(ud()||vd("Xbox One"))&&"mp4"==a.H[d].split(";")[0].split("/")[1]&&(b=yg(b));return b}var Th=window.URL.createObjectURL,Vh="sequence",ni=["audio/aac","audio/ac3","audio/ec3","audio/mpeg"];function oi(a,b,c,d){this.ya=a;this.Ba=b;this.la=c;this.xd=void 0===d?null:d}oi.prototype.dc=function(){return this.Ba};oi.prototype.$b=function(){return this.la};function pi(a,b){return a&&b?a.dc()==b.dc()&&a.$b()==b.$b()&&ib(a.ya(),b.ya()):a==b}M("shaka.media.InitSegmentReference",oi);oi.prototype.getEndByte=oi.prototype.$b;oi.prototype.getStartByte=oi.prototype.dc; function qi(a,b,c,d,e,f,g,h,k,l,m,n){l=void 0===l?[]:l;this.startTime=a;this.l=this.endTime=b;this.j=c;this.Ba=d;this.la=e;this.g=f;this.timestampOffset=g;this.appendWindowStart=h;this.appendWindowEnd=k;this.h=l;this.tilesLayout=void 0===m?"":m;this.i=void 0===n?null:n}q=qi.prototype;q.ya=function(){return this.j()};q.lf=function(){return this.startTime};q.Ze=function(){return this.endTime};q.dc=function(){return this.Ba};q.$b=function(){return this.la};q.tf=function(){return this.tilesLayout}; q.rf=function(){return this.i};M("shaka.media.SegmentReference",qi);qi.prototype.getTileDuration=qi.prototype.rf;qi.prototype.getTilesLayout=qi.prototype.tf;qi.prototype.getEndByte=qi.prototype.$b;qi.prototype.getStartByte=qi.prototype.dc;qi.prototype.getEndTime=qi.prototype.Ze;qi.prototype.getStartTime=qi.prototype.lf;qi.prototype.getUris=qi.prototype.ya;function S(a,b,c){this.j=a;this.Qc=b;this.m=this.l=Infinity;this.g=1;this.h=this.i=null;this.o=0;this.s=!0;this.u=0;this.C=void 0===c?!0:c;this.D=0}q=S.prototype;q.getDuration=function(){return this.l};q.ef=function(){return this.g};q.Ka=function(a){this.l=a};q.kf=function(){return this.j};q.ye=function(a){this.o=a};q.oc=function(a){this.s=a};q.Rd=function(a){this.m=a};q.Xf=function(a){this.Qc=a};q.Ye=function(){return this.Qc}; q.Ib=function(a){if(0!=a.length){var b=a[a.length-1].endTime;this.Cd(a[0].startTime);this.g=a.reduce(function(c,d){return Math.max(c,d.endTime-d.startTime)},this.g);this.h=Math.max(this.h,b);null!=this.j&&this.C&&(this.j=(Date.now()+this.o)/1E3-this.h-this.g)}};q.Cd=function(a){this.i=null==this.i?a:Math.min(this.i,a)};q.Bd=function(a){this.g=Math.max(this.g,a)};q.offset=function(a){null!=this.i&&(this.i+=a);null!=this.h&&(this.h+=a)};q.T=function(){return Infinity==this.l&&!this.s}; q.kb=function(){return Infinity!=this.l&&!this.s};q.Qa=function(){return Math.max(this.u,this.fb()-this.m)};q.ze=function(a){this.u=a};q.fb=function(){return this.T()||this.kb()?Math.min(Math.max(0,(Date.now()+this.o)/1E3-this.g-this.j)+this.D,this.l):this.h||this.l};q.cc=function(a){var b=Math.max(this.i,this.u);return Infinity==this.m?Math.ceil(1E3*b)/1E3:Math.max(b,Math.min(this.fb()-this.m+a,this.Pa()))};q.Eb=function(){return this.cc(0)}; q.Pa=function(){return Math.max(0,this.fb()-(this.T()||this.kb()?this.Qc:0))};q.Ce=function(){return null==this.j||null!=this.h&&this.C?!1:!0};q.xe=function(a){this.D=a};M("shaka.media.PresentationTimeline",S);S.prototype.setAvailabilityTimeOffset=S.prototype.xe;S.prototype.usingPresentationStartTime=S.prototype.Ce;S.prototype.getSeekRangeEnd=S.prototype.Pa;S.prototype.getSeekRangeStart=S.prototype.Eb;S.prototype.getSafeSeekRangeStart=S.prototype.cc;S.prototype.getSegmentAvailabilityEnd=S.prototype.fb; S.prototype.setUserSeekStart=S.prototype.ze;S.prototype.getSegmentAvailabilityStart=S.prototype.Qa;S.prototype.isInProgress=S.prototype.kb;S.prototype.isLive=S.prototype.T;S.prototype.offset=S.prototype.offset;S.prototype.notifyMaxSegmentDuration=S.prototype.Bd;S.prototype.notifyMinSegmentStartTime=S.prototype.Cd;S.prototype.notifySegments=S.prototype.Ib;S.prototype.getDelay=S.prototype.Ye;S.prototype.setDelay=S.prototype.Xf;S.prototype.setSegmentAvailabilityDuration=S.prototype.Rd; S.prototype.setStatic=S.prototype.oc;S.prototype.setClockOffset=S.prototype.ye;S.prototype.getPresentationStartTime=S.prototype.kf;S.prototype.setDuration=S.prototype.Ka;S.prototype.getMaxSegmentDuration=S.prototype.ef;S.prototype.getDuration=S.prototype.getDuration;function ri(a,b){this.j=a;this.m=si(a);this.g=a.g.currentTime;this.l=Date.now()/1E3;this.h=!1;this.o=b;this.i=function(){}}ri.prototype.release=function(){this.j=null;this.i=function(){}};function ti(a,b){a.i=b}function ui(a){this.g=a}function si(a){if(a.g.paused||0==a.g.playbackRate||0==a.g.buffered.length)var b=!1;else a:{b=a.g.currentTime;a=r(Oh(a.g.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 vi(a,b,c,d,e){var f=this;this.g=a;this.C=b;this.l=c;this.u=e;this.i=new ff;this.s=!1;this.D=a.readyState;this.j=!1;this.h=d;this.o=!1;this.i.A(a,"waiting",function(){return wi(f)});this.m=(new O(function(){wi(f)})).Ca(.25)}vi.prototype.release=function(){this.i&&(this.i.release(),this.i=null);null!=this.m&&(this.m.stop(),this.m=null);this.h&&(this.h.release(),this.h=null);this.g=this.C=this.u=null};vi.prototype.Fd=function(){this.o=!0;wi(this)}; function wi(a){if(0!=a.g.readyState){if(a.g.seeking){if(!a.s)return}else a.s=!1;if(!a.g.paused||0==a.g.currentTime&&(a.g.autoplay||0!=a.g.currentTime)){a.g.readyState!=a.D&&(a.j=!1,a.D=a.g.readyState);var b;if(!(b=!a.h)){b=a.h;var c=b.j,d=si(c),e=c.g.currentTime,f=Date.now()/1E3;if(b.g!=e||b.m!=d)b.l=f,b.g=e,b.m=d,b.h=!1;e=f-b.l;if(d=e>=b.o&&d&&!b.h)b.i(b.g,e),b.h=!0,b.g=c.g.currentTime;b=!d}if(b){e=a.l.smallGapLimit;var g=a.g.currentTime;b=a.g.buffered;c=Ph(b,g,a.l.gapDetectionThreshold);if(!(null== c||0==c&&!a.o||(d=b.start(c),d>=a.C.Pa()))){var h=d-g;e=h<=e;f=!1;.001>h||(e||a.j||(a.j=!0,g=(new Map).set("currentTime",g).set("gapSize",h),g=new P("largegap",g),g.cancelable=!0,a.u(g),a.l.jumpLargeGaps&&!g.defaultPrevented&&(f=!0)),!e&&!f)||(0!=c&&b.end(c-1),a.g.currentTime=d)}}}}};function xi(a,b,c,d){b==HTMLMediaElement.HAVE_NOTHING||a.readyState>=b?d():(b=yi.value().get(b),c.ta(a,b,d))}var yi=new yc(function(){return new Map([[HTMLMediaElement.HAVE_METADATA,"loadedmetadata"],[HTMLMediaElement.HAVE_CURRENT_DATA,"loadeddata"],[HTMLMediaElement.HAVE_FUTURE_DATA,"canplay"],[HTMLMediaElement.HAVE_ENOUGH_DATA,"canplaythrough"]])});function zi(a,b,c){var d=this;this.g=a;this.l=b;this.j=c;this.m=!1;this.h=new ff;this.i=new Ai(a);xi(this.g,HTMLMediaElement.HAVE_METADATA,this.h,function(){Bi(d,d.j)})}zi.prototype.release=function(){this.h&&(this.h.release(),this.h=null);null!=this.i&&(this.i.release(),this.i=null);this.l=function(){};this.g=null};function Ci(a){return a.m?a.g.currentTime:a.j}function Di(a,b){0Math.abs(a.g.currentTime-b)?Fi(a):(a.h.ta(a.g,"seeking",function(){Fi(a)}),Ei(a.i,0==a.g.currentTime?b:a.g.currentTime))}function Fi(a){a.m=!0;a.h.A(a.g,"seeking",function(){return a.l()})}function Ai(a){var b=this;this.h=a;this.m=10;this.l=this.j=this.i=0;this.g=new O(function(){0>=b.i?b.g.stop():b.h.currentTime!=b.j?b.g.stop():(b.h.currentTime=b.l,b.i--)})}Ai.prototype.release=function(){this.g&&(this.g.stop(),this.g=null);this.h=null}; function Ei(a,b){a.j=a.h.currentTime;a.l=b;a.i=a.m;a.h.currentTime=b;a.g.Ca(.1)};function Gi(a){function b(){null==c.h||0==c.h?c.j=!0:(c.i.ta(c.g,"seeking",function(){c.j=!0}),c.g.currentTime=Math.max(0,c.g.currentTime+c.h))}var c=this;this.g=a;this.j=!1;this.h=null;this.i=new ff;xi(this.g,HTMLMediaElement.HAVE_CURRENT_DATA,this.i,function(){b()})}Gi.prototype.release=function(){this.i&&(this.i.release(),this.i=null);this.g=null};Gi.prototype.o=function(a){this.h=this.j?this.h:a};Gi.prototype.m=function(){return(this.j?this.g.currentTime:this.h)||0};Gi.prototype.D=function(){}; function Hi(a,b,c,d,e,f){var g=this;this.i=a;this.g=b.presentationTimeline;this.G=b.minBufferTime||0;this.l=c;this.C=e;this.u=null;this.j=new vi(a,b.presentationTimeline,c,Ii(a,c),f);this.h=new zi(a,function(){a:{var h=g.j;h.s=!0;h.o=!1;h.j=!1;var k=Ci(g.h);h=Ji(g,k);if(.001l-k&&(k= l-3);ha.g.getDuration()?a.g.Eb():a.g.Pa():0>b&&(b=a.g.Pa()+b);return Mi(a,Li(a,b))}Hi.prototype.D=function(){this.j.Fd()};function Mi(a,b){var c=a.g.getDuration();return b>=c?c-a.l.durationBackoff:b}function Ji(a,b){var c=Math.max(a.G,a.l.rebufferingGoal),d=a.l.safeSeekOffset,e=a.g.Eb(),f=a.g.Pa(),g=a.g.getDuration();3>f-e&&(e=f-3);var h=a.g.cc(c),k=a.g.cc(d);c=a.g.cc(c+d);return b>=g?Mi(a,b):b>f?f:b=h||Mh(a.i.buffered,b)?b:c} function Li(a,b){var c=a.g.Eb();if(bc?c:b}function Ii(a,b){if(!b.stallEnabled)return null;var c=b.stallSkip,d=new ri(new ui(a),b.stallThreshold);ti(d,function(){c?a.currentTime+=c:(a.pause(),a.play())});return d};function T(a){this.K=a;this.g=null;this.h=0;this.i=!1}q=T.prototype;q.destroy=function(){Qb("shaka.media.SegmentIndex","Please use release() instead of destroy().");this.release();return Promise.resolve()};q.release=function(){this.i||(this.K=[],this.g&&this.g.stop(),this.g=null)};q.Af=function(){this.i=!0}; q.find=function(a){for(var b=this.K.length-1,c=b;0<=c;--c){var d=this.K[c],e=c=d.startTime&&aa||a>=this.K.length?null:this.K[a]};q.offset=function(a){if(!this.i)for(var b=r(this.K),c=b.next();!c.done;c=b.next())c=c.value,c.startTime+=a,c.endTime+=a,c.timestampOffset+=a}; q.Gb=function(a){!this.i&&a.length&&(this.K=this.K.filter(function(b){return b.startTimeb&&(0==c.K.length||d.endTime>c.K[0].startTime)});this.Gb(a);this.cb(b)};q.cb=function(a){if(!this.i){var b=this.K.length;this.K=this.K.filter(function(c){return c.endTime>a});this.h+=b-this.K.length}}; q.Ya=function(a,b,c){c=void 0===c?!1:c;if(!this.i){for(;this.K.length;)if(this.K[this.K.length-1].startTime>=b)this.K.pop();else break;for(;this.K.length;)if(this.K[0].endTime<=a)this.K.shift(),c||this.h++;else break;0!=this.K.length&&(a=this.K[this.K.length-1],this.K[this.K.length-1]=new qi(a.startTime,b,a.j,a.Ba,a.la,a.g,a.timestampOffset,a.appendWindowStart,a.appendWindowEnd,a.h,a.tilesLayout,a.i))}}; q.Sc=function(a,b){var c=this;this.i||(this.g&&this.g.stop(),this.g=new O(function(){var d=b();d?c.K.push.apply(c.K,ka(d)):(c.g.stop(),c.g=null)}),this.g.Ca(a))};T.prototype[Symbol.iterator]=function(){return this.Db(0)};T.prototype.Db=function(a){var b=this.find(a);if(null==b)return null;b--;var c=this.get(b+1),d=-1;if(c&&0=f.startTime&&a=a.h.length&&(this.h++,this.g=0,a=this.i.get(this.h));return a&&0=c});0<=b?d.splice(b,d[b].position==c?1:0,a):d.push(a)} Ui.prototype.j=function(a){for(var b=r(this.g.values()),c=b.next();!c.done;c=b.next()){c=c.value;a:{var d=c.ic;for(var e=d.length-1;0<=e;e--){var f=d[e];if(f.position<=a){d=f.xd;break a}}d=null}if(e=d)e=c.be,e=!(e===d||e&&d&&e.bandwidth==d.bandwidth&&e.audioSamplingRate==d.audioSamplingRate&&e.codecs==d.codecs&&e.contentType==d.contentType&&e.frameRate==d.frameRate&&e.height==d.height&&e.mimeType==d.mimeType&&e.channelsCount==d.channelsCount&&e.pixelAspectRatio==d.pixelAspectRatio&&e.width==d.width); if(e)a:{e=a;f=d.contentType;if((f=this.h()[f])&&0=f[0].start&&e=e?!1:!0})}else b.ic=[]};function Yi(a){R.call(this);var b=this;this.g=new Set;this.i=a;this.h=(new O(function(){for(var c=b.i(),d=r(b.g),e=d.next();!e.done;e=d.next())e=e.value,e.endTimed.endTime?cj:$i;this.g.set(d,f);for(var g=r(this.l),h=g.next();!h.done;h=g.next())h=h.value,h.sb==e&&h.rb==f&&h.jb(d,b)}}; function aj(a,b,c,d){b=new P(b,new Map([["region",c],["seeking",d]]));a.dispatchEvent(b)}var bj=1,$i=2,cj=3;function dj(a,b,c,d,e){a=Xe(a,d,e);if(0!=b||null!=c)a.headers.Range=c?"bytes="+b+"-"+c:"bytes="+b+"-";return a};function ej(a,b){var c=this;this.g=b;this.m=a;this.h=null;this.u=1;this.o=this.l=null;this.i=new Map;this.C=!1;this.D=null;this.s=!1;this.j=new df(function(){return fj(c)})}ej.prototype.destroy=function(){return this.j.destroy()};function fj(a){var b,c,d,e;return K(function(f){if(1==f.g){b=[];c=r(a.i.values());for(d=c.next();!d.done;d=c.next())e=d.value,gj(e),b.push(hj(e));return u(f,Promise.all(b),2)}a.i.clear();a.g=null;a.m=null;a.h=null;z(f)})} ej.prototype.configure=function(a){this.h=a;this.D=new Ee({maxAttempts:Math.max(a.retryParameters.maxAttempts,2),baseDelay:a.retryParameters.baseDelay,backoffFactor:a.retryParameters.backoffFactor,fuzzFactor:a.retryParameters.fuzzFactor,timeout:0,stallTimeout:0,connectionTimeout:0},!0)};ej.prototype.start=function(){var a=this;return K(function(b){if(1==b.g)return u(b,ij(a),2);ef(a.j);a.C=!0;z(b)})}; function jj(a,b){var c,d,e,f,g,h;K(function(k){switch(k.g){case 1:return c=wc,B(k,2),u(k,ii(a.g.O,c.Y),4);case 4:wa(k,3);break;case 2:if(d=F(k),a.g)a.g.onError(d);case 3:e=Sc(b.mimeType,b.codecs);Uh(a.g.O,e,a.m.sequenceMode);f=a.g.O.l;if(g=f.isTextVisible()||a.h.alwaysStreamText)h=kj(b),a.i.set(c.Y,h),lj(a,h,0);z(k)}})}function mj(a){var b=a.i.get(vc);b&&(gj(b),hj(b)["catch"](function(){}),a.i["delete"](vc));a.o=null} function nj(a,b){var c=a.i.get("video");if(c){var d=c.stream;if(d)if(b){var e=d.trickModeVideo;e&&!c.ob&&(oj(a,e,!1,0,!1),c.ob=d)}else if(d=c.ob)c.ob=null,oj(a,d,!0,0,!1)}}function pj(a,b,c,d,e){c=void 0===c?!1:c;d=void 0===d?0:d;e=void 0===e?!1:e;a.l=b;a.C&&(b.video&&oj(a,b.video,c,d,e),b.audio&&oj(a,b.audio,c,d,e))}function qj(a,b){a.o=b;a.C&&oj(a,b,!0,0,!1)} function oj(a,b,c,d,e){var f=a.i.get(b.type);f||b.type!=vc?f&&(f.ob&&(b.trickModeVideo?(f.ob=b,b=b.trickModeVideo):f.ob=null),f.stream!=b||e)&&(b.type==vc&&Uh(a.g.O,Sc(b.mimeType,b.codecs),a.m.sequenceMode),f.stream.closeSegmentIndex&&f.stream.closeSegmentIndex(),f.stream=b,f.ea=null,c&&(f.Yb?f.Uc=!0:f.Ja?(f.qb=!0,f.Ac=d,f.Uc=!0):(gj(f),rj(a,f,!0,d)["catch"](function(g){if(a.g)a.g.onError(g)}))),sj(a,f)["catch"](function(g){if(a.g)a.g.onError(g)})):jj(a,b)} function sj(a,b){var c,d;return K(function(e){if(1==e.g){if(!b.ua)return e["return"]();c=b.stream;d=b.ua;return c.segmentIndex?e.B(2):u(e,c.createSegmentIndex(),2)}if(b.ua!=d||b.stream!=c)return e["return"]();var f=a.g.Ic();var g=$h(a.g.O,b.type),h=b.stream.segmentIndex.find(b.za?b.za.endTime:f),k=null==h?null:b.stream.segmentIndex.get(h);h=k?k.la?k.la-k.Ba:null:null;k&&!h&&(h=(k.endTime-k.startTime)*(b.stream.bandwidth||0)/8);h?((k=k.g)&&(h+=(k.la?k.la-k.Ba:null)||0),k=a.g.getBandwidthEstimate(), f=8*h/k<(g||0)-f-Math.max(a.m.minBufferTime||0,a.h.rebufferingGoal)||b.ua.h.g>h?!0:!1):f=!1;f&&b.ua.abort();z(e)})} ej.prototype.lc=function(){for(var a=this.g.Ic(),b=this.h.smallGapLimit,c=r(this.i.keys()),d=c.next();!d.done;d=c.next()){var e=d.value;d=this.i.get(e);d.ea=null;var f=this.g.O;e==vc?(f=f.g,f=null==f.g||null==f.h?!1:a>=f.g&&ap?a.g.O.Ka(p):a.g.O.Ka(Math.pow(2,32));g=r(c.keys());for(h=g.next();!h.done;h=g.next())k=h.value,l=c.get(k), a.i.has(k)||(m=kj(l),a.i.set(k,m),lj(a,m,0));z(n)})}function kj(a){return{stream:a,type:a.type,ea:null,za:null,Kc:null,vd:null,ud:null,td:null,ob:null,endOfStream:!1,Ja:!1,Ma:null,qb:!1,Ac:0,Uc:!1,Yb:!1,lc:!0,Id:!1,ec:!1,ua:null}} function uj(a,b){var c,d,e,f,g;return K(function(h){switch(h.g){case 1:ef(a.j);if(b.Ja||null==b.Ma||b.Yb)return h["return"]();b.Ma=null;if(!b.qb){h.B(2);break}return u(h,rj(a,b,b.Uc,b.Ac),3);case 3:return h["return"]();case 2:if(b.stream.segmentIndex){h.B(4);break}c=b.stream;return u(h,b.stream.createSegmentIndex(),5);case 5:if(c!=b.stream)return c.closeSegmentIndex&&c.closeSegmentIndex(),null==b.Ma&&lj(a,b,0),h["return"]();case 4:B(h,6);d=vj(a,b);null!=d&&(lj(a,b,d),b.ec=!1);wa(h,7);break;case 6:return e= F(h),u(h,wj(a,e),8);case 8:return h["return"]();case 7:f=Array.from(a.i.values());if(!a.C||!f.every(function(k){return k.endOfStream})){h.B(0);break}return u(h,a.g.O.endOfStream(),10);case 10:ef(a.j),g=a.g.O.getDuration(),0!=g&&ga.m.presentationTimeline.getDuration()-d)return b.endOfStream=!0,"video"==b.type&&(c=a.i.get(vc))&&xj(c)&&(c.endOfStream=!0),null;b.endOfStream=!1;if(e>=f)return a.h.updateIntervalSeconds/2;e=$h(a.g.O,b.type);e=yj(a,b,c,e);if(!e)return a.h.updateIntervalSeconds;f=Infinity; var g=Array.from(a.i.values());g=r(g);for(var h=g.next();!h.done;h=g.next())h=h.value,xj(h)||h.ea&&!h.ea.current()||(f=Math.min(f,h.za?h.za.endTime:c));if(d>=f+a.m.presentationTimeline.g)return a.h.updateIntervalSeconds;zj(a,b,c,e)["catch"](function(){});return null} function yj(a,b,c,d){if(b.ea)return b.ea.current();if(b.za||d)return b.ea=b.stream.segmentIndex.Db(b.za?b.za.endTime:d),b.ea&&b.ea.next().value;a=a.h.inaccurateManifestTolerance;d=Math.max(c-a,0);var e=null;a&&(b.ea=b.stream.segmentIndex.Db(d),e=b.ea&&b.ea.next().value);e||(b.ea=b.stream.segmentIndex.Db(c),e=b.ea&&b.ea.next().value);return e} function zj(a,b,c,d){var e,f,g,h,k,l,m,n,p,t,v,y;return K(function(x){switch(x.g){case 1:return e=wc,f=b.stream,g=b.ea,b.Ja=!0,B(x,2),u(x,Aj(a,b,d),4);case 4:ef(a.j);if(a.s)return x["return"]();h="video/mp4"==f.mimeType||"audio/mp4"==f.mimeType;k=window.ReadableStream;if(a.h.lowLatencyMode&&k&&h)return n=new Uint8Array(0),p=function(w){var C,D,A;return K(function(E){ef(a.j);if(a.s)return E["return"]();n=Bj(n,w);C=!1;D=0;(new pg).box("mdat",function(G){D=G.size+G.start;C=!0}).parse(n,!1,!0);if(!C)return E.B(0); A=n.subarray(0,D);n=n.subarray(D);return u(E,Cj(a,b,c,f,d,A),0)})},u(x,Dj(a,b,d,p),6);l=Dj(a,b,d);return u(x,l,7);case 7:return m=x.h,ef(a.j),a.s?x["return"]():b.qb?(b.Ja=!1,lj(a,b,0),x["return"]()):u(x,Cj(a,b,c,f,d,m),6);case 6:ef(a.j);if(a.s)return x["return"]();b.za=d;g.next();b.Ja=!1;b.Id=!1;t=a.g.O.Za();v=t[b.type];bb(JSON.stringify(v));b.qb||a.g.Fd();lj(a,b,0);wa(x,0);break;case 2:y=F(x);ef(a.j,y);if(a.s)return x["return"]();b.Ja=!1;if(7001==y.code)b.Ja=!1,b.Ma=null,lj(a,b,0),x.B(0);else if(b.type== e.Y&&a.h.ignoreTextStreamFailures)a.i["delete"](e.Y),x.B(0);else if(3017==y.code)Ej(a,b,y),x.B(0);else if(1001==y.code&&y.data&&404==y.data[1])b.Ja=!1,b.Ma=null,lj(a,b,1),x.B(0);else return b.ec=!0,y.severity=2,u(x,wj(a,y),0)}})}function Bj(a,b){var c=new Uint8Array(a.length+b.length);c.set(a);c.set(b,a.length);return c} function Ej(a,b,c){if(!Array.from(a.i.values()).some(function(e){return e!=b&&e.Id})){var d=Math.round(100*a.u);if(20=g?h["return"]():u(h,a.g.O.remove(b.type,e,e+g),2)}ef(a.j);z(h)})}function xj(a){return a&&a.type==vc&&("application/cea-608"==a.stream.mimeType||"application/cea-708"==a.stream.mimeType)} function Dj(a,b,c,d){var e,f,g,h,k;return K(function(l){if(1==l.g)return e=cf,f=dj(c.ya(),c.Ba,c.la,a.h.retryParameters,d),g=b.stream,a.g.modifySegmentRequest(f,{type:g.type,init:c instanceof oi,duration:c.endTime-c.startTime,mimeType:g.mimeType,codecs:g.codecs,bandwidth:g.bandwidth}),h=a.g.lb.request(e,f),b.ua=h,u(l,h.promise,2);k=l.h;b.ua=null;return l["return"](k.data)})} function rj(a,b,c,d){var e,f;return K(function(g){if(1==g.g)return b.qb=!1,b.Uc=!1,b.Ac=0,b.Yb=!0,b.za=null,b.Kc=null,b.ea=null,d?(e=a.g.Ic(),f=a.g.O.getDuration(),u(g,a.g.O.remove(b.type,e+d,f),3)):u(g,ii(a.g.O,b.type),4);if(3!=g.g)return ef(a.j),c?u(g,a.g.O.flush(b.type),3):g.B(3);ef(a.j);b.Yb=!1;b.endOfStream=!1;lj(a,b,0);z(g)})} function lj(a,b,c){var d=b.type;if(d!=vc||a.i.has(d))b.Ma=(new qd(function(){var e;return K(function(f){if(1==f.g)return B(f,2),u(f,uj(a,b),4);if(2!=f.g)return wa(f,0);e=F(f);if(a.g)a.g.onError(e);z(f)})})).R(c)}function gj(a){null!=a.Ma&&(a.Ma.stop(),a.Ma=null)}function hj(a){return K(function(b){return a.ua?u(b,a.ua.abort(),0):b.B(0)})}function wj(a,b){return K(function(c){if(1==c.g)return u(c,Ge(a.D),2);ef(a.j);a.g.onError(b);b.handled||a.h.failureCallback(b);z(c)})};function Hj(a,b){var c=Ij(),d=this;this.j=b;this.i=a;this.l=c;this.o=null;this.m=[];this.h=this.g=null;this.u=Promise.resolve().then(function(){return Jj(d)});this.s=new df(function(){return Kj(d)})}Hj.prototype.destroy=function(){return this.s.destroy()};function Kj(a){var b,c,d;return K(function(e){if(1==e.g)return a.h&&a.h.abort(),Lj(a),u(e,a.u,2);a.g&&a.g.Ia.mb();b=r(a.m);for(c=b.next();!c.done;c=b.next())d=c.value,d.Ia.mb();a.g=null;a.m=[];a.j=null;z(e)})} function Mj(a,b){var c={Jb:function(){},Mc:function(){},mb:function(){},onError:function(){},Oc:function(){},Ng:function(){}};a.m.push({create:b,Ia:c});a.h&&a.h.abort();Lj(a);return c} function Jj(a){return K(function(b){if(a.s.g)b=b.B(0);else{if(0==a.m.length||a.g&&!a.g.ib)var c=!1;else{a.g&&(a.g.Ia.mb(),a.g=null);c=a.m.shift();var d=c.create(a.l);d?(c.Ia.Jb(),a.g={node:d.node,payload:d.payload,ib:d.ib,Ia:c.Ia}):c.Ia.Oc();c=!0}c?c=Promise.resolve():a.g?c=Nj(a):(a.j.Df(a.i),a.o=new xc,c=a.o);b=u(b,c,1)}return b})} function Nj(a){var b,c;return K(function(d){switch(d.g){case 1:return a.i=a.j.gf(a.i,a.l,a.g.node,a.g.payload),B(d,2),a.h=a.j.Se(a.i,a.l,a.g.payload),u(d,a.h.promise,4);case 4:a.h=null;a.i==a.g.node&&(a.g.Ia.Mc(),a.g=null);wa(d,0);break;case 2:b=F(d);if(7001==b.code)a.g.Ia.mb();else a.g.Ia.onError(b);a.g=null;a.h=null;c=a;return u(d,a.j.handleError(a.l,b),5);case 5:c.i=d.h,z(d)}})}function Lj(a){a.o&&(a.o.resolve(),a.o=null)};function Oj(a){this.g=null;for(var b=r(Array.from(a.textTracks)),c=b.next();!c.done;c=b.next())c=c.value,c.mode="disabled","Shaka Player TextTrack"==c.label&&(this.g=c);this.g||(this.g=a.addTextTrack("subtitles","Shaka Player TextTrack"));this.g.mode="hidden"}q=Oj.prototype;q.remove=function(a,b){if(!this.g)return!1;Pj(this.g,function(c){return c.startTimea});return!0}; q.append=function(a){function b(g){var h=[],k=700<=g.fontWeight,l="italic"==g.fontStyle,m=g.textDecoration.includes("underline");k&&h.push("b");l&&h.push("i");m&&h.push("u");k=h.reduce(function(n,p){return n+"<"+p+">"},"");h=h.reduceRight(function(n,p){return n+""},"");return g.lineBreak||g.spacer?(g.spacer&&Qb("shaka.extern.Cue","Please use lineBreak instead of spacer."),"\n"):g.nestedCues.length?g.nestedCues.map(b).join(""):k+g.payload+h}var c=a.map(function(g){if(g.nestedCues.length){var h= g.clone();h.nestedCues=[];h.payload=b(g);return h}return g}),d=[];a=this.g.cues?Array.from(this.g.cues):[];var e={};c=r(c);for(var f=c.next();!f.done;e={ub:e.ub},f=c.next())e.ub=f.value,a.some(function(g){return function(h){return h.startTime==g.ub.startTime&&h.endTime==g.ub.endTime&&h.text==g.ub.payload?!0:!1}}(e))||(f=Qj(e.ub))&&d.push(f);a=d.slice().sort(function(g,h){return g.startTime!=h.startTime?g.startTime-h.startTime:g.endTime!=h.endTime?g.endTime-h.startTime:"line"in VTTCue.prototype?d.indexOf(h)- d.indexOf(g):d.indexOf(g)-d.indexOf(h)});a=r(a);for(e=a.next();!e.done;e=a.next())this.g.addCue(e.value)};q.destroy=function(){this.g&&(Pj(this.g,function(){return!0}),this.g.mode="disabled");this.g=null;return Promise.resolve()};q.isTextVisible=function(){return"showing"==this.g.mode};q.setTextVisibility=function(a){this.g.mode=a?"showing":"hidden"}; function Qj(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 Pj(a,b){var c=a.mode;a.mode="showing"==c?"showing":"hidden";for(var d=r(Array.from(a.cues)),e=d.next();!e.done;e=d.next())(e=e.value)&&b(e)&&a.removeCue(e);a.mode=c}M("shaka.text.SimpleTextDisplayer",Oj);Oj.prototype.setTextVisibility=Oj.prototype.setTextVisibility;Oj.prototype.isTextVisible=Oj.prototype.isTextVisible;Oj.prototype.destroy=Oj.prototype.destroy;Oj.prototype.append=Oj.prototype.append;Oj.prototype.remove=Oj.prototype.remove;function Rj(){}function Sj(a){for(;a.firstChild;)a.removeChild(a.firstChild)}M("shaka.util.Dom",Rj);Rj.removeAllChildren=Sj;function Tj(a,b){var c=this;this.j=!1;this.i=[];this.u=a;this.m=b;this.g=document.createElement("div");this.g.classList.add("shaka-text-container");this.g.style.textAlign="center";this.g.style.display="flex";this.g.style.flexDirection="column";this.g.style.alignItems="center";this.g.style.justifyContent="flex-end";this.m.appendChild(this.g);this.s=(new O(function(){Uj(c)})).Ca(.25);this.h=new Map;this.o=new ff;this.o.A(document,"fullscreenchange",function(){Uj(c,!0)});this.l=null;"ResizeObserver"in window&&(this.l=new ResizeObserver(function(){Uj(c,!0)}),this.l.observe(this.g))}q=Tj.prototype;q.append=function(a){var b=[].concat(ka(this.i)),c={};a=r(a);for(var d=a.next();!d.done;c={pc:c.pc},d=a.next())c.pc=d.value,b.some(function(e){return function(f){return ub(f,e.pc)}}(c))||this.i.push(c.pc);Uj(this)}; q.destroy=function(){this.m.removeChild(this.g);this.g=null;this.j=!1;this.i=[];this.s&&this.s.stop();this.h.clear();this.o&&(this.o.release(),this.o=null);this.l&&(this.l.disconnect(),this.l=null)};q.remove=function(a,b){if(!this.g)return!1;var c=this.i.length;this.i=this.i.filter(function(d){return d.startTime=b});Uj(this,c>this.i.length);return!0};q.isTextVisible=function(){return this.j};q.setTextVisibility=function(a){this.j=a}; function Vj(a,b,c,d,e){var f=!1,g=[],h=[];b=r(b);for(var k=b.next();!k.done;k=b.next()){k=k.value;e.push(k);var l=a.h.get(k),m=k.startTime<=d&&k.endTime>d,n=l?l.De:null;l&&(g.push(l.ae),m||(f=!0,a.h["delete"](k),l=null));m&&(h.push(k),l||(Wj(a,k,e),l=a.h.get(k),n=l.De,f=!0));0h?"0":"")+h+":"+(10>l?"0":"")+l+":"+(10>m?"0":"")+m+"."+(100>k?10>k?"00":"0":"")+k}function d(h){var k=[],l=700<=h.fontWeight,m="italic"==h.fontStyle,n=h.textDecoration.includes("underline");l&&k.push("b");m&&k.push("i");n&&k.push("u");l=k.reduce(function(p,t){return p+"<"+t+">"}, "");k=k.reduceRight(function(p,t){return p+""},"");return h.lineBreak||h.spacer?(h.spacer&&Qb("shaka.text.Cue","Please use lineBreak instead of spacer."),"\n"):h.nestedCues.length?h.nestedCues.map(d).join(""):l+h.payload+k}var e=a.map(function(h){if(h.nestedCues.length){var k=h.clone();k.nestedCues=[];k.payload=d(h);return k}return h}),f="WEBVTT\n\n";e=r(e);for(var g=e.next();!g.done;g=e.next())g=g.value,f+=c(g.startTime)+" --\x3e "+c(g.endTime)+function(h){var k=[];switch(h.textAlign){case "left":k.push("align:left"); break;case "right":k.push("align:right");break;case nb:k.push("align:middle");break;case "start":k.push("align:start");break;case "end":k.push("align:end")}switch(h.writingMode){case "vertical-lr":k.push("vertical:lr");break;case "vertical-rl":k.push("vertical:rl")}return k.length?" "+k.join(" "):""}(g)+"\n",f+=g.payload+"\n\n";return f}M("shaka.text.WebVttGenerator",function(){});function bk(a,b){this.h=a;this.g=b;this.j="";this.o=void 0;this.i=!1;this.m=!0;this.l=!1}function ck(a,b,c){try{if(a.g.enabled){var d={d:1E3*c.duration,st:a.h.T()?dk:ek};d.ot=fk(c);var e=d.ot===gk||d.ot===hk||d.ot===ik||d.ot===jk;e&&(d.bl=kk(a,c.type));c.bandwidth&&(d.br=c.bandwidth/1E3);e&&d.ot!==jk&&(d.tb=lk(a,d.ot)/1E3);mk(a,b,d)}}catch(f){Ya("CMCD_SEGMENT_ERROR","Could not generate segment CMCD data.",f)}} function nk(a,b,c){try{if(!a.g.enabled)return b;var d=ok(a);a:{switch(c){case "video/webm":case "video/mp4":var e=ik;break a;case "application/x-mpegurl":e=pk;break a}e=void 0}d.ot=e;d.su=!0;var f=qk(d);return rk(b,f)}catch(g){return Ya("CMCD_SRC_ERROR","Could not generate src CMCD data.",g),b}}function sk(a,b){try{if(!a.g.enabled)return b;var c=ok(a);c.ot=tk;c.su=!0;var d=qk(c);return rk(b,d)}catch(e){return Ya("CMCD_TEXT_TRACK_ERROR","Could not generate text track CMCD data.",e),b}} function ok(a){a.j||(a.j=a.g.sessionId||window.crypto.randomUUID());return{v:1,sf:a.o,sid:a.j,cid:a.g.contentId,mtp:a.h.getBandwidthEstimate()/1E3}}function mk(a,b,c){c=void 0===c?{}:c;var d=void 0===d?a.g.useHeaders:d;if(a.g.enabled){Object.assign(c,ok(a));c.pr=a.h.Hc();var e=c.ot===gk||c.ot===ik;a.l&&e&&(c.bs=!0,c.su=!0,a.l=!1);null==c.su&&(c.su=a.m);if(d)a=uk(c),Object.keys(a).length&&Object.assign(b.headers,a);else{var f=qk(c);f&&(b.uris=b.uris.map(function(g){return rk(g,f)}))}}} function fk(a){var b=a.type;if(a.init)return vk;if("video"==b)return a.codecs.includes(",")?ik:gk;if("audio"==b)return hk;if("text"==b)return"application/mp4"===a.mimeType?jk:tk}function kk(a,b){var c=a.h.Za()[b];if(!c.length)return NaN;var d=a.h.Xe();return(c=c.find(function(e){return e.start<=d&&e.end>=d}))?1E3*(c.end-d):NaN} function lk(a,b){var c=a.h.hb();if(!c.length)return NaN;var d=c[0];c=r(c);for(var e=c.next();!e.done;e=c.next())e=e.value,"variant"===e.type&&e.bandwidth>d.bandwidth&&(d=e);switch(b){case gk:return d.videoBandwidth||NaN;case hk:return d.audioBandwidth||NaN;default:return d.bandwidth}} function qk(a){function b(n){return 100*c(n/100)}function c(n){return Math.round(n)}function d(n){return!Number.isNaN(n)&&null!=n&&""!==n&&!1!==n}var e=[],f={br:c,d:c,bl:b,dl:b,mtp:b,nor:function(n){return encodeURIComponent(n)},rtp:b,tb:c},g=Object.keys(a||{}).sort();g=r(g);for(var h=g.next();!h.done;h=g.next()){h=h.value;var k=a[h];if(d(k)&&("v"!==h||1!==k)&&("pr"!=h||1!==k)){var l=f[h];l&&(k=l(k));l=typeof k;var m=void 0;m="string"===l&&"ot"!==h&&"sf"!==h&&"st"!==h?h+"="+JSON.stringify(k):"boolean"=== l?h:"symbol"===l?h+"="+k.description:h+"="+k;e.push(m)}}return e.join(",")}function uk(a){var b=Object.keys(a),c={},d=["Object","Request","Session","Status"],e=[{},{},{},{}],f={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3};b=r(b);for(var g=b.next();!g.done;g=b.next())g=g.value,e[null!=f[g]?f[g]:1][g]=a[g];for(a=0;ae)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}M("shaka.util.ConfigUtils",wk);wk.convertToConfigObject=yk;wk.mergeConfigObjects=xk;function zk(){} function Ak(){var a=Infinity;navigator.connection&&navigator.connection.saveData&&(a=360);var b={retryParameters:Fe(),servers:{},clearKeys:{},advanced:{},delayLicenseRequestUntilPlayed:!1,initDataTransform:Yf,logLicenseExchange:!1,updateExpirationTime:1,preferredKeySystems:[]},c={retryParameters:Fe(),availabilityWindowOverride:NaN,disableAudio:!1,disableVideo:!1,disableText:!1,disableThumbnails:!1,defaultPresentationDelay:0,dash:{clockSyncUri:"",ignoreDrmInfo:!1,disableXlinkProcessing:!1,xlinkFailGracefully:!1, ignoreMinBufferTime:!1,autoCorrectDrift:!0,initialSegmentLimit:1E3,ignoreSuggestedPresentationDelay:!1,ignoreEmptyAdaptationSet:!1,ignoreMaxSegmentDuration:!1,keySystemsByURI:{"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:79f0049a-4098-8642-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime"}, manifestPreprocessor:function(g){return g}},hls:{ignoreTextStreamFailures:!1,ignoreImageStreamFailures:!1,defaultAudioCodec:"mp4a.40.2",defaultVideoCodec:"avc1.42E01E"}},d={retryParameters:Fe(),failureCallback:function(g){return[g]},rebufferingGoal:2,bufferingGoal:10,bufferBehind:30,ignoreTextStreamFailures:!1,alwaysStreamText:!1,startAtSegmentBoundary:!1,gapDetectionThreshold:.1,smallGapLimit:.5,jumpLargeGaps:!1,durationBackoff:1,forceTransmuxTS:!1,safeSeekOffset:5,stallEnabled:!0,stallThreshold:1, stallSkip:.1,useNativeHlsOnSafari:!0,inaccurateManifestTolerance:2,lowLatencyMode:!1,autoLowLatencyMode:!1,forceHTTPS:!1,preferNativeHls:!1,updateIntervalSeconds:1,dispatchAllEmsgBoxes:!1,observeQualityChanges:!1};if(navigator.userAgent.match(/Edge\//)||ud()||vd("CrKey"))d.gapDetectionThreshold=.5;if(vd("Web0S")||ud()||vd("CrKey"))d.stallSkip=0;var e={trackSelectionCallback:function(g){return K(function(h){return h["return"](g)})},downloadSizeCallback:function(g){var h;return K(function(k){if(1== k.g)return navigator.storage&&navigator.storage.estimate?u(k,navigator.storage.estimate(),3):k["return"](!0);h=k.h;return k["return"](h.usage+g<.95*h.quota)})},progressCallback:function(g,h){return[g,h]},usePersistentLicense:!0},f={drm:b,manifest:c,streaming:d,offline:e,abrFactory:function(){return new oe},abr:{enabled:!0,useNetworkInformation:!0,defaultBandwidthEstimate:1E6,switchInterval:8,bandwidthUpgradeTarget:.85,bandwidthDowngradeTarget:.95,restrictions:{minWidth:0,maxWidth:Infinity,minHeight:0, maxHeight:a,minPixels:0,maxPixels:Infinity,minFrameRate:0,maxFrameRate:Infinity,minBandwidth:0,maxBandwidth:Infinity},advanced:{minTotalBytes:128E3,minBytes:16E3,fastHalfLife:2,slowHalfLife:5}},preferredAudioLanguage:"",preferredTextLanguage:"",preferredVariantRole:"",preferredTextRole:"",preferredAudioChannelCount:2,preferredVideoCodecs:[],preferredAudioCodecs:[],preferForcedSubs:!1,preferredDecodingAttributes:[],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},cmcd:{enabled:!1,sessionId:"",contentId:"",useHeaders:!1}};e.trackSelectionCallback=function(g){return K(function(h){return h["return"](Bk(g,f.preferredAudioLanguage))})};return f} function Ck(a,b,c){var d={".drm.servers":"",".drm.clearKeys":"",".drm.advanced":{distinctiveIdentifierRequired:!1,persistentStateRequired:!1,videoRobustness:"",audioRobustness:"",sessionType:"",serverCertificate:new Uint8Array(0),serverCertificateUri:"",individualizationServer:""}};return xk(a,b,c||Ak(),d,"")} function Bk(a,b){var c=a.filter(function(h){return"variant"==h.type}),d=[],e=nd(b,c.map(function(h){return h.language}));e&&(d=c.filter(function(h){return gd(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=r(a);for(g=d.next();!g.done;g=d.next())g=g.value,g.type!=vc&&"image"!=g.type||c.push(g);return c}M("shaka.util.PlayerConfiguration",zk);zk.mergeConfigObjects=Ck;function Dk(){this.g=null;this.h=[]}function Ek(a,b){if(null==a.g)a.g={timestamp:Date.now()/1E3,state:b,duration:0};else{var c=Date.now()/1E3;a.g.duration=c-a.g.timestamp;a.g.state!=b&&(a.h.push(a.g),a.g={timestamp:c,state:b,duration:0})}}function Fk(a,b){var c=0;a.g&&a.g.state==b&&(c+=a.g.duration);for(var d=r(a.h),e=d.next();!e.done;e=d.next())e=e.value,c+=e.state==b?e.duration:0;return c} function Gk(a){function b(f){return{timestamp:f.timestamp,state:f.state,duration:f.duration}}for(var c=[],d=r(a.h),e=d.next();!e.done;e=d.next())c.push(b(e.value));a.g&&c.push(b(a.g));return c};function Hk(){this.i=this.h=null;this.g=[]}function Ik(a,b,c){a.i!=b&&(a.i=b,a.g.push({timestamp:Date.now()/1E3,id:b.id,type:"text",fromAdaptation:c,bandwidth:null}))};function Jk(){this.o=this.s=this.G=this.C=this.m=this.j=this.D=this.l=this.i=this.H=this.J=this.L=this.u=this.N=NaN;this.g=new Dk;this.h=new Hk};function V(a,b){R.call(this);var c=this;this.l=Kk;this.xc=this.g=null;this.pa=!1;this.m=new ff;this.kd=this.s=this.Ub=this.i=this.Dc=this.J=this.j=this.qa=this.X=this.Ec=this.L=this.yc=this.H=this.yb=this.D=this.N=this.o=this.G=null;this.wd=1E9;this.h=Lk(this);this.sd={width:Infinity,height:Infinity};this.u=null;this.vb=new we(this.h.preferredAudioLanguage,this.h.preferredVariantRole,this.h.preferredAudioChannelCount);this.wb=this.h.preferredTextLanguage;this.Ob=this.h.preferredTextRole;this.Vb=this.h.preferForcedSubs; this.md=[];this.Wb=null;b&&b(this);this.G=Mk(this);this.G.Od(this.h.streaming.forceHTTPS);this.C=null;Nk&&(this.C=Xb(Nk));this.m.A(window,"online",function(){c.Jd()});this.V={name:"detach"};this.$={name:"attach"};this.ha={name:"unload"};this.zd={name:"manifest-parser"};this.rd={name:"manifest"};this.xb={name:"media-source"};this.nd={name:"drm-engine"};this.fa={name:"load"};this.Dd={name:"src-equals-drm-engine"};this.zb={name:"src-equals"};var d=new Map;d.set(this.$,function(e,f){return Le(Ok(c,e, f))});d.set(this.V,function(e){e.F&&(c.m.Da(e.F,"error"),e.F=null);c.C&&c.C.release();c.g=null;e=Promise.resolve();return Le(e)});d.set(this.ha,function(e){return Le(Pk(c,e))});d.set(this.xb,function(e){e=Qk(c,e);return Le(e)});d.set(this.zd,function(e,f){var g=Rk(c,e,f);return Le(g)});d.set(this.rd,function(e){return Sk(c,e)});d.set(this.nd,function(e){e=Tk(c,e);return Le(e)});d.set(this.fa,function(e,f){return Le(Uk(c,e,f))});d.set(this.Dd,function(e,f){var g=Vk(c,e,f);return Le(g)});d.set(this.zb, function(e,f){return Wk(c,e,f)});this.Ga=new Hj(this.V,{gf:function(e,f,g,h){var k=null;e==c.V&&(k=g==c.V?c.V:c.$);e==c.$&&(k=g==c.V||f.F!=h.F?c.V:g==c.$?c.$:g==c.xb||g==c.fa?c.xb:g==c.zb?c.Dd:null);e==c.xb&&(k=g==c.fa&&f.F==h.F?c.zd:c.ha);e==c.zd&&(k=Xk(c.fa,c.rd,c.ha,g,f,h));e==c.rd&&(k=Xk(c.fa,c.nd,c.ha,g,f,h));e==c.nd&&(k=Xk(c.fa,c.fa,c.ha,g,f,h));e==c.Dd&&(k=g==c.zb&&f.F==h.F?c.zb:c.ha);if(e==c.fa||e==c.zb)k=c.ha;e==c.ha&&(k=h.F&&f.F==h.F?c.$:c.V);return k},Se:function(e,f,g){c.dispatchEvent(Yk(Zk, (new Map).set("state",e.name)));return d.get(e)(f,g)},handleError:function(e){return K(function(f){return 1==f.g?u(f,Pk(c,e),2):f["return"](e.F?c.$:c.V)})},Df:function(e){c.dispatchEvent(Yk($k,(new Map).set("state",e.name)))}});a&&this.Xb(a,!0)}ra(V,R);function Yk(a,b){return new P(a,b)}q=V.prototype; q.destroy=function(){var a=this,b;return K(function(c){switch(c.g){case 1:if(a.l==al)return c["return"]();a.l=al;b=Mj(a.Ga,function(){return{node:a.V,payload:Ij(),ib:!1}});return u(c,new Promise(function(d){b.Jb=function(){};b.Mc=function(){d()};b.mb=function(){d()};b.onError=function(){d()};b.Oc=function(){d()}}),2);case 2:return u(c,a.Ga.destroy(),3);case 3:a.m&&(a.m.release(),a.m=null);a.kd=null;a.s=null;a.h=null;a.u=null;a.xc=null;a.X=null;if(!a.G){c.B(4);break}return u(c,a.G.destroy(),5);case 5:a.G= null;case 4:R.prototype.release.call(a),z(c)}})};q.Xb=function(a,b){b=void 0===b?!0:b;if(this.l==al)return Promise.reject(bl());var c=Ij();c.F=a;rd()||(b=!1);var d=b?this.xb:this.$,e=Mj(this.Ga,function(){return{node:d,payload:c,ib:!1}});e.Jb=function(){};return cl(e)};q.detach=function(){var a=this;if(this.l==al)return Promise.reject(bl());var b=Mj(this.Ga,function(){return{node:a.V,payload:Ij(),ib:!1}});b.Jb=function(){};return cl(b)}; q.Vd=function(a){var b=this;a=void 0===a?!0:a;if(this.l==al)return Promise.reject(bl());rd()||(a=!1);var c=Ij(),d=Mj(this.Ga,function(e){var f=e.F&&a?b.xb:e.F?b.$:b.V;c.F=e.F;return{node:f,payload:c,ib:!1}});d.Jb=function(){};return cl(d)};q.eg=function(a){this.Wb=a}; q.load=function(a,b,c){var d=this;this.Wb=null;if(this.l==al)return Promise.reject(bl());this.dispatchEvent(Yk(dl));var e=Ij();e.uri=a;e.Sd=Date.now()/1E3;c&&(e.mimeType=c);void 0!==b&&(e.startTime=b);var f=el(this,e)?this.zb:this.fa,g=Mj(this.Ga,function(h){if(null==h.F)return null;e.F=h.F;return{node:f,payload:e,ib:!0}});this.u=new Jk;this.X=fl(this);g.Jb=function(){};return new Promise(function(h,k){g.Oc=function(){return k(new N(2,7,7002))};g.Mc=function(){h();d.dispatchEvent(Yk(gl))};g.mb=function(){return k(bl())}; g.onError=function(l){return k(l)}})};function el(a,b){if(!rd())return!0;var c=b.mimeType,d=b.uri||"";c||(c=jg(d),c=hl[c]);if(c){if(""==(b.F||td()).canPlayType(c))return!1;if(!rd()||!(c in ig||jg(d)in kg)||a.h.streaming.preferNativeHls)return!0;if(wd())return a.h.streaming.useNativeHlsOnSafari}return!1}function Ok(a,b,c){null==b.F&&(b.F=c.F,a.m.A(b.F,"error",function(){var d=il(a);d&&jl(a,d)}));a.g=b.F;return Promise.resolve()} function Pk(a,b){var c,d,e,f,g,h,k,l,m;return K(function(n){switch(n.g){case 1:return a.l!=al&&(a.l=Kk),c=a.md.map(function(p){return p()}),a.md=[],u(n,Promise.all(c),2);case 2:a.dispatchEvent(Yk(kl));b.mimeType=null;b.startTime=null;b.uri=null;b.F&&(a.m.Da(b.F,"loadedmetadata"),a.m.Da(b.F,"playing"),a.m.Da(b.F,"pause"),a.m.Da(b.F,"ended"),a.m.Da(b.F,"ratechange"));a.yb&&(a.yb.release(),a.yb=null);a.yc&&(a.yc.stop(),a.yc=null);if(!a.J){n.B(3);break}return u(n,a.J.stop(),4);case 4:a.J=null,a.Dc=null; case 3:if(!a.s){n.B(5);break}return u(n,a.s.stop(),5);case 5:if(!a.j){n.B(7);break}return u(n,a.j.destroy(),8);case 8:a.j=null;case 7:a.H&&(a.H.release(),a.H=null);a.D&&(a.D.release(),a.D=null);if(!a.N){n.B(9);break}return u(n,a.N.destroy(),10);case 10:a.N=null;case 9:if(a.C)a.C.onAssetUnload();if(!b.F||!b.F.src){n.B(11);break}return u(n,new Promise(function(p){return(new O(p)).R(.1)}),12);case 12:for(b.F.removeAttribute("src"),b.F.load();b.F.lastChild;)b.F.removeChild(b.F.firstChild);case 11:if(!a.o){n.B(13); break}return u(n,a.o.destroy(),14);case 14:a.o=null;case 13:a.Ub=null;a.L=null;if(a.i){d=r(a.i.variants);for(e=d.next();!e.done;e=d.next())for(f=e.value,g=r([f.audio,f.video]),h=g.next();!h.done;h=g.next())(k=h.value)&&k.segmentIndex&&k.segmentIndex.release();l=r(a.i.textStreams);for(h=l.next();!h.done;h=l.next())m=h.value,m.segmentIndex&&m.segmentIndex.release()}a.i=null;a.u=new Jk;a.qd=null;ll(a);z(n)}})} function Qk(a,b){var c,d,e,f;return K(function(g){if(1==g.g)return c=new Jh,d=a.h.textDisplayFactory,e=Xb(d),a.qd=d,f=ml(b.F,c,e,function(h,k,l){h=r(h);for(var m=h.next();!m.done;m=h.next())if(m=m.value,m.data&&m.cueTime&&m.frames){for(var n=m.cueTime+k,p=l,t=r(m.frames),v=t.next();!v.done;v=t.next())nl(a,n,p,"ID3",v.value);if(a.C)a.C.onHlsTimedMetadata(m,n)}}),u(g,f.D,2);a.N=f;z(g)})} function Rk(a,b,c){var d,e,f,g;return K(function(h){if(1==h.g)return b.mimeType=c.mimeType,b.uri=c.uri,d=b.uri,e=a.G,a.Ub=d,f=a,u(h,hg(d,e,a.h.manifest.retryParameters,b.mimeType),2);f.Dc=h.h;a.J=Xb(a.Dc);g=Pe(a.h.manifest);c.F&&"AUDIO"===c.F.nodeName&&(g.disableVideo=!0);a.J.configure(g);z(h)})} function Sk(a,b){var c=b.uri,d=a.G;a.Ec=new Yi(function(){return a.kc()});a.Ec.addEventListener("regionadd",function(g){g=g.region;ol(a,pl,g);if(a.C)a.C.onDashTimedMetadata(g)});a.qa=null;a.h.streaming.observeQualityChanges&&(a.qa=new Ui(function(){return a.Za()}),a.qa.addEventListener("qualitychange",function(g){var h=g.quality;g=g.position;h=(new Map).set("mediaQuality",{bandwidth:h.bandwidth,audioSamplingRate:h.audioSamplingRate,codecs:h.codecs,contentType:h.contentType,frameRate:h.frameRate,height:h.height, mimeType:h.mimeType,channelsCount:h.channelsCount,pixelAspectRatio:h.pixelAspectRatio,width:h.width}).set("position",g);a.dispatchEvent(Yk(ql,h))}));var e={networkingEngine:d,modifyManifestRequest:function(g,h){var k=a.X;try{k.g.enabled&&(k.o=h.format,mk(k,g,{ot:pk,su:!k.i}))}catch(l){Ya("CMCD_MANIFEST_ERROR","Could not generate manifest CMCD data.",l)}},modifySegmentRequest:function(g,h){ck(a.X,g,h)},filter:function(g){return rl(a,g)},makeTextStreamsForClosedCaptions:function(g){return sl(a,g)}, onTimelineRegionAdded:function(g){var h=a.Ec;a:{var k=r(h.g);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.g.add(g),g=new P("regionadd",new Map([["region",g]])),h.dispatchEvent(g))},onEvent:function(g){return a.dispatchEvent(g)},onError:function(g){return jl(a,g)},isLowLatencyMode:function(){return a.h.streaming.lowLatencyMode},isAutoLowLatencyMode:function(){return a.h.streaming.autoLowLatencyMode}, enableLowLatencyMode:function(){a.configure("streaming.lowLatencyMode",!0)}},f=Date.now()/1E3;return new He(function(){var g,h,k,l;return K(function(m){if(1==m.g)return g=a,u(m,a.J.start(c,e),2);g.i=m.h;h=Yk(tl);a.dispatchEvent(h);if(0==a.i.variants.length)throw new N(2,4,4036);ul(a.i);k=Date.now()/1E3;l=k-f;a.u.D=l;z(m)})}(),function(){return a.J.stop()})} function Tk(a,b){var c,d;return K(function(e){return 1==e.g?(c=Date.now()/1E3,d=!0,a.o=vl(a,{lb:a.G,onError:function(f){jl(a,f)},Nc:function(f){wl(a,f)},onExpirationUpdated:function(f,g){xl(a,f,g)},onEvent:function(f){a.dispatchEvent(f);f.type==yl&&d&&(d=!1,a.u.j=Date.now()/1E3-c)}}),a.o.configure(a.h.drm),u(e,yf(a.o,a.i.variants,a.i.offlineSessionIds),2)):3!=e.g?u(e,a.o.Xb(b.F),3):u(e,rl(a,a.i),0)})} function Uk(a,b,c){var d,e,f,g,h,k,l,m,n,p,t,v;return K(function(y){switch(y.g){case 1:b.startTime=c.startTime;null!=a.Wb&&(b.startTime=a.Wb,a.Wb=null);d=b.F;e=b.uri;a.Ub=e;a.H=new Qi({Jc:function(){return b.F.playbackRate},Fc:function(){return b.F.defaultPlaybackRate},Qd:function(x){b.F.playbackRate=x},pe:function(x){b.F.currentTime+=x}});f=function(){return zl(a)};g=function(){return Al(a)};a.m.A(d,"playing",f);a.m.A(d,"pause",f);a.m.A(d,"ended",f);a.m.A(d,"ratechange",g);h=a.h.abrFactory;a.s&& a.kd==h||(a.kd=h,a.s=Xb(h),"function"!=typeof a.s.playbackRateChanged&&(Qb("AbrManager","Please use an AbrManager with playbackRateChanged function."),a.s.playbackRateChanged=function(){}),a.s.configure(a.h.abr));a.vb=new we(a.h.preferredAudioLanguage,a.h.preferredVariantRole,a.h.preferredAudioChannelCount);a.wb=a.h.preferredTextLanguage;a.Ob=a.h.preferredTextRole;a.Vb=a.h.preferForcedSubs;Bl(a.i.presentationTimeline,a.h.playRangeStart,a.h.playRangeEnd);a.s.init(function(x,w,C){a.j&&x!=a.j.l&&Cl(a, x,!0,void 0===w?!1:w,void 0===C?0:C)});a.D=Dl(a,b.startTime);a.yb=El(a);k=Math.max(a.i.minBufferTime,a.h.streaming.rebufferingGoal);Fl(a,k);Ad(a.i,a.h.preferredVideoCodecs,a.h.preferredAudioCodecs,a.h.preferredAudioChannelCount,a.h.preferredDecodingAttributes);a.j=Gl(a);a.j.configure(a.h.streaming);a.l=Hl;a.dispatchEvent(Yk(Il));l=null;if(m=a.hb().find(function(x){return x.active})){y.B(2);break}l=Jl(a)?a.s.chooseVariant():null;Cl(a,l,!0,!1,0);if(!a.h.streaming.startAtSegmentBoundary){y.B(3);break}n= a.D.m();return u(y,Kl(l,n),4);case 4:p=y.h,a.D.o(p);case 3:Ll(a,null,be(l));case 2:return t=a.gb().find(function(x){return x.active}),t||((v=le(a.i.textStreams,a.wb,a.Ob,a.Vb)[0]||null)&&Ik(a.u.h,v,!0),l&&(v?(l.audio&&Ml(a,l.audio,v)&&(a.pa=!0),a.pa&&a.N.l.setTextVisibility(!0),Nl(a)):a.pa=!1),v&&(a.h.streaming.alwaysStreamText||a.pd())&&qj(a.j,v)),u(y,a.j.start(),5);case 5:a.h.abr.enabled&&(a.s.enable(),Ol(a)),Qd(a.j?a.j.l:null,a.i),Pl(a.i),Ql(a),Jl(a),a.i.variants.some(function(x){return x.primary}), a.m.ta(d,"loadedmetadata",function(){a.u.l=Date.now()/1E3-c.Sd}),z(y)}})} function Vk(a,b,c){var d,e,f,g,h,k,l;return K(function(m){return 1==m.g?(d=wc,e=Date.now()/1E3,f=!0,a.o=vl(a,{lb:a.G,onError:function(n){jl(a,n)},Nc:function(n){wl(a,n)},onExpirationUpdated:function(n,p){xl(a,n,p)},onEvent:function(n){a.dispatchEvent(n);n.type==yl&&f&&(f=!1,a.u.j=Date.now()/1E3-e)}}),a.o.configure(a.h.drm),g=c.uri||"",h=jg(g),k=hl[h],"application/x-mpegurl"==k&&wd()&&(k="application/vnd.apple.mpegurl"),k||(k="video/mp4"),l={id:0,language:"und",primary:!1,audio:null,video:{id:0,originalId:null, createSegmentIndex:function(){return Promise.resolve()},segmentIndex:null,mimeType:c.mimeType?c.mimeType.split(";")[0]:k,codecs:c.mimeType?Vc(c.mimeType):"",encrypted:!0,drmInfos:[],keyIds:new Set,language:"und",label:null,type:d.Na,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null},bandwidth:100,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]},a.o.$=!0,u(m,yf(a.o,[l],[]),2)):u(m,a.o.Xb(b.F), 0)})} function Wk(a,b,c){function d(){return zl(a)}b.uri=c.uri;b.startTime=c.startTime;a.Ub=b.uri;a.D=new Gi(b.F);null!=b.startTime&&a.D.o(b.startTime);a.H=new Qi({Jc:function(){return b.F.playbackRate},Fc:function(){return b.F.defaultPlaybackRate},Qd:function(h){b.F.playbackRate=h},pe:function(h){b.F.currentTime+=h}});Fl(a,a.h.streaming.rebufferingGoal);a.m.A(b.F,"playing",d);a.m.A(b.F,"pause",d);a.m.A(b.F,"ended",d);a.m.A(b.F,"ratechange",function(){return Al(a)});"none"!=a.g.preload&&a.m.ta(a.g,"loadedmetadata", function(){a.u.l=Date.now()/1E3-c.Sd});a.g.audioTracks&&(a.m.A(a.g.audioTracks,"addtrack",function(){return Ql(a)}),a.m.A(a.g.audioTracks,"removetrack",function(){return Ql(a)}),a.m.A(a.g.audioTracks,"change",function(){return Ql(a)}));a.g.textTracks&&(a.m.A(a.g.textTracks,"addtrack",function(h){if(h.track)switch(h=h.track,h.kind){case "metadata":Rl(a,h);break;case "chapters":Sl(a,h);break;default:Ql(a)}}),a.m.A(a.g.textTracks,"removetrack",function(){return Ql(a)}),a.m.A(a.g.textTracks,"change", function(){return Ql(a)}));var e=jg(b.uri);b.F.src=nk(a.X,b.uri,hl[e]);(ud()||vd("Web0S"))&&b.F.load();a.l=Tl;a.dispatchEvent(Yk(Il));var f=new xc;xi(a.g,HTMLMediaElement.HAVE_METADATA,a.m,function(){f.resolve()});var g=!1;a.md.push(function(){g=!0});xi(a.g,HTMLMediaElement.HAVE_CURRENT_DATA,a.m,function(){var h;return K(function(k){if(1==k.g){if(g)return k["return"]();Ul(a);h=Vl(a);return h.find(function(l){return"disabled"!=l.mode})?k.B(2):u(k,new Promise(function(l){a.m.ta(a.g.textTracks,"change", l);(new O(l)).R(1)}),2)}if(g)return k["return"]();Wl(a);z(k)})});a.g.error?f.reject(il(a)):"none"==a.g.preload&&(Xa('With