webpackJsonpjwplayer([3,13],{8:function(t,e,i){var n,r;n=[i(1),i(11),i(2),i(13),i(12)],r=function(t,e,i,n,r){function a(e){if(this._currentTextTrackIndex=-1,e){if(this._textTracks?(this._textTracks=t.reject(this._textTracks,function(t){var e=t._id;if(this.renderNatively&&e&&0===e.indexOf("nativecaptions"))return delete this._tracksById[e],!0},this),delete this._tracksById.nativemetadata):this._initTextTracks(),e.length){var n=0,a=e.length;for(n;nthis._textTracks.length)return!0;for(var e=0;e59?e(i[1],i[2],0,i[4]):e(0,i[1],i[2],i[4]):null}function n(){this.values=Object.create(null)}function r(t,e,i,n){for(var r=n?t.split(n):[t],a=0;a<=r.length;a+=1)if("string"==typeof r[a]){var s=r[a].split(i);if(2===s.length){var o=s[0],u=s[1];e(o,u)}}}function a(t,e,a){function s(){var e=i(t);if(null===e)throw new Error("Malformed timestamp: "+h);return t=t.replace(c,""),e}function o(t,e){var i=new n;r(t,function(t,e){switch(t){case"region":for(var n=a.length-1;n>=0;n--)if(a[n].id===e){i.set(t,a[n].region);break}break;case"vertical":i.alt(t,e,["rl","lr"]);break;case"line":var r=e.split(","),s=r[0];i.integer(t,s),i.percent(t,s)&&i.set("snapToLines",!1),i.alt(t,s,["auto"]),2===r.length&&i.alt("lineAlign",r[1],["start",y,"end"]);break;case"position":r=e.split(","),i.percent(t,r[0]),2===r.length&&i.alt("positionAlign",r[1],["start",y,"end","line-left","line-right","auto"]);break;case"size":i.percent(t,e);break;case"align":i.alt(t,e,["start",y,"end","left","right"])}},d,l),e.region=i.get("region",null),e.vertical=i.get("vertical","");var s=i.get("line","auto");"auto"===s&&b.line===-1&&(s=-1),e.line=s,e.lineAlign=i.get("lineAlign","start"),e.snapToLines=i.get("snapToLines",!0),e.size=i.get("size",100),e.align=i.get("align",y);var o=i.get("position","auto");"auto"===o&&50===b.position&&(o="start"===e.align||"left"===e.align?0:"end"===e.align||"right"===e.align?100:50),e.position=o}function u(){t=t.replace(f,"")}var h=t;if(u(),e.startTime=s(),u(),"-->"!==t.substr(0,3))throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+h);t=t.substr(3),u(),e.endTime=s(),u(),o(t,e)}var s=/^(\d+):(\d{2})(:\d{2})?\.(\d{3})/,o=/^-?\d+$/,u=/\r\n|\n/,h=/^NOTE($|[ \t])/,c=/^[^\sa-zA-Z-]+/,d=/:/,l=/\s/,f=/^\s+/,p=/-->/,m=/^WEBVTT([ \t].*)?$/,v=window.requestAnimationFrame||function(t){return window.setTimeout(t,17)},g=function(t,i){this.window=t,this.state="INITIAL",this.buffer="",this.decoder=i||new e,this.regionList=[],this.maxCueBatch=1e3};n.prototype={set:function(t,e){this.get(t)||""===e||(this.values[t]=e)},get:function(t,e,i){return i?this.has(t)?this.values[t]:e[i]:this.has(t)?this.values[t]:e},has:function(t){return t in this.values},alt:function(t,e,i){for(var n=0;n=0&&e<=100&&(this.set(t,e),!0)}};var b=new t(0,0,0),y="middle"===b.align?"middle":"center";return g.prototype={parse:function(e,i){function n(){for(var t=l.buffer,e=0;e2&&void 0!==arguments[2]?arguments[2]:"",n=d(t,e);return(0,c.JWError)(a.NETWORK,n,h.FATAL,l(n,t,i))},e.networkErrorCode=function(t,e){var i=void 0;return i=t>0?o.BAD_HTTP_STATUS:e&&"http:"===e.substring(0,5)&&"https:"===document.location.protocol?o.BLOCKED_MIXED_CONTENT:o.CROSSDOMAIN_ERROR}),l=e.networkErrorMessage=function(t,e,i){var n="";switch(t){case o.BAD_HTTP_STATUS:n=f(e,i);break;case o.CROSSDOMAIN_ERROR:n="Crossdomain access denied";break;case o.BLOCKED_MIXED_CONTENT:n="Unable to fetch HTTP resource over HTTPS";break;default:n="Unknown Network Error"}return n},f=e.badStatusMessage=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i="";switch(t){case 403:i="You do not have permission to access this content";break;case 404:i="404 Not Found";break;default:i=t+" "+e}return i}},46:function(t,e,i){var n,r;n=[i(2)],r=function(t){return{container:null,volume:function(e){e=t.between(e/100,0,1),this.video.volume=e},mute:function(t){this.video.muted=!!t,this.video.muted||this.video.removeAttribute("muted")},resize:function(e,i,n){if(!(e&&i&&this.video.videoWidth&&this.video.videoHeight))return!1;if("uniform"===n){var r=e/i,a=this.video.videoWidth/this.video.videoHeight,s=null;Math.abs(r-a)<.09&&(s="fill"),t.style(this.video,{objectFit:s})}return!1},getContainer:function(){return this.container},setContainer:function(t){this.container=t,t.insertBefore(this.video,t.firstChild)},remove:function(){this.stop(),this.destroy(),this.container===this.video.parentNode&&this.container.removeChild(this.video)},getVideo:function(e,i){var n=i||document.getElementById(e),r=n?n.querySelector("video"):null;return r||(r=document.createElement("video"),t.isMobile()&&r.setAttribute("jw-gesture-required","")),r.className="jw-video jw-reset",this.video=r,r}}}.apply(e,n),!(void 0!==r&&(t.exports=r))},47:function(t,e,i){var n,r;n=[i(3),i(10),i(5),i(1),i(24)],r=function(t,e,i,n,r){var a=256;return{stallCheckTimeout_:-1,lastStalledTime_:NaN,trigger:function(e,i){return t.trigger.call(this,e,i)},setState:function(t){return e.setState.call(this,t)},attachMedia:function(){this.eventsOn_()},detachMedia:function(){return this.stopStallCheck(),this.eventsOff_(),this.video},stopStallCheck:function(){clearTimeout(this.stallCheckTimeout_)},startStallCheck:function(){this.stopStallCheck(),this.stallCheckTimeout_=setTimeout(this.stalledHandler.bind(this,this.video.currentTime),a)},stalledHandler:function(t){t===this.video.currentTime&&(this.video.paused||this.video.ended||this.state!==i.LOADING&&this.state!==i.ERROR&&(this.seeking||(this.atEdgeOfLiveStream()&&this.setPlaybackRate(1),this.setState(i.STALLED))))},atEdgeOfLiveStream:function(){if(!this.isLive())return!1;var t=2;return r.endOfRange(this.video.buffered)-this.video.currentTime<=t},setAutoplayAttributes:function(){this.video.setAttribute("autoplay",""),this.video.setAttribute("muted","")},removeAutoplayAttributes:function(){this.video.removeAttribute("autoplay"),this.video.removeAttribute("muted")}}}.apply(e,n),!(void 0!==r&&(t.exports=r))},48:function(t,e,i){var n,r;n=[i(2),i(5)],r=function(t,e){return{seeking:!1,loadedmetadata:function(){var t={duration:this.getDuration(),height:this.video.videoHeight,width:this.video.videoWidth},e=this.drmUsed;e&&(t.drm=e),this.trigger("meta",t)},timeupdate:function(){this.stopStallCheck();var t=this.video.videoHeight;t!==this._helperLastVideoHeight&&this.adaptation&&this.adaptation({size:{width:this.video.videoWidth,height:t}}),this._helperLastVideoHeight=t,this.state!==e.STALLED&&this.state!==e.LOADING||this.setState(e.PLAYING),this.startStallCheck();var i=this.getCurrentTime(),n={position:i,duration:this.getDuration()};if(this.getPtsOffset){var r=this.getPtsOffset();r>=0&&(n.metadata={mpegts:r+i})}(this.state===e.PLAYING||this.seeking)&&this.trigger("time",n)},click:function(t){this.trigger("click",t)},volumechange:function(){var t=this.video;this.trigger("volume",{volume:Math.round(100*t.volume)}),this.trigger("mute",{mute:t.muted})},seeked:function(){this.seeking&&(this.seeking=!1,this.trigger("seeked"))},playing:function(){this.setState(e.PLAYING),this.video.hasAttribute("jw-gesture-required")&&this.video.removeAttribute("jw-gesture-required"),this.trigger("providerFirstFrame")},pause:function(){this.state!==e.COMPLETE&&(this.video.ended||this.video.currentTime!==this.video.duration&&this.setState(e.PAUSED))},progress:function(){var e=this.getDuration();if(!(e<=0||e===1/0)){var i=this.video.buffered;if(i&&0!==i.length){var n=t.between(i.end(i.length-1)/e,0,1);this.trigger("bufferChange",{bufferPercent:100*n,position:this.getCurrentTime(),duration:e})}}},ratechange:function(){this.trigger("ratechange",{playbackRate:this.video.playbackRate})},ended:function(){this.stopStallCheck(),this._helperLastVideoHeight=0,this.state!==e.IDLE&&this.state!==e.COMPLETE&&this.trigger("complete")},loadeddata:function(){this.renderNatively&&this.setTextTracks(this.video.textTracks),this.video.setAttribute("jw-loaded","data")},error:function(){var t=this.video.error&&this.video.error.code||-1,e={1:"Unknown operation aborted",2:"Unknown network error",3:"Unknown decode error",4:"Source not supported"}[t]||"Unknown";this.trigger("mediaError",{code:t,message:"Error playing file: "+e})}}}.apply(e,n),!(void 0!==r&&(t.exports=r))},78:function(t,e,i){function n(t){return t&&t.__esModule?t:{"default":t}}var r,a,s=i(9),o=i(172),u=n(o),h=i(30);r=[i(1),i(23),i(116),i(2),i(5),i(4),i(3),i(48),i(46),i(47),i(8),i(29),i(183)],a=function(t,e,i,n,r,a,c,d,l,f,p,m,v){function g(u,g){function y(){ct.addEventListener("error",I),ct.addEventListener("trackschanged",j),ct.addEventListener("buffering",ht),t.each(pt,function(t,e){mt.video.addEventListener(e,t,!1)}),o.CueDispatcher.on("cues",st)}function T(t,e){return n.generateLabel(t,g.qualityLabels,e)}function w(t,e){for(var i=0,n=Math.abs(e),r=1;r0&&t.currentTime0&&void 0!==arguments[0]?arguments[0]:{sources:[]},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=void 0;e.response&&(n=new Uint8Array(e.response)),ct.configure({drm:F(n),preferredTextLanguage:gt.selectedCaptionCode||i.getCode(gt.captionLabel),abr:{enabled:mt.abr}});var r=t.sources[0].file,a=t.starttime||0;ct.load(r,a).then(D,I)}function D(){mt.trigger(a.JWPLAYER_MEDIA_BUFFER_FULL)}function O(e){var i=0===e;if(q(e,mt.jwLevels)){var n=mt.jwLevels[e].shakaId,r=t.findWhere(mt.shakaLevels,{id:n});if(r){var a=r.bandwidth>yt,s=r.language!==bt;yt=r.bandwidth,ct.selectVariantTrack(r,a||s)}mt.abr=i,ct.configure({abr:{enabled:mt.abr}}),U()}}function U(t){var e=mt.audioTracks[t||G()];if(e){var i=mt.shakaAudioTracks[e.shakaIndex];i&&(bt=i.language,ct.selectAudioLanguage(bt))}}function j(){var e=ct.getTextTracks();mt._tracksById&&e.length===Object.keys(mt._tracksById).length||(e=e.reduce(function(t,e){if("Shaka Player TextTrack"===e.label||e.mimeType.indexOf("vtt")===-1)return t;var n=e;return n.kind+="s",n.embedded=!0,n.label=i.getLabel(n.language),t.push(n),t},[]),e.length&&mt.addTextTracks(e));var n=ct.getVariantTracks(),r=t.findWhere(n,{active:!0}),s=t.groupBy(n,"language"),o="video";mt.tracksByLang=s,t.size(s)&&(B(s,r.language),U(mt.currentAudioIndex),r&&(H(s[r.language]),O(mt.currentQuality),mt.trigger(a.JWPLAYER_MEDIA_LEVELS,{levels:mt.jwLevels,currentQuality:mt.currentQuality})),r.mimeType.indexOf("audio")>-1&&(o="audio")),mt.trigger(a.JWPLAYER_MEDIA_TYPE,{mediaType:o})}function B(e,i){var n=t.find(e[i],function(t){return t.active}),r=[];t.forEach(t.keys(e),function(t){t===i?r.push(n):r.push(e[t][0])}),t.isArray(r)&&W(r),mt.trigger(a.JWPLAYER_AUDIO_TRACKS,{tracks:mt.audioTracks,currentTrack:mt.currentAudioIndex})}function F(t){var e,i,n={},r="";if(m.isSupported("clearkey")&&dt.clearkey)return i=dt.clearkey,i.keyId=i.keyId?i.keyId.replace(/-/g,""):null,n.clearKeys={},n.clearKeys[i.keyId]=i.key,n;if(m.isSupported("widevine"))mt.drmUsed="widevine",e="com.widevine.alpha",r="http://widevine-proxy.appspot.com/proxy";else{if(!m.isSupported("playready"))return n;mt.drmUsed="playready",e="com.microsoft.playready",r="http://microsoft-proxy.appspot.com/proxy"}if(i=dt[mt.drmUsed],!i)return n;if(t&&(n.advanced={},n.advanced[e]={serverCertificate:t}),n.servers=n.servers||{},n.servers[e]=i.url||r,i){var a=i.licenseRequestFilter;ct.getNetworkingEngine().registerRequestFilter(function(t,e){if(t===v.net.NetworkingEngine.RequestType.LICENSE){if("function"==typeof a){var n=ct.drmInfo();a(e,n)}S(i,e)}})}return n}function H(e){mt.currentQuality=0,mt.shakaLevels=e,mt.shakaLevels.sort(function(t,e){return t.height1&&mt.jwLevels.unshift({label:"Auto",shakaId:"auto"})}function V(e){return t.map(e,function(r,a){var s=r.language,o=t.where(e,{language:s}).length>1,u=i.getLabel(s);return"und"===s?u="Unknown":"dv"===s&&(u="Audio Description"),o&&(u+=" ("+n.toKbps(r.bandwidth)+" kbps)"),{autoselect:!1,defaulttrack:!!r.active,groupid:"default",language:r.language,name:u,shakaIndex:a,shakaId:r.id}})}function K(){var e;return q(mt.currentAudioIndex,mt.audioTracks)?mt.currentAudioIndex:(e=t.find(mt.audioTracks,function(t){return t.defaulttrack&&"dv"!==t.language}),e||(e=t.find(mt.audioTracks,function(t){return"dv"!==t.language})),e?e.shakaIndex:0)}function q(e,i){return t.isNumber(e)&&!t.isNaN(e)&&e>=0&&ee)throw Error("Bad port number "+e);t.Ka=e}else t.Ka=null}function l(t,e,i){e instanceof v?t.a=e:(i||(e=p(e,ps)),t.a=new v(e))}function f(t,e){return t?e?decodeURI(t):decodeURIComponent(t):""}function p(t,e,i){return"string"==typeof t?(t=encodeURI(t).replace(e,m),i&&(t=t.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),t):null}function m(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(t,e){return t.reduce(function(t,e,i){return e["catch"](t.bind(null,i))}.bind(null,e),Promise.reject())}function y(t,e){return t.concat(e)}function T(){}function w(t){return null!=t}function E(t){return function(e){return e!=t}}function k(t,e,i){return i.indexOf(t)==e}function S(t,e){if(!e.length)return t;var i=e.map(function(t){return new h(t)});return t.map(function(t){return new h(t)}).map(function(t){return i.map(t.resolve.bind(t))}).reduce(y,[]).map(function(t){return t.toString()})}function I(t,e){return{keySystem:t,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:e||[],keyIds:[]}}function A(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],h=!!{".abr.manager":!0}[o]||!!{serverCertificate:!0}[a];(s||a in t)&&(void 0===e[a]?void 0===u||s?delete t[a]:t[a]=u:h?t[a]=e[a]:"object"==typeof t[a]&&"object"==typeof e[a]?A(t[a],e[a],u,n,o):typeof e[a]==typeof u&&(t[a]=e[a]))}}function x(t){return JSON.parse(JSON.stringify(t))}function _(){var t,e,i=new Promise(function(i,n){t=i,e=n});return i.resolve=t,i.reject=e,i}function P(t){this.f=!1,this.a=[],this.b=[],this.c=[],this.h=t||null}function C(){return{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:0}}function N(t,e){return{uris:t,method:"GET",body:null,headers:{},allowCrossSiteCredentials:!1,retryParameters:e}}function R(t,e){for(var i=[],n=0;n=t[e]}.bind(null,e);if(!e[0]&&!e[2])return X(t,!1);if(!e[1]&&!e[3])return X(t,!0);if(i(0)&&i(1)&&i(2)&&i(3))return G(t);throw new u(2,2,2003)}function W(t){t=unescape(encodeURIComponent(t));for(var e=new Uint8Array(t.length),i=0;i=e?null:new VTTCue(t,e,i)}function St(t,e,i,n){return Promise.resolve().then(function(){if(this.c)if(null==i||null==n)this.f.parseInit(e);else{for(var t=this.f.parseMedia(e,{periodStart:this.h,segmentStart:i,segmentEnd:n}),r=0;r=this.g);++r)this.c.addCue(t[r]);null==this.b&&(this.b=i),this.a=Math.min(n,this.g)}}.bind(t))}function It(t,e){for(var i=t.c.cues,n=[],r=0;rt.end(0)-t.start(0)?null:t.length?t.end(t.length-1):null}function _t(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 Pt(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,e,i){this.f=t,this.N=e,this.i=i,this.c={},this.a=null,this.b={},this.g=new D,this.h=!1}function Nt(){var t={};return'video/mp4; codecs="avc1.42E01E",video/mp4; codecs="avc3.42E01E",video/mp4; codecs="hvc1.1.6.L93.90",audio/mp4; codecs="mp4a.40.2",audio/mp4; codecs="ac-3",audio/mp4; codecs="ec-3",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",video/mp2t; codecs="mp4a.40.2",text/vtt,application/mp4; codecs="wvtt",application/ttml+xml,application/mp4; codecs="stpp"'.split(",").forEach(function(e){t[e]=!!bs[e]||MediaSource.isTypeSupported(e);var i=e.split(";")[0];t[i]=t[i]||t[e]}),t}function Rt(t,e){t.a||(t.a=new wt(t.i)),t.a.f=new bs[e]}function Lt(t,e){if("text"==e)var i=t.a.b;else i=Mt(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 Mt(t,e){try{return t.c[e].buffered}catch(i){return null}}function Dt(t,e,i,n,r){return"text"==e?St(t.a,i,n,r):jt(t,e,t.je.bind(t,e,i))}function Ot(t,e){return"text"==e?t.a.remove(0,1/0):jt(t,e,t.qc.bind(t,e,0,t.N.duration))}function Ut(t,e,i,n){return"text"==e?(t.a.h=i,null!=n&&(t.a.g=n),Promise.resolve()):(null==n&&(n=1/0),Promise.all([jt(t,e,t.Ec.bind(t,e)),jt(t,e,t.$d.bind(t,e,i)),jt(t,e,t.Yd.bind(t,e,n))]))}function jt(t,e,i){if(t.h)return Promise.reject();if(i={start:i,p:new _},t.b[e].push(i),1==t.b[e].length)try{i.start()}catch(n){"QuotaExceededError"==n.name?i.p.reject(new u(2,3,3017,e)):i.p.reject(new u(2,3,3015,n)),Ft(t,e)}return i.p}function Bt(t,e){if(t.h)return Promise.reject();var i,n=[];for(i in t.c){var r=new _,a={start:function(t){t.resolve()}.bind(null,r),p:r};t.b[i].push(a),n.push(r),1==t.b[i].length&&a.start()}return Promise.all(n).then(function(){var t;try{e()}catch(i){var n=Promise.reject(new u(2,3,3015,i))}for(t in this.c)Ft(this,t);return n}.bind(t),function(){return Promise.reject()}.bind(t))}function Ft(t,e){t.b[e].shift();var i=t.b[e][0];if(i)try{i.start()}catch(n){i.p.reject(new u(2,3,3015,n)),Ft(t,e)}}function Ht(t,e,i){return i==e||t>=ys&&i==e.split("-")[0]||t>=Ts&&i.split("-")[0]==e.split("-")[0]}function Vt(t){t=t.toLowerCase().split("-");var e=ws[t[0]];return e&&(t[0]=e),t.join("-")}function Kt(t,e,i){var n=t.video;return!(n&&(n.widthe.maxWidth||n.width>i.width||n.heighte.maxHeight||n.height>i.height||n.width*n.heighte.maxPixels)||t.bandwidthe.maxBandwidth)}function qt(t,e,i){var n=!1;return t.variants.forEach(function(t){var r=t.allowedByApplication;t.allowedByApplication=Kt(t,e,i),r!=t.allowedByApplication&&(n=!0)}),n}function Gt(t,e,i){var n=e.video,r=e.audio;for(e=0;en.indexOf(e)||i&&(t.mimeType!=i.mimeType||t.codecs.split(".")[0]!=i.codecs.split(".")[0]))}function Yt(t,e,i){var n=null;return Jt(t.variants).map(function(t){var r;r=t.video&&t.audio?i==t.video.id&&e==t.audio.id:t.video&&i==t.video.id||t.audio&&e==t.audio.id;var a="";t.video&&(a+=t.video.codecs),t.audio&&(""!=a&&(a+=", "),a+=t.audio.codecs,n=t.audio.label);var s=t.audio?t.audio.codecs:null,o=t.video?t.video.codecs:null,u=null;t.video?u=t.video.mimeType:t.audio&&(u=t.audio.mimeType);var h=null;t.audio?h=t.audio.kind:t.video&&(h=t.video.kind);var c=R((t.audio?t.audio.roles:[]).concat(t.video?t.video.roles:[]));return{id:t.id,active:r,type:"variant",bandwidth:t.bandwidth,language:t.language,label:n,kind:h||null,width:t.video?t.video.width:null,height:t.video?t.video.height:null,frameRate:t.video?t.video.frameRate:void 0,mimeType:u,codecs:a,audioCodec:s,videoCodec:o,primary:t.primary,roles:c,videoId:t.video?t.video.id:null,audioId:t.audio?t.audio.id:null}})}function Wt(t,e){return t.textStreams.map(function(t){return{id:t.id,active:e==t.id,type:"text",language:t.language,label:t.label,kind:t.kind,mimeType:t.mimeType,codecs:t.codecs||null,audioCodec:null,videoCodec:null,primary:t.primary,roles:t.roles}})}function zt(t,e){for(var i=0;i=t.periods[i].startTime)return i;return 0}function re(t,e){for(var i=0;ie?"-Infinity":"Infinity":e;return n}})}function he(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__?ce(e):e})}function ce(t){return{length:t.length,start:function(e){return t.start[e]},end:function(e){return t.end[e]}}}function de(t,e,i,n,r){this.J=t,this.l=e,this.B=i,this.G=n,this.v=r,this.c=this.j=this.h=!1,this.A="",this.a=this.i=null,this.b={video:{},player:{}},this.o=0,this.f={},this.g=null}function le(t){for(var e in t.f){var i=t.f[e];delete t.f[e],i.reject(new u(1,7,7e3))}}function fe(t,e){var i=ue(e);t.a.sendMessage("urn:x-cast:com.google.shaka.v2",i,function(){},o)}function pe(){this.nb=new M,this.Ua=this}function me(t,e,i){pe.call(this),this.c=t,this.b=e,this.h=this.f=this.g=this.i=this.j=null,this.a=new de(i,this.fe.bind(this),this.ge.bind(this),this.he.bind(this),this.Vb.bind(this)),ve(this)}function ve(t){t.a.init(),t.h=new D,Es.forEach(function(t){O(this.h,this.c,t,this.ue.bind(this))}.bind(t)),As.forEach(function(t){O(this.h,this.b,t,this.Id.bind(this))}.bind(t)),t.j={};for(var e in t.c)Object.defineProperty(t.j,e,{configurable:!1,enumerable:!0,get:t.te.bind(t,e),set:t.ve.bind(t,e)});t.i={};for(e in t.b)Object.defineProperty(t.i,e,{configurable:!1,enumerable:!0,get:t.Hd.bind(t,e)});t.g=new pe,t.g.Ua=t.j,t.f=new pe,t.f.Ua=t.i}function ge(t,e,i,n){pe.call(this),this.a=t,this.b=e,this.j={video:t,player:e},this.l=i||function(){},this.o=n||function(t){return t},this.i=!1,this.f=!0,this.h=this.g=this.c=null,be(this)}function be(e){var i=cast.receiver.CastReceiverManager.getInstance();i.onSenderConnected=e.jc.bind(e),i.onSenderDisconnected=e.jc.bind(e),i.onSystemVolumeChanged=e.Mc.bind(e),e.g=i.getCastMessageBus("urn:x-cast:com.google.cast.media"),e.g.onMessage=e.hd.bind(e),e.c=i.getCastMessageBus("urn:x-cast:com.google.shaka.v2"),e.c.onMessage=e.vd.bind(e),i.start(),Es.forEach(function(t){this.a.addEventListener(t,this.mc.bind(this,"video"))}.bind(e)),As.forEach(function(t){this.b.addEventListener(t,this.mc.bind(this,"player"))}.bind(e)),cast.__platform__&&cast.__platform__.canDisplayType('video/mp4; codecs="avc1.640028"; width=3840; height=2160')?e.b.Jb(3840,2160):e.b.Jb(1920,1080),e.b.addEventListener("loading",function(){this.f=!1,ye(this)}.bind(e)),e.a.addEventListener("playing",function(){this.f=!1,ye(this)}.bind(e)),e.a.addEventListener("pause",function(){ye(this)}.bind(e)),e.b.addEventListener("unloading",function(){this.f=!0,ye(this)}.bind(e)),e.a.addEventListener("ended",function(){t.setTimeout(function(){this.a&&this.a.ended&&(this.f=!0,ye(this))}.bind(this),5e3)}.bind(e))}function ye(t){Promise.resolve().then(function(){this.dispatchEvent(new oe("caststatuschanged")),Ee(this,0)}.bind(t))}function Te(t,e,i){for(var n in e.player)t.b[n](e.player[n]);t.l(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 oe("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(),Ee(this,0))}.bind(t))}function we(t,e,i,n){t.i&&(t=ue(e),n?i.getCastChannel(n).send(t):i.broadcast(t))}function Ee(t,e,i){var n=Rs,n={mediaSessionId:0,playbackRate:t.a.playbackRate,playerState:t.f?n.IDLE:t.b.la?n.Ac:t.a.paused?n.Bc:n.Cc,currentTime:t.a.currentTime,supportedMediaCommands:15,volume:{level:t.a.volume,muted:t.a.muted}};i&&(n.media=i),we(t,{requestId:e,type:"MEDIA_STATUS",status:[n]},t.g)}function ke(t,e){var i=Se(t,e);return 1!=i.length?null:i[0]}function Se(t,e){return Array.prototype.filter.call(t.childNodes,function(t){return t.tagName==e})}function Ie(t){var e=t.firstChild;return e&&e.nodeType==Node.TEXT_NODE?t.textContent.trim():null}function Ae(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 xe(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 _e(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 Pe(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 Ce(t){return t=Number(t),t%1?null:t}function Ne(t){return t=Number(t),!(t%1)&&0f)if(l+1=f)break;f=Math.ceil((f-p)/m)-1}else{if(1/0==h)break;if(p/r>=h)break;f=Math.ceil((h*r-p)/m)-1}0>>31;var c=2147483647&c,d=n.s.D();if(n.s.I(4),1==s)throw new u(2,3,3006);r.push(new Ke(r.length,e/a,(e+d)/a,function(){return i},t,t+c-1)),e+=d,t+=c}return r}function Ze(t){this.a=t}function ti(t,e){if(t.a.length){var i=t.a[t.a.length-1];i.startTime>e||(t.a[t.a.length-1]=new Ke(i.position,i.startTime,e,i.a,i.X,i.M))}}function ei(t){this.b=t,this.a=new qe(t,0),Ds||(Ds=[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 ii(t){var e=ni(t);if(7=e&&!(i&1<<8-e);e++);if(8t||i&&t>=i?null:Math.floor(t/n)},getSegmentReference:function(t){var e=t*n;return 0>e||i&&e>=i?null:new Ke(t,e,e+n,function(){var i=je(s,u,t+r,o,e*a);return S(h,[i])},0,null)}}}function Ti(t,e){for(var i=[],n=0;ne.l||(e.f=t.setTimeout(e.ie.bind(e),1e3*Math.max(Math.max(3,e.l)-i,0)))}function Li(t,e,i){e=e||{contentType:"",mimeType:"",codecs:"",containsEmsgBoxes:!1,frameRate:void 0},i=i||e.U;var n=Se(t,"BaseURL").map(Ie),r=t.getAttribute("contentType")||e.contentType,a=t.getAttribute("mimeType")||e.mimeType,s=t.getAttribute("codecs")||e.codecs,o=Ae(t,"frameRate",Le)||e.frameRate,u=!!Se(t,"InbandEventStream").length;return r||(r=Ui(a,s)),{U:S(i,n),Ra:ke(t,"SegmentBase")||e.Ra,pa:ke(t,"SegmentList")||e.pa,Sa:ke(t,"SegmentTemplate")||e.Sa,width:Ae(t,"width",Re)||e.width,height:Ae(t,"height",Re)||e.height,contentType:r,mimeType:a,codecs:s,frameRate:o,containsEmsgBoxes:u||e.containsEmsgBoxes,id:t.getAttribute("id")}}function Mi(t){var e=0+(t.Ra?1:0);return e+=t.pa?1:0,(e+=t.Sa?1:0)?(1!=e&&(t.Ra&&(t.pa=null),t.Sa=null),!0):"text"==t.contentType||"application"==t.contentType}function Di(t,e,i,n){return e=S(e,[i]),e=N(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=G(t.data);return t=Date.parse(t),isNaN(t)?0:t-Date.now()})}function Oi(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}),b(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 Di(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 Di(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":return Promise.reject();default:return Promise.reject()}}.bind(t))["catch"](function(){return 0})}function Ui(t,e){return bs[ie(t,e)]?"text":t.split("/")[0]}function ji(t,e,i,n){this.uri=t,this.type=e,this.ga=i,this.segments=n||null}function Bi(t,e,i,n){this.id=t,this.name=e,this.a=i,this.value=n||null}function Fi(t,e){this.name=t,this.value=e}function Hi(t,e,i){return i=i||null,(t=t.getAttribute(e))?t.value:i}function Vi(t,e){this.ga=e,this.uri=t}function Ki(t,e){return t.filter(function(t){return t.name==e})}function qi(t,e){var i=Ki(t,e);return i.length?i[0]:null}function Gi(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 Xi(t){this.b=t,this.a=0}function Yi(t,e){e.lastIndex=t.a;var i=(i=e.exec(t.b))?{position:i.index,length:i[0].length,Td:i}:null;return t.a!=t.b.length&&i&&i.position==t.a?(t.a+=i.length,i.Td):null}function Wi(t){return t.a==t.b.length?null:(t=Yi(t,/[^ \t\n]*/gm))?t[0]:null}function zi(){this.a=0}function $i(t,e,i){e=G(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 u(2,4,4015);e=0;for(var r=[],a=1;ai.length)return null;var n=null,r=t;for(t=null;r&&!(t=r.getAttribute(e))&&(r=r.parentNode,r instanceof Element););if(e=t)for(t=0;tt.Y()?t.na():t.cb())}function Un(e,i){null!=e.f&&(t.clearInterval(e.f),e.f=null),e.g=i,e.a.playbackRate=e.h||0>i?0:i,!e.h&&0>i&&(e.f=t.setInterval(function(){this.a.currentTime+=i/4}.bind(e),250))}function jn(t,e){var i=_t.bind(null,t.a.buffered),n=1*Math.max(t.c.minBufferTime||0,t.l.rebufferingGoal),r=t.c.presentationTimeline,a=r.va(),s=r.Fa(n),o=r.Fa(5),n=r.Fa(n+5);return e>a?a:e=s||i(e)?e:n}function Bn(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 Fn(t,e){var i=t.c.presentationTimeline.na();return ei?i:e)}function Hn(t,e,i,n,r,a){this.a=t,this.g=e,this.A=i,this.l=n,this.h=r,this.B=a,this.c=[],this.j=new D,this.b=!1,this.i=-1,this.f=null,Kn(this)}function Vn(t){var e=x(t);return e.eventElement=t.eventElement,e}function Kn(e){qn(e),e.f=t.setTimeout(e.G.bind(e),250)}function qn(e){e.f&&(t.clearTimeout(e.f),e.f=null)}function Gn(t,e){this.a=e,this.b=t,this.g=null,this.i=1,this.o=Promise.resolve(),this.h=[],this.j={},this.c={},this.f=this.l=this.v=!1}function Xn(t){return t.b.periods[ne(t.b,Dn(t.a.Pa))]}function Yn(t){return V(t.c,function(t){return t.oa||t.stream})}function Wn(t,e){var i={};return i.text=e,Zn(t,i)}function zn(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.oa;a||($n(t,"video",r,!1),i.oa=n)}}else(a=i.oa)&&(i.oa=null,$n(t,"video",a,!0))}}function $n(t,e,i,n){var r=t.c[e];if(!r&&"text"==e&&t.g.ignoreTextStreamFailures)Wn(t,i);else if(r){var a=re(t.b,i);n&&a!=r.xa?Qn(t):(r.oa&&(i.trickModeVideo?(r.oa=i,i=i.trickModeVideo):r.oa=null),(a=t.h[a])&&a.Ma&&(a=t.j[i.id])&&a.Ma&&r.stream!=i&&("text"==e&&Rt(t.a.K,ie(i.mimeType,i.codecs)),r.stream=i,r.eb=!0,n&&(r.ta?r.kb=!0:r.ya?(r.sa=!0,r.kb=!0):(vr(r),pr(t,r,!0)))))}}function Jn(t){var e=Dn(t.a.Pa);Object.keys(t.c).every(function(t){var i=this.a.K;return"text"==t?(t=i.a,t=e>=t.b&&ee?t.a.K.qa(e):t.a.K.qa(Math.pow(2,32))}function nr(t,e){var i=Dn(t.a.Pa),n=e.Ga&&e.ea?t.b.periods[re(t.b,e.Ga)].startTime+e.ea.endTime:Math.max(i,e.rc),r=re(t.b,e.stream),a=ne(t.b,n),s=t.a.K,o=e.type;return"text"==o?(s=s.a,s=null==s.a||s.a=t.b.presentationTimeline.Y()?(e.endOfStream=!0,null):(e.endOfStream=!1,e.xa=a,a!=r?null:s>=o?.5:(n=t.a.K,a=e.type,n="text"==a?n.a.a:xt(Mt(n,a)),e.ea&&e.stream==e.Ga?(a=e.ea.position+1,n=rr(t,e,r,a)):(a=e.ea?e.stream.findSegmentPosition(Math.max(0,t.b.periods[re(t.b,e.Ga)].startTime+e.ea.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=rr(t,e,r,Math.max(0,a-1))),n=s||rr(t,e,r,a))),n?(e.rc=0,ar(t,e,i,r,n),null):1))}function rr(t,e,i,n){return i=t.b.periods[i],(e=e.stream.getSegmentReference(n))?(t=t.b.presentationTimeline,n=t.va(),i.startTime+e.endTimen?null:e):null}function ar(t,e,i,n,r){var a=t.b.periods[n],s=e.stream,o=t.b.periods[n+1],u=null,u=o?o.startTime:t.b.presentationTimeline.Y();n=or(t,e,n,u),e.ya=!0,e.eb=!1,o=fr(t,r),Promise.all([n,o]).then(function(t){if(!this.f&&!this.l)return ur(this,e,i,a,s,r,t[1])}.bind(t)).then(function(){this.f||this.l||(e.ya=!1,e.Gb=!1,e.sa||this.a.Ab(),mr(this,e,0),cr(this,s))}.bind(t))["catch"](function(t){this.f||this.l||(e.ya=!1,this.b.presentationTimeline.$()&&this.g.infiniteRetriesForLiveStreams&&(1001==t.code||1002==t.code||1003==t.code)?"text"==e.type&&this.g.ignoreTextStreamFailures&&1001==t.code?delete this.c.text:(t.severity=1,this.a.onError(t),mr(this,e,4)):3017==t.code?sr(this,e,t):"text"==e.type&&this.g.ignoreTextStreamFailures?delete this.c.text:(e.tb=!0,t.severity=2,this.a.onError(t)))}.bind(t))}function sr(t,e,i){if(!H(t.c).some(function(t){return t!=e&&t.Gb})){var n=Math.round(100*t.i);if(20=i?Promise.resolve():t.a.K.remove(e.type,n,n+i).then(function(){}.bind(t)))}function cr(t,e){if(!t.v&&(t.v=H(t.c).every(function(t){return"text"==t.type||!t.sa&&!t.ta&&t.ea}),t.v)){var i=re(t.b,e);for(t.h[i]||tr(t,i).then(function(){this.a.ac()}.bind(t))["catch"](T),i=0;i=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=Y(e.response)}catch(s){}n(new u(401==e.status||403==e.status?2:1,1,1001,t,e.status,a,r))}},r.onerror=function(){n(new u(1,1,1002,t))},r.ontimeout=function(){n(new u(1,1,1003,t))};for(var a in e.headers)r.setRequestHeader(a,e.headers[a]);r.send(e.body)})}function br(){this.a=null,this.b=[],this.c={}}function yr(t,e,i){return Er(t,e,"readwrite",function(t){t.put(i)})}function Tr(t,e,i){return Er(t,"segment","readwrite",function(t){for(var n=0;n=t.length)return Promise.resolve();var n=t[e++];return Dr(this,n).then(i)}.bind(this);return i()}.bind(t));return t.b={},t.i=Promise.all(i).then(function(){return yr(this.j,"manifest",e)}.bind(t)).then(function(){this.l=[]}.bind(t)),t.i}function Dr(t,e){var i=N(e.uris,t.A);(e.X||null!=e.M)&&(i.headers.Range="bytes="+e.X+"-"+(null==e.M?"":e.M));var n;return t.v.request(1,i).then(function(t){return this.a?(n=t.data.byteLength,this.l.push(e.Hb.key),e.Hb.data=t.data,yr(this.j,"segment",e.Hb)):Promise.reject(new u(2,9,9002))}.bind(t)).then(function(){if(!this.a)return Promise.reject(new u(2,9,9002));null==e.M?(this.a.size+=n,this.f+=e.Rb):this.h+=n;var t=(this.h+this.f)/(this.c+this.g),i=Ir(this.a);this.o.progressCallback(i,t)}.bind(t))}function Or(){this.a=-1}function Ur(t){var e=new Si(null,0);e.qa(t.duration);var i=t.drmInfo?[t.drmInfo]:[];return{presentationTimeline:e,minBufferTime:10,offlineSessionIds:t.sessionIds,periods:t.periods.map(function(t){return Ar(t,i,e)})}}function jr(t){if(/^offline:([0-9]+)$/.exec(t)){var e={uri:t,data:new ArrayBuffer(0),headers:{"content-type":"application/x-offline-manifest"}};return Promise.resolve(e)}if(e=/^offline:[0-9]+\/[0-9]+\/([0-9]+)$/.exec(t)){var i=Number(e[1]),n=Nr();return n?n.init(to).then(function(){return n.get("segment",i)}).then(function(e){return n.m().then(function(){if(!e)throw new u(2,9,9003,i);return{uri:t,data:e.data,headers:{}}})}):Promise.reject(new u(2,9,9e3))}return Promise.reject(new u(2,1,9004,t))}function Br(){this.a=Promise.resolve(),this.b=this.c=this.f=!1,this.i=new Promise(function(t){this.g=t}.bind(this))}function Fr(t){return t.f||(t.a=t.a.then(function(t){return this.c=!0,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 Hr(t,e){pe.call(this),this.O=!1,this.f=t,this.A=null,this.l=new D,this.Qb=new ae,this.Za=this.c=this.h=this.a=this.v=this.g=this.Xa=this.ka=this.N=this.j=this.o=null,this.Dc=1e9,this.Wa=[],this.la=!1,this.$a=!0,this.ma=this.J=null,this.G={},this.Ya=[],this.B={},this.b=$r(this),this.ob={width:1/0,height:1/0},this.i=Jr(),this.Va=0,this.ja=this.b.preferredAudioLanguage,this.Da=this.b.preferredTextLanguage,this.lb=this.mb="",e&&e(this),this.o=new P(this.ee.bind(this)),this.Xa=Kr(this);for(var i=0;ii.length)return t.za(new u(2,4,4012)),{};t.b.abr.manager.setVariants(i),t.b.abr.manager.setTextStreams(n);var a=[];r&&(a=["video","audio"],e.textStreams.length&&a.push("text")),r=Yn(t.a);var s=t.a,o=s.c.video||s.c.audio;if(s=o?s.b.periods[o.xa]:null,e=te(r.audio,r.video,s?s.variants:e.variants)){e.allowedByApplication&&e.allowedByKeySystem||(a.push("audio"),a.push("video"));for(var h in r)e=r[h],"audio"==e.type&&e.language!=i[0].language?a.push(h):"text"==e.type&&0=n.a.length)t=i;else{var r=[];for(t=0;tthis.a?this.b:Math.min(a(this.c),a(this.f))},e("shaka.util.Error",u),u.prototype.toString=function(){return"shaka.util.Error "+JSON.stringify(this,null," ")},u.Severity={RECOVERABLE:1,CRITICAL:2},u.Category={NETWORK:1,TEXT:2,MEDIA:3,MANIFEST:4,STREAMING:5,DRM:6,PLAYER:7,CAST:8,STORAGE:9},u.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,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,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};var cs=/^(?:([^:\/?#.]+):)?(?:\/\/(?:([^\/?#]*)@)?([^\/#?]*?)(?::([0-9]+))?(?=[\/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#(.*))?$/;us=h.prototype,us.aa="",us.Ca="",us.ca="",us.Ka=null,us.W="",us.ua="",us.toString=function(){var t=[],e=this.aa;if(e&&t.push(p(e,ds,!0),":"),e=this.ca){t.push("//");var i=this.Ca;i&&t.push(p(i,ds,!0),"@"),t.push(encodeURIComponent(e).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e=this.Ka,null!=e&&t.push(":",String(e))}return(e=this.W)&&(this.ca&&"/"!=e.charAt(0)&&t.push("/"),t.push(p(e,"/"==e.charAt(0)?fs:ls,!0))),(e=this.a.toString())&&t.push("?",e),(e=this.ua)&&t.push("#",p(e,ms)),t.join("")},us.resolve=function(t){var e=new h(this);"data"===e.aa&&(e=new h);var i=!!t.aa;i?c(e,t.aa):i=!!t.Ca,i?e.Ca=t.Ca:i=!!t.ca,i?e.ca=t.ca:i=null!=t.Ka;var n=t.W;if(i)d(e,t.Ka);else if(i=!!t.W){if("/"!=n.charAt(0))if(this.ca&&!this.W)n="/"+n;else{var r=e.W.lastIndexOf("/");-1!=r&&(n=e.W.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;sn||i&&1e3>n)&&!this.a[e].ia&&(this.a.splice(e,1),t.close()),J(this.B)}},us.Kd=function(){function t(t,e){return"expired"==e}!F(this.A)&&K(this.A,t)&&this.g(new u(2,6,6014)),this.Da(this.A)},us.qd=function(){for(var t=0;t=e||i.endTime<=t)}),null==this.b||e<=this.b||t>=this.a||(t<=this.b&&e>=this.a?this.b=this.a=null:t<=this.b&&ethis.b&&e>=this.a&&(this.a=t)))}.bind(this))},At.prototype.parseInit=function(t){this.Oa(t,0,null,null)},At.prototype.parseMedia=function(t,e){return this.Oa(t,e.periodStart,e.segmentStart,e.segmentEnd)},us=Ct.prototype,us.m=function(){this.h=!0;var t,e=[];for(t in this.b){var i=this.b[t],n=i[0];for(this.b[t]=i.slice(0,1),n&&e.push(n.p["catch"](T)),n=1;n=s.bandwidth/.95&&r<=o&&(i=s)}(n=i)&&n.video&&(e.video=n.video),n&&n.audio&&(e.audio=n.audio)}return-1e)){var n=8e3*e/t,a=t/1e3;i.a+=e,r(i.c,a,n),r(i.f,a,n)}if(null!=this.c&&this.b)t:{if(this.j){if(8e3>Date.now()-this.c)break t}else{if(!(128e3<=this.a.a))break t;this.j=!0}i=this.chooseStreams(["audio","video"]),this.a.getBandwidthEstimate(),this.f(i)}},ae.prototype.segmentDownloaded=ae.prototype.segmentDownloaded,ae.prototype.getBandwidthEstimate=function(){return this.a.getBandwidthEstimate()},ae.prototype.getBandwidthEstimate=ae.prototype.getBandwidthEstimate,ae.prototype.setDefaultEstimate=function(t){this.a.setDefaultEstimate(t)},ae.prototype.setDefaultEstimate=ae.prototype.setDefaultEstimate,ae.prototype.setRestrictions=function(t){this.i=t},ae.prototype.setRestrictions=ae.prototype.setRestrictions,ae.prototype.setVariants=function(t){this.h=t},ae.prototype.setVariants=ae.prototype.setVariants,ae.prototype.setTextStreams=function(t){this.g=t},ae.prototype.setTextStreams=ae.prototype.setTextStreams,oe.prototype.preventDefault=function(){this.cancelable&&(this.defaultPrevented=!0)},oe.prototype.stopImmediatePropagation=function(){this.a=!0},oe.prototype.stopPropagation=function(){};var Es="ended play playing pause pausing ratechange seeked seeking timeupdate volumechange".split(" "),ks="buffered currentTime duration ended loop muted paused playbackRate seeking videoHeight videoWidth volume".split(" "),Ss=["loop","playbackRate"],Is=["pause","play"],As="adaptation buffering emsg error loading unloading texttrackvisibility timelineregionadded timelineregionenter timelineregionexit trackschanged".split(" "),xs="drmInfo getAudioLanguages getConfiguration getExpiration getManifestUri getPlaybackRate getPlayheadTimeAsDate getTextLanguages getTextTracks getTracks getStats getVariantTracks isBuffering isInProgress isLive isTextTrackVisible keySystem seekRange".split(" "),_s=[["getConfiguration","configure"]],Ps=[["isTextTrackVisible","setTextTrackVisibility"]],Cs="addTextTrack cancelTrickPlay configure resetConfiguration selectAudioLanguage selectTextLanguage selectTextTrack selectTrack selectVariantTrack setTextTrackVisibility trickPlay".split(" "),Ns=["load","unload"];us=de.prototype,us.m=function(){return le(this),this.a&&(this.a.leave(function(){},function(){}),this.a=null),this.G=this.B=this.l=null,this.c=this.j=this.h=!1,this.g=this.f=this.b=this.i=null,Promise.resolve()},us.V=function(){return this.c},us.Fb=function(){return this.A},us.init=function(){if(t.chrome&&chrome.cast&&chrome.cast.isAvailable){delete t.__onGCastApiAvailable,this.h=!0,this.l();var e=new chrome.cast.SessionRequest(this.J),e=new chrome.cast.ApiConfig(e,this.gd.bind(this),this.sd.bind(this),"origin_scoped");chrome.cast.initialize(e,function(){},function(){})}else t.__onGCastApiAvailable=function(t){t&&this.init()}.bind(this)},us.Ib=function(t){this.i=t,this.c&&fe(this,{type:"appData",appData:this.i})},us.cast=function(t){return this.h?this.j?this.c?Promise.reject(new u(1,8,8002)):(this.g=new _,chrome.cast.requestSession(this.Bb.bind(this,t),this.cc.bind(this)),this.g):Promise.reject(new u(1,8,8001)):Promise.reject(new u(1,8,8e3))},us.ab=function(){this.c&&(le(this),this.a&&(this.a.stop(function(){},function(){}),this.a=null))},us.get=function(t,e){if("video"==t){if(0<=Is.indexOf(e))return this.pc.bind(this,t,e)}else if("player"==t){if(0<=Cs.indexOf(e))return this.pc.bind(this,t,e);if(0<=Ns.indexOf(e))return this.Pd.bind(this,t,e);if(0<=xs.indexOf(e))return this.lc.bind(this,t,e)}return this.lc(t,e)},us.set=function(t,e,i){this.b[t][e]=i,fe(this,{type:"set",targetName:t,property:e,value:i})},us.Bb=function(t,e){this.a=e,this.a.addUpdateListener(this.dc.bind(this)),this.a.addMessageListener("urn:x-cast:com.google.shaka.v2",this.md.bind(this)),this.dc(),fe(this,{type:"init",initState:t,appData:this.i}),this.g.resolve()},us.cc=function(t){var e=8003;switch(t.code){case"cancel":e=8004;break;case"timeout":e=8005;break;case"receiver_unavailable":e=8006}this.g.reject(new u(2,8,e,t))},us.lc=function(t,e){return this.b[t][e]},us.pc=function(t,e){fe(this,{type:"call",targetName:t,methodName:e,args:Array.prototype.slice.call(arguments,2)})},us.Pd=function(t,e){var i=Array.prototype.slice.call(arguments,2),n=new _,r=this.o.toString();return this.o++,this.f[r]=n,fe(this,{type:"asyncCall",targetName:t,methodName:e,args:i,id:r}),n},us.gd=function(t){var e=this.v();this.g=new _,this.Bb(e,t)},us.sd=function(t){this.j="available"==t,this.l()},us.dc=function(){var t=!!this.a&&"connected"==this.a.status;if(this.c&&!t){this.G();for(var e in this.b)this.b[e]={};le(this)}this.A=(this.c=t)?this.a.receiver.friendlyName:"",this.l()},us.md=function(t,e){var i=he(e);switch(i.type){case"event":var n=i.targetName,r=i.event;this.B(n,new oe(r.type,r));break;case"update":r=i.update;for(n in r){var i=this.b[n]||{};for(a in r[n])i[a]=r[n][a]}break;case"asyncComplete":n=i.id;var a=i.error;if(i=this.f[n],delete this.f[n],i)if(a){n=new u(a.severity,a.category,a.code);for(r in a)n[r]=a[r];i.reject(n)}else i.resolve()}},pe.prototype.addEventListener=function(t,e){this.nb.push(t,e)},pe.prototype.removeEventListener=function(t,e){this.nb.remove(t,e)},pe.prototype.dispatchEvent=function(t){for(var e=this.nb.get(t.type)||[],i=0;ithis.H.byteLength&&Ge();var e=this.H.buffer.slice(this.u,this.u+t);return this.u+=t,new Uint8Array(e)},qe.prototype.readBytes=qe.prototype.La,qe.prototype.I=function(t){this.u+t>this.H.byteLength&&Ge(),this.u+=t},qe.prototype.skip=qe.prototype.I,qe.prototype.Db=function(){for(var t=this.u;this.Z()&&this.H.getUint8(this.u);)this.u+=1;return t=this.H.buffer.slice(t,this.u),this.u+=1,G(t)},qe.prototype.readTerminatedString=qe.prototype.Db,e("shaka.util.Mp4Parser",Xe),Xe.prototype.C=function(t,e){var i=$e(t);return this.b[i]=0,this.a[i]=e,this},Xe.prototype.box=Xe.prototype.C,Xe.prototype.da=function(t,e){var i=$e(t);return this.b[i]=1,this.a[i]=e,this},Xe.prototype.fullBox=Xe.prototype.da,Xe.prototype.parse=function(t){for(t=new qe(new DataView(t),0);t.Z();)this.fb(0,t)},Xe.prototype.parse=Xe.prototype.parse,Xe.prototype.fb=function(t,e){var i=e.u,n=e.D(),r=e.D();switch(n){case 0:n=e.H.byteLength-i;break;case 1:n=e.Qa()}var a=this.a[r];if(a){var s=null,o=null;1==this.b[r]&&(o=e.D(),s=o>>>24,o&=16777215),r=i+n-e.u,r=0=i.startTime&&tt||t>=this.a.length?null:this.a[t]):null},Ze.prototype.get=Ze.prototype.get,Ze.prototype.xb=function(t){for(var e,i,n=[],r=i=0;ie.startTime||(.1t);++e);this.a.splice(0,e)},Ze.prototype.evict=Ze.prototype.qb;var Ds;ei.prototype.Z=function(){return this.a.Z()},si.prototype.parse=function(t,e,i,n){var r;if(e=new ei(new DataView(e)),440786851!=ii(e).id)throw new u(2,3,3008);var a=ii(e);if(408125543!=a.id)throw new u(2,3,3009);for(e=a.a.byteOffset,a=new ei(a.a),r=null;a.Z();){var s=ii(a);if(357149030==s.id){r=s;break}}if(!r)throw new u(2,3,3010);for(a=new ei(r.a),r=1e6,s=null;a.Z();){var o=ii(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 u(2,3,3003);s=s.a.getFloat64(0)}}if(null==s)throw new u(2,3,3011);if(a=r/1e9,r=s*a,t=ii(new ei(new DataView(t))),475249515!=t.id)throw new u(2,3,3007);return oi(t,e,a,r,i,n)};var Os={},Us={};e("shaka.media.ManifestParser.registerParserByExtension",function(t,e){Us[t]=e}),e("shaka.media.ManifestParser.registerParserByMime",function(t,e){Os[t]=e}),e("shaka.media.PresentationTimeline",Si),Si.prototype.Y=function(){return this.a},Si.prototype.getDuration=Si.prototype.Y,Si.prototype.qa=function(t){this.a=t},Si.prototype.setDuration=Si.prototype.qa,Si.prototype.Wc=function(){return this.f},Si.prototype.getPresentationStartTime=Si.prototype.Wc,Si.prototype.wc=function(t){this.h=t},Si.prototype.setClockOffset=Si.prototype.wc,Si.prototype.yc=function(t){this.g=t},Si.prototype.setStatic=Si.prototype.yc,Si.prototype.Xc=function(){return this.c},Si.prototype.getSegmentAvailabilityDuration=Si.prototype.Xc,Si.prototype.xc=function(t){this.c=t},Si.prototype.setSegmentAvailabilityDuration=Si.prototype.xc,Si.prototype.Ia=function(t,e){e.length&&(this.b=e.reduce(function(t,e){return Math.max(t,e.endTime-e.startTime)},this.b))},Si.prototype.notifySegments=Si.prototype.Ia,Si.prototype.yb=function(t){this.b=Math.max(this.b,t)},Si.prototype.notifyMaxSegmentDuration=Si.prototype.yb,Si.prototype.$=function(){return 1/0==this.a&&!this.g},Si.prototype.isLive=Si.prototype.$,Si.prototype.wa=function(){return 1/0!=this.a&&!this.g},Si.prototype.isInProgress=Si.prototype.wa,Si.prototype.na=function(){return this.Fa(0)},Si.prototype.getSegmentAvailabilityStart=Si.prototype.na,Si.prototype.Fa=function(t){if(1/0==this.c)return 0;var e=this.va();return Math.max(0,Math.min(e-this.c+t,e))},Si.prototype.getSafeAvailabilityStart=Si.prototype.Fa,Si.prototype.va=function(){return this.$()||this.wa()?Math.min(Math.max(0,(Date.now()+this.h)/1e3-this.b-this.f),this.a):this.a},Si.prototype.getSegmentAvailabilityEnd=Si.prototype.va,Si.prototype.cb=function(){return Math.max(0,this.va()-(this.$()||this.wa()?this.i:0))},Si.prototype.getSeekRangeEnd=Si.prototype.cb,e("shaka.dash.DashParser",Ii),us=Ii.prototype,us.configure=function(t){this.b=t},us.start=function(t,e){return this.g=[t],this.a=e,Ai(this).then(function(){return this.a&&Ri(this,0),this.c}.bind(this))},us.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()},us.update=function(){Ai(this)["catch"](function(t){this.a&&this.a.onError(t)}.bind(this))},us.onExpirationUpdated=function(){},us.Dd=function(t,e){t.S=Li(e,t.T,null);var i=!1,n=Se(e,"Role"),r=n.map(function(t){return t.getAttribute("value")}).filter(w),a=void 0;"text"==t.S.contentType&&(a="subtitle");for(var s=0;si.length||"data"!=i[0])throw new u(2,1,1004,e);if(i=i.slice(1).join(":").split(","),2>i.length)throw new u(2,1,1004,e);var n=i[0],i=t.decodeURIComponent(i.slice(1).join(",")),n=n.split(";"),r=null;if(1s[0].indexOf("-->")&&(h=s[0],s.splice(0,1));var c=new Xi(s[0]),d=Pn(c),l=Yi(c,/[ \t]+--\x3e[ \t]+/g),f=Pn(c);if(null==d||!l||null==f)throw new u(2,2,2001);if(s=kt(d+o,f+o,s.slice(1).join("\n").trim())){for(Yi(c,/[ \t]+/gm),o=Wi(c);o;)_n(s,o),Yi(c,/[ \t]+/gm),o=Wi(c);null!=h&&(s.id=h),h=s}else h=null}h&&a.push(h)}return a},Et("text/vtt",xn),Et('text/vtt; codecs="vtt"',xn),Cn.prototype.parseInit=function(t){var e=!1;if((new Xe).C("moov",Ye).C("trak",Ye).C("mdia",Ye).da("mdhd",function(t){0==t.version?(t.s.I(4),t.s.I(4),this.a=t.s.D(),t.s.I(4)):(t.s.I(8),t.s.I(8),this.a=t.s.D(),t.s.I(8)),t.s.I(4)}.bind(this)).C("minf",Ye).C("stbl",Ye).da("stsd",We).C("wvtt",function(){e=!0}).parse(t),!this.a)throw new u(2,2,2008);if(!e)throw new u(2,2,2008)},Cn.prototype.parseMedia=function(t,e){var i=0,n=[],r=[],a=[],s=!1,o=!1,h=!1;if((new Xe).C("moof",Ye).C("traf",Ye).da("tfdt",function(t){s=!0,i=t.version?t.s.Qa():t.s.D()}).da("trun",function(t){o=!0;var e=t.version,i=t.Nc;t=t.s;var r=t.D();1&i&&t.I(4),4&i&&t.I(4);for(var a=[],s=0;sthis.g?0:this.g)&&Un(this,this.a.playbackRate)},us.fc=function(){var t=On(this);.001>Math.abs(this.a.currentTime-t)?(O(this.b,this.a,"seeking",this.ic.bind(this)),O(this.b,this.a,"playing",this.gc.bind(this))):(U(this.b,this.a,"seeking",this.td.bind(this)),this.a.currentTime=t)},us.td=function(){O(this.b,this.a,"seeking",this.ic.bind(this)),O(this.b,this.a,"playing",this.gc.bind(this))},us.hc=function(){if(this.a.readyState){this.a.readyState!=this.G&&(this.i=!1,this.G=this.a.readyState);var t=this.l.smallGapLimit,e=this.a.currentTime,i=this.a.buffered;t:{if(i&&i.length&&!(1==i.length&&1e-6>i.end(0)-i.start(0))){var n=.1;/(Edge\/|Trident\/|Tizen)/.test(navigator.userAgent)&&(n=.5);for(var r=0;re&&(!r||i.end(r-1)-e<=n)){n=r;break t}}n=null}if(null==n){if(3>this.a.readyState&&0=i.start(n)&&e=this.c.presentationTimeline.cb()))){var a=r-e,t=a<=t,s=!1;t||this.i||(this.i=!0,a=new oe("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),Bn(this,e,r))}}},us.ic=function(){this.o=!1;var t=this.a.currentTime,e=jn(this,t);.001this.a.currentTime?1:e.info.endTime=this.g.presentationTimeline.va()-.1||this.a.ended;if(this.b){var i=1*Math.max(this.g.minBufferTime||0,this.A.rebufferingGoal);(e||t>=i)&&0!=this.b&&(this.b=!1,this.l(!1))}else!e&&.5>t&&1!=this.b&&(this.b=!0,this.l(!0));this.c.forEach(this.o.bind(this,!1))},us=Gn.prototype,us.m=function(){for(var t in this.c)vr(this.c[t]);return this.g=this.c=this.j=this.h=this.o=this.b=this.a=null,this.f=!0,Promise.resolve()},us.configure=function(t){this.g=t},us.init=function(){var t=this.a.bc(this.b.periods[ne(this.b,Dn(this.a.Pa))]);return F(t)?Promise.reject(new u(2,5,5005)):Zn(this,t).then(function(){this.a&&this.a.jd&&this.a.jd()}.bind(this))},us.le=function(t){if(!this.f&&!t.ya&&null!=t.ra&&!t.ta)if(t.ra=null,t.sa)pr(this,t,t.kb);else{try{var e=nr(this,t);null!=e&&(mr(this,t,e),t.tb=!1)}catch(i){return void this.a.onError(i)}e=H(this.c),dr(this,t),e.every(function(t){return t.endOfStream})&&this.a.K.endOfStream().then(function(){this.b.presentationTimeline.qa(this.a.K.Y())}.bind(this))}},us.Ed=function(t,e,i){var n=i.s.Db(),r=i.s.Db(),a=i.s.D(),s=i.s.D(),o=i.s.D(),u=i.s.D();i=i.s.La(i.s.H.byteLength-i.s.u),t=t.startTime+e.startTime+s/a,"urn:mpeg:dash:event:2012"==n?this.a.kd():this.a.onEvent(new oe("emsg",{detail:{startTime:t,endTime:t+o/a,schemeIdUri:n,value:r,timescale:a,presentationTimeDelta:s,eventDuration:o,id:u,messageData:i}}))},e("shaka.net.HttpPlugin",gr),gs.http=gr,gs.https=gr,us=br.prototype,us.init=function(t,e){return kr(this,t,e).then(function(){var e=Object.keys(t);return Promise.all(e.map(function(t){return wr(this,t).then(function(e){this.c[t]=e}.bind(this))}.bind(this)))}.bind(this))},us.m=function(){return Promise.all(this.b.map(function(t){try{t.transaction.abort()}catch(e){}return t.L["catch"](T)})).then(function(){this.a&&(this.a.close(),this.a=null)}.bind(this))},us.get=function(t,e){var i;return Er(this,t,"readonly",function(t){i=t.get(e)}).then(function(){return i.result})},us.forEach=function(t,e){return Er(this,t,"readonly",function(t){t.openCursor().onsuccess=function(t){(t=t.target.result)&&(e(t.value),t["continue"]())}})},us.remove=function(t,e){return Er(this,t,"readwrite",function(t){t["delete"](e)})};var to={manifest:"key",segment:"key"};Rr.prototype.m=function(){var t=this.j,e=this.l,i=this.i||Promise.resolve();return e.length&&(i=i.then(function(){return Tr(t,e)})),this.b={},this.l=[],this.i=this.a=this.A=this.v=this.j=this.o=null,i},us=Or.prototype,us.configure=function(){},us.start=function(t){var e=/^offline:([0-9]+)$/.exec(t);if(!e)return Promise.reject(new u(2,1,9004,t));var i=Number(e[1]),n=Nr();return this.a=i,n?n.init(to).then(function(){return n.get("manifest",i)}).then(function(t){if(!t)throw new u(2,9,9003,i);return Ur(t)}).then(function(t){return n.m().then(function(){return t})},function(t){return n.m().then(function(){throw t})}):Promise.reject(new u(2,9,9e3))},us.stop=function(){return Promise.resolve()},us.update=function(){},us.onExpirationUpdated=function(t,e){var i=Nr();i.init(to).then(function(){return i.get("manifest",this.a)}.bind(this)).then(function(n){if(n&&!(0>n.sessionIds.indexOf(t))&&(void 0==n.expiration||n.expiration>e))return n.expiration=e,yr(i,"manifest",n)})["catch"](function(){}).then(function(){return i.m()})},Os["application/x-offline-manifest"]=Or,e("shaka.offline.OfflineScheme",jr),gs.offline=jr,Br.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},Br.prototype.cancel=function(t){return this.c?Promise.resolve():(this.b=!0,this.h=t,this.i)},i(Hr),e("shaka.Player",Hr),Hr.prototype.m=function(){this.O=!0;var t=Promise.resolve();return this.J&&(t=this.J.cancel(new u(2,7,7e3))),t.then(function(){var t=Promise.all([this.ma,Yr(this),this.l?this.l.m():null,this.o?this.o.m():null]);return this.b=this.o=this.Qb=this.l=this.A=this.f=null,t}.bind(this))},Hr.prototype.destroy=Hr.prototype.m,Hr.version="v2.1.5";var eo={};Hr.registerSupportPlugin=function(t,e){eo[t]=e},Hr.isBrowserSupported=function(){return!!(t.Promise&&t.Uint8Array&&Array.prototype.forEach&&t.MediaSource&&t.MediaSource.isTypeSupported&&t.MediaKeys&&t.navigator&&t.navigator.requestMediaKeySystemAccess&&t.MediaKeySystemAccess&&t.MediaKeySystemAccess.prototype.getConfiguration)},Hr.probeSupport=function(){return bt().then(function(t){var e=Ei(),i=Nt();t={manifest:e,media:i,drm:t};for(var n in eo)t[n]=eo[n]();return t})},Hr.prototype.load=function(t,e,i){var n=this.ib(),r=new Br;this.J=r,this.dispatchEvent(new oe("loading"));var a=Date.now();return Fr(r.then(function(){return n}).then(function(){return this.i=Jr(),O(this.l,this.f,"playing",this.Ta.bind(this)),O(this.l,this.f,"pause",this.Ta.bind(this)),O(this.l,this.f,"ended",this.Ta.bind(this)),ki(t,this.o,this.b.manifest.retryParameters,i)}.bind(this)).then(function(e){return this.h=new e,this.h.configure(this.b.manifest),e={networkingEngine:this.o,filterPeriod:this.gb.bind(this),onTimelineRegionAdded:this.xd.bind(this),onEvent:this.hb.bind(this),onError:this.za.bind(this)},2this.Wa.indexOf(t.id)}.bind(this))},Hr.prototype.getTextTracks=Hr.prototype.Xb,Hr.prototype.tc=function(t){if(this.a&&(t=$t(Xn(this.a),t))){Gr(this,t,!1);var e={};e.text=t,Qr(this,e,!0)}},Hr.prototype.selectTextTrack=Hr.prototype.tc,Hr.prototype.uc=function(t,e){if(this.a){var i={},n=zt(Xn(this.a),t),r=Yn(this.a);if(n){if(!n.allowedByApplication||!n.allowedByKeySystem)return;n.audio&&(Xr(this,n.audio),n.audio!=r.audio&&(i.audio=n.audio)),n.video&&(Xr(this,n.video),n.video!=r.video&&(i.video=n.video))}H(i).forEach(function(t){Gr(this,t,!1)}.bind(this)),(n=r.text)&&(i.text=n),Qr(this,i,e)}},Hr.prototype.selectVariantTrack=Hr.prototype.uc,Hr.prototype.Pc=function(){return this.a?Jt(Xn(this.a).variants).map(function(t){return t.language}).filter(k):[]},Hr.prototype.getAudioLanguages=Hr.prototype.Pc,Hr.prototype.Yc=function(){return this.a?Xn(this.a).textStreams.map(function(t){return t.language}).filter(k):[]},Hr.prototype.getTextLanguages=Hr.prototype.Yc,Hr.prototype.Vd=function(t,e){if(this.a){var i=Xn(this.a);this.ja=t,this.mb=e||"",ia(this,i)}},Hr.prototype.selectAudioLanguage=Hr.prototype.Vd,Hr.prototype.Wd=function(t,e){if(this.a){var i=Xn(this.a);this.Da=t,this.lb=e||"",ia(this,i)}},Hr.prototype.selectTextLanguage=Hr.prototype.Wd,Hr.prototype.bd=function(){return"showing"==this.A.mode},Hr.prototype.isTextTrackVisible=Hr.prototype.bd,Hr.prototype.Zd=function(t){this.A.mode=t?"showing":"hidden",aa(this)},Hr.prototype.setTextTrackVisibility=Hr.prototype.Zd,Hr.prototype.Uc=function(){return this.c?new Date(1e3*this.c.presentationTimeline.f+1e3*this.f.currentTime):null},Hr.prototype.getPlayheadTimeAsDate=Hr.prototype.Uc,Hr.prototype.getStats=function(){Zr(this),this.Ta();var t=null,e=null,i=this.f&&this.f.getVideoPlaybackQuality?this.f.getVideoPlaybackQuality():{};return this.g&&this.c&&(t=ne(this.c,Dn(this.g)),e=this.B[t],e=ee(e.audio,e.video,this.c.periods[t].variants),t=e.video||{}),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.b.abr.manager.getBandwidthEstimate(),loadLatency:this.i.loadLatency,playTime:this.i.playTime,bufferingTime:this.i.bufferingTime,switchHistory:x(this.i.switchHistory),stateHistory:x(this.i.stateHistory)}},Hr.prototype.getStats=Hr.prototype.getStats,Hr.prototype.addTextTrack=function(t,e,i,n,r,a){if(!this.a)return Promise.reject();for(var s,o=Xn(this.a),u=0;uJt(t.variants).length,!e)throw new u(2,4,4011);if(t)throw new u(2,4,4012)},us.ee=function(t,e){this.b.abr.manager.segmentDownloaded(t,e)},us.zc=function(t){if(Zr(this),this.la=t,this.Ta(),this.g){var e=this.g;t!=e.h&&(e.h=t,Un(e,e.g))}this.dispatchEvent(new oe("buffering",{buffering:t}))},us.ae=function(){ra(this)},us.Ta=function(){if(!this.O){var t=this.la?"buffering":this.f.ended?"ended":this.f.paused?"paused":"playing",e=Date.now()/1e3;if(this.i.stateHistory.length){var i=this.i.stateHistory[this.i.stateHistory.length-1];if(i.duration=e-i.timestamp,t==i.state)return}this.i.stateHistory.push({timestamp:e,state:t,duration:0})}},us.de=function(){if(this.v){var t=this.v;t.c.forEach(t.o.bind(t,!0))}this.a&&Jn(this.a)},us.ed=function(t){this.$a=!0,this.b.abr.manager.disable();var e=Qt(t,this.ja,void 0,this.mb),i=Zt(t,this.Da,void 0,this.lb);t=ea(this,t,e,i,!0);for(var n in this.G)t[n]=this.G[n].stream;this.G={};for(n in t)Gr(this,t[n],!0);return t},us.Gc=function(){this.$a=!1,this.b.abr.enabled&&this.b.abr.manager.enable();for(var t in this.G){var e=this.G[t];$n(this.a,t,e.stream,e.Kc)}this.G={}},us.ld=function(){this.h&&this.h.update&&this.h.update()},us.ud=function(){this.g&&this.g.Ab()},us.Lb=function(t,e){var i,n=Yn(this.a);for(i in t){var r=t[i];n[i]!=r?Gr(this,r,!0):delete t[i]}if(!F(t)&&this.a){for(i in t)$n(this.a,i,t[i],e||!1);na(this)}},us.za=function(t){this.O||this.dispatchEvent(new oe("error",{detail:t}))},us.xd=function(t){this.v?this.v.v(t):this.Ya.push(t)},us.hb=function(t){this.dispatchEvent(t)},us.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.za(new u(2,3,3016,t,e,this.f.error.message))}}},us.ce=function(t){var e=["output-restricted","internal-error"],i=Xn(this.a),n=!1,r=1==Object.keys(t).length&&"00"==Object.keys(t)[0];i.variants.forEach(function(i){var a=[];i.audio&&a.push(i.audio),i.video&&a.push(i.video),a.forEach(function(a){var s=i.allowedByKeySystem;a.keyId&&(a=t[r?"00":a.keyId],i.allowedByKeySystem=!!a&&0>e.indexOf(a)),s!=i.allowedByKeySystem&&(n=!0)})});var a=Yn(this.a);(a=te(a.audio,a.video,i.variants))&&!a.allowedByKeySystem&&ia(this,i),n&&ra(this)},us.be=function(t,e){this.h&&this.h.onExpirationUpdated&&this.h.onExpirationUpdated(t,e),this.dispatchEvent(new oe("expirationupdated"))},e("shaka.offline.Storage",sa),sa.support=oa,sa.prototype.m=function(){var t=this.a,e=this.h?this.h.m()["catch"](function(){}).then(function(){if(t)return t.m()}):Promise.resolve();return this.i=this.f=this.h=this.a=null,e},sa.prototype.destroy=sa.prototype.m,sa.prototype.configure=function(t){A(this.i,t,ha(this),{},"")},sa.prototype.configure=sa.prototype.configure,sa.prototype.me=function(t,e,i){function n(t){a=t}if(this.v)return Promise.reject(new u(2,9,9006));this.v=!0;var r,a=null;return ca(this).then(function(){return pa(this),ua(this,t,n,i)}.bind(this)).then(function(i){if(pa(this),this.c=i.manifest,this.b=i.Lc,this.c.presentationTimeline.$()||this.c.presentationTimeline.wa())throw new u(2,9,9005,t);this.c.periods.forEach(this.o.bind(this)),this.g=this.a.c.manifest++,this.l=0,i=this.c.periods.map(this.B.bind(this));var n=this.b.b,a=ot(this.b);if(n){if(!a.length)throw new u(2,9,9007,t);n.initData=[]}return r={key:this.g,originalManifestUri:t,duration:this.l,size:0,expiration:this.b.bb(),periods:i,sessionIds:a,drmInfo:n,appMetadata:e},Mr(this.h,r)}.bind(this)).then(function(){if(pa(this),a)throw a;return da(this)}.bind(this)).then(function(){return Ir(r)}.bind(this))["catch"](function(t){return da(this)["catch"](T).then(function(){throw t})}.bind(this))},sa.prototype.store=sa.prototype.me,sa.prototype.remove=function(t){function e(t){6013!=t.code&&(s=t)}var i=t.offlineUri,n=/^offline:([0-9]+)$/.exec(i);if(!n)return Promise.reject(new u(2,9,9004,i));var r,a,s=null,o=Number(n[1]);return ca(this).then(function(){return pa(this),this.a.get("manifest",o)}.bind(this)).then(function(t){if(pa(this),!t)throw new u(2,9,9003,i);return r=t,t=Ur(r),a=new nt(this.f.o,e,function(){},function(){}),a.configure(this.f.getConfiguration().drm),a.init(t,!0)}.bind(this)).then(function(){return at(a,r.sessionIds)}.bind(this)).then(function(){return a.m()}.bind(this)).then(function(){if(pa(this),s)throw s;var e=r.periods.map(function(t){return t.streams.map(function(t){var e=t.segments.map(function(t){return t=/^offline:[0-9]+\/[0-9]+\/([0-9]+)$/.exec(t.uri),Number(t[1])});return t.initSegmentUri&&(t=/^offline:[0-9]+\/[0-9]+\/([0-9]+)$/.exec(t.initSegmentUri),e.push(Number(t[1]))),e}).reduce(y,[])}).reduce(y,[]),i=0,n=e.length,a=this.i.progressCallback;return Tr(this.a,e,function(){i++,a(t,i/n)})}.bind(this)).then(function(){return pa(this),this.i.progressCallback(t,1),this.a.remove("manifest",o)}.bind(this))},sa.prototype.remove=sa.prototype.remove,sa.prototype.list=function(){var t=[];return ca(this).then(function(){return pa(this),this.a.forEach("manifest",function(e){t.push(Ir(e))})}.bind(this)).then(function(){return t})},sa.prototype.list=sa.prototype.list,sa.prototype.A=function(t){for(var e,i=[],n=Vt(this.f.getConfiguration().preferredAudioLanguage),r=[0,ys,Ts],a=t.filter(function(t){return"variant"==t.type}),r=r.map(function(t){return a.filter(function(e){return e=Vt(e.language),Ht(t,n,e)})}),s=0;s=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},sa.prototype.o=function(t){var e={};if(this.j){var i=this.j.filter(function(t){return"variant"==t.type}),n=null;i.length&&(n=zt(t,i[0])),n&&(n.video&&(e.video=n.video),n.audio&&(e.audio=n.audio))}Gt(this.b,e,t),qt(t,this.f.getConfiguration().restrictions,{width:1/0,height:1/0})},sa.prototype.B=function(t){var e,i,n=Yt(t,null,null),r=Wt(t,null),n=this.i.trackSelectionCallback(n.concat(r));for(this.j||(this.j=n,this.c.periods.forEach(this.o.bind(this))),r=n.length-1;0navigator.userAgent.indexOf("Trident/")||(no=HTMLInputElement.prototype.addEventListener,HTMLInputElement.prototype.addEventListener=ga)}),ma(function(){if(4503599627370497!=Math.round(4503599627370497)){var t=Math.round;Math.round=function(e){var i=e;return 4503599627370496>=e&&(i=t(e)),i}}}),ba.prototype.c=function(t){if(!(1e.indexOf("Apple")||(0<=i.indexOf("Version/8")?t.MediaSource=null:0<=i.indexOf("Version/9")?Ga():0<=i.indexOf("Version/10")&&(Ga(),Xa()))}});var oo=0;za.prototype.then=function(t,e){var i=new za;switch(this.Ba){case 1:ts(this,i,t);break;case 2:ts(this,i,e);break;case oo:this.c.push({L:i,pb:t}),this.b.push({L:i,pb:e})}return i},za.prototype["catch"]=function(t){return this.then(void 0,t)},za.prototype.fa=function(t){if(this.Ba==oo){for(this.jb=t,this.Ba=1,t=0;t