aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordedeibel2018-12-28 21:48:19 +0100
committerdedeibel2018-12-28 21:48:19 +0100
commitcdff0cdfe99b111219af1eee8550b3c051b09a3d (patch)
tree0fc700bca30672d59c1587aa516d3b43e2bf2057
parent71792b6b56ea48327debffdc6743a521d65bb035 (diff)
parent8a01788fdc5e7d3062d66388b41350fe85d95c56 (diff)
Merge branch 'master' of ssh://git.c3voc.de/streaming-website
Diffstat (limited to '')
-rw-r--r--assets/clapprio/dash-shaka-playback.min.js2
-rw-r--r--template/assemblies/player/audio.phtml2
2 files changed, 2 insertions, 2 deletions
diff --git a/assets/clapprio/dash-shaka-playback.min.js b/assets/clapprio/dash-shaka-playback.min.js
index 6c746b6..ca58633 100644
--- a/assets/clapprio/dash-shaka-playback.min.js
+++ b/assets/clapprio/dash-shaka-playback.min.js
@@ -1,2 +1,2 @@
-!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("clappr")):"function"==typeof define&&define.amd?define(["clappr"],e):"object"==typeof exports?exports.DashShakaPlayback=e(require("clappr")):t.DashShakaPlayback=e(t.Clappr)}("undefined"!=typeof self?self:this,function(t){return function(t){function e(n){if(i[n])return i[n].exports;var r=i[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var i={};return e.m=t,e.c=i,e.d=function(t,i,n){e.o(t,i)||Object.defineProperty(t,i,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(i,"a",i),i},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="dist/",e(e.s=0)}([function(t,e,i){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function t(e,i,n){null===e&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,i);if(void 0===r){var a=Object.getPrototypeOf(e);return null===a?void 0:t(a,i,n)}if("value"in r)return r.value;var s=r.get;if(void 0!==s)return s.call(n)},o=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),u=i(1),h=i(2),c=function(t){return t&&t.__esModule?t:{default:t}}(h),l=function(t){function e(t){n(this,e);var i=r(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return i._levels=[],i._pendingAdaptationEvent=!1,i._isShakaReadyState=!1,t.autoPlay&&i.play(),i}return a(e,t),o(e,[{key:"name",get:function(){return"dash_shaka_playback"}},{key:"shakaVersion",get:function(){return c.default.player.Player.version}},{key:"shakaPlayerInstance",get:function(){return this._player}},{key:"levels",get:function(){return this._levels}},{key:"currentLevel",set:function(t){var e=this;this._currentLevelId=t;var i=-1===this._currentLevelId;this.trigger(u.Events.PLAYBACK_LEVEL_SWITCH_START),i?(this._player.configure({abr:{enabled:!0}}),this.trigger(u.Events.PLAYBACK_LEVEL_SWITCH_END)):(this._player.configure({abr:{enabled:!1}}),this._pendingAdaptationEvent=!0,this.selectTrack(this.videoTracks.filter(function(t){return t.id===e._currentLevelId})[0]))},get:function(){return this._currentLevelId||-1}}],[{key:"canPlay",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";c.default.polyfill.installAll();var i=c.default.Player.isBrowserSupported(),n=t.split("?")[0].match(/.*\.(.*)$/)||[];return i&&("mpd"===n[1]||e.indexOf("application/dash+xml")>-1)}},{key:"Events",get:function(){return{SHAKA_READY:"shaka:ready"}}}]),o(e,[{key:"play",value:function(){if(this._player||this._setup(),!this.isReady)return void this.once(e.Events.SHAKA_READY,this.play);this._stopped=!1,this._src=this.el.src,s(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"play",this).call(this)}},{key:"setupSrc",value:function(){}},{key:"_ready",value:function(){}},{key:"_onShakaReady",value:function(){this._isShakaReadyState=!0,this.trigger(e.Events.SHAKA_READY),this.trigger(u.Events.PLAYBACK_READY,this.name)}},{key:"error",value:function(t){u.Log.error("an error was raised by the video tag",t,this.el.error)}},{key:"isHighDefinitionInUse",value:function(){return!1}},{key:"stop",value:function(){var t=this;clearInterval(this.sendStatsId),this._stopped=!0,this._player?(this._sendStats(),this._player.unload().then(function(){s(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"stop",t).call(t),t._player=null,t._isShakaReadyState=!1}).catch(function(){u.Log.error("shaka could not be unloaded")})):s(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"stop",this).call(this)}},{key:"getPlaybackType",value:function(){return(this.isReady&&this._player.isLive()?"live":"vod")||""}},{key:"selectAudioLanguage",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this._player.selectAudioLanguage(t,e)}},{key:"selectTrack",value:function(t){if("text"===t.type)this._player.selectTextTrack(t);else{if("variant"!==t.type)throw new Error("Unhandled track type:",t.type);this._player.selectVariantTrack(t),t.mimeType.startsWith("video/")&&this._onAdaptation()}}},{key:"_enableShakaTextTrack",value:function(t){this.el.textTracks&&(this._shakaTTVisible=t,Array.from(this.el.textTracks).filter(function(t){return"subtitles"===t.kind}).forEach(function(e){return e.mode=!0===t?"showing":"hidden"}))}},{key:"_checkForClosedCaptions",value:function(){if(!this._ccIsSetup){if(this.hasClosedCaptionsTracks){this.trigger(u.Events.PLAYBACK_SUBTITLE_AVAILABLE);var t=this.closedCaptionsTrackId;this.closedCaptionsTrackId=t}this._ccIsSetup=!0}}},{key:"destroy",value:function(){var t=this;clearInterval(this.sendStatsId),this._player?this._player.destroy().then(function(){return t._destroy()}).catch(function(){t._destroy(),u.Log.error("shaka could not be destroyed")}):this._destroy()}},{key:"_setup",value:function(){var t=this;this._isShakaReadyState=!1,this._ccIsSetup=!1,this._player=this._createPlayer(),this._options.shakaConfiguration&&this._player.configure(this._options.shakaConfiguration),this._options.shakaOnBeforeLoad&&this._options.shakaOnBeforeLoad(this._player),this._player.load(this._options.src).then(function(){return t._loaded()}).catch(function(e){return t._setupError(e)})}},{key:"_createPlayer",value:function(){var t=new c.default.Player(this.el);return t.addEventListener("error",this._onError.bind(this)),t.addEventListener("adaptation",this._onAdaptation.bind(this)),t.addEventListener("buffering",this._onBuffering.bind(this)),t}},{key:"_onBuffering",value:function(t){if(!this._stopped){var e=t.buffering?u.Events.PLAYBACK_BUFFERING:u.Events.PLAYBACK_BUFFERFULL;this.trigger(e)}}},{key:"_loaded",value:function(){this._onShakaReady(),this._startToSendStats(),this._fillLevels(),this._checkForClosedCaptions()}},{key:"_fillLevels",value:function(){0===this._levels.length&&(this._levels=this.videoTracks.slice(0).reverse(),this.trigger(u.Events.PLAYBACK_LEVELS_AVAILABLE,this.levels))}},{key:"_startToSendStats",value:function(){var t=this,e=this._options.shakaSendStatsInterval||3e4;this.sendStatsId=setInterval(function(){return t._sendStats()},e)}},{key:"_sendStats",value:function(){this.trigger(u.Events.PLAYBACK_STATS_ADD,this._player.getStats())}},{key:"_setupError",value:function(t){this._onError(t)}},{key:"_onError",value:function(t){var e=this;u.Log.error("Shaka error event:",t.detail),this.trigger(u.Events.PLAYBACK_ERROR,t,this.name),t.detail&&2==t.detail.severity&&1002==t.detail.code&&(console.log("retrying"),this.stop(),setTimeout(function(){return e.play()},1e3))}},{key:"_onAdaptation",value:function(){var t=this.videoTracks.filter(function(t){return!0===t.active})[0];this._fillLevels(),this._sendStats(),this._pendingAdaptationEvent_&&(this.trigger(u.Events.PLAYBACK_LEVEL_SWITCH_END),this._pendingAdaptationEvent=!1),u.Log.debug("an adaptation has happened:",t),this.trigger(u.Events.PLAYBACK_BITRATE,{bandwidth:t.bandwidth,language:t.language,width:t.width,height:t.height,level:t.id})}},{key:"_destroy",value:function(){s(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"destroy",this).call(this),this._isShakaReadyState=!1,u.Log.debug("shaka was destroyed")}},{key:"isReady",get:function(){return this._isShakaReadyState}},{key:"textTracks",get:function(){return this.isReady&&this._player.getTextTracks()}},{key:"audioLanguages",get:function(){return this.isReady&&this._player.getAudioLanguages()}},{key:"audioTracks",get:function(){return this.isReady&&this._player.getVariantTracks().filter(function(t){return t.mimeType.startsWith("audio/")})}},{key:"videoTracks",get:function(){return this.isReady&&this._player.getVariantTracks().filter(function(t){return t.mimeType.startsWith("video/")})}},{key:"closedCaptionsTracks",get:function(){var t=0,e=function(){return t++};return(this.textTracks||[]).filter(function(t){return"subtitle"===t.kind}).map(function(t){return{id:e(),name:t.label||t.language,track:t}})}},{key:"closedCaptionsTrackId",get:function(){return s(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"closedCaptionsTrackId",this)},set:function(t){if(this._player){var e=this.closedCaptionsTracks,i=void 0;if(-1!==t){if(!(i=e.find(function(e){return e.id===t})))return void u.Log.warn('Track id "'+t+'" not found');if(this._shakaTTVisible&&!0===i.track.active)return void u.Log.info('Track id "'+t+'" already showing')}i?(this._player.selectTextTrack(i.track),this._enableShakaTextTrack(!0)):this._enableShakaTextTrack(!1),this._ccTrackId=t,this.trigger(u.Events.PLAYBACK_SUBTITLE_CHANGED,{id:t})}}}]),e}(u.HTML5Video);e.default=l,t.exports=e.default},function(e,i){e.exports=t},function(t,e,i){var n;!function(){var r={};(function(t){function e(t,e){var i=t.split("."),n=Do;i[0]in n||!n.execScript||n.execScript("var "+i[0]);for(var r;i.length&&(r=i.shift());)i.length||void 0===e?n=n[r]?n[r]:n[r]={}:n[r]=e}function i(t){function e(){}var i=Re;e.prototype=i.prototype,t.ff=i.prototype,t.prototype=new e,t.prototype.constructor=t,t.df=function(t,e,n){return i.prototype[e].apply(t,Array.prototype.slice.call(arguments,2))}}function n(t){this.c=Math.exp(Math.log(.5)/t),this.b=this.a=0}function r(t,e,i){var n=Math.pow(t.c,e);i=i*(1-n)+n*t.a,isNaN(i)||(t.a=i,t.b+=e)}function a(t){return t.a/(1-Math.pow(t.c,t.b))}function s(){this.b=new n(2),this.c=new n(5),this.a=0}function o(){}function u(){}function h(t,e,i,n){this.severity=t,this.category=e,this.code=i,this.data=Array.prototype.slice.call(arguments,3),this.handled=!1}function c(t){var e;t instanceof c?(l(this,t.da),this.Ba=t.Ba,this.ia=t.ia,f(this,t.La),this.Y=t.Y,d(this,g(t.a)),this.ua=t.ua):t&&(e=String(t).match(Mo))?(l(this,e[1]||"",!0),this.Ba=p(e[2]||""),this.ia=p(e[3]||"",!0),f(this,e[4]),this.Y=p(e[5]||"",!0),d(this,e[6]||"",!0),this.ua=p(e[7]||"")):this.a=new v(null)}function l(t,e,i){t.da=i?p(e,!0):e,t.da&&(t.da=t.da.replace(/:$/,""))}function f(t,e){if(e){if(e=Number(e),isNaN(e)||0>e)throw Error("Bad port number "+e);t.La=e}else t.La=null}function d(t,e,i){e instanceof v?t.a=e:(i||(e=m(e,jo)),t.a=new v(e))}function p(t,e){return t?e?decodeURI(t):decodeURIComponent(t):""}function m(t,e,i){return"string"==typeof t?(t=encodeURI(t).replace(e,y),i&&(t=t.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),t):null}function y(t){return t=t.charCodeAt(0),"%"+(t>>4&15).toString(16)+(15&t).toString(16)}function v(t){this.b=t||null}function g(t){var e=new v;if(e.b=t.b,t.a){var i,n={};for(i in t.a)n[i]=t.a[i].concat();e.a=n,e.c=t.c}return e}function b(){var t,e,i=new Promise(function(i,n){t=i,e=n});return i.resolve=t,i.reject=e,i}function T(t,e,i){var n=E();this.j=null==t.maxAttempts?n.maxAttempts:t.maxAttempts,this.f=null==t.baseDelay?n.baseDelay:t.baseDelay,this.i=null==t.fuzzFactor?n.fuzzFactor:t.fuzzFactor,this.h=null==t.backoffFactor?n.backoffFactor:t.backoffFactor,this.a=0,this.b=this.f,this.c=e||!1,this.g=i||null,this.c&&(this.a=1)}function w(t){if(t.a>=t.j){if(!t.c)return Promise.reject();t.a=1,t.b=t.f}var e=new b;return t.a?(S(t,e.resolve,t.b*(1+(2*Math.random()-1)*t.i)),t.b*=t.h):e.resolve(),t.a++,e}function E(){return{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:0}}function S(t,e,i){if(t.g)if(t.g()||!i)e();else{var n=Math.min(200,i);A(function(){S(this,e,i-n)}.bind(t),n)}else A(e,i)}function A(e,i){t.setTimeout(e,i)}function k(t,e,i,n,r){var a,s=r in n;for(a in e){var o=r+"."+a,u=s?n[r]:i[a];(s||a in t)&&(void 0===e[a]?void 0===u||s?delete t[a]:t[a]=u:u.constructor==Object&&e[a]&&e[a].constructor==Object?(t[a]||(t[a]=u),k(t[a],e[a],u,n,o)):typeof e[a]==typeof u&&null!=e[a]&&e[a].constructor==u.constructor&&(t[a]=e[a]))}}function I(t){function e(t){switch(typeof t){case"undefined":case"boolean":case"number":case"string":case"symbol":case"function":return t;default:if(!t)return t;if(0<=i.indexOf(t))return null;var n=t.constructor==Array;if(t.constructor!=Object&&!n)return null;i.push(t);var r,a=n?[]:{};for(r in t)a[r]=e(t[r]);return n&&(a.length=t.length),a}}var i=[];return e(t)}function _(t,e){return t.reduce(function(t,e,i){return e.catch(t.bind(null,i))}.bind(null,e),Promise.reject())}function P(t,e){return t.concat(e)}function x(){}function R(t){return null!=t}function N(t,e,i){return i.indexOf(t)==e}function L(t){this.f=!1,this.a=[],this.b=[],this.c=[],this.g=t||null}function D(t,e,i){i=i||3;var n=Fo[t];(!n||i>=n.ke)&&(Fo[t]={ke:i,ie:e})}function M(t,e){return{uris:t,method:"GET",body:null,headers:{},allowCrossSiteCredentials:!1,retryParameters:e}}function C(t,e,i,n,r,a,s){if(t.f||s())return Promise.reject();var o=new c(i.uris[r]),u=o.da;if(u||(u=location.protocol,u=u.slice(0,-1),l(o,u),i.uris[r]=o.toString()),!(u=(u=Fo[u])?u.ie:null))return Promise.reject(new h(2,1,1e3,o));var f=Date.now();return u(i.uris[r],i,e).then(function(t){void 0==t.timeMs&&(t.timeMs=Date.now()-f);var i=Date.now(),n=Promise.resolve();return this.c.forEach(function(i){n=n.then(function(){return Promise.resolve(i(e,t))}.bind(this))}.bind(this)),n=n.catch(function(t){var e=2;throw t instanceof h&&(e=t.severity),new h(e,1,1007,t)}),n.then(function(){return t.timeMs+=Date.now()-i,t.timeMs+=a,t})}.bind(t)).catch(function(t){if(t&&1==t.severity)return r=(r+1)%i.uris.length,s()?Promise.reject():w(n).then(function(){return C(this,e,i,n,r,a,s)}.bind(this),function(){throw t});throw t}.bind(t))}function O(t,e){for(var i=[],n=0;n<t.length;++n){for(var r=!1,a=0;a<i.length&&!(r=e?e(t[n],i[a]):t[n]===i[a]);++a);r||i.push(t[n])}return i}function U(t,e,i){for(var n=0;n<t.length;++n)if(i(t[n],e))return n;return-1}function j(t,e){var i=t.indexOf(e);-1<i&&t.splice(i,1)}function B(t,e){var i=0;return t.forEach(function(t){i+=e(t)?1:0}),i}function F(){this.a={}}function V(){this.a=new F}function H(t,e,i,n){t.a&&(e=new G(e,i,n),t.a.push(i,e))}function K(t,e,i,n){H(t,e,i,function(t){this.ga(e,i),n(t)}.bind(t))}function q(t){if(t.a){var e,i=t.a,n=[];for(e in i.a)n.push.apply(n,i.a[e]);for(i=0;i<n.length;++i)n[i].ga();t.a.a={}}}function G(t,e,i){this.target=t,this.type=e,this.a=i,this.target.addEventListener(e,i,!1)}function X(e,i){var n,r=i||{};for(n in r)this[n]=r[n];this.defaultPrevented=this.cancelable=this.bubbles=!1,this.timeStamp=t.performance&&t.performance.now?t.performance.now():Date.now(),this.type=e,this.isTrusted=!1,this.target=this.currentTarget=null,this.a=!1}function Y(t,e){if(!e.length)return t;var i=e.map(function(t){return new c(t)});return t.map(function(t){return new c(t)}).map(function(t){return i.map(t.resolve.bind(t))}).reduce(P,[]).map(function(t){return t.toString()})}function z(t,e){return{keySystem:t,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:e||[],keyIds:[]}}function $(t){return!t||!Object.keys(t).length}function W(t){return Object.keys(t).map(function(e){return t[e]})}function J(t,e){return Object.keys(t).every(function(i){return e(i,t[i])})}function Q(t,e){Object.keys(t).forEach(function(i){e(i,t[i])})}function Z(t,e){var i=t;return e&&(i+='; codecs="'+e+'"'),i}function tt(t){if(!t)return"";t=new Uint8Array(t),239==t[0]&&187==t[1]&&191==t[2]&&(t=t.subarray(3)),t=escape(rt(t));try{return decodeURIComponent(t)}catch(t){throw new h(2,2,2004)}}function et(t,e,i){if(!t)return"";if(!i&&t.byteLength%2)throw new h(2,2,2004);if(t instanceof ArrayBuffer)var n=t;else i=new Uint8Array(t.byteLength),i.set(new Uint8Array(t)),n=i.buffer;t=Math.floor(t.byteLength/2),i=new Uint16Array(t),n=new DataView(n);for(var r=0;r<t;r++)i[r]=n.getUint16(2*r,e);return rt(i)}function it(t){var e=new Uint8Array(t);if(239==e[0]&&187==e[1]&&191==e[2])return tt(e);if(254==e[0]&&255==e[1])return et(e.subarray(2),!1);if(255==e[0]&&254==e[1])return et(e.subarray(2),!0);var i=function(t,e){return t.byteLength<=e||32<=t[e]&&126>=t[e]}.bind(null,e);if(!e[0]&&!e[2])return et(t,!1);if(!e[1]&&!e[3])return et(t,!0);if(i(0)&&i(1)&&i(2)&&i(3))return tt(t);throw new h(2,2,2003)}function nt(t){t=unescape(encodeURIComponent(t));for(var e=new Uint8Array(t.length),i=0;i<t.length;++i)e[i]=t.charCodeAt(i);return e.buffer}function rt(t){for(var e="",i=0;i<t.length;i+=16e3)e+=String.fromCharCode.apply(null,t.subarray(i,i+16e3));return e}function at(t){this.a=null,this.b=function(){this.a=null,t()}.bind(this)}function st(t,e){t.cancel(),t.a=setTimeout(t.b,1e3*e)}function ot(t,e){t.cancel();var i=function(){this.b(),this.a=setTimeout(i,1e3*e)}.bind(t);t.a=setTimeout(i,1e3*e)}function ut(e,i){var n=void 0==i||i,r=t.btoa(String.fromCharCode.apply(null,e)).replace(/\+/g,"-").replace(/\//g,"_");return n?r:r.replace(/=*$/,"")}function ht(e){e=t.atob(e.replace(/-/g,"+").replace(/_/g,"/"));for(var i=new Uint8Array(e.length),n=0;n<e.length;++n)i[n]=e.charCodeAt(n);return i}function ct(e){for(var i=new Uint8Array(e.length/2),n=0;n<e.length;n+=2)i[n/2]=t.parseInt(e.substr(n,2),16);return i}function lt(t){for(var e="",i=0;i<t.length;++i){var n=t[i].toString(16);1==n.length&&(n="0"+n),e+=n}return e}function ft(t,e){if(!t&&!e)return!0;if(!t||!e||t.length!=e.length)return!1;for(var i=0;i<t.length;++i)if(t[i]!=e[i])return!1;return!0}function dt(t){for(var e=0,i=0;i<arguments.length;++i)e+=arguments[i].length;for(var e=new Uint8Array(e),n=0,i=0;i<arguments.length;++i)e.set(arguments[i],n),n+=arguments[i].length;return e}function pt(t){this.s=t,this.l=this.j=this.u=null,this.K=!1,this.b=null,this.f=new V,this.a=[],this.m=[],this.i=new b,this.h=null,this.g=function(e){this.i.reject(e),t.onError(e)}.bind(this),this.A={},this.F=new at(this.le.bind(this)),this.ha=this.c=!1,this.J=[],this.W=!1,this.w=new at(this.je.bind(this)),ot(this.w,1),this.i.catch(function(){})}function mt(t,e){if(!t.j)return K(t.f,e,"encrypted",function(){this.g(new h(2,6,6010))}.bind(t)),Promise.resolve();t.l=e,K(t.f,t.l,"play",t.Pd.bind(t));var i=t.l.setMediaKeys(t.j),i=i.catch(function(t){return Promise.reject(new h(2,6,6003,t.message))}),n=null;return t.b.serverCertificate&&t.b.serverCertificate.length&&(n=t.j.setServerCertificate(t.b.serverCertificate).then(function(){}).catch(function(t){return Promise.reject(new h(2,6,6004,t.message))})),Promise.all([i,n]).then(function(){if(this.c)return Promise.reject();vt(this),this.b.initData.length||this.m.length||H(this.f,this.l,"encrypted",this.Ed.bind(this))}.bind(t)).catch(function(t){return this.c?Promise.resolve():Promise.reject(t)}.bind(t))}function yt(t,e){return Promise.all(e.map(function(t){return kt(this,t).then(function(t){if(t){for(var e=new b,i=0;i<this.a.length;i++)if(this.a[i].ea==t){this.a[i].ma=e;break}return Promise.all([t.remove(),e])}}.bind(this))}.bind(t)))}function vt(t){var e=t.b?t.b.initData:[];return e.forEach(function(t){It(this,t.initDataType,t.initData)}.bind(t)),t.m.forEach(function(t){kt(this,t)}.bind(t)),e.length||t.m.length||t.i.resolve(),t.i}function gt(t){return t.a.map(function(t){return t.ea.sessionId})}function bt(e,i,n,r,a){var s=Et(e);i.periods.forEach(function(e){e.variants.forEach(function(e){s&&(e.drmInfos=[s]),e.drmInfos.forEach(function(i){wt(this,i),t.cast&&t.cast.__platform__&&"com.microsoft.playready"==i.keySystem&&(i.keySystem="com.chromecast.playready");var s=r[i.keySystem];s||(s={audioCapabilities:[],videoCapabilities:[],distinctiveIdentifier:"optional",persistentState:n?"required":"optional",sessionTypes:[n?"persistent-license":"temporary"],label:i.keySystem,drmInfos:[]},r[i.keySystem]=s,a.push(i.keySystem)),s.drmInfos.push(i),i.distinctiveIdentifierRequired&&(s.distinctiveIdentifier="required"),i.persistentStateRequired&&(s.persistentState="required");var o=[];e.video&&o.push(e.video),e.audio&&o.push(e.audio),o.forEach(function(t){("video"==t.type?s.videoCapabilities:s.audioCapabilities).push({robustness:("video"==t.type?i.videoRobustness:i.audioRobustness)||"",contentType:Z(t.mimeType,t.codecs)})}.bind(this))}.bind(this))}.bind(this))}.bind(e))}function Tt(t,e,i){if(1==i.length&&""==i[0])return Promise.reject(new h(2,6,6e3));var n=new b,r=n;return[!0,!1].forEach(function(t){i.forEach(function(i){var n=e[i];n.drmInfos.some(function(t){return!!t.licenseServerUri})==t&&(n.audioCapabilities.length||delete n.audioCapabilities,n.videoCapabilities.length||delete n.videoCapabilities,r=r.catch(function(){return this.c?Promise.reject():navigator.requestMediaKeySystemAccess(i,[n])}.bind(this)))}.bind(this))}.bind(t)),r=r.catch(function(){return Promise.reject(new h(2,6,6001))}),r=r.then(function(t){if(this.c)return Promise.reject();var i=0<=navigator.userAgent.indexOf("Edge/"),n=t.getConfiguration();return this.u=(n.audioCapabilities||[]).concat(n.videoCapabilities||[]).map(function(t){return t.contentType}),i&&(this.u=null),i=e[t.keySystem],St(this,t.keySystem,i,i.drmInfos),this.b.licenseServerUri?t.createMediaKeys():Promise.reject(new h(2,6,6012))}.bind(t)).then(function(t){if(this.c)return Promise.reject();this.j=t,this.K=!0}.bind(t)).catch(function(t){return this.c?Promise.resolve():(this.u=this.b=null,t instanceof h?Promise.reject(t):Promise.reject(new h(2,6,6002,t.message)))}.bind(t)),n.reject(),r}function wt(t,e){var i=e.keySystem;if(i){if(!e.licenseServerUri){var n=t.h.servers[i];n&&(e.licenseServerUri=n)}e.keyIds||(e.keyIds=[]),(i=t.h.advanced[i])&&(e.distinctiveIdentifierRequired||(e.distinctiveIdentifierRequired=i.distinctiveIdentifierRequired),e.persistentStateRequired||(e.persistentStateRequired=i.persistentStateRequired),e.videoRobustness||(e.videoRobustness=i.videoRobustness),e.audioRobustness||(e.audioRobustness=i.audioRobustness),e.serverCertificate||(e.serverCertificate=i.serverCertificate))}}function Et(e){if($(e.h.clearKeys))return null;var i,n=[],r=[];for(i in e.h.clearKeys){var a=e.h.clearKeys[i],s=ct(i),a=ct(a),s={kty:"oct",kid:ut(s,!1),k:ut(a,!1)};n.push(s),r.push(s.kid)}return e=JSON.stringify({keys:n}),r=JSON.stringify({kids:r}),r=[{initData:new Uint8Array(nt(r)),initDataType:"keyids"}],{keySystem:"org.w3.clearkey",licenseServerUri:"data:application/json;base64,"+t.btoa(e),distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:r,keyIds:[]}}function St(t,e,i,n){var r=[],a=[],s=[],o=[];At(n,r,a,s,o),t.b={keySystem:e,licenseServerUri:r[0],distinctiveIdentifierRequired:"required"==i.distinctiveIdentifier,persistentStateRequired:"required"==i.persistentState,audioRobustness:i.audioCapabilities?i.audioCapabilities[0].robustness:"",videoRobustness:i.videoCapabilities?i.videoCapabilities[0].robustness:"",serverCertificate:a[0],initData:s,keyIds:o}}function At(t,e,i,n,r){function a(t,e){return!(!t.keyId||t.keyId!=e.keyId)||t.initDataType==e.initDataType&&ft(t.initData,e.initData)}t.forEach(function(t){if(-1==e.indexOf(t.licenseServerUri)&&e.push(t.licenseServerUri),t.serverCertificate&&-1==U(i,t.serverCertificate,ft)&&i.push(t.serverCertificate),t.initData&&t.initData.forEach(function(t){-1==U(n,t,a)&&n.push(t)}),t.keyIds)for(var s=0;s<t.keyIds.length;++s)-1==r.indexOf(t.keyIds[s])&&r.push(t.keyIds[s])})}function kt(t,e){try{var i=t.j.createSession("persistent-license")}catch(e){var n=new h(2,6,6005,e.message);return t.g(n),Promise.reject(n)}H(t.f,i,"message",t.Dc.bind(t)),H(t.f,i,"keystatuseschange",t.xc.bind(t));var r={initData:null,ea:i,loaded:!1,Ob:1/0,ma:null};return t.a.push(r),i.load(e).then(function(t){if(!this.c){if(t)return r.loaded=!0,this.a.every(function(t){return t.loaded})&&this.i.resolve(),i;this.a.splice(this.a.indexOf(r),1),this.g(new h(2,6,6013))}}.bind(t),function(t){this.c||(this.a.splice(this.a.indexOf(r),1),this.g(new h(2,6,6005,t.message)))}.bind(t))}function It(t,e,i){try{var n=t.ha?t.j.createSession("persistent-license"):t.j.createSession()}catch(e){return void t.g(new h(2,6,6005,e.message))}H(t.f,n,"message",t.Dc.bind(t)),H(t.f,n,"keystatuseschange",t.xc.bind(t)),t.a.push({initData:i,ea:n,loaded:!1,Ob:1/0,ma:null}),n.generateRequest(e,i.buffer).catch(function(t){if(!this.c){for(var e=0;e<this.a.length;++e)if(this.a[e].ea==n){this.a.splice(e,1);break}this.g(new h(2,6,6006,t.message))}}.bind(t))}function _t(t,e){for(var i,n=e.target,r=0;r<t.a.length;r++)if(t.a[r].ea==n){i=t.a[r];break}r=M([t.b.licenseServerUri],t.h.retryParameters),r.body=e.message,r.method="POST","com.microsoft.playready"!=t.b.keySystem&&"com.chromecast.playready"!=t.b.keySystem||Pt(r),t.s.Wa.request(2,r).then(function(t){return this.c?Promise.reject():n.update(t.data).then(function(){this.s.onEvent(new X("drmsessionupdate")),i&&(i.ma&&i.ma.resolve(),setTimeout(function(){i.loaded=!0,this.a.every(function(t){return t.loaded})&&this.i.resolve()}.bind(this),5e3))}.bind(this))}.bind(t),function(t){if(this.c)return Promise.resolve();t=new h(2,6,6007,t),this.g(t),i&&i.ma&&i.ma.reject(t)}.bind(t)).catch(function(t){if(this.c)return Promise.resolve();t=new h(2,6,6008,t.message),this.g(t),i&&i.ma&&i.ma.reject(t)}.bind(t))}function Pt(t){var e=et(t.body,!0,!0);if(-1==e.indexOf("PlayReadyKeyMessage"))t.headers["Content-Type"]="text/xml; charset=utf-8";else{for(var e=(new DOMParser).parseFromString(e,"application/xml"),i=e.getElementsByTagName("HttpHeader"),n=0;n<i.length;++n)t.headers[i[n].querySelector("name").textContent]=i[n].querySelector("value").textContent;t.body=ht(e.querySelector("Challenge").textContent).buffer}}function xt(){var t=[],e=[{contentType:'video/mp4; codecs="avc1.42E01E"'},{contentType:'video/webm; codecs="vp8"'}],i=[{videoCapabilities:e,persistentState:"required",sessionTypes:["persistent-license"]},{videoCapabilities:e}],n={};return"org.w3.clearkey com.widevine.alpha com.microsoft.playready com.apple.fps.2_0 com.apple.fps.1_0 com.apple.fps com.adobe.primetime".split(" ").forEach(function(e){var r=navigator.requestMediaKeySystemAccess(e,i).then(function(t){var i=t.getConfiguration().sessionTypes,i=!!i&&0<=i.indexOf("persistent-license");return 0<=navigator.userAgent.indexOf("Tizen 3")&&(i=!1),n[e]={persistentState:i},t.createMediaKeys()}).catch(function(){n[e]=null});t.push(r)}),Promise.all(t).then(function(){return n})}function Rt(t,e){var i=t.keySystem();return!e.drmInfos.length||e.drmInfos.some(function(t){return t.keySystem==i})}function Nt(t,e){if(!t.length)return e;if(!e.length)return t;for(var i=[],n=0;n<t.length;n++)for(var r=0;r<e.length;r++)if(t[n].keySystem==e[r].keySystem){var a=t[n],r=e[r],s=[],s=s.concat(a.initData||[]),s=s.concat(r.initData||[]),o=[],o=o.concat(a.keyIds),o=o.concat(r.keyIds);i.push({keySystem:a.keySystem,licenseServerUri:a.licenseServerUri||r.licenseServerUri,distinctiveIdentifierRequired:a.distinctiveIdentifierRequired||r.distinctiveIdentifierRequired,persistentStateRequired:a.persistentStateRequired||r.persistentStateRequired,videoRobustness:a.videoRobustness||r.videoRobustness,audioRobustness:a.audioRobustness||r.audioRobustness,serverCertificate:a.serverCertificate||r.serverCertificate,initData:s,keyIds:o});break}return i}function Lt(t){return!t||1==t.length&&1e-6>t.end(0)-t.start(0)?null:t.length?t.end(t.length-1):null}function Dt(t,e){return!(!t||!t.length||1==t.length&&1e-6>t.end(0)-t.start(0))&&(e>=t.start(0)&&e<=t.end(t.length-1))}function Mt(t,e){if(!t||!t.length||1==t.length&&1e-6>t.end(0)-t.start(0))return 0;for(var i=0,n=t.length-1;0<=n&&t.end(n)>e;--n)i+=t.end(n)-Math.max(t.start(n),e);return i}function Ct(t){if(!t)return[];for(var e=[],i=0;i<t.length;i++)e.push({start:t.start(i),end:t.end(i)});return e}function Ot(){this.a=new muxjs.mp4.Transmuxer,this.b=null,this.c=[],this.f=!1,this.a.on("data",this.h.bind(this)),this.a.on("done",this.g.bind(this))}function Ut(t,e){var i=e.replace("mp2t","mp4");"audio"==t&&(i=i.replace("video","audio"));var n=/avc1\.(66|77|100)\.(\d+)/.exec(i);if(n)var r="avc1.",a=n[1],s=Number(n[2]),r=("66"==a?r+"4200":"77"==a?r+"4d00":r+"6400")+(s>>4).toString(16),r=r+(15&s).toString(16),i=i.replace(n[0],r);return i}function jt(t,e,i){return t.b=new b,t.c=[],null==i||t.f||(t.a.setBaseMediaDecodeTime(9e4*i),t.f=!0),e=new Uint8Array(e),t.a.push(e),t.a.flush(),t.b}function Bt(t){this.c=null,this.f=t,this.h=this.i=0,this.g=1/0,this.b=this.a=null}function Ft(t,e,i,n){return Promise.resolve().then(function(){if(this.c&&this.f)if(null==i||null==n)this.c.parseInit(new Uint8Array(e));else{var t={periodStart:this.i,segmentStart:i,segmentEnd:n},t=this.c.parseMedia(new Uint8Array(e),t).filter(function(t){return t.startTime>=this.h&&t.startTime<this.g}.bind(this));this.f.append(t),null==this.a&&(this.a=Math.max(i,this.h)),this.b=Math.min(n,this.g)}}.bind(t))}function Vt(t,e,i){this.g=t,this.f=e,this.l=i,this.b={},this.a=null,this.c={},this.i=new V,this.j=!1,this.h={}}function Ht(){var t={};return'video/mp4; codecs="avc1.42E01E",video/mp4; codecs="avc3.42E01E",video/mp4; codecs="hev1.1.6.L93.90",video/mp4; codecs="hvc1.1.6.L93.90",video/mp4; codecs="hev1.2.4.L153.B0"; eotf="smpte2084",video/mp4; codecs="hvc1.2.4.L153.B0"; eotf="smpte2084",video/mp4; codecs="vp9",video/mp4; codecs="vp09.00.10.08",audio/mp4; codecs="mp4a.40.2",audio/mp4; codecs="ac-3",audio/mp4; codecs="ec-3",audio/mp4; codecs="opus",audio/mp4; codecs="flac",video/webm; codecs="vp8",video/webm; codecs="vp9",video/webm; codecs="av1",audio/webm; codecs="vorbis",audio/webm; codecs="opus",video/mp2t; codecs="avc1.42E01E",video/mp2t; codecs="avc3.42E01E",video/mp2t; codecs="hvc1.1.6.L93.90",video/mp2t; codecs="mp4a.40.2",video/mp2t; codecs="ac-3",video/mp2t; codecs="ec-3",text/vtt,application/mp4; codecs="wvtt",application/ttml+xml,application/mp4; codecs="stpp"'.split(",").forEach(function(e){t[e]=!!Ko[e]||MediaSource.isTypeSupported(e);var i=e.split(";")[0];t[i]=t[i]||t[e]}),t}function Kt(t,e){t.a||(t.a=new Bt(t.l)),t.a.c=new Ko[e]}function qt(t,e){if("text"==e)var i=t.a.a;else i=Gt(t,e),i=!i||1==i.length&&1e-6>i.end(0)-i.start(0)?null:1==i.length&&0>i.start(0)?0:i.length?i.start(0):null;return i}function Gt(t,e){try{return t.b[e].buffered}catch(t){return null}}function Xt(t,e,i,n,r){return"text"==e?Ft(t.a,i,n,r):t.h[e]?jt(t.h[e],i,n).then(function(t){return $t(this,e,this.Sc.bind(this,e,t.buffer))}.bind(t)):$t(t,e,t.Sc.bind(t,e,i))}function Yt(t,e){return"text"==e?t.a.remove(0,1/0):$t(t,e,t.Tc.bind(t,e,0,t.f.duration))}function zt(t,e,i,n,r){return"text"==e?(t.a.i=i,t=t.a,t.h=n,t.g=r,Promise.resolve()):Promise.all([$t(t,e,t.Zc.bind(t,e)),$t(t,e,t.Ce.bind(t,e,i)),$t(t,e,t.ze.bind(t,e,n,r))])}function $t(t,e,i){if(t.j)return Promise.reject();if(i={start:i,p:new b},t.c[e].push(i),1==t.c[e].length)try{i.start()}catch(n){"QuotaExceededError"==n.name?i.p.reject(new h(2,3,3017,e)):i.p.reject(new h(2,3,3015,n)),Jt(t,e)}return i.p}function Wt(t,e){if(t.j)return Promise.reject();var i,n=[];for(i in t.b){var r=new b,a={start:function(t){t.resolve()}.bind(null,r),p:r};t.c[i].push(a),n.push(r),1==t.c[i].length&&a.start()}return Promise.all(n).then(function(){var t;try{e()}catch(t){var i=Promise.reject(new h(2,3,3015,t))}for(t in this.b)Jt(this,t);return i}.bind(t),function(){return Promise.reject()}.bind(t))}function Jt(t,e){t.c[e].shift();var i=t.c[e][0];if(i)try{i.start()}catch(n){i.p.reject(new h(2,3,3015,n)),Jt(t,e)}}function Qt(t,e,i){return i==e||t>=qo&&i==e.split("-")[0]||t>=Go&&i.split("-")[0]==e.split("-")[0]}function Zt(t){t=t.toLowerCase().split("-");var e=Xo[t[0]];return e&&(t[0]=e),t.join("-")}function te(t,e,i){var n=t.video;return!(n&&(n.width<e.minWidth||n.width>e.maxWidth||n.width>i.width||n.height<e.minHeight||n.height>e.maxHeight||n.height>i.height||n.width*n.height<e.minPixels||n.width*n.height>e.maxPixels)||t.bandwidth<e.minBandwidth||t.bandwidth>e.maxBandwidth)}function ee(t,e,i){var n=!1;return t.variants.forEach(function(t){var r=t.allowedByApplication;t.allowedByApplication=te(t,e,i),r!=t.allowedByApplication&&(n=!0)}),n}function ie(t,e,i,n){n.variants=n.variants.filter(function(n){return!(t&&t.K&&!Rt(t,n))&&(ne(n.audio,t,e)&&ne(n.video,t,i))}),n.textStreams=n.textStreams.filter(function(t){return!!Ko[Z(t.mimeType,t.codecs)]})}function ne(e,i,n){if(!e)return!0;var r=null;i&&i.K&&(r=i.u),i=Z(e.mimeType,e.codecs);var a,s=Z(e.mimeType,e.codecs),o=e.mimeType;for(a in Ho){var u=e[a],h=Ho[a];u&&(o+="; "+h+'="'+u+'"')}return!(!(Ko[s]||MediaSource.isTypeSupported(o)||t.muxjs&&"mp2t"==s.split(";")[0].split("/")[1]&&MediaSource.isTypeSupported(Ut(e.type,s)))||r&&e.encrypted&&0>r.indexOf(i)||n&&(e.mimeType!=n.mimeType||e.codecs.split(".")[0]!=n.codecs.split(".")[0]))}function re(t){var e=t.audio,i=t.video,n=e?e.codecs:null,r=i?i.codecs:null,a=[];r&&a.push(r),n&&a.push(n);var s=[];i&&s.push(i.mimeType),e&&s.push(e.mimeType);var s=s[0]||null,o=[];e&&o.push(e.kind),i&&o.push(i.kind);var o=o[0]||null,u=[];return e&&u.push.apply(u,e.roles),i&&u.push.apply(u,i.roles),u=O(u),t={id:t.id,active:!1,type:"variant",bandwidth:t.bandwidth,language:t.language,label:null,kind:o,width:null,height:null,frameRate:null,mimeType:s,codecs:a.join(", "),audioCodec:n,videoCodec:r,primary:t.primary,roles:u,videoId:null,audioId:null,channelsCount:null,audioBandwidth:null,videoBandwidth:null},i&&(t.videoId=i.id,t.width=i.width||null,t.height=i.height||null,t.frameRate=i.frameRate||null,t.videoBandwidth=i.bandwidth||null),e&&(t.audioId=e.id,t.channelsCount=e.channelsCount,t.audioBandwidth=e.bandwidth||null,t.label=e.label),t}function ae(t){return{id:t.id,active:!1,type:"text",bandwidth:0,language:t.language,label:t.label,kind:t.kind||null,width:null,height:null,frameRate:null,mimeType:t.mimeType,codecs:t.codecs||null,audioCodec:null,videoCodec:null,primary:t.primary,roles:t.roles,videoId:null,audioId:null,channelsCount:null,audioBandwidth:null,videoBandwidth:null}}function se(t){var e=[],i=fe(t.variants);return t=t.textStreams,i.forEach(function(t){e.push(re(t))}),t.forEach(function(t){e.push(ae(t))}),e}function oe(t,e,i){return fe(t.variants).map(function(t){var n=re(t);return t.video&&t.audio?n.active=i==t.video.id&&e==t.audio.id:t.video?n.active=i==t.video.id:t.audio&&(n.active=e==t.audio.id),n})}function ue(t,e){return t.textStreams.map(function(t){var i=ae(t);return i.active=e==t.id,i})}function he(t,e){for(var i=0;i<t.variants.length;i++)if(t.variants[i].id==e.id)return t.variants[i];return null}function ce(t,e){for(var i=0;i<t.textStreams.length;i++)if(t.textStreams[i].id==e.id)return t.textStreams[i];return null}function le(t){return t.allowedByApplication&&t.allowedByKeySystem}function fe(t){return t.filter(function(t){return le(t)})}function de(t,e,i,n){var r=fe(t.variants),a=r.filter(function(t){return t.primary});a.length||(a=r);var s=a.length?a[0].language:"",a=a.filter(function(t){return t.language==s});if(e){var o=Zt(e);[Go,qo,0].forEach(function(t){var e=!1;r.forEach(function(i){o=Zt(o);var r=Zt(i.language);Qt(t,o,r)&&(e?a.push(i):(a=[i],e=!0),n&&(n.audio=!0))})})}return i&&(t=me(a,i),t.length)?t:(t=a.map(function(t){return(t.audio?t.audio.roles:[]).concat(t.video?t.video.roles:[])}).reduce(P,[]),t.length?me(a,t[0]):a)}function pe(t,e,i,n){var r=t.textStreams,a=r.filter(function(t){return t.primary});a.length||(a=r);var s=a.length?a[0].language:"",a=a.filter(function(t){return t.language==s});if(e){var o=Zt(e);[Go,qo,0].forEach(function(t){var e=!1;r.forEach(function(i){var r=Zt(i.language);Qt(t,o,r)&&(e?a.push(i):(a=[i],e=!0),n&&(n.text=!0))})})}return i&&(t=ye(a,i),t.length)?t:(t=a.map(function(t){return t.roles}).reduce(P,[]),t.length?ye(a,t[0]):a)}function me(t,e){return t.filter(function(t){return t.audio&&0<=t.audio.roles.indexOf(e)||t.video&&0<=t.video.roles.indexOf(e)})}function ye(t,e){return t.filter(function(t){return 0<=t.roles.indexOf(e)})}function ve(t,e,i){for(var n=0;n<i.length;n++)if(i[n].audio==t&&i[n].video==e)return i[n];return null}function ge(t,e,i){function n(t,e){return null==t?null==e:e.id==t}for(var r=0;r<i.length;r++)if(n(t,i[r].audio)&&n(e,i[r].video))return i[r];return null}function be(t,e){for(var i=t.periods.length-1;0<i;--i)if(e+Vo>=t.periods[i].startTime)return i;return 0}function Te(t,e){for(var i=0;i<t.periods.length;++i){var n=t.periods[i];if("text"==e.type){for(var r=0;r<n.textStreams.length;++r)if(n.textStreams[r]==e)return i}else for(r=0;r<n.variants.length;++r){var a=n.variants[r];if(a.audio==e||a.video==e||a.video&&a.video.trickModeVideo==e)return i}}return-1}function we(){this.h=null,this.c=!1,this.b=new s,this.g=[],this.i=!1,this.a=this.f=null}function Ee(t,e){return e.filter(function(e){return te(e,t,{width:1/0,height:1/0})}).sort(function(t,e){return t.bandwidth-e.bandwidth})}function Se(t){return JSON.stringify(t,function(t,e){if("function"!=typeof e){if(e instanceof Event||e instanceof X){var i,n={};for(i in e){var r=e[i];r&&"object"==typeof r?"detail"==i&&(n[i]=r):i in Event||(n[i]=r)}return n}if(e instanceof TimeRanges)for(n={__type__:"TimeRanges",length:e.length,start:[],end:[]},i=0;i<e.length;++i)n.start.push(e.start(i)),n.end.push(e.end(i));else n="number"==typeof e?isNaN(e)?"NaN":isFinite(e)?e:0>e?"-Infinity":"Infinity":e;return n}})}function Ae(t){return JSON.parse(t,function(t,e){return"NaN"==e?NaN:"-Infinity"==e?-1/0:"Infinity"==e?1/0:e&&"object"==typeof e&&"TimeRanges"==e.__type__?ke(e):e})}function ke(t){return{length:t.length,start:function(e){return t.start[e]},end:function(e){return t.end[e]}}}function Ie(t,e,i,n,r,a){this.J=t,this.g=e,this.K=i,this.j=!1,this.A=n,this.F=r,this.u=a,this.b=this.h=!1,this.w="",this.i=null,this.l=this.vc.bind(this),this.m=this.Ld.bind(this),this.a={video:{},player:{}},this.s=0,this.c={},this.f=null}function _e(t){var e=au;e.removeUpdateListener(t.l),e.removeMessageListener("urn:x-cast:com.google.shaka.v2",t.m)}function Pe(t){for(var e in t.c){var i=t.c[e];delete t.c[e],i.reject(new h(1,7,7e3))}}function xe(t){t=Se(t),au.sendMessage("urn:x-cast:com.google.shaka.v2",t,function(){},u)}function Re(){this.xb=new F,this.eb=this}function Ne(t,e,i){Re.call(this),this.c=t,this.b=e,this.i=this.g=this.f=this.j=this.h=null,this.a=new Ie(i,this.He.bind(this),this.Ie.bind(this),this.Je.bind(this),this.Ke.bind(this),this.mc.bind(this)),Le(this)}function Le(t){t.a.init(),t.i=new V,Yo.forEach(function(t){H(this.i,this.c,t,this.We.bind(this))}.bind(t)),Jo.forEach(function(t){H(this.i,this.b,t,this.he.bind(this))}.bind(t)),t.h={};for(var e in t.c)Object.defineProperty(t.h,e,{configurable:!1,enumerable:!0,get:t.Ve.bind(t,e),set:t.Xe.bind(t,e)});t.j={};for(e in t.b)Object.defineProperty(t.j,e,{configurable:!1,enumerable:!0,get:t.ge.bind(t,e)});t.f=new Re,t.f.eb=t.h,t.g=new Re,t.g.eb=t.j}function De(t,e,i,n){Re.call(this),this.a=t,this.b=e,this.m={video:t,player:e},this.s=i||function(){},this.u=n||function(t){return t},this.l=!1,this.f=!0,this.g=0,this.j=!1,this.i=this.h=this.c=null,Me(this)}function Me(e){var i=cast.receiver.CastReceiverManager.getInstance();i.onSenderConnected=e.Cc.bind(e),i.onSenderDisconnected=e.Cc.bind(e),i.onSystemVolumeChanged=e.gd.bind(e),e.h=i.getCastMessageBus("urn:x-cast:com.google.cast.media"),e.h.onMessage=e.Gd.bind(e),e.c=i.getCastMessageBus("urn:x-cast:com.google.shaka.v2"),e.c.onMessage=e.Ud.bind(e),i.start(),Yo.forEach(function(t){this.a.addEventListener(t,this.Gc.bind(this,"video"))}.bind(e)),Jo.forEach(function(t){this.b.addEventListener(t,this.Gc.bind(this,"player"))}.bind(e)),cast.__platform__&&cast.__platform__.canDisplayType('video/mp4; codecs="avc1.640028"; width=3840; height=2160')?e.b.Yb(3840,2160):e.b.Yb(1920,1080),e.a.addEventListener("loadeddata",function(){this.j=!0}.bind(e)),e.b.addEventListener("loading",function(){this.f=!1,Ce(this)}.bind(e)),e.a.addEventListener("playing",function(){this.f=!1,Ce(this)}.bind(e)),e.a.addEventListener("pause",function(){Ce(this)}.bind(e)),e.b.addEventListener("unloading",function(){this.f=!0,Ce(this)}.bind(e)),e.a.addEventListener("ended",function(){t.setTimeout(function(){this.a&&this.a.ended&&(this.f=!0,Ce(this))}.bind(this),5e3)}.bind(e))}function Ce(t){Promise.resolve().then(function(){this.dispatchEvent(new X("caststatuschanged")),je(this,0)}.bind(t))}function Oe(t,e,i){for(var n in e.player)t.b[n](e.player[n]);t.s(i),i=Promise.resolve();var r=t.a.autoplay;e.manifest&&(t.a.autoplay=!1,i=t.b.load(e.manifest,e.startTime),i.catch(function(t){this.b.dispatchEvent(new X("error",{detail:t}))}.bind(t))),i.then(function(){var t;for(t in e.video){var i=e.video[t];this.a[t]=i}for(t in e.playerAfterLoad)i=e.playerAfterLoad[t],this.b[t](i);this.a.autoplay=r,e.manifest&&(this.a.play(),je(this,0))}.bind(t))}function Ue(t,e,i,n){t.l&&(t=Se(e),n?i.getCastChannel(n).send(t):i.broadcast(t))}function je(t,e,i){var n=t.a.playbackRate,r=su;r=t.f?r.IDLE:t.b.rc()?r.Uc:t.a.paused?r.Wc:r.Xc,n={mediaSessionId:0,playbackRate:n,playerState:r,currentTime:t.a.currentTime,supportedMediaCommands:15,volume:{level:t.a.volume,muted:t.a.muted}},i&&(n.media=i),Ue(t,{requestId:e,type:"MEDIA_STATUS",status:[n]},t.h)}function Be(t,e){var i=Fe(t,e);return 1!=i.length?null:i[0]}function Fe(t,e){return Array.prototype.filter.call(t.childNodes,function(t){return t.tagName==e})}function Ve(t){var e=t.firstChild;return e&&e.nodeType==Node.TEXT_NODE?t.textContent.trim():null}function He(t,e,i,n){var r=null;return t=t.getAttribute(e),null!=t&&(r=i(t)),null==r?void 0!=n?n:null:r}function Ke(t){return t?(/^\d+\-\d+\-\d+T\d+:\d+:\d+(\.\d+)?$/.test(t)&&(t+="Z"),t=Date.parse(t),isNaN(t)?null:Math.floor(t/1e3)):null}function qe(t){return t&&(t=/^P(?:([0-9]*)Y)?(?:([0-9]*)M)?(?:([0-9]*)D)?(?:T(?:([0-9]*)H)?(?:([0-9]*)M)?(?:([0-9.]*)S)?)?$/.exec(t))?(t=31536e3*Number(t[1]||null)+2592e3*Number(t[2]||null)+86400*Number(t[3]||null)+3600*Number(t[4]||null)+60*Number(t[5]||null)+Number(t[6]||null),isFinite(t)?t:null):null}function Ge(t){var e=/([0-9]+)-([0-9]+)/.exec(t);return e?(t=Number(e[1]),isFinite(t)?(e=Number(e[2]),isFinite(e)?{start:t,end:e}:null):null):null}function Xe(t){return t=Number(t),t%1?null:t}function Ye(t){return t=Number(t),!(t%1)&&0<t?t:null}function ze(t){return t=Number(t),!(t%1)&&0<=t?t:null}function $e(t){var e;return t=(e=t.match(/^(\d+)\/(\d+)$/))?Number(e[1]/e[2]):Number(t),isNaN(t)?null:t}function We(t,e,i){t=Ze(t);var n=null,r=[],a=[],s=t.map(function(t){return t.keyId}).filter(R);if(s.length&&1<s.filter(N).length)throw new h(2,4,4010);i||(a=t.filter(function(t){return"urn:mpeg:dash:mp4protection:2011"!=t.Mc||(n=t.init||n,!1)}),a.length&&(r=Qe(n,e,a),r.length||(r=[z("",n)]))),!t.length||!i&&a.length||(r=W(ou).map(function(t){return z(t,n)}));var o=s[0]||null;return o&&r.forEach(function(t){t.initData.forEach(function(t){t.keyId=o})}),{hc:o,ef:n,drmInfos:r,kc:!0}}function Je(t,e,i,n){var r=We(t,e,n);if(i.kc)t=1==i.drmInfos.length&&!i.drmInfos[0].keySystem,e=!r.drmInfos.length,(!i.drmInfos.length||t&&!e)&&(i.drmInfos=r.drmInfos),i.kc=!1;else if(0<r.drmInfos.length&&(i.drmInfos=i.drmInfos.filter(function(t){return r.drmInfos.some(function(e){return e.keySystem==t.keySystem})}),!i.drmInfos.length))throw new h(2,4,4008);return r.hc||i.hc}function Qe(t,e,i){return i.map(function(i){var n=ou[i.Mc];return n?[z(n,i.init||t)]:e(i.node)||[]}).reduce(P,[])}function Ze(t){return t.map(function(t){var e=t.getAttribute("schemeIdUri"),i=t.getAttribute("cenc:default_KID"),n=Fe(t,"cenc:pssh").map(Ve);if(!e)return null;if(e=e.toLowerCase(),i&&(i=i.replace(/-/g,"").toLowerCase(),0<=i.indexOf(" ")))throw new h(2,4,4009);var r=[];try{r=n.map(function(t){return{initDataType:"cenc",initData:ht(t),keyId:null}})}catch(t){throw new h(2,4,4007)}return{node:t,Mc:e,keyId:i,init:0<r.length?r:null}}).filter(R)}function ti(e,i,n,r,a){null!=a&&(a=Math.round(a));var s={RepresentationID:i,Number:n,Bandwidth:r,Time:a};return e.replace(/\$(RepresentationID|Number|Bandwidth|Time)?(?:%0([0-9]+)d)?\$/g,function(e,i,n){if("$$"==e)return"$";var r=s[i];return null==r?e:("RepresentationID"==i&&n&&(n=void 0),e=r.toString(),n=t.parseInt(n,10)||1,Array(Math.max(0,n-e.length)+1).join("0")+e)})}function ei(t,e){var i=ii(t,e,"timescale"),n=1;i&&(n=Ye(i)||1),i=ii(t,e,"duration"),(i=Ye(i||""))&&(i/=n);var r=ii(t,e,"startNumber"),a=Number(ii(t,e,"presentationTimeOffset"))||0,s=ze(r||"");null!=r&&null!=s||(s=1);var o=ni(t,e,"SegmentTimeline"),r=null;if(o){for(var r=n,u=t.R.duration||1/0,o=Fe(o,"S"),h=[],c=0,l=0;l<o.length;++l){var f=o[l],d=He(f,"t",ze),p=He(f,"d",ze),f=He(f,"r",Xe);if(null!=d&&(d-=a),!p)break;if(d=null!=d?d:c,0>(f=f||0))if(l+1<o.length){if(null==(f=He(o[l+1],"t",ze)))break;if(d>=f)break;f=Math.ceil((f-d)/p)-1}else{if(1/0==u)break;if(d/r>=u)break;f=Math.ceil((u*r-d)/p)-1}0<h.length&&d!=c&&(h[h.length-1].end=d/r);for(var m=0;m<=f;++m)c=d+p,h.push({start:d/r,end:c/r,Te:d}),d=c}r=h}return{timescale:n,O:i,za:s,V:a/n||0,dc:a,I:r}}function ii(t,e,i){return[e(t.v),e(t.S),e(t.Z)].filter(R).map(function(t){return t.getAttribute(i)}).reduce(function(t,e){return t||e})}function ni(t,e,i){return[e(t.v),e(t.S),e(t.Z)].filter(R).map(function(t){return Be(t,i)}).reduce(function(t,e){return t||e})}function ri(t,e){var i=new DOMParser;try{var n=tt(t),r=i.parseFromString(n,"text/xml")}catch(t){}if(r&&r.documentElement.tagName==e)var a=r.documentElement;return a&&0<a.getElementsByTagName("parsererror").length?null:a}function ai(t,e,i,n,r,a){for(var s=t.getAttribute("xlink:href"),o=t.getAttribute("xlink:actuate")||"onRequest",u=0;u<t.attributes.length;u++){var c=t.attributes[u].nodeName;-1!=c.indexOf("xlink:")&&(t.removeAttribute(c),--u)}if(5<=a)return Promise.reject(new h(2,4,4028));if("onLoad"!=o)return Promise.reject(new h(2,4,4027));var l=Y([n],[s]);return r.request(0,M(l,e)).then(function(n){if(!(n=ri(n.data,t.tagName)))return Promise.reject(new h(2,4,4001,s));for(;t.childNodes.length;)t.removeChild(t.childNodes[0]);for(;n.childNodes.length;){var o=n.childNodes[0];n.removeChild(o),t.appendChild(o)}for(o=0;o<n.attributes.length;o++){var u=n.attributes[o].nodeName,c=n.getAttribute(u);t.setAttribute(u,c)}return si(t,e,i,l[0],r,a+1)}.bind(t))}function si(t,e,i,n,r,a){if(a=a||0,t.getAttribute("xlink:href")){var s=ai(t,e,i,n,r,a);return i&&(s=s.catch(function(){return si(t,e,i,n,r,a)})),s}for(s=0;s<t.childNodes.length;s++){var o=t.childNodes[s];o instanceof Element&&"urn:mpeg:dash:resolve-to-zero:2013"==o.getAttribute("xlink:href")&&(t.removeChild(o),--s)}for(var u=[],s=0;s<t.childNodes.length;s++)o=t.childNodes[s],o.nodeType==Node.ELEMENT_NODE&&(o=si(o,e,i,n,r,a),u.push(o));return Promise.all(u).then(function(){return t})}function oi(t,e,i){this.a=t,this.N=e,this.D=i}function ui(t,e,i,n,r,a){this.position=t,this.startTime=e,this.endTime=i,this.a=n,this.N=r,this.D=a}function hi(t,e){this.G=t,this.b=e==uu,this.a=0}function ci(){throw new h(2,3,3e3)}function li(){this.c=[],this.b=[],this.a=!1}function fi(t){for(;t.o.ca()&&!t.oa.a;)t.oa.rb(t.start,t.o,t.Ec)}function di(t){for(var e=t.o.B();0<e&&!t.oa.a;--e)t.oa.rb(t.start,t.o,t.Ec)}function pi(t){return function(e){t(e.o.Ma(e.o.G.byteLength-e.o.U()))}}function mi(t){for(var e=0,i=0;i<t.length;i++)e=e<<8|t.charCodeAt(i);return e}function yi(t,e,i,n){var r,a=(new li).ba("sidx",function(t){r=vi(e,n,i,t)});if(t&&a.parse(t),r)return r;throw new h(2,3,3004)}function vi(t,e,i,n){var r=[];n.o.H(4);var a=n.o.B();if(!a)throw new h(2,3,3005);if(n.version)var s=n.o.Na(),o=n.o.Na();else s=n.o.B(),o=n.o.B();n.o.H(2);var u=n.o.Xa();for(t=t+n.size+o,o=0;o<u;o++){var c=n.o.B(),l=(2147483648&c)>>>31,c=2147483647&c,f=n.o.B();if(n.o.H(4),1==l)throw new h(2,3,3006);r.push(new ui(r.length,s/a-e,(s+f)/a-e,function(){return i},t,t+c-1)),s+=f,t+=c}return n.oa.stop(),r}function gi(t){this.a=t}function bi(t,e){for(var i;t.a.length&&(i=t.a[t.a.length-1],i.startTime>=e);)t.a.pop();for(;t.a.length&&(i=t.a[0],0>=i.endTime);)t.a.shift();t.a.length&&(i=t.a[0],i.startTime<Vo&&(t.a[0]=new ui(i.position,0,i.endTime,i.a,i.N,i.D)),i=t.a[t.a.length-1],t.a[t.a.length-1]=new ui(i.position,i.startTime,e,i.a,i.N,i.D))}function Ti(t){this.b=t,this.a=new hi(t,0),hu||(hu=[new Uint8Array([255]),new Uint8Array([127,255]),new Uint8Array([63,255,255]),new Uint8Array([31,255,255,255]),new Uint8Array([15,255,255,255,255]),new Uint8Array([7,255,255,255,255,255]),new Uint8Array([3,255,255,255,255,255,255]),new Uint8Array([1,255,255,255,255,255,255,255])])}function wi(t){var e=Ei(t);if(7<e.length)throw new h(2,3,3002);for(var i=0,n=0;n<e.length;n++)i=256*i+e[n];e=i,i=Ei(t);t:{for(n=0;n<hu.length;n++)if(ft(i,hu[n])){n=!0;break t}n=!1}if(n)i=t.b.byteLength-t.a.U();else{if(8==i.length&&224&i[1])throw new h(2,3,3001);for(var n=i[0]&(1<<8-i.length)-1,r=1;r<i.length;r++)n=256*n+i[r];i=n}return i=t.a.U()+i<=t.b.byteLength?i:t.b.byteLength-t.a.U(),n=new DataView(t.b.buffer,t.b.byteOffset+t.a.U(),i),t.a.H(i),new Si(e,n)}function Ei(t){var e,i=t.a.$();for(e=1;8>=e&&!(i&1<<8-e);e++);if(8<e)throw new h(2,3,3002);var n=new Uint8Array(e);for(n[0]=i,i=1;i<e;i++)n[i]=t.a.$();return n}function Si(t,e){this.id=t,this.a=e}function Ai(t){if(8<t.a.byteLength)throw new h(2,3,3002);if(8==t.a.byteLength&&224&t.a.getUint8(0))throw new h(2,3,3001);for(var e=0,i=0;i<t.a.byteLength;i++)var n=t.a.getUint8(i),e=256*e+n;return e}function ki(){}function Ii(t,e,i,n,r,a){function s(){return r}var o=[];t=new Ti(t.a);for(var u=null,h=null;t.ca();){var c=wi(t);if(187==c.id){var l=_i(c);l&&(c=i*l.Ue,l=e+l.oe,null!=u&&o.push(new ui(o.length,u-a,c-a,s,h,l-1)),u=c,h=l)}}return null!=u&&o.push(new ui(o.length,u-a,n-a,s,h,null)),o}function _i(t){var e=new Ti(t.a);if(t=wi(e),179!=t.id)throw new h(2,3,3013);if(t=Ai(t),e=wi(e),183!=e.id)throw new h(2,3,3012);for(var e=new Ti(e.a),i=0;e.ca();){var n=wi(e);if(241==n.id){i=Ai(n);break}}return{Ue:t,oe:i}}function Pi(t,e){var i=ni(t,e,"Initialization");if(!i)return null;var n=t.v.aa,r=i.getAttribute("sourceURL");r&&(n=Y(t.v.aa,[r]));var r=0,a=null;return(i=He(i,"range",Ge))&&(r=i.start,a=i.end),new oi(function(){return n},r,a)}function xi(t,e){var i=Number(ii(t,Ni,"presentationTimeOffset"))||0,n=ii(t,Ni,"timescale"),r=1;n&&(r=Ye(n)||1);var i=i/r||0,n=Pi(t,Ni),a=t.v.contentType,r=t.v.mimeType.split("/")[1];if("text"!=a&&"mp4"!=r&&"webm"!=r)throw new h(2,4,4006);if("webm"==r&&!n)throw new h(2,4,4005);var a=ni(t,Ni,"RepresentationIndex"),s=ii(t,Ni,"indexRange"),o=t.v.aa,s=Ge(s||"");if(a){var u=a.getAttribute("sourceURL");u&&(o=Y(t.v.aa,[u])),s=He(a,"range",Ge,s)}if(!s)throw new h(2,4,4002);return r=Ri(t,e,n,o,s.start,s.end,r,i),{createSegmentIndex:r.createSegmentIndex,findSegmentPosition:r.findSegmentPosition,getSegmentReference:r.getSegmentReference,initSegmentReference:n,V:i}}function Ri(t,e,i,n,r,a,s,o){var u=t.presentationTimeline,h=!t.Da||!t.R.Hb,c=t.R.duration,l=e,f=null;return{createSegmentIndex:function(){var t=[l(n,r,a),"webm"==s?l(i.a(),i.N,i.D):null];return l=null,Promise.all(t).then(function(t){var e=t[0];t=t[1]||null,e="mp4"==s?yi(e,r,n,o):(new ki).parse(e,t,n,o),u.Ia(0,e),f=new gi(e),h&&bi(f,c)})},findSegmentPosition:function(t){return f.find(t)},getSegmentReference:function(t){return f.get(t)}}}function Ni(t){return t.Ya}function Li(t,e){var i=Pi(t,Di),n=Ci(t),r=ei(t,Di),a=r.za;a||(a=1);var s=0;if(r.O?s=r.O*(a-1):r.I&&0<r.I.length&&(s=r.I[0].start),n={O:r.O,startTime:s,za:a,V:r.V,I:r.I,Ha:n},!n.O&&!n.I&&1<n.Ha.length)throw new h(2,4,4002);if(!n.O&&!t.R.duration&&!n.I&&1==n.Ha.length)throw new h(2,4,4002);if(n.I&&!n.I.length)throw new h(2,4,4002);return a=r=null,t.Z.id&&t.v.id&&(a=t.Z.id+","+t.v.id,r=e[a]),s=Mi(t.R.duration,n.za,t.v.aa,n),r?(r.Lb(s),a=t.presentationTimeline.ja(),r.Bb(a-t.R.start)):(t.presentationTimeline.Ia(0,s),r=new gi(s),a&&t.Da&&(e[a]=r)),t.Da&&t.R.Hb||bi(r,t.R.duration),{createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:r.find.bind(r),getSegmentReference:r.get.bind(r),initSegmentReference:i,V:n.V}}function Di(t){return t.qa}function Mi(t,e,i,n){var r=n.Ha.length;n.I&&n.I.length!=n.Ha.length&&(r=Math.min(n.I.length,n.Ha.length));for(var a=[],s=n.startTime,o=0;o<r;o++){var u=n.Ha[o],h=Y(i,[u.Ad]),c=null!=n.O?s+n.O:n.I?n.I[o].end:s+t;a.push(new ui(o+e,s,c,function(t){return t}.bind(null,h),u.start,u.end)),s=c}return a}function Ci(t){return[t.v.qa,t.S.qa,t.Z.qa].filter(R).map(function(t){return Fe(t,"SegmentURL")}).reduce(function(t,e){return 0<t.length?t:e}).map(function(e){e.getAttribute("indexRange")&&!t.qc&&(t.qc=!0);var i=e.getAttribute("media");return e=He(e,"mediaRange",Ge,{start:0,end:null}),{Ad:i,start:e.start,end:e.end}})}function Oi(t,e,i,n){var r=Fi(t),a=ei(t,Ui),s=ii(t,Ui,"media"),o=ii(t,Ui,"index");if(a={O:a.O,timescale:a.timescale,za:a.za,V:a.V,dc:a.dc,I:a.I,Kb:s,Va:o},s=0+(a.Va?1:0),s+=a.I?1:0,!(s+=a.O?1:0))throw new h(2,4,4002);if(1!=s&&(a.Va&&(a.I=null),a.O=null),!a.Va&&!a.Kb)throw new h(2,4,4002);if(a.Va){if("mp4"!=(i=t.v.mimeType.split("/")[1])&&"webm"!=i)throw new h(2,4,4006);if("webm"==i&&!r)throw new h(2,4,4005);n=ti(a.Va,t.v.id,null,t.bandwidth||null,null),n=Y(t.v.aa,[n]),t=Ri(t,e,r,n,0,null,i,a.V)}else a.O?(n||t.presentationTimeline.Mb(a.O),t=ji(t,a)):(n=e=null,t.Z.id&&t.v.id&&(n=t.Z.id+","+t.v.id,e=i[n]),s=Bi(t,a),e?(e.Lb(s),i=t.presentationTimeline.ja(),e.Bb(i-t.R.start)):(t.presentationTimeline.Ia(0,s),e=new gi(s),n&&t.Da&&(i[n]=e)),t.Da&&t.R.Hb||bi(e,t.R.duration),t={createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:e.find.bind(e),getSegmentReference:e.get.bind(e)});return{createSegmentIndex:t.createSegmentIndex,findSegmentPosition:t.findSegmentPosition,getSegmentReference:t.getSegmentReference,initSegmentReference:r,V:a.V}}function Ui(t){return t.Za}function ji(t,e){var i=t.R.duration,n=e.O,r=e.za,a=e.timescale,s=e.V,o=e.Kb,u=t.bandwidth||null,h=t.v.id,c=t.v.aa;return{createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(t){return 0>t||i&&t>=i?null:Math.floor((t+s)/n)},getSegmentReference:function(t){var e=t*n-s,l=Math.min(e+n,i);return 0>l||i&&e>=i?null:new ui(t,e,l,function(){var i=ti(o,h,t+r,u,e*a);return Y(c,[i])},0,null)}}}function Bi(t,e){for(var i=[],n=0;n<e.I.length;n++){var r=n+e.za;i.push(new ui(r,e.I[n].start,e.I[n].end,function(t,e,i,n,r,a){return t=ti(t,e,r,i,a),Y(n,[t]).map(function(t){return t.toString()})}.bind(null,e.Kb,t.v.id,t.bandwidth||null,t.v.aa,r,e.I[n].Te+e.dc),0,null))}return i}function Fi(t){var e=ii(t,Ui,"initialization");if(!e)return null;var i=t.v.id,n=t.bandwidth||null,r=t.v.aa;return new oi(function(){var t=ti(e,i,null,n,null);return Y(r,[t])},0,null)}function Vi(){var t,e={};for(t in cu)e[t]=!0;for(t in lu)e[t]=!0;return["application/dash+xml","application/x-mpegurl","application/vnd.apple.mpegurl","application/vnd.ms-sstr+xml"].forEach(function(t){e[t]=!!cu[t]}),["mpd","m3u8","ism"].forEach(function(t){e[t]=!!lu[t]}),e}function Hi(t,e,i,n){var r=n;return r||(n=new c(t).Y.split("/").pop().split("."),1<n.length&&(n=n.pop().toLowerCase(),r=lu[n])),r?Promise.resolve(r):(i=M([t],i),i.method="HEAD",e.request(0,i).then(function(e){return(e=e.headers["content-type"])&&(e=e.toLowerCase()),(r=cu[e])?r:Promise.reject(new h(2,4,4e3,t))},function(t){return t.severity=2,Promise.reject(t)}))}function Ki(t,e){this.c=t,this.j=e,this.f=this.a=1/0,this.b=1,this.i=0,this.h=!0,this.g=0}function qi(){this.a=this.b=null,this.g=[],this.c=null,this.i=[],this.h=1,this.j={},this.l=0,this.f=null}function Gi(t){return t.a.networkingEngine.request(0,M(t.g,t.b.retryParameters),function(){return!this.a}.bind(t)).then(function(t){if(this.a)return Xi(this,t.data,t.uri)}.bind(t))}function Xi(t,e,i){if(!(e=ri(e,"MPD")))throw new h(2,4,4001,i);return si(e,t.b.retryParameters,t.b.dash.xlinkFailGracefully,i,t.a.networkingEngine).then(function(t){return Yi(this,t,i)}.bind(t))}function Yi(t,e,i){i=[i];var n=Fe(e,"Location").map(Ve).filter(R);0<n.length&&(i=t.g=n),n=Fe(e,"BaseURL").map(Ve),i=Y(i,n);var r=He(e,"minBufferTime",qe);t.l=He(e,"minimumUpdatePeriod",qe,-1);var a=He(e,"availabilityStartTime",Ke),n=He(e,"timeShiftBufferDepth",qe),s=He(e,"suggestedPresentationDelay",qe),o=He(e,"maxSegmentDuration",qe),u=e.getAttribute("type")||"static";if(t.c)var h=t.c.presentationTimeline;else{var c=Math.max(10,1.5*r);h=new Ki(a,null!=s?s:c)}var a=zi(t,{Da:"static"!=u,presentationTimeline:h,Z:null,R:null,S:null,v:null,bandwidth:0,qc:!1},i,e),s=a.duration,l=a.periods;return h.ub("static"==u),"static"!=u&&a.ic||h.fa(s||1/0),h.Zb(null!=n?n:1/0),h.Mb(o||1),t.c?Promise.resolve():(e=Fe(e,"UTCTiming"),n=h.P(),rn(t,i,e,n).then(function(t){this.a&&(h.Pc(t),this.c={presentationTimeline:h,periods:l,offlineSessionIds:[],minBufferTime:r||0})}.bind(t)))}function zi(t,e,i,n){var r=He(n,"mediaPresentationDuration",qe),a=[],s=0;n=Fe(n,"Period");for(var o=0;o<n.length;o++){var u=n[o],s=He(u,"start",qe,s),h=He(u,"duration",qe),c=null;if(o!=n.length-1){var l=He(n[o+1],"start",qe);null!=l&&(c=l-s)}else null!=r&&(c=r-s);if(null==c&&(c=h),u=$i(t,e,i,{start:s,duration:c,node:u,Hb:null==c||o==n.length-1}),a.push(u),h=e.Z.id,-1==t.i.indexOf(h)&&(t.i.push(h),t.c&&(t.a.filterNewPeriod(u),t.c.periods.push(u))),null==c){s=null;break}s+=c}return t.c||t.a.filterAllPeriods(a),null!=r?{periods:a,duration:r,ic:!1}:{periods:a,duration:s,ic:!0}}function $i(t,e,i,n){e.Z=Zi(n.node,null,i),e.R=n,e.Z.id||(e.Z.id="__shaka_period_"+n.start),Fe(n.node,"EventStream").forEach(t.ee.bind(t,n.start,n.duration)),i=Fe(n.node,"AdaptationSet").map(t.ce.bind(t,e)).filter(R);var r=i.map(function(t){return t.qe}).reduce(P,[]),a=r.filter(N);if(e.Da&&r.length!=a.length)throw new h(2,4,4018);var s=i.filter(function(t){return!t.cc});if(i.filter(function(t){return t.cc}).forEach(function(t){var e=t.streams[0],i=t.cc;s.forEach(function(t){t.id==i&&t.streams.forEach(function(t){t.trickModeVideo=e})})}),r=Wi(s,"video"),a=Wi(s,"audio"),!r.length&&!a.length)throw new h(2,4,4004);for(a.length||(a=[null]),r.length||(r=[null]),e=[],i=0;i<a.length;i++)for(var o=0;o<r.length;o++)Ji(t,a[i],r[o],e);for(t=Wi(s,"text"),r=[],i=0;i<t.length;i++)r.push.apply(r,t[i].streams);return{startTime:n.start,textStreams:r,variants:e}}function Wi(t,e){return t.filter(function(t){return t.contentType==e})}function Ji(t,e,i,n){if(e||i)if(e&&i){var r=e.drmInfos,a=i.drmInfos;if(r.length&&a.length?0<Nt(r,a).length:1)for(var s=Nt(e.drmInfos,i.drmInfos),r=0;r<e.streams.length;r++)for(var o=0;o<i.streams.length;o++)a=(i.streams[o].bandwidth||0)+(e.streams[r].bandwidth||0),a={id:t.h++,language:e.language,primary:e.Jb||i.Jb,audio:e.streams[r],video:i.streams[o],bandwidth:a,drmInfos:s,allowedByApplication:!0,allowedByKeySystem:!0},n.push(a)}else for(s=e||i,r=0;r<s.streams.length;r++)a=s.streams[r].bandwidth||0,a={id:t.h++,language:s.language||"und",primary:s.Jb,audio:e?s.streams[r]:null,video:i?s.streams[r]:null,bandwidth:a,drmInfos:s.drmInfos,allowedByApplication:!0,allowedByKeySystem:!0},n.push(a)}function Qi(e,i){0>e.l||(e.f=t.setTimeout(e.Le.bind(e),1e3*Math.max(Math.max(3,e.l)-i,0)))}function Zi(t,e,i){e=e||{contentType:"",mimeType:"",codecs:"",containsEmsgBoxes:!1,frameRate:void 0,Nb:null},i=i||e.aa;var n=Fe(t,"BaseURL").map(Ve),r=t.getAttribute("contentType")||e.contentType,a=t.getAttribute("mimeType")||e.mimeType,s=t.getAttribute("codecs")||e.codecs,o=He(t,"frameRate",$e)||e.frameRate,u=!!Fe(t,"InbandEventStream").length,h=Fe(t,"AudioChannelConfiguration"),h=tn(h)||e.Nb;return r||(r=an(a,s)),{aa:Y(i,n),Ya:Be(t,"SegmentBase")||e.Ya,qa:Be(t,"SegmentList")||e.qa,Za:Be(t,"SegmentTemplate")||e.Za,width:He(t,"width",ze)||e.width,height:He(t,"height",ze)||e.height,contentType:r,mimeType:a,codecs:s,frameRate:o,containsEmsgBoxes:u||e.containsEmsgBoxes,id:t.getAttribute("id"),Nb:h}}function tn(t){for(var e=0;e<t.length;++e){var i=t[e],n=i.getAttribute("schemeIdUri");if(n&&(i=i.getAttribute("value")))switch(n){case"urn:mpeg:dash:outputChannelPositionList:2012":return i.trim().split(/ +/).length;case"urn:mpeg:dash:23003:3:audio_channel_configuration:2011":case"urn:dts:dash:audio_channel_configuration:2012":if(!(n=parseInt(i,10)))continue;return n;case"tag:dolby.com,2014:dash:audio_channel_configuration:2011":case"urn:dolby:dash:audio_channel_configuration:2011":if(n=parseInt(i,16)){for(t=0;n;)1&n&&++t,n>>=1;return t}}}return null}function en(t){var e=0+(t.Ya?1:0);return e+=t.qa?1:0,(e+=t.Za?1:0)?(1!=e&&(t.Ya&&(t.qa=null),t.Za=null),!0):"text"==t.contentType||"application"==t.contentType}function nn(t,e,i,n){return e=Y(e,[i]),e=M(e,t.b.retryParameters),e.method=n,t.a.networkingEngine.request(0,e).then(function(t){if("HEAD"==n){if(!t.headers||!t.headers.date)return 0;t=t.headers.date}else t=tt(t.data);return t=Date.parse(t),isNaN(t)?0:t-Date.now()})}function rn(t,e,i,n){i=i.map(function(t){return{scheme:t.getAttribute("schemeIdUri"),value:t.getAttribute("value")}});var r=t.b.dash.clockSyncUri;return n&&!i.length&&r&&i.push({scheme:"urn:mpeg:dash:utc:http-head:2014",value:r}),_(i,function(t){var i=t.value;switch(t.scheme){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":return nn(this,e,i,"HEAD");case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":return nn(this,e,i,"GET");case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":return t=Date.parse(i),isNaN(t)?0:t-Date.now();case"urn:mpeg:dash:utc:http-ntp:2014":case"urn:mpeg:dash:utc:ntp:2014":case"urn:mpeg:dash:utc:sntp:2014":default:return Promise.reject()}}.bind(t)).catch(function(){return 0})}function an(t,e){return Ko[Z(t,e)]?"text":t.split("/")[0]}function sn(t,e,i,n){this.uri=t,this.type=e,this.a=i,this.segments=n||null}function on(t,e,i,n){this.id=t,this.name=e,this.a=i,this.value=n||null}function un(t,e){this.name=t,this.value=e}function hn(t,e,i){return i=i||null,(t=t.getAttribute(e))?t.value:i}function cn(t,e){this.a=e,this.uri=t}function ln(t,e){return t.filter(function(t){return t.name==e})}function fn(t,e){var i=ln(t,e);return i.length?i[0]:null}function dn(t,e,i){return t.filter(function(t){var n=t.getAttribute("TYPE");return t=t.getAttribute("GROUP-ID"),n.value==e&&t.value==i})}function pn(t,e){return Y([t],[e])[0]}function mn(t){this.b=t,this.a=0}function yn(t,e){e.lastIndex=t.a;var i=(i=e.exec(t.b))?{position:i.index,length:i[0].length,te:i}:null;return t.a!=t.b.length&&i&&i.position==t.a?(t.a+=i.length,i.te):null}function vn(t){return t.a==t.b.length?null:(t=yn(t,/[^ \t\n]*/gm))?t[0]:null}function gn(){this.a=0}function bn(t,e,i){e=tt(e),e=e.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n").trim();var n=e.split(/\n+/m);if(!/^#EXTM3U($|[ \t\n])/m.test(n[0]))throw new h(2,4,4015);e=0;for(var r=[],a=1;a<n.length;)if(/^#(?!EXT)/m.test(n[a]))a+=1;else{var s=n[a];if(s=wn(t.a++,s),0<=fu.indexOf(s.name))e=1;else if(0<=du.indexOf(s.name)){if(1!=e)throw new h(2,4,4017);return n=n.splice(a,n.length-a),t=Tn(t,n,r),new sn(i,e,r,t)}r.push(s),a+=1,"EXT-X-STREAM-INF"==s.name&&(s.a.push(new un("URI",n[a])),a+=1)}return new sn(i,e,r)}function Tn(t,e,i){var n=[],r=[];return e.forEach(function(t){/^(#EXT)/.test(t)?(t=wn(this.a++,t),0<=fu.indexOf(t.name)?i.push(t):r.push(t)):/^#(?!EXT)/m.test(t)||(n.push(new cn(t.trim(),r)),r=[])}.bind(t)),n}function wn(t,e){var i=e.match(/^#(EXT[^:]*)(?::(.*))?$/);if(!i)throw new h(2,4,4016);var n=i[1],r=i[2],i=[];if(r&&0<=r.indexOf("="))for(var a,r=new mn(r),s=/([^=]+)=(?:"([^"]*)"|([^",]*))(?:,|$)/g;a=yn(r,s);)i.push(new un(a[1],a[2]||a[3]));else if(r)return new on(t,n,i,r);return new on(t,n,i)}function En(t){return new Promise(function(e){var i=En.parse(t);e({uri:t,data:i.data,headers:{"content-type":i.contentType}})})}function Sn(){this.g=this.c=null,this.F=1,this.u={},this.A={},this.K={},this.a={},this.b=null,this.l="",this.s=new gn,this.i=this.h=null,this.f=vu,this.m=null,this.j=0,this.w=1/0}function An(t,e,i){Yn(t,i).then(function(t){var n=gu,r=bn(this.s,t.data,i);if(1!=r.type)throw new h(2,4,4017);t=fn(r.a,"EXT-X-MEDIA-SEQUENCE");var a=e.stream;jn(this,r,t?Number(t.value):0,a.mimeType,a.codecs).then(function(t){e.tb.a=t,t=t[t.length-1],fn(r.a,"EXT-X-ENDLIST")&&($n(this,n.na),this.b.fa(t.endTime))}.bind(this))}.bind(t))}function kn(t,e,i){if(e=bn(t.s,e,i),0!=e.type)throw new h(2,4,4022);return In(t,e).then(function(t){if(this.c.filterAllPeriods([t]),this.f!=gu.na){var e=3*this.j;this.b.Qc(e),this.h=this.w,this.f==gu.ec&&this.b.Zb(e)}else{var i,n=1/0,r=1/0;for(i in this.a)e=this.a[i],n=Math.min(n,e.Bd),r=Math.min(r,e.duration);this.b.fa(r);for(i in this.a)e=this.a[i],e.stream.presentationTimeOffset=n,e.tb.offset(-n),bi(e.tb,r)}this.m={presentationTimeline:this.b,periods:[t],offlineSessionIds:[],minBufferTime:0}}.bind(t))}function In(t,e){var i=e.a,n=ln(e.a,"EXT-X-MEDIA").filter(function(t){return"SUBTITLES"==Gn(t,"TYPE")}.bind(t)).map(function(t){return Rn(this,t)}.bind(t));return Promise.all(n).then(function(t){var n=ln(i,"EXT-X-STREAM-INF").map(function(t){return _n(this,t,e)}.bind(this));return Promise.all(n).then(function(e){return{startTime:0,variants:e.reduce(P,[]),textStreams:t}}.bind(this))}.bind(t))}function _n(t,e,i){var n=hn(e,"CODECS","avc1.42E01E,mp4a.40.2").split(","),r=e.getAttribute("RESOLUTION"),a=null,s=null,o=hn(e,"FRAME-RATE"),u=Number(Gn(e,"BANDWIDTH"));if(r)var h=r.value.split("x"),a=h[0],s=h[1];i=ln(i.a,"EXT-X-MEDIA");var c=hn(e,"AUDIO"),l=hn(e,"VIDEO");if(c?i=dn(i,"AUDIO",c):l&&(i=dn(i,"VIDEO",l)),h=Kn("text",n)){var f=hn(e,"SUBTITLES");f&&(f=dn(i,"SUBTITLES",f),f.length&&(t.u[f[0].id].stream.codecs=h)),n.splice(n.indexOf(h),1)}i=i.map(function(t){return Nn(this,t,n)}.bind(t));var d=[],p=[];return Promise.all(i).then(function(t){if(c?d=t:l&&(p=t),d.length||p.length)if(d.length)if(Gn(e,"URI")==d[0].Wb){t="audio";var i=!0}else t="video";else t="audio";else i=!1,1==n.length?(t=Kn("video",n),t=r||o||t?"video":"audio"):(t="video",n=[n.join(",")]);return i?Promise.resolve():Dn(this,e,n,t)}.bind(t)).then(function(t){return t&&("audio"==t.stream.type?d=[t]:p=[t]),Pn(this,d,p,u,a,s,o)}.bind(t))}function Pn(t,e,i,n,r,a,s){i.forEach(function(t){(t=t.stream)&&(t.width=Number(r)||void 0,t.height=Number(a)||void 0,t.frameRate=Number(s)||void 0)}.bind(t)),e.length||(e=[null]),i.length||(i=[null]);for(var o=[],u=0;u<e.length;u++)for(var h=0;h<i.length;h++){var c=e[u]?e[u].stream:null,l=i[h]?i[h].stream:null,f=e[u]?e[u].drmInfos:null,d=i[h]?i[h].drmInfos:null;if(c&&l){if(!(f.length&&d.length?0<Nt(f,d).length:1))continue;var p=Nt(f,d)}else c?p=f:l&&(p=d);f=(i[u]?i[u].Wb:"")+" - "+(e[u]?e[u].Wb:""),t.A[f]||(c=xn(t,c,l,n,p),o.push(c),t.A[f]=c)}return o}function xn(t,e,i,n,r){return{id:t.F++,language:e?e.language:"und",primary:!!e&&e.primary||!!i&&i.primary,audio:e,video:i,bandwidth:n,drmInfos:r,allowedByApplication:!0,allowedByKeySystem:!0}}function Rn(t,e){return Gn(e,"TYPE"),Nn(t,e,[]).then(function(t){return t.stream})}function Nn(t,e,i){var n=Gn(e,"URI"),n=pn(t.l,n);if(t.a[n])return Promise.resolve(t.a[n]);var r=Gn(e,"TYPE").toLowerCase();"subtitles"==r&&(r="text");var a=Zt(hn(e,"LANGUAGE","und")),s=hn(e,"NAME"),o=e.getAttribute("DEFAULT"),u=e.getAttribute("AUTOSELECT"),h=hn(e,"CHANNELS");return Mn(t,n,i,r,a,!!o||!!u,s,"audio"==r?Ln(h):null).then(function(t){return this.a[n]?this.a[n]:(this.u[e.id]=t,this.a[n]=t)}.bind(t))}function Ln(t){return t?(t=t.split("/")[0],parseInt(t,10)):null}function Dn(t,e,i,n){var r=Gn(e,"URI"),r=pn(t.l,r);return t.a[r]?Promise.resolve(t.a[r]):Mn(t,r,i,n,"und",!1,null,null).then(function(t){return this.a[r]?this.a[r]:this.a[r]=t}.bind(t))}function Mn(t,e,i,n,r,a,s,o){var u=e;e=pn(t.l,e);var c,l,f="";return Yn(t,e).then(function(t){if(c=bn(this.s,t.data,e),1!=c.type)throw new h(2,4,4017);t=c;var r=gu,a=fn(t.a,"EXT-X-PLAYLIST-TYPE"),s=fn(t.a,"EXT-X-ENDLIST"),s=a&&"VOD"==a.value||s,a=a&&"EVENT"==a.value&&!s,a=!s&&!a;if(s?$n(this,r.na):(a?$n(this,r.ec):$n(this,r.Vc),t=Xn(t.a,"EXT-X-TARGETDURATION"),t=Number(t.value),this.j=Math.max(t,this.j),this.w=Math.min(t,this.w)),1==i.length)f=i[0];else{if(null==(t=Kn(n,i)))throw new h(2,4,4025,i);f=t}return qn(this,n,f,c)}.bind(t)).then(function(t){return l=t,t=fn(c.a,"EXT-X-MEDIA-SEQUENCE"),jn(this,c,t?Number(t.value):0,l,f)}.bind(t)).then(function(t){var e=t[0].startTime,i=t[t.length-1].endTime,d=i-e,p=new gi(t);this.b||Cn(this,i),i=null,"text"!=n&&(i=On(c)),this.b.Ia(0,t),t=void 0,"text"==n&&(t="subtitle");var m=[];c.segments.forEach(function(t){t=ln(t.a,"EXT-X-KEY"),m.push.apply(m,t)});var y=!1,v=[],g=null;if(m.forEach(function(t){if("NONE"!=Gn(t,"METHOD")){y=!0;var e=Gn(t,"KEYFORMAT");(t=(e=yu[e])?e(t):null)&&(t.keyIds.length&&(g=t.keyIds[0]),v.push(t))}}),y&&!v.length)throw new h(2,4,4026);return t={id:this.F++,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:p.find.bind(p),getSegmentReference:p.get.bind(p),initSegmentReference:i,presentationTimeOffset:0,mimeType:l,codecs:f,kind:t,encrypted:y,keyId:g,language:r,label:s||null,type:n,primary:a,trickModeVideo:null,containsEmsgBoxes:!1,frameRate:void 0,width:void 0,height:void 0,bandwidth:void 0,roles:[],channelsCount:o},this.K[t.id]=p,{stream:t,tb:p,drmInfos:v,Wb:u,Bd:e,duration:d}}.bind(t))}function Cn(t,e){var i=null,n=0;t.f!=gu.na&&(i=Date.now()/1e3-e,n=3*t.j),t.b=new Ki(i,n),t.b.ub(t.f==gu.na)}function On(t){var e=ln(t.a,"EXT-X-MAP");if(!e.length)return null;if(1<e.length)throw new h(2,4,4020);var e=e[0],i=Gn(e,"URI"),n=pn(t.uri,i);return t=0,i=null,(e=hn(e,"BYTERANGE"))&&(t=e.split("@"),e=Number(t[0]),t=Number(t[1]),i=t+e-1),new oi(function(){return[n]},t,i)}function Un(t,e,i,n,r){var a=i.a,s=pn(t.uri,i.uri);t=Xn(a,"EXTINF").value.split(","),t=r+Number(t[0]),i=0;var o=null;return(a=fn(a,"EXT-X-BYTERANGE"))&&(i=a.value.split("@"),a=Number(i[0]),i=i[1]?Number(i[1]):e.D+1,o=i+a-1),new ui(n,r,t,function(){return[s]},i,o)}function jn(t,e,i,n,r){var a=e.segments,s=[],o=pn(e.uri,a[0].uri),u=Un(e,null,a[0],i,0);return Fn(t,e.uri,u,n,r).then(function(t){o.split("/").pop();for(var n=0;n<a.length;++n){var r=s[s.length-1],r=Un(e,r,a[n],i+n,n?r.endTime:t);s.push(r)}return s}.bind(t))}function Bn(t,e){var i=t.c.networkingEngine,n=M(e.a(),t.g.retryParameters),r={},a=e.N;r.Range="bytes="+a+"-"+(a+2048-1);var s={};return(a||null!=e.D)&&(a="bytes="+a+"-",null!=e.D&&(a+=e.D),s.Range=a),n.headers=r,i.request(1,n).catch(function(){return o("Unable to fetch a partial HLS segment! Falling back to a full segment request, which is expensive! Your server should support Range requests and CORS preflights.",n.uris[0]),n.headers=s,i.request(1,n)})}function Fn(t,e,i,n,r){return t.m&&(e=t.a[e].tb.get(i.position))?Promise.resolve(e.startTime):Bn(t,i).then(function(t){if("video/mp4"==n||"audio/mp4"==n)return Vn(t.data);if("video/mp2t"==n)return Hn(t.data);if("application/mp4"!=n&&n.indexOf("text/"))throw new h(2,4,4030);t=t.data;var e=Z(n,r);if(Ko[e]){var i=new Bt(null);i.c=new Ko[e],t=i.Gb(t)}else t=0;return t}.bind(t))}function Vn(t){var e=0,i=!1;if((new li).C("moof",fi).C("traf",fi).ba("tfdt",function(t){e=(t.version?t.o.Na():t.o.B())/9e4,i=!0,t.oa.stop()}).parse(t,!0),!i)throw new h(2,4,4030);return e}function Hn(t){function e(){throw new h(2,4,4030)}t=new hi(new DataView(t),0);for(var i=0;;){i=t.U();var n=t.$();if(71!=n&&e(),16384&t.Xa()||e(),(n=(48&t.$())>>4)&&2!=n||e(),3==n&&(n=t.$(),t.H(n)),1==t.B()>>8)return t.H(3),(i=t.$()>>6)&&1!=i||e(),t.$()||e(),i=t.$(),n=t.Xa(),t=t.Xa(),(1073741824*((14&i)>>1)+((65534&n)<<14|(65534&t)>>1))/9e4;t.seek(i+188),n=t.$(),71!=n&&(t.seek(i+192),n=t.$()),71!=n&&(t.seek(i+204),n=t.$()),71!=n&&e(),t.Lc(1)}}function Kn(t,e){for(var i=pu[t],n=0;n<i.length;n++)for(var r=0;r<e.length;r++)if(i[n].test(e[r].trim()))return e[r].trim();return"text"==t?"":null}function qn(t,e,i,n){n=pn(n.uri,n.segments[0].uri);var r=new c(n).Y.split(".").pop(),a=mu[e][r];return a?Promise.resolve(a):"text"==e?i&&"vtt"!=i?Promise.resolve("application/mp4"):Promise.resolve("text/vtt"):(e=M([n],t.g.retryParameters),e.method="HEAD",t.c.networkingEngine.request(1,e).then(function(t){if(!(t=t.headers["content-type"]))throw new h(2,4,4021,r);return t.split(";")[0]}))}function Gn(t,e){var i=t.getAttribute(e);if(!i)throw new h(2,4,4023,e);return i.value}function Xn(t,e){var i=fn(t,e);if(!i)throw new h(2,4,4024,e);return i}function Yn(t,e){return t.c.networkingEngine.request(0,M([e],t.g.retryParameters),function(){return!this.c}.bind(t))}function zn(e,i){null!=e.h&&null!=i&&(e.i=t.setTimeout(e.J.bind(e),1e3*i))}function $n(e,i){e.f=i,e.b&&e.b.ub(e.f==gu.na),e.f==gu.na&&null!=e.i&&(t.clearTimeout(e.i),e.i=null,e.h=null)}function Wn(t,e,i,n,r,a){this.a=t,this.c=e,this.l=i,this.m=null==n?null:Qn(this,n),this.K=r,this.J=a,this.b=new V,this.j=!1,this.i=1,this.h=this.f=null,this.g=new at(this.Dd.bind(this)),this.F=t.readyState,this.s=!1,this.A=this.W=-1,this.u=this.w=!1,0<t.readyState?this.yc():(K(this.b,t,"loadedmetadata",this.yc.bind(this)),H(this.b,t,"timeupdate",function(){st(this.g,.1)}.bind(this))),e=this.Ac.bind(this),H(this.b,t,"ratechange",this.Qd.bind(this)),H(this.b,t,"waiting",e),this.h=new at(e),ot(this.h,.25)}function Jn(t,e){0<t.a.readyState?t.a.currentTime=rr(t,e):t.m=e}function Qn(t,e){var i=t.c.presentationTimeline.T();return e>=i?i-t.l.durationBackoff:e}function Zn(t){return 0<t.a.readyState?t.a.paused?t.a.currentTime:rr(t,t.a.currentTime):tr(t)}function tr(t){if(null!=t.m)return rr(t,t.m);var e=t.c.presentationTimeline;return e=1/0>e.T()?e.ja():e.pb(),t.m=Qn(t,e),e}function er(t,e){t.f&&(t.f.cancel(),t.f=null),t.i=e,t.a.playbackRate=t.j||0>e?0:e,!t.j&&0>e&&(t.f=new at(function(){this.a.currentTime+=e/4}.bind(t)),ot(t.f,.25))}function ir(t,e){var i=Dt.bind(null,t.a.buffered),n=1*Math.max(t.c.minBufferTime||0,t.l.rebufferingGoal),r=t.c.presentationTimeline,a=r.Fa(0),s=r.va(),o=r.T(),u=r.Fa(n),h=r.Fa(5),n=r.Fa(n+5);return e>=o?Qn(t,e):e>s?s:e<a?i(h)?h:n:e>=u||i(e)?e:n}function nr(t,e,i){t.a.currentTime=i;var n=0,r=function(){!this.a||10<=n++||this.a.currentTime!=e||(this.a.currentTime=i,setTimeout(r,100))}.bind(t);setTimeout(r,100)}function rr(t,e){var i=t.c.presentationTimeline.ja();return e<i?i:(i=t.c.presentationTimeline.va(),e>i?i:e)}function ar(t,e,i,n,r,a,s){this.a=t,this.w=e,this.g=i,this.u=n,this.l=r,this.h=a,this.A=s,this.c=[],this.j=new V,this.b=!1,this.i=-1,this.f=null,or(this)}function sr(t){var e=I(t);return e.eventElement=t.eventElement,e}function or(e){ur(e),e.f=t.setTimeout(e.F.bind(e),250)}function ur(e){e.f&&(t.clearTimeout(e.f),e.f=null)}function hr(t,e){this.a=e,this.b=t,this.h=null,this.i=1,this.m=Promise.resolve(),this.g=[],this.j={},this.c={},this.s=!1,this.A=null,this.w=this.f=this.l=!1,this.u=0}function cr(t){var e=Zn(t.a.Ka);return t.b.periods[be(t.b,e)]}function lr(t){var e=t.c.video||t.c.audio;return e?t.b.periods[e.xa]:null}function fr(t){return pr(t,"audio")}function dr(t){return pr(t,"video")}function pr(t,e){var i=t.c[e];return i?i.pa||i.stream:null}function mr(t,e){t.u++,t.w=!1;var i=t.u;return t.a.L.init({text:e}),Ar(t,[e]).then(function(){if(this.u==i&&!this.c.text&&!this.w){var t=Zn(this.a.Ka);this.c.text=Er(e,be(this.b,t)),jr(this,this.c.text,0)}}.bind(t))}function yr(t,e){var i=t.c.video;if(i){var n=i.stream;if(n)if(e){var r=n.trickModeVideo;if(r){var a=i.pa;a||(gr(t,r,!1),i.pa=n)}}else(a=i.pa)&&(i.pa=null,gr(t,a,!0))}}function vr(t,e,i){e.video&&gr(t,e.video,i),e.audio&&gr(t,e.audio,i)}function gr(t,e,i){var n=t.c[e.type];if(!n&&"text"==e.type&&t.h.ignoreTextStreamFailures)mr(t,e);else if(n){var r=Te(t.b,e);i&&r!=n.xa?Tr(t):(n.pa&&(e.trickModeVideo?(n.pa=e,e=e.trickModeVideo):n.pa=null),(r=t.g[r])&&r.Oa&&(r=t.j[e.id])&&r.Oa&&n.stream!=e&&("text"==e.type&&Kt(t.a.L,Z(e.mimeType,e.codecs)),n.stream=e,n.qb=!0,i&&(n.ta?n.wb=!0:n.ya?(n.sa=!0,n.wb=!0):(Br(n),Ur(t,n,!0)))))}}function br(t){var e=Zn(t.a.Ka);Object.keys(t.c).every(function(t){var i=this.a.L;return"text"==t?(t=i.a,t=e>=t.a&&e<t.b):(t=Gt(i,t),t=Dt(t,e)),t}.bind(t))||Tr(t)}function Tr(t){for(var e in t.c){var i=t.c[e];i.ta||i.sa||(i.ya?i.sa=!0:null==qt(t.a.L,e)?null==i.ra&&jr(t,i,0):(Br(i),Ur(t,i,!1)))}}function wr(t,e,i){var n=Zn(t.a.Ka),r=be(t.b,n),a={},n=[];return e.variant&&e.variant.audio&&(a.audio=e.variant.audio,n.push(e.variant.audio)),e.variant&&e.variant.video&&(a.video=e.variant.video,n.push(e.variant.video)),e.text&&(a.text=e.text,n.push(e.text)),t.a.L.init(a),kr(t),Ar(t,n).then(function(){if(!this.f)for(var t in a){var e=a[t];this.c[t]||(this.c[t]=Er(e,r,i),jr(this,this.c[t],0))}}.bind(t))}function Er(t,e,i){return{stream:t,type:t.type,Ga:null,ka:null,pa:null,qb:!0,xa:e,endOfStream:!1,ya:!1,ra:null,sa:!1,wb:!1,ta:!1,Vb:!1,Ua:!1,Jc:i||0}}function Sr(t,e){var i=t.g[e];if(i)return i.M;i={M:new b,Oa:!1},t.g[e]=i;var n=t.b.periods[e].variants.map(function(t){var e=[];return t.audio&&e.push(t.audio),t.video&&e.push(t.video),t.video&&t.video.trickModeVideo&&e.push(t.video.trickModeVideo),e}).reduce(P,[]).filter(N);return n.push.apply(n,t.b.periods[e].textStreams),t.m=t.m.then(function(){if(!this.f)return Ar(this,n)}.bind(t)).then(function(){this.f||(this.g[e].M.resolve(),this.g[e].Oa=!0)}.bind(t)).catch(function(t){this.f||(this.g[e].M.reject(),delete this.g[e],this.a.onError(t))}.bind(t)),i.M}function Ar(t,e){e.map(function(t){return t.id}).filter(N);for(var i=[],n=0;n<e.length;++n){var r=e[n],a=t.j[r.id];a?i.push(a.M):(t.j[r.id]={M:new b,Oa:!1},i.push(r.createSegmentIndex()))}return Promise.all(i).then(function(){if(!this.f)for(var t=0;t<e.length;++t){var i=this.j[e[t].id];i.Oa||(i.M.resolve(),i.Oa=!0)}}.bind(t)).catch(function(t){if(!this.f)return this.j[r.id].M.reject(),delete this.j[r.id],Promise.reject(t)}.bind(t))}function kr(t){var e=t.b.presentationTimeline.T();1/0>e?t.a.L.fa(e):t.a.L.fa(Math.pow(2,32))}function Ir(t,e){var i=Zn(t.a.Ka),n=e.Ga&&e.ka?t.b.periods[Te(t.b,e.Ga)].startTime+e.ka.endTime:Math.max(i,e.Jc),r=Te(t.b,e.stream),a=be(t.b,n),s=t.a.L,o=e.type;return"text"==o?(s=s.a,s=null==s.b||s.b<i?0:s.b-Math.max(i,s.a)):(s=Gt(s,o),s=Mt(s,i)),o=Math.max(t.i*Math.max(t.b.minBufferTime||0,t.h.rebufferingGoal),t.i*t.h.bufferingGoal),n>=t.b.presentationTimeline.T()?(e.endOfStream=!0,null):(e.endOfStream=!1,e.xa=a,a!=r?null:s>=o?.5:(n=t.a.L,a=e.type,n="text"==a?n.a.b:Lt(Gt(n,a)),e.ka&&e.stream==e.Ga?(a=e.ka.position+1,n=_r(t,e,r,a)):(a=e.ka?e.stream.findSegmentPosition(Math.max(0,t.b.periods[Te(t.b,e.Ga)].startTime+e.ka.endTime-t.b.periods[r].startTime)):e.stream.findSegmentPosition(Math.max(0,(n||i)-t.b.periods[r].startTime)),null==a?n=null:(s=null,null==n&&(s=_r(t,e,r,Math.max(0,a-1))),n=s||_r(t,e,r,a))),n?(e.Jc=0,Pr(t,e,i,r,n),null):1))}function _r(t,e,i,n){return i=t.b.periods[i],(e=e.stream.getSegmentReference(n))?(n=t.b.presentationTimeline,t=n.ja(),n=n.va(),i.startTime+e.endTime<t||i.startTime+e.startTime>n?null:e):null}function Pr(t,e,i,n,r){var a=t.b.periods[n],s=e.stream,o=t.b.presentationTimeline.T(),u=t.b.periods[n+1];n=Rr(t,e,n,a.startTime,u?u.startTime:o),e.ya=!0,e.qb=!1,o=Or(t,r),Promise.all([n,o]).then(function(t){if(!this.f&&!this.l)return Nr(this,e,i,a,s,r,t[1])}.bind(t)).then(function(){this.f||this.l||(e.ya=!1,e.Vb=!1,e.sa||this.a.Qb(),jr(this,e,0),Dr(this,s))}.bind(t)).catch(function(t){this.f||this.l||(e.ya=!1,"text"==e.type&&this.h.ignoreTextStreamFailures?delete this.c.text:3017==t.code?xr(this,e,t):(e.Ua=!0,t.severity=2,Fr(this,t)))}.bind(t))}function xr(t,e,i){if(!W(t.c).some(function(t){return t!=e&&t.Vb})){var n=Math.round(100*t.i);if(20<n)t.i-=.2;else{if(!(4<n))return e.Ua=!0,t.l=!0,void t.a.onError(i);t.i-=.04}e.Vb=!0}jr(t,e,4)}function Rr(t,e,i,n,r){return e.qb?(i=zt(t.a.L,e.type,t.b.periods[i].startTime-e.stream.presentationTimeOffset,n,r),e.stream.initSegmentReference?(t=Or(t,e.stream.initSegmentReference).then(function(t){if(!this.f)return Xt(this.a.L,e.type,t,null,null)}.bind(t)).catch(function(t){return e.qb=!0,Promise.reject(t)}),Promise.all([i,t])):i):Promise.resolve()}function Nr(t,e,i,n,r,a,s){return r.containsEmsgBoxes&&(new li).ba("emsg",t.de.bind(t,n,a)).parse(s),Lr(t,e,i).then(function(){if(!this.f)return Xt(this.a.L,e.type,s,a.startTime+n.startTime,a.endTime+n.startTime)}.bind(t)).then(function(){if(!this.f)return e.Ga=r,e.ka=a,Promise.resolve()}.bind(t))}function Lr(t,e,i){var n=qt(t.a.L,e.type);return null==n?Promise.resolve():(i=i-n-t.h.bufferBehind,0>=i?Promise.resolve():t.a.L.remove(e.type,n,n+i).then(function(){}.bind(t)))}function Dr(t,e){if(!t.s&&(t.s=W(t.c).every(function(t){return"text"==t.type||!t.sa&&!t.ta&&t.ka}),t.s)){var i=Te(t.b,e);for(t.g[i]||Sr(t,i).then(function(){this.a.sc()}.bind(t)).catch(x),i=0;i<t.b.periods.length;++i)Sr(t,i).catch(x);t.a.Vd&&t.a.Vd()}}function Mr(t,e){if(e.xa!=Te(t.b,e.stream)){var i=e.xa,n=W(t.c);n.every(function(t){return t.xa==i})&&n.every(Cr)&&Sr(t,i).then(function(){if(!this.f&&n.every(function(t){var e=Te(this.b,t.stream);return Cr(t)&&t.xa==i&&e!=i}.bind(this))){var t=this.b.periods[i],e=this.a.tc(t),r={};e.variant&&e.variant.video&&(r.video=e.variant.video),e.variant&&e.variant.audio&&(r.audio=e.variant.audio),e.text&&(r.text=e.text);for(var a in this.c)if(!r[a]&&"text"!=a)return void this.a.onError(new h(2,5,5005));for(a in r)if(!this.c[a]){if("text"!=a)return void this.a.onError(new h(2,5,5005));wr(this,{text:r.text},t.startTime),delete r[a]}for(a in this.c)(t=r[a])?(gr(this,t,!1),jr(this,this.c[a],0)):delete this.c[a];this.a.sc()}}.bind(t)).catch(x)}}function Cr(t){return!t.ya&&null==t.ra&&!t.sa&&!t.ta}function Or(t,e){var i=M(e.a(),t.h.retryParameters);if(e.N||null!=e.D){var n="bytes="+e.N+"-";null!=e.D&&(n+=e.D),i.headers.Range=n}return t.a.Wa.request(1,i).then(function(t){return t.data})}function Ur(t,e,i){e.sa=!1,e.wb=!1,e.ta=!0,Yt(t.a.L,e.type).then(function(){if(!this.f&&i){var t=this.a.L,n=e.type;return"text"==n?Promise.resolve():$t(t,n,t.hd.bind(t,n))}}.bind(t)).then(function(){this.f||(e.Ga=null,e.ka=null,e.ta=!1,e.endOfStream=!1,jr(this,e,0))}.bind(t))}function jr(e,i,n){i.ra=t.setTimeout(e.Ne.bind(e,i),1e3*n)}function Br(e){null!=e.ra&&(t.clearTimeout(e.ra),e.ra=null)}function Fr(t,e){w(t.A).then(function(){this.a.onError(e),e.handled||this.h.failureCallback(e)}.bind(t))}function Vr(t,e){return new Promise(function(i,n){var r=new XMLHttpRequest;r.open(e.method,t,!0),r.responseType="arraybuffer",r.timeout=e.retryParameters.timeout,r.withCredentials=e.allowCrossSiteCredentials,r.onload=function(e){e=e.target;var r=e.getAllResponseHeaders().trim().split("\r\n").reduce(function(t,e){var i=e.split(": ");return t[i[0].toLowerCase()]=i.slice(1).join(": "),t},{});if(200<=e.status&&299>=e.status&&202!=e.status)e.responseURL&&(t=e.responseURL),i({uri:t,data:e.response,headers:r,fromCache:!!r["x-shaka-from-cache"]});else{var a=null;try{a=it(e.response)}catch(t){}n(new h(401==e.status||403==e.status?2:1,1,1001,t,e.status,a,r))}},r.onerror=function(){n(new h(1,1,1002,t))},r.ontimeout=function(){n(new h(1,1,1003,t))};for(var a in e.headers)r.setRequestHeader(a,e.headers[a]);r.send(e.body)})}function Hr(t,e,i){t.openCursor().onsuccess=function(t){var n=t.target.result;n?e(n.key,n.value,function(){n.continue()}):i()}}function Kr(t,e){function i(t){return c?t:(t.close(),Promise.reject(new h(2,9,9001,"Failed to issue upgrade after "+u+" retries")))}function n(t){return c?t:(t.close(),a().then(function(){return r()}))}function r(){return qr(t,s)}function a(){return new Promise(function(t){setTimeout(t,1e3)})}function s(t,e,i){o(t,e,i),c=!0}var o=sa,u=e||0,c=!1,l=Promise.resolve().then(r);if(u){for(var f=0;f<u;f++)l=l.then(n);l=l.then(i)}return l}function qr(e,i){var n=t.indexedDB.open(e,2),r=new b;return n.onupgradeneeded=function(t){var e=t.target.transaction;i(t.oldVersion,e.db,e)},n.onsuccess=function(t){r.resolve(t.target.result)},n.onerror=function(){r.reject(new h(2,9,9001,"Failed to open indexeddb"))},r}function Gr(){}function Xr(){}function Yr(t){var e=t.periods.map(function(t){return zr(t)});return{originalManifestUri:t.originalManifestUri,duration:t.duration,size:t.size,expiration:t.expiration,periods:e,sessionIds:t.sessionIds,drmInfo:t.drmInfo,appMetadata:t.appMetadata}}function zr(t){Wr(t);var e=t.streams.map(function(t){return $r(t)});return{startTime:t.startTime,streams:e}}function $r(t){var e=t.segments.map(function(t){var e=Jr(t.uri);return{startTime:t.startTime,endTime:t.endTime,dataKey:e}}),i=t.initSegmentUri?Jr(t.initSegmentUri):null;return{id:t.id,primary:t.primary,presentationTimeOffset:t.presentationTimeOffset,contentType:t.contentType,mimeType:t.mimeType,codecs:t.codecs,frameRate:t.frameRate,kind:t.kind,language:t.language,label:t.label,width:t.width,height:t.height,initSegmentKey:i,encrypted:t.encrypted,keyId:t.keyId,segments:e,variantIds:t.variantIds}}function Wr(t){var e=[];e.push.apply(e,t.streams),t=e.filter(function(t){return"audio"==t.contentType});var i=e.filter(function(t){return"video"==t.contentType}),n=[];n.push.apply(n,t),n.push.apply(n,i);var r=e.every(function(t){return null==t.variantIds});if(e.every(function(t){return null!=(t=t.variantIds)&&void 0!=t}),r){e.forEach(function(t){t.variantIds=[]});var a=0;t.length&&i.length?t.forEach(function(t){i.forEach(function(e){t.variantIds.push(a),e.variantIds.push(a),a++})}):n.forEach(function(t){t.variantIds.push(a),a++})}}function Jr(t){var e=(e=/^offline:[0-9]+\/[0-9]+\/([0-9]+)$/.exec(t))?Number(e[1]):null;return null==e&&(e=(t=/^offline:segment\/([0-9]+)$/.exec(t))?Number(t[1]):null),e}function Qr(t){this.c=t,this.b=null,this.a=[]}function Zr(t,e){return ea(t,e)}function ta(t,e,i){var n;return aa(t,e,"readonly",function(t){n=t.get(i)}).then(function(){return n.result})}function ea(t,e){function i(){}return aa(t,"manifest-v2","readonly",function(t){Hr(t,function(t,i,n){e(t,i),n()},i)})}function ia(t,e,i){return aa(t,"manifest-v2","readwrite",function(t){t.put(i,e)})}function na(t,e,i){var n;return aa(t,e,"readwrite",function(t){t.add(i).onsuccess=function(t){n=t.target.result}}).then(function(){return n})}function ra(t,e,i,n){return aa(t,e,"readwrite",function(t){i.forEach(function(e){t.delete(e).onsuccess=function(){n&&n(e)}})})}function aa(t,e,i,n){var r={transaction:t.b.transaction([e],i),M:new b};return r.transaction.oncomplete=function(){t.a.splice(t.a.indexOf(r),1),r.M.resolve()},r.transaction.onabort=function(e){t.a.splice(t.a.indexOf(r),1);var i=r.transaction;r.M.reject(i.error?new h(2,9,9001,i.error):new h(2,9,9002)),e.preventDefault()},r.transaction.onerror=function(t){t.preventDefault()},e=r.transaction.objectStore(e),n(e),t.a.push(r),r.M}function sa(t,e,i){var n={0:new Gr,1:new Xr}[t];if(!n)throw new h(1,9,9001,"Attemping to upgrade from version "+t+" which is not supported. To use offline, please delete the offline storage.");n.a(e,i)}function oa(t,e,i){this.b={},this.i=[],this.h=t,this.j=e,this.m=i,this.g=this.a=null,this.f=this.c=0,this.l=[]}function ua(t,e){t.l.push(e)}function ha(t,e,i,n,r){t.b[e]=t.b[e]||[],t.b[e].push({uris:i.a(),N:i.N,D:i.D,gc:n,Wd:r})}function ca(t,e){t.c=0,t.f=0,W(t.b).forEach(function(t){t.forEach(this.s.bind(this))}.bind(t)),t.a=e;var i=W(t.b).map(function(t){var e=0,i=function(){return this.a?e>=t.length?Promise.resolve():la(this,t[e++]).then(i):Promise.reject(new h(2,9,9002))}.bind(this);return i()}.bind(t));return t.b={},t.g=Promise.all(i).then(function(){return na(this.h,"manifest-v2",e)}.bind(t)).then(function(t){return this.i=[],t}.bind(t)),t.g}function la(t,e){var i=M(e.uris,t.m);(e.N||null!=e.D)&&(i.headers.Range="bytes="+e.N+"-"+(null==e.D?"":e.D));var n;return t.j.request(1,i).then(function(t){return this.a?(n=t.data.byteLength,na(this.h,"segment-v2",{data:t.data})):Promise.reject(new h(2,9,9002))}.bind(t)).then(function(t){if(!this.a)return Promise.reject(new h(2,9,9002));this.a.size+=n,this.f+=null==e.D?e.gc:e.D-e.N+1,this.i.push(t),e.Wd(t),fa(this)}.bind(t))}function fa(t){var e=t.c?t.f/t.c:0,i=t.a.size;t.l.forEach(function(t){t(e,i)})}function da(t){return(t=/^offline:manifest\/([0-9]+)$/.exec(t))?Number(t[1]):null}function pa(t,e,i){var n=void 0==e.expiration?1/0:e.expiration,r=e.presentationTimeline.T();return e=se(e.periods[0]),{offlineUri:null,originalManifestUri:t,duration:r,size:0,expiration:n,tracks:e,appMetadata:i}}function ma(t,e){var i=ya(e.periods[0],[],new Ki(null,0)),n=e.appMetadata||{},i=se(i);return{offlineUri:t,originalManifestUri:e.originalManifestUri,duration:e.duration,size:e.size,expiration:e.expiration,tracks:i,appMetadata:n}}function ya(t,e,i){var n=t.streams.filter(wa);return e=ga(n,t.streams.filter(Ea),e),n=t.streams.filter(Sa).map(ba),t.streams.forEach(function(t){t=t.segments.map(function(t,e){return va(e,t)}),i.Ia(0,t)}),{startTime:t.startTime,variants:e,textStreams:n}}function va(t,e){var i="offline:segment/"+e.dataKey;return new ui(t,e.startTime,e.endTime,function(){return[i]},0,null)}function ga(t,e,i){var n={},r=[];return r.push.apply(r,t),r.push.apply(r,e),r.forEach(function(t){t.variantIds.forEach(function(t){n[t]||(n[t]={id:t,language:"",primary:!1,audio:null,video:null,bandwidth:0,drmInfos:i,allowedByApplication:!0,allowedByKeySystem:!0})})}),t.forEach(function(t){var e=ba(t);t.variantIds.forEach(function(t){t=n[t],t.language=e.language,t.primary=t.primary||e.primary,t.audio=e})}),e.forEach(function(t){var e=ba(t);t.variantIds.forEach(function(t){t=n[t],t.primary=t.primary||e.primary,t.video=e})}),W(n)}function ba(t){var e=t.segments.map(function(t,e){return va(e,t)}),e=new gi(e),e={id:t.id,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:e.find.bind(e),getSegmentReference:e.get.bind(e),initSegmentReference:null,presentationTimeOffset:t.presentationTimeOffset,mimeType:t.mimeType,codecs:t.codecs,width:t.width||void 0,height:t.height||void 0,frameRate:t.frameRate||void 0,kind:t.kind,encrypted:t.encrypted,keyId:t.keyId,language:t.language,label:t.label||null,type:t.contentType,primary:t.primary,trickModeVideo:null,containsEmsgBoxes:!1,roles:[],channelsCount:null};return null!=t.initSegmentKey&&(e.initSegmentReference=Ta(t.initSegmentKey)),e}function Ta(t){var e="offline:segment/"+t;return new oi(function(){return[e]},0,null)}function wa(t){return"audio"==t.contentType}function Ea(t){return"video"==t.contentType}function Sa(t){return"text"==t.contentType}function Aa(){if(!t.indexedDB)return Promise.reject(new h(2,9,9e3));var e=new Qr("shaka_offline_db");return e.init().then(function(){return e})}function ka(){this.a=-1}function Ia(t){var e=new Ki(null,0);e.fa(t.duration);var i=t.drmInfo?[t.drmInfo]:[];return{presentationTimeline:e,minBufferTime:2,offlineSessionIds:t.sessionIds,periods:t.periods.map(function(t){return ya(t,i,e)})}}function _a(t){if(null!=da(t))return _a.a(t);var e=(e=/^offline:segment\/([0-9]+)$/.exec(t))?Number(e[1]):null;return null!=e?_a.b(e,t):Promise.reject(new h(2,1,9004,t))}function Pa(t){this.a=null;for(var e=0;e<t.textTracks.length;++e){var i=t.textTracks[e];i.mode="disabled","Shaka Player TextTrack"==i.label&&(this.a=i)}this.a||(this.a=t.addTextTrack("subtitles","Shaka Player TextTrack")),this.a.mode="hidden",this.b=this.a.cues}function xa(t){if(t.startTime>=t.endTime)return null;var e=new VTTCue(t.startTime,t.endTime,t.payload);e.lineAlign=t.lineAlign,e.positionAlign=t.positionAlign,e.size=t.size;try{e.align=t.textAlign}catch(t){}return"center"==t.textAlign&&"center"!=e.align&&(e.align="middle"),t.writingDirection==Mu?e.vertical="lr":t.writingDirection==Cu&&(e.vertical="rl"),t.lineInterpretation==Uu&&(e.snapToLines=!1),null!=t.line&&(e.line=t.line),null!=t.position&&(e.position=t.position),e}function Ra(t,e){for(var i=t.b,n=[],r=0;r<i.length;++r)e(i[r])&&n.push(i[r]);for(r=0;r<n.length;++r)t.a.removeCue(n[r])}function Na(){this.a=Promise.resolve(),this.b=this.c=this.f=!1,this.i=new Promise(function(t){this.g=t}.bind(this)),this.l=[],this.j=[]}function La(t){return t.f||(t.a=t.a.then(function(t){return this.c=!0,this.l.forEach(function(t){t()}),Promise.resolve(t)}.bind(t),function(t){return this.c=!0,this.b?(this.g(),Promise.reject(this.h)):Promise.reject(t)}.bind(t))),t.f=!0,t.a}function Da(t,e){Re.call(this),this.F=!1,this.f=t,this.lb=!1,this.u=null,this.m=new V,this.h=this.yb=this.b=this.i=this.a=this.w=this.g=this.ib=this.J=this.K=this.l=this.s=null,this.Yc=1e9,this.gb=[],this.kb=!1,this.Ca=!0,this.Sa=this.Ta=this.ha=null,this.fc=!1,this.W=null,this.jb=[],this.A={},this.c=Ga(this),this.hb={width:1/0,height:1/0},this.j=Xa(),this.fb=0,this.Qa=this.c.preferredAudioLanguage,this.Ra=this.c.preferredTextLanguage,this.bb=this.cb="",e&&e(this),this.s=new L(this.Fe.bind(this)),this.ib=Oa(this),H(this.m,this.f,"error",this.Yd.bind(this))}function Ma(t){if(!t.ha)return Promise.resolve();var e=Promise.resolve();return t.i&&(e=t.i.stop(),t.i=null),t=t.ha.cancel(new h(2,7,7e3)),Promise.all([e,t])}function Ca(t){function e(t){return(t.video?t.video.codecs.split(".")[0]:"")+"-"+(t.audio?t.audio.codecs.split(".")[0]:"")}var i={};t.b.periods.forEach(function(t){t.variants.forEach(function(t){var n=e(t);n in i||(i[n]=[]),i[n].push(t)})});var n=null,r=1/0;Q(i,function(t,e){var i=0,a=0;e.forEach(function(t){i+=t.bandwidth||0,++a});var s=i/a;s<r&&(n=t,r=s)}),t.b.periods.forEach(function(t){t.variants=t.variants.filter(function(t){return e(t)==n})})}function Oa(e){e.K=new MediaSource;var i=new b;return H(e.m,e.K,"sourceopen",i.resolve),e.f.src=t.URL.createObjectURL(e.K),i}function Ua(t){if(t.i&&t.i.configure(t.c.manifest),t.l&&t.l.configure(t.c.drm),t.a){t.a.configure(t.c.streaming);try{t.b.periods.forEach(t.mb.bind(t))}catch(e){t.Pa(e)}var e=fr(t.a),i=dr(t.a),n=cr(t.a);(e=ve(e,i,n.variants))&&e.allowedByApplication&&e.allowedByKeySystem||Ja(t,n)}t.h&&(t.h.configure(t.c.abr),t.c.abr.enabled&&!t.Ca?t.h.enable():t.h.disable())}function ja(t){var e=[];return t.forEach(function(t){if(t){var i=t.language;t.roles.length?t.roles.forEach(function(t){e.push({language:i,sb:t})}):e.push({language:i,sb:""})}else e.push({language:"und",sb:""})}),O(e,function(t,e){return t.language==e.language&&t.sb==e.sb})}function Ba(t,e,i){e.video&&Va(t,e.video),e.audio&&Va(t,e.audio);var n=lr(t.a);e!=ve(fr(t.a),dr(t.a),n?n.variants:[])&&t.j.switchHistory.push({timestamp:Date.now()/1e3,id:e.id,type:"variant",fromAdaptation:i,bandwidth:e.bandwidth})}function Fa(t,e,i){Va(t,e),t.j.switchHistory.push({timestamp:Date.now()/1e3,id:e.id,type:"text",fromAdaptation:i,bandwidth:null})}function Va(t,e){var i=Te(t.b,e);t.A[i]||(t.A[i]={}),t.A[i][e.type]=e.id}function Ha(t){t.m&&(t.m.ga(t.K,"sourceopen"),t.m.ga(t.f,"loadeddata"),t.m.ga(t.f,"playing"),t.m.ga(t.f,"pause"),t.m.ga(t.f,"ended")),t.f&&(t.f.removeAttribute("src"),t.f.load());var e=Promise.all([t.h?t.h.stop():null,t.l?t.l.destroy():null,t.J?t.J.destroy():null,t.g?t.g.destroy():null,t.w?t.w.destroy():null,t.a?t.a.destroy():null,t.i?t.i.stop():null,t.u?t.u.destroy():null]);return t.l=null,t.J=null,t.g=null,t.w=null,t.a=null,t.i=null,t.u=null,t.b=null,t.yb=null,t.ib=null,t.K=null,t.jb=[],t.A={},t.j=Xa(),e}function Ka(t){return t.i?Ha(t).then(function(){this.F||(this.Rc(!1),this.ib=Oa(this))}.bind(t)):Promise.resolve()}function qa(){return{".drm.servers":"",".drm.clearKeys":"",".drm.advanced":{distinctiveIdentifierRequired:!1,persistentStateRequired:!1,videoRobustness:"",audioRobustness:"",serverCertificate:new Uint8Array(0)}}}function Ga(t){var e=5e5;return navigator.connection&&navigator.connection.type&&(e=1e6*navigator.connection.downlink),{drm:{retryParameters:E(),servers:{},clearKeys:{},advanced:{},delayLicenseRequestUntilPlayed:!1},manifest:{retryParameters:E(),dash:{customScheme:function(t){if(t)return null},clockSyncUri:"",ignoreDrmInfo:!1,xlinkFailGracefully:!1}},streaming:{retryParameters:E(),failureCallback:t.ed.bind(t),rebufferingGoal:2,bufferingGoal:10,bufferBehind:30,ignoreTextStreamFailures:!1,startAtSegmentBoundary:!1,smallGapLimit:.5,jumpLargeGaps:!1,durationBackoff:1},abrFactory:we,textDisplayFactory:function(t){return new Pa(t)}.bind(null,t.f),abr:{enabled:!0,defaultBandwidthEstimate:e,switchInterval:8,bandwidthUpgradeTarget:.85,bandwidthDowngradeTarget:.95,restrictions:{minWidth:0,maxWidth:1/0,minHeight:0,maxHeight:1/0,minPixels:0,maxPixels:1/0,minBandwidth:0,maxBandwidth:1/0}},preferredAudioLanguage:"",preferredTextLanguage:"",restrictions:{minWidth:0,maxWidth:1/0,minHeight:0,maxHeight:1/0,minPixels:0,maxPixels:1/0,minBandwidth:0,maxBandwidth:1/0},playRangeStart:0,playRangeEnd:1/0}}function Xa(){return{width:NaN,height:NaN,streamBandwidth:NaN,decodedFrames:NaN,droppedFrames:NaN,estimatedBandwidth:NaN,loadLatency:NaN,playTime:0,bufferingTime:0,switchHistory:[],stateHistory:[]}}function Ya(t,e,i){t.Ca?(t.Sa=e,t.fc=i||!1):vr(t.a,e,i||!1)}function za(t){if(t.b){var e=Date.now()/1e3;t.kb?t.j.bufferingTime+=e-t.fb:t.j.playTime+=e-t.fb,t.fb=e}}function $a(t,e){function i(t,e){if(!t)return null;var i=t.findSegmentPosition(e-a.startTime);return null==i?null:(i=t.getSegmentReference(i))?i.startTime+a.startTime:null}var n=fr(t.a),r=dr(t.a),a=cr(t.a),n=i(n,e),r=i(r,e);return null!=r&&null!=n?Math.max(r,n):null!=r?r:null!=n?n:e}function Wa(t,e){return e&&e.length?(t.h.setVariants(e),t.h.chooseVariant()):(t.Pa(new h(2,4,4012)),null)}function Ja(t,e){var i=de(e,t.Qa,t.cb),n=pe(e,t.Ra,t.bb);(i=Wa(t,i))&&(Ba(t,i,!0),Ya(t,i,!0)),(n=n[0])&&t.Ib()&&(Fa(t,n,!0),t.Ca?t.W=n:gr(t.a,n,!0)),Qa(t)}function Qa(t){Promise.resolve().then(function(){this.F||this.dispatchEvent(new X("adaptation"))}.bind(t))}function Za(t){Promise.resolve().then(function(){this.F||this.dispatchEvent(new X("trackschanged"))}.bind(t))}function ts(t){t.dispatchEvent(new X("texttrackvisibility"))}function es(t){if(!t||t.constructor!=Da)throw new h(2,9,9008);this.g=null,this.a=t,this.b=os(this),this.f=null,this.l=!1,this.c=this.s=this.h=this.i=null}function is(){return!!t.indexedDB}function ns(t,e,i,n,r){if(i.presentationTimeline.P()||i.presentationTimeline.wa())throw new h(2,9,9005,e);t.h=i,t.f=r,t.j(i.periods),t.s=pa(e,i,n);var a=ls(t,e,n);return ca(t.c,a).then(function(t){return ma("offline:manifest/"+t,a)})}function rs(t,e){function i(t){6013!=t.code&&(s=t)}var n=da(e);if(null==n)return Promise.reject(new h(2,9,9004,e));var r,a,s=null;return us(t).then(function(){return ps(this),this.g.Ea(n)}.bind(t)).then(function(t){if(ps(this),!t)throw new h(2,9,9003,e);return r=t,t=Ia(r),a=new pt({Wa:this.a.s,onError:i,Pb:function(){},onExpirationUpdated:function(){},onEvent:function(){}}),a.configure(this.a.getConfiguration().drm),a.init(t,this.b.usePersistentLicense||!1)}.bind(t)).then(function(){return yt(a,r.sessionIds)}.bind(t)).then(function(){return a.destroy()}.bind(t)).then(function(){if(ps(this),s)throw s;return as(this,e,n,r)}.bind(t))}function as(t,e,i,n){function r(){u++,a(s,u/h)}var a=t.b.progressCallback,s=ma(e,n),o=ms(n),u=0,h=o.length+1;return Promise.resolve().then(function(){return ps(this),ra(this.g,"segment-v2",o,r)}.bind(t)).then(function(){return ps(this),ra(this.g,"manifest-v2",[i],r)}.bind(t))}function ss(t,e,i,n){function r(){}var a,s,o,u=t.a.s,h=t.a.getConfiguration();return Hi(e,u,h.manifest.retryParameters,n).then(function(t){return ps(this),o=new t,o.configure(h.manifest),o.start(e,{networkingEngine:u,filterAllPeriods:this.j.bind(this),filterNewPeriod:this.m.bind(this),onTimelineRegionAdded:function(){},onEvent:function(){},onError:i})}.bind(t)).then(function(t){return ps(this),a=t,s=new pt({Wa:u,onError:i,Pb:r,onExpirationUpdated:function(){},onEvent:function(){}}),s.configure(h.drm),s.init(a,this.b.usePersistentLicense||!1)}.bind(t)).then(function(){return ps(this),cs(a)}.bind(t)).then(function(){return ps(this),vt(s)}.bind(t)).then(function(){return ps(this),o.stop()}.bind(t)).then(function(){return ps(this),{manifest:a,fd:s}}.bind(t)).catch(function(t){if(o)return o.stop().then(function(){throw t});throw t})}function os(t){return{trackSelectionCallback:t.u.bind(t),progressCallback:function(t,e){if(t||e)return null},usePersistentLicense:!0}}function us(e){if(!t.indexedDB)return Promise.reject(new h(2,9,9e3));if(e.g)return Promise.resolve();var i=e.a.s,n=e.a.getConfiguration().streaming.retryParameters;return Aa().then(function(t){this.g=t,this.c=new oa(t,i,n),ua(this.c,function(t,e){var i=this.s;i.size=e,this.b.progressCallback(i,t)}.bind(this))}.bind(e))}function hs(t){var e=t.f?t.f.destroy():Promise.resolve();return t.f=null,t.h=null,t.l=!1,t.i=null,e}function cs(t){var e=t.periods.map(function(t){return t.variants}).reduce(P,[]).map(function(t){var e=[];return t.audio&&e.push(t.audio),t.video&&e.push(t.video),e}).reduce(P,[]).filter(N);return t=t.periods.map(function(t){return t.textStreams}).reduce(P,[]),e.push.apply(e,t),Promise.all(e.map(function(t){return t.createSegmentIndex()}))}function ls(t,e,i){var n=t.h.periods.map(t.w.bind(t)),r=t.f.b,a=gt(t.f);if(r&&t.b.usePersistentLicense){if(!a.length)throw new h(2,9,9007,e);r.initData=[]}return{originalManifestUri:e,duration:t.h.presentationTimeline.T(),size:0,expiration:t.f.ob(),periods:n,sessionIds:t.b.usePersistentLicense?a:[],drmInfo:r,appMetadata:i}}function fs(t,e,i,n){var r={id:e.id,primary:e.primary,presentationTimeOffset:e.presentationTimeOffset||0,contentType:e.type,mimeType:e.mimeType,codecs:e.codecs,frameRate:e.frameRate,kind:e.kind,language:e.language,label:e.label,width:e.width||null,height:e.height||null,initSegmentKey:null,encrypted:e.encrypted,keyId:e.keyId,segments:[],variantIds:[]};return null!=n&&r.variantIds.push(n),n=t.h.presentationTimeline.ja(),ds(e,n,function(t){var n=t.startTime,a=t.endTime;ha(this.c,e.type,t,(a-n)*i/8,function(t){r.segments.push({startTime:n,endTime:a,dataKey:t})})}.bind(t)),(n=e.initSegmentReference)&&ha(t.c,e.contentType,n,0,function(t){r.initSegmentKey=t}),r}function ds(t,e,i){e=t.findSegmentPosition(e);for(var n=null==e?null:t.getSegmentReference(e);n;)i(n),n=t.getSegmentReference(++e)}function ps(t){if(!t.a)throw new h(2,9,9002)}function ms(t){var e=[];return t.periods.forEach(function(t){t.streams.forEach(function(t){null!=t.initSegmentKey&&e.push(t.initSegmentKey),t.segments.forEach(function(t){e.push(t.dataKey)})})}),e}function ys(t){Tu.push(t)}function vs(t){var e=t.type.replace(/^(webkit|moz|MS)/,"").toLowerCase();if("function"==typeof Event)var i=new Event(e,t);else i=document.createEvent("Event"),i.initEvent(e,t.bubbles,t.cancelable);t.target.dispatchEvent(i)}function gs(t,e,i){if("input"==t)switch(this.type){case"range":t="change"}wu.call(this,t,e,i)}function bs(t){this.f=[],this.b=[],this.a=[],(new li).ba("pssh",this.c.bind(this)).parse(t.buffer)}function Ts(t,e){try{var i=new ws(t,e);return Promise.resolve(i)}catch(t){return Promise.reject(t)}}function ws(t,e){this.keySystem=t;for(var i=!1,n=0;n<e.length;++n){var r=e[n],a={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:r.initDataTypes,sessionTypes:["temporary"],label:r.label},s=!1;if(r.audioCapabilities)for(var o=0;o<r.audioCapabilities.length;++o){var u=r.audioCapabilities[o];if(u.contentType){s=!0;var h=u.contentType.split(";")[0];MSMediaKeys.isTypeSupported(this.keySystem,h)&&(a.audioCapabilities.push(u),i=!0)}}if(r.videoCapabilities)for(o=0;o<r.videoCapabilities.length;++o)u=r.videoCapabilities[o],u.contentType&&(s=!0,h=u.contentType.split(";")[0],MSMediaKeys.isTypeSupported(this.keySystem,h)&&(a.videoCapabilities.push(u),i=!0));if(s||(i=MSMediaKeys.isTypeSupported(this.keySystem,"video/mp4")),"required"==r.persistentState&&(i=!1),i)return void(this.a=a)}throw r=Error("Unsupported keySystem"),r.name="NotSupportedError",r.code=DOMException.NOT_SUPPORTED_ERR,r}function Es(t){var e=this.mediaKeys;return e&&e!=t&&As(e,null),delete this.mediaKeys,(this.mediaKeys=t)?As(t,this):Promise.resolve()}function Ss(t){this.a=new MSMediaKeys(t),this.b=new V}function As(t,e){function i(){e.msSetMediaKeys(n.a),e.removeEventListener("loadedmetadata",i)}if(q(t.b),!e)return Promise.resolve();H(t.b,e,"msneedkey",Is);var n=t;try{return 1<=e.readyState?e.msSetMediaKeys(t.a):e.addEventListener("loadedmetadata",i),Promise.resolve()}catch(t){return Promise.reject(t)}}function ks(t){Re.call(this),this.c=null,this.g=t,this.b=this.a=null,this.f=new V,this.sessionId="",this.expiration=NaN,this.closed=new b,this.keyStatuses=new xs}function Is(t){var e=document.createEvent("CustomEvent");e.initCustomEvent("encrypted",!1,!1,null),e.initDataType="cenc";var i=t.initData;if(i){var n=new bs(i);if(1>=n.a.length)t=i;else{var r=[];for(t=0;t<n.a.length;t++)r.push(i.subarray(n.a[t].start,n.a[t].end+1));for(i=O(r,_s),t=n=0;t<i.length;t++)n+=i[t].length;for(n=new Uint8Array(n),t=r=0;t<i.length;t++)n.set(i[t],r),r+=i[t].length;t=n}}else t=i;e.initData=t,this.dispatchEvent(e)}function _s(t,e){return ft(t,e)}function Ps(t,e){var i=t.keyStatuses;i.size=void 0==e?0:1,i.a=e,t.dispatchEvent(new X("keystatuseschange"))}function xs(){this.size=0,this.a=void 0}function Rs(){return Promise.reject(Error("The key system specified is not supported."))}function Ns(t){return t?Promise.reject(Error("MediaKeys not supported.")):Promise.resolve()}function Ls(){throw new TypeError("Illegal constructor.")}function Ds(){throw new TypeError("Illegal constructor.")}function Ms(e){Su=e,Au=new Uint8Array([0]).buffer,navigator.requestMediaKeySystemAccess=Os,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=Us,t.MediaKeys=Bs,t.MediaKeySystemAccess=js}function Cs(t){var e=Su;return e?e+t.charAt(0).toUpperCase()+t.slice(1):t}function Os(t,e){try{var i=new js(t,e);return Promise.resolve(i)}catch(t){return Promise.reject(t)}}function Us(t){var e=this.mediaKeys;return e&&e!=t&&Fs(e,null),delete this.mediaKeys,(this.mediaKeys=t)&&Fs(t,this),Promise.resolve()}function js(t,e){this.a=this.keySystem=t;var i=!1;"org.w3.clearkey"==t&&(this.a="webkit-org.w3.clearkey",i=!1);for(var n=!1,r=document.getElementsByTagName("video"),a=r.length?r[0]:document.createElement("video"),s=0;s<e.length;++s){r=e[s];var o={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:r.initDataTypes,sessionTypes:["temporary"],label:r.label},u=!1;if(r.audioCapabilities)for(var h=0;h<r.audioCapabilities.length;++h){var c=r.audioCapabilities[h];if(c.contentType){var u=!0,l=c.contentType.split(";")[0];a.canPlayType(l,this.a)&&(o.audioCapabilities.push(c),n=!0)}}if(r.videoCapabilities)for(h=0;h<r.videoCapabilities.length;++h)c=r.videoCapabilities[h],c.contentType&&(u=!0,a.canPlayType(c.contentType,this.a)&&(o.videoCapabilities.push(c),n=!0));if(u||(n=a.canPlayType("video/mp4",this.a)||a.canPlayType("video/webm",this.a)),"required"==r.persistentState&&(i?(o.persistentState="required",o.sessionTypes=["persistent-license"]):n=!1),n)return void(this.b=o)}throw i="Unsupported keySystem","org.w3.clearkey"!=t&&"com.widevine.alpha"!=t||(i="None of the requested configurations were supported."),i=Error(i),i.name="NotSupportedError",i.code=DOMException.NOT_SUPPORTED_ERR,i}function Bs(t){this.g=t,this.b=null,this.a=new V,this.c=[],this.f={}}function Fs(t,e){t.b=e,q(t.a);var i=Su;e&&(H(t.a,e,i+"needkey",t.be.bind(t)),H(t.a,e,i+"keymessage",t.ae.bind(t)),H(t.a,e,i+"keyadded",t.Zd.bind(t)),H(t.a,e,i+"keyerror",t.$d.bind(t)))}function Vs(t,e){var i=t.f[e];return i||((i=t.c.shift())?(i.sessionId=e,t.f[e]=i):null)}function Hs(t,e,i){Re.call(this),this.f=t,this.h=!1,this.a=this.b=null,this.c=e,this.g=i,this.sessionId="",this.expiration=NaN,this.closed=new b,this.keyStatuses=new Gs}function Ks(t,e,i){if(t.h)return Promise.reject(Error("The session is already initialized."));t.h=!0;try{if("persistent-license"==t.g)if(i)var n=new Uint8Array(nt("LOAD_SESSION|"+i));else{var r=nt("PERSISTENT|"),a=new Uint8Array(r.byteLength+e.byteLength);a.set(new Uint8Array(r),0),a.set(new Uint8Array(e),r.byteLength),n=a}else n=new Uint8Array(e)}catch(t){return Promise.reject(t)}t.b=new b;var s=Cs("generateKeyRequest");try{t.f[s](t.c,n)}catch(e){if("InvalidStateError"!=e.name)return t.b=null,Promise.reject(e);setTimeout(function(){try{this.f[s](this.c,n)}catch(t){this.b.reject(t),this.b=null}}.bind(t),10)}return t.b}function qs(t,e){var i=t.keyStatuses;i.size=void 0==e?0:1,i.a=e,t.dispatchEvent(new X("keystatuseschange"))}function Gs(){this.size=0,this.a=void 0}function Xs(){var t=MediaSource.prototype.addSourceBuffer;MediaSource.prototype.addSourceBuffer=function(){var e=t.apply(this,arguments);return e.abort=function(){},e}}function Ys(){var t=SourceBuffer.prototype.remove;SourceBuffer.prototype.remove=function(e,i){return t.call(this,e,i-.001)}}function zs(){var t=MediaSource.prototype.endOfStream;MediaSource.prototype.endOfStream=function(){for(var e,i=0,n=0;n<this.sourceBuffers.length;++n)e=this.sourceBuffers[n],e=e.buffered.end(e.buffered.length-1),i=Math.max(i,e);if(!isNaN(this.duration)&&i<this.duration)for(this.pc=!0,n=0;n<this.sourceBuffers.length;++n)e=this.sourceBuffers[n],e.jc=!1;return t.apply(this,arguments)};var e=!1,i=MediaSource.prototype.addSourceBuffer;MediaSource.prototype.addSourceBuffer=function(){var t=i.apply(this,arguments);return t.mediaSource_=this,t.addEventListener("updateend",$s,!1),e||(this.addEventListener("sourceclose",Ws,!1),e=!0),t}}function $s(t){var e=t.target,i=e.mediaSource_;if(i.pc){for(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),e.jc=!0,t=0;t<i.sourceBuffers.length;++t)if(0==i.sourceBuffers[t].jc)return;i.pc=!1}}function Ws(t){t=t.target;for(var e=0;e<t.sourceBuffers.length;++e)t.sourceBuffers[e].removeEventListener("updateend",$s,!1);t.removeEventListener("sourceclose",Ws,!1)}function Js(){var t=MediaSource.isTypeSupported;MediaSource.isTypeSupported=function(e){return"mp2t"!=e.split(/ *; */)[0].split("/")[1]&&t(e)}}function Qs(){var t=MediaSource.isTypeSupported,e=/^dv(?:he|av)\./;MediaSource.isTypeSupported=function(i){for(var n,r,a=i.split(/ *; */),s=a[0],o={},u=1;u<a.length;++u)n=a[u].split("="),r=n[0],n=n[1].replace(/"(.*)"/,"$1"),o[r]=n;if(!(n=o.codecs))return t(i);var h=!1,c=!1;i=n.split(",").filter(function(t){return e.test(t)?(c=!0,!1):(/^(hev|hvc)1\.2/.test(t)&&(h=!0),!0)}),c&&(h=!1),o.codecs=i.join(","),h&&(o.eotf="smpte2084");for(r in o)n=o[r],s+="; "+r+'="'+n+'"';return cast.__platform__.canDisplayType(s)}}function Zs(t){if(this.c=[],this.b=[],this.Aa=ku,t)try{t(this.la.bind(this),this.a.bind(this))}catch(t){this.a(t)}}function to(t){var e=new Zs;return e.la(void 0),e.then(function(){return t})}function eo(t){var e=new Zs;return e.a(t),e}function io(t){function e(t,e,i){t.Aa==ku&&(r[e]=i,++n==r.length&&t.la(r))}var i=new Zs;if(!t.length)return i.la([]),i;for(var n=0,r=Array(t.length),a=i.a.bind(i),s=0;s<t.length;++s)t[s]&&t[s].then?t[s].then(e.bind(null,i,s),a):e(i,s,t[s]);return i}function no(t){for(var e=new Zs,i=e.la.bind(e),n=e.a.bind(e),r=0;r<t.length;++r)t[r]&&t[r].then?t[r].then(i,n):i(t[r]);return e}function ro(t,e,i){_u.push(function(){if(i&&"function"==typeof i){try{var t=i(this.f)}catch(t){return void e.a(t)}try{var n=t&&t.then}catch(t){return void e.a(t)}t instanceof Zs?t==e?e.a(new TypeError("Chaining cycle detected")):t.then(e.la.bind(e),e.a.bind(e)):n?ao(t,n,e):e.la(t)}else 1==this.Aa?e.la(this.f):e.a(this.f)}.bind(t)),null==Iu&&(Iu=oo(so))}function ao(t,e,i){try{var n=!1;e.call(t,function(t){if(!n){n=!0;try{var e=t&&t.then}catch(t){return void i.a(t)}e?ao(t,e,i):i.la(t)}},i.a.bind(i))}catch(t){i.a(t)}}function so(){for(;_u.length;){null!=Iu&&(uo(Iu),Iu=null);var t=_u;_u=[];for(var e=0;e<t.length;++e)t[e]()}}function oo(){return 0}function uo(){}function ho(){return{droppedVideoFrames:this.webkitDroppedFrameCount,totalVideoFrames:this.webkitDecodedFrameCount,corruptedVideoFrames:0,creationTime:NaN,totalFrameDelay:0}}function co(e,i,n){return new t.TextTrackCue(e,i,n)}function lo(e,i,n){return new t.TextTrackCue(e+"-"+i+"-"+n,e,i,n)}function fo(t,e,i){this.startTime=t,this.endTime=e,this.payload=i,this.region={x:0,y:0,width:100,height:100},this.position=null,this.positionAlign=Pu,this.size=100,this.textAlign=xu,this.writingDirection=Du,this.lineInterpretation=Ou,this.line=null,this.lineHeight="",this.lineAlign=ju,this.displayAlign=Nu,this.fontSize=this.backgroundColor=this.color="",this.fontWeight=Fu,this.fontStyle=Vu,this.fontFamily="",this.textDecoration=[],this.wrapLine=!0,this.id=""}function po(){}function mo(t){var e=[];if(!t)return e;for(var i=t.childNodes,n=0;n<i.length;n++){var r="span"==i[n].nodeName&&"p"==t.nodeName;i[n].nodeType!=Node.ELEMENT_NODE||"br"==i[n].nodeName||r||(r=mo(i[n]),e=e.concat(r))}return e.length||e.push(t),e}function yo(t,e){for(var i=t.childNodes,n=0;n<i.length;n++)if("br"==i[n].nodeName&&0<n)i[n-1].textContent+="\n";else if(0<i[n].childNodes.length)yo(i[n],e);else if(e){var r=i[n].textContent.trim(),r=r.replace(/\s+/g," ");i[n].textContent=r}}function vo(t,e){for(var i=e.split(" "),n=0;n<i.length;n++)switch(i[n]){case"underline":0>t.textDecoration.indexOf("underline")&&t.textDecoration.push("underline");break;case"noUnderline":0<=t.textDecoration.indexOf("underline")&&j(t.textDecoration,"underline");break;case"lineThrough":0>t.textDecoration.indexOf("lineThrough")&&t.textDecoration.push("lineThrough");break;case"noLineThrough":0<=t.textDecoration.indexOf("lineThrough")&&j(t.textDecoration,"lineThrough");break;case"overline":0>t.textDecoration.indexOf("overline")&&t.textDecoration.push("overline");break;case"noOverline":0<=t.textDecoration.indexOf("overline")&&j(t.textDecoration,"overline")}}function go(t,e,i,n){return(t=To(t,i,n))?t:bo(e,i,n)}function bo(t,e,i){for(var n=mo(t),r=0;r<n.length;r++){var a=n[r].getAttribute(i);if(a)return a}return(t=wo(t,"style",e))?t.getAttribute(i):null}function To(t,e,i){return(t=wo(t,"style",e))?t.getAttribute(i):null}function wo(t,e,i){if(!t||1>i.length)return null;var n=null,r=t;for(t=null;r&&!(t=r.getAttribute(e))&&(r=r.parentNode)instanceof Element;);if(e=t)for(t=0;t<i.length;t++)if(i[t].getAttribute("xml:id")==e){n=i[t];break}return n}function Eo(t,e){var i=null;if(Ku.test(t))var i=Ku.exec(t),n=Number(i[1]),r=Number(i[2]),a=Number(i[3]),s=Number(i[4]),s=s+(Number(i[5])||0)/e.b,a=a+s/e.frameRate,i=a+60*r+3600*n;else qu.test(t)?i=So(qu,t):Gu.test(t)?i=So(Gu,t):Xu.test(t)?(i=Xu.exec(t),i=Number(i[1])/e.frameRate):Yu.test(t)?(i=Yu.exec(t),i=Number(i[1])/e.a):zu.test(t)&&(i=So(zu,t));return i}function So(t,e){var i=t.exec(e);return i&&""!=i[0]?(Number(i[4])||0)/1e3+(Number(i[3])||0)+60*(Number(i[2])||0)+3600*(Number(i[1])||0):null}function Ao(t,e,i,n){this.frameRate=Number(t)||30,this.b=Number(e)||1,this.a=Number(n),this.a||(this.a=t?this.frameRate*this.b:1),i&&(t=/^(\d+) (\d+)$/g.exec(i))&&(this.frameRate*=t[1]/t[2])}function ko(){this.a=new po}function Io(){}function _o(t,e){var i;(i=/^align:(start|middle|center|end|left|right)$/.exec(e))?(i=i[1],t.textAlign="middle"==i?xu:Ru[i.toUpperCase()]):(i=/^vertical:(lr|rl)$/.exec(e))?t.writingDirection="lr"==i[1]?Mu:Cu:(i=/^size:([\d\.]+)%$/.exec(e))?t.size=Number(i[1]):(i=/^position:([\d\.]+)%(?:,(line-left|line-right|center|start|end))?$/.exec(e))?(t.position=Number(i[1]),i[2]&&(i=i[2],t.positionAlign="line-left"==i||"start"==i?"line-left":"line-right"==i||"end"==i?"line-right":"center")):(i=/^line:([\d\.]+)%(?:,(start|end|center))?$/.exec(e))?(t.lineInterpretation=Uu,t.line=Number(i[1]),i[2]&&(t.lineAlign=Bu[i[2].toUpperCase()])):(i=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(e))&&(t.lineInterpretation=Ou,t.line=Number(i[1]),i[2]&&(t.lineAlign=Bu[i[2].toUpperCase()]))}function Po(t){if(!(t=yn(t,/(?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3})/g)))return null;var e=Number(t[2]),i=Number(t[3]);return 59<e||59<i?null:Number(t[4])/1e3+i+60*e+3600*(Number(t[1])||0)}function xo(){this.a=null}function Ro(t,e,i){var n,r,a;return(new li).C("payl",pi(function(t){n=tt(t)})).C("iden",pi(function(t){r=tt(t)})).C("sttg",pi(function(t){a=tt(t)})).parse(t),n?No(n,r,a,e,i):null}function No(t,e,i,n,r){if(t=new fo(n,r,t),e&&(t.id=e),i)for(e=new mn(i),i=vn(e);i;)_o(t,i),yn(e,/[ \t]+/gm),i=vn(e);return t}var Lo,Do=this;Do.$e=!0,s.prototype.getBandwidthEstimate=function(t){return 128e3>this.a?t:Math.min(a(this.b),a(this.c))},t.console&&t.console.log.bind&&(o=console.warn.bind(console)),e("shaka.util.Error",h),h.prototype.toString=function(){return"shaka.util.Error "+JSON.stringify(this,null," ")},h.Severity={RECOVERABLE:1,CRITICAL:2},h.Category={NETWORK:1,TEXT:2,MEDIA:3,MANIFEST:4,STREAMING:5,DRM:6,PLAYER:7,CAST:8,STORAGE:9},h.Code={UNSUPPORTED_SCHEME:1e3,BAD_HTTP_STATUS:1001,HTTP_ERROR:1002,TIMEOUT:1003,MALFORMED_DATA_URI:1004,UNKNOWN_DATA_URI_ENCODING:1005,REQUEST_FILTER_ERROR:1006,RESPONSE_FILTER_ERROR:1007,INVALID_TEXT_HEADER:2e3,INVALID_TEXT_CUE:2001,UNABLE_TO_DETECT_ENCODING:2003,BAD_ENCODING:2004,INVALID_XML:2005,INVALID_MP4_TTML:2007,INVALID_MP4_VTT:2008,UNABLE_TO_EXTRACT_CUE_START_TIME:2009,BUFFER_READ_OUT_OF_BOUNDS:3e3,JS_INTEGER_OVERFLOW:3001,EBML_OVERFLOW:3002,EBML_BAD_FLOATING_POINT_SIZE:3003,MP4_SIDX_WRONG_BOX_TYPE:3004,MP4_SIDX_INVALID_TIMESCALE:3005,MP4_SIDX_TYPE_NOT_SUPPORTED:3006,WEBM_CUES_ELEMENT_MISSING:3007,WEBM_EBML_HEADER_ELEMENT_MISSING:3008,WEBM_SEGMENT_ELEMENT_MISSING:3009,WEBM_INFO_ELEMENT_MISSING:3010,WEBM_DURATION_ELEMENT_MISSING:3011,WEBM_CUE_TRACK_POSITIONS_ELEMENT_MISSING:3012,WEBM_CUE_TIME_ELEMENT_MISSING:3013,MEDIA_SOURCE_OPERATION_FAILED:3014,MEDIA_SOURCE_OPERATION_THREW:3015,VIDEO_ERROR:3016,QUOTA_EXCEEDED_ERROR:3017,UNABLE_TO_GUESS_MANIFEST_TYPE:4e3,DASH_INVALID_XML:4001,DASH_NO_SEGMENT_INFO:4002,DASH_EMPTY_ADAPTATION_SET:4003,DASH_EMPTY_PERIOD:4004,DASH_WEBM_MISSING_INIT:4005,DASH_UNSUPPORTED_CONTAINER:4006,DASH_PSSH_BAD_ENCODING:4007,DASH_NO_COMMON_KEY_SYSTEM:4008,DASH_MULTIPLE_KEY_IDS_NOT_SUPPORTED:4009,DASH_CONFLICTING_KEY_IDS:4010,UNPLAYABLE_PERIOD:4011,RESTRICTIONS_CANNOT_BE_MET:4012,NO_PERIODS:4014,HLS_PLAYLIST_HEADER_MISSING:4015,INVALID_HLS_TAG:4016,HLS_INVALID_PLAYLIST_HIERARCHY:4017,DASH_DUPLICATE_REPRESENTATION_ID:4018,HLS_MULTIPLE_MEDIA_INIT_SECTIONS_FOUND:4020,HLS_COULD_NOT_GUESS_MIME_TYPE:4021,HLS_MASTER_PLAYLIST_NOT_PROVIDED:4022,HLS_REQUIRED_ATTRIBUTE_MISSING:4023,HLS_REQUIRED_TAG_MISSING:4024,HLS_COULD_NOT_GUESS_CODECS:4025,HLS_KEYFORMATS_NOT_SUPPORTED:4026,DASH_UNSUPPORTED_XLINK_ACTUATE:4027,DASH_XLINK_DEPTH_LIMIT:4028,HLS_COULD_NOT_PARSE_SEGMENT_START_TIME:4030,INVALID_STREAMS_CHOSEN:5005,NO_RECOGNIZED_KEY_SYSTEMS:6e3,REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE:6001,FAILED_TO_CREATE_CDM:6002,FAILED_TO_ATTACH_TO_VIDEO:6003,INVALID_SERVER_CERTIFICATE:6004,FAILED_TO_CREATE_SESSION:6005,FAILED_TO_GENERATE_LICENSE_REQUEST:6006,LICENSE_REQUEST_FAILED:6007,LICENSE_RESPONSE_REJECTED:6008,ENCRYPTED_CONTENT_WITHOUT_DRM_INFO:6010,NO_LICENSE_SERVER_GIVEN:6012,OFFLINE_SESSION_REMOVED:6013,EXPIRED:6014,LOAD_INTERRUPTED:7e3,CAST_API_UNAVAILABLE:8e3,NO_CAST_RECEIVERS:8001,ALREADY_CASTING:8002,UNEXPECTED_CAST_ERROR:8003,CAST_CANCELED_BY_USER:8004,CAST_CONNECTION_TIMED_OUT:8005,CAST_RECEIVER_APP_UNAVAILABLE:8006,STORAGE_NOT_SUPPORTED:9e3,INDEXED_DB_ERROR:9001,OPERATION_ABORTED:9002,REQUESTED_ITEM_NOT_FOUND:9003,MALFORMED_OFFLINE_URI:9004,CANNOT_STORE_LIVE_OFFLINE:9005,STORE_ALREADY_IN_PROGRESS:9006,NO_INIT_DATA_FOR_OFFLINE:9007,LOCAL_PLAYER_INSTANCE_REQUIRED:9008,CONTENT_UNSUPPORTED_BY_BROWSER:9009,UNSUPPORTED_UPGRADE_REQUEST:9010};var Mo=/^(?:([^:\/?#.]+):)?(?:\/\/(?:([^\/?#]*)@)?([^\/#?]*?)(?::([0-9]+))?(?=[\/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#(.*))?$/;Lo=c.prototype,Lo.da="",Lo.Ba="",Lo.ia="",Lo.La=null,Lo.Y="",Lo.ua="",Lo.toString=function(){var t=[],e=this.da;if(e&&t.push(m(e,Co,!0),":"),e=this.ia){t.push("//");var i=this.Ba;i&&t.push(m(i,Co,!0),"@"),t.push(encodeURIComponent(e).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e=this.La,null!=e&&t.push(":",String(e))}return(e=this.Y)&&(this.ia&&"/"!=e.charAt(0)&&t.push("/"),t.push(m(e,"/"==e.charAt(0)?Uo:Oo,!0))),(e=this.a.toString())&&t.push("?",e),(e=this.ua)&&t.push("#",m(e,Bo)),t.join("")},Lo.resolve=function(t){var e=new c(this);"data"===e.da&&(e=new c);var i=!!t.da;i?l(e,t.da):i=!!t.Ba,i?e.Ba=t.Ba:i=!!t.ia,i?e.ia=t.ia:i=null!=t.La;var n=t.Y;if(i)f(e,t.La);else if(i=!!t.Y){if("/"!=n.charAt(0))if(this.ia&&!this.Y)n="/"+n;else{var r=e.Y.lastIndexOf("/");-1!=r&&(n=e.Y.substr(0,r+1)+n)}if(".."==n||"."==n)n="";else if(-1!=n.indexOf("./")||-1!=n.indexOf("/.")){for(var r=!n.lastIndexOf("/",0),n=n.split("/"),a=[],s=0;s<n.length;){var o=n[s++];"."==o?r&&s==n.length&&a.push(""):".."==o?((1<a.length||1==a.length&&""!=a[0])&&a.pop(),r&&s==n.length&&a.push("")):(a.push(o),r=!0)}n=a.join("/")}}return i?e.Y=n:i=""!==t.a.toString(),i?d(e,g(t.a)):i=!!t.ua,i&&(e.ua=t.ua),e};var Co=/[#\/\?@]/g,Oo=/[\#\?:]/g,Uo=/[\#\?]/g,jo=/[\#\?@]/g,Bo=/#/g;v.prototype.a=null,v.prototype.c=null,v.prototype.toString=function(){if(this.b)return this.b;if(!this.a)return"";var t,e=[];for(t in this.a)for(var i=encodeURIComponent(t),n=this.a[t],r=0;r<n.length;r++){var a=i;""!==n[r]&&(a+="="+encodeURIComponent(n[r])),e.push(a)}return this.b=e.join("&")},e("shaka.net.NetworkingEngine",L),L.RequestType={MANIFEST:0,SEGMENT:1,LICENSE:2,APP:3},L.PluginPriority={af:1,cf:2,Ye:3};var Fo={};L.registerScheme=D,L.unregisterScheme=function(t){delete Fo[t]},L.prototype.me=function(t){this.b.push(t)},L.prototype.registerRequestFilter=L.prototype.me,L.prototype.Re=function(t){var e=this.b;0<=(t=e.indexOf(t))&&e.splice(t,1)},L.prototype.unregisterRequestFilter=L.prototype.Re,L.prototype.cd=function(){this.b=[]},L.prototype.clearAllRequestFilters=L.prototype.cd,L.prototype.ne=function(t){this.c.push(t)},L.prototype.registerResponseFilter=L.prototype.ne,L.prototype.Se=function(t){var e=this.c;0<=(t=e.indexOf(t))&&e.splice(t,1)},L.prototype.unregisterResponseFilter=L.prototype.Se,L.prototype.dd=function(){this.c=[]},L.prototype.clearAllResponseFilters=L.prototype.dd,L.prototype.destroy=function(){this.f=!0,this.b=[],this.c=[];for(var t=[],e=0;e<this.a.length;++e)t.push(this.a[e].catch(x));return Promise.all(t)},L.prototype.destroy=L.prototype.destroy,L.prototype.request=function(t,e,i){var n=i||function(){return!1};if(this.f)return Promise.reject();e.method=e.method||"GET",e.headers=e.headers||{},e.retryParameters=e.retryParameters?I(e.retryParameters):E(),e.uris=I(e.uris);var r=Date.now(),a=Promise.resolve();return this.b.forEach(function(i){a=a.then(i.bind(null,t,e))}),a=a.catch(function(t){throw new h(2,1,1006,t)}),a=a.then(function(){var a=Date.now()-r,s=new T(e.retryParameters,!1,i);return w(s).then(function(){return C(this,t,e,s,0,a,n)}.bind(this))}.bind(this)),this.a.push(a),a.then(function(e){return 0<=this.a.indexOf(a)&&this.a.splice(this.a.indexOf(a),1),this.g&&!e.fromCache&&1==t&&this.g(e.timeMs,e.data.byteLength),e}.bind(this)).catch(function(t){return t&&(t.severity=2),0<=this.a.indexOf(a)&&this.a.splice(this.a.indexOf(a),1),Promise.reject(t)}.bind(this))},L.prototype.request=L.prototype.request,F.prototype.push=function(t,e){this.a.hasOwnProperty(t)?this.a[t].push(e):this.a[t]=[e]},F.prototype.get=function(t){return(t=this.a[t])?t.slice():null},F.prototype.remove=function(t,e){var i=this.a[t];if(i)for(var n=0;n<i.length;++n)i[n]==e&&(i.splice(n,1),--n)},V.prototype.destroy=function(){return q(this),this.a=null,Promise.resolve()},V.prototype.ga=function(t,e){if(this.a)for(var i=this.a.get(e)||[],n=0;n<i.length;++n){var r=i[n];r.target==t&&(r.ga(),this.a.remove(e,r))}},G.prototype.ga=function(){this.target.removeEventListener(this.type,this.a,!1),this.a=this.target=null},X.prototype.preventDefault=function(){this.cancelable&&(this.defaultPrevented=!0)},X.prototype.stopImmediatePropagation=function(){this.a=!0},X.prototype.stopPropagation=function(){};var Vo=1/15,Ho={codecs:"codecs",frameRate:"framerate",bandwidth:"bitrate",width:"width",height:"height",channelsCount:"channels"};e("shaka.util.StringUtils.fromUTF8",tt),e("shaka.util.StringUtils.fromUTF16",et),e("shaka.util.StringUtils.fromBytesAutoDetect",it),e("shaka.util.StringUtils.toUTF8",nt),at.prototype.cancel=function(){null!=this.a&&(clearTimeout(this.a),this.a=null)},e("shaka.util.Uint8ArrayUtils.toBase64",ut),e("shaka.util.Uint8ArrayUtils.fromBase64",ht),e("shaka.util.Uint8ArrayUtils.fromHex",ct),e("shaka.util.Uint8ArrayUtils.toHex",lt),e("shaka.util.Uint8ArrayUtils.equal",ft),e("shaka.util.Uint8ArrayUtils.concat",dt),Lo=pt.prototype,Lo.destroy=function(){this.c=!0;var t=[];return this.a.forEach(function(e){e=e.ea.close().catch(x);var i=new Promise(function(t){setTimeout(t,1e3)});t.push(Promise.race([e,i]))}),this.i.reject(),this.f&&t.push(this.f.destroy()),this.l&&t.push(this.l.setMediaKeys(null).catch(x)),this.w&&(this.w.cancel(),this.w=null),this.F&&(this.F.cancel(),this.F=null),this.f=this.l=this.j=this.u=this.b=null,this.a=[],this.m=[],this.s=this.g=this.h=null,Promise.all(t)},Lo.configure=function(t){this.h=t},Lo.init=function(t,e){var i={},n=[];return this.ha=e,this.m=t.offlineSessionIds,bt(this,t,e||0<t.offlineSessionIds.length,i,n),n.length?Tt(this,i,n):(this.K=!0,Promise.resolve())},Lo.keySystem=function(){return this.b?this.b.keySystem:""},Lo.ob=function(){var t=this.a.map(function(t){return t=t.ea.expiration,isNaN(t)?1/0:t});return Math.min.apply(Math,t)},Lo.Ed=function(t){for(var e=new Uint8Array(t.initData),i=0;i<this.a.length;++i)if(ft(e,this.a[i].initData))return;It(this,t.initDataType,e)},Lo.Dc=function(t){this.h.delayLicenseRequestUntilPlayed&&this.l.paused&&!this.W?this.J.push(t):_t(this,t)},Lo.xc=function(t){t=t.target;var e;for(e=0;e<this.a.length&&this.a[e].ea!=t;++e);if(e!=this.a.length){var i=!1;t.keyStatuses.forEach(function(t,n){if("string"==typeof n){var r=n;n=t,t=r}if("com.microsoft.playready"==this.b.keySystem&&16==n.byteLength){var r=new DataView(n),a=r.getUint32(0,!0),s=r.getUint16(4,!0),o=r.getUint16(6,!0);r.setUint32(0,a,!1),r.setUint16(4,s,!1),r.setUint16(6,o,!1)}"com.microsoft.playready"==this.b.keySystem&&"status-pending"==t&&(t="usable"),"status-pending"!=t&&(this.a[e].loaded=!0,this.a.every(function(t){return t.loaded})&&this.i.resolve()),"expired"==t&&(i=!0),r=lt(new Uint8Array(n)),this.A[r]=t}.bind(this));var n=t.expiration-Date.now();(0>n||i&&1e3>n)&&!this.a[e].ma&&(this.a.splice(e,1),t.close()),st(this.F,.5)}},Lo.le=function(){function t(t,e){return"expired"==e}!$(this.A)&&J(this.A,t)&&this.g(new h(2,6,6014)),this.s.Pb(this.A)},Lo.Pd=function(){for(var t=0;t<this.J.length;t++)_t(this,this.J[t]);this.W=!0,this.J=[]},Lo.je=function(){this.a.forEach(function(t){var e=t.Ob,i=t.ea.expiration;isNaN(i)&&(i=1/0),i!=e&&(this.s.onExpirationUpdated(t.ea.sessionId,i),t.Ob=i)}.bind(this))},Ot.prototype.destroy=function(){return this.a.dispose(),this.a=null,Promise.resolve()},Ot.prototype.h=function(t){var e=new Uint8Array(t.data.byteLength+t.initSegment.byteLength);e.set(t.initSegment,0),e.set(t.data,t.initSegment.byteLength),this.c.push(e)},Ot.prototype.g=function(){var t=dt.apply(null,this.c);this.b.resolve(t)};var Ko={};e("shaka.text.TextEngine.registerParser",function(t,e){Ko[t]=e}),e("shaka.text.TextEngine.unregisterParser",function(t){delete Ko[t]}),Bt.prototype.destroy=function(){return this.f=this.c=null,Promise.resolve()},Bt.prototype.Ae=function(t){this.f=t},Bt.prototype.setDisplayer=Bt.prototype.Ae,Bt.prototype.Gb=function(t){var e={periodStart:0,segmentStart:0,segmentEnd:0};try{return this.c.parseMedia(new Uint8Array(t),e)[0].startTime}catch(t){throw new h(2,2,2009,t)}},Bt.prototype.remove=function(t,e){return Promise.resolve().then(function(){!this.f||!this.f.remove(t,e)||null==this.a||e<=this.a||t>=this.b||(t<=this.a&&e>=this.b?this.a=this.b=null:t<=this.a&&e<this.b?this.a=e:t>this.a&&e>=this.b&&(this.b=t))}.bind(this))},Lo=Vt.prototype,Lo.destroy=function(){this.j=!0;var t,e=[];for(t in this.c){var i=this.c[t],n=i[0];for(this.c[t]=i.slice(0,1),n&&e.push(n.p.catch(x)),n=1;n<i.length;++n)i[n].p.catch(x),i[n].p.reject()}this.a&&e.push(this.a.destroy());for(t in this.h)e.push(this.h[t].destroy());return Promise.all(e).then(function(){this.i.destroy(),this.l=this.a=this.f=this.g=this.i=null,this.b={},this.h={},this.c={}}.bind(this))},Lo.init=function(e){for(var i in e){var n=e[i],n=Z(n.mimeType,n.codecs);"text"==i?Kt(this,n):(!MediaSource.isTypeSupported(n)&&t.muxjs&&"mp2t"==n.split(";")[0].split("/")[1]&&MediaSource.isTypeSupported(Ut(i,n))&&(this.h[i]=new Ot,n=Ut(i,n)),n=this.f.addSourceBuffer(n),H(this.i,n,"error",this.Me.bind(this,i)),H(this.i,n,"updateend",this.Ja.bind(this,i)),this.b[i]=n,this.c[i]=[])}},Lo.Cb=function(){var t=this.a&&null!=this.a.a?[{start:this.a.a,end:this.a.b}]:[];return{total:Ct(this.g.buffered),audio:Ct(Gt(this,"audio")),video:Ct(Gt(this,"video")),text:t}},Lo.remove=function(t,e,i){return"text"==t?this.a.remove(e,i):$t(this,t,this.Tc.bind(this,t,e,i))},Lo.endOfStream=function(t){return Wt(this,function(){t?this.f.endOfStream(t):this.f.endOfStream()}.bind(this))},Lo.fa=function(t){return Wt(this,function(){this.f.duration=t}.bind(this))},Lo.T=function(){return this.f.duration},Lo.Sc=function(t,e){this.b[t].appendBuffer(e)},Lo.Tc=function(t,e,i){i<=e?this.Ja(t):this.b[t].remove(e,i)},Lo.Zc=function(t){var e=this.b[t].appendWindowStart,i=this.b[t].appendWindowEnd;this.b[t].abort(),this.b[t].appendWindowStart=e,this.b[t].appendWindowEnd=i,this.Ja(t)},Lo.hd=function(t){this.g.currentTime-=.001,this.Ja(t)},Lo.Ce=function(t,e){this.b[t].timestampOffset=e,this.Ja(t)},Lo.ze=function(t,e,i){this.b[t].appendWindowStart=0,this.b[t].appendWindowEnd=i,this.b[t].appendWindowStart=e,this.Ja(t)},Lo.Me=function(t){this.c[t][0].p.reject(new h(2,3,3014,this.g.error?this.g.error.code:0))},Lo.Ja=function(t){var e=this.c[t][0];e&&(e.p.resolve(),Jt(this,t))};var qo=1,Go=2,Xo={aar:"aa",abk:"ab",afr:"af",aka:"ak",alb:"sq",amh:"am",ara:"ar",arg:"an",arm:"hy",asm:"as",ava:"av",ave:"ae",aym:"ay",aze:"az",bak:"ba",bam:"bm",baq:"eu",bel:"be",ben:"bn",bih:"bh",bis:"bi",bod:"bo",bos:"bs",bre:"br",bul:"bg",bur:"my",cat:"ca",ces:"cs",cha:"ch",che:"ce",chi:"zh",chu:"cu",chv:"cv",cor:"kw",cos:"co",cre:"cr",cym:"cy",cze:"cs",dan:"da",deu:"de",div:"dv",dut:"nl",dzo:"dz",ell:"el",eng:"en",epo:"eo",est:"et",eus:"eu",ewe:"ee",fao:"fo",fas:"fa",fij:"fj",fin:"fi",fra:"fr",fre:"fr",fry:"fy",ful:"ff",geo:"ka",ger:"de",gla:"gd",gle:"ga",glg:"gl",glv:"gv",gre:"el",grn:"gn",guj:"gu",hat:"ht",hau:"ha",heb:"he",her:"hz",hin:"hi",hmo:"ho",hrv:"hr",hun:"hu",hye:"hy",ibo:"ig",ice:"is",ido:"io",iii:"ii",iku:"iu",ile:"ie",ina:"ia",ind:"id",ipk:"ik",isl:"is",ita:"it",jav:"jv",jpn:"ja",kal:"kl",kan:"kn",kas:"ks",kat:"ka",kau:"kr",kaz:"kk",khm:"km",kik:"ki",kin:"rw",kir:"ky",kom:"kv",kon:"kg",kor:"ko",kua:"kj",kur:"ku",lao:"lo",lat:"la",lav:"lv",lim:"li",lin:"ln",lit:"lt",ltz:"lb",lub:"lu",lug:"lg",mac:"mk",mah:"mh",mal:"ml",mao:"mi",mar:"mr",may:"ms",mkd:"mk",mlg:"mg",mlt:"mt",mon:"mn",mri:"mi",msa:"ms",mya:"my",nau:"na",nav:"nv",nbl:"nr",nde:"nd",ndo:"ng",nep:"ne",nld:"nl",nno:"nn",nob:"nb",nor:"no",nya:"ny",oci:"oc",oji:"oj",ori:"or",orm:"om",oss:"os",pan:"pa",per:"fa",pli:"pi",pol:"pl",por:"pt",pus:"ps",que:"qu",roh:"rm",ron:"ro",rum:"ro",run:"rn",rus:"ru",sag:"sg",san:"sa",sin:"si",slk:"sk",slo:"sk",slv:"sl",sme:"se",smo:"sm",sna:"sn",snd:"sd",som:"so",sot:"st",spa:"es",sqi:"sq",srd:"sc",srp:"sr",ssw:"ss",sun:"su",swa:"sw",swe:"sv",tah:"ty",tam:"ta",tat:"tt",tel:"te",tgk:"tg",tgl:"tl",tha:"th",tib:"bo",tir:"ti",ton:"to",tsn:"tn",tso:"ts",tuk:"tk",tur:"tr",twi:"tw",uig:"ug",ukr:"uk",urd:"ur",uzb:"uz",ven:"ve",vie:"vi",vol:"vo",wel:"cy",wln:"wa",wol:"wo",xho:"xh",yid:"yi",yor:"yo",zha:"za",zho:"zh",zul:"zu"};e("shaka.abr.SimpleAbrManager",we),we.prototype.stop=function(){this.h=null,this.c=!1,this.g=[],this.f=null},we.prototype.stop=we.prototype.stop,we.prototype.init=function(t){this.h=t},we.prototype.init=we.prototype.init,we.prototype.chooseVariant=function(){var t=Ee(this.a.restrictions,this.g),e=this.b.getBandwidthEstimate(this.a.defaultBandwidthEstimate);if(this.g.length&&!t.length)throw new h(2,4,4012);for(var i=t[0]||null,n=0;n<t.length;++n){var r=t[n],a=(t[n+1]||{bandwidth:1/0}).bandwidth/this.a.bandwidthUpgradeTarget;e>=r.bandwidth/this.a.bandwidthDowngradeTarget&&e<=a&&(i=r)}return this.f=Date.now(),i},we.prototype.chooseVariant=we.prototype.chooseVariant,we.prototype.enable=function(){this.c=!0},we.prototype.enable=we.prototype.enable,we.prototype.disable=function(){this.c=!1},we.prototype.disable=we.prototype.disable,we.prototype.segmentDownloaded=function(t,e){var i=this.b;if(!(16e3>e)){var n=8e3*e/t,a=t/1e3;i.a+=e,r(i.b,a,n),r(i.c,a,n)}if(null!=this.f&&this.c)t:{if(this.i){if(Date.now()-this.f<1e3*this.a.switchInterval)break t}else{if(!(128e3<=this.b.a))break t;this.i=!0}i=this.chooseVariant(),this.b.getBandwidthEstimate(this.a.defaultBandwidthEstimate),this.h(i)}},we.prototype.segmentDownloaded=we.prototype.segmentDownloaded,we.prototype.getBandwidthEstimate=function(){return this.b.getBandwidthEstimate(this.a.defaultBandwidthEstimate)},we.prototype.getBandwidthEstimate=we.prototype.getBandwidthEstimate,we.prototype.setVariants=function(t){this.g=t},we.prototype.setVariants=we.prototype.setVariants,we.prototype.configure=function(t){this.a=t},we.prototype.configure=we.prototype.configure;var Yo="ended play playing pause pausing ratechange seeked seeking timeupdate volumechange".split(" "),zo="buffered currentTime duration ended loop muted paused playbackRate seeking videoHeight videoWidth volume".split(" "),$o=["loop","playbackRate"],Wo=["pause","play"],Jo="adaptation buffering emsg error loading streaming texttrackvisibility timelineregionadded timelineregionenter timelineregionexit trackschanged unloading".split(" "),Qo={drmInfo:20,getAudioLanguages:2,getAudioLanguagesAndRoles:2,getBufferedInfo:2,getConfiguration:2,getExpiration:2,getManifestUri:2,getPlaybackRate:2,getTextLanguages:2,getTextLanguagesAndRoles:2,getTextTracks:2,getStats:5,getVariantTracks:2,isAudioOnly:10,isBuffering:1,isInProgress:1,isLive:10,isTextTrackVisible:1,keySystem:10,seekRange:1},Zo={getPlayheadTimeAsDate:1,getPresentationStartTimeAsDate:20},tu=[["getConfiguration","configure"]],eu=[["isTextTrackVisible","setTextTrackVisibility"]],iu="addTextTrack cancelTrickPlay configure resetConfiguration retryStreaming selectAudioLanguage selectTextLanguage selectTextTrack selectVariantTrack setTextTrackVisibility trickPlay".split(" "),nu=["load","unload"],ru=!1,au=null;Lo=Ie.prototype,Lo.destroy=function(){return Pe(this),au&&_e(this),this.F=this.A=this.g=null,this.b=this.h=!1,this.m=this.l=this.f=this.c=this.a=this.i=null,Promise.resolve()},Lo.X=function(){return this.b},Lo.Ub=function(){return this.w},Lo.init=function(){if(t.chrome&&chrome.cast&&chrome.cast.isAvailable){delete t.__onGCastApiAvailable,this.h=!0,this.g();var e=new chrome.cast.SessionRequest(this.J),e=new chrome.cast.ApiConfig(e,this.wc.bind(this),this.Rd.bind(this),"origin_scoped");chrome.cast.initialize(e,function(){},function(){}),ru&&setTimeout(this.g.bind(this),20),(e=au)&&e.status!=chrome.cast.SessionStatus.STOPPED?this.wc(e):au=null}else t.__onGCastApiAvailable=function(t){t&&this.init()}.bind(this)},Lo.Xb=function(t){this.i=t,this.b&&xe({type:"appData",appData:this.i})},Lo.cast=function(t){return this.h?ru?this.b?Promise.reject(new h(1,8,8002)):(this.f=new b,chrome.cast.requestSession(this.Rb.bind(this,t),this.uc.bind(this)),this.f):Promise.reject(new h(1,8,8001)):Promise.reject(new h(1,8,8e3))},Lo.nb=function(){this.b&&(Pe(this),au&&(_e(this),au.stop(function(){},function(){}),au=null))},Lo.get=function(t,e){if("video"==t){if(0<=Wo.indexOf(e))return this.Ic.bind(this,t,e)}else if("player"==t){if(Zo[e]&&!this.get("player","isLive")())return function(){};if(0<=iu.indexOf(e))return this.Ic.bind(this,t,e);if(0<=nu.indexOf(e))return this.pe.bind(this,t,e);if(Qo[e])return this.Fc.bind(this,t,e)}return this.Fc(t,e)},Lo.set=function(t,e,i){this.a[t][e]=i,xe({type:"set",targetName:t,property:e,value:i})},Lo.Rb=function(t,e){au=e,e.addUpdateListener(this.l),e.addMessageListener("urn:x-cast:com.google.shaka.v2",this.m),this.vc(),xe({type:"init",initState:t,appData:this.i}),this.f.resolve()},Lo.uc=function(t){var e=8003;switch(t.code){case"cancel":e=8004;break;case"timeout":e=8005;break;case"receiver_unavailable":e=8006}this.f.reject(new h(2,8,e,t))},Lo.Fc=function(t,e){return this.a[t][e]},Lo.Ic=function(t,e){xe({type:"call",targetName:t,methodName:e,args:Array.prototype.slice.call(arguments,2)})},Lo.pe=function(t,e){var i=Array.prototype.slice.call(arguments,2),n=new b,r=this.s.toString();return this.s++,this.c[r]=n,xe({type:"asyncCall",targetName:t,methodName:e,args:i,id:r}),n},Lo.wc=function(t){var e=this.u();this.f=new b,this.j=!0,this.Rb(e,t)},Lo.Rd=function(t){ru="available"==t,this.g()},Lo.vc=function(){var t=!!au&&"connected"==au.status;if(this.b&&!t){this.F();for(var e in this.a)this.a[e]={};Pe(this)}this.w=(this.b=t)?au.receiver.friendlyName:"",this.g()},Lo.Ld=function(t,e){var i=Ae(e);switch(i.type){case"event":var n=i.targetName,r=i.event;this.A(n,new X(r.type,r));break;case"update":r=i.update;for(n in r){var i=this.a[n]||{};for(a in r[n])i[a]=r[n][a]}this.j&&(this.K(),this.j=!1);break;case"asyncComplete":n=i.id;var a=i.error;if(i=this.c[n],delete this.c[n],i)if(a){n=new h(a.severity,a.category,a.code);for(r in a)n[r]=a[r];i.reject(n)}else i.resolve()}},Re.prototype.addEventListener=function(t,e){this.xb.push(t,e)},Re.prototype.removeEventListener=function(t,e){this.xb.remove(t,e)},Re.prototype.dispatchEvent=function(t){for(var e=this.xb.get(t.type)||[],i=0;i<e.length;++i){t.target=this.eb,t.currentTarget=this.eb;var n=e[i];try{n.handleEvent?n.handleEvent(t):n.call(this,t)}catch(t){}if(t.a)break}return t.defaultPrevented},i(Ne),e("shaka.cast.CastProxy",Ne),Ne.prototype.destroy=function(t){return t&&this.a&&this.a.nb(),t=[this.i?this.i.destroy():null,this.b?this.b.destroy():null,this.a?this.a.destroy():null],this.a=this.i=this.j=this.h=this.b=this.c=null,Promise.all(t)},Ne.prototype.destroy=Ne.prototype.destroy,Ne.prototype.xd=function(){return this.h},Ne.prototype.getVideo=Ne.prototype.xd,Ne.prototype.od=function(){return this.j},Ne.prototype.getPlayer=Ne.prototype.od,Ne.prototype.$c=function(){return!!this.a&&(this.a.h&&ru)},Ne.prototype.canCast=Ne.prototype.$c,Ne.prototype.X=function(){return!!this.a&&this.a.X()},Ne.prototype.isCasting=Ne.prototype.X,Ne.prototype.Ub=function(){return this.a?this.a.Ub():""},Ne.prototype.receiverName=Ne.prototype.Ub,Ne.prototype.cast=function(){var t=this.mc();return this.a.cast(t).then(function(){return this.b.vb()}.bind(this))},Ne.prototype.cast=Ne.prototype.cast,Ne.prototype.Xb=function(t){this.a.Xb(t)},Ne.prototype.setAppData=Ne.prototype.Xb,Ne.prototype.Pe=function(){var t=this.a;if(t.b){var e=t.u();chrome.cast.requestSession(t.Rb.bind(t,e),t.uc.bind(t))}},Ne.prototype.suggestDisconnect=Ne.prototype.Pe,Ne.prototype.nb=function(){this.a.nb()},Ne.prototype.forceDisconnect=Ne.prototype.nb,Lo=Ne.prototype,Lo.mc=function(){var t={video:{},player:{},playerAfterLoad:{},manifest:this.b.nc(),startTime:null};return this.c.pause(),$o.forEach(function(e){t.video[e]=this.c[e]}.bind(this)),this.c.ended||(t.startTime=this.c.currentTime),tu.forEach(function(e){var i=e[1];e=this.b[e[0]](),t.player[i]=e}.bind(this)),eu.forEach(function(e){var i=e[1];e=this.b[e[0]](),t.playerAfterLoad[i]=e}.bind(this)),t},Lo.He=function(){this.dispatchEvent(new X("caststatuschanged"))},Lo.Ie=function(){this.f.dispatchEvent(new X(this.h.paused?"pause":"play"))},Lo.Ke=function(){tu.forEach(function(t){var e=t[1];t=this.a.get("player",t[0])(),this.b[e](t)}.bind(this));var t=this.a.get("player","getManifestUri")(),e=this.a.get("video","ended"),i=Promise.resolve(),n=this.c.autoplay,r=null;e||(r=this.a.get("video","currentTime")),t&&(this.c.autoplay=!1,i=this.b.load(t,r),i.catch(function(t){this.b.dispatchEvent(new X("error",{detail:t}))}.bind(this)));var a={};$o.forEach(function(t){a[t]=this.a.get("video",t)}.bind(this)),i.then(function(){$o.forEach(function(t){this.c[t]=a[t]}.bind(this)),eu.forEach(function(t){var e=t[1];t=this.a.get("player",t[0])(),this.b[e](t)}.bind(this)),this.c.autoplay=n,t&&this.c.play()}.bind(this))},Lo.Ve=function(t){if("addEventListener"==t)return this.f.addEventListener.bind(this.f);if("removeEventListener"==t)return this.f.removeEventListener.bind(this.f);if(this.a.X()&&!Object.keys(this.a.a.video).length){var e=this.c[t];if("function"!=typeof e)return e}return this.a.X()?this.a.get("video",t):(e=this.c[t],"function"==typeof e&&(e=e.bind(this.c)),e)},Lo.Xe=function(t,e){this.a.X()?this.a.set("video",t,e):this.c[t]=e},Lo.We=function(t){this.a.X()||this.f.dispatchEvent(new X(t.type,t))},Lo.ge=function(t){return"addEventListener"==t?this.g.addEventListener.bind(this.g):"removeEventListener"==t?this.g.removeEventListener.bind(this.g):"getMediaElement"==t?function(){return this.h}.bind(this):"getNetworkingEngine"==t?this.b.oc.bind(this.b):"getManifest"==t?this.a.X()?function(){return null}:this.b.Ea.bind(this.b):this.a.X()&&!Object.keys(this.a.a.video).length&&Qo[t]||!this.a.X()?(t=this.b[t],t.bind(this.b)):this.a.get("player",t)},Lo.he=function(t){this.a.X()||this.g.dispatchEvent(t)},Lo.Je=function(t,e){this.a.X()&&("video"==t?this.f.dispatchEvent(e):"player"==t&&this.g.dispatchEvent(e))},i(De),e("shaka.cast.CastReceiver",De),De.prototype.isConnected=function(){return this.l},De.prototype.isConnected=De.prototype.isConnected,De.prototype.zd=function(){return this.f},De.prototype.isIdle=De.prototype.zd,De.prototype.destroy=function(){var e=this.b?this.b.destroy():Promise.resolve();return null!=this.i&&t.clearTimeout(this.i),this.s=this.m=this.b=this.a=null,this.l=!1,this.f=!0,this.i=this.h=this.c=null,e.then(function(){cast.receiver.CastReceiverManager.getInstance().stop()})},De.prototype.destroy=De.prototype.destroy,Lo=De.prototype,Lo.Cc=function(){this.l=!!cast.receiver.CastReceiverManager.getInstance().getSenders().length,Ce(this)},Lo.Gc=function(t,e){this.b&&(this.Sb(),Ue(this,{type:"event",targetName:t,event:e},this.c))},Lo.Sb=function(){null!=this.i&&t.clearTimeout(this.i),this.i=t.setTimeout(this.Sb.bind(this),500);var e={video:{},player:{}};if(zo.forEach(function(t){e.video[t]=this.a[t]}.bind(this)),this.b.P())for(var i in Zo){var n=Zo[i];this.g%n||(e.player[i]=this.b[i]())}for(i in Qo)n=Qo[i],this.g%n||(e.player[i]=this.b[i]());(n=cast.receiver.CastReceiverManager.getInstance().getSystemVolume())&&(e.video.volume=n.level,e.video.muted=n.muted),this.j&&(this.g+=1),Ue(this,{type:"update",update:e},this.c)},Lo.gd=function(){var t=cast.receiver.CastReceiverManager.getInstance().getSystemVolume();t&&Ue(this,{type:"update",update:{video:{volume:t.level,muted:t.muted}}},this.c),Ue(this,{type:"event",targetName:"video",event:{type:"volumechange"}},this.c)},Lo.Ud=function(t){var e=Ae(t.data);switch(e.type){case"init":this.g=0,this.j=!1,Oe(this,e.initState,e.appData),this.Sb();break;case"appData":this.s(e.appData);break;case"set":var i=e.targetName,n=e.property,r=e.value;if("video"==i){if(e=cast.receiver.CastReceiverManager.getInstance(),"volume"==n){e.setSystemVolumeLevel(r);break}if("muted"==n){e.setSystemVolumeMuted(r);break}}this.m[i][n]=r;break;case"call":i=e.targetName,n=e.methodName,r=e.args,i=this.m[i],i[n].apply(i,r);break;case"asyncCall":i=e.targetName,n=e.methodName,"player"==i&&"load"==n&&(this.g=0,this.j=!1),r=e.args,e=e.id,t=t.senderId,i=this.m[i],i[n].apply(i,r).then(this.Nc.bind(this,t,e,null),this.Nc.bind(this,t,e))}},Lo.Gd=function(t){var e=Ae(t.data);switch(e.type){case"PLAY":this.a.play(),je(this,0);break;case"PAUSE":this.a.pause(),je(this,0);break;case"SEEK":t=e.currentTime;var i=e.resumeState;null!=t&&(this.a.currentTime=Number(t)),i&&"PLAYBACK_START"==i?(this.a.play(),je(this,0)):i&&"PLAYBACK_PAUSE"==i&&(this.a.pause(),je(this,0));break;case"STOP":this.b.vb().then(function(){je(this,0)}.bind(this));break;case"GET_STATUS":je(this,Number(e.requestId));break;case"VOLUME":i=e.volume,t=i.level;var i=i.muted,n=this.a.volume,r=this.a.muted;null!=t&&(this.a.volume=Number(t)),null!=i&&(this.a.muted=i),n==this.a.volume&&r==this.a.muted||je(this,0);break;case"LOAD":this.g=0,this.j=!1,i=e.media.contentId,t=e.currentTime;var a=this.u(i);this.a.autoplay=!0,this.b.load(a,t).then(function(){je(this,0,{contentId:a,streamType:this.b.P()?"LIVE":"BUFFERED",contentType:""})}.bind(this)).catch(function(t){var i="LOAD_FAILED";7==t.category&&7e3==t.code&&(i="LOAD_CANCELLED"),Ue(this,{requestId:Number(e.requestId),type:i},this.h)}.bind(this));break;default:Ue(this,{requestId:Number(e.requestId),type:"INVALID_REQUEST",reason:"INVALID_COMMAND"},this.h)}},Lo.Nc=function(t,e,i){Ue(this,{type:"asyncComplete",id:e,error:i},this.c,t)};var su={IDLE:"IDLE",Xc:"PLAYING",Uc:"BUFFERING",Wc:"PAUSED"},ou={"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:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime"};e("shaka.media.InitSegmentReference",oi),oi.prototype.Ab=function(){return this.a()},oi.prototype.createUris=oi.prototype.Ab,oi.prototype.Fb=function(){return this.N},oi.prototype.getStartByte=oi.prototype.Fb,oi.prototype.Db=function(){return this.D},oi.prototype.getEndByte=oi.prototype.Db,e("shaka.media.SegmentReference",ui),ui.prototype.U=function(){return this.position},ui.prototype.getPosition=ui.prototype.U,ui.prototype.Gb=function(){return this.startTime},ui.prototype.getStartTime=ui.prototype.Gb,ui.prototype.ld=function(){return this.endTime},ui.prototype.getEndTime=ui.prototype.ld,ui.prototype.Ab=function(){return this.a()},ui.prototype.createUris=ui.prototype.Ab,ui.prototype.Fb=function(){return this.N},ui.prototype.getStartByte=ui.prototype.Fb,ui.prototype.Db=function(){return this.D},ui.prototype.getEndByte=ui.prototype.Db,e("shaka.util.DataViewReader",hi);var uu=1;hi.Endianness={Ze:0,bf:uu},hi.prototype.ca=function(){return this.a<this.G.byteLength},hi.prototype.hasMoreData=hi.prototype.ca,hi.prototype.U=function(){return this.a},hi.prototype.getPosition=hi.prototype.U,hi.prototype.md=function(){return this.G.byteLength},hi.prototype.getLength=hi.prototype.md,hi.prototype.$=function(){try{var t=this.G.getUint8(this.a)}catch(t){ci()}return this.a+=1,t},hi.prototype.readUint8=hi.prototype.$,hi.prototype.Xa=function(){try{var t=this.G.getUint16(this.a,this.b)}catch(t){ci()}return this.a+=2,t},hi.prototype.readUint16=hi.prototype.Xa,hi.prototype.B=function(){try{var t=this.G.getUint32(this.a,this.b)}catch(t){ci()}return this.a+=4,t},hi.prototype.readUint32=hi.prototype.B,hi.prototype.Hc=function(){try{var t=this.G.getInt32(this.a,this.b)}catch(t){ci()}return this.a+=4,t},hi.prototype.readInt32=hi.prototype.Hc,hi.prototype.Na=function(){try{if(this.b)var t=this.G.getUint32(this.a,!0),e=this.G.getUint32(this.a+4,!0);else e=this.G.getUint32(this.a,!1),t=this.G.getUint32(this.a+4,!1)}catch(t){ci()}if(2097151<e)throw new h(2,3,3001);return this.a+=8,e*Math.pow(2,32)+t},hi.prototype.readUint64=hi.prototype.Na,hi.prototype.Ma=function(t){this.a+t>this.G.byteLength&&ci();var e=new Uint8Array(this.G.buffer,this.G.byteOffset+this.a,t);return this.a+=t,new Uint8Array(e)},hi.prototype.readBytes=hi.prototype.Ma,hi.prototype.H=function(t){this.a+t>this.G.byteLength&&ci(),this.a+=t},hi.prototype.skip=hi.prototype.H,hi.prototype.Lc=function(t){this.a<t&&ci(),this.a-=t},hi.prototype.rewind=hi.prototype.Lc,hi.prototype.seek=function(t){(0>t||t>this.G.byteLength)&&ci(),this.a=t},hi.prototype.seek=hi.prototype.seek,hi.prototype.Tb=function(){for(var t=this.a;this.ca()&&this.G.getUint8(this.a);)this.a+=1;return t=new Uint8Array(this.G.buffer,this.G.byteOffset+t,this.a-t),this.a+=1,tt(t)},hi.prototype.readTerminatedString=hi.prototype.Tb,e("shaka.util.Mp4Parser",li),li.prototype.C=function(t,e){var i=mi(t);return this.c[i]=0,this.b[i]=e,this},li.prototype.box=li.prototype.C,li.prototype.ba=function(t,e){var i=mi(t);return this.c[i]=1,this.b[i]=e,this},li.prototype.fullBox=li.prototype.ba,li.prototype.stop=function(){this.a=!0},li.prototype.stop=li.prototype.stop,li.prototype.parse=function(t,e){var i=new Uint8Array(t),i=new hi(new DataView(i.buffer,i.byteOffset,i.byteLength),0);for(this.a=!1;i.ca()&&!this.a;)this.rb(0,i,e)},li.prototype.parse=li.prototype.parse,li.prototype.rb=function(t,e,i){var n=e.U(),r=e.B(),a=e.B();switch(r){case 0:r=e.G.byteLength-n;break;case 1:r=e.Na()}var s=this.b[a];if(s){var o=null,u=null;1==this.c[a]&&(u=e.B(),o=u>>>24,u&=16777215),a=n+r,i&&a>e.G.byteLength&&(a=e.G.byteLength),a-=e.U(),e=0<a?e.Ma(a):new Uint8Array(0),e=new hi(new DataView(e.buffer,e.byteOffset,e.byteLength),0),s({oa:this,Ec:i||!1,version:o,lc:u,o:e,size:r,start:n+t})}else e.H(n+r-e.U())},li.prototype.parseNext=li.prototype.rb,li.children=fi,li.sampleDescription=di,li.allData=pi,e("shaka.media.SegmentIndex",gi),gi.prototype.destroy=function(){return this.a=null,Promise.resolve()},gi.prototype.destroy=gi.prototype.destroy,gi.prototype.find=function(t){for(var e=this.a.length-1;0<=e;--e){var i=this.a[e];if(t>=i.startTime&&t<i.endTime)return i.position}return this.a.length&&t<this.a[0].startTime?this.a[0].position:null},gi.prototype.find=gi.prototype.find,gi.prototype.get=function(t){return this.a.length?(t-=this.a[0].position,0>t||t>=this.a.length?null:this.a[t]):null},gi.prototype.get=gi.prototype.get,gi.prototype.offset=function(t){for(var e=0;e<this.a.length;++e)this.a[e].startTime+=t,this.a[e].endTime+=t},gi.prototype.offset=gi.prototype.offset,gi.prototype.Lb=function(t){for(var e,i,n,r=[],a=e=0;e<this.a.length&&a<t.length;)i=this.a[e],n=t[a],i.startTime<n.startTime?(r.push(i),e++):(i.startTime>n.startTime?e||r.push(n):(.1<Math.abs(i.endTime-n.endTime)?(n=new ui(i.position,n.startTime,n.endTime,n.a,n.N,n.D),r.push(n)):r.push(i),e++),a++);for(;e<this.a.length;)r.push(this.a[e++]);if(r.length)for(e=r[r.length-1].position+1;a<t.length;)n=t[a++],n=new ui(e++,n.startTime,n.endTime,n.a,n.N,n.D),r.push(n);else r=t;this.a=r},gi.prototype.merge=gi.prototype.Lb,gi.prototype.Bb=function(t){for(var e=0;e<this.a.length&&!(this.a[e].endTime>t);++e);this.a.splice(0,e)},gi.prototype.evict=gi.prototype.Bb;var hu;Ti.prototype.ca=function(){return this.a.ca()},ki.prototype.parse=function(t,e,i,n){var r;if(e=new Ti(new DataView(e)),440786851!=wi(e).id)throw new h(2,3,3008);var a=wi(e);if(408125543!=a.id)throw new h(2,3,3009);for(e=a.a.byteOffset,a=new Ti(a.a),r=null;a.ca();){var s=wi(a);if(357149030==s.id){r=s;break}}if(!r)throw new h(2,3,3010);for(a=new Ti(r.a),r=1e6,s=null;a.ca();){var o=wi(a);if(2807729==o.id)r=Ai(o);else if(17545==o.id)if(s=o,4==s.a.byteLength)s=s.a.getFloat32(0);else{if(8!=s.a.byteLength)throw new h(2,3,3003);s=s.a.getFloat64(0)}}if(null==s)throw new h(2,3,3011);if(a=r/1e9,r=s*a,t=wi(new Ti(new DataView(t))),475249515!=t.id)throw new h(2,3,3007);return Ii(t,e,a,r,i,n)};var cu={},lu={};e("shaka.media.ManifestParser.registerParserByExtension",function(t,e){lu[t]=e}),e("shaka.media.ManifestParser.registerParserByMime",function(t,e){cu[t]=e}),e("shaka.media.PresentationTimeline",Ki),Ki.prototype.T=function(){return this.a},Ki.prototype.getDuration=Ki.prototype.T,Ki.prototype.fa=function(t){this.a=t},Ki.prototype.setDuration=Ki.prototype.fa,Ki.prototype.qd=function(){return this.c},Ki.prototype.getPresentationStartTime=Ki.prototype.qd,Ki.prototype.Pc=function(t){this.i=t},Ki.prototype.setClockOffset=Ki.prototype.Pc,Ki.prototype.ub=function(t){this.h=t},Ki.prototype.setStatic=Ki.prototype.ub,Ki.prototype.sd=function(){return this.f},Ki.prototype.getSegmentAvailabilityDuration=Ki.prototype.sd,Ki.prototype.Zb=function(t){this.f=t},Ki.prototype.setSegmentAvailabilityDuration=Ki.prototype.Zb,Ki.prototype.Qc=function(t){this.j=t},Ki.prototype.setDelay=Ki.prototype.Qc,Ki.prototype.Ia=function(t,e){e.length&&(this.b=e.reduce(function(t,e){return Math.max(t,e.endTime-e.startTime)},this.b))},Ki.prototype.notifySegments=Ki.prototype.Ia,Ki.prototype.Mb=function(t){this.b=Math.max(this.b,t)},Ki.prototype.notifyMaxSegmentDuration=Ki.prototype.Mb,Ki.prototype.P=function(){return 1/0==this.a&&!this.h},Ki.prototype.isLive=Ki.prototype.P,Ki.prototype.wa=function(){return 1/0!=this.a&&!this.h},Ki.prototype.isInProgress=Ki.prototype.wa,Ki.prototype.ja=function(){return this.Fa(0)},Ki.prototype.getSegmentAvailabilityStart=Ki.prototype.ja,Ki.prototype.Fa=function(t){if(1/0==this.f)return this.g;var e=this.va();return Math.max(this.g,Math.min(e-this.f+t,e))},Ki.prototype.getSafeAvailabilityStart=Ki.prototype.Fa,Ki.prototype.Oc=function(t){this.g=t},Ki.prototype.setAvailabilityStart=Ki.prototype.Oc,Ki.prototype.va=function(){return this.P()||this.wa()?Math.min(Math.max(0,(Date.now()+this.i)/1e3-this.b-this.c),this.a):this.a},Ki.prototype.getSegmentAvailabilityEnd=Ki.prototype.va,Ki.prototype.pb=function(){var t=this.P()||this.wa()?this.j:0;return Math.max(0,this.va()-t)},Ki.prototype.getSeekRangeEnd=Ki.prototype.pb,e("shaka.dash.DashParser",qi),Lo=qi.prototype,Lo.configure=function(t){this.b=t},Lo.start=function(t,e){return this.g=[t],this.a=e,Gi(this).then(function(){return this.a&&Qi(this,0),this.c}.bind(this))},Lo.stop=function(){return this.b=this.a=null,this.g=[],this.c=null,this.i=[],this.j={},null!=this.f&&(t.clearTimeout(this.f),this.f=null),Promise.resolve()},Lo.update=function(){Gi(this).catch(function(t){this.a&&this.a.onError(t)}.bind(this))},Lo.onExpirationUpdated=function(){},Lo.ce=function(t,e){t.S=Zi(e,t.Z,null);var i=!1,n=Fe(e,"Role"),r=n.map(function(t){return t.getAttribute("value")}).filter(R),a=void 0;"text"==t.S.contentType&&(a="subtitle");for(var s=0;s<n.length;s++){var o=n[s].getAttribute("schemeIdUri");if(null==o||"urn:mpeg:dash:role:2011"==o)switch(o=n[s].getAttribute("value")){case"main":i=!0;break;case"caption":case"subtitle":a=o}}var u=null,c=!1;if(Fe(e,"EssentialProperty").forEach(function(t){"http://dashif.org/guidelines/trickmode"==t.getAttribute("schemeIdUri")?u=t.getAttribute("value"):c=!0}),c)return null;var n=Fe(e,"ContentProtection"),l=We(n,this.b.dash.customScheme,this.b.dash.ignoreDrmInfo),n=Zt(e.getAttribute("lang")||"und"),o=e.getAttribute("label"),s=Fe(e,"Representation"),r=s.map(this.fe.bind(this,t,l,a,n,o,i,r)).filter(function(t){return!!t});if(!r.length)throw new h(2,4,4003);return t.S.contentType&&"application"!=t.S.contentType||(t.S.contentType=an(r[0].mimeType,r[0].codecs),r.forEach(function(e){e.type=t.S.contentType})),r.forEach(function(t){l.drmInfos.forEach(function(e){t.keyId&&e.keyIds.push(t.keyId)})}),a=s.map(function(t){return t.getAttribute("id")}).filter(R),{id:t.S.id||"__fake__"+this.h++,contentType:t.S.contentType,language:n,Jb:i,streams:r,drmInfos:l.drmInfos,cc:u,qe:a}},Lo.fe=function(t,e,i,n,r,a,s,o){if(t.v=Zi(o,t.S,null),!en(t.v))return null;t.bandwidth=He(o,"bandwidth",Ye)||0;var u=this.re.bind(this);if(t.v.Ya)u=xi(t,u);else if(t.v.qa)u=Li(t,this.j);else if(t.v.Za)u=Oi(t,u,this.j,!!this.c);else{var h=t.v.aa,c=t.R.duration||0;u={createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(t){return 0<=t&&t<c?1:null},getSegmentReference:function(t){return 1!=t?null:new ui(1,0,c,function(){return h},0,null)},initSegmentReference:null,V:0}}return o=Fe(o,"ContentProtection"),o=Je(o,this.b.dash.customScheme,e,this.b.dash.ignoreDrmInfo),{id:this.h++,createSegmentIndex:u.createSegmentIndex,findSegmentPosition:u.findSegmentPosition,getSegmentReference:u.getSegmentReference,initSegmentReference:u.initSegmentReference,presentationTimeOffset:u.V,mimeType:t.v.mimeType,codecs:t.v.codecs,frameRate:t.v.frameRate,bandwidth:t.bandwidth,width:t.v.width,height:t.v.height,kind:i,encrypted:0<e.drmInfos.length,keyId:o,language:n,label:r,type:t.S.contentType,primary:a,trickModeVideo:null,containsEmsgBoxes:t.v.containsEmsgBoxes,roles:s,channelsCount:t.v.Nb}},Lo.Le=function(){this.f=null;var t=Date.now();Gi(this).then(function(){this.a&&Qi(this,(Date.now()-t)/1e3)}.bind(this)).catch(function(t){this.a&&(t.severity=1,this.a.onError(t),Qi(this,0))}.bind(this))},Lo.ee=function(t,e,i){var n=i.getAttribute("schemeIdUri")||"",r=i.getAttribute("value")||"",a=He(i,"timescale",ze)||1;Fe(i,"Event").forEach(function(i){var s=He(i,"presentationTime",ze)||0,o=He(i,"duration",ze)||0,s=s/a+t,o=s+o/a;null!=e&&(s=Math.min(s,t+e),o=Math.min(o,t+e)),i={schemeIdUri:n,value:r,startTime:s,endTime:o,id:i.getAttribute("id")||"",eventElement:i},this.a.onTimelineRegionAdded(i)}.bind(this))},Lo.re=function(t,e,i){return t=M(t,this.b.retryParameters),null!=e&&(t.headers.Range="bytes="+e+"-"+(null!=i?i:"")),this.a.networkingEngine.request(1,t).then(function(t){return t.data})},lu.mpd=qi,cu["application/dash+xml"]=qi,on.prototype.toString=function(){function t(t){return t.name+'="'+t.value+'"'}return this.value?"#"+this.name+":"+this.value:0<this.a.length?"#"+this.name+":"+this.a.map(t).join(","):"#"+this.name},on.prototype.getAttribute=function(t){var e=this.a.filter(function(e){return e.name==t});return e.length?e[0]:null};var fu="EXT-X-TARGETDURATION EXT-X-MEDIA-SEQUENCE EXT-X-DISCONTINUITY-SEQUENCE EXT-X-PLAYLIST-TYPE EXT-X-MAP EXT-X-I-FRAMES-ONLY EXT-X-ENDLIST".split(" "),du="EXTINF EXT-X-BYTERANGE EXT-X-DISCONTINUITY EXT-X-PROGRAM-DATE-TIME EXT-X-KEY EXT-X-DATERANGE".split(" ");e("shaka.net.DataUriPlugin",En),En.parse=function(e){var i=e.split(":");if(2>i.length||"data"!=i[0])throw new h(2,1,1004,e);if(i=i.slice(1).join(":").split(","),2>i.length)throw new h(2,1,1004,e);var n=i[0],i=t.decodeURIComponent(i.slice(1).join(",")),n=n.split(";"),r=null;if(1<n.length&&(r=n[1]),"base64"==r)e=ht(i).buffer;else{if(r)throw new h(2,1,1005,e);e=nt(i)}return{data:e,contentType:n[0]}},D("data",En),e("shaka.hls.HlsParser",Sn),Lo=Sn.prototype,Lo.configure=function(t){this.g=t},Lo.start=function(t,e){return this.c=e,this.l=t,Yn(this,t).then(function(e){return kn(this,e.data,t).then(function(){return zn(this,this.h),this.m}.bind(this))}.bind(this))},Lo.stop=function(){return this.g=this.c=null,this.u={},this.A={},this.m=null,Promise.resolve()},Lo.update=function(){if(this.f!=gu.na){var t,e=[];for(t in this.a)e.push(An(this,this.a[t],t));return Promise.all(e)}},Lo.onExpirationUpdated=function(){};var pu={audio:[/^vorbis$/,/^opus$/,/^flac$/,/^mp4a/,/^[ae]c-3$/],video:[/^avc/,/^hev/,/^hvc/,/^vp0?[89]/,/^av1$/],text:[/^vtt$/,/^wvtt/,/^stpp/]},mu={audio:{mp4:"audio/mp4",m4s:"audio/mp4",m4i:"audio/mp4",m4a:"audio/mp4",ts:"video/mp2t"},video:{mp4:"video/mp4",m4s:"video/mp4",m4i:"video/mp4",m4v:"video/mp4",ts:"video/mp2t"},text:{mp4:"application/mp4",m4s:"application/mp4",m4i:"application/mp4",vtt:"text/vtt",ttml:"application/ttml+xml"}};Sn.prototype.J=function(){this.c&&(this.i=null,this.update().then(function(){zn(this,this.h)}.bind(this)).catch(function(t){this.c&&(t.severity=1,this.c.onError(t),zn(this,0))}.bind(this)))};var yu={"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":function(t){if("SAMPLE-AES-CENC"!=Gn(t,"METHOD"))return null;var e=Gn(t,"URI"),e=En.parse(e),e=new Uint8Array(e.data),e=z("com.widevine.alpha",[{initDataType:"cenc",initData:e}]);return(t=hn(t,"KEYID"))&&(e.keyIds=[t.substr(2).toLowerCase()]),e}},vu="VOD",gu={na:vu,Vc:"EVENT",ec:"LIVE"};lu.m3u8=Sn,cu["application/x-mpegurl"]=Sn,cu["application/vnd.apple.mpegurl"]=Sn,Lo=Wn.prototype,Lo.destroy=function(){var t=this.b.destroy();return this.b=null,this.f&&(this.f.cancel(),this.f=null),this.h&&(this.h.cancel(),this.h=null),this.g&&(this.g.cancel(),this.g=null),this.J=this.K=this.l=this.c=this.a=null,t},Lo.Eb=function(){return this.i},Lo.Qb=function(){this.u=!0,this.Ac()},Lo.Qd=function(){var t=this.j||0>this.i?0:this.i;this.a.playbackRate&&this.a.playbackRate!=t&&er(this,this.a.playbackRate)},Lo.yc=function(){var t=tr(this);this.b.ga(this.a,"timeupdate"),this.g.cancel(),.001>Math.abs(this.a.currentTime-t)?(H(this.b,this.a,"seeking",this.Bc.bind(this)),H(this.b,this.a,"playing",this.zc.bind(this))):(K(this.b,this.a,"seeking",this.Sd.bind(this)),this.a.currentTime=t)},Lo.Sd=function(){H(this.b,this.a,"seeking",this.Bc.bind(this)),H(this.b,this.a,"playing",this.zc.bind(this))},Lo.Ac=function(){if(this.a.readyState&&!this.a.paused){this.a.readyState!=this.F&&(this.s=!1,this.F=this.a.readyState);var t=this.l.smallGapLimit,e=this.a.currentTime,i=this.a.buffered,n=this.c.presentationTimeline.ja();if(e<n)i=ir(this,e),nr(this,e,i);else{t:{if(i&&i.length&&!(1==i.length&&1e-6>i.end(0)-i.start(0))){n=.1,/(Edge\/|Trident\/|Tizen)/.test(navigator.userAgent)&&(n=.5);for(var r=0;r<i.length;r++)if(i.start(r)>e&&(!r||i.end(r-1)-e<=n)){n=r;break t}}n=null}if(null==n){if(3>this.a.readyState&&0<this.a.playbackRate)if(this.A!=e)this.A=e,this.W=Date.now(),this.w=!1;else if(!this.w&&this.W<Date.now()-1e3)for(t=0;t<i.length;t++)if(e>=i.start(t)&&e<i.end(t)-.5){this.a.currentTime+=.1,this.A=this.a.currentTime,this.w=!0;break}}else if(n||this.u){var r=i.start(n),a=this.c.presentationTimeline.pb();if(!(r>=a)){var a=r-e,t=a<=t,s=!1;t||this.s||(this.s=!0,a=new X("largegap",{currentTime:e,gapSize:a}),a.cancelable=!0,this.J(a),this.l.jumpLargeGaps&&!a.defaultPrevented&&(s=!0)),(t||s)&&(n&&i.end(n-1),nr(this,e,r))}}}}},Lo.Dd=function(){this.m=ir(this,this.a.currentTime)},Lo.Bc=function(){this.u=!1;var t=this.a.currentTime,e=ir(this,t);.001<Math.abs(e-t)?nr(this,t,e):(this.s=!1,this.K())},Lo.zc=function(){var t=this.a.currentTime,e=ir(this,t);.001<Math.abs(e-t)&&nr(this,t,e)},ar.prototype.destroy=function(){var t=this.j?this.j.destroy():Promise.resolve();return this.j=null,ur(this),this.A=this.h=this.l=this.u=this.g=this.w=this.a=null,this.c=[],t},ar.prototype.s=function(t){if(!this.c.some(function(e){return e.info.schemeIdUri==t.schemeIdUri&&e.info.startTime==t.startTime&&e.info.endTime==t.endTime})){var e={info:t,status:1};this.c.push(e);var i=new X("timelineregionadded",{detail:sr(t)});this.h(i),this.m(!0,e)}},ar.prototype.m=function(t,e){var i=e.info.startTime>this.a.currentTime?1:e.info.endTime<this.a.currentTime?3:2,n=2==e.status,r=2==i;i!=e.status&&((!t||n||r)&&(n||this.h(new X("timelineregionenter",{detail:sr(e.info)})),r||this.h(new X("timelineregionexit",{detail:sr(e.info)}))),e.status=i)},ar.prototype.F=function(){this.f=null,or(this);var t=be(this.g,this.a.currentTime);t!=this.i&&(-1!=this.i&&this.A(),this.i=t);var t=Mt(this.a.buffered,this.a.currentTime),e=Lt(this.a.buffered),i=this.g.presentationTimeline,n=i.va(),e=i.P()&&e>=n,i="ended"==this.w.readyState,e=e||this.a.ended||i;this.b?(i=1*Math.max(this.g.minBufferTime||0,this.u.rebufferingGoal),(e||t>=i)&&0!=this.b&&(this.b=!1,this.l(!1))):!e&&.5>t&&1!=this.b&&(this.b=!0,this.l(!0)),this.c.forEach(this.m.bind(this,!1))},Lo=hr.prototype,Lo.destroy=function(){for(var t in this.c)Br(this.c[t]);return this.h=this.c=this.j=this.g=this.m=this.b=this.a=null,this.f=!0,Promise.resolve()},Lo.configure=function(t){this.h=t,this.A=new T({maxAttempts:Math.max(t.retryParameters.maxAttempts,2),baseDelay:t.retryParameters.baseDelay,backoffFactor:t.retryParameters.backoffFactor,fuzzFactor:t.retryParameters.fuzzFactor,timeout:0},!0)},Lo.init=function(){var t=Zn(this.a.Ka),t=this.a.tc(this.b.periods[be(this.b,t)]);return t.variant||t.text?wr(this,t).then(function(){this.a&&this.a.Hd&&this.a.Hd()}.bind(this)):Promise.reject(new h(2,5,5005))},Lo.Ne=function(t){if(!this.f&&!t.ya&&null!=t.ra&&!t.ta)if(t.ra=null,t.sa)Ur(this,t,t.wb);else{try{var e=Ir(this,t);null!=e&&(jr(this,t,e),t.Ua=!1)}catch(t){return void Fr(this,t)}e=W(this.c),Mr(this,t),e.every(function(t){return t.endOfStream})&&this.a.L.endOfStream().then(function(){this.b.presentationTimeline.fa(this.a.L.T())}.bind(this))}},Lo.de=function(t,e,i){var n=i.o.Tb(),r=i.o.Tb(),a=i.o.B(),s=i.o.B(),o=i.o.B(),u=i.o.B(),h=i.o.Ma(i.o.G.byteLength-i.o.U());t=t.startTime+e.startTime+s/a,"urn:mpeg:dash:event:2012"==n?this.a.Jd():this.a.onEvent(new X("emsg",{detail:{startTime:t,endTime:t+o/a,schemeIdUri:n,value:r,timescale:a,presentationTimeDelta:s,eventDuration:o,id:u,messageData:h}})),i.oa.stop()},e("shaka.net.HttpPlugin",Vr),D("http",Vr,1),D("https",Vr,1),Gr.prototype.a=function(t){t.createObjectStore("manifest-v2",{autoIncrement:!0}),t.createObjectStore("segment-v2",{autoIncrement:!0})},Xr.prototype.a=function(t,e){function i(){o.clear(),s.clear()}function n(t,e,i){e=Yr(e),a.add(e,t).onsuccess=i}var r=t.createObjectStore("segment-v2"),a=t.createObjectStore("manifest-v2"),s=e.objectStore("segment"),o=e.objectStore("manifest");Hr(s,function(t,e,i){r.add({data:e.data},t).onsuccess=i},function(){Hr(o,n,i)})},Qr.prototype.init=function(t){var e=this.c;return Promise.resolve().then(function(){return Kr(e,t)}).then(function(t){this.b=t}.bind(this))},Qr.prototype.destroy=function(){return Promise.all(this.a.map(function(t){try{t.transaction.abort()}catch(t){}return t.M.catch(x)})).then(function(){this.b&&(this.b.close(),this.b=null)}.bind(this))},Qr.prototype.Ea=function(t){return ta(this,"manifest-v2",t)},oa.prototype.destroy=function(){var t=this.h,e=this.i,i=this.g||Promise.resolve();return e.length&&(i=i.then(function(){return ra(t,"segment-v2",e,null)})),this.b={},this.i=[],this.g=this.a=this.m=this.j=this.h=null,i},oa.prototype.s=function(t){this.c+=null==t.D?t.gc:t.D-t.N+1},Lo=ka.prototype,Lo.configure=function(){},Lo.start=function(t){var e=da(t);if(null==e)return Promise.reject(new h(2,1,9004,t));this.a=e;var i;return Aa().then(function(t){return i=t,i.Ea(e)}.bind(this)).then(function(t){if(!t)throw new h(2,9,9003,e);return Ia(t)}).then(function(t){return i.destroy().then(function(){return t})},function(t){return i.destroy().then(function(){throw t})})},Lo.stop=function(){return Promise.resolve()},Lo.update=function(){},Lo.onExpirationUpdated=function(t,e){var i,n=this.a;Aa().then(function(t){return i=t,i.Ea(n)}).then(function(r){if(r&&!(0>r.sessionIds.indexOf(t))&&(void 0==r.expiration||r.expiration>e))return r.expiration=e,ia(i,n,r)}).catch(function(){}).then(function(){return i.destroy()})},cu["application/x-offline-manifest"]=ka,e("shaka.offline.OfflineScheme",_a),_a.a=function(t){return t={uri:t,data:new ArrayBuffer(0),headers:{"content-type":"application/x-offline-manifest"}},Promise.resolve(t)},_a.b=function(t,e){var i,n;return Aa().then(function(e){return i=e,ta(i,"segment-v2",t)}).then(function(t){return n=t,i.destroy()}).then(function(){if(!n)throw new h(2,9,9003,t);return{uri:e,data:n.data,headers:{}}})},D("offline",_a),e("shaka.text.SimpleTextDisplayer",Pa),Pa.prototype.remove=function(t,e){return!!this.a&&(Ra(this,function(i){return!(i.startTime>=e||i.endTime<=t)}),!0)},Pa.prototype.remove=Pa.prototype.remove,Pa.prototype.append=function(t){for(var e=[],i=0;i<t.length;i++){var n=xa(t[i]);n&&e.push(n)}e.slice().sort(function(t,i){return t.startTime!=i.startTime?t.startTime-i.startTime:t.endTime!=i.endTime?t.endTime-i.startTime:e.indexOf(i)-e.indexOf(t)}).forEach(function(t){this.a.addCue(t)}.bind(this))},Pa.prototype.append=Pa.prototype.append,Pa.prototype.destroy=function(){return this.a&&Ra(this,function(){return!0}),this.a=null,Promise.resolve()},Pa.prototype.destroy=Pa.prototype.destroy,Pa.prototype.isTextVisible=function(){return"showing"==this.a.mode},Pa.prototype.isTextVisible=Pa.prototype.isTextVisible,Pa.prototype.setTextVisibility=function(t){this.a.mode=t?"showing":"hidden"},Pa.prototype.setTextVisibility=Pa.prototype.setTextVisibility,Na.prototype.then=function(t){return this.a=this.a.then(t).then(function(t){return this.b?(this.g(),Promise.reject(this.h)):Promise.resolve(t)}.bind(this)),this},Na.prototype.cancel=function(t){return this.c?Promise.resolve():(this.b=!0,this.h=t,this.j.forEach(function(t){t()}),this.i)},i(Da),e("shaka.Player",Da),Da.prototype.destroy=function(){return this.F=!0,Ma(this).then(function(){var t=Promise.all([this.Ta,Ha(this),this.m?this.m.destroy():null,this.s?this.s.destroy():null]);return this.f=null,this.lb=!1,this.c=this.s=this.h=this.m=null,t}.bind(this))},Da.prototype.destroy=Da.prototype.destroy,Da.version="v2.3.0";var bu={};Da.registerSupportPlugin=function(t,e){bu[t]=e},Da.isBrowserSupported=function(){return!!(t.Promise&&t.Uint8Array&&Array.prototype.forEach&&t.MediaSource&&MediaSource.isTypeSupported&&t.MediaKeys&&t.navigator&&t.navigator.requestMediaKeySystemAccess&&t.MediaKeySystemAccess&&t.MediaKeySystemAccess.prototype.getConfiguration)},Da.probeSupport=function(){return xt().then(function(t){t={manifest:Vi(),media:Ht(),drm:t};for(var e in bu)t[e]=bu[e]();return t})},Da.prototype.load=function(t,e,i){var n=this.vb(),r=new Na;this.ha=r,this.dispatchEvent(new X("loading"));var a=Date.now();return La(r.then(function(){return n}).then(function(){return this.j=Xa(),H(this.m,this.f,"playing",this.ab.bind(this)),H(this.m,this.f,"pause",this.ab.bind(this)),H(this.m,this.f,"ended",this.ab.bind(this)),this.h=new this.c.abrFactory,this.h.configure(this.c.abr),this.u=new this.c.textDisplayFactory,this.u.setTextVisibility(this.lb),Hi(t,this.s,this.c.manifest.retryParameters,i)}.bind(this)).then(function(e){return this.i=new e,this.i.configure(this.c.manifest),this.i.start(t,{networkingEngine:this.s,filterNewPeriod:this.mb.bind(this),filterAllPeriods:this.$b.bind(this),onTimelineRegionAdded:this.Xd.bind(this),onEvent:this.$a.bind(this),onError:this.Pa.bind(this)})}.bind(this)).then(function(e){if(e.periods.some(function(t){return t.variants.some(function(t){return t.video&&t.audio})})&&e.periods.forEach(function(t){t.variants=t.variants.filter(function(t){return t.video&&t.audio})}),0==e.periods.length)throw new h(2,4,4014);return this.b=e,this.yb=t,this.l=new pt({Wa:this.s,onError:this.Pa.bind(this),Pb:this.Id.bind(this),onExpirationUpdated:this.Fd.bind(this),onEvent:this.$a.bind(this)}),this.l.configure(this.c.drm),this.l.init(e,!1)}.bind(this)).then(function(){this.$b(this.b.periods),this.fb=Date.now()/1e3,this.Qa=this.c.preferredAudioLanguage,this.Ra=this.c.preferredTextLanguage;var t=this.b.presentationTimeline.T(),e=this.c.playRangeEnd,i=this.c.playRangeStart;return 0<i&&(this.P()||this.b.presentationTimeline.Oc(i)),e<t&&(this.P()||this.b.presentationTimeline.fa(e)),Promise.all([mt(this.l,this.f),this.ib])}.bind(this)).then(function(){return this.h.init(this.Ge.bind(this)),this.g=new Wn(this.f,this.b,this.c.streaming,void 0==e?null:e,this.Ee.bind(this),this.$a.bind(this)),this.w=new ar(this.f,this.K,this.b,this.c.streaming,this.Rc.bind(this),this.$a.bind(this),this.De.bind(this)),this.J=new Vt(this.f,this.K,this.u),this.a=new hr(this.b,{Ka:this.g,L:this.J,Wa:this.s,tc:this.Cd.bind(this),sc:this.ad.bind(this),onError:this.Pa.bind(this),onEvent:this.$a.bind(this),Jd:this.Kd.bind(this),Qb:this.Td.bind(this),filterNewPeriod:this.mb.bind(this),filterAllPeriods:this.$b.bind(this)}),this.a.configure(this.c.streaming),this.dispatchEvent(new X("streaming")),Ca(this),this.a.init()}.bind(this)).then(function(){if(this.c.streaming.startAtSegmentBoundary){var t=$a(this,Zn(this.g));Jn(this.g,t)}this.b.periods.forEach(this.mb.bind(this)),Za(this),Qa(this);var t=cr(this.a),e=de(t,this.Qa,this.cb);this.h.setVariants(e),t.variants.some(function(t){return t.primary}),this.jb.forEach(this.w.s.bind(this.w)),this.jb=[],K(this.m,this.f,"loadeddata",function(){this.j.loadLatency=(Date.now()-a)/1e3}.bind(this)),this.ha=null}.bind(this))).catch(function(t){return this.ha==r&&(this.ha=null,this.dispatchEvent(new X("unloading"))),Promise.reject(t)}.bind(this))},Da.prototype.load=Da.prototype.load,Da.prototype.configure=function(t){k(this.c,t,Ga(this),qa(),""),Ua(this)},Da.prototype.configure=Da.prototype.configure,Da.prototype.getConfiguration=function(){var t=Ga(this);return k(t,this.c,Ga(this),qa(),""),t},Da.prototype.getConfiguration=Da.prototype.getConfiguration,Da.prototype.se=function(){this.c=Ga(this),Ua(this)},Da.prototype.resetConfiguration=Da.prototype.se,Da.prototype.nd=function(){return this.f},Da.prototype.getMediaElement=Da.prototype.nd,Da.prototype.oc=function(){return this.s},Da.prototype.getNetworkingEngine=Da.prototype.oc,Da.prototype.nc=function(){return this.yb},Da.prototype.getManifestUri=Da.prototype.nc,Da.prototype.P=function(){return!!this.b&&this.b.presentationTimeline.P()},Da.prototype.isLive=Da.prototype.P,Da.prototype.wa=function(){return!!this.b&&this.b.presentationTimeline.wa()},Da.prototype.isInProgress=Da.prototype.wa,Da.prototype.yd=function(){if(!this.b||!this.b.periods.length)return!1;var t=this.b.periods[0].variants;return!!t.length&&!t[0].video},Da.prototype.isAudioOnly=Da.prototype.yd,Da.prototype.ue=function(){var t=0,e=0;return this.b&&(e=this.b.presentationTimeline,t=e.ja(),e=e.pb()),{start:t,end:e}},Da.prototype.seekRange=Da.prototype.ue,Da.prototype.keySystem=function(){return this.l?this.l.keySystem():""},Da.prototype.keySystem=Da.prototype.keySystem,Da.prototype.drmInfo=function(){return this.l?this.l.b:null},Da.prototype.drmInfo=Da.prototype.drmInfo,Da.prototype.ob=function(){return this.l?this.l.ob():1/0},Da.prototype.getExpiration=Da.prototype.ob,Da.prototype.rc=function(){return this.kb},Da.prototype.isBuffering=Da.prototype.rc,Da.prototype.vb=function(){return this.F?Promise.resolve():(this.dispatchEvent(new X("unloading")),Ma(this).then(function(){return this.Ta||(this.Ta=Ka(this).then(function(){this.Ta=null}.bind(this))),this.Ta}.bind(this)))},Da.prototype.unload=Da.prototype.vb,Da.prototype.Eb=function(){return this.g?this.g.Eb():0},Da.prototype.getPlaybackRate=Da.prototype.Eb,Da.prototype.Qe=function(t){this.g&&er(this.g,t),this.a&&yr(this.a,1!=t)},Da.prototype.trickPlay=Da.prototype.Qe,Da.prototype.bd=function(){this.g&&er(this.g,1),this.a&&yr(this.a,!1)},Da.prototype.cancelTrickPlay=Da.prototype.bd,Da.prototype.wd=function(){if(!this.b||!this.g)return[];var t=be(this.b,Zn(this.g)),e=this.A[t]||{};return oe(this.b.periods[t],e.audio,e.video)},Da.prototype.getVariantTracks=Da.prototype.wd,Da.prototype.vd=function(){if(!this.b||!this.g)return[];var t=be(this.b,Zn(this.g));return ue(this.b.periods[t],(this.A[t]||{}).text).filter(function(t){return 0>this.gb.indexOf(t.id)}.bind(this))},Da.prototype.getTextTracks=Da.prototype.vd,Da.prototype.xe=function(t){if(this.a){(t=ce(cr(this.a),t))&&(Fa(this,t,!1),this.Ca?this.W=t:gr(this.a,t,!0))}},Da.prototype.selectTextTrack=Da.prototype.xe,Da.prototype.ye=function(t,e){if(this.a){this.c.abr.enabled&&o("Changing tracks while abr manager is enabled will likely result in the selected track being overriden. Consider disabling abr before calling selectVariantTrack().");var i=cr(this.a);(i=he(i,t))&&le(i)&&(Ba(this,i,!1),Ya(this,i,e))}},Da.prototype.selectVariantTrack=Da.prototype.ye,Da.prototype.kd=function(){if(!this.a)return[];var t=cr(this.a),t=fe(t.variants).map(function(t){return t.audio}).filter(N);return ja(t)},Da.prototype.getAudioLanguagesAndRoles=Da.prototype.kd,Da.prototype.ud=function(){return this.a?ja(cr(this.a).textStreams):[]},Da.prototype.getTextLanguagesAndRoles=Da.prototype.ud,Da.prototype.jd=function(){return this.a?fe(cr(this.a).variants).map(function(t){return t.language}).filter(N):[]},Da.prototype.getAudioLanguages=Da.prototype.jd,Da.prototype.td=function(){return this.a?cr(this.a).textStreams.map(function(t){return t.language}).filter(N):[]},Da.prototype.getTextLanguages=Da.prototype.td,Da.prototype.ve=function(t,e){if(this.a){var i=cr(this.a);this.Qa=t,this.cb=e||"",Ja(this,i)}},Da.prototype.selectAudioLanguage=Da.prototype.ve,Da.prototype.we=function(t,e){if(this.a){var i=cr(this.a);this.Ra=t,this.bb=e||"",Ja(this,i)}},Da.prototype.selectTextLanguage=Da.prototype.we,Da.prototype.Ib=function(){return this.u?this.u.isTextVisible():this.lb},Da.prototype.isTextTrackVisible=Da.prototype.Ib,Da.prototype.Be=function(t){this.u&&this.u.setTextVisibility(t),this.lb=t,ts(this),this.a&&(t?(t=cr(this.a),t=pe(t,this.Ra,this.bb)[0],mr(this.a,t)):(t=this.a,t.w=!0,t.c.text&&(Br(t.c.text),delete t.c.text)))},Da.prototype.setTextTrackVisibility=Da.prototype.Be,Da.prototype.pd=function(){return this.b?new Date(1e3*this.b.presentationTimeline.c+1e3*this.f.currentTime):null},Da.prototype.getPlayheadTimeAsDate=Da.prototype.pd,Da.prototype.rd=function(){return this.b?new Date(1e3*this.b.presentationTimeline.c):null},Da.prototype.getPresentationStartTimeAsDate=Da.prototype.rd,Da.prototype.Cb=function(){return this.J?this.J.Cb():{total:[],audio:[],video:[],text:[]}},Da.prototype.getBufferedInfo=Da.prototype.Cb,Da.prototype.getStats=function(){za(this),this.ab();var t=null,e=null,i=this.f,i=i&&i.getVideoPlaybackQuality?i.getVideoPlaybackQuality():{};if(this.g&&this.b){var n=be(this.b,Zn(this.g)),r=this.b.periods[n];(n=this.A[n])&&(e=ge(n.audio,n.video,r.variants),t=e.video||{})}return t||(t={}),e||(e={}),{width:t.width||0,height:t.height||0,streamBandwidth:e.bandwidth||0,decodedFrames:Number(i.totalVideoFrames),droppedFrames:Number(i.droppedVideoFrames),estimatedBandwidth:this.h?this.h.getBandwidthEstimate():NaN,loadLatency:this.j.loadLatency,playTime:this.j.playTime,bufferingTime:this.j.bufferingTime,switchHistory:I(this.j.switchHistory),stateHistory:I(this.j.stateHistory)}},Da.prototype.getStats=Da.prototype.getStats,Da.prototype.addTextTrack=function(t,e,i,n,r,a){if(!this.a)return Promise.reject();for(var s,o=cr(this.a),u=0;u<this.b.periods.length;u++)if(this.b.periods[u]==o){if(u==this.b.periods.length-1){if(s=this.b.presentationTimeline.T()-o.startTime,1/0==s)return Promise.reject()}else s=this.b.periods[u+1].startTime-o.startTime;break}var h={id:this.Yc++,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(){return 1},getSegmentReference:function(e){return 1!=e?null:new ui(1,0,s,function(){return[t]},0,null)},initSegmentReference:null,presentationTimeOffset:0,mimeType:n,codecs:r||"",kind:i,encrypted:!1,keyId:null,language:e,label:a||null,type:"text",primary:!1,trickModeVideo:null,containsEmsgBoxes:!1,roles:[],channelsCount:null};return this.gb.push(h.id),o.textStreams.push(h),mr(this.a,h).then(function(){if(!this.F){var t=this.b.periods.indexOf(o),n=pr(this.a,"text");return n&&(this.A[t].text=n.id),this.gb.splice(this.gb.indexOf(h.id),1),Ja(this,o),Za(this),{id:h.id,active:!1,type:"text",bandwidth:0,language:e,label:a||null,kind:i,width:null,height:null}}}.bind(this))},Da.prototype.addTextTrack=Da.prototype.addTextTrack,Da.prototype.Yb=function(t,e){this.hb.width=t,this.hb.height=e},Da.prototype.setMaxHardwareResolution=Da.prototype.Yb,Da.prototype.Kc=function(){if(this.a){var t=this.a;if(t.f)t=!1;else if(t.l)t=!1;else{for(var e in t.c){var i=t.c[e];i.Ua&&(i.Ua=!1,jr(t,i,.1))}t=!0}}else t=!1;return t},Da.prototype.retryStreaming=Da.prototype.Kc,Da.prototype.Ea=function(){return this.b},Da.prototype.getManifest=Da.prototype.Ea,Lo=Da.prototype,Lo.ed=function(t){var e=[1001,1002,1003];this.P()&&0<=e.indexOf(t.code)&&(t.severity=1,this.Kc())},Lo.$b=function(t){t.forEach(ie.bind(null,this.l,this.a?fr(this.a):null,this.a?dr(this.a):null));var e=B(t,function(t){return t.variants.some(le)});if(!e)throw new h(2,4,9009);if(e<t.length)throw new h(2,4,4011);t.forEach(function(t){if(ee(t,this.c.restrictions,this.hb)&&this.a&&cr(this.a)==t&&Za(this),!t.variants.some(le))throw new h(2,4,4012)}.bind(this))},Lo.mb=function(t){ie(this.l,this.a?fr(this.a):null,this.a?dr(this.a):null,t);var e=t.variants,i=e.some(le);if(ee(t,this.c.restrictions,this.hb)&&this.a&&cr(this.a)==t&&Za(this),t=e.some(le),!i)throw new h(2,4,4011);if(!t)throw new h(2,4,4012)},Lo.Fe=function(t,e){this.h&&this.h.segmentDownloaded(t,e)},Lo.Rc=function(t){if(za(this),this.kb=t,this.ab(),this.g){var e=this.g;t!=e.j&&(e.j=t,er(e,e.i))}this.dispatchEvent(new X("buffering",{buffering:t}))},Lo.De=function(){Za(this)},Lo.ab=function(){if(!this.F){var t=this.kb?"buffering":this.f.ended?"ended":this.f.paused?"paused":"playing",e=Date.now()/1e3;if(this.j.stateHistory.length){var i=this.j.stateHistory[this.j.stateHistory.length-1];if(i.duration=e-i.timestamp,t==i.state)return}this.j.stateHistory.push({timestamp:e,state:t,duration:0})}},Lo.Ee=function(){if(this.w){var t=this.w;t.c.forEach(t.m.bind(t,!0))}this.a&&br(this.a)},Lo.Cd=function(t){this.Ca=!0,this.h.disable();var e={audio:!1,text:!1},i=de(t,this.Qa,this.cb,e);return t=pe(t,this.Ra,this.bb,e),i=Wa(this,i),t=t[0]||null,this.W=this.Sa=null,i&&Ba(this,i,!0),t&&(Fa(this,t,!0),!lr(this.a)&&i&&i.audio&&e.text&&t.language!=i.audio.language&&(this.u.setTextVisibility(!0),ts(this))),this.Ib()?{variant:i,text:t}:{variant:i,text:null}},Lo.ad=function(){this.Ca=!1,this.c.abr.enabled&&this.h.enable(),this.Sa&&(vr(this.a,this.Sa,this.fc),this.Sa=null),this.W&&(gr(this.a,this.W,!0),this.W=null)},Lo.Kd=function(){this.i&&this.i.update&&this.i.update()},Lo.Td=function(){this.g&&this.g.Qb()},Lo.Ge=function(t,e){Ba(this,t,!0),this.a&&(vr(this.a,t,e||!1),Qa(this))},Lo.Pa=function(t){if(!this.F){var e=new X("error",{detail:t});this.dispatchEvent(e),e.defaultPrevented&&(t.handled=!0)}},Lo.Xd=function(t){this.w?this.w.s(t):this.jb.push(t)},Lo.$a=function(t){this.dispatchEvent(t)},Lo.Yd=function(){if(this.f.error){var t=this.f.error.code;if(1!=t){var e=this.f.error.msExtendedCode;e&&(0>e&&(e+=Math.pow(2,32)),e=e.toString(16)),this.Pa(new h(2,3,3016,t,e,this.f.error.message))}}},Lo.Id=function(t){var e=["output-restricted","internal-error"],i=cr(this.a),n=!1,r=Object.keys(t),a=1==r.length&&"00"==r[0];r.length&&i.variants.forEach(function(i){var r=[];i.audio&&r.push(i.audio),i.video&&r.push(i.video),r.forEach(function(r){var s=i.allowedByKeySystem;r.keyId&&(r=t[a?"00":r.keyId],i.allowedByKeySystem=!!r&&0>e.indexOf(r)),s!=i.allowedByKeySystem&&(n=!0)})}),(r=ve(fr(this.a),dr(this.a),i.variants))&&!r.allowedByKeySystem&&Ja(this,i),n&&Za(this)},Lo.Fd=function(t,e){this.i&&this.i.onExpirationUpdated&&this.i.onExpirationUpdated(t,e),this.dispatchEvent(new X("expirationupdated"))},e("shaka.offline.Storage",es),es.support=is,es.prototype.destroy=function(){var t=this.g,e=this.c?this.c.destroy().catch(function(){}).then(function(){if(t)return t.destroy()}):Promise.resolve();return this.b=this.a=this.c=this.g=null,e},es.prototype.destroy=es.prototype.destroy,es.prototype.configure=function(t){k(this.b,t,os(this),{},"")},es.prototype.configure=es.prototype.configure,es.prototype.Oe=function(t,e,i){function n(t){a=t}if(this.l)return Promise.reject(new h(2,9,9006));this.l=!0;var r=e||{},a=null;return us(this).then(function(){return ps(this),ss(this,t,n,i)}.bind(this)).then(function(e){if(ps(this),a)throw a;return ns(this,t,e.manifest,r,e.fd)}.bind(this)).then(function(t){return ps(this),hs(this).then(function(){return t})}.bind(this)).catch(function(t){return a=a||t,hs(this).then(function(){throw a})}.bind(this))},es.prototype.store=es.prototype.Oe,es.prototype.remove=function(t){return t.offlineUri?(o("Removing downloaded content using shakaExtern.StoredContent is deprecated. Please remove using the offline uri."),rs(this,t.offlineUri)):rs(this,t)},es.prototype.remove=es.prototype.remove,es.prototype.list=function(){var t=[];return us(this).then(function(){return ps(this),Zr(this.g,function(e,i){var n=ma("offline:manifest/"+e,i);t.push(n)})}.bind(this)).then(function(){return t})},es.prototype.list=es.prototype.list,es.prototype.u=function(t){for(var e,i=[],n=Zt(this.a.getConfiguration().preferredAudioLanguage),r=[0,qo,Go],a=t.filter(function(t){return"variant"==t.type}),r=r.map(function(t){return a.filter(function(e){return e=Zt(e.language),Qt(t,n,e)})}),s=0;s<r.length;s++)if(r[s].length){e=r[s];break}e||(r=a.filter(function(t){return t.primary}),r.length&&(e=r)),e||(e=a,a.map(function(t){return t.language}).filter(N));var o=e.filter(function(t){return t.height&&480>=t.height});return o.length&&(o.sort(function(t,e){return e.height-t.height}),e=o.filter(function(t){return t.height==o[0].height})),e.sort(function(t,e){return t.bandwidth-e.bandwidth}),e.length&&i.push(e[Math.floor(e.length/2)]),i.push.apply(i,t.filter(function(t){return"text"==t.type})),i},es.prototype.j=function(t){t.forEach(this.m.bind(this))},es.prototype.m=function(t){var e=null;if(this.i){var i=this.i.filter(function(t){return"variant"==t.type})[0];i&&(e=he(t,i))}var n=i=null;e&&(e.audio&&(i=e.audio),e.video&&(n=e.video)),ie(this.f,i,n,t),ee(t,this.a.getConfiguration().restrictions,{width:1/0,height:1/0})},es.prototype.w=function(t){var e,i,n=oe(t,null,null),r=ue(t,null),n=this.b.trackSelectionCallback(n.concat(r));for(this.i||(this.i=n,this.j(this.h.periods)),r=n.length-1;0<r;--r){var a=!1;for(i=r-1;0<=i;--i)if(n[r].type==n[i].type&&n[r].kind==n[i].kind&&n[r].language==n[i].language){a=!0;break}if(a)break}for(a=[],r=0;r<n.length;r++)(e=he(t,n[r]))?(e.audio&&((i=a.filter(function(t){return t.id==e.audio.id})[0])?i.variantIds.push(e.id):(i=e.video?e.bandwidth/2:e.bandwidth,a.push(fs(this,e.audio,i,e.id)))),e.video&&((i=a.filter(function(t){return t.id==e.video.id})[0])?i.variantIds.push(e.id):(i=e.audio?e.bandwidth/2:e.bandwidth,a.push(fs(this,e.video,i,e.id))))):a.push(fs(this,ce(t,n[r]),0));return{startTime:t.startTime,streams:a}},bu.offline=is,e("shaka.polyfill.installAll",function(){for(var t=0;t<Tu.length;++t)Tu[t]()});var Tu=[];e("shaka.polyfill.register",ys),ys(function(){if(t.Document){var e=Element.prototype;e.requestFullscreen=e.requestFullscreen||e.mozRequestFullScreen||e.msRequestFullscreen||e.webkitRequestFullscreen,e=Document.prototype,e.exitFullscreen=e.exitFullscreen||e.mozCancelFullScreen||e.msExitFullscreen||e.webkitExitFullscreen,"fullscreenElement"in document||(Object.defineProperty(document,"fullscreenElement",{get:function(){return document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement}}),Object.defineProperty(document,"fullscreenEnabled",{get:function(){return document.mozFullScreenEnabled||document.msFullscreenEnabled||document.webkitFullscreenEnabled}})),document.addEventListener("webkitfullscreenchange",vs),document.addEventListener("webkitfullscreenerror",vs),document.addEventListener("mozfullscreenchange",vs),document.addEventListener("mozfullscreenerror",vs),document.addEventListener("MSFullscreenChange",vs),document.addEventListener("MSFullscreenError",vs)}}),ys(function(){var e=navigator.userAgent;e&&0<=e.indexOf("CrKey")&&delete t.indexedDB});var wu;ys(function(){0>navigator.userAgent.indexOf("Trident/")||HTMLInputElement.prototype.addEventListener==gs||(wu=HTMLInputElement.prototype.addEventListener,HTMLInputElement.prototype.addEventListener=gs)}),ys(function(){if(4503599627370497!=Math.round(4503599627370497)){var t=Math.round;Math.round=function(e){var i=e;return 4503599627370496>=e&&(i=t(e)),i}}}),bs.prototype.c=function(t){if(!(1<t.version)){var e=lt(t.o.Ma(16)),i=[];if(0<t.version)for(var n=t.o.B(),r=0;r<n;++r){var a=lt(t.o.Ma(16));i.push(a)}n=t.o.B(),t.o.H(n),this.b.push.apply(this.b,i),this.f.push(e),this.a.push({start:t.start,end:t.start+t.size-1})}},ws.prototype.createMediaKeys=function(){var t=new Ss(this.keySystem);return Promise.resolve(t)},ws.prototype.getConfiguration=function(){return this.a},Ss.prototype.createSession=function(t){if("temporary"!=(t||"temporary"))throw new TypeError("Session type "+t+" is unsupported on this platform.");return new ks(this.a)},Ss.prototype.setServerCertificate=function(){return Promise.resolve(!1)},i(ks),Lo=ks.prototype,Lo.generateRequest=function(t,e){this.a=new b;try{this.c=this.g.createSession("video/mp4",new Uint8Array(e),null),H(this.f,this.c,"mskeymessage",this.Od.bind(this)),H(this.f,this.c,"mskeyadded",this.Md.bind(this)),H(this.f,this.c,"mskeyerror",this.Nd.bind(this)),Ps(this,"status-pending")}catch(t){this.a.reject(t)}return this.a},Lo.load=function(){return Promise.reject(Error("MediaKeySession.load not yet supported"))},Lo.update=function(t){this.b=new b;try{this.c.update(new Uint8Array(t))}catch(t){this.b.reject(t)}return this.b},Lo.close=function(){try{this.c.close(),this.closed.resolve(),q(this.f)}catch(t){this.closed.reject(t)}return this.closed},Lo.remove=function(){return Promise.reject(Error("MediaKeySession.remove is only applicable for persistent licenses, which are not supported on this platform"))},Lo.Od=function(t){this.a&&(this.a.resolve(),this.a=null),this.dispatchEvent(new X("message",{messageType:void 0==this.keyStatuses.a?"licenserequest":"licenserenewal",message:t.message.buffer}))},Lo.Md=function(){this.a?(Ps(this,"usable"),this.a.resolve(),this.a=null):this.b&&(Ps(this,"usable"),this.b.resolve(),this.b=null)},Lo.Nd=function(){var t=Error("EME PatchedMediaKeysMs key error");if(t.errorCode=this.c.error,this.a)this.a.reject(t),this.a=null;else if(this.b)this.b.reject(t),this.b=null;else switch(this.c.error.code){case MSMediaKeyError.MS_MEDIA_KEYERR_OUTPUT:case MSMediaKeyError.MS_MEDIA_KEYERR_HARDWARECHANGE:Ps(this,"output-not-allowed");default:Ps(this,"internal-error")}};var Eu;Lo=xs.prototype,Lo.forEach=function(t){this.a&&t(this.a,Eu)},Lo.get=function(t){if(this.has(t))return this.a},Lo.has=function(t){var e=Eu;return!(!this.a||!ft(new Uint8Array(t),new Uint8Array(e)))},Lo.entries=function(){},Lo.keys=function(){},Lo.values=function(){},Ls.prototype.createSession=function(){},Ls.prototype.setServerCertificate=function(){},Ds.prototype.getConfiguration=function(){},Ds.prototype.createMediaKeys=function(){};var Su="";js.prototype.createMediaKeys=function(){var t=new Bs(this.a);return Promise.resolve(t)},js.prototype.getConfiguration=function(){return this.b},Lo=Bs.prototype,Lo.createSession=function(t){var e=t||"temporary";if("temporary"!=e&&"persistent-license"!=e)throw new TypeError("Session type "+t+" is unsupported on this platform.");return t=this.b||document.createElement("video"),t.src||(t.src="about:blank"),e=new Hs(t,this.g,e),this.c.push(e),e},Lo.setServerCertificate=function(){return Promise.resolve(!1)},Lo.be=function(t){var e=document.createEvent("CustomEvent");e.initCustomEvent("encrypted",!1,!1,null),e.initDataType="webm",e.initData=t.initData,this.b.dispatchEvent(e)},Lo.ae=function(t){var e=Vs(this,t.sessionId);e&&(t=new X("message",{messageType:void 0==e.keyStatuses.a?"licenserequest":"licenserenewal",message:t.message}),e.b&&(e.b.resolve(),e.b=null),e.dispatchEvent(t))},Lo.Zd=function(t){(t=Vs(this,t.sessionId))&&(qs(t,"usable"),t.a&&t.a.resolve(),t.a=null)},Lo.$d=function(t){var e=Vs(this,t.sessionId);if(e){var i=Error("EME v0.1b key error");i.errorCode=t.errorCode,i.errorCode.systemCode=t.systemCode,!t.sessionId&&e.b?(i.method="generateRequest",45==t.systemCode&&(i.message="Unsupported session type."),e.b.reject(i),e.b=null):t.sessionId&&e.a?(i.method="update",e.a.reject(i),e.a=null):(i=t.systemCode,t.errorCode.code==MediaKeyError.MEDIA_KEYERR_OUTPUT?qs(e,"output-restricted"):1==i?qs(e,"expired"):qs(e,"internal-error"))}},i(Hs),Lo=Hs.prototype,Lo.ac=function(t,e){if(this.a)this.a.then(this.ac.bind(this,t,e)).catch(this.ac.bind(this,t,e));else{if(this.a=t,"webkit-org.w3.clearkey"==this.c){var i=tt(e),n=JSON.parse(i);"oct"!=n.keys[0].kty&&(this.a.reject(Error("Response is not a valid JSON Web Key Set.")),this.a=null),i=ht(n.keys[0].k),n=ht(n.keys[0].kid)}else i=new Uint8Array(e),n=null;var r=Cs("addKey");try{this.f[r](this.c,i,n,this.sessionId)}catch(t){this.a.reject(t),this.a=null}}},Lo.generateRequest=function(t,e){return Ks(this,e,null)},Lo.load=function(t){return"persistent-license"==this.g?Ks(this,null,t):Promise.reject(Error("Not a persistent session."))},Lo.update=function(t){var e=new b;return this.ac(e,t),e},Lo.close=function(){if("persistent-license"!=this.g){if(!this.sessionId)return this.closed.reject(Error("The session is not callable.")),this.closed;var t=Cs("cancelKeyRequest");try{this.f[t](this.c,this.sessionId)}catch(t){}}return this.closed.resolve(),this.closed},Lo.remove=function(){return"persistent-license"!=this.g?Promise.reject(Error("Not a persistent session.")):this.close()};var Au;Lo=Gs.prototype,Lo.forEach=function(t){this.a&&t(this.a,Au)},Lo.get=function(t){if(this.has(t))return this.a},Lo.has=function(t){var e=Au;return!(!this.a||!ft(new Uint8Array(t),new Uint8Array(e)))},Lo.entries=function(){},Lo.keys=function(){},Lo.values=function(){},ys(function(){!t.HTMLVideoElement||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration||(HTMLMediaElement.prototype.webkitGenerateKeyRequest?Ms("webkit"):HTMLMediaElement.prototype.generateKeyRequest?Ms(""):t.MSMediaKeys?(Eu=new Uint8Array([0]).buffer,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=Es,t.MediaKeys=Ss,t.MediaKeySystemAccess=ws,navigator.requestMediaKeySystemAccess=Ts):(navigator.requestMediaKeySystemAccess=Rs,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=Ns,t.MediaKeys=Ls,t.MediaKeySystemAccess=Ds))}),ys(function(){if(t.MediaSource)if(t.cast&&cast.__platform__&&cast.__platform__.canDisplayType)Qs();else if(navigator.vendor&&0<=navigator.vendor.indexOf("Apple")){var e=navigator.appVersion;Js(),0<=e.indexOf("Version/8")?t.MediaSource=null:0<=e.indexOf("Version/9")?Xs():0<=e.indexOf("Version/10")?(Xs(),zs()):0<=e.indexOf("Version/11")&&(Xs(),Ys())}});var ku=0;Zs.prototype.then=function(t,e){var i=new Zs;switch(this.Aa){case 1:ro(this,i,t);break;case 2:ro(this,i,e);break;case ku:this.c.push({M:i,zb:t}),this.b.push({M:i,zb:e})}return i},Zs.prototype.catch=function(t){return this.then(void 0,t)},Zs.prototype.la=function(t){if(this.Aa==ku){for(this.f=t,this.Aa=1,t=0;t<this.c.length;++t)ro(this,this.c[t].M,this.c[t].zb);this.c=[],this.b=[]}},Zs.prototype.a=function(t){if(this.Aa==ku){for(this.f=t,this.Aa=2,t=0;t<this.b.length;++t)ro(this,this.b[t].M,this.b[t].zb);this.c=[],this.b=[]}};var Iu=null,_u=[];ys(function(e){t.setImmediate?(oo=function(e){return t.setImmediate(e)},uo=function(e){return t.clearImmediate(e)}):(oo=function(e){return t.setTimeout(e,0)},uo=function(e){return t.clearTimeout(e)}),t.Promise&&!e||(t.Promise=Zs,t.Promise.resolve=to,t.Promise.reject=eo,t.Promise.all=io,t.Promise.race=no,t.Promise.prototype.then=Zs.prototype.then,t.Promise.prototype.catch=Zs.prototype.catch)}),ys(function(){if(t.HTMLMediaElement){var e=HTMLMediaElement.prototype.play;HTMLMediaElement.prototype.play=function(){var t=e.apply(this,arguments);return t&&t.catch(function(){}),t}}}),ys(function(){if(t.HTMLVideoElement){var e=HTMLVideoElement.prototype;!e.getVideoPlaybackQuality&&"webkitDroppedFrameCount"in e&&(e.getVideoPlaybackQuality=ho)}}),ys(function(){if(!t.VTTCue&&t.TextTrackCue){var e=TextTrackCue.length;if(3==e)t.VTTCue=co;else if(6==e)t.VTTCue=lo;else{try{var i=!!co(1,2,"")}catch(t){i=!1}i&&(t.VTTCue=co)}}}),e("shaka.text.Cue",fo);var Pu="auto";fo.positionAlign={LEFT:"line-left",RIGHT:"line-right",CENTER:"center",AUTO:Pu};var xu="center",Ru={LEFT:"left",RIGHT:"right",CENTER:xu,START:"start",END:"end"};fo.textAlign=Ru;var Nu="before",Lu={BEFORE:Nu,CENTER:"center",AFTER:"after"};fo.displayAlign=Lu;var Du=0,Mu=2,Cu=3;fo.writingDirection={HORIZONTAL_LEFT_TO_RIGHT:Du,HORIZONTAL_RIGHT_TO_LEFT:1,VERTICAL_LEFT_TO_RIGHT:Mu,VERTICAL_RIGHT_TO_LEFT:Cu};var Ou=0,Uu=1;fo.lineInterpretation={LINE_NUMBER:Ou,PERCENTAGE:Uu};var ju="center",Bu={CENTER:ju,START:"start",END:"end"};fo.lineAlign=Bu;var Fu=400;fo.fontWeight={NORMAL:Fu,BOLD:700};var Vu="normal",Hu={NORMAL:Vu,ITALIC:"italic",OBLIQUE:"oblique"};fo.fontStyle=Hu,fo.textDecoration={UNDERLINE:"underline",LINE_THROUGH:"lineThrough",OVERLINE:"overline"},po.prototype.parseInit=function(){},po.prototype.parseMedia=function(t,e){var i=tt(t),n=[],r=new DOMParser,a=null;try{a=r.parseFromString(i,"text/xml")}catch(t){throw new h(2,2,2005)}if(a){var s=a.getElementsByTagName("tt")[0];if(!s)throw new h(2,2,2005);r=s.getAttribute("ttp:frameRate"),a=s.getAttribute("ttp:subFrameRate");var o=s.getAttribute("ttp:frameRateMultiplier"),u=s.getAttribute("ttp:tickRate");if("default"!=(i=s.getAttribute("xml:space")||"default")&&"preserve"!=i)throw new h(2,2,2005);for(i="default"==i,r=new Ao(r,a,o,u),a=mo(s.getElementsByTagName("styling")[0]),o=mo(s.getElementsByTagName("layout")[0]),s=mo(s.getElementsByTagName("body")[0]),u=0;u<s.length;u++){var c=s[u],l=e.periodStart,f=r,d=a,p=o,m=i;if(c.hasAttribute("begin")||c.hasAttribute("end")||!/^\s*$/.test(c.textContent)){yo(c,m);var m=Eo(c.getAttribute("begin"),f),y=Eo(c.getAttribute("end"),f),f=Eo(c.getAttribute("dur"),f),v=c.textContent;if(null==y&&null!=f&&(y=m+f),null==m||null==y)throw new h(2,2,2001);l=new fo(m+l,y+l,v),m=wo(c,"region",p),p=l,"rtl"==go(c,m,d,"tts:direction")&&(p.writingDirection=1),y=go(c,m,d,"tts:writingMode"),"tb"==y||"tblr"==y?p.writingDirection=Mu:"tbrl"==y?p.writingDirection=Cu:"rltb"==y||"rl"==y?p.writingDirection=1:y&&(p.writingDirection=Du),(y=go(c,m,d,"tts:origin"))&&(y=$u.exec(y))&&(p.region.x=Number(y[1]),p.region.y=Number(y[2])),(y=go(c,m,d,"tts:extent"))&&(y=$u.exec(y))&&(p.region.width=Number(y[1]),p.region.height=Number(y[2])),(y=go(c,m,d,"tts:textAlign"))&&(p.positionAlign=Qu[y],p.lineAlign=Ju[y],p.textAlign=Ru[y.toUpperCase()]),(y=go(c,m,d,"tts:displayAlign"))&&(p.displayAlign=Lu[y.toUpperCase()]),(y=go(c,m,d,"tts:color"))&&(p.color=y),(y=go(c,m,d,"tts:backgroundColor"))&&(p.backgroundColor=y),(y=go(c,m,d,"tts:fontFamily"))&&(p.fontFamily=y),(y=go(c,m,d,"tts:fontWeight"))&&"bold"==y&&(p.fontWeight=700),(y=go(c,m,d,"tts:wrapOption"))&&"noWrap"==y&&(p.wrapLine=!1),(y=go(c,m,d,"tts:lineHeight"))&&y.match(Wu)&&(p.lineHeight=y),(y=go(c,m,d,"tts:fontSize"))&&y.match(Wu)&&(p.fontSize=y),(y=go(c,m,d,"tts:fontStyle"))&&(p.fontStyle=Hu[y.toUpperCase()]),(m=bo(m,d,"tts:textDecoration"))&&vo(p,m),(c=To(c,d,"tts:textDecoration"))&&vo(p,c)}else l=null;l&&n.push(l)}}return n};var Ku=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,qu=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,Gu=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d{2,})$/,Xu=/^(\d*\.?\d*)f$/,Yu=/^(\d*\.?\d*)t$/,zu=/^(?:(\d*\.?\d*)h)?(?:(\d*\.?\d*)m)?(?:(\d*\.?\d*)s)?(?:(\d*\.?\d*)ms)?$/,$u=/^(\d{1,2}|100)% (\d{1,2}|100)%$/,Wu=/^(\d+px|\d+em)$/,Ju={left:"start",center:"center",right:"end",start:"start",end:"end"},Qu={left:"line-left",center:"center",right:"line-right"};Ko["application/ttml+xml"]=po,ko.prototype.parseInit=function(t){var e=!1;if((new li).C("moov",fi).C("trak",fi).C("mdia",fi).C("minf",fi).C("stbl",fi).ba("stsd",di).C("stpp",function(t){e=!0,t.oa.stop()}).parse(t),!e)throw new h(2,2,2007)},ko.prototype.parseMedia=function(t,e){var i=!1,n=[];if((new li).C("mdat",pi(function(t){i=!0,n=n.concat(this.a.parseMedia(t,e))}.bind(this))).parse(t),!i)throw new h(2,2,2007);return n},Ko['application/mp4; codecs="stpp"']=ko,Ko['application/mp4; codecs="stpp.TTML.im1t"']=ko,Io.prototype.parseInit=function(){},Io.prototype.parseMedia=function(t,e){var i=tt(t),i=i.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n"),i=i.split(/\n{2,}/m);if(!/^WEBVTT($|[ \t\n])/m.test(i[0]))throw new h(2,2,2e3);var n=e.segmentStart;if(0<=i[0].indexOf("X-TIMESTAMP-MAP")){var r=i[0].match(/LOCAL:((?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3}))/m),a=i[0].match(/MPEGTS:(\d+)/m);r&&a&&(n=Po(new mn(r[1])),n=e.periodStart+(Number(a[1])/9e4-n))}for(a=[],r=1;r<i.length;r++){var s=i[r].split("\n"),o=n;if(1==s.length&&!s[0]||/^NOTE($|[ \t])/.test(s[0])||"STYLE"==s[0])var u=null;else{u=null,0>s[0].indexOf("--\x3e")&&(u=s[0],s.splice(0,1));var c=new mn(s[0]),l=Po(c),f=yn(c,/[ \t]+--\x3e[ \t]+/g),d=Po(c);if(null==l||!f||null==d)throw new h(2,2,2001);for(s=new fo(l+o,d+o,s.slice(1).join("\n").trim()),yn(c,/[ \t]+/gm),o=vn(c);o;)_o(s,o),yn(c,/[ \t]+/gm),o=vn(c);null!=u&&(s.id=u),u=s}u&&a.push(u)}return a},Ko["text/vtt"]=Io,Ko['text/vtt; codecs="vtt"']=Io,xo.prototype.parseInit=function(t){var e=!1;if((new li).C("moov",fi).C("trak",fi).C("mdia",fi).ba("mdhd",function(t){0==t.version?(t.o.H(4),t.o.H(4),this.a=t.o.B(),t.o.H(4)):(t.o.H(8),t.o.H(8),this.a=t.o.B(),t.o.H(8)),t.o.H(4)}.bind(this)).C("minf",fi).C("stbl",fi).ba("stsd",di).C("wvtt",function(){e=!0}).parse(t),!this.a)throw new h(2,2,2008);if(!e)throw new h(2,2,2008)},xo.prototype.parseMedia=function(t,e){if(!this.a)throw new h(2,2,2008);var i=0,n=[],r=[],a=[],s=!1,o=!1,u=!1,c=null;if((new li).C("moof",fi).C("traf",fi).ba("tfdt",function(t){s=!0,i=t.version?t.o.Na():t.o.B()}).ba("tfhd",function(t){var e=t.lc;t=t.o,t.H(4),1&e&&t.H(8),2&e&&t.H(4),c=8&e?t.B():null}).ba("trun",function(t){o=!0;var e=t.version,i=t.lc;t=t.o;var r=t.B();1&i&&t.H(4),4&i&&t.H(4);for(var a=[],s=0;s<r;s++){var u={duration:null,bc:null};256&i&&(u.duration=t.B()),512&i&&t.H(4),1024&i&&t.H(4),2048&i&&(u.bc=e?t.Hc():t.B()),a.push(u)}n=a}).C("vtte",function(){r.push(null)}).C("vttc",pi(function(t){r.push(t)})).C("mdat",function(t){u=!0,fi(t)}).parse(t),!u&&!s&&!o)throw new h(2,2,2008);for(var l=i,f=0;f<n.length;f++){var d=n[f],p=r[f],m=d.duration||c;m&&(d=d.bc?i+d.bc:l,l=d+m,p&&a.push(Ro(p,e.periodStart+d/this.a,e.periodStart+l/this.a)))}return a.filter(R)},Ko['application/mp4; codecs="wvtt"']=xo}).call(r,this),void 0!==t&&t.exports?t.exports=r.shaka:void 0!==(n=function(){return r.shaka}.call(e,i,e,t))&&(t.exports=n)}()}])});
+!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("clappr")):"function"==typeof define&&define.amd?define(["clappr"],e):"object"==typeof exports?exports.DashShakaPlayback=e(require("clappr")):t.DashShakaPlayback=e(t.Clappr)}("undefined"!=typeof self?self:this,function(t){return function(t){function e(i){if(n[i])return n[i].exports;var r=n[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="dist/",e(e.s=0)}([function(t,e,n){"use strict";function i(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function t(e,n,i){null===e&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,n);if(void 0===r){var a=Object.getPrototypeOf(e);return null===a?void 0:t(a,n,i)}if("value"in r)return r.value;var o=r.get;if(void 0!==o)return o.call(i)},u=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),c=n(1),h=n(2),l=function(t){return t&&t.__esModule?t:{default:t}}(h),f=function(t){function e(){var t;r(this,e);for(var n=arguments.length,i=Array(n),o=0;o<n;o++)i[o]=arguments[o];var s=a(this,(t=e.__proto__||Object.getPrototypeOf(e)).call.apply(t,[this].concat(i)));return s._levels=[],s._pendingAdaptationEvent=!1,s._isShakaReadyState=!1,s._minDvrSize=void 0===s.options.dashMinimumDvrSize?60:s.options.dashMinimumDvrSize,s}return o(e,t),u(e,[{key:"name",get:function(){return"dash_shaka_playback"}},{key:"shakaVersion",get:function(){return l.default.player.Player.version}},{key:"shakaPlayerInstance",get:function(){return this._player}},{key:"levels",get:function(){return this._levels}},{key:"currentLevel",set:function(t){var e=this;this._currentLevelId=t;var n=-1===this._currentLevelId;this.trigger(c.Events.PLAYBACK_LEVEL_SWITCH_START),n?(this._player.configure({abr:{enabled:!0}}),this.trigger(c.Events.PLAYBACK_LEVEL_SWITCH_END)):(this._player.configure({abr:{enabled:!1}}),this._pendingAdaptationEvent=!0,this.selectTrack(this.videoTracks.filter(function(t){return t.id===e._currentLevelId})[0]))},get:function(){return this._currentLevelId||-1}}],[{key:"canPlay",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";l.default.polyfill.installAll();var n=l.default.Player.isBrowserSupported(),i=t.split("?")[0].match(/.*\.(.*)$/)||[];return n&&("mpd"===i[1]||e.indexOf("application/dash+xml")>-1)}},{key:"Events",get:function(){return{SHAKA_READY:"shaka:ready"}}}]),u(e,[{key:"play",value:function(){if(this._player||this._setup(),!this.isReady)return void this.once(e.Events.SHAKA_READY,this.play);this._stopped=!1,this._src=this.el.src,s(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"play",this).call(this),this._startUpdateTimers()}},{key:"pause",value:function(){s(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"pause",this).call(this),this.dvrEnabled&&this._updateDvr(!0)}},{key:"_setupSrc",value:function(){}},{key:"_startUpdateTimers",value:function(){var t=this;this._timeUpdateTimer||(this._timeUpdateTimer=setInterval(function(){t._onDurationChange(),t._onTimeUpdate()},200))}},{key:"_stopUpdateTimers",value:function(){clearInterval(this._timeUpdateTimer),this._timeUpdateTimer=null,clearInterval(this._progressUpdateTimer),this._progressUpdateTimer=null}},{key:"_ready",value:function(){}},{key:"_onShakaReady",value:function(){this._isShakaReadyState=!0,this.trigger(e.Events.SHAKA_READY),this.trigger(c.Events.PLAYBACK_READY,this.name)}},{key:"error",value:function(t){c.Log.error("an error was raised by the video tag",t,this.el.error)}},{key:"isHighDefinitionInUse",value:function(){return!1}},{key:"stop",value:function(){var t=this;clearInterval(this.sendStatsId),this._stopUpdateTimers(),this._stopped=!0,this._player?(this._sendStats(),this._player.unload().then(function(){s(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"stop",t).call(t),t._player=null,t._isShakaReadyState=!1}).catch(function(){c.Log.error("shaka could not be unloaded")})):s(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"stop",this).call(this)}},{key:"getPlaybackType",value:function(){return this._playbackType}},{key:"getCurrentTime",value:function(){return Math.max(0,this.el.currentTime-this._startTime)}},{key:"getDuration",value:function(){return this._duration}},{key:"isSeekEnabled",value:function(){return this._playbackType===c.Playback.VOD||this.dvrEnabled}},{key:"seekPercentage",value:function(t){var e=this._duration;t>0&&(e=this._duration*(t/100)),this.seek(e)}},{key:"seek",value:function(t){t<0&&(c.Log.warn("Attempt to seek to a negative time. Resetting to live point."),t=this.getDuration()),this.dvrEnabled&&this._updateDvr(t<this.getDuration()-3),t+=this._startTime,s(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"seek",this).call(this,t)}},{key:"selectAudioLanguage",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this._player.selectAudioLanguage(t,e)}},{key:"selectTrack",value:function(t){if("text"===t.type)this._player.selectTextTrack(t);else{if("variant"!==t.type)throw new Error("Unhandled track type:",t.type);this._player.selectVariantTrack(t),t.mimeType.startsWith("video/")&&this._onAdaptation()}}},{key:"_enableShakaTextTrack",value:function(t){this.el.textTracks&&(this._shakaTTVisible=t,Array.from(this.el.textTracks).filter(function(t){return"subtitles"===t.kind}).forEach(function(e){return e.mode=!0===t?"showing":"hidden"}))}},{key:"_checkForClosedCaptions",value:function(){if(!this._ccIsSetup){if(this.hasClosedCaptionsTracks){this.trigger(c.Events.PLAYBACK_SUBTITLE_AVAILABLE);var t=this.closedCaptionsTrackId;this.closedCaptionsTrackId=t}this._ccIsSetup=!0}}},{key:"destroy",value:function(){var t=this;this._stopUpdateTimers(),clearInterval(this.sendStatsId),this._player?this._player.destroy().then(function(){return t._destroy()}).catch(function(){t._destroy(),c.Log.error("shaka could not be destroyed")}):this._destroy(),s(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"destroy",this).call(this)}},{key:"_setup",value:function(){var t=this;this._isShakaReadyState=!1,this._ccIsSetup=!1,this._player=this._createPlayer(),this._options.shakaConfiguration&&this._player.configure(this._options.shakaConfiguration),this._options.shakaOnBeforeLoad&&this._options.shakaOnBeforeLoad(this._player),this._player.load(this._options.src).then(function(){return t._loaded()}).catch(function(e){return t._setupError(e)})}},{key:"_createPlayer",value:function(){var t=new l.default.Player(this.el);return t.addEventListener("error",this._onError.bind(this)),t.addEventListener("adaptation",this._onAdaptation.bind(this)),t.addEventListener("buffering",this._onBuffering.bind(this)),t}},{key:"_onBuffering",value:function(t){if(!this._stopped){var e=t.buffering?c.Events.PLAYBACK_BUFFERING:c.Events.PLAYBACK_BUFFERFULL;this.trigger(e)}}},{key:"_onProgress",value:function(){if(this.el.buffered.length){for(var t=[],e=0,n=0;n<this.el.buffered.length;n++)t=[].concat(i(t),[{start:Math.max(0,this.el.buffered.start(n)-this._startTime),end:Math.max(0,this.el.buffered.end(n)-this._startTime)}]),this.el.currentTime>=t[n].start&&this.el.currentTime<=t[n].end&&(e=n);var r={start:t[e].start,current:t[e].end,total:this.getDuration()};this.trigger(c.Events.PLAYBACK_PROGRESS,r,t)}}},{key:"_onDurationChange",value:function(){var t=this.getDuration();this._lastDuration!==t&&(this._lastDuration=t,s(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"_onDurationChange",this).call(this))}},{key:"_updateSettings",value:function(){this._playbackType===c.Playback.VOD?this.settings.left=["playpause","position","duration"]:this.dvrEnabled?this.settings.left=["playpause"]:this.settings.left=["playstop"],this.settings.seekEnabled=this.isSeekEnabled(),this.trigger(c.Events.PLAYBACK_SETTINGSUPDATE)}},{key:"_onTimeUpdate",value:function(){var t={current:this.getCurrentTime(),total:this.getDuration(),firstFragDateTime:this._player.getPresentationStartTimeAsDate()};this._lastTimeUpdate&&t.current===this._lastTimeUpdate.current&&t.total===this._lastTimeUpdate.total||(this._lastTimeUpdate=t,this.trigger(c.Events.PLAYBACK_TIMEUPDATE,t,this.name))}},{key:"_updateDvr",value:function(t){this.trigger(c.Events.PLAYBACK_DVR,t),this.trigger(c.Events.PLAYBACK_STATS_ADD,{dvr:t})}},{key:"_loaded",value:function(){this._onShakaReady(),this._startToSendStats(),this._fillLevels(),this._checkForClosedCaptions()}},{key:"_fillLevels",value:function(){0===this._levels.length&&(this._levels=this.videoTracks.slice(0).reverse(),this.trigger(c.Events.PLAYBACK_LEVELS_AVAILABLE,this.levels))}},{key:"_startToSendStats",value:function(){var t=this,e=this._options.shakaSendStatsInterval||3e4;this.sendStatsId=setInterval(function(){return t._sendStats()},e)}},{key:"_sendStats",value:function(){this.trigger(c.Events.PLAYBACK_STATS_ADD,this._player.getStats())}},{key:"_setupError",value:function(t){this._onError(t)}},{key:"_onError",value:function(t){var n=this,i={shakaError:t,videoError:this.el.error},r=i.shakaError.detail||i.shakaError,a=r.category,o=r.code,u=r.severity;if(i.videoError||!o&&!a)return s(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"_onError",this).call(this);var h=u===l.default.util.Error.Severity.CRITICAL,f={code:a+"_"+o,description:"Category: "+a+", code: "+o+", severity: "+u,level:h?c.PlayerError.Levels.FATAL:c.PlayerError.Levels.WARN,raw:t},d=this.createError(f);c.Log.error("Shaka error event:",d),this.trigger(c.Events.PLAYBACK_ERROR,d),t.detail&&2==t.detail.severity&&1002==t.detail.code&&(console.log("retrying"),this.stop(),setTimeout(function(){return n.play()},1e3))}},{key:"_onAdaptation",value:function(){var t=this.videoTracks.filter(function(t){return!0===t.active})[0];this._fillLevels(),this._sendStats(),this._pendingAdaptationEvent_&&(this.trigger(c.Events.PLAYBACK_LEVEL_SWITCH_END),this._pendingAdaptationEvent=!1),c.Log.debug("an adaptation has happened:",t),this.trigger(c.Events.PLAYBACK_BITRATE,{bandwidth:t.bandwidth,language:t.language,width:t.width,height:t.height,level:t.id})}},{key:"_destroy",value:function(){this._isShakaReadyState=!1,c.Log.debug("shaka was destroyed")}},{key:"isReady",get:function(){return this._isShakaReadyState}},{key:"textTracks",get:function(){return this.isReady&&this._player.getTextTracks()}},{key:"audioLanguages",get:function(){return this.isReady&&this._player.getAudioLanguages()}},{key:"audioTracks",get:function(){return this.isReady&&this._player.getVariantTracks().filter(function(t){return t.mimeType.startsWith("audio/")})}},{key:"videoTracks",get:function(){return this.isReady&&this._player.getVariantTracks().filter(function(t){return t.mimeType.startsWith("video/")})}},{key:"dvrEnabled",get:function(){return this._player.isLive()&&this._duration>=this._minDvrSize}},{key:"_startTime",get:function(){return this._player.seekRange().start}},{key:"_duration",get:function(){if(!this._player)return 0;var t=this._player.seekRange(),e=t.start;return t.end-e}},{key:"_playbackType",get:function(){return(this.isReady&&this._player.isLive()?c.Playback.LIVE:c.Playback.VOD)||""}},{key:"closedCaptionsTracks",get:function(){var t=0,e=function(){return t++};return(this.textTracks||[]).filter(function(t){return"subtitle"===t.kind}).map(function(t){return{id:e(),name:t.label||t.language,track:t}})}},{key:"closedCaptionsTrackId",get:function(){return s(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"closedCaptionsTrackId",this)},set:function(t){if(this._player){var e=this.closedCaptionsTracks,n=void 0;if(-1!==t){if(!(n=e.find(function(e){return e.id===t})))return void c.Log.warn('Track id "'+t+'" not found');if(this._shakaTTVisible&&!0===n.track.active)return void c.Log.info('Track id "'+t+'" already showing')}n?(this._player.selectTextTrack(n.track),this._enableShakaTextTrack(!0)):this._enableShakaTextTrack(!1),this._ccTrackId=t,this.trigger(c.Events.PLAYBACK_SUBTITLE_CHANGED,{id:t})}}}]),e}(c.HTML5Video);e.default=f,t.exports=e.default},function(e,n){e.exports=t},function(t,e,n){(function(t){!function(){var n="undefined"!=typeof window?window:t,i={};(function(t,e){function n(){n=function(){},Bu.Symbol||(Bu.Symbol=Fu)}function i(){n();var t=Bu.Symbol.iterator;t||(t=Bu.Symbol.iterator=Bu.Symbol("iterator")),"function"!=typeof Array.prototype[t]&&ju(Array.prototype,t,{configurable:!0,writable:!0,value:function(){return r(this)}}),i=function(){}}function r(t){var e=0;return a(function(){return e<t.length?{done:!1,value:t[e++]}:{done:!0}})}function a(t){return i(),t={next:t},t[Bu.Symbol.iterator]=function(){return this},t}function o(t){i();var e=t[Symbol.iterator];return e?e.call(t):r(t)}function s(t,e){if(e){for(var n=Bu,i=t.split("."),r=0;r<i.length-1;r++){var a=i[r];a in n||(n[a]={}),n=n[a]}i=i[i.length-1],r=n[i],a=e(r),a!=r&&null!=a&&ju(n,i,{configurable:!0,writable:!0,value:a})}}function u(t){function e(e){return t.next(e)}function n(e){return t.throw(e)}return new Promise(function(i,r){function a(t){t.done?i(t.value):Promise.resolve(t.value).then(e,n).then(a,r)}a(t.next())})}function c(t){return u(t())}function h(){this.g=!1,this.c=null,this.K=void 0,this.w=1,this.b=this.f=0,this.i=this.a=null}function l(t){if(t.g)throw new TypeError("Generator is already running");t.g=!0}function f(t,e){t.a={rc:e,yc:!0},t.w=t.f||t.b}function d(t,e,n){return t.w=n,{value:e}}function p(t,e,n){t.f=e,void 0!=n&&(t.b=n)}function m(t){t.f=0,t.b=2}function v(t){t.w=0,t.f=0}function y(t){t.f=0;var e=t.a.rc;return t.a=null,e}function g(t){t.i=[t.a],t.f=0,t.b=0}function b(t,e){var n=t.i.splice(0)[0];(n=t.a=t.a||n)?n.yc?t.w=t.f||t.b:void 0!=n.V&&t.b<n.V?(t.w=n.V,t.a=null):t.w=t.b:t.w=e}function w(t){this.a=new h,this.b=t}function T(t,e){l(t.a);var n=t.a.c;return n?E(t,"return"in n?n.return:function(t){return{value:t,done:!0}},e,t.a.return):(t.a.return(e),S(t))}function E(t,e,n,i){try{var r=e.call(t.a.c,n);if(!(r instanceof Object))throw new TypeError("Iterator result "+r+" is not an object");if(!r.done)return t.a.g=!1,r;var a=r.value}catch(e){return t.a.c=null,f(t.a,e),S(t)}return t.a.c=null,i.call(t.a,a),S(t)}function S(t){for(;t.a.w;)try{var e=t.b(t.a);if(e)return t.a.g=!1,{value:e.value,done:!1}}catch(e){t.a.K=void 0,f(t.a,e)}if(t.a.g=!1,t.a.a){if(e=t.a.a,t.a.a=null,e.yc)throw e.rc;return{value:e.return,done:!0}}return{value:void 0,done:!0}}function k(t){this.next=function(e){return l(t.a),t.a.c?e=E(t,t.a.c.next,e,t.a.h):(t.a.h(e),e=S(t)),e},this.throw=function(e){return l(t.a),t.a.c?e=E(t,t.a.c.throw,e,t.a.h):(f(t.a,e),e=S(t)),e},this.return=function(e){return T(t,e)},i(),this[Symbol.iterator]=function(){return this}}function A(t,e){return k.prototype=t.prototype,new k(new w(e))}function _(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function I(t,e){var n=t.split("."),i=Vu;n[0]in i||!i.execScript||i.execScript("var "+n[0]);for(var r;n.length&&(r=n.shift());)n.length||void 0===e?i=i[r]?i[r]:i[r]={}:i[r]=e}function x(t,e){function n(){}n.prototype=e.prototype,t.hf=e.prototype,t.prototype=new n,t.prototype.constructor=t,t.ff=function(t,n,i){return e.prototype[n].apply(t,Array.prototype.slice.call(arguments,2))}}function P(t){this.c=Math.exp(Math.log(.5)/t),this.b=this.a=0}function R(t,e,n){var i=Math.pow(t.c,e);n=n*(1-i)+i*t.a,isNaN(n)||(t.a=n,t.b+=e)}function N(t){return t.a/(1-Math.pow(t.c,t.b))}function D(){this.b=new P(2),this.c=new P(5),this.a=0}function C(){}function M(){}function L(t){var e;t instanceof L?(O(this,t.ia),this.Fa=t.Fa,this.la=t.la,U(this,t.Qa),this.aa=t.aa,j(this,H(t.a)),this.za=t.za):t&&(e=String(t).match(Ku))?(O(this,e[1]||"",!0),this.Fa=B(e[2]||""),this.la=B(e[3]||"",!0),U(this,e[4]),this.aa=B(e[5]||"",!0),j(this,e[6]||"",!0),this.za=B(e[7]||"")):this.a=new K(null)}function O(t,e,n){t.ia=n?B(e,!0):e,t.ia&&(t.ia=t.ia.replace(/:$/,""))}function U(t,e){if(e){if(e=Number(e),isNaN(e)||0>e)throw Error("Bad port number "+e);t.Qa=e}else t.Qa=null}function j(t,e,n){e instanceof K?t.a=e:(n||(e=F(e,Xu)),t.a=new K(e))}function B(t,e){return t?e?decodeURI(t):decodeURIComponent(t):""}function F(t,e,n){return"string"==typeof t?(t=encodeURI(t).replace(e,V),n&&(t=t.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),t):null}function V(t){return t=t.charCodeAt(0),"%"+(t>>4&15).toString(16)+(15&t).toString(16)}function K(t){this.b=t||null}function H(t){var e=new K;if(e.b=t.b,t.a){var n,i={};for(n in t.a)i[n]=t.a[n].concat();e.a=i,e.c=t.c}return e}function q(){var t,e,n=new Promise(function(n,i){t=n,e=i});return n.resolve=t,n.reject=e,n}function G(t,e){var n=Y();this.i=null==t.maxAttempts?n.maxAttempts:t.maxAttempts,this.f=null==t.baseDelay?n.baseDelay:t.baseDelay,this.h=null==t.fuzzFactor?n.fuzzFactor:t.fuzzFactor,this.g=null==t.backoffFactor?n.backoffFactor:t.backoffFactor,this.a=0,this.b=this.f,(this.c=e||!1)&&(this.a=1)}function X(e){if(e.a>=e.i){if(!e.c)return Promise.reject();e.a=1,e.b=e.f}var n=new q;return e.a?(t.setTimeout(n.resolve,e.b*(1+(2*Math.random()-1)*e.h)),e.b*=e.g):n.resolve(),e.a++,n}function Y(){return{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:0}}function z(t,e,n,i){this.severity=t,this.category=e,this.code=n,this.data=Array.prototype.slice.call(arguments,3),this.handled=!1}function W(t,e){this.promise=t,this.b=e,this.a=!1}function $(t){return new W(Promise.reject(t),function(){return Promise.resolve()})}function J(){var t=Promise.reject(new z(2,7,7001));return t.catch(function(){}),new W(t,function(){return Promise.resolve()})}function Q(t){return new W(Promise.resolve(t),function(){return Promise.resolve()})}function Z(t){return new W(t,function(){return t.catch(function(){})})}function tt(t){return new W(Promise.all(t.map(function(t){return t.promise})),function(){return Promise.all(t.map(function(t){return t.abort()}))})}function et(t,e,n){try{var i=t(e);return i&&i.promise&&i.abort?(n.resolve(i.promise),function(){return i.abort()}):(n.resolve(i),function(){return Promise.resolve(i).then(function(){}).catch(function(){})})}catch(t){return n.reject(t),function(){return Promise.resolve()}}}function nt(t,e){return!("number"!=typeof t||"number"!=typeof e||!isNaN(t)||!isNaN(e))||t===e}function it(t,e){e||(e=nt);for(var n=[],i=o(t),r=i.next();!r.done;r=i.next())r=r.value,-1==rt(n,r,e)&&n.push(r);return n}function rt(t,e,n){for(var i=0;i<t.length;++i)if(n(t[i],e))return i;return-1}function at(t,e){var n=t.indexOf(e);-1<n&&t.splice(n,1)}function ot(t,e){var n=0;return t.forEach(function(t){n+=e(t)?1:0}),n}function st(t,e,n,i,r){var a,o=r in i,s=!0;for(a in e){var u=r+"."+a,c=o?i[r]:n[a];o||a in t?void 0===e[a]?void 0===c||o?delete t[a]:t[a]=ut(c):c.constructor==Object&&e[a]&&e[a].constructor==Object?(t[a]||(t[a]=ut(c)),u=st(t[a],e[a],c,i,u),s=s&&u):typeof e[a]!=typeof c||null==e[a]||e[a].constructor!=c.constructor?s=!1:t[a]=e[a]:s=!1}return s}function ut(t){function e(t){switch(typeof t){case"undefined":case"boolean":case"number":case"string":case"symbol":case"function":return t;default:if(!t||t.buffer&&t.buffer.constructor==ArrayBuffer)return t;if(0<=n.indexOf(t))return null;var i=t.constructor==Array;if(t.constructor!=Object&&!i)return null;n.push(t);var r,a=i?[]:{};for(r in t)a[r]=e(t[r]);return i&&(a.length=t.length),a}}var n=[];return e(t)}function ct(t,e){function n(){return Promise.all(t.map(function(t){return t.destroy()}))}return Promise.resolve(e()).then(function(t){return n().then(function(){return t})},function(t){return n().then(function(){throw t})})}function ht(){this.a=[]}function lt(t,e){t.a.push(e.finally(function(){at(t.a,e)}))}function ft(t){this.c=!1,this.g=new ht,this.a=[],this.b=[],this.f=t||null}function dt(t,e,n){n=n||3;var i=zu[t];(!i||n>=i.priority)&&(zu[t]={priority:n,me:e})}function pt(t,e){return{uris:t,method:"GET",body:null,headers:{},allowCrossSiteCredentials:!1,retryParameters:e}}function mt(t){return t.then=function(e,n){return C("The network request interface has changed! Please update your application to the new interface, which allows operations to be aborted. Support for the old API will be removed in v2.5."),t.promise.then(e,n)},t.catch=function(e){return C("The network request interface has changed! Please update your application to the new interface, which allows operations to be aborted. Support for the old API will be removed in v2.5."),t.promise.catch(e)},t}function vt(t,e,n){var i=Q(void 0);return t.a.forEach(function(t){i=i.X(function(){return t(e,n)})}),i.X(void 0,function(t){if(t&&7001==t.code)throw t;throw new z(2,1,1006,t)})}function yt(t,e,n,i,r,a){var o=new L(n.uris[r]),s=o.ia;s||(s=location.protocol,s=s.slice(0,-1),O(o,s),n.uris[r]=o.toString());var u=(s=zu[s])?s.me:null;if(!u)return $(new z(2,1,1e3,o));var c;return Z(X(i)).X(function(){if(t.c)return J();c=Date.now();var i=u(n.uris[r],n,e);return void 0==i.promise&&(C("The scheme plugin interface has changed! Please update your scheme plugins to the new interface to add support for abort(). Support for the old plugin interface will be removed in v2.5."),i=Z(i)),i}).X(function(t){return void 0==t.timeMs&&(t.timeMs=Date.now()-c),t},function(o){if(o&&7001==o.code)throw o;if(t.c)return J();if(o&&1==o.severity)return r=(r+1)%n.uris.length,yt(t,e,n,i,r,o);throw o||a})}function gt(t,e,n){var i=Q(void 0);return t.b.forEach(function(t){i=i.X(function(){return t(e,n)})}),i.X(function(){return n},function(t){if(t&&7001==t.code)throw t;var e=2;throw t instanceof z&&(e=t.severity),new z(e,1,1007,t)})}function bt(){this.a={}}function wt(){this.a=new bt}function Tt(t,e,n,i){t.a&&(e=new kt(e,n,i),t.a.push(n,e))}function Et(t,e,n,i){Tt(t,e,n,function(t){this.pa(e,n),i(t)}.bind(t))}function St(t){if(t.a){var e,n=t.a,i=[];for(e in n.a)i.push.apply(i,n.a[e]);for(n=0;n<i.length;++n)i[n].pa();t.a.a={}}}function kt(t,e,n){this.target=t,this.type=e,this.a=n,this.target.addEventListener(e,n,!1)}function At(e,n){var i,r=n||{};for(i in r)this[i]=r[i];this.defaultPrevented=this.cancelable=this.bubbles=!1,this.timeStamp=t.performance&&t.performance.now?t.performance.now():Date.now(),this.type=e,this.isTrusted=!1,this.target=this.currentTarget=null,this.a=!1}function _t(t,e){return t.reduce(function(t,e,n){return e.catch(t.bind(null,n))}.bind(null,e),Promise.reject())}function It(t,e){return t.concat(e)}function xt(){}function Pt(t){return null!=t}function Rt(t,e,n){return n.indexOf(t)==e}function Nt(t,e){if(0==e.length)return t;var n=e.map(function(t){return new L(t)});return t.map(function(t){return new L(t)}).map(function(t){return n.map(t.resolve.bind(t))}).reduce(It,[]).map(function(t){return t.toString()})}function Dt(t,e){return{keySystem:t,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:e||[],keyIds:[]}}function Ct(t,e){var n=t;return e&&(n+='; codecs="'+e+'"'),n}function Mt(t){if(!t)return"";t=new Uint8Array(t),239==t[0]&&187==t[1]&&191==t[2]&&(t=t.subarray(3)),t=escape(jt(t));try{return decodeURIComponent(t)}catch(t){throw new z(2,2,2004)}}function Lt(t,e,n){if(!t)return"";if(!n&&0!=t.byteLength%2)throw new z(2,2,2004);if(t instanceof ArrayBuffer)var i=t;else n=new Uint8Array(t.byteLength),n.set(new Uint8Array(t)),i=n.buffer;t=Math.floor(t.byteLength/2),n=new Uint16Array(t),i=new DataView(i);for(var r=0;r<t;r++)n[r]=i.getUint16(2*r,e);return jt(n)}function Ot(t){var e=new Uint8Array(t);if(239==e[0]&&187==e[1]&&191==e[2])return Mt(e);if(254==e[0]&&255==e[1])return Lt(e.subarray(2),!1);if(255==e[0]&&254==e[1])return Lt(e.subarray(2),!0);var n=function(t,e){return t.byteLength<=e||32<=t[e]&&126>=t[e]}.bind(null,e);if(0==e[0]&&0==e[2])return Lt(t,!1);if(0==e[1]&&0==e[3])return Lt(t,!0);if(n(0)&&n(1)&&n(2)&&n(3))return Mt(t);throw new z(2,2,2003)}function Ut(t){t=encodeURIComponent(t),t=unescape(t);for(var e=new Uint8Array(t.length),n=0;n<t.length;++n)e[n]=t.charCodeAt(n);return e.buffer}function jt(t){for(var e="",n=0;n<t.length;n+=16e3)e+=String.fromCharCode.apply(null,t.subarray(n,n+16e3));return e}function Bt(t){this.a=null,this.b=function(){this.a=null,t()}.bind(this)}function Ft(t){var e=tc;t.cancel(),t.a=setTimeout(t.b,1e3*e)}function Vt(t,e){t.cancel();var n=function(){this.b(),this.a=setTimeout(n,1e3*e)}.bind(t);t.a=setTimeout(n,1e3*e)}function Kt(e,n){var i=void 0==n||n,r=t.btoa(jt(e)).replace(/\+/g,"-").replace(/\//g,"_");return i?r:r.replace(/=*$/,"")}function Ht(e){e=t.atob(e.replace(/-/g,"+").replace(/_/g,"/"));for(var n=new Uint8Array(e.length),i=0;i<e.length;++i)n[i]=e.charCodeAt(i);return n}function qt(e){for(var n=new Uint8Array(e.length/2),i=0;i<e.length;i+=2)n[i/2]=t.parseInt(e.substr(i,2),16);return n}function Gt(t){for(var e="",n=0;n<t.length;++n){var i=t[n].toString(16);1==i.length&&(i="0"+i),e+=i}return e}function Xt(t,e){if(!t&&!e)return!0;if(!t||!e||t.length!=e.length)return!1;for(var n=0;n<t.length;++n)if(t[n]!=e[n])return!1;return!0}function Yt(t){for(var e=0,n=0;n<arguments.length;++n)e+=arguments[n].length;e=new Uint8Array(e);for(var i=n=0;i<arguments.length;++i)e.set(arguments[i],n),n+=arguments[i].length;return e}function zt(t){this.s=t,this.l=this.j=this.u=null,this.L=!1,this.b=null,this.g=new wt,this.a=[],this.o=[],this.i=new q,this.f=null,this.h=function(e){this.i.reject(e),t.onError(e)}.bind(this),this.S={},this.m={},this.G=new Bt(this.oe.bind(this)),this.ga=this.c=!1,this.I=[],this.Y=!1,this.A=new Bt(this.ne.bind(this)),Vt(this.A,1),this.i.catch(function(){})}function Wt(t,e){return Promise.all(e.map(function(t){return oe(this,t).then(function(t){if(t){for(var e=new q,n=0;n<this.a.length;n++)if(this.a[n].ja==t){this.a[n].qa=e;break}return Promise.all([t.remove(),e])}}.bind(this))}.bind(t)))}function $t(t){var e=t.b?t.b.initData:[];return e.forEach(function(t){se(this,t.initDataType,t.initData)}.bind(t)),t.o.forEach(function(t){oe(this,t)}.bind(t)),e.length||t.o.length||t.i.resolve(),t.i}function Jt(t,e,n){for(var i=o(t.a),r=i.next();!r.done;r=i.next())if(Xt(n,r.value.initData))return;se(t,e,n)}function Qt(t){return t.a.map(function(t){return t.ja.sessionId})}function Zt(e,n,i,r,a){var o=ne(e),s=ie(e,n);n.periods.forEach(function(e){e.variants.forEach(function(e){o&&(e.drmInfos=[o]),s&&(e.drmInfos=s),e.drmInfos.forEach(function(n){ee(this,n),t.cast&&t.cast.__platform__&&"com.microsoft.playready"==n.keySystem&&(n.keySystem="com.chromecast.playready");var o=r[n.keySystem];o||(o={audioCapabilities:[],videoCapabilities:[],distinctiveIdentifier:"optional",persistentState:i?"required":"optional",sessionTypes:[i?"persistent-license":"temporary"],label:n.keySystem,drmInfos:[]},r[n.keySystem]=o,a.push(n.keySystem)),o.drmInfos.push(n),n.distinctiveIdentifierRequired&&(o.distinctiveIdentifier="required"),n.persistentStateRequired&&(o.persistentState="required");var s=[];e.video&&s.push(e.video),e.audio&&s.push(e.audio),s.forEach(function(t){("video"==t.type?o.videoCapabilities:o.audioCapabilities).push({robustness:("video"==t.type?n.videoRobustness:n.audioRobustness)||"",contentType:Ct(t.mimeType,t.codecs)})}.bind(this))}.bind(this))}.bind(this))}.bind(e))}function te(t,e,n,i){if(1==n.length&&""==n[0])return Promise.reject(new z(2,6,6e3));var r=new q,a=r;return[!0,!1].forEach(function(t){n.forEach(function(n){var i=e[n];i.drmInfos.some(function(t){return!!t.licenseServerUri})==t&&(0==i.audioCapabilities.length&&delete i.audioCapabilities,0==i.videoCapabilities.length&&delete i.videoCapabilities,a=a.catch(function(){return this.c?Promise.reject():navigator.requestMediaKeySystemAccess(n,[i])}.bind(this)))}.bind(this))}.bind(t)),a=a.catch(function(){return Promise.reject(new z(2,6,6001))}),a=a.then(function(t){if(this.c)return Promise.reject();var n=0<=navigator.userAgent.indexOf("Edge/"),i=t.getConfiguration();return this.u=(i.audioCapabilities||[]).concat(i.videoCapabilities||[]).map(function(t){return t.contentType}),n&&(this.u=null),n=e[t.keySystem],re(this,t.keySystem,n,n.drmInfos),this.b.licenseServerUri?t.createMediaKeys():Promise.reject(new z(2,6,6012))}.bind(t)).then(function(t){if(this.c)return Promise.reject();this.j=t,this.L=!0}.bind(t)).catch(function(t){return this.c?Promise.resolve():(this.u=this.b=null,t instanceof z?Promise.reject(t):Promise.reject(new z(2,6,6002,t.message)))}.bind(t)),i||(a=a.catch(function(){})),r.reject(),a}function ee(t,e){var n=e.keySystem;if(n){if(!e.licenseServerUri){var i=t.f.servers[n];i&&(e.licenseServerUri=i)}e.keyIds||(e.keyIds=[]),(n=t.f.advanced[n])&&(e.distinctiveIdentifierRequired||(e.distinctiveIdentifierRequired=n.distinctiveIdentifierRequired),e.persistentStateRequired||(e.persistentStateRequired=n.persistentStateRequired),e.videoRobustness||(e.videoRobustness=n.videoRobustness),e.audioRobustness||(e.audioRobustness=n.audioRobustness),e.serverCertificate||(e.serverCertificate=n.serverCertificate))}}function ne(e){if($u.empty(e.f.clearKeys))return null;var n,i=[],r=[];for(n in e.f.clearKeys){var a=e.f.clearKeys[n],o=qt(n);a=qt(a),o={kty:"oct",kid:Kt(o,!1),k:Kt(a,!1)},i.push(o),r.push(o.kid)}return e=JSON.stringify({keys:i}),r=JSON.stringify({kids:r}),r=[{initData:new Uint8Array(Ut(r)),initDataType:"keyids"}],{keySystem:"org.w3.clearkey",licenseServerUri:"data:application/json;base64,"+t.btoa(e),distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:r,keyIds:[]}}function ie(t,e){var n=t.f,i=Object.keys(n.servers);return!i.length||e.periods.some(function(t){return t.variants.some(function(t){return t.drmInfos.length})})?null:i.map(function(t){return{keySystem:t,licenseServerUri:n.servers[t],distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:[],keyIds:[]}})}function re(t,e,n,i){var r=[],a=[],o=[],s=[];ae(i,r,a,o,s),t.b={keySystem:e,licenseServerUri:r[0],distinctiveIdentifierRequired:"required"==n.distinctiveIdentifier,persistentStateRequired:"required"==n.persistentState,audioRobustness:n.audioCapabilities?n.audioCapabilities[0].robustness:"",videoRobustness:n.videoCapabilities?n.videoCapabilities[0].robustness:"",serverCertificate:a[0],initData:o,keyIds:s}}function ae(t,e,n,i,r){function a(t,e){return!(!t.keyId||t.keyId!=e.keyId)||t.initDataType==e.initDataType&&Xt(t.initData,e.initData)}t.forEach(function(t){if(-1==e.indexOf(t.licenseServerUri)&&e.push(t.licenseServerUri),t.serverCertificate&&-1==rt(n,t.serverCertificate,Xt)&&n.push(t.serverCertificate),t.initData&&t.initData.forEach(function(t){-1==rt(i,t,a)&&i.push(t)}),t.keyIds)for(var o=0;o<t.keyIds.length;++o)-1==r.indexOf(t.keyIds[o])&&r.push(t.keyIds[o])})}function oe(t,e){try{var n=t.j.createSession("persistent-license")}catch(e){var i=new z(2,6,6005,e.message);return t.h(i),Promise.reject(i)}Tt(t.g,n,"message",t.Ic.bind(t)),Tt(t.g,n,"keystatuseschange",t.Ec.bind(t));var r={initData:null,ja:n,loaded:!1,Tb:1/0,qa:null};return t.a.push(r),n.load(e).then(function(t){if(!this.c){if(t)return r.loaded=!0,this.a.every(function(t){return t.loaded})&&this.i.resolve(),n;this.a.splice(this.a.indexOf(r),1),this.h(new z(2,6,6013))}}.bind(t),function(t){this.c||(this.a.splice(this.a.indexOf(r),1),this.h(new z(2,6,6005,t.message)))}.bind(t))}function se(t,e,n){try{var i=t.ga?t.j.createSession("persistent-license"):t.j.createSession()}catch(e){return void t.h(new z(2,6,6005,e.message))}Tt(t.g,i,"message",t.Ic.bind(t)),Tt(t.g,i,"keystatuseschange",t.Ec.bind(t)),t.a.push({initData:n,ja:i,loaded:!1,Tb:1/0,qa:null}),i.generateRequest(e,n.buffer).catch(function(t){if(!this.c){for(var e=0;e<this.a.length;++e)if(this.a[e].ja==i){this.a.splice(e,1);break}this.h(new z(2,6,6006,t.message))}}.bind(t))}function ue(t,e){for(var n,i=e.target,r=0;r<t.a.length;r++)if(t.a[r].ja==i){n=t.a[r];break}r=pt([t.b.licenseServerUri],t.f.retryParameters),r.body=e.message,r.method="POST","com.microsoft.playready"!=t.b.keySystem&&"com.chromecast.playready"!=t.b.keySystem||ce(r),t.s.$a.request(2,r).promise.then(function(t){return this.c?Promise.reject():i.update(t.data).then(function(){this.s.onEvent(new At("drmsessionupdate")),n&&(n.qa&&n.qa.resolve(),setTimeout(function(){n.loaded=!0,this.a.every(function(t){return t.loaded})&&this.i.resolve()}.bind(this),1e3*Zu))}.bind(this))}.bind(t),function(t){if(this.c)return Promise.resolve();t=new z(2,6,6007,t),this.h(t),n&&n.qa&&n.qa.reject(t)}.bind(t)).catch(function(t){if(this.c)return Promise.resolve();t=new z(2,6,6008,t.message),this.h(t),n&&n.qa&&n.qa.reject(t)}.bind(t))}function ce(t){var e=Lt(t.body,!0,!0);if(-1==e.indexOf("PlayReadyKeyMessage"))t.headers["Content-Type"]="text/xml; charset=utf-8";else{e=(new DOMParser).parseFromString(e,"application/xml");for(var n=e.getElementsByTagName("HttpHeader"),i=0;i<n.length;++i)t.headers[n[i].querySelector("name").textContent]=n[i].querySelector("value").textContent;t.body=Ht(e.querySelector("Challenge").textContent).buffer}}function he(){var t=[],e=[{contentType:'video/mp4; codecs="avc1.42E01E"'},{contentType:'video/webm; codecs="vp8"'}],n=[{videoCapabilities:e,persistentState:"required",sessionTypes:["persistent-license"]},{videoCapabilities:e}],i={};return"org.w3.clearkey com.widevine.alpha com.microsoft.playready com.apple.fps.2_0 com.apple.fps.1_0 com.apple.fps com.adobe.primetime".split(" ").forEach(function(e){var r=navigator.requestMediaKeySystemAccess(e,n).then(function(t){var n=t.getConfiguration().sessionTypes;return n=!!n&&0<=n.indexOf("persistent-license"),0<=navigator.userAgent.indexOf("Tizen 3")&&(n=!1),i[e]={persistentState:n},t.createMediaKeys()}).catch(function(){i[e]=null});t.push(r)}),Promise.all(t).then(function(){return i})}function le(t,e){var n=t.keySystem();return 0==e.drmInfos.length||e.drmInfos.some(function(t){return t.keySystem==n})}function fe(t,e){if(!t.length)return e;if(!e.length)return t;for(var n=[],i=0;i<t.length;i++)for(var r=0;r<e.length;r++)if(t[i].keySystem==e[r].keySystem){var a=t[i];r=e[r];var o=[];o=o.concat(a.initData||[]),o=o.concat(r.initData||[]);var s=[];s=s.concat(a.keyIds),s=s.concat(r.keyIds),n.push({keySystem:a.keySystem,licenseServerUri:a.licenseServerUri||r.licenseServerUri,distinctiveIdentifierRequired:a.distinctiveIdentifierRequired||r.distinctiveIdentifierRequired,persistentStateRequired:a.persistentStateRequired||r.persistentStateRequired,videoRobustness:a.videoRobustness||r.videoRobustness,audioRobustness:a.audioRobustness||r.audioRobustness,serverCertificate:a.serverCertificate||r.serverCertificate,initData:o,keyIds:s});break}return n}function de(t){return!t||1==t.length&&1e-6>t.end(0)-t.start(0)?null:t.length?t.end(t.length-1):null}function pe(t,e,n){return n=void 0===n?0:n,!(!t||!t.length||1==t.length&&1e-6>t.end(0)-t.start(0)||e>t.end(t.length-1))&&e+n>=t.start(0)}function me(t,e){if(!t||!t.length||1==t.length&&1e-6>t.end(0)-t.start(0))return 0;for(var n=0,i=t.length-1;0<=i&&t.end(i)>e;--i)n+=t.end(i)-Math.max(t.start(i),e);return n}function ve(t){if(!t)return[];for(var e=[],n=0;n<t.length;n++)e.push({start:t.start(n),end:t.end(n)});return e}function ye(t,e,n){this.startTime=t,this.endTime=e,this.payload=n,this.region=new ge,this.position=null,this.positionAlign=ec,this.size=100,this.textAlign=nc,this.writingDirection=oc,this.lineInterpretation=sc,this.line=null,this.lineHeight="",this.lineAlign=uc,this.displayAlign=rc,this.fontSize=this.backgroundColor=this.color="",this.fontWeight=hc,this.fontStyle=lc,this.fontFamily="",this.textDecoration=[],this.wrapLine=!0,this.id=""}function ge(){this.id="",this.regionAnchorY=this.regionAnchorX=this.viewportAnchorY=this.viewportAnchorX=0,this.height=this.width=100,this.viewportAnchorUnits=this.widthUnits=this.heightUnits=dc,this.scroll=pc}function be(){this.a=new muxjs.mp4.Transmuxer({keepOriginalTimestamps:!0}),this.b=null,this.g=[],this.c=[],this.f=!1,this.a.on("data",this.i.bind(this)),this.a.on("done",this.h.bind(this))}function we(e,n){return!(!t.muxjs||"mp2t"!=e.split(";")[0].split("/")[1])&&(n?MediaSource.isTypeSupported(Te(n,e)):MediaSource.isTypeSupported(Te("audio",e))||MediaSource.isTypeSupported(Te("video",e)))}function Te(t,e){var n=e.replace("mp2t","mp4");"audio"==t&&(n=n.replace("video","audio"));var i=/avc1\.(66|77|100)\.(\d+)/.exec(n);if(i){var r="avc1.",a=i[1],o=Number(i[2]);r=("66"==a?r+"4200":"77"==a?r+"4d00":r+"6400")+(o>>4).toString(16),r+=(15&o).toString(16),n=n.replace(i[0],r)}return n}function Ee(t,e){t.f=!0,t.b=new q,t.g=[],t.c=[];var n=new Uint8Array(e);return t.a.push(n),t.a.flush(),t.f&&t.b.reject(new z(2,3,3018)),t.b}function Se(t){this.f=null,this.c=t,this.h=this.i=0,this.g=1/0,this.b=this.a=null}function ke(t,e,n,i){return Promise.resolve().then(function(){if(this.f&&this.c)if(null==n||null==i)this.f.parseInit(new Uint8Array(e));else{var t={periodStart:this.i,segmentStart:n,segmentEnd:i};t=this.f.parseMedia(new Uint8Array(e),t).filter(function(t){return t.startTime>=this.h&&t.startTime<this.g}.bind(this)),this.c.append(t),null==this.a&&(this.a=Math.max(n,this.h)),this.b=Math.min(i,this.g)}}.bind(t))}function Ae(e){this.f=e,this.o=null,this.b={},this.a=null,this.c={},this.h=new wt,this.m=!1,this.i={},this.l=!1,e=this.j=new q;var n=new MediaSource;Et(this.h,n,"sourceopen",e.resolve),this.f.src=t.URL.createObjectURL(n),this.g=n}function _e(){var t={};return'video/mp4; codecs="avc1.42E01E",video/mp4; codecs="avc3.42E01E",video/mp4; codecs="hev1.1.6.L93.90",video/mp4; codecs="hvc1.1.6.L93.90",video/mp4; codecs="hev1.2.4.L153.B0"; eotf="smpte2084",video/mp4; codecs="hvc1.2.4.L153.B0"; eotf="smpte2084",video/mp4; codecs="vp9",video/mp4; codecs="vp09.00.10.08",audio/mp4; codecs="mp4a.40.2",audio/mp4; codecs="ac-3",audio/mp4; codecs="ec-3",audio/mp4; codecs="opus",audio/mp4; codecs="flac",video/webm; codecs="vp8",video/webm; codecs="vp9",video/webm; codecs="vp09.00.10.08",audio/webm; codecs="vorbis",audio/webm; codecs="opus",video/mp2t; codecs="avc1.42E01E",video/mp2t; codecs="avc3.42E01E",video/mp2t; codecs="hvc1.1.6.L93.90",video/mp2t; codecs="mp4a.40.2",video/mp2t; codecs="ac-3",video/mp2t; codecs="ec-3",text/vtt,application/mp4; codecs="wvtt",application/ttml+xml,application/mp4; codecs="stpp"'.split(",").forEach(function(e){t[e]=!!mc[e]||MediaSource.isTypeSupported(e)||we(e);var n=e.split(";")[0];t[n]=t[n]||t[e]}),t}function Ie(t,e){t.a||(t.a=new Se(t.o)),t.a.f=new mc[e]}function xe(t,e){if("text"==e)var n=t.a.a;else n=Ne(t,e),n=!n||1==n.length&&1e-6>n.end(0)-n.start(0)?null:1==n.length&&0>n.start(0)?0:n.length?n.start(0):null;return n}function Pe(t,e){return"text"==e?t.a.b:de(Ne(t,e))}function Re(t,e,n){return"text"==e?(t=t.a,null==t.b||t.b<n?0:t.b-Math.max(n,t.a)):(t=Ne(t,e),me(t,n))}function Ne(t,e){try{return t.b[e].buffered}catch(t){return null}}function De(t,e,n,i,r){return"text"==e?ke(t.a,n,i,r):t.i[e]?Ee(t.i[e],n).then(function(t){return this.a||Ie(this,"text/vtt"),this.l&&this.a.lc(t.cues),Le(this,e,this.Vc.bind(this,e,t.data.buffer))}.bind(t)):Le(t,e,t.Vc.bind(t,e,n))}function Ce(t,e){return"text"==e?t.a?t.a.remove(0,1/0):Promise.resolve():Le(t,e,t.Wc.bind(t,e,0,t.g.duration))}function Me(t,e,n,i,r){return"text"==e?(t.a.i=n,t=t.a,t.h=i,t.g=r,Promise.resolve()):Promise.all([Le(t,e,t.cd.bind(t,e)),Le(t,e,t.Ge.bind(t,e,n)),Le(t,e,t.De.bind(t,e,i,r))])}function Le(t,e,n){if(t.m)return Promise.reject();if(n={start:n,p:new q},t.c[e].push(n),1==t.c[e].length)try{n.start()}catch(i){"QuotaExceededError"==i.name?n.p.reject(new z(2,3,3017,e)):n.p.reject(new z(2,3,3015,i)),Ue(t,e)}return n.p}function Oe(t,e){if(t.m)return Promise.reject();var n,i=[];for(n in t.b){var r=new q,a={start:function(t){t.resolve()}.bind(null,r),p:r};t.c[n].push(a),i.push(r),1==t.c[n].length&&a.start()}return Promise.all(i).then(function(){try{e()}catch(e){var t=Promise.reject(new z(2,3,3015,e))}for(var n in this.b)Ue(this,n);return t}.bind(t),function(){return Promise.reject()}.bind(t))}function Ue(t,e){t.c[e].shift();var n=t.c[e][0];if(n)try{n.start()}catch(i){n.p.reject(new z(2,3,3015,i)),Ue(t,e)}}function je(t,e,n){return n==e||t>=vc&&n==e.split("-")[0]||t>=yc&&n.split("-")[0]==e.split("-")[0]}function Be(t){t=t.toLowerCase().split("-");var e=gc[t[0]];return e&&(t[0]=e),t.join("-")}function Fe(t,e,n){var i=t.video;return!(i&&(i.width<e.minWidth||i.width>e.maxWidth||i.width>n.width||i.height<e.minHeight||i.height>e.maxHeight||i.height>n.height||i.width*i.height<e.minPixels||i.width*i.height>e.maxPixels)||t.bandwidth<e.minBandwidth||t.bandwidth>e.maxBandwidth)}function Ve(t,e,n){var i=!1;return t.variants.forEach(function(t){var r=t.allowedByApplication;t.allowedByApplication=Fe(t,e,n),r!=t.allowedByApplication&&(i=!0)}),i}function Ke(t,e,n,i){i.variants=i.variants.filter(function(i){return!(t&&t.L&&!le(t,i))&&(He(i.audio,t,e)&&He(i.video,t,n))}),i.textStreams=i.textStreams.filter(function(t){return!!mc[Ct(t.mimeType,t.codecs)]})}function He(t,e,n){if(!t)return!0;var i=null;e&&e.L&&(i=e.u),e=Ct(t.mimeType,t.codecs);var r,a=Ct(t.mimeType,t.codecs),o=t.mimeType;for(r in Ju){var s=t[r],u=Ju[r];s&&(o+="; "+u+'="'+s+'"')}return!(!(mc[a]||MediaSource.isTypeSupported(o)||we(a,t.type))||i&&t.encrypted&&0>i.indexOf(e)||n&&(t.mimeType!=n.mimeType||t.codecs.split(".")[0]!=n.codecs.split(".")[0]))}function qe(t){var e=t.audio,n=t.video,i=e?e.codecs:null,r=n?n.codecs:null,a=[];r&&a.push(r),i&&a.push(i);var o=[];n&&o.push(n.mimeType),e&&o.push(e.mimeType),o=o[0]||null;var s=[];e&&s.push(e.kind),n&&s.push(n.kind),s=s[0]||null;var u=[];return e&&u.push.apply(u,e.roles),n&&u.push.apply(u,n.roles),u=it(u),t={id:t.id,active:!1,type:"variant",bandwidth:t.bandwidth,language:t.language,label:null,kind:s,width:null,height:null,frameRate:null,mimeType:o,codecs:a.join(", "),audioCodec:i,videoCodec:r,primary:t.primary,roles:u,videoId:null,audioId:null,channelsCount:null,audioBandwidth:null,videoBandwidth:null},n&&(t.videoId=n.id,t.width=n.width||null,t.height=n.height||null,t.frameRate=n.frameRate||null,t.videoBandwidth=n.bandwidth||null),e&&(t.audioId=e.id,t.channelsCount=e.channelsCount,t.audioBandwidth=e.bandwidth||null,t.label=e.label),t}function Ge(t){return{id:t.id,active:!1,type:"text",bandwidth:0,language:t.language,label:t.label,kind:t.kind||null,width:null,height:null,frameRate:null,mimeType:t.mimeType,codecs:t.codecs||null,audioCodec:null,videoCodec:null,primary:t.primary,roles:t.roles,videoId:null,audioId:null,channelsCount:null,audioBandwidth:null,videoBandwidth:null}}function Xe(t){var e=[],n=Je(t.variants);return t=t.textStreams,n.forEach(function(t){e.push(qe(t))}),t.forEach(function(t){e.push(Ge(t))}),e}function Ye(t,e,n){return Je(t.variants).map(function(t){var i=qe(t);return t.video&&t.audio?i.active=n==t.video.id&&e==t.audio.id:t.video?i.active=n==t.video.id:t.audio&&(i.active=e==t.audio.id),i})}function ze(t,e){return t.textStreams.map(function(t){var n=Ge(t);return n.active=e==t.id,n})}function We(t,e){for(var n=0;n<t.variants.length;n++)if(t.variants[n].id==e.id)return t.variants[n];return null}function $e(t){return t.allowedByApplication&&t.allowedByKeySystem}function Je(t){return t.filter(function(t){return $e(t)})}function Qe(t,e,n,i,r){return t=Ze(t,e,n,r),tn(t,i)}function Ze(t,e,n,i){var r=Je(t),a=r;t=r.filter(function(t){return t.primary}),t.length&&(a=t);var o=a.length?a[0].language:"";if(a=a.filter(function(t){return t.language==o}),e){var s=Be(e);[yc,vc,0].forEach(function(t){var e=!1;r.forEach(function(n){s=Be(s);var r=Be(n.language);je(t,s,r)&&(e?a.push(n):(a=[n],e=!0),i&&(i.audio=!0))})})}return n&&(e=nn(a,n),e.length)?e:(e=a.map(function(t){return(t.audio?t.audio.roles:[]).concat(t.video?t.video.roles:[])}).reduce(It,[]),e.length?nn(a,e[0]):a)}function tn(t,e){var n=t.filter(function(t){return t.audio&&t.audio.channelsCount}).reduce(function(t,e){var n=e.audio.channelsCount;return t[n]?t[n].push(e):t[n]=[e],t},{}),i=Object.keys(n);if(0==i.length)return t;var r=i.filter(function(t){return t<=e});return r.length?n[Math.max.apply(null,r)]:n[Math.min.apply(null,i)]}function en(t,e,n,i){var r=t,a=t.filter(function(t){return t.primary});a.length&&(r=a);var o=r.length?r[0].language:"";if(r=r.filter(function(t){return t.language==o}),e){var s=Be(e);[yc,vc,0].forEach(function(e){var n=!1;t.forEach(function(t){var a=Be(t.language);je(e,s,a)&&(n?r.push(t):(r=[t],n=!0),i&&(i.text=!0))})})}if(n){if(e=rn(r,n),e.length)return e}else if(e=r.filter(function(t){return 0==t.roles.length}),e.length)return e;return e=r.map(function(t){return t.roles}).reduce(It,[]),e.length?rn(r,e[0]):r}function nn(t,e){return t.filter(function(t){return t.audio&&0<=t.audio.roles.indexOf(e)||t.video&&0<=t.video.roles.indexOf(e)})}function rn(t,e){return t.filter(function(t){return 0<=t.roles.indexOf(e)})}function an(t,e,n){for(var i=0;i<n.length;i++)if(n[i].audio==t&&n[i].video==e)return n[i];return null}function on(t,e,n){function i(t,e){return null==t?null==e:e.id==t}for(var r=0;r<n.length;r++)if(i(t,n[r].audio)&&i(e,n[r].video))return n[r];return null}function sn(t,e){for(var n=t.periods.length-1;0<n;--n)if(e+Wu>=t.periods[n].startTime)return n;return 0}function un(t,e){for(var n=0;n<t.periods.length;++n){var i=t.periods[n];if("text"==e.type){for(var r=0;r<i.textStreams.length;++r)if(i.textStreams[r]==e)return n}else for(r=0;r<i.variants.length;++r){var a=i.variants[r];if(a.audio==e||a.video==e||a.video&&a.video.trickModeVideo==e)return n}}return-1}function cn(){this.h=null,this.f=!1,this.b=new D,this.c=[],this.i=!1,this.a=this.g=null}function hn(t,e){return t&&(e=e.filter(function(e){return Fe(e,t,{width:1/0,height:1/0})})),e.sort(function(t,e){return t.bandwidth-e.bandwidth})}function ln(t){return JSON.stringify(t,function(t,e){if("function"!=typeof e){if(e instanceof Event||e instanceof At){var n,i={};for(n in e){var r=e[n];r&&"object"==typeof r?"detail"==n&&(i[n]=r):n in Event||(i[n]=r)}return i}if(e instanceof TimeRanges)for(i={__type__:"TimeRanges",length:e.length,start:[],end:[]},n=0;n<e.length;++n)i.start.push(e.start(n)),i.end.push(e.end(n));else i="number"==typeof e?isNaN(e)?"NaN":isFinite(e)?e:0>e?"-Infinity":"Infinity":e;return i}})}function fn(t){return JSON.parse(t,function(t,e){return"NaN"==e?NaN:"-Infinity"==e?-1/0:"Infinity"==e?1/0:e&&"object"==typeof e&&"TimeRanges"==e.__type__?dn(e):e})}function dn(t){return{length:t.length,start:function(e){return t.start[e]},end:function(e){return t.end[e]}}}function pn(t,e,n,i,r,a){this.I=t,this.g=e,this.L=n,this.j=!1,this.A=i,this.G=r,this.s=a,this.b=this.h=!1,this.u="",this.i=null,this.l=this.Cc.bind(this),this.m=this.Pd.bind(this),this.a={video:{},player:{}},this.o=0,this.c={},this.f=null}function mn(t){var e=Nc;e.removeUpdateListener(t.l),e.removeMessageListener("urn:x-cast:com.google.shaka.v2",t.m)}function vn(t){for(var e in t.c){var n=t.c[e];delete t.c[e],n.reject(new z(1,7,7e3))}}function yn(t){t=ln(t),Nc.sendMessage("urn:x-cast:com.google.shaka.v2",t,function(){},M)}function gn(){this.Bb=new bt,this.jb=this}function bn(t,e,n){gn.call(this),this.c=t,this.b=e,this.i=this.g=this.f=this.j=this.h=null,this.a=new pn(n,this.Le.bind(this),this.Me.bind(this),this.Ne.bind(this),this.Oe.bind(this),this.tc.bind(this)),wn(this)}function wn(t){t.a.init(),t.i=new wt,bc.forEach(function(t){Tt(this.i,this.c,t,this.$e.bind(this))}.bind(t)),Sc.forEach(function(t){Tt(this.i,this.b,t,this.le.bind(this))}.bind(t)),t.h={};for(var e in t.c)Object.defineProperty(t.h,e,{configurable:!1,enumerable:!0,get:t.Ze.bind(t,e),set:t.af.bind(t,e)});t.j={};for(var n in t.b)Object.defineProperty(t.j,n,{configurable:!1,enumerable:!0,get:t.ke.bind(t,n)});t.f=new gn,t.f.jb=t.h,t.g=new gn,t.g.jb=t.j}function Tn(t,e,n,i){gn.call(this),this.a=t,this.b=e,this.c=new wt,this.s={video:t,player:e},this.u=n||function(){},this.A=i||function(t){return t},this.o=!1,this.h=!0,this.g=0,this.m=!1,this.j=!0,this.l=this.i=this.f=null,En(this)}function En(e){var n=cast.receiver.CastReceiverManager.getInstance();n.onSenderConnected=e.Hc.bind(e),n.onSenderDisconnected=e.Hc.bind(e),n.onSystemVolumeChanged=e.ld.bind(e),e.i=n.getCastMessageBus("urn:x-cast:com.google.cast.media"),e.i.onMessage=e.Kd.bind(e),e.f=n.getCastMessageBus("urn:x-cast:com.google.shaka.v2"),e.f.onMessage=e.Zd.bind(e),n.start(),bc.forEach(function(t){Tt(this.c,this.a,t,this.Kc.bind(this,"video"))}.bind(e)),Sc.forEach(function(t){Tt(this.c,this.b,t,this.Kc.bind(this,"player"))}.bind(e)),cast.__platform__&&cast.__platform__.canDisplayType('video/mp4; codecs="avc1.640028"; width=3840; height=2160')?e.b.cc(3840,2160):e.b.cc(1920,1080),Tt(e.c,e.a,"loadeddata",function(){this.m=!0}.bind(e)),Tt(e.c,e.b,"loading",function(){this.h=!1,Sn(this)}.bind(e)),Tt(e.c,e.a,"playing",function(){this.h=!1,Sn(this)}.bind(e)),Tt(e.c,e.a,"pause",function(){Sn(this)}.bind(e)),Tt(e.c,e.b,"unloading",function(){this.h=!0,Sn(this)}.bind(e)),Tt(e.c,e.a,"ended",function(){t.setTimeout(function(){this.a&&this.a.ended&&(this.h=!0,Sn(this))}.bind(this),5e3)}.bind(e))}function Sn(t){Promise.resolve().then(function(){this.b&&(this.dispatchEvent(new At("caststatuschanged")),An(this)||xn(this,0))}.bind(t))}function kn(t,e,n){for(var i in e.player)t.b[i](e.player[i]);t.u(n),n=Promise.resolve();var r=t.a.autoplay;e.manifest&&(t.a.autoplay=!1,n=t.b.load(e.manifest,e.startTime)),n.then(function(){if(t.b){for(var n in e.video)t.a[n]=e.video[n];for(var i in e.playerAfterLoad)t.b[i](e.playerAfterLoad[i]);t.a.autoplay=r,e.manifest&&(t.a.play(),xn(t,0))}},function(e){t.b.dispatchEvent(new At("error",{detail:e}))})}function An(t){return!(!t.j||!t.a.duration&&!t.b.P())&&(_n(t),t.j=!1,!0)}function _n(t){xn(t,0,{contentId:t.b.Ib(),streamType:t.b.P()?"LIVE":"BUFFERED",duration:t.a.duration,contentType:""})}function In(t,e,n,i){t.o&&(t=ln(e),i?n.getCastChannel(i).send(t):n.broadcast(t))}function xn(t,e,n){var i=t.a.playbackRate,r=Dc;r=t.h?r.IDLE:t.b.xc()?r.Yc:t.a.paused?r.$c:r.ad,i={mediaSessionId:0,playbackRate:i,playerState:r,currentTime:t.a.currentTime,supportedMediaCommands:15,volume:{level:t.a.volume,muted:t.a.muted}},n&&(i.media=n),In(t,{requestId:e,type:"MEDIA_STATUS",status:[i]},t.i)}function Pn(t,e){var n=Rn(t,e);return 1!=n.length?null:n[0]}function Rn(t,e){return Array.prototype.filter.call(t.childNodes,function(t){return t instanceof Element&&t.tagName==e})}function Nn(t){return Array.prototype.filter.call(t.childNodes,function(t){return t instanceof Element&&"pssh"==t.localName&&"urn:mpeg:cenc:2013"==t.namespaceURI})}function Dn(t,e,n){return t.hasAttributeNS(e,n)?t.getAttributeNS(e,n):null}function Cn(t){return Array.prototype.every.call(t.childNodes,function(t){return t.nodeType==Node.TEXT_NODE||t.nodeType==Node.CDATA_SECTION_NODE})?t.textContent.trim():null}function Mn(t,e,n,i){var r=null;return t=t.getAttribute(e),null!=t&&(r=n(t)),null==r?void 0!=i?i:null:r}function Ln(t){return t?(/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(t)&&(t+="Z"),t=Date.parse(t),isNaN(t)?null:Math.floor(t/1e3)):null}function On(t){return t&&(t=/^P(?:([0-9]*)Y)?(?:([0-9]*)M)?(?:([0-9]*)D)?(?:T(?:([0-9]*)H)?(?:([0-9]*)M)?(?:([0-9.]*)S)?)?$/.exec(t))?(t=31536e3*Number(t[1]||null)+2592e3*Number(t[2]||null)+86400*Number(t[3]||null)+3600*Number(t[4]||null)+60*Number(t[5]||null)+Number(t[6]||null),isFinite(t)?t:null):null}function Un(t){var e=/([0-9]+)-([0-9]+)/.exec(t);return e?(t=Number(e[1]),isFinite(t)?(e=Number(e[2]),isFinite(e)?{start:t,end:e}:null):null):null}function jn(t){return t=Number(t),0==t%1?t:null}function Bn(t){return t=Number(t),0==t%1&&0<t?t:null}function Fn(t){return t=Number(t),0==t%1&&0<=t?t:null}function Vn(t){var e;return t=(e=t.match(/^(\d+)\/(\d+)$/))?Number(e[1]/e[2]):Number(t),isNaN(t)?null:t}function Kn(t,e,n){t=Gn(t);var i=null,r=[],a=[],o=t.map(function(t){return t.keyId}).filter(Pt);if(o.length&&1<o.filter(Rt).length)throw new z(2,4,4010);n||(a=t.filter(function(t){return"urn:mpeg:dash:mp4protection:2011"!=t.Pc||(i=t.init||i,!1)}),a.length&&(r=qn(i,e,a),0==r.length&&(r=[Dt("",i)]))),!t.length||!n&&a.length||(r=$u.values(Cc).filter(function(t){return"org.w3.clearkey"!=t}).map(function(t){return Dt(t,i)}));var s=o[0]||null;return s&&r.forEach(function(t){t.initData.forEach(function(t){t.keyId=s})}),{nc:s,gf:i,drmInfos:r,sc:!0}}function Hn(t,e,n,i){var r=Kn(t,e,i);if(n.sc)t=1==n.drmInfos.length&&!n.drmInfos[0].keySystem,e=0==r.drmInfos.length,(0==n.drmInfos.length||t&&!e)&&(n.drmInfos=r.drmInfos),n.sc=!1;else if(0<r.drmInfos.length&&(n.drmInfos=n.drmInfos.filter(function(t){return r.drmInfos.some(function(e){return e.keySystem==t.keySystem})}),0==n.drmInfos.length))throw new z(2,4,4008);return r.nc||n.nc}function qn(t,e,n){return n.map(function(n){var i=Cc[n.Pc];return i?[Dt(i,n.init||t)]:e(n.node)||[]}).reduce(It,[])}function Gn(t){return t.map(function(t){var e=t.getAttribute("schemeIdUri"),n=Dn(t,"urn:mpeg:cenc:2013","default_KID"),i=Nn(t).map(Cn);if(!e)return null;if(e=e.toLowerCase(),n&&(n=n.replace(/-/g,"").toLowerCase(),0<=n.indexOf(" ")))throw new z(2,4,4009);var r=[];try{r=i.map(function(t){return{initDataType:"cenc",initData:Ht(t),keyId:null}})}catch(t){throw new z(2,4,4007)}return{node:t,Pc:e,keyId:n,init:0<r.length?r:null}}).filter(Pt)}function Xn(e,n,i,r,a){var o={RepresentationID:n,Number:i,Bandwidth:r,Time:a};return e.replace(/\$(RepresentationID|Number|Bandwidth|Time)?(?:%0([0-9]+)([diouxX]))?\$/g,function(e,n,i,r){if("$$"==e)return"$";var a=o[n];if(null==a)return e;switch("RepresentationID"==n&&i&&(i=void 0),"Time"==n&&(a=Math.round(a)),r){case void 0:case"d":case"i":case"u":e=a.toString();break;case"o":e=a.toString(8);break;case"x":e=a.toString(16);break;case"X":e=a.toString(16).toUpperCase();break;default:e=a.toString()}return i=t.parseInt(i,10)||1,Array(Math.max(0,i-e.length)+1).join("0")+e})}function Yn(t,e){var n=zn(t,e,"timescale"),i=1;n&&(i=Bn(n)||1),n=zn(t,e,"duration"),(n=Bn(n||""))&&(n/=i);var r=zn(t,e,"startNumber"),a=Number(zn(t,e,"presentationTimeOffset"))||0,o=Fn(r||"");null!=r&&null!=o||(o=1);var s=Wn(t,e,"SegmentTimeline");if(r=null,s){r=i;var u=t.M.duration||1/0;s=Rn(s,"S");for(var c=[],h=0,l=0;l<s.length;++l){var f=s[l],d=Mn(f,"t",Fn),p=Mn(f,"d",Fn);if(f=Mn(f,"r",jn),null!=d&&(d-=a),!p)break;if(d=null!=d?d:h,0>(f=f||0))if(l+1<s.length){if(null==(f=Mn(s[l+1],"t",Fn)))break;if(d>=f)break;f=Math.ceil((f-d)/p)-1}else{if(1/0==u)break;if(d/r>=u)break;f=Math.ceil((u*r-d)/p)-1}0<c.length&&d!=h&&(c[c.length-1].end=d/r);for(var m=0;m<=f;++m)h=d+p,c.push({start:d/r,end:h/r,We:d}),d=h}r=c}return{timescale:i,R:n,Ea:o,da:a/i||0,ic:a,H:r}}function zn(t,e,n){return[e(t.v),e(t.W),e(t.ba)].filter(Pt).map(function(t){return t.getAttribute(n)}).reduce(function(t,e){return t||e})}function Wn(t,e,n){return[e(t.v),e(t.W),e(t.ba)].filter(Pt).map(function(t){return Pn(t,n)}).reduce(function(t,e){return t||e})}function $n(t,e){var n=new DOMParser;try{var i=Mt(t),r=n.parseFromString(i,"text/xml")}catch(t){}if(r&&r.documentElement.tagName==e)var a=r.documentElement;return a&&0<a.getElementsByTagName("parsererror").length?null:a}function Jn(t,e,n,i,r,a){for(var o=Dn(t,"http://www.w3.org/1999/xlink","href"),s=Dn(t,"http://www.w3.org/1999/xlink","actuate")||"onRequest",u=0;u<t.attributes.length;u++){var c=t.attributes[u];"http://www.w3.org/1999/xlink"==c.namespaceURI&&(t.removeAttributeNS(c.namespaceURI,c.localName),--u)}if(5<=a)return $(new z(2,4,4028));if("onLoad"!=s)return $(new z(2,4,4027));var h=Nt([i],[o]);return r.request(0,pt(h,e)).X(function(i){if(!(i=$n(i.data,t.tagName)))return $(new z(2,4,4001,o));for(;t.childNodes.length;)t.removeChild(t.childNodes[0]);for(;i.childNodes.length;){var s=i.childNodes[0];i.removeChild(s),t.appendChild(s)}for(s=0;s<i.attributes.length;s++){var u=i.attributes[s].nodeName,c=i.getAttribute(u);t.setAttribute(u,c)}return Qn(t,e,n,h[0],r,a+1)})}function Qn(t,e,n,i,r,a){if(a=a||0,Dn(t,"http://www.w3.org/1999/xlink","href")){var o=Jn(t,e,n,i,r,a);return n&&(o=o.X(void 0,function(){return Qn(t,e,n,i,r,a)})),o}o=[];for(var s=0;s<t.childNodes.length;s++){var u=t.childNodes[s];u instanceof Element&&("urn:mpeg:dash:resolve-to-zero:2013"==Dn(u,"http://www.w3.org/1999/xlink","href")?(t.removeChild(u),--s):"SegmentTimeline"!=u.tagName&&o.push(Qn(u,e,n,i,r,a)))}return tt(o).X(function(){return t})}function Zn(t,e,n){this.c=t,this.b=e,this.a=n}function ti(t,e,n,i,r,a){this.position=t,this.startTime=e,this.endTime=n,this.c=i,this.b=r,this.a=a}function ei(t,e){this.D=t,this.b=e==Mc,this.a=0}function ni(){throw new z(2,3,3e3)}function ii(){this.c=[],this.b=[],this.a=!1}function ri(t){for(;t.reader.ha()&&!t.parser.a;)t.parser.xb(t.start,t.reader,t.partialOkay)}function ai(t){for(var e=t.reader.B();0<e&&!t.parser.a;--e)t.parser.xb(t.start,t.reader,t.partialOkay)}function oi(t){return function(e){t(e.reader.Da(e.reader.D.byteLength-e.reader.U()))}}function si(t){for(var e=0,n=0;n<t.length;n++)e=e<<8|t.charCodeAt(n);return e}function ui(t){return String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,255&t)}function ci(t,e,n,i){var r,a=(new ii).Z("sidx",function(t){r=hi(e,i,n,t)});if(t&&a.parse(t),r)return r;throw new z(2,3,3004)}function hi(t,e,n,i){var r=[];i.reader.F(4);var a=i.reader.B();if(0==a)throw new z(2,3,3005);if(0==i.version)var o=i.reader.B(),s=i.reader.B();else o=i.reader.Ra(),s=i.reader.Ra();i.reader.F(2);var u=i.reader.bb();for(t=t+i.size+s,s=0;s<u;s++){var c=i.reader.B(),h=(2147483648&c)>>>31;c&=2147483647;var l=i.reader.B();if(i.reader.F(4),1==h)throw new z(2,3,3006);r.push(new ti(r.length,o/a-e,(o+l)/a-e,function(){return n},t,t+c-1)),o+=l,t+=c}return i.parser.stop(),r}function li(t){this.a=t}function fi(t,e){for(;t.a.length&&t.a[t.a.length-1].startTime>=e;)t.a.pop();for(;t.a.length&&0>=t.a[0].endTime;)t.a.shift();if(0!=t.a.length){var n=t.a[t.a.length-1];t.a[t.a.length-1]=new ti(n.position,n.startTime,e,n.c,n.b,n.a)}}function di(t){this.b=t,this.a=new ei(t,0),Lc||(Lc=[new Uint8Array([255]),new Uint8Array([127,255]),new Uint8Array([63,255,255]),new Uint8Array([31,255,255,255]),new Uint8Array([15,255,255,255,255]),new Uint8Array([7,255,255,255,255,255]),new Uint8Array([3,255,255,255,255,255,255]),new Uint8Array([1,255,255,255,255,255,255,255])])}function pi(t){var e=mi(t);if(7<e.length)throw new z(2,3,3002);for(var n=0,i=0;i<e.length;i++)n=256*n+e[i];e=n,n=mi(t);t:{for(i=0;i<Lc.length;i++)if(Xt(n,Lc[i])){i=!0;break t}i=!1}if(i)n=t.b.byteLength-t.a.U();else{if(8==n.length&&224&n[1])throw new z(2,3,3001);i=n[0]&(1<<8-n.length)-1;for(var r=1;r<n.length;r++)i=256*i+n[r];n=i}return n=t.a.U()+n<=t.b.byteLength?n:t.b.byteLength-t.a.U(),i=new DataView(t.b.buffer,t.b.byteOffset+t.a.U(),n),t.a.F(n),new vi(e,i)}function mi(t){var e,n=t.a.ca();for(e=1;8>=e&&!(n&1<<8-e);e++);if(8<e)throw new z(2,3,3002);var i=new Uint8Array(e);for(i[0]=n,n=1;n<e;n++)i[n]=t.a.ca();return i}function vi(t,e){this.id=t,this.a=e}function yi(t){if(8<t.a.byteLength)throw new z(2,3,3002);if(8==t.a.byteLength&&224&t.a.getUint8(0))throw new z(2,3,3001);for(var e=0,n=0;n<t.a.byteLength;n++){e=256*e+t.a.getUint8(n)}return e}function gi(){}function bi(t,e,n,i,r,a){function o(){return r}var s=[];t=new di(t.a);for(var u=null,c=null;t.ha();){var h=pi(t);if(187==h.id){var l=wi(h);l&&(h=n*l.Xe,l=e+l.re,null!=u&&s.push(new ti(s.length,u-a,h-a,o,c,l-1)),u=h,c=l)}}return null!=u&&s.push(new ti(s.length,u-a,i-a,o,c,null)),s}function wi(t){var e=new di(t.a);if(t=pi(e),179!=t.id)throw new z(2,3,3013);if(t=yi(t),e=pi(e),183!=e.id)throw new z(2,3,3012);e=new di(e.a);for(var n=0;e.ha();){var i=pi(e);if(241==i.id){n=yi(i);break}}return{Xe:t,re:n}}function Ti(t,e){var n=Wn(t,e,"Initialization");if(!n)return null;var i=t.v.ea,r=n.getAttribute("sourceURL");r&&(i=Nt(t.v.ea,[r])),r=0;var a=null;return(n=Mn(n,"range",Un))&&(r=n.start,a=n.end),new Zn(function(){return i},r,a)}function Ei(t,e){var n=Number(zn(t,ki,"presentationTimeOffset"))||0,i=zn(t,ki,"timescale"),r=1;i&&(r=Bn(i)||1),n=n/r||0,i=Ti(t,ki);var a=t.v.contentType;if(r=t.v.mimeType.split("/")[1],"text"!=a&&"mp4"!=r&&"webm"!=r)throw new z(2,4,4006);if("webm"==r&&!i)throw new z(2,4,4005);a=Wn(t,ki,"RepresentationIndex");var o=zn(t,ki,"indexRange"),s=t.v.ea;if(o=Un(o||""),a){var u=a.getAttribute("sourceURL");u&&(s=Nt(t.v.ea,[u])),o=Mn(a,"range",Un,o)}if(!o)throw new z(2,4,4002);return r=Si(t,e,i,s,o.start,o.end,r,n),{createSegmentIndex:r.createSegmentIndex,findSegmentPosition:r.findSegmentPosition,getSegmentReference:r.getSegmentReference,initSegmentReference:i,da:n}}function Si(t,e,n,i,r,a,o,s){var u=t.presentationTimeline,c=!t.Ia||!t.M.Lb,h=t.M.index,l=t.M.duration,f=e,d=null;return{createSegmentIndex:function(){var t=[f(i,r,a),"webm"==o?f(n.c(),n.b,n.a):null];return f=null,Promise.all(t).then(function(t){var e=t[0];t=t[1]||null,e="mp4"==o?ci(e,r,i,s):(new gi).parse(e,t,i,s),u.Na(e,0==h),d=new li(e),c&&fi(d,l)})},findSegmentPosition:function(t){return d.find(t)},getSegmentReference:function(t){return d.get(t)}}}function ki(t){return t.cb}function Ai(t,e){var n=Ti(t,_i),i=xi(t),r=Yn(t,_i),a=r.Ea;0==a&&(a=1);var o=0;if(r.R?o=r.R*(a-1):r.H&&0<r.H.length&&(o=r.H[0].start),i={R:r.R,startTime:o,Ea:a,da:r.da,H:r.H,Ma:i},!i.R&&!i.H&&1<i.Ma.length)throw new z(2,4,4002);if(!i.R&&!t.M.duration&&!i.H&&1==i.Ma.length)throw new z(2,4,4002);if(i.H&&0==i.H.length)throw new z(2,4,4002);return a=r=null,t.ba.id&&t.v.id&&(a=t.ba.id+","+t.v.id,r=e[a]),o=Ii(t.M.duration,i.Ea,t.v.ea,i),r?(r.Pb(o),a=t.presentationTimeline.Xa(),r.Fb(a-t.M.start)):(t.presentationTimeline.Na(o,0==t.M.index),r=new li(o),a&&t.Ia&&(e[a]=r)),t.Ia&&t.M.Lb||fi(r,t.M.duration),{createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:r.find.bind(r),getSegmentReference:r.get.bind(r),initSegmentReference:n,da:i.da}}function _i(t){return t.ta}function Ii(t,e,n,i){var r=i.Ma.length;i.H&&i.H.length!=i.Ma.length&&(r=Math.min(i.H.length,i.Ma.length));for(var a=[],o=i.startTime,s=0;s<r;s++){var u=i.Ma[s],c=Nt(n,[u.Gd]),h=void 0;h=null!=i.R?o+i.R:i.H?i.H[s].end:o+t,a.push(new ti(s+e,o,h,function(t){return t}.bind(null,c),u.start,u.end)),o=h}return a}function xi(t){return[t.v.ta,t.W.ta,t.ba.ta].filter(Pt).map(function(t){return Rn(t,"SegmentURL")}).reduce(function(t,e){return 0<t.length?t:e}).map(function(e){e.getAttribute("indexRange")&&!t.wc&&(t.wc=!0);var n=e.getAttribute("media");return e=Mn(e,"mediaRange",Un,{start:0,end:null}),{Gd:n,start:e.start,end:e.end}})}function Pi(t,e,n,i){var r=Ci(t),a=Yn(t,Ri),o=zn(t,Ri,"media"),s=zn(t,Ri,"index");if(a={R:a.R,timescale:a.timescale,Ea:a.Ea,da:a.da,ic:a.ic,H:a.H,Ob:o,Za:s},o=a.Za?1:0,o+=a.H?1:0,0==(o+=a.R?1:0))throw new z(2,4,4002);if(1!=o&&(a.Za&&(a.H=null),a.R=null),!a.Za&&!a.Ob)throw new z(2,4,4002);if(a.Za){if("mp4"!=(n=t.v.mimeType.split("/")[1])&&"webm"!=n)throw new z(2,4,4006);if("webm"==n&&!r)throw new z(2,4,4005);i=Xn(a.Za,t.v.id,null,t.bandwidth||null,null),i=Nt(t.v.ea,[i]),t=Si(t,e,r,i,0,null,n,a.da)}else a.R?(i||t.presentationTimeline.Rb(a.R),t=Ni(t,a)):(o=e=null,t.ba.id&&t.v.id&&(o=t.ba.id+","+t.v.id,e=n[o]),s=Di(t,a),i=!t.Ia||!t.M.Lb,e?(i&&fi(new li(s),t.M.duration),e.Pb(s),n=t.presentationTimeline.Xa(),e.Fb(n-t.M.start)):(t.presentationTimeline.Na(s,0==t.M.index),e=new li(s),o&&t.Ia&&(n[o]=e)),i&&fi(e,t.M.duration),t={createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:e.find.bind(e),getSegmentReference:e.get.bind(e)});return{createSegmentIndex:t.createSegmentIndex,findSegmentPosition:t.findSegmentPosition,getSegmentReference:t.getSegmentReference,initSegmentReference:r,da:a.da}}function Ri(t){return t.fb}function Ni(t,e){var n=t.M.duration,i=e.R,r=e.Ea,a=e.timescale,o=e.Ob,s=t.bandwidth||null,u=t.v.id,c=t.v.ea;return{createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(t){return 0>t||n&&t>=n?null:Math.floor(t/i)},getSegmentReference:function(t){var e=t*i,h=e+i;return n&&(h=Math.min(h,n)),0>h||n&&e>=n?null:new ti(t,e,h,function(){var n=Xn(o,u,t+r,s,e*a);return Nt(c,[n])},0,null)}}}function Di(t,e){for(var n=[],i=0;i<e.H.length;i++){var r=i+e.Ea;n.push(new ti(r,e.H[i].start,e.H[i].end,function(t,e,n,i,r,a){return t=Xn(t,e,r,n,a),Nt(i,[t]).map(function(t){return t.toString()})}.bind(null,e.Ob,t.v.id,t.bandwidth||null,t.v.ea,r,e.H[i].We+e.ic),0,null))}return n}function Ci(t){var e=zn(t,Ri,"initialization");if(!e)return null;var n=t.v.id,i=t.bandwidth||null,r=t.v.ea;return new Zn(function(){var t=Xn(e,n,null,i,null);return Nt(r,[t])},0,null)}function Mi(){var t,e={};for(t in Oc)e[t]=!0;for(var n in Uc)e[n]=!0;return["application/dash+xml","application/x-mpegurl","application/vnd.apple.mpegurl","application/vnd.ms-sstr+xml"].forEach(function(t){e[t]=!!Oc[t]}),["mpd","m3u8","ism"].forEach(function(t){e[t]=!!Uc[t]}),e}function Li(t,e,n,i){var r=i;return r||(i=new L(t).aa.split("/").pop().split("."),1<i.length&&(i=i.pop().toLowerCase(),r=Uc[i])),r?Promise.resolve(r):(n=pt([t],n),n.method="HEAD",e.request(0,n).promise.then(function(e){return(e=e.headers["content-type"])&&(e=e.toLowerCase()),(r=Oc[e])?r:Promise.reject(new z(2,4,4e3,t))},function(t){return t.severity=2,Promise.reject(t)}))}function Oi(t,e){this.f=t,this.l=e,this.c=this.b=1/0,this.a=1,this.j=this.h=0,this.i=!0,this.g=0}function Ui(){this.a=this.b=null,this.h=[],this.c=null,this.j=[],this.i=1,this.l={},this.m=0,this.o=new P(5),this.g=null,this.f=new ht}function ji(t){var e=Date.now(),n=t.a.networkingEngine.request(0,pt(t.h,t.b.retryParameters));return lt(t.f,n),n.promise.then(function(e){if(t.a)return Bi(t,e.data,e.uri)}).then(function(){var n=(Date.now()-e)/1e3;return R(t.o,1,n),n})}function Bi(t,e,n){if(!(e=$n(e,"MPD")))throw new z(2,4,4001,n);return e=Qn(e,t.b.retryParameters,t.b.dash.xlinkFailGracefully,n,t.a.networkingEngine),lt(t.f,e),e.promise.then(function(e){return Fi(t,e,n)})}function Fi(t,e,n){n=[n];var i=Rn(e,"Location").map(Cn).filter(Pt);0<i.length&&(n=t.h=i),i=Rn(e,"BaseURL").map(Cn),n=Nt(n,i);var r=Mn(e,"minBufferTime",On);t.m=Mn(e,"minimumUpdatePeriod",On,-1);var a=Mn(e,"availabilityStartTime",Ln);i=Mn(e,"timeShiftBufferDepth",On);var o=Mn(e,"suggestedPresentationDelay",On),s=Mn(e,"maxSegmentDuration",On),u=e.getAttribute("type")||"static";if(t.c)var c=t.c.presentationTimeline;else{var h=Math.max(t.b.dash.defaultPresentationDelay,1.5*r);c=new Oi(a,null!=o?o:h)}a=Vi(t,{Ia:"static"!=u,presentationTimeline:c,ba:null,M:null,W:null,v:null,bandwidth:0,wc:!1},n,e),o=a.duration;var l=a.periods;return c.yb("static"==u),"static"!=u&&a.oc||c.ka(o||1/0),(u=c.P())&&!isNaN(t.b.availabilityWindowOverride)&&(i=t.b.availabilityWindowOverride),null==i&&(i=1/0),c.dc(i),c.Rb(s||1),t.c?Promise.resolve():(e=Rn(e,"UTCTiming"),$i(t,n,e,u).then(function(t){this.a&&(c.Rc(t),this.c={presentationTimeline:c,periods:l,offlineSessionIds:[],minBufferTime:r||0})}.bind(t)))}function Vi(t,e,n,i){var r=Mn(i,"mediaPresentationDuration",On),a=[],o=0;i=Rn(i,"Period");for(var s=0;s<i.length;s++){var u=i[s];o=Mn(u,"start",On,o);var c=Mn(u,"duration",On),h=null;if(s!=i.length-1){var l=Mn(i[s+1],"start",On);null!=l&&(h=l-o)}else null!=r&&(h=r-o);if(null==h&&(h=c),u=Ki(t,e,n,{start:o,duration:h,node:u,index:s,Lb:null==h||s==i.length-1}),a.push(u),c=e.ba.id,-1==t.j.indexOf(c)&&(t.j.push(c),t.c&&(t.a.filterNewPeriod(u),t.c.periods.push(u))),null==h){o=null;break}o+=h}return null==t.c&&t.a.filterAllPeriods(a),null!=r?{periods:a,duration:r,oc:!1}:{periods:a,duration:o,oc:!0}}function Ki(t,e,n,i){e.ba=Xi(i.node,null,n),e.M=i,e.ba.id||(e.ba.id="__shaka_period_"+i.start),Rn(i.node,"EventStream").forEach(t.ie.bind(t,i.start,i.duration)),n=Rn(i.node,"AdaptationSet").map(t.ge.bind(t,e)).filter(Pt);var r=n.map(function(t){return t.te}).reduce(It,[]),a=r.filter(Rt);if(e.Ia&&r.length!=a.length)throw new z(2,4,4018);var o=n.filter(function(t){return!t.hc});if(n.filter(function(t){return t.hc}).forEach(function(t){var e=t.streams[0],n=t.hc;o.forEach(function(t){t.id==n&&t.streams.forEach(function(t){t.trickModeVideo=e})})}),n=Hi(o,"video"),r=Hi(o,"audio"),!n.length&&!r.length)throw new z(2,4,4004);for(r.length||(r=[null]),n.length||(n=[null]),e=[],a=0;a<r.length;a++)for(var s=0;s<n.length;s++)qi(t,r[a],n[s],e);for(t=Hi(o,"text"),n=[],r=0;r<t.length;r++)n.push.apply(n,t[r].streams);return{startTime:i.start,textStreams:n,variants:e}}function Hi(t,e){return t.filter(function(t){return t.contentType==e})}function qi(t,e,n,i){if(e||n)if(e&&n){var r=e.drmInfos,a=n.drmInfos;if(r.length&&a.length?0<fe(r,a).length:1){a=fe(e.drmInfos,n.drmInfos);for(var o=0;o<e.streams.length;o++)for(var s=0;s<n.streams.length;s++)r=(n.streams[s].bandwidth||0)+(e.streams[o].bandwidth||0),r={id:t.i++,language:e.language,primary:e.Nb||n.Nb,audio:e.streams[o],video:n.streams[s],bandwidth:r,drmInfos:a,allowedByApplication:!0,allowedByKeySystem:!0},i.push(r)}}else for(a=e||n,o=0;o<a.streams.length;o++)r=a.streams[o].bandwidth||0,r={id:t.i++,language:a.language||"und",primary:a.Nb,audio:e?a.streams[o]:null,video:n?a.streams[o]:null,bandwidth:r,drmInfos:a.drmInfos,allowedByApplication:!0,allowedByKeySystem:!0},i.push(r)}function Gi(e,n){0>e.m||(e.g=t.setTimeout(e.Pe.bind(e),1e3*Math.max(3,e.m-n,N(e.o))))}function Xi(t,e,n){e=e||{contentType:"",mimeType:"",codecs:"",containsEmsgBoxes:!1,frameRate:void 0,Sb:null},n=n||e.ea;var i=Rn(t,"BaseURL").map(Cn),r=t.getAttribute("contentType")||e.contentType,a=t.getAttribute("mimeType")||e.mimeType,o=t.getAttribute("codecs")||e.codecs,s=Mn(t,"frameRate",Vn)||e.frameRate,u=!!Rn(t,"InbandEventStream").length,c=Rn(t,"AudioChannelConfiguration");return c=Yi(c)||e.Sb,r||(r=Ji(a,o)),{ea:Nt(n,i),cb:Pn(t,"SegmentBase")||e.cb,ta:Pn(t,"SegmentList")||e.ta,fb:Pn(t,"SegmentTemplate")||e.fb,width:Mn(t,"width",Fn)||e.width,height:Mn(t,"height",Fn)||e.height,contentType:r,mimeType:a,codecs:o,frameRate:s,containsEmsgBoxes:u||e.containsEmsgBoxes,id:t.getAttribute("id"),Sb:c}}function Yi(t){for(var e=0;e<t.length;++e){var n=t[e],i=n.getAttribute("schemeIdUri");if(i&&(n=n.getAttribute("value")))switch(i){case"urn:mpeg:dash:outputChannelPositionList:2012":return n.trim().split(/ +/).length;case"urn:mpeg:dash:23003:3:audio_channel_configuration:2011":case"urn:dts:dash:audio_channel_configuration:2012":if(!(i=parseInt(n,10)))continue;return i;case"tag:dolby.com,2014:dash:audio_channel_configuration:2011":case"urn:dolby:dash:audio_channel_configuration:2011":if(i=parseInt(n,16)){for(t=0;i;)1&i&&++t,i>>=1;return t}}}return null}function zi(t){var e=t.cb?1:0;return e+=t.ta?1:0,0==(e+=t.fb?1:0)?"text"==t.contentType||"application"==t.contentType:(1!=e&&(t.cb&&(t.ta=null),t.fb=null),!0)}function Wi(t,e,n,i){return e=Nt(e,[n]),e=pt(e,t.b.retryParameters),e.method=i,e=t.a.networkingEngine.request(0,e),lt(t.f,e),e.promise.then(function(t){if("HEAD"==i){if(!t.headers||!t.headers.date)return 0;t=t.headers.date}else t=Mt(t.data);return t=Date.parse(t),isNaN(t)?0:t-Date.now()})}function $i(t,e,n,i){n=n.map(function(t){return{scheme:t.getAttribute("schemeIdUri"),value:t.getAttribute("value")}});var r=t.b.dash.clockSyncUri;return i&&!n.length&&r&&n.push({scheme:"urn:mpeg:dash:utc:http-head:2014",value:r}),_t(n,function(t){var n=t.value;switch(t.scheme){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":return Wi(this,e,n,"HEAD");case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":return Wi(this,e,n,"GET");case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":return t=Date.parse(n),isNaN(t)?0:t-Date.now();case"urn:mpeg:dash:utc:http-ntp:2014":case"urn:mpeg:dash:utc:ntp:2014":case"urn:mpeg:dash:utc:sntp:2014":default:return Promise.reject()}}.bind(t)).catch(function(){return 0})}function Ji(t,e){return mc[Ct(t,e)]?"text":t.split("/")[0]}function Qi(t,e,n,i){this.uri=t,this.type=e,this.a=n,this.segments=i||null}function Zi(t,e,n,i){this.id=t,this.name=e,this.a=n,this.value=i||null}function tr(t,e){this.name=t,this.value=e}function er(t,e,n){return n=n||null,(t=t.getAttribute(e))?t.value:n}function nr(t,e){this.a=e,this.uri=t}function ir(t,e){return t.filter(function(t){return t.name==e})}function rr(t,e){var n=ir(t,e);return n.length?n[0]:null}function ar(t,e,n){return t.filter(function(t){var i=t.getAttribute("TYPE");return t=t.getAttribute("GROUP-ID"),i.value==e&&t.value==n})}function or(t,e){return Nt([t],[e])[0]}function sr(t){this.b=t,this.a=0}function ur(t){cr(t,/[ \t]+/gm)}function cr(t,e){e.lastIndex=t.a;var n=e.exec(t.b);return n=null==n?null:{position:n.index,length:n[0].length,we:n},t.a==t.b.length||null==n||n.position!=t.a?null:(t.a+=n.length,n.we)}function hr(t){return t.a==t.b.length?null:(t=cr(t,/[^ \t\n]*/gm))?t[0]:null}function lr(){this.a=0}function fr(t,e,n){e=Mt(e),e=e.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n").trim();var i=e.split(/\n+/m);if(!/^#EXTM3U($|[ \t\n])/m.test(i[0]))throw new z(2,4,4015);e=0;for(var r=1;r<i.length;r++)if(!/^#(?!EXT)/m.test(i[r])){var a=pr(t,i[r]);if(--t.a,0<=jc.indexOf(a.name)){e=1;break}"EXT-X-STREAM-INF"==a.name&&(r+=1)}for(r=[],a=1;a<i.length;)if(/^#(?!EXT)/m.test(i[a]))a+=1;else{var o=pr(t,i[a]);if(0<=Bc.indexOf(o.name)){if(1!=e)throw new z(2,4,4017);return i=i.splice(a,i.length-a),t=dr(t,i,r),new Qi(n,e,r,t)}r.push(o),a+=1,"EXT-X-STREAM-INF"==o.name&&(o.a.push(new tr("URI",i[a])),a+=1)}return new Qi(n,e,r)}function dr(t,e,n){var i=[],r=[];return e.forEach(function(e){if(/^(#EXT)/.test(e))e=pr(t,e),0<=jc.indexOf(e.name)?n.push(e):r.push(e);else{if(/^#(?!EXT)/m.test(e))return[];i.push(new nr(e.trim(),r)),r=[]}}),i}function pr(t,e){t:{var n=t.a++,i=e.match(/^#(EXT[^:]*)(?::(.*))?$/);if(!i)throw new z(2,4,4016,e);var r=i[1],a=i[2];if(i=[],a&&0<=a.indexOf("=")){a=new sr(a);for(var o,s=/([^=]+)=(?:"([^"]*)"|([^",]*))(?:,|$)/g;o=cr(a,s);)i.push(new tr(o[1],o[2]||o[3]))}else if(a){n=new Zi(n,r,i,a);break t}n=new Zi(n,r,i)}return n}function mr(t){try{var e=mr.parse(t);return Q({uri:t,data:e.data,headers:{"content-type":e.contentType}})}catch(t){return $(t)}}function vr(){this.g=this.c=null,this.L=1,this.u={},this.I={},this.Y={},this.a={},this.b=null,this.m="",this.s=new lr,this.j=this.i=null,this.f=Hc,this.o=null,this.l=0,this.A=1/0,this.h=new ht,this.G=[]}function yr(t,e,n){Vr(t,n).then(function(t){var i=qc,r=fr(this.s,t.data,n);if(1!=r.type)throw new z(2,4,4017);t=rr(r.a,"EXT-X-MEDIA-SEQUENCE");var a=e.stream;Dr(this,r,t?Number(t.value):0,a.mimeType,a.codecs).then(function(t){e.eb.a=t,t=t[t.length-1],rr(r.a,"EXT-X-ENDLIST")&&(Hr(this,i.ra),this.b.ka(t.endTime))}.bind(this))}.bind(t))}function gr(t,e,n){if(e=fr(t.s,e,n),0!=e.type)throw new z(2,4,4022);return br(t,e).then(function(t){this.c.filterAllPeriods([t]);var e=1/0,n=0,i=0,r=1/0;for(o in this.a){var a=this.a[o];e=Math.min(e,a.Qb),n=Math.max(n,a.Qb),i=Math.max(i,a.Fd),"text"!=a.stream.type&&(r=Math.min(r,a.duration))}var o=null;if(a=0,this.f!=qc.ra&&(o=Date.now()/1e3-i,a=3*this.l),this.b=new Oi(o,a),this.b.yb(this.f==qc.ra),Nr(this),this.f!=qc.ra){for(e=3*this.l,this.b.Sc(e),this.i=this.A,this.f==qc.jc&&(isNaN(this.g.availabilityWindowOverride)||(e=this.g.availabilityWindowOverride),this.b.dc(e)),e=0;95443.7176888889<=n;)e+=95443.7176888889,n-=95443.7176888889;if(e)for(var s in this.a)n=this.a[s],95443.7176888889>n.Qb&&(n.stream.presentationTimeOffset=-e,n.eb.offset(e))}else{this.b.ka(r);for(var u in this.a)s=this.a[u],s.stream.presentationTimeOffset=e,s.eb.offset(-e),fi(s.eb,r)}this.o={presentationTimeline:this.b,periods:[t],offlineSessionIds:[],minBufferTime:0}}.bind(t))}function br(t,e){var n=e.a,i=ir(e.a,"EXT-X-MEDIA").filter(function(t){return"SUBTITLES"==Br(t,"TYPE")}.bind(t)).map(function(t){return kr(this,t)}.bind(t));return Promise.all(i).then(function(t){var i=ir(n,"EXT-X-STREAM-INF").map(function(t){return wr(this,t,e)}.bind(this));return Promise.all(i).then(function(e){return{startTime:0,variants:e.reduce(It,[]),textStreams:t}}.bind(this))}.bind(t))}function wr(t,e,n){var i=er(e,"CODECS","avc1.42E01E,mp4a.40.2").split(/\s*,\s*/),r=e.getAttribute("RESOLUTION"),a=null,o=null,s=er(e,"FRAME-RATE"),u=Number(Br(e,"BANDWIDTH"));if(r){var c=r.value.split("x");a=c[0],o=c[1]}n=ir(n.a,"EXT-X-MEDIA");var h=er(e,"AUDIO"),l=er(e,"VIDEO");if(h?n=ar(n,"AUDIO",h):l&&(n=ar(n,"VIDEO",l)),c=Ur("text",i)){var f=er(e,"SUBTITLES");f&&(f=ar(n,"SUBTITLES",f),f.length&&(t.u[f[0].id].stream.codecs=c)),i.splice(i.indexOf(c),1)}n=n.map(function(t){return Ar(this,t,i)}.bind(t));var d=[],p=[];return Promise.all(n).then(function(t){if(h?d=t:l&&(p=t),t=!1,d.length||p.length)if(d.length)if(Br(e,"URI")==d[0].$b){var n="audio";t=!0}else n="video";else n="audio";else 1==i.length?(n=Ur("video",i),n=r||s||n?"video":"audio"):(n="video",i=[i.join(",")]);return t?Promise.resolve():Ir(this,e,i,n)}.bind(t)).then(function(t){return t&&("audio"==t.stream.type?d=[t]:p=[t]),p&&Tr(p),d&&Tr(d),Er(this,d,p,u,a,o,s)}.bind(t))}function Tr(t){t.forEach(function(t){var e=t.stream.codecs.split(",");e=e.filter(function(t){return"mp4a.40.34"!=t}),t.stream.codecs=e.join(",")})}function Er(t,e,n,i,r,a,o){n.forEach(function(t){(t=t.stream)&&(t.width=Number(r)||void 0,t.height=Number(a)||void 0,t.frameRate=Number(o)||void 0)}.bind(t)),e.length||(e=[null]),n.length||(n=[null]);for(var s=[],u=0;u<e.length;u++)for(var c=0;c<n.length;c++){var h=e[u]?e[u].stream:null,l=n[c]?n[c].stream:null,f=e[u]?e[u].drmInfos:null,d=n[c]?n[c].drmInfos:null,p=void 0;if(h&&l){if(!(f.length&&d.length?0<fe(f,d).length:1))continue;p=fe(f,d)}else h?p=f:l&&(p=d);f=(n[u]?n[u].$b:"")+" - "+(e[u]?e[u].$b:""),t.I[f]||(h=Sr(t,h,l,i,p),s.push(h),t.I[f]=h)}return s}function Sr(t,e,n,i,r){return{id:t.L++,language:e?e.language:"und",primary:!!e&&e.primary||!!n&&n.primary,audio:e,video:n,bandwidth:i,drmInfos:r,allowedByApplication:!0,allowedByKeySystem:!0}}function kr(t,e){return Br(e,"TYPE"),Ar(t,e,[]).then(function(t){return t.stream})}function Ar(t,e,n){var i=Br(e,"URI");if(i=or(t.m,i),t.a[i])return Promise.resolve(t.a[i]);var r=Br(e,"TYPE").toLowerCase();"subtitles"==r&&(r="text");var a=Be(er(e,"LANGUAGE","und")),o=er(e,"NAME"),s=e.getAttribute("DEFAULT"),u=e.getAttribute("AUTOSELECT"),c=er(e,"CHANNELS");return xr(t,i,n,r,a,!!s||!!u,o,"audio"==r?_r(c):null).then(function(t){return this.a[i]?this.a[i]:(this.u[e.id]=t,this.a[i]=t)}.bind(t))}function _r(t){return t?(t=t.split("/")[0],parseInt(t,10)):null}function Ir(t,e,n,i){var r=Br(e,"URI");return r=or(t.m,r),t.a[r]?Promise.resolve(t.a[r]):xr(t,r,n,i,"und",!1,null,null).then(function(t){return this.a[r]?this.a[r]:this.a[r]=t}.bind(t))}function xr(t,e,n,i,r,a,o,s){var u=e;e=or(t.m,e);var c,h,l="";return Vr(t,e).then(function(t){if(c=fr(this.s,t.data,e),1!=c.type)throw new z(2,4,4017);t=c;var r=qc,a=rr(t.a,"EXT-X-PLAYLIST-TYPE"),o=rr(t.a,"EXT-X-ENDLIST");if(o=a&&"VOD"==a.value||o,a=a&&"EVENT"==a.value&&!o,a=!o&&!a,o?Hr(this,r.ra):(a?Hr(this,r.jc):Hr(this,r.Zc),t=Fr(t.a,"EXT-X-TARGETDURATION"),t=Number(t.value),this.l=Math.max(t,this.l),this.A=Math.min(t,this.A)),1==n.length)l=n[0];else{if(null==(t=Ur(i,n)))throw new z(2,4,4025,n);l=t}return jr(this,i,l,c)}.bind(t)).then(function(t){return h=t,t=rr(c.a,"EXT-X-MEDIA-SEQUENCE"),Dr(this,c,t?Number(t.value):0,h,l)}.bind(t)).then(function(t){var e=t[0].startTime,n=t[t.length-1].endTime,f=n-e;t=new li(t);var d=Pr(c),p=void 0;"text"==i&&(p="subtitle");var m=[];c.segments.forEach(function(t){t=ir(t.a,"EXT-X-KEY"),m.push.apply(m,t)});var v=!1,y=[],g=null;if(m.forEach(function(t){if("NONE"!=Br(t,"METHOD")){v=!0;var e=Br(t,"KEYFORMAT");(t=(e=Kc[e])?e(t):null)&&(t.keyIds.length&&(g=t.keyIds[0]),y.push(t))}}),v&&!y.length)throw new z(2,4,4026);return d={id:this.L++,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:t.find.bind(t),getSegmentReference:t.get.bind(t),initSegmentReference:d,presentationTimeOffset:0,mimeType:h,codecs:l,kind:p,encrypted:v,keyId:g,language:r,label:o||null,type:i,primary:a,trickModeVideo:null,containsEmsgBoxes:!1,frameRate:void 0,width:void 0,height:void 0,bandwidth:void 0,roles:[],channelsCount:s},this.Y[d.id]=t,{stream:d,eb:t,drmInfos:y,$b:u,Qb:e,Fd:n,duration:f}}.bind(t))}function Pr(t){var e=ir(t.a,"EXT-X-MAP");if(!e.length)return null;if(1<e.length)throw new z(2,4,4020);e=e[0];var n=Br(e,"URI"),i=or(t.uri,n);return t=0,n=null,(e=er(e,"BYTERANGE"))&&(t=e.split("@"),e=Number(t[0]),t=Number(t[1]),n=t+e-1),new Zn(function(){return[i]},t,n)}function Rr(t,e,n,i,r){var a=n.a,o=or(t.uri,n.uri);t=Fr(a,"EXTINF").value.split(","),t=r+Number(t[0]),n=0;var s=null;return(a=rr(a,"EXT-X-BYTERANGE"))&&(n=a.value.split("@"),a=Number(n[0]),n=n[1]?Number(n[1]):e.a+1,s=n+a-1),new ti(i,r,t,function(){return[o]},n,s)}function Nr(t){t.b&&(t.G.forEach(function(e){t.b.Na(e,!0)}),t.G=[])}function Dr(t,e,n,i,r){var a=e.segments,o=[],s=or(e.uri,a[0].uri),u=Rr(e,null,a[0],n,0),c=Pr(e);return Mr(t,e.uri,c,u,i,r).then(function(t){s.split("/").pop();for(var i=0;i<a.length;++i){var r=o[o.length-1];r=Rr(e,r,a[i],n+i,0==i?t:r.endTime),o.push(r)}return this.G.push(o),Nr(this),o}.bind(t))}function Cr(t,e){var n=t.c.networkingEngine,i=pt(e.c(),t.g.retryParameters),r={},a=e.b;r.Range="bytes="+a+"-"+(a+2048-1);var o={};return 0==a&&null==e.a||(a="bytes="+a+"-",null!=e.a&&(a+=e.a),o.Range=a),i.headers=r,r=n.request(1,i),lt(t.h,r),r.promise.catch(function(){C("Unable to fetch a partial HLS segment! Falling back to a full segment request, which is expensive! Your server should support Range requests and CORS preflights.",i.uris[0]),i.headers=o;var e=n.request(1,i);return lt(t.h,e),e.promise})}function Mr(t,e,n,i,r,a){return t.o&&(e=t.a[e].eb.get(i.position))?Promise.resolve(e.startTime):(i=[Cr(t,i)],"video/mp4"!=r&&"audio/mp4"!=r||(n?i.push(Cr(t,n)):i.push(i[0])),Promise.all(i).then(function(t){if("video/mp4"==r||"audio/mp4"==r)return Lr(t[0].data,t[1].data);if("audio/mpeg"==r)return 0;if("video/mp2t"==r)return Or(t[0].data);if("application/mp4"==r||0==r.indexOf("text/")){t=t[0].data;var e=Ct(r,a);if(mc[e]){var n=new Se(null);n.f=new mc[e],t=n.Kb(t)}else t=0;return t}throw new z(2,4,4030)}.bind(t)))}function Lr(t,e){var n=0;if((new ii).C("moov",ri).C("trak",ri).C("mdia",ri).Z("mdhd",function(t){t.reader.F(0==t.version?8:16),n=t.reader.B(),t.parser.stop()}).parse(e,!0),!n)throw new z(2,4,4030);var i=0,r=!1;if((new ii).C("moof",ri).C("traf",ri).Z("tfdt",function(t){i=(0==t.version?t.reader.B():t.reader.Ra())/n,r=!0,t.parser.stop()}).parse(t,!0),!r)throw new z(2,4,4030);return i}function Or(t){function e(){throw new z(2,4,4030)}t=new ei(new DataView(t),0);for(var n=0,i=0;;){if(n=t.U(),i=t.ca(),71!=i&&e(),16384&t.bb()||e(),i=(48&t.ca())>>4,0!=i&&2!=i||e(),3==i&&(i=t.ca(),t.F(i)),1==t.B()>>8)return t.F(3),n=t.ca()>>6,0!=n&&1!=n||e(),0==t.ca()&&e(),n=t.ca(),i=t.bb(),t=t.bb(),(1073741824*((14&n)>>1)+((65534&i)<<14|(65534&t)>>1))/9e4;t.seek(n+188),i=t.ca(),71!=i&&(t.seek(n+192),i=t.ca()),71!=i&&(t.seek(n+204),i=t.ca()),71!=i&&e(),t.Oc(1)}}function Ur(t,e){for(var n=Fc[t],i=0;i<n.length;i++)for(var r=0;r<e.length;r++)if(n[i].test(e[r].trim()))return e[r].trim();return"text"==t?"":null}function jr(t,e,n,i){i=or(i.uri,i.segments[0].uri);var r=new L(i).aa.split(".").pop(),a=Vc[e][r];return a?Promise.resolve(a):"text"==e?n&&"vtt"!=n?Promise.resolve("application/mp4"):Promise.resolve("text/vtt"):(e=pt([i],t.g.retryParameters),e.method="HEAD",e=t.c.networkingEngine.request(1,e),lt(t.h,e),e.promise.then(function(t){if(!(t=t.headers["content-type"]))throw new z(2,4,4021,r);return t.split(";")[0]}))}function Br(t,e){var n=t.getAttribute(e);if(!n)throw new z(2,4,4023,e);return n.value}function Fr(t,e){var n=rr(t,e);if(!n)throw new z(2,4,4024,e);return n}function Vr(t,e){var n=t.c.networkingEngine.request(0,pt([e],t.g.retryParameters));return lt(t.h,n),n.promise}function Kr(e,n){null!=e.i&&null!=n&&(e.j=t.setTimeout(e.S.bind(e),1e3*n))}function Hr(e,n){e.f=n,e.b&&e.b.yb(e.f==qc.ra),e.f==qc.ra&&null!=e.j&&(t.clearTimeout(e.j),e.j=null,e.i=null)}function qr(t,e,n,i){this.a=t,this.s=e,this.o=n,this.u=i,this.h=new wt,this.b=null,this.g=!1,this.m=t.readyState,this.c=!1,this.j=this.A=-1,this.f=this.i=!1,e=this.l.bind(this),Tt(this.h,t,"waiting",e),this.b=new Bt(e),Vt(this.b,.25)}function Gr(t,e,n){this.a=t,this.i=e,this.h=n,this.c=new wt,this.f=1,this.g=!1,this.b=null,0<t.readyState?this.Fc():Et(this.c,t,"loadedmetadata",this.Fc.bind(this)),Tt(this.c,t,"ratechange",this.Vd.bind(this))}function Xr(t){return 0<t.a.readyState?t.a.currentTime:t.h}function Yr(t,e){0<t.a.readyState?Wr(t,t.a.currentTime,e):(t.h=e,setTimeout(t.i,0))}function zr(t,e){null!=t.b&&(t.b.cancel(),t.b=null),t.f=e,t.a.playbackRate=t.g||0>e?0:e,!t.g&&0>e&&(t.b=new Bt(function(){t.a.currentTime+=e/4}),Vt(t.b,.25))}function Wr(t,e,n){function i(){!t.a||10<=r++||t.a.currentTime!=e||(t.a.currentTime=n,setTimeout(i,100))}t.a.currentTime=n;var r=0;setTimeout(i,100)}function $r(t,e,n,i,r,a){this.c=t,this.b=e,this.h=n,this.j=r,this.f=null,this.g=new qr(t,e,n,a),e=this.Xd.bind(this),n=this.b.presentationTimeline,null==i?i=1/0>n.T()?n.Ja():n.ma():0>i&&(i=n.ma()+i),i=Qr(this,ta(this,i)),this.a=new Gr(t,e,i),this.f=new Bt(this.Ud.bind(this)),Vt(this.f,.25)}function Jr(t){var e=Xr(t.a);return 0<t.c.readyState&&(t.c.paused||(e=ta(t,e))),e}function Qr(t,e){var n=t.b.presentationTimeline.T();return e>=n?n-t.h.durationBackoff:e}function Zr(t,e){var n=pe.bind(null,t.c.buffered),i=Math.max(t.b.minBufferTime||0,t.h.rebufferingGoal),r=t.b.presentationTimeline,a=r.Ja(),o=r.ma(),s=r.T();3>o-a&&(a=o-3);var u=r.Wa(i),c=r.Wa(5);return i=r.Wa(i+5),e>=s?Qr(t,e):e>o?o:e<a?n(c)?c:i:e>=u||n(e)?e:i}function ta(t,e){var n=t.b.presentationTimeline.Ja();return e<n?n:(n=t.b.presentationTimeline.ma(),e>n?n:e)}function ea(t,e,n,i,r,a,o){this.a=t,this.u=e,this.g=n,this.s=i,this.l=r,this.h=a,this.A=o,this.c=[],this.j=new wt,this.b=!1,this.i=-1,this.f=null,ia(this)}function na(t){var e=ut(t);return e.eventElement=t.eventElement,e}function ia(e){ra(e),e.f=t.setTimeout(e.G.bind(e),250)}function ra(e){e.f&&(t.clearTimeout(e.f),e.f=null)}function aa(t,e){this.a=e,this.b=t,this.g=null,this.j=1,this.m=Promise.resolve(),this.h=[],this.i={},this.c={},this.o=!1,this.A=null,this.u=this.f=this.l=!1,this.s=0}function oa(t){var e=Jr(t.a.Pa);return t.b.periods[sn(t.b,e)]}function sa(t){var e=t.c.video||t.c.audio;return e?t.b.periods[e.Ba]:null}function ua(t){return ha(t,"audio")}function ca(t){return ha(t,"video")}function ha(t,e){var n=t.c[e];return n?n.sa||n.stream:null}function la(t,e){Ce(t.a.J,"text"),t.s++,t.u=!1;var n=t.s;return t.a.J.init({text:e},!1).then(function(){return Ta(t,[e])}).then(function(){if(!t.f&&t.s==n&&!t.c.text&&!t.u){var i=Jr(t.a.Pa);t.c.text=ba(e,sn(t.b,i)),Oa(t,t.c.text,0)}})}function fa(t){t.u=!0,t.c.text&&(Ua(t.c.text),delete t.c.text)}function da(t,e){var n=t.c.video;if(n){var i=n.stream;if(i)if(e){var r=i.trickModeVideo;r&&!n.sa&&(ma(t,r,!1),n.sa=i)}else(i=n.sa)&&(n.sa=null,ma(t,i,!0))}}function pa(t,e,n){e.video&&ma(t,e.video,n),e.audio&&ma(t,e.audio,n)}function ma(t,e,n){var i=t.c[e.type];if(!i&&"text"==e.type&&t.g.ignoreTextStreamFailures)la(t,e);else if(i){var r=un(t.b,e);n&&r!=i.Ba?ya(t):(i.sa&&(e.trickModeVideo?(i.sa=e,e=e.trickModeVideo):i.sa=null),(r=t.h[r])&&r.Sa&&(r=t.i[e.id])&&r.Sa&&i.stream!=e&&("text"==e.type&&Ie(t.a.J,Ct(e.mimeType,e.codecs)),i.stream=e,i.wb=!0,n&&(i.ya?i.zb=!0:i.Ca?(i.va=!0,i.zb=!0):(Ua(i),La(t,i,!0)))))}}function va(t){var e=Jr(t.a.Pa),n=t.g.smallGapLimit;Object.keys(t.c).every(function(t){var i=this.a.J;return"text"==t?(t=i.a,t=e>=t.a&&e<t.b):(t=Ne(i,t),t=pe(t,e,n)),t}.bind(t))||ya(t)}function ya(t){for(var e in t.c){var n=t.c[e];n.ya||n.va||(n.Ca?n.va=!0:null==xe(t.a.J,e)?null==n.ua&&Oa(t,n,0):(Ua(n),La(t,n,!1)))}}function ga(t,e,n){var i=Jr(t.a.Pa),r=sn(t.b,i),a={},o=[];return e.variant&&e.variant.audio&&(a.audio=e.variant.audio,o.push(e.variant.audio)),e.variant&&e.variant.video&&(a.video=e.variant.video,o.push(e.variant.video)),e.text&&(a.text=e.text,o.push(e.text)),t.a.J.init(a,t.g.forceTransmuxTS).then(function(){if(!t.f){var e=t.b.presentationTimeline.T();return 1/0>e?t.a.J.ka(e):t.a.J.ka(Math.pow(2,32)),Ta(t,o)}}).then(function(){if(!t.f)for(var e in a){var i=a[e];t.c[e]||(t.c[e]=ba(i,r,n),Oa(t,t.c[e],0))}})}function ba(t,e,n){return{stream:t,type:t.type,La:null,na:null,sa:null,wb:!0,Ba:e,endOfStream:!1,Ca:!1,ua:null,va:!1,zb:!1,ya:!1,Zb:!1,Ya:!1,Nc:n||0}}function wa(t,e){var n=t.h[e];if(n)return n.promise;n={promise:new q,Sa:!1},t.h[e]=n;var i=t.b.periods[e].variants.map(function(t){var e=[];return t.audio&&e.push(t.audio),t.video&&e.push(t.video),t.video&&t.video.trickModeVideo&&e.push(t.video.trickModeVideo),e}).reduce(It,[]).filter(Rt);return i.push.apply(i,t.b.periods[e].textStreams),t.m=t.m.then(function(){if(!this.f)return Ta(this,i)}.bind(t)).then(function(){this.f||(this.h[e].promise.resolve(),this.h[e].Sa=!0)}.bind(t)).catch(function(t){this.f||(this.h[e].promise.catch(function(){}),this.h[e].promise.reject(),delete this.h[e],this.a.onError(t))}.bind(t)),n.promise}function Ta(t,e){e.map(function(t){return t.id}).filter(Rt);for(var n=[],i=0;i<e.length;++i){var r=e[i],a=t.i[r.id];a?n.push(a.promise):(t.i[r.id]={promise:new q,Sa:!1},n.push(r.createSegmentIndex()))}return Promise.all(n).then(function(){if(!this.f)for(var t=0;t<e.length;++t){var n=this.i[e[t].id];n.Sa||(n.promise.resolve(),n.Sa=!0)}}.bind(t)).catch(function(t){if(!this.f){for(var n=0;n<e.length;n++)this.i[e[n].id].promise.catch(function(){}),this.i[e[n].id].promise.reject(),delete this.i[e[n].id];return Promise.reject(t)}}.bind(t))}function Ea(t,e){var n=Jr(t.a.Pa),i=Sa(t,e,n),r=un(t.b,e.stream),a=sn(t.b,i),o=Re(t.a.J,e.type,n),s=Math.max(t.j*Math.max(t.b.minBufferTime||0,t.g.rebufferingGoal),t.j*t.g.bufferingGoal);if(i>=t.b.presentationTimeline.T())return e.endOfStream=!0,null;if(e.endOfStream=!1,e.Ba=a,a!=r)return null;if(o>=s)return.5;if(a=Pe(t.a.J,e.type),!(a=ka(t,e,n,a,r)))return 1;var u=1/0;return $u.values(t.c).forEach(function(e){u=Math.min(u,Sa(t,e,n))}),i>=u+t.b.presentationTimeline.a?1:(e.Nc=0,_a(t,e,n,r,a),null)}function Sa(t,e,n){return e.La&&e.na?t.b.periods[un(t.b,e.La)].startTime+e.na.endTime:Math.max(n,e.Nc)}function ka(t,e,n,i,r){if(e.na&&e.stream==e.La)return Aa(t,e,r,e.na.position+1);if(null==(n=e.na?e.stream.findSegmentPosition(Math.max(0,t.b.periods[un(t.b,e.La)].startTime+e.na.endTime-t.b.periods[r].startTime)):e.stream.findSegmentPosition(Math.max(0,(i||n)-t.b.periods[r].startTime))))return null;var a=null;return null==i&&(a=Aa(t,e,r,Math.max(0,n-1))),a||Aa(t,e,r,n)}function Aa(t,e,n,i){return n=t.b.periods[n],(e=e.stream.getSegmentReference(i))?(i=t.b.presentationTimeline,t=i.Xa(),i=i.Ka(),n.startTime+e.endTime<t||n.startTime+e.startTime>i?null:e):null}function _a(t,e,n,i,r){var a=t.b.periods[i],o=e.stream,s=t.b.presentationTimeline.T(),u=t.b.periods[i+1];i=xa(t,e,i,Math.max(0,a.startTime-.1),u?u.startTime:s),e.Ca=!0,e.wb=!1,s=Ma(t,r),Promise.all([i,s]).then(function(t){if(!this.f&&!this.l)return Pa(this,e,n,a,o,r,t[1])}.bind(t)).then(function(){this.f||this.l||(e.Ca=!1,e.Zb=!1,e.va||this.a.ab(),Oa(this,e,0),Na(this,o))}.bind(t)).catch(function(t){this.f||this.l||(e.Ca=!1,"text"==e.type&&this.g.ignoreTextStreamFailures?delete this.c.text:3017==t.code?Ia(this,e,t):(e.Ya=!0,t.severity=2,ja(this,t)))}.bind(t))}function Ia(t,e,n){if(!$u.values(t.c).some(function(t){return t!=e&&t.Zb})){var i=Math.round(100*t.j);if(20<i)t.j-=.2;else{if(!(4<i))return e.Ya=!0,t.l=!0,void t.a.onError(n);t.j-=.04}e.Zb=!0}Oa(t,e,4)}function xa(t,e,n,i,r){return e.wb?(n=Me(t.a.J,e.type,t.b.periods[n].startTime-e.stream.presentationTimeOffset,i,r),e.stream.initSegmentReference?(t=Ma(t,e.stream.initSegmentReference).then(function(t){if(!this.f)return De(this.a.J,e.type,t,null,null)}.bind(t)).catch(function(t){return e.wb=!0,Promise.reject(t)}),Promise.all([n,t])):n):Promise.resolve()}function Pa(t,e,n,i,r,a,o){return r.containsEmsgBoxes&&(new ii).Z("emsg",t.he.bind(t,i,a)).parse(o),Ra(t,e,n).then(function(){if(!this.f)return De(this.a.J,e.type,o,a.startTime+i.startTime,a.endTime+i.startTime)}.bind(t)).then(function(){if(!this.f)return e.La=r,e.na=a,Promise.resolve()}.bind(t))}function Ra(t,e,n){var i=Math.max(t.g.bufferBehind,t.b.presentationTimeline.a),r=xe(t.a.J,e.type);return null==r?Promise.resolve():(n=n-r-i,0>=n?Promise.resolve():t.a.J.remove(e.type,r,r+n).then(function(){}.bind(t)))}function Na(t,e){if(!t.o&&(t.o=$u.values(t.c).every(function(t){return"text"==t.type||!t.va&&!t.ya&&t.na}),t.o)){var n=un(t.b,e);for(t.h[n]||wa(t,n).then(function(){this.f||this.a.zc()}.bind(t)).catch(xt),n=0;n<t.b.periods.length;++n)wa(t,n).catch(xt);t.a.$d&&t.a.$d()}}function Da(t,e){if(e.Ba!=un(t.b,e.stream)){var n=e.Ba,i=$u.values(t.c);i.every(function(t){return t.Ba==n})&&i.every(Ca)&&wa(t,n).then(function(){if(!this.f&&i.every(function(t){var e=un(this.b,t.stream);return Ca(t)&&t.Ba==n&&e!=n}.bind(this))){var t=this.b.periods[n],e=this.a.Ac(t),r={};e.variant&&e.variant.video&&(r.video=e.variant.video),e.variant&&e.variant.audio&&(r.audio=e.variant.audio),e.text&&(r.text=e.text);for(var a in this.c)if(!r[a]&&"text"!=a)return void this.a.onError(new z(2,5,5005));for(var o in r)if(!this.c[o]){if("text"!=o)return void this.a.onError(new z(2,5,5005));ga(this,{text:r.text},t.startTime),delete r[o]}for(var s in this.c)(t=r[s])?(ma(this,t,!1),Oa(this,this.c[s],0)):delete this.c[s];this.a.zc()}}.bind(t)).catch(xt)}}function Ca(t){return!t.Ca&&null==t.ua&&!t.va&&!t.ya}function Ma(t,e){var n=pt(e.c(),t.g.retryParameters);if(0!=e.b||null!=e.a){var i="bytes="+e.b+"-";null!=e.a&&(i+=e.a),n.headers.Range=i}return t.a.$a.request(1,n).promise.then(function(t){return t.data})}function La(t,e,n){e.va=!1,e.zb=!1,e.ya=!0,Ce(t.a.J,e.type).then(function(){if(!this.f&&n)return this.a.J.flush(e.type)}.bind(t)).then(function(){this.f||(e.La=null,e.na=null,e.ya=!1,e.endOfStream=!1,Oa(this,e,0))}.bind(t))}function Oa(e,n,i){n.ua=t.setTimeout(e.Re.bind(e,n),1e3*i)}function Ua(e){null!=e.ua&&(t.clearTimeout(e.ua),e.ua=null)}function ja(t,e){X(t.A).then(function(){this.f||(this.a.onError(e),e.handled||this.g.failureCallback(e))}.bind(t))}function Ba(t,e,n,i,r,a){if(200<=n&&299>=n&&202!=n)return r&&(i=r),{uri:i,data:e,headers:t,fromCache:!!t["x-shaka-from-cache"]};r=null;try{r=Ot(e)}catch(t){}throw new z(401==n||403==n?2:1,1,1001,i,n,r,t,a)}function Fa(t,e,n){var i=new Fa.b;$u.forEach(e.headers,function(t,e){i.append(t,e)});var r,a=new Fa.a,o={body:e.body||void 0,headers:i,method:e.method,signal:a.signal,credentials:e.allowCrossSiteCredentials?"include":void 0},s={mc:!1,Xc:!1};return e.retryParameters.timeout&&(r=setTimeout(function(){s.Xc=!0,a.abort()},e.retryParameters.timeout)),t=Fa.f(t,n,o,s,r),new W(t,function(){return s.mc=!0,a.abort(),Promise.resolve()})}function Va(t,e,n){var i=new Va.g;return new W(new Promise(function(r,a){i.open(e.method,t,!0),i.responseType="arraybuffer",i.timeout=e.retryParameters.timeout,i.withCredentials=e.allowCrossSiteCredentials,i.onabort=function(){a(new z(1,1,7001,t,n))},i.onload=function(e){e=e.target;var i=e.getAllResponseHeaders().trim().split("\r\n").reduce(function(t,e){var n=e.split(": ");return t[n[0].toLowerCase()]=n.slice(1).join(": "),t},{});try{var o=Ba(i,e.response,e.status,t,e.responseURL,n);r(o)}catch(t){a(t)}},i.onerror=function(e){a(new z(1,1,1002,t,e,n))},i.ontimeout=function(){a(new z(1,1,1003,t,n))};for(var o in e.headers)i.setRequestHeader(o.toLowerCase(),e.headers[o]);i.send(e.body)}),function(){return i.abort(),Promise.resolve()})}function Ka(t){this.a={},this.c=Promise.resolve(),this.h=!1,this.i=t,this.f=this.b=this.g=0}function Ha(t,e,n,i,r){t.a[e]=t.a[e]||[],t.a[e].push({request:n,pc:i,Id:r})}function qa(t,e){var n=$u.values(t.a);t.a={},n.forEach(function(e){e.forEach(function(e){t.b+=e.pc})});var i=Promise.resolve().then(function(){return Ya(t),Promise.all(n.map(function(n){return Ga(t,e,n)}))});return t.c=t.c.then(function(){return i}),i}function Ga(t,e,n){var i=Promise.resolve();return n.forEach(function(n){i=i.then(function(){return Ya(t),Xa(t,e,n)})}),i}function Xa(t,e,n){return Promise.resolve().then(function(){return Ya(t),e.request(1,n.request).promise}).then(function(e){return Ya(t),t.g+=n.pc,t.f+=e.data.byteLength,t.i(t.b?t.g/t.b:0,t.f),n.Id(e.data)})}function Ya(t){if(t.h)throw new z(2,9,7001)}function za(t,e){var n=this;this.c=t,this.b=t.objectStore(e),this.a=new q,t.onabort=function(t){t.preventDefault(),n.a.reject()},t.onerror=function(t){t.preventDefault(),n.a.reject()},t.oncomplete=function(){n.a.resolve()}}function Wa(t){this.b=t,this.a=[]}function $a(t,e){return Ja(t,e,"readwrite")}function Ja(t,e,n){n=t.b.transaction([e],n);var i=new za(n,e);return t.a.push(i),i.promise().then(function(){at(t.a,i)},function(){at(t.a,i)}),i}function Qa(){this.a={}}function Za(t){var e=null;if($u.forEach(t.a,function(t,n){$u.forEach(n.getCells(),function(n,i){i.hasFixedKeySpace()||e||(e={path:{fa:t,N:n},N:i})})}),e)return e;throw new z(2,9,9013,"Could not find a cell that supports add-operations")}function to(t,e){$u.forEach(t.a,function(t,n){$u.forEach(n.getCells(),function(n,i){e({fa:t,N:n},i)})})}function eo(t,e,n){if(!(t=t.a[e]))throw new z(2,9,9013,"Could not find mechanism with name "+e);if(!(e=t.getCells()[n]))throw new z(2,9,9013,"Could not find cell with name "+n);return e}function no(t){return c(function e(){var n,i,r,a;return A(e,function(e){switch(e.w){case 1:return n=$u,i=Object.values(t.a),r=0<i.length,r||(a=Gc,n.forEach(a,function(t,e){var n=e();n&&i.push(n)})),d(e,Promise.all(i.map(function(t){return t.erase()})),2);case 2:if(!r)return d(e,Promise.all(i.map(function(t){return t.destroy()})),0);e.V(0)}})})}function io(){return $u.values(Gc).some(function(t){return!!(t=t())&&(t.destroy(),!0)})}function ro(t){this.a=new Wa(t)}function ao(t){return Promise.reject(new z(2,9,9011,"Cannot add new value to "+t))}function oo(t,e,n,i){t=$a(t.a,e);var r=t.store();return n.forEach(function(t){r.delete(t).onsuccess=function(){return i(t)}}),t.promise()}function so(t,e,n){t=Ja(t.a,e,"readonly");var i=t.store(),r={},a=[];return n.forEach(function(t){i.get(t).onsuccess=function(e){e=e.target.result,void 0==e&&a.push(t),r[t]=e}}),t.promise().then(function(){return a.length?Promise.reject(new z(2,9,9012,"Could not find values for "+a)):n.map(function(t){return r[t]})})}function uo(t){return{originalManifestUri:t.originalManifestUri,duration:t.duration,size:t.size,expiration:null==t.expiration?1/0:t.expiration,periods:t.periods.map(co),sessionIds:t.sessionIds,drmInfo:t.drmInfo,appMetadata:t.appMetadata}}function co(t){return mo(t),t.streams.forEach(function(){}),{startTime:t.startTime,streams:t.streams.map(ho)}}function ho(t){var e=t.Cd?po(t.Cd):null;return{id:t.id,primary:t.primary,presentationTimeOffset:t.presentationTimeOffset,contentType:t.contentType,mimeType:t.mimeType,codecs:t.codecs,frameRate:t.frameRate,kind:t.kind,language:t.language,label:t.label,width:t.width,height:t.height,initSegmentKey:e,encrypted:t.encrypted,keyId:t.keyId,segments:t.segments.map(lo),variantIds:t.variantIds}}function lo(t){var e=po(t.uri);return{startTime:t.startTime,endTime:t.endTime,dataKey:e}}function fo(t){return{data:t.data}}function po(t){var e;if((e=/^offline:[0-9]+\/[0-9]+\/([0-9]+)$/.exec(t))||(e=/^offline:segment\/([0-9]+)$/.exec(t)))return Number(e[1]);throw new z(2,9,9004,"Could not parse uri "+t)}function mo(t){var e=t.streams.filter(function(t){return"audio"==t.contentType}),n=t.streams.filter(function(t){return"video"==t.contentType});if(!e.every(function(t){return t.variantIds})||!n.every(function(t){return t.variantIds})){e.forEach(function(t){t.variantIds=[]}),n.forEach(function(t){t.variantIds=[]});var i=0;if(n.length&&!e.length){var r=i++;n.forEach(function(t){t.variantIds.push(r)})}if(!n.length&&e.length){var a=i++;e.forEach(function(t){t.variantIds.push(a)})}n.length&&e.length&&e.forEach(function(t){n.forEach(function(e){var n=i++;t.variantIds.push(n),e.variantIds.push(n)})})}}function vo(t,e,n,i){this.a=new Wa(t),this.c=e,this.b=n,this.f=i}function yo(t,e,n){if(t.f)return Promise.reject(new z(1,9,9011,"Cannot add new value to "+e));t=$a(t.a,e);var i=t.store(),r=[];return n.forEach(function(t){i.add(t).onsuccess=function(t){r.push(t.target.result)}}),t.promise().then(function(){return r})}function go(t,e,n,i){t=$a(t.a,e);var r=t.store();return n.forEach(function(t){r.delete(t).onsuccess=function(){return i(t)}}),t.promise()}function bo(t,e,n){t=Ja(t.a,e,"readonly");var i=t.store(),r={},a=[];return n.forEach(function(t){var e=i.get(t);e.onsuccess=function(){void 0==e.result&&a.push(t),r[t]=e.result}}),t.promise().then(function(){return a.length?Promise.reject(new z(1,9,9012,"Could not find values for "+a)):n.map(function(t){return r[t]})})}function wo(){this.c=this.b=this.a=this.f=null}function To(){var e=new q,n=t.indexedDB.deleteDatabase("shaka_offline_db");return n.onblocked=function(){},n.onsuccess=function(){e.resolve()},n.onerror=function(t){e.reject(new z(2,9,9001,n.error)),t.preventDefault()},e}function Eo(t,e,n,i){this.a=t,this.g=e,this.f=n,this.c=i,this.b=["offline:",t,"/",e,"/",n,"/",i].join("")}function So(t){if(null==(t=/^offline:([a-z]+)\/([^\/]+)\/([^\/]+)\/([0-9]+)$/.exec(t)))return null;var e=t[1];if("manifest"!=e&&"segment"!=e)return null;var n=t[2];if(!n)return null;var i=t[3];return i&&null!=e?new Eo(e,n,i,Number(t[4])):null}function ko(t,e){this.b=t,this.a=e}function Ao(t,e){var n=new Oi(null,0);n.ka(e.duration);var i=e.periods.map(function(e){return _o(t,e,n)}),r=e.drmInfo?[e.drmInfo]:[];return e.drmInfo&&i.forEach(function(t){t.variants.forEach(function(t){t.drmInfos=r})}),{presentationTimeline:n,minBufferTime:2,offlineSessionIds:e.sessionIds,periods:i}}function _o(t,e,n){var i=e.streams.filter(function(t){return"audio"==t.contentType}),r=e.streams.filter(function(t){return"video"==t.contentType});return i=Io(t,i,r),r=e.streams.filter(function(t){return"text"==t.contentType}).map(function(e){return xo(t,e)}),e.streams.forEach(function(e,i){var r=e.segments.map(function(e,n){return Po(t,n,e)});n.Na(r,0==i)}),{startTime:e.startTime,variants:i,textStreams:r}}function Io(t,e,n){var i={},r=[];return r.push.apply(r,e),r.push.apply(r,n),r.forEach(function(t){t.variantIds.forEach(function(t){i[t]=i[t]||{id:t,language:"",primary:!1,audio:null,video:null,bandwidth:0,drmInfos:[],allowedByApplication:!0,allowedByKeySystem:!0}})}),e.forEach(function(e){var n=xo(t,e);e.variantIds.forEach(function(t){t=i[t],t.language=n.language,t.primary=t.primary||n.primary,t.audio=n})}),n.forEach(function(e){var n=xo(t,e);e.variantIds.forEach(function(t){t=i[t],t.primary=t.primary||n.primary,t.video=n})}),$u.values(i)}function xo(t,e){var n=e.segments.map(function(e,n){return Po(t,n,e)}),i=new li(n);return n={id:e.id,createSegmentIndex:function(){return Promise.resolve()},findSegmentPosition:function(t){return i.find(t)},getSegmentReference:function(t){return i.get(t)},initSegmentReference:null,presentationTimeOffset:e.presentationTimeOffset,mimeType:e.mimeType,codecs:e.codecs,width:e.width||void 0,height:e.height||void 0,frameRate:e.frameRate||void 0,kind:e.kind,encrypted:e.encrypted,keyId:e.keyId,language:e.language,label:e.label||null,type:e.contentType,primary:e.primary,trickModeVideo:null,containsEmsgBoxes:!1,roles:[],channelsCount:null},null!=e.initSegmentKey&&(n.initSegmentReference=Ro(t,e.initSegmentKey)),n}function Po(t,e,n){var i=new Eo("segment",t.b,t.a,n.dataKey);return new ti(e,n.startTime,n.endTime,function(){return[i.toString()]},0,null)}function Ro(t,e){var n=new Eo("segment",t.b,t.a,e);return new Zn(function(){return[n.toString()]},0,null)}function No(){this.a=null}function Do(t){var e=So(t);return e&&"manifest"==e.a?Do.a(t):e&&"segment"==e.a?Do.b(e.key(),e):$(new z(2,1,9004,t))}function Co(t){this.a=null;for(var e=0;e<t.textTracks.length;++e){var n=t.textTracks[e];n.mode="disabled","Shaka Player TextTrack"==n.label&&(this.a=n)}this.a||(this.a=t.addTextTrack("subtitles","Shaka Player TextTrack")),this.a.mode="hidden"}function Mo(t){if(t.startTime>=t.endTime)return null;var e=new VTTCue(t.startTime,t.endTime,t.payload);e.lineAlign=t.lineAlign,e.positionAlign=t.positionAlign,e.size=t.size;try{e.align=t.textAlign}catch(t){}return"center"==t.textAlign&&"center"!=e.align&&(e.align="middle"),2==t.writingDirection?e.vertical="lr":3==t.writingDirection&&(e.vertical="rl"),1==t.lineInterpretation&&(e.snapToLines=!1),null!=t.line&&(e.line=t.line),null!=t.position&&(e.position=t.position),e}function Lo(t,e){var n=t.mode;t.mode="showing"==n?"showing":"hidden";for(var i=t.cues,r=i.length-1;0<=r;r--){var a=i[r];a&&e(a)&&t.removeCue(a)}t.mode=n}function Oo(e,n){var i=this;gn.call(this),this.wa=!1,this.f=null,this.pb=!1,this.u=null,this.o=new wt,this.Ab=this.h=this.Cb=this.b=this.m=this.a=this.A=this.g=this.j=this.i=this.s=null,this.bd=1e9,this.lb=[],this.ob=!1,this.xa=!0,this.S=this.qb=this.Ha=null,this.kc=!1,this.G=null,this.nb=[],this.I={},this.c=Wo(this),this.mb={width:1/0,height:1/0},this.l=$o(),this.kb=0,this.L=this.c.preferredAudioLanguage,this.ga=this.c.preferredTextLanguage,this.Ga=this.c.preferredVariantRole,this.Ua=this.c.preferredTextRole,this.Y=this.c.preferredAudioChannelCount,n&&n(this),this.s=new ft(this.Je.bind(this)),e&&this.rb(e,!0),Tt(this.o,t,"online",function(){i.ac()})}function Uo(t){if(!t.Ha)return Promise.resolve();var e=Promise.resolve();return t.m&&(e=t.m.stop(),t.m=null),Promise.all([e,t.Ha()])}function jo(t,e,n){return c(function i(){var r,a;return A(i,function(i){switch(i.w){case 1:return d(i,Li(e,t.s,t.c.manifest.retryParameters,n),2);case 2:return r=i.K,t.m=new r,t.m.configure(t.c.manifest),a={networkingEngine:t.s,filterNewPeriod:t.tb.bind(t),filterAllPeriods:t.ec.bind(t),onTimelineRegionAdded:t.ae.bind(t),onEvent:t.gb.bind(t),onError:t.Ta.bind(t)},i.return(t.m.start(e,a))}})})}function Bo(t){function e(t){return t.video&&t.audio||t.video&&t.video.codecs.includes(",")}if(t.b.periods.some(function(t){return t.variants.some(e)})&&t.b.periods.forEach(function(t){t.variants=t.variants.filter(e)}),0==t.b.periods.length)throw new z(2,4,4014)}function Fo(t){var e=t.b.presentationTimeline.T(),n=t.c.playRangeEnd,i=t.c.playRangeStart;0<i&&(t.P()||t.b.presentationTimeline.Tc(i)),n<e&&(t.P()||t.b.presentationTimeline.ka(n))}function Vo(t){function e(t){return(t.video?t.video.codecs.split(".")[0]:"")+"-"+(t.audio?t.audio.codecs.split(".")[0]:"")}var n=t.b.periods.reduce(function(t,e){return t.concat(e.variants)},[]);n=tn(n,t.c.preferredAudioChannelCount);var i={};n.forEach(function(t){var n=e(t);n in i||(i[n]=[]),i[n].push(t)});var r=null,a=1/0;$u.forEach(i,function(t,e){var n=0,i=0;e.forEach(function(t){n+=t.bandwidth||0,++i});var o=n/i;o<a&&(r=t,a=o)}),t.b.periods.forEach(function(t){t.variants=t.variants.filter(function(t){return e(t)==r})})}function Ko(t){if(t.m&&t.m.configure(t.c.manifest),t.i&&t.i.configure(t.c.drm),t.a){t.a.configure(t.c.streaming);try{t.b.periods.forEach(t.tb.bind(t))}catch(e){t.Ta(e)}var e=ua(t.a),n=ca(t.a),i=oa(t.a);(e=an(e,n,i.variants))&&e.allowedByApplication&&e.allowedByKeySystem||es(t,i)}t.h&&(t.h.configure(t.c.abr),t.c.abr.enabled&&!t.xa?t.h.enable():t.h.disable())}function Ho(t){var e=[];return t.forEach(function(t){if(t){var n=t.language;t.roles.length?t.roles.forEach(function(t){e.push({language:n,role:t})}):e.push({language:n,role:""})}else e.push({language:"und",role:""})}),it(e,function(t,e){return t.language==e.language&&t.role==e.role})}function qo(t,e,n){e.video&&Xo(t,e.video),e.audio&&Xo(t,e.audio);var i=sa(t.a);e!=an(ua(t.a),ca(t.a),i?i.variants:[])&&t.l.switchHistory.push({timestamp:Date.now()/1e3,id:e.id,type:"variant",fromAdaptation:n,bandwidth:e.bandwidth})}function Go(t,e,n){Xo(t,e),t.l.switchHistory.push({timestamp:Date.now()/1e3,id:e.id,type:"text",fromAdaptation:n,bandwidth:null})}function Xo(t,e){var n=un(t.b,e);t.I[n]||(t.I[n]={}),t.I[n][e.type]=e.id}function Yo(t){t.o&&(t.o.pa(t.f,"loadeddata"),t.o.pa(t.f,"playing"),t.o.pa(t.f,"pause"),t.o.pa(t.f,"ended"));var e=t.i,n=Promise.all([t.h?t.h.stop():null,t.j?t.j.destroy():null,t.g?t.g.destroy():null,t.A?t.A.destroy():null,t.a?t.a.destroy():null,t.m?t.m.stop():null,t.u?t.u.destroy():null]).then(function(){return e?e.destroy():null});return t.xa=!0,t.i=null,t.j=null,t.g=null,t.A=null,t.a=null,t.m=null,t.u=null,t.b=null,t.Cb=null,t.nb=[],t.I={},t.l=$o(),n}function zo(){return{".drm.servers":"",".drm.clearKeys":"",".drm.advanced":{distinctiveIdentifierRequired:!1,persistentStateRequired:!1,videoRobustness:"",audioRobustness:"",serverCertificate:new Uint8Array(0)}}}function Wo(t){var e=5e5,n=1/0;return navigator.connection&&navigator.connection.type&&(e=1e6*navigator.connection.downlink,navigator.connection.saveData&&(n=360)),{drm:{retryParameters:Y(),servers:{},clearKeys:{},advanced:{},delayLicenseRequestUntilPlayed:!1},manifest:{retryParameters:Y(),availabilityWindowOverride:NaN,dash:{customScheme:function(t){if(t)return null},clockSyncUri:"",ignoreDrmInfo:!1,xlinkFailGracefully:!1,defaultPresentationDelay:10}},streaming:{retryParameters:Y(),failureCallback:t.kd.bind(t),rebufferingGoal:2,bufferingGoal:10,bufferBehind:30,ignoreTextStreamFailures:!1,alwaysStreamText:!1,startAtSegmentBoundary:!1,smallGapLimit:.5,jumpLargeGaps:!1,durationBackoff:1,forceTransmuxTS:!1},abrFactory:cn,textDisplayFactory:function(){return new Co(t.f)},abr:{enabled:!0,defaultBandwidthEstimate:e,switchInterval:8,bandwidthUpgradeTarget:.85,bandwidthDowngradeTarget:.95,restrictions:{minWidth:0,maxWidth:1/0,minHeight:0,maxHeight:n,minPixels:0,maxPixels:1/0,minBandwidth:0,maxBandwidth:1/0}},preferredAudioLanguage:"",preferredTextLanguage:"",preferredVariantRole:"",preferredTextRole:"",preferredAudioChannelCount:2,restrictions:{minWidth:0,maxWidth:1/0,minHeight:0,maxHeight:1/0,minPixels:0,maxPixels:1/0,minBandwidth:0,maxBandwidth:1/0},playRangeStart:0,playRangeEnd:1/0}}function $o(){return{width:NaN,height:NaN,streamBandwidth:NaN,decodedFrames:NaN,droppedFrames:NaN,estimatedBandwidth:NaN,loadLatency:NaN,playTime:0,bufferingTime:0,switchHistory:[],stateHistory:[]}}function Jo(t,e,n){t.xa?(t.S=e,t.kc=n||!1):pa(t.a,e,n||!1)}function Qo(t){if(t.b){var e=Date.now()/1e3;t.ob?t.l.bufferingTime+=e-t.kb:t.l.playTime+=e-t.kb,t.kb=e}}function Zo(t,e){function n(t,e){if(!t)return null;var n=t.findSegmentPosition(e-a.startTime);return null==n?null:(n=t.getSegmentReference(n))?n.startTime+a.startTime:null}var i=ua(t.a),r=ca(t.a),a=oa(t.a);return i=n(i,e),r=n(r,e),null!=r&&null!=i?Math.max(r,i):null!=r?r:null!=i?i:e}function ts(t,e){return e&&e.length?(t.h.setVariants(e),t.h.chooseVariant()):(t.Ta(new z(2,4,4012)),null)}function es(t,e){var n=Qe(e.variants,t.L,t.Ga,t.Y),i=en(e.textStreams,t.ga,t.Ua);(n=ts(t,n))&&(qo(t,n,!0),Jo(t,n,!0)),(i=i[0])&&(t.c.streaming.alwaysStreamText||t.Mb())&&(Go(t,i,!0),t.xa?t.G=i:ma(t.a,i,!0)),ns(t)}function ns(t){Promise.resolve().then(function(){this.wa||this.dispatchEvent(new At("adaptation"))}.bind(t))}function is(t){Promise.resolve().then(function(){this.wa||this.dispatchEvent(new At("trackschanged"))}.bind(t))}function rs(t){t.dispatchEvent(new At("texttrackvisibility"))}function as(t,e,n){var i=void 0==e.expiration?1/0:e.expiration,r=e.presentationTimeline.T();return e=Xe(e.periods[0]),{offlineUri:null,originalManifestUri:t,duration:r,size:0,expiration:i,tracks:e,appMetadata:n}}function os(t,e){var n=_o(new ko(t.fa(),t.N()),e.periods[0],new Oi(null,0)),i=e.appMetadata||{};return n=Xe(n),{offlineUri:t.toString(),originalManifestUri:e.originalManifestUri,duration:e.duration,size:e.size,expiration:e.expiration,tracks:n,appMetadata:i}}function ss(){this.a={}}function us(t,e,n){return n=n.endTime-n.startTime,cs(t,e)*n}function cs(t,e){var n=t.a[e];return null==n&&(n=0),n}function hs(t){if(!t||t.constructor!=Oo)throw new z(2,9,9008);this.a=t,this.b=ys(this),this.g=!1,this.c=null,this.f=[]}function ls(){return io()}function fs(t,e,n,i,r,a){var o,s=as(r,i,a),u=new Ka(function(e,n){s.size=n,t.b.progressCallback(s,e)});return ct([u],function(){return o=Ts(t,u,e,n,i,r,a),qa(u,t.a.s)}).then(function(){return o.size=s.size,o})}function ds(t,e,n){var i,r=new zt({$a:t.a.s,onError:function(t){6013!=t.code&&(i=t)},Ub:function(){},onExpirationUpdated:function(){},onEvent:function(){}});r.configure(t.a.getConfiguration().drm);var a=Ao(new ko(e.fa(),e.N()),n);return ct([r],function(){return c(function e(){return A(e,function(e){switch(e.w){case 1:return d(e,r.init(a,t.b.usePersistentLicense),2);case 2:return d(e,Wt(r,n.sessionIds),0)}})})}).then(function(){if(i)throw i})}function ps(t,e,n,i){function r(){s+=1,t.b.progressCallback(u,s/o)}var a=xs(i),o=a.length+1,s=0,u=os(n,i);return Promise.all([e.removeSegments(a,r),e.removeManifests([n.key()],r)])}function ms(t,e,n,i){function r(){}var a,o,s,u=t.a.s,c=t.a.getConfiguration();return Li(e,u,c.manifest.retryParameters,i).then(function(t){var i=this;As(this),o=new zt({$a:u,onError:n,Ub:r,onExpirationUpdated:function(){},onEvent:function(){}}),o.configure(c.drm);var a={networkingEngine:u,filterAllPeriods:function(t){gs(i,o,t)},filterNewPeriod:function(t){bs(i,o,t)},onTimelineRegionAdded:function(){},onEvent:function(){},onError:n};return s=new t,s.configure(c.manifest),s.start(e,a)}.bind(t)).then(function(t){return As(this),a=t,o.init(a,this.b.usePersistentLicense)}.bind(t)).then(function(){return As(this),ws(a)}.bind(t)).then(function(){return As(this),$t(o)}.bind(t)).then(function(){return As(this),s.stop()}.bind(t)).then(function(){return As(this),{manifest:a,Eb:o}}.bind(t)).catch(function(t){if(s)return s.stop().then(function(){throw t});throw t})}function vs(t,e){var n=[],i=Be(t),r=[0,vc,yc],a=e.filter(function(t){return"variant"==t.type});r=r.map(function(t){return a.filter(function(e){return e=Be(e.language),je(t,i,e)})});for(var o,s=0;s<r.length;s++)if(r[s].length){o=r[s];break}o||(r=a.filter(function(t){return t.primary}),r.length&&(o=r)),o||(o=a,a.map(function(t){return t.language}).filter(Rt));var u=o.filter(function(t){return t.height&&480>=t.height});return u.length&&(u.sort(function(t,e){return e.height-t.height}),o=u.filter(function(t){return t.height==u[0].height})),o.sort(function(t,e){return t.bandwidth-e.bandwidth}),o.length&&n.push(o[Math.floor(o.length/2)]),n.push.apply(n,e.filter(function(t){return"text"==t.type})),n}function ys(t){return{trackSelectionCallback:function(e){return vs(t.a.getConfiguration().preferredAudioLanguage,e)},progressCallback:function(t,e){if(t||e)return null},usePersistentLicense:!0}}function gs(t,e,n){n.forEach(function(n){return bs(t,e,n)})}function bs(t,e,n){var i=null;if(t.c){var r=t.c.filter(function(t){return"variant"==t.type})[0];r&&(i=We(n,r))}var a=r=null;i&&(i.audio&&(r=i.audio),i.video&&(a=i.video)),Ke(e,r,a,n),Ve(n,t.a.getConfiguration().restrictions,{width:1/0,height:1/0})}function ws(t){var e=t.periods.map(function(t){return t.variants}).reduce(It,[]).map(function(t){var e=[];return t.audio&&e.push(t.audio),t.video&&e.push(t.video),e}).reduce(It,[]).filter(Rt);return t=t.periods.map(function(t){return t.textStreams}).reduce(It,[]),e.push.apply(e,t),Promise.all(e.map(function(t){return t.createSegmentIndex()}))}function Ts(t,e,n,i,r,a,o){var s=new ss,u=r.periods.map(function(a){return Es(t,e,n,s,i,r,a)}),c=i.b,h=Qt(i);if(c&&t.b.usePersistentLicense){if(!h.length)throw new z(2,9,9007,a);c.initData=[]}return{originalManifestUri:a,duration:r.presentationTimeline.T(),size:0,expiration:i.vb(),periods:u,sessionIds:t.b.usePersistentLicense?h:[],drmInfo:c,appMetadata:o}}function Es(t,e,n,i,r,a,o){var s=Ye(o,null,null),u=ze(o,null);s=t.b.trackSelectionCallback(s.concat(u)),null==t.c&&(t.c=s,gs(t,r,a.periods)),Ps(s),a.periods.forEach(function(t){t.variants.forEach(function(t){var e=t.audio,n=t.video;if(e&&!n&&(i.a[e.id]=e.bandwidth||t.bandwidth),!e&&n&&(i.a[n.id]=n.bandwidth||t.bandwidth),e&&n){var r=e.bandwidth||393216,a=n.bandwidth||t.bandwidth-r;0>=a&&(a=t.bandwidth),i.a[e.id]=r,i.a[n.id]=a}}),t.textStreams.forEach(function(t){i.a[t.id]=52})});var c={};s.forEach(function(t){"variant"==t.type&&null!=t.audioId&&(c[t.audioId]=!0),"variant"==t.type&&null!=t.videoId&&(c[t.videoId]=!0),"text"==t.type&&(c[t.id]=!0)});var h={};return Rs(a).filter(function(t){return!!c[t.id]}).forEach(function(r){h[r.id]=Ss(t,e,n,i,a,r)}),s.forEach(function(t){"variant"==t.type&&null!=t.audioId&&h[t.audioId].variantIds.push(t.id),"variant"==t.type&&null!=t.videoId&&h[t.videoId].variantIds.push(t.id)}),{startTime:o.startTime,streams:$u.values(h)}}function Ss(t,e,n,i,r,a){var o={id:a.id,primary:a.primary,presentationTimeOffset:a.presentationTimeOffset||0,contentType:a.type,mimeType:a.mimeType,codecs:a.codecs,frameRate:a.frameRate,kind:a.kind,language:a.language,label:a.label,width:a.width||null,height:a.height||null,initSegmentKey:null,encrypted:a.encrypted,keyId:a.keyId,segments:[],variantIds:[]};r=r.presentationTimeline.Xa();var s=a.id;return ks(a,r,function(r){Ha(e,s,Is(t,r),us(i,a.id,r),function(e){return n.addSegments([{data:e}]).then(function(e){t.f.push(e[0]),o.segments.push({startTime:r.startTime,endTime:r.endTime,dataKey:e[0]})})})}),(r=a.initSegmentReference)&&Ha(e,s,Is(t,r),.5*cs(i,a.id),function(e){return n.addSegments([{data:e}]).then(function(e){t.f.push(e[0]),o.initSegmentKey=e[0]})}),o}function ks(t,e,n){e=t.findSegmentPosition(e);for(var i=null==e?null:t.getSegmentReference(e);i;)n(i),i=t.getSegmentReference(++e)}function As(t){if(!t.a)throw new z(2,9,7001)}function _s(){if(!io())throw new z(2,9,9e3)}function Is(t,e){var n=t.a.getConfiguration().streaming.retryParameters;return n=pt(e.c(),n),0==e.b&&null==e.a||(n.headers.Range="bytes="+e.b+"-"+(null==e.a?"":e.a)),n}function xs(t){var e=[];return t.periods.forEach(function(t){t.streams.forEach(function(t){null!=t.initSegmentKey&&e.push(t.initSegmentKey),t.segments.forEach(function(t){e.push(t.dataKey)})})}),e}function Ps(t){t.some(function(e){return t.some(function(t){return e!=t&&e.type==t.type&&e.kind==t.kind&&e.language==t.language})})}function Rs(t){var e={};return t.periods.forEach(function(t){t.textStreams.forEach(function(t){e[t.id]=t}),t.variants.forEach(function(t){t.audio&&(e[t.audio.id]=t.audio),t.video&&(e[t.video.id]=t.video)})}),$u.values(e)}function Ns(t,e){e=e||0;for(var n={priority:e,dd:t},i=0;i<Yc.length;i++)if(Yc[i].priority<e)return void Yc.splice(i,0,n);Yc.push(n)}function Ds(t){var e=t.type.replace(/^(webkit|moz|MS)/,"").toLowerCase();if("function"==typeof Event)var n=new Event(e,t);else n=document.createEvent("Event"),n.initEvent(e,t.bubbles,t.cancelable);t.target.dispatchEvent(n)}function Cs(t,e,n){if("input"==t)switch(this.type){case"range":t="change"}zc.call(this,t,e,n)}function Ms(){var t=MediaSource.prototype.addSourceBuffer;MediaSource.prototype.addSourceBuffer=function(){var e=t.apply(this,arguments);return e.abort=function(){},e}}function Ls(){var t=SourceBuffer.prototype.remove;SourceBuffer.prototype.remove=function(e,n){return t.call(this,e,n-.001)}}function Os(){var t=MediaSource.prototype.endOfStream;MediaSource.prototype.endOfStream=function(){for(var e=0,n=0;n<this.sourceBuffers.length;++n){var i=this.sourceBuffers[n];i=i.buffered.end(i.buffered.length-1),e=Math.max(e,i)}if(!isNaN(this.duration)&&e<this.duration)for(this.vc=!0,e=0;e<this.sourceBuffers.length;++e)this.sourceBuffers[e].qc=!1;return t.apply(this,arguments)};var e=!1,n=MediaSource.prototype.addSourceBuffer;MediaSource.prototype.addSourceBuffer=function(){var t=n.apply(this,arguments);return t.mediaSource_=this,t.addEventListener("updateend",Us,!1),e||(this.addEventListener("sourceclose",js,!1),e=!0),t}}function Us(t){var e=t.target,n=e.mediaSource_;if(n.vc){for(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),e.qc=!0,t=0;t<n.sourceBuffers.length;++t)if(0==n.sourceBuffers[t].qc)return;n.vc=!1}}function js(t){t=t.target;for(var e=0;e<t.sourceBuffers.length;++e)t.sourceBuffers[e].removeEventListener("updateend",Us,!1);t.removeEventListener("sourceclose",js,!1)}function Bs(){var t=MediaSource.isTypeSupported;MediaSource.isTypeSupported=function(e){return"mp2t"!=e.split(/ *; */)[0].split("/")[1]&&t(e)}}function Fs(){var t=MediaSource.isTypeSupported,e=/^dv(?:he|av)\./;MediaSource.isTypeSupported=function(n){for(var i=n.split(/ *; */),r=i[0],a={},o=1;o<i.length;++o){var s=i[o].split("="),u=s[0];s=s[1].replace(/"(.*)"/,"$1"),a[u]=s}if(!(i=a.codecs))return t(n);var c=!1,h=!1;n=i.split(",").filter(function(t){return e.test(t)?(h=!0,!1):(/^(hev|hvc)1\.2/.test(t)&&(c=!0),!0)}),h&&(c=!1),a.codecs=n.join(","),c&&(a.eotf="smpte2084");for(var l in a)r+="; "+l+'="'+a[l]+'"';return cast.__platform__.canDisplayType(r)}}function Vs(t){this.f=[],this.b=[],this.a=[],(new ii).Z("pssh",this.c.bind(this)).parse(t.buffer)}function Ks(t,e){try{var n=new Hs(t,e);return Promise.resolve(n)}catch(t){return Promise.reject(t)}}function Hs(t,e){this.keySystem=t;for(var n=!1,i=0;i<e.length;++i){var r=e[i],a={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:r.initDataTypes,sessionTypes:["temporary"],label:r.label},o=!1;if(r.audioCapabilities)for(var s=0;s<r.audioCapabilities.length;++s){var u=r.audioCapabilities[s];if(u.contentType){o=!0;var c=u.contentType.split(";")[0];MSMediaKeys.isTypeSupported(this.keySystem,c)&&(a.audioCapabilities.push(u),n=!0)}}if(r.videoCapabilities)for(s=0;s<r.videoCapabilities.length;++s)u=r.videoCapabilities[s],u.contentType&&(o=!0,c=u.contentType.split(";")[0],MSMediaKeys.isTypeSupported(this.keySystem,c)&&(a.videoCapabilities.push(u),n=!0));if(o||(n=MSMediaKeys.isTypeSupported(this.keySystem,"video/mp4")),"required"==r.persistentState&&(n=!1),n)return void(this.a=a)}throw n=Error("Unsupported keySystem"),n.name="NotSupportedError",n.code=DOMException.NOT_SUPPORTED_ERR,n}function qs(t){var e=this.mediaKeys;return e&&e!=t&&Xs(e,null),delete this.mediaKeys,(this.mediaKeys=t)?Xs(t,this):Promise.resolve()}function Gs(t){this.a=new MSMediaKeys(t),this.b=new wt}function Xs(t,e){function n(){e.msSetMediaKeys(i.a),e.removeEventListener("loadedmetadata",n)}if(St(t.b),!e)return Promise.resolve();Tt(t.b,e,"msneedkey",zs);var i=t;try{return 1<=e.readyState?e.msSetMediaKeys(t.a):e.addEventListener("loadedmetadata",n),Promise.resolve()}catch(t){return Promise.reject(t)}}function Ys(t){gn.call(this),this.c=null,this.g=t,this.b=this.a=null,this.f=new wt,this.sessionId="",this.expiration=NaN,this.closed=new q,this.keyStatuses=new Js}function zs(t){var e=document.createEvent("CustomEvent");if(e.initCustomEvent("encrypted",!1,!1,null),e.initDataType="cenc",t=t.initData){var n=new Vs(t);if(!(1>=n.a.length)){for(var i=[],r=0;r<n.a.length;r++)i.push(t.subarray(n.a[r].start,n.a[r].end+1));for(t=it(i,Ws),i=n=0;i<t.length;i++)n+=t[i].length;for(n=new Uint8Array(n),r=i=0;r<t.length;r++)n.set(t[r],i),i+=t[r].length;t=n}}e.initData=t,this.dispatchEvent(e)}function Ws(t,e){return Xt(t,e)}function $s(t,e){var n=t.keyStatuses;n.size=void 0==e?0:1,n.a=e,t.dispatchEvent(new At("keystatuseschange"))}function Js(){this.size=0,this.a=void 0}function Qs(){return Promise.reject(Error("The key system specified is not supported."))}function Zs(t){return null==t?Promise.resolve():Promise.reject(Error("MediaKeys not supported."))}function tu(){throw new TypeError("Illegal constructor.")}function eu(){throw new TypeError("Illegal constructor.")}function nu(t){var e=$c;return e?e+t.charAt(0).toUpperCase()+t.slice(1):t}function iu(t,e){try{var n=new au(t,e);return Promise.resolve(n)}catch(t){return Promise.reject(t)}}function ru(t){var e=this.mediaKeys;return e&&e!=t&&su(e,null),delete this.mediaKeys,(this.mediaKeys=t)&&su(t,this),Promise.resolve()}function au(t,e){this.a=this.keySystem=t;var n=!1;"org.w3.clearkey"==t&&(this.a="webkit-org.w3.clearkey",n=!1);var i=!1,r=document.getElementsByTagName("video");r=r.length?r[0]:document.createElement("video");for(var a=0;a<e.length;++a){var o=e[a],s={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:o.initDataTypes,sessionTypes:["temporary"],label:o.label},u=!1;if(o.audioCapabilities)for(var c=0;c<o.audioCapabilities.length;++c){var h=o.audioCapabilities[c];if(h.contentType){u=!0;var l=h.contentType.split(";")[0];r.canPlayType(l,this.a)&&(s.audioCapabilities.push(h),i=!0)}}if(o.videoCapabilities)for(c=0;c<o.videoCapabilities.length;++c)h=o.videoCapabilities[c],h.contentType&&(u=!0,r.canPlayType(h.contentType,this.a)&&(s.videoCapabilities.push(h),i=!0));if(u||(i=r.canPlayType("video/mp4",this.a)||r.canPlayType("video/webm",this.a)),"required"==o.persistentState&&(n?(s.persistentState="required",s.sessionTypes=["persistent-license"]):i=!1),i)return void(this.b=s)}throw n="Unsupported keySystem","org.w3.clearkey"!=t&&"com.widevine.alpha"!=t||(n="None of the requested configurations were supported."),n=Error(n),n.name="NotSupportedError",n.code=DOMException.NOT_SUPPORTED_ERR,n}function ou(t){this.g=t,this.b=null,this.a=new wt,this.c=[],this.f={}}function su(t,e){t.b=e,St(t.a);var n=$c;e&&(Tt(t.a,e,n+"needkey",t.fe.bind(t)),Tt(t.a,e,n+"keymessage",t.ee.bind(t)),Tt(t.a,e,n+"keyadded",t.ce.bind(t)),Tt(t.a,e,n+"keyerror",t.de.bind(t)))}function uu(t,e){var n=t.f[e];return n||((n=t.c.shift())?(n.sessionId=e,t.f[e]=n):null)}function cu(t,e,n){gn.call(this),this.f=t,this.h=!1,this.a=this.b=null,this.c=e,this.g=n,this.sessionId="",this.expiration=NaN,this.closed=new q,this.keyStatuses=new fu}function hu(t,e,n){if(t.h)return Promise.reject(Error("The session is already initialized."));t.h=!0;try{if("persistent-license"==t.g)if(n)var i=new Uint8Array(Ut("LOAD_SESSION|"+n));else{var r=Ut("PERSISTENT|"),a=new Uint8Array(r.byteLength+e.byteLength);a.set(new Uint8Array(r),0),a.set(new Uint8Array(e),r.byteLength),i=a}else i=new Uint8Array(e)}catch(t){return Promise.reject(t)}t.b=new q;var o=nu("generateKeyRequest");try{t.f[o](t.c,i)}catch(e){if("InvalidStateError"!=e.name)return t.b=null,Promise.reject(e);setTimeout(function(){try{this.f[o](this.c,i)}catch(t){this.b.reject(t),this.b=null}}.bind(t),10)}return t.b}function lu(t,e){var n=t.keyStatuses;n.size=void 0==e?0:1,n.a=e,t.dispatchEvent(new At("keystatuseschange"))}function fu(){this.size=0,this.a=void 0}function du(){return{droppedVideoFrames:this.webkitDroppedFrameCount,totalVideoFrames:this.webkitDecodedFrameCount,corruptedVideoFrames:0,creationTime:NaN,totalFrameDelay:0}}function pu(e,n,i){return new t.TextTrackCue(e,n,i)}function mu(e,n,i){return new t.TextTrackCue(e+"-"+n+"-"+i,e,n,i)}function vu(){}function yu(t){var e=[];if(!t)return e;for(var n=t.childNodes,i=0;i<n.length;i++){var r="span"==n[i].nodeName&&"p"==t.nodeName;n[i].nodeType!=Node.ELEMENT_NODE||"br"==n[i].nodeName||r||(r=yu(n[i]),e=e.concat(r))}return e.length||e.push(t),e}function gu(t,e){for(var n=t.childNodes,i=0;i<n.length;i++)if("br"==n[i].nodeName&&0<i)n[i-1].textContent+="\n";else if(0<n[i].childNodes.length)gu(n[i],e);else if(e){var r=n[i].textContent.trim();r=r.replace(/\s+/g," "),n[i].textContent=r}}function bu(t,e,n,i,r,a,o){if(!t.hasAttribute("begin")&&!t.hasAttribute("end")&&/^\s*$/.test(t.textContent))return null;gu(t,o),o=_u(t.getAttribute("begin"),n);var s=_u(t.getAttribute("end"),n);n=_u(t.getAttribute("dur"),n);var u=t.textContent;if(null==s&&null!=n&&(s=o+n),null==o||null==s)throw new z(2,2,2001);if(e=new ye(o+e,s+e,u),(r=Au(t,"region",r))&&r.getAttribute("xml:id")){var c=r.getAttribute("xml:id");a=a.filter(function(t){return t.id==c}),e.region=a[0]}return wu(e,t,r,i),e}function wu(t,e,n,i){"rtl"==Eu(e,n,i,"direction")&&(t.writingDirection=1);var r=Eu(e,n,i,"writingMode");"tb"==r||"tblr"==r?t.writingDirection=2:"tbrl"==r?t.writingDirection=3:"rltb"==r||"rl"==r?t.writingDirection=1:r&&(t.writingDirection=oc),(r=Eu(e,n,i,"textAlign"))&&(t.positionAlign=uh[r],t.lineAlign=sh[r],t.textAlign=ic[r.toUpperCase()]),(r=Eu(e,n,i,"displayAlign"))&&(t.displayAlign=ac[r.toUpperCase()]),(r=Eu(e,n,i,"color"))&&(t.color=r),(r=Eu(e,n,i,"backgroundColor"))&&(t.backgroundColor=r),(r=Eu(e,n,i,"fontFamily"))&&(t.fontFamily=r),(r=Eu(e,n,i,"fontWeight"))&&"bold"==r&&(t.fontWeight=700),(r=Eu(e,n,i,"wrapOption"))&&"noWrap"==r&&(t.wrapLine=!1),(r=Eu(e,n,i,"lineHeight"))&&r.match(Zc)&&(t.lineHeight=r),(r=Eu(e,n,i,"fontSize"))&&r.match(Zc)&&(t.fontSize=r),(r=Eu(e,n,i,"fontStyle"))&&(t.fontStyle=fc[r.toUpperCase()]),(n=Su(n,i,"textDecoration"))&&Tu(t,n),(e=ku(e,i,"textDecoration"))&&Tu(t,e)}function Tu(t,e){for(var n=e.split(" "),i=0;i<n.length;i++)switch(n[i]){case"underline":0>t.textDecoration.indexOf("underline")&&t.textDecoration.push("underline");break;case"noUnderline":0<=t.textDecoration.indexOf("underline")&&at(t.textDecoration,"underline");break;case"lineThrough":0>t.textDecoration.indexOf("lineThrough")&&t.textDecoration.push("lineThrough");break;case"noLineThrough":0<=t.textDecoration.indexOf("lineThrough")&&at(t.textDecoration,"lineThrough");break;case"overline":0>t.textDecoration.indexOf("overline")&&t.textDecoration.push("overline");break;case"noOverline":0<=t.textDecoration.indexOf("overline")&&at(t.textDecoration,"overline")}}function Eu(t,e,n,i){return(t=ku(t,n,i))?t:Su(e,n,i)}function Su(t,e,n){for(var i=yu(t),r=0;r<i.length;r++){var a=Dn(i[r],"http://www.w3.org/ns/ttml#styling",n);if(a)return a}return(t=Au(t,"style",e))?Dn(t,"http://www.w3.org/ns/ttml#styling",n):null}function ku(t,e,n){return(t=Au(t,"style",e))?Dn(t,"http://www.w3.org/ns/ttml#styling",n):null}function Au(t,e,n){if(!t||1>n.length)return null;var i=null,r=t;for(t=null;r&&!(t=r.getAttribute(e))&&(r=r.parentNode)instanceof Element;);if(e=t)for(t=0;t<n.length;t++)if(n[t].getAttribute("xml:id")==e){i=n[t];break}return i}function _u(t,e){var n=null;if(eh.test(t)){n=eh.exec(t);var i=Number(n[1]),r=Number(n[2]),a=Number(n[3]),o=Number(n[4]);o+=(Number(n[5])||0)/e.b,a+=o/e.frameRate,n=a+60*r+3600*i}else nh.test(t)?n=Iu(nh,t):ih.test(t)?n=Iu(ih,t):rh.test(t)?(n=rh.exec(t),n=Number(n[1])/e.frameRate):ah.test(t)?(n=ah.exec(t),n=Number(n[1])/e.a):oh.test(t)&&(n=Iu(oh,t));return n}function Iu(t,e){var n=t.exec(e);return null==n||""==n[0]?null:(Number(n[4])||0)/1e3+(Number(n[3])||0)+60*(Number(n[2])||0)+3600*(Number(n[1])||0)}function xu(t,e,n,i){this.frameRate=Number(t)||30,this.b=Number(e)||1,this.a=Number(i),0==this.a&&(this.a=t?this.frameRate*this.b:1),n&&(t=/^(\d+) (\d+)$/g.exec(n))&&(this.frameRate*=t[1]/t[2])}function Pu(){this.a=new vu}function Ru(){}function Nu(t,e,n){var i;(i=/^align:(start|middle|center|end|left|right)$/.exec(e))?(e=i[1],t.textAlign="middle"==e?nc:ic[e.toUpperCase()]):(i=/^vertical:(lr|rl)$/.exec(e))?t.writingDirection="lr"==i[1]?2:3:(i=/^size:([\d.]+)%$/.exec(e))?t.size=Number(i[1]):(i=/^position:([\d.]+)%(?:,(line-left|line-right|center|start|end))?$/.exec(e))?(t.position=Number(i[1]),i[2]&&(e=i[2],t.positionAlign="line-left"==e||"start"==e?"line-left":"line-right"==e||"end"==e?"line-right":"center")):(i=/^region:(.*)$/.exec(e))?(e=Du(n,i[1]))&&(t.region=e):(n=/^line:([\d.]+)%(?:,(start|end|center))?$/.exec(e))?(t.lineInterpretation=1,t.line=Number(n[1]),n[2]&&(t.lineAlign=cc[n[2].toUpperCase()])):(n=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(e))&&(t.lineInterpretation=sc,t.line=Number(n[1]),n[2]&&(t.lineAlign=cc[n[2].toUpperCase()]))}function Du(t,e){var n=t.filter(function(t){return t.id==e});return n.length?n[0]:null}function Cu(t){if(null==(t=cr(t,/(?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3})/g)))return null;var e=Number(t[2]),n=Number(t[3]);return 59<e||59<n?null:Number(t[4])/1e3+n+60*e+3600*(Number(t[1])||0)}function Mu(){this.a=null}function Lu(t,e,n){var i,r,a;return(new ii).C("payl",oi(function(t){i=Mt(t)})).C("iden",oi(function(t){r=Mt(t)})).C("sttg",oi(function(t){a=Mt(t)})).parse(t),i?Ou(i,r,a,e,n):null}function Ou(t,e,n,i,r){if(t=new ye(i,r,t),e&&(t.id=e),n)for(e=new sr(n),n=hr(e);n;)Nu(t,n,[]),ur(e),n=hr(e);return t}var Uu,ju="function"==typeof Object.defineProperties?Object.defineProperty:function(t,e,n){t!=Array.prototype&&t!=Object.prototype&&(t[e]=n.value)},Bu=void 0!==t&&t===this?this:void 0!==e&&null!=e?e:this,Fu=function(){var t=0;return function(e){return"jscomp_symbol_"+(e||"")+t++}}();s("Promise",function(t){function e(t){this.b=0,this.g=void 0,this.a=[];var e=this.c();try{t(e.resolve,e.reject)}catch(t){e.reject(t)}}function n(){this.a=null}function i(t){return t instanceof e?t:new e(function(e){e(t)})}if(t)return t;n.prototype.b=function(t){null==this.a&&(this.a=[],this.f()),this.a.push(t)},n.prototype.f=function(){var t=this;this.c(function(){t.h()})};var r=Bu.setTimeout;n.prototype.c=function(t){r(t,0)},n.prototype.h=function(){for(;this.a&&this.a.length;){var t=this.a;this.a=[];for(var e=0;e<t.length;++e){var n=t[e];t[e]=null;try{n()}catch(t){this.g(t)}}}this.a=null},n.prototype.g=function(t){this.c(function(){throw t})},e.prototype.c=function(){function t(t){return function(i){n||(n=!0,t.call(e,i))}}var e=this,n=!1;return{resolve:t(this.m),reject:t(this.f)}},e.prototype.m=function(t){if(t===this)this.f(new TypeError("A Promise cannot resolve to itself"));else if(t instanceof e)this.o(t);else{t:switch(typeof t){case"object":var n=null!=t;break t;case"function":n=!0;break t;default:n=!1}n?this.l(t):this.h(t)}},e.prototype.l=function(t){var e=void 0;try{e=t.then}catch(t){return void this.f(t)}"function"==typeof e?this.s(e,t):this.h(t)},e.prototype.f=function(t){this.i(2,t)},e.prototype.h=function(t){this.i(1,t)},e.prototype.i=function(t,e){if(0!=this.b)throw Error("Cannot settle("+t+", "+e+"): Promise already settled in state"+this.b);this.b=t,this.g=e,this.j()},e.prototype.j=function(){if(null!=this.a){for(var t=0;t<this.a.length;++t)a.b(this.a[t]);this.a=null}};var a=new n;return e.prototype.o=function(t){var e=this.c();t.sb(e.resolve,e.reject)},e.prototype.s=function(t,e){var n=this.c();try{t.call(e,n.resolve,n.reject)}catch(t){n.reject(t)}},e.prototype.then=function(t,n){function i(t,e){return"function"==typeof t?function(e){try{r(t(e))}catch(t){a(t)}}:e}var r,a,o=new e(function(t,e){r=t,a=e});return this.sb(i(t,r),i(n,a)),o},e.prototype.catch=function(t){return this.then(void 0,t)},e.prototype.sb=function(t,e){function n(){switch(i.b){case 1:t(i.g);break;case 2:e(i.g);break;default:throw Error("Unexpected state: "+i.b)}}var i=this;null==this.a?a.b(n):this.a.push(n)},e.resolve=i,e.reject=function(t){return new e(function(e,n){n(t)})},e.race=function(t){return new e(function(e,n){for(var r=o(t),a=r.next();!a.done;a=r.next())i(a.value).sb(e,n)})},e.all=function(t){var n=o(t),r=n.next();return r.done?i([]):new e(function(t,e){var a=[],o=0;do{a.push(void 0),o++,i(r.value).sb(function(e){return function(n){a[e]=n,0==--o&&t(a)}}(a.length-1),e),r=n.next()}while(!r.done)})},e}),s("Promise.prototype.finally",function(t){return t||function(t){return this.then(function(e){return Promise.resolve(t()).then(function(){return e})},function(e){return Promise.resolve(t()).then(function(){throw e})})}}),h.prototype.h=function(t){this.K=t},h.prototype.return=function(t){this.a={return:t},this.w=this.b},h.prototype.V=function(t){this.w=t},s("WeakMap",function(t){function e(t){if(this.a=(u+=Math.random()+1).toString(),t){n(),i(),t=o(t);for(var e;!(e=t.next()).done;)e=e.value,this.set(e[0],e[1])}}function r(t){_(t,s)||ju(t,s,{value:{}})}function a(t){var e=Object[t];e&&(Object[t]=function(t){return r(t),e(t)})}if(function(){if(!t||!Object.seal)return!1;try{var e=Object.seal({}),n=Object.seal({}),i=new t([[e,2],[n,3]]);return 2==i.get(e)&&3==i.get(n)&&(i.delete(e),i.set(n,4),!i.has(e)&&4==i.get(n))}catch(t){return!1}}())return t;var s="$jscomp_hidden_"+Math.random();a("freeze"),a("preventExtensions"),a("seal");var u=0;return e.prototype.set=function(t,e){if(r(t),!_(t,s))throw Error("WeakMap key fail: "+t);return t[s][this.a]=e,this},e.prototype.get=function(t){return _(t,s)?t[s][this.a]:void 0},e.prototype.has=function(t){return _(t,s)&&_(t[s],this.a)},e.prototype.delete=function(t){return!(!_(t,s)||!_(t[s],this.a))&&delete t[s][this.a]},e}),s("Map",function(t){function e(){var t={};return t.oa=t.next=t.head=t}function r(t,e){var n=t.a;return a(function(){if(n){for(;n.head!=t.a;)n=n.oa;for(;n.next!=n.head;)return n=n.next,{done:!1,value:e(n)};n=null}return{done:!0,value:void 0}})}function s(t,e){var n=e&&typeof e;"object"==n||"function"==n?c.has(e)?n=c.get(e):(n=""+ ++h,c.set(e,n)):n="p_"+e;var i=t.b[n];if(i&&_(t.b,n))for(var r=0;r<i.length;r++){var a=i[r];if(e!==e&&a.key!==a.key||e===a.key)return{id:n,list:i,index:r,O:a}}return{id:n,list:i,index:-1,O:void 0}}function u(t){if(this.b={},this.a=e(),this.size=0,t){t=o(t);for(var n;!(n=t.next()).done;)n=n.value,this.set(n[0],n[1])}}if(function(){if(!t||"function"!=typeof t||!t.prototype.entries||"function"!=typeof Object.seal)return!1;try{var e=Object.seal({x:4}),n=new t(o([[e,"s"]]));if("s"!=n.get(e)||1!=n.size||n.get({x:4})||n.set({x:4},"t")!=n||2!=n.size)return!1;var i=n.entries(),r=i.next();return!r.done&&r.value[0]==e&&"s"==r.value[1]&&(r=i.next(),!(r.done||4!=r.value[0].x||"t"!=r.value[1]||!i.next().done))}catch(t){return!1}}())return t;n(),i();var c=new WeakMap;u.prototype.set=function(t,e){var n=s(this,t);return n.list||(n.list=this.b[n.id]=[]),n.O?n.O.value=e:(n.O={next:this.a,oa:this.a.oa,head:this.a,key:t,value:e},n.list.push(n.O),this.a.oa.next=n.O,this.a.oa=n.O,this.size++),this},u.prototype.delete=function(t){return t=s(this,t),!(!t.O||!t.list)&&(t.list.splice(t.index,1),t.list.length||delete this.b[t.id],t.O.oa.next=t.O.next,t.O.next.oa=t.O.oa,t.O.head=null,this.size--,!0)},u.prototype.clear=function(){this.b={},this.a=this.a.oa=e(),this.size=0},u.prototype.has=function(t){return!!s(this,t).O},u.prototype.get=function(t){return(t=s(this,t).O)&&t.value},u.prototype.entries=function(){return r(this,function(t){return[t.key,t.value]})},u.prototype.keys=function(){return r(this,function(t){return t.key})},u.prototype.values=function(){return r(this,function(t){return t.value})},u.prototype.forEach=function(t,e){for(var n,i=this.entries();!(n=i.next()).done;)n=n.value,t.call(e,n[1],n[0],this)},u.prototype[Symbol.iterator]=u.prototype.entries;var h=0;return u}),s("Array.prototype.find",function(t){return t||function(t,e){t:{var n=this;n instanceof String&&(n=String(n));for(var i=n.length,r=0;r<i;r++){var a=n[r];if(t.call(e,a,r,n)){n=a;break t}}n=void 0}return n}}),s("Object.values",function(t){return t||function(t){var e,n=[];for(e in t)_(t,e)&&n.push(t[e]);return n}}),s("Object.is",function(t){return t||function(t,e){return t===e?0!==t||1/t==1/e:t!==t&&e!==e}}),s("Array.prototype.includes",function(t){return t||function(t,e){var n=this;n instanceof String&&(n=String(n));var i=n.length,r=e||0;for(0>r&&(r=Math.max(r+i,0));r<i;r++){var a=n[r];if(a===t||Object.is(a,t))return!0}return!1}}),s("String.prototype.includes",function(t){return t||function(t,e){if(null==this)throw new TypeError("The 'this' value for String.prototype.includes must not be null or undefined");if(t instanceof RegExp)throw new TypeError("First argument to String.prototype.includes must not be a regular expression");return-1!==this.indexOf(t,e||0)}});var Vu=this;Vu.a=!0,D.prototype.getBandwidthEstimate=function(t){return 128e3>this.a?t:Math.min(N(this.b),N(this.c))},t.console&&t.console.log.bind&&(C=console.warn.bind(console));var Ku=/^(?:([^:\/?#.]+):)?(?:\/\/(?:([^\/?#]*)@)?([^\/#?]*?)(?::([0-9]+))?(?=[\/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#(.*))?$/;Uu=L.prototype,Uu.ia="",Uu.Fa="",Uu.la="",Uu.Qa=null,Uu.aa="",Uu.za="",Uu.toString=function(){var t=[],e=this.ia;if(e&&t.push(F(e,Hu,!0),":"),e=this.la){t.push("//");var n=this.Fa;n&&t.push(F(n,Hu,!0),"@"),t.push(encodeURIComponent(e).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e=this.Qa,null!=e&&t.push(":",String(e))}return(e=this.aa)&&(this.la&&"/"!=e.charAt(0)&&t.push("/"),t.push(F(e,"/"==e.charAt(0)?Gu:qu,!0))),(e=this.a.toString())&&t.push("?",e),(e=this.za)&&t.push("#",F(e,Yu)),t.join("")},Uu.resolve=function(t){var e=new L(this);"data"===e.ia&&(e=new L);var n=!!t.ia;n?O(e,t.ia):n=!!t.Fa,n?e.Fa=t.Fa:n=!!t.la,n?e.la=t.la:n=null!=t.Qa;var i=t.aa;if(n)U(e,t.Qa);else if(n=!!t.aa){if("/"!=i.charAt(0))if(this.la&&!this.aa)i="/"+i;else{var r=e.aa.lastIndexOf("/");-1!=r&&(i=e.aa.substr(0,r+1)+i)}if(".."==i||"."==i)i="";else if(-1!=i.indexOf("./")||-1!=i.indexOf("/.")){r=0==i.lastIndexOf("/",0),i=i.split("/");for(var a=[],o=0;o<i.length;){var s=i[o++];"."==s?r&&o==i.length&&a.push(""):".."==s?((1<a.length||1==a.length&&""!=a[0])&&a.pop(),r&&o==i.length&&a.push("")):(a.push(s),r=!0)}i=a.join("/")}}return n?e.aa=i:n=""!==t.a.toString(),n?j(e,H(t.a)):n=!!t.za,n&&(e.za=t.za),e};var Hu=/[#\/\?@]/g,qu=/[#\?:]/g,Gu=/[#\?]/g,Xu=/[#\?@]/g,Yu=/#/g;K.prototype.a=null,K.prototype.c=null,K.prototype.add=function(t,e){if(!this.a&&(this.a={},this.c=0,this.b))for(var n=this.b.split("&"),i=0;i<n.length;i++){var r=n[i].indexOf("="),a=null;if(0<=r){var o=n[i].substring(0,r);a=n[i].substring(r+1)}else o=n[i];o=decodeURIComponent(o.replace(/\+/g," ")),a=a||"",this.add(o,decodeURIComponent(a.replace(/\+/g," ")))}return this.b=null,(n=this.a.hasOwnProperty(t)&&this.a[t])||(this.a[t]=n=[]),n.push(e),this.c++,this},K.prototype.toString=function(){if(this.b)return this.b;if(!this.a)return"";var t,e=[];for(t in this.a)for(var n=encodeURIComponent(t),i=this.a[t],r=0;r<i.length;r++){var a=n;""!==i[r]&&(a+="="+encodeURIComponent(i[r])),e.push(a)}return this.b=e.join("&")},q.prototype.resolve=function(){},q.prototype.reject=function(){},I("shaka.util.Error",z),z.prototype.toString=function(){return"shaka.util.Error "+JSON.stringify(this,null," ")},z.Severity={RECOVERABLE:1,CRITICAL:2},z.Category={NETWORK:1,TEXT:2,MEDIA:3,MANIFEST:4,STREAMING:5,DRM:6,PLAYER:7,CAST:8,STORAGE:9},z.Code={UNSUPPORTED_SCHEME:1e3,BAD_HTTP_STATUS:1001,HTTP_ERROR:1002,TIMEOUT:1003,MALFORMED_DATA_URI:1004,UNKNOWN_DATA_URI_ENCODING:1005,REQUEST_FILTER_ERROR:1006,RESPONSE_FILTER_ERROR:1007,MALFORMED_TEST_URI:1008,UNEXPECTED_TEST_REQUEST:1009,INVALID_TEXT_HEADER:2e3,INVALID_TEXT_CUE:2001,UNABLE_TO_DETECT_ENCODING:2003,BAD_ENCODING:2004,INVALID_XML:2005,INVALID_MP4_TTML:2007,INVALID_MP4_VTT:2008,UNABLE_TO_EXTRACT_CUE_START_TIME:2009,BUFFER_READ_OUT_OF_BOUNDS:3e3,JS_INTEGER_OVERFLOW:3001,EBML_OVERFLOW:3002,EBML_BAD_FLOATING_POINT_SIZE:3003,MP4_SIDX_WRONG_BOX_TYPE:3004,MP4_SIDX_INVALID_TIMESCALE:3005,MP4_SIDX_TYPE_NOT_SUPPORTED:3006,WEBM_CUES_ELEMENT_MISSING:3007,WEBM_EBML_HEADER_ELEMENT_MISSING:3008,WEBM_SEGMENT_ELEMENT_MISSING:3009,WEBM_INFO_ELEMENT_MISSING:3010,WEBM_DURATION_ELEMENT_MISSING:3011,WEBM_CUE_TRACK_POSITIONS_ELEMENT_MISSING:3012,WEBM_CUE_TIME_ELEMENT_MISSING:3013,MEDIA_SOURCE_OPERATION_FAILED:3014,MEDIA_SOURCE_OPERATION_THREW:3015,VIDEO_ERROR:3016,QUOTA_EXCEEDED_ERROR:3017,TRANSMUXING_FAILED:3018,UNABLE_TO_GUESS_MANIFEST_TYPE:4e3,DASH_INVALID_XML:4001,DASH_NO_SEGMENT_INFO:4002,DASH_EMPTY_ADAPTATION_SET:4003,DASH_EMPTY_PERIOD:4004,DASH_WEBM_MISSING_INIT:4005,DASH_UNSUPPORTED_CONTAINER:4006,DASH_PSSH_BAD_ENCODING:4007,DASH_NO_COMMON_KEY_SYSTEM:4008,DASH_MULTIPLE_KEY_IDS_NOT_SUPPORTED:4009,DASH_CONFLICTING_KEY_IDS:4010,UNPLAYABLE_PERIOD:4011,RESTRICTIONS_CANNOT_BE_MET:4012,NO_PERIODS:4014,HLS_PLAYLIST_HEADER_MISSING:4015,INVALID_HLS_TAG:4016,HLS_INVALID_PLAYLIST_HIERARCHY:4017,DASH_DUPLICATE_REPRESENTATION_ID:4018,HLS_MULTIPLE_MEDIA_INIT_SECTIONS_FOUND:4020,HLS_COULD_NOT_GUESS_MIME_TYPE:4021,HLS_MASTER_PLAYLIST_NOT_PROVIDED:4022,HLS_REQUIRED_ATTRIBUTE_MISSING:4023,HLS_REQUIRED_TAG_MISSING:4024,HLS_COULD_NOT_GUESS_CODECS:4025,HLS_KEYFORMATS_NOT_SUPPORTED:4026,DASH_UNSUPPORTED_XLINK_ACTUATE:4027,DASH_XLINK_DEPTH_LIMIT:4028,HLS_COULD_NOT_PARSE_SEGMENT_START_TIME:4030,CONTENT_UNSUPPORTED_BY_BROWSER:4032,CANNOT_ADD_EXTERNAL_TEXT_TO_LIVE_STREAM:4033,INVALID_STREAMS_CHOSEN:5005,NO_RECOGNIZED_KEY_SYSTEMS:6e3,REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE:6001,FAILED_TO_CREATE_CDM:6002,FAILED_TO_ATTACH_TO_VIDEO:6003,INVALID_SERVER_CERTIFICATE:6004,FAILED_TO_CREATE_SESSION:6005,FAILED_TO_GENERATE_LICENSE_REQUEST:6006,LICENSE_REQUEST_FAILED:6007,LICENSE_RESPONSE_REJECTED:6008,ENCRYPTED_CONTENT_WITHOUT_DRM_INFO:6010,NO_LICENSE_SERVER_GIVEN:6012,OFFLINE_SESSION_REMOVED:6013,EXPIRED:6014,LOAD_INTERRUPTED:7e3,OPERATION_ABORTED:7001,NO_VIDEO_ELEMENT:7002,CAST_API_UNAVAILABLE:8e3,NO_CAST_RECEIVERS:8001,ALREADY_CASTING:8002,UNEXPECTED_CAST_ERROR:8003,CAST_CANCELED_BY_USER:8004,CAST_CONNECTION_TIMED_OUT:8005,CAST_RECEIVER_APP_UNAVAILABLE:8006,STORAGE_NOT_SUPPORTED:9e3,INDEXED_DB_ERROR:9001,DEPRECATED_OPERATION_ABORTED:9002,REQUESTED_ITEM_NOT_FOUND:9003,MALFORMED_OFFLINE_URI:9004,CANNOT_STORE_LIVE_OFFLINE:9005,STORE_ALREADY_IN_PROGRESS:9006,NO_INIT_DATA_FOR_OFFLINE:9007,LOCAL_PLAYER_INSTANCE_REQUIRED:9008,NEW_KEY_OPERATION_NOT_SUPPORTED:9011,KEY_NOT_FOUND:9012,MISSING_STORAGE_CELL:9013},I("shaka.util.AbortableOperation",W),W.failed=$,W.aborted=J,W.completed=Q,W.notAbortable=Z,W.prototype.abort=function(){return this.a=!0,this.b()},W.prototype.abort=W.prototype.abort,W.all=tt,W.prototype.finally=function(t){return this.promise.then(function(){return t(!0)},function(){return t(!1)}),this},W.prototype.finally=W.prototype.finally,W.prototype.X=function(t,e){function n(){return r.reject(new z(2,7,7001)),i.abort()}var i=this,r=new q;return this.promise.then(function(e){i.a?r.reject(new z(2,7,7001)):t?n=et(t,e,r):r.resolve(e)},function(t){e?n=et(e,t,r):r.reject(t)}),new W(r,function(){return n()})},W.prototype.chain=W.prototype.X,ht.prototype.destroy=function(){var t=[];return this.a.forEach(function(e){e.promise.catch(function(){}),t.push(e.abort())}),this.a=[],Promise.all(t)},I("shaka.net.NetworkingEngine",ft),ft.RequestType={MANIFEST:0,SEGMENT:1,LICENSE:2,APP:3},ft.PluginPriority={FALLBACK:1,PREFERRED:2,APPLICATION:3};var zu={};ft.registerScheme=dt,ft.unregisterScheme=function(t){delete zu[t]},ft.prototype.pe=function(t){this.a.push(t)},ft.prototype.registerRequestFilter=ft.prototype.pe,ft.prototype.Ue=function(t){at(this.a,t)},ft.prototype.unregisterRequestFilter=ft.prototype.Ue,ft.prototype.hd=function(){this.a=[]},ft.prototype.clearAllRequestFilters=ft.prototype.hd,ft.prototype.qe=function(t){this.b.push(t)},ft.prototype.registerResponseFilter=ft.prototype.qe,ft.prototype.Ve=function(t){at(this.b,t)},ft.prototype.unregisterResponseFilter=ft.prototype.Ve,ft.prototype.jd=function(){this.b=[]},ft.prototype.clearAllResponseFilters=ft.prototype.jd,ft.prototype.destroy=function(){return this.c=!0,this.a=[],this.b=[],this.g.destroy()},ft.prototype.destroy=ft.prototype.destroy,ft.prototype.request=function(t,e){var n=this;if(this.c)return mt(J());e.method=e.method||"GET",e.headers=e.headers||{},e.retryParameters=e.retryParameters?ut(e.retryParameters):Y(),e.uris=ut(e.uris);var i=vt(this,t,e),r=i.X(function(){return yt(n,t,e,new G(e.retryParameters,!1),0,null)}),a=r.X(function(e){return gt(n,t,e)}),o=Date.now(),s=0;i.promise.then(function(){s=Date.now()-o},function(){});var u=0;return r.promise.then(function(){u=Date.now()},function(){}),i=a.X(function(e){var i=Date.now()-u;return e.timeMs+=s,e.timeMs+=i,n.f&&!e.fromCache&&1==t&&n.f(e.timeMs,e.data.byteLength),e},function(t){throw t&&(t.severity=2),t}),lt(this.g,i),mt(i)},ft.prototype.request=ft.prototype.request,bt.prototype.push=function(t,e){this.a.hasOwnProperty(t)?this.a[t].push(e):this.a[t]=[e]},bt.prototype.get=function(t){return(t=this.a[t])?t.slice():null},bt.prototype.remove=function(t,e){var n=this.a[t];if(n)for(var i=0;i<n.length;++i)n[i]==e&&(n.splice(i,1),--i)},wt.prototype.destroy=function(){return St(this),this.a=null,Promise.resolve()},wt.prototype.pa=function(t,e){if(this.a)for(var n=this.a.get(e)||[],i=0;i<n.length;++i){var r=n[i];r.target==t&&(r.pa(),this.a.remove(e,r))}},kt.prototype.pa=function(){this.target.removeEventListener(this.type,this.a,!1),this.a=this.target=null},At.prototype.preventDefault=function(){this.cancelable&&(this.defaultPrevented=!0)},At.prototype.stopImmediatePropagation=function(){this.a=!0},At.prototype.stopPropagation=function(){};var Wu=1/15,$u={empty:function(t){return!t||0==Object.keys(t).length},values:function(t){return Object.keys(t).map(function(e){return t[e]})},map:function(t,e){return Object.keys(t).reduce(function(n,i){return n[i]=e(t[i],i),n},{})},every:function(t,e){return Object.keys(t).every(function(n){return e(n,t[n])})},forEach:function(t,e){Object.keys(t).forEach(function(n){e(n,t[n])})},df:function(t){var e=new Map;return Object.keys(t).forEach(function(n){e.set(n,t[n])}),e},ef:function(t){var e={};return t.forEach(function(t,n){e[n]=t}),e}},Ju={codecs:"codecs",frameRate:"framerate",bandwidth:"bitrate",width:"width",height:"height",channelsCount:"channels"};I("shaka.util.StringUtils.fromUTF8",Mt),I("shaka.util.StringUtils.fromUTF16",Lt),I("shaka.util.StringUtils.fromBytesAutoDetect",Ot),I("shaka.util.StringUtils.toUTF8",Ut),Bt.prototype.cancel=function(){null!=this.a&&(clearTimeout(this.a),this.a=null)},I("shaka.util.Uint8ArrayUtils.toBase64",Kt),I("shaka.util.Uint8ArrayUtils.fromBase64",Ht),I("shaka.util.Uint8ArrayUtils.fromHex",qt),I("shaka.util.Uint8ArrayUtils.toHex",Gt),I("shaka.util.Uint8ArrayUtils.equal",Xt),I("shaka.util.Uint8ArrayUtils.concat",Yt),Uu=zt.prototype,Uu.destroy=function(){this.c=!0;var t=[];return this.a.forEach(function(e){e=e.ja.close().catch(xt);var n=new Promise(function(t){setTimeout(t,1e3*Qu)});t.push(Promise.race([e,n]))}),this.i.reject(),this.g&&t.push(this.g.destroy()),this.l&&t.push(this.l.setMediaKeys(null).catch(xt)),this.A&&(this.A.cancel(),this.A=null),this.G&&(this.G.cancel(),this.G=null),this.g=this.l=this.j=this.u=this.b=null,this.a=[],this.o=[],this.s=this.h=this.f=null,Promise.all(t)},Uu.configure=function(t){this.f=t},Uu.init=function(t,e){var n={},i=[],r=t.periods.some(function(t){return t.variants.some(function(t){return t.drmInfos.length})});return this.ga=e,this.o=t.offlineSessionIds,Zt(this,t,e||0<t.offlineSessionIds.length,n,i),i.length?te(this,n,i,r):(this.L=!0,Promise.resolve())},Uu.rb=function(t){if(!this.j)return Et(this.g,t,"encrypted",function(){this.h(new z(2,6,6010))}.bind(this)),Promise.resolve();this.l=t,Et(this.g,this.l,"play",this.Td.bind(this)),t=this.l.setMediaKeys(this.j),t=t.catch(function(t){return Promise.reject(new z(2,6,6003,t.message))});var e=null;return this.b.serverCertificate&&this.b.serverCertificate.length&&(e=this.j.setServerCertificate(this.b.serverCertificate).then(function(){}).catch(function(t){return Promise.reject(new z(2,6,6004,t.message))})),Promise.all([t,e]).then(function(){var t=this;if(this.c)return Promise.reject();$t(this),this.b.initData.length||this.o.length||Tt(this.g,this.l,"encrypted",function(e){return Jt(t,e.initDataType,new Uint8Array(e.initData))})}.bind(this)).catch(function(t){return this.c?Promise.resolve():Promise.reject(t)}.bind(this))},Uu.keySystem=function(){return this.b?this.b.keySystem:""},Uu.vb=function(){var t=this.a.map(function(t){return t=t.ja.expiration,isNaN(t)?1/0:t});return Math.min.apply(Math,t)},Uu.Ic=function(t){this.f.delayLicenseRequestUntilPlayed&&this.l.paused&&!this.Y?this.I.push(t):ue(this,t)},Uu.Ec=function(t){t=t.target;var e;for(e=0;e<this.a.length&&this.a[e].ja!=t;++e);if(e!=this.a.length){var n=!1;t.keyStatuses.forEach(function(t,i){if("string"==typeof i){var r=i;i=t,t=r}if("com.microsoft.playready"==this.b.keySystem&&16==i.byteLength){r=new DataView(i);var a=r.getUint32(0,!0),o=r.getUint16(4,!0),s=r.getUint16(6,!0);r.setUint32(0,a,!1),r.setUint16(4,o,!1),r.setUint16(6,s,!1)}"com.microsoft.playready"==this.b.keySystem&&"status-pending"==t&&(t="usable"),"status-pending"!=t&&(this.a[e].loaded=!0),"expired"==t&&(n=!0),r=Gt(new Uint8Array(i)),this.S[r]=t}.bind(this));var i=t.expiration-Date.now();(0>i||n&&1e3>i)&&!this.a[e].qa&&(this.a.splice(e,1),t.close().catch(function(){})),this.a.every(function(t){return t.loaded})&&(this.i.resolve(),Ft(this.G))}},Uu.oe=function(){function t(t,e){return"expired"==e}this.m={};for(var e in this.S)this.m[e]=this.S[e];!$u.empty(this.m)&&$u.every(this.m,t)&&this.h(new z(2,6,6014)),this.s.Ub(this.m)},Uu.Td=function(){for(var t=0;t<this.I.length;t++)ue(this,this.I[t]);this.Y=!0,this.I=[]},Uu.ne=function(){this.a.forEach(function(t){var e=t.Tb,n=t.ja.expiration;isNaN(n)&&(n=1/0),n!=e&&(this.s.onExpirationUpdated(t.ja.sessionId,n),t.Tb=n)}.bind(this))};var Qu=1,Zu=5,tc=.5;I("shaka.text.Cue",ye);var ec="auto";ye.positionAlign={LEFT:"line-left",RIGHT:"line-right",CENTER:"center",AUTO:ec};var nc="center",ic={LEFT:"left",RIGHT:"right",CENTER:nc,START:"start",END:"end"};ye.textAlign=ic;var rc="before",ac={BEFORE:rc,CENTER:"center",AFTER:"after"};ye.displayAlign=ac;var oc=0;ye.writingDirection={HORIZONTAL_LEFT_TO_RIGHT:oc,HORIZONTAL_RIGHT_TO_LEFT:1,VERTICAL_LEFT_TO_RIGHT:2,VERTICAL_RIGHT_TO_LEFT:3};var sc=0;ye.lineInterpretation={LINE_NUMBER:sc,PERCENTAGE:1};var uc="center",cc={CENTER:uc,START:"start",END:"end"};ye.lineAlign=cc;var hc=400;ye.fontWeight={NORMAL:hc,BOLD:700};var lc="normal",fc={NORMAL:lc,ITALIC:"italic",OBLIQUE:"oblique"};ye.fontStyle=fc,ye.textDecoration={UNDERLINE:"underline",LINE_THROUGH:"lineThrough",OVERLINE:"overline"},I("shaka.text.CueRegion",ge);var dc=1;ge.units={PX:0,PERCENTAGE:dc,LINES:2};var pc="";ge.scrollMode={NONE:pc,UP:"up"},be.prototype.destroy=function(){return this.a.dispose(),this.a=null,Promise.resolve()},be.prototype.i=function(t){for(var e=0;e<t.captions.length;e++){var n=t.captions[e];this.c.push(new ye(n.startTime,n.endTime,n.text))}e=new Uint8Array(t.data.byteLength+t.initSegment.byteLength),e.set(t.initSegment,0),e.set(t.data,t.initSegment.byteLength),this.g.push(e)},be.prototype.h=function(){var t={data:Yt.apply(null,this.g),cues:this.c};this.b.resolve(t),this.f=!1};var mc={};I("shaka.text.TextEngine.registerParser",function(t,e){mc[t]=e}),I("shaka.text.TextEngine.unregisterParser",function(t){delete mc[t]}),Se.prototype.destroy=function(){return this.c=this.f=null,Promise.resolve()},Se.prototype.Ee=function(t){this.c=t},Se.prototype.setDisplayer=Se.prototype.Ee,Se.prototype.Kb=function(t){var e={periodStart:0,segmentStart:null,segmentEnd:0};try{return this.f.parseMedia(new Uint8Array(t),e)[0].startTime}catch(t){throw new z(2,2,2009,t)}},Se.prototype.remove=function(t,e){return Promise.resolve().then(function(){!this.c||!this.c.remove(t,e)||null==this.a||e<=this.a||t>=this.b||(t<=this.a&&e>=this.b?this.a=this.b=null:t<=this.a&&e<this.b?this.a=e:t>this.a&&e>=this.b&&(this.b=t))}.bind(this))},Se.prototype.lc=function(t){this.c.append(t)},Se.prototype.appendCues=Se.prototype.lc,Uu=Ae.prototype,Uu.destroy=function(){this.m=!0;var t,e=[];for(t in this.c){var n=this.c[t],i=n[0];for(this.c[t]=n.slice(0,1),i&&e.push(i.p.catch(xt)),i=1;i<n.length;++i)n[i].p.catch(xt),n[i].p.reject()}this.a&&e.push(this.a.destroy());for(var r in this.i)e.push(this.i[r].destroy());return Promise.all(e).then(function(){var t=this.h?this.h.destroy():null;return this.f&&(this.f.removeAttribute("src"),this.f.load()),this.o=this.a=this.g=this.f=this.h=null,this.b={},this.i={},this.c={},t}.bind(this))},Uu.init=function(t,e){var n=this;return this.j.then(function(){for(var i in t){var r=t[i];r=Ct(r.mimeType,r.codecs),"text"==i?Ie(n,r):(!e&&MediaSource.isTypeSupported(r)||!we(r,i)||(n.i[i]=new be,r=Te(i,r)),r=n.g.addSourceBuffer(r),Tt(n.h,r,"error",n.Qe.bind(n,i)),Tt(n.h,r,"updateend",n.Oa.bind(n,i)),n.b[i]=r,n.c[i]=[])}})},Uu.Gb=function(){var t=this.a&&null!=this.a.a?[{start:this.a.a,end:this.a.b}]:[];return{total:ve(this.f.buffered),audio:ve(Ne(this,"audio")),video:ve(Ne(this,"video")),text:t}},Uu.remove=function(t,e,n){return"text"==t?this.a.remove(e,n):Le(this,t,this.Wc.bind(this,t,e,n))},Uu.flush=function(t){return"text"==t?Promise.resolve():Le(this,t,this.md.bind(this,t))},Uu.endOfStream=function(t){return Oe(this,function(){t?this.g.endOfStream(t):this.g.endOfStream()}.bind(this))},Uu.ka=function(t){return Oe(this,function(){this.g.duration=t}.bind(this))},Uu.T=function(){return this.g.duration},Uu.Vc=function(t,e){this.b[t].appendBuffer(e)},Uu.Wc=function(t,e,n){n<=e?this.Oa(t):this.b[t].remove(e,n)},Uu.cd=function(t){var e=this.b[t].appendWindowStart,n=this.b[t].appendWindowEnd;this.b[t].abort(),this.b[t].appendWindowStart=e,this.b[t].appendWindowEnd=n,this.Oa(t)},Uu.md=function(t){this.f.currentTime-=.001,this.Oa(t)},Uu.Ge=function(t,e){0>e&&(e+=.001),this.b[t].timestampOffset=e,this.Oa(t)},Uu.De=function(t,e,n){this.b[t].appendWindowStart=0,this.b[t].appendWindowEnd=n,this.b[t].appendWindowStart=e,this.Oa(t)},Uu.Qe=function(t){this.c[t][0].p.reject(new z(2,3,3014,this.f.error?this.f.error.code:0))},Uu.Oa=function(t){var e=this.c[t][0];e&&(e.p.resolve(),Ue(this,t))};var vc=1,yc=2,gc={aar:"aa",abk:"ab",afr:"af",aka:"ak",alb:"sq",amh:"am",ara:"ar",arg:"an",arm:"hy",asm:"as",ava:"av",ave:"ae",aym:"ay",aze:"az",bak:"ba",bam:"bm",baq:"eu",bel:"be",ben:"bn",bih:"bh",bis:"bi",bod:"bo",bos:"bs",bre:"br",bul:"bg",bur:"my",cat:"ca",ces:"cs",cha:"ch",che:"ce",chi:"zh",chu:"cu",chv:"cv",cor:"kw",cos:"co",cre:"cr",cym:"cy",cze:"cs",dan:"da",deu:"de",div:"dv",dut:"nl",dzo:"dz",ell:"el",eng:"en",epo:"eo",est:"et",eus:"eu",ewe:"ee",fao:"fo",fas:"fa",fij:"fj",fin:"fi",fra:"fr",fre:"fr",fry:"fy",ful:"ff",geo:"ka",ger:"de",gla:"gd",gle:"ga",glg:"gl",glv:"gv",gre:"el",grn:"gn",guj:"gu",hat:"ht",hau:"ha",heb:"he",her:"hz",hin:"hi",hmo:"ho",hrv:"hr",hun:"hu",hye:"hy",ibo:"ig",ice:"is",ido:"io",iii:"ii",iku:"iu",ile:"ie",ina:"ia",ind:"id",ipk:"ik",isl:"is",ita:"it",jav:"jv",jpn:"ja",kal:"kl",kan:"kn",kas:"ks",kat:"ka",kau:"kr",kaz:"kk",khm:"km",kik:"ki",kin:"rw",kir:"ky",kom:"kv",kon:"kg",kor:"ko",kua:"kj",kur:"ku",lao:"lo",lat:"la",lav:"lv",lim:"li",lin:"ln",lit:"lt",ltz:"lb",lub:"lu",lug:"lg",mac:"mk",mah:"mh",mal:"ml",mao:"mi",mar:"mr",may:"ms",mkd:"mk",mlg:"mg",mlt:"mt",mon:"mn",mri:"mi",msa:"ms",mya:"my",nau:"na",nav:"nv",nbl:"nr",nde:"nd",ndo:"ng",nep:"ne",nld:"nl",nno:"nn",nob:"nb",nor:"no",nya:"ny",oci:"oc",oji:"oj",ori:"or",orm:"om",oss:"os",pan:"pa",per:"fa",pli:"pi",pol:"pl",por:"pt",pus:"ps",que:"qu",roh:"rm",ron:"ro",rum:"ro",run:"rn",rus:"ru",sag:"sg",san:"sa",sin:"si",slk:"sk",slo:"sk",slv:"sl",sme:"se",smo:"sm",sna:"sn",snd:"sd",som:"so",sot:"st",spa:"es",sqi:"sq",srd:"sc",srp:"sr",ssw:"ss",sun:"su",swa:"sw",swe:"sv",tah:"ty",tam:"ta",tat:"tt",tel:"te",tgk:"tg",tgl:"tl",tha:"th",tib:"bo",tir:"ti",ton:"to",tsn:"tn",tso:"ts",tuk:"tk",tur:"tr",twi:"tw",uig:"ug",ukr:"uk",urd:"ur",uzb:"uz",ven:"ve",vie:"vi",vol:"vo",wel:"cy",wln:"wa",wol:"wo",xho:"xh",yid:"yi",yor:"yo",zha:"za",zho:"zh",zul:"zu"};I("shaka.abr.SimpleAbrManager",cn),cn.prototype.stop=function(){this.h=null,this.f=!1,this.c=[],this.g=null},cn.prototype.stop=cn.prototype.stop,cn.prototype.init=function(t){this.h=t},cn.prototype.init=cn.prototype.init,cn.prototype.chooseVariant=function(){var t=hn(this.a.restrictions,this.c),e=this.b.getBandwidthEstimate(this.a.defaultBandwidthEstimate);this.c.length&&!t.length&&(t=hn(null,this.c),t=[t[0]]);for(var n=t[0]||null,i=0;i<t.length;++i){var r=t[i],a=(t[i+1]||{bandwidth:1/0}).bandwidth/this.a.bandwidthUpgradeTarget;e>=r.bandwidth/this.a.bandwidthDowngradeTarget&&e<=a&&(n=r)}return this.g=Date.now(),n},cn.prototype.chooseVariant=cn.prototype.chooseVariant,cn.prototype.enable=function(){this.f=!0},cn.prototype.enable=cn.prototype.enable,cn.prototype.disable=function(){this.f=!1},cn.prototype.disable=cn.prototype.disable,cn.prototype.segmentDownloaded=function(t,e){var n=this.b;if(!(16e3>e)){var i=8e3*e/t,r=t/1e3;n.a+=e,R(n.b,r,i),R(n.c,r,i)}if(null!=this.g&&this.f)t:{if(this.i){if(Date.now()-this.g<1e3*this.a.switchInterval)break t}else{if(!(128e3<=this.b.a))break t;this.i=!0}n=this.chooseVariant(),this.b.getBandwidthEstimate(this.a.defaultBandwidthEstimate),this.h(n)}},cn.prototype.segmentDownloaded=cn.prototype.segmentDownloaded,cn.prototype.getBandwidthEstimate=function(){return this.b.getBandwidthEstimate(this.a.defaultBandwidthEstimate)},cn.prototype.getBandwidthEstimate=cn.prototype.getBandwidthEstimate,cn.prototype.setVariants=function(t){this.c=t},cn.prototype.setVariants=cn.prototype.setVariants,cn.prototype.configure=function(t){this.a=t},cn.prototype.configure=cn.prototype.configure;var bc="ended play playing pause pausing ratechange seeked seeking timeupdate volumechange".split(" "),wc="buffered currentTime duration ended loop muted paused playbackRate seeking videoHeight videoWidth volume".split(" "),Tc=["loop","playbackRate"],Ec=["pause","play"],Sc="adaptation buffering emsg error loading streaming texttrackvisibility timelineregionadded timelineregionenter timelineregionexit trackschanged unloading".split(" "),kc={getAudioLanguages:2,getAudioLanguagesAndRoles:2,getBufferedInfo:2,getConfiguration:2,getExpiration:2,getManifestUri:2,getPlaybackRate:2,getTextLanguages:2,getTextLanguagesAndRoles:2,getTextTracks:2,getStats:5,usingEmbeddedTextTrack:2,getVariantTracks:2,isAudioOnly:10,isBuffering:1,isInProgress:1,isLive:10,isTextTrackVisible:1,keySystem:10,seekRange:1},Ac={getPlayheadTimeAsDate:1,getPresentationStartTimeAsDate:20},_c=[["getConfiguration","configure"]],Ic=[["isTextTrackVisible","setTextTrackVisibility"]],xc="addTextTrack cancelTrickPlay configure resetConfiguration retryStreaming selectAudioLanguage selectEmbeddedTextTrack selectTextLanguage selectTextTrack selectVariantTrack setTextTrackVisibility trickPlay".split(" "),Pc=["attach","detach","load","unload"],Rc=!1,Nc=null;Uu=pn.prototype,Uu.destroy=function(){return vn(this),Nc&&mn(this),this.G=this.A=this.g=null,this.b=this.h=!1,this.m=this.l=this.f=this.c=this.a=this.i=null,Promise.resolve()},Uu.$=function(){return this.b},Uu.Yb=function(){return this.u},Uu.init=function(){if(t.chrome&&chrome.cast&&chrome.cast.isAvailable){delete t.__onGCastApiAvailable,this.h=!0,this.g();var e=new chrome.cast.SessionRequest(this.I);e=new chrome.cast.ApiConfig(e,this.Dc.bind(this),this.Wd.bind(this),"origin_scoped"),chrome.cast.initialize(e,function(){},function(){}),Rc&&setTimeout(this.g.bind(this),20),(e=Nc)&&e.status!=chrome.cast.SessionStatus.STOPPED?this.Dc(e):Nc=null}else t.__onGCastApiAvailable=function(t){t&&this.init()}.bind(this)},Uu.bc=function(t){this.i=t,this.b&&yn({type:"appData",appData:this.i})},Uu.cast=function(t){return this.h?Rc?this.b?Promise.reject(new z(1,8,8002)):(this.f=new q,chrome.cast.requestSession(this.Vb.bind(this,t),this.Bc.bind(this)),this.f):Promise.reject(new z(1,8,8001)):Promise.reject(new z(1,8,8e3))},Uu.ub=function(){this.b&&(vn(this),Nc&&(mn(this),Nc.stop(function(){},function(){}),Nc=null))},Uu.get=function(t,e){if("video"==t){if(0<=Ec.indexOf(e))return this.Mc.bind(this,t,e)}else if("player"==t){if(Ac[e]&&!this.get("player","isLive")())return function(){};if(0<=xc.indexOf(e))return this.Mc.bind(this,t,e);if(0<=Pc.indexOf(e))return this.se.bind(this,t,e);if(kc[e])return this.Jc.bind(this,t,e)}return this.Jc(t,e)},Uu.set=function(t,e,n){this.a[t][e]=n,yn({type:"set",targetName:t,property:e,value:n})},Uu.Vb=function(t,e){Nc=e,e.addUpdateListener(this.l),e.addMessageListener("urn:x-cast:com.google.shaka.v2",this.m),this.Cc(),yn({type:"init",initState:t,appData:this.i}),this.f.resolve()},Uu.Bc=function(t){var e=8003;switch(t.code){case"cancel":e=8004;break;case"timeout":e=8005;break;case"receiver_unavailable":e=8006}this.f.reject(new z(2,8,e,t))},Uu.Jc=function(t,e){return this.a[t][e]},Uu.Mc=function(t,e){yn({type:"call",targetName:t,methodName:e,args:Array.prototype.slice.call(arguments,2)})},Uu.se=function(t,e){var n=Array.prototype.slice.call(arguments,2),i=new q,r=this.o.toString();return this.o++,this.c[r]=i,yn({type:"asyncCall",targetName:t,methodName:e,args:n,id:r}),i},Uu.Dc=function(t){var e=this.s();this.f=new q,this.j=!0,this.Vb(e,t)},Uu.Wd=function(t){Rc="available"==t,this.g()},Uu.Cc=function(){var t=!!Nc&&"connected"==Nc.status;if(this.b&&!t){this.G();for(var e in this.a)this.a[e]={};vn(this)}this.u=(this.b=t)?Nc.receiver.friendlyName:"",this.g()},Uu.Pd=function(t,e){var n=fn(e);switch(n.type){case"event":var i=n.event;this.A(n.targetName,new At(i.type,i));break;case"update":i=n.update;for(var r in i){n=this.a[r]||{};for(var a in i[r])n[a]=i[r][a]}this.j&&(this.L(),this.j=!1);break;case"asyncComplete":if(r=n.id,n=n.error,a=this.c[r],delete this.c[r],a)if(n){r=new z(n.severity,n.category,n.code);for(i in n)r[i]=n[i];a.reject(r)}else a.resolve()}},gn.prototype.addEventListener=function(t,e){this.Bb.push(t,e)},gn.prototype.removeEventListener=function(t,e){this.Bb.remove(t,e)},gn.prototype.dispatchEvent=function(t){for(var e=this.Bb.get(t.type)||[],n=0;n<e.length;++n){t.target=this.jb,t.currentTarget=this.jb;var i=e[n];try{i.handleEvent?i.handleEvent(t):i.call(this,t)}catch(t){}if(t.a)break}return t.defaultPrevented},x(bn,gn),I("shaka.cast.CastProxy",bn),bn.prototype.destroy=function(t){return t&&this.a&&this.a.ub(),t=[this.i?this.i.destroy():null,this.b?this.b.destroy():null,this.a?this.a.destroy():null],this.a=this.i=this.j=this.h=this.b=this.c=null,Promise.all(t)},bn.prototype.destroy=bn.prototype.destroy,bn.prototype.Bd=function(){return this.h},bn.prototype.getVideo=bn.prototype.Bd,bn.prototype.td=function(){return this.j},bn.prototype.getPlayer=bn.prototype.td,bn.prototype.ed=function(){return!!this.a&&(this.a.h&&Rc)},bn.prototype.canCast=bn.prototype.ed,bn.prototype.$=function(){return!!this.a&&this.a.$()},bn.prototype.isCasting=bn.prototype.$,bn.prototype.Yb=function(){return this.a?this.a.Yb():""},bn.prototype.receiverName=bn.prototype.Yb,bn.prototype.cast=function(){var t=this.tc();return this.a.cast(t).then(function(){if(this.b)return this.b.hb()}.bind(this))},bn.prototype.cast=bn.prototype.cast,bn.prototype.bc=function(t){this.a.bc(t)},bn.prototype.setAppData=bn.prototype.bc,bn.prototype.Se=function(){var t=this.a;if(t.b){var e=t.s();chrome.cast.requestSession(t.Vb.bind(t,e),t.Bc.bind(t))}},bn.prototype.suggestDisconnect=bn.prototype.Se,bn.prototype.ub=function(){this.a.ub()},bn.prototype.forceDisconnect=bn.prototype.ub,Uu=bn.prototype,Uu.tc=function(){var t={video:{},player:{},playerAfterLoad:{},manifest:this.b.Ib(),startTime:null};return this.c.pause(),Tc.forEach(function(e){t.video[e]=this.c[e]}.bind(this)),this.c.ended||(t.startTime=this.c.currentTime),_c.forEach(function(e){var n=e[1];e=this.b[e[0]](),t.player[n]=e}.bind(this)),Ic.forEach(function(e){var n=e[1];e=this.b[e[0]](),t.playerAfterLoad[n]=e}.bind(this)),t},Uu.Le=function(){this.dispatchEvent(new At("caststatuschanged"))},Uu.Me=function(){this.f.dispatchEvent(new At(this.h.paused?"pause":"play"))},Uu.Oe=function(){var t=this;_c.forEach(function(t){var e=t[1];t=this.a.get("player",t[0])(),this.b[e](t)}.bind(this));var e=this.a.get("player","getManifestUri")(),n=this.a.get("video","ended"),i=Promise.resolve(),r=this.c.autoplay,a=null;n||(a=this.a.get("video","currentTime")),e&&(this.c.autoplay=!1,i=this.b.load(e,a));var o={};Tc.forEach(function(t){o[t]=this.a.get("video",t)}.bind(this)),i.then(function(){t.c&&(Tc.forEach(function(t){this.c[t]=o[t]}.bind(t)),Ic.forEach(function(t){var e=t[1];t=this.a.get("player",t[0])(),this.b[e](t)}.bind(t)),t.c.autoplay=r,e&&t.c.play())},function(e){t.b.dispatchEvent(new At("error",{detail:e}))})},Uu.Ze=function(t){if("addEventListener"==t)return this.f.addEventListener.bind(this.f);if("removeEventListener"==t)return this.f.removeEventListener.bind(this.f);if(this.a.$()&&0==Object.keys(this.a.a.video).length){var e=this.c[t];if("function"!=typeof e)return e}return this.a.$()?this.a.get("video",t):(t=this.c[t],"function"==typeof t&&(t=t.bind(this.c)),t)},Uu.af=function(t,e){this.a.$()?this.a.set("video",t,e):this.c[t]=e},Uu.$e=function(t){this.a.$()||this.f.dispatchEvent(new At(t.type,t))},Uu.ke=function(t){if("addEventListener"==t)return this.g.addEventListener.bind(this.g);if("removeEventListener"==t)return this.g.removeEventListener.bind(this.g);if("getMediaElement"==t)return function(){return this.h}.bind(this);if("getNetworkingEngine"==t)return this.b.uc.bind(this.b);if(this.a.$()){if("getManifest"==t||"drmInfo"==t)return function(){return C(t+"() does not work while casting!"),null};if("attach"==t||"detach"==t)return function(){return C(t+"() does not work while casting!"),Promise.resolve()}}return this.a.$()&&0==Object.keys(this.a.a.video).length&&kc[t]||!this.a.$()?this.b[t].bind(this.b):this.a.get("player",t)},Uu.le=function(t){this.a.$()||this.g.dispatchEvent(t)},Uu.Ne=function(t,e){this.a.$()&&("video"==t?this.f.dispatchEvent(e):"player"==t&&this.g.dispatchEvent(e))},x(Tn,gn),I("shaka.cast.CastReceiver",Tn),Tn.prototype.isConnected=function(){return this.o},Tn.prototype.isConnected=Tn.prototype.isConnected,Tn.prototype.Ed=function(){return this.h},Tn.prototype.isIdle=Tn.prototype.Ed,Tn.prototype.destroy=function(){var e=[this.c?this.c.destroy():null,this.b?this.b.destroy():null];return null!=this.l&&t.clearTimeout(this.l),this.u=this.s=this.c=this.b=this.a=null,this.o=!1,this.h=!0,this.l=this.i=this.f=null,Promise.all(e).then(function(){cast.receiver.CastReceiverManager.getInstance().stop()})},Tn.prototype.destroy=Tn.prototype.destroy,Uu=Tn.prototype,Uu.Hc=function(){this.g=0,this.j=!0,this.o=0!=cast.receiver.CastReceiverManager.getInstance().getSenders().length,Sn(this)},Uu.Kc=function(t,e){this.b&&(this.Wb(),In(this,{type:"event",targetName:t,event:e},this.f))},Uu.Wb=function(){null!=this.l&&t.clearTimeout(this.l),this.l=t.setTimeout(this.Wb.bind(this),500);var e={video:{},player:{}};if(wc.forEach(function(t){e.video[t]=this.a[t]}.bind(this)),this.b.P())for(var n in Ac)0==this.g%Ac[n]&&(e.player[n]=this.b[n]());for(var i in kc)0==this.g%kc[i]&&(e.player[i]=this.b[i]());(n=cast.receiver.CastReceiverManager.getInstance().getSystemVolume())&&(e.video.volume=n.level,e.video.muted=n.muted),this.m&&(this.g+=1),In(this,{type:"update",update:e},this.f),An(this)},Uu.ld=function(){var t=cast.receiver.CastReceiverManager.getInstance().getSystemVolume();t&&In(this,{type:"update",update:{video:{volume:t.level,muted:t.muted}}},this.f),In(this,{type:"event",targetName:"video",event:{type:"volumechange"}},this.f)},Uu.Zd=function(t){var e=fn(t.data);switch(e.type){case"init":this.g=0,this.m=!1,this.j=!0,kn(this,e.initState,e.appData),this.Wb();break;case"appData":this.u(e.appData);break;case"set":var n=e.targetName,i=e.property;if(e=e.value,"video"==n){var r=cast.receiver.CastReceiverManager.getInstance();if("volume"==i){r.setSystemVolumeLevel(e);break}if("muted"==i){r.setSystemVolumeMuted(e);break}}this.s[n][i]=e;break;case"call":n=this.s[e.targetName],n[e.methodName].apply(n,e.args);break;case"asyncCall":n=e.targetName,i=e.methodName,"player"==n&&"load"==i&&(this.g=0,this.m=!1),r=e.id,t=t.senderId;var a=this.s[n];e=a[i].apply(a,e.args),"player"==n&&"load"==i&&(e=e.then(function(){this.j=!0}.bind(this))),e.then(this.Qc.bind(this,t,r,null),this.Qc.bind(this,t,r))}},Uu.Kd=function(t){var e=fn(t.data);switch(e.type){case"PLAY":this.a.play(),xn(this,0);break;case"PAUSE":this.a.pause(),xn(this,0);break;case"SEEK":t=e.currentTime;var n=e.resumeState;null!=t&&(this.a.currentTime=Number(t)),n&&"PLAYBACK_START"==n?(this.a.play(),xn(this,0)):n&&"PLAYBACK_PAUSE"==n&&(this.a.pause(),xn(this,0));break;case"STOP":this.b.hb().then(function(){this.b&&xn(this,0)}.bind(this));break;case"GET_STATUS":xn(this,Number(e.requestId));break;case"VOLUME":n=e.volume,t=n.level,n=n.muted;var i=this.a.volume,r=this.a.muted;null!=t&&(this.a.volume=Number(t)),null!=n&&(this.a.muted=n),i==this.a.volume&&r==this.a.muted||xn(this,0);break;case"LOAD":this.g=0,this.j=this.m=!1,t=e.currentTime,n=this.A(e.media.contentId),this.a.autoplay=!0,this.b.load(n,t).then(function(){this.b&&_n(this)}.bind(this)).catch(function(t){var n="LOAD_FAILED";7==t.category&&7e3==t.code&&(n="LOAD_CANCELLED"),In(this,{requestId:Number(e.requestId),type:n},this.i)}.bind(this));break;default:In(this,{requestId:Number(e.requestId),type:"INVALID_REQUEST",reason:"INVALID_COMMAND"},this.i)}},Uu.Qc=function(t,e,n){this.b&&In(this,{type:"asyncComplete",id:e,error:n},this.f,t)};var Dc={IDLE:"IDLE",ad:"PLAYING",Yc:"BUFFERING",$c:"PAUSED"},Cc={"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:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime"};I("shaka.media.InitSegmentReference",Zn),Zn.prototype.Db=function(){return this.c()},Zn.prototype.createUris=Zn.prototype.Db,Zn.prototype.Jb=function(){return this.b},Zn.prototype.getStartByte=Zn.prototype.Jb,Zn.prototype.Hb=function(){return this.a},Zn.prototype.getEndByte=Zn.prototype.Hb,I("shaka.media.SegmentReference",ti),ti.prototype.U=function(){return this.position},ti.prototype.getPosition=ti.prototype.U,ti.prototype.Kb=function(){return this.startTime},ti.prototype.getStartTime=ti.prototype.Kb,ti.prototype.pd=function(){return this.endTime},ti.prototype.getEndTime=ti.prototype.pd,ti.prototype.Db=function(){return this.c()},ti.prototype.createUris=ti.prototype.Db,ti.prototype.Jb=function(){return this.b},ti.prototype.getStartByte=ti.prototype.Jb,ti.prototype.Hb=function(){return this.a},ti.prototype.getEndByte=ti.prototype.Hb,I("shaka.util.DataViewReader",ei);var Mc=1;ei.Endianness={bf:0,cf:Mc},ei.prototype.ha=function(){return this.a<this.D.byteLength},ei.prototype.hasMoreData=ei.prototype.ha,ei.prototype.U=function(){return this.a},ei.prototype.getPosition=ei.prototype.U,ei.prototype.qd=function(){return this.D.byteLength},ei.prototype.getLength=ei.prototype.qd,ei.prototype.ca=function(){try{var t=this.D.getUint8(this.a);return this.a+=1,t}catch(t){ni()}},ei.prototype.readUint8=ei.prototype.ca,ei.prototype.bb=function(){try{var t=this.D.getUint16(this.a,this.b);return this.a+=2,t}catch(t){ni()}},ei.prototype.readUint16=ei.prototype.bb,ei.prototype.B=function(){try{var t=this.D.getUint32(this.a,this.b);return this.a+=4,t}catch(t){ni()}},ei.prototype.readUint32=ei.prototype.B,ei.prototype.Lc=function(){try{var t=this.D.getInt32(this.a,this.b);return this.a+=4,t}catch(t){ni()}},ei.prototype.readInt32=ei.prototype.Lc,ei.prototype.Ra=function(){try{if(this.b)var t=this.D.getUint32(this.a,!0),e=this.D.getUint32(this.a+4,!0);else e=this.D.getUint32(this.a,!1),t=this.D.getUint32(this.a+4,!1)}catch(t){ni()}if(2097151<e)throw new z(2,3,3001);return this.a+=8,e*Math.pow(2,32)+t},ei.prototype.readUint64=ei.prototype.Ra,ei.prototype.Da=function(t){this.a+t>this.D.byteLength&&ni();var e=new Uint8Array(this.D.buffer,this.D.byteOffset+this.a,t);return this.a+=t,new Uint8Array(e)},ei.prototype.readBytes=ei.prototype.Da,ei.prototype.F=function(t){this.a+t>this.D.byteLength&&ni(),this.a+=t},ei.prototype.skip=ei.prototype.F,ei.prototype.Oc=function(t){this.a<t&&ni(),this.a-=t},ei.prototype.rewind=ei.prototype.Oc,ei.prototype.seek=function(t){(0>t||t>this.D.byteLength)&&ni(),this.a=t},ei.prototype.seek=ei.prototype.seek,ei.prototype.Xb=function(){for(var t=this.a;this.ha()&&0!=this.D.getUint8(this.a);)this.a+=1;return t=new Uint8Array(this.D.buffer,this.D.byteOffset+t,this.a-t),this.a+=1,Mt(t)},ei.prototype.readTerminatedString=ei.prototype.Xb,I("shaka.util.Mp4Parser",ii),ii.prototype.C=function(t,e){var n=si(t);return this.c[n]=0,this.b[n]=e,this},ii.prototype.box=ii.prototype.C,ii.prototype.Z=function(t,e){var n=si(t);return this.c[n]=1,this.b[n]=e,this},ii.prototype.fullBox=ii.prototype.Z,ii.prototype.stop=function(){this.a=!0},ii.prototype.stop=ii.prototype.stop,ii.prototype.parse=function(t,e){var n=new Uint8Array(t);for(n=new ei(new DataView(n.buffer,n.byteOffset,n.byteLength),0),this.a=!1;n.ha()&&!this.a;)this.xb(0,n,e)},ii.prototype.parse=ii.prototype.parse,ii.prototype.xb=function(t,e,n){var i=e.U(),r=e.B(),a=e.B();switch(r){case 0:r=e.D.byteLength-i;break;case 1:r=e.Ra()}var o=this.b[a];if(o){var s=null,u=null;1==this.c[a]&&(u=e.B(),s=u>>>24,u&=16777215),a=i+r,n&&a>e.D.byteLength&&(a=e.D.byteLength),a-=e.U(),e=0<a?e.Da(a):new Uint8Array(0),e=new ei(new DataView(e.buffer,e.byteOffset,e.byteLength),0),o({parser:this,partialOkay:n||!1,version:s,flags:u,reader:e,size:r,start:i+t})}else e.F(Math.min(i+r-e.U(),e.D.byteLength-e.U()))},ii.prototype.parseNext=ii.prototype.xb,ii.children=ri,ii.sampleDescription=ai,ii.allData=oi,ii.typeToString=ui,I("shaka.media.SegmentIndex",li),li.prototype.destroy=function(){return this.a=null,Promise.resolve()},li.prototype.destroy=li.prototype.destroy,li.prototype.find=function(t){for(var e=this.a.length-1;0<=e;--e){var n=this.a[e];if(t>=n.startTime&&t<n.endTime)return n.position}return this.a.length&&t<this.a[0].startTime?this.a[0].position:null},li.prototype.find=li.prototype.find,li.prototype.get=function(t){return 0==this.a.length?null:(t-=this.a[0].position,0>t||t>=this.a.length?null:this.a[t])},li.prototype.get=li.prototype.get,li.prototype.offset=function(t){for(var e=0;e<this.a.length;++e)this.a[e].startTime+=t,this.a[e].endTime+=t},li.prototype.offset=li.prototype.offset,li.prototype.Pb=function(t){for(var e=[],n=0,i=0;n<this.a.length&&i<t.length;){var r=this.a[n],a=t[i];r.startTime<a.startTime?(e.push(r),n++):(r.startTime>a.startTime?0==n&&e.push(a):(.1<Math.abs(r.endTime-a.endTime)?e.push(new ti(r.position,a.startTime,a.endTime,a.c,a.b,a.a)):e.push(r),n++),i++)}for(;n<this.a.length;)e.push(this.a[n++]);if(e.length)for(n=e[e.length-1].position+1;i<t.length;)r=t[i++],r=new ti(n++,r.startTime,r.endTime,r.c,r.b,r.a),e.push(r);else e=t;this.a=e},li.prototype.merge=li.prototype.Pb,li.prototype.Fb=function(t){for(var e=0;e<this.a.length;++e)if(this.a[e].endTime>t)return void this.a.splice(0,e);this.a=[]},li.prototype.evict=li.prototype.Fb;var Lc;di.prototype.ha=function(){return this.a.ha()},gi.prototype.parse=function(t,e,n,i){var r;if(e=new di(new DataView(e)),440786851!=pi(e).id)throw new z(2,3,3008);var a=pi(e);if(408125543!=a.id)throw new z(2,3,3009);for(e=a.a.byteOffset,a=new di(a.a),r=null;a.ha();){var o=pi(a);if(357149030==o.id){r=o;break}}if(!r)throw new z(2,3,3010);for(a=new di(r.a),r=1e6,o=null;a.ha();){var s=pi(a);if(2807729==s.id)r=yi(s);else if(17545==s.id)if(o=s,4==o.a.byteLength)o=o.a.getFloat32(0);else{if(8!=o.a.byteLength)throw new z(2,3,3003);o=o.a.getFloat64(0)}}if(null==o)throw new z(2,3,3011);if(a=r/1e9,r=o*a,t=pi(new di(new DataView(t))),475249515!=t.id)throw new z(2,3,3007);return bi(t,e,a,r,n,i)};var Oc={},Uc={};I("shaka.media.ManifestParser.registerParserByExtension",function(t,e){Uc[t]=e}),I("shaka.media.ManifestParser.registerParserByMime",function(t,e){Oc[t]=e}),I("shaka.media.PresentationTimeline",Oi),Oi.prototype.T=function(){return this.b},Oi.prototype.getDuration=Oi.prototype.T,Oi.prototype.ka=function(t){this.b=t},Oi.prototype.setDuration=Oi.prototype.ka,Oi.prototype.vd=function(){return this.f},Oi.prototype.getPresentationStartTime=Oi.prototype.vd,Oi.prototype.Rc=function(t){this.j=t},Oi.prototype.setClockOffset=Oi.prototype.Rc,Oi.prototype.yb=function(t){this.i=t},Oi.prototype.setStatic=Oi.prototype.yb,Oi.prototype.dc=function(t){this.c=t},Oi.prototype.setSegmentAvailabilityDuration=Oi.prototype.dc,Oi.prototype.Sc=function(t){this.l=t},Oi.prototype.setDelay=Oi.prototype.Sc,Oi.prototype.Na=function(t,e){0!=t.length&&(e&&(this.h=Math.max(this.h,t[0].startTime)),this.a=t.reduce(function(t,e){return Math.max(t,e.endTime-e.startTime)},this.a))},Oi.prototype.notifySegments=Oi.prototype.Na,Oi.prototype.Rb=function(t){this.a=Math.max(this.a,t)},Oi.prototype.notifyMaxSegmentDuration=Oi.prototype.Rb,Oi.prototype.P=function(){return 1/0==this.b&&!this.i},Oi.prototype.isLive=Oi.prototype.P,Oi.prototype.Aa=function(){return 1/0!=this.b&&!this.i},Oi.prototype.isInProgress=Oi.prototype.Aa,Oi.prototype.Xa=function(){if(1/0==this.c)return this.g;var t=this.Ka()-this.c;return Math.max(this.g,t)},Oi.prototype.getSegmentAvailabilityStart=Oi.prototype.Xa,Oi.prototype.Tc=function(t){this.g=t},Oi.prototype.setUserSeekStart=Oi.prototype.Tc,Oi.prototype.Ka=function(){return this.P()||this.Aa()?Math.min(Math.max(0,(Date.now()+this.j)/1e3-this.a-this.f),this.b):this.b},Oi.prototype.getSegmentAvailabilityEnd=Oi.prototype.Ka,Oi.prototype.Wa=function(t){var e=Math.max(this.h,this.g);if(1/0==this.c)return e;var n=this.Ka()-this.c;return t=Math.min(n+t,this.ma()),Math.max(e,t)},Oi.prototype.getSafeSeekRangeStart=Oi.prototype.Wa,Oi.prototype.Ja=function(){return this.Wa(0)},Oi.prototype.getSeekRangeStart=Oi.prototype.Ja,Oi.prototype.ma=function(){var t=this.P()||this.Aa()?this.l:0;return Math.max(0,this.Ka()-t)},Oi.prototype.getSeekRangeEnd=Oi.prototype.ma,I("shaka.dash.DashParser",Ui),Uu=Ui.prototype,Uu.configure=function(t){this.b=t},Uu.start=function(t,e){return this.h=[t],this.a=e,ji(this).then(function(t){return this.a&&Gi(this,t),this.c}.bind(this))},Uu.stop=function(){return this.b=this.a=null,this.h=[],this.c=null,this.j=[],this.l={},null!=this.g&&(t.clearTimeout(this.g),this.g=null),this.f.destroy()},Uu.update=function(){ji(this).catch(function(t){this.a&&this.a.onError(t)}.bind(this))},Uu.onExpirationUpdated=function(){},Uu.ge=function(t,e){t.W=Xi(e,t.ba,null);var n=!1,i=Rn(e,"Role"),r=i.map(function(t){return t.getAttribute("value")}).filter(Pt),a=void 0,o="text"==t.W.contentType;o&&(a="subtitle");for(var s=0;s<i.length;s++){var u=i[s].getAttribute("schemeIdUri");if(null==u||"urn:mpeg:dash:role:2011"==u)switch(u=i[s].getAttribute("value")){case"main":n=!0;break;case"caption":case"subtitle":a=u}}var c=null,h=!1;if(Rn(e,"EssentialProperty").forEach(function(t){"http://dashif.org/guidelines/trickmode"==t.getAttribute("schemeIdUri")?c=t.getAttribute("value"):h=!0}),h)return null;i=Rn(e,"ContentProtection");var l=Kn(i,this.b.dash.customScheme,this.b.dash.ignoreDrmInfo);if(i=Be(e.getAttribute("lang")||"und"),u=e.getAttribute("label"),s=Rn(e,"Representation"),r=s.map(this.je.bind(this,t,l,a,i,u,n,r)).filter(function(t){return!!t}),0==r.length){if(o)return null;throw new z(2,4,4003)}return t.W.contentType&&"application"!=t.W.contentType||(t.W.contentType=Ji(r[0].mimeType,r[0].codecs),r.forEach(function(e){e.type=t.W.contentType})),r.forEach(function(t){l.drmInfos.forEach(function(e){t.keyId&&e.keyIds.push(t.keyId)})}),o=s.map(function(t){return t.getAttribute("id")}).filter(Pt),{id:t.W.id||"__fake__"+this.i++,contentType:t.W.contentType,language:i,Nb:n,streams:r,drmInfos:l.drmInfos,hc:c,te:o}},Uu.je=function(t,e,n,i,r,a,o,s){if(t.v=Xi(s,t.W,null),!zi(t.v))return null;t.bandwidth=Mn(s,"bandwidth",Bn)||0;var u=t.v.contentType;u="text"==u||"application"==u;try{var c=this.ue.bind(this);if(t.v.cb)var h=Ei(t,c);else if(t.v.ta)h=Ai(t,this.l);else if(t.v.fb)h=Pi(t,c,this.l,!!this.c);else{var l=t.v.ea,f=t.M.duration||0;h={createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(t){return 0<=t&&t<f?1:null},getSegmentReference:function(t){return 1!=t?null:new ti(1,0,f,function(){return l},0,null)},initSegmentReference:null,da:0}}}catch(t){if(u&&4002==t.code)return null;throw t}return s=Rn(s,"ContentProtection"),s=Hn(s,this.b.dash.customScheme,e,this.b.dash.ignoreDrmInfo),{id:this.i++,createSegmentIndex:h.createSegmentIndex,findSegmentPosition:h.findSegmentPosition,getSegmentReference:h.getSegmentReference,initSegmentReference:h.initSegmentReference,presentationTimeOffset:h.da,mimeType:t.v.mimeType,codecs:t.v.codecs,frameRate:t.v.frameRate,bandwidth:t.bandwidth,width:t.v.width,height:t.v.height,kind:n,encrypted:0<e.drmInfos.length,keyId:s,language:i,label:r,type:t.W.contentType,primary:a,trickModeVideo:null,containsEmsgBoxes:t.v.containsEmsgBoxes,roles:o,channelsCount:t.v.Sb}},Uu.Pe=function(){this.g=null,ji(this).then(function(t){this.a&&Gi(this,t)}.bind(this)).catch(function(t){this.a&&(t.severity=1,this.a.onError(t),Gi(this,0))}.bind(this))},Uu.ie=function(t,e,n){var i=n.getAttribute("schemeIdUri")||"",r=n.getAttribute("value")||"",a=Mn(n,"timescale",Fn)||1;Rn(n,"Event").forEach(function(n){var o=Mn(n,"presentationTime",Fn)||0,s=Mn(n,"duration",Fn)||0;o=o/a+t,s=o+s/a,null!=e&&(o=Math.min(o,t+e),s=Math.min(s,t+e)),n={schemeIdUri:i,value:r,startTime:o,endTime:s,id:n.getAttribute("id")||"",eventElement:n},this.a.onTimelineRegionAdded(n)}.bind(this))},Uu.ue=function(t,e,n){return t=pt(t,this.b.retryParameters),null!=e&&(t.headers.Range="bytes="+e+"-"+(null!=n?n:"")),e=this.a.networkingEngine.request(1,t),lt(this.f,e),e.promise.then(function(t){return t.data})},Uc.mpd=Ui,Oc["application/dash+xml"]=Ui,Zi.prototype.toString=function(){function t(t){return t.name+'="'+t.value+'"'}return this.value?"#"+this.name+":"+this.value:0<this.a.length?"#"+this.name+":"+this.a.map(t).join(","):"#"+this.name},Zi.prototype.getAttribute=function(t){var e=this.a.filter(function(e){return e.name==t});return e.length?e[0]:null};var jc="EXT-X-TARGETDURATION EXT-X-MEDIA-SEQUENCE EXT-X-DISCONTINUITY-SEQUENCE EXT-X-PLAYLIST-TYPE EXT-X-MAP EXT-X-I-FRAMES-ONLY EXT-X-ENDLIST".split(" "),Bc="EXTINF EXT-X-BYTERANGE EXT-X-DISCONTINUITY EXT-X-PROGRAM-DATE-TIME EXT-X-KEY EXT-X-DATERANGE".split(" ");I("shaka.net.DataUriPlugin",mr),mr.parse=function(e){var n=e.split(":");if(2>n.length||"data"!=n[0])throw new z(2,1,1004,e);if(n=n.slice(1).join(":").split(","),2>n.length)throw new z(2,1,1004,e);var i=n[0];n=t.decodeURIComponent(n.slice(1).join(",")),i=i.split(";");var r=null;if(1<i.length&&(r=i[1]),"base64"==r)e=Ht(n).buffer;else{if(r)throw new z(2,1,1005,e);e=Ut(n)}return{data:e,contentType:i[0]}},dt("data",mr),I("shaka.hls.HlsParser",vr),Uu=vr.prototype,Uu.configure=function(t){this.g=t},Uu.start=function(t,e){return this.c=e,this.m=t,Vr(this,t).then(function(e){return gr(this,e.data,t).then(function(){return Kr(this,this.i),this.o}.bind(this))}.bind(this))},Uu.stop=function(){return this.g=this.c=null,this.u={},this.I={},this.o=null,this.h.destroy()},Uu.update=function(){if(this.f!=qc.ra){var t,e=[];for(t in this.a)e.push(yr(this,this.a[t],t));return Promise.all(e)}},Uu.onExpirationUpdated=function(){};var Fc={audio:[/^vorbis$/,/^opus$/,/^flac$/,/^mp4a/,/^[ae]c-3$/],video:[/^avc/,/^hev/,/^hvc/,/^vp0?[89]/,/^av1$/],text:[/^vtt$/,/^wvtt/,/^stpp/]},Vc={audio:{mp4:"audio/mp4",m4s:"audio/mp4",m4i:"audio/mp4",m4a:"audio/mp4",ts:"video/mp2t"},video:{mp4:"video/mp4",m4s:"video/mp4",m4i:"video/mp4",m4v:"video/mp4",ts:"video/mp2t"},text:{mp4:"application/mp4",m4s:"application/mp4",m4i:"application/mp4",vtt:"text/vtt",ttml:"application/ttml+xml"}};vr.prototype.S=function(){this.c&&(this.j=null,this.update().then(function(){Kr(this,this.i)}.bind(this)).catch(function(t){this.c&&(t.severity=1,this.c.onError(t),Kr(this,0))}.bind(this)))};var Kc={"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":function(t){var e=Br(t,"METHOD");return"SAMPLE-AES-CENC"!=e&&"SAMPLE-AES-CTR"!=e?null:(e=Br(t,"URI"),e=mr.parse(e),e=new Uint8Array(e.data),e=Dt("com.widevine.alpha",[{initDataType:"cenc",initData:e}]),(t=er(t,"KEYID"))&&(e.keyIds=[t.substr(2).toLowerCase()]),e)}},Hc="VOD",qc={ra:Hc,Zc:"EVENT",jc:"LIVE"};Uc.m3u8=vr,Oc["application/x-mpegurl"]=vr,Oc["application/vnd.apple.mpegurl"]=vr,qr.prototype.destroy=function(){var t=this.h.destroy();return this.u=this.s=this.a=this.h=null,null!=this.b&&(this.b.cancel(),this.b=null),t},qr.prototype.ab=function(){this.f=!0,this.l()},qr.prototype.l=function(){if(0!=this.a.readyState){if(this.a.seeking){if(!this.g)return}else this.g=!1;if(!this.a.paused){this.a.readyState!=this.m&&(this.c=!1,this.m=this.a.readyState);var t=this.o.smallGapLimit,e=this.a.currentTime,n=this.a.buffered;t:{if(n&&n.length&&!(1==n.length&&1e-6>n.end(0)-n.start(0))){var i=.1;/(Edge\/|Trident\/|Tizen)/.test(navigator.userAgent)&&(i=.5);for(var r=0;r<n.length;r++)if(n.start(r)>e&&(0==r||n.end(r-1)-e<=i)){i=r;break t}}i=null}if(null==i){if(n=this.a.currentTime,e=this.a.buffered,!this.a.paused&&0<this.a.playbackRate)if(this.j!=n)this.j=n,this.A=Date.now(),this.i=!1;else if(!this.i&&this.A<Date.now()-1e3)for(i=0;i<e.length;i++)if(n>=e.start(i)&&n<e.end(i)-.5){this.a.currentTime+=.1,this.j=this.a.currentTime,this.i=!0;break}}else if(0!=i||this.f){r=n.start(i);var a=this.s.presentationTimeline.ma();if(!(r>=a)){a=r-e,t=a<=t;var o=!1;.001>a||(t||this.c||(this.c=!0,e=new At("largegap",{currentTime:e,gapSize:a}),e.cancelable=!0,this.u(e),this.o.jumpLargeGaps&&!e.defaultPrevented&&(o=!0)),!t&&!o)||(0!=i&&n.end(i-1),this.a.currentTime=r)}}}}},Uu=Gr.prototype,Uu.destroy=function(){var t=this.c.destroy();return this.c=null,null!=this.b&&(this.b.cancel(),this.b=null),this.i=this.a=null,t},Uu.Va=function(){return this.f},Uu.Vd=function(){var t=this.g||0>this.f?0:this.f;this.a.playbackRate&&this.a.playbackRate!=t&&zr(this,this.a.playbackRate)},Uu.Fc=function(){.001>Math.abs(this.a.currentTime-this.h)?this.Gc():(Et(this.c,this.a,"seeking",this.Gc.bind(this)),this.a.currentTime=0==this.a.currentTime?this.h:this.a.currentTime)},Uu.Gc=function(){var t=this;Tt(this.c,this.a,"seeking",function(){return t.i()})},Uu=$r.prototype,Uu.destroy=function(){var t=Promise.all([this.a.destroy(),this.g.destroy()]);return this.g=this.a=null,null!=this.f&&(this.f.cancel(),this.f=null),this.j=this.h=this.b=this.c=null,t},Uu.Va=function(){return this.a.Va()},Uu.ab=function(){this.g.ab()},Uu.Ud=function(){if(0!=this.c.readyState&&!this.c.paused){var t=this.c.currentTime,e=this.b.presentationTimeline,n=e.Ja();e=e.ma(),3>e-n&&(n=e-3),t<n&&(t=Zr(this,t),this.c.currentTime=t)}},Uu.Xd=function(){var t=this.g;t.g=!0,t.f=!1,t.c=!1;var e=Xr(this.a);if(t=Zr(this,e),.001<Math.abs(t-e)&&(e=(new Date).getTime()/1e3,!this.i||this.i<e-1))return this.i=e,void Yr(this.a,t);this.j()},ea.prototype.destroy=function(){var t=this.j?this.j.destroy():Promise.resolve();return this.j=null,ra(this),this.A=this.h=this.l=this.s=this.g=this.u=this.a=null,this.c=[],t},ea.prototype.o=function(t){if(!this.c.some(function(e){return e.info.schemeIdUri==t.schemeIdUri&&e.info.startTime==t.startTime&&e.info.endTime==t.endTime})){var e={info:t,status:1};this.c.push(e);var n=new At("timelineregionadded",{detail:na(t)});this.h(n),this.m(!0,e)}},ea.prototype.m=function(t,e){var n=e.info.startTime>this.a.currentTime?1:e.info.endTime<this.a.currentTime?3:2,i=2==e.status,r=2==n;n!=e.status&&((!t||i||r)&&(i||this.h(new At("timelineregionenter",{detail:na(e.info)})),r||this.h(new At("timelineregionexit",{detail:na(e.info)}))),e.status=n)},ea.prototype.G=function(){this.f=null,ia(this);var t=sn(this.g,this.a.currentTime);t!=this.i&&(-1!=this.i&&this.A(),this.i=t),t=me(this.a.buffered,this.a.currentTime);var e=de(this.a.buffered),n=this.g.presentationTimeline,i=n.Ka();e=n.P()&&e>=i,n=this.u,n=!n.g||"ended"==n.g.readyState,e=e||this.a.ended||n,this.b?(n=Math.max(this.g.minBufferTime||0,this.s.rebufferingGoal),(e||t>=n)&&0!=this.b&&(this.b=!1,this.l(!1))):!e&&.5>t&&1!=this.b&&(this.b=!0,this.l(!0)),this.c.forEach(this.m.bind(this,!1))},Uu=aa.prototype,Uu.destroy=function(){for(var t in this.c)Ua(this.c[t]);return this.g=this.c=this.i=this.h=this.m=this.b=this.a=null,this.f=!0,Promise.resolve()},Uu.configure=function(t){this.g=t,this.A=new G({maxAttempts:Math.max(t.retryParameters.maxAttempts,2),baseDelay:t.retryParameters.baseDelay,backoffFactor:t.retryParameters.backoffFactor,fuzzFactor:t.retryParameters.fuzzFactor,timeout:0},!0)},Uu.init=function(){var t=Jr(this.a.Pa);return t=this.a.Ac(this.b.periods[sn(this.b,t)]),t.variant||t.text?ga(this,t).then(function(){!this.f&&this.a&&this.a.Ld&&this.a.Ld()}.bind(this)):Promise.reject(new z(2,5,5005))},Uu.Re=function(t){if(!this.f&&!t.Ca&&null!=t.ua&&!t.ya)if(t.ua=null,t.va)La(this,t,t.zb);else{try{var e=Ea(this,t);null!=e&&(Oa(this,t,e),t.Ya=!1)}catch(t){return void ja(this,t)}e=$u.values(this.c),Da(this,t),e.every(function(t){return t.endOfStream})&&this.a.J.endOfStream().then(function(){if(!this.f){var t=this.a.J.T();t<this.b.presentationTimeline.T()&&this.b.presentationTimeline.ka(t)}}.bind(this))}},Uu.he=function(t,e,n){var i=n.reader.Xb(),r=n.reader.Xb(),a=n.reader.B(),o=n.reader.B(),s=n.reader.B(),u=n.reader.B();n=n.reader.Da(n.reader.D.byteLength-n.reader.U()),t=t.startTime+e.startTime+o/a,"urn:mpeg:dash:event:2012"==i?this.a.Nd():this.a.onEvent(new At("emsg",{detail:{startTime:t,endTime:t+s/a,schemeIdUri:i,value:r,timescale:a,presentationTimeDelta:o,eventDuration:s,id:u,messageData:n}}))},I("shaka.net.HttpFetchPlugin",Fa),Fa.f=function(t,e,n,i,r){return c(function a(){var o,s,u,c,h,l;return A(a,function(a){switch(a.w){case 1:return o=Fa.c,p(a,2,3),d(a,o(t,n),5);case 5:return s=a.K,d(a,s.arrayBuffer(),6);case 6:u=a.K;case 3:g(a),clearTimeout(r),b(a,4);break;case 2:if(c=y(a),i.mc)throw new z(1,1,7001,t,e);if(i.Xc)throw new z(1,1,1003,t,e);throw new z(1,1,1002,t,c,e);case 4:return h={},l=s.headers,l.forEach(function(t,e){h[e.trim()]=t}),a.return(Ba(h,u,s.status,t,s.url,e))}})})},Fa.isSupported=function(){return!(!t.fetch||!t.AbortController)},Fa.isSupported=Fa.isSupported,Fa.c=t.fetch,Fa.a=t.AbortController,Fa.b=t.Headers,Fa.isSupported()&&(dt("http",Fa,2),dt("https",Fa,2)),I("shaka.net.HttpXHRPlugin",Va),Va.g=t.XMLHttpRequest,dt("http",Va,1),dt("https",Va,1),Ka.prototype.destroy=function(){this.h=!0;var t=this.c.catch(function(){});return this.c=Promise.resolve(),t},za.prototype.abort=function(){try{this.c.abort()}catch(t){}return this.a.catch(function(){})},za.prototype.store=function(){return this.b},za.prototype.promise=function(){return this.a},Wa.prototype.destroy=function(){return Promise.all(this.a.map(function(t){return t.abort()}))},Qa.prototype.destroy=function(){var t=$u.values(this.a).map(function(t){return t.destroy()});return this.a={},Promise.all(t)},Qa.prototype.init=function(){var t=this;$u.forEach(Gc,function(e,n){var i=n();i&&(t.a[e]=i)});var e=$u.values(this.a).map(function(t){return t.init()});return Promise.all(e)},I("shaka.offline.StorageMuxer.register",function(t,e){Gc[t]=e}),I("shaka.offline.StorageMuxer.unregister",function(t){delete Gc[t]});var Gc={};Uu=ro.prototype,Uu.destroy=function(){return this.a.destroy()},Uu.hasFixedKeySpace=function(){return!0},Uu.addSegments=function(){return ao("segment")},Uu.removeSegments=function(t,e){return oo(this,"segment",t,e)},Uu.getSegments=function(t){return so(this,"segment",t).then(function(t){return t.map(fo)})},Uu.addManifests=function(){return ao("manifest")},Uu.updateManifestExpiration=function(t,e){var n=$a(this.a,"manifest"),i=n.store(),r=new q;return i.get(t).onsuccess=function(n){(n=n.target.result)?(n.expiration=e,i.put(n),r.resolve()):r.reject(new z(2,9,9012,"Could not find values for "+t))},n.promise().then(function(){return r})},Uu.removeManifests=function(t,e){return oo(this,"manifest",t,e)},Uu.getManifests=function(t){return so(this,"manifest",t).then(function(t){return t.map(uo)})},Uu.getAllManifests=function(){var t=Ja(this.a,"manifest","readonly"),e={};return t.store().openCursor().onsuccess=function(t){(t=t.target.result)&&(e[t.key]=uo(t.value),t.continue())},t.promise().then(function(){return e})},Uu=vo.prototype,Uu.destroy=function(){return this.a.destroy()},Uu.hasFixedKeySpace=function(){return this.f},Uu.addSegments=function(t){return yo(this,this.c,t)},Uu.removeSegments=function(t,e){return go(this,this.c,t,e)},Uu.getSegments=function(t){return bo(this,this.c,t)},Uu.addManifests=function(t){return yo(this,this.b,t)},Uu.updateManifestExpiration=function(t,e){var n=$a(this.a,this.b),i=n.store();return i.get(t).onsuccess=function(n){(n=n.target.result)&&(n.expiration=e,i.put(n,t))},n.promise()},Uu.removeManifests=function(t,e){return go(this,this.b,t,e)},Uu.getManifests=function(t){return bo(this,this.b,t)},Uu.getAllManifests=function(){var t=Ja(this.a,this.b,"readonly"),e={};return t.store().openCursor().onsuccess=function(t){(t=t.target.result)&&(e[t.key]=t.value,t.continue())},t.promise().then(function(){return e})},wo.prototype.init=function(){var e=this,n=new q,i=t.indexedDB.open("shaka_offline_db",3);return i.onsuccess=function(t){t=t.target.result,e.f=t;var i=t.objectStoreNames;i=i.contains("manifest")&&i.contains("segment")?new ro(t):null,e.a=i,i=t.objectStoreNames,i=i.contains("manifest-v2")&&i.contains("segment-v2")?new vo(t,"segment-v2","manifest-v2",!0):null,e.b=i,i=t.objectStoreNames,t=i.contains("manifest-v3")&&i.contains("segment-v3")?new vo(t,"segment-v3","manifest-v3",!1):null,e.c=t,n.resolve()},i.onupgradeneeded=function(t){t=t.target.result;var e={autoIncrement:!0};t.createObjectStore("manifest-v3",e),t.createObjectStore("segment-v3",e)},i.onerror=function(t){n.reject(new z(2,9,9001,i.error)),t.preventDefault()},n},wo.prototype.destroy=function(){var t=this;return c(function e(){return A(e,function(e){switch(e.w){case 1:if(!t.a){e.V(2);break}return d(e,t.a.destroy(),2);case 2:if(!t.b){e.V(4);break}return d(e,t.b.destroy(),4);case 4:if(!t.c){e.V(6);break}return d(e,t.c.destroy(),6);case 6:t.f&&t.f.close(),e.w=0}})})},wo.prototype.getCells=function(){var t={};return this.a&&(t.v1=this.a),this.b&&(t.v2=this.b),this.c&&(t.v3=this.c),t},wo.prototype.erase=function(){var t=this;return c(function e(){return A(e,function(e){switch(e.w){case 1:if(!t.a){e.V(2);break}return d(e,t.a.destroy(),2);case 2:if(!t.b){e.V(4);break}return d(e,t.b.destroy(),4);case 4:if(!t.c){e.V(6);break}return d(e,t.c.destroy(),6);case 6:return t.f&&t.f.close(),d(e,To(),8);case 8:return t.f=null,t.a=null,t.b=null,t.c=null,d(e,t.init(),0)}})})},Gc.idb=function(){return t.indexedDB?new wo:null},Eo.prototype.fa=function(){return this.g},Eo.prototype.N=function(){return this.f},Eo.prototype.key=function(){return this.c},Eo.prototype.toString=function(){return this.b},Uu=No.prototype,Uu.configure=function(){},Uu.start=function(t){var e=So(t);if(this.a=e,null==e||"manifest"!=e.a)return Promise.reject(new z(2,1,9004,e));var n=new Qa;return ct([n],function(){return c(function t(){var i,r,a,o;return A(t,function(t){switch(t.w){case 1:return d(t,n.init(),2);case 2:return d(t,eo(n,e.fa(),e.N()),3);case 3:return i=t.K,d(t,i.getManifests([e.key()]),4);case 4:return r=t.K,a=r[0],o=new ko(e.fa(),e.N()),t.return(Ao(o,a))}})})})},Uu.stop=function(){return Promise.resolve()},Uu.update=function(){},Uu.onExpirationUpdated=function(t,e){var n=this.a,i=new Qa;return ct([i],function(){return c(function r(){var a,o,s,u,c;return A(r,function(r){switch(r.w){case 1:return d(r,i.init(),2);case 2:return d(r,eo(i,n.fa(),n.N()),3);case 3:return a=r.K,d(r,a.getManifests([n.key()]),4);case 4:if(o=r.K,s=o[0],u=0<=s.sessionIds.indexOf(t),c=void 0==s.expiration||s.expiration>e,u&&c)return d(r,a.updateManifestExpiration(n.key(),e),0);r.V(0)}})})}).catch(function(){})},Oc["application/x-offline-manifest"]=No,I("shaka.offline.OfflineScheme",Do),Do.a=function(t){return t={uri:t,data:new ArrayBuffer(0),headers:{"content-type":"application/x-offline-manifest"}},Q(t)},Do.b=function(t,e){var n=new Qa;return Z(ct([n],function(){return c(function t(){var i,r,a;return A(t,function(t){switch(t.w){case 1:return d(t,n.init(),2);case 2:return d(t,eo(n,e.fa(),e.N()),3);case 3:return i=t.K,d(t,i.getSegments([e.key()]),4);case 4:return r=t.K,a=r[0],t.return({uri:e,data:a.data,headers:{}})}})})}))},dt("offline",Do),I("shaka.text.SimpleTextDisplayer",Co),Co.prototype.remove=function(t,e){return!!this.a&&(Lo(this.a,function(n){return!(n.startTime>=e||n.endTime<=t)}),!0)},Co.prototype.remove=Co.prototype.remove,Co.prototype.append=function(t){for(var e=Mo,n=[],i=0;i<t.length;i++){var r=e(t[i]);r&&n.push(r)}n.slice().sort(function(t,e){return t.startTime!=e.startTime?t.startTime-e.startTime:t.endTime!=e.endTime?t.endTime-e.startTime:n.indexOf(e)-n.indexOf(t)}).forEach(function(t){this.a.addCue(t)}.bind(this))},Co.prototype.append=Co.prototype.append,Co.prototype.destroy=function(){return this.a&&Lo(this.a,function(){return!0}),this.a=null,Promise.resolve()},Co.prototype.destroy=Co.prototype.destroy,Co.prototype.isTextVisible=function(){return"showing"==this.a.mode},Co.prototype.isTextVisible=Co.prototype.isTextVisible,Co.prototype.setTextVisibility=function(t){this.a.mode=t?"showing":"hidden"},Co.prototype.setTextVisibility=Co.prototype.setTextVisibility,x(Oo,gn),I("shaka.Player",Oo),Oo.prototype.destroy=function(){var t=this;return c(function e(){var n;return A(e,function(e){switch(e.w){case 1:return d(e,t.detach(),2);case 2:return t.wa=!0,n=Promise.all([t.o?t.o.destroy():null,t.s?t.s.destroy():null]),t.pb=!1,t.o=null,t.h=null,t.Ab=null,t.s=null,t.c=null,d(e,n,0)}})})},Oo.prototype.destroy=Oo.prototype.destroy,Oo.version="v2.4.5";var Xc={};Oo.registerSupportPlugin=function(t,e){Xc[t]=e},Oo.isBrowserSupported=function(){return!!(t.Promise&&t.Uint8Array&&Array.prototype.forEach&&t.MediaSource&&MediaSource.isTypeSupported&&t.MediaKeys&&t.navigator&&t.navigator.requestMediaKeySystemAccess&&t.MediaKeySystemAccess&&t.MediaKeySystemAccess.prototype.getConfiguration)},Oo.probeSupport=function(){return he().then(function(t){t={manifest:Mi(),media:_e(),drm:t};for(var e in Xc)t[e]=Xc[e]();return t})},Oo.prototype.rb=function(t,e){var n=this;return c(function i(){return A(i,function(i){switch(i.w){case 1:if(void 0===e&&(e=!0),!n.f){i.V(2);break}return d(i,n.detach(),2);case 2:if(n.f=t,Tt(n.o,n.f,"error",n.be.bind(n)),e)return n.j=new Ae(n.f),d(i,n.j.j,0);i.V(0)}})})},Oo.prototype.attach=Oo.prototype.rb,Oo.prototype.detach=function(){var t=this;return c(function e(){return A(e,function(e){switch(e.w){case 1:return t.f?d(e,t.hb(!1),2):e.return();case 2:t.o.pa(t.f,"error"),t.f=null,e.w=0}})})},Oo.prototype.detach=Oo.prototype.detach,Oo.prototype.load=function(t,e,n){var i=this;return c(function r(){var a,o,s,u,c,h,l,f,m,g,b;return A(r,function(r){switch(r.w){case 1:if(!i.f)throw new z(2,7,7002);return o=new q,s=function(){return a=new z(2,7,7e3),o},i.dispatchEvent(new At("loading")),u=Date.now(),p(r,2),c=i.hb(),i.Ha=s,d(r,c,4);case 4:if(i.l=$o(),Tt(i.o,i.f,"playing",i.ib.bind(i)),Tt(i.o,i.f,"pause",i.ib.bind(i)),Tt(i.o,i.f,"ended",i.ib.bind(i)),h=i.c.abrFactory,i.h&&i.Ab==h||(i.Ab=h,i.h=new h,i.h.configure(i.c.abr)),i.u=new i.c.textDisplayFactory,i.u.setTextVisibility(i.pb),a)throw a;return l=i,d(r,jo(i,t,n),5);case 5:if(l.b=r.K,i.Cb=t,a)throw a;return Bo(i),i.i=new zt({$a:i.s,onError:i.Ta.bind(i),Ub:i.Md.bind(i),onExpirationUpdated:i.Jd.bind(i),onEvent:i.gb.bind(i)}),i.i.configure(i.c.drm),d(r,i.i.init(i.b,!1),6);case 6:if(a)throw a;return i.ec(i.b.periods),i.kb=Date.now()/1e3,i.L=i.c.preferredAudioLanguage,i.ga=i.c.preferredTextLanguage,i.Y=i.c.preferredAudioChannelCount,Fo(i),d(r,i.i.rb(i.f),7);case 7:if(a)throw a;return i.h.init(i.Ke.bind(i)),i.j||(i.j=new Ae(i.f)),i.j.o=i.u,i.g=new $r(i.f,i.b,i.c.streaming,void 0==e?null:e,i.Ie.bind(i),i.gb.bind(i)),i.A=new ea(i.f,i.j,i.b,i.c.streaming,i.Uc.bind(i),i.gb.bind(i),i.He.bind(i)),i.a=new aa(i.b,{Pa:i.g,J:i.j,$a:i.s,Ac:i.Hd.bind(i),zc:i.fd.bind(i),onError:i.Ta.bind(i),onEvent:i.gb.bind(i),Nd:i.Od.bind(i),ab:i.Yd.bind(i),filterNewPeriod:i.tb.bind(i),filterAllPeriods:i.ec.bind(i)}),i.a.configure(i.c.streaming),Vo(i),i.dispatchEvent(new At("streaming")),d(r,i.a.init(),8);case 8:if(a)throw a;if(i.c.streaming.startAtSegmentBoundary&&(f=Zo(i,Jr(i.g)),Yr(i.g.a,f)),i.b.periods.forEach(i.tb.bind(i)),is(i),ns(i),m=oa(i.a),g=Qe(m.variants,i.L,i.Ga,i.Y),i.h.setVariants(g),m.variants.some(function(t){return t.primary}),i.nb.forEach(i.A.o.bind(i.A)),i.nb=[],Et(i.o,i.f,"loadeddata",function(){this.l.loadLatency=(Date.now()-u)/1e3}.bind(i)),a)throw a;i.Ha=null,v(r);break;case 2:return b=y(r),o.resolve(),i.Ha==s&&(i.Ha=null,i.dispatchEvent(new At("unloading"))),a?r.return(Promise.reject(a)):r.return(Promise.reject(b))}})})},Oo.prototype.load=Oo.prototype.load,Oo.prototype.configure=function(t,e){if(2==arguments.length&&"string"==typeof t){for(var n=t,i={},r=i,a=0,o=0;!(0>(a=n.indexOf(".",a)));)0!=a&&"\\"==n[a-1]||(o=n.substring(o,a).replace(/\\\./g,"."),r[o]={},r=r[o],o=a+1),a+=1;r[n.substring(o).replace(/\\\./g,".")]=e,t=i}return n=st(this.c,t,Wo(this),zo(),""),Ko(this),n},Oo.prototype.configure=Oo.prototype.configure,Oo.prototype.getConfiguration=function(){var t=Wo(this);return st(t,this.c,Wo(this),zo(),""),t},Oo.prototype.getConfiguration=Oo.prototype.getConfiguration,Oo.prototype.ve=function(){this.c=Wo(this),Ko(this)},Oo.prototype.resetConfiguration=Oo.prototype.ve,Oo.prototype.sd=function(){return this.f},Oo.prototype.getMediaElement=Oo.prototype.sd,Oo.prototype.uc=function(){return this.s},Oo.prototype.getNetworkingEngine=Oo.prototype.uc,Oo.prototype.Ib=function(){return this.Cb},Oo.prototype.getManifestUri=Oo.prototype.Ib,Oo.prototype.P=function(){return!!this.b&&this.b.presentationTimeline.P()},Oo.prototype.isLive=Oo.prototype.P,Oo.prototype.Aa=function(){return!!this.b&&this.b.presentationTimeline.Aa()},Oo.prototype.isInProgress=Oo.prototype.Aa,Oo.prototype.Dd=function(){if(!this.b||!this.b.periods.length)return!1;var t=this.b.periods[0].variants;return!!t.length&&!t[0].video},Oo.prototype.isAudioOnly=Oo.prototype.Dd,Oo.prototype.xe=function(){var t=0,e=0;return this.b&&(e=this.b.presentationTimeline,t=e.Ja(),e=e.ma()),{start:t,end:e}},Oo.prototype.seekRange=Oo.prototype.xe,Oo.prototype.keySystem=function(){return this.i?this.i.keySystem():""},Oo.prototype.keySystem=Oo.prototype.keySystem,Oo.prototype.drmInfo=function(){return this.i?this.i.b:null},Oo.prototype.drmInfo=Oo.prototype.drmInfo,Oo.prototype.vb=function(){return this.i?this.i.vb():1/0},Oo.prototype.getExpiration=Oo.prototype.vb,Oo.prototype.xc=function(){return this.ob},Oo.prototype.isBuffering=Oo.prototype.xc,Oo.prototype.hb=function(t){var e=this;return c(function n(){return A(n,function(n){switch(n.w){case 1:return e.wa?n.return():(void 0===t&&(t=!0),e.dispatchEvent(new At("unloading")),d(n,Uo(e),2));case 2:return e.qb||(e.qb=Yo(e).then(function(){e.Uc(!1),e.qb=null})),d(n,e.qb,3);case 3:if(t)return e.j=new Ae(e.f),d(n,e.j.j,0);n.V(0)}})})},Oo.prototype.unload=Oo.prototype.hb,Oo.prototype.Va=function(){return this.g?this.g.Va():0},Oo.prototype.getPlaybackRate=Oo.prototype.Va,Oo.prototype.Te=function(t){this.g&&zr(this.g.a,t),this.a&&da(this.a,1!=t)},Oo.prototype.trickPlay=Oo.prototype.Te,Oo.prototype.gd=function(){this.g&&zr(this.g.a,1),this.a&&da(this.a,!1)},Oo.prototype.cancelTrickPlay=Oo.prototype.gd,Oo.prototype.Ad=function(){if(!this.b||!this.g)return[];var t=sn(this.b,Jr(this.g)),e=this.I[t]||{};return Ye(this.b.periods[t],e.audio,e.video)},Oo.prototype.getVariantTracks=Oo.prototype.Ad,Oo.prototype.zd=function(){if(!this.b||!this.g)return[];var t=sn(this.b,Jr(this.g)),e=this.I[t]||{};if(!e.text){var n=en(this.b.periods[t].textStreams,this.ga,this.Ua);n.length&&(e.text=n[0].id)}return ze(this.b.periods[t],e.text).filter(function(t){return 0>this.lb.indexOf(t.id)}.bind(this))},Oo.prototype.getTextTracks=Oo.prototype.zd,Oo.prototype.Be=function(t){if(this.a){var e=oa(this.a);t:{for(var n=0;n<e.textStreams.length;n++)if(e.textStreams[n].id==t.id){t=e.textStreams[n];break t}t=null}t&&(this.j.l=!1,Go(this,t,!1),e=t,this.xa?this.G=e:ma(this.a,e,!0),this.ga=t.language)}},Oo.prototype.selectTextTrack=Oo.prototype.Be,Oo.prototype.ze=function(){this.j.l=!0,fa(this.a)},Oo.prototype.selectEmbeddedTextTrack=Oo.prototype.ze,Oo.prototype.Ye=function(){return!!this.j&&this.j.l},Oo.prototype.usingEmbeddedTextTrack=Oo.prototype.Ye,Oo.prototype.Ce=function(t,e){if(this.a){this.c.abr.enabled&&C("Changing tracks while abr manager is enabled will likely result in the selected track being overriden. Consider disabling abr before calling selectVariantTrack().");var n=oa(this.a),i=We(n,t);i&&$e(i)&&(qo(this,i,!1),Jo(this,i,e),this.L=i.language,i.audio&&i.audio.channelsCount&&(this.Y=i.audio.channelsCount),n=Qe(n.variants,this.L,this.Ga,this.Y),this.h.setVariants(n))}},Oo.prototype.selectVariantTrack=Oo.prototype.Ce,Oo.prototype.od=function(){if(!this.a)return[];var t=oa(this.a);return t=Je(t.variants).map(function(t){return t.audio}).filter(Rt),Ho(t)},Oo.prototype.getAudioLanguagesAndRoles=Oo.prototype.od,Oo.prototype.yd=function(){return this.a?Ho(oa(this.a).textStreams):[]},Oo.prototype.getTextLanguagesAndRoles=Oo.prototype.yd,Oo.prototype.nd=function(){return this.a?Je(oa(this.a).variants).map(function(t){return t.language}).filter(Rt):[]},Oo.prototype.getAudioLanguages=Oo.prototype.nd,Oo.prototype.xd=function(){return this.a?oa(this.a).textStreams.map(function(t){return t.language}).filter(Rt):[]},Oo.prototype.getTextLanguages=Oo.prototype.xd,Oo.prototype.ye=function(t,e){if(this.a){var n=oa(this.a);this.L=t,this.Ga=e||"",es(this,n)}},Oo.prototype.selectAudioLanguage=Oo.prototype.ye,Oo.prototype.Ae=function(t,e){if(this.a){var n=oa(this.a);this.ga=t,this.Ua=e||"",es(this,n)}},Oo.prototype.selectTextLanguage=Oo.prototype.Ae,Oo.prototype.Mb=function(){return this.u?this.u.isTextVisible():this.pb},Oo.prototype.isTextTrackVisible=Oo.prototype.Mb,Oo.prototype.Fe=function(t){this.u&&this.u.setTextVisibility(t),this.pb=t,rs(this),!this.c.streaming.alwaysStreamText&&this.a&&(t?(t=oa(this.a),(t=en(t.textStreams,this.ga,this.Ua)[0])&&la(this.a,t)):fa(this.a))},Oo.prototype.setTextTrackVisibility=Oo.prototype.Fe,Oo.prototype.ud=function(){return this.b?new Date(1e3*this.b.presentationTimeline.f+1e3*this.f.currentTime):null},Oo.prototype.getPlayheadTimeAsDate=Oo.prototype.ud,Oo.prototype.wd=function(){return this.b?new Date(1e3*this.b.presentationTimeline.f):null},Oo.prototype.getPresentationStartTimeAsDate=Oo.prototype.wd,Oo.prototype.Gb=function(){return this.j?this.j.Gb():{total:[],audio:[],video:[],text:[]}},Oo.prototype.getBufferedInfo=Oo.prototype.Gb,Oo.prototype.getStats=function(){Qo(this),this.ib();var t=null,e=null,n=this.f;if(n=n&&n.getVideoPlaybackQuality?n.getVideoPlaybackQuality():{},this.g&&this.b){var i=sn(this.b,Jr(this.g)),r=this.b.periods[i];(i=this.I[i])&&(e=on(i.audio,i.video,r.variants),t=e.video||{})}return t||(t={}),e||(e={}),{width:t.width||0,height:t.height||0,streamBandwidth:e.bandwidth||0,decodedFrames:Number(n.totalVideoFrames),droppedFrames:Number(n.droppedVideoFrames),estimatedBandwidth:this.h?this.h.getBandwidthEstimate():NaN,loadLatency:this.l.loadLatency,playTime:this.l.playTime,bufferingTime:this.l.bufferingTime,switchHistory:ut(this.l.switchHistory),stateHistory:ut(this.l.stateHistory)}},Oo.prototype.getStats=Oo.prototype.getStats,Oo.prototype.addTextTrack=function(t,e,n,i,r,a){if(!this.a)return Promise.reject();var o=oa(this.a),s=this.b.periods.indexOf(o)+1,u=(s>=this.b.periods.length?this.b.presentationTimeline.T():this.b.periods[s].startTime)-o.startTime;if(1/0==u)return Promise.reject(new z(1,4,4033));var c={id:this.bd++,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(){return 1},getSegmentReference:function(e){return 1!=e?null:new ti(1,0,u,function(){return[t]},0,null)},initSegmentReference:null,presentationTimeOffset:0,mimeType:i,codecs:r||"",kind:n,encrypted:!1,keyId:null,language:e,label:a||null,type:"text",primary:!1,trickModeVideo:null,containsEmsgBoxes:!1,roles:[],channelsCount:null};return this.lb.push(c.id),o.textStreams.push(c),la(this.a,c).then(function(){if(!this.wa){var t=this.b.periods.indexOf(o),i=ha(this.a,"text");return i&&(this.I[t].text=i.id),this.lb.splice(this.lb.indexOf(c.id),1),es(this,o),is(this),{id:c.id,active:!1,type:"text",bandwidth:0,language:e,label:a||null,kind:n,width:null,height:null}}}.bind(this))},Oo.prototype.addTextTrack=Oo.prototype.addTextTrack,Oo.prototype.cc=function(t,e){this.mb.width=t,this.mb.height=e},Oo.prototype.setMaxHardwareResolution=Oo.prototype.cc,Oo.prototype.ac=function(){if(this.a){var t=this.a;if(t.f)t=!1;else if(t.l)t=!1;else{for(var e in t.c){var n=t.c[e];n.Ya&&(n.Ya=!1,Oa(t,n,.1))}t=!0}}else t=!1;return t},Oo.prototype.retryStreaming=Oo.prototype.ac,Oo.prototype.rd=function(){return this.b},Oo.prototype.getManifest=Oo.prototype.rd,Uu=Oo.prototype,Uu.kd=function(t){var e=[1001,1002,1003];this.P()&&0<=e.indexOf(t.code)&&(t.severity=1,this.ac())},Uu.ec=function(t){t.forEach(Ke.bind(null,this.i,this.a?ua(this.a):null,this.a?ca(this.a):null));var e=ot(t,function(t){return t.variants.some($e)});if(0==e)throw new z(2,4,4032);if(e<t.length)throw new z(2,4,4011);t.forEach(function(t){if(Ve(t,this.c.restrictions,this.mb)&&this.a&&oa(this.a)==t&&is(this),!t.variants.some($e))throw new z(2,4,4012)}.bind(this))},Uu.tb=function(t){Ke(this.i,this.a?ua(this.a):null,this.a?ca(this.a):null,t);var e=t.variants,n=e.some($e);if(Ve(t,this.c.restrictions,this.mb)&&this.a&&oa(this.a)==t&&is(this),t=e.some($e),!n)throw new z(2,4,4011);if(!t)throw new z(2,4,4012);if(n=this.i?this.i.b:null)for(e=o(e),t=e.next();!t.done;t=e.next()){t=o(t.value.drmInfos);for(var i=t.next();!i.done;i=t.next())if(i=i.value,i.keySystem==n.keySystem){i=o(i.initData||[]);for(var r=i.next();!r.done;r=i.next())r=r.value,Jt(this.i,r.initDataType,r.initData)}}},Uu.Je=function(t,e){this.h&&this.h.segmentDownloaded(t,e)},Uu.Uc=function(t){if(Qo(this),this.ob=t,this.ib(),this.g){var e=this.g.a;t!=e.g&&(e.g=t,zr(e,e.f))}this.dispatchEvent(new At("buffering",{buffering:t}))},Uu.He=function(){is(this)},Uu.ib=function(){if(!this.wa){var t=this.ob?"buffering":this.f.ended?"ended":this.f.paused?"paused":"playing",e=Date.now()/1e3;if(this.l.stateHistory.length){var n=this.l.stateHistory[this.l.stateHistory.length-1];if(n.duration=e-n.timestamp,t==n.state)return}this.l.stateHistory.push({timestamp:e,state:t,duration:0})}},Uu.Ie=function(){if(this.A){var t=this.A;t.c.forEach(t.m.bind(t,!0))}this.a&&va(this.a)},Uu.Hd=function(t){this.xa=!0,this.h.disable();var e={audio:!1,text:!1},n=Qe(t.variants,this.L,this.Ga,this.Y,e),i=en(t.textStreams,this.ga,this.Ua,e);if(n=ts(this,n),i=i[0]||null,this.S){t:{for(var r=this.b,a=0;a<r.periods.length;++a)for(var o=r.periods[a],s=0;s<o.variants.length;++s)if(o.variants[s]==this.S){r=a;break t}r=-1}this.b.periods[r]==t&&(n=this.S),this.S=null}return this.G&&(this.b.periods[un(this.b,this.G)]==t&&(i=this.G),this.G=null),n&&qo(this,n,!0),i&&(Go(this,i,!0),!sa(this.a)&&n&&n.audio&&e.text&&i.language!=n.audio.language&&(this.u.setTextVisibility(!0),rs(this))),this.c.streaming.alwaysStreamText||this.Mb()?{variant:n,text:i}:{variant:n,text:null}},Uu.fd=function(){this.xa=!1,this.c.abr.enabled&&this.h.enable(),this.S&&(pa(this.a,this.S,this.kc),this.S=null),this.G&&(ma(this.a,this.G,!0),this.G=null)},Uu.Od=function(){this.m&&this.m.update&&this.m.update()},Uu.Yd=function(){this.g&&this.g.ab()},Uu.Ke=function(t,e){qo(this,t,!0),this.a&&(pa(this.a,t,e||!1),ns(this))},Uu.Ta=function(t){if(!this.wa){var e=new At("error",{detail:t});this.dispatchEvent(e),e.defaultPrevented&&(t.handled=!0)}},Uu.ae=function(t){this.A?this.A.o(t):this.nb.push(t)},Uu.gb=function(t){this.dispatchEvent(t)},Uu.be=function(){if(this.f.error){var t=this.f.error.code;if(1!=t){var e=this.f.error.msExtendedCode;e&&(0>e&&(e+=Math.pow(2,32)),e=e.toString(16)),this.Ta(new z(2,3,3016,t,e,this.f.error.message))}}},Uu.Md=function(t){var e=["output-restricted","internal-error"],n=oa(this.a),i=!1,r=Object.keys(t),a=1==r.length&&"00"==r[0];r.length&&n.variants.forEach(function(n){var r=[];n.audio&&r.push(n.audio),n.video&&r.push(n.video),r.forEach(function(r){var o=n.allowedByKeySystem;r.keyId&&(r=t[a?"00":r.keyId],n.allowedByKeySystem=!!r&&0>e.indexOf(r)),o!=n.allowedByKeySystem&&(i=!0)})}),(r=an(ua(this.a),ca(this.a),n.variants))&&!r.allowedByKeySystem&&es(this,n),i&&(is(this),n=Qe(n.variants,this.L,this.Ga,this.Y),this.h.setVariants(n))},Uu.Jd=function(t,e){this.m&&this.m.onExpirationUpdated&&this.m.onExpirationUpdated(t,e),this.dispatchEvent(new At("expirationupdated"))},I("shaka.offline.Storage",hs),hs.support=ls,hs.prototype.destroy=function(){return this.a=this.b=null,Promise.resolve()},hs.prototype.destroy=hs.prototype.destroy,hs.prototype.configure=function(t){st(this.b,t,ys(this),{},"")},hs.prototype.configure=hs.prototype.configure,hs.prototype.store=function(t,e,n){var i=this;return c(function r(){var a,o,s,u,h,l;return A(r,function(r){switch(r.w){case 1:return _s(),i.g?r.return(Promise.reject(new z(2,9,9006))):(i.g=!0,a=e||{},o=null,s=function(t){o=o||t},d(r,ms(i,t,s,n),2));case 2:if(u=r.K,!(h=!u.manifest.presentationTimeline.P()&&!u.manifest.presentationTimeline.Aa()))throw new z(2,9,9005,t);if(As(i),o)throw o;return l=new Qa,r.return(ct([l,u.Eb],function(){return c(function e(){var n,r,s,c,h,f,v;return A(e,function(e){switch(e.w){case 1:return m(e),d(e,l.init(),4);case 4:return As(i),gs(i,u.Eb,u.manifest.periods),d(e,Za(l),5);case 5:return n=e.K,As(i),p(e,6),d(e,fs(i,n.N,u.Eb,u.manifest,t,a||{}),8);case 8:return r=e.K,As(i),d(e,n.N.addManifests([r]),9);case 9:return s=e.K,As(i),c=new Eo("manifest",n.path.fa,n.path.N,s[0]),e.return(os(c,r));case 6:return h=y(e),f=i.f,v=function(){},d(e,n.N.removeSegments(f,v),10);case 10:throw o||h;case 2:g(e),i.g=!1,i.c=null,i.f=[],b(e,0)}})})}))}})})},hs.prototype.store=hs.prototype.store,hs.prototype.remove=function(t){var e=this;_s();var n=So(t);if(null==n||"manifest"!=n.a)return Promise.reject(new z(2,9,9004,t));var i=new Qa;return ct([i],function(){return c(function t(){var r,a,o;return A(t,function(t){switch(t.w){case 1:return d(t,i.init(),2);case 2:return d(t,eo(i,n.fa(),n.N()),3);case 3:return r=t.K,d(t,r.getManifests([n.key()]),4);case 4:return a=t.K,o=a[0],d(t,Promise.all([ds(e,n,o),ps(e,r,n,o)]),0)}})})})},hs.prototype.remove=hs.prototype.remove,hs.prototype.list=function(){function t(t,n){return c(function i(){var r;return A(i,function(i){switch(i.w){case 1:return d(i,n.getAllManifests(),2);case 2:r=i.K,$u.forEach(r,function(n,i){var r=os(new Eo("manifest",t.fa,t.N,n),i);e.push(r)}),i.w=0}})})}_s();var e=[],n=new Qa;return ct([n],function(){return c(function e(){var i;return A(e,function(e){switch(e.w){case 1:return d(e,n.init(),2);case 2:return i=Promise.resolve(),to(n,function(e,n){i=i.then(function(){return t(e,n)})}),d(e,i,0)}})})}).then(function(){return e})},hs.prototype.list=hs.prototype.list,hs.deleteAll=function(){return c(function t(){var e;return A(t,function(t){switch(t.w){case 1:return e=new Qa,m(t),d(t,no(e),2);case 2:return g(t),d(t,e.destroy(),5);case 5:b(t,0)}})})},Xc.offline=ls,I("shaka.polyfill.installAll",function(){for(var t=0;t<Yc.length;++t)Yc[t].dd()});var Yc=[];I("shaka.polyfill.register",Ns),Ns(function(){if(t.Document){var e=Element.prototype;e.requestFullscreen=e.requestFullscreen||e.mozRequestFullScreen||e.msRequestFullscreen||e.webkitRequestFullscreen,e=Document.prototype,e.exitFullscreen=e.exitFullscreen||e.mozCancelFullScreen||e.msExitFullscreen||e.webkitExitFullscreen,"fullscreenElement"in document||(Object.defineProperty(document,"fullscreenElement",{get:function(){return document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement}}),Object.defineProperty(document,"fullscreenEnabled",{get:function(){return document.mozFullScreenEnabled||document.msFullscreenEnabled||document.webkitFullscreenEnabled}})),document.addEventListener("webkitfullscreenchange",Ds),document.addEventListener("webkitfullscreenerror",Ds),document.addEventListener("mozfullscreenchange",Ds),document.addEventListener("mozfullscreenerror",Ds),document.addEventListener("MSFullscreenChange",Ds),document.addEventListener("MSFullscreenError",Ds)}}),Ns(function(){var e=navigator.userAgent;e&&0<=e.indexOf("CrKey")&&delete t.indexedDB});var zc;Ns(function(){0>navigator.userAgent.indexOf("Trident/")||HTMLInputElement.prototype.addEventListener==Cs||(zc=HTMLInputElement.prototype.addEventListener,HTMLInputElement.prototype.addEventListener=Cs)}),Ns(function(){}),Ns(function(){if(t.MediaSource)if(t.cast&&cast.__platform__&&cast.__platform__.canDisplayType)Fs();else if(navigator.vendor&&0<=navigator.vendor.indexOf("Apple")){var e=navigator.appVersion;Bs(),0<=e.indexOf("Version/8")?t.MediaSource=null:0<=e.indexOf("Version/9")?Ms():0<=e.indexOf("Version/10")?(Ms(),Os()):0<=e.indexOf("Version/11")&&(Ms(),Ls())}}),Vs.prototype.c=function(t){if(!(1<t.version)){var e=Gt(t.reader.Da(16)),n=[];if(0<t.version)for(var i=t.reader.B(),r=0;r<i;++r){var a=Gt(t.reader.Da(16));n.push(a)}i=t.reader.B(),t.reader.F(i),this.b.push.apply(this.b,n),this.f.push(e),this.a.push({start:t.start,end:t.start+t.size-1})}},Hs.prototype.createMediaKeys=function(){var t=new Gs(this.keySystem);return Promise.resolve(t)},Hs.prototype.getConfiguration=function(){return this.a},Gs.prototype.createSession=function(t){var e=t||"temporary";if("temporary"!=e)throw new TypeError("Session type "+t+" is unsupported on this platform.");return new Ys(this.a,e)},Gs.prototype.setServerCertificate=function(){return Promise.resolve(!1)},x(Ys,gn),Uu=Ys.prototype,Uu.generateRequest=function(t,e){this.a=new q;try{this.c=this.g.createSession("video/mp4",new Uint8Array(e),null),Tt(this.f,this.c,"mskeymessage",this.Sd.bind(this)),Tt(this.f,this.c,"mskeyadded",this.Qd.bind(this)),Tt(this.f,this.c,"mskeyerror",this.Rd.bind(this)),$s(this,"status-pending")}catch(t){this.a.reject(t)}return this.a},Uu.load=function(){return Promise.reject(Error("MediaKeySession.load not yet supported"))},Uu.update=function(t){this.b=new q;try{this.c.update(new Uint8Array(t))}catch(t){this.b.reject(t)}return this.b},Uu.close=function(){try{this.c.close(),this.closed.resolve(),St(this.f)}catch(t){this.closed.reject(t)}return this.closed},Uu.remove=function(){return Promise.reject(Error("MediaKeySession.remove is only applicable for persistent licenses, which are not supported on this platform"))},Uu.Sd=function(t){this.a&&(this.a.resolve(),this.a=null),this.dispatchEvent(new At("message",{messageType:void 0==this.keyStatuses.a?"licenserequest":"licenserenewal",message:t.message.buffer}))},Uu.Qd=function(){this.a?($s(this,"usable"),this.a.resolve(),this.a=null):this.b&&($s(this,"usable"),this.b.resolve(),this.b=null)},Uu.Rd=function(){var t=Error("EME PatchedMediaKeysMs key error");if(t.errorCode=this.c.error,null!=this.a)this.a.reject(t),this.a=null;else if(null!=this.b)this.b.reject(t),this.b=null;else switch(this.c.error.code){case MSMediaKeyError.MS_MEDIA_KEYERR_OUTPUT:case MSMediaKeyError.MS_MEDIA_KEYERR_HARDWARECHANGE:$s(this,"output-not-allowed");break;default:$s(this,"internal-error")}};var Wc;Uu=Js.prototype,Uu.forEach=function(t){this.a&&t(this.a,Wc)},Uu.get=function(t){if(this.has(t))return this.a},Uu.has=function(t){var e=Wc;return!(!this.a||!Xt(new Uint8Array(t),new Uint8Array(e)))},Uu.entries=function(){},Uu.keys=function(){},Uu.values=function(){},Ns(function(){!t.HTMLVideoElement||!t.MSMediaKeys||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration||(Wc=new Uint8Array([0]).buffer,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=qs,t.MediaKeys=Gs,t.MediaKeySystemAccess=Hs,navigator.requestMediaKeySystemAccess=Ks)}),tu.prototype.createSession=function(){},tu.prototype.setServerCertificate=function(){},eu.prototype.getConfiguration=function(){},eu.prototype.createMediaKeys=function(){},Ns(function(){!t.HTMLVideoElement||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration||(navigator.requestMediaKeySystemAccess=Qs,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=Zs,t.MediaKeys=tu,t.MediaKeySystemAccess=eu)},-10);var $c="";au.prototype.createMediaKeys=function(){var t=new ou(this.a);return Promise.resolve(t)},au.prototype.getConfiguration=function(){return this.b},Uu=ou.prototype,Uu.createSession=function(t){var e=t||"temporary";if("temporary"!=e&&"persistent-license"!=e)throw new TypeError("Session type "+t+" is unsupported on this platform.");return t=this.b||document.createElement("video"),t.src||(t.src="about:blank"),e=new cu(t,this.g,e),this.c.push(e),e},Uu.setServerCertificate=function(){return Promise.resolve(!1)},Uu.fe=function(t){var e=document.createEvent("CustomEvent");e.initCustomEvent("encrypted",!1,!1,null),e.initDataType="webm",e.initData=t.initData,this.b.dispatchEvent(e)},Uu.ee=function(t){var e=uu(this,t.sessionId);e&&(t=new At("message",{messageType:void 0==e.keyStatuses.a?"licenserequest":"licenserenewal",message:t.message}),e.b&&(e.b.resolve(),e.b=null),e.dispatchEvent(t))},Uu.ce=function(t){(t=uu(this,t.sessionId))&&(lu(t,"usable"),t.a&&t.a.resolve(),t.a=null)},Uu.de=function(t){var e=uu(this,t.sessionId);if(e){var n=Error("EME v0.1b key error");n.errorCode=t.errorCode,n.errorCode.systemCode=t.systemCode,!t.sessionId&&e.b?(n.method="generateRequest",45==t.systemCode&&(n.message="Unsupported session type."),e.b.reject(n),e.b=null):t.sessionId&&e.a?(n.method="update",e.a.reject(n),e.a=null):(n=t.systemCode,t.errorCode.code==MediaKeyError.MEDIA_KEYERR_OUTPUT?lu(e,"output-restricted"):1==n?lu(e,"expired"):lu(e,"internal-error"))}},x(cu,gn),Uu=cu.prototype,Uu.fc=function(t,e){if(this.a)this.a.then(this.fc.bind(this,t,e)).catch(this.fc.bind(this,t,e));else{if(this.a=t,"webkit-org.w3.clearkey"==this.c){var n=Mt(e),i=JSON.parse(n);"oct"!=i.keys[0].kty&&(this.a.reject(Error("Response is not a valid JSON Web Key Set.")),this.a=null),n=Ht(i.keys[0].k),i=Ht(i.keys[0].kid)}else n=new Uint8Array(e),i=null;var r=nu("addKey");try{this.f[r](this.c,n,i,this.sessionId)}catch(t){this.a.reject(t),this.a=null}}},Uu.generateRequest=function(t,e){return hu(this,e,null)},Uu.load=function(t){return"persistent-license"==this.g?hu(this,null,t):Promise.reject(Error("Not a persistent session."))},Uu.update=function(t){var e=new q;return this.fc(e,t),e},Uu.close=function(){if("persistent-license"!=this.g){if(!this.sessionId)return this.closed.reject(Error("The session is not callable.")),this.closed;var t=nu("cancelKeyRequest");try{this.f[t](this.c,this.sessionId)}catch(t){}}return this.closed.resolve(),this.closed},Uu.remove=function(){return"persistent-license"!=this.g?Promise.reject(Error("Not a persistent session.")):this.close()};var Jc;Uu=fu.prototype,Uu.forEach=function(t){this.a&&t(this.a,Jc)},Uu.get=function(t){if(this.has(t))return this.a},Uu.has=function(t){var e=Jc;return!(!this.a||!Xt(new Uint8Array(t),new Uint8Array(e)))},Uu.entries=function(){},Uu.keys=function(){},Uu.values=function(){},Ns(function(){if(!(!t.HTMLVideoElement||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration)){if(HTMLMediaElement.prototype.webkitGenerateKeyRequest)$c="webkit";else if(!HTMLMediaElement.prototype.generateKeyRequest)return;Jc=new Uint8Array([0]).buffer,navigator.requestMediaKeySystemAccess=iu,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=ru,t.MediaKeys=ou,t.MediaKeySystemAccess=au}}),Ns(function(){if(t.HTMLMediaElement){var e=HTMLMediaElement.prototype.play;HTMLMediaElement.prototype.play=function(){var t=e.apply(this,arguments);return t&&t.catch(function(){}),t}}}),Ns(function(){if(t.HTMLVideoElement){var e=HTMLVideoElement.prototype;!e.getVideoPlaybackQuality&&"webkitDroppedFrameCount"in e&&(e.getVideoPlaybackQuality=du)}}),Ns(function(){if(!t.VTTCue&&t.TextTrackCue){var e=TextTrackCue.length;if(3==e)t.VTTCue=pu;else if(6==e)t.VTTCue=mu;else{try{var n=!!pu(1,2,"")}catch(t){n=!1}n&&(t.VTTCue=pu)}}}),vu.prototype.parseInit=function(){},vu.prototype.parseMedia=function(t,e){var n=Mt(t),i=[],r=new DOMParser,a=null;try{a=r.parseFromString(n,"text/xml")}catch(t){throw new z(2,2,2005)}if(a){if(!(r=a.getElementsByTagName("tt")[0]))throw new z(2,2,2005);a=Dn(r,"http://www.w3.org/ns/ttml#parameter","frameRate");var o=Dn(r,"http://www.w3.org/ns/ttml#parameter","subFrameRate"),s=Dn(r,"http://www.w3.org/ns/ttml#parameter","frameRateMultiplier"),u=Dn(r,"http://www.w3.org/ns/ttml#parameter","tickRate");if("default"!=(n=r.getAttribute("xml:space")||"default")&&"preserve"!=n)throw new z(2,2,2005);n="default"==n,a=new xu(a,o,s,u),o=yu(r.getElementsByTagName("styling")[0]),s=yu(r.getElementsByTagName("layout")[0]),u=[];for(var c=0;c<s.length;c++){var h=s[c],l=o,f=new ge,d=h.getAttribute("xml:id");if(d){f.id=d;var p;(p=Su(h,l,"extent"))&&null!=(p=(d=Qc.exec(p))||th.exec(p))&&(f.width=Number(p[1]),f.height=Number(p[2]),f.widthUnits=d?dc:0,f.heightUnits=d?dc:0),(h=Su(h,l,"origin"))&&null!=(p=(d=Qc.exec(h))||th.exec(h))&&(f.viewportAnchorX=Number(p[1]),f.viewportAnchorY=Number(p[2]),f.viewportAnchorUnits=d?dc:0)}else f=null;f&&u.push(f)}for(r=yu(r.getElementsByTagName("body")[0]),c=0;c<r.length;c++)(f=bu(r[c],e.periodStart,a,o,s,u,n))&&i.push(f)}return i};var Qc=/^(\d{1,2}|100)% (\d{1,2}|100)%$/,Zc=/^(\d+px|\d+em)$/,th=/^(\d+)px (\d+)px$/,eh=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,nh=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,ih=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d{2,})$/,rh=/^(\d*(?:\.\d*)?)f$/,ah=/^(\d*(?:\.\d*)?)t$/,oh=/^(?:(\d*(?:\.\d*)?)h)?(?:(\d*(?:\.\d*)?)m)?(?:(\d*(?:\.\d*)?)s)?(?:(\d*(?:\.\d*)?)ms)?$/,sh={left:"start",center:uc,right:"end",start:"start",end:"end"},uh={left:"line-left",center:"center",right:"line-right"};mc["application/ttml+xml"]=vu,Pu.prototype.parseInit=function(t){var e=!1;if((new ii).C("moov",ri).C("trak",ri).C("mdia",ri).C("minf",ri).C("stbl",ri).Z("stsd",ai).C("stpp",function(t){e=!0,t.parser.stop()}).parse(t),!e)throw new z(2,2,2007)},Pu.prototype.parseMedia=function(t,e){var n=!1,i=[];if((new ii).C("mdat",oi(function(t){n=!0,i=i.concat(this.a.parseMedia(t,e))}.bind(this))).parse(t),!n)throw new z(2,2,2007);return i},mc['application/mp4; codecs="stpp"']=Pu,mc['application/mp4; codecs="stpp.TTML.im1t"']=Pu,Ru.prototype.parseInit=function(){},Ru.prototype.parseMedia=function(t,e){var n=Mt(t);if(n=n.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n"),n=n.split(/\n{2,}/m),!/^WEBVTT($|[ \t\n])/m.test(n[0]))throw new z(2,2,2e3);var i=e.segmentStart;if(null==i&&(i=0,0<=n[0].indexOf("X-TIMESTAMP-MAP"))){var r=n[0].match(/LOCAL:((?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3}))/m),a=n[0].match(/MPEGTS:(\d+)/m);r&&a&&(i=Cu(new sr(r[1])),i=e.periodStart+(Number(a[1])/9e4-i))}a=[];var o=n[0].split("\n");for(r=1;r<o.length;r++)if(/^Region:/.test(o[r])){var s=new sr(o[r]),u=new ge;hr(s),ur(s);for(var c=hr(s);c;){var h=u,l=c;(c=/^id=(.*)$/.exec(l))?h.id=c[1]:(c=/^width=(\d{1,2}|100)%$/.exec(l))?h.width=Number(c[1]):(c=/^lines=(\d+)$/.exec(l))?(h.height=Number(c[1]),h.heightUnits=2):(c=/^regionanchor=(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(l))?(h.regionAnchorX=Number(c[1]),h.regionAnchorY=Number(c[2])):(c=/^viewportanchor=(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(l))?(h.viewportAnchorX=Number(c[1]),h.viewportAnchorY=Number(c[2])):/^scroll=up$/.exec(l)&&(h.scroll="up"),ur(s),c=hr(s)}a.push(u)}for(r=[],s=1;s<n.length;s++){if(o=n[s].split("\n"),c=o,l=i,o=a,1==c.length&&!c[0]||/^NOTE($|[ \t])/.test(c[0])||"STYLE"==c[0])o=null;else{u=null,0>c[0].indexOf("--\x3e")&&(u=c[0],c.splice(0,1)),h=new sr(c[0]);var f=Cu(h),d=cr(h,/[ \t]+--\x3e[ \t]+/g),p=Cu(h);if(null==f||null==d||null==p)throw new z(2,2,2001);for(c=new ye(f+l,p+l,c.slice(1).join("\n").trim()),ur(h),l=hr(h);l;)Nu(c,l,o),ur(h),l=hr(h);null!=u&&(c.id=u),o=c}o&&r.push(o)}return r},mc["text/vtt"]=Ru,mc['text/vtt; codecs="vtt"']=Ru,Mu.prototype.parseInit=function(t){var e=!1;if((new ii).C("moov",ri).C("trak",ri).C("mdia",ri).Z("mdhd",function(t){0==t.version?(t.reader.F(4),t.reader.F(4),this.a=t.reader.B(),t.reader.F(4)):(t.reader.F(8),t.reader.F(8),this.a=t.reader.B(),t.reader.F(8)),t.reader.F(4)}.bind(this)).C("minf",ri).C("stbl",ri).Z("stsd",ai).C("wvtt",function(){e=!0}).parse(t),!this.a)throw new z(2,2,2008);if(!e)throw new z(2,2,2008)},Mu.prototype.parseMedia=function(t,e){var n=this;if(!this.a)throw new z(2,2,2008);var i,r=0,a=[],o=[],s=!1,u=!1,c=!1,h=null;if((new ii).C("moof",ri).C("traf",ri).Z("tfdt",function(t){s=!0,r=0==t.version?t.reader.B():t.reader.Ra()}).Z("tfhd",function(t){var e=t.flags;t=t.reader,t.F(4),1&e&&t.F(8),2&e&&t.F(4),h=8&e?t.B():null}).Z("trun",function(t){u=!0;var e=t.version,n=t.flags;t=t.reader;var i=t.B();1&n&&t.F(4),4&n&&t.F(4);for(var r=[],o=0;o<i;o++){var s={duration:null,sampleSize:null,gc:null};256&n&&(s.duration=t.B()),512&n&&(s.sampleSize=t.B()),1024&n&&t.F(4),2048&n&&(s.gc=0==e?t.B():t.Lc()),r.push(s)}a=r}).C("mdat",oi(function(t){c=!0,i=t})).parse(t),!c&&!s&&!u)throw new z(2,2,2008);var l=r,f=new DataView(i.buffer,i.byteOffset,i.byteLength),d=new ei(f,0);return a.forEach(function(t){var i=t.duration||h,a=t.gc?r+t.gc:l;l=a+(i||0);var s=0;do{var u=d.B();s+=u;var c=d.B(),f=null;"vttc"==ui(c)?8<u&&(f=d.Da(u-8)):d.F(u-8),i&&f&&o.push(Lu(f,e.periodStart+a/n.a,e.periodStart+l/n.a))}while(t.sampleSize&&s<t.sampleSize)}),o.filter(Pt)},mc['application/mp4; codecs="wvtt"']=Mu}).call(i,n,n);for(var r in i.shaka)e[r]=i.shaka[r]}()}).call(e,n(3))},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n}])});
//# sourceMappingURL=dash-shaka-playback.min.js.map \ No newline at end of file
diff --git a/template/assemblies/player/audio.phtml b/template/assemblies/player/audio.phtml
index 0713f20..c3594eb 100644
--- a/template/assemblies/player/audio.phtml
+++ b/template/assemblies/player/audio.phtml
@@ -2,7 +2,7 @@
preload="auto"
controls="controls"
autoplay="autoplay"
- style="height: 400px; display: block; margin: auto;"
+ style="max-height: 400px; max-width:100vw; display: block; margin: auto;"
poster="<?=h($stream->getPoster())?>"
>
<source