;OATH = window.OATH || {};OATH.VideoPlatform = OATH.VideoPlatform || {};OATH.VideoPlatform.PlayerHosting = {"app":"omega","bucket":null,"colo":"sg3","dbColo":"ap-southeast-1","env":"prod","ver":"8.3.24","config":null,"expiry":600,"req":{"ypv":null,"path":"/p/oath/js/1/video-time.gif","usm":{"bucket":null,"config":null}},"type":"oath-player-desktop.js","g":[],"gv":2,"lang":"en-us"};

/*! For license information please see oath-player-desktop.js.LICENSE.txt */
(function(){var __webpack_modules__={3661:function(t,i,n){"use strict";var e=n(6837);function r(t,i){var n=this;n._=[],n.length=0,n._t=t||Uint8Array,i&&n.set(i)}t.exports=r,r.prototype.destroy=function(){this._=[],this.length=0},r.prototype.set=function(t){var i=this;i._.push(t),i.length=i.length+t.length},r.prototype.get=function(t){var i=this;if(e.isNullOrUndefined(t)||t<0||t>i.length)throw new Error("[DataManager] Array position out of bounds");for(var n=0,r=0,s=null,o=0;o<i._.length;o++){var u=i._[o];if(t<(n+=u.length)){s=u[t-r];break}r+=u.length}return s},r.prototype.subArray=function(t,i){var n=this;if((e.isNullOrUndefined(i)||i>n.length)&&(i=n.length),e.isNullOrUndefined(t)&&(t=0),t>=i)return new n._t(0);for(var r=i-t,s=new n._t(r),o=0,u=0,h=0,a=0;a<n._.length;a++){var c=n._[a];if(h+=c.length,o>0){if(i<=h){s.set(c.subarray(0,r-o),o);break}s.set(c.subarray(0),o),o+=c.length}else{if(t<h&&i<=h){s=c.subarray(t-u,i-u);break}if(t<h){var f=t-u;s.set(c.subarray(f)),o=c.length-f}}u+=c.length}return s}},2999:function(t){"use strict";function i(t){var i=this;i.name=t||"unnamed",i._i={},i.qi=0}t.exports=i,i.prototype.addEventListener=function(t,i,n){var e=this;if(e._i){e._i[t]||(e._i[t]={});var r=t+"_"+ ++e.qi;return e._i[t][r]={subscriber:n,cb:i},r}},i.prototype.removeEventListener=function(t,i){var n=this;n._i&&t in n._i&&n._i[t].hasOwnProperty(i)&&delete n._i[t][i]},i.prototype.removeEventListeners=function(t){var i=this;i._i&&t&&Object.keys(t).forEach((function(n){var e=t[n];n in i._i&&i._i[n].hasOwnProperty(e)&&(delete i._i[n][e],delete t[n])}))},i.prototype.publish=function(t){var i=this;if(i._i&&t in i._i){var n=i._i[t],e=arguments;Object.keys(n).forEach((function(t){var i=n[t];if(i)try{i.cb&&"function"==typeof i.cb&&i.cb.apply(i.subscriber,Array.prototype.slice.call(e,1))}catch(t){}}))}},i.prototype.destroy=function(){this._i=null}},2990:function(t){"use strict";var i=t.exports={};i.inherits=function(t,i){t.super_=i,t.prototype=Object.create(i.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})},i.guid=function(){function t(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return t()+t()+"-"+t()+"-"+t()+"-"+t()+"-"+t()+t()+t()},i.base64ToBuffer=function(t){return new Uint8Array(atob(t).split("").map((function(t){return t.charCodeAt(0)})))},i.arrayToUint8Array=function(t){for(var i=t.length,n=new Uint8Array(i),e=new DataView(n.buffer),r=0;r<i;r++)e.setUint8(r,t[r]);return n},i.isDrmItemContained=function(t,i){if(!t||!i||0===i.length)return!1;for(var n=0;n<i.length;n++)if(t.widevine.pssh===i[n].widevine.pssh)return!0;return!1},i.isAbsoluteUrl=function(t){return 0===t.indexOf("http")},i.isUplynk=function(t){return!(!t||!t.length)&&((t=t.toLowerCase()).indexOf("uplynk.com")>-1||t.indexOf("downlynk.com")>-1||t.indexOf("uplynk.localhost")>-1||t.indexOf("downlynk.localhost")>-1)},i.isWithCreds=function(t){return t&&t.length&&i.isUplynk(t)&&t.indexOf("expand=finance")>-1}},6837:function(t,i){i.isArray=function(t){return Array.isArray(t)},i.isBoolean=function(t){return"boolean"==typeof t},i.isNullOrUndefined=function(t){return null==t},i.isNumber=function(t){return"number"==typeof t&&!isNaN(t)},i.isString=function(t){return"string"==typeof t},i.isObject=function(t){return"[object Object]"===(i=t,Object.prototype.toString.call(i));var i},i.isFunction=function(t){return"function"==typeof t},i.deepCopy=function(t){var n={};return i.isNullOrUndefined(t)?t:(Object.keys(t).forEach((function(e){i.isArray(t[e])?n[e]=t[e].slice():i.isObject(t[e])?n[e]=i.deepCopy(t[e]):n[e]=t[e]})),n)}},2576:function(t,i){"use strict";function n(){var t=this;try{t._n=t.getWindow()}catch(i){t._n=null}t._e=!1,t._n&&t._n.performance&&"function"==typeof t._n.performance.clearResourceTimings&&"function"==typeof t._n.performance.getEntriesByName&&(t._e=!0,t._n.performance.onresourcetimingbufferfull=t._r.bind(t))}t.exports=n,i.entryTypes=["mark","measure","navigation","frame","resource","server"],n.prototype.getWindow=function(){return window},n.prototype._r=function(){this._e&&this._n.performance.clearResourceTimings()},n.prototype.getPerformanceTiming=function(t,n,e){var r,s=this,o={};if(!t||!n&&!e)return null;if(e&&i.entryTypes.indexOf(e)<0)return null;if(!s._e)return null;if(!(r=n?s._n.performance.getEntriesByName(n,e||void 0):s._n.performance.getEntriesByType(e))||!r.length)return null;var u=r[r.length-1];return t.forEach((function(t){o[t]=u[t]})),o},n.prototype.destroy=function(){var t=this;t._e&&t._n&&(t._n.performance.onresourcetimingbufferfull=null),t._n=null,t._e=!1}},729:function(t){"use strict";function i(){var t=this;t.LOCALSTORAGE_PREFIX="com.yahoo.yep",t._s=t.do()}t.exports=i,i.prototype.do=function(){try{return"localStorage"in window&&null!==window.localStorage}catch(t){return!1}},i.prototype.writeProperty=function(t,i){this._s&&(i=JSON.stringify(i),t=this.LOCALSTORAGE_PREFIX+"."+t,window.localStorage.setItem(t,i))},i.prototype.readProperty=function(t){if(!t||!t.length)return null;if(this._s){t=this.LOCALSTORAGE_PREFIX+"."+t;var i=JSON.parse(window.localStorage.getItem(t));return i||null}return null}},2849:function(t,i,n){"use strict";var e=n(3576);i.apply=function(){r()};var r=function(){function t(t,i){i=i||{bubbles:!1,cancelable:!1,detail:void 0};var n=window.document.createEvent("CustomEvent");return n.initCustomEvent(t,i.bubbles,i.cancelable,i.detail),n}!e.ie&&window.CustomEvent||(t.prototype=window.Event.prototype,window.CustomEvent=t)}},902:function(t,i,n){"use strict";t.exports=r;var e=n(2999);function r(t,i){var n=this;if(!t||isNaN(t))throw new Error("Invalid Argument: No delay");e.call(n,n.constructor.name),n.delay=Math.max(t,20),n.repeatCount=i>0?i:Number.POSITIVE_INFINITY,n.currentCount=0,n.running=!1,n.startTime=0,n._o=null,n._u={},n._h={}}n(2990).inherits(r,e),r.prototype.destroy=function(){var t=this;t.reset(),t._u={},e.prototype.removeEventListeners.call(t,t._h),e.prototype.destroy.call(t)},r.prototype.addEventListener=function(t,i){if(!i)throw new Error("Invalid Argument: No context");var n=e.prototype.addEventListener.call(this,"timedOut",t,i);this._h.timedOut=n},r.prototype.removeEventListener=function(t,i){if(!i)throw new Error("Invalid Argument: No context");e.removeEventListeners(this._h)},r.prototype.start=function(){var t=this;t._o||t.running||(t._o=setInterval((function(){t.currentCount++,t.currentCount>=t.repeatCount&&t.stop(),t.publish("timedOut"),t.startTime=Date.now()}),t.delay),t.startTime=Date.now(),t.running=!0)},r.prototype.stop=function(){var t=this;t._o&&t.running&&(clearInterval(t._o),t._o=null,t.running=!1,t.startTime=0)},r.prototype.reset=function(){var t=this;t.stop(),t.currentCount=0,t.startTime=0}},3576:function(t,i,n){"use strict";t.exports=n(3093).userAgent},3093:function(t,i,n){"use strict";t.exports={userAgent:n(7870),capabilities:n(895)}},895:function(t,i,n){"use strict";var e=n(7870),r={wifi:!0,broadband:!0,dsl:!0,cable:!0};function s(){if("undefined"!=typeof navigator)return(navigator&&(navigator.connection||navigator.mozConnection||navigator.webkitConnection)||{}).type}function o(){if(!e.mobile)return!0;var t=e.android&&e.chrome>=50,i=e.ios&&!e.iosWebView&&e.safari>=10;return t||i}t.exports={getConnectionType:s,isAutoplaySupported:o,isAutoplayAllowed:function(t){return!e.mobile||!(!(t=(s()||t||"").replace(/^cs_/i,"").toLowerCase())||!r[t])&&o()}}},7870:function(t,i){"use strict";var n="undefined"!=typeof navigator?navigator.userAgent.toLowerCase().replace(/<[A-Za-z]+.*?(\/>|>.*?<\/[A-Za-z]+>)|javascript:/g,""):"",e="undefined"!=typeof window?window:{},r=function(t){if(null===t)return!1;var i=t[1];return parseFloat(i.replace("_",".").split(".",2).join("."))||1},s=function(t){for(var i=(e&&e.location&&e.location.search&&e.location.search.substring(1)||"").split("&"),n=0;n<i.length;n++){var r=i[n].split("=");if(decodeURIComponent(r[0])===t)return decodeURIComponent(r[1])}return null};if(i.ua=n,i.chromium=r(/chromium\/([^\s]*)/.exec(n)),i.edge=r(/edge\/([^\s]*)/.exec(n)),i.opera=/opr\/|opera\//.test(n),i.chrome=!i.chromium&&!i.edge&&!i.opera&&(r(/chrome\/([^\s]*)/.exec(n))||r(/crios\/([^\s]*)/.exec(n))),i.ie=r(/msie ([^;]*)/.exec(n))||r(/trident.*; rv:([0-9.]+)/.exec(n)),i.firefox=!i.ie&&r(/firefox\/([^\s]*)/.exec(n)),i.android=/android/.test(n),i.androidTablet=i.android&&!/mobile/.test(n),i.htc_one=/htc_one/.test(n),i.vizio=/Vizio/i.test(n)||"vizio"===s("man"),i.tivo=/TiVo/i.test(n),i.fios=/Verizon_STB|\(Verizon.*VMS1100|\(Verizon.*IPC1100|\(Verizon.*IPC3200/i.test(n),i.firetv=i.android&&/amazonwebappplatform/.test(n)&&/aft/.test(n),i.lg=/web0s/.test(n),i.tizen=/tizen/.test(n),i.orsay=/smarttv/.test(n)&&!i.tizen&&!i.lg,i.samsung=i.orsay||i.tizen,i.sony=/(sony)/.test(n),i.ps4=/(playstation 4)/.test(n),i.ios=/(ipad|iphone|ipod)/.test(n),i.iphone=/(iphone|ipod)/.test(n)&&!/ipad/.test(n),i.ipad=i.ios&&!i.iphone,i.androidBrowser=!i.chrome&&/android/.test(n),i.androidVersion=r(/android\s([0-9.]*)/.exec(n)),i.safari=!i.chrome&&!i.chromium&&!i.android&&/safari\/([^\s]*)/.test(n)&&r(/version\/([^\s]*)/.exec(n)),i.iosWebView=i.ios&&!navigator.standalone&&!i.safari,i.iosVersion=i.ios&&r(/\bos ((\d+_?){2,3})\s/.exec(n)),i.mobile=i.ios||i.android&&!i.firetv,i.safariDesktop=!i.mobile&&i.safari,i.tv=i.vizio||i.tivo||i.firetv||i.samsung||i.sony||i.ps4||i.lg||i.fios,i.desktop=!i.mobile&&!i.tv,i.phantomJS=e.window&&e.window._a,i.tv)if(i.vizio)i.os="vizio",i.model=s("class")||s("soc");else if(i.tivo)i.os="tivo",/tcd849/.test(n)?(i.model="series6",i.version="tcd849"):/tcd8d9/.test(n)?(i.model="series6",i.version="tcd8d9"):/tcd8f9/.test(n)?(i.model="series6",i.version="tcd8f9"):/tcd8/.test(n)?(i.model="series5",i.version="tcd8"):/tcdd/.test(n)?(i.model="series5",i.version="tcdd"):i.model="series4";else if(i.firetv)i.os="firetv",/aftb/.test(n)?i.model="aftb":/afts/.test(n)?i.model="afts":(/aftm/.test(n),i.model="aftm");else if(i.lg)i.os="lg",i.model="lg";else if(i.samsung){i.os="samsung";var o=void 0!==o?o:window.tizen;o&&o.systeminfo?(i.model="tizen",i.version=o.systeminfo.getCapability("http://tizen.org/feature/platform.version")):i.model="orsay"}else i.sony?(i.os="sony",/bdp/.test(n)?i.model="bdp":i.model="tv"):i.ps4?(i.os="ps4",i.model="4"):i.fios?i.os="fios":i.os=null;else i.ios?i.os="ios":i.android?i.os="android":/windows|win32/.test(n)?(i.os="windows",i.winXP=/(windows nt 5\.[1-3])/.test(n),i.winVista=/(windows nt 6\.0)/.test(n),i.win7=/(windows nt 6\.1)/.test(n),i.win8=/(windows nt 6\.2)/.test(n),i.win8_1=/(windows nt 6\.3)/.test(n),i.win10=/(windows nt 10\.0)/.test(n),i.win64=/(wow64|win64)/.test(n)):/macintosh|mac_powerpc/.test(n)?i.os="macintosh":/symbos/.test(n)?i.os="symbos":/linux/.test(n)?i.os="linux":i.os=null},1426:function(t,i,n){"use strict";t.exports=r;var e=n(4702);function r(){var t=this;t.gc=[],t.gc.push(new e.BandwidthRule),t.gc.push(new e.BufferRule),t.gc.push(new e.ResolutionRule)}r.prototype.destroy=function(){this.gc=[]},r.prototype.getNextStreamIndex=function(t,i){if(!e.validateAbrInput(t))return-1;if(i)return(new e.StartupRule).getNextStreamIndex(t);var n=Number.MAX_VALUE;return this.gc.forEach((function(i){var e=i.getNextStreamIndex(t);e<0||(n=Math.min(n,e))})),n===Number.MAX_VALUE?-1:n}},4702:function(t,i){"use strict";function n(){this.PIXEL_THRESHOLD_FACTOR=.5}function e(){var t=this;t.BANDWIDTH_FACTOR_LOW=1.3,t.BANDWIDTH_FACTOR_HIGH=1.6,t.MIN_BW_FOR_LOW_FACTOR=25e5,t.MIN_BUFFER_TO_SWITCH_DOWN=10}function r(){var t=this;t.BANDWIDTH_FACTOR_LOW=1.3,t.BANDWIDTH_FACTOR_HIGH=1.6,t.MIN_BW_FOR_LOW_FACTOR=25e5,t.MIN_BUFFER_TO_SWITCH_UP=6,t.MIN_LENGTH_DATA=2,t.ALLOWED_LOAD_TIME=500}function s(){var t=this;t.MAX_WIDTH_240P=427,t.MAX_HEIGHT_240P=240,t.MAX_BITRATE_240P=9e5,t.MAX_BITRATE_LIMIT=1e7,t.PIXEL_RATIO_360=6}t.exports.StartupRule=n,t.exports.BandwidthRule=e,t.exports.BufferRule=r,t.exports.ResolutionRule=s,i.validateAbrInput=function(t){return!(!t||"object"!=typeof t||!t.bitrateList||!t.bitrateList.length||"number"!=typeof t.estimatedBandwidthInBps||isNaN(t.estimatedBandwidthInBps)||void 0===t.currentIndex||null===t.currentIndex||isNaN(t.currentIndex)||void 0===t.bufferLength||isNaN(t.bufferLength)||void 0===t.displayWidth||isNaN(t.displayWidth)||t.displayWidth<=0||void 0===t.displayHeight||isNaN(t.displayHeight)||t.displayHeight<=0||void 0===t.streams||t.streams.length<=0)},n.prototype.getNextStreamIndex=function(t){if(!i.validateAbrInput(t))return-1;for(var n,e=t.displayWidth*t.displayHeight*this.PIXEL_THRESHOLD_FACTOR,r=t.streams.length-1;r>=0;r--){var s=t.streams[r].width*t.streams[r].height;if(!n&&s<e&&(n=s),n&&s<n)return r+1}return 0},e.prototype.getNextStreamIndex=function(t){if(!i.validateAbrInput(t))return-1;for(var n=0,e=t.estimatedBandwidthInBps||t.bwHistory,r=this._c(e),s=0;s<t.bitrateList.length&&!(e<r*t.bitrateList[s]);s++)n=s;return n<t.currentIndex&&t.bufferLength>this.MIN_BUFFER_TO_SWITCH_DOWN&&(n=t.currentIndex),n},e.prototype._c=function(t){var i=this;return t>=i.MIN_BW_FOR_LOW_FACTOR?i.BANDWIDTH_FACTOR_LOW:i.BANDWIDTH_FACTOR_HIGH},r.prototype.getNextStreamIndex=function(t){var n=this;if(!i.validateAbrInput(t))return-1;var e=t.segmentLength?Math.min(t.segmentLength,n.MIN_BUFFER_TO_SWITCH_UP):n.MIN_BUFFER_TO_SWITCH_UP;return 0===t.bufferLength?n._f(t):t.bufferLength<e?t.currentIndex:t.bitrateList.length-1},r.prototype._f=function(t){for(var i=this,n=0,e=t.estimatedBandwidthInBps||t.bwHistory,r=i._c(e),s=i.ALLOWED_LOAD_TIME/1e3,o=0;o<t.bitrateList.length&&!(r*t.bitrateList[o]*i.MIN_LENGTH_DATA/e>s);o++)n=o;return n},r.prototype._c=function(t){var i=this;return t>=i.MIN_BW_FOR_LOW_FACTOR?i.BANDWIDTH_FACTOR_LOW:i.BANDWIDTH_FACTOR_HIGH},s.prototype.getNextStreamIndex=function(t){var n=this;if(!i.validateAbrInput(t))return-1;var e=t.pixelRatio||n.getPixelRatio(t),r=t.displayWidth,s=t.displayHeight;!isNaN(e)&&e>1&&(r*=e,s*=e);for(var o=0,u=0;u<t.streams.length&&!(t.streams[u].width>r||t.streams[u].height>s);u++)o=u;var h=t.streams[o].width,a=t.streams[o].height,c=r<=n.MAX_WIDTH_240P||s<=n.MAX_HEIGHT_240P?n.MAX_BITRATE_240P:n.MAX_BITRATE_LIMIT;if((o=n._l(t,h,a,c))<t.streams.length-1&&t.bitrateList[o+1]<c){var f=t.streams[o+1].width,l=t.streams[o+1].height,v=t.streams[o].height;Math.abs(l-s)<=Math.abs(v-s)&&(o=n._l(t,f,l,c))}return o},s.prototype._l=function(t,i,n,e){var r=0;return t.streams.forEach((function(s,o){var u=t.bitrateList[o];s&&s.width===i&&s.height===n&&u<=e&&o>r&&u>t.bitrateList[r]&&(r=o)})),r},s.prototype.getPixelRatio=function(t){var i=1;try{window&&(i=window.devicePixelRatio)}catch(t){i=1}return i||(i=1),t.is360&&(i*=this.PIXEL_RATIO_360),i}},3799:function(t){"use strict";function i(t){var i=this;i.COLLECTION_INTERVAL=100,i.MIN_SAMPLE_SIZE=5e4,i.SAMPLE_QUEUE_LENGTH=40,i.INSTANCE_SAMPLE_QUEUE_LENGTH=15,i.BW_ADJUSTMENT_FACTOR=.8,i._v=[],i._d=[],i.averageBandwidth=t||0,i.instantaneousBandwidth=t||0}t.exports=i,i.prototype.destroy=function(){var t=this;t._v=[],t._d=[],t.averageBandwidth=0,t.instantaneousTotalBandwidth=0},i.prototype.addSample=function(t){var i=this;if(t&&!(t.time<=0)){i.dp(t);var n=0,e=i._v.length,r=e*(e+1)/2,s=1/r;i._v.forEach((function(t,i){n+=(i+1)*s*t.bandwidth})),i.averageBandwidth=i.BW_ADJUSTMENT_FACTOR*n,n=0,e=i._d.length,s=1/(r=e*(e+1)/2),i._d.forEach((function(t,i){n+=(i+1)*s*t.bandwidth})),i.instantaneousBandwidth=i.BW_ADJUSTMENT_FACTOR*n}},i.prototype.dp=function(t){var i=this;!t||t.time<=0||(t.bandwidth=t.size/t.time*.008,t.bandwidth=Math.min(60,t.bandwidth),i._v.push(t),i._d.push(t),i._v.length>i.SAMPLE_QUEUE_LENGTH&&i._v.shift(),i._d.length>i.INSTANCE_SAMPLE_QUEUE_LENGTH&&i._d.shift())},i.prototype.replaceSamples=function(t,i){var n=this,e=t&&i?t/i*.008:0;if(e>0){n.averageBandwidth=e,n._v=[];for(var r=Math.min(Math.ceil(i/n.COLLECTION_INTERVAL),n.SAMPLE_QUEUE_LENGTH),s=0;s<r;s++){var o={bandwidth:e};n._v.push(o)}}}},7027:function(t,i,n){"use strict";t.exports={Command:n(2701),MediaLoadCommand:n(7745),StreamLoadCommand:n(5867),LicenseLoadCommand:n(8158),SegmentLoadCommand:n(8913),Mp4InitSegmentLoadCommand:n(8893),SubtitleSegmentLoadCommand:n(558),ErrorHandleCommand:n(6219)}},1726:function(t,i,n){"use strict";var e=n(2701).CmdNames,r=n(7027);t.exports.create=function(t,i,n){for(var s in e){if(e.hasOwnProperty(s))if(e[s]===t)return new(0,r[t+"Command"])(i,n)}return null}},258:function(t,i,n){"use strict";t.exports=h;var e=n(2701),r=e.CmdEvents,s=e.CmdNames,o=n(1726),u=n(2990);function h(){var t=this;for(var i in t._p={},t._h={},s)s.hasOwnProperty(i)&&(t._p[s[i]]={})}h.prototype.destroy=function(){this.removeAllCommands(),this._p=null},h.prototype.executeCommand=function(t,i,n){i&&(i.controller=this.__controller);var e=this.createCommand(t,i,n);return e&&e.execute(),e},h.prototype.createCommand=function(t,i,n){var e;try{e=o.create(t,i,n)}catch(t){e=null}if(!e)return null;for(var s in e.key=u.guid(),r)if(r.hasOwnProperty(s)){var h=r[s],a="on"+t+h;n[a]&&(this._h[h+t+e.key]=e.addEventListener(h,n[a],n))}return this._p[t][e.key]=e,e},h.prototype.removeCommand=function(t){var i=this;if(t){var n=i._p[t.name];if(n[t.key]===t){if(delete n[t.key],t.client)for(var e in r)if(r.hasOwnProperty(e)){var s=r[e],o="on"+t.name+s;t.client[o]&&(t.removeEventListener(s,i._h[s+t.name+t.key]),delete i._h[s+t.name+t.key])}t.destroy()}}},h.prototype.removeRelatedCommands=function(t){var i=this;if(i._p.hasOwnProperty(t)){var n=i._p[t];for(var e in n)if(n.hasOwnProperty(e)){var r=n[e];r&&i.removeCommand(r)}}},h.prototype.removeAllCommands=function(){var t=this;for(var i in t._p)t._p.hasOwnProperty(i)&&t.removeRelatedCommands(i)},h.prototype.getCommand=function(t){var i=this._p[t];if(!i)return null;var n=Object.keys(i);return n.length<1?null:i[n[n.length-1]]}},2701:function(t,i,n){"use strict";t.exports.Command=s;var e=n(2999),r=n(2990);function s(t,i){var n=this;n.data=t,n.client=i,e.call(n,n.constructor.name)}t.exports.CmdNames={CMD_MEDIA_LOAD:"MediaLoad",CMD_STREAM_LOAD:"StreamLoad",CMD_LICENSE_LOAD:"LicenseLoad",CMD_SEGMENT_LOAD:"SegmentLoad",CMD_MP4_INIT_SEGMENT_LOAD:"Mp4InitSegmentLoad",CMD_SUBTITLE_SEGMENT_LOAD:"SubtitleSegmentLoad",CMD_ERROR_HANDLE:"ErrorHandle"},t.exports.CmdEvents={CMD_COMPLETE:"Complete",CMD_PROGRESS:"Progress",CMD_ERROR:"Error"},r.inherits(s,e),s.prototype.destroy=function(){this.data=null,e.prototype.destroy.call(this)},s.prototype.execute=function(){},s.prototype.cancel=function(){}},6219:function(t,i,n){"use strict";t.exports=l;var e=n(2990),r=n(2701),s=r.Command,o=r.CmdNames,u=r.CmdEvents,h=n(902),a=n(574).AbrModes,c=n(6837),f=n(7572);function l(t,i){var n=this;if(!t||c.isNullOrUndefined(t.streamIndex)||!t.controller)throw new Error("Invalid argument: data argument of the command is not complete");s.call(n,t,i),n.name=o.CMD_ERROR_HANDLE,n.__controller=n.data.controller,n._m=n.__controller.model,n.ERR_INTERVAL_AFTER_BUFFER_EMPTY=1e4,n._b=new h(n.ERR_INTERVAL_AFTER_BUFFER_EMPTY,1),n._b.addEventListener((function(){n._b.destroy(),n._g()}),n),n._y(t.streamIndex),n.hw=-1}e.inherits(l,s),l.prototype.destroy=function(){var t=this;t._b&&t._b.destroy(),s.prototype.destroy.call(t)},l.prototype.execute=function(t){var i=this;if(!i._b.running||-1===i.hw||t===i.hw)if(i.data.error&&i.data.error.code===f.ERR_XHR_LOAD_FORBIDDEN[0])i._g();else{if(i._m.getABRMode()===a.AUTO){if(i.t_.length){var n=i.t_.shift();return i.publish(u.CMD_PROGRESS,i,{index:n}),void(i.hw=n)}if(0!==i._m.currentLoadingStreamIndex)return i.publish(u.CMD_PROGRESS,i,{index:0}),void(i.hw=0)}i._m.bufferLength>.15||i._b.start()}},l.prototype.cancel=function(){},l.prototype._y=function(t){var i=this;if(i.t_=[],!(t<0||t>=i._m.streams.length)){var n,e=t;for(n=e-1;n>=0;n--)i.t_.push(n);for(n=e+1;n<i._m.streams.length;n++)i.t_.push(n)}},l.prototype._g=function(){this.publish(u.CMD_ERROR,this)}},8158:function(t,i,n){"use strict";t.exports=a;var e=n(2990),r=n(4939).Events,s=n(2701),o=s.Command,u=s.CmdNames,h=s.CmdEvents;function a(t,i){var n=this;if(!t||!t.controller)throw new Error("Invalid argument: data argument of the command is not complete");o.call(n,t,i),n.i_=1,n.n_=[403],n.name=u.CMD_LICENSE_LOAD,n.e_=t.controller.services.getNewLoader(n.r_())}e.inherits(a,o),a.prototype.destroy=function(){this.e_.destroy(),o.prototype.destroy.call(this)},a.prototype.execute=function(){var t=this,i=t.data.url;t.e_.addEventListener(r.COMPLETE,(function(i){t.publish(h.CMD_COMPLETE,t,i)}),t),t.e_.addEventListener(r.ERROR,(function(i){t.publish(h.CMD_ERROR,t,i)}),t),t.e_.load(i,t.data.challenge)},a.prototype.cancel=function(){},a.prototype.r_=function(){var t=this;return{method:"POST",responseType:"arraybuffer",headerFields:t.data.headerFields,url:t.data.url,maxRetries:t.i_,retryExclusion:t.n_}}},7745:function(t,i,n){"use strict";t.exports=a;var e=n(2990),r=n(4939).Events,s=n(2701),o=s.Command,u=s.CmdNames,h=s.CmdEvents;function a(t,i){var n=this;if(!t||!t.url||!t.controller)throw new Error("Invalid argument: data argument of the command is not complete");o.call(n,t,i),n.name=u.CMD_MEDIA_LOAD,n.e_=t.controller.services.getNewLoader(t)}e.inherits(a,o),a.prototype.destroy=function(){this.e_.destroy(),o.prototype.destroy.call(this)},a.prototype.execute=function(){var t=this,i=t.data.url;t.e_.addEventListener(r.COMPLETE,(function(i){t.publish(h.CMD_COMPLETE,t,i)}),t),t.e_.addEventListener(r.ERROR,(function(i){t.publish(h.CMD_ERROR,t,i)}),t),t.e_.load(i)},a.prototype.cancel=function(){}},8893:function(t,i,n){"use strict";t.exports=h;var e=n(2990),r=n(2701),s=r.CmdNames,o=r.CmdEvents,u=n(8913);function h(t,i){var n=this;n.s_=t.stream,n.o_=[],n.u_=!!t.comboLoad,n.h_=t.initSegment,n.a_=t.segment,n.c_=t.cached,n.f_=n.constructor.super_.prototype,n.constructor.super_.call(n,t,i),n.l_=t.initSegment.url,n.name=s.CMD_MP4_INIT_SEGMENT_LOAD}e.inherits(h,u),h.prototype.destroy=function(){var t=this;t.o_=[],t.f_.destroy.call(t)},h.prototype.v_=function(t){if(!(t&&t.controller&&t.stream&&t.initSegment&&t.initSegment.url))throw new Error("Invalid argument: data argument of the command is not complete")},h.prototype.d_=function(){var t=this;if(t.o_.push(t.h_),t.u_){var i=t.s_.getMp4Chunk("sidx"),n=t.s_.getMp4Chunk("first");i&&t.o_.push(i),n&&t.a_&&t.o_.push(n)}},h.prototype.r_=function(){var t=this,i={responseType:"arraybuffer",isChunkedLoad:!0,minChunkSize:1e3,headerFields:{}};t.d_();var n=-1,e=-1;if(t.o_.length){var r=t.o_[0].range,s=t.o_[t.o_.length-1].range;r&&s&&(n=r.start,e=s.end)}if(n>=0&&e>=0&&(i.headerFields.Range="bytes="+n+"-"+e,t.p_=e-n+1),"atlas"===(t.s_.cdn||t.a_&&t.a_.cdn)){var o=t.s_.sessionId||t.a_&&t.a_.sessionId;i.headerFields.Accept="*/*; X-PB-SESSION-ID="+o}return i},h.prototype.m_=function(){var t=this;t.a_&&t.f_.m_.call(t)},h.prototype.b_=function(){var t=this;!t.u_&&t.c_&&t.h_.loaded?t.g_():t.f_.b_.call(t)},h.prototype.y_=function(t,i){var n=this;t&&(n.u_?n.w_(t,i):n.__(t,i))},h.prototype.w_=function(t,i){var n=this;if(t){var e=0,r=t.byteLength,s=t;i!==n.E_&&n.A_(i);for(var u=null,h=0;h<n.o_.length;h++){if(u=n.o_[h],!s)return;if(u.loaded||(e+=u.append(s),"first"===u.name&&n.O_&&n.O_.append(s),u.loaded&&"first"!==u.name&&n.publish(o.CMD_PROGRESS,n,{chunk:u,stream:n.s_,comboLoad:n.u_})),e>=r)return;if(e>0&&(s=t.subarray(e)),!u.loaded)return}}},h.prototype.__=function(t,i){var n=this;i!==n.E_?n.A_(i):n.O_.append(t)},h.prototype.g_=function(){var t=this;if(!t.u_){var i=t.o_[0];i&&(i.loaded=!0,t.publish(o.CMD_PROGRESS,t,{chunk:i,stream:t.s_,comboLoad:t.u_}),t.publish(o.CMD_COMPLETE,t,{stream:t.s_,comboLoad:t.u_}))}t.f_.g_.call(t)},h.prototype.S_=function(){var t=this;t.publish(o.CMD_COMPLETE,t,{stream:t.s_,comboLoad:t.u_})},h.prototype.T_=function(t,i){var n=this;if(t){if(!n.u_){var e=n.o_[0];return e&&!e.loaded&&e.append(t.data),void n.publish(o.CMD_PROGRESS,n,{chunk:e,stream:n.s_,comboLoad:n.u_})}t.stream=n.s_,t.chunk={name:"first"},n.f_.T_.call(n,t,i)}},h.prototype.I_=function(){return 0},h.prototype.getSegment=function(){return this.a_}},8913:function(t,i,n){"use strict";t.exports=d;var e=n(2990),r=n(4939).Events,s=n(4169),o=n(4641),u=n(2576),h=n(902),a=n(7650).HLSEvent,c=n(2701),f=c.Command,l=c.CmdNames,v=c.CmdEvents;function d(t,i){var n=this;n.v_(t),f.call(n,t,i),n.name=l.CMD_SEGMENT_LOAD,n.a_=t.segment,n.s_=t.stream,n.__controller=n.data.controller,n._m=n.__controller.model,n.l_=n.a_?n.a_.url:t.url,n.j_=n.a_?n.a_.streamIndex:t.stream.index,n.M_=n.a_?n.a_.encryptionData:null,n.N_=!1,n.R_=new u,n.E_=0,n.k_=null;var e=t.controller.services;n.n_=[403],n.e_=e.getNewLoader(n.r_()),n.M_&&n.M_.keyUri&&(n.L_=e.getNewLoader(n.D_())),n.C_=n.__controller.services.bandwidthEstimator,n.P_=new h(n.C_.COLLECTION_INTERVAL),n.P_.addEventListener(n.x_,n),n.m_()}e.inherits(d,f),d.prototype.destroy=function(){var t=this;t.cancel(),t.e_.destroy(),t.P_.destroy(),t.R_.destroy(),t.L_&&t.L_.destroy(),t.O_&&t.O_.destroy(),f.prototype.destroy.call(t)},d.prototype.v_=function(t){if(!(t&&t.segment&&t.stream&&t.controller))throw new Error("Invalid argument: data argument of the command is not complete")},d.prototype.D_=function(){var t=this,i={responseType:"arraybuffer",isChunkedLoad:!1,headerFields:{},retryExclusion:t.n_};return t._m.metadata.skt&&(i.headerFields.skt=t._m.metadata.skt),i},d.prototype.r_=function(){var t=this,i={responseType:"arraybuffer",isChunkedLoad:!0,headerFields:{},retryExclusion:t.n_},n=t.a_?t.a_.bitrate*t.a_.duration/8:0;return t.a_.brStartOffset>=0&&t.a_.brEndOffset>=0&&(i.headerFields.Range="bytes="+t.a_.brStartOffset+"-"+t.a_.brEndOffset,n=t.a_.brEndOffset-t.a_.brStartOffset+1),i.minChunkSize=.025*n,"atlas"===t.a_.cdn&&(i.headerFields.Accept="*/*; X-PB-SESSION-ID="+t.a_.sessionId),0===t.a_.streamIndex&&(i.timeout=1e4),i},d.prototype.m_=function(){var t=this,i=t.U_();i.containerFormat=t.a_.containerFormat,i.encryptionData=t.M_;var n=t.__controller.create(s,i);n&&(n.addEventListener(o.DATA_PROCESS_PROGRESS,t.T_,t),n.addEventListener(o.DATA_PROCESS_COMPLETE,t.S_,t),n.addEventListener(o.DATA_PROCESS_ERROR,t.V_,t),t.O_=n)},d.prototype.U_=function(){var t=this;return{seqNum:t.a_.seqNum,discontinuity:t.a_.discontinuity,demux:t._m.config.demux,width:t.s_?t.s_.width:640,height:t.s_?t.s_.height:360,timescale:t.s_.timescale?t.s_.timescale:t._m.timescale,duration:t._m.duration,segDuration:t.a_.duration?t.a_.duration:-1,pcr:t._m.getPCR(),frameRate:t.s_?t.s_.frameRate:30,mp4State:t.data.state?t.data.state.mp4:null,startOffsetTimestamp:t._m.startOffsetTimestamp,startTime:t.a_.startTime,lastChunkEndTs:t.data.state?t.data.state.lastChunkEndTs:null,lastFrameDuration:t.data.state?t.data.state.lastFrameDuration:null,prevSegEndTimeStamps:t._m.getPrevSegEndTimestamps(t.s_,t.a_),isAltAudioActive:!!t.data.state&&t.data.state.isAltAudioActive,live:t._m.live,onlyMetadata:t.data.onlyMetadata,useEditBox:!0,userAgent:t._m.userAgent,dash:t._m.isDash(),type:t.s_.type}},d.prototype.execute=function(){var t=this;t.E_=0,t.B_=!1,t.N_=!0,t.F_=Date.now(),t.z_=0,t.G_=0,t.a_&&(t.a_.totalDownloadTime=0,t.a_.timeToFirstByte=0),t.H_=Date.now(),t.P_.start(),t.M_&&t.L_&&t.Y_(),t.b_()},d.prototype.cancel=function(){this.q_(),this.e_.reset()},d.prototype.q_=function(){var t=this;t.P_.reset(),t.O_&&t.O_.close(),t.N_=!1},d.prototype.Y_=function(){var t=this;if(t.M_&&t.L_){var i=t.s_.lastKey,n=t.M_.keyUri;if(i&&i.keyUri&&i.key&&i.keyUri===n)t.W_(i.key);else{t.L_.addEventListener(r.COMPLETE,(function(i){t.W_(i)}),t),t.L_.addEventListener(r.ERROR,(function(i){t.publish(v.CMD_ERROR,t,i)}),t),t.L_.load(n)}}},d.prototype.b_=function(){var t=this;if(t.e_){var i=t.l_;t.e_.addEventListener(r.COMPLETE,(function(){t.g_()}),t),t.e_.addEventListener(r.PROGRESS,(function(i,n){t.y_(i,n)}),t),t.e_.addEventListener(r.ERROR,(function(i){t.publish(v.CMD_ERROR,t,i)}),t),t.e_.addEventListener(r.BYTES_LOADED,(function(i,n){t.A_(i,n)}),t),t.e_.load(i)}},d.prototype.A_=function(t,i){var n=this;n.a_&&0===n.a_.timeToFirstByte&&(n.a_.timeToFirstByte=Date.now()-n.H_,n.__controller.sendEvent(a.SEGMENT_FIRST_BYTE_LOADED,i),n.publish(v.CMD_PROGRESS,n,{position:"firstByte"})),n.z_+=Math.max(t-n.E_,0),n.E_=t},d.prototype.y_=function(t,i){var n=this;i!==n.E_&&n.A_(i),n.O_&&n.O_.append(t)},d.prototype.g_=function(){var t=this;t.x_(),t.P_.stop();var i=t.I_();t.O_&&t.O_.endOfSegment(),i>0&&t.C_.replaceSamples(t.E_,i)},d.prototype.W_=function(t){var i=this;t.type="key",t.initVector=i.M_.initVector,t.seqNum=i.a_.seqNum,i.a_.encryptionData.key=t,i.s_.lastKey=i.M_,i.O_.append(t)},d.prototype.T_=function(t){var i=this;t&&(t.putParam&&(i.k_&&t.putParam("perfInfo",i.k_),t.putParam("bytesTotal",i.E_)),i.publish(v.CMD_PROGRESS,i,t))},d.prototype.S_=function(t){this.publish(v.CMD_COMPLETE,this,t)},d.prototype.V_=function(){},d.prototype.x_=function(){var t=this,i=Math.max(t.z_,0),n=Date.now();t.G_=n-t.F_,t.P_.reset(),t.C_&&t.G_>10&&(t.F_=n,t.a_&&(t.a_.totalDownloadTime+=t.G_),t.z_=0,t.C_.addSample({size:i,time:t.G_})),t.P_.start()},d.prototype.I_=function(){var t=this,i=t.R_?t.R_.getPerformanceTiming(["startTime","requestStart","responseStart","responseEnd","secureConnectionStart","fetchStart","connectStart","domainLookupStart"],t.l_):null;return t.k_=i,i&&i.responseEnd&&i.startTime?i.responseEnd-i.startTime:null}},5867:function(t,i,n){"use strict";t.exports=a;var e=n(2990),r=n(4939).Events,s=n(2701),o=s.Command,u=s.CmdNames,h=s.CmdEvents;function a(t,i){var n=this;if(!(t&&t.stream&&t.stream.url&&t.controller))throw new Error("Invalid argument: data argument of the command is not complete");o.call(n,t,i),n.name=u.CMD_STREAM_LOAD,n.e_=t.controller.services.getNewLoader(t.retryOpts,t.stream.url)}e.inherits(a,o),a.prototype.destroy=function(){this.e_.destroy(),o.prototype.destroy.call(this)},a.prototype.execute=function(){var t=this,i=t.data.stream.url;t.e_.addEventListener(r.COMPLETE,(function(n){t.publish(h.CMD_COMPLETE,t,{data:n.data,headers:n.headers,streamUrl:i,stream:t.data.stream})}),t),t.e_.addEventListener(r.ERROR,(function(i){t.publish(h.CMD_ERROR,t,i)}),t),t.e_.load(i)},a.prototype.cancel=function(){}},558:function(t,i,n){"use strict";t.exports=c;var e=n(2990),r=n(4939).Events,s=n(7650).HLSEvent,o=n(2701),u=o.Command,h=o.CmdNames,a=o.CmdEvents;function c(t,i){var n=this;if(!(t&&t.controller&&t.subtitleStream&&t.segment))throw new Error("Invalid Argument: data arg is incomplete");u.call(n,t,i),n.name=h.CMD_SUBTITLE_SEGMENT_LOAD,n.s_=t.subtitleStream,n.__controller=t.controller,n.a_=t.segment||null,n._h={},n.Q_()}e.inherits(c,u),c.prototype.destroy=function(){var t=this;t.e_.destroy(),t.__controller.removeEventListeners(t._h),u.prototype.destroy.call(t)},c.prototype.execute=function(){var t=this;t.a_&&t.e_&&t.e_.load(t.a_.url)},c.prototype.cancel=function(){},c.prototype.Q_=function(){var t=this;t.e_=t.__controller.services.getNewLoader();t.e_.addEventListener(r.COMPLETE,(function(i){t.g_(i)}),t),t.e_.addEventListener(r.ERROR,(function(i){t.publish(a.CMD_ERROR,t,i)}),t)},c.prototype.g_=function(t){var i=this;if(i.a_){i.a_.data=t.data;var n=i.a_.pcr();null!=n?i.X_():i.__controller.addEventListener(s.PCR_AVAILABLE,i.X_,i)}},c.prototype.X_=function(){var t=this;t.a_.parseSegment(),t.publish(a.CMD_COMPLETE,t,{data:t.a_.toObject(),url:t.a_.url})}},6244:function(t,i,n){"use strict";t.exports=s;var e=n(3878),r=n(7572);function s(){var t=this;t._node=t.Z_.node,t.J_=t.Z_.mediaSource,t.K_=null,t.tE=[],t.iE=!1,t._m=t.Z_.appModel,t.nE=t._m.config.pastBufferLengthLimit}s.prototype.destroy=function(){this.eE(),this.tE=[]},s.prototype.setSwitchManager=function(t){this.K_=t},s.prototype.process=function(){var t=this;t.rE()&&"open"===t.J_.readyState&&t.J_.endOfStream()},s.prototype.onError=function(){this.iE=!0},s.prototype.onSeeking=function(t,i){t&&this.eE(),i&&this.sE()},s.prototype.oE=function(t){for(var i=this,n=0;n<i.tE.length;n++)if(t===i.tE[n].type)return i.tE[n];return null},s.prototype.setMinimumBufferTime=function(t){this.tE.forEach((function(i){i.setMinBufferTime(t)}))},s.prototype.createSourceBuffer=function(t,i,n){var s=this;if(!s.J_||s.iE)return null;var o=s.oE(t);if(!o)if(s.Z_.isMimetypeSupported(i)){o=s.Z_.create(e,s.J_,t,i),s.tE.push(o);var u=s._m.config.minBufferTime,h=isNaN(n)?s._m.live?u.live:u.vod:n;s.setMinimumBufferTime(h)}else{var a=new r.Error(r.ERR_MIMETYPE_NOT_SUPPORTED);s.Z_.notifyError(a)}return o},s.prototype.uE=function(){var t=this;if(t.J_&&!t.iE)for(;t.tE.length>0;){t.tE.shift().destroy()}},s.prototype.sE=function(){var t=this,i=[];t.J_&&!t.iE&&"open"===t.J_.readyState&&(t.tE.forEach((function(t){i.push({type:t.type,mimeType:t.mimeType})})),t.uE(),i.forEach((function(i){t.createSourceBuffer(i.type,i.mimeType,NaN)})))},s.prototype.eE=function(){var t=this;t.J_&&!t.iE&&t.tE.forEach((function(t){t.abort()}))},s.prototype.clear=function(t,i){var n=this;if(n.J_&&!n.iE)if(t){if(!(t&&t.end-t.start<10)&&i){i.clearBuffer(t.start,t.end,(function(t){}))}}else n.tE.forEach((function(t){t.clearAll()}))},s.prototype.clearSrcBuffer=function(t,i){var n=this.oE(t);if(n)if(i){n.clearBuffer(i.start,i.end,(function(t){}))}else n.clearAll()},s.prototype.appendBuffer=function(t,i){var n=this,e=n.createSourceBuffer(t.type,t.mimeType);e&&!n.iE&&t.data&&t.data.length&&e.appendBuffer(t.data,t.startTime,t.endTime,t.onlyMetadata,(function(t,e){n.hE(t,e),i(t,e)}))},s.prototype.endOfStream=function(t){this.tE.forEach((function(i){i.setEndOfStream(t)}))},s.prototype.rE=function(){if(!this.tE.length)return!1;var t=!0;return this.tE.forEach((function(i){t=t&&"closed"===i.state})),t},s.prototype.getPendingBufferLength=function(){var t=0;return this.tE.forEach((function(i){var n=i.getTotalPendingBufferLength();t<n&&(t=n)})),t},s.prototype.getBufferedAndPending=function(){var t={};return this.tE.forEach((function(i){var n=i.getTotalPendingBufferLength(),e=i.getBufferLength();-1!==i.mimeType.indexOf("video")?t.video={buffered:e,pending:n,mimeType:i.mimeType}:t.audio={buffered:e,pending:n,mimeType:i.mimeType}})),t},s.prototype.resetReadyState=function(){this.tE.forEach((function(t){t.ready=!1}))},s.prototype.areSrcBuffersReady=function(){for(var t=0;t<this.tE.length;t++)if(!this.tE[t].ready)return!1;return!0},s.prototype.hE=function(t,i){var n=this;i&&(n.clear(n.aE(i),i),n.clear(n.cE(i),i))},s.prototype.aE=function(t){var i=this,n=i._node.currentTime,e=null;try{e=t.buffer.buffered}catch(t){e=null}var r=0,s=0,o=i._m.live?i.nE.live:i.nE.vod;return e&&e.length&&(r=e.start(0),s=Math.max(n-o,0)),{start:r,end:s}},s.prototype.cE=function(t){var i=this,n=i._node.currentTime,e=null;try{e=t.buffer.buffered}catch(t){e=null}var r=i._m.live?i.nE.live:i.nE.vod,s={start:0,end:0};return e&&e.length>1&&n+r<e.start(1)&&(s.start=e.start(1),s.end=e.end(1)),s}},4460:function(t,i,n){"use strict";t.exports=A;var e=n(5557),r=e.MessageIds,s=e.MessageTypes,o=n(2990),u=n(6837),h=n(902),a=n(6769),c=n(2053),f=n(6244),l=n(7650).HLSEvent,v=n(9719),d=n(3789),p=n(729),m=n(2350).SynchTypes,b=n(8630).W,g=n(4998).aU,y=n(4998).sS,w="synchBegin",_="synchMetadataReady",E="synchDone";function A(t){var i=this;i.fE="Controller",i.lE=o.guid(),i._node=i.Z_.node,i.J_=i.Z_.mediaSource,i._m=i.Z_.appModel,i.mediaLoaded=!1,i.vE=!1,i.dE=null,i.pE=t?t.sessionId:null,i.mE=new c(i._node,i.Z_.mediaSource,i),i.bE=i.Z_.create(f),i.gE=i.Z_.create(v),i.yE=new p,i.wE=new h(250),i.wE.addEventListener(i._E,i),i._m.shouldSynchronizePlayers()&&(i.EE=new g(i._node,i.AE()),i.OE()),i.SE=[];var n={userAgent:i._m.userAgent,metadata:t,config:i._m.config};if(n.config.bwHistory=i.TE(),i.IE=i.jE(n),i.IE){if(i.ME=i.NE(i.fE),i.ME)return n.config.inWorkerScope=!0,i.ME.addEventListener("message",i.RE.bind(i)),void i.kE(r.CREATE,[n]);i._m.config.useWorker=!1}i.LE=new a(n,i.DE.bind(i)),i.IE=!1,i.CE=!1,i.PE=!1,i.xE=null,i.dE=null,i.UE=E,i.VE=null,i.BE=!1}A.prototype.destroy=function(){var t=this;t.mE.destroy(),t.bE.destroy(),t.gE.destroy(),t.SE=[],t.FE&&t.FE.destroy(),t.wE&&(t.wE.destroy(),t.wE=null),t.EE&&t.EE.destroy(),t.IE&&t.ME?(t.kE(r.DESTROY),t.ME.terminate()):t.LE.destroy()},A.prototype.OE=function(){var t=this;Object.values(y).forEach((function(i){t.EE.on(i,(function(n){(n=n||{}).bufferLength=t._m.getBufferLength();var e=i===y.SYNCH_STRATEGY_APPLIED;t.LE.setIgnoreBuffering(e),t.Z_.sendEvent("stream"+i,n)}))}))},A.prototype.jE=function(t){var i=t?t.userAgent:null,n=!t||!t.config||t.config.useWorker;if(!i)return n;if(i.chrome&&!i.win7)return!1;if(i.safariDesktop)return!1;var e=t?t.metadata:null;return!(e&&e.url&&e.url.indexOf(".mpd")>-1)&&(!(i.firefox&&e&&e.streams&&e.streams.length&&"m3u8:fmp4"===e.streams[0].format)&&((!this.zE(e)||!(i.safari||i.edge||i.ie))&&n))},A.prototype.zE=function(t){if(!t)return!1;var i=t.url,n=t.streams&&t.streams.length?this.GE(t.streams[0]):null;return o.isUplynk(i||n)},A.prototype.GE=function(t){if(!t)return null;var i=t.url;return!i&&t.host&&t.path&&(i=t.host+t.path),i},A.prototype.sendVideoEvent=function(t){var i=this;if(t)switch(t.type){case"play":i.HE();break;case"playing":i.YE();break;case"pause":i.qE();break;case"seeking":i.WE(t);break;case"seeked":i.QE(t);break;case"ended":i.XE();break;case"error":i.ZE();break;case"timeupdate":i.$E(t);break;case"resize":i.JE(t)}},A.prototype.onMediaSourceOpen=function(){var t=this;t.mediaLoaded&&(t.wE.reset(),t.wE.start(),t.SE.length&&t.KE())},A.prototype.play=function(t){var i=this;if(!i.J_||"closed"!==i.J_.readyState&&i.mediaLoaded){var n=i._m.live?i._node.currentTime:i._m.duration,e=t>0&&t<=n?t:null;e&&i._A(e,m.INIT),i.tO()}else i.SE.push([i,i.play,[t]])},A.prototype.pause=function(){var t=this;!t.J_||"closed"!==t.J_.readyState&&t.mediaLoaded?t._node.pause():t.SE.push([t,t.pause])},A.prototype.preload=function(t){var i=this;!i.J_||"closed"!==i.J_.readyState&&i.mediaLoaded?i.iO("preload",[t]):i.SE.push([i,i.preload,[t]])},A.prototype.setABRMode=function(t){this.iO("setABRMode",[t])},A.prototype.setAudioLanguage=function(t){this.iO("setAudioLanguage",[t])},A.prototype.suspendStreaming=function(){this.iO("suspendStreaming")},A.prototype.resumeStreaming=function(){this.iO("resumeStreaming")},A.prototype.getSegInfo=function(){var t=this,i={mode:"sync",segInfo:null,bufferLen:null,sessionId:t.pE};return t.IE&&t.ME?(i.mode="async",t.kE(r.CALL_METHOD,null,"getSegInfo")):i.segInfo=t.LE.getSegInfo(),i.bufferLen=t._m.getBufferLength(),i},A.prototype.getSyncOffset=function(){return this.EE?this.EE.getSyncOffset():NaN},A.prototype.startSync=function(){this.EE&&this.EE.startSync()},A.prototype.stopSync=function(){this.EE&&this.EE.stopSync()},A.prototype.getSyncState=function(){return this.EE?this.EE.getSyncState():-1},A.prototype.HE=function(){var t=this;if(t._m.setDimensions(),!t.J_||"closed"!==t.J_.readyState&&t.mediaLoaded){var i=t.dE;t.xE&&(i=t.xE,t.xE=null),t.CE=!1,t.iO("onPlay",[i]),t.gE.onPlay()}else t.SE.push([t,t.HE])},A.prototype.YE=function(){this.iO("onPlaying"),this.gE.onPlaying()},A.prototype.qE=function(){var t=this;t.CE=!0,t.iO("onPause"),t.gE.onPause()},A.prototype.WE=function(t){var i=this,n=t.target.currentTime,e=!i._m.live,r=!1,s=i._m.userAgent;s&&s.safariDesktop&&(r=!i._m.live||i.BE),i.bE.onSeeking(e,r),i.BE=!1,i.iO("onSeeking",[n])},A.prototype.QE=function(t){var i=t.target.currentTime;this.iO("onSeeked",[i])},A.prototype.XE=function(){this.wE.stop(),this.iO("onComplete")},A.prototype.ZE=function(){var t=this,i=t._node.error?t._node.error.code:null;t.iO("onError",[i]),t.bE.onError()},A.prototype.JE=function(){this._m.setDimensions()},A.prototype.$E=function(){this.nO("onTimeUpdate")},A.prototype._E=function(){this.mediaLoaded&&this.nO("onUpdate")},A.prototype.nO=function(t){var i=this;i.bE.process();var n={currentTime:i._node.currentTime,bufferedAndPending:i.bE.getBufferedAndPending(),bufferLength:i._m.getBufferLength(),pendingBufferLength:i.bE.getPendingBufferLength(),bufferedRanges:i._m.getBufferedDto(),dimensions:i._m.getDimensions(),pixelRatio:i._m.getPixelRatio(),frameStats:i.gE.getFpsStats()};i.iO(t,[n])},A.prototype.eO=function(){var t=this;t.mediaLoaded=!0,t.J_&&"closed"===t.J_.readyState||(t.wE.start(),t.SE.length&&t.KE())},A.prototype._A=function(t,i){var n=this;n.dE=t,n.UE=w,n.VE=i,n._m.live&&(n.bE.resetReadyState(),n.bE.clear())},A.prototype.rO=function(t){var i=this;i.dE=null,i.UE=E,i.VE=null,i._m.live&&i.iO("onSynchComplete",[t])},A.prototype.KE=function(){var t=this.SE;this.SE=[],t.forEach((function(t){var i=t[0],n=t[1],e=t.length>2?t[2]:null;n&&"function"==typeof n&&n.apply(i,e)}))},A.prototype.iO=function(t,i){var n=this;n.IE&&n.ME?n.kE(r.CALL_METHOD,i,t):n.LE[t].apply(n.LE,i)},A.prototype.NE=function(){return null},A.prototype.RE=function(t){var i=this;if(t){var n=t.data?new d(t.data):t;if(n&&n.instanceId===i.lE){var e=n.getParam("media");if(e&&(i._m.update(e),i.EE&&i.sO(e)),n.type!==s.EVENT)switch(n.id){case r.CREATE_SRC_BUFFER:i.oO(n.getParam("tracks"));break;case r.APPEND_SRC_BUFFER:i.uO(n.getParam("tracks"));break;case r.SAVE_AVG_BANDWIDTH:i.hO(n.getParam("avgBwInfo"));break;case r.END_OF_STREAM:n.args&&n.args.length&&(i.bE.endOfStream(n.getParam("endOfStream")),i.Z_.sendEvent(l.CONTENT_LOAD_FINISHED,n.args[0]));break;case r.PAUSE_BEFORE_STREAM_CHANGE:i.aO(n.getParam("streamType"));break;case r.PLAY_AFTER_STREAM_CHANGE:i.cO();break;case r.DRM_INIT:i.FE||(i.FE=new b(i.LE,i._node,i.Z_));for(var o=0;o<i._m.drmInfo.length;o++)i.FE.addDrmItem(i._m.drmInfo[o]);break;case r.DRM_LICENSE_INFO:i.FE&&i.FE.addDrmItem(n.getParam("drmItem"));break;case r.SKIP_GAP:i._node.currentTime=n.getParam("seekPosition")}else i.fO(n.id,n.getParam("eventData"))}}},A.prototype.DE=function(t){t.instanceId=this.lE,this.RE(t)},A.prototype.sO=function(t){var i=this;if(i.EE){var n=t.streams&&t.streams[t.currentLoadingStreamIndex],e=t.currentLoadingSeqNum;if(n&&!u.isNullOrUndefined(e))n.segments.forEach((function(t){t.seqNum===e&&i.EE.addSegmentInfo({startTime:t.startTime,endTime:t.startTime+t.duration,pdt:t.programDateTime,seqNum:e})})),i.EE.updateDateRanges(n.dateRanges)}},A.prototype.fO=function(t,i){var n=this;if(t){switch(t){case l.MEDIA_LOADED:n.eO();break;case l.WAITING:var e=i?i.minBufferTime:.1;n.bE.setMinimumBufferTime(e),n.gE.updateBufferingInfo(i);break;case l.LIVE_SYNCH:var r=i?i.synchPosition:null,s=i?i.synchType:m.INIT;n._A(r,s);break;case l.SEG_INFO_METRICS_AVAILABLE:i={segInfo:i,bufferLen:n._m.getBufferLength(),sessionId:n.pE};break;case l.VTT_SEGMENT_LOADED:i&&(i.sessionId=n.pE);break;case l.MEDIA_METADATA_LOADED:i=n._m.streams;break;case l.ERROR:return i.error=new Error(i.message,i.code),void n.Z_.notifyError(i)}n.Z_.sendEvent(t,i)}},A.prototype.oO=function(t){var i=this;t&&(!i.J_||"closed"!==i.J_.readyState&&i.mediaLoaded?(i.lO(),t.forEach((function(t){i.bE.createSourceBuffer(t.type,t.mimeType,t.minBufferTime)}))):i.SE.push([i,i.oO,[t]]))},A.prototype.lO=function(){var t=this;t.J_&&!t.J_.duration&&t._m.duration>0&&(t.J_.duration=t._m.duration)},A.prototype.uO=function(t){var i=this;t&&(t.forEach((function(t){i.bE.appendBuffer(t,(function(t,n){i.hE(t,n)}))})),i._m.preloading&&!i.vE&&(i.Z_.sendEvent(l.PRELOAD_PROGRESS),i.vE=!0))},A.prototype.hE=function(){var t=this;if(!t._m.live&&t.UE===w){if(!t.bE.areSrcBuffersReady())return;return t.bE.onSeeking(!0),t.UE=_,void t.iO("onSynchMetadataReady",[t.dE])}if(t.dE&&t.bE.areSrcBuffersReady()){var i=t.vO(t._node),n=t._node.buffered;if(i.length&&n.length){var e=i.start(i.length-1),r=i.end(i.length-1),s=t._m.TIMESTAMP_COMPARE_EPSILON;if(t.dE+s>=e&&t.dE<=r){for(var o=t.dE,u=0;u<n.length;u++)if(!(o>n.end(u))&&o<n.start(u)){o=n.start(u);break}var h=t._m.userAgent;t.BE=h&&h.safariDesktop&&t._m.live&&t.VE===m.TIME_GAP;try{t._node.currentTime=o}catch(t){}t.rO(o)}}}},A.prototype.kE=function(t,i,n){var e=this;if(e.ME&&t){var r={type:s.MESSAGE,id:t,moduleName:e.fE,instanceId:e.lE,funcName:n,args:i,timestamp:Date.now()};e.ME.postMessage(r)}},A.prototype.TE=function(){var t=this.yE.readProperty("avgBW"),i=t?t.avgBWtimestamp:null;if((i?Date.now()-parseInt(i):Number.MAX_VALUE)<1e3*this._m.config.bwHistoryMaxAge&&t){var n=t.avgBW;return n?parseInt(n):0}return 0},A.prototype.hO=function(t){t&&this.yE&&this.yE.writeProperty("avgBW",t)},A.prototype.cO=function(){var t=this;t.PE&&(t.tO(),t.PE=!1,t.Z_.sendEvent(l.WAITING,{value:!1,bufferInit:!1}))},A.prototype.aO=function(t){var i=this,n=i._node.currentTime,e=i._m.live;e&&"audio"===t?i.bE.clearSrcBuffer(t):i.bE.clear(),i.CE||(i.Z_.sendEvent(l.WAITING,{value:!0,bufferInit:!1}),i._node.pause(),i.PE=!0),e?i.xE=n:i._node.currentTime=n},A.prototype.tO=function(){var t=this;if(t._node){var i=t._node.play();return i&&"function"==typeof i.catch&&i.catch((function(){t._node.paused&&t.Z_.sendEvent(l.PLAY_BLOCKED)})),i}},A.prototype.getCurrentDate=function(){return this._m.getCurrentDate()},A.prototype.vO=function(t){var i=this._m.userAgent;return this._m.live&&i.edge&&i.edge>=17&&i.edge<18?t.buffered:t.seekable},A.prototype.AE=function(){var t=this._m.config.streamSynch.synchConfig;return t?{pauseOnAhead:t.pauseOnAhead,synchPoint:t.behindLiveEdgeMs,synchThreshold:t.syncAccuracyMs,variableRateChange:t.variableRateChange}:null}},867:function(t){"use strict";t.exports={ERROR:-1,INITIAL:0,MEDIA_METADATA_LOADING:1,MEDIA_METADATA_LOADED:2,STREAM_METADATA_LOADING:3,STREAM_METADATA_LOADED:4,MEDIA_LOADED:5,PRELOADING:6,PLAY_REQUESTED:7,PLAYING:8,PAUSED:9,PLAY_COMPLETE:10}},3878:function(t){"use strict";t.exports=e;var i="append",n="remove";function e(t,i,n){var e=this;e._node=e.Z_.node,e.dO=!1,e.type=i,e.mimeType=n,e.J_=t,e.buffer=t.addSourceBuffer(n),e.pO=[],e.mO=[],e.bO=[],e.gO=!1,e.yO=.1,e.ready=!1,e.TIMESTAMP_COMPARE_EPSILON=.065,e.GOP_LENGTH=2,e.wO=e._O.bind(e),e.buffer.addEventListener("updateend",e.wO),e.EO=function(){e.abort()},e.buffer.addEventListener("error",e.EO),e.state="open"}e.prototype.destroy=function(){var t=this;t.remove(),t.pO=[],t.mO=[],t.bO=[],t.state="closed"},e.prototype.remove=function(){var t=this;t.dO||(t.dO=!0,t.abort(),t.buffer.removeEventListener("updateend",t.wO),t.buffer.removeEventListener("error",t.EO),"closed"!==t.J_.readyState&&t.J_.removeSourceBuffer(t.buffer))},e.prototype.setMinBufferTime=function(t){this.yO=Math.max(.1,t)},e.prototype.appendBuffer=function(t,n,e,r,s){var o=this;if(!o.dO){var u={type:i,cb:s,buffer:t,startTime:n,endTime:e,time:e-n,onlyMetadata:r||!1};o.pO.push(u),o.AO()}},e.prototype.clearBuffer=function(t,i,e){var r=this;if(r.dO||t>=i)return e("["+r.constructor.name+"] Invalid remove buffer call");var s={type:n,cb:e,startTime:t,endTime:Math.round(1e3*parseFloat(i))/1e3};r.mO.push(s),r.AO()},e.prototype.abort=function(){var t=this;if("open"===t.J_.readyState&&!t.dO){t.pO=[],t.mO=[],t.bO=[];try{t.buffer.abort()}catch(t){}}},e.prototype.clearAll=function(){var t=this;if("closed"!==t.J_.readyState&&!t.dO){t.abort();try{var i=t.buffer.buffered,n=i.length?i.start(0):0,e=i.length?i.end(i.length-1):0;e>n&&t.buffer.remove(n,e)}catch(t){}}},e.prototype.setEndOfStream=function(t){var i=this;i.gO=t,i.dO||(t?(i.OO(),i.AO()):i.state=i.pO.length?i.state:"empty")},e.prototype.OO=function(){var t=this;t.gO&&"empty"===t.state&&!t.bO.length&&(t.state="closed")},e.prototype._O=function(){var t=this;if(!t.dO){if(t.ready=!0,t.bO.length)t.bO.shift().cb(null,t);t.pO.length||(t.state="empty"),t.AO(),t.OO()}},e.prototype.AO=function(){for(var t=this;t.mO.length;){if(t.buffer.updating)return;t.SO(t.mO.shift())}for(;t.pO.length;){if(t.buffer.updating)return;var i=t.getBufferLength()+t.getTotalPendingBufferLength(),n=t.pO.length&&t.pO[0]&&t.pO[0].onlyMetadata;if(!t.gO&&i<t.yO&&!n)return;t.SO(t.pO.shift())}},e.prototype.SO=function(t){var e=this;if(t&&t.type)try{t.type===i?e.buffer.appendBuffer(t.buffer):t.type===n&&e.buffer.remove(t.startTime,t.endTime),e.bO.push(t),e.state="updating"}catch(n){if("QuotaExceededError"===n.name)e.TO()&&t.type===i&&e.pO.unshift(t)}},e.prototype.TO=function(){var t=this,i=t._node.buffered,n=i.length>0?i.start(0):NaN,e=t._node.currentTime-t.GOP_LENGTH;return e>n&&(t.buffer.remove(n,e),!0)},e.prototype.getTotalPendingBufferLength=function(){var t=0;return this.pO.forEach((function(i){i&&i.time&&(t+=i.time)})),t},e.prototype.getBufferLength=function(){var t,i=this,n=i.Z_.node,e=i.TIMESTAMP_COMPARE_EPSILON,r=0,s=n.currentTime,o=null;try{o=i.buffer.buffered;for(var u=0;o&&u<o.length;u++)if(s+e>=o.start(u)&&s<o.end(u)){t=u;break}t>=0&&o&&o.length&&(r=o.end(t)-s)}catch(t){}return r}},2053:function(t){"use strict";function i(t,i,n){var e=this;t&&i&&n&&(e._node=t,e.IO=n,e.J_=i,e.jO())}t.exports=i,i.prototype.destroy=function(){this.MO()},i.prototype.jO=function(){var t=this;t.mE=t.NO.bind(t),t.RO=["play","playing","pause","seeking","seeked","ended","error","timeupdate"],t.RO.forEach((function(i){t._node.addEventListener(i,t.mE)})),t.kO=t.LO.bind(t),t.J_.addEventListener("sourceopen",t.kO),window.addEventListener("resize",t.mE)},i.prototype.MO=function(){var t=this;t.RO.forEach((function(i){t._node.removeEventListener(i,t.mE)})),t.J_.removeEventListener("sourceopen",t.kO),window.removeEventListener("resize",t.mE)},i.prototype.NO=function(t){this.IO.sendVideoEvent(t)},i.prototype.LO=function(t){this.IO.onMediaSourceOpen(t)}},9112:function(t,i,n){"use strict";t.exports.AacStreamer=h,t.exports.AacLiveStreamer=a;var e=n(2990),r=n(2350).Streamer,s=n(7980),o=n(5557),u=n(6837);function h(t,i){this.DO(t,i)}function a(t,i){this.DO(t,i)}e.inherits(h,r),e.inherits(a,s),a.prototype.DO=h.prototype.DO=function(t,i){var n=this;n.constructor.super_.call(n,t,i),n.f_=n.constructor.super_.prototype,n.processOnlyMetadata=!1,n.lastAudioTimestamp=NaN,n.lastAudioFrameDuration=NaN,n.primary=!1,n.CO="mp4a.40.2",n.PO="audio",n.xO();var e=[{type:n.PO,mimeType:n.PO+'/mp4; codecs="'+n.CO+'"',minBufferTime:n.__controller.getMinimumBufferTime()}];n.__controller.sendMessage(o.MessageIds.CREATE_SRC_BUFFER,[e],["tracks"]),n.UO=n.STATES.INITIALIZED},a.prototype.destroy=h.prototype.destroy=function(){this.f_.destroy.call(this)},a.prototype.onSeeking=h.prototype.onSeeking=function(t){var i=this;i.lastAudioTimestamp=NaN,i.f_.onSeeking.call(i,t)},a.prototype.onSwitchBegin=h.prototype.onSwitchBegin=function(){var t=this;t.xO(),t.f_.onSwitchBegin.call(t)},a.prototype.onManualStreamChange=h.prototype.onManualStreamChange=function(){var t=this;t.xO(),t.lastAudioTimestamp=NaN,t.f_.onManualStreamChange.call(t)},a.prototype.VO=h.prototype.VO=function(){this.xO()},a.prototype.BO=h.prototype.BO=function(t){var i=this;if(!i.isActive())return null;var n=i.FO;return{segment:n.getSegmentfromSeqNum(t),stream:n,state:{mp4:i.zO,lastChunkEndTs:{audio:i.lastAudioTimestamp,video:NaN},lastFrameDuration:{audio:i.lastAudioFrameDuration,video:NaN}},onlyMetadata:i.processOnlyMetadata}},a.prototype.onSegmentLoadProgress=h.prototype.onSegmentLoadProgress=function(t,i,n){var e=this;if(i){var r=i.getParam?i.getParam("parsedInfo"):null;r&&(r.lastChunkEndTs&&u.isNumber(r.lastChunkEndTs.audio)&&(e.lastAudioTimestamp=r.lastChunkEndTs.audio),r.lastFrameDuration&&u.isNumber(r.lastFrameDuration.audio)&&(e.lastAudioFrameDuration=r.lastFrameDuration.audio)),e.f_.onSegmentLoadProgress.call(e,t,i,n)}},a.prototype.xO=h.prototype.xO=function(){this.zO={video:{shouldInit:!0,seqNum:0},audio:{shouldInit:!0,seqNum:0}}},a.prototype.GO=h.prototype.GO=function(t,i){},a.prototype.HO=function(t){var i=this;i.lastAudioTimestamp=NaN,i.isActive()&&i.f_.HO.call(i,t)}},39:function(t,i,n){"use strict";t.exports=s;var e=n(7650).HLSEvent,r=n(5557);function s(){var t=this;t._m=t.__controller.model,t.YO=!1,t.iE=!1,t.qO=NaN,t.WO=NaN,t.QO={},t.CE=!0,t.XO=-1,t.MIN_BUFFER_TO_PLAY=1,t.MIN_TIME_TO_BUFFER_CHECK=150,t.BUFFER_REPORT_THRESHOLD=20,t.MIN_BUFFER_TIME_UPPER_BOUND=5,t.WEIGHT=.5,t.CHROME_BUFFER_GAP_EPSILON=.15,t.ZO=!0,t.$O=!1,t.JO()}s.prototype.onPlayRequested=function(){this.KO()},s.prototype.destroy=function(){},s.prototype.checkBuffering=function(t){var i=this,n=i._m.bufferLength,e=i._m.currentTime,r=i._m.duration;if(!(isFinite(r)&&e+.05>r)){var s=i.tS();!t&&s<i.MIN_TIME_TO_BUFFER_CHECK||(!(n<=.02||i.iS===e&&n<i.MIN_BUFFER_TO_PLAY)||i.CE||i._m.preloading||i.YO?!isNaN(i.qO)&&e>i.qO?i.nS():!i.CE&&i.iS===e&&i._m.getTotalBufferLength()>i.MIN_BUFFER_TO_PLAY&&i.eS():i.KO(),i.iS=e,i.rS=Date.now())}},s.prototype.onPlaying=function(){this.CE=!1},s.prototype.onPause=function(){var t=this;t.CE=!0,t.YO&&(t.QO.bufferInit=!0,t.nS())},s.prototype.onSeeking=function(){this.$O=!0},s.prototype.onSeeked=function(){this.$O=!1},s.prototype.onTimeUpdate=function(){this.YO&&this.checkBuffering(!0)},s.prototype.onVideoSync=function(t){this.iS=t},s.prototype.onError=function(){this.YO&&this.nS()},s.prototype.onComplete=function(){var t=this;t.YO&&t.nS(),t.JO()},s.prototype.setIgnoreBuffering=function(t){this.ZO=t},s.prototype.eS=function(){var t=this;if(!(t._m.bufferedRanges.length<2)){var i=t._m.TIMESTAMP_COMPARE_EPSILON,n=t._m.currentTime;t._m.userAgent&&t._m.userAgent.chrome&&(n-=3);for(var s=t._m.bufferedRanges.ranges,o=0;o<s.length-1;o++){var u=s[o],h=s[o+1];if(h.start-u.end>t._m.config.skipGapLimit)t._m.currentTime!==t.WO&&(t.__controller.sendEvent(e.BUFFER_GAP_DETECTED,h.start-u.end),t.WO=t._m.currentTime);else{var a=u.end-i-(t._m.userAgent.chrome?t.CHROME_BUFFER_GAP_EPSILON:0),c=h.start;n>a&&n<c&&t.__controller.sendMessage(r.MessageIds.SKIP_GAP,[h.start],["seekPosition"])}}}},s.prototype.KO=function(){var t=this;if(!t.YO){t.YO=!0;var i=t.getMinimumBufferTime();t.oS(),t.qO=t._m.currentTime,t.$O&&(t.ZO=!0),t.QO={value:t.YO,bufferInit:t.ZO,minBufferTime:i},t.__controller.sendEvent(e.WAITING,t.QO)}},s.prototype.nS=function(){var t=this;t.YO&&(t.YO=!1,t.qO=NaN,t.QO={value:!1,waitTime:t.uS(),bufferInit:t.ZO,minBufferTime:.1},t.__controller.sendEvent(e.WAITING,t.QO),t.QO={},t.ZO=!1)},s.prototype.getMinimumBufferTime=function(){var t=this,i=t.__controller.services.bandwidthEstimator.instantaneousBandwidth,n=t._m.getCurrentLoadingStream(),e=n?n.bitrate/1e6:0,r=t._m.config.minBufferTime;return r=t._m.live?r.live:r.vod,t._m.config.variableMinBuffer&&e&&!isNaN(i)?t.hS(i/e,r):r},s.prototype.hS=function(t,i){var n=this.MIN_BUFFER_TIME_UPPER_BOUND;if(i>=n)return i;var e=Math.max(i,0);if(t>=1)return e;var r=t*n;return 1*Math.max(e,n-r*this.WEIGHT).toFixed(1)},s.prototype.tS=function(){var t=this,i=Date.now();return t.rS=t.rS||i,i-t.rS},s.prototype.oS=function(){var t=this,i=t.tS(),n=t.aS();t.cS=Date.now()-Math.max(i-n,0)},s.prototype.uS=function(){var t=this,i=t.aS(),n=Math.max(Date.now()-t.cS-i,0);return t.QO.bufferInit||n<t.BUFFER_REPORT_THRESHOLD?0:n},s.prototype.aS=function(){var t=this,i=0;return t.iS&&(i=1e3*(t._m.currentTime-t.iS).toFixed(3)),i},s.prototype.JO=function(){this.rS=null,this.iS=null},s.prototype.isBuffering=function(){return this.YO}},6769:function(t,i,n){"use strict";t.exports=_;var e=n(7650).HLSEvent,r=n(7572),s=n(6972),o=s.StreamingController,u=s.Events,h=n(39),a=n(574).MetadataTypes,c=n(2701).CmdNames,f=n(258),l=n(902),v=n(867),d=n(2999),p=n(2990),m=n(574).Model,b=n(5212),g=n(5557),y=n(3789),w=n(3093).userAgent;function _(t,i){var n=this;d.call(n,n.constructor.name),n.fS=t,n.lS=i,n.model=n.create(m,t),n.services=n.create(b),n.vS=n.services.metadataParser,n.dS=n.create(f),n.pS=n.create(o),n.mS=n.create(h),n.UO=v.INITIAL,n._h={},n.bS=n.fS.config.inWorkerScope,n.jO(),n.$O=!1,n.gS=!1,n.yS=new l(250),n.yS.addEventListener(n.wS,n),n.initialize()}p.inherits(_,d),_.prototype.create=function(){var t=this,i=Array.prototype.slice.call(arguments),n=i.shift(),e=Object.create(n.prototype);return e.__controller=t,n.apply(e,i),e},_.prototype.destroy=function(){var t=this;t.pS&&(t.pS.destroy(),t.pS=null),t.mS&&(t.mS.destroy(),t.mS=null),t.dS&&(t.dS.destroy(),t.dS=null),t.services&&(t.services.destroy(),t.services=null),t.yS&&(t.yS.destroy(),t.yS=null),t.UO=v.INITIAL,t.removeEventListeners(t._h),d.prototype.destroy.call(t)},_.prototype.initialize=function(){this._S()},_.prototype.getSegInfo=function(){var t=this;if(!t.pS)return null;var i=t.pS.getMetrics();return t.bS&&t.sendEvent(e.SEG_INFO_METRICS_AVAILABLE,i),i},_.prototype.sendEvent=function(t,i){var n=this;n.publish(t,i);var e=n.create(y,{type:g.MessageTypes.EVENT,id:t,args:[i],argNames:["eventData"]});n.ES(e)},_.prototype.sendMessage=function(t,i,n,e){var r=this.create(y,{type:g.MessageTypes.MESSAGE,id:t,args:i,argNames:n});this.ES(r,e)},_.prototype.notifyError=function(t){var i=this;i.error=t;var n=i.UO;n!==v.ERROR&&i.AS(v.ERROR),n!==v.PAUSED&&i.sendEvent(e.ERROR,"HlsError"===i.error.constructor.name?i.error.dto():i.error)},_.prototype.ES=function(t,i){t&&this.lS&&(t.addMedia(),this.lS(t,i))},_.prototype.jO=function(){var t=this;t.pS.addEventListener(u.STREAM_METADATA_LOADED,t.SS,t),t.pS.addEventListener(u.STREAM_METADATA_LOAD_ERROR,t.TS,t),t.pS.addEventListener(u.PRELOAD_COMPLETE,t.IS,t),t.pS.addEventListener(u.SEG_LOAD_PROGRESS,t.jS,t)},_.prototype.MS=function(t){},_.prototype.AS=function(t,i){var n=this;n.MS(t),n.UO=t,n.sendEvent(e.STATE_CHANGED,t),n.NS(i)},_.prototype.getState=function(){return this.UO},_.prototype.NS=function(t){var i=this;switch(i.UO){case v.MEDIA_METADATA_LOADING:i.RS();break;case v.MEDIA_METADATA_LOADED:if(i.sendEvent(e.MEDIA_METADATA_LOADED),i.model.isDash()){i.sendMessage(g.MessageIds.DRM_INIT),i.AS(v.MEDIA_LOADED);break}i.AS(v.STREAM_METADATA_LOADING);break;case v.STREAM_METADATA_LOADING:i.pS.loadStream(i.model.getCurrentLoadingStream());break;case v.STREAM_METADATA_LOADED:i.AS(v.MEDIA_LOADED);break;case v.MEDIA_LOADED:if(w.android&&w.chrome&&i.model.drmInfo&&i.model.drmInfo.length)return;i.kS();break;case v.PRELOADING:i.pS.onPreloadBegin(),i.sendEvent(e.PRELOAD_START),i.yS.start();break;case v.PLAY_REQUESTED:i.yS.start(),i.pS.onPlay(t),i.gS||(i.mS.onPlayRequested(),i.gS=!0);break;case v.PLAYING:i.pS.onPlaying();break;case v.PLAY_COMPLETE:i.yS.stop(),i.pS.onComplete(),i.mS.onComplete();break;case v.ERROR:i.yS.stop(),i.pS.onError(),i.dS.removeAllCommands(),i.mS.onError()}},_.prototype._S=function(){var t=this,i=t.model.metadata;if(t.UO===v.INITIAL)return i.type===a.STRUCTURED?(t.model.build(t.vS.parse(i)),void(i.hasStreamMetadata?i.hasSubtitleMetadata?t.pS.loadAllSubtitleStreams():t.AS(v.MEDIA_LOADED):i.hasMediaMetadata&&t.AS(v.MEDIA_METADATA_LOADED))):void t.AS(v.MEDIA_METADATA_LOADING)},_.prototype.wS=function(){var t=this;t.UO<v.MEDIA_LOADED||(t.mS.checkBuffering(),t.pS.process())},_.prototype.onPlay=function(t){var i=this;i.UO===v.ERROR&&i.error&&i.notifyError(i.error),i.UO<v.MEDIA_LOADED||(i.UO===v.PRELOADING&&(i.pS.onPreloadEnd(),this.sendEvent(e.PRELOAD_COMPLETE)),i.AS(v.PLAY_REQUESTED,t))},_.prototype.onPlaying=function(){var t=this;t.UO<v.MEDIA_LOADED||(t.AS(v.PLAYING),t.mS.onPlaying())},_.prototype.onPause=function(){var t=this;t.UO<v.MEDIA_LOADED||(t.pS.onPause(),t.mS.onPause(),t.AS(v.PAUSED))},_.prototype.onSeeking=function(t){var i=this;i.UO<v.MEDIA_LOADED||(i.$O=!0,i.pS.onSeeking(t),i.mS.onSeeking())},_.prototype.onSeeked=function(t){var i=this;i.UO<v.MEDIA_LOADED||(i.$O=!1,i.pS.onSeeked(t),i.mS.onSeeked())},_.prototype.onComplete=function(){this.UO<v.MEDIA_LOADED||this.AS(v.PLAY_COMPLETE)},_.prototype.onError=function(t){this.AS(v.ERROR)},_.prototype.onTimeUpdate=function(t){var i=this;i.LS(t),i.mS.onTimeUpdate(),i.pS.onTimeUpdate(i.model.currentTime)},_.prototype.onUpdate=function(t){this.LS(t),this.mS.onTimeUpdate()},_.prototype.onSynchComplete=function(t){this.pS.onSynchComplete(),this.mS.onVideoSync(t)},_.prototype.onSynchMetadataReady=function(t){this.pS.onSynchMetadataReady(t)},_.prototype.LS=function(t){var i=this;t&&(i.model.currentTime=t.currentTime,i.model.bufferedAndPending=t.bufferedAndPending,i.model.bufferLength=t.bufferLength,i.model.pendingBufferLength=t.pendingBufferLength,i.model.bufferedRanges=t.bufferedRanges,i.model.dimensions=t.dimensions,i.model.pixelRatio=t.pixelRatio,i.services.segmentMetrics.updateFrameStats(t.frameStats))},_.prototype.RS=function(){var t=this,i=t.model.getMediaUrl(),n=i&&-1!==i.indexOf(".mpd"),e={url:i,withResponseHeaders:n};t.dS.executeCommand(c.CMD_MEDIA_LOAD,e,t)},_.prototype.onMediaLoadComplete=function(t,i){var n=this;if(t)if(i){var e={rawData:i.data,headers:i.headers,type:a.RAW,url:t.data?t.data.url:"",cdn:n.model.getMediaCdn()};n.model.build(n.vS.parse(e)),n.dS.removeCommand(t),n.AS(v.MEDIA_METADATA_LOADED)}else n.dS.removeCommand(t)},_.prototype.onMediaLoadError=function(t,i){var n=this;t&&n.dS.removeCommand(t),i&&1===i.code&&(n.AS(v.ERROR),n.notifyError(new r.Error(r.ERR_PLAYLIST_LOAD)))},_.prototype.SS=function(){this.UO<v.MEDIA_LOADED&&this.AS(v.STREAM_METADATA_LOADED)},_.prototype.TS=function(){this.AS(v.ERROR),this.notifyError(new r.Error(r.ERR_PLAYLIST_LOAD))},_.prototype.IS=function(){var t=this;t.UO===v.PRELOADING&&(t.AS(v.MEDIA_LOADED),t.sendEvent(e.PRELOAD_COMPLETE)),t.yS.reset()},_.prototype.jS=function(){this.mS.isBuffering()&&this.sendEvent(e.BUFFER_GROWTH_DETECTED)},_.prototype.DS=function(t){for(var i=Object.keys(v),n=0;n<i.length;n++)if(t===v[i[n]])return i[n]},_.prototype.preload=function(t){var i=this;t&&(i.model.config.preloadBufferLimit=t,i.model.bufferLength+i.model.pendingBufferLength<t&&i.UO===v.MEDIA_LOADED&&i.AS(v.PRELOADING))},_.prototype.setABRMode=function(t){this.UO<v.MEDIA_LOADED||this.pS.setABRMode(t)},_.prototype.setAudioLanguage=function(t){this.UO<v.MEDIA_LOADED||this.pS.setAudioLanguage(t)},_.prototype.setIgnoreBuffering=function(t){this.mS.setIgnoreBuffering(t)},_.prototype.getMinimumBufferTime=function(){return this.mS.getMinimumBufferTime()},_.prototype.suspendStreaming=function(){this.yS.stop(),this.pS.suspendStreaming()},_.prototype.resumeStreaming=function(){var t=this;t.UO!==v.PRELOADING&&t.UO!==v.PLAY_REQUESTED&&t.UO!==v.PLAYING&&t.UO!==v.PAUSED||(t.pS.resumeStreaming(),t.yS.start())},_.prototype.kS=function(){var t=this;t.pS.isInitialized()||(t.pS.init(),t.sendEvent(e.MEDIA_LOADED),!t.model.live&&t.model.bufferLength+t.model.pendingBufferLength<t.model.config.preloadBufferLimit&&t.AS(v.PRELOADING))},_.prototype.onGenerateRequestComplete=function(){this.kS()}},5902:function(t,i,n){"use strict";t.exports.Fmp4Streamer=f,t.exports.Fmp4LiveStreamer=l;var e=n(2990),r=n(7980),s=n(2350).Streamer,o=n(2701).CmdNames,u=n(2503).StreamTypes,h=n(5557),a=n(574).StreamingMode,c=n(6837);function f(t,i){var n=this;s.call(n,t,i),n.f_=n.constructor.super_.prototype,n.CS=null,n._y(t)}function l(t,i){var n=this;r.call(n,t,i),n.f_=n.constructor.super_.prototype,n.CS=null,n._y(t),n.SEGMENT_OFFSET=7}e.inherits(f,s),e.inherits(l,r),f.prototype.destroy=function(){s.prototype.destroy.call(this)},l.prototype.destroy=function(){r.prototype.destroy.call(this)},l.prototype._y=f.prototype._y=function(t){var i=this;i.PS(t);var n=[{type:i.PO,mimeType:i.PO+'/mp4; codecs="'+i.CO+'"',minBufferTime:i.__controller.getMinimumBufferTime()}];i.__controller.sendMessage(h.MessageIds.CREATE_SRC_BUFFER,[n],["tracks"])},l.prototype.PS=f.prototype.PS=function(t){var i=this;t.type===u.AUDIO?(i.CO=i._m.userAgent.android?"mp4a.40.2":t.audioCodec||"mp4a.40.2",i.PO="audio"):(i.CO=t.videoCodec||"avc1.640021",i.PO="video")},l.prototype.setCurrentStream=f.prototype.setCurrentStream=function(t){var i=this;t&&i.FO&&!t.equals(i.FO)&&(i.FO=t,i.UO===i.STATES.LOADING&&i.abortCurrentSegment(i.xS),i.isStreamReady()||(i.UO=i.STATES.NONE))},l.prototype.US=f.prototype.US=function(t,i,n,e){var r=this,s=r.FO;r.dS.removeRelatedCommands(o.CMD_MP4_INIT_SEGMENT_LOAD);var u={stream:s,segment:i,initSegment:t,comboLoad:n,cached:e};r.dS.executeCommand(o.CMD_MP4_INIT_SEGMENT_LOAD,u,r)},l.prototype.VS=f.prototype.VS=function(t){var i=this;if(!(i.UO>=i.STATES.INITIALIZING)){var n=c.isNullOrUndefined(t)?i.BS(i.FS):t,e=i.FO,r=n===e.startSeqNum,s=e.getSegmentfromSeqNum(n);if(s){var o=e.getInitSegment(s),u=!c.isNullOrUndefined(o);u||(o=e.addInitSegment(s.initSegment));var h=e.streamingMode===a.HLS&&!c.isNullOrUndefined(e.mp4Chunks.first);h&&(s=r?s:null),i.UO=i.STATES.INITIALIZING,s&&s.periodId!==i.CS&&i.zS(s.periodId),i.GS(s?s.periodId:null),i.US(o,s,h,u)}}},l.prototype.onMp4InitSegmentLoadProgress=f.prototype.onMp4InitSegmentLoadProgress=function(t,i){var n=this,e=n.FO;if(i&&e){var r=t.getSegment();if(i.comboLoad&&r&&"firstByte"===i.position)n.onSegmentLoadProgress(t,i);else{var s=i.chunk,o=i.stream;if(s&&o){var u=o.getInitSegment(r);switch(s.name){case"init":o.setMp4Timescale(u);break;case"sidx":var h=s.data;h&&o.updateSegmentRanges(n.HS.mp4BoxParser.parse(h,"sidx",o.sidxOffset));break;case"first":return void n.onSegmentLoadProgress(t,i)}e.equals(o)&&o.isReady()&&(n.YS(u),n.UO=n.STATES.INITIALIZED,i.comboLoad&&r&&(n.qS=r.seqNum,n.UO=n.STATES.LOADING))}}}},l.prototype.onMp4InitSegmentLoadComplete=f.prototype.onMp4InitSegmentLoadComplete=function(t,i){var n=this;if(i){var e=t.getSegment();i.comboLoad&&e?n.onSegmentLoadComplete(t):(n.UO<n.STATES.INITIALIZED&&n.FO.equals(i.stream)&&(n.UO=n.STATES.INITIALIZED),n.dS.removeCommand(t))}},l.prototype.onMp4InitSegmentLoadError=f.prototype.onMp4InitSegmentLoadError=function(t,i){this.dS.removeCommand(t)},l.prototype.onSegmentLoadProgress=f.prototype.onSegmentLoadProgress=function(t,i){var n=this,e=n.FO;if(i&&e){var r=i.stream;if(!r||e.equals(r)){if("firstByte"!==i.position){var o={data:new Uint8Array(i.data),codec:n.CO,type:n.PO,minBufferTime:n.__controller.getMinimumBufferTime(),frames:i.samples,startTime:e.timescale>0?i.baseTime/e.timescale:NaN,endTime:e.timescale>0?(i.baseTime+i.totalDuration)/e.timescale:NaN};n.WS([o])}s.prototype.onSegmentLoadProgress.call(n,t,i)}}},l.prototype.zS=f.prototype.zS=function(t){var i=this;if(i.CS!==t){i.CS=t;var n=i.FO;"MAIN"!==i.type&&"AUDIO"!==i.type||i.QS(t,n),i.GS(t)}},l.prototype.QS=f.prototype.QS=function(t,i){for(var n=this._m.streams,e=(this.type,0);e<n.length;e++)n[e].groupId;i.groupId},l.prototype.GS=f.prototype.GS=function(t){var i=this,n=i.FO;n&&n.drmInfo&&!c.isNullOrUndefined(t)&&n.drmInfo.forEach((function(n){n.periodId===t&&i.__controller.sendMessage(h.MessageIds.DRM_LICENSE_INFO,[n],["drmItem"])}))},l.prototype.YS=f.prototype.YS=function(t){var i=this,n=i.FO;if(t){var e=t.data;if(e){var r={data:new Uint8Array(e.buffer),codec:i.CO,type:i.PO,minBufferTime:i.__controller.getMinimumBufferTime(),onlyMetadata:!0};i.WS([r]),n.activeInitSegment=t;var s=n?n.getMp4Chunk("sidx"):null;if(s){var o=s.data;o&&(r.data=new Uint8Array(o.buffer),i.WS([r]))}}}},l.prototype.GO=f.prototype.GO=function(t,i){},l.prototype.VO=f.prototype.VO=function(t){var i=this,n=i.FO.getSegmentfromSeqNum(t);n&&n.periodId!==i.CS&&i.zS(n.periodId),i.UO=i.STATES.NONE,i.XS=!0,i.qS=t,i.VS(t)},f.prototype.onSynchBegin=function(){this.processOnlyMetadata=!0},l.prototype.HO=function(t){var i=this;i.lastChunkEndTs={audio:NaN,video:NaN},i.f_.HO.call(i,t)}},6888:function(t,i,n){"use strict";t.exports.Fmp4SubtitleStreamer=a,t.exports.Fmp4SubtitleLiveStreamer=c;var e=n(2990),r=n(5902).Fmp4Streamer,s=n(5902).Fmp4LiveStreamer,o=n(2835),u=n(6837),h=n(7650).HLSEvent;function a(t){r.call(this,t),this._y()}function c(t){s.call(this,t),this._y()}e.inherits(a,r),e.inherits(c,s),a.prototype.destroy=function(){var t=this;t.ZS=null,t._="",r.prototype.destroy.call(t)},c.prototype.destroy=function(){var t=this;t.ZS=null,t._="",s.prototype.destroy.call(t)},c.prototype._y=a.prototype._y=function(){var t=this;t.PO="subtitle",t.ZS=new o,t.$S()},c.prototype.VO=a.prototype.VO=function(t){this.$S(),r.prototype.VO.call(this,t)},c.prototype.onSegmentLoadProgress=a.prototype.onSegmentLoadProgress=function(t,i){var n=this,e=n.FO;if(i&&e&&e.timescale){var r=i.stream;if((!r||e.equals(r))&&"firstByte"!==i.position){var s=n.ZS.extractVttCaptions(i.data);if(s.length){var o=n.ZS.parse(i.data,"trun"),u=o?o.sampleData:[];if(u.length===s.length){var h=n.ZS.parse(i.data,"tfdt"),a=h?h.baseMediaDecodeTime:0,c=a=1e3*a/e.timescale;s.forEach((function(t,i){var r=u[i],s=r?1e3*r.sampleDuration/e.timescale:0;if(t.cueText){var o=n.JS(t.cueTime)+a,h=null!==o?o+s:c+s;n._+="\n"+n.KS(o)+" --\x3e "+n.KS(h),n._+="\n"+t.cueText+"\n"}c+=s})),n._+="\n"}}}}},c.prototype.onSegmentLoadComplete=a.prototype.onSegmentLoadComplete=function(t,i){var n=this,e=n.FO;if(e){var r=e.getSegmentfromSeqNum(n.qS);r&&n.__controller.sendEvent(h.VTT_SEGMENT_LOADED,n.tT(r))}n.f_.onSegmentLoadComplete.call(n,t,i),n._=""},c.prototype.$S=a.prototype.$S=function(){this._="WEBVTT\nX-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:0\n\n"},c.prototype.JS=a.prototype.JS=function(t){var i=null;if(!t)return i;var n=t.split(":");if(n&&n.length>=3){var e=n[2].split("."),r=0,s=0;e&&e.length>=2&&(r=parseInt(e[0]),s=parseInt(e[1])),i=1e3*(3600*n[0]+60*n[1]+r)+s}return i},c.prototype.KS=a.prototype.KS=function(t){var i="";if(u.isNullOrUndefined(t))return i;function n(t){return t<10?"0"+t:""+t}var e=Math.floor(t/1e3),r=Math.floor(t-1e3*e),s=Math.floor(e/3600);e-=3600*s;var o,h=Math.floor(e/60);return e-=60*h,i=n(s)+":"+n(h)+":"+n(e)+"."+((o=r)<10?"00"+o:o<100?"0"+o:""+o)},c.prototype.tT=a.prototype.tT=function(t){var i={};return t&&(i.discontinuity=t.discontinuity,i.sequenceNum=t.seqNum,i.startTime=t.startTime,i.programDateTime=t.programDateTime,i.url=t.url,i.duration=t.duration,i.clockReference=0,i.localCueTime=0,i.mpegTSTime=0,i.data=this._,i.offset=0,i.adjustedTime=0),i},c.prototype.GO=a.prototype.GO=function(){},c.prototype.YS=a.prototype.YS=function(t){this.FO.activeInitSegment=t},c.prototype.GS=a.prototype.GS=function(){}},8630:function(t,i,n){"use strict";t.exports.W=h;var e=n(2990),r=n(7572),s=n(258),o=n(2701).CmdNames,u=n(902);function h(t,i,n){var e=this;e.iT=o.CMD_LICENSE_LOAD,e.LICENSE_TYPE_NONE=0,e.LICENSE_TYPE_WIDEVINE=1,e.LICENSE_TYPE_PLAYREADY=2,e.nT=0,e.playreadyKeySystem={keySystem:"com.microsoft.playready",supportedConfig:[{initDataTypes:["keyids","cenc"],audioCapabilities:[{contentType:'audio/mp4; codecs="mp4a"',robustness:""}],videoCapabilities:[{contentType:'video/mp4; codecs="avc1"',robustness:""}]}]},e.widevineKeySystem={keySystem:"com.widevine.alpha",supportedConfig:[{label:"foo",initDataTypes:["cenc"],sessionTypes:["temporary"],audioCapabilities:[{contentType:'audio/mp4; codecs="mp4a.40.5"',robustness:"SW_SECURE_CRYPTO"}],videoCapabilities:[{contentType:'video/mp4; codecs="avc1.640028"',robustness:"HW_SECURE_ALL"},{contentType:'video/mp4; codecs="avc1.640028"',robustness:"SW_SECURE_CRYPTO"},{contentType:'video/mp4; codecs="avc1.4d001f"',robustness:"HW_SECURE_ALL"},{contentType:'video/mp4; codecs="avc1.4d001f"',robustness:"SW_SECURE_CRYPTO"},{contentType:'video/mp4; codecs="avc1.42000d"',robustness:"HW_SECURE_ALL"},{contentType:'video/mp4; codecs="avc1.42000d"',robustness:"SW_SECURE_CRYPTO"}]}]},e.LICENSE_STATUS_DONE="DONE",e.LICENSE_STATUS_LOADING="LOADING",e.LICENSE_STATUS_NEW="NEW_REQ",e.dS=t.create(s),e.eT=[],window.addEventListener("beforeunload",e.rT.bind(e)),e.sT=i,e.Z_=n,e.oT=null,e.uT=null,e.hT=null,e.aT=[],e.cT=new u(250),e.cT.addEventListener(e.fT,e),e.lT=0,e.LE=t,e.vT()}h.prototype.addDrmItem=function(t){var i=this;e.isDrmItemContained(t,i.aT)||(t.status=i.LICENSE_STATUS_NEW,i.aT.push(t),i.dT(i))},h.prototype.vT=function(){var t=this;t.uT=null,navigator.requestMediaKeySystemAccess?navigator.requestMediaKeySystemAccess(t.widevineKeySystem.keySystem,t.widevineKeySystem.supportedConfig).then((function(i){t.nT=t.LICENSE_TYPE_WIDEVINE,t.Z_.appModel.licenseType="widevine",i.createMediaKeys().then((function(i){t.pT(t,i)}),(function(){t.hT={type:r.ERR_DRM_INIT,message:"LicenseManager - createMediaKeys() failed for Widevine"}}))}),(function(){navigator.requestMediaKeySystemAccess(t.playreadyKeySystem.keySystem,t.playreadyKeySystem.supportedConfig).then((function(i){t.nT=t.LICENSE_TYPE_PLAYREADY,t.Z_.appModel.licenseType="playready",i.createMediaKeys().then((function(i){t.pT(t,i)}),(function(){t.hT={type:r.ERR_DRM_INIT,message:"LicenseManager - createMediaKeys() failed for PlayReady"}}))}),(function(){t.hT={type:r.ERR_DRM_CONFIG,message:"LicenseManager - Your browser/system does not support the requested configurations for playing DRM protected content."}}))})):t.hT={type:r.ERR_DRM_EME_MISSING,message:"LicenseManager - Browser EME components not detected! (also check URL for HTTPS)"}},h.prototype.pT=function(t,i){t.uT=i,t.cT.start()},h.prototype.fT=function(){var t=this;t.sT.mediaKeys||(t.cT.stop(),t.sT.setMediaKeys(t.uT).then((function(){t.dT(t)}),(function(i){t.hT={type:r.ERR_DRM_INIT,message:"LicenseManager - "+i}})))},h.prototype.dT=function(t){if(null===t.uT&&null!==t.hT)return t.mT(t.hT.type,t.hT.message),void(t.hT=null);if(null!==t.uT)for(var i=0;i<t.aT.length;i++){var n=t.aT[i];n.status===t.LICENSE_STATUS_NEW&&(t.nT===t.LICENSE_TYPE_WIDEVINE?(n.widevine.initData=e.base64ToBuffer(n.widevine.pssh),n.widevine.initDataType="cenc",n.status=t.LICENSE_STATUS_LOADING,t.bT(t,n.widevine)):t.nT===t.LICENSE_TYPE_PLAYREADY&&(n.playready.initData=e.base64ToBuffer(n.playready.pssh),n.playready.initDataType="cenc",n.status=t.LICENSE_STATUS_LOADING,t.bT(t,n.playready)))}},h.prototype.bT=function(t,i){var n=t.uT.createSession("temporary");t.eT.push(n),n.addEventListener("message",(function(n){t.gT(t,i,n)}),!1);var e=n.generateRequest(i.initDataType,i.initData);e.then((function(){t.lT++,t.lT===t.aT.length&&t.LE.onGenerateRequestComplete()})),e.catch((function(i){t.mT(r.ERR_DRM_LICENSE_REQUEST,"LicenseManager - keySession.generateRequest() failed: "+i)}))},h.prototype.yT=function(t,i){return t.nT===t.LICENSE_TYPE_PLAYREADY?i.prefix+"/pr":t.nT===t.LICENSE_TYPE_WIDEVINE?i.prefix+"/wv":""},h.prototype.gT=function(t,i,n){var e=t.yT(t,i),r=t.wT(t,n.message);t.dS.executeCommand(t.iT,{challenge:r.challenge,headerFields:r.headerFields,url:e,drmInfo:i,event:n},t)},h.prototype.wT=function(t,i){var n,s={};if(t.nT===t.LICENSE_TYPE_PLAYREADY){var o=(new DOMParser).parseFromString(String.fromCharCode.apply(null,new Uint16Array(i)),"application/xml");o.getElementsByTagName("Challenge")[0]?n=e.base64ToBuffer(o.getElementsByTagName("Challenge")[0].childNodes[0].nodeValue).buffer:t.mT(r.ERR_DRM_LICENSE_REQUEST,"LicenseManager - Cannot find <Challenge> in key message");var u=o.getElementsByTagName("name"),h=o.getElementsByTagName("value");u.length!==h.length&&t.mT(r.ERR_DRM_LICENSE_REQUEST,"LicenseManager - Playready: Mismatched header <name>/<value> pair in key message");for(var a=0;a<u.length;a++)s[u[a].childNodes[0].nodeValue]=h[a].childNodes[0].nodeValue}else t.nT===t.LICENSE_TYPE_WIDEVINE&&(n=i);return{challenge:n,headerFields:s}},h.prototype.onLicenseLoadComplete=function(t,i){var n=this,e=t.data?t.data.event:null,s=t.data?t.data.drmInfo:null;e.target.update(i.data).catch((function(t){n.mT(r.ERR_DRM_LICENSE_REQUEST,"LicenseManager - call to MediaKeySession.update() failed: "+t)}));for(var o=0;o<n.aT.length;o++)n.aT[o].widevine.pssh!==s.pssh&&n.aT[o].playready.pssh!==s.pssh||(n.aT[o].status=n.LICENSE_STATUS_DONE)},h.prototype.onLicenseLoadError=function(){this.mT(r.ERR_XHR_LOAD,"LicenseManager - XHR failed")},h.prototype.mT=function(t,i){var n=new r.Error(t,i);this.Z_.notifyError(n)},h.prototype.rT=function(){for(var t=this,i=0;i<t.eT.length;i++)t.eT[i].close().then((function(){}));t.eT=[]},h.prototype.destroy=function(){var t=this;t._T=null,t.uT=null,t.aT=[],t.rT(),t.cT.destroy()}},7980:function(t,i,n){"use strict";t.exports=l;var e=n(2990),r=n(2350),s=r.Streamer,o=r.Events,u=r.SynchTypes,h=n(902),a=n(7650).HLSEvent,c=n(2503).StreamTypes,f=n(6837);function l(t,i){var n=this;s.call(n,t,i),n._h={},n._h[a.MEDIA_LOADED]=n.__controller.addEventListener(a.MEDIA_LOADED,n.eO,n),n.DEFAULT_STREAM_UPDATE_INTERVAL=8e3,n.MAX_STREAM_UPDATE_INTERVAL=1e4,n.PAST_BUFFER_LENGTH_LIMIT=n._m.config.pastBufferLengthLimit.live,n.LONG_PAUSE_INTERVAL=24e3,n.ET=new h(n.DEFAULT_STREAM_UPDATE_INTERVAL),n.ET.addEventListener(n.AT,n),n.dE=null,n.OT=null,n.ST=!1,n.TT=new h(n.LONG_PAUSE_INTERVAL,1),n.TT.addEventListener(n.IT,n)}e.inherits(l,s),l.prototype.destroy=function(){var t=this;t.ET.destroy(),t.TT.destroy(),t.__controller.removeEventListeners(t._h),s.prototype.destroy.call(t)},l.prototype.onPlay=function(t){var i=this;if(i.jT(),i.MT()){var n=i.OT?u.TIME_GAP:u.INIT;i.HO(n),i.process(i.FS),i.OT=null}else i.NT&&(i.FS=t,i.CE=!1,i.process(i.FS),i.OT=null);s.prototype.onPlay.call(i),i.TT.stop()},l.prototype.onPause=function(){var t=this;t.OT=Date.now(),t.TT.start(),s.prototype.onPause.call(t)},l.prototype.onSeeking=function(t){var i=this;i.RT(!1),i.ST&&(i.kT(),i.process(t))},l.prototype.onSynchComplete=function(){var t=this;t.dE=null,t.FS=null,t.type===c.MAIN&&t._m.setLivePlaybackStartTime(null)},l.prototype.suspendStreaming=function(){this.ET&&this.ET.stop()},l.prototype.resumeStreaming=function(){this.ET&&this.ET.start()},l.prototype.MT=function(){var t=this;if(!t.OT)return!0;if(this._m.config.streamSynch)return!1;var i=t.FO,n=i&&i.targetDuration?3*i.targetDuration*1e3:t.LONG_PAUSE_INTERVAL;return Date.now()-t.OT>n},l.prototype.HO=function(t){var i=this;if(i._m.hasEndlist)i.RT(!0);else{var n=i.FO;if(n.segments.length&&!f.isNullOrUndefined(n.endSeqNum)&&!f.isNullOrUndefined(n.startSeqNum)){var e=i.LT(),r=n.getSegmentfromSeqNum(e);i.FS=r?r.startTime:null,i.dE=i.FS,n.type===c.MAIN&&i._m.setLivePlaybackStartTime(i.dE);var s=i._m.userAgent;i.ST=s&&s.safariDesktop&&t===u.TIME_GAP,i.publish(o.LIVE_SYNCH,i,{synchPosition:i.dE,synchType:t})}}},l.prototype.IT=function(){},l.prototype.DT=function(){var t=this;return!t.CT&&t.UO!==t.STATES.LOADING&&!t.CE&&!t.PT()},l.prototype.xT=function(){var t=this;t.isActive()&&(!t.UT&&t.UO!==t.STATES.INITIALIZING||t.VT||(t.AT(),t.jT()))},l.prototype.LT=function(){var t=this,i=t.FO,n=t._m.getLivePlaybackStartTime();return i.type===c.MAIN||f.isNullOrUndefined(n)?Math.max(i.endSeqNum-t.SEGMENT_OFFSET,i.startSeqNum):i.getSeqNumBeforePosition(n)},l.prototype.BT=function(t){return t},l.prototype.onStreamLoaded=function(t){this.jT(),s.prototype.onStreamLoaded.call(this,t)},l.prototype.eO=function(){this.jT()},l.prototype.jT=function(){var t,i,n=this;n._m.hasEndlist||n.FO.isDash()&&n.type!==c.MAIN?n.ET.destroy():(t=n.ET.startTime>0?Date.now()-n.ET.startTime:0,n.ET.reset(),i=n._m.getStreamRefreshInterval()||n.DEFAULT_STREAM_UPDATE_INTERVAL,i-=t,i=Math.max(i,100),i=Math.min(i,n.MAX_STREAM_UPDATE_INTERVAL),n.ET.delay=i,n.ET.start())},l.prototype.FT=function(){var t=this,i={url:t.FO.url,withResponseHeaders:t._m.isDash()};return t.CE&&(i.stopStreamLoadOnError=!0,i.maxRetries=1),i},l.prototype.stopStreamUpdate=function(){this.ET.reset()},l.prototype.canSwitch=function(t){var i=this;return!i.dE&&("mid-segment"!==t||i.UO===i.STATES.LOADING)},l.prototype.zT=function(){var t=this,i=t.FO;i&&i.endSeqNum===t.qS&&t._m.hasEndlist&&t.RT(!0)}},2440:function(t,i,n){"use strict";var e=n(27),r=n(5985),s=n(5902),o=n(9112),u=n(6888),h=n(2503).StreamTypes,a=e.TsStreamer,c=e.TsLiveStreamer,f=r.SubtitleStreamer,l=r.SubtitleLiveStreamer,v=s.Fmp4Streamer,d=s.Fmp4LiveStreamer,p=o.AacStreamer,m=o.AacLiveStreamer,b=u.Fmp4SubtitleStreamer,g=u.Fmp4SubtitleLiveStreamer;t.exports.create=function(t,i,n){if(!t||!i||"function"!=typeof t.create)return null;var e,r=i.type===h.SUBTITLES;switch(i.containerFormat){case"vtt":e=n?l:f;break;case"aac":e=n?m:p;break;case"mp4":e=r?n?g:b:n?d:v;break;case"ts":e=n?c:a}return e?t.create(e,i):null}},2350:function(t,i,n){"use strict";t.exports.Streamer=b;var e=n(2990),r=n(2999),s=n(2701).CmdNames,o=n(7572),u=n(7650).HLSEvent,h=n(4361),a=h.StreamLoader,c=h.Events,f=n(5557),l=n(258),v=n(2503).StreamTypes,d=n(5877),p=t.exports.Events={SEG_LOAD_START:"streamerSegLoadStart",SEG_LOAD_PROGRESS:"streamerSegLoadProgress",SEG_LOAD_COMPLETE:"streamerSegLoadComplete",SEG_LOAD_ERROR:"streamerSegLoadError",PRELOAD_COMPLETE:"streamerPreloadComplete",STREAM_LOAD_COMPLETE:"StreamLoadComplete",STREAM_LOAD_ERROR:"StreamLoadError",LIVE_SYNCH:"streamerLiveSynch"},m=t.exports.SynchTypes={INIT:"synchAtInit",TIME_GAP:"synchAtTimeGap"};function b(t){var i=this,n=i.__controller;r.call(i,i.constructor.name),i._m=n.model,i.HS=n.services,i.dS=n.create(l),i.GT=n.create(a,i.dS),i.GT.addEventListener(c.STREAM_LOADED,i.onStreamLoaded,i),i.GT.addEventListener(c.STREAM_LOAD_ERROR,i.onStreamLoadError,i),i.AVG_BW_MEASUREMENT_INTERVAL=30,i.HT=0,i.YT=0,i.iT=s.CMD_SEGMENT_LOAD,i.FO=t,i.type=t?t.type:null;var e=t.altRenditionGroups&&t.altRenditionGroups.SUBTITLES&&t.altRenditionGroups.SUBTITLES.hasStreams();i.type&&i.type!==v.VIDEO&&i.type!==v.MAIN||e||(i.qT=[],i.WT=new d(i.sendVttEventCB.bind(i))),i.STATES={ERROR:-1,NONE:0,INITIALIZING:1,INITIALIZED:2,LOADING:3},i.UO=i.STATES.NONE,i.VT=!1,i.QT=!1,i.qS=NaN,i.gO=!1,i.FS=null,i.CE=!1,i.XT=i._m.config.maxBuffer,i.ZT=i._m.live,i.$T=!1,i.NT=!1,i.JT={audio:NaN,video:NaN},i.UT=!1,i.n_=[403]}e.inherits(b,r),b.prototype.destroy=function(){var t=this;t.GT.destroy(),t.UO=t.STATES.NONE,t.FO=null,t.dS&&(t.dS.destroy(),t.dS=null),r.prototype.destroy.call(t)},b.prototype.setCurrentStream=function(t){var i=this;t&&!t.equals(i.FO)&&(i.FO=t,i.onSwitchBegin())},b.prototype.isActive=function(){var t=this;return t.FO&&t.FO.url&&t.FO.url.length>0},b.prototype.setAltAudioActive=function(t){this.$T=t},b.prototype.getCurrentStream=function(){return this.FO},b.prototype.process=function(t,i){var n=this;if("number"==typeof t&&(n.FS=t),n.isStreamReady()||n.UO===n.STATES.ERROR){if(n.DT()){var e=n.BS(n.FS,i),r=n.KT(e);"empty"!==r?"ahead"!==r&&("behind"!==r?n.DT()&&(n.FS=null,n.tI(e)):n.HO(m.TIME_GAP)):n.xT()}}else n.VS()},b.prototype.suspendStreaming=b.prototype.resumeStreaming=function(){},b.prototype.onPlay=function(t){var i=this;i.CE=!1,i.XT=i._m.config.maxBuffer,t&&i.onSynchBegin()},b.prototype.onPlaying=function(){this.NT=!1},b.prototype.onPause=function(){this.CE=!0},b.prototype.onSeeking=function(t){var i=this;i.kT(),i.RT(!1),i.process(t)},b.prototype.onSeeked=function(){},b.prototype.onError=function(){this.dS&&this.dS.removeAllCommands()},b.prototype.onComplete=function(){},b.prototype.onTimeUpdate=function(t){var i=this;if(i.YT){var n=t-i.YT;n>0&&(i.HT+=n)}i.HT>i.AVG_BW_MEASUREMENT_INTERVAL&&(i.hO(i.HS.bandwidthEstimator.averageBandwidth),i.HT=0),i.YT=t},b.prototype.onPreloadBegin=function(){var t=this;t.QT=!0,t.XT=t._m.config.preloadBufferLimit},b.prototype.onPreloadEnd=function(){this.QT=!1},b.prototype.HO=function(){},b.prototype.isStreamReady=function(){var t=this,i=t.FO;return i&&i.isReady()&&t.UO>=t.STATES.INITIALIZED},b.prototype.VS=function(){var t=this;t.isActive()&&(t.UO=t.STATES.INITIALIZING,t.xT())},b.prototype.DT=function(){var t=this,i=t.PT(),n=t._m.config.stopBufferingOnPause;return t.QT&&i&&t.publish(p.PRELOAD_COMPLETE,t),!t.gO&&t.UO!==t.STATES.LOADING&&((!t.CE||!n)&&(!i&&!t.iI()))},b.prototype.KT=function(t){var i=this.FO;if(!i||i.isEmpty()||isNaN(t))return"empty";if(!i.contains(t)){if(t<i.startSeqNum)return"behind";if(t>i.endSeqNum)return"ahead"}return"available"},b.prototype.PT=function(){var t=this;if(t.type&&t._m.bufferedAndPending){var i={buffered:0,pending:0},n=t._m.bufferedAndPending.video||i;return t.type!==v.MAIN&&t.type!==v.VIDEO&&(n=t._m.bufferedAndPending.audio||i),n.buffered+n.pending>=t.XT}return t._m.bufferLength+t._m.pendingBufferLength>=t.XT},b.prototype.iI=function(){var t=this._m;return t.getTotalBufferLength()>=t.config.maxTotalBuffer},b.prototype.onSwitchBegin=function(){this.UT=!0,this.xT()},b.prototype.onSwitchEnd=function(){this.UT=!1},b.prototype.xT=function(){this.VT||this.AT()},b.prototype.AT=function(){var t=this;t.isActive()&&(t.VT=!0,t.GT.load(t.FO,t.FT()))},b.prototype.FT=function(){var t=this;return{url:t.FO.url,retryExclusion:t.n_,withResponseHeaders:t._m.isDash()}},b.prototype.onStreamLoaded=function(t){var i=this;i.UO===i.STATES.INITIALIZING&&(i.UO=i.STATES.INITIALIZED),i.VT=!1,i.publish(p.STREAM_LOAD_COMPLETE,i,{stream:t.dto()})},b.prototype.onStreamLoadError=function(t,i){var n=this;i.code===o.ERR_XHR_LOAD_LIVE_PAUSE[0]&&n.stopStreamUpdate(),n.publish(p.STREAM_LOAD_ERROR,n,{err:i,stream:t}),n.UO=n.STATES.ERROR,n.VT=!1,n.process()},b.prototype.BS=function(t,i){var n=this,e=n.FO,r=NaN;return r="number"==typeof t?e.getSeqNumBeforePosition(t+n._m.TIMESTAMP_COMPARE_EPSILON):isNaN(n.qS)?n.LT():n.UO===n.STATES.ERROR||n.XS?n.qS:n.qS+1,i||(r=n.BT(r)),n.ZT||(r=Math.max(r,e.startSeqNum),r=Math.min(r,e.endSeqNum)),r},b.prototype.BT=function(t){var i=this,n=i.FO,e=i._m.bufferedRanges,r=e.length,s=i.nI(t),o=i._m.userAgent;if(o&&o.safariDesktop)return t;if(i._m.isDash())return t;if(s>=0&&r&&s<r){var u=e.ranges[s].end;return!i.ZT&&u>=i._m.duration?(i.RT(!0),n.endSeqNum):n.getSeqNumBeforePosition(u)}return t},b.prototype.LT=function(){return this.FO.getSeqNumBeforePosition(0)},b.prototype.nI=function(t){var i=this,n=i.FO.getSegmentfromSeqNum(t);if(!n)return-1;for(var e=i._m.TIMESTAMP_COMPARE_EPSILON,r=i._m.bufferedRanges,s=0;s<r.length;s++){var o=r.ranges[s],u=o.start-e,h=o.end+e;if(u=0===n.startTime&&u<.1?0:u,n.startTime>=u&&n.startTime+n.duration<=h)return s}return-1},b.prototype.VO=function(){},b.prototype.tI=function(t){var i=this;if(i.VO(t),!(i.UO<i.STATES.INITIALIZED)){i.kT(),i.UO=i.STATES.LOADING,i.qS=t,i.XS=!1,i._m.updateCurrentLoadingSeqNum(i.qS);var n=i.eI(i.qS);n&&(i.GO(n,i.FO),i.publish(p.SEG_LOAD_START,i),i.rI(t))}},b.prototype.rI=function(){},b.prototype.eI=function(t){var i=this,n=i.BO(t),e=n?n.segment:null;return e?(i.xS=i.dS.executeCommand(i.iT,n,i),e):null},b.prototype.BO=function(t){var i=this.FO;return i?{segment:i.getSegmentfromSeqNum(t),stream:i}:null},b.prototype.onSegmentLoadProgress=function(t,i){var n,e,r,s,o,u=this;if(i)if(i.id!==f.MessageIds.TIMED_METADATA){i.getParam?(n=i.getParam("tracks"),e=i.getParam("perfInfo"),r=i.getParam("bytesTotal")||0,s=i.getParam("parsedInfo"),o=i.getParam("cea608TrackData")):i.cea608TrackData&&(o=i.cea608TrackData);var h=s?s.position:i.position,a=s&&s.inWorkerScope||!1;switch(u.publish(p.SEG_LOAD_PROGRESS,u,{seqNum:u.qS,position:h,bytesTotal:r,inWorkerScope:a,perfInfo:e}),u._m.preloading=u.QT,h){case"firstByte":return;case"start":break;case"end":u.UO===u.STATES.LOADING&&(u.UO=u.STATES.INITIALIZED)}if(n&&(n.forEach((function(t){t.minBufferTime=u.__controller.getMinimumBufferTime(),u.JT[t.type]=t.endTimestamp})),u.WS(n,i.getParam("transferables"))),u.qT&&o&&o.length>0)for(var c=0;c<o.length;c++)u.qT.push(o[c]);"end"===h&&(u._m.setSegEndTimeStamps(u.type,u.FO.groupId,u.qS,u.JT),u.JT.audio=NaN,u.JT.video=NaN)}else{var l=i.getParam("timedMetadata");u._m.updateTimedMetadata(l,u.qS)}},b.prototype.onSegmentLoadComplete=function(t){var i=this;if(i.UO===i.STATES.LOADING&&(i.UO=i.STATES.INITIALIZED),i.qT&&i.qT.length>0){for(var n=[],e=0;e<i.qT.length;e++){for(var r=i.qT[e],s=0;s<n.length&&r.pts>=n[s].pts;)s++;n.splice(s,0,r)}var o=i.FO.getSegmentfromSeqNum(i.qS);i.WT.parse(n,o),i.qT=[]}i.dS.removeCommand(t),i.zT(),i.publish(p.SEG_LOAD_COMPLETE,i,{stream:i.FO}),i.xS=null},b.prototype.onSegmentLoadError=function(t,i){var n=this;n.abortCurrentSegment(t),n.xS=null;var e=i&&i.code===o.ERR_XHR_LOAD[0]?new o.Error(o.ERR_SEGMENT_LOAD):i;n.publish(p.SEG_LOAD_ERROR,n,{seqNum:n.qS,err:e,stream:n.FO})},b.prototype.abortCurrentSegment=function(t){var i=this;return i.UO!==i.STATES.LOADING?null:(t&&i.dS.removeCommand(t),i.UO===i.STATES.LOADING&&(i.UO=i.STATES.INITIALIZED),i.XS=!0,i.JT.audio=NaN,i.JT.video=NaN,i.qS)},b.prototype.kT=function(){var t=this;t.UO===t.STATES.LOADING&&(t.UO=t.STATES.INITIALIZED),t.JT.audio=NaN,t.JT.video=NaN,t.dS.removeRelatedCommands(t.iT)},b.prototype.WS=function(t,i){t&&this.__controller.sendMessage(f.MessageIds.APPEND_SRC_BUFFER,[t],["tracks"],i)},b.prototype.RT=function(t){var i=this;i.gO=t,i.JT.audio=NaN,i.JT.video=NaN,i.type===v.MAIN&&i.__controller.sendMessage(f.MessageIds.END_OF_STREAM,[t],["endOfStream"])},b.prototype.zT=function(){var t=this,i=t.FO;i&&i.endSeqNum===t.qS&&t.RT(!0)},b.prototype.hO=function(t){var i={avgBWtimestamp:Date.now(),avgBW:t};this.type===v.MAIN&&this.__controller.sendMessage(f.MessageIds.SAVE_AVG_BANDWIDTH,[i],["avgBwInfo"])},b.prototype.onManualStreamChange=function(){var t=this;t.RT(!1),t.NT=!0,t.kT(),t.GT.cancel(),t.VT=!1,t.UO=t.UO!==t.STATES.ERROR?t.STATES.INITIALIZING:t.UO,t.xT()},b.prototype.midSegUpSwitch=function(){var t=this;t.xS&&t.abortCurrentSegment(t.xS),t.GT.cancel(),t.VT=!1,t.xT(),t.process(t.YT,!0)},b.prototype.onSynchBegin=function(){},b.prototype.onSynchComplete=function(){},b.prototype.onSynchMetadataReady=function(t){var i=this;i.kT(),i.RT(!1),i.process(t)},b.prototype.canSwitch=function(t){return"mid-segment"!==t||this.UO===this.STATES.LOADING},b.prototype.isInError=function(){return this.UO===this.STATES.ERROR},b.prototype.getSegLoadCommand=function(){return this.dS.getCommand(this.iT)},b.prototype.GO=function(){},b.prototype.sendVttEventCB=function(t){this.__controller.sendEvent(u.VTT_SEGMENT_LOADED,t)}},6972:function(t,i,n){"use strict";t.exports.StreamingController=y;var e=n(2350).Events,r=n(2440),s=n(4571),o=n(1811),u=n(902),h=n(4361),a=h.StreamLoader,c=h.Events,f=n(2503).StreamTypes,l=n(2990),v=n(2999),d=n(7650).HLSEvent,p=n(258),m=n(574).AbrModes,b=n(5557),g=t.exports.Events={STREAM_METADATA_LOADED:"streamMetadataLoaded",STREAM_METADATA_LOAD_ERROR:"streamMetadataLoadError",PRELOAD_COMPLETE:"preloadComplete",SEG_LOAD_PROGRESS:"streamingControllerSegLoadProgress"};function y(){var t=this;v.call(t,t.constructor.name),t._m=t.__controller.model,t.HS=t.__controller.services,t.dS=t.__controller.create(p),t.sI=t.HS.segmentMetrics,t.oI={},t.uI=0,t.hI=0,t.aI={},t.cI=null,t.fI=0,t.FAST_UP_SWITCH_INTERVAL=.3,t.EO=t.__controller.create(o,t.dS),t.EO.addEventListener(t.EO.SWITCH_ON_ERROR,t.lI,t),t.K_=t.__controller.create(s),t.K_.addEventListener(t.K_.SWITCH_BEGIN,t.vI,t),t.K_.addEventListener(t.K_.SWITCH_END,t.dI,t),t.pI=new u(1e3*t._m.config.segmentLoadMonitorInterval),t.pI.addEventListener(t.mI,t),t.bI=new u(1e3*t.FAST_UP_SWITCH_INTERVAL),t.bI.addEventListener(t.gI,t),t.yI={},t.SE=[],t.CE=!1,t.UT=!1,t.NT=!1,t.wI=t.K_.SCENARIOS.STARTUP,t.STATES={ERROR:-1,INITIAL:0,STREAM_METADATA_LOADED:1,INITIALIZED:2},t.UO=t.STATES.INITIAL}l.inherits(y,v),y.prototype.loadStream=function(t){var i=this;t&&i.UO===i.STATES.INITIAL&&(i._I(t).load(t),i.uI++,Object.keys(t.altRenditionGroups).forEach((function(n){var e=t.getAlternateStream(n);e&&e.url&&(i._I(e).load(e),i.uI++)})))},y.prototype.loadAllSubtitleStreams=function(){var t=this;if(t.UO===t.STATES.INITIAL){var i=[];t._m.streams.forEach((function(n){var e=n.getAlternateStream(f.SUBTITLES);e&&i.indexOf(e.url)<0&&(i.push(e.url),t._I(e).load(e),t.uI++)})),t.UO=t.STATES.STREAM_METADATA_LOADED,t.publish(g.STREAM_METADATA_LOADED)}},y.prototype._I=function(t){var i=this,n=i.__controller.create(a,i.dS);return n.addEventListener(c.STREAM_LOADED,i.EI,i),n.addEventListener(c.STREAM_LOAD_ERROR,i.AI,i),i.oI[t.url]=n,t.type===f.SUBTITLES&&i.hI++,n},y.prototype.OI=function(){var t=this;Object.keys(t.oI).forEach((function(i){var n=t.oI[i];n&&n.destroy()})),t.oI={},t.uI=0},y.prototype.EI=function(t){var i=this;if(t){var n=i.oI[t.url];if(n){if(i.UO>=i.STATES.STREAM_METADATA_LOADED)return n.destroy(),delete i.oI[t.url],void i._m.synchStreamTimelines(t.type);t.type!==f.SUBTITLES&&i.hI++,i.hI>=i.uI&&(i.UO=i.STATES.STREAM_METADATA_LOADED,i._m.synchStreamTimelines(),i.publish(g.STREAM_METADATA_LOADED)),n.destroy(),delete i.oI[t.url]}}},y.prototype.AI=function(t,i){var n=this;t&&t.type===f.SUBTITLES||(n.UO=n.STATES.ERROR,n.publish(g.STREAM_METADATA_LOAD_ERROR,i))},y.prototype.init=function(){var t=this;if(t.UO!==t.STATES.ERROR&&t.UO!==t.STATES.INITIALIZED){var i=t._m.getCurrentLoadingStream();if(i){t.hI=0;var n=t.SI(i);n.addEventListener(e.PRELOAD_COMPLETE,t.IS,t),n.addEventListener(e.LIVE_SYNCH,t._A,t),t.aI.MAIN=n,t.cI=n,t.fI++,Object.keys(i.altRenditionGroups).forEach((function(n){var e=i.getAlternateStream(n);if(e){var r=t.SI(e);r&&(t.aI[n]=r,t.fI++)}})),t.TI(),t.II(),t.UO=t.STATES.INITIALIZED}}},y.prototype.isInitialized=function(){return this.UO>=this.STATES.INITIALIZED},y.prototype.SI=function(t){var i=this;if(!t)return null;var n=r.create(i.__controller,t,i._m.live);return i.jI(n),n},y.prototype.MI=function(){var t=this;Object.keys(t.aI).forEach((function(i){t.aI[i].destroy()})),t.aI={},t.cI=null},y.prototype.jI=function(t){var i=this;if(t){var n={};n[e.SEG_LOAD_START]=i.NI,n[e.SEG_LOAD_PROGRESS]=i.jS,n[e.SEG_LOAD_COMPLETE]=i.RI,n[e.SEG_LOAD_ERROR]=i.kI,n[e.STREAM_LOAD_ERROR]=i.LI,n[e.STREAM_LOAD_COMPLETE]=i.DI,Object.keys(e).forEach((function(r){var s=e[r];t.addEventListener(s,n[s],i)}))}},y.prototype.TI=function(){var t=this,i=t.aI.AUDIO;t.cI&&t.cI.setAltAudioActive(i&&i.isActive())},y.prototype.CI=function(){var t=this,i=Array.prototype.slice.call(arguments),n=i.shift(),e=t.cI;e&&e[n]&&"function"==typeof e[n]&&e[n].apply(e,i),Object.keys(t.aI).forEach((function(r){r!==f.MAIN&&(e=t.aI[r])&&e[n]&&"function"==typeof e[n]&&e[n].apply(e,i)}))},y.prototype.process=function(){var t=this;t.CI("process"),t.wI=t.K_.SCENARIOS.LOAD},y.prototype.suspendStreaming=function(){this.CI("suspendStreaming")},y.prototype.resumeStreaming=function(){this.CI("resumeStreaming")},y.prototype.setABRMode=function(t){var i=this,n=i._m;n.setABRMode(t)&&n.getABRMode()!==m.AUTO&&(i.xI("video"),i.UT=!1,i.II())},y.prototype.xI=function(t){var i=this;i.NT=!0,i.__controller.sendMessage(b.MessageIds.PAUSE_BEFORE_STREAM_CHANGE,[t],["streamType"]),i.CI("onManualStreamChange")},y.prototype.setAudioLanguage=function(t){var i=this,n=i._m;if(n.setAudioLanguage(t)){i.xI("audio");var e=f.AUDIO,r=n.getCurrentLoadingStream(),s=r?r.getAlternateStream(e):null,o=i.aI[e];s&&o&&o.setCurrentStream(s),i.TI()}},y.prototype.getMetrics=function(){return this.sI.getMetrics()},y.prototype.onPlay=function(t){var i=this;i.pI.start(),i.UI()?(i.CI("onPlay",t),i.CE=!1,i.NT=!1):i.SE.push([i,i.onPlay,[t]])},y.prototype.onPlaying=function(){this.CI("onPlaying"),this.bI.start()},y.prototype.onPause=function(){var t=this;t.pI.stop(),t.CI("onPause"),t.CE=!0},y.prototype.onSeeking=function(t){var i=this;i._m.live||i.II(),i.CI("onSeeking",t)},y.prototype.onSeeked=function(t){this.CI("onSeeked",t)},y.prototype.onComplete=function(){this.sI.onComplete(),this.CI("onComplete")},y.prototype.onError=function(){this.CI("onError")},y.prototype.onTimeUpdate=function(t){this.CI("onTimeUpdate",t),this.sI.onTimeUpdate(t)},y.prototype.onSynchMetadataReady=function(t){this.II(),this.CI("onSynchMetadataReady",t)},y.prototype.onSynchComplete=function(){this.CI("onSynchComplete")},y.prototype.onPreloadBegin=function(){this.CI("onPreloadBegin")},y.prototype.onPreloadEnd=function(){this.CI("onPreloadEnd")},y.prototype.lI=function(t){var i=this;i.UT=!1,i.II(i.K_.SCENARIOS.ERROR,{index:t})},y.prototype.vI=function(){var t=this,i=t._m.getCurrentLoadingStream();t.UT=!0,t.cI.setCurrentStream(i),Object.keys(i.altRenditionGroups).forEach((function(n){var e=i.getAlternateStream(n);e&&t.aI[n]&&t.aI[n].setCurrentStream(e)})),t.TI()},y.prototype.dI=function(){this.UT=!1,this.CI("onSwitchEnd")},y.prototype.mI=function(){var t=this,i=t.cI?t.cI.getSegLoadCommand():null;i&&t.II(t.K_.SCENARIOS.MIDSEGMENT,{command:i,position:i.position})},y.prototype.gI=function(){var t=this;t.UT=!1,t.II(),t._m.getCurrentLoadingStream().bitrate>t._m.getCurrentPlayingStream().bitrate&&(t.bI.reset(),t.CI("midSegUpSwitch"))},y.prototype.VI=function(t,i,n,e,r){var s=this,o=s._m.getCurrentLoadingStream(),u=o?o.getSegmentfromSeqNum(i):null,h={bitrateIndex:o?o.index:0,frameRate:o?o.frameRate:30,bytesTotal:n};"firstByte"===t?(h.beginTime=u?u.startTime:NaN,h.switchReason="none",h.observedBitrate=s.HS.bandwidthEstimator.averageBandwidth,h.timeToFirstByte=u?u.timeToFirstByte:NaN,h.endTime=u?u.startTime+u.duration:NaN,h.programDateTime=u?u.programDateTime:NaN,s.sI.segmentLoadBegin(i,h)):"end"===t&&(h.perfInfo=r,h.timeToDownload=u?u.totalDownloadTime:NaN,h.segmentInWorker=!!e,s.sI.segmentLoadEnd(i,h))},y.prototype.BI=function(){var t=this;t.pI.reset(),t.CE||t.EO.running||t.pI.start()},y.prototype.II=function(t,i){var n=this;if(t=t||n.wI,!n.UT)if(t!==n.K_.SCENARIOS.MIDSEGMENT){var e=i?i.index:null;n.K_.switchStream(t,null,e)}else{var r=i?i.command:null,s=i?i.position:null;n.FI(t,r,s)}},y.prototype.FI=function(t,i,n){var e=this;if("end"!==n&&(e.cI&&e.cI.canSwitch(t)&&e.K_.switchStream(t,"down"))){var r=e.cI.abortCurrentSegment(i);r&&e.VI("end",r),e.process()}},y.prototype.NI=function(){this.BI()},y.prototype.jS=function(t,i){var n=this;if(n.zI(t)&&i){n.publish(g.SEG_LOAD_PROGRESS,i.bytesTotal),"firstByte"===i.position&&n.K_.switchComplete();var e=i.position,r=i.bytesTotal,s=i.inWorkerScope,o=i.perfInfo,u=i.seqNum;n.VI(e,u,r,s,o),n.BI()}},y.prototype.RI=function(t){var i=this;i.GI(),i.zI(t)&&i.II()},y.prototype.kI=function(t,i){var n=this;n.zI(t)&&n.VI("end",i.seqNum),n.HI(i.err,i.stream)},y.prototype.DI=function(t,i){var n=this;if(n.GI(),n.zI(t)||n._m.synchStreamTimelines(t.type),n.__controller.sendEvent(d.STREAM_UPDATED,i),n.SE.length>0&&n.KE(),n.NT){for(var e=0,r=Object.keys(n.aI),s=0;s<n.fI;s++)n.aI[r[s]].isActive()&&e++;++n.hI>=e&&(n.hI=0,n.__controller.sendMessage(b.MessageIds.PLAY_AFTER_STREAM_CHANGE))}},y.prototype.LI=function(t,i){this.HI(i.err,i.stream)},y.prototype.HI=function(t,i){this.pI.stop(),this.EO.handle(t,i)},y.prototype.GI=function(){var t=this,i=!0;t.EO.running&&(Object.keys(t.aI).forEach((function(n){var e=t.aI[n],r=e?e.getCurrentStream():null;r&&r.type!==f.SUBTITLES&&(i=i&&!e.isInError())})),i&&(t.EO.onLoadComplete(),t.BI()))},y.prototype.IS=function(){this.onPreloadEnd(),this.publish(g.PRELOAD_COMPLETE)},y.prototype._A=function(t,i){this.zI(t)&&this.__controller.sendEvent(d.LIVE_SYNCH,i)},y.prototype.zI=function(t){return t&&t.type===f.MAIN},y.prototype.UI=function(){var t=this;if(t.UO!==t.STATES.INITIALIZED)return!1;var i=!0;return Object.keys(t.aI).forEach((function(n){if(n!==f.SUBTITLES){var e=t.aI[n];i=i&&(!e.isActive()||e.isStreamReady())}})),i},y.prototype.KE=function(){var t=this.SE;this.SE=[],t.forEach((function(t){var i=t[0],n=t[1],e=t.length>2?t[2]:null;n&&"function"==typeof n&&n.apply(i,e)}))},y.prototype.destroy=function(){var t=this;t.MI(),t.OI(),t.EO&&(t.EO.destroy(),t.EO=null),t.dS&&(t.dS.destroy(),t.dS=null),t.K_&&(t.K_.destroy(),t.K_=null),t.bI&&(t.bI.destroy(),t.bI=null),t.sI&&(t.sI.destroy(),t.sI=null),t.pI.destroy(),t.SE=[],v.prototype.destroy.call(t)}},5985:function(t,i,n){"use strict";t.exports.SubtitleStreamer=h,t.exports.SubtitleLiveStreamer=a;var e=n(2990),r=n(2350).Streamer,s=n(7980),o=n(2701).CmdNames,u=n(7650).HLSEvent;function h(t,i){this.DO(t,i)}function a(t,i){this.DO(t,i)}e.inherits(h,r),e.inherits(a,s),a.prototype.DO=h.prototype.DO=function(t,i){var n=this;n.constructor.super_.call(n,t,i),n.f_=n.constructor.super_.prototype,n.YI={},n.iT=o.CMD_SUBTITLE_SEGMENT_LOAD,n.primary=!1,n.UO=t.isReady()?n.STATES.INITIALIZED:n.STATES.NONE},a.prototype.destroy=h.prototype.destroy=function(){var t=this;t.YI={},t.f_.destroy.call(t)},a.prototype.onPlay=h.prototype.onPlay=function(t){this.f_.onPlay.call(this,t)},a.prototype.onTimeUpdate=h.prototype.onTimeUpdate=function(t){this.YT=t},a.prototype.PT=h.prototype.PT=function(){var t=this;return t.qI(t.YT)>=t.XT},a.prototype.iI=h.prototype.iI=function(){return this.qI()>=this._m.config.maxTotalBuffer},a.prototype.BO=h.prototype.BO=function(t){var i=this.FO;return i?{subtitleStream:i,segment:i.getSegmentfromSeqNum(t),live:this._m.live}:{}},a.prototype.onSubtitleSegmentLoadComplete=h.prototype.onSubtitleSegmentLoadComplete=function(t,i){var n=this;if(i){var e=i.data;n.__controller.sendEvent(u.VTT_SEGMENT_LOADED,e),n.YI[e.sequenceNum]={start:e.startTime,end:e.startTime+e.duration}}n.f_.onSegmentLoadComplete.call(n,t)},a.prototype.onSubtitleSegmentLoadError=h.prototype.onSubtitleSegmentLoadError=function(t){var i=this;i.UO=i.STATES.NONE,i.dS.removeCommand(t)},a.prototype.BT=h.prototype.BT=function(t){var i=this,n=i.FO,e=t;if(!isNaN(e))for(;i.YI[e];)e++;return!i.ZT&&e>n.endSeqNum?(i.RT(!0),n.endSeqNum):e},a.prototype.qI=h.prototype.qI=function(t){var i=this.FO,n=i.getSeqNumBeforePosition(t);if(isNaN(n))return 0;for(var e=0;n<=i.endSeqNum;n++){var r=this.YI[n];if(!r)break;e=r.end-t}return e},a.prototype.WI=h.prototype.WI=function(){var t=this,i=0;return Object.keys(t.YI).forEach((function(n){var e=t.YI[n];e&&(i+=e.end-e.start)})),i},a.prototype.GO=h.prototype.GO=function(){this.FO},a.prototype.nI=h.prototype.nI=function(){},a.prototype.WS=h.prototype.WS=function(){},a.prototype.onSynchMetadataReady=h.prototype.onSynchMetadataReady=function(){},a.prototype.setABRMode=h.prototype.setABRMode=function(){},a.prototype.canSwitch=h.prototype.canSwitch=function(){return!0}},4571:function(t,i,n){"use strict";t.exports=h;var e=n(1426),r=n(574).AbrModes,s=n(2999),o=n(2990),u=n(7650).HLSEvent;function h(){var t=this;t._m=t.__controller.model,t.QI=t.__controller.create(e),t.XI={estimatedBandwidthInBps:0,bitrateList:[],currentIndex:0,bufferLength:0},t._h={},t.eO(),t.SWITCH_BEGIN="switchBegin",t.SWITCH_END="switchEnd",t.SCENARIOS={STARTUP:"startup",LOAD:"load",ERROR:"error",MIDSEGMENT:"mid-segment"},t.switching=!0,s.call(t,t.constructor.name),t._h[u.MEDIA_LOADED]=t.__controller.addEventListener(u.MEDIA_LOADED,t.eO,t)}o.inherits(h,s),h.prototype.destroy=function(){var t=this;t.QI.destroy(),t.__controller.removeEventListeners(t._h),s.prototype.destroy.call(t)},h.prototype.switchStream=function(t,i,n){var e=this;e._m.getABRMode()!==r.AUTO&&e._m.streams.forEach((function(t,i){e._m.getUserReqBitrate()===t.bitrate&&(n=i)}));var s=e._m.currentLoadingStreamIndex,o=e.ZI(),u=e.$I(n,t,o);return!(u<0)&&(u!==s&&((!i||!("up"===i&&u<s||"down"===i&&u>s))&&(e._m.setCurrentLoadingStream(u),e.switching=!0,e.publish(e.SWITCH_BEGIN,u),!0)))},h.prototype.$I=function(t,i,n){return"number"==typeof t?t:this.QI.getNextStreamIndex(n,i===this.SCENARIOS.STARTUP)},h.prototype.switchComplete=function(){var t=this;t.switching=!1,t.publish(t.SWITCH_END)},h.prototype.ZI=function(){var t=this;t.JI();var i=t.XI,n=t.__controller.services.bandwidthEstimator,e=t._m.dimensions;return i.estimatedBandwidthInBps=1e3*n.averageBandwidth*1e3,i.currentIndex=t._m.currentLoadingStreamIndex,i.bufferLength=t._m.bufferLength,i.displayWidth=isNaN(e.width)?640:e.width,i.displayHeight=isNaN(e.height)?360:e.height,i.pixelRatio=t._m.pixelRatio,i.is360=t._m.is360,i.streams=t._m.streams,i.segmentLength=t._m.getSegmentLength(),i},h.prototype.eO=function(){this.JI()},h.prototype.JI=function(){var t=this;t._m.streams&&!t.XI.bitrateList.length&&(t.XI.bitrateList=[],t._m.streams.forEach((function(i){t.XI.bitrateList.push("VBR"===i.rcMode.toUpperCase()?i.avgBitrate:i.bitrate)})))}},27:function(t,i,n){"use strict";t.exports.TsStreamer=a,t.exports.TsLiveStreamer=c;var e=n(2990),r=n(2350).Streamer,s=n(7980),o=n(2701).CmdNames,u=n(6837),h=n(5557);function a(t,i){this.DO(t,i)}function c(t,i){this.DO(t,i),this.SEGMENT_OFFSET=2}e.inherits(a,r),e.inherits(c,s),c.prototype.DO=a.prototype.DO=function(t,i){var n=this;n.constructor.super_.call(n,t,i),n.f_=n.constructor.super_.prototype,n.processOnlyMetadata=!1,n.lastChunkEndTs={audio:NaN,video:NaN},n.lastFrameDuration={audio:NaN,video:NaN},n.xO(),n.iT=o.CMD_SEGMENT_LOAD,n.primary=!0;var e=n.__controller.getMinimumBufferTime(),r=[{codec:"avc1.640021",type:"video",mimeType:'video/mp4; codecs="avc1.640021"',minBufferTime:e}];t&&t.hasAudio&&r.push({codec:"mp4a.40.2",type:"audio",mimeType:'audio/mp4; codecs="mp4a.40.2"',minBufferTime:e}),n.__controller.sendMessage(h.MessageIds.CREATE_SRC_BUFFER,[r],["tracks"]),n.UO=n.STATES.INITIALIZED},c.prototype.destroy=a.prototype.destroy=function(){var t=this;t.xO(),t.f_.destroy.call(t)},c.prototype.onSeeking=a.prototype.onSeeking=function(t){var i=this;i.lastChunkEndTs={audio:NaN,video:NaN},i.f_.onSeeking.call(i,t)},c.prototype.onSwitchBegin=a.prototype.onSwitchBegin=function(){var t=this;t.xO(),t.f_.onSwitchBegin.call(t)},c.prototype.VO=a.prototype.VO=function(){this.xO()},c.prototype.BO=a.prototype.BO=function(t){var i=this;return{segment:i._m.getSegment(i._m.currentLoadingStreamIndex,t),stream:i.FO,state:{mp4:i.zO,lastChunkEndTs:i.lastChunkEndTs,lastFrameDuration:i.lastFrameDuration,isAltAudioActive:i.$T},onlyMetadata:i.processOnlyMetadata}},c.prototype.onSegmentLoadProgress=a.prototype.onSegmentLoadProgress=function(t,i,n){var e=this;if(i){var r=i.getParam?i.getParam("parsedInfo"):null;r&&(u.isNumber(r.pcr)&&e._m.setPCR(r.pcr),u.isNumber(r.frameRate)&&e.FO.setFrameRate(r.frameRate),u.isNumber(r.startOffsetTimestamp)&&e._m.setStartOffset(r.startOffsetTimestamp),r.lastChunkEndTs&&(e.lastChunkEndTs=r.lastChunkEndTs),r.lastFrameDuration&&(e.lastFrameDuration=r.lastFrameDuration)),e.f_.onSegmentLoadProgress.call(e,t,i,n)}},c.prototype.WS=a.prototype.WS=function(t,i){var n=this;t&&(n.f_.WS.call(n,t,i),t.forEach((function(t){n.zO[t.type].shouldInit=!1})))},c.prototype.onSynchMetadataReady=a.prototype.onSynchMetadataReady=function(t){var i=this;i.processOnlyMetadata=!1,i.f_.onSynchMetadataReady.call(i,t)},c.prototype.onManualStreamChange=a.prototype.onManualStreamChange=function(){var t=this;t.xO(),t.lastChunkEndTs={audio:NaN,video:NaN},t.f_.onManualStreamChange.call(t)},c.prototype.midSegUpSwitch=a.prototype.midSegUpSwitch=function(){var t=this;t.xO(),t.lastChunkEndTs={audio:NaN,video:NaN},t.f_.midSegUpSwitch.call(t)},c.prototype.xO=a.prototype.xO=function(){this.zO={audio:{shouldInit:!0,seqNum:0},video:{shouldInit:!0,seqNum:0}}},c.prototype.GO=a.prototype.GO=function(t,i){},a.prototype.onSynchBegin=function(){this.processOnlyMetadata=!0},c.prototype.HO=function(t){var i=this;i.lastChunkEndTs={audio:NaN,video:NaN},i.f_.HO.call(i,t)}},7572:function(t){"use strict";var i="api",n="network",e="decode";function r(t,i){var n=this;n.code=t[0],n.message=t[1],n.type=t[2],n.isDrm=t[3],i&&(n.message+=": "+i),n.error=new Error(n.message,n.code)}t.exports={Error:r,ERR_XHR_LOAD:[11,"Failed to load xhr request",n,!1],ERR_PLAYLIST_LOAD:[12,"Failed to load Playlist",n,!1],ERR_SUBS_LOAD:[13,"Failed to load Subtitle",n,!1],ERR_SEGMENT_LOAD:[14,"Failed to load Segment",n,!1],ERR_PARTIAL_LOAD:[15,"Loader failed to load complete data",n,!1],ERR_MASTER_PLAYLIST_PARSE:[16,"Failed to parse Master Playlist",e,!1],ERR_MEDIA_PLAYLIST_PARSE:[17,"Failed to parse Media Playlist",e,!1],ERR_SEGMENT_PARSE:[18,"Failed to parse segment data",e,!1],ERR_API_NO_NODE:[19,"No video node is being set",i,!1],ERR_MIMETYPE_NOT_SUPPORTED:[20,"Mimetype is not supported in current browser",e,!1],ERR_XHR_LOAD_LIVE_PAUSE:[21,"Failed to load xhr request during live pause",n,!1],ERR_DRM_EME_MISSING:[22,"Browser EME components not detected or HTTPS required",e,!0],ERR_DRM_INIT:[23,"Failed to initialize DRM components",e,!0],ERR_DRM_CONFIG:[24,"Browser/system does not support the requested DRM configurations",e,!0],ERR_DRM_LICENSE_REQUEST:[25,"Failed to get DRM license",e,!0],ERR_XHR_LOAD_FORBIDDEN:[27,"Forbidden to load xhr request",n,!1]},r.prototype.dto=function(){var t=this;return{code:t.code,message:t.message,type:t.type,isDrm:t.isDrm}}},7650:function(t,i){"use strict";i.HLSEvent={STATE_CHANGED:"stateChanged",PRELOAD_PROGRESS:"preloadProgress",MEDIA_LOADED:"mediaLoaded",MEDIA_METADATA_LOADED:"mediaMetadataLoaded",STREAM_UPDATED:"streamUpdated",INFO_UPDATE:"infoUpdate",SEGMENT_FIRST_BYTE_LOADED:"segmentFirstByteLoaded",SEGMENT_RENDERED:"segmentRendered",VTT_SEGMENT_LOADED:"vttSegmentLoaded",PCR_AVAILABLE:"pcrAvailable",STREAM_SWITCHED:"streamSwitched",LIVE_LOADING_LATE:"liveLoadingLate",LIVE_SYNCH:"liveSynch",WAITING:"hlsWaiting",CUEPOINT_DETECTED:"cuepointDetected",CUEPOINT_STARTED:"cuepointStarted",ABR_DATA_UPDATED:"abrDataUpdated",ERROR:"error",SEG_INFO_METRICS_AVAILABLE:"segInfoMetricsAvailable",CONTENT_LOAD_FINISHED:"contentLoadFinished",PRELOAD_START:"preloadStart",PRELOAD_COMPLETE:"preloadComplete",CC_VTT_AVAILABLE:"ccVttAvailable",BUFFER_GROWTH_DETECTED:"bufferGrowthDetected",MULTI_LANGUAGES_AVAILABLE:"multiLanguagesAvailable",TIMED_METADATA_READY:"timedMetadataReady",PLAY_BLOCKED:"playbackBlocked",BUFFER_GAP_DETECTED:"bufferGapDetected",DATE_RANGE_STARTED:"daterangeStarted",DATE_RANGE_ENDED:"daterangeEnded",STREAM_SYNCH_COMPLETE:"streamsynchComplete",STREAM_SYNCH_STRATEGY_APPLIED:"streamsynchStrategyApplied"},i.ExternalEvents=[i.HLSEvent.MEDIA_LOADED,i.HLSEvent.MEDIA_METADATA_LOADED,i.HLSEvent.INFO_UPDATE,i.HLSEvent.VTT_SEGMENT_LOADED,i.HLSEvent.SEGMENT_FIRST_BYTE_LOADED,i.HLSEvent.SEGMENT_RENDERED,i.HLSEvent.STREAM_SWITCHED,i.HLSEvent.LIVE_LOADING_LATE,i.HLSEvent.STREAM_UPDATED,i.HLSEvent.WAITING,i.HLSEvent.CUEPOINT_DETECTED,i.HLSEvent.CUEPOINT_STARTED,i.HLSEvent.ABR_DATA_UPDATED,i.HLSEvent.PRELOAD_PROGRESS,i.HLSEvent.SEG_INFO_METRICS_AVAILABLE,i.HLSEvent.CONTENT_LOAD_FINISHED,i.HLSEvent.PRELOAD_START,i.HLSEvent.PRELOAD_COMPLETE,i.HLSEvent.CC_VTT_AVAILABLE,i.HLSEvent.BUFFER_GROWTH_DETECTED,i.HLSEvent.MULTI_LANGUAGES_AVAILABLE,i.HLSEvent.TIMED_METADATA_READY,i.HLSEvent.PLAY_BLOCKED,i.HLSEvent.BUFFER_GAP_DETECTED,i.HLSEvent.DATE_RANGE_STARTED,i.HLSEvent.DATE_RANGE_ENDED,i.HLSEvent.STREAM_SYNCH_COMPLETE,i.HLSEvent.STREAM_SYNCH_STRATEGY_APPLIED]},3713:function(t,i,n){"use strict";t.exports=s;var e=n(2990),r=n(4892);function s(t,i){var n=this;t.noDemux=!0,n.constructor.super_.call(n,t,i),n.f_=n.constructor.super_.prototype}e.inherits(s,r),s.prototype.destroy=function(){this.f_.destroy.call(this)}},1811:function(t,i,n){"use strict";t.exports=u;var e=n(2999),r=n(2990),s=n(2701).CmdNames,o=n(2503).StreamTypes;function u(t){var i=this;i._m=i.__controller.model,i.dS=t,i.SWITCH_ON_ERROR="switchOnError",i.iE=null,e.call(i,i.constructor.name),i.running=!1}r.inherits(u,e),u.prototype.destroy=function(){var t=this;t._m=null,t.dS=null,t.iE=null,t.running=!1},u.prototype.handle=function(t,i){var n=this;if(t&&i&&i.type!==o.SUBTITLES){var e=i.index;n.iE=t;var r={streamIndex:e,error:t};n.running=!0;var u=n.dS.getCommand(s.CMD_ERROR_HANDLE);u?u.execute(e):n.dS.executeCommand(s.CMD_ERROR_HANDLE,r,n)}},u.prototype.onErrorHandleProgress=function(t,i){this.publish(this.SWITCH_ON_ERROR,i.index)},u.prototype.onErrorHandleError=function(t){var i=this;i.running=!1,i.dS.removeCommand(t),i.__controller.notifyError(i.iE)},u.prototype.onLoadComplete=function(){var t=this;t.running=!1;var i=t.dS.getCommand(s.CMD_ERROR_HANDLE);t.dS.removeCommand(i)}},1511:function(t,i,n){"use strict";t.exports=h;var e=n(4892),r=n(5557),s=n(2990),o=n(867),u=n(3789);function h(t,i){var n=this;if(n._m=n.__controller.model,n.IE=n._m.config.useWorker,n.KI=n._m.userAgent,n.fE="HlsTransformer",n.lE=s.guid(),n.fS=t,n.lS=i,n.MIN_BUFFER_LENGTH=5,n.jE()){if(n.ME=n.__controller.services.getWorker(n.fE),n.ME)return n.ME.addEventListener("message",n.RE.bind(n)),void n.kE(r.MessageIds.CREATE,[t]);n._m.config.useWorker=!1}n._j=new e(t,i),n.IE=!1}h.prototype.destroy=function(){var t=this;t.IE&&t.ME?t.kE(r.MessageIds.DESTROY):t._j.destroy()},h.prototype.close=function(){var t=this;t.IE&&t.ME?t.kE(r.MessageIds.CALL_METHOD,null,"close"):t._j.close()},h.prototype.append=function(t){var i=this;i.IE&&i.ME?i.kE(r.MessageIds.CALL_METHOD,[t],"append",[t.buffer]):i._j.append(t)},h.prototype.endOfSegment=function(){var t=this;t.IE&&t.ME?t.kE(r.MessageIds.CALL_METHOD,null,"endOfSegment"):t._j.endOfSegment()},h.prototype.RE=function(t){if(t){var i=t.data?new u(t.data):t;if(i&&i.instanceId===this.lE&&(i.id===r.MessageIds.APPEND_SRC_BUFFER||i.id===r.MessageIds.TIMED_METADATA)){var n=i.getParam("parsedInfo");n&&(n.inWorkerScope=!0),this.lS(i)}}},h.prototype.jE=function(){var t=this;return!!t.IE&&(t.KI.chrome&&!t.KI.win7?t.IE=!(t.__controller&&t.__controller.getState()>=o.PLAY_REQUESTED)||t._m.bufferLength>t.MIN_BUFFER_LENGTH:t.IE=!1,t.IE)},h.prototype.kE=function(t,i,n,e){var s=this;if(s.ME&&t){var o={type:r.MessageTypes.MESSAGE,id:t,moduleName:s.fE,instanceId:s.lE,funcName:n,args:i,timestamp:Date.now()};s.ME.postMessage(o,e)}}},4892:function(t,i,n){"use strict";t.exports=h;var e=n(8457),r=n(5328),s=n(6837),o=n(5557),u=n(3789);function h(t,i){var n=this;n.fS=t,n.lS=i,n.Yj=t.noDemux?null:new e(t.demux,n.processSegmentData.bind(n)),n.tM=new r,n.DEFAULT_WIDTH=640,n.DEFAULT_HEIGHT=360,n.GAP_EPSILON=100,n.iM=n.fS.startOffsetTimestamp,n.nM=n.fS.lastChunkEndTs||{audio:NaN,video:NaN},n.eM=n.fS.lastFrameDuration||{audio:NaN,video:NaN},n.$T=n.fS.isAltAudioActive,n.rM=n.fS.prevSegEndTimeStamps;var s=n.fS.mp4State;n.sM={audio:!s||!s.audio||s.audio.shouldInit,video:!s||!s.video||s.video.shouldInit},n.oM={audio:0,video:0},n.uM={audio:{dts:NaN,pts:NaN},video:{dts:NaN,pts:NaN}}}h.prototype.destroy=function(){var t=this;t.Yj&&(t.Yj.destroy(),t.Yj=null),t.tM.destroy()},h.prototype.close=function(){this.Yj&&this.Yj.destroy()},h.prototype.append=function(t){this.Yj&&this.Yj.append(t)},h.prototype.endOfSegment=function(){this.Yj&&this.Yj.endOfSegment()},h.prototype.processSegmentData=function(t){var i=this;if(t&&!t.error){var n,e=t.avData,r=t.pos,s=t.timedMetadata,h=i.fS.startTime,a=i.fS.timescale,c=0;if(e){var f=i.fS.pcr;(null==f||isNaN(f))&&(i.fS.pcr=f=e.pcr-h*a);var l=[],v=e.audio,d=e.video,p=null,m=[];if(v&&v.frames&&v.frames.length&&!i.$T&&(v.type="audio",v.config.timescale=a,v.config.duration=i.fS.duration*v.config.timescale,v.config.useEditBox=i.fS.useEditBox,c=i.hM("audio",v.frames[0],f,h,a),v.frames.forEach((function(t){t.dts-=c,t.pts-=c})),v.startTime=v.frames[0].dts,v.endTime=v.frames[v.frames.length-1].dts,l.push(v)),d&&d.frames&&d.frames.length){if(d.type="video",d.config.timescale=a,d.config.duration=i.fS.duration*d.config.timescale,d.config.width=i.fS.width||i.DEFAULT_WIDTH,d.config.height=i.fS.height||i.DEFAULT_HEIGHT,d.config.useEditBox=i.fS.useEditBox,d.frames.length>1){var b=d.frames[1].dts-d.frames[0].dts;d.config.frameRate=d.config.timescale/b,i.fS.frameRate=d.config.frameRate}c=i.hM("video",d.frames[0],f,h,a),d.frames.forEach((function(t){t.dts-=c,t.pts-=c})),d.startTime=d.frames[0].dts,d.endTime=d.frames[d.frames.length-1].dts,p=d.frames[0].pts,l.push(d);for(var g=0;g<d.frames.length;g++)for(var y=0;y<d.frames[g].cea608Data.length;y++){var w=d.frames[g].cea608Data[y];w.pts=d.frames[g].pts,w.dts=d.frames[g].dts,w.timescale=d.config.timescale,m.push(w)}}n=new u({type:o.MessageTypes.MESSAGE,id:o.MessageIds.APPEND_SRC_BUFFER});var _={};_.position=i.position=r,_.pcr=f,_.frameRate=i.fS.frameRate,"number"!=typeof i.iM&&"number"==typeof p&&(i.iM=p),_.startOffsetTimestamp=i.iM;var E=i.aM(l);_.lastChunkEndTs=i.nM,_.lastFrameDuration=i.eM,n.putParam("parsedInfo",_);var A=[];E&&E.tracks&&(n.putParam("tracks",E.tracks),E.tracks.forEach((function(t){A.push(t.data.buffer)})),m&&m.length>0&&n.putParam("cea608TrackData",m),n.putParam("transferables",A))}else{if(!s)return;var O=s.pts-i.fS.pcr;c=this.cM(O,h,a),s.timestamp=(O-c)/a,delete s.pts,(n=new u({type:o.MessageTypes.MESSAGE,id:o.MessageIds.TIMED_METADATA})).putParam("timedMetadata",s)}i.lS&&i.lS(n)}},h.prototype.hM=function(t,i,n,e,r){var s=this,o=s.uM[t];isNaN(o.dts)&&isNaN(o.pts)&&(s.uM[t]={dts:i.dts-n,pts:i.pts-n});var u=s.oM[t];return 0!==u?u+n:(s.oM[t]=s.cM(s.uM[t].dts,e,r),s.oM[t]+n)},h.prototype.cM=function(t,i,n){var e=this;if(!e.fS.discontinuity)return 0;var r=e.rM?e.rM.audio:NaN;return t-(i=isNaN(r)?i*n:r)},h.prototype.aM=function(t){var i=this;if(t&&t.length){var n={tracks:[]};return t.forEach((function(t){if(t){t.config.offset=i.fS.live?0:i.iM;var e=i.fS.mp4State,r=i.sM[t.type];t.config.shouldInit=s.isNullOrUndefined(r)?"start"===i.position:r,t.config.seqNum=e[t.type]?e[t.type].seqNum++:0,"video"===t.type?t.config.defaultFrameDuration=i.fS.timescale/i.fS.frameRate:"audio"===t.type&&(t.config.defaultFrameDuration=Math.ceil(1024*i.fS.timescale/t.config.samplingFreq)),i.fM(t.type,t.frames,t.config.defaultFrameDuration),i.sM[t.type]=!1,i.fS.onlyMetadata&&(t.frames=[]);var o=i.tM.generate(t);o.onlyMetadata=i.fS.onlyMetadata,n.tracks.push(o)}})),n}},h.prototype.fM=function(t,i,n){var e=this;if(i&&i.length){var r=i[i.length-1].dts,o=i[0].dts;if(s.isNumber(e.nM[t])&&!isNaN(e.nM[t])){var u=o-e.nM[t],h=Math.ceil(2*e.eM[t])-e.GAP_EPSILON,a=Math.ceil(10*e.eM[t]);if(u>h);else if(u<e.eM[t]-e.GAP_EPSILON&&"audio"===t){var c=e.nM[t]+e.eM[t];c-o>n&&(c=o+n-1),i[0].pts=c,i[0].dts=i[0].pts}if(u>h&&u<a)for(var f=Math.floor(u/n),l=0;l<f;l++){var v=i[0].pts,d=i[0].dts;i.unshift(s.deepCopy(i[0])),i[0].pts=v-n,i[0].dts=d-n}}e.nM[t]=r,e.eM[t]=n}}},6473:function(t){"use strict";t.exports=i;function i(){}i.prototype.lM=function(t,i){for(var n=this,e=i,r=0;n.vM(t,i);)r+=10,r+=n.dM(t,i+6),n.pM(t,i+10)&&(r+=10),i+=r;return r>0?t.subarray(e,e+r):null},i.prototype.vM=function(t,i){return i+10<=t.length&&73===t[i]&&68===t[i+1]&&51===t[i+2]&&t[i+3]<255&&t[i+4]<255&&t[i+6]<128&&t[i+7]<128&&t[i+8]<128&&t[i+9]<128},i.prototype.pM=function(t,i){return i+10<=t.length&&51===t[i]&&68===t[i+1]&&73===t[i+2]&&t[i+3]<255&&t[i+4]<255&&t[i+6]<128&&t[i+7]<128&&t[i+8]<128&&t[i+9]<128},i.prototype.dM=function(t,i){var n=(127&t[i])<<21;return n|=(127&t[i+1])<<14,n|=(127&t[i+2])<<7,n|=127&t[i+3]},i.prototype.getString=function(t){var i=this.lM(t,0);if(!i||!i.length)return null;for(var n="",e=0;e<i.length;e++)n+=String.fromCharCode(i[e]);return n},i.prototype.mM=function(t){return 100===t[5]?self.dM(t,10):0},i.prototype.bM=function(t,i){var n=t.subarray(i,i+4);return String.fromCharCode.apply(null,n)},i.prototype.getID3Payload=function(t){var i=this,n=i.lM(t,0);if(!n||!n.length)return null;var e=10+i.mM(n);return{key:i.bM(n,e),data:n.subarray(e+10)}},i.prototype.extractID3FromMessage=function(t){if(!t)return null;t=new Uint8Array(t);for(var i=0;!this.vM(t,i);)i++;return i+10>t.length?null:t.subarray(i)}},4361:function(t,i,n){"use strict";t.exports.StreamLoader=a;var e=n(2701).CmdNames,r=n(574).MetadataTypes,s=n(7572),o=n(2990),u=n(2999),h=t.exports.Events={STREAM_LOADED:"streamLoaded",STREAM_LOAD_ERROR:"streamLoadError"};function a(t){var i=this;u.call(i,i.constructor.name),i._m=i.__controller.model,i.dS=t,i.vS=i.__controller.services.metadataParser,i.stream=null,i.loaded=!1}o.inherits(a,u),a.prototype.destroy=function(){u.prototype.destroy.call(this)},a.prototype.load=function(t,i){var n=this;t&&(n.stream=t,n.loaded=!1,n.dS.executeCommand(e.CMD_STREAM_LOAD,{stream:t,retryOpts:i},n))},a.prototype.cancel=function(){this.dS.removeRelatedCommands(e.CMD_STREAM_LOAD)},a.prototype.onStreamLoadComplete=function(t,i){var n=this;if(t)if(i&&i.stream){var e=i.stream,s={rawData:i.data,headers:i.headers,type:r.RAW,streamType:e.type,groupId:e.groupId,name:e.name,url:i.streamUrl,index:e.index};n._m.build(n.vS.parse(s)),n.dS.removeCommand(t),n.loaded=!0,n.publish(h.STREAM_LOADED,e)}else n.dS.removeCommand(t)},a.prototype.onStreamLoadError=function(t,i){var n=this;n.dS.removeCommand(t);var e=i.code===s.ERR_XHR_LOAD[0]?new s.Error(s.ERR_PLAYLIST_LOAD):i;n.publish(h.STREAM_LOAD_ERROR,n.stream,e)}},2191:function(t,i,n){"use strict";t.exports=r;var e=n(6837);function r(){var t=this;t.gM={},t.yM=Number.NaN,t.wM=!1,t._M=NaN,t.EM=[]}r.prototype.destroy=function(){this.gM={},this.EM=[]},r.prototype.addStream=function(t){var i=this;i.EM.push(t),i.EM.length&&(i.yM=i.EM[0].endSeqNum)},r.prototype.update=function(t){var i=this;if(t){var n=i.AM(t);if(n){var e=i.__controller.model.live;if(e&&(t=n.isDash()?i.OM(t,n):i.SM(t)),n.updateConfig(t),i.TM(t),e&&!n.isDash()&&i.yM>=n.endSeqNum){var r=1e3*n.targetDuration,s=!isNaN(r)&&r>0?r:n.refreshInterval;n.refreshInterval=.5*s}i.yM=n.endSeqNum}}},r.prototype.AM=function(t){var i=this;if(!t||!i.EM.length)return null;for(var n=0;n<i.EM.length;n++)if(i.EM[n].equals(t))return i.EM[n];return null},r.prototype.TM=function(t){var i=this;if(t&&t.segmentInfoList&&t.segmentInfoList[0].programDateTime&&i.EM.length)for(var n,e=t.segmentInfoList[0],r=0;r<i.EM.length;r++){var s=i.EM[r],o=s.segments;if(s.index!==t.index){for(n=0;o&&n<o.length;n++)if(o[n].seqNum===e.sequenceNum){o[n].programDateTime=e.programDateTime;break}}else for(n=1;n<t.segmentInfoList.length;n++){var u=o[n],h=o[n-1];u.programDateTime=h.programDateTime+1e3*h.duration}}},r.prototype.SM=function(t){var i=this;if(!t)return t;var n=t.segmentInfoList;if(!n||!n.length)return t;Object.keys(i.gM).length||(i.gM[n[0].sequenceNum]={startTime:n[0].startTime,programDateTime:n[0].programDateTime});var e,r,s,o,u=i.gM[n[0].sequenceNum];if(u&&"number"==typeof u.startTime)e=i.gM[n[0].sequenceNum].startTime;else{var h=Object.keys(i.gM),a=parseInt(h[h.length-1]);n[n.length-1].sequenceNum;var c=0;for(r=1;r<n.length;r++)if(-1!==h.indexOf(n[r].sequenceNum.toString())){c=r;break}if(c)for(e=i.gM[n[c].sequenceNum].startTime,r=c-1;r>=0;r--)e-=n[r].duration;else{if(n[0].sequenceNum>a)s=parseInt(h[h.length-1]),o=i.gM[s];else for(r=n[n.length-1].sequenceNum;r<=a;){if(-1!==h.indexOf(r.toString())){s=r,o=i.gM[s];break}r++}e="number"==typeof o.programDateTime?o.startTime+(n[0].programDateTime-o.programDateTime)/1e3:o.startTime+(n[0].sequenceNum-s)*n[0].duration}}var f=0;return n.forEach((function(t){t.startTime=e+f,f+=t.duration,!i.wM&&t.discontinuity&&(i.wM=!0,i._M=t.startTime),i.wM&&!isNaN(i._M)&&(t.discontinuity=t.startTime>=i._M),i.gM[t.sequenceNum]||(i.gM[t.sequenceNum]={startTime:t.startTime,programDateTime:t.programDateTime})})),t},r.prototype.OM=function(t,i){if(!t||!i)return t;var n=t.segmentInfoList;if(!n||!n.length)return t;var e=i.segments;if(!e||!e.length)return t;for(var r=0,s=!1,o=0;o<e.length;o++)if(r=e[o].seqNum,e[o].startTime>=n[0].startTime){s=!0;break}s||r++;for(var u=0;u<n.length;u++)n[u].sequenceNum=r,r++;return t},r.prototype.adjustStartTime=function(t,i,n){var r=this;if(t&&!e.isNullOrUndefined(n)&&!e.isNullOrUndefined(i)){var s=Object.keys(r.gM),o=s.length?s[0]:null,u=o?r.gM[o]:null,h=u?(u.programDateTime-n)/1e3-(u.startTime-i):0;h?(s.forEach((function(t){(u=r.gM[t]).startTime+=h})),t.segments.forEach((function(t){u=r.gM[t.seqNum],t.startTime=u?u.startTime:t.startTime+h})),t.adjusted=!0):t.adjusted=!0}}},5514:function(t,i,n){"use strict";t.exports=a;var e=n(4460),r=n(2999),s=n(7650),o=n(2990),u=n(3093).userAgent,h=n(8734);function a(t,i,n,e){var s=this;r.call(s,s.constructor.name),s.node=i,s.window=t,s.mediaSource=new t.MediaSource,s.SE=[],s.IM=!1,s.node.mediaKeys?(s.node.src="",s.node.setMediaKeys(null).then((function(){s._y(t,i,n,e)}))):s._y(t,i,n,e)}o.inherits(a,r),a.prototype._y=function(t,i,n,r){var s=this;s.node.src=t.URL.createObjectURL(s.mediaSource),(r=r||{}).userAgent=u,r.inWorkerScope=!1,r.metadata=n,s.appModel=s.create(h,r),s.controller=s.create(e,n),s.IM=!0,s.node.load(),this.KE()},a.prototype.create=function(){var t=this,i=Array.prototype.slice.call(arguments),n=i.shift(),e=Object.create(n.prototype);return e.Z_=t,n.apply(e,i),e},a.prototype.sendEvent=function(t,i){var n=this;n.publish(t,i),t&&s.ExternalEvents.indexOf(t)>=0&&n.node.dispatchEvent(n.jM(t,i))},a.prototype.getSegInfo=function(){return this.controller?this.controller.getSegInfo():null},a.prototype.notifyError=function(t){var i=this;i.error=t;var n=i.error.type||"decode";"open"===i.mediaSource.readyState&&i.mediaSource.endOfStream(n),i.controller&&i.controller.destroy()},a.prototype.isMimetypeSupported=function(t){return this.window.MediaSource.isTypeSupported(t)},a.prototype.jM=function(t,i){return new this.window.CustomEvent(t,{detail:i,bubbles:!1,cancelable:!1})},a.prototype.setABRMode=function(t){var i=this;i.controller?i.controller.setABRMode(t):i.SE.push(["setABRMode",[t]])},a.prototype.setAudioLanguage=function(t){var i=this;i.controller?i.controller.setAudioLanguage(t):i.SE.push(["setAudioLanguage",[t]])},a.prototype.play=function(t){var i=this;i.controller?i.controller.play(t):i.SE.push(["play",[t]])},a.prototype.pause=function(){var t=this;t.controller?t.controller.pause():t.SE.push(["pause"])},a.prototype.preload=function(t){var i=this;i.controller?i.controller.preload(t):i.SE.push(["preload",[t]])},a.prototype.getCurrentDate=function(){return this.controller?this.controller.getCurrentDate():null},a.prototype.suspendStreaming=function(){var t=this;t.controller&&(t.IM=!1,t.controller.suspendStreaming())},a.prototype.resumeStreaming=function(){var t=this;t.controller&&!t.IM&&(t.controller.resumeStreaming(),t.IM=!0)},a.prototype.getSyncOffset=function(){return this.controller?this.controller.getSyncOffset():NaN},a.prototype.startSync=function(){this.controller&&this.controller.startSync()},a.prototype.stopSync=function(){this.controller&&this.controller.stopSync()},a.prototype.getSyncState=function(){return this.controller?this.controller.getSyncState():-1},a.prototype.destroy=function(){var t=this;t.controller&&t.controller.destroy(),t.appModel&&t.appModel.destroy(),t.mediaSource=null,t.IM=!1,r.prototype.destroy.call(t)},a.prototype.KE=function(){var t=this,i=t.SE;t.SE=[],i.forEach((function(i){var n=t.controller,e=n[i[0]],r=i.length>1?i[1]:null;e&&"function"==typeof e&&e.apply(n,r)}))}},1842:function(t,i,n){"use strict";t.exports=o;var e=n(5514),r=n(7572),s=n(2849);function o(t,i){var n=this;n.MM=i||{},n._node="string"==typeof t?document.querySelector(t):t||null,Object.defineProperty(n,"error",{enumerable:!0,get:function(){return n.Z_?n.Z_.error:null}}),s.apply()}o.prototype.setSrc=function(t){var i=this;if(!i._node)throw new r.Error(r.ERR_API_NO_NODE).error;if(t){if(t!==i.NM){i.NM=t,i.Z_&&i.unload();try{i.Z_=new e(window,i._node,i.NM,i.MM)}catch(t){}}}else i._node.src=""},o.prototype.getSegInfo=function(){try{return this.Z_?this.Z_.getSegInfo():null}catch(t){return null}},o.prototype.setQuality=function(t){try{this.Z_.setABRMode(t)}catch(t){}},o.prototype.setAudioLanguage=function(t){try{this.Z_.setAudioLanguage(t)}catch(t){}},o.prototype.unload=function(){var t=this;t.Z_&&t.Z_.destroy(),t.Z_=null},o.prototype.play=function(t){this.Z_&&this.Z_.play(t)},o.prototype.pause=function(){var t=this;t.Z_?t.Z_.pause():t._node&&t._node.pause()},o.prototype.preload=function(t){this.Z_&&this.Z_.preload(t)},o.prototype.getCurrentDate=function(){if(this.Z_)return this.Z_.getCurrentDate()||null},o.prototype.suspendStreaming=function(){this.Z_&&this.Z_.suspendStreaming()},o.prototype.resumeStreaming=function(){this.Z_&&this.Z_.resumeStreaming()},o.prototype.getSyncOffset=function(){return this.Z_?this.Z_.getSyncOffset():NaN},o.prototype.startSync=function(){this.Z_&&this.Z_.startSync()},o.prototype.stopSync=function(){this.Z_&&this.Z_.stopSync()},o.prototype.getSyncState=function(){return this.Z_?this.Z_.getSyncState():-1},o.prototype.destroy=function(){var t=this;t.Z_&&t.Z_.destroy(),t.Z_=null,t.NM=null,t.MM=null,t._node=null}},2807:function(t){"use strict";t.exports={useWorker:!0,maxRetries:5,maxBuffer:60,maxTotalBuffer:300,requestTimeout:10,chunkedRequestTimeout:5,pastBufferLengthLimit:{vod:180,live:10},segmentLoadMonitorInterval:1,preloadBufferLimit:0,skipGapLimit:.5,variableMinBuffer:!0,minBufferTime:{vod:.1,live:4},sendAbrAnalytics:!1,demux:{startChunkWithKeyFrame:!0},stopBufferingOnPause:!1,dimensions:{width:640,height:360},bwHistoryMaxAge:300,streamSynch:{synchronize:!1,synchConfig:null}}},8734:function(t,i,n){"use strict";t.exports=u;var e=n(2807),r=n(6837),s=n(2990),o=n(574).StreamingMode;function u(t){var i=this;if(!t||!t.userAgent)throw new Error("Invalid/incomplete configuration to AppModel");i.configure(t),i.streams=[],i.altRenditionGroups=[],i.live=!1,i.duration=0,i.timescale=9e4,i.TIMESTAMP_COMPARE_EPSILON=.065,i.PIXEL_RATIO_360=6,i.currentPlayingStreamIndex=0,i.currentLoadingStreamIndex=0,i.preloading=!1,i.currentKbps=0,i.infoUpdateSent=!0,i.streamingMode=o.HLS,i.drmRequired=!1,i.drmInfo=[],i.licenseType="none",i.is360=t.metadata&&t.metadata.is360||!1,i.setDimensions(t.dimensions)}u.prototype.destroy=function(){var t=this;t.config=null,t.streams=[],t.altRenditionGroups=[]},u.prototype.configure=function(t){var i=this;i.config=i.config||r.deepCopy(e),i.userAgent=t.userAgent,t&&Object.keys(t).forEach((function(n){i.config.hasOwnProperty(n)&&(i.config[n]=t[n])})),i.config.demux.startChunkWithKeyFrame=!(i.userAgent.chrome&&i.userAgent.chrome>=50)||i.zE(t.metadata),i.config.demux.useTimer=!(i.userAgent.chrome||i.userAgent.ie||i.userAgent.edge);var n=i.config.streamSynch.synchConfig||{},s=t.metadata,o=s&&s.syncPoint?1e3*s.syncPoint:null;n.behindLiveEdgeMs=n.behindLiveEdgeMs||o,i.config.streamSynch.synchConfig=n},u.prototype.zE=function(t){if(!t)return!1;var i=t.url,n=t.streams&&t.streams.length?this.GE(t.streams[0]):null;return s.isUplynk(i||n)},u.prototype.GE=function(t){if(!t)return null;var i=t.url;return!i&&t.host&&t.path&&(i=t.host+t.path),i},u.prototype.update=function(t){var i=this;t&&(Object.keys(t).forEach((function(n){("currentKbps"!==n||t.currentKbps||i.infoUpdateSent)&&i.hasOwnProperty(n)&&(i[n]=t[n])})),i.infoUpdateSent=!1)},u.prototype.setDimensions=function(t){var i=this.Z_.node;this.RM=t||{width:i?i.clientWidth:0,height:i?i.clientHeight:0}},u.prototype.getBufferLength=function(){var t,i,n=this,e=n.Z_.node,r=e.buffered,s=0,o=e.currentTime;if(0===o){for(t=0;t<r.length;t++)s+=r.end(t)-r.start(t);return s}var u=n.Z_.mediaSource;s=1/0;for(var h=0;h<u.activeSourceBuffers.length;h++){var a=n.kM(o,u.activeSourceBuffers[h]);a>=0&&(s=Math.min(s,a))}for(t=0;t<r.length;t++)if(o>=r.start(t)&&o<r.end(t)){i=t;break}return i>=0&&r.length&&(s=Math.min(r.end(i)-o,s)),s===1/0&&(s=0),s},u.prototype.kM=function(t,i){if(!i)return-1;for(var n,e=i.buffered,r=0,s=0;s<e.length;s++)if(t>=e.start(s)&&t<e.end(s)){n=s;break}return n>=0&&e.length&&(r=e.end(n)-t),r},u.prototype.getBufferedDto=function(){for(var t=this.Z_.node.buffered,i={length:t.length,ranges:[]},n=0;n<t.length;n++)i.ranges[n]={start:t.start(n),end:t.end(n)};return i},u.prototype.getCurrentPlayingStream=function(){var t=this;return t.streams&&t.streams.length&&t.currentPlayingStreamIndex>=0&&t.currentPlayingStreamIndex<t.streams.length?t.streams[t.currentPlayingStreamIndex]:null},u.prototype.getDimensions=function(){return this.RM},u.prototype.getPixelRatio=function(){var t=1;try{window&&(t=window.devicePixelRatio)}catch(i){t=1}return t||(t=1),this.is360&&(t*=this.PIXEL_RATIO_360),t},u.prototype.getCurrentDate=function(){var t=this.getCurrentPlayingStream(),i=this.Z_.node.currentTime,n=t?t.segments:null;if(n)for(var e=n.length-1;e>=0;e--)if(n[e].programDateTime>0&&i>=n[e].startTime){var r=parseInt(1e3*(i-n[e].startTime));return n[e].programDateTime+r}},u.prototype.shouldSynchronizePlayers=function(){return this.config.streamSynch.synchronize}},676:function(t,i,n){"use strict";t.exports=u;var e=n(8776),r=n(7650).HLSEvent,s=n(2503).StreamTypes,o=n(2191);function u(t,i,n,u){var h=this;if(h.type=t,h.groupId=i,h.LM=[],h.DM=h.__controller.create(o),n){(n=h.CM(n)).forEach((function(t){var i=h.__controller.create(e,t);h.LM.push(i),h.DM.addStream(i)}));var a=h.PM("default");a||(a=h.PM("autoSelect")),a&&(h.setCurrentStream(a),a.type===s.SUBTITLES&&h.__controller.sendEvent(r.CC_VTT_AVAILABLE,{sessionId:h.__controller.model.sessionId})),t===s.AUDIO&&(u&&h.setCurrentStreamWithName(u),h.xM())}h.UM()}u.prototype.PM=function(t){for(var i=this,n=0;n<i.LM.length;n++)if(i.LM[n][t])return i.LM[n];return null},u.prototype.destroy=function(){var t=this;t.LM.forEach((function(t){t.destroy()})),t.LM=[],t.DM.destroy()},u.prototype.getCurrentStream=function(){return this.FO},u.prototype.setCurrentStream=function(t){t&&(this.FO=t)},u.prototype.setCurrentStreamWithName=function(t){var i=this;if(!t||!i.FO||t===i.FO.name)return!1;for(var n=0;n<i.LM.length;n++){var e=i.LM[n];if(t===e.name)return i.setCurrentStream(e),!0}return!1},u.prototype.update=function(t){this.DM.update(t)},u.prototype.adjustStartTime=function(t,i){var n=this;n.LM.forEach((function(e){e.adjusted||n.DM.adjustStartTime(e,t,i)}))},u.prototype.getContainerFormat=function(){return this.FO?this.FO.containerFormat:null},u.prototype.setContainerFormat=function(t){this.LM.forEach((function(i){i.containerFormat||(i.containerFormat=t)}))},u.prototype.getDrmInfo=function(){for(var t=[],i=0;i<this.LM.length;i++){var n=this.LM[i].drmInfo;if(!n)break;for(var e=0;e<n.length;e++)t.push(n[e])}return t},u.prototype.hasStreams=function(){return this.LM.length>0},u.prototype.UM=function(){return!0},u.prototype.xM=function(){var t=this,i={},n=[];t.LM.forEach((function(e){i[e.name]||(i[e.name]=1,n.push({name:e.name,language:e.language,selected:t.FO&&e.name===t.FO.name}))})),n.length>1&&t.__controller.sendEvent(r.MULTI_LANGUAGES_AVAILABLE,{sessionId:t.__controller.model.sessionId,languages:n})},u.prototype.CM=function(t){return t?t.filter((function(t){return!!t.url})):t}},8776:function(t,i,n){"use strict";t.exports=f;var e=n(7988),r=n(7159),s=n(2990),o=n(6837),u=n(2503),h=u.Stream,a=u.StreamTypes,c=n(574).StreamingMode;function f(t){var i=this;i.constructor.super_.call(i),i.f_=i.constructor.super_.prototype,i.segments=[],t&&i.updateConfig(t)}s.inherits(f,h),f.prototype.destroy=function(){var t=this;t.segments=[],t.f_.destroy.call(t)},f.prototype.updateConfig=function(t){var i=this;i.f_.updateConfig.call(i,t),t&&(i.type=t.type||i.type,i.groupId=t.groupId||i.groupId,i.language=t.language||i.language,i.name=t.name||i.name,i.default=o.isNullOrUndefined(t.default)?i.default:t.default,i.autoSelect=o.isNullOrUndefined(t.autoSelect)?i.autoSelect:t.autoSelect,i.forced=o.isNullOrUndefined(t.forced)?i.forced:t.forced);var n=e;i.type===a.SUBTITLES&&(n=i.streamingMode===c.DASH&&"mp4"===t.containerFormat?e:r),t.segmentInfoList&&t.segmentInfoList.length&&(i.segments=t.segmentInfoList.map((function(t){return t.bitrate=i.bitrate,t.sessionId=i.sessionId,t.cdn=i.cdn,i.__controller.create(n,t)}))),i.segments.length&&(i.startSeqNum=i.segments[0].seqNum,i.endSeqNum=i.segments[i.segments.length-1].seqNum),i.adjusted=i.type===a.MAIN||i.adjusted},f.prototype.equals=function(t){var i=this;return!!t&&(i.url===t.url&&i.groupId===t.groupId&&i.name===t.name)},f.prototype.setStreamIndex=function(){},f.prototype.dto=function(){}},5086:function(t){"use strict";function i(t){var i=this;t&&(i.startSeqNum=t.startSeqNum,i.startTime=t.startTime,i.cuepointDuration=t.cuepointDuration,i.isCueOutFired=!1,i.isCueOutDetectedFired=!1)}t.exports=i,i.prototype.setCueOutFiredState=function(t){this.isCueOutFired=t},i.prototype.setCueOutDetectedState=function(t){this.isCueOutDetectedFired=t},i.prototype.setCueOutStartTime=function(t){this.startTime=t},i.prototype.dto=function(){var t=this,i={};return Object.keys(t).forEach((function(n){i[n]=t[n]})),i}},87:function(t,i,n){"use strict";t.exports=r;var e=n(7166);function r(){this.VM={}}r.prototype.destroy=function(){var t=this;Object.keys(t.VM).forEach((function(i){var n=t.VM[i];n&&n.destroy()})),t.VM={}},r.prototype.add=function(t){var i=this;if(!t||!t.url)return null;var n=i.BM(t);return i.VM[n]||(i.VM[n]=new e({name:"init",url:t.url,range:t.range})),i.VM[n]},r.prototype.remove=function(t){var i=this;if(t&&t.url){var n=i.BM(t);(t=i.VM[n])&&(t.destroy(),delete i.VM[n])}},r.prototype.get=function(t){if(!t||!t.url)return null;var i=this.BM(t);return this.VM[i]},r.prototype.getFirst=function(){var t=Object.keys(this.VM);return t&&t.length?this.VM[t[0]]:null},r.prototype.BM=function(t){var i=t.range,n=i?"_"+i.start+"_"+i.end:"";return t.url+n}},574:function(t,i,n){"use strict";i.Model=d;var e=i.StreamingMode={DASH:"dash",HLS:"hls"};i.MetadataTypes={RAW:"raw",RAW_SUBTITLE:"rawSubtitle",STRUCTURED:"structured"};var r=i.AbrModes={AUTO:"auto",LOW:"low",MID:"medium",HIGH:"high"},s=n(2503),o=s.Stream,u=s.StreamTypes,h=n(676),a=n(7650).HLSEvent,c=n(2807),f=n(6837),l=n(2990),v=n(2191);function d(t){var i=this;if(!(t&&t.userAgent&&t.config&&t.metadata))throw new Error("Incomplete input parameters to Model");i.configure(t.config,t.userAgent),i.FM={},i.streams=[],i.altRenditionGroups=[],i.zM=i.__controller.create(v),i.GM(t.metadata),i.live=t.metadata&&t.metadata.live,i.hasEndlist=!1,i.duration=0,i.bufferLength=0,i.pendingBufferLength=0,i.bufferedRanges={length:0,ranges:[]},i.currentTime=0,i.timescale=9e4,i.TIMESTAMP_COMPARE_EPSILON=.065,i.preloading=!1,i.timedMetadataStore={},i.dimensions=t.config.dimensions?t.config.dimensions:{width:NaN,height:NaN},i.pixelRatio=1,i.bwHistory=t.config.bwHistory,i.HM=r.AUTO,i.YM=0,i.gM={},i.currentLoadingStreamIndex=-1,i.currentLoadingSeqNum=-1,i.qM=null,i.WM=null,i.QM=t.metadata.url&&-1!==t.metadata.url.indexOf(".mpd")?e.DASH:e.HLS,i.drmRequired=!1,i.drmInfo=[]}d.prototype.destroy=function(){var t=this;t.config=null,t.streams&&(t.streams.forEach((function(t){t.destroy()})),t.streams=[]),t.altRenditionGroups&&(t.altRenditionGroups.forEach((function(t){t.destroy()})),t.altRenditionGroups=[]),t.gM={},t.zM.destroy(),t.timedMetadataStore=null},d.prototype.configure=function(t,i){var n=this;n.config=n.config||f.deepCopy(c),n.userAgent=i,t&&(Object.keys(t).forEach((function(i){n.config.hasOwnProperty(i)&&(n.config[i]=t[i])})),n.inWorkerScope=t.inWorkerScope),f.isNullOrUndefined(n.config.demux.startChunkWithKeyFrame)&&n.userAgent&&(n.config.demux.startChunkWithKeyFrame=!(n.userAgent.chrome&&n.userAgent.chrome>=50))},d.prototype.build=function(t){var i=this;if(t){t.streamingMode===e.DASH&&(i.QM=t.streamingMode,i.drmRequired=t.drm,i.XM=t,i.live=!(!t.type||"dynamic"!==t.type.toLowerCase()));var n=i.ZM(t.renditionGroups);i.$M(t.streamInfoList,n)}},d.prototype.JM=function(t){var i,n,e,r;for(i=0;i<t.length&&(e=t[i].getDrmInfo());i++)for(n=0;n<e.length;n++)r=e[n],l.isDrmItemContained(r,this.drmInfo)||this.drmInfo.push(r)},d.prototype.ZM=function(t){var i=this;return t?(Object.keys(t).forEach((function(n){var e=t[n];e&&Object.keys(e).forEach((function(t){var r=i.KM(n,t),s=e[t];s&&s.length&&(i.tN(s[0]),r?i.iN(n,t,s):i.nN(n,t,s))}))})),i.JM(i.altRenditionGroups),i.altRenditionGroups):i.altRenditionGroups},d.prototype.KM=function(t,i){for(var n=0;n<this.altRenditionGroups.length;n++){var e=this.altRenditionGroups[n];if(e.type===t&&e.groupId===i)return e}return null},d.prototype.nN=function(t,i,n){var e=this,r=e.metadata&&e.metadata.currLang,s=e.__controller.create(h,t,i,n,r);e.altRenditionGroups.push(s)},d.prototype.iN=function(t,i,n){if(n&&n.length){var e=this.KM(t,i);n.forEach((function(t){e.update(t)}))}},d.prototype.$M=function(t,i){var n=this;t&&t.length&&((t=n.CM(t)).forEach((function(t){t.sessionId=n.sessionId,t.type=u.MAIN,n.tN(t);for(var e=!1,r=n.isDash()?"groupId":"url",s=0;s<n.streams.length;s++){if(n.streams[s][r]===t[r]){n.updateStream(s,t),e=!0;break}}e||n.addStream(t,i)})),n.JM(n.streams),n.eN(),n.duration=n.live?NaN:t[0].duration)},d.prototype.CM=function(t){return t&&t.length?(this.userAgent.firefox&&t[0].channels&&(t=this.rN(t)),t=t.filter((function(t){if(!t.url)return!1;var i=t.codecs;if(!i)return!0;for(var n=0;n<i.length;n++)if(-1===i[n].indexOf("avc1")&&-1===i[n].indexOf("mp4a")&&-1===i[n].indexOf("aac"))return!1;return!0}))):t},d.prototype.rN=function(t){for(var i=!1,n=t[0].channels,e=1;e<t.length;e++)if(t[e].channels&&n!==t[e].channels){i=!0;break}return i?t.filter((function(t){return 1!==t.channels})):t},d.prototype.isDash=function(){return this.QM===e.DASH},d.prototype.addStream=function(t,i){var n=this,e=n.__controller.create(o,t,i);n.streams.push(e),e.setStreamIndex(n.streams.length-1),n.zM.addStream(e),1===n.streams.length&&n.setCurrentLoadingStream(e.index)},d.prototype.updateStream=function(t,i){var n=this;t>=n.streams.length||(!0===i.hasEndList&&(n.hasEndlist=!0),n.zM.update(i))},d.prototype.synchStreamTimelines=function(t){var i=this,n=i.getCurrentLoadingStream();if(n&&i.live&&n.segments.length){var e=n.segments[0].programDateTime,r=n.segments[0].startTime;f.isNullOrUndefined(e)||f.isNullOrUndefined(r)||i.altRenditionGroups.forEach((function(i){t&&i.type!==t||i.adjustStartTime(r,e)}))}},d.prototype.getCurrentLoadingStream=function(){return this.getStreamByIndex(this.currentLoadingStreamIndex)},d.prototype.setCurrentLoadingStream=function(t){var i=this;i.streams&&i.streams.length&&(t<0||t>=i.streams.length||(i.currentLoadingStreamIndex=t))},d.prototype.getCurrentPlayingStream=function(){return this.getStreamByIndex(this.currentPlayingStreamIndex)},d.prototype.setCurrentPlayingStream=function(t){var i=this;i.streams&&i.streams.length&&(t<0||t>=i.streams.length||(i.currentPlayingStreamIndex=t))},d.prototype.getTotalBufferLength=function(){for(var t=this.bufferedRanges,i=0,n=0;n<t.length;n++)i+=t.ranges[n].end-t.ranges[n].start;return i},d.prototype.setPCR=function(t){var i=this;(null===i.qM||void 0===i.qM||isNaN(i.qM))&&(i.qM=t,i.__controller.sendEvent(a.PCR_AVAILABLE,t))},d.prototype.getPCR=function(){return this.qM},d.prototype.setLivePlaybackStartTime=function(t){this.WM=t},d.prototype.getLivePlaybackStartTime=function(){return this.WM},d.prototype.setStartOffset=function(t){var i=this;i.startOffsetTimestamp&&!isNaN(i.startOffsetTimestamp)||(i.startOffsetTimestamp=t)},d.prototype.setSegEndTimeStamps=function(t,i,n,e){if(t&&e){var r=t===u.MAIN?this.streams:this.KM(t,i);r&&r.length&&r.forEach((function(t){var i=t.getSegmentfromSeqNum(n);i&&(i.endTimestamps.audio=e.audio,i.endTimestamps.video=e.video)}))}},d.prototype.getPrevSegEndTimestamps=function(t,i){if(!t||!i)return null;var n=t.getIndexFromSeqNum(i.seqNum);return n>=1&&t.segments&&n<t.segments.length?t.segments[n-1].endTimestamps:null},d.prototype.getStreamRefreshInterval=function(){var t=this.getCurrentLoadingStream();return t?t.refreshInterval:null},d.prototype.GM=function(t){var n=this;if(t){n.sessionId=t?t.sessionId:null,n.is360=!!t&&t.is360,t.type=i.MetadataTypes.RAW,n.metadata=t;var e=t.streams,r=t.altStreams;e&&e.length>0&&((e[0].hls_info||e[0].hlsInfo||e.length>1)&&(n.metadata.type=i.MetadataTypes.STRUCTURED,n.metadata.hasMediaMetadata=!0),(e[0].hls_info||e[0].hlsInfo)&&(n.metadata.hasStreamMetadata=!0)),n.metadata.hasMediaMetadata||n.metadata.hasStreamMetadata||(n.FM=e&&1===e.length?e[0]:t),r&&r.length&&(n.metadata.hasAltStreamMetadata=!0)}},d.prototype.eN=function(){this.streams.sort((function(t,i){return t.bitrate-i.bitrate})),this.streams.forEach((function(t,i){t.index=i,t.segments.forEach((function(t){t.setStreamIndex(i)}))}))},d.prototype.getSegment=function(t,i){return t<0||t>=this.streams.length?null:this.streams[t].getSegmentfromSeqNum(i)},d.prototype.sN=function(t){var i=[];return this.streams.forEach((function(n){n.index!==t&&i.push({index:n.index,url:n.url})})),i},d.prototype.setABRMode=function(t){var i=this,n=i.HM;return i.HM=r.AUTO,Object.keys(r).forEach((function(n){r[n]===t.preference&&(i.HM=t.preference)})),i.YM=1e3*t.stream.bitrate,n!==i.HM},d.prototype.getABRMode=function(){return this.HM},d.prototype.setAudioLanguage=function(t){var i=!1;return this.altRenditionGroups.forEach((function(n){n.type===u.AUDIO&&(i=n.setCurrentStreamWithName(t)||i)})),i},d.prototype.getMediaDto=function(){var t=this,i={streams:[],altRenditionGroups:[],live:t.live,duration:t.duration,currentPlayingStreamIndex:t.currentPlayingStreamIndex,currentLoadingStreamIndex:t.currentLoadingStreamIndex,currentLoadingSeqNum:t.currentLoadingSeqNum,preloading:t.preloading,currentKbps:t.__controller.services.segmentMetrics.getMetricsBandwidthInfo(),abrMode:t.HM,streamingMode:t.QM,drmRequired:t.drmRequired,drmInfo:t.drmInfo};return t.streams.forEach((function(t){i.streams.push(t.dto())})),i},d.prototype.updateCurrentLoadingSeqNum=function(t){return this.currentLoadingSeqNum=t},d.prototype.getUserReqBitrate=function(){return this.YM},d.prototype.tN=function(t){t&&t.segmentInfoList&&!f.isNullOrUndefined(t.hasEndList)&&f.isNullOrUndefined(this.live)&&(this.live=!t.hasEndList)},d.prototype.getMediaUrl=function(){var t=this,i=t.FM.url||"";return!i.length&&t.FM.host&&t.FM.path&&(i=t.FM.host+t.FM.path),i},d.prototype.getMediaCdn=function(){return this.FM.cdn||""},d.prototype.getStreamByIndex=function(t){var i=this;return i.streams&&i.streams.length&&t>=0&&t<i.streams.length?i.streams[t]:null},d.prototype.getSegmentLength=function(){var t=this;return t.streams&&t.streams.length?t.streams[0].targetDuration:NaN},d.prototype.updateTimedMetadata=function(t,i){var n=this;if(t&&t.payload){n.timedMetadataStore[i]=n.timedMetadataStore[i]||[];for(var e=n.timedMetadataStore[i].length,r=0;r<n.timedMetadataStore[i].length;r++){var s=n.timedMetadataStore[i][r];if(Math.abs(s.timestamp-t.timestamp)<=.1&&n.oN(s.payload,t.payload))return!1;if(t.timestamp<s.timestamp){e=r;break}}return n.timedMetadataStore[i].splice(e,0,t),!0}},d.prototype.oN=function(t,i){return!(t.key!==i.key||!t.data||!i.data||t.data.byteLength!==i.data.byteLength)&&t.data.every((function(t,n){return t===i.data[n]}))}},7166:function(t){"use strict";function i(t){var i=this;t&&(i.url=t.url,i.name=t.name,i.range=t.range);var n=i.range;i.loaded=!1,i.data=n&&n.end>=0&&n.start>=0&&n.end>n.start?new Uint8Array(n.end-n.start+1):null,i.uN=0,i.z_=i.data?i.data.byteLength:0}t.exports=i,i.prototype.destroy=function(){this.data=null},i.prototype.append=function(t){var i=this;if(i.loaded||!t)return 0;var n=0;if(i.z_&&i.data){n=Math.min(t.byteLength,i.z_-i.uN);for(var e=0;e<n;e++)i.data[i.uN+e]=t[e];i.uN+=n,i.uN>=i.z_&&(i.loaded=!0)}else{var r=t.byteLength;if(!r)return;var s=null,o=0;i.data&&(o=(s=i.data).length),n=o+r,i.data=new Uint8Array(n),s&&i.data.set(s),i.data.set(t,o),i.uN+=n}return n},i.prototype.equals=function(t){var i=this;return!!t&&(i.url===t.url&&i.name===t.name&&(!i.range||!t.range||i.range.start===t.range.start&&i.range.end===t.range.end))}},7988:function(t){"use strict";function i(t){var i=this;t&&(i.duration=t.duration,i.url=t.url,i.initSegment=t.initSegment,i.seqNum=t.sequenceNum,i.startTime=t.startTime,i.discontinuity=t.discontinuity,i.programDateTime=t.programDateTime,i.streamIndex=t.levelIndex,i.bitrate=t.bitrate,i.sessionId=t.sessionId,i.cdn=t.cdn,i.hN=i.streamIndex+"_"+i.seqNum,i.brStartOffset=t.brStartOffset,i.brEndOffset=t.brEndOffset,i.containerFormat=t.containerFormat,i.encryptionData=t.encryptionData,i.endTimestamps=t.endTimestamps,i.periodId=t.periodId),i.endTimestamps||(i.endTimestamps={audio:NaN,video:NaN}),i.totalDownloadTime=0,i.timeToFirstByte=0,i.aN=0}t.exports=i,i.prototype.setStreamIndex=function(t){var i=this;i.streamIndex=t,i.hN=i.streamIndex+"_"+i.seqNum},i.prototype.dto=function(){var t=this,i={};return Object.keys(t).forEach((function(n){"__controller"!==n&&(i[n]=t[n])})),i}},2503:function(t,i,n){"use strict";t.exports.Stream=c;var e=i.StreamTypes={MAIN:"MAIN",AUDIO:"AUDIO",VIDEO:"VIDEO",SUBTITLES:"SUBTITLES",CLOSED_CAPTIONS:"CLOSED_CAPTIONS"},r=n(7988),s=n(5086),o=n(7166),u=n(574).StreamingMode,h=n(2835),a=n(87);function c(t,i){var n=this;n.segments=[],n.cuepoints=[],n.dateRanges={},n.type=e.MAIN,n.videoCodec=null,n.audioCodec=null,n.mp4Chunks={sidx:null,first:null},n.adjusted=!1,n.cN=new a(n),n.activeInitSegment=null,t&&(n.fN(t,i),n.updateConfig(t)),n.ZS=new h}c.prototype.destroy=function(){var t=this;t.segments=[],t.cuepoints=[],t.dateRanges={},"mp4"===t.containerFormat&&Object.keys(t.mp4Chunks).forEach((function(i){var n=t.mp4Chunks[i];n&&n.destroy()})),t.cN.destroy()},c.prototype.fN=function(t,i){var n=this;if(n.altRenditionGroups={},i)for(var e=0;e<i.length;e++){var r=i[e];r.groupId===t.audioGroupId?(n.altRenditionGroups.AUDIO=r,n.audioGroupId=t.audioGroupId):r.groupId===t.videoGroupId?(n.altRenditionGroups.VIDEO=r,n.videoGroupId=t.videoGroupId):r.groupId===t.subtitlesGroupId?(n.altRenditionGroups.SUBTITLES=r,n.subtitlesGroupId=t.subtitlesGroupId):r.groupId===t.ccGroupId&&(n.altRenditionGroups.CLOSED_CAPTIONS=r,n.ccGroupId=t.ccGroupId)}},c.prototype.getAlternateStream=function(t){if(this.altRenditionGroups[t])return this.altRenditionGroups[t].getCurrentStream()},c.prototype.setAlternateStream=function(t,i){this.altRenditionGroups[t]&&this.altRenditionGroups[t].setCurrentStream(i)},c.prototype.updateConfig=function(t){var i=this,n=i.audioCodec&&i.audioCodec.length>0;if(t&&(i.streamingMode=t.streamingMode||i.streamingMode,i.bitrate=t.bitrate||i.bitrate,i.avgBitrate=t.avgBitrate||i.avgBitrate,i.url=t.url||i.url,i.containerFormat=t.containerFormat||i.containerFormat,i.cdn=t.cdn||i.cdn,i.rcMode=t.rcMode||"cbr",i.channels=t.channels>=0?t.channels:i.channels,i.width=t.width>=0?t.width:i.width,i.height=t.height>=0?t.height:i.height,i.index=t.index>=0?t.index:i.index,i.hlsInfo=t.hlsInfo||i.hlsInfo,i.targetDuration=t.targetDuration||NaN,i.sessionId=t.sessionId||null,i.audioCodec=t.audioCodec||i.audioCodec,i.videoCodec=t.videoCodec||i.videoCodec,i.type=t.type||e.MAIN,i.sidxOffset=t.sidxOffset>=0?t.sidxOffset:i.sidxOffset,i.sidxLength=t.sidxLength>=0?t.sidxLength:i.sidxLength,i.firstSegOffset=t.firstSegOffset>=0?t.firstSegOffset:i.firstSegOffset,i.firstSegLength=t.firstSegLength>=0?t.firstSegLength:i.firstSegLength,i.hasAudio=t.hasAudio||n||i.channels>0||i.hasAudio,i.groupId=t.groupId||null,void 0!==t.hasEndList&&null!==t.hasEndList&&(i.hasEndList=t.hasEndList),i.hlsInfo&&i.hlsInfo.mp4_url&&(i.mp4Chunks.sidx=i.lN("sidx",i.sidxOffset,i.sidxLength,i.hlsInfo.mp4_url),i.mp4Chunks.first=i.lN("first",i.firstSegOffset,i.firstSegLength,i.hlsInfo.mp4_url)),t.drmInfo&&(i.drmInfo=t.drmInfo),i.vN(t.dateRanges)),i.url&&i.url.length&&i.url.indexOf("_60fps")>=0?i.frameRate=60:i.frameRate="AUDIO"===i.type?0:30,t&&t.segmentInfoList){var o=[];i.dN(i.segments,t.segmentInfoList),t.segmentInfoList.forEach((function(t){t.levelIndex=i.index,t.bitrate=i.bitrate,t.sessionId=i.sessionId,t.cdn=i.cdn;var n=i.getSegmentfromSeqNum(t.sequenceNum);n&&(t.endTimestamps=n.endTimestamps),o.push(i.__controller.create(r,t))})),o.length&&(i.segments=o,i.startSeqNum=o[0].seqNum,i.endSeqNum=o[o.length-1].seqNum,t.cuepointList&&t.cuepointList.length&&(t.cuepointList.forEach((function(t){i.hasCuepoint(t.startSeqNum)||i.cuepoints.push(new s(t))})),i.updateCuepointTime()))}i.segments&&i.segments.length&&(i.refreshInterval=1e3*i.segments[i.segments.length-1].duration);var u=i.altRenditionGroups?i.altRenditionGroups.AUDIO:null;i.type===e.MAIN&&u&&i.containerFormat&&!u.getContainerFormat()&&u.setContainerFormat("ts"===i.containerFormat?"aac":"mp4")},c.prototype.dN=function(t,i){t&&t.length&&t.forEach((function(t){t.seqNum!==i[0].sequenceNum||(i[0].programDateTime=t.programDateTime)}))},c.prototype.addInitSegment=function(t){return"mp4"===this.containerFormat?this.cN.add(t):null},c.prototype.getInitSegment=function(t){var i=this;if(!t){if(!i.segments.length)return null;t=i.segments[0]}return i.cN.get(t.initSegment)},c.prototype.lN=function(t,i,n,e){var r,s=this.mp4Chunks[t];return s||("mp4"===this.containerFormat&&e?(i>=0&&n>=0&&(r={start:i,end:i+n-1}),new o({name:t,url:e,range:r})):null)},c.prototype.getMp4Chunk=function(t){return"mp4"===this.containerFormat?this.mp4Chunks[t]:null},c.prototype.dto=function(){var t=this,i={segments:[],cuepoints:[]},n=["segments","__controller","cuepoints","altRenditionGroups","_initSegmentCache","activeInitSegment"];return Object.keys(t).forEach((function(e){n.indexOf(e)>=0||(i[e]=t[e])})),t.segments.forEach((function(t){i.segments.push(t.dto())})),t.cuepoints.forEach((function(t){i.cuepoints.push(t.dto())})),i},c.prototype.setStreamIndex=function(t){this.index=t,this.segments.forEach((function(i){i.setStreamIndex(t)}))},c.prototype.getSeqNumBeforePosition=function(t){var i=this;if(!i.segments.length)return NaN;if(t<i.segments[0].startTime)return i.startSeqNum;for(var n=0;n<i.segments.length;n++){var e=i.segments[n];if(e&&e.startTime<=t&&e.startTime+e.duration>t)return i.startSeqNum+n}var r=i.segments[i.segments.length-1];return r&&r.startTime+r.duration===t?i.endSeqNum:NaN},c.prototype.getSegmentfromSeqNum=function(t){var i=this,n=i.getIndexFromSeqNum(t);return n>=0&&n<i.segments.length?i.segments[n]:null},c.prototype.getIndexFromSeqNum=function(t){var i=this;if(t>=i.startSeqNum&&t<=i.endSeqNum)for(var n=0;n<i.segments.length;n++)if(i.segments[n]&&i.segments[n].seqNum===t)return n;return-1},c.prototype.contains=function(t){return t>=this.startSeqNum&&t<=this.endSeqNum},c.prototype.isEmpty=function(){return 0===this.segments.length},c.prototype.isReady=function(){var t=this;if("mp4"!==t.containerFormat)return t.url&&t.segments.length>0;var i=t.cN.getFirst();if(t.streamingMode===u.HLS&&t.hlsInfo&&t.hlsInfo.mp4_url){var n=t.mp4Chunks.sidx;return i&&n&&i.loaded&&n.loaded}return i&&i.loaded&&t.segments.length>0},c.prototype.hasCuepoint=function(t){for(var i=this.cuepoints.length-1;i>=0;i--)if(this.cuepoints[i].startSeqNum===t)return!0;return!1},c.prototype.updateCuepointTime=function(){for(var t,i=this,n=0;n<i.cuepoints.length;n++)(t=i.getSegmentfromSeqNum(i.cuepoints[n].startSeqNum))&&i.cuepoints[n].setCueOutStartTime(t.startTime)},c.prototype.equals=function(t){var i=this;return!!t&&(i.url===t.url&&i.type===t.type&&(i.isDash()?i.groupId===t.groupId:i.index===t.index))},c.prototype.updateSegmentRanges=function(t){var i=this;if(t&&t.length)for(var n=0;n<t.length&&n<i.segments.length;n++)i.segments[n].brStartOffset=t[n].brStartOffset,i.segments[n].brEndOffset=t[n].brEndOffset},c.prototype.setMp4Timescale=function(t){var i=this;if("mp4"===i.containerFormat&&t&&t.loaded&&t.data){var n=i.ZS.parse(t.data,"mdhd");if(n&&n.timescale>0)i.timescale=n.timescale;else{var e=i.ZS.parse(t.data,"mvhd");i.timescale=e.timescale}}},c.prototype.isDash=function(){return this.streamingMode===u.DASH},c.prototype.setFrameRate=function(t){t&&(this.frameRate=t)},c.prototype.getDrmInfo=function(){return this.drmInfo},c.prototype.vN=function(t){var i=this;t&&t.forEach((function(t){var n=t.id+"-"+t.startDate;i.dateRanges[n]=t}))}},7159:function(t){"use strict";function i(t){var i=this;t&&(i.discontinuity=t.discontinuity,i.seqNum=t.sequenceNum,i.startTime=t.startTime,i.programDateTime=t.programDateTime,i.url=t.url,i.duration=t.duration),i.clockReference=0,i.localCueTime=0,i.mpegTSTime=0,i.offset=0,i.adjustedTime=0}t.exports=i,i.prototype.destroy=function(){this.data=null},i.prototype.toObject=function(){var t=this,i={};return i.discontinuity=t.discontinuity,i.sequenceNum=t.seqNum,i.startTime=t.startTime,i.programDateTime=t.programDateTime,i.url=t.url,i.duration=t.duration,i.playlistUrl=t.playlistUrl,i.clockReference=t.clockReference,i.localCueTime=t.localCueTime,i.mpegTSTime=t.mpegTSTime,i.data=t.data,i.offset=t.offset,i.adjustedTime=t.adjustedTime,i},i.prototype.parseSegment=function(){var t=this;if(t.data){var i=t.data.split("\n");if(!(i.length<=0)&&0===i[0].indexOf("WEBVTT")){for(var n=Math.floor((Math.pow(2,33)-1)/90),e=0,r=0,s=1;s<i.length;s++){var o=i[s].trim();if(0===o.indexOf("X-TIMESTAMP-MAP")){var u=new RegExp(/LOCAL[:=]([^,]+)/),h=new RegExp(/MPEGTS[:=]([^,]+)/);r=0,e=0;var a=u.exec(o);if(a&&a.length>=2){var c=a[1].split(":");if(c&&c.length>=3){var f=c[2].split("."),l=0,v=0;f&&f.length>=2&&(l=parseInt(f[0]),v=parseInt(f[1])),r=1e3*(3600*c[0]+60*c[1]+l)+v,r%=n}}var d=h.exec(o);d&&d.length>=2&&(e=parseFloat(d[1]),e=Math.round(e/90)),t.clockReference=t.pcr(),t.localCueTime=r,t.mpegTSTime=e,null===t.clockReference||t.clockReference}else if(o.indexOf("--\x3e")>=0){var p=o.split("--\x3e");if(p){var m=p[0].split(":");if(m){var b=1e3*(3600*parseInt(m[0])+60*parseInt(m[1])+parseFloat(m[2]));null!==t.clockReference&&void 0!==t.clockReference||(t.clockReference=b%n+t.mpegTSTime)}}break}}t.adjustedTime=e-r-t.clockReference+t.offset}}},i.prototype.pcr=function(){var t=this;if(!t.__controller)return 0;var i=t.__controller.model,n=i.getPCR();if("number"!=typeof n)return null;if(n=n/t.__controller.model.timescale*1e3,i.live&&n<0){var e=-Math.floor(Math.pow(2,32)/90),r=Math.floor((Math.pow(2,32)-1)/90);n=Math.abs(n-e)+r}return n},i.prototype.isBuffered=function(){return!!this.data}},2835:function(t,i,n){"use strict";t.exports=s;var e=n(3288),r=n(6837);function s(){this.pN=0}s.prototype.destroy=function(){this.pN=0},s.prototype.parse=function(t,i,n){var s=this;if(!t||!i||!e[i])return null;s.pN=0;var o=new DataView(t.buffer);if(r.isNullOrUndefined(n)?(n=s.findBoxOffset(o,i),s.pN=n):s.pN=n,s.pN<0)return null;var u=s.parseHeader(o,i,s.pN);return!u||u.boxSize>o.byteLength?null:"sidx"===u.boxType?s.mN(o,u,n):s.X_(o,u)},s.prototype.bN=function(t){var i=this,n=[];if(!t)return n;i.pN=0;for(var r=new DataView(t.buffer);i.pN+8<=r.byteLength;){var s=i.pN,o=i.gN(r.getUint32(s+4),4);if(e[o]){var u=i.parseHeader(r,o,s);u&&("sidx"===u.boxType?n.push(i.mN(r,u)):n.push(i.X_(r,u)))}else i.pN++}return n},s.prototype.parseHeader=function(t,i,n){var r=this,s={boxOffset:n};r.pN=n;var o=r.yN(t,s);return-1===o||s.boxType!==i||e[i].fullBox&&-1===(o=r.wN(t,s))?null:s},s.prototype.extractVttCaptions=function(t){var i=this,n=[];if(i.pN=0,!t)return n;var e=new DataView(t.buffer),r=i.findBoxOffset(e,"mdat");if(r<0)return n;var s=t.slice(r+8),o=i.bN(s);if(!o.length)return n;for(var u=0;u<o.length;u++){var h=o[u];if(h)if("vttc"===h.boxType){i.pN=0;var a=s.slice(h.boxOffset+8,h.boxOffset+h.boxSize),c=i.bN(a);n.push(i._N(c))}else"vtte"===h.boxType&&n.push({})}return n},s.prototype.X_=function(t,i,n){var r=this;if(!t||!i||i.boxSize>t.byteLength)return i;var s=e[i.boxType],o=s.properties;if(!o)return r.pN+=i.boxSize-(s.fullBox?12:8),i;for(var u=Object.keys(o),h=0;h<u.length;h++){var a=u[h],c=o[a];if(r.EN(c.validator,i[c.validationProperty]||i.flags,c.validationResult))if("array"===c.type){i[a]=[];var f=c.length||c.lengthField&&i[c.lengthField],l=c.itemSchema;if(!l)break;f?r.AN(i,a,t,f,l,n):r.SN(i,a,t,l)}else r.TN(t,c,n,a),i[a]=r.IN(i,c,t)}return i},s.prototype.TN=function(t,i,n,e,r,s){if(n&&i){var o=!n.pos||n.pos&&n.pos===r||r===s-1&&-1===n.pos;n.name&&e===n.name&&n.length&&i.length&&n.length===i.length&&o&&this.jN(t,n)}},s.prototype.AN=function(t,i,n,e,r,s){for(var o,u=this,h=0;h<e;h++){if(r.length)o=u.IN(t,r,n);else{o={};for(var a=Object.keys(r),c=0;c<a.length;c++){var f=a[c],l=r[f];u.EN(l.validator,t.flags)&&(u.TN(n,l,s,f,h,e),o[f]=u.IN(t,l,n))}}t[i].push(o)}},s.prototype.SN=function(t,i,n,e){for(var r;this.pN<t.boxOffset+t.boxSize;)r=this.IN(t,e,n),t[i].push(r)},s.prototype.EN=function(t,i,n){return!t||(n?(i&t)===n:i&t)},s.prototype.IN=function(t,i,n){var e,r=this;return i.length&&(e=r.MN(n,i.length),r.pN+=e.readBytes,e.readBytes===i.length/8)?"string"===i.type?r.gN(e.value,4):e.value:"string"===i.type?r.NN(t,n):"boxstring"===i.type?r.RN(t,n):null},s.prototype.MN=function(t,i){var n=this,e={value:0,readBytes:0},r=i/8;if(n.pN+r<=t.byteLength){switch(i){case 8:e.value=t.getUint8(n.pN);break;case 16:e.value=t.getUint16(n.pN);break;case 32:e.value=t.getUint32(n.pN);break;case 64:for(var s=new Uint8Array(8),o=0;o<8;o++)s[o]=t.getUint8(n.pN+o);e.value=s}e.readBytes=r}return e},s.prototype.jN=function(t,i){var n=this,e=i.value;switch(i.length){case 8:t.setUint8(n.pN,e);break;case 16:t.setUint16(n.pN,e);break;case 32:t.setUint32(n.pN,e)}},s.prototype.NN=function(t,i){var n=this,e="",r=n.MN(i,8);for(n.pN+=r.readBytes;r.readBytes>0&&r.value>0&&n.pN<t.boxOffset+t.boxSize;)e+=String.fromCharCode(r.value),r=n.MN(i,8),n.pN+=r.readBytes;return e},s.prototype.RN=function(t,i){var n=this,e=t.boxSize-(n.pN-t.boxOffset),r=String.fromCharCode.apply(null,new Uint8Array(i.buffer,n.pN,e));return n.pN+=e,r},s.prototype.findBoxOffset=function(t,i){if(!t||t.byteLength<8)return-1;var n,r=e[i].parents,s=0;if(r&&r.length>0){for(var o=!1,u=0;u<r.length;u++){var h=r[u];if((n=this.findBoxOffset(t,h))>=0){s=n+(e[h].fullBox?12:8);var a=e[h].payload;a&&(s+=a),o=!0;break}}if(!o)return-1}for(;s+8<=t.byteLength;){if(this.gN(t.getUint32(s+4),4)===i)return s;var c=t.getUint32(s);if(!(c>0))break;s+=c}return-1},s.prototype.yN=function(t,i){var n=this;if(!t||!i||t.byteLength<8)return-1;i.boxSize=t.getUint32(n.pN),n.pN+=4;var e=t.getUint32(n.pN);return i.boxType=n.gN(e,4),n.pN+=4,1===i.boxSize&&(i.boxSize=n.kN(t),n.pN+=8),0},s.prototype.wN=function(t,i){if(!t||!i)return-1;var n=t.getUint32(this.pN);return i.boxVersion=n>>24,i.flags=16777215&n,this.pN+=4,0},s.prototype.mN=function(t,i,n){var e,r=this;if(!t||!i)return null;n=n||0,r.pN+=4,r.pN+=4,0===i.boxVersion?(t.getUint32(r.pN),r.pN+=4,e=t.getUint32(r.pN),r.pN+=4):(r.kN(t),r.pN+=8,e=r.kN(t),r.pN+=8),r.pN+=2;var s=t.getUint16(r.pN);r.pN+=2;for(var o=i.boxOffset+i.boxSize+e,u=[],h=0;h<s;h++){var a=t.getUint32(r.pN);if(r.pN+=4,1===a>>>31)return null;var c=2147483647&a;r.pN+=8,u.push({brStartOffset:o+n,brEndOffset:o+n+c-1}),o+=c}return u},s.prototype.setSingleProp=function(t,i,n){var e=this;if(t&&i){var r=new DataView(t.buffer),s=e.findBoxOffset(r,i);if(!(s<0)){e.pN=s;var o=e.parseHeader(r,i,s);o&&e.X_(r,o,n)}}},s.prototype.gN=function(t,i){if(!t||!i)return"";for(var n=new Array(i),e=i-1;e>=0;e--){var r=255&t;n[e]=String.fromCharCode(r),t>>>=8}return n.join("")},s.prototype.kN=function(t){var i=this.pN,n=t.getUint32(i);i+=4;var e=t.getUint32(i);return n*Math.pow(2,32)+e},s.prototype._N=function(t){for(var i={},n=0;n<t.length;n++){var e=t[n];if(e)switch(e.boxType){case"vsid":i.sourceId=e.sourceId;break;case"ctim":i.cueTime=e.cueTime;break;case"payl":i.cueText=e.cueText}}return i}},3288:function(t){"use strict";t.exports={ftyp:{fullBox:!1,properties:{majorBrand:{length:32,type:"string"},minorVersion:{length:32},compatibleBrands:{type:"array",itemSchema:{length:32,type:"string"}}}},moov:{fullBox:!1},styp:{fullBox:!1,properties:{majorBrand:{length:32,type:"string"},minorVersion:{length:32},compatibleBrands:{type:"array",itemSchema:{length:32,type:"string"}}}},moof:{fullBox:!1},mdat:{fullBox:!1},sidx:{fullBox:!0,properties:{referenceId:{length:32},timescale:{length:32},earliestPresentationTime:{length:32},firstOffset:{length:32},reserved:{length:16},referenceCount:{length:16},referenceData:{type:"array",lengthField:"referenceCount",itemSchema:{referenceType:{length:1},referencedSize:{length:31},subsegmentDuration:{length:32},startsWithSAP:{length:1},sapType:{length:3},sapDeltaTime:{length:28}}}}},emsg:{fullBox:!0,properties:{schemeIdUri:{type:"string"},value:{type:"string"},timescale:{length:32},presentationTimeDelta:{length:32},eventDuration:{length:32},id:{length:32},message:{type:"array",itemSchema:{length:8}}}},trak:{fullBox:!1,parents:["moov"]},mdia:{fullBox:!1,parents:["trak"]},mvhd:{fullBox:!0,parents:["moov"],properties:{creationTime:{length:32},modificationTime:{length:32},timescale:{length:32},duration:{length:32},rate:{length:32},volume:{length:16},reserved:{length:80},matrix:{type:"array",length:9,itemSchema:{length:32}},preDefined:{length:192},nextTrackId:{length:32}}},mdhd:{fullBox:!0,parents:["mdia"],properties:{creationTime:{length:32},modificationTime:{length:32},timescale:{length:32},duration:{length:32},language:{length:16},preDefined:{length:16}}},esds:{fullBox:!0,parents:["mp4a","enca"],properties:{descriptorTag:{length:8},descriptorLength:{length:8},esId:{length:16},streamPriority:{length:8},decoderConfigDesc:{length:8},decoderConfigLength:{length:8},codecTag:{length:8},streamType:{length:8},bufferSize:{length:8},bufferSize2:{length:16},maxBitrate:{length:32},avgBitrate:{length:32},decoderInfoDescriptor:{length:8},decoderInfoDescriptorLength:{length:8},audioSpecificConfig0:{length:8},audioSpecificConfig1:{length:8},audioSpecificConfig2:{length:8,validator:248,validationProperty:"audioSpecificConfig0",validationResult:40},audioSpecificConfig3:{length:8,validator:248,validationProperty:"audioSpecificConfig0",validationResult:40},slDescriptor:{length:8},slDescriptorLength:{length:8},slValue:{length:8}}},mp4a:{fullBox:!1,parents:["stsd"],payload:28,properties:{reserved0:{length:48},dataReferenceIndex:{length:16},reserved1:{length:32},reserved2:{length:32},channelCount:{length:16},sampleSize:{length:16},predefined:{length:16},reserved3:{length:16},sampleRate:{length:32}}},enca:{fullBox:!1,parents:["stsd"],payload:28,properties:{reserved0:{length:48},dataReferenceIndex:{length:16},reserved1:{length:32},reserved2:{length:32},channelCount:{length:16},sampleSize:{length:16},predefined:{length:16},reserved3:{length:16},sampleRate:{length:32}}},stsd:{fullBox:!0,parents:["stbl"],payload:4,properties:{entryCount:{length:32}}},stbl:{fullBox:!1,parents:["minf"]},minf:{fullBox:!1,parents:["mdia"]},traf:{fullBox:!1,parents:["moof"]},tfdt:{fullBox:!0,parents:["traf"],properties:{baseMediaDecodeTime:{length:32}}},tfhd:{fullBox:!0,parents:["traf"],properties:{trackId:{length:32},baseDataOffset:{length:64,validator:1},sampleDescriptionIndex:{length:32,validator:2},defaultSampleDuration:{length:32,validator:8},defaultSampleSize:{length:32,validator:16},defaultSampleFlags:{length:32,validator:32}}},trun:{fullBox:!0,parents:["traf"],properties:{sampleCount:{length:32},dataOffset:{validator:1,length:32},firstSampleFlags:{validator:4,length:32},sampleData:{type:"array",lengthField:"sampleCount",itemSchema:{sampleDuration:{validator:256,length:32},sampleSize:{validator:512,length:32},sampleFlags:{validator:1024,length:32},sampleCompositionTimeOffset:{validator:2048,length:32}}}}},vttc:{fullBox:!1},vtte:{fullBox:!1},vsid:{fullBox:!1,parents:["vttc"],properties:{sourceId:{length:32}}},ctim:{fullBox:!1,parents:["vttc"],properties:{cueTime:{type:"boxstring"}}},payl:{fullBox:!1,parents:["vttc"],properties:{cueText:{type:"boxstring"}}},iden:{fullBox:!1,parents:["vttc"],properties:{cueId:{type:"boxstring"}}},sttg:{fullBox:!1,parents:["vttc"],properties:{settings:{type:"boxstring"}}}}},9730:function(t){"use strict";t.exports=i;function i(){}i.prototype.initSegment=function(t,i){var n=this.ftyp(i),e=this.moov(t),r=new Uint8Array(n.byteLength+e.byteLength);return r.set(n),r.set(e,n.byteLength),r},i.prototype.ftyp=function(t){t=t||"avc1";var i=new Uint8Array([105,115,111,109]),n=new Uint8Array([0,0,0,1]),e=new Uint8Array([t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)]);return this.LN("ftyp",[i,n,e])},i.prototype.moov=function(t){var i=this,n=[];n.push(i.DN(t[0].config.duration,t[0].config.timescale));for(var e=0;e<t.length;e++)n.push(i.CN(t[e]));return n.push(i.PN(t)),i.LN("moov",n)},i.prototype.moof=function(t,i){var n=this,e=[];e.push(n.xN(t));for(var r=0;r<i.length;r++){var s=n.UN(i[r]);e.push(s)}return n.LN("moof",e)},i.prototype.mdat=function(t){var i=[];if(t&&t.frames)for(var n=0;n<t.frames.length;n++)i.push(t.frames[n].data);return this.LN("mdat",i)},i.prototype.xN=function(t){var i=new Uint8Array(4);return new DataView(i.buffer).setUint32(0,t),this.VN("mfhd",0,new Uint8Array(3),[i])},i.prototype.UN=function(t){if(t){var i,n,e=this,r=[],s=32,o=e.BN(t);return s+=o.length,r.push(o),t.frames&&t.frames.length&&(s+=(i=e.FN(t.frames[0].dts)).length,r.push(i)),"video"===t.type&&(s+=(n=e.zN(t)).length),r.push(e.GN(t,s)),n&&r.push(n),e.LN("traf",r)}},i.prototype.BN=function(t){var i=new Uint8Array(4);return new DataView(i.buffer).setUint32(0,t.streamId),this.VN("tfhd",0,new Uint8Array([0,0,0]),[i])},i.prototype.FN=function(t){var i=new Uint8Array(4);return new DataView(i.buffer).setUint32(0,Math.max(0,t)),this.VN("tfdt",0,new Uint8Array([0,0,0]),[i])},i.prototype.GN=function(t,i){var n=this,e=t.frames||[],r=e.length,s=n.HN(e),o=0,u=s[1],h=0;for(h=0;h<4;h++)o+=u&1<<h?1:0;var a=new Uint8Array(4*o*r),c=new DataView(a.buffer);i+=20+a.length+8;var f=n.YN(r,i),l=0;for(h=0;h<r;h++){var v=e[h];if(1&u&&(c.setUint32(l,v.duration),l+=4),2&u&&(c.setUint32(l,v.size),l+=4),4&u){var d=(v.flags.isLeading<<2|v.flags.dependsOn)<<24|(v.flags.isDependedOn<<6|v.flags.hasRedundancy<<4|v.flags.paddingValue<<1|v.flags.isNonSyncSample)<<16|(240&v.flags.degradationPriority)<<8|15&v.flags.degradationPriority;c.setUint32(l,d),l+=4}8&u&&(c.setUint32(l,v.pts-v.dts),l+=4)}return n.VN("trun",0,s,[f,a])},i.prototype.zN=function(t){for(var i=t.frames||[],n=i.length,e=new Uint8Array(n),r=0;r<n;r++){var s=i[r];s.flags&&(e[r]=s.flags.isLeading<<6|s.flags.dependsOn<<4|s.flags.isDependedOn<<2|s.flags.hasRedundancy)}return this.VN("sdtp",0,new Uint8Array(3),[e])},i.prototype.YN=function(t,i){var n=new Uint8Array(8),e=new DataView(n.buffer);return e.setUint32(0,t),e.setInt32(4,i),n},i.prototype.HN=function(t){var i=t.length,n=new Uint8Array(3);return n[2]=1,i&&(void 0!==t[0].duration&&(n[1]|=1),void 0!==t[0].size&&(n[1]|=2),void 0!==t[0].flags&&(n[1]|=4),void 0!==t[0].pts&&(n[1]|=8)),n},i.prototype.DN=function(t,i){var n=new Uint8Array(96),e=new DataView(n.buffer);e.setUint32(0,1),e.setUint32(4,2);var r=i||9e4;return e.setUint32(8,r),t&&e.setUint32(12,t),e.setUint32(16,65536),e.setUint16(20,256),e.setUint32(32,65536),e.setUint32(48,65536),e.setUint32(64,1073741824),e.setUint32(92,4294967295),this.VN("mvhd",0,new Uint8Array(3),[n])},i.prototype.CN=function(t){var i=this;t.config.duration=t.config.duration||4294967295;var n=[i.qN(t)];return t.config.useEditBox&&n.push(i.WN(t)),n.push(i.QN(t)),i.LN("trak",n)},i.prototype.qN=function(t){var i=new Uint8Array(80),n=new DataView(i.buffer);return n.setUint32(8,t.streamId),n.setUint32(16,t.config.duration),n.setUint8(32,"audio"===t.type?1:0),n.setUint32(36,65536),n.setUint32(52,65536),n.setUint32(68,1073741824),n.setUint16(72,t.config.width),n.setUint16(76,t.config.height),this.VN("tkhd",0,new Uint8Array([0,0,7]),[i])},i.prototype.WN=function(t){return this.LN("edts",[this.XN(t)])},i.prototype.XN=function(t){var i=new Uint8Array(16),n=new DataView(i.buffer);return n.setUint32(0,1),n.setUint32(4,0),n.setUint32(8,t.config.offset),n.setUint16(12,1),n.setUint16(14,0),this.VN("elst",0,new Uint8Array(3),[i])},i.prototype.QN=function(t){var i=this;return i.LN("mdia",[i.ZN(t),i.$N(t.type),i.JN(t)])},i.prototype.ZN=function(t){var i=new Uint8Array(20),n=new DataView(i.buffer);n.setUint32(0,2),n.setUint32(4,3);var e=t.config.timescale||9e4;return n.setUint32(8,e),n.setUint32(12,t.config.duration),n.setUint16(16,21956),this.VN("mdhd",0,new Uint8Array(3),[i])},i.prototype.$N=function(t){var i={video:1986618469,audio:1936684398,hint:1751740020},n=new Uint8Array(32),e=new DataView(n.buffer);return e.setUint32(4,i[t]),e.setUint32(20,i[t]),e.setUint32(24,1214344804),e.setUint32(28,1818587648),this.VN("hdlr",0,new Uint8Array(3),[n])},i.prototype.JN=function(t){var i=this,n="audio"===t.type?i.KN():i.tR();return i.LN("minf",[n,i.iR(),i.nR(t)])},i.prototype.tR=function(){var t=new Uint8Array(8);return this.VN("vmhd",0,new Uint8Array([0,0,1]),[t])},i.prototype.KN=function(){var t=new Uint8Array(4);return this.VN("smhd",0,new Uint8Array(3),[t])},i.prototype.iR=function(){return this.LN("dinf",[this.eR()])},i.prototype.eR=function(){var t=new Uint8Array([0,0,0,1]),i=[];return i.push(t),i.push(this.l_(new Uint8Array([0,0,1]))),this.VN("dref",0,new Uint8Array(3),i)},i.prototype.l_=function(t){return this.VN("url ",0,t,[])},i.prototype.rR=function(t){return this.VN("urn ",0,t,[])},i.prototype.nR=function(t){var i=this;return i.LN("stbl",[i.sR(t),i.oR(),i.uR(),i.hR(),i.aR()])},i.prototype.sR=function(t){var i=this,n="audio"===t.type?i.cR(t):i.fR(t),e=new Uint8Array([0,0,0,1]);return i.VN("stsd",0,new Uint8Array(3),[e,n])},i.prototype.fR=function(t){var i=this,n=[];n.push((65280&t.config.ppsLength)>>>8),n.push(255&t.config.ppsLength);try{t.config.ppsLength>0&&(n=n.concat(Array.prototype.slice.call(t.config.pps)))}catch(t){}var e=[];e.push((65280&t.config.spsLength)>>>8),e.push(255&t.config.spsLength);try{t.config.spsLength>0&&(e=e.concat(Array.prototype.slice.call(t.config.sps)))}catch(t){}var r=new Uint8Array(78),s=new DataView(r.buffer);return s.setUint16(6,1),s.setUint16(24,t.config.width),s.setUint16(26,t.config.height),s.setUint32(28,4718592),s.setUint32(32,4718592),s.setUint16(40,1),s.setUint32(42,259613032),s.setUint32(46,1869557110),s.setUint32(50,1768187247),s.setUint32(54,761818227),s.setUint16(74,24),s.setUint16(76,65535),i.LN("avc1",[r,i.LN("avcC",[new Uint8Array([1,t.config.profileIndication,t.config.profileCompatibility,t.config.levelIndication,255].concat([255&t.config.numOfSPS|224]).concat(e).concat([255&t.config.numOfPPS]).concat(n))]),i.lR()])},i.prototype.lR=function(){var t=new Uint8Array(12);return new DataView(t.buffer).setUint32(0,1875072),this.LN("btrt",[t])},i.prototype.cR=function(t){var i=new Uint8Array(8),n=new DataView(i.buffer);n.setUint16(6,1);var e=new Uint8Array(20);return(n=new DataView(e.buffer)).setUint16(8,t.config.channels),n.setUint16(10,t.config.sampleSize),n.setUint16(16,t.config.samplingFreq),this.LN("mp4a",[i,e,this.vR(t)])},i.prototype.vR=function(t){var i=new Uint8Array(27),n=new DataView(i.buffer);return n.setUint8(0,3),n.setUint8(1,25),n.setUint8(5,4),n.setUint8(6,17),n.setUint8(7,64),n.setUint8(8,21),n.setUint16(10,1536),n.setUint8(20,5),n.setUint8(21,2),n.setUint8(22,t.config.audioObjectTypeIndex<<3|t.config.samplingFreqIndex>>>1),n.setUint8(23,t.config.samplingFreqIndex<<7|t.config.channels<<3),n.setUint8(24,6),n.setUint8(25,1),n.setUint8(26,2),this.VN("esds",0,new Uint8Array(3),[i])},i.prototype.oR=function(){var t=new Uint8Array(4);return this.VN("stts",0,new Uint8Array(3),[t])},i.prototype.uR=function(){var t=new Uint8Array(4);return this.VN("stsc",0,new Uint8Array(3),[t])},i.prototype.hR=function(){var t=new Uint8Array(8);return this.VN("stsz",0,new Uint8Array(3),[t])},i.prototype.aR=function(){var t=new Uint8Array(4);return this.VN("stco",0,new Uint8Array(3),[t])},i.prototype.PN=function(t){for(var i=[],n=0;n<t.length;n++)i.push(this.dR(t[n]));return this.LN("mvex",i)},i.prototype.dR=function(t){var i=new Uint8Array(20),n=new DataView(i.buffer);return n.setUint32(0,t.streamId),n.setUint32(4,1),n.setUint32(16,65537),"video"!==t.type&&(i[i.length-1]=0),this.VN("trex",0,new Uint8Array(3),[i])},i.prototype.VN=function(t,i,n,e){var r=new Uint8Array(1);r[0]=i;var s=[r,n];return s=s.concat(e),this.LN(t,s)},i.prototype.LN=function(t,i){var n=0,e=new Uint8Array([t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)]),r=0,s=0;for(s=0;s<i.length;s++)r+=i[s].length;var o=new Uint8Array(r+8);for(new DataView(o.buffer,o.byteOffset,o.byteLength).setUint32(0,o.byteLength),o.set(e,4),n=8,s=0;s<i.length;s++)o.set(i[s],n),n+=i[s].length;return o}},5328:function(t,i,n){"use strict";t.exports=r;var e=n(9730);function r(){this.pR=null,this.mR=new e}r.prototype.destroy=function(){this.pR=null},r.prototype.generate=function(t){if(!t)return null;var i=this,n=[t],e=null,r=null,s=null,o=0;if(t.config.shouldInit){var u="audio"===t.type?"mp41":"avc1";o+=(e=i.bR(n,u))?e.length:0}t.frames.length&&(o+=(r=i.gR(n))?r.length:0,o+=(s=i.yR(n))?s.length:0),i.pR=new Uint8Array(o);var h=0;e&&(i.pR.set(e,h),h+=e.length),r&&(i.pR.set(r,h),h+=r.length),s&&(i.pR.set(s,h),h+=s.length);var a=t.frames.length>0?t.frames[t.frames.length-1].duration:0,c=t.endTime+a;return{data:i.pR,type:t.type,codec:t.config.codec,mimeType:t.type+'/mp4; codecs="'+t.config.codec+'"',startTime:t.frames.length?t.startTime/t.config.timescale:0,endTime:t.frames.length?c/t.config.timescale:0,endTimestamp:c}},r.prototype.bR=function(t,i){if(!t||!t.length)return null;var n=this.mR.initSegment(t,i);return n||null},r.prototype.gR=function(t){var i=this,n=0;return t&&t.length?(t.forEach((function(t){n=t.config.seqNum,t.frames&&t.frames.length&&t.frames.forEach((function(n,e,r){n.size=n.nalUnitSize?n.nalUnitSize+4*n.nalUnits.length:n.data?n.data.length:0,e<r.length-1?n.duration=t.frames[e+1].dts-n.dts:n.duration=e>0?n.dts-t.frames[e-1].dts:t.config.defaultFrameDuration||i.wR(t.type.track.config.timescale),n.duration}))})),i.mR.moof(n,t)):null},r.prototype.yR=function(t){var i=this;if(!t||!t.length)return null;var n,e=[],r=0;t.forEach((function(t){"video"===t.type&&t.frames.forEach((function(t){t.normalizedData=new Uint8Array(t.nalUnitSize+4*t.nalUnits.length);var i=new DataView(t.normalizedData.buffer),n=0;t.nalUnits.forEach((function(e){i.setUint32(n,e.data.byteLength),n+=4,t.normalizedData.set(e.data,n),n+=e.data.byteLength})),t.data=t.normalizedData})),(n=i.mR.mdat(t))&&n.length&&(e.push(n),r+=n.length)}));var s=new Uint8Array(r),o=0;return e.forEach((function(t){s.set(t,o),o+=t.length})),s},r.prototype.wR=function(t,i){return("audio"===t?.0232199546:.0333333333)*i}},4838:function(t,i,n){"use strict";t.exports=c;var e=n(3713),r=n(2990),s=n(6837),o=n(2999),u=n(4641),h=n(7279).AACStream,a=n(7650).HLSEvent.PCR_AVAILABLE;function c(t){var i=this;o.call(i,i.constructor.name),i.ER=t,i._=null,i.AR="start",i.s_=new h,i.OR=!1,i._h={},i.SR=i.__controller.create(e,t,i.TR.bind(i)),i.IR=t.lastChunkEndTs?t.lastChunkEndTs.audio:NaN,i.jR=t.lastFrameDuration?t.lastFrameDuration.audio:NaN,s.isNullOrUndefined(i.ER.pcr)&&(i._h[a]=i.__controller.addEventListener(a,i.MR,i))}r.inherits(c,o),c.prototype.destroy=function(){var t=this;t.close(),t.SR.destroy(),t.s_.destroy(),o.prototype.destroy.call(t)},c.prototype.setSource=function(t){this.NR=t,this.jO()},c.prototype.jO=function(){var t=this;t.NR&&(t.NR.addEventListener(u.DATA_PROCESS_PROGRESS,(function(i){t.append(i)}),t),t.NR.addEventListener(u.DATA_PROCESS_COMPLETE,(function(){t.endOfSegment()}),t),t.NR.addEventListener(u.DATA_PROCESS_ERROR,(function(i){t.publish(u.DATA_PROCESS_ERROR,i)}),t))},c.prototype.close=function(){var t=this;t._=null,t.__controller.removeEventListener(a,t._h[a]),t.SR.close()},c.prototype.append=function(t){var i=this;if(t){var n=t.length;if(n){var e=null,r=0;i._&&(r=(e=i._).length);var s=r+n;i._=new Uint8Array(s),e&&i._.set(e),i._.set(t,r),i.X_()}}},c.prototype.MR=function(t){var i=this;i.ER.pcr=t,i.X_(),i.__controller.removeEventListener(a,i._h[a])},c.prototype.X_=function(){var t=this,i=t.ER.pcr;if(!s.isNullOrUndefined(i)){if(t._&&t._.length>0){var n;n=t.IR&&t.jR?i+t.IR+t.jR:i+t.ER.startTime*t.ER.timescale;var e=t.s_.readFramesFromBitstream(t._,n);t._=t._.subarray(e)}var r=t.s_.getLastFrameDetails();r&&(t.IR=r.timestamp-i,t.jR=r.duration),(t.s_.ready||t.OR)&&t.RR()}},c.prototype.RR=function(){var t=this,i=t.s_.getFrames(),n=i&&i.length>0;if("end"===t.AR||n){var e=n?i[0].dts:null,r={audio:{frames:i,config:t.s_.getConfig()},pcr:e};t.SR.processSegmentData({avData:r,pos:t.AR}),"start"===t.AR&&(t.AR="middle")}},c.prototype.endOfSegment=function(){var t=this;t.AR="end",t.OR=!0,t.X_(),t.SR.endOfSegment()},c.prototype.TR=function(t,i){var n;t&&(this.publish(u.DATA_PROCESS_PROGRESS,t,i),t.getParam&&(n=t.getParam("parsedInfo")),"end"===(n?n.position:t.position)&&this.publish(u.DATA_PROCESS_COMPLETE))}},5619:function(t,i,n){"use strict";t.exports=h,t.exports.KEY_METHODS={AES_128:"AES-128",NONE:"NONE"};var e=n(4641),r=n(2990),s=n(2999),o="Key Import is rejected",u="Decryption is rejected";function h(){var t=this;t.KI=t.__controller.model.userAgent,s.call(t,t.constructor.name),"undefined"==typeof window?t.kR=crypto||msCrypto:t.kR=window.crypto||window.msCrypto,t.kR=t.kR.subtle||t.kR.webkitSubtle,t._=null,t.LR=null,t.DR={name:"AES-CBC",length:128,iv:null}}r.inherits(h,s),h.prototype.destroy=function(){this.close(),s.prototype.destroy.call(this)},h.prototype.close=function(){var t=this;t._=null,t.CR=null,t.LR=null,t.PR=null},h.prototype.append=function(t){t&&("key"===t.type?this.xR(t):this.UR(t))},h.prototype.UR=function(t){var i=this;if(t)if(i.CR){var n=new Uint8Array(i.CR.byteLength+t.byteLength);n.set(new Uint8Array(i.CR),0),n.set(new Uint8Array(t),i.CR.byteLength),i.CR=n}else i.CR=t},h.prototype.xR=function(t){var i=this;t&&(t.initVector||(t.initVector=i.VR(t.seqNum)),i.LR=t,i.DR.iv=i.BR(t.initVector).buffer,11!==i.KI.ie?i.kR.importKey("raw",t.data,i.DR,!0,["decrypt"]).then((function(t){i.PR=t,i.FR()}),(function(t){i.ZE(o,t)})):i.zR(t))},h.prototype.zR=function(t){var i=this,n=i.kR.importKey("raw",t.data,i.DR,!0,["decrypt"]);n?(n.onerror=function(t){i.ZE(o,t)},n.oncomplete=function(t){i.PR=t&&t.target?t.target.result:null,i.FR()}):i.ZE("Key Import operation is not created in IE-11")},h.prototype.FR=function(){var t=this;if(t.PR&&t.CR&&t.CR.byteLength&&t.OR){var i=t.CR.buffer,n=i.byteLength-i.byteLength%16,e=i.slice(0,n);t.CR=new Uint8Array(i.slice(n)),11!==t.KI.ie?t.kR.decrypt(t.DR,t.PR,e).then((function(i){t.GR(i)}),(function(i){t.ZE(u,i)})).catch((function(i){t.ZE("Exception",i.toString())})):t.HR(e)}},h.prototype.HR=function(t){var i=this;if(i.PR&&t){var n=i.kR.decrypt(i.DR,i.PR,t);n?(n.onerror=function(t){i.ZE(u,t)},n.oncomplete=function(t){t&&t.target&&i.GR(t.target.result)}):i.ZE("Decryption operation is not created in IE-11")}},h.prototype.GR=function(t){var i=this;i.publish(e.DATA_PROCESS_PROGRESS,new Uint8Array(t)),i.OR&&(0===i.CR.byteLength?i.publish(e.DATA_PROCESS_COMPLETE):i.FR())},h.prototype.BR=function(t){for(var i=[],n=0,e=(t=t.substr(2)).length;n<e;n+=2)i.push(parseInt(t.substr(n,2),16));return new Uint8Array(i)},h.prototype.endOfSegment=function(){var t=this;t.OR=!0,t.LR&&t.PR&&t.FR()},h.prototype.ZE=function(t,i){this.publish(e.DATA_PROCESS_ERROR)},h.prototype.VR=function(t){for(var i="0x",n=(t=t||0).toString(16),e=n.length<32?32-n.length:0,r=0;r<e;r++)i+="0";return i+=n}},5267:function(t,i,n){"use strict";t.exports=d;var e=n(6837),r=n(2990),s=n(2999),o=n(4641),u=n(2835),h=n(6473),a=n(5557),c=n(3789),f=n(1849),l=n(7279).NAL_UNIT_TYPES,v=n(2503).StreamTypes;function d(t){var i=this;s.call(i,i.constructor.name),i._=null,i.ER=t,i.YR=new h,i.ZS=new u,i.qR=new f}r.inherits(d,s),d.prototype.destroy=function(){var t=this;t._=null,t.ZS.destroy(),t.qR.destroy(),s.prototype.destroy.call(t)},d.prototype.setSource=function(t){this.NR=t,this.jO()},d.prototype.jO=function(){var t=this;t.NR&&(t.NR.addEventListener(o.DATA_PROCESS_PROGRESS,(function(i){t.append(i)}),t),t.NR.addEventListener(o.DATA_PROCESS_COMPLETE,(function(){t.endOfSegment()}),t),t.NR.addEventListener(o.DATA_PROCESS_ERROR,(function(i){t.publish(o.DATA_PROCESS_ERROR,i)}),t))},d.prototype.close=function(){this._=null},d.prototype.append=function(t){var i=this;if(t){var n=t.length;if(n){var e=null,r=0;i._&&(r=(e=i._).length);var s=r+n;i._=new Uint8Array(s),e&&i._.set(e),i._.set(t,r),i.WR()}}},d.prototype.WR=function(){for(var t=this;t._&&t._.length>=8;){var i=t._.length,n=new DataView(t._.buffer),e=t.ZS.parse(t._,"styp"),r=t.ZS.parse(t._,"emsg"),s=t.ZS.parse(t._,"moof"),u=t.ZS.parse(t._,"ftyp"),h=t.ZS.parse(t._,"moov");if(u&&h){t.ER.userAgent.android&&t.QR();var a=[];u&&a.push(u),h&&a.push(h);var c=t.XR(a),f=t.ZR(a),l=new Uint8Array(t._.buffer.slice(c,f));t.publish(o.DATA_PROCESS_PROGRESS,{position:"init",data:l}),t._.length>f?t._=new Uint8Array(t._.buffer.slice(f)):t._=null}else{if(!s)return;var d=t.ZS.findBoxOffset(n,"mdat");if(d<0)return;var p=t.ZS.parseHeader(n,"mdat",d),m=[];e&&m.push(e),r&&m.push(r),s&&m.push(s),p&&m.push(p);var b=t.XR(m),g=t.ZR(m);if(i<g)return;var y=t.$R(),w=t.ER.timescale,_=t.JR(),E=t.KR(),A=t._k(_,y);if(t.ER.dash){var O=Math.round(t.ER.startTime*w),S=t.ER.segDuration*w;E!==O&&(E=O,t.tL(E)),A!==S&&(t.iL(_,S),A=S)}var T=null;t.ER.type!==v.MAIN&&t.ER.type!==v.VIDEO||(T=t.nL(d,_,E,w));var I=new Uint8Array(t._.buffer.slice(b,g));t.AR="firstByte"===t.AR?"start":"middle",t.publish(o.DATA_PROCESS_PROGRESS,{position:t.AR,data:I,cea608TrackData:T,baseTime:E,defaultSampleDuration:y,totalDuration:A,samples:_.samples}),t.ER.dash&&r&&t.eL(r),t._.length>g?t._=new Uint8Array(t._.buffer.slice(g)):t._=null}}},d.prototype.endOfSegment=function(){this.WR(),this.publish(o.DATA_PROCESS_COMPLETE)},d.prototype.XR=function(t){if(!t||!t.length)return 0;var i=Number.POSITIVE_INFINITY;return t.forEach((function(t){i=Math.min(i,t.boxOffset)})),i},d.prototype.ZR=function(t){if(!t||!t.length)return 0;var i=0,n=t[0];return t.forEach((function(t){i<t.boxOffset&&(i=t.boxOffset,n=t)})),n.boxOffset+n.boxSize},d.prototype.KR=function(){var t=this.ZS.parse(this._,"tfdt");return t?t.baseMediaDecodeTime:0},d.prototype.tL=function(t){this.ZS.setSingleProp(this._,"tfdt",{name:"baseMediaDecodeTime",value:t,length:32})},d.prototype.iL=function(t,i){if(t&&t.totalDuration){var n=i-t.totalDuration,e=t.samples[t.samples.length-1].duration+n;e<0&&(e=0),this.ZS.setSingleProp(this._,"trun",{name:"sampleDuration",value:e,length:32,pos:-1})}},d.prototype.$R=function(){var t=this.ZS.parse(this._,"tfhd");return t&&t.defaultSampleDuration>0?t.defaultSampleDuration:0},d.prototype._k=function(t,i){return t.totalDuration?t.totalDuration:t.samples.length*i},d.prototype.JR=function(){var t=[],i=0,n=this.ZS.parse(this._,"trun");if(n&&n.sampleData)for(var r=n.sampleData.length,s=n.sampleData,o=0;o<r;o++){var u={};s[o].sampleDuration&&(u.duration=s[o].sampleDuration,i+=u.duration),s[o].sampleSize&&(u.size=s[o].sampleSize),s[o].sampleFlags&&(u.flags=s[o].sampleFlags),e.isNullOrUndefined(s[o].sampleCompositionTimeOffset)||(u.cto=s[o].sampleCompositionTimeOffset),t.push(u)}return{samples:t,totalDuration:i}},d.prototype.eL=function(t){var i=this;if(t){var n=i.rL(t.presentationTimeDelta,t.timescale),e=t.message&&i.YR.extractID3FromMessage(t.message),r={payload:e&&i.YR.getID3Payload(e),timestamp:i.ER.startTime+n},s=new c({type:a.MessageTypes.MESSAGE,id:a.MessageIds.TIMED_METADATA});s.putParam("timedMetadata",r),i.publish(o.DATA_PROCESS_PROGRESS,s)}},d.prototype.rL=function(t,i){return 0===i?0:t/i},d.prototype.QR=function(){var t=this,i=t.ZS.parse(t._,"esds");if(i){var n=i.audioSpecificConfig0>>3,e=i.audioSpecificConfig0<<1&14|i.audioSpecificConfig1>>7&1,r=i.audioSpecificConfig1>>3&7;if(5===n){var s=(n=2)<<3|(14&e)>>1,o=(1&e)<<7|r<<3;t.ZS.setSingleProp(t._,"esds",{name:"audioSpecificConfig0",value:s,length:8}),t.ZS.setSingleProp(t._,"esds",{name:"audioSpecificConfig1",value:o,length:8}),t.ZS.setSingleProp(t._,"esds",{name:"audioSpecificConfig2",value:0,length:8}),t.ZS.setSingleProp(t._,"esds",{name:"audioSpecificConfig3",value:0,length:8})}}},d.prototype.nL=function(t,i,n,e){for(var r=[],s=this._.slice(t+8),o=n,u=0,h=0,a=0;a<i.samples.length;a++){var c=i.samples[a];for(h+=c.size;u<h&&u<s.length;){var f=s[u]<<24|s[u+1]<<16|s[u+2]<<8|s[u+3];if((15&s[u+=4])===l.AD_INFO_SEI)for(var v=this.qR.parse(s,u+1),d=0;d<v.length;d++){var p=v[d];p.pts=o+c.cto,p.dts=o,p.timescale=e,r.push(p)}u+=f}o+=c.duration}return r}},4169:function(t,i,n){"use strict";t.exports=a;var e=n(8169),r=n(4641),s=n(2990),o=n(2999),u=n(5619),h=n(5619).KEY_METHODS;function a(t){if(!t)throw new Error("Invalid argument: data argument of the ProcessorChain is not complete");var i=this;i.ER=t,i.sL=null,i.oL=null,o.call(i,i.constructor.name),t.encryptionData&&t.encryptionData.method!==h.NONE&&(i.sL=i.__controller.create(u,t.encryptionData)),i.oL=e.create(i.__controller,t.containerFormat,t),i.sL&&i.oL.setSource(i.sL),i.uL=i.sL||i.oL,i.hL=i.oL,i.hL&&(i.hL.addEventListener(r.DATA_PROCESS_PROGRESS,(function(t,n){i.publish(r.DATA_PROCESS_PROGRESS,t,n)}),i),i.hL.addEventListener(r.DATA_PROCESS_COMPLETE,(function(t){i.publish(r.DATA_PROCESS_COMPLETE,t)}),i),i.hL.addEventListener(r.DATA_PROCESS_ERROR,(function(){i.publish(r.DATA_PROCESS_ERROR)}),i))}s.inherits(a,o),a.prototype.destroy=function(){var t=this;t.sL&&(t.sL.destroy(),t.sL=null),t.oL&&(t.oL.destroy(),t.oL=null),t.uL=null,t.hL=null,o.prototype.destroy.call(t)},a.prototype.append=function(t){this.uL&&this.uL.append(t)},a.prototype.close=function(){this.uL&&this.uL.close()},a.prototype.endOfSegment=function(){this.uL&&this.uL.endOfSegment()}},4641:function(t){"use strict";t.exports={DATA_PROCESS_PROGRESS:"dataProcessProgress",DATA_PROCESS_ERROR:"dataProcessError",DATA_PROCESS_COMPLETE:"dataProcessComplete"}},8169:function(t,i,n){"use strict";var e=n(8520),r=n(4838),s=n(5267);t.exports.create=function(t,i,n){if(!t||!i||"function"!=typeof t.create)return null;var o;switch(i){case"mp4":o=s;break;case"aac":o=r;break;default:case"ts":o=e}return t.create(o,n)}},8520:function(t,i,n){"use strict";t.exports=u;var e=n(1511),r=n(2990),s=n(2999),o=n(4641);function u(t){var i=this;s.call(i,i.constructor.name),i.ER=t,i.aL=i.__controller.create(e,t,i.TR.bind(i))}r.inherits(u,s),u.prototype.destroy=function(){this.aL.destroy(),s.prototype.destroy.call(this)},u.prototype.setSource=function(t){this.NR=t,this.jO()},u.prototype.jO=function(){var t=this;t.NR&&(t.NR.addEventListener(o.DATA_PROCESS_PROGRESS,(function(i){t.append(i)}),t),t.NR.addEventListener(o.DATA_PROCESS_COMPLETE,(function(){t.endOfSegment()}),t),t.NR.addEventListener(o.DATA_PROCESS_ERROR,(function(i){t.publish(o.DATA_PROCESS_ERROR,i)}),t))},u.prototype.close=function(){this.aL.close()},u.prototype.append=function(t){this.aL.append(t)},u.prototype.endOfSegment=function(){this.aL.endOfSegment()},u.prototype.TR=function(t){var i;t&&(this.publish(o.DATA_PROCESS_PROGRESS,t),t.getParam&&(i=t.getParam("parsedInfo")),"end"===(i?i.position:t.position)&&this.publish(o.DATA_PROCESS_COMPLETE,t))}},5877:function(t){"use strict";function i(t){var i=this;i.cL=t,i.a_=null,i.fL=!1,i.lL=0,i.vL=[],i.dL=null,i.pL=0,i.mL=0,i.bL=0,i.gL=[],i.yL=0,i.wL=0,i._L=0,i.EL=!1,i.AL=4}t.exports=i,i.prototype.destroy=function(){this.cL=null},i.prototype.parse=function(t,i){var n=this;n.a_=i;for(var e=0;e<t.length;e++)n.OL(t[e]);n.a_=null},i.prototype.OL=function(t){var i=this;if(i.SL(t.data1)&&i.SL(t.data2)&&(i._L=t.pts/t.timescale,t.data1&=127,t.data2&=127,0!==t.data1||0!==t.data2))if(t.data1>=1&&t.data1<=14&&1===t.fieldType&&(i.fL=!0),15===t.data1&&i.fL&&1===t.fieldType)i.fL=!1;else{if(t.data1>=16&&t.data1<31){if(i.TL(t.data1,t.data2))return;if(8!=(8&t.data1)&&0===t.fieldType?i.IL(0):8==(8&t.data1)&&0===t.fieldType?i.IL(1):8!=(8&t.data1)&&1===t.fieldType?i.IL(2):8==(8&t.data1)&&1===t.fieldType&&i.IL(3),null===i.dL)return;i.jL(t),i.ML(t),i.NL(t);var n=119&t.data1;17===n&&48==(112&t.data2)?i.RL(15&t.data2):18!==n&&26!==n||64&t.data2?19!==n&&27!==n||64&t.data2||i.kL(63&t.data2):i.LL(63&t.data2)}else{if(i.fL&&1===t.fieldType)return;if(t.data1>=32&&t.data1<=126){if(0===t.fieldType&&2===i.lL?i.IL(0):0===t.fieldType&&3===i.lL?i.IL(1):1===t.fieldType&&0===i.lL?i.IL(2):1===t.fieldType&&1===i.lL&&i.IL(3),null===i.dL)return;var e=i.DL(t.data1);if(i.dL.appendChar(e),t.data2>=32&&t.data2<=126){var r=i.DL(t.data2);i.dL.appendChar(r)}}}i.pL=t.data1,i.mL=t.data2}},i.prototype.jL=function(t){var i=this,n=119&t.data1,e=96&t.data2;17===n&&64===e?(i.dL.startNewRow(1),i.CL(t.data2)):17===n&&96===e?(i.dL.startNewRow(2),i.CL(t.data2)):18===n&&64===e?(i.dL.startNewRow(3),i.CL(t.data2)):18===n&&96===e?(i.dL.startNewRow(4),i.CL(t.data2)):21===n&&64===e?(i.dL.startNewRow(5),i.CL(t.data2)):21===n&&96===e?(i.dL.startNewRow(6),i.CL(t.data2)):22===n&&64===e?(i.dL.startNewRow(7),i.CL(t.data2)):22===n&&96===e?(i.dL.startNewRow(8),i.CL(t.data2)):23===n&&64===e?(i.dL.startNewRow(9),i.CL(t.data2)):23===n&&96===e?(i.dL.startNewRow(10),i.CL(t.data2)):16===n&&64===e?(i.dL.startNewRow(11),i.CL(t.data2)):19===n&&64===e?(i.dL.startNewRow(12),i.CL(t.data2)):19===n&&96===e?(i.dL.startNewRow(13),i.CL(t.data2)):20===n&&64===e?(i.dL.startNewRow(14),i.CL(t.data2)):20===n&&96===e&&(i.dL.startNewRow(15),i.CL(t.data2))},i.prototype.ML=function(t){17===(119&t.data1)&&32==(112&t.data2)&&(this.CL(t.data2),this.dL.appendChar(" "))},i.prototype.NL=function(t){var i=this,e=119&t.data1;20===e&&32===t.data2?i.dL.setMode(n.POP_ON_MODE):20===e&&33===t.data2?i.dL.backspace():20===e&&36===t.data2?i.dL.clearEndOfRow():20===e&&37===t.data2?i.dL.setMode(n.ROLL_UP_MODE,2):20===e&&38===t.data2?i.dL.setMode(n.ROLL_UP_MODE,3):20===e&&39===t.data2?i.dL.setMode(n.ROLL_UP_MODE,4):20===e&&41===t.data2?i.dL.setMode(n.PAINT_ON_MODE):20===e&&44===t.data2?i.dL.eraseDisplayMemory():20===e&&45===t.data2?i.dL.linebreak():20===e&&46===t.data2?i.dL.eraseNondisplayMemory():20===e&&47===t.data2?i.dL.endOfCaption():23===e&&33===t.data2?i.dL.setIndent(1):23===e&&34===t.data2?i.dL.setIndent(2):23===e&&35===t.data2&&i.dL.setIndent(3)},i.prototype.RL=function(t){var i=["®","°","½","¿","™","¢","£","♪","à"," ","è","â","ê","î","ô","û"],n=t;n<0||n>=i.length||this.dL.appendChar(i[n])},i.prototype.LL=function(t){var i=["Á","É","Ó","Ú","Ü","ü","´","¡","*","'","-","©","℠","·",'"','"',"À","Â","Ç","È","Ê","Ë","ë","Î","Ï","ï","Ô","Ù","ù","Û","«","»"],n=t-32;n<0||n>=i.length||this.dL.appendChar(i[n])},i.prototype.kL=function(t){var i=["Ã","ã","Í","Ì","ì","Ò","ò","Õ","õ","{","}","\\","^","_","|","~","Ä","ä","Ö","ö","ß","¥","¤","¦","Å","å","Ø","ø","┌","┐","└","┘"],n=t-32;n<0||n>=i.length||this.dL.appendChar(i[n])},i.prototype.SL=function(t){return[0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0][t]},i.prototype.DL=function(t){return 42===t?"á":92===t?"é":94===t?"í":95===t?"ó":96===t?"ú":123===t?"ç":124===t?"÷":125===t?"Ñ":126===t?"ñ":String.fromCharCode(t)},i.prototype.TL=function(t,i){return this.pL===t&&this.mL===i},i.prototype.CL=function(t){var i=this;if(16==(16&t)){var n=0;0==(14&t)?n=0:2==(14&t)?n=4:4==(14&t)?n=8:6==(14&t)?n=12:8==(14&t)?n=16:10==(14&t)?n=20:12==(14&t)?n=24:14==(14&t)&&(n=28),i.dL.setColumn(n)}else 14==(14&t)&&i.dL.setItalic();1==(1&t)&&i.dL.setUnderlined()},i.prototype.IL=function(t){var i=this;i.vL[t]||(i.vL[t]=new e(t,i.onFlipMemories.bind(this),i.onEraseDisplayMemory.bind(this),i.onLinebreak.bind(this))),i.lL=t,i.dL=i.vL[t]},i.prototype.getChannel=function(t){return this.vL[t]},i.prototype.translate608RowToVTTLine=function(t){var i=[10,15.33,20.66,26,31.33,36.66,42,47.33,52.66,58,63.33,68.66,74,79.33,84.66];return t<1||t>i.length?i[0]:i[t-1]},i.prototype.translate608ColumnToVTTPosition=function(t){var i=0;return t<=4?i=10:t>=5&&t<=8?i=20:t>=9&&t<=12?i=30:t>=13&&t<=16?i=40:t>=17&&t<=20?i=50:t>=21&&t<=24?i=60:t>=25&&t<=29?i=70:t>=29&&(i=80),i},i.prototype.onFlipMemories=function(t){var i=this;i.EL&&i.onEraseDisplayMemory(t);var e=i.getChannel(t);if(e.getMode()===n.POP_ON_MODE){if(i.yL=i._L,t===i.bL){var r=i.gL;i.gL=e.getCaptionRows(),e.setCaptionRows(r);for(var s=0;s<i.gL.length;s++)i.gL[s]&&i.gL[s].hasCaptionData()&&(i.EL=!0)}e.eraseNondisplayMemory()}},i.prototype.PL=function(t,i){var n=[];n.push("snapToLines:false"),n.push("align:start");var e="line:"+this.translate608RowToVTTLine(i)+"%";n.push(e);var r="position:"+this.translate608ColumnToVTTPosition(t)+"%";return n.push(r),n},i.prototype.xL=function(t,i,n){for(var e=i[t].toString();t<i.length-1;){var r=i[t+1];if(r&&r.hasCaptionData()){var s=r.toString();s.length>0&&(e+="\n"+s),n&&r.reset(),t++}else t++}return{rowIdx:t,rowText:e}},i.prototype.onEraseDisplayMemory=function(t){var i=this,e=i.getChannel(t),r=e.getMode();if(t===i.bL){if(r===n.POP_ON_MODE){i.wL=i._L;for(var s=0;s<i.gL.length;s++){var o=i.gL[s];if(o&&o.hasCaptionData()){var u=o.getStartPosition(),h=i.PL(u,s+1),a=i.xL(s,i.gL,!0);s=a.rowIdx;var c=a.rowText;i.wL-i.yL>i.AL&&(i.wL=i.yL+i.AL),i.UL(c,h),i.yL+=.001,o.reset()}}}else r===n.ROLL_UP_MODE||r===n.PAINT_ON_MODE?(-1!==i.yL&&0!==i.yL||(i.yL=i._L),i.wL>i.yL&&(i.yL=i.wL),i.VL(t),e.eraseNondisplayMemory()):r&&e.eraseNondisplayMemory();i.EL=!1}else e.eraseNondisplayMemory()},i.prototype.onLinebreak=function(t){var i=this;if(t===i.bL){var e=i.getChannel(t).getMode();e!==n.ROLL_UP_MODE&&e!==n.PAINT_ON_MODE||(-1!==i.yL&&0!==i.yL||(i.yL=i._L),i.wL>i.yL&&(i.yL=i.wL),i.VL(t))}},i.prototype.VL=function(t){for(var i=this,n=i.getChannel(t).getCaptionRows(),e=0;e<n.length;e++){var r=n[e];if(r&&r.hasCaptionData()){var s=i.PL(12,e),o=i.xL(e,n,!1);e=o.rowIdx;var u=o.rowText;i.wL=i.yL+1.5,i.UL(u,s),i.yL+=.001}}i.yL=-1},i.prototype.UL=function(t,i){var n=this,e="WEBVTT\nX-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:0\n\n";e+=n.BL(n.yL),e+=" --\x3e ",e+=n.BL(n.wL);for(var r=0;r<i.length;r++)e+=" "+i[r];if(e+="\n",e+=t+"\n",n.cL){var s={discontinuity:n.a_.discontinuity,sequenceNum:n.a_.seqNum,startTime:n.a_.startTime,programDateTime:n.a_.programDateTime,url:n.a_.url,duration:n.a_.duration,clockReference:0,localCueTime:0,mpegTSTime:0,data:e,offset:0,adjustedTime:0};n.cL(s)}},i.prototype.BL=function(t){var i=this,n=Math.floor(t/60/60);n=i.FL(n);var e=Math.floor(t/60%60);e=i.FL(e);var r=(t%60).toFixed(3);return n+":"+e+":"+(r=i.FL(r))},i.prototype.FL=function(t){return t<10&&(t="0"+t),t};var n={POP_ON_MODE:0,ROLL_UP_MODE:1,PAINT_ON_MODE:3};function e(t,i,n,e){var r=this;r.zL=t,r.GL=0,r.HL=[],r.YL=null,r.qL=null,r.WL=null,r.QL=i,r.XL=n,r.ZL=e}function r(){var t=this;t.$L=32,t.JL=-1,t.KL=!1,t.tD=!1,t.nD=0,t.rD=[],t.MAX_CHARS=32}function s(){var t=this;t.character="",t.isUnderlined=!1,t.isItalic=!1}e.prototype.setMode=function(t,i){this.WL=t,i<2?i=2:i>4&&(i=4),this.GL=i},e.prototype.getMode=function(){return this.WL},e.prototype.sD=function(t){var i=this;if(!(t<1||t>15)){(t<i.GL||null===i.YL)&&(i.YL=i.GL);for(var n=i.HL[0],e=0;e<i.HL.length;e++)e<i.HL.length-1?i.HL[e]=i.HL[e+1]:i.HL[e]=n,(e>i.YL||i.YL-i.GL>0&&e<i.YL-i.GL)&&i.HL[e]&&i.HL[e].reset()}},e.prototype.oD=function(){var t=this;t.ZL&&t.ZL(t.zL)},e.prototype.startNewRow=function(t){if(!(t<1||t>15)){var i=this;i.WL===n.ROLL_UP_MODE?i.sD(t):i.WL===n.PAINT_ON_MODE&&i.oD(),i.YL=t,i.qL=i.getCaptionRow(t),i.qL.reset()}},e.prototype.getCaptionRows=function(){return this.HL},e.prototype.setCaptionRows=function(t){this.HL=t},e.prototype.setIndent=function(t){this.qL&&this.qL.tabIndex(t)},e.prototype.setColumn=function(t){this.qL&&this.qL.columnIndex(t)},e.prototype.setItalic=function(){this.qL&&this.qL.setIsItalic(!0)},e.prototype.setUnderlined=function(){this.qL&&this.qL.setIsUnderlined(!0)},e.prototype.appendChar=function(t){this.qL&&this.qL.writeChar(t)},e.prototype.linebreak=function(){var t=this;t.ZL&&t.ZL(t.zL)},e.prototype.eraseNondisplayMemory=function(){for(var t=this,i=0;i<t.HL.length;i++)t.HL[i]&&t.HL[i].reset()},e.prototype.clearEndOfRow=function(){this.qL&&this.qL.clearToEnd()},e.prototype.backspace=function(){this.qL&&this.qL.backspace()},e.prototype.eraseDisplayMemory=function(){this.XL(this.zL)},e.prototype.endOfCaption=function(){this.QL(this.zL)},e.prototype.getCaptionRow=function(t){var i=this;if(t<1||t>15)return null;var n=t-1;return i.HL[n]||(i.HL[n]=new r),i.HL[n]},r.prototype.reset=function(){var t=this;t.tD=!1,t.KL=!1;for(var i=0;i<t.rD.length;i++)t.rD[i]&&t.rD[i].reset();t.nD=0,t.$L=32,t.JL=-1},r.prototype.clearToEnd=function(){for(var t=this,i=t.nD;i<t.rD.length;i++)t.rD[i]&&t.rD[i].reset()},r.prototype.columnIndex=function(t){t<0||t>=this.MAX_CHARS||(this.nD=t)},r.prototype.tabIndex=function(t){this.uD(t)},r.prototype.writeChar=function(t){var i=this,n=i.rD[i.nD];n||(i.rD[i.nD]=new s,n=i.rD[i.nD]),n.setValue(t,i.tD,i.KL),i.nD<i.$L&&(i.$L=i.nD),i.nD>i.JL&&(i.JL=i.nD),i.uD(1)},r.prototype.backspace=function(){var t=this;t.nD>0&&(t.rD[t.nD].reset(),t.nD--)},r.prototype.uD=function(t){var i=this;i.nD+t<i.MAX_CHARS?i.nD+=t:i.nD=i.MAX_CHARS-1},r.prototype.setIsItalic=function(t){this.tD=t},r.prototype.setIsUnderlined=function(t){this.KL=t},r.prototype.hasCaptionData=function(){return 32!==this.$L||-1!==this.JL},r.prototype.getCharacterAt=function(t){return t<0||t>=this.MAX_CHARS?null:this.rD[t]},r.prototype.getStartPosition=function(){return this.$L},r.prototype.getEndPosition=function(){return this.JL},r.prototype.toString=function(){var t=this,i="",n=!1,e=!1;if(t.hasCaptionData())for(var r=t.$L;r<=t.JL;r++){var s=t.getCharacterAt(r);s.isItalic&&!e?(i+="<i>",e=!0):e&&!s.isItalic&&(i+="</i>",e=!1),s.isUnderlined&&!n?(i+="<u>",n=!0):n&&!s.isUnderlined&&(i+="</u>",n=!1),"&"===s.character?i+="&amp;":"<"===s.character?i+="&lt;":">"===s.character?i+="&gt;":i+=s.character}return n&&(i+="</u>",n=!1),e&&(i+="</i>",e=!1),i},s.prototype.reset=function(){var t=this;t.character="",t.isItalic=!1,t.isUnderlined=!1},s.prototype.setValue=function(t,i,n){var e=this;e.character=t,e.isItalic=i,e.isUnderlined=n}},4939:function(t,i,n){"use strict";i.Loader=l,i.LoadRequest=function(t){var i=this;if(!t||e.isNullOrUndefined(t.maxRetries)||e.isNullOrUndefined(t.requestTimeout)||e.isNullOrUndefined(t.chunkedRequestTimeout))throw new Error("[LoadRequest] Invalid Arguments: Request details are not complete");i.method=t.method||"GET",i.chunked=t.isChunkedLoad||!1,i.useMSStream=t.useMSStream||!1,i.maxRetries=t.maxRetries,i.retryExclusion=t.retryExclusion,i.requestTimeout=1e3*t.requestTimeout,i.chunkedRequestTimeout=1e3*t.chunkedRequestTimeout,i.responseType=t.responseType||"text",i.headerFields=t.headerFields,i.minChunkSize=e.isNullOrUndefined(t.minChunkSize)?1e5:t.minChunkSize,i.stopStreamLoadOnError=t.stopStreamLoadOnError,i.url=t.url,i.withCredentials=t.withCredentials||!1,i.withResponseHeaders=t.withResponseHeaders||!1},i.Events={COMPLETE:"complete",ERROR:"error",PROGRESS:"progress",BYTES_LOADED:"bytesLoaded"};var e=n(6837),r=n(2990),s=n(2999),o=n(7572),u=n(902),h=0,a=3,c=4,f=1;function l(t,i,n){var e=this;if(!t)throw new Error("[Loader] Invalid Arguments: Loader created without a load request");s.call(e,"Loader"),e.request=t,e.bS=n,e.window=e.bS?null:i||window,e.vD=null,e.pD={},e.mD=[1e3,1e3,2e3,2e3,3e3,3e3,5e3],e.yD=5e3,e.wD=new u(1e3,1),e.wD.addEventListener(e.load,e),e.MIN_TIMEOUT=2e3,e.MAX_TIMEOUT=15e3,e._D=0,e.i_=t.maxRetries,e.ED=new u(e.OD(),1),e.ED.addEventListener(e.SD,e)}function v(t,i,n){l.call(this,t,i,n)}function d(t,i,n){v.call(this,t,i,n)}i.getLoader=function(t,i,n){if(!t)throw new Error("[LoaderFactory] Invalid Arguments: Loader created without a load request");return t.chunked?t.useMSStream?new d(t,i,n):new v(t,i,n):new l(t,i,n)},r.inherits(l,s),r.inherits(v,l),r.inherits(d,v),l.prototype.load=function(t,n){var e=this;if(!e.request)throw new Error("[Loader] InvalidStateError: load called without a request");if(e.url=t||e.request.url,!e.url)return e.publish(i.Events.ERROR,new o.Error(o.ERR_XHR_LOAD));e.TD(),e.vD=e.bS?new XMLHttpRequest:new e.window.XMLHttpRequest,e.vD.MD=0,e.vD.ND=!1,e.RD(),e.vD.withCredentials=e.request.withCredentials,e.vD.open(e.request.method,e.url,!0),e.LD=e.request.headerFields,e.LD&&Object.keys(e.LD).forEach((function(t){e.vD.setRequestHeader(t,e.LD[t])})),e.DD(),e.ED.reset(),e.ED.start(),e.vD.send(n)},l.prototype.DD=function(){this.vD.responseType=this.request.responseType},l.prototype.RD=function(){var t=this;t.vD.onerror=t.HI.bind(t),t.vD.onreadystatechange=function(){if(t.vD&&t.vD.readyState===c&&!t.vD.ND){if(!t.CD(t.vD.status))return t.ED.stop(),t.HI();t.vD.ND=!0;var n={data:t.vD.response};if(t.request.withResponseHeaders){var e=t.vD.getAllResponseHeaders();if(e){var r=e.trim().split(/[\r\n]+/),s=[];r.forEach((function(t){var i=t.split(": "),n=i.shift(),e=i.join(": ");s.push({name:n,value:e})})),n.headers=s}}t.publish(i.Events.COMPLETE,n),t.ED.stop()}}},l.prototype.PD=function(t){var i=new RegExp(t+": (.*)","ig"),n=this.vD.getAllResponseHeaders(),e=i.exec(n);return e&&e.length>1?e[1]:""},l.prototype.CD=function(t){return t>=200&&t<300},l.prototype.xD=function(){Date.now(),this.UD;this.ED.stop()},l.prototype.SD=function(){this.xD(),this.HI()},l.prototype.VD=function(){this.reset(),this.BD(o.ERR_PARTIAL_LOAD)},l.prototype.FD=function(){var t=this,i=t.mD.length,n=t._D;return n<i?t.mD[n]:t.mD[i-1]+t.yD*(n-i+1)},l.prototype.HI=function(){var t=this;t.TD(),t._D<t.i_&&(!t.request.retryExclusion||-1===t.request.retryExclusion.indexOf(t.vD.status))?(t._D++,t.wD.delay=t.FD(),t.wD.reset(),t.wD.start(),t.request.headerFields&&t.vD.readyState===c&&0===t.vD.status&&(t.request.headerFields=null)):t.request.stopStreamLoadOnError?t.BD(o.ERR_XHR_LOAD_LIVE_PAUSE):403===t.vD.status?t.BD(o.ERR_XHR_LOAD_FORBIDDEN):t.BD(o.ERR_XHR_LOAD)},l.prototype.BD=function(t){this.publish(i.Events.ERROR,new o.Error(t))},l.prototype.TD=function(){var t=this;t.vD&&t.vD.readyState!==c&&t.vD.readyState!==h&&(t.vD.ND=!0,t.vD.abort()),t.wD.stop(),t.ED.stop()},l.prototype.OD=function(){var t=this,i=t.request,n=i.chunked?i.chunkedRequestTimeout:i.requestTimeout;return isNaN(n)||n<t.MIN_TIMEOUT||n>t.MAX_TIMEOUT?t.MAX_TIMEOUT:n},l.prototype.reset=function(){var t=this;t.TD(),t.vD=null,t.request=null},l.prototype.destroy=function(){var t=this;t.reset(),t.wD.destroy(),t.ED.destroy(),s.prototype.destroy.call(t)},v.prototype.destroy=function(){l.prototype.destroy.call(this)},v.prototype.RD=function(){var t=this,n=function(){if(t.vD&&!t.vD.ND&&(t.vD.readyState===c||t.vD.readyState===a)){if(!t.CD(t.vD.status))return t.ED.stop(),0===t.vD.MD?t.HI():void t.VD();var n=t.vD.responseText,e=n.length-t.vD.MD;if(e>0&&(t.ED.stop(),t.pD.atlasMarker=t.PD("X-ATLAS-MARKERS"),t.publish(i.Events.BYTES_LOADED,n.length,t.pD)),e>t.request.minChunkSize||t.vD.readyState===c){for(var r=new Uint8Array(e),s=0;s<e;s++)r[s]=255&n.charCodeAt(s+t.vD.MD);t.vD.MD=n.length,t.publish(i.Events.PROGRESS,r,n.length)}t.ED.start(),t.vD.readyState===c&&(t.vD.ND=!0,t.publish(i.Events.COMPLETE),t.ED.stop())}};t.vD.onreadystatechange=n,t.vD.onprogress=n},v.prototype.SD=function(){var t=this;t.xD(),t.vD.MD>0&&t.vD.readyState===a?t.VD():t.HI()},v.prototype.DD=function(){this.vD.overrideMimeType("text/plain; charset=x-user-defined")},d.prototype.destroy=function(){v.prototype.destroy.call(this)},d.prototype.RD=function(){var t=this;t.vD.onreadystatechange=function(){if(t.vD.readyState===a){if(!t.CD(t.vD.status))return t.ED.stop(),t.HI();var n=t.vD.response;if(t.zD||(t.zD=t.bS?new MSStreamReader:new t.window.MSStreamReader),t.zD.readyState===f)return;t.zD.readAsArrayBuffer(n),t.zD.onprogress=function(){t.ED.stop();var n=t.zD.result;n.byteLength>0&&(t.pD.atlasMarker=t.PD("X-ATLAS-MARKERS"),t.publish(i.Events.BYTES_LOADED,n.byteLength,t.pD));var e=new Uint8Array(n.slice(t.vD.MD,n.byteLength));t.vD.MD=n.byteLength,t.publish(i.Events.PROGRESS,e,n.byteLength),t.ED.start()},t.zD.onload=function(){t.ED.stop(),t.publish(i.Events.COMPLETE)},t.zD.onerror=function(){t.ED.stop()}}}},d.prototype.DD=function(){this.vD.responseType="ms-stream"},d.prototype.reset=function(){var t=this;l.prototype.reset.call(t),t.zD&&t.zD.abort()}},1788:function(t,i,n){"use strict";t.exports=y;var e=n(574),r=e.MetadataTypes,s=e.StreamingMode,o=n(2503).StreamTypes,u="#EXT-X-STREAM-INF:",h="#EXT-X-MEDIA:TYPE=SUBTITLES,",a="#EXT-X-MEDIA:",c="#EXTINF:",f="#EXT-X-MEDIA-SEQUENCE:",l="#EXT-X-DISCONTINUITY-SEQUENCE:",v="#EXT-X-TARGETDURATION:",d="#EXT-X-PROGRAM-DATE-TIME:",p="#EXT-X-DATERANGE:",m="#EXT-X-BYTERANGE:",b="#EXT-X-MAP",g="#EXT-X-KEY";function y(){this.GD=[],this.ERRORS={INVALID_M3U8:1,EMPTY_DATA:2,NO_SEGMENTS:3}}y.prototype.parse=function(t){if(!t)return null;return t.type===r.STRUCTURED?this.parseStructuredMetadata(t):this.HD(t)},y.prototype.HD=function(t){var i=this,n={},e=t.rawData;if(""===e||!e)return n.error=i.ERRORS.EMPTY_DATA,n;var r=e.split("\n");return 0!==r[0].indexOf("#EXTM3U")?(n.error=i.ERRORS.INVALID_M3U8,n):e.indexOf(c)>0?i.YD(r,t):e.indexOf(u)>0?i.qD(r,t):(n.error=i.ERRORS.INVALID_M3U8,n)},y.prototype.parseStructuredMetadata=function(t){var i=this,n={};return n.streamInfoList=i.parseStreamInfo(t.streams),t.hasStreamMetadata&&n.streamInfoList.forEach((function(t){t.segmentInfoList=i.parseSegmentInfo(t.hlsInfo,t.initSegment,t.index),t.duration=0,t.segmentInfoList.forEach((function(i){t.duration+=i.duration})),t.hasEndList=!0,t.targetDuration=t.hlsInfo.segment_duration})),t.hasAltStreamMetadata&&(n.renditionGroups={},t.altStreams.forEach((function(t){var e,r=t.manifestContent;r&&0===r.indexOf(h)?((e=i.WD(r,t.host)).type=o.SUBTITLES,e.containerFormat="vtt"):(e=i.parseStreamInfo([t])[0]).hlsInfo&&(e.segmentInfoList=i.parseSegmentInfo(e.hlsInfo,e.initSegment)),i.QD(n.renditionGroups,e)}))),n},y.prototype.qD=function(t,i){for(var n=this,e=[],r={},s=i.url,o=i.cdn,h=0;h<t.length;h++){var c=null,f=t[h].trim();if(0===f.indexOf(u)){c=n.XD(n.ZD(f.substr(u.length)));do{f=t[++h]}while(f.match(/^\s*$/));c.url=n.$D(f,s),c.cdn=o,e.push(c)}else 0===f.indexOf(a)&&(f=f.replace(/"/g,""),c=n.JD(n.ZD(f.substr(a.length)),s),n.QD(r,c))}return{streamInfoList:e,renditionGroups:r}},y.prototype.QD=function(t,i){if(i.type&&i.groupId){var n=t[i.type];n||(n=t[i.type]={});var e=n[i.groupId];e&&e.length?e.push(i):n[i.groupId]=[i]}},y.prototype.ZD=function(t){for(var i={},n=t.indexOf("=");-1!==n;){var e=t.substr(0,n),r=0;'"'===(t=t.substr(n+1)).charAt(0)?(r=t.substr(1).indexOf('"'),i[e]=t.substr(1,r),t=t.substr(r+3)):(r=-1===(r=t.indexOf(","))?t.length:r,i[e]=t.substr(0,r),t=t.substr(r+1)),n=t.indexOf("=")}return i},y.prototype.YD=function(t,i){var n=this,e={},r={},u=[],h=[],a={streamInfoList:[],renditionGroups:{}};if(!t||!t.length)return a;var y=i.url,w=i.index;r.discontinuity=!1,r.sequenceNum=0,r.startTime=0,r.programDateTime=0,r.brStartOffset=-1,r.brEndOffset=-1,r.levelIndex=w,e.discontinuitySeqNum=0,e.index=w,e.targetDuration=0,e.hasEndList=!1,e.url=y,e.duration=0,e.containerFormat="",e.streamingMode=s.HLS,e.dateRanges=[];for(var _=0;_<t.length;_++){var E=t[_].trim();if(!E.match(/^\s*$/)){if(0===E.indexOf(f)&&(e.seqNum=parseInt(E.substr(f.length)),r.sequenceNum=e.seqNum),0===E.indexOf(l))e.discontinuitySeqNum=parseInt(E.substr(l.length));else if(0===E.indexOf("#EXT-X-DISCONTINUITY"))r.discontinuity=!0;else if(0===E.indexOf(v))e.targetDuration=parseFloat(E.substr(v.length));else if(0===E.indexOf(b)){var A=n.KD(E,y);r.initSegment=A}else if(0===E.indexOf(g))r.encryptionData=n.vC(E,y);else if(0===E.indexOf(d))r.programDateTime=n._C(E);else if(0===E.indexOf(p)){var O=n.xC(E);O&&e.dateRanges.push(O)}else if(0===E.indexOf(c)){var S=E.indexOf(",");r.duration=-1===S?parseFloat(E.substr(c.length)):parseFloat(E.substr(c.length,S-c.length)),e.duration+=r.duration;do{E=t[++_].trim()}while(E.match(/^\s*$/));if(0===E.indexOf(m)){var T=E.substr(m.length,E.length-m.length),I=T.indexOf("@");r.brStartOffset=parseInt(T.substr(I+1,T.length-I-1)),r.brEndOffset=r.brStartOffset+parseInt(T.substr(0,I))-1;do{E=t[++_].trim()}while(E.match(/^\s*$/))}r.url=n.$D(E,y),r.containerFormat=n.tP(r.url),e.containerFormat=r.containerFormat,u.push(n.iP(r)),r.startTime+=r.duration,r.sequenceNum++,r.programDateTime=0,r.brStartOffset=-1,r.brEndOffset=-1,r.encryptionData&&(r.encryptionData.initVector=null)}else 0===E.indexOf("#EXT-X-ENDLIST")&&(e.hasEndList=!0);if(E.indexOf("#EXT-X-CUE-OUT:")>=0){var j=n.nP(r.sequenceNum,E);h.push(j)}}}if(u.length&&(e.segmentInfoList=u,e.initSegment=u[0].initSegment),h.length&&(e.cuepointList=h),i.streamType&&i.streamType!==o.MAIN){var M=a.renditionGroups;e.type=i.streamType,e.groupId=i.groupId,e.name=i.name,n.QD(M,e)}else a.streamInfoList.push(e);return a},y.prototype.XD=function(t){if(!t)return null;var i={streamingMode:s.HLS};return Object.keys(t).forEach((function(n){var e=t[n];switch(n){case"BANDWIDTH":i.bitrate=1*e;break;case"AVERAGE-BANDWIDTH":i.avgBitrate=1*e;break;case"RESOLUTION":var r=e.split("x");i.width=parseInt(r[0]),i.height=parseInt(r[1]);break;case"CODECS":i.codecs=e.split(","),i.hasAudio=-1!==e.indexOf("mp4a");break;case"AUDIO":i.audioGroupId=e.replace(/"/g,"");break;case"VIDEO":i.videoGroupId=e.replace(/"/g,"");break;case"SUBTITLES":i.subtitlesGroupId=e.replace(/"/g,"");break;case"CLOSED-CAPTIONS":i.ccGroupId=e.replace(/"/g,"")}})),i},y.prototype.tP=function(t,i){var n=null;return t&&t.length?t.indexOf(".ts")>-1?n="ts":t.indexOf(".mp4")>-1||t.indexOf(".m4s")>-1?n="mp4":t.indexOf(".aac")>-1?n="aac":t.indexOf(".vtt")>-1&&(n="vtt"):i&&(i.indexOf("mp2t")>-1?n="ts":i.indexOf("mp4")>-1?n="mp4":i.indexOf("aac")>-1?n="aac":i.indexOf("vtt")>-1&&(n="vtt")),n},y.prototype.$D=function(t,i){var n=null;return"http://"===t.substr(0,7)||"https://"===t.substr(0,8)?t:(i.indexOf("?")>-1&&(i=i.substr(0,i.indexOf("?"))),"/"===t.substr(0,1)?i.substr(0,i.indexOf("//")+2)+(n=i.substr(i.indexOf("//")+2)).substr(0,n.indexOf("/"))+t:i.substr(0,i.lastIndexOf("/")+1)+t)},y.prototype.WD=function(t,i){var n=(t=t.replace(/"/g,"")).substr(h.length).split(",");return this.eP(n,t,i)},y.prototype.eP=function(t,i,n){var e=this,r={};return t&&t.length&&(t.forEach((function(t){t.indexOf("GROUP-ID")>-1?r.groupId=t.split("=")[1]:t.indexOf("LANGUAGE")>-1?r.language=t.split("=")[1]:t.indexOf("NAME")>-1?r.name=t.split("=")[1]:t.indexOf("AUTOSELECT")>-1?r.autoSelect="YES"===t.split("=")[1]:t.indexOf("DEFAULT")>-1?r.default="YES"===t.split("=")[1]:t.indexOf("URI")>-1?r.url=e.$D(t.substr(4),n):t.indexOf("FORCED")>-1&&(r.forced="YES"===t.split("=")[1])})),r.streamingMode=s.HLS),r},y.prototype.JD=function(t,i){var n=this;if(!t)return null;var e={streamingMode:s.HLS};return Object.keys(t).forEach((function(r){var s=t[r];switch(r){case"TYPE":e.type=s,e.type===o.SUBTITLES&&(e.containerFormat="vtt");break;case"GROUP-ID":e.groupId=s;break;case"LANGUAGE":e.language=s;break;case"NAME":e.name=s;break;case"AUTOSELECT":e.autoSelect="YES"===s;break;case"DEFAULT":e.default="YES"===s;break;case"FORCED":e.forced="YES"===s;break;case"URI":e.url=n.$D(s,i)}})),e},y.prototype.rP=function(t){var i={};return i.discontinuity=t.discontinuity,i.sequenceNum=t.sequenceNum,i.startTime=t.startTime,i.programDateTime=t.programDateTime,i.url=t.url,i.duration=t.duration,i},y.prototype.KD=function(t,i){if(!t)return null;for(var n={},e=t.substr(b.length+1).split(","),r=0;r<e.length;r++){var s=e[r].split("=");if(0===s[0].indexOf("URI"))n.url=this.$D(e[r].substr(5,e[r].length-6),i);else if(0===s[0].indexOf("BYTERANGE")){var o=s[1].indexOf("@");n.range={start:parseInt(s[1].substr(o+1,s[1].length-o-2)),end:parseInt(s[1].substr(1,o-1)-1)}}}return n},y.prototype.vC=function(t,i){if(!t)return null;for(var n={},e=t.substr(g.length+1).split(","),r=0;r<e.length;r++){var s=e[r].split("=");0===s[0].indexOf("URI")?n.keyUri=this.$D(e[r].substr(5,e[r].length-6),i):0===s[0].indexOf("METHOD")?n.method=s[1]:0===s[0].indexOf("IV")&&(n.initVector=s[1])}return n},y.prototype._C=function(t){return t?this.sP(t.substr(d.length)):0},y.prototype.sP=function(t){if(!t)return 0;var i,n,e=t.split("T"),r=e[0].split("-"),s=parseInt(r[0]),o=parseInt(r[1])-1,u=parseInt(r[2]),h=e[1],a=0;if(h.indexOf("Z")>=0)i=h.substr(0,h.indexOf("Z")).split(":");else if(h.indexOf("+")>=0){var c=h.split("+");i=c[0].split(":"),n=c[1].split(":"),a=-1}else if(h.indexOf("-")>=0){var f=h.split("-");i=f[0].split(":"),n=f[1].split(":"),a=1}else h.indexOf(".")>=0&&(i=h.split(":"));var l=0,v=0,d=0;(i&&(l=parseInt(i[0]),v=parseInt(i[1]),d=parseFloat(i[2])),n)&&(l=(24+l+a*parseInt(n[0]))%24,(v+=a*parseInt(n[1]))>=60?(l++,v-=60):v<0&&(l--,v+=60));return new Date(Date.UTC(s,o,u,l,v,d)).getTime()},y.prototype.xC=function(t){var i=this;if(!t)return null;var n=(t=t.replace(/"/g,"")).substr(p.length).split(","),e={};return n&&n.length&&n.forEach((function(t){var n=t.split("=")[1];t.indexOf("ID")>-1?e.id=n:t.indexOf("START-DATE")>-1?e.startDate=i.sP(n):t.indexOf("DURATION")>-1?e.duration=parseInt(n):t.indexOf("END-DATE")>-1?e.endDate=i.sP(n):t.indexOf("CLASS")>-1?e.className=n:t.indexOf("X-DATA")>-1&&(e.rawData=atob(n))})),"urn:uplynk:content-data:watchtogether"===e.className&&e.rawData&&e.rawData.length&&(e.jsonData=JSON.parse(e.rawData)),e},y.prototype.iP=function(t){var i={};i.discontinuity=t.discontinuity,i.sequenceNum=t.sequenceNum,i.startTime=t.startTime,i.programDateTim