diff options
author | MaZderMind | 2018-01-24 23:51:18 +0100 |
---|---|---|
committer | MaZderMind | 2018-01-24 23:51:18 +0100 |
commit | 7f066f2e9c382fe8c12a2a607c4576e1ee38f87c (patch) | |
tree | f36dc1e17fcded998f35562976b47ec47b3d7609 /assets/clapprio/dash-shaka-playback.min.js | |
parent | ceaad129176e3ff5dd47b884c024569f474eec5b (diff) | |
parent | f36367abd9b1537b3b01463347d01b186844fbef (diff) |
Merge branch '34c3-cherries'
Diffstat (limited to '')
-rw-r--r-- | assets/clapprio/dash-shaka-playback.min.js | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/assets/clapprio/dash-shaka-playback.min.js b/assets/clapprio/dash-shaka-playback.min.js new file mode 100644 index 0000000..6c746b6 --- /dev/null +++ b/assets/clapprio/dash-shaka-playback.min.js @@ -0,0 +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)}()}])}); +//# sourceMappingURL=dash-shaka-playback.min.js.map
\ No newline at end of file |