summaryrefslogtreecommitdiff
path: root/contrib/site-lwl/js/clappr.min.js
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/site-lwl/js/clappr.min.js')
-rw-r--r--contrib/site-lwl/js/clappr.min.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/contrib/site-lwl/js/clappr.min.js b/contrib/site-lwl/js/clappr.min.js
new file mode 100644
index 0000000..b044081
--- /dev/null
+++ b/contrib/site-lwl/js/clappr.min.js
@@ -0,0 +1,2 @@
+!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Clappr=e():t.Clappr=e()}("undefined"!=typeof self?self:this,function(){return function(t){function e(i){if(r[i])return r[i].exports;var n=r[i]={i:i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,e),n.l=!0,n.exports}var r={};return e.m=t,e.c=r,e.d=function(t,r,i){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=100)}([function(t,e,r){"use strict";e.__esModule=!0,e.default=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e,r){"use strict";e.__esModule=!0;var i=r(39),n=function(t){return t&&t.__esModule?t:{default:t}}(i);e.default=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==(void 0===e?"undefined":(0,n.default)(e))&&"function"!=typeof e?t:e}},function(t,e,r){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var n=r(134),a=i(n),o=r(76),s=i(o),l=r(39),u=i(l);e.default=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(void 0===e?"undefined":(0,u.default)(e)));t.prototype=(0,s.default)(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(a.default?(0,a.default)(t,e):t.__proto__=e)}},function(t,e,r){"use strict";e.__esModule=!0;var i=r(75),n=function(t){return t&&t.__esModule?t:{default:t}}(i);e.default=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),(0,n.default)(t,i.key,i)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}()},function(t,e,r){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=r(53),a=i(n),o=r(0),s=i(o),l=r(39),u=i(l),d=r(29),c=i(d),f=r(5),h=Array.prototype.slice,p=/\s+/,g=function(t,e,r,i){if(!r)return!0;if("object"===(void 0===r?"undefined":(0,u.default)(r))){for(var n in r)t[e].apply(t,[n,r[n]].concat(i));return!1}if(p.test(r)){for(var a=r.split(p),o=0,s=a.length;o<s;o++)t[e].apply(t,[a[o]].concat(i));return!1}return!0},y=function(t,e,r,i){function n(){try{switch(e.length){case 0:for(;++o<s;)(a=t[o]).callback.call(a.ctx);return;case 1:for(;++o<s;)(a=t[o]).callback.call(a.ctx,l);return;case 2:for(;++o<s;)(a=t[o]).callback.call(a.ctx,l,u);return;case 3:for(;++o<s;)(a=t[o]).callback.call(a.ctx,l,u,d);return;default:for(;++o<s;)(a=t[o]).callback.apply(a.ctx,e);return}}catch(t){c.default.error.apply(c.default,[r,"error on event",i,"trigger","-",t]),n()}}var a=void 0,o=-1,s=t.length,l=e[0],u=e[1],d=e[2];n()},m=function(){function t(){(0,s.default)(this,t)}return t.prototype.on=function(t,e,r){return g(this,"on",t,[e,r])&&e?(this._events||(this._events={}),(this._events[t]||(this._events[t]=[])).push({callback:e,context:r,ctx:r||this}),this):this},t.prototype.once=function(t,e,r){var i=this,n=void 0;if(!g(this,"once",t,[e,r])||!e)return this;var a=function(){return i.off(t,n)};return n=function(){a(),e.apply(this,arguments)},this.on(t,n,r)},t.prototype.off=function(t,e,r){var i=void 0,n=void 0,o=void 0,s=void 0,l=void 0,u=void 0,d=void 0,c=void 0;if(!this._events||!g(this,"off",t,[e,r]))return this;if(!t&&!e&&!r)return this._events=void 0,this;for(s=t?[t]:(0,a.default)(this._events),l=0,u=s.length;l<u;l++)if(t=s[l],o=this._events[t]){if(this._events[t]=i=[],e||r)for(d=0,c=o.length;d<c;d++)n=o[d],(e&&e!==n.callback&&e!==n.callback._callback||r&&r!==n.context)&&i.push(n);i.length||delete this._events[t]}return this},t.prototype.trigger=function(t){var e=this.name||this.constructor.name;if(c.default.debug.apply(c.default,[e].concat(Array.prototype.slice.call(arguments))),!this._events)return this;var r=h.call(arguments,1);if(!g(this,"trigger",t,r))return this;var i=this._events[t],n=this._events.all;return i&&y(i,r,e,t),n&&y(n,arguments,e,t),this},t.prototype.stopListening=function(t,e,r){var i=this._listeningTo;if(!i)return this;var n=!e&&!r;r||"object"!==(void 0===e?"undefined":(0,u.default)(e))||(r=this),t&&((i={})[t._listenId]=t);for(var o in i)t=i[o],t.off(e,r,this),(n||0===(0,a.default)(t._events).length)&&delete this._listeningTo[o];return this},t.register=function(e){t.Custom||(t.Custom={});var r="string"==typeof e&&e.toUpperCase().trim();r&&!t.Custom[r]?t.Custom[r]=r.toLowerCase().split("_").map(function(t,e){return 0===e?t:t=t[0].toUpperCase()+t.slice(1)}).join(""):c.default.error("Events","Error when register event: "+e)},t.listAvailableCustomEvents=function(){return t.Custom||(t.Custom={}),(0,a.default)(t.Custom).filter(function(e){return"string"==typeof t.Custom[e]})},t}();e.default=m;var v={listenTo:"on",listenToOnce:"once"};(0,a.default)(v).forEach(function(t){m.prototype[t]=function(e,r,i){return(this._listeningTo||(this._listeningTo={}))[e._listenId||(e._listenId=(0,f.uniqueId)("l"))]=e,i||"object"!==(void 0===r?"undefined":(0,u.default)(r))||(i=this),e[v[t]](r,i,this),this}}),m.PLAYER_READY="ready",m.PLAYER_RESIZE="resize",m.PLAYER_FULLSCREEN="fullscreen",m.PLAYER_PLAY="play",m.PLAYER_PAUSE="pause",m.PLAYER_STOP="stop",m.PLAYER_ENDED="ended",m.PLAYER_SEEK="seek",m.PLAYER_ERROR="playererror",m.ERROR="error",m.PLAYER_TIMEUPDATE="timeupdate",m.PLAYER_VOLUMEUPDATE="volumeupdate",m.PLAYER_SUBTITLE_AVAILABLE="subtitleavailable",m.PLAYBACK_PROGRESS="playback:progress",m.PLAYBACK_TIMEUPDATE="playback:timeupdate",m.PLAYBACK_READY="playback:ready",m.PLAYBACK_BUFFERING="playback:buffering",m.PLAYBACK_BUFFERFULL="playback:bufferfull",m.PLAYBACK_SETTINGSUPDATE="playback:settingsupdate",m.PLAYBACK_LOADEDMETADATA="playback:loadedmetadata",m.PLAYBACK_HIGHDEFINITIONUPDATE="playback:highdefinitionupdate",m.PLAYBACK_BITRATE="playback:bitrate",m.PLAYBACK_LEVELS_AVAILABLE="playback:levels:available",m.PLAYBACK_LEVEL_SWITCH_START="playback:levels:switch:start",m.PLAYBACK_LEVEL_SWITCH_END="playback:levels:switch:end",m.PLAYBACK_PLAYBACKSTATE="playback:playbackstate",m.PLAYBACK_DVR="playback:dvr",m.PLAYBACK_MEDIACONTROL_DISABLE="playback:mediacontrol:disable",m.PLAYBACK_MEDIACONTROL_ENABLE="playback:mediacontrol:enable",m.PLAYBACK_ENDED="playback:ended",m.PLAYBACK_PLAY_INTENT="playback:play:intent",m.PLAYBACK_PLAY="playback:play",m.PLAYBACK_PAUSE="playback:pause",m.PLAYBACK_SEEK="playback:seek",m.PLAYBACK_SEEKED="playback:seeked",m.PLAYBACK_STOP="playback:stop",m.PLAYBACK_ERROR="playback:error",m.PLAYBACK_STATS_ADD="playback:stats:add",m.PLAYBACK_FRAGMENT_LOADED="playback:fragment:loaded",m.PLAYBACK_LEVEL_SWITCH="playback:level:switch",m.PLAYBACK_SUBTITLE_AVAILABLE="playback:subtitle:available",m.PLAYBACK_SUBTITLE_CHANGED="playback:subtitle:changed",m.CORE_CONTAINERS_CREATED="core:containers:created",m.CORE_ACTIVE_CONTAINER_CHANGED="core:active:container:changed",m.CORE_OPTIONS_CHANGE="core:options:change",m.CORE_READY="core:ready",m.CORE_FULLSCREEN="core:fullscreen",m.CORE_RESIZE="core:resize",m.CORE_SCREEN_ORIENTATION_CHANGED="core:screen:orientation:changed",m.CORE_MOUSE_MOVE="core:mousemove",m.CORE_MOUSE_LEAVE="core:mouseleave",m.CONTAINER_PLAYBACKSTATE="container:playbackstate",m.CONTAINER_PLAYBACKDVRSTATECHANGED="container:dvr",m.CONTAINER_BITRATE="container:bitrate",m.CONTAINER_STATS_REPORT="container:stats:report",m.CONTAINER_DESTROYED="container:destroyed",m.CONTAINER_READY="container:ready",m.CONTAINER_ERROR="container:error",m.CONTAINER_LOADEDMETADATA="container:loadedmetadata",m.CONTAINER_SUBTITLE_AVAILABLE="container:subtitle:available",m.CONTAINER_SUBTITLE_CHANGED="container:subtitle:changed",m.CONTAINER_TIMEUPDATE="container:timeupdate",m.CONTAINER_PROGRESS="container:progress",m.CONTAINER_PLAY="container:play",m.CONTAINER_STOP="container:stop",m.CONTAINER_PAUSE="container:pause",m.CONTAINER_ENDED="container:ended",m.CONTAINER_CLICK="container:click",m.CONTAINER_DBLCLICK="container:dblclick",m.CONTAINER_CONTEXTMENU="container:contextmenu",m.CONTAINER_MOUSE_ENTER="container:mouseenter",m.CONTAINER_MOUSE_LEAVE="container:mouseleave",m.CONTAINER_SEEK="container:seek",m.CONTAINER_SEEKED="container:seeked",m.CONTAINER_VOLUME="container:volume",m.CONTAINER_FULLSCREEN="container:fullscreen",m.CONTAINER_STATE_BUFFERING="container:state:buffering",m.CONTAINER_STATE_BUFFERFULL="container:state:bufferfull",m.CONTAINER_SETTINGSUPDATE="container:settingsupdate",m.CONTAINER_HIGHDEFINITIONUPDATE="container:highdefinitionupdate",m.CONTAINER_MEDIACONTROL_SHOW="container:mediacontrol:show",m.CONTAINER_MEDIACONTROL_HIDE="container:mediacontrol:hide",m.CONTAINER_MEDIACONTROL_DISABLE="container:mediacontrol:disable",m.CONTAINER_MEDIACONTROL_ENABLE="container:mediacontrol:enable",m.CONTAINER_STATS_ADD="container:stats:add",m.CONTAINER_OPTIONS_CHANGE="container:options:change",m.MEDIACONTROL_RENDERED="mediacontrol:rendered",m.MEDIACONTROL_FULLSCREEN="mediacontrol:fullscreen",m.MEDIACONTROL_SHOW="mediacontrol:show",m.MEDIACONTROL_HIDE="mediacontrol:hide",m.MEDIACONTROL_MOUSEMOVE_SEEKBAR="mediacontrol:mousemove:seekbar",m.MEDIACONTROL_MOUSELEAVE_SEEKBAR="mediacontrol:mouseleave:seekbar",m.MEDIACONTROL_PLAYING="mediacontrol:playing",m.MEDIACONTROL_NOTPLAYING="mediacontrol:notplaying",m.MEDIACONTROL_CONTAINERCHANGED="mediacontrol:containerchanged",m.MEDIACONTROL_OPTIONS_CHANGE="mediacontrol:options:change",t.exports=e.default},function(t,e,r){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(e)for(var r in e){var i=(0,w.default)(e,r);i?(0,R.default)(t,r,i):t[r]=e[r]}return t}function a(t,e){var r=function(t){function r(){(0,b.default)(this,r);for(var i=arguments.length,n=Array(i),a=0;a<i;a++)n[a]=arguments[a];var o=(0,T.default)(this,t.call.apply(t,[this].concat(n)));return e.initialize&&e.initialize.apply(o,n),o}return(0,L.default)(r,t),r}(t);return n(r.prototype,e),r}function o(t,e){if(!isFinite(t))return"--:--";t*=1e3,t=parseInt(t/1e3);var r=t%60;t=parseInt(t/60);var i=t%60;t=parseInt(t/60);var n=t%24,a=parseInt(t/24),o="";return a&&a>0&&(o+=a+":",n<1&&(o+="00:")),(n&&n>0||e)&&(o+=("0"+n).slice(-2)+":"),o+=("0"+i).slice(-2)+":",o+=("0"+r).slice(-2),o.trim()}function s(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"t",e=0,r=B.params[t]||B.hashParams[t]||"",i=r.match(/[0-9]+[hms]+/g)||[];if(i.length>0){var n={h:3600,m:60,s:1};i.forEach(function(t){if(t){var r=t[t.length-1],i=parseInt(t.slice(0,t.length-1),10);e+=i*n[r]}})}else r&&(e=parseInt(r,10));return e}function l(t){return U[t]||(U[t]=0),t+ ++U[t]}function u(t){return t-parseFloat(t)+1>=0}function d(){var t=document.getElementsByTagName("script");return t.length?t[t.length-1].src:""}function c(){return window.navigator&&window.navigator.language}function f(){return window.performance&&window.performance.now?performance.now():Date.now()}function h(t,e){var r=t.indexOf(e);r>=0&&t.splice(r,1)}function p(t,e){return void 0!==t&&void 0!==e&&void 0!==e.find(function(e){return t.toLowerCase()===e.toLowerCase()})}function g(t,e){e=(0,m.default)({inline:!1,muted:!1,timeout:250,type:"video",source:M.default.mp4,element:null},e);var r=e.element?e.element:document.createElement(e.type);r.muted=e.muted,!0===e.muted&&r.setAttribute("muted","muted"),!0===e.inline&&r.setAttribute("playsinline","playsinline"),r.src=e.source;var i=r.play(),n=setTimeout(function(){a(!1,new Error("Timeout "+e.timeout+" ms has been reached"))},e.timeout),a=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;clearTimeout(n),t(e,r)};void 0!==i?i.then(function(){return a(!0)}).catch(function(t){return a(!1,t)}):a(!0)}Object.defineProperty(e,"__esModule",{value:!0}),e.DomRecycler=e.cancelAnimationFrame=e.requestAnimationFrame=e.QueryString=e.Config=e.Fullscreen=void 0;var y=r(12),m=i(y),v=r(3),A=i(v),_=r(0),b=i(_),E=r(1),T=i(E),S=r(2),L=i(S),k=r(75),R=i(k),C=r(140),w=i(C);e.assign=n,e.extend=a,e.formatTime=o,e.seekStringToSeconds=s,e.uniqueId=l,e.isNumber=u,e.currentScriptUrl=d,e.getBrowserLanguage=c,e.now=f,e.removeArrayItem=h,e.listContainsIgnoreCase=p,e.canAutoPlayMedia=g,r(143);var O=r(14),P=i(O),D=r(6),I=i(D),x=r(147),M=i(x),N=e.Fullscreen={isFullscreen:function(){return!!(document.webkitFullscreenElement||document.webkitIsFullScreen||document.mozFullScreen||document.msFullscreenElement)},requestFullscreen:function(t){t.requestFullscreen?t.requestFullscreen():t.webkitRequestFullscreen?t.webkitRequestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.msRequestFullscreen?t.msRequestFullscreen():t.querySelector&&t.querySelector("video")&&t.querySelector("video").webkitEnterFullScreen?t.querySelector("video").webkitEnterFullScreen():t.webkitEnterFullScreen&&t.webkitEnterFullScreen()},cancelFullscreen:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document;t.exitFullscreen?t.exitFullscreen():t.webkitCancelFullScreen?t.webkitCancelFullScreen():t.webkitExitFullscreen?t.webkitExitFullscreen():t.mozCancelFullScreen?t.mozCancelFullScreen():t.msExitFullscreen&&t.msExitFullscreen()},fullscreenEnabled:function(){return!!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}},F=e.Config=function(){function t(){(0,b.default)(this,t)}return t._defaultConfig=function(){return{volume:{value:100,parse:parseInt}}},t._defaultValueFor=function(t){try{return this._defaultConfig()[t].parse(this._defaultConfig()[t].value)}catch(t){return}},t._createKeyspace=function(t){return"clappr."+document.domain+"."+t},t.restore=function(t){return P.default.hasLocalstorage&&localStorage[this._createKeyspace(t)]?this._defaultConfig()[t].parse(localStorage[this._createKeyspace(t)]):this._defaultValueFor(t)},t.persist=function(t,e){if(P.default.hasLocalstorage)try{return localStorage[this._createKeyspace(t)]=e,!0}catch(t){return!1}},t}(),B=e.QueryString=function(){function t(){(0,b.default)(this,t)}return t.parse=function(t){for(var e=void 0,r=/\+/g,i=/([^&=]+)=?([^&]*)/g,n=function(t){return decodeURIComponent(t.replace(r," "))},a={};e=i.exec(t);)a[n(e[1]).toLowerCase()]=n(e[2]);return a},(0,A.default)(t,null,[{key:"params",get:function(){var t=window.location.search.substring(1);return t!==this.query&&(this._urlParams=this.parse(t),this.query=t),this._urlParams}},{key:"hashParams",get:function(){var t=window.location.hash.substring(1);return t!==this.hash&&(this._hashParams=this.parse(t),this.hash=t),this._hashParams}}]),t}(),U={},j=e.requestAnimationFrame=(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)}).bind(window),G=e.cancelAnimationFrame=(window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.clearTimeout).bind(window),K=[],V=e.DomRecycler=function(){function t(){(0,b.default)(this,t)}return t.configure=function(t){this.options=I.default.extend(this.options,t)},t.create=function(t){return this.options.recycleVideo&&"video"===t&&K.length>0?K.shift():(0,I.default)("<"+t+">")},t.garbage=function(t){this.options.recycleVideo&&"VIDEO"===t[0].tagName.toUpperCase()&&(t.children().remove(),K.push(t))},t}();V.options={recycleVideo:!1},e.default={Config:F,Fullscreen:N,QueryString:B,DomRecycler:V,extend:a,formatTime:o,seekStringToSeconds:s,uniqueId:l,currentScriptUrl:d,isNumber:u,requestAnimationFrame:j,cancelAnimationFrame:G,getBrowserLanguage:c,now:f,removeArrayItem:h,canAutoPlayMedia:g,Media:M.default}},function(t,e){var r=function(){function t(t){return null==t?String(t):z[q.call(t)]||"object"}function e(e){return"function"==t(e)}function r(t){return null!=t&&t==t.window}function i(t){return null!=t&&t.nodeType==t.DOCUMENT_NODE}function n(e){return"object"==t(e)}function a(t){return n(t)&&!r(t)&&Object.getPrototypeOf(t)==Object.prototype}function o(t){var e=!!t&&"length"in t&&t.length,i=S.type(t);return"function"!=i&&!r(t)&&("array"==i||0===e||"number"==typeof e&&e>0&&e-1 in t)}function s(t){return O.call(t,function(t){return null!=t})}function l(t){return t.length>0?S.fn.concat.apply([],t):t}function u(t){return t.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function d(t){return t in x?x[t]:x[t]=new RegExp("(^|\\s)"+t+"(\\s|$)")}function c(t,e){return"number"!=typeof e||M[u(t)]?e:e+"px"}function f(t){var e,r;return I[t]||(e=D.createElement(t),D.body.appendChild(e),r=getComputedStyle(e,"").getPropertyValue("display"),e.parentNode.removeChild(e),"none"==r&&(r="block"),I[t]=r),I[t]}function h(t){return"children"in t?P.call(t.children):S.map(t.childNodes,function(t){if(1==t.nodeType)return t})}function p(t,e){var r,i=t?t.length:0;for(r=0;r<i;r++)this[r]=t[r];this.length=i,this.selector=e||""}function g(t,e,r){for(T in e)r&&(a(e[T])||J(e[T]))?(a(e[T])&&!a(t[T])&&(t[T]={}),J(e[T])&&!J(t[T])&&(t[T]=[]),g(t[T],e[T],r)):e[T]!==E&&(t[T]=e[T])}function y(t,e){return null==e?S(t):S(t).filter(e)}function m(t,r,i,n){return e(r)?r.call(t,i,n):r}function v(t,e,r){null==r?t.removeAttribute(e):t.setAttribute(e,r)}function A(t,e){var r=t.className||"",i=r&&r.baseVal!==E;if(e===E)return i?r.baseVal:r;i?r.baseVal=e:t.className=e}function _(t){try{return t?"true"==t||"false"!=t&&("null"==t?null:+t+""==t?+t:/^[\[\{]/.test(t)?S.parseJSON(t):t):t}catch(e){return t}}function b(t,e){e(t);for(var r=0,i=t.childNodes.length;r<i;r++)b(t.childNodes[r],e)}var E,T,S,L,k,R,C=[],w=C.concat,O=C.filter,P=C.slice,D=window.document,I={},x={},M={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,"z-index":1,zoom:1},N=/^\s*<(\w+|!)[^>]*>/,F=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,B=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,U=/^(?:body|html)$/i,j=/([A-Z])/g,G=["val","css","html","text","data","width","height","offset"],K=["after","prepend","before","append"],V=D.createElement("table"),Y=D.createElement("tr"),H={tr:D.createElement("tbody"),tbody:V,thead:V,tfoot:V,td:Y,th:Y,"*":D.createElement("div")},$=/complete|loaded|interactive/,W=/^[\w-]*$/,z={},q=z.toString,X={},Z=D.createElement("div"),Q={tabindex:"tabIndex",readonly:"readOnly",for:"htmlFor",class:"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},J=Array.isArray||function(t){return t instanceof Array};return X.matches=function(t,e){if(!e||!t||1!==t.nodeType)return!1;var r=t.matches||t.webkitMatchesSelector||t.mozMatchesSelector||t.oMatchesSelector||t.matchesSelector;if(r)return r.call(t,e);var i,n=t.parentNode,a=!n;return a&&(n=Z).appendChild(t),i=~X.qsa(n,e).indexOf(t),a&&Z.removeChild(t),i},k=function(t){return t.replace(/-+(.)?/g,function(t,e){return e?e.toUpperCase():""})},R=function(t){return O.call(t,function(e,r){return t.indexOf(e)==r})},X.fragment=function(t,e,r){var i,n,o;return F.test(t)&&(i=S(D.createElement(RegExp.$1))),i||(t.replace&&(t=t.replace(B,"<$1></$2>")),e===E&&(e=N.test(t)&&RegExp.$1),e in H||(e="*"),o=H[e],o.innerHTML=""+t,i=S.each(P.call(o.childNodes),function(){o.removeChild(this)})),a(r)&&(n=S(i),S.each(r,function(t,e){G.indexOf(t)>-1?n[t](e):n.attr(t,e)})),i},X.Z=function(t,e){return new p(t,e)},X.isZ=function(t){return t instanceof X.Z},X.init=function(t,r){var i;if(!t)return X.Z();if("string"==typeof t)if(t=t.trim(),"<"==t[0]&&N.test(t))i=X.fragment(t,RegExp.$1,r),t=null;else{if(r!==E)return S(r).find(t);i=X.qsa(D,t)}else{if(e(t))return S(D).ready(t);if(X.isZ(t))return t;if(J(t))i=s(t);else if(n(t))i=[t],t=null;else if(N.test(t))i=X.fragment(t.trim(),RegExp.$1,r),t=null;else{if(r!==E)return S(r).find(t);i=X.qsa(D,t)}}return X.Z(i,t)},S=function(t,e){return X.init(t,e)},S.extend=function(t){var e,r=P.call(arguments,1);return"boolean"==typeof t&&(e=t,t=r.shift()),r.forEach(function(r){g(t,r,e)}),t},X.qsa=function(t,e){var r,i="#"==e[0],n=!i&&"."==e[0],a=i||n?e.slice(1):e,o=W.test(a);return t.getElementById&&o&&i?(r=t.getElementById(a))?[r]:[]:1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType?[]:P.call(o&&!i&&t.getElementsByClassName?n?t.getElementsByClassName(a):t.getElementsByTagName(e):t.querySelectorAll(e))},S.contains=D.documentElement.contains?function(t,e){return t!==e&&t.contains(e)}:function(t,e){for(;e&&(e=e.parentNode);)if(e===t)return!0;return!1},S.type=t,S.isFunction=e,S.isWindow=r,S.isArray=J,S.isPlainObject=a,S.isEmptyObject=function(t){var e;for(e in t)return!1;return!0},S.isNumeric=function(t){var e=Number(t),r=typeof t;return null!=t&&"boolean"!=r&&("string"!=r||t.length)&&!isNaN(e)&&isFinite(e)||!1},S.inArray=function(t,e,r){return C.indexOf.call(e,t,r)},S.camelCase=k,S.trim=function(t){return null==t?"":String.prototype.trim.call(t)},S.uuid=0,S.support={},S.expr={},S.noop=function(){},S.map=function(t,e){var r,i,n,a=[];if(o(t))for(i=0;i<t.length;i++)null!=(r=e(t[i],i))&&a.push(r);else for(n in t)null!=(r=e(t[n],n))&&a.push(r);return l(a)},S.each=function(t,e){var r,i;if(o(t)){for(r=0;r<t.length;r++)if(!1===e.call(t[r],r,t[r]))return t}else for(i in t)if(!1===e.call(t[i],i,t[i]))return t;return t},S.grep=function(t,e){return O.call(t,e)},window.JSON&&(S.parseJSON=JSON.parse),S.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(t,e){z["[object "+e+"]"]=e.toLowerCase()}),S.fn={constructor:X.Z,length:0,forEach:C.forEach,reduce:C.reduce,push:C.push,sort:C.sort,splice:C.splice,indexOf:C.indexOf,concat:function(){var t,e,r=[];for(t=0;t<arguments.length;t++)e=arguments[t],r[t]=X.isZ(e)?e.toArray():e;return w.apply(X.isZ(this)?this.toArray():this,r)},map:function(t){return S(S.map(this,function(e,r){return t.call(e,r,e)}))},slice:function(){return S(P.apply(this,arguments))},ready:function(t){return $.test(D.readyState)&&D.body?t(S):D.addEventListener("DOMContentLoaded",function(){t(S)},!1),this},get:function(t){return t===E?P.call(this):this[t>=0?t:t+this.length]},toArray:function(){return this.get()},size:function(){return this.length},remove:function(){return this.each(function(){null!=this.parentNode&&this.parentNode.removeChild(this)})},each:function(t){return C.every.call(this,function(e,r){return!1!==t.call(e,r,e)}),this},filter:function(t){return e(t)?this.not(this.not(t)):S(O.call(this,function(e){return X.matches(e,t)}))},add:function(t,e){return S(R(this.concat(S(t,e))))},is:function(t){return this.length>0&&X.matches(this[0],t)},not:function(t){var r=[];if(e(t)&&t.call!==E)this.each(function(e){t.call(this,e)||r.push(this)});else{var i="string"==typeof t?this.filter(t):o(t)&&e(t.item)?P.call(t):S(t);this.forEach(function(t){i.indexOf(t)<0&&r.push(t)})}return S(r)},has:function(t){return this.filter(function(){return n(t)?S.contains(this,t):S(this).find(t).size()})},eq:function(t){return-1===t?this.slice(t):this.slice(t,+t+1)},first:function(){var t=this[0];return t&&!n(t)?t:S(t)},last:function(){var t=this[this.length-1];return t&&!n(t)?t:S(t)},find:function(t){var e=this;return t?"object"==typeof t?S(t).filter(function(){var t=this;return C.some.call(e,function(e){return S.contains(e,t)})}):1==this.length?S(X.qsa(this[0],t)):this.map(function(){return X.qsa(this,t)}):S()},closest:function(t,e){var r=[],n="object"==typeof t&&S(t);return this.each(function(a,o){for(;o&&!(n?n.indexOf(o)>=0:X.matches(o,t));)o=o!==e&&!i(o)&&o.parentNode;o&&r.indexOf(o)<0&&r.push(o)}),S(r)},parents:function(t){for(var e=[],r=this;r.length>0;)r=S.map(r,function(t){if((t=t.parentNode)&&!i(t)&&e.indexOf(t)<0)return e.push(t),t});return y(e,t)},parent:function(t){return y(R(this.pluck("parentNode")),t)},children:function(t){return y(this.map(function(){return h(this)}),t)},contents:function(){return this.map(function(){return this.contentDocument||P.call(this.childNodes)})},siblings:function(t){return y(this.map(function(t,e){return O.call(h(e.parentNode),function(t){return t!==e})}),t)},empty:function(){return this.each(function(){this.innerHTML=""})},pluck:function(t){return S.map(this,function(e){return e[t]})},show:function(){return this.each(function(){"none"==this.style.display&&(this.style.display=""),"none"==getComputedStyle(this,"").getPropertyValue("display")&&(this.style.display=f(this.nodeName))})},replaceWith:function(t){return this.before(t).remove()},wrap:function(t){var r=e(t);if(this[0]&&!r)var i=S(t).get(0),n=i.parentNode||this.length>1;return this.each(function(e){S(this).wrapAll(r?t.call(this,e):n?i.cloneNode(!0):i)})},wrapAll:function(t){if(this[0]){S(this[0]).before(t=S(t));for(var e;(e=t.children()).length;)t=e.first();S(t).append(this)}return this},wrapInner:function(t){var r=e(t);return this.each(function(e){var i=S(this),n=i.contents(),a=r?t.call(this,e):t;n.length?n.wrapAll(a):i.append(a)})},unwrap:function(){return this.parent().each(function(){S(this).replaceWith(S(this).children())}),this},clone:function(){return this.map(function(){return this.cloneNode(!0)})},hide:function(){return this.css("display","none")},toggle:function(t){return this.each(function(){var e=S(this);(t===E?"none"==e.css("display"):t)?e.show():e.hide()})},prev:function(t){return S(this.pluck("previousElementSibling")).filter(t||"*")},next:function(t){return S(this.pluck("nextElementSibling")).filter(t||"*")},html:function(t){return 0 in arguments?this.each(function(e){var r=this.innerHTML;S(this).empty().append(m(this,t,e,r))}):0 in this?this[0].innerHTML:null},text:function(t){return 0 in arguments?this.each(function(e){var r=m(this,t,e,this.textContent);this.textContent=null==r?"":""+r}):0 in this?this.pluck("textContent").join(""):null},attr:function(t,e){var r;return"string"!=typeof t||1 in arguments?this.each(function(r){if(1===this.nodeType)if(n(t))for(T in t)v(this,T,t[T]);else v(this,t,m(this,e,r,this.getAttribute(t)))}):0 in this&&1==this[0].nodeType&&null!=(r=this[0].getAttribute(t))?r:E},removeAttr:function(t){return this.each(function(){1===this.nodeType&&t.split(" ").forEach(function(t){v(this,t)},this)})},prop:function(t,e){return t=Q[t]||t,1 in arguments?this.each(function(r){this[t]=m(this,e,r,this[t])}):this[0]&&this[0][t]},removeProp:function(t){return t=Q[t]||t,this.each(function(){delete this[t]})},data:function(t,e){var r="data-"+t.replace(j,"-$1").toLowerCase(),i=1 in arguments?this.attr(r,e):this.attr(r);return null!==i?_(i):E},val:function(t){return 0 in arguments?(null==t&&(t=""),this.each(function(e){this.value=m(this,t,e,this.value)})):this[0]&&(this[0].multiple?S(this[0]).find("option").filter(function(){return this.selected}).pluck("value"):this[0].value)},offset:function(t){if(t)return this.each(function(e){var r=S(this),i=m(this,t,e,r.offset()),n=r.offsetParent().offset(),a={top:i.top-n.top,left:i.left-n.left};"static"==r.css("position")&&(a.position="relative"),r.css(a)});if(!this.length)return null;if(D.documentElement!==this[0]&&!S.contains(D.documentElement,this[0]))return{top:0,left:0};var e=this[0].getBoundingClientRect();return{left:e.left+window.pageXOffset,top:e.top+window.pageYOffset,width:Math.round(e.width),height:Math.round(e.height)}},css:function(e,r){if(arguments.length<2){var i=this[0];if("string"==typeof e){if(!i)return;return i.style[k(e)]||getComputedStyle(i,"").getPropertyValue(e)}if(J(e)){if(!i)return;var n={},a=getComputedStyle(i,"");return S.each(e,function(t,e){n[e]=i.style[k(e)]||a.getPropertyValue(e)}),n}}var o="";if("string"==t(e))r||0===r?o=u(e)+":"+c(e,r):this.each(function(){this.style.removeProperty(u(e))});else for(T in e)e[T]||0===e[T]?o+=u(T)+":"+c(T,e[T])+";":this.each(function(){this.style.removeProperty(u(T))});return this.each(function(){this.style.cssText+=";"+o})},index:function(t){return t?this.indexOf(S(t)[0]):this.parent().children().indexOf(this[0])},hasClass:function(t){return!!t&&C.some.call(this,function(t){return this.test(A(t))},d(t))},addClass:function(t){return t?this.each(function(e){if("className"in this){L=[];var r=A(this);m(this,t,e,r).split(/\s+/g).forEach(function(t){S(this).hasClass(t)||L.push(t)},this),L.length&&A(this,r+(r?" ":"")+L.join(" "))}}):this},removeClass:function(t){return this.each(function(e){if("className"in this){if(t===E)return A(this,"");L=A(this),m(this,t,e,L).split(/\s+/g).forEach(function(t){L=L.replace(d(t)," ")}),A(this,L.trim())}})},toggleClass:function(t,e){return t?this.each(function(r){var i=S(this);m(this,t,r,A(this)).split(/\s+/g).forEach(function(t){(e===E?!i.hasClass(t):e)?i.addClass(t):i.removeClass(t)})}):this},scrollTop:function(t){if(this.length){var e="scrollTop"in this[0];return t===E?e?this[0].scrollTop:this[0].pageYOffset:this.each(e?function(){this.scrollTop=t}:function(){this.scrollTo(this.scrollX,t)})}},scrollLeft:function(t){if(this.length){var e="scrollLeft"in this[0];return t===E?e?this[0].scrollLeft:this[0].pageXOffset:this.each(e?function(){this.scrollLeft=t}:function(){this.scrollTo(t,this.scrollY)})}},position:function(){if(this.length){var t=this[0],e=this.offsetParent(),r=this.offset(),i=U.test(e[0].nodeName)?{top:0,left:0}:e.offset();return r.top-=parseFloat(S(t).css("margin-top"))||0,r.left-=parseFloat(S(t).css("margin-left"))||0,i.top+=parseFloat(S(e[0]).css("border-top-width"))||0,i.left+=parseFloat(S(e[0]).css("border-left-width"))||0,{top:r.top-i.top,left:r.left-i.left}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent||D.body;t&&!U.test(t.nodeName)&&"static"==S(t).css("position");)t=t.offsetParent;return t})}},S.fn.detach=S.fn.remove,["width","height"].forEach(function(t){var e=t.replace(/./,function(t){return t[0].toUpperCase()});S.fn[t]=function(n){var a,o=this[0];return n===E?r(o)?o["inner"+e]:i(o)?o.documentElement["scroll"+e]:(a=this.offset())&&a[t]:this.each(function(e){o=S(this),o.css(t,m(this,n,e,o[t]()))})}}),K.forEach(function(e,r){var i=r%2;S.fn[e]=function(){var e,n,a=S.map(arguments,function(r){var i=[];return e=t(r),"array"==e?(r.forEach(function(t){return t.nodeType!==E?i.push(t):S.zepto.isZ(t)?i=i.concat(t.get()):void(i=i.concat(X.fragment(t)))}),i):"object"==e||null==r?r:X.fragment(r)}),o=this.length>1;return a.length<1?this:this.each(function(t,e){n=i?e:e.parentNode,e=0==r?e.nextSibling:1==r?e.firstChild:2==r?e:null;var s=S.contains(D.documentElement,n);a.forEach(function(t){if(o)t=t.cloneNode(!0);else if(!n)return S(t).remove();n.insertBefore(t,e),s&&b(t,function(t){if(!(null==t.nodeName||"SCRIPT"!==t.nodeName.toUpperCase()||t.type&&"text/javascript"!==t.type||t.src)){var e=t.ownerDocument?t.ownerDocument.defaultView:window;e.eval.call(e,t.innerHTML)}})})})},S.fn[i?e+"To":"insert"+(r?"Before":"After")]=function(t){return S(t)[e](this),this}}),X.Z.prototype=p.prototype=S.fn,X.uniq=R,X.deserializeValue=_,S.zepto=X,S}();window.Zepto=r,void 0===window.$&&(window.$=r),function(t){function e(e,r,i){var n=t.Event(r);return t(e).trigger(n,i),!n.isDefaultPrevented()}function r(t,r,i,n){if(t.global)return e(r||A,i,n)}function i(e){e.global&&0==t.active++&&r(e,null,"ajaxStart")}function n(e){e.global&&!--t.active&&r(e,null,"ajaxStop")}function a(t,e){var i=e.context;if(!1===e.beforeSend.call(i,t,e)||!1===r(e,i,"ajaxBeforeSend",[t,e]))return!1;r(e,i,"ajaxSend",[t,e])}function o(t,e,i,n){var a=i.context;i.success.call(a,t,"success",e),n&&n.resolveWith(a,[t,"success",e]),r(i,a,"ajaxSuccess",[e,i,t]),l("success",e,i)}function s(t,e,i,n,a){var o=n.context;n.error.call(o,i,e,t),a&&a.rejectWith(o,[i,e,t]),r(n,o,"ajaxError",[i,n,t||e]),l(e,i,n)}function l(t,e,i){var a=i.context;i.complete.call(a,e,t),r(i,a,"ajaxComplete",[e,i]),n(i)}function u(t,e,r){if(r.dataFilter==d)return t;var i=r.context;return r.dataFilter.call(i,t,e)}function d(){}function c(t){return t&&(t=t.split(";",2)[0]),t&&(t==S?"html":t==T?"json":b.test(t)?"script":E.test(t)&&"xml")||"text"}function f(t,e){return""==e?t:(t+"&"+e).replace(/[&?]{1,2}/,"?")}function h(e){e.processData&&e.data&&"string"!=t.type(e.data)&&(e.data=t.param(e.data,e.traditional)),!e.data||e.type&&"GET"!=e.type.toUpperCase()&&"jsonp"!=e.dataType||(e.url=f(e.url,e.data),e.data=void 0)}function p(e,r,i,n){return t.isFunction(r)&&(n=i,i=r,r=void 0),t.isFunction(i)||(n=i,i=void 0),{url:e,data:r,success:i,dataType:n}}function g(e,r,i,n){var a,o=t.isArray(r),s=t.isPlainObject(r);t.each(r,function(r,l){a=t.type(l),n&&(r=i?n:n+"["+(s||"object"==a||"array"==a?r:"")+"]"),!n&&o?e.add(l.name,l.value):"array"==a||!i&&"object"==a?g(e,l,i,r):e.add(r,l)})}var y,m,v=+new Date,A=window.document,_=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,b=/^(?:text|application)\/javascript/i,E=/^(?:text|application)\/xml/i,T="application/json",S="text/html",L=/^\s*$/,k=A.createElement("a");k.href=window.location.href,t.active=0,t.ajaxJSONP=function(e,r){if(!("type"in e))return t.ajax(e);var i,n,l=e.jsonpCallback,u=(t.isFunction(l)?l():l)||"Zepto"+v++,d=A.createElement("script"),c=window[u],f=function(e){t(d).triggerHandler("error",e||"abort")},h={abort:f};return r&&r.promise(h),t(d).on("load error",function(a,l){clearTimeout(n),t(d).off().remove(),"error"!=a.type&&i?o(i[0],h,e,r):s(null,l||"error",h,e,r),window[u]=c,i&&t.isFunction(c)&&c(i[0]),c=i=void 0}),!1===a(h,e)?(f("abort"),h):(window[u]=function(){i=arguments},d.src=e.url.replace(/\?(.+)=\?/,"?$1="+u),A.head.appendChild(d),e.timeout>0&&(n=setTimeout(function(){f("timeout")},e.timeout)),h)},t.ajaxSettings={type:"GET",beforeSend:d,success:d,error:d,complete:d,context:null,global:!0,xhr:function(){return new window.XMLHttpRequest},accepts:{script:"text/javascript, application/javascript, application/x-javascript",json:T,xml:"application/xml, text/xml",html:S,text:"text/plain"},crossDomain:!1,timeout:0,processData:!0,cache:!0,dataFilter:d},t.ajax=function(e){var r,n,l=t.extend({},e||{}),p=t.Deferred&&t.Deferred();for(y in t.ajaxSettings)void 0===l[y]&&(l[y]=t.ajaxSettings[y]);i(l),l.crossDomain||(r=A.createElement("a"),r.href=l.url,r.href=r.href,l.crossDomain=k.protocol+"//"+k.host!=r.protocol+"//"+r.host),l.url||(l.url=window.location.toString()),(n=l.url.indexOf("#"))>-1&&(l.url=l.url.slice(0,n)),h(l);var g=l.dataType,v=/\?.+=\?/.test(l.url);if(v&&(g="jsonp"),!1!==l.cache&&(e&&!0===e.cache||"script"!=g&&"jsonp"!=g)||(l.url=f(l.url,"_="+Date.now())),"jsonp"==g)return v||(l.url=f(l.url,l.jsonp?l.jsonp+"=?":!1===l.jsonp?"":"callback=?")),t.ajaxJSONP(l,p);var _,b=l.accepts[g],E={},T=function(t,e){E[t.toLowerCase()]=[t,e]},S=/^([\w-]+:)\/\//.test(l.url)?RegExp.$1:window.location.protocol,R=l.xhr(),C=R.setRequestHeader;if(p&&p.promise(R),l.crossDomain||T("X-Requested-With","XMLHttpRequest"),T("Accept",b||"*/*"),(b=l.mimeType||b)&&(b.indexOf(",")>-1&&(b=b.split(",",2)[0]),R.overrideMimeType&&R.overrideMimeType(b)),(l.contentType||!1!==l.contentType&&l.data&&"GET"!=l.type.toUpperCase())&&T("Content-Type",l.contentType||"application/x-www-form-urlencoded"),l.headers)for(m in l.headers)T(m,l.headers[m]);if(R.setRequestHeader=T,R.onreadystatechange=function(){if(4==R.readyState){R.onreadystatechange=d,clearTimeout(_);var e,r=!1;if(R.status>=200&&R.status<300||304==R.status||0==R.status&&"file:"==S){if(g=g||c(l.mimeType||R.getResponseHeader("content-type")),"arraybuffer"==R.responseType||"blob"==R.responseType)e=R.response;else{e=R.responseText;try{e=u(e,g,l),"script"==g?(0,eval)(e):"xml"==g?e=R.responseXML:"json"==g&&(e=L.test(e)?null:t.parseJSON(e))}catch(t){r=t}if(r)return s(r,"parsererror",R,l,p)}o(e,R,l,p)}else s(R.statusText||null,R.status?"error":"abort",R,l,p)}},!1===a(R,l))return R.abort(),s(null,"abort",R,l,p),R;var w=!("async"in l)||l.async;if(R.open(l.type,l.url,w,l.username,l.password),l.xhrFields)for(m in l.xhrFields)R[m]=l.xhrFields[m];for(m in E)C.apply(R,E[m]);return l.timeout>0&&(_=setTimeout(function(){R.onreadystatechange=d,R.abort(),s(null,"timeout",R,l,p)},l.timeout)),R.send(l.data?l.data:null),R},t.get=function(){return t.ajax(p.apply(null,arguments))},t.post=function(){var e=p.apply(null,arguments);return e.type="POST",t.ajax(e)},t.getJSON=function(){var e=p.apply(null,arguments);return e.dataType="json",t.ajax(e)},t.fn.load=function(e,r,i){if(!this.length)return this;var n,a=this,o=e.split(/\s/),s=p(e,r,i),l=s.success;return o.length>1&&(s.url=o[0],n=o[1]),s.success=function(e){a.html(n?t("<div>").html(e.replace(_,"")).find(n):e),l&&l.apply(a,arguments)},t.ajax(s),this};var R=encodeURIComponent;t.param=function(e,r){var i=[];return i.add=function(e,r){t.isFunction(r)&&(r=r()),null==r&&(r=""),this.push(R(e)+"="+R(r))},g(i,e,r),i.join("&").replace(/%20/g,"+")}}(r),function(t){t.Callbacks=function(e){e=t.extend({},e);var r,i,n,a,o,s,l=[],u=!e.once&&[],d=function(t){for(r=e.memory&&t,i=!0,s=a||0,a=0,o=l.length,n=!0;l&&s<o;++s)if(!1===l[s].apply(t[0],t[1])&&e.stopOnFalse){r=!1;break}n=!1,l&&(u?u.length&&d(u.shift()):r?l.length=0:c.disable())},c={add:function(){if(l){var i=l.length,s=function(r){t.each(r,function(t,r){"function"==typeof r?e.unique&&c.has(r)||l.push(r):r&&r.length&&"string"!=typeof r&&s(r)})};s(arguments),n?o=l.length:r&&(a=i,d(r))}return this},remove:function(){return l&&t.each(arguments,function(e,r){for(var i;(i=t.inArray(r,l,i))>-1;)l.splice(i,1),n&&(i<=o&&--o,i<=s&&--s)}),this},has:function(e){return!(!l||!(e?t.inArray(e,l)>-1:l.length))},empty:function(){return o=l.length=0,this},disable:function(){return l=u=r=void 0,this},disabled:function(){return!l},lock:function(){return u=void 0,r||c.disable(),this},locked:function(){return!u},fireWith:function(t,e){return!l||i&&!u||(e=e||[],e=[t,e.slice?e.slice():e],n?u.push(e):d(e)),this},fire:function(){return c.fireWith(this,arguments)},fired:function(){return!!i}};return c}}(r),function(t){function e(r){var i=[["resolve","done",t.Callbacks({once:1,memory:1}),"resolved"],["reject","fail",t.Callbacks({once:1,memory:1}),"rejected"],["notify","progress",t.Callbacks({memory:1})]],n="pending",a={state:function(){return n},always:function(){return o.done(arguments).fail(arguments),this},then:function(){var r=arguments;return e(function(e){t.each(i,function(i,n){var s=t.isFunction(r[i])&&r[i];o[n[1]](function(){var r=s&&s.apply(this,arguments);if(r&&t.isFunction(r.promise))r.promise().done(e.resolve).fail(e.reject).progress(e.notify);else{var i=this===a?e.promise():this,o=s?[r]:arguments;e[n[0]+"With"](i,o)}})}),r=null}).promise()},promise:function(e){return null!=e?t.extend(e,a):a}},o={};return t.each(i,function(t,e){var r=e[2],s=e[3];a[e[1]]=r.add,s&&r.add(function(){n=s},i[1^t][2].disable,i[2][2].lock),o[e[0]]=function(){return o[e[0]+"With"](this===o?a:this,arguments),this},o[e[0]+"With"]=r.fireWith}),a.promise(o),r&&r.call(o,o),o}var r=Array.prototype.slice;t.when=function(i){var n,a,o,s=r.call(arguments),l=s.length,u=0,d=1!==l||i&&t.isFunction(i.promise)?l:0,c=1===d?i:e(),f=function(t,e,i){return function(a){e[t]=this,i[t]=arguments.length>1?r.call(arguments):a,i===n?c.notifyWith(e,i):--d||c.resolveWith(e,i)}};if(l>1)for(n=new Array(l),a=new Array(l),o=new Array(l);u<l;++u)s[u]&&t.isFunction(s[u].promise)?s[u].promise().done(f(u,o,s)).fail(c.reject).progress(f(u,a,n)):--d;return d||c.resolveWith(o,s),c.promise()},t.Deferred=e}(r),function(t){function e(t){return t._zid||(t._zid=f++)}function r(t,r,a,o){if(r=i(r),r.ns)var s=n(r.ns);return(y[e(t)]||[]).filter(function(t){return t&&(!r.e||t.e==r.e)&&(!r.ns||s.test(t.ns))&&(!a||e(t.fn)===e(a))&&(!o||t.sel==o)})}function i(t){var e=(""+t).split(".");return{e:e[0],ns:e.slice(1).sort().join(" ")}}function n(t){return new RegExp("(?:^| )"+t.replace(" "," .* ?")+"(?: |$)")}function a(t,e){return t.del&&!v&&t.e in A||!!e}function o(t){return _[t]||v&&A[t]||t}function s(r,n,s,l,d,f,h){var p=e(r),g=y[p]||(y[p]=[]);n.split(/\s/).forEach(function(e){if("ready"==e)return t(document).ready(s);var n=i(e);n.fn=s,n.sel=d,n.e in _&&(s=function(e){var r=e.relatedTarget;if(!r||r!==this&&!t.contains(this,r))return n.fn.apply(this,arguments)}),n.del=f;var p=f||s;n.proxy=function(t){if(t=u(t),!t.isImmediatePropagationStopped()){t.data=l;var e=p.apply(r,t._args==c?[t]:[t].concat(t._args));return!1===e&&(t.preventDefault(),t.stopPropagation()),e}},n.i=g.length,g.push(n),"addEventListener"in r&&r.addEventListener(o(n.e),n.proxy,a(n,h))})}function l(t,i,n,s,l){var u=e(t);(i||"").split(/\s/).forEach(function(e){r(t,e,n,s).forEach(function(e){delete y[u][e.i],"removeEventListener"in t&&t.removeEventListener(o(e.e),e.proxy,a(e,l))})})}function u(e,r){return!r&&e.isDefaultPrevented||(r||(r=e),t.each(S,function(t,i){var n=r[t];e[t]=function(){return this[i]=b,n&&n.apply(r,arguments)},e[i]=E}),e.timeStamp||(e.timeStamp=Date.now()),(r.defaultPrevented!==c?r.defaultPrevented:"returnValue"in r?!1===r.returnValue:r.getPreventDefault&&r.getPreventDefault())&&(e.isDefaultPrevented=b)),e}function d(t){var e,r={originalEvent:t};for(e in t)T.test(e)||t[e]===c||(r[e]=t[e]);return u(r,t)}var c,f=1,h=Array.prototype.slice,p=t.isFunction,g=function(t){return"string"==typeof t},y={},m={},v="onfocusin"in window,A={focus:"focusin",blur:"focusout"},_={mouseenter:"mouseover",mouseleave:"mouseout"};m.click=m.mousedown=m.mouseup=m.mousemove="MouseEvents",t.event={add:s,remove:l},t.proxy=function(r,i){var n=2 in arguments&&h.call(arguments,2);if(p(r)){var a=function(){return r.apply(i,n?n.concat(h.call(arguments)):arguments)};return a._zid=e(r),a}if(g(i))return n?(n.unshift(r[i],r),t.proxy.apply(null,n)):t.proxy(r[i],r);throw new TypeError("expected function")},t.fn.bind=function(t,e,r){return this.on(t,e,r)},t.fn.unbind=function(t,e){return this.off(t,e)},t.fn.one=function(t,e,r,i){return this.on(t,e,r,i,1)};var b=function(){return!0},E=function(){return!1},T=/^([A-Z]|returnValue$|layer[XY]$|webkitMovement[XY]$)/,S={preventDefault:"isDefaultPrevented",stopImmediatePropagation:"isImmediatePropagationStopped",stopPropagation:"isPropagationStopped"};t.fn.delegate=function(t,e,r){return this.on(e,t,r)},t.fn.undelegate=function(t,e,r){return this.off(e,t,r)},t.fn.live=function(e,r){return t(document.body).delegate(this.selector,e,r),this},t.fn.die=function(e,r){return t(document.body).undelegate(this.selector,e,r),this},t.fn.on=function(e,r,i,n,a){var o,u,f=this;return e&&!g(e)?(t.each(e,function(t,e){f.on(t,r,i,e,a)}),f):(g(r)||p(n)||!1===n||(n=i,i=r,r=c),n!==c&&!1!==i||(n=i,i=c),!1===n&&(n=E),f.each(function(c,f){a&&(o=function(t){return l(f,t.type,n),n.apply(this,arguments)}),r&&(u=function(e){var i,a=t(e.target).closest(r,f).get(0);if(a&&a!==f)return i=t.extend(d(e),{currentTarget:a,liveFired:f}),(o||n).apply(a,[i].concat(h.call(arguments,1)))}),s(f,e,n,i,r,u||o)}))},t.fn.off=function(e,r,i){var n=this;return e&&!g(e)?(t.each(e,function(t,e){n.off(t,r,e)}),n):(g(r)||p(i)||!1===i||(i=r,r=c),!1===i&&(i=E),n.each(function(){l(this,e,i,r)}))},t.fn.trigger=function(e,r){return e=g(e)||t.isPlainObject(e)?t.Event(e):u(e),e._args=r,this.each(function(){e.type in A&&"function"==typeof this[e.type]?this[e.type]():"dispatchEvent"in this?this.dispatchEvent(e):t(this).triggerHandler(e,r)})},t.fn.triggerHandler=function(e,i){var n,a;return this.each(function(o,s){n=d(g(e)?t.Event(e):e),n._args=i,n.target=s,t.each(r(s,e.type||e),function(t,e){if(a=e.proxy(n),n.isImmediatePropagationStopped())return!1})}),a},"focusin focusout focus blur load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select keydown keypress keyup error".split(" ").forEach(function(e){t.fn[e]=function(t){return 0 in arguments?this.bind(e,t):this.trigger(e)}}),t.Event=function(t,e){g(t)||(e=t,t=e.type);var r=document.createEvent(m[t]||"Events"),i=!0;if(e)for(var n in e)"bubbles"==n?i=!!e[n]:r[n]=e[n];return r.initEvent(t,i,!0),u(r)}}(r),function(){try{getComputedStyle(void 0)}catch(e){var t=getComputedStyle;window.getComputedStyle=function(e,r){try{return t(e,r)}catch(t){return null}}}}(),function(t){function e(e){return e=t(e),!(!e.width()&&!e.height())&&"none"!==e.css("display")}function r(t,e){t=t.replace(/=#\]/g,'="#"]');var r,i,n=s.exec(t);if(n&&n[2]in o&&(r=o[n[2]],i=n[3],t=n[1],i)){var a=Number(i);i=isNaN(a)?i.replace(/^["']|["']$/g,""):a}return e(t,r,i)}var i=t.zepto,n=i.qsa,a=i.matches,o=t.expr[":"]={visible:function(){if(e(this))return this},hidden:function(){if(!e(this))return this},selected:function(){if(this.selected)return this},checked:function(){if(this.checked)return this},parent:function(){return this.parentNode},first:function(t){if(0===t)return this},last:function(t,e){if(t===e.length-1)return this},eq:function(t,e,r){if(t===r)return this},contains:function(e,r,i){if(t(this).text().indexOf(i)>-1)return this},has:function(t,e,r){if(i.qsa(this,r).length)return this}},s=new RegExp("(.*):(\\w+)(?:\\(([^)]+)\\))?$\\s*"),l=/^\s*>/,u="Zepto"+ +new Date;i.qsa=function(e,a){return r(a,function(r,o,s){try{var d;!r&&o?r="*":l.test(r)&&(d=t(e).addClass(u),r="."+u+" "+r);var c=n(e,r)}catch(t){throw console.error("error performing selector: %o",a),t}finally{d&&d.removeClass(u)}return o?i.uniq(t.map(c,function(t,e){return o.call(t,e,c,s)})):c})},i.matches=function(t,e){return r(e,function(e,r,i){return(!e||a(t,e))&&(!r||r.call(t,null,i)===t)})}}(r),t.exports=r},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},n=/(.)^/,a={"'":"'","\\":"\\","\r":"r","\n":"n","\t":"t","\u2028":"u2028","\u2029":"u2029"},o=/\\|'|\r|\n|\t|\u2028|\u2029/g,s={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"},l=new RegExp("[&<>\"']","g"),u=function(t){return null===t?"":(""+t).replace(l,function(t){return s[t]})},d=0,c=function(t,e){var r,s=new RegExp([(i.escape||n).source,(i.interpolate||n).source,(i.evaluate||n).source].join("|")+"|$","g"),l=0,c="__p+='";t.replace(s,function(e,r,i,n,s){return c+=t.slice(l,s).replace(o,function(t){return"\\"+a[t]}),r&&(c+="'+\n((__t=("+r+"))==null?'':escapeExpr(__t))+\n'"),i&&(c+="'+\n((__t=("+i+"))==null?'':__t)+\n'"),n&&(c+="';\n"+n+"\n__p+='"),l=s+e.length,e}),c+="';\n",i.variable||(c="with(obj||{}){\n"+c+"}\n"),c="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+c+"return __p;\n//# sourceURL=/microtemplates/source["+d+++"]";try{r=new Function(i.variable||"obj","escapeExpr",c)}catch(t){throw t.source=c,t}if(e)return r(e,u);var f=function(t){return r.call(this,t,u)};return f.source="function("+(i.variable||"obj")+"){\n"+c+"}",f};c.settings=i,e.default=c,t.exports=e.default},function(t,e){function r(t,e){var r=t[1]||"",n=t[3];if(!n)return r;if(e&&"function"==typeof btoa){var a=i(n);return[r].concat(n.sources.map(function(t){return"/*# sourceURL="+n.sourceRoot+t+" */"})).concat([a]).join("\n")}return[r].join("\n")}function i(t){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(t))))+" */"}t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var i=r(e,t);return e[2]?"@media "+e[2]+"{"+i+"}":i}).join("")},e.i=function(t,r){"string"==typeof t&&(t=[[null,t,""]]);for(var i={},n=0;n<this.length;n++){var a=this[n][0];"number"==typeof a&&(i[a]=!0)}for(n=0;n<t.length;n++){var o=t[n];"number"==typeof o[0]&&i[o[0]]||(r&&!o[2]?o[2]=r:r&&(o[2]="("+o[2]+") and ("+r+")"),e.push(o))}},e}},function(t,e,r){function i(t,e){for(var r=0;r<t.length;r++){var i=t[r],n=p[i.id];if(n){n.refs++;for(var a=0;a<n.parts.length;a++)n.parts[a](i.parts[a]);for(;a<i.parts.length;a++)n.parts.push(d(i.parts[a],e))}else{for(var o=[],a=0;a<i.parts.length;a++)o.push(d(i.parts[a],e));p[i.id]={id:i.id,refs:1,parts:o}}}}function n(t,e){for(var r=[],i={},n=0;n<t.length;n++){var a=t[n],o=e.base?a[0]+e.base:a[0],s=a[1],l=a[2],u=a[3],d={css:s,media:l,sourceMap:u};i[o]?i[o].parts.push(d):r.push(i[o]={id:o,parts:[d]})}return r}function a(t,e){var r=m(t.insertInto);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var i=_[_.length-1];if("top"===t.insertAt)i?i.nextSibling?r.insertBefore(e,i.nextSibling):r.appendChild(e):r.insertBefore(e,r.firstChild),_.push(e);else if("bottom"===t.insertAt)r.appendChild(e);else{if("object"!=typeof t.insertAt||!t.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var n=m(t.insertInto+" "+t.insertAt.before);r.insertBefore(e,n)}}function o(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t);var e=_.indexOf(t);e>=0&&_.splice(e,1)}function s(t){var e=document.createElement("style");return t.attrs.type="text/css",u(e,t.attrs),a(t,e),e}function l(t){var e=document.createElement("link");return t.attrs.type="text/css",t.attrs.rel="stylesheet",u(e,t.attrs),a(t,e),e}function u(t,e){Object.keys(e).forEach(function(r){t.setAttribute(r,e[r])})}function d(t,e){var r,i,n,a;if(e.transform&&t.css){if(!(a=e.transform(t.css)))return function(){};t.css=a}if(e.singleton){var u=A++;r=v||(v=s(e)),i=c.bind(null,r,u,!1),n=c.bind(null,r,u,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(r=l(e),i=h.bind(null,r,e),n=function(){o(r),r.href&&URL.revokeObjectURL(r.href)}):(r=s(e),i=f.bind(null,r),n=function(){o(r)});return i(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;i(t=e)}else n()}}function c(t,e,r,i){var n=r?"":i.css;if(t.styleSheet)t.styleSheet.cssText=E(e,n);else{var a=document.createTextNode(n),o=t.childNodes;o[e]&&t.removeChild(o[e]),o.length?t.insertBefore(a,o[e]):t.appendChild(a)}}function f(t,e){var r=e.css,i=e.media;if(i&&t.setAttribute("media",i),t.styleSheet)t.styleSheet.cssText=r;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(r))}}function h(t,e,r){var i=r.css,n=r.sourceMap,a=void 0===e.convertToAbsoluteUrls&&n;(e.convertToAbsoluteUrls||a)&&(i=b(i)),n&&(i+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(n))))+" */");var o=new Blob([i],{type:"text/css"}),s=t.href;t.href=URL.createObjectURL(o),s&&URL.revokeObjectURL(s)}var p={},g=function(t){var e;return function(){return void 0===e&&(e=t.apply(this,arguments)),e}}(function(){return window&&document&&document.all&&!window.atob}),y=function(t){return document.querySelector(t)},m=function(t){var e={};return function(t){if("function"==typeof t)return t();if(void 0===e[t]){var r=y.call(this,t);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(t){r=null}e[t]=r}return e[t]}}(),v=null,A=0,_=[],b=r(158);t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");e=e||{},e.attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||"boolean"==typeof e.singleton||(e.singleton=g()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var r=n(t,e);return i(r,e),function(t){for(var a=[],o=0;o<r.length;o++){var s=r[o],l=p[s.id];l.refs--,a.push(l)}if(t){i(n(t,e),e)}for(var o=0;o<a.length;o++){var l=a[o];if(0===l.refs){for(var u=0;u<l.parts.length;u++)l.parts[u]();delete p[l.id]}}}};var E=function(){var t=[];return function(e,r){return t[e]=r,t.filter(Boolean).join("\n")}}()},function(t,e,r){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=r(12),a=i(n),o=r(0),s=i(o),l=r(1),u=i(l),d=r(3),c=i(d),f=r(2),h=i(f),p=r(5),g=r(30),y=i(g),m=r(20),v=i(m),A=r(6),_=i(A),b=function(t){function e(r,i,n){(0,s.default)(this,e);var a=(0,u.default)(this,t.call(this,r));return a.settings={},a._i18n=i,a.playerError=n,a._consented=!1,a}return(0,h.default)(e,t),(0,c.default)(e,[{key:"isAudioOnly",get:function(){return!1}},{key:"isAdaptive",get:function(){return!1}},{key:"ended",get:function(){return!1}},{key:"i18n",get:function(){return this._i18n}},{key:"buffering",get:function(){return!1}},{key:"consented",get:function(){return this._consented}}]),e.prototype.consent=function(){this._consented=!0},e.prototype.play=function(){},e.prototype.pause=function(){},e.prototype.stop=function(){},e.prototype.seek=function(t){},e.prototype.seekPercentage=function(t){},e.prototype.getStartTimeOffset=function(){return 0},e.prototype.getDuration=function(){return 0},e.prototype.isPlaying=function(){return!1},e.prototype.getPlaybackType=function(){return e.NO_OP},e.prototype.isHighDefinitionInUse=function(){return!1},e.prototype.volume=function(t){},e.prototype.configure=function(t){this._options=_.default.extend(this._options,t)},e.prototype.attemptAutoPlay=function(){var t=this;this.canAutoPlay(function(e,r){e&&t.play()})},e.prototype.canAutoPlay=function(t){t(!0,null)},(0,c.default)(e,[{key:"isReady",get:function(){return!1}},{key:"hasClosedCaptionsTracks",get:function(){return this.closedCaptionsTracks.length>0}},{key:"closedCaptionsTracks",get:function(){return[]}},{key:"closedCaptionsTrackId",get:function(){return-1},set:function(t){}}]),e}(y.default);e.default=b,(0,a.default)(b.prototype,v.default),b.extend=function(t){return(0,p.extend)(b,t)},b.canPlay=function(t,e){return!1},b.VOD="vod",b.AOD="aod",b.LIVE="live",b.NO_OP="no_op",b.type="playback",t.exports=e.default},function(t,e){var r=t.exports={version:"2.4.0"};"number"==typeof __e&&(__e=r)},function(t,e,r){t.exports={default:r(102),__esModule:!0}},function(t,e,r){var i=r(50)("wks"),n=r(36),a=r(17).Symbol,o="function"==typeof a;(t.exports=function(t){return i[t]||(i[t]=o&&a[t]||(o?a:n)("Symbol."+t))}).store=i},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(144),n=function(t){return t&&t.__esModule?t:{default:t}}(i);e.default=n.default,t.exports=e.default},function(t,e,r){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=r(0),a=i(n),o=r(1),s=i(o),l=r(3),u=i(l),d=r(2),c=i(d),f=r(5),h=r(4),p=i(h),g=function(t){function e(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,a.default)(this,e);var i=(0,s.default)(this,t.call(this,r));return i._options=r,i.uniqueId=(0,f.uniqueId)("o"),i}return(0,c.default)(e,t),(0,u.default)(e,[{key:"options",get:function(){return this._options}}]),e}(p.default);e.default=g,t.exports=e.default},function(t,e,r){var i=r(17),n=r(11),a=r(44),o=r(25),s=function(t,e,r){var l,u,d,c=t&s.F,f=t&s.G,h=t&s.S,p=t&s.P,g=t&s.B,y=t&s.W,m=f?n:n[e]||(n[e]={}),v=m.prototype,A=f?i:h?i[e]:(i[e]||{}).prototype;f&&(r=e);for(l in r)(u=!c&&A&&void 0!==A[l])&&l in m||(d=u?A[l]:r[l],m[l]=f&&"function"!=typeof A[l]?r[l]:g&&u?a(d,i):y&&A[l]==d?function(t){var e=function(e,r,i){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,r)}return new t(e,r,i)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(d):p&&"function"==typeof d?a(Function.call,d):d,p&&((m.virtual||(m.virtual={}))[l]=d,t&s.R&&v&&!v[l]&&o(v,l,d)))};s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,t.exports=s},function(t,e){var r=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},function(t,e,r){var i=r(26),n=r(65),a=r(45),o=Object.defineProperty;e.f=r(21)?Object.defineProperty:function(t,e,r){if(i(t),e=a(e,!0),i(r),n)try{return o(t,e,r)}catch(t){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(t[e]=r.value),t}},function(t,e,r){var i=r(68),n=r(47);t.exports=function(t){return i(n(t))}},function(t,e,r){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=r(12),a=i(n),o=r(29),s=i(o),l=r(24),u=i(l),d={createError:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{useCodePrefix:!0},r=this.constructor&&this.constructor.type||"",i=this.name||r,n=this.i18n||this.core&&this.core.i18n||this.container&&this.container.i18n,o=i+":"+(t&&t.code||"unknown"),l={description:"",level:u.default.Levels.FATAL,origin:i,scope:r,raw:{}},d=(0,a.default)({},l,t,{code:e.useCodePrefix?o:t.code});if(n&&d.level==u.default.Levels.FATAL&&!d.UI){var c={title:n.t("default_error_title"),message:n.t("default_error_message")};d.UI=c}return this.playerError?this.playerError.createError(d):s.default.warn(i,"PlayerError is not defined. Error: ",d),d}};e.default=d,t.exports=e.default},function(t,e,r){t.exports=!r(27)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e){var r={}.hasOwnProperty;t.exports=function(t,e){return r.call(t,e)}},function(t,e,r){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=r(12),a=i(n),o=r(0),s=i(o),l=r(1),u=i(l),d=r(3),c=i(d),f=r(2),h=i(f),p=r(5),g=r(30),y=i(g),m=r(20),v=i(m),A=function(t){function e(r){(0,s.default)(this,e);var i=(0,u.default)(this,t.call(this,r.options));return i.core=r,i.enabled=!0,i.bindEvents(),i.render(),i}return(0,h.default)(e,t),(0,c.default)(e,[{key:"playerError",get:function(){return this.core.playerError}}]),e.prototype.bindEvents=function(){},e.prototype.getExternalInterface=function(){return{}},e.prototype.enable=function(){this.enabled||(this.bindEvents(),this.$el.show(),this.enabled=!0)},e.prototype.disable=function(){this.stopListening(),this.$el.hide(),this.enabled=!1},e.prototype.render=function(){return this},e}(y.default);e.default=A,(0,a.default)(A.prototype,v.default),A.extend=function(t){return(0,p.extend)(A,t)},A.type="core",t.exports=e.default},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(79),n=function(t){return t&&t.__esModule?t:{default:t}}(i);e.default=n.default,t.exports=e.default},function(t,e,r){var i=r(18),n=r(33);t.exports=r(21)?function(t,e,r){return i.f(t,e,n(1,r))}:function(t,e,r){return t[e]=r,t}},function(t,e,r){var i=r(32);t.exports=function(t){if(!i(t))throw TypeError(t+" is not an object!");return t}},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,r){var i=r(67),n=r(51);t.exports=Object.keys||function(t){return i(t,n)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(148),n=function(t){return t&&t.__esModule?t:{default:t}}(i);e.default=n.default,t.exports=e.default},function(t,e,r){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=r(0),a=i(n),o=r(1),s=i(o),l=r(3),u=i(l),d=r(2),c=i(d),f=r(6),h=i(f),p=r(5),g=r(15),y=i(g),m=/^(\S+)\s*(.*)$/,v=function(t){function e(r){(0,a.default)(this,e);var i=(0,s.default)(this,t.call(this,r));return i.cid=(0,p.uniqueId)("c"),i._ensureElement(),i.delegateEvents(),i}return(0,c.default)(e,t),(0,u.default)(e,[{key:"tagName",get:function(){return"div"}},{key:"events",get:function(){return{}}},{key:"attributes",get:function(){return{}}}]),e.prototype.$=function(t){return this.$el.find(t)},e.prototype.render=function(){return this},e.prototype.destroy=function(){return this.$el.remove(),this.stopListening(),this.undelegateEvents(),this},e.prototype.setElement=function(t,e){return this.$el&&this.undelegateEvents(),this.$el=h.default.zepto.isZ(t)?t:(0,h.default)(t),this.el=this.$el[0],!1!==e&&this.delegateEvents(),this},e.prototype.delegateEvents=function(t){if(!t&&!(t=this.events))return this;this.undelegateEvents();for(var e in t){var r=t[e];if(r&&r.constructor!==Function&&(r=this[t[e]]),r){var i=e.match(m),n=i[1],a=i[2];n+=".delegateEvents"+this.cid,""===a?this.$el.on(n,r.bind(this)):this.$el.on(n,a,r.bind(this))}}return this},e.prototype.undelegateEvents=function(){return this.$el.off(".delegateEvents"+this.cid),this},e.prototype._ensureElement=function(){if(this.el)this.setElement(this.el,!1);else{var t=h.default.extend({},this.attributes);this.id&&(t.id=this.id),this.className&&(t.class=this.className);var e=p.DomRecycler.create(this.tagName).attr(t);this.setElement(e,!1)}},e}(y.default);e.default=v,t.exports=e.default},function(t,e,r){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=r(0),a=i(n),o=r(4),s=i(o),l=new s.default,u=function t(){(0,a.default)(this,t)};e.default=u,u.on=function(t,e,r){l.on(t,e,r)},u.once=function(t,e,r){l.once(t,e,r)},u.off=function(t,e,r){l.off(t,e,r)},u.trigger=function(t){for(var e=arguments.length,r=Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];l.trigger.apply(l,[t].concat(r))},u.stopListening=function(t,e,r){l.stopListening(t,e,r)},t.exports=e.default},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e){t.exports={}},function(t,e,r){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=r(12),a=i(n),o=r(0),s=i(o),l=r(1),u=i(l),d=r(3),c=i(d),f=r(2),h=i(f),p=r(5),g=r(15),y=i(g),m=r(20),v=i(m),A=function(t){function e(r){(0,s.default)(this,e);var i=(0,u.default)(this,t.call(this,r.options));return i.core=r,i.enabled=!0,i.bindEvents(),i}return(0,h.default)(e,t),(0,c.default)(e,[{key:"playerError",get:function(){return this.core.playerError}}]),e.prototype.bindEvents=function(){},e.prototype.enable=function(){this.enabled||(this.bindEvents(),this.enabled=!0)},e.prototype.disable=function(){this.enabled&&(this.stopListening(),this.enabled=!1)},e.prototype.getExternalInterface=function(){return{}},e.prototype.destroy=function(){this.stopListening()},e}(y.default);e.default=A,(0,a.default)(A.prototype,v.default),A.extend=function(t){return(0,p.extend)(A,t)},A.type="core",t.exports=e.default},function(t,e){var r=0,i=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++r+i).toString(36))}},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,r){var i=r(47);t.exports=function(t){return Object(i(t))}},function(t,e,r){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var n=r(110),a=i(n),o=r(121),s=i(o),l="function"==typeof s.default&&"symbol"==typeof a.default?function(t){return typeof t}:function(t){return t&&"function"==typeof s.default&&t.constructor===s.default&&t!==s.default.prototype?"symbol":typeof t};e.default="function"==typeof s.default&&"symbol"===l(a.default)?function(t){return void 0===t?"undefined":l(t)}:function(t){return t&&"function"==typeof s.default&&t.constructor===s.default&&t!==s.default.prototype?"symbol":void 0===t?"undefined":l(t)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(0),n=function(t){return t&&t.__esModule?t:{default:t}}(i),a=function t(){(0,n.default)(this,t),this.options={},this.playbackPlugins=[],this.currentSize={width:0,height:0}};a._players={},a.getInstance=function(t){return a._players[t]||(a._players[t]=new a)},e.default=a,t.exports=e.default},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(172),n=function(t){return t&&t.__esModule?t:{default:t}}(i);e.default=n.default,t.exports=e.default},function(t,e,r){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=r(12),a=i(n),o=r(0),s=i(o),l=r(1),u=i(l),d=r(3),c=i(d),f=r(2),h=i(f),p=r(5),g=r(30),y=i(g),m=r(20),v=i(m),A=function(t){function e(r){(0,s.default)(this,e);var i=(0,u.default)(this,t.call(this,r.options));return i.container=r,i.enabled=!0,i.bindEvents(),i}return(0,h.default)(e,t),(0,c.default)(e,[{key:"playerError",get:function(){return this.container.playerError}}]),e.prototype.enable=function(){this.enabled||(this.bindEvents(),this.$el.show(),this.enabled=!0)},e.prototype.disable=function(){this.stopListening(),this.$el.hide(),this.enabled=!1},e.prototype.bindEvents=function(){},e}(y.default);e.default=A,(0,a.default)(A.prototype,v.default),A.extend=function(t){return(0,p.extend)(A,t)},A.type="container",t.exports=e.default},function(t,e,r){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=r(12),a=i(n),o=r(0),s=i(o),l=r(1),u=i(l),d=r(3),c=i(d),f=r(2),h=i(f),p=r(15),g=i(p),y=r(5),m=r(20),v=i(m),A=function(t){function e(r){(0,s.default)(this,e);var i=(0,u.default)(this,t.call(this,r.options));return i.container=r,i.enabled=!0,i.bindEvents(),i}return(0,h.default)(e,t),(0,c.default)(e,[{key:"playerError",get:function(){return this.container.playerError}}]),e.prototype.enable=function(){this.enabled||(this.bindEvents(),this.enabled=!0)},e.prototype.disable=function(){this.enabled&&(this.stopListening(),this.enabled=!1)},e.prototype.bindEvents=function(){},e.prototype.destroy=function(){this.stopListening()},e}(g.default);e.default=A,(0,a.default)(A.prototype,v.default),A.extend=function(t){return(0,y.extend)(A,t)},A.type="container",t.exports=e.default},function(t,e,r){var i=r(104);t.exports=function(t,e,r){if(i(t),void 0===e)return t;switch(r){case 1:return function(r){return t.call(e,r)};case 2:return function(r,i){return t.call(e,r,i)};case 3:return function(r,i,n){return t.call(e,r,i,n)}}return function(){return t.apply(e,arguments)}}},function(t,e,r){var i=r(32);t.exports=function(t,e){if(!i(t))return t;var r,n;if(e&&"function"==typeof(r=t.toString)&&!i(n=r.call(t)))return n;if("function"==typeof(r=t.valueOf)&&!i(n=r.call(t)))return n;if(!e&&"function"==typeof(r=t.toString)&&!i(n=r.call(t)))return n;throw TypeError("Can't convert object to primitive value")}},function(t,e){var r={}.toString;t.exports=function(t){return r.call(t).slice(8,-1)}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e){var r=Math.ceil,i=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?i:r)(t)}},function(t,e,r){var i=r(50)("keys"),n=r(36);t.exports=function(t){return i[t]||(i[t]=n(t))}},function(t,e,r){var i=r(17),n=i["__core-js_shared__"]||(i["__core-js_shared__"]={});t.exports=function(t){return n[t]||(n[t]={})}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e,r){t.exports={default:r(108),__esModule:!0}},function(t,e){t.exports=!0},function(t,e,r){var i=r(26),n=r(114),a=r(51),o=r(49)("IE_PROTO"),s=function(){},l=function(){var t,e=r(66)("iframe"),i=a.length;for(e.style.display="none",r(115).appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write("<script>document.F=Object<\/script>"),t.close(),l=t.F;i--;)delete l.prototype[a[i]];return l()};t.exports=Object.create||function(t,e){var r;return null!==t?(s.prototype=i(t),r=new s,s.prototype=null,r[o]=t):r=l(),void 0===e?r:n(r,e)}},function(t,e,r){var i=r(18).f,n=r(22),a=r(13)("toStringTag");t.exports=function(t,e,r){t&&!n(t=r?t:t.prototype,a)&&i(t,a,{configurable:!0,value:e})}},function(t,e,r){e.f=r(13)},function(t,e,r){var i=r(17),n=r(11),a=r(54),o=r(57),s=r(18).f;t.exports=function(t){var e=n.Symbol||(n.Symbol=a?{}:i.Symbol||{});"_"==t.charAt(0)||t in e||s(e,t,{value:o.f(t)})}},function(t,e,r){var i=r(37),n=r(33),a=r(19),o=r(45),s=r(22),l=r(65),u=Object.getOwnPropertyDescriptor;e.f=r(21)?u:function(t,e){if(t=a(t),e=o(e,!0),l)try{return u(t,e)}catch(t){}if(s(t,e))return n(!i.f.call(t,e),t[e])}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(149),n=function(t){return t&&t.__esModule?t:{default:t}}(i);e.default={Kibo:n.default},t.exports=e.default},function(t,e,r){"use strict";e.__esModule=!0;var i=r(83),n=function(t){return t&&t.__esModule?t:{default:t}}(i);e.default=function(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}return(0,n.default)(t)}},function(t,e){function r(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function n(t){if(d===setTimeout)return setTimeout(t,0);if((d===r||!d)&&setTimeout)return d=setTimeout,setTimeout(t,0);try{return d(t,0)}catch(e){try{return d.call(null,t,0)}catch(e){return d.call(this,t,0)}}}function a(t){if(c===clearTimeout)return clearTimeout(t);if((c===i||!c)&&clearTimeout)return c=clearTimeout,clearTimeout(t);try{return c(t)}catch(e){try{return c.call(null,t)}catch(e){return c.call(this,t)}}}function o(){g&&h&&(g=!1,h.length?p=h.concat(p):y=-1,p.length&&s())}function s(){if(!g){var t=n(o);g=!0;for(var e=p.length;e;){for(h=p,p=[];++y<e;)h&&h[y].run();y=-1,e=p.length}h=null,g=!1,a(t)}}function l(t,e){this.fun=t,this.array=e}function u(){}var d,c,f=t.exports={};!function(){try{d="function"==typeof setTimeout?setTimeout:r}catch(t){d=r}try{c="function"==typeof clearTimeout?clearTimeout:i}catch(t){c=i}}();var h,p=[],g=!1,y=-1;f.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];p.push(new l(t,e)),1!==p.length||g||n(s)},l.prototype.run=function(){this.fun.apply(null,this.array)},f.title="browser",f.browser=!0,f.env={},f.argv=[],f.version="",f.versions={},f.on=u,f.addListener=u,f.once=u,f.off=u,f.removeListener=u,f.removeAllListeners=u,f.emit=u,f.binding=function(t){throw new Error("process.binding is not supported")},f.cwd=function(){return"/"},f.chdir=function(t){throw new Error("process.chdir is not supported")},f.umask=function(){return 0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=r(177),t.exports=e.default},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#010101" d="M1.425.35L14.575 8l-13.15 7.65V.35z"></path></svg>'},function(t,e,r){t.exports=!r(21)&&!r(27)(function(){return 7!=Object.defineProperty(r(66)("div"),"a",{get:function(){return 7}}).a})},function(t,e,r){var i=r(32),n=r(17).document,a=i(n)&&i(n.createElement);t.exports=function(t){return a?n.createElement(t):{}}},function(t,e,r){var i=r(22),n=r(19),a=r(106)(!1),o=r(49)("IE_PROTO");t.exports=function(t,e){var r,s=n(t),l=0,u=[];for(r in s)r!=o&&i(s,r)&&u.push(r);for(;e.length>l;)i(s,r=e[l++])&&(~a(u,r)||u.push(r));return u}},function(t,e,r){var i=r(46);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==i(t)?t.split(""):Object(t)}},function(t,e,r){var i=r(48),n=Math.min;t.exports=function(t){return t>0?n(i(t),9007199254740991):0}},function(t,e,r){var i=r(16),n=r(11),a=r(27);t.exports=function(t,e){var r=(n.Object||{})[t]||Object[t],o={};o[t]=e(r),i(i.S+i.F*a(function(){r(1)}),"Object",o)}},function(t,e,r){"use strict";var i=r(112)(!0);r(72)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,r=this._i;return r>=e.length?{value:void 0,done:!0}:(t=i(e,r),this._i+=t.length,{value:t,done:!1})})},function(t,e,r){"use strict";var i=r(54),n=r(16),a=r(73),o=r(25),s=r(22),l=r(34),u=r(113),d=r(56),c=r(116),f=r(13)("iterator"),h=!([].keys&&"next"in[].keys()),p=function(){return this};t.exports=function(t,e,r,g,y,m,v){u(r,e,g);var A,_,b,E=function(t){if(!h&&t in k)return k[t];switch(t){case"keys":case"values":return function(){return new r(this,t)}}return function(){return new r(this,t)}},T=e+" Iterator",S="values"==y,L=!1,k=t.prototype,R=k[f]||k["@@iterator"]||y&&k[y],C=R||E(y),w=y?S?E("entries"):C:void 0,O="Array"==e?k.entries||R:R;if(O&&(b=c(O.call(new t)))!==Object.prototype&&(d(b,T,!0),i||s(b,f)||o(b,f,p)),S&&R&&"values"!==R.name&&(L=!0,C=function(){return R.call(this)}),i&&!v||!h&&!L&&k[f]||o(k,f,C),l[e]=C,l[T]=p,y)if(A={values:S?C:E("values"),keys:m?C:E("keys"),entries:w},v)for(_ in A)_ in k||a(k,_,A[_]);else n(n.P+n.F*(h||L),e,A);return A}},function(t,e,r){t.exports=r(25)},function(t,e,r){var i=r(67),n=r(51).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return i(t,n)}},function(t,e,r){t.exports={default:r(132),__esModule:!0}},function(t,e,r){t.exports={default:r(138),__esModule:!0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(152),n=function(t){return t&&t.__esModule?t:{default:t}}(i);e.default=n.default,t.exports=e.default},function(t,e,r){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=r(6),a=i(n),o=r(7),s=i(o),l={getStyleFor:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{baseUrl:""};return(0,a.default)('<style class="clappr-style"></style>').html((0,s.default)(t.toString())(e))}};e.default=l,t.exports=e.default},function(t,e,r){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=r(0),a=i(n),o=r(1),s=i(o),l=r(3),u=i(l),d=r(2),c=i(d),f=r(4),h=i(f),p=r(15),g=i(p),y=r(29),m=i(y),v=function(t){function e(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments[1];(0,a.default)(this,e);var n=(0,s.default)(this,t.call(this,r));return n.core=i,n}return(0,c.default)(e,t),(0,u.default)(e,[{key:"name",get:function(){return"error"}}],[{key:"Levels",get:function(){return{FATAL:"FATAL",WARN:"WARN",INFO:"INFO"}}}]),e.prototype.createError=function(t){if(!this.core)return void m.default.warn(this.name,"Core is not set. Error: ",t);this.core.trigger(h.default.ERROR,t)},e}(g.default);e.default=v,t.exports=e.default},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(155),n=function(t){return t&&t.__esModule?t:{default:t}}(i);e.default=n.default,t.exports=e.default},function(t,e){t.exports=function(t){return"string"!=typeof t?t:(/^['"].*['"]$/.test(t)&&(t=t.slice(1,-1)),/["'() \t\n]/.test(t)?'"'+t.replace(/"/g,'\\"').replace(/\n/g,"\\n")+'"':t)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(163),n=function(t){return t&&t.__esModule?t:{default:t}}(i);e.default=n.default,t.exports=e.default},function(t,e,r){t.exports={default:r(164),__esModule:!0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(176),n=function(t){return t&&t.__esModule?t:{default:t}}(i);e.default=n.default,t.exports=e.default},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(182),n=function(t){return t&&t.__esModule?t:{default:t}}(i);e.default=n.default,t.exports=e.default},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(183),n=function(t){return t&&t.__esModule?t:{default:t}}(i);e.default=n.default,t.exports=e.default},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(186),n=function(t){return t&&t.__esModule?t:{default:t}}(i);e.default=n.default,t.exports=e.default},function(t,e,r){t.exports={default:r(187),__esModule:!0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(189),n=function(t){return t&&t.__esModule?t:{default:t}}(i);e.default=n.default,t.exports=e.default},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(192),n=function(t){return t&&t.__esModule?t:{default:t}}(i);e.default=n.default,t.exports=e.default},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(196),n=function(t){return t&&t.__esModule?t:{default:t}}(i);e.default=n.default,t.exports=e.default},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(202),n=function(t){return t&&t.__esModule?t:{default:t}}(i);e.default=n.default,t.exports=e.default},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(206),n=function(t){return t&&t.__esModule?t:{default:t}}(i);e.default=n.default,t.exports=e.default},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(212),n=function(t){return t&&t.__esModule?t:{default:t}}(i);e.default=n.default,t.exports=e.default},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(213),n=function(t){return t&&t.__esModule?t:{default:t}}(i);e.default=n.default,t.exports=e.default},function(t,e){t.exports="<%=baseUrl%>/a8c874b93b3d848f39a71260c57e3863.cur"},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" fill="#010101" d="M1.712 14.76H6.43V1.24H1.71v13.52zm7.86-13.52v13.52h4.716V1.24H9.573z"></path></svg>'},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(223),n=function(t){return t&&t.__esModule?t:{default:t}}(i);e.default=n.default,t.exports=e.default},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(233),n=function(t){return t&&t.__esModule?t:{default:t}}(i);e.default=n.default,t.exports=e.default},function(t,e,r){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=r(101),a=i(n),o=r(5),s=i(o),l=r(4),u=i(l),d=r(10),c=i(d),f=r(43),h=i(f),p=r(35),g=i(p),y=r(23),m=i(y),v=r(42),A=i(v),_=r(15),b=i(_),E=r(30),T=i(E),S=r(14),L=i(S),k=r(80),R=i(k),C=r(77),w=i(C),O=r(24),P=i(O),D=r(82),I=i(D),x=r(31),M=i(x),N=r(40),F=i(N),B=r(63),U=i(B),j=r(84),G=i(j),K=r(86),V=i(K),Y=r(87),H=i(Y),$=r(85),W=i($),z=r(41),q=i(z),X=r(89),Z=i(X),Q=r(90),J=i(Q),tt=r(95),et=i(tt),rt=r(94),it=i(rt),nt=r(98),at=i(nt),ot=r(99),st=i(ot),lt=r(29),ut=i(lt),dt=r(93),ct=i(dt),ft=r(91),ht=i(ft),pt=r(92),gt=i(pt),yt=r(78),mt=i(yt),vt=r(60),At=i(vt),_t=r(7),bt=i(_t),Et=r(6),Tt=i(Et);e.default={Player:a.default,Mediator:M.default,Events:u.default,Browser:L.default,PlayerInfo:F.default,MediaControl:et.default,ContainerPlugin:h.default,UIContainerPlugin:A.default,CorePlugin:g.default,UICorePlugin:m.default,Playback:c.default,Container:R.default,Core:w.default,PlayerError:P.default,Loader:I.default,BaseObject:b.default,UIObject:T.default,Utils:s.default,BaseFlashPlayback:U.default,Flash:G.default,FlasHLS:V.default,HLS:H.default,HTML5Audio:W.default,HTML5Video:q.default,HTMLImg:Z.default,NoOp:J.default,ClickToPausePlugin:it.default,DVRControls:at.default,Favicon:st.default,Log:ut.default,Poster:ct.default,SpinnerThreeBouncePlugin:ht.default,WaterMarkPlugin:gt.default,Styler:mt.default,Vendor:At.default,version:"0.3.2",template:bt.default,$:Tt.default},t.exports=e.default},function(t,e,r){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=r(12),a=i(n),o=r(53),s=i(o),l=r(0),u=i(l),d=r(1),c=i(d),f=r(3),h=i(f),p=r(2),g=i(p),y=r(5),m=r(15),v=i(m),A=r(4),_=i(A),b=r(14),E=i(b),T=r(150),S=i(T),L=r(82),k=i(L),R=r(40),C=i(R),w=r(20),O=i(w),P=r(6),D=i(P),I=(0,y.currentScriptUrl)().replace(/\/[^\/]+$/,""),x=function(t){function e(r){(0,u.default)(this,e);var i=(0,c.default)(this,t.call(this,r)),n={recycleVideo:!0},a={playerId:(0,y.uniqueId)(""),persistConfig:!0,width:640,height:360,baseUrl:I,allowUserInteraction:E.default.isMobile,playback:n};return i._options=D.default.extend(a,r),i.options.sources=i._normalizeSources(r),i.options.chromeless||(i.options.allowUserInteraction=!0),i.options.allowUserInteraction||(i.options.disableKeyboardShortcuts=!0),i._registerOptionEventListeners(i.options.events),i._coreFactory=new S.default(i),i.playerInfo=C.default.getInstance(i.options.playerId),i.playerInfo.currentSize={width:r.width,height:r.height},i.playerInfo.options=i.options,i.options.parentId?i.setParentId(i.options.parentId):i.options.parent&&i.attachTo(i.options.parent),i}return(0,g.default)(e,t),(0,h.default)(e,[{key:"loader",set:function(t){this._loader=t},get:function(){return this._loader||(this._loader=new k.default(this.options.plugins||{},this.options.playerId)),this._loader}},{key:"ended",get:function(){return this.core.activeContainer.ended}},{key:"buffering",get:function(){return this.core.activeContainer.buffering}},{key:"isReady",get:function(){return!!this._ready}},{key:"eventsMapping",get:function(){return{onReady:_.default.PLAYER_READY,onResize:_.default.PLAYER_RESIZE,onPlay:_.default.PLAYER_PLAY,onPause:_.default.PLAYER_PAUSE,onStop:_.default.PLAYER_STOP,onEnded:_.default.PLAYER_ENDED,onSeek:_.default.PLAYER_SEEK,onError:_.default.PLAYER_ERROR,onTimeUpdate:_.default.PLAYER_TIMEUPDATE,onVolumeUpdate:_.default.PLAYER_VOLUMEUPDATE,onSubtitleAvailable:_.default.PLAYER_SUBTITLE_AVAILABLE}}}]),e.prototype.setParentId=function(t){var e=document.querySelector(t);return e&&this.attachTo(e),this},e.prototype.attachTo=function(t){return this.options.parentElement=t,this.core=this._coreFactory.create(),this._addEventListeners(),this},e.prototype._addEventListeners=function(){return this.core.isReady?this._onReady():this.listenToOnce(this.core,_.default.CORE_READY,this._onReady),this.listenTo(this.core.activeContainer,_.default.CORE_ACTIVE_CONTAINER_CHANGED,this._containerChanged),this.listenTo(this.core,_.default.CORE_FULLSCREEN,this._onFullscreenChange),this.listenTo(this.core,_.default.CORE_RESIZE,this._onResize),this},e.prototype._addContainerEventListeners=function(){var t=this.core.activeContainer;return t&&(this.listenTo(t,_.default.CONTAINER_PLAY,this._onPlay),this.listenTo(t,_.default.CONTAINER_PAUSE,this._onPause),this.listenTo(t,_.default.CONTAINER_STOP,this._onStop),this.listenTo(t,_.default.CONTAINER_ENDED,this._onEnded),this.listenTo(t,_.default.CONTAINER_SEEK,this._onSeek),this.listenTo(t,_.default.CONTAINER_ERROR,this._onError),this.listenTo(t,_.default.CONTAINER_TIMEUPDATE,this._onTimeUpdate),this.listenTo(t,_.default.CONTAINER_VOLUME,this._onVolumeUpdate),this.listenTo(t,_.default.CONTAINER_SUBTITLE_AVAILABLE,this._onSubtitleAvailable)),this},e.prototype._registerOptionEventListeners=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,s.default)(e).length>0&&(0,s.default)(r).forEach(function(e){var i=t.eventsMapping[e];i&&t.off(i,r[e])}),(0,s.default)(e).forEach(function(r){var i=t.eventsMapping[r];if(i){var n=e[r];(n="function"==typeof n&&n)&&t.on(i,n)}}),this},e.prototype._containerChanged=function(){this.stopListening(),this._addEventListeners()},e.prototype._onReady=function(){this._ready=!0,this._addContainerEventListeners(),this.trigger(_.default.PLAYER_READY)},e.prototype._onFullscreenChange=function(t){this.trigger(_.default.PLAYER_FULLSCREEN,t)},e.prototype._onVolumeUpdate=function(t){this.trigger(_.default.PLAYER_VOLUMEUPDATE,t)},e.prototype._onSubtitleAvailable=function(){this.trigger(_.default.PLAYER_SUBTITLE_AVAILABLE)},e.prototype._onResize=function(t){this.trigger(_.default.PLAYER_RESIZE,t)},e.prototype._onPlay=function(){this.trigger(_.default.PLAYER_PLAY)},e.prototype._onPause=function(){this.trigger(_.default.PLAYER_PAUSE)},e.prototype._onStop=function(){this.trigger(_.default.PLAYER_STOP,this.getCurrentTime())},e.prototype._onEnded=function(){this.trigger(_.default.PLAYER_ENDED)},e.prototype._onSeek=function(t){this.trigger(_.default.PLAYER_SEEK,t)},e.prototype._onTimeUpdate=function(t){this.trigger(_.default.PLAYER_TIMEUPDATE,t)},e.prototype._onError=function(t){this.trigger(_.default.PLAYER_ERROR,t)},e.prototype._normalizeSources=function(t){var e=t.sources||(void 0!==t.source?[t.source]:[]);return 0===e.length?[{source:"",mimeType:""}]:e},e.prototype.resize=function(t){return this.core.resize(t),this},e.prototype.load=function(t,e,r){return void 0!==r&&this.configure({autoPlay:!!r}),this.core.load(t,e),this},e.prototype.destroy=function(){return this.stopListening(),this.core.destroy(),this},e.prototype.consent=function(){return this.core.getCurrentPlayback().consent(),this},e.prototype.play=function(){return this.core.activeContainer.play(),this},e.prototype.pause=function(){return this.core.activeContainer.pause(),this},e.prototype.stop=function(){return this.core.activeContainer.stop(),this},e.prototype.seek=function(t){return this.core.activeContainer.seek(t),this},e.prototype.seekPercentage=function(t){return this.core.activeContainer.seekPercentage(t),this},e.prototype.mute=function(){return this._mutedVolume=this.getVolume(),this.setVolume(0),this},e.prototype.unmute=function(){return this.setVolume("number"==typeof this._mutedVolume?this._mutedVolume:100),this._mutedVolume=null,this},e.prototype.isPlaying=function(){return this.core.activeContainer.isPlaying()},e.prototype.isDvrEnabled=function(){return this.core.activeContainer.isDvrEnabled()},e.prototype.isDvrInUse=function(){return this.core.activeContainer.isDvrInUse()},e.prototype.configure=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._registerOptionEventListeners(t.events,this.options.events),this.core.configure(t),this},e.prototype.getPlugin=function(t){return this.core.plugins.concat(this.core.activeContainer.plugins).filter(function(e){return e.name===t})[0]},e.prototype.getCurrentTime=function(){return this.core.activeContainer.getCurrentTime()},e.prototype.getStartTimeOffset=function(){return this.core.activeContainer.getStartTimeOffset()},e.prototype.getDuration=function(){return this.core.activeContainer.getDuration()},e}(v.default);e.default=x,(0,a.default)(x.prototype,O.default),t.exports=e.default},function(t,e,r){r(103),t.exports=r(11).Object.assign},function(t,e,r){var i=r(16);i(i.S+i.F,"Object",{assign:r(105)})},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,r){"use strict";var i=r(28),n=r(52),a=r(37),o=r(38),s=r(68),l=Object.assign;t.exports=!l||r(27)(function(){var t={},e={},r=Symbol(),i="abcdefghijklmnopqrst";return t[r]=7,i.split("").forEach(function(t){e[t]=t}),7!=l({},t)[r]||Object.keys(l({},e)).join("")!=i})?function(t,e){for(var r=o(t),l=arguments.length,u=1,d=n.f,c=a.f;l>u;)for(var f,h=s(arguments[u++]),p=d?i(h).concat(d(h)):i(h),g=p.length,y=0;g>y;)c.call(h,f=p[y++])&&(r[f]=h[f]);return r}:l},function(t,e,r){var i=r(19),n=r(69),a=r(107);t.exports=function(t){return function(e,r,o){var s,l=i(e),u=n(l.length),d=a(o,u);if(t&&r!=r){for(;u>d;)if((s=l[d++])!=s)return!0}else for(;u>d;d++)if((t||d in l)&&l[d]===r)return t||d||0;return!t&&-1}}},function(t,e,r){var i=r(48),n=Math.max,a=Math.min;t.exports=function(t,e){return t=i(t),t<0?n(t+e,0):a(t,e)}},function(t,e,r){r(109),t.exports=r(11).Object.keys},function(t,e,r){var i=r(38),n=r(28);r(70)("keys",function(){return function(t){return n(i(t))}})},function(t,e,r){t.exports={default:r(111),__esModule:!0}},function(t,e,r){r(71),r(117),t.exports=r(57).f("iterator")},function(t,e,r){var i=r(48),n=r(47);t.exports=function(t){return function(e,r){var a,o,s=String(n(e)),l=i(r),u=s.length;return l<0||l>=u?t?"":void 0:(a=s.charCodeAt(l),a<55296||a>56319||l+1===u||(o=s.charCodeAt(l+1))<56320||o>57343?t?s.charAt(l):a:t?s.slice(l,l+2):o-56320+(a-55296<<10)+65536)}}},function(t,e,r){"use strict";var i=r(55),n=r(33),a=r(56),o={};r(25)(o,r(13)("iterator"),function(){return this}),t.exports=function(t,e,r){t.prototype=i(o,{next:n(1,r)}),a(t,e+" Iterator")}},function(t,e,r){var i=r(18),n=r(26),a=r(28);t.exports=r(21)?Object.defineProperties:function(t,e){n(t);for(var r,o=a(e),s=o.length,l=0;s>l;)i.f(t,r=o[l++],e[r]);return t}},function(t,e,r){t.exports=r(17).document&&document.documentElement},function(t,e,r){var i=r(22),n=r(38),a=r(49)("IE_PROTO"),o=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=n(t),i(t,a)?t[a]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?o:null}},function(t,e,r){r(118);for(var i=r(17),n=r(25),a=r(34),o=r(13)("toStringTag"),s=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],l=0;l<5;l++){var u=s[l],d=i[u],c=d&&d.prototype;c&&!c[o]&&n(c,o,u),a[u]=a.Array}},function(t,e,r){"use strict";var i=r(119),n=r(120),a=r(34),o=r(19);t.exports=r(72)(Array,"Array",function(t,e){this._t=o(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,r=this._i++;return!t||r>=t.length?(this._t=void 0,n(1)):"keys"==e?n(0,r):"values"==e?n(0,t[r]):n(0,[r,t[r]])},"values"),a.Arguments=a.Array,i("keys"),i("values"),i("entries")},function(t,e){t.exports=function(){}},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e,r){t.exports={default:r(122),__esModule:!0}},function(t,e,r){r(123),r(129),r(130),r(131),t.exports=r(11).Symbol},function(t,e,r){"use strict";var i=r(17),n=r(22),a=r(21),o=r(16),s=r(73),l=r(124).KEY,u=r(27),d=r(50),c=r(56),f=r(36),h=r(13),p=r(57),g=r(58),y=r(125),m=r(126),v=r(127),A=r(26),_=r(19),b=r(45),E=r(33),T=r(55),S=r(128),L=r(59),k=r(18),R=r(28),C=L.f,w=k.f,O=S.f,P=i.Symbol,D=i.JSON,I=D&&D.stringify,x=h("_hidden"),M=h("toPrimitive"),N={}.propertyIsEnumerable,F=d("symbol-registry"),B=d("symbols"),U=d("op-symbols"),j=Object.prototype,G="function"==typeof P,K=i.QObject,V=!K||!K.prototype||!K.prototype.findChild,Y=a&&u(function(){return 7!=T(w({},"a",{get:function(){return w(this,"a",{value:7}).a}})).a})?function(t,e,r){var i=C(j,e);i&&delete j[e],w(t,e,r),i&&t!==j&&w(j,e,i)}:w,H=function(t){var e=B[t]=T(P.prototype);return e._k=t,e},$=G&&"symbol"==typeof P.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof P},W=function(t,e,r){return t===j&&W(U,e,r),A(t),e=b(e,!0),A(r),n(B,e)?(r.enumerable?(n(t,x)&&t[x][e]&&(t[x][e]=!1),r=T(r,{enumerable:E(0,!1)})):(n(t,x)||w(t,x,E(1,{})),t[x][e]=!0),Y(t,e,r)):w(t,e,r)},z=function(t,e){A(t);for(var r,i=m(e=_(e)),n=0,a=i.length;a>n;)W(t,r=i[n++],e[r]);return t},q=function(t,e){return void 0===e?T(t):z(T(t),e)},X=function(t){var e=N.call(this,t=b(t,!0));return!(this===j&&n(B,t)&&!n(U,t))&&(!(e||!n(this,t)||!n(B,t)||n(this,x)&&this[x][t])||e)},Z=function(t,e){if(t=_(t),e=b(e,!0),t!==j||!n(B,e)||n(U,e)){var r=C(t,e);return!r||!n(B,e)||n(t,x)&&t[x][e]||(r.enumerable=!0),r}},Q=function(t){for(var e,r=O(_(t)),i=[],a=0;r.length>a;)n(B,e=r[a++])||e==x||e==l||i.push(e);return i},J=function(t){for(var e,r=t===j,i=O(r?U:_(t)),a=[],o=0;i.length>o;)!n(B,e=i[o++])||r&&!n(j,e)||a.push(B[e]);return a};G||(P=function(){if(this instanceof P)throw TypeError("Symbol is not a constructor!");var t=f(arguments.length>0?arguments[0]:void 0),e=function(r){this===j&&e.call(U,r),n(this,x)&&n(this[x],t)&&(this[x][t]=!1),Y(this,t,E(1,r))};return a&&V&&Y(j,t,{configurable:!0,set:e}),H(t)},s(P.prototype,"toString",function(){return this._k}),L.f=Z,k.f=W,r(74).f=S.f=Q,r(37).f=X,r(52).f=J,a&&!r(54)&&s(j,"propertyIsEnumerable",X,!0),p.f=function(t){return H(h(t))}),o(o.G+o.W+o.F*!G,{Symbol:P});for(var tt="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),et=0;tt.length>et;)h(tt[et++]);for(var tt=R(h.store),et=0;tt.length>et;)g(tt[et++]);o(o.S+o.F*!G,"Symbol",{for:function(t){return n(F,t+="")?F[t]:F[t]=P(t)},keyFor:function(t){if($(t))return y(F,t);throw TypeError(t+" is not a symbol!")},useSetter:function(){V=!0},useSimple:function(){V=!1}}),o(o.S+o.F*!G,"Object",{create:q,defineProperty:W,defineProperties:z,getOwnPropertyDescriptor:Z,getOwnPropertyNames:Q,getOwnPropertySymbols:J}),D&&o(o.S+o.F*(!G||u(function(){var t=P();return"[null]"!=I([t])||"{}"!=I({a:t})||"{}"!=I(Object(t))})),"JSON",{stringify:function(t){if(void 0!==t&&!$(t)){for(var e,r,i=[t],n=1;arguments.length>n;)i.push(arguments[n++]);return e=i[1],"function"==typeof e&&(r=e),!r&&v(e)||(e=function(t,e){if(r&&(e=r.call(this,t,e)),!$(e))return e}),i[1]=e,I.apply(D,i)}}}),P.prototype[M]||r(25)(P.prototype,M,P.prototype.valueOf),c(P,"Symbol"),c(Math,"Math",!0),c(i.JSON,"JSON",!0)},function(t,e,r){var i=r(36)("meta"),n=r(32),a=r(22),o=r(18).f,s=0,l=Object.isExtensible||function(){return!0},u=!r(27)(function(){return l(Object.preventExtensions({}))}),d=function(t){o(t,i,{value:{i:"O"+ ++s,w:{}}})},c=function(t,e){if(!n(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!a(t,i)){if(!l(t))return"F";if(!e)return"E";d(t)}return t[i].i},f=function(t,e){if(!a(t,i)){if(!l(t))return!0;if(!e)return!1;d(t)}return t[i].w},h=function(t){return u&&p.NEED&&l(t)&&!a(t,i)&&d(t),t},p=t.exports={KEY:i,NEED:!1,fastKey:c,getWeak:f,onFreeze:h}},function(t,e,r){var i=r(28),n=r(19);t.exports=function(t,e){for(var r,a=n(t),o=i(a),s=o.length,l=0;s>l;)if(a[r=o[l++]]===e)return r}},function(t,e,r){var i=r(28),n=r(52),a=r(37);t.exports=function(t){var e=i(t),r=n.f;if(r)for(var o,s=r(t),l=a.f,u=0;s.length>u;)l.call(t,o=s[u++])&&e.push(o);return e}},function(t,e,r){var i=r(46);t.exports=Array.isArray||function(t){return"Array"==i(t)}},function(t,e,r){var i=r(19),n=r(74).f,a={}.toString,o="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],s=function(t){try{return n(t)}catch(t){return o.slice()}};t.exports.f=function(t){return o&&"[object Window]"==a.call(t)?s(t):n(i(t))}},function(t,e){},function(t,e,r){r(58)("asyncIterator")},function(t,e,r){r(58)("observable")},function(t,e,r){r(133);var i=r(11).Object;t.exports=function(t,e,r){return i.defineProperty(t,e,r)}},function(t,e,r){var i=r(16);i(i.S+i.F*!r(21),"Object",{defineProperty:r(18).f})},function(t,e,r){t.exports={default:r(135),__esModule:!0}},function(t,e,r){r(136),t.exports=r(11).Object.setPrototypeOf},function(t,e,r){var i=r(16);i(i.S,"Object",{setPrototypeOf:r(137).set})},function(t,e,r){var i=r(32),n=r(26),a=function(t,e){if(n(t),!i(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,i){try{i=r(44)(Function.call,r(59).f(Object.prototype,"__proto__").set,2),i(t,[]),e=!(t instanceof Array)}catch(t){e=!0}return function(t,r){return a(t,r),e?t.__proto__=r:i(t,r),t}}({},!1):void 0),check:a}},function(t,e,r){r(139);var i=r(11).Object;t.exports=function(t,e){return i.create(t,e)}},function(t,e,r){var i=r(16);i(i.S,"Object",{create:r(55)})},function(t,e,r){t.exports={default:r(141),__esModule:!0}},function(t,e,r){r(142);var i=r(11).Object;t.exports=function(t,e){return i.getOwnPropertyDescriptor(t,e)}},function(t,e,r){var i=r(19),n=r(59).f;r(70)("getOwnPropertyDescriptor",function(){return function(t,e){return n(i(t),e)}})},function(t,e,r){"use strict";Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(t){if(null==this)throw new TypeError('"this" is null or not defined');var e=Object(this),r=e.length>>>0;if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var i=arguments[1],n=0;n<r;){var a=e[n];if(t.call(i,a,n,e))return a;n++}}})},function(t,e,r){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.getDevice=e.getViewportSize=e.getOsData=e.getBrowserData=e.getBrowserInfo=void 0;var n=r(6),a=i(n),o=r(145),s=i(o),l=r(146),u=i(l),d={},c=e.getBrowserInfo=function(t){var e=t.match(/\b(playstation 4|nx|opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[],r=void 0;if(/trident/i.test(e[1]))return r=/\brv[ :]+(\d+)/g.exec(t)||[],{name:"IE",version:parseInt(r[1]||"")};if("Chrome"===e[1]){if(null!=(r=t.match(/\bOPR\/(\d+)/)))return{name:"Opera",version:parseInt(r[1])};if(null!=(r=t.match(/\bEdge\/(\d+)/)))return{name:"Edge",version:parseInt(r[1])}}else/android/i.test(t)&&(r=t.match(/version\/(\d+)/i))&&(e.splice(1,1,"Android WebView"),e.splice(2,1,r[1]));return e=e[2]?[e[1],e[2]]:[navigator.appName,navigator.appVersion,"-?"],{name:e[0],version:parseInt(e[1])}},f=e.getBrowserData=function(){var t={},e=d.userAgent.toLowerCase();for(var r in s.default){var i=new RegExp(s.default[r].identifier.toLowerCase()),n=i.exec(e);if(null!=n&&n[1]){if(t.name=s.default[r].name,t.group=s.default[r].group,s.default[r].versionIdentifier){var a=new RegExp(s.default[r].versionIdentifier.toLowerCase()),o=a.exec(e);null!=o&&o[1]&&h(o[1],t)}else h(n[1],t);break}}return t},h=function(t,e){var r=t.split(".",2);e.fullVersion=t,r[0]&&(e.majorVersion=parseInt(r[0])),r[1]&&(e.minorVersion=parseInt(r[1]))},p=e.getOsData=function(){var t={},e=d.userAgent.toLowerCase();for(var r in u.default){var i=new RegExp(u.default[r].identifier.toLowerCase()),n=i.exec(e);if(null!=n){if(t.name=u.default[r].name,t.group=u.default[r].group,u.default[r].version)g(u.default[r].version,u.default[r].versionSeparator?u.default[r].versionSeparator:".",t);else if(n[1])g(n[1],u.default[r].versionSeparator?u.default[r].versionSeparator:".",t);else if(u.default[r].versionIdentifier){var a=new RegExp(u.default[r].versionIdentifier.toLowerCase()),o=a.exec(e);null!=o&&o[1]&&g(o[1],u.default[r].versionSeparator?u.default[r].versionSeparator:".",t)}break}}return t},g=function(t,e,r){var i="["==e.substr(0,1)?new RegExp(e,"g"):e,n=t.split(i,2);"."!=e&&(t=t.replace(new RegExp(e,"g"),".")),r.fullVersion=t,n&&n[0]&&(r.majorVersion=parseInt(n[0])),n&&n[1]&&(r.minorVersion=parseInt(n[1]))},y=e.getViewportSize=function(){var t={};return t.width=(0,a.default)(window).width(),t.height=(0,a.default)(window).height(),t},m=e.getDevice=function(t){var e=/\((iP(?:hone|ad|od))?(?:[^;]*; ){0,2}([^)]+(?=\)))/,r=e.exec(t);return r&&(r[1]||r[2])||""},v=c(navigator.userAgent);d.isEdge=/edge/i.test(navigator.userAgent),d.isChrome=/chrome|CriOS/i.test(navigator.userAgent)&&!d.isEdge,d.isSafari=/safari/i.test(navigator.userAgent)&&!d.isChrome&&!d.isEdge,d.isFirefox=/firefox/i.test(navigator.userAgent),d.isLegacyIE=!!window.ActiveXObject,d.isIE=d.isLegacyIE||/trident.*rv:1\d/i.test(navigator.userAgent),d.isIE11=/trident.*rv:11/i.test(navigator.userAgent),d.isChromecast=d.isChrome&&/CrKey/i.test(navigator.userAgent),d.isMobile=/Android|webOS|iPhone|iPad|iPod|BlackBerry|Windows Phone|IEMobile|Mobile Safari|Opera Mini/i.test(navigator.userAgent),d.isiOS=/iPad|iPhone|iPod/i.test(navigator.userAgent),d.isAndroid=/Android/i.test(navigator.userAgent),d.isWindowsPhone=/Windows Phone/i.test(navigator.userAgent),d.isWin8App=/MSAppHost/i.test(navigator.userAgent),d.isWiiU=/WiiU/i.test(navigator.userAgent),d.isPS4=/PlayStation 4/i.test(navigator.userAgent),d.hasLocalstorage=function(){try{return localStorage.setItem("clappr","clappr"),localStorage.removeItem("clappr"),!0}catch(t){return!1}}(),d.hasFlash=function(){try{return!!new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(t){return!(!navigator.mimeTypes||void 0===navigator.mimeTypes["application/x-shockwave-flash"]||!navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin)}}(),d.name=v.name,d.version=v.version,d.userAgent=navigator.userAgent,d.data=f(),d.os=p(),d.viewport=y(),d.device=m(d.userAgent),void 0!==window.orientation&&function(){switch(window.orientation){case-90:case 90:d.viewport.orientation="landscape";break;default:d.viewport.orientation="portrait"}}(),e.default=d},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=[{name:"Chromium",group:"Chrome",identifier:"Chromium/([0-9.]*)"},{name:"Chrome Mobile",group:"Chrome",identifier:"Chrome/([0-9.]*) Mobile",versionIdentifier:"Chrome/([0-9.]*)"},{name:"Chrome",group:"Chrome",identifier:"Chrome/([0-9.]*)"},{name:"Chrome for iOS",group:"Chrome",identifier:"CriOS/([0-9.]*)"},{name:"Android Browser",group:"Chrome",identifier:"CrMo/([0-9.]*)"},{name:"Firefox",group:"Firefox",identifier:"Firefox/([0-9.]*)"},{name:"Opera Mini",group:"Opera",identifier:"Opera Mini/([0-9.]*)"},{name:"Opera",group:"Opera",identifier:"Opera ([0-9.]*)"},{name:"Opera",group:"Opera",identifier:"Opera/([0-9.]*)",versionIdentifier:"Version/([0-9.]*)"},{name:"IEMobile",group:"Explorer",identifier:"IEMobile/([0-9.]*)"},{name:"Internet Explorer",group:"Explorer",identifier:"MSIE ([a-zA-Z0-9.]*)"},{name:"Internet Explorer",group:"Explorer",identifier:"Trident/([0-9.]*)",versionIdentifier:"rv:([0-9.]*)"},{name:"Spartan",group:"Spartan",identifier:"Edge/([0-9.]*)",versionIdentifier:"Edge/([0-9.]*)"},{name:"Safari",group:"Safari",identifier:"Safari/([0-9.]*)",versionIdentifier:"Version/([0-9.]*)"}];e.default=i,t.exports=e.default},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=[{name:"Windows 2000",group:"Windows",identifier:"Windows NT 5.0",version:"5.0"},{name:"Windows XP",group:"Windows",identifier:"Windows NT 5.1",version:"5.1"},{name:"Windows Vista",group:"Windows",identifier:"Windows NT 6.0",version:"6.0"},{name:"Windows 7",group:"Windows",identifier:"Windows NT 6.1",version:"7.0"},{name:"Windows 8",group:"Windows",identifier:"Windows NT 6.2",version:"8.0"},{name:"Windows 8.1",group:"Windows",identifier:"Windows NT 6.3",version:"8.1"},{name:"Windows 10",group:"Windows",identifier:"Windows NT 10.0",version:"10.0"},{name:"Windows Phone",group:"Windows Phone",identifier:"Windows Phone ([0-9.]*)"},{name:"Windows Phone",group:"Windows Phone",identifier:"Windows Phone OS ([0-9.]*)"},{name:"Windows",group:"Windows",identifier:"Windows"},{name:"Chrome OS",group:"Chrome OS",identifier:"CrOS"},{name:"Android",group:"Android",identifier:"Android",versionIdentifier:"Android ([a-zA-Z0-9.-]*)"},{name:"iPad",group:"iOS",identifier:"iPad",versionIdentifier:"OS ([0-9_]*)",versionSeparator:"[_|.]"},{name:"iPod",group:"iOS",identifier:"iPod",versionIdentifier:"OS ([0-9_]*)",versionSeparator:"[_|.]"},{name:"iPhone",group:"iOS",identifier:"iPhone OS",versionIdentifier:"OS ([0-9_]*)",versionSeparator:"[_|.]"},{name:"Mac OS X High Sierra",group:"Mac OS",identifier:"Mac OS X (10([_|.])13([0-9_.]*))",versionSeparator:"[_|.]"},{name:"Mac OS X Sierra",group:"Mac OS",identifier:"Mac OS X (10([_|.])12([0-9_.]*))",versionSeparator:"[_|.]"},{name:"Mac OS X El Capitan",group:"Mac OS",identifier:"Mac OS X (10([_|.])11([0-9_.]*))",versionSeparator:"[_|.]"},{name:"Mac OS X Yosemite",group:"Mac OS",identifier:"Mac OS X (10([_|.])10([0-9_.]*))",versionSeparator:"[_|.]"},{name:"Mac OS X Mavericks",group:"Mac OS",identifier:"Mac OS X (10([_|.])9([0-9_.]*))",versionSeparator:"[_|.]"},{name:"Mac OS X Mountain Lion",group:"Mac OS",identifier:"Mac OS X (10([_|.])8([0-9_.]*))",versionSeparator:"[_|.]"},{name:"Mac OS X Lion",group:"Mac OS",identifier:"Mac OS X (10([_|.])7([0-9_.]*))",versionSeparator:"[_|.]"},{name:"Mac OS X Snow Leopard",group:"Mac OS",identifier:"Mac OS X (10([_|.])6([0-9_.]*))",versionSeparator:"[_|.]"},{name:"Mac OS X Leopard",group:"Mac OS",identifier:"Mac OS X (10([_|.])5([0-9_.]*))",versionSeparator:"[_|.]"},{name:"Mac OS X Tiger",group:"Mac OS",identifier:"Mac OS X (10([_|.])4([0-9_.]*))",versionSeparator:"[_|.]"},{name:"Mac OS X Panther",group:"Mac OS",identifier:"Mac OS X (10([_|.])3([0-9_.]*))",versionSeparator:"[_|.]"},{name:"Mac OS X Jaguar",group:"Mac OS",identifier:"Mac OS X (10([_|.])2([0-9_.]*))",versionSeparator:"[_|.]"},{name:"Mac OS X Puma",group:"Mac OS",identifier:"Mac OS X (10([_|.])1([0-9_.]*))",versionSeparator:"[_|.]"},{name:"Mac OS X Cheetah",group:"Mac OS",identifier:"Mac OS X (10([_|.])0([0-9_.]*))",versionSeparator:"[_|.]"},{name:"Mac OS",group:"Mac OS",identifier:"Mac OS"},{name:"Ubuntu",group:"Linux",identifier:"Ubuntu",versionIdentifier:"Ubuntu/([0-9.]*)"},{name:"Debian",group:"Linux",identifier:"Debian"},{name:"Gentoo",group:"Linux",identifier:"Gentoo"},{name:"Linux",group:"Linux",identifier:"Linux"},{name:"BlackBerry",group:"BlackBerry",identifier:"BlackBerry"}];e.default=i,t.exports=e.default},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=e.mp4="data:video/mp4;base64,AAAAHGZ0eXBpc29tAAACAGlzb21pc28ybXA0MQAAAAhmcmVlAAAC721kYXQhEAUgpBv/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA3pwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcCEQBSCkG//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADengAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcAAAAsJtb292AAAAbG12aGQAAAAAAAAAAAAAAAAAAAPoAAAALwABAAABAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAB7HRyYWsAAABcdGtoZAAAAAMAAAAAAAAAAAAAAAIAAAAAAAAALwAAAAAAAAAAAAAAAQEAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAACRlZHRzAAAAHGVsc3QAAAAAAAAAAQAAAC8AAAAAAAEAAAAAAWRtZGlhAAAAIG1kaGQAAAAAAAAAAAAAAAAAAKxEAAAIAFXEAAAAAAAtaGRscgAAAAAAAAAAc291bgAAAAAAAAAAAAAAAFNvdW5kSGFuZGxlcgAAAAEPbWluZgAAABBzbWhkAAAAAAAAAAAAAAAkZGluZgAAABxkcmVmAAAAAAAAAAEAAAAMdXJsIAAAAAEAAADTc3RibAAAAGdzdHNkAAAAAAAAAAEAAABXbXA0YQAAAAAAAAABAAAAAAAAAAAAAgAQAAAAAKxEAAAAAAAzZXNkcwAAAAADgICAIgACAASAgIAUQBUAAAAAAfQAAAHz+QWAgIACEhAGgICAAQIAAAAYc3R0cwAAAAAAAAABAAAAAgAABAAAAAAcc3RzYwAAAAAAAAABAAAAAQAAAAIAAAABAAAAHHN0c3oAAAAAAAAAAAAAAAIAAAFzAAABdAAAABRzdGNvAAAAAAAAAAEAAAAsAAAAYnVkdGEAAABabWV0YQAAAAAAAAAhaGRscgAAAAAAAAAAbWRpcmFwcGwAAAAAAAAAAAAAAAAtaWxzdAAAACWpdG9vAAAAHWRhdGEAAAABAAAAAExhdmY1Ni40MC4xMDE=";e.default={mp4:i}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(0),n=function(t){return t&&t.__esModule?t:{default:t}}(i),a=r(60),o="font-weight: bold; font-size: 13px;",s="color: #ff8000;"+o,l="color: #ff0000;"+o,u=1,d=3,c=["color: #0000ff;font-weight: bold; font-size: 13px;","color: #006600;font-weight: bold; font-size: 13px;",s,l,l],f=["debug","info","warn","error","disabled"],h=function(){function t(){var e=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:d;(0,n.default)(this,t),this.kibo=new a.Kibo,this.kibo.down(["ctrl shift d"],function(){return e.onOff()}),this.BLACKLIST=["timeupdate","playback:timeupdate","playback:progress","container:hover","container:timeupdate","container:progress"],this.level=r,this.offLevel=i}return t.prototype.debug=function(t){this.log(t,0,Array.prototype.slice.call(arguments,1))},t.prototype.info=function(t){this.log(t,u,Array.prototype.slice.call(arguments,1))},t.prototype.warn=function(t){this.log(t,2,Array.prototype.slice.call(arguments,1))},t.prototype.error=function(t){this.log(t,3,Array.prototype.slice.call(arguments,1))},t.prototype.onOff=function(){this.level===this.offLevel?this.level=this.previousLevel:(this.previousLevel=this.level,this.level=this.offLevel),window.console&&window.console.log&&window.console.log("%c[Clappr.Log] set log level to "+f[this.level],s)},t.prototype.level=function(t){this.level=t},t.prototype.log=function(t,e,r){if(!(this.BLACKLIST.indexOf(r[0])>=0||e<this.level)){r||(r=t,t=null);var i=c[e],n="";t&&(n="["+t+"]"),window.console&&window.console.log&&window.console.log.apply(console,["%c["+f[e]+"]"+n,i].concat(r))}},t}();e.default=h,h.LEVEL_DEBUG=0,h.LEVEL_INFO=u,h.LEVEL_WARN=2,h.LEVEL_ERROR=3,h.getInstance=function(){return void 0===this._instance&&(this._instance=new this,this._instance.previousLevel=this._instance.level,this._instance.level=this._instance.offLevel),this._instance},h.setLevel=function(t){this.getInstance().level=t},h.debug=function(){this.getInstance().debug.apply(this.getInstance(),arguments)},h.info=function(){this.getInstance().info.apply(this.getInstance(),arguments)},h.warn=function(){this.getInstance().warn.apply(this.getInstance(),arguments)},h.error=function(){this.getInstance().error.apply(this.getInstance(),arguments)},t.exports=e.default},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(t){this.element=t||window.document,this.initialize()};i.KEY_NAMES_BY_CODE={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"caps_lock",27:"esc",32:"space",37:"left",38:"up",39:"right",40:"down",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12"},i.KEY_CODES_BY_NAME={},function(){for(var t in i.KEY_NAMES_BY_CODE)Object.prototype.hasOwnProperty.call(i.KEY_NAMES_BY_CODE,t)&&(i.KEY_CODES_BY_NAME[i.KEY_NAMES_BY_CODE[t]]=+t)}(),i.MODIFIERS=["shift","ctrl","alt"],i.registerEvent=function(){return document.addEventListener?function(t,e,r){t.addEventListener(e,r,!1)}:document.attachEvent?function(t,e,r){t.attachEvent("on"+e,r)}:void 0}(),i.unregisterEvent=function(){return document.removeEventListener?function(t,e,r){t.removeEventListener(e,r,!1)}:document.detachEvent?function(t,e,r){t.detachEvent("on"+e,r)}:void 0}(),i.stringContains=function(t,e){return-1!==t.indexOf(e)},i.neatString=function(t){return t.replace(/^\s+|\s+$/g,"").replace(/\s+/g," ")},i.capitalize=function(t){return t.toLowerCase().replace(/^./,function(t){return t.toUpperCase()})},i.isString=function(t){return i.stringContains(Object.prototype.toString.call(t),"String")},i.arrayIncludes=function(){return Array.prototype.indexOf?function(t,e){return-1!==t.indexOf(e)}:function(t,e){for(var r=0;r<t.length;r++)if(t[r]===e)return!0;return!1}}(),i.extractModifiers=function(t){var e,r;for(e=[],r=0;r<i.MODIFIERS.length;r++)i.stringContains(t,i.MODIFIERS[r])&&e.push(i.MODIFIERS[r]);return e},i.extractKey=function(t){var e,r;for(e=i.neatString(t).split(" "),r=0;r<e.length;r++)if(!i.arrayIncludes(i.MODIFIERS,e[r]))return e[r]},i.modifiersAndKey=function(t){var e,r;return i.stringContains(t,"any")?i.neatString(t).split(" ").slice(0,2).join(" "):(e=i.extractModifiers(t),r=i.extractKey(t),r&&!i.arrayIncludes(i.MODIFIERS,r)&&e.push(r),e.join(" "))},i.keyName=function(t){return i.KEY_NAMES_BY_CODE[t+""]},i.keyCode=function(t){return+i.KEY_CODES_BY_NAME[t]},i.prototype.initialize=function(){var t,e=this;for(this.lastKeyCode=-1,this.lastModifiers={},t=0;t<i.MODIFIERS.length;t++)this.lastModifiers[i.MODIFIERS[t]]=!1;this.keysDown={any:[]},this.keysUp={any:[]},this.downHandler=this.handler("down"),this.upHandler=this.handler("up"),i.registerEvent(this.element,"keydown",this.downHandler),i.registerEvent(this.element,"keyup",this.upHandler),i.registerEvent(window,"unload",function t(){i.unregisterEvent(e.element,"keydown",e.downHandler),i.unregisterEvent(e.element,"keyup",e.upHandler),i.unregisterEvent(window,"unload",t)})},i.prototype.handler=function(t){var e=this;return function(r){var n,a,o;for(r=r||window.event,e.lastKeyCode=r.keyCode,n=0;n<i.MODIFIERS.length;n++)e.lastModifiers[i.MODIFIERS[n]]=r[i.MODIFIERS[n]+"Key"];for(i.arrayIncludes(i.MODIFIERS,i.keyName(e.lastKeyCode))&&(e.lastModifiers[i.keyName(e.lastKeyCode)]=!0),a=e["keys"+i.capitalize(t)],n=0;n<a.any.length;n++)!1===a.any[n](r)&&r.preventDefault&&r.preventDefault();if(o=e.lastModifiersAndKey(),a[o])for(n=0;n<a[o].length;n++)!1===a[o][n](r)&&r.preventDefault&&r.preventDefault()}},i.prototype.registerKeys=function(t,e,r){var n,a,o=this["keys"+i.capitalize(t)];for(i.isString(e)&&(e=[e]),n=0;n<e.length;n++)a=e[n],a=i.modifiersAndKey(a+""),o[a]?o[a].push(r):o[a]=[r];return this},i.prototype.unregisterKeys=function(t,e,r){var n,a,o,s=this["keys"+i.capitalize(t)];for(i.isString(e)&&(e=[e]),n=0;n<e.length;n++)if(o=e[n],o=i.modifiersAndKey(o+""),null===r)delete s[o];else if(s[o])for(a=0;a<s[o].length;a++)if(String(s[o][a])===String(r)){s[o].splice(a,1);break}return this},i.prototype.off=function(t){return this.unregisterKeys("down",t,null)},i.prototype.delegate=function(t,e,r){return null!==r||void 0!==r?this.registerKeys(t,e,r):this.unregisterKeys(t,e,r)},i.prototype.down=function(t,e){return this.delegate("down",t,e)},i.prototype.up=function(t,e){return this.delegate("up",t,e)},i.prototype.lastKey=function(t){return t?this.lastModifiers[t]:i.keyName(this.lastKeyCode)},i.prototype.lastModifiersAndKey=function(){var t,e;for(t=[],e=0;e<i.MODIFIERS.length;e++)this.lastKey(i.MODIFIERS[e])&&t.push(i.MODIFIERS[e]);return i.arrayIncludes(t,this.lastKey())||t.push(this.lastKey()),t.join(" ")},e.default=i,t.exports=e.default},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(151),n=function(t){return t&&t.__esModule?t:{default:t}}(i);e.default=n.default,t.exports=e.default},function(t,e,r){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=r(0),a=i(n),o=r(1),s=i(o),l=r(3),u=i(l),d=r(2),c=i(d),f=r(15),h=i(f),p=r(77),g=i(p),y=function(t){function e(r){(0,a.default)(this,e);var i=(0,s.default)(this,t.call(this));return i.player=r,i._options=r.options,i}return(0,c.default)(e,t),(0,u.default)(e,[{key:"loader",get:function(){return this.player.loader}}]),e.prototype.create=function(){return this.options.loader=this.loader,this.core=new g.default(this.options),this.addCorePlugins(),this.core.createContainers(this.options),this.core},e.prototype.addCorePlugins=function(){var t=this;return this.loader.corePlugins.forEach(function(e){var r=new e(t.core);t.core.addPlugin(r),t.setupExternalInterface(r)}),this.core},e.prototype.setupExternalInterface=function(t){var e=t.getExternalInterface();for(var r in e)this.player[r]=e[r].bind(t),this.core[r]=e[r].bind(t)},e}(h.default);e.default=y,t.exports=e.default},function(t,e,r){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=r(12),a=i(n),o=r(0),s=i(o),l=r(1),u=i(l),d=r(3),c=i(d),f=r(2),h=i(f),p=r(5),g=r(78),y=i(g),m=r(4),v=i(m),A=r(30),_=i(A),b=r(23),E=i(b),T=r(14),S=i(T),L=r(153),k=i(L),R=r(31),C=i(R),w=r(40),O=i(w),P=r(24),D=i(P),I=r(20),x=i(I),M=r(6),N=i(M);r(159);var F=r(161),B=i(F),U=void 0,j=function(t){function e(r){(0,s.default)(this,e);var i=(0,u.default)(this,t.call(this,r));return i.playerError=new D.default(r,i),i.configureDomRecycler(),i.playerInfo=O.default.getInstance(r.playerId),i.firstResize=!0,i.plugins=[],i.containers=[],i._boundFullscreenHandler=function(){return i.handleFullscreenChange()},(0,N.default)(document).bind("fullscreenchange",i._boundFullscreenHandler),(0,N.default)(document).bind("MSFullscreenChange",i._boundFullscreenHandler),(0,N.default)(document).bind("mozfullscreenchange",i._boundFullscreenHandler),S.default.isMobile&&(0,N.default)(window).bind("resize",function(t){i.handleWindowResize(t)}),i}return(0,h.default)(e,t),(0,c.default)(e,[{key:"events",get:function(){return{webkitfullscreenchange:"handleFullscreenChange",mousemove:"onMouseMove",mouseleave:"onMouseLeave"}}},{key:"attributes",get:function(){return{"data-player":"",tabindex:9999}}},{key:"isReady",get:function(){return!!this.ready}},{key:"i18n",get:function(){return this.getPlugin("strings")||{t:function(t){return t}}}},{key:"mediaControl",get:function(){return this.getPlugin("media_control")||this.dummyMediaControl}},{key:"dummyMediaControl",get:function(){return this._dummyMediaControl?this._dummyMediaControl:(this._dummyMediaControl=new E.default(this),this._dummyMediaControl)}},{key:"activeContainer",get:function(){return this._activeContainer},set:function(t){this._activeContainer=t,this.trigger(v.default.CORE_ACTIVE_CONTAINER_CHANGED,this._activeContainer)}},{key:"activePlayback",get:function(){return this.activeContainer&&this.activeContainer.playback}}]),e.prototype.configureDomRecycler=function(){var t=this.options&&this.options.playback&&this.options.playback.recycleVideo;p.DomRecycler.configure({recycleVideo:t})},e.prototype.createContainers=function(t){this.defer=N.default.Deferred(),this.defer.promise(this),this.containerFactory=new k.default(t,t.loader,this.i18n,this.playerError),this.prepareContainers()},e.prototype.prepareContainers=function(){var t=this;this.containerFactory.createContainers().then(function(e){return t.setupContainers(e)}).then(function(e){return t.resolveOnContainersReady(e)})},e.prototype.updateSize=function(){p.Fullscreen.isFullscreen()?this.setFullscreen():this.setPlayerSize()},e.prototype.setFullscreen=function(){S.default.isiOS||(this.$el.addClass("fullscreen"),this.$el.removeAttr("style"),this.playerInfo.previousSize={width:this.options.width,height:this.options.height},this.playerInfo.currentSize={width:(0,N.default)(window).width(),height:(0,N.default)(window).height()})},e.prototype.setPlayerSize=function(){this.$el.removeClass("fullscreen"),this.playerInfo.currentSize=this.playerInfo.previousSize,this.playerInfo.previousSize={width:(0,N.default)(window).width(),height:(0,N.default)(window).height()},this.resize(this.playerInfo.currentSize)},e.prototype.resize=function(t){(0,p.isNumber)(t.height)||(0,p.isNumber)(t.width)?(this.el.style.height=t.height+"px",this.el.style.width=t.width+"px"):(this.el.style.height=""+t.height,this.el.style.width=""+t.width),this.playerInfo.previousSize={width:this.options.width,height:this.options.height},this.options.width=t.width,this.options.height=t.height,this.playerInfo.currentSize=t,this.triggerResize(this.playerInfo.currentSize)},e.prototype.enableResizeObserver=function(){var t=this,e=function(){t.triggerResize({width:t.el.clientWidth,height:t.el.clientHeight})};this.resizeObserverInterval=setInterval(e,500)},e.prototype.triggerResize=function(t){(this.firstResize||this.oldHeight!==t.height||this.oldWidth!==t.width)&&(this.oldHeight=t.height,this.oldWidth=t.width,this.playerInfo.computedSize=t,this.firstResize=!1,C.default.trigger(this.options.playerId+":"+v.default.PLAYER_RESIZE,t),this.trigger(v.default.CORE_RESIZE,t))},e.prototype.disableResizeObserver=function(){this.resizeObserverInterval&&clearInterval(this.resizeObserverInterval)},e.prototype.resolveOnContainersReady=function(t){var e=this;N.default.when.apply(N.default,t).done(function(){e.defer.resolve(e),e.ready=!0,e.trigger(v.default.CORE_READY)})},e.prototype.addPlugin=function(t){this.plugins.push(t)},e.prototype.hasPlugin=function(t){return!!this.getPlugin(t)},e.prototype.getPlugin=function(t){return this.plugins.filter(function(e){return e.name===t})[0]},e.prototype.load=function(t,e){this.options.mimeType=e,t=t&&t.constructor===Array?t:[t],this.options.sources=t,this.containers.forEach(function(t){return t.destroy()}),this.containerFactory.options=N.default.extend(this.options,{sources:t}),this.prepareContainers()},e.prototype.destroy=function(){this.disableResizeObserver(),this.containers.forEach(function(t){return t.destroy()}),this.plugins.forEach(function(t){return t.destroy()}),this.$el.remove(),(0,N.default)(document).unbind("fullscreenchange",this._boundFullscreenHandler),(0,N.default)(document).unbind("MSFullscreenChange",this._boundFullscreenHandler),(0,N.default)(document).unbind("mozfullscreenchange",this._boundFullscreenHandler),this.stopListening()},e.prototype.handleFullscreenChange=function(){this.trigger(v.default.CORE_FULLSCREEN,p.Fullscreen.isFullscreen()),this.updateSize()},e.prototype.handleWindowResize=function(t){var e=window.innerWidth>window.innerHeight?"landscape":"portrait";this._screenOrientation!==e&&(this._screenOrientation=e,this.triggerResize({width:this.el.clientWidth,height:this.el.clientHeight}),this.trigger(v.default.CORE_SCREEN_ORIENTATION_CHANGED,{event:t,orientation:this._screenOrientation}))},e.prototype.removeContainer=function(t){this.stopListening(t),this.containers=this.containers.filter(function(e){return e!==t})},e.prototype.setupContainer=function(t){this.listenTo(t,v.default.CONTAINER_DESTROYED,this.removeContainer),this.containers.push(t)},e.prototype.setupContainers=function(t){return t.forEach(this.setupContainer.bind(this)),this.trigger(v.default.CORE_CONTAINERS_CREATED),this.renderContainers(),this.activeContainer=t[0],this.render(),this.appendToParent(),this.containers},e.prototype.renderContainers=function(){var t=this;this.containers.forEach(function(e){return t.el.appendChild(e.render().el)})},e.prototype.createContainer=function(t,e){var r=this.containerFactory.createContainer(t,e);return this.setupContainer(r),this.el.appendChild(r.render().el),r},e.prototype.getCurrentContainer=function(){return this.activeContainer},e.prototype.getCurrentPlayback=function(){return this.activePlayback},e.prototype.getPlaybackType=function(){return this.activeContainer&&this.activeContainer.getPlaybackType()},e.prototype.toggleFullscreen=function(){p.Fullscreen.isFullscreen()?(p.Fullscreen.cancelFullscreen(),!S.default.isiOS&&this.$el.removeClass("fullscreen nocursor")):(p.Fullscreen.requestFullscreen(S.default.isiOS?this.activeContainer.el:this.el),!S.default.isiOS&&this.$el.addClass("fullscreen"))},e.prototype.onMouseMove=function(t){this.trigger(v.default.CORE_MOUSE_MOVE,t)},e.prototype.onMouseLeave=function(t){this.trigger(v.default.CORE_MOUSE_LEAVE,t)},e.prototype.configure=function(t){var e=this;this._options=N.default.extend(this._options,t),this.configureDomRecycler();var r=t.source||t.sources;r&&this.load(r,t.mimeType||this.options.mimeType),this.trigger(v.default.CORE_OPTIONS_CHANGE),this.containers.forEach(function(t){return t.configure(e.options)})},e.prototype.appendToParent=function(){!(this.$el.parent()&&this.$el.parent().length)&&this.$el.appendTo(this.options.parentElement)},e.prototype.render=function(){U||(U=y.default.getStyleFor(B.default,{baseUrl:this.options.baseUrl})),(0,N.default)("head").append(U),this.options.width=this.options.width||this.$el.width(),this.options.height=this.options.height||this.$el.height();var t={width:this.options.width,height:this.options.height};return this.playerInfo.previousSize=this.playerInfo.currentSize=this.playerInfo.computedSize=t,this.updateSize(),this.previousSize={width:this.$el.width(),height:this.$el.height()},this.enableResizeObserver(),this},e}(_.default);e.default=j,(0,a.default)(j.prototype,x.default),t.exports=e.default},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(154),n=function(t){return t&&t.__esModule?t:{default:t}}(i);e.default=n.default,t.exports=e.default},function(t,e,r){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=r(39),a=i(n),o=r(0),s=i(o),l=r(1),u=i(l),d=r(3),c=i(d),f=r(2),h=i(f),p=r(15),g=i(p),y=r(4),m=i(y),v=r(80),A=i(v),_=r(6),b=i(_),E=function(t){function e(r,i,n,a){(0,s.default)(this,e);var o=(0,u.default)(this,t.call(this,r));return o._i18n=n,o.loader=i,o.playerError=a,o}return(0,h.default)(e,t),(0,c.default)(e,[{key:"options",get:function(){return this._options},set:function(t){this._options=t}}]),e.prototype.createContainers=function(){var t=this;return b.default.Deferred(function(e){e.resolve(t.options.sources.map(function(e){return t.createContainer(e)}))})},e.prototype.findPlaybackPlugin=function(t,e){return this.loader.playbackPlugins.filter(function(r){return r.canPlay(t,e)})[0]},e.prototype.createContainer=function(t){var e=null,r=this.options.mimeType;"object"===(void 0===t?"undefined":(0,a.default)(t))?(e=t.source.toString(),t.mimeType&&(r=t.mimeType)):e=t.toString(),e.match(/^\/\//)&&(e=window.location.protocol+e);var i=b.default.extend({},this.options,{src:e,mimeType:r}),n=this.findPlaybackPlugin(e,r),o=new n(i,this._i18n,this.playerError);i=b.default.extend({},i,{playback:o});var s=new A.default(i,this._i18n,this.playerError),l=b.default.Deferred();return l.promise(s),this.addContainerPlugins(s),this.listenToOnce(s,m.default.CONTAINER_READY,function(){return l.resolve(s)}),s},e.prototype.addContainerPlugins=function(t){this.loader.containerPlugins.forEach(function(e){t.addPlugin(new e(t))})},e}(g.default);e.default=E,t.exports=e.default},function(t,e,r){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=r(12),a=i(n),o=r(0),s=i(o),l=r(1),u=i(l),d=r(3),c=i(d),f=r(2),h=i(f),p=r(4),g=i(p),y=r(30),m=i(y),v=r(20),A=i(v);r(156);var _=r(6),b=i(_),E=function(t){function e(r,i,n){(0,s.default)(this,e);var a=(0,u.default)(this,t.call(this,r));return a._i18n=i,a.currentTime=0,a.volume=100,a.playback=r.playback,a.playerError=n,a.settings=b.default.extend({},a.playback.settings),a.isReady=!1,a.mediaControlDisabled=!1,a.plugins=[a.playback],a.bindEvents(),a}return(0,h.default)(e,t),(0,c.default)(e,[{key:"name",get:function(){return"Container"}},{key:"attributes",get:function(){return{class:"container","data-container":""}}},{key:"events",get:function(){return{click:"clicked",dblclick:"dblClicked",doubleTap:"dblClicked",contextmenu:"onContextMenu",mouseenter:"mouseEnter",mouseleave:"mouseLeave"}}},{key:"ended",get:function(){return this.playback.ended}},{key:"buffering",get:function(){return this.playback.buffering}},{key:"i18n",get:function(){return this._i18n}},{key:"hasClosedCaptionsTracks",get:function(){return this.playback.hasClosedCaptionsTracks}},{key:"closedCaptionsTracks",get:function(){return this.playback.closedCaptionsTracks}},{key:"closedCaptionsTrackId",get:function(){return this.playback.closedCaptionsTrackId},set:function(t){this.playback.closedCaptionsTrackId=t}}]),e.prototype.bindEvents=function(){this.listenTo(this.playback,g.default.PLAYBACK_PROGRESS,this.progress),this.listenTo(this.playback,g.default.PLAYBACK_TIMEUPDATE,this.timeUpdated),this.listenTo(this.playback,g.default.PLAYBACK_READY,this.ready),this.listenTo(this.playback,g.default.PLAYBACK_BUFFERING,this.onBuffering),this.listenTo(this.playback,g.default.PLAYBACK_BUFFERFULL,this.bufferfull),this.listenTo(this.playback,g.default.PLAYBACK_SETTINGSUPDATE,this.settingsUpdate),this.listenTo(this.playback,g.default.PLAYBACK_LOADEDMETADATA,this.loadedMetadata),this.listenTo(this.playback,g.default.PLAYBACK_HIGHDEFINITIONUPDATE,this.highDefinitionUpdate),this.listenTo(this.playback,g.default.PLAYBACK_BITRATE,this.updateBitrate),this.listenTo(this.playback,g.default.PLAYBACK_PLAYBACKSTATE,this.playbackStateChanged),this.listenTo(this.playback,g.default.PLAYBACK_DVR,this.playbackDvrStateChanged),this.listenTo(this.playback,g.default.PLAYBACK_MEDIACONTROL_DISABLE,this.disableMediaControl),this.listenTo(this.playback,g.default.PLAYBACK_MEDIACONTROL_ENABLE,this.enableMediaControl),this.listenTo(this.playback,g.default.PLAYBACK_SEEKED,this.onSeeked),this.listenTo(this.playback,g.default.PLAYBACK_ENDED,this.onEnded),this.listenTo(this.playback,g.default.PLAYBACK_PLAY,this.playing),this.listenTo(this.playback,g.default.PLAYBACK_PAUSE,this.paused),this.listenTo(this.playback,g.default.PLAYBACK_STOP,this.stopped),this.listenTo(this.playback,g.default.PLAYBACK_ERROR,this.error),this.listenTo(this.playback,g.default.PLAYBACK_SUBTITLE_AVAILABLE,this.subtitleAvailable),this.listenTo(this.playback,g.default.PLAYBACK_SUBTITLE_CHANGED,this.subtitleChanged)},e.prototype.subtitleAvailable=function(){this.trigger(g.default.CONTAINER_SUBTITLE_AVAILABLE)},e.prototype.subtitleChanged=function(t){this.trigger(g.default.CONTAINER_SUBTITLE_CHANGED,t)},e.prototype.playbackStateChanged=function(t){this.trigger(g.default.CONTAINER_PLAYBACKSTATE,t)},e.prototype.playbackDvrStateChanged=function(t){this.settings=this.playback.settings,this.dvrInUse=t,this.trigger(g.default.CONTAINER_PLAYBACKDVRSTATECHANGED,t)},e.prototype.updateBitrate=function(t){this.trigger(g.default.CONTAINER_BITRATE,t)},e.prototype.statsReport=function(t){this.trigger(g.default.CONTAINER_STATS_REPORT,t)},e.prototype.getPlaybackType=function(){return this.playback.getPlaybackType()},e.prototype.isDvrEnabled=function(){return!!this.playback.dvrEnabled},e.prototype.isDvrInUse=function(){return!!this.dvrInUse},e.prototype.destroy=function(){this.trigger(g.default.CONTAINER_DESTROYED,this,this.name),this.stopListening(),this.plugins.forEach(function(t){return t.destroy()}),this.$el.remove()},e.prototype.setStyle=function(t){this.$el.css(t)},e.prototype.animate=function(t,e){return this.$el.animate(t,e).promise()},e.prototype.ready=function(){this.isReady=!0,this.trigger(g.default.CONTAINER_READY,this.name)},e.prototype.isPlaying=function(){return this.playback.isPlaying()},e.prototype.getStartTimeOffset=function(){return this.playback.getStartTimeOffset()},e.prototype.getCurrentTime=function(){return this.currentTime},e.prototype.getDuration=function(){return this.playback.getDuration()},e.prototype.error=function(t){this.isReady||this.ready(),this.trigger(g.default.CONTAINER_ERROR,t,this.name)},e.prototype.loadedMetadata=function(t){this.trigger(g.default.CONTAINER_LOADEDMETADATA,t)},e.prototype.timeUpdated=function(t){this.currentTime=t.current,this.trigger(g.default.CONTAINER_TIMEUPDATE,t,this.name)},e.prototype.progress=function(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];this.trigger.apply(this,[g.default.CONTAINER_PROGRESS].concat(e,[this.name]))},e.prototype.playing=function(){this.trigger(g.default.CONTAINER_PLAY,this.name)},e.prototype.paused=function(){this.trigger(g.default.CONTAINER_PAUSE,this.name)},e.prototype.play=function(){this.playback.play()},e.prototype.stop=function(){this.playback.stop(),this.currentTime=0},e.prototype.pause=function(){this.playback.pause()},e.prototype.onEnded=function(){this.trigger(g.default.CONTAINER_ENDED,this,this.name),this.currentTime=0},e.prototype.stopped=function(){this.trigger(g.default.CONTAINER_STOP)},e.prototype.clicked=function(){this.options.chromeless&&!this.options.allowUserInteraction||this.trigger(g.default.CONTAINER_CLICK,this,this.name)},e.prototype.dblClicked=function(){this.options.chromeless&&!this.options.allowUserInteraction||this.trigger(g.default.CONTAINER_DBLCLICK,this,this.name)},e.prototype.onContextMenu=function(t){this.options.chromeless&&!this.options.allowUserInteraction||this.trigger(g.default.CONTAINER_CONTEXTMENU,t,this.name)},e.prototype.seek=function(t){this.trigger(g.default.CONTAINER_SEEK,t,this.name),this.playback.seek(t)},e.prototype.onSeeked=function(){this.trigger(g.default.CONTAINER_SEEKED,this.name)},e.prototype.seekPercentage=function(t){var e=this.getDuration();if(t>=0&&t<=100){var r=e*(t/100);this.seek(r)}},e.prototype.setVolume=function(t){this.volume=parseInt(t,10),this.trigger(g.default.CONTAINER_VOLUME,t,this.name),this.playback.volume(t)},e.prototype.fullscreen=function(){this.trigger(g.default.CONTAINER_FULLSCREEN,this.name)},e.prototype.onBuffering=function(){this.trigger(g.default.CONTAINER_STATE_BUFFERING,this.name)},e.prototype.bufferfull=function(){this.trigger(g.default.CONTAINER_STATE_BUFFERFULL,this.name)},e.prototype.addPlugin=function(t){this.plugins.push(t)},e.prototype.hasPlugin=function(t){return!!this.getPlugin(t)},e.prototype.getPlugin=function(t){return this.plugins.filter(function(e){return e.name===t})[0]},e.prototype.mouseEnter=function(){this.options.chromeless&&!this.options.allowUserInteraction||this.trigger(g.default.CONTAINER_MOUSE_ENTER)},e.prototype.mouseLeave=function(){this.options.chromeless&&!this.options.allowUserInteraction||this.trigger(g.default.CONTAINER_MOUSE_LEAVE)},e.prototype.settingsUpdate=function(){this.settings=this.playback.settings,this.trigger(g.default.CONTAINER_SETTINGSUPDATE)},e.prototype.highDefinitionUpdate=function(t){this.trigger(g.default.CONTAINER_HIGHDEFINITIONUPDATE,t)},e.prototype.isHighDefinitionInUse=function(){return this.playback.isHighDefinitionInUse()},e.prototype.disableMediaControl=function(){this.mediaControlDisabled||(this.mediaControlDisabled=!0,this.trigger(g.default.CONTAINER_MEDIACONTROL_DISABLE))},e.prototype.enableMediaControl=function(){this.mediaControlDisabled&&(this.mediaControlDisabled=!1,this.trigger(g.default.CONTAINER_MEDIACONTROL_ENABLE))},e.prototype.updateStyle=function(){!this.options.chromeless||this.options.allowUserInteraction?this.$el.removeClass("chromeless"):this.$el.addClass("chromeless")},e.prototype.configure=function(t){this._options=b.default.extend(this._options,t),this.updateStyle(),this.playback.configure(this.options),this.trigger(g.default.CONTAINER_OPTIONS_CHANGE)},e.prototype.render=function(){return this.$el.append(this.playback.render().el),this.updateStyle(),this},e}(m.default);e.default=E,(0,a.default)(E.prototype,A.default),t.exports=e.default},function(t,e,r){var i=r(157);"string"==typeof i&&(i=[[t.i,i,""]]);var n={singleton:!0,hmr:!0};n.transform=void 0,n.insertInto=void 0;r(9)(i,n);i.locals&&(t.exports=i.locals)},function(t,e,r){e=t.exports=r(8)(!1),e.push([t.i,".container[data-container]{position:absolute;background-color:#000;height:100%;width:100%}.container[data-container] .chromeless{cursor:default}[data-player]:not(.nocursor) .container[data-container]:not(.chromeless).pointer-enabled{cursor:pointer}",""])},function(t,e){t.exports=function(t){var e="undefined"!=typeof window&&window.location;if(!e)throw new Error("fixUrls requires window.location");if(!t||"string"!=typeof t)return t;var r=e.protocol+"//"+e.host,i=r+e.pathname.replace(/\/[^\/]*$/,"/");return t.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(t,e){var n=e.trim().replace(/^"(.*)"$/,function(t,e){return e}).replace(/^'(.*)'$/,function(t,e){return e});if(/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(n))return t;var a;return a=0===n.indexOf("//")?n:0===n.indexOf("/")?r+n:i+n.replace(/^\.\//,""),"url("+JSON.stringify(a)+")"})}},function(t,e,r){var i=r(160);"string"==typeof i&&(i=[[t.i,i,""]]);var n={singleton:!0,hmr:!0};n.transform=void 0,n.insertInto=void 0;r(9)(i,n);i.locals&&(t.exports=i.locals)},function(t,e,r){e=t.exports=r(8)(!1),e.push([t.i,'[data-player]{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-transform:translateZ(0);transform:translateZ(0);position:relative;margin:0;padding:0;border:0;font-style:normal;font-weight:400;text-align:center;overflow:hidden;font-size:100%;font-family:Roboto,Open Sans,Arial,sans-serif;text-shadow:0 0 0;box-sizing:border-box}[data-player] a,[data-player] abbr,[data-player] acronym,[data-player] address,[data-player] applet,[data-player] article,[data-player] aside,[data-player] audio,[data-player] b,[data-player] big,[data-player] blockquote,[data-player] canvas,[data-player] caption,[data-player] center,[data-player] cite,[data-player] code,[data-player] dd,[data-player] del,[data-player] details,[data-player] dfn,[data-player] div,[data-player] dl,[data-player] dt,[data-player] em,[data-player] embed,[data-player] fieldset,[data-player] figcaption,[data-player] figure,[data-player] footer,[data-player] form,[data-player] h1,[data-player] h2,[data-player] h3,[data-player] h4,[data-player] h5,[data-player] h6,[data-player] header,[data-player] hgroup,[data-player] i,[data-player] iframe,[data-player] img,[data-player] ins,[data-player] kbd,[data-player] label,[data-player] legend,[data-player] li,[data-player] mark,[data-player] menu,[data-player] nav,[data-player] object,[data-player] ol,[data-player] output,[data-player] p,[data-player] pre,[data-player] q,[data-player] ruby,[data-player] s,[data-player] samp,[data-player] section,[data-player] small,[data-player] span,[data-player] strike,[data-player] strong,[data-player] sub,[data-player] summary,[data-player] sup,[data-player] table,[data-player] tbody,[data-player] td,[data-player] tfoot,[data-player] th,[data-player] thead,[data-player] time,[data-player] tr,[data-player] tt,[data-player] u,[data-player] ul,[data-player] var,[data-player] video{margin:0;padding:0;border:0;font:inherit;font-size:100%;vertical-align:baseline}[data-player] table{border-collapse:collapse;border-spacing:0}[data-player] caption,[data-player] td,[data-player] th{text-align:left;font-weight:400;vertical-align:middle}[data-player] blockquote,[data-player] q{quotes:none}[data-player] blockquote:after,[data-player] blockquote:before,[data-player] q:after,[data-player] q:before{content:"";content:none}[data-player] a img{border:none}[data-player]:focus{outline:0}[data-player] *{max-width:none;box-sizing:inherit;float:none}[data-player] div{display:block}[data-player].fullscreen{width:100%!important;height:100%!important;top:0;left:0}[data-player].nocursor{cursor:none}.clappr-style{display:none!important}',""])},function(t,e,r){var i=r(81);e=t.exports=r(8)(!1),e.push([t.i,'@font-face{font-family:Roboto;font-style:normal;font-weight:400;src:local("Roboto"),local("Roboto-Regular"),url('+i(r(162))+') format("truetype")}',""])},function(t,e){t.exports="<%=baseUrl%>/38861cba61c66739c1452c3a71e39852.ttf"},function(t,e,r){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=r(76),a=i(n),o=r(61),s=i(o),l=r(0),u=i(l),d=r(1),c=i(d),f=r(2),h=i(f),p=r(15),g=i(p),y=r(40),m=i(y),v=r(41),A=i(v),_=r(84),b=i(_),E=r(85),T=i(E),S=r(86),L=i(S),k=r(87),R=i(k),C=r(89),w=i(C),O=r(90),P=i(O),D=r(91),I=i(D),x=r(200),M=i(x),N=r(92),F=i(N),B=r(93),U=i(B),j=r(210),G=i(j),K=r(94),V=i(K),Y=r(95),H=i(Y),$=r(98),W=i($),z=r(227),q=i(z),X=r(99),Z=i(X),Q=r(234),J=i(Q),tt=r(239),et=i(tt),rt=r(240),it=i(rt),nt=r(241),at=i(nt),ot=r(242),st=i(ot),lt=function(t){function e(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];(0,u.default)(this,e);var a=(0,c.default)(this,t.call(this));return a.playerId=i,a.playbackPlugins=[],n||(a.playbackPlugins=[].concat((0,s.default)(a.playbackPlugins),[R.default])),a.playbackPlugins=[].concat((0,s.default)(a.playbackPlugins),[A.default,T.default]),n||(a.playbackPlugins=[].concat((0,s.default)(a.playbackPlugins),[b.default,L.default])),a.playbackPlugins=[].concat((0,s.default)(a.playbackPlugins),[w.default,P.default]),a.containerPlugins=[I.default,F.default,U.default,M.default,G.default,V.default],a.corePlugins=[H.default,W.default,q.default,Z.default,J.default,et.default,it.default,st.default,at.default],Array.isArray(r)||a.validateExternalPluginsType(r),a.addExternalPlugins(r),a}return(0,h.default)(e,t),e.prototype.groupPluginsByType=function(t){return Array.isArray(t)&&(t=t.reduce(function(t,e){return t[e.type]||(t[e.type]=[]),t[e.type].push(e),t},{})),t},e.prototype.removeDups=function(t){var e=function(t,e){return t[e.prototype.name]&&delete t[e.prototype.name],t[e.prototype.name]=e,t},r=t.reduceRight(e,(0,a.default)(null)),i=[];for(var n in r)i.unshift(r[n]);return i},e.prototype.addExternalPlugins=function(t){t=this.groupPluginsByType(t),t.playback&&(this.playbackPlugins=this.removeDups(t.playback.concat(this.playbackPlugins))),t.container&&(this.containerPlugins=this.removeDups(t.container.concat(this.containerPlugins))),t.core&&(this.corePlugins=this.removeDups(t.core.concat(this.corePlugins))),m.default.getInstance(this.playerId).playbackPlugins=this.playbackPlugins},e.prototype.validateExternalPluginsType=function(t){["playback","container","core"].forEach(function(e){(t[e]||[]).forEach(function(t){var r="external "+t.type+" plugin on "+e+" array";if(t.type!==e)throw new ReferenceError(r)})})},e}(g.default);e.default=lt,t.exports=e.default},function(t,e,r){r(71),r(165),t.exports=r(11).Array.from},function(t,e,r){"use strict";var i=r(44),n=r(16),a=r(38),o=r(166),s=r(167),l=r(69),u=r(168),d=r(169);n(n.S+n.F*!r(171)(function(t){Array.from(t)}),"Array",{from:function(t){var e,r,n,c,f=a(t),h="function"==typeof this?this:Array,p=arguments.length,g=p>1?arguments[1]:void 0,y=void 0!==g,m=0,v=d(f);if(y&&(g=i(g,p>2?arguments[2]:void 0,2)),void 0==v||h==Array&&s(v))for(e=l(f.length),r=new h(e);e>m;m++)u(r,m,y?g(f[m],m):f[m]);else for(c=v.call(f),r=new h;!(n=c.next()).done;m++)u(r,m,y?o(c,g,[n.value,m],!0):n.value);return r.length=m,r}})},function(t,e,r){var i=r(26);t.exports=function(t,e,r,n){try{return n?e(i(r)[0],r[1]):e(r)}catch(e){var a=t.return;throw void 0!==a&&i(a.call(t)),e}}},function(t,e,r){var i=r(34),n=r(13)("iterator"),a=Array.prototype;t.exports=function(t){return void 0!==t&&(i.Array===t||a[n]===t)}},function(t,e,r){"use strict";var i=r(18),n=r(33);t.exports=function(t,e,r){e in t?i.f(t,e,n(0,r)):t[e]=r}},function(t,e,r){var i=r(170),n=r(13)("iterator"),a=r(34);t.exports=r(11).getIteratorMethod=function(t){if(void 0!=t)return t[n]||t["@@iterator"]||a[i(t)]}},function(t,e,r){var i=r(46),n=r(13)("toStringTag"),a="Arguments"==i(function(){return arguments}()),o=function(t,e){try{return t[e]}catch(t){}};t.exports=function(t){var e,r,s;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=o(e=Object(t),n))?r:a?i(e):"Object"==(s=i(e))&&"function"==typeof e.callee?"Arguments":s}},function(t,e,r){var i=r(13)("iterator"),n=!1;try{var a=[7][i]();a.return=function(){n=!0},Array.from(a,function(){throw 2})}catch(t){}t.exports=function(t,e){if(!e&&!n)return!1;var r=!1;try{var a=[7],o=a[i]();o.next=function(){return{done:r=!0}},a[i]=function(){return o},t(a)}catch(t){}return r}},function(t,e,r){"use strict";(function(i){function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var a=r(83),o=n(a),s=r(0),l=n(s),u=r(1),d=n(u),c=r(3),f=n(c),h=r(2),p=n(h),g=r(61),y=n(g),m=r(53),v=n(m),A=r(5),_=r(10),b=n(_),E=r(14),T=n(E),S=r(24),L=n(S),k=r(4),R=n(k),C=r(29),w=n(C),O=r(6),P=n(O),D=r(7),I=n(D),x=r(173),M=n(x);r(174);var N={mp4:["avc1.42E01E","avc1.58A01E","avc1.4D401E","avc1.64001E","mp4v.20.8","mp4v.20.240","mp4a.40.2"].map(function(t){return'video/mp4; codecs="'+t+', mp4a.40.2"'}),ogg:['video/ogg; codecs="theora, vorbis"','video/ogg; codecs="dirac"','video/ogg; codecs="theora, speex"'],"3gpp":['video/3gpp; codecs="mp4v.20.8, samr"'],webm:['video/webm; codecs="vp8, vorbis"'],mkv:['video/x-matroska; codecs="theora, vorbis"'],m3u8:["application/x-mpegurl"]};N.ogv=N.ogg,N["3gp"]=N["3gpp"];var F={wav:["audio/wav"],mp3:["audio/mp3",'audio/mpeg;codecs="mp3"'],aac:['audio/mp4;codecs="mp4a.40.5"'],oga:["audio/ogg"]},B=(0,v.default)(F).reduce(function(t,e){return[].concat((0,y.default)(t),(0,y.default)(F[e]))},[]),U={code:"unknown",message:"unknown"},j=function(t){function e(){(0,l.default)(this,e);for(var r=arguments.length,i=Array(r),n=0;n<r;n++)i[n]=arguments[n];var a=(0,d.default)(this,t.call.apply(t,[this].concat(i)));a._destroyed=!1,a._loadStarted=!1,a._isBuffering=!1,a._playheadMoving=!1,a._playheadMovingTimer=null,a._stopped=!1,a._ccTrackId=-1,a._setupSrc(a.options.src),a.options.playback||(a.options.playback=a.options||{}),a.options.playback.disableContextMenu=a.options.playback.disableContextMenu||a.options.disableVideoTagContextMenu;var o=a.options.playback,s=o.preload||(T.default.isSafari?"auto":a.options.preload),u=void 0;return a.options.poster&&("string"==typeof a.options.poster?u=a.options.poster:"string"==typeof a.options.poster.url&&(u=a.options.poster.url)),P.default.extend(a.el,{muted:a.options.mute,defaultMuted:a.options.mute,loop:a.options.loop,poster:u,preload:s||"metadata",controls:(o.controls||a.options.useVideoTagDefaultControls)&&"controls",crossOrigin:o.crossOrigin,"x-webkit-playsinline":o.playInline}),o.playInline&&a.$el.attr({playsinline:"playsinline"}),o.crossOrigin&&a.$el.attr({crossorigin:o.crossOrigin}),a.settings={default:["seekbar"]},a.settings.left=["playpause","position","duration"],a.settings.right=["fullscreen","volume","hd-indicator"],o.externalTracks&&a._setupExternalTracks(o.externalTracks),a.options.autoPlay&&a.attemptAutoPlay(),a}return(0,p.default)(e,t),(0,f.default)(e,[{key:"name",get:function(){return"html5_video"}},{key:"tagName",get:function(){return this.isAudioOnly?"audio":"video"}},{key:"isAudioOnly",get:function(){var t=this.options.src,r=e._mimeTypesForUrl(t,F,this.options.mimeType);return this.options.playback&&this.options.playback.audioOnly||this.options.audioOnly||B.indexOf(r[0])>=0}},{key:"attributes",get:function(){return{"data-html5-video":""}}},{key:"events",get:function(){return{canplay:"_onCanPlay",canplaythrough:"_handleBufferingEvents",durationchange:"_onDurationChange",ended:"_onEnded",error:"_onError",loadeddata:"_onLoadedData",loadedmetadata:"_onLoadedMetadata",pause:"_onPause",playing:"_onPlaying",progress:"_onProgress",seeking:"_onSeeking",seeked:"_onSeeked",stalled:"_handleBufferingEvents",timeupdate:"_onTimeUpdate",waiting:"_onWaiting"}}},{key:"ended",get:function(){return this.el.ended}},{key:"buffering",get:function(){return this._isBuffering}}]),e.prototype.attemptAutoPlay=function(){var t=this;this.canAutoPlay(function(e,r){r&&w.default.warn(t.name,"autoplay error.",{result:e,error:r}),e&&i.nextTick(function(){return!t._destroyed&&t.play()})})},e.prototype.canAutoPlay=function(t){this.options.disableCanAutoPlay&&t(!0,null);var e={timeout:this.options.autoPlayTimeout||500,inline:this.options.playback.playInline||!1,muted:this.options.mute||!1};T.default.isMobile&&A.DomRecycler.options.recycleVideo&&(e.element=this.el),(0,A.canAutoPlayMedia)(t,e)},e.prototype._setupExternalTracks=function(t){this._externalTracks=t.map(function(t){return{kind:t.kind||"subtitles",label:t.label,lang:t.lang,src:t.src}})},e.prototype._setupSrc=function(t){this.el.src!==t&&(this._ccIsSetup=!1,this.el.src=t,this._src=this.el.src)},e.prototype._onLoadedMetadata=function(t){this._handleBufferingEvents(),this.trigger(R.default.PLAYBACK_LOADEDMETADATA,{duration:t.target.duration,data:t}),this._updateSettings();var e=void 0===this._options.autoSeekFromUrl||this._options.autoSeekFromUrl;this.getPlaybackType()!==b.default.LIVE&&e&&this._checkInitialSeek()},e.prototype._onDurationChange=function(){this._updateSettings(),this._onTimeUpdate(),this._onProgress()},e.prototype._updateSettings=function(){this.getPlaybackType()===b.default.VOD||this.getPlaybackType()===b.default.AOD?this.settings.left=["playpause","position","duration"]:this.settings.left=["playstop"],this.settings.seekEnabled=this.isSeekEnabled(),this.trigger(R.default.PLAYBACK_SETTINGSUPDATE)},e.prototype.isSeekEnabled=function(){return isFinite(this.getDuration())},e.prototype.getPlaybackType=function(){var t="audio"===this.tagName?b.default.AOD:b.default.VOD;return[0,void 0,1/0].indexOf(this.el.duration)>=0?b.default.LIVE:t},e.prototype.isHighDefinitionInUse=function(){return!1},e.prototype.consent=function(){this.isPlaying()||(t.prototype.consent.call(this),this.el.load())},e.prototype.play=function(){this.trigger(R.default.PLAYBACK_PLAY_INTENT),this._stopped=!1,this._setupSrc(this._src),this._handleBufferingEvents();var t=this.el.play();t&&t.catch&&t.catch(function(){})},e.prototype.pause=function(){this.el.pause()},e.prototype.stop=function(){this.pause(),this._stopped=!0,this.el.removeAttribute("src"),this._stopPlayheadMovingChecks(),this._handleBufferingEvents(),this.trigger(R.default.PLAYBACK_STOP)},e.prototype.volume=function(t){0===t?(this.$el.attr({muted:"true"}),this.el.muted=!0):(this.$el.attr({muted:null}),this.el.muted=!1,this.el.volume=t/100)},e.prototype.mute=function(){this.el.muted=!0},e.prototype.unmute=function(){this.el.muted=!1},e.prototype.isMuted=function(){return!0===this.el.muted||0===this.el.volume},e.prototype.isPlaying=function(){return!this.el.paused&&!this.el.ended},e.prototype._startPlayheadMovingChecks=function(){null===this._playheadMovingTimer&&(this._playheadMovingTimeOnCheck=null,this._determineIfPlayheadMoving(),this._playheadMovingTimer=setInterval(this._determineIfPlayheadMoving.bind(this),500))},e.prototype._stopPlayheadMovingChecks=function(){null!==this._playheadMovingTimer&&(clearInterval(this._playheadMovingTimer),this._playheadMovingTimer=null,this._playheadMoving=!1)},e.prototype._determineIfPlayheadMoving=function(){var t=this._playheadMovingTimeOnCheck,e=this.el.currentTime;this._playheadMoving=t!==e,this._playheadMovingTimeOnCheck=e,this._handleBufferingEvents()},e.prototype._onWaiting=function(){this._loadStarted=!0,this._handleBufferingEvents()},e.prototype._onLoadedData=function(){this._loadStarted=!0,this._handleBufferingEvents()},e.prototype._onCanPlay=function(){this._handleBufferingEvents()},e.prototype._onPlaying=function(){this._checkForClosedCaptions(),this._startPlayheadMovingChecks(),this._handleBufferingEvents(),this.trigger(R.default.PLAYBACK_PLAY)},e.prototype._onPause=function(){this._stopPlayheadMovingChecks(),this._handleBufferingEvents(),this.trigger(R.default.PLAYBACK_PAUSE)},e.prototype._onSeeking=function(){this._handleBufferingEvents(),this.trigger(R.default.PLAYBACK_SEEK)},e.prototype._onSeeked=function(){this._handleBufferingEvents(),this.trigger(R.default.PLAYBACK_SEEKED)},e.prototype._onEnded=function(){this._handleBufferingEvents(),this.trigger(R.default.PLAYBACK_ENDED,this.name)},e.prototype._handleBufferingEvents=function(){var t=!this.el.ended&&!this.el.paused,e=this._loadStarted&&!this.el.ended&&!this._stopped&&(t&&!this._playheadMoving||this.el.readyState<this.el.HAVE_FUTURE_DATA);this._isBuffering!==e&&(this._isBuffering=e,e?this.trigger(R.default.PLAYBACK_BUFFERING,this.name):this.trigger(R.default.PLAYBACK_BUFFERFULL,this.name))},e.prototype._onError=function(){var t=this.el.error||U,e=t.code,r=t.message,i=e===U.code,n=this.createError({code:e,description:r,raw:this.el.error,level:i?L.default.Levels.WARN:L.default.Levels.FATAL});i?w.default.warn(this.name,"HTML5 unknown error: ",n):this.trigger(R.default.PLAYBACK_ERROR,n)},e.prototype.destroy=function(){this._destroyed=!0,this.handleTextTrackChange&&this.el.textTracks.removeEventListener("change",this.handleTextTrackChange),t.prototype.destroy.call(this),this.el.removeAttribute("src"),this._src=null,A.DomRecycler.garbage(this.$el)},e.prototype.seek=function(t){this.el.currentTime=t},e.prototype.seekPercentage=function(t){var e=this.el.duration*(t/100);this.seek(e)},e.prototype._checkInitialSeek=function(){var t=(0,A.seekStringToSeconds)();0!==t&&this.seek(t)},e.prototype.getCurrentTime=function(){return this.el.currentTime},e.prototype.getDuration=function(){return this.el.duration},e.prototype._onTimeUpdate=function(){this.getPlaybackType()===b.default.LIVE?this.trigger(R.default.PLAYBACK_TIMEUPDATE,{current:1,total:1},this.name):this.trigger(R.default.PLAYBACK_TIMEUPDATE,{current:this.el.currentTime,total:this.el.duration},this.name)},e.prototype._onProgress=function(){if(this.el.buffered.length){for(var t=[],e=0,r=0;r<this.el.buffered.length;r++)t=[].concat((0,y.default)(t),[{start:this.el.buffered.start(r),end:this.el.buffered.end(r)}]),this.el.currentTime>=t[r].start&&this.el.currentTime<=t[r].end&&(e=r);var i={start:t[e].start,current:t[e].end,total:this.el.duration};this.trigger(R.default.PLAYBACK_PROGRESS,i,t)}},e.prototype._typeFor=function(t){var r=e._mimeTypesForUrl(t,N,this.options.mimeType);return 0===r.length&&(r=e._mimeTypesForUrl(t,F,this.options.mimeType)),(r[0]||"").split(";")[0]},e.prototype._ready=function(){this._isReadyState||(this._isReadyState=!0,this.trigger(R.default.PLAYBACK_READY,this.name))},e.prototype._checkForClosedCaptions=function(){if(this.isHTML5Video&&!this._ccIsSetup){if(this.hasClosedCaptionsTracks){this.trigger(R.default.PLAYBACK_SUBTITLE_AVAILABLE);var t=this.closedCaptionsTrackId;this.closedCaptionsTrackId=t,this.handleTextTrackChange=this._handleTextTrackChange.bind(this),this.el.textTracks.addEventListener("change",this.handleTextTrackChange)}this._ccIsSetup=!0}},e.prototype._handleTextTrackChange=function(){var t=this.closedCaptionsTracks,e=t.find(function(t){return"showing"===t.track.mode})||{id:-1};this._ccTrackId!==e.id&&(this._ccTrackId=e.id,this.trigger(R.default.PLAYBACK_SUBTITLE_CHANGED,{id:e.id}))},e.prototype.render=function(){return this.options.playback.disableContextMenu&&this.$el.on("contextmenu",function(){return!1}),this._externalTracks&&this._externalTracks.length>0&&this.$el.html(this.template({tracks:this._externalTracks})),this._ready(),this},(0,f.default)(e,[{key:"isReady",get:function(){return this._isReadyState}},{key:"isHTML5Video",get:function(){return this.name===e.prototype.name}},{key:"closedCaptionsTracks",get:function(){var t=0,e=function(){return t++};return(this.el.textTracks?(0,o.default)(this.el.textTracks):[]).filter(function(t){return"subtitles"===t.kind||"captions"===t.kind}).map(function(t){return{id:e(),name:t.label,track:t}})}},{key:"closedCaptionsTrackId",get:function(){return this._ccTrackId},set:function(t){if((0,A.isNumber)(t)){var e=this.closedCaptionsTracks,r=void 0;if(-1!==t){if(!(r=e.find(function(e){return e.id===t})))return;if("showing"===r.track.mode)return}e.filter(function(t){return"hidden"!==t.track.mode}).forEach(function(t){return t.track.mode="hidden"}),r&&(r.track.mode="showing"),this._ccTrackId=t,this.trigger(R.default.PLAYBACK_SUBTITLE_CHANGED,{id:t})}}},{key:"template",get:function(){return(0,I.default)(M.default)}}]),e}(b.default);e.default=j,j._mimeTypesForUrl=function(t,e,r){var i=(t.split("?")[0].match(/.*\.(.*)$/)||[])[1],n=r||i&&e[i.toLowerCase()]||[];return n.constructor===Array?n:[n]},j._canPlay=function(t,e,r,i){var n=j._mimeTypesForUrl(r,e,i),a=document.createElement(t);return!!n.filter(function(t){return!!a.canPlayType(t).replace(/no/,"")})[0]},j.canPlay=function(t,e){return j._canPlay("audio",F,t,e)||j._canPlay("video",N,t,e)},t.exports=e.default}).call(e,r(62))},function(t,e){t.exports='<% for (var i = 0; i < tracks.length; i++) { %>\n <track data-html5-video-track="<%= i %>" kind="<%= tracks[i].kind %>" label="<%= tracks[i].label %>" srclang="<%= tracks[i].lang %>" src="<%= tracks[i].src %>" />\n<% }; %>\n'},function(t,e,r){var i=r(175);"string"==typeof i&&(i=[[t.i,i,""]]);var n={singleton:!0,hmr:!0};n.transform=void 0,n.insertInto=void 0;r(9)(i,n);i.locals&&(t.exports=i.locals)},function(t,e,r){e=t.exports=r(8)(!1),e.push([t.i,"[data-html5-video]{position:absolute;height:100%;width:100%;display:block}",""])},function(t,e,r){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=r(0),a=i(n),o=r(1),s=i(o),l=r(3),u=i(l),d=r(2),c=i(d),f=r(5),h=r(63),p=i(h),g=r(14),y=i(g),m=r(31),v=i(m),A=r(7),_=i(A),b=r(6),E=i(b),T=r(4),S=i(T),L=r(10),k=i(L),R=r(181),C=i(R),w=function(t){function e(){(0,a.default)(this,e);for(var r=arguments.length,i=Array(r),n=0;n<r;n++)i[n]=arguments[n];var o=(0,s.default)(this,t.call.apply(t,[this].concat(i)));return o._src=o.options.src,o._baseUrl=o.options.baseUrl,o._autoPlay=o.options.autoPlay,o.settings={default:["seekbar"]},o.settings.left=["playpause","position","duration"],o.settings.right=["fullscreen","volume"],o.settings.seekEnabled=!0,o._isReadyState=!1,o._addListeners(),o}return(0,c.default)(e,t),(0,u.default)(e,[{key:"name",get:function(){return"flash"}},{key:"swfPath",get:function(){return(0,_.default)(C.default)({baseUrl:this._baseUrl})}},{key:"ended",get:function(){return"ENDED"===this._currentState}},{key:"buffering",get:function(){return!!this._bufferingState&&"ENDED"!==this._currentState}}]),e.prototype._bootstrap=function(){var t=this;this.el.playerPlay?(this.el.width="100%",this.el.height="100%","PLAYING"===this._currentState?this._firstPlay():(this._currentState="IDLE",this._autoPlay&&this.play()),(0,E.default)('<div style="position: absolute; top: 0; left: 0; width: 100%; height: 100%" />').insertAfter(this.$el),this.getDuration()>0?this._metadataLoaded():v.default.once(this.uniqueId+":timeupdate",this._metadataLoaded,this)):(this._attempts=this._attempts||0,++this._attempts<=60?setTimeout(function(){return t._bootstrap()},50):this.trigger(S.default.PLAYBACK_ERROR,{message:"Max number of attempts reached"},this.name))},e.prototype._metadataLoaded=function(){this._isReadyState=!0,this.trigger(S.default.PLAYBACK_READY,this.name),this.trigger(S.default.PLAYBACK_SETTINGSUPDATE,this.name)},e.prototype.getPlaybackType=function(){return k.default.VOD},e.prototype.isHighDefinitionInUse=function(){return!1},e.prototype._updateTime=function(){this.trigger(S.default.PLAYBACK_TIMEUPDATE,{current:this.el.getPosition(),total:this.el.getDuration()},this.name)},e.prototype._addListeners=function(){v.default.on(this.uniqueId+":progress",this._progress,this),v.default.on(this.uniqueId+":timeupdate",this._updateTime,this),v.default.on(this.uniqueId+":statechanged",this._checkState,this),v.default.on(this.uniqueId+":flashready",this._bootstrap,this)},e.prototype.stopListening=function(){t.prototype.stopListening.call(this),v.default.off(this.uniqueId+":progress"),v.default.off(this.uniqueId+":timeupdate"),v.default.off(this.uniqueId+":statechanged"),v.default.off(this.uniqueId+":flashready")},e.prototype._checkState=function(){this._isIdle||"PAUSED"===this._currentState||("PLAYING_BUFFERING"!==this._currentState&&"PLAYING_BUFFERING"===this.el.getState()?(this._bufferingState=!0,this.trigger(S.default.PLAYBACK_BUFFERING,this.name),this._currentState="PLAYING_BUFFERING"):"PLAYING"===this.el.getState()?(this._bufferingState=!1,this.trigger(S.default.PLAYBACK_BUFFERFULL,this.name),this._currentState="PLAYING"):"IDLE"===this.el.getState()?this._currentState="IDLE":"ENDED"===this.el.getState()&&(this.trigger(S.default.PLAYBACK_ENDED,this.name),this.trigger(S.default.PLAYBACK_TIMEUPDATE,{current:0,total:this.el.getDuration()},this.name),this._currentState="ENDED",this._isIdle=!0))},e.prototype._progress=function(){"IDLE"!==this._currentState&&"ENDED"!==this._currentState&&this.trigger(S.default.PLAYBACK_PROGRESS,{start:0,current:this.el.getBytesLoaded(),total:this.el.getBytesTotal()})},e.prototype._firstPlay=function(){var t=this;this.el.playerPlay?(this._isIdle=!1,this.el.playerPlay(this._src),this.listenToOnce(this,S.default.PLAYBACK_BUFFERFULL,function(){return t._checkInitialSeek()}),this._currentState="PLAYING"):this.listenToOnce(this,S.default.PLAYBACK_READY,this._firstPlay)},e.prototype._checkInitialSeek=function(){var t=(0,f.seekStringToSeconds)(window.location.href);0!==t&&this.seekSeconds(t)},e.prototype.play=function(){this.trigger(S.default.PLAYBACK_PLAY_INTENT),"PAUSED"===this._currentState||"PLAYING_BUFFERING"===this._currentState?(this._currentState="PLAYING",this.el.playerResume(),this.trigger(S.default.PLAYBACK_PLAY,this.name)):"PLAYING"!==this._currentState&&(this._firstPlay(),this.trigger(S.default.PLAYBACK_PLAY,this.name))},e.prototype.volume=function(t){var e=this;this.isReady?this.el.playerVolume(t):this.listenToOnce(this,S.default.PLAYBACK_BUFFERFULL,function(){return e.volume(t)})},e.prototype.pause=function(){this._currentState="PAUSED",this.el.playerPause(),this.trigger(S.default.PLAYBACK_PAUSE,this.name)},e.prototype.stop=function(){this.el.playerStop(),this.trigger(S.default.PLAYBACK_STOP),this.trigger(S.default.PLAYBACK_TIMEUPDATE,{current:0,total:0},this.name)},e.prototype.isPlaying=function(){return!!(this.isReady&&this._currentState.indexOf("PLAYING")>-1)},e.prototype.getDuration=function(){return this.el.getDuration()},e.prototype.seekPercentage=function(t){var e=this;if(this.el.getDuration()>0){var r=this.el.getDuration()*(t/100);this.seek(r)}else this.listenToOnce(this,S.default.PLAYBACK_BUFFERFULL,function(){return e.seekPercentage(t)})},e.prototype.seek=function(t){var e=this;this.isReady&&this.el.playerSeek?(this.el.playerSeek(t),this.trigger(S.default.PLAYBACK_TIMEUPDATE,{current:t,total:this.el.getDuration()},this.name),"PAUSED"===this._currentState&&this.el.playerPause()):this.listenToOnce(this,S.default.PLAYBACK_BUFFERFULL,function(){return e.seek(t)})},e.prototype.destroy=function(){clearInterval(this.bootstrapId),t.prototype.stopListening.call(this),this.$el.remove()},(0,u.default)(e,[{key:"isReady",get:function(){return this._isReadyState}}]),e}(p.default);e.default=w,w.canPlay=function(t){if(y.default.hasFlash&&t&&t.constructor===String){var e=t.split("?")[0].match(/.*\.(.*)$/)||[];return e.length>1&&!y.default.isMobile&&e[1].toLowerCase().match(/^(mp4|mov|f4v|3gpp|3gp)$/)}return!1},t.exports=e.default},function(t,e,r){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=r(0),a=i(n),o=r(3),s=i(o),l=r(1),u=i(l),d=r(2),c=i(d),f=r(10),h=i(f),p=r(7),g=i(p),y=r(14),m=i(y),v=r(178),A=i(v);r(179);var _=function(t){function e(){return(0,a.default)(this,e),(0,u.default)(this,t.apply(this,arguments))}return(0,c.default)(e,t),e.prototype.setElement=function(t){this.$el=t,this.el=t[0]},e.prototype.render=function(){return this.$el.attr("data",this.swfPath),this.$el.html(this.template({cid:this.cid,swfPath:this.swfPath,baseUrl:this.baseUrl,playbackId:this.uniqueId,wmode:this.wmode,callbackName:"window.Clappr.flashlsCallbacks."+this.cid})),m.default.isIE&&(this.$("embed").remove(),m.default.isLegacyIE&&this.$el.attr("classid","clsid:d27cdb6e-ae6d-11cf-96b8-444553540000")),this.el.id=this.cid,this},(0,s.default)(e,[{key:"tagName",get:function(){return"object"}},{key:"swfPath",get:function(){return""}},{key:"wmode",get:function(){return"transparent"}},{key:"template",get:function(){return(0,g.default)(A.default)}},{key:"attributes",get:function(){var t="application/x-shockwave-flash";return m.default.isLegacyIE&&(t=""),{class:"clappr-flash-playback",type:t,width:"100%",height:"100%",data:this.swfPath,"data-flash-playback":this.name}}}]),e}(h.default);e.default=_,t.exports=e.default},function(t,e){t.exports='<param name="movie" value="<%= swfPath %>">\n<param name="quality" value="autohigh">\n<param name="swliveconnect" value="true">\n<param name="allowScriptAccess" value="always">\n<param name="bgcolor" value="#000000">\n<param name="allowFullScreen" value="false">\n<param name="wmode" value="<%= wmode %>">\n<param name="tabindex" value="1">\n<param name="FlashVars" value="playbackId=<%= playbackId %>&callback=<%= callbackName %>">\n<embed\n name="<%= cid %>"\n type="application/x-shockwave-flash"\n disabled="disabled"\n tabindex="-1"\n enablecontextmenu="false"\n allowScriptAccess="always"\n quality="autohigh"\n pluginspage="http://www.macromedia.com/go/getflashplayer"\n wmode="<%= wmode %>"\n swliveconnect="true"\n allowfullscreen="false"\n bgcolor="#000000"\n FlashVars="playbackId=<%= playbackId %>&callback=<%= callbackName %>"\n data="<%= swfPath %>"\n src="<%= swfPath %>"\n width="100%"\n height="100%">\n</embed>\n'},function(t,e,r){var i=r(180);"string"==typeof i&&(i=[[t.i,i,""]]);var n={singleton:!0,hmr:!0};n.transform=void 0,n.insertInto=void 0;r(9)(i,n);i.locals&&(t.exports=i.locals)},function(t,e,r){e=t.exports=r(8)(!1),e.push([t.i,".clappr-flash-playback[data-flash-playback]{display:block;position:absolute;top:0;left:0;height:100%;width:100%;pointer-events:none}",""])},function(t,e){t.exports="<%=baseUrl%>/4b76590b32dab62bc95c1b7951efae78.swf"},function(t,e,r){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=r(0),a=i(n),o=r(3),s=i(o),l=r(1),u=i(l),d=r(2),c=i(d),f=r(4),h=i(f),p=r(10),g=i(p),y=r(41),m=i(y),v=function(t){function e(){return(0,a.default)(this,e),(0,u.default)(this,t.apply(this,arguments))}return(0,c.default)(e,t),e.prototype.updateSettings=function(){this.settings.left=["playpause","position","duration"],this.settings.seekEnabled=this.isSeekEnabled(),this.trigger(h.default.PLAYBACK_SETTINGSUPDATE)},e.prototype.getPlaybackType=function(){return g.default.AOD},(0,s.default)(e,[{key:"name",get:function(){return"html5_audio"}},{key:"tagName",get:function(){return"audio"}},{key:"isAudioOnly",get:function(){return!0}}]),e}(m.default);e.default=v,v.canPlay=function(t,e){var r={wav:["audio/wav"],mp3:["audio/mp3",'audio/mpeg;codecs="mp3"'],aac:['audio/mp4;codecs="mp4a.40.5"'],oga:["audio/ogg"]};return m.default._canPlay("audio",r,t,e)},t.exports=e.default},function(t,e,r){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=r(0),a=i(n),o=r(1),s=i(o),l=r(3),u=i(l),d=r(2),c=i(d),f=r(63),h=i(f),p=r(4),g=i(p),y=r(7),m=i(y),v=r(10),A=i(v),_=r(31),b=i(_),E=r(14),T=i(E),S=r(24),L=i(S),k=r(184),R=i(k),C=r(185),w=i(C),O=r(6),P=i(O),D=function(t){function e(){(0,a.default)(this,e);for(var r=arguments.length,i=Array(r),n=0;n<r;n++)i[n]=arguments[n];var o=(0,s.default)(this,t.call.apply(t,[this].concat(i)));return o._src=o.options.src,o._baseUrl=o.options.baseUrl,o._initHlsParameters(o.options),o.highDefinition=!1,o._autoPlay=o.options.autoPlay,o._loop=o.options.loop,o._defaultSettings={left:["playstop"],default:["seekbar"],right:["fullscreen","volume","hd-indicator"],seekEnabled:!1},o.settings=P.default.extend({},o._defaultSettings),o._playbackType=A.default.LIVE,o._hasEnded=!1,o._addListeners(),o}return(0,c.default)(e,t),(0,u.default)(e,[{key:"name",get:function(){return"flashls"}},{key:"swfPath",get:function(){return(0,m.default)(w.default)({baseUrl:this._baseUrl})}},{key:"levels",get:function(){return this._levels||[]}},{key:"currentLevel",get:function(){return null===this._currentLevel||void 0===this._currentLevel?-1:this._currentLevel},set:function(t){this._currentLevel=t,this.trigger(g.default.PLAYBACK_LEVEL_SWITCH_START),this.el.playerSetCurrentLevel(t)}},{key:"ended",get:function(){return this._hasEnded}},{key:"buffering",get:function(){return!!this._bufferingState&&!this._hasEnded}}]),e.prototype._initHlsParameters=function(t){this._autoStartLoad=void 0===t.autoStartLoad||t.autoStartLoad,this._capLevelToStage=void 0!==t.capLevelToStage&&t.capLevelToStage,this._maxLevelCappingMode=void 0===t.maxLevelCappingMode?"downscale":t.maxLevelCappingMode,this._minBufferLength=void 0===t.minBufferLength?-1:t.minBufferLength,this._minBufferLengthCapping=void 0===t.minBufferLengthCapping?-1:t.minBufferLengthCapping,this._maxBufferLength=void 0===t.maxBufferLength?120:t.maxBufferLength,this._maxBackBufferLength=void 0===t.maxBackBufferLength?30:t.maxBackBufferLength,this._lowBufferLength=void 0===t.lowBufferLength?3:t.lowBufferLength,this._mediaTimePeriod=void 0===t.mediaTimePeriod?100:t.mediaTimePeriod,this._fpsDroppedMonitoringPeriod=void 0===t.fpsDroppedMonitoringPeriod?5e3:t.fpsDroppedMonitoringPeriod,this._fpsDroppedMonitoringThreshold=void 0===t.fpsDroppedMonitoringThreshold?.2:t.fpsDroppedMonitoringThreshold,this._capLevelonFPSDrop=void 0!==t.capLevelonFPSDrop&&t.capLevelonFPSDrop,this._smoothAutoSwitchonFPSDrop=void 0===t.smoothAutoSwitchonFPSDrop?this.capLevelonFPSDrop:t.smoothAutoSwitchonFPSDrop,this._switchDownOnLevelError=void 0===t.switchDownOnLevelError||t.switchDownOnLevelError,this._seekMode=void 0===t.seekMode?"ACCURATE":t.seekMode,this._keyLoadMaxRetry=void 0===t.keyLoadMaxRetry?3:t.keyLoadMaxRetry,this._keyLoadMaxRetryTimeout=void 0===t.keyLoadMaxRetryTimeout?64e3:t.keyLoadMaxRetryTimeout,this._fragmentLoadMaxRetry=void 0===t.fragmentLoadMaxRetry?3:t.fragmentLoadMaxRetry,this._fragmentLoadMaxRetryTimeout=void 0===t.fragmentLoadMaxRetryTimeout?4e3:t.fragmentLoadMaxRetryTimeout,this._fragmentLoadSkipAfterMaxRetry=void 0===t.fragmentLoadSkipAfterMaxRetry||t.fragmentLoadSkipAfterMaxRetry,this._maxSkippedFragments=void 0===t.maxSkippedFragments?5:t.maxSkippedFragments,this._flushLiveURLCache=void 0!==t.flushLiveURLCache&&t.flushLiveURLCache,this._initialLiveManifestSize=void 0===t.initialLiveManifestSize?1:t.initialLiveManifestSize,this._manifestLoadMaxRetry=void 0===t.manifestLoadMaxRetry?3:t.manifestLoadMaxRetry,this._manifestLoadMaxRetryTimeout=void 0===t.manifestLoadMaxRetryTimeout?64e3:t.manifestLoadMaxRetryTimeout,this._manifestRedundantLoadmaxRetry=void 0===t.manifestRedundantLoadmaxRetry?3:t.manifestRedundantLoadmaxRetry,this._startFromBitrate=void 0===t.startFromBitrate?-1:t.startFromBitrate,this._startFromLevel=void 0===t.startFromLevel?-1:t.startFromLevel,this._autoStartMaxDuration=void 0===t.autoStartMaxDuration?-1:t.autoStartMaxDuration,this._seekFromLevel=void 0===t.seekFromLevel?-1:t.seekFromLevel,this._useHardwareVideoDecoder=void 0!==t.useHardwareVideoDecoder&&t.useHardwareVideoDecoder,this._hlsLogEnabled=void 0===t.hlsLogEnabled||t.hlsLogEnabled,this._logDebug=void 0!==t.logDebug&&t.logDebug,this._logDebug2=void 0!==t.logDebug2&&t.logDebug2,this._logWarn=void 0===t.logWarn||t.logWarn,this._logError=void 0===t.logError||t.logError,this._hlsMinimumDvrSize=void 0===t.hlsMinimumDvrSize?60:t.hlsMinimumDvrSize},e.prototype._addListeners=function(){var t=this;b.default.on(this.cid+":flashready",function(){return t._bootstrap()}),b.default.on(this.cid+":timeupdate",function(e){return t._updateTime(e)}),b.default.on(this.cid+":playbackstate",function(e){return t._setPlaybackState(e)}),b.default.on(this.cid+":levelchanged",function(e){return t._levelChanged(e)}),b.default.on(this.cid+":error",function(e,r,i){return t._flashPlaybackError(e,r,i)}),b.default.on(this.cid+":fragmentloaded",function(e){return t._onFragmentLoaded(e)}),b.default.on(this.cid+":levelendlist",function(e){return t._onLevelEndlist(e)})},e.prototype.stopListening=function(){t.prototype.stopListening.call(this),b.default.off(this.cid+":flashready"),b.default.off(this.cid+":timeupdate"),b.default.off(this.cid+":playbackstate"),b.default.off(this.cid+":levelchanged"),b.default.off(this.cid+":playbackerror"),b.default.off(this.cid+":fragmentloaded"),b.default.off(this.cid+":manifestloaded"),b.default.off(this.cid+":levelendlist")},e.prototype._bootstrap=function(){var t=this;if(this.el.playerLoad)this.el.width="100%",this.el.height="100%",this._isReadyState=!0,this._srcLoaded=!1,this._currentState="IDLE",this._setFlashSettings(),this._updatePlaybackType(),(this._autoPlay||this._shouldPlayOnManifestLoaded)&&this.play(),this.trigger(g.default.PLAYBACK_READY,this.name);else if(this._bootstrapAttempts=this._bootstrapAttempts||0,++this._bootstrapAttempts<=60)setTimeout(function(){return t._bootstrap()},50);else{var e=this.createError({code:"playerLoadFail_maxNumberAttemptsReached",description:this.name+" error: Max number of attempts reached",level:L.default.Levels.FATAL,raw:{}});this.trigger(g.default.PLAYBACK_ERROR,e)}},e.prototype._setFlashSettings=function(){this.el.playerSetAutoStartLoad(this._autoStartLoad),this.el.playerSetCapLevelToStage(this._capLevelToStage),this.el.playerSetMaxLevelCappingMode(this._maxLevelCappingMode),this.el.playerSetMinBufferLength(this._minBufferLength),this.el.playerSetMinBufferLengthCapping(this._minBufferLengthCapping),this.el.playerSetMaxBufferLength(this._maxBufferLength),this.el.playerSetMaxBackBufferLength(this._maxBackBufferLength),this.el.playerSetLowBufferLength(this._lowBufferLength),this.el.playerSetMediaTimePeriod(this._mediaTimePeriod),this.el.playerSetFpsDroppedMonitoringPeriod(this._fpsDroppedMonitoringPeriod),this.el.playerSetFpsDroppedMonitoringThreshold(this._fpsDroppedMonitoringThreshold),this.el.playerSetCapLevelonFPSDrop(this._capLevelonFPSDrop),this.el.playerSetSmoothAutoSwitchonFPSDrop(this._smoothAutoSwitchonFPSDrop),this.el.playerSetSwitchDownOnLevelError(this._switchDownOnLevelError),this.el.playerSetSeekMode(this._seekMode),this.el.playerSetKeyLoadMaxRetry(this._keyLoadMaxRetry),this.el.playerSetKeyLoadMaxRetryTimeout(this._keyLoadMaxRetryTimeout),this.el.playerSetFragmentLoadMaxRetry(this._fragmentLoadMaxRetry),this.el.playerSetFragmentLoadMaxRetryTimeout(this._fragmentLoadMaxRetryTimeout),this.el.playerSetFragmentLoadSkipAfterMaxRetry(this._fragmentLoadSkipAfterMaxRetry),this.el.playerSetMaxSkippedFragments(this._maxSkippedFragments),this.el.playerSetFlushLiveURLCache(this._flushLiveURLCache),this.el.playerSetInitialLiveManifestSize(this._initialLiveManifestSize),this.el.playerSetManifestLoadMaxRetry(this._manifestLoadMaxRetry),this.el.playerSetManifestLoadMaxRetryTimeout(this._manifestLoadMaxRetryTimeout),this.el.playerSetManifestRedundantLoadmaxRetry(this._manifestRedundantLoadmaxRetry),this.el.playerSetStartFromBitrate(this._startFromBitrate),this.el.playerSetStartFromLevel(this._startFromLevel),this.el.playerSetAutoStartMaxDuration(this._autoStartMaxDuration),this.el.playerSetSeekFromLevel(this._seekFromLevel),this.el.playerSetUseHardwareVideoDecoder(this._useHardwareVideoDecoder),this.el.playerSetLogInfo(this._hlsLogEnabled),this.el.playerSetLogDebug(this._logDebug),this.el.playerSetLogDebug2(this._logDebug2),this.el.playerSetLogWarn(this._logWarn),this.el.playerSetLogError(this._logError)},e.prototype.setAutoStartLoad=function(t){this._autoStartLoad=t,this.el.playerSetAutoStartLoad(this._autoStartLoad)},e.prototype.setCapLevelToStage=function(t){this._capLevelToStage=t,this.el.playerSetCapLevelToStage(this._capLevelToStage)},e.prototype.setMaxLevelCappingMode=function(t){this._maxLevelCappingMode=t,this.el.playerSetMaxLevelCappingMode(this._maxLevelCappingMode)},e.prototype.setSetMinBufferLength=function(t){this._minBufferLength=t,this.el.playerSetMinBufferLength(this._minBufferLength)},e.prototype.setMinBufferLengthCapping=function(t){this._minBufferLengthCapping=t,this.el.playerSetMinBufferLengthCapping(this._minBufferLengthCapping)},e.prototype.setMaxBufferLength=function(t){this._maxBufferLength=t,this.el.playerSetMaxBufferLength(this._maxBufferLength)},e.prototype.setMaxBackBufferLength=function(t){this._maxBackBufferLength=t,this.el.playerSetMaxBackBufferLength(this._maxBackBufferLength)},e.prototype.setLowBufferLength=function(t){this._lowBufferLength=t,this.el.playerSetLowBufferLength(this._lowBufferLength)},e.prototype.setMediaTimePeriod=function(t){this._mediaTimePeriod=t,this.el.playerSetMediaTimePeriod(this._mediaTimePeriod)},e.prototype.setFpsDroppedMonitoringPeriod=function(t){this._fpsDroppedMonitoringPeriod=t,this.el.playerSetFpsDroppedMonitoringPeriod(this._fpsDroppedMonitoringPeriod)},e.prototype.setFpsDroppedMonitoringThreshold=function(t){this._fpsDroppedMonitoringThreshold=t,this.el.playerSetFpsDroppedMonitoringThreshold(this._fpsDroppedMonitoringThreshold)},e.prototype.setCapLevelonFPSDrop=function(t){this._capLevelonFPSDrop=t,this.el.playerSetCapLevelonFPSDrop(this._capLevelonFPSDrop)},e.prototype.setSmoothAutoSwitchonFPSDrop=function(t){this._smoothAutoSwitchonFPSDrop=t,this.el.playerSetSmoothAutoSwitchonFPSDrop(this._smoothAutoSwitchonFPSDrop)},e.prototype.setSwitchDownOnLevelError=function(t){this._switchDownOnLevelError=t,this.el.playerSetSwitchDownOnLevelError(this._switchDownOnLevelError)},e.prototype.setSeekMode=function(t){this._seekMode=t,this.el.playerSetSeekMode(this._seekMode)},e.prototype.setKeyLoadMaxRetry=function(t){this._keyLoadMaxRetry=t,this.el.playerSetKeyLoadMaxRetry(this._keyLoadMaxRetry)},e.prototype.setKeyLoadMaxRetryTimeout=function(t){this._keyLoadMaxRetryTimeout=t,this.el.playerSetKeyLoadMaxRetryTimeout(this._keyLoadMaxRetryTimeout)},e.prototype.setFragmentLoadMaxRetry=function(t){this._fragmentLoadMaxRetry=t,this.el.playerSetFragmentLoadMaxRetry(this._fragmentLoadMaxRetry)},e.prototype.setFragmentLoadMaxRetryTimeout=function(t){this._fragmentLoadMaxRetryTimeout=t,this.el.playerSetFragmentLoadMaxRetryTimeout(this._fragmentLoadMaxRetryTimeout)},e.prototype.setFragmentLoadSkipAfterMaxRetry=function(t){this._fragmentLoadSkipAfterMaxRetry=t,this.el.playerSetFragmentLoadSkipAfterMaxRetry(this._fragmentLoadSkipAfterMaxRetry)},e.prototype.setMaxSkippedFragments=function(t){this._maxSkippedFragments=t,this.el.playerSetMaxSkippedFragments(this._maxSkippedFragments)},e.prototype.setFlushLiveURLCache=function(t){this._flushLiveURLCache=t,this.el.playerSetFlushLiveURLCache(this._flushLiveURLCache)},e.prototype.setInitialLiveManifestSize=function(t){this._initialLiveManifestSize=t,this.el.playerSetInitialLiveManifestSize(this._initialLiveManifestSize)},e.prototype.setManifestLoadMaxRetry=function(t){this._manifestLoadMaxRetry=t,this.el.playerSetManifestLoadMaxRetry(this._manifestLoadMaxRetry)},e.prototype.setManifestLoadMaxRetryTimeout=function(t){this._manifestLoadMaxRetryTimeout=t,this.el.playerSetManifestLoadMaxRetryTimeout(this._manifestLoadMaxRetryTimeout)},e.prototype.setManifestRedundantLoadmaxRetry=function(t){this._manifestRedundantLoadmaxRetry=t,this.el.playerSetManifestRedundantLoadmaxRetry(this._manifestRedundantLoadmaxRetry)},e.prototype.setStartFromBitrate=function(t){this._startFromBitrate=t,this.el.playerSetStartFromBitrate(this._startFromBitrate)},e.prototype.setStartFromLevel=function(t){this._startFromLevel=t,this.el.playerSetStartFromLevel(this._startFromLevel)},e.prototype.setAutoStartMaxDuration=function(t){this._autoStartMaxDuration=t,this.el.playerSetAutoStartMaxDuration(this._autoStartMaxDuration)},e.prototype.setSeekFromLevel=function(t){this._seekFromLevel=t,this.el.playerSetSeekFromLevel(this._seekFromLevel)},e.prototype.setUseHardwareVideoDecoder=function(t){this._useHardwareVideoDecoder=t,this.el.playerSetUseHardwareVideoDecoder(this._useHardwareVideoDecoder)},e.prototype.setSetLogInfo=function(t){this._hlsLogEnabled=t,this.el.playerSetLogInfo(this._hlsLogEnabled)},e.prototype.setLogDebug=function(t){this._logDebug=t,this.el.playerSetLogDebug(this._logDebug)},e.prototype.setLogDebug2=function(t){this._logDebug2=t,this.el.playerSetLogDebug2(this._logDebug2)},e.prototype.setLogWarn=function(t){this._logWarn=t,this.el.playerSetLogWarn(this._logWarn)},e.prototype.setLogError=function(t){this._logError=t,this.el.playerSetLogError(this._logError)},e.prototype._levelChanged=function(t){var e=this.el.getLevels()[t];e&&(this.highDefinition=e.height>=720||e.bitrate/1e3>=2e3,this.trigger(g.default.PLAYBACK_HIGHDEFINITIONUPDATE,this.highDefinition),this._levels&&0!==this._levels.length||this._fillLevels(),this.trigger(g.default.PLAYBACK_BITRATE,{height:e.height,width:e.width,bandwidth:e.bitrate,bitrate:e.bitrate,level:t}),this.trigger(g.default.PLAYBACK_LEVEL_SWITCH_END))},e.prototype._updateTime=function(t){if("IDLE"!==this._currentState){var e=this._normalizeDuration(t.duration),r=Math.min(Math.max(t.position,0),e),i=this._dvrEnabled,n=this._playbackType===A.default.LIVE;this._dvrEnabled=n&&e>this._hlsMinimumDvrSize,100!==e&&void 0!==n&&(this._dvrEnabled!==i&&(this._updateSettings(),this.trigger(g.default.PLAYBACK_SETTINGSUPDATE,this.name)),n&&!this._dvrEnabled&&(r=e),this.trigger(g.default.PLAYBACK_TIMEUPDATE,{current:r,total:e},this.name))}},e.prototype.play=function(){this.trigger(g.default.PLAYBACK_PLAY_INTENT),"PAUSED"===this._currentState?this.el.playerResume():this._srcLoaded||"PLAYING"===this._currentState?this.el.playerPlay():this._firstPlay()},e.prototype.getPlaybackType=function(){return this._playbackType?this._playbackType:null},e.prototype.getCurrentTime=function(){return this.el.getPosition()},e.prototype.getCurrentLevelIndex=function(){return this._currentLevel},e.prototype.getCurrentLevel=function(){return this.levels[this.currentLevel]},e.prototype.getCurrentBitrate=function(){return this.levels[this.currentLevel].bitrate},e.prototype.setCurrentLevel=function(t){this.currentLevel=t},e.prototype.isHighDefinitionInUse=function(){return this.highDefinition},e.prototype.getLevels=function(){return this.levels},e.prototype._setPlaybackState=function(t){["PLAYING_BUFFERING","PAUSED_BUFFERING"].indexOf(t)>=0?(this._bufferingState=!0,this.trigger(g.default.PLAYBACK_BUFFERING,this.name),this._updateCurrentState(t)):["PLAYING","PAUSED"].indexOf(t)>=0?(["PLAYING_BUFFERING","PAUSED_BUFFERING","IDLE"].indexOf(this._currentState)>=0&&(this._bufferingState=!1,this.trigger(g.default.PLAYBACK_BUFFERFULL,this.name)),this._updateCurrentState(t)):"IDLE"===t&&(this._srcLoaded=!1,this._loop&&["PLAYING_BUFFERING","PLAYING"].indexOf(this._currentState)>=0?(this.play(),this.seek(0)):(this._updateCurrentState(t),this._hasEnded=!0,this.trigger(g.default.PLAYBACK_TIMEUPDATE,{current:0,total:this.getDuration()},this.name),this.trigger(g.default.PLAYBACK_ENDED,this.name)))},e.prototype._updateCurrentState=function(t){this._currentState=t,"IDLE"!==t&&(this._hasEnded=!1),this._updatePlaybackType(),"PLAYING"===t?this.trigger(g.default.PLAYBACK_PLAY,this.name):"PAUSED"===t&&this.trigger(g.default.PLAYBACK_PAUSE,this.name)},e.prototype._updatePlaybackType=function(){this._playbackType=this.el.getType(),this._playbackType&&(this._playbackType=this._playbackType.toLowerCase(),this._playbackType===A.default.VOD?this._startReportingProgress():this._stopReportingProgress()),this.trigger(g.default.PLAYBACK_PLAYBACKSTATE,{type:this._playbackType})},e.prototype._startReportingProgress=function(){this._reportingProgress||(this._reportingProgress=!0)},e.prototype._stopReportingProgress=function(){this._reportingProgress=!1},e.prototype._onFragmentLoaded=function(t){if(this.trigger(g.default.PLAYBACK_FRAGMENT_LOADED,t),this._reportingProgress&&this.getCurrentTime()){var e=this.getCurrentTime()+this.el.getbufferLength();this.trigger(g.default.PLAYBACK_PROGRESS,{start:this.getCurrentTime(),current:e,total:this.el.getDuration()})}},e.prototype._onLevelEndlist=function(){this._updatePlaybackType()},e.prototype._firstPlay=function(){var t=this;this._shouldPlayOnManifestLoaded=!0,this.el.playerLoad&&(b.default.once(this.cid+":manifestloaded",function(e,r){return t._manifestLoaded(e,r)}),this._setFlashSettings(),this.el.playerLoad(this._src),this._srcLoaded=!0)},e.prototype.volume=function(t){var e=this;this.isReady?this.el.playerVolume(t):this.listenToOnce(this,g.default.PLAYBACK_BUFFERFULL,function(){return e.volume(t)})},e.prototype.pause=function(){(this._playbackType!==A.default.LIVE||this._dvrEnabled)&&(this.el.playerPause(),this._playbackType===A.default.LIVE&&this._dvrEnabled&&this._updateDvr(!0))},e.prototype.stop=function(){this._srcLoaded=!1,this.el.playerStop(),this.trigger(g.default.PLAYBACK_STOP),this.trigger(g.default.PLAYBACK_TIMEUPDATE,{current:0,total:0},this.name)},e.prototype.isPlaying=function(){return!!this._currentState&&!!this._currentState.match(/playing/i)},e.prototype.getDuration=function(){return this._normalizeDuration(this.el.getDuration())},e.prototype._normalizeDuration=function(t){return this._playbackType===A.default.LIVE&&(t=Math.max(0,t-10)),t},e.prototype.seekPercentage=function(t){var e=this.el.getDuration(),r=0;t>0&&(r=e*t/100),this.seek(r)},e.prototype.seek=function(t){var e=this.getDuration();if(this._playbackType===A.default.LIVE){var r=e-t>3;this._updateDvr(r)}this.el.playerSeek(t),this.trigger(g.default.PLAYBACK_TIMEUPDATE,{current:t,total:e},this.name)},e.prototype._updateDvr=function(t){var e=!!this._dvrInUse;this._dvrInUse=t,this._dvrInUse!==e&&(this._updateSettings(),this.trigger(g.default.PLAYBACK_DVR,this._dvrInUse),this.trigger(g.default.PLAYBACK_STATS_ADD,{dvr:this._dvrInUse}))},e.prototype._flashPlaybackError=function(t,e,r){var i={code:t,description:r,level:L.default.Levels.FATAL,raw:{code:t,url:e,message:r}},n=this.createError(i);this.trigger(g.default.PLAYBACK_ERROR,n),this.trigger(g.default.PLAYBACK_STOP)},e.prototype._manifestLoaded=function(t,e){this._shouldPlayOnManifestLoaded&&(this._shouldPlayOnManifestLoaded=!1,this.el.playerPlay()),this._fillLevels(),this.trigger(g.default.PLAYBACK_LOADEDMETADATA,{duration:t,data:e})},e.prototype._fillLevels=function(){var t=this.el.getLevels(),e=t.length;this._levels=[];for(var r=0;r<e;r++)this._levels.push({id:r,label:t[r].height+"p",level:t[r]});this.trigger(g.default.PLAYBACK_LEVELS_AVAILABLE,this._levels)},e.prototype.destroy=function(){this.stopListening(),this.$el.remove()},e.prototype._updateSettings=function(){this.settings=P.default.extend({},this._defaultSettings),this._playbackType===A.default.VOD||this._dvrInUse?(this.settings.left=["playpause","position","duration"],this.settings.seekEnabled=!0):this._dvrEnabled?(this.settings.left=["playpause"],this.settings.seekEnabled=!0):this.settings.seekEnabled=!1},e.prototype._createCallbacks=function(){var t=this;window.Clappr||(window.Clappr={}),window.Clappr.flashlsCallbacks||(window.Clappr.flashlsCallbacks={}),this.flashlsEvents=new R.default(this.cid),window.Clappr.flashlsCallbacks[this.cid]=function(e,r){t.flashlsEvents[e].apply(t.flashlsEvents,r)}},e.prototype.render=function(){return t.prototype.render.call(this),this._createCallbacks(),this},(0,u.default)(e,[{key:"isReady",get:function(){return this._isReadyState}},{key:"dvrEnabled",get:function(){return!!this._dvrEnabled}}]),e}(h.default);e.default=D,D.canPlay=function(t,e){var r=t.split("?")[0].match(/.*\.(.*)$/)||[];return T.default.hasFlash&&(r.length>1&&"m3u8"===r[1].toLowerCase()||"application/x-mpegURL"===e||"application/vnd.apple.mpegurl"===e)},t.exports=e.default},function(t,e,r){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=r(0),a=i(n),o=r(31),s=i(o),l=function(){function t(e){(0,a.default)(this,t),this.instanceId=e}return t.prototype.ready=function(){s.default.trigger(this.instanceId+":flashready")},t.prototype.videoSize=function(t,e){s.default.trigger(this.instanceId+":videosizechanged",t,e)},t.prototype.complete=function(){s.default.trigger(this.instanceId+":complete")},t.prototype.error=function(t,e,r){s.default.trigger(this.instanceId+":error",t,e,r)},t.prototype.manifest=function(t,e){s.default.trigger(this.instanceId+":manifestloaded",t,e)},t.prototype.audioLevelLoaded=function(t){s.default.trigger(this.instanceId+":audiolevelloaded",t)},t.prototype.levelLoaded=function(t){s.default.trigger(this.instanceId+":levelloaded",t)},t.prototype.levelEndlist=function(t){s.default.trigger(this.instanceId+":levelendlist",t)},t.prototype.fragmentLoaded=function(t){s.default.trigger(this.instanceId+":fragmentloaded",t)},t.prototype.fragmentPlaying=function(t){s.default.trigger(this.instanceId+":fragmentplaying",t)},t.prototype.position=function(t){s.default.trigger(this.instanceId+":timeupdate",t)},t.prototype.state=function(t){s.default.trigger(this.instanceId+":playbackstate",t)},t.prototype.seekState=function(t){s.default.trigger(this.instanceId+":seekstate",t)},t.prototype.switch=function(t){s.default.trigger(this.instanceId+":levelchanged",t)},t.prototype.audioTracksListChange=function(t){s.default.trigger(this.instanceId+":audiotracklistchanged",t)},t.prototype.audioTrackChange=function(t){s.default.trigger(this.instanceId+":audiotrackchanged",t)},t}();e.default=l,t.exports=e.default},function(t,e){t.exports="<%=baseUrl%>/8fa12a459188502b9f0d39b8a67d9e6c.swf"},function(t,e,r){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=r(61),a=i(n),o=r(88),s=i(o),l=r(0),u=i(l),d=r(1),c=i(d),f=r(3),h=i(f),p=r(2),g=i(p),y=r(41),m=i(y),v=r(188),A=i(v),_=r(4),b=i(_),E=r(10),T=i(E),S=r(5),L=r(29),k=i(L),R=r(24),C=i(R),w=function(t){function e(){(0,u.default)(this,e);for(var r=arguments.length,i=Array(r),n=0;n<r;n++)i[n]=arguments[n];var a=(0,c.default)(this,t.call.apply(t,[this].concat(i)));return a.options.playback||(a.options.playback=a.options),a._minDvrSize=void 0===a.options.hlsMinimumDvrSize?60:a.options.hlsMinimumDvrSize,a._extrapolatedWindowNumSegments=a.options.playback&&void 0!==a.options.playback.extrapolatedWindowNumSegments?a.options.playback.extrapolatedWindowNumSegments:2,a._playbackType=T.default.VOD,a._lastTimeUpdate={current:0,total:0},a._lastDuration=null,a._playableRegionStartTime=0,a._localStartTimeCorrelation=null,a._localEndTimeCorrelation=null,a._playableRegionDuration=0,a._programDateTime=0,a._durationExcludesAfterLiveSyncPoint=!1,a._segmentTargetDuration=null,a._playlistType=null,a._recoverAttemptsRemaining=a.options.hlsRecoverAttempts||16,a}return(0,g.default)(e,t),(0,h.default)(e,[{key:"name",get:function(){return"hls"}},{key:"levels",get:function(){return this._levels||[]}},{key:"currentLevel",get:function(){return null===this._currentLevel||void 0===this._currentLevel?-1:this._currentLevel},set:function(t){this._currentLevel=t,this.trigger(b.default.PLAYBACK_LEVEL_SWITCH_START),this.options.hlsUseNextLevel?this._hls.nextLevel=this._currentLevel:this._hls.currentLevel=this._currentLevel}},{key:"isReady",get:function(){return this._isReadyState}},{key:"_startTime",get:function(){return this._playbackType===T.default.LIVE&&"EVENT"!==this._playlistType?this._extrapolatedStartTime:this._playableRegionStartTime}},{key:"_now",get:function(){return(0,S.now)()}},{key:"_extrapolatedStartTime",get:function(){if(!this._localStartTimeCorrelation)return this._playableRegionStartTime;var t=this._localStartTimeCorrelation,e=this._now-t.local,r=(t.remote+e)/1e3;return Math.min(r,this._playableRegionStartTime+this._extrapolatedWindowDuration)}},{key:"_extrapolatedEndTime",get:function(){var t=this._playableRegionStartTime+this._playableRegionDuration;if(!this._localEndTimeCorrelation)return t;var e=this._localEndTimeCorrelation,r=this._now-e.local,i=(e.remote+r)/1e3;return Math.max(t-this._extrapolatedWindowDuration,Math.min(i,t))}},{key:"_duration",get:function(){return this._extrapolatedEndTime-this._startTime}},{key:"_extrapolatedWindowDuration",get:function(){return null===this._segmentTargetDuration?0:this._extrapolatedWindowNumSegments*this._segmentTargetDuration}}],[{key:"HLSJS",get:function(){return A.default}}]),e.prototype._setup=function(){var t=this;this._ccIsSetup=!1,this._ccTracksUpdated=!1,this._hls=new A.default((0,S.assign)({},this.options.playback.hlsjsConfig)),this._hls.on(A.default.Events.MEDIA_ATTACHED,function(){return t._hls.loadSource(t.options.src)}),this._hls.on(A.default.Events.LEVEL_LOADED,function(e,r){return t._updatePlaybackType(e,r)}),this._hls.on(A.default.Events.LEVEL_UPDATED,function(e,r){return t._onLevelUpdated(e,r)}),this._hls.on(A.default.Events.LEVEL_SWITCHING,function(e,r){return t._onLevelSwitch(e,r)}),this._hls.on(A.default.Events.FRAG_LOADED,function(e,r){return t._onFragmentLoaded(e,r)}),this._hls.on(A.default.Events.ERROR,function(e,r){return t._onHLSJSError(e,r)}),this._hls.on(A.default.Events.SUBTITLE_TRACK_LOADED,function(e,r){return t._onSubtitleLoaded(e,r)}),this._hls.on(A.default.Events.SUBTITLE_TRACKS_UPDATED,function(){return t._ccTracksUpdated=!0}),this._hls.attachMedia(this.el)},e.prototype.render=function(){return this._ready(),t.prototype.render.call(this)},e.prototype._ready=function(){this._isReadyState=!0,this.trigger(b.default.PLAYBACK_READY,this.name)},e.prototype._recover=function(t,e,r){if(this._recoveredDecodingError)if(this._recoveredAudioCodecError){k.default.error("hlsjs: failed to recover",{evt:t,data:e}),r.level=C.default.Levels.FATAL;var i=this.createError(r);this.trigger(b.default.PLAYBACK_ERROR,i),this.stop()}else this._recoveredAudioCodecError=!0,this._hls.swapAudioCodec(),this._hls.recoverMediaError();else this._recoveredDecodingError=!0,this._hls.recoverMediaError()},e.prototype._setupSrc=function(t){},e.prototype._startTimeUpdateTimer=function(){var t=this;this._timeUpdateTimer=setInterval(function(){t._onDurationChange(),t._onTimeUpdate()},100)},e.prototype._stopTimeUpdateTimer=function(){clearInterval(this._timeUpdateTimer)},e.prototype.getProgramDateTime=function(){return this._programDateTime},e.prototype.getDuration=function(){return this._duration},e.prototype.getCurrentTime=function(){return Math.max(0,this.el.currentTime-this._startTime)},e.prototype.getStartTimeOffset=function(){return this._startTime},e.prototype.seekPercentage=function(t){var e=this._duration;t>0&&(e=this._duration*(t/100)),this.seek(e)},e.prototype.seek=function(e){e<0&&(k.default.warn("Attempt to seek to a negative time. Resetting to live point. Use seekToLivePoint() to seek to the live point."),e=this.getDuration()),this.dvrEnabled&&this._updateDvr(e<this.getDuration()-3),e+=this._startTime,t.prototype.seek.call(this,e)},e.prototype.seekToLivePoint=function(){this.seek(this.getDuration())},e.prototype._updateDvr=function(t){this.trigger(b.default.PLAYBACK_DVR,t),this.trigger(b.default.PLAYBACK_STATS_ADD,{dvr:t})},e.prototype._updateSettings=function(){this._playbackType===T.default.VOD?this.settings.left=["playpause","position","duration"]:this.dvrEnabled?this.settings.left=["playpause"]:this.settings.left=["playstop"],this.settings.seekEnabled=this.isSeekEnabled(),this.trigger(b.default.PLAYBACK_SETTINGSUPDATE)},e.prototype._onHLSJSError=function(t,e){var r={code:e.type+"_"+e.details,description:this.name+" error: type: "+e.type+", details: "+e.details,raw:e},i=void 0;if(e.response&&(r.description+=", response: "+(0,s.default)(e.response)),e.fatal)if(this._recoverAttemptsRemaining>0)switch(this._recoverAttemptsRemaining-=1,e.type){case A.default.ErrorTypes.NETWORK_ERROR:switch(e.details){case A.default.ErrorDetails.MANIFEST_LOAD_ERROR:case A.default.ErrorDetails.MANIFEST_LOAD_TIMEOUT:case A.default.ErrorDetails.MANIFEST_PARSING_ERROR:case A.default.ErrorDetails.LEVEL_LOAD_ERROR:case A.default.ErrorDetails.LEVEL_LOAD_TIMEOUT:k.default.error("hlsjs: unrecoverable network fatal error.",{evt:t,data:e}),i=this.createError(r),this.trigger(b.default.PLAYBACK_ERROR,i),this.stop();break;default:k.default.warn("hlsjs: trying to recover from network error.",{evt:t,data:e}),r.level=C.default.Levels.WARN,this.createError(r),this._hls.startLoad()}break;case A.default.ErrorTypes.MEDIA_ERROR:k.default.warn("hlsjs: trying to recover from media error.",{evt:t,data:e}),r.level=C.default.Levels.WARN,this.createError(r),this._recover(t,e,r);break;default:k.default.error("hlsjs: could not recover from error.",{evt:t,data:e}),i=this.createError(r),this.trigger(b.default.PLAYBACK_ERROR,i),this.stop()}else k.default.error("hlsjs: could not recover from error after maximum number of attempts.",{evt:t,data:e}),i=this.createError(r),this.trigger(b.default.PLAYBACK_ERROR,i),this.stop();else r.level=C.default.Levels.WARN,this.createError(r),k.default.warn("hlsjs: non-fatal error occurred",{evt:t,data:e})},e.prototype._onTimeUpdate=function(){var t={current:this.getCurrentTime(),total:this.getDuration(),firstFragDateTime:this.getProgramDateTime()};this._lastTimeUpdate&&t.current===this._lastTimeUpdate.current&&t.total===this._lastTimeUpdate.total||(this._lastTimeUpdate=t,this.trigger(b.default.PLAYBACK_TIMEUPDATE,t,this.name))},e.prototype._onDurationChange=function(){var e=this.getDuration();this._lastDuration!==e&&(this._lastDuration=e,t.prototype._onDurationChange.call(this))},e.prototype._onProgress=function(){if(this.el.buffered.length){for(var t=[],e=0,r=0;r<this.el.buffered.length;r++)t=[].concat((0,a.default)(t),[{start:Math.max(0,this.el.buffered.start(r)-this._playableRegionStartTime),end:Math.max(0,this.el.buffered.end(r)-this._playableRegionStartTime)}]),this.el.currentTime>=t[r].start&&this.el.currentTime<=t[r].end&&(e=r);var i={start:t[e].start,current:t[e].end,total:this.getDuration()};this.trigger(b.default.PLAYBACK_PROGRESS,i,t)}},e.prototype.play=function(){this._hls||this._setup(),t.prototype.play.call(this),this._startTimeUpdateTimer()},e.prototype.pause=function(){this._hls&&(t.prototype.pause.call(this),this.dvrEnabled&&this._updateDvr(!0))},e.prototype.stop=function(){this._hls&&(t.prototype.stop.call(this),this._hls.destroy(),delete this._hls)},e.prototype.destroy=function(){this._stopTimeUpdateTimer(),this._hls&&(this._hls.destroy(),delete this._hls),t.prototype.destroy.call(this)},e.prototype._updatePlaybackType=function(t,e){this._playbackType=e.details.live?T.default.LIVE:T.default.VOD,this._onLevelUpdated(t,e),this._ccTracksUpdated&&this._playbackType===T.default.LIVE&&this.hasClosedCaptionsTracks&&this._onSubtitleLoaded()},e.prototype._fillLevels=function(){this._levels=this._hls.levels.map(function(t,e){return{id:e,level:t,label:t.bitrate/1e3+"Kbps"}}),this.trigger(b.default.PLAYBACK_LEVELS_AVAILABLE,this._levels)},e.prototype._onLevelUpdated=function(t,e){this._segmentTargetDuration=e.details.targetduration,this._playlistType=e.details.type||null;var r=!1,i=!1,n=e.details.fragments,a=this._playableRegionStartTime,o=this._playableRegionDuration;if(0!==n.length){if(n[0].rawProgramDateTime&&(this._programDateTime=n[0].rawProgramDateTime),this._playableRegionStartTime!==n[0].start&&(r=!0,this._playableRegionStartTime=n[0].start),r)if(this._localStartTimeCorrelation){var s=this._localStartTimeCorrelation,l=this._now-s.local,u=(s.remote+l)/1e3;u<n[0].start?this._localStartTimeCorrelation={local:this._now,remote:1e3*n[0].start}:u>a+this._extrapolatedWindowDuration&&(this._localStartTimeCorrelation={local:this._now,remote:1e3*Math.max(n[0].start,a+this._extrapolatedWindowDuration)})}else this._localStartTimeCorrelation={local:this._now,remote:1e3*(n[0].start+this._extrapolatedWindowDuration/2)};var d=e.details.totalduration;if(this._playbackType===T.default.LIVE){var c=e.details.targetduration,f=this.options.playback.hlsjsConfig||{},h=f.liveSyncDurationCount||A.default.DefaultConfig.liveSyncDurationCount,p=c*h;p<=d?(d-=p,this._durationExcludesAfterLiveSyncPoint=!0):this._durationExcludesAfterLiveSyncPoint=!1}d!==this._playableRegionDuration&&(i=!0,this._playableRegionDuration=d);var g=n[0].start+d,y=a+o;if(g!==y)if(this._localEndTimeCorrelation){var m=this._localEndTimeCorrelation,v=this._now-m.local,_=(m.remote+v)/1e3;_>g?this._localEndTimeCorrelation={local:this._now,remote:1e3*g}:_<g-this._extrapolatedWindowDuration?this._localEndTimeCorrelation={local:this._now,remote:1e3*(g-this._extrapolatedWindowDuration)}:_>y&&(this._localEndTimeCorrelation={local:this._now,remote:1e3*y})}else this._localEndTimeCorrelation={local:this._now,remote:1e3*g};i&&this._onDurationChange(),r&&this._onProgress()}},e.prototype._onFragmentLoaded=function(t,e){this.trigger(b.default.PLAYBACK_FRAGMENT_LOADED,e)},e.prototype._onSubtitleLoaded=function(){if(!this._ccIsSetup){this.trigger(b.default.PLAYBACK_SUBTITLE_AVAILABLE);var t=this._playbackType===T.default.LIVE?-1:this.closedCaptionsTrackId;this.closedCaptionsTrackId=t,this._ccIsSetup=!0}},e.prototype._onLevelSwitch=function(t,e){this.levels.length||this._fillLevels(),this.trigger(b.default.PLAYBACK_LEVEL_SWITCH_END),this.trigger(b.default.PLAYBACK_LEVEL_SWITCH,e);var r=this._hls.levels[e.level];r&&(this.highDefinition=r.height>=720||r.bitrate/1e3>=2e3,this.trigger(b.default.PLAYBACK_HIGHDEFINITIONUPDATE,this.highDefinition),this.trigger(b.default.PLAYBACK_BITRATE,{height:r.height,width:r.width,bandwidth:r.bitrate,bitrate:r.bitrate,level:e.level}))},e.prototype.getPlaybackType=function(){return this._playbackType},e.prototype.isSeekEnabled=function(){return this._playbackType===T.default.VOD||this.dvrEnabled},(0,h.default)(e,[{key:"dvrEnabled",get:function(){return this._durationExcludesAfterLiveSyncPoint&&this._duration>=this._minDvrSize&&this.getPlaybackType()===T.default.LIVE}}]),e}(m.default);e.default=w,w.canPlay=function(t,e){var r=t.split("?")[0].match(/.*\.(.*)$/)||[],i=r.length>1&&"m3u8"===r[1].toLowerCase()||(0,S.listContainsIgnoreCase)(e,["application/vnd.apple.mpegurl","application/x-mpegURL"]);return!(!A.default.isSupported()||!i)},t.exports=e.default},function(t,e,r){var i=r(11),n=i.JSON||(i.JSON={stringify:JSON.stringify});t.exports=function(t){return n.stringify.apply(n,arguments)}},function(t,e,r){"undefined"!=typeof window&&function(e,r){t.exports=r()}(0,function(){return function(t){function e(i){if(r[i])return r[i].exports;var n=r[i]={i:i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,e),n.l=!0,n.exports}var r={};return e.m=t,e.c=r,e.d=function(t,r,i){e.o(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:i})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,r){if(1&r&&(t=e(t)),8&r)return t;if(4&r&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(e.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&r&&"string"!=typeof t)for(var n in t)e.d(i,n,function(e){return t[e]}.bind(null,n));return i},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/dist/",e(e.s="./src/hls.js")}({"./node_modules/eventemitter3/index.js":function(t,e,r){"use strict";function i(){}function n(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function a(t,e,r,i,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var o=new n(r,i||t,a),s=u?u+e:e;return t._events[s]?t._events[s].fn?t._events[s]=[t._events[s],o]:t._events[s].push(o):(t._events[s]=o,t._eventsCount++),t}function o(t,e){0==--t._eventsCount?t._events=new i:delete t._events[e]}function s(){this._events=new i,this._eventsCount=0}var l=Object.prototype.hasOwnProperty,u="~";Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(u=!1)),s.prototype.eventNames=function(){var t,e,r=[];if(0===this._eventsCount)return r;for(e in t=this._events)l.call(t,e)&&r.push(u?e.slice(1):e);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},s.prototype.listeners=function(t){var e=u?u+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,n=r.length,a=new Array(n);i<n;i++)a[i]=r[i].fn;return a},s.prototype.listenerCount=function(t){var e=u?u+t:t,r=this._events[e];return r?r.fn?1:r.length:0},s.prototype.emit=function(t,e,r,i,n,a){var o=u?u+t:t;if(!this._events[o])return!1;var s,l,d=this._events[o],c=arguments.length;if(d.fn){switch(d.once&&this.removeListener(t,d.fn,void 0,!0),c){case 1:return d.fn.call(d.context),!0;case 2:return d.fn.call(d.context,e),!0;case 3:return d.fn.call(d.context,e,r),!0;case 4:return d.fn.call(d.context,e,r,i),!0;case 5:return d.fn.call(d.context,e,r,i,n),!0;case 6:return d.fn.call(d.context,e,r,i,n,a),!0}for(l=1,s=new Array(c-1);l<c;l++)s[l-1]=arguments[l];d.fn.apply(d.context,s)}else{var f,h=d.length;for(l=0;l<h;l++)switch(d[l].once&&this.removeListener(t,d[l].fn,void 0,!0),c){case 1:d[l].fn.call(d[l].context);break;case 2:d[l].fn.call(d[l].context,e);break;case 3:d[l].fn.call(d[l].context,e,r);break;case 4:d[l].fn.call(d[l].context,e,r,i);break;default:if(!s)for(f=1,s=new Array(c-1);f<c;f++)s[f-1]=arguments[f];d[l].fn.apply(d[l].context,s)}}return!0},s.prototype.on=function(t,e,r){return a(this,t,e,r,!1)},s.prototype.once=function(t,e,r){return a(this,t,e,r,!0)},s.prototype.removeListener=function(t,e,r,i){var n=u?u+t:t;if(!this._events[n])return this;if(!e)return o(this,n),this;var a=this._events[n];if(a.fn)a.fn!==e||i&&!a.once||r&&a.context!==r||o(this,n);else{for(var s=0,l=[],d=a.length;s<d;s++)(a[s].fn!==e||i&&!a[s].once||r&&a[s].context!==r)&&l.push(a[s]);l.length?this._events[n]=1===l.length?l[0]:l:o(this,n)}return this},s.prototype.removeAllListeners=function(t){var e;return t?(e=u?u+t:t,this._events[e]&&o(this,e)):(this._events=new i,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=u,s.EventEmitter=s,t.exports=s},"./node_modules/node-libs-browser/node_modules/events/events.js":function(t,e){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function i(t){return"function"==typeof t}function n(t){return"number"==typeof t}function a(t){return"object"==typeof t&&null!==t}function o(t){return void 0===t}t.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(t){if(!n(t)||t<0||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},r.prototype.emit=function(t){var e,r,n,s,l,u;if(this._events||(this._events={}),"error"===t&&(!this._events.error||a(this._events.error)&&!this._events.error.length)){if((e=arguments[1])instanceof Error)throw e;var d=new Error('Uncaught, unspecified "error" event. ('+e+")");throw d.context=e,d}if(r=this._events[t],o(r))return!1;if(i(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:s=Array.prototype.slice.call(arguments,1),r.apply(this,s)}else if(a(r))for(s=Array.prototype.slice.call(arguments,1),u=r.slice(),n=u.length,l=0;l<n;l++)u[l].apply(this,s);return!0},r.prototype.addListener=function(t,e){var n;if(!i(e))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,i(e.listener)?e.listener:e),this._events[t]?a(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,a(this._events[t])&&!this._events[t].warned&&(n=o(this._maxListeners)?r.defaultMaxListeners:this._maxListeners)&&n>0&&this._events[t].length>n&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace()),this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(t,e){function r(){this.removeListener(t,r),n||(n=!0,e.apply(this,arguments))}if(!i(e))throw TypeError("listener must be a function");var n=!1;return r.listener=e,this.on(t,r),this},r.prototype.removeListener=function(t,e){var r,n,o,s;if(!i(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(r=this._events[t],o=r.length,n=-1,r===e||i(r.listener)&&r.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(a(r)){for(s=o;s-- >0;)if(r[s]===e||r[s].listener&&r[s].listener===e){n=s;break}if(n<0)return this;1===r.length?(r.length=0,delete this._events[t]):r.splice(n,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},r.prototype.removeAllListeners=function(t){var e,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[t],i(r))this.removeListener(t,r);else if(r)for(;r.length;)this.removeListener(t,r[r.length-1]);return delete this._events[t],this},r.prototype.listeners=function(t){return this._events&&this._events[t]?i(this._events[t])?[this._events[t]]:this._events[t].slice():[]},r.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(i(e))return 1;if(e)return e.length}return 0},r.listenerCount=function(t,e){return t.listenerCount(e)}},"./node_modules/url-toolkit/src/url-toolkit.js":function(t,e,r){!function(e){var r=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/\?#]*\/)*.*?)??(;.*?)?(\?.*?)?(#.*?)?$/,i=/^([^\/?#]*)(.*)$/,n=/(?:\/|^)\.(?=\/)/g,a=/(?:\/|^)\.\.\/(?!\.\.\/).*?(?=\/)/g,o={buildAbsoluteURL:function(t,e,r){if(r=r||{},t=t.trim(),!(e=e.trim())){if(!r.alwaysNormalize)return t;var n=o.parseURL(t);if(!n)throw new Error("Error trying to parse base URL.");return n.path=o.normalizePath(n.path),o.buildURLFromParts(n)}var a=o.parseURL(e);if(!a)throw new Error("Error trying to parse relative URL.");if(a.scheme)return r.alwaysNormalize?(a.path=o.normalizePath(a.path),o.buildURLFromParts(a)):e;var s=o.parseURL(t);if(!s)throw new Error("Error trying to parse base URL.");if(!s.netLoc&&s.path&&"/"!==s.path[0]){var l=i.exec(s.path);s.netLoc=l[1],s.path=l[2]}s.netLoc&&!s.path&&(s.path="/");var u={scheme:s.scheme,netLoc:a.netLoc,path:null,params:a.params,query:a.query,fragment:a.fragment};if(!a.netLoc&&(u.netLoc=s.netLoc,"/"!==a.path[0]))if(a.path){var d=s.path,c=d.substring(0,d.lastIndexOf("/")+1)+a.path;u.path=o.normalizePath(c)}else u.path=s.path,a.params||(u.params=s.params,a.query||(u.query=s.query));return null===u.path&&(u.path=r.alwaysNormalize?o.normalizePath(a.path):a.path),o.buildURLFromParts(u)},parseURL:function(t){var e=r.exec(t);return e?{scheme:e[1]||"",netLoc:e[2]||"",path:e[3]||"",params:e[4]||"",query:e[5]||"",fragment:e[6]||""}:null},normalizePath:function(t){for(t=t.split("").reverse().join("").replace(n,"");t.length!==(t=t.replace(a,"")).length;);return t.split("").reverse().join("")},buildURLFromParts:function(t){return t.scheme+t.netLoc+t.path+t.params+t.query+t.fragment}};t.exports=o}()},"./node_modules/webworkify-webpack/index.js":function(t,e,r){function i(t){function e(i){if(r[i])return r[i].exports;var n=r[i]={i:i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,e),n.l=!0,n.exports}var r={};e.m=t,e.c=r,e.i=function(t){return t},e.d=function(t,r,i){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:i})},e.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/",e.oe=function(t){throw console.error(t),t};var i=e(e.s=ENTRY_MODULE);return i.default||i}function n(t){return(t+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function a(t){return!isNaN(1*t)}function o(t,e,i){var o={};o[i]=[];var s=e.toString(),l=s.match(/^function\s?\(\w+,\s*\w+,\s*(\w+)\)/);if(!l)return o;for(var c,f=l[1],h=new RegExp("(\\\\n|\\W)"+n(f)+d,"g");c=h.exec(s);)"dll-reference"!==c[3]&&o[i].push(c[3]);for(h=new RegExp("\\("+n(f)+'\\("(dll-reference\\s('+u+'))"\\)\\)'+d,"g");c=h.exec(s);)t[c[2]]||(o[i].push(c[1]),t[c[2]]=r(c[1]).m),o[c[2]]=o[c[2]]||[],o[c[2]].push(c[4]);for(var p=Object.keys(o),g=0;g<p.length;g++)for(var y=0;y<o[p[g]].length;y++)a(o[p[g]][y])&&(o[p[g]][y]=1*o[p[g]][y]);return o}function s(t){return Object.keys(t).reduce(function(e,r){return e||t[r].length>0},!1)}function l(t,e){for(var r={main:[e]},i={main:[]},n={main:{}};s(r);)for(var a=Object.keys(r),l=0;l<a.length;l++){var u=a[l],d=r[u],c=d.pop();if(n[u]=n[u]||{},!n[u][c]&&t[u][c]){n[u][c]=!0,i[u]=i[u]||[],i[u].push(c);for(var f=o(t,t[u][c],u),h=Object.keys(f),p=0;p<h.length;p++)r[h[p]]=r[h[p]]||[],r[h[p]]=r[h[p]].concat(f[h[p]])}}return i}var u="[\\.|\\-|\\+|\\w|/|@]+",d="\\((/\\*.*?\\*/)?s?.*?("+u+").*?\\)";t.exports=function(t,e){e=e||{};var n={main:r.m},a=e.all?{main:Object.keys(n.main)}:l(n,t),o="";Object.keys(a).filter(function(t){return"main"!==t}).forEach(function(t){for(var e=0;a[t][e];)e++;a[t].push(e),n[t][e]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",o=o+"var "+t+" = ("+i.toString().replace("ENTRY_MODULE",JSON.stringify(e))+")({"+a[t].map(function(e){return JSON.stringify(e)+": "+n[t][e].toString()}).join(",")+"});\n"}),o=o+"new (("+i.toString().replace("ENTRY_MODULE",JSON.stringify(t))+")({"+a.main.map(function(t){return JSON.stringify(t)+": "+n.main[t].toString()}).join(",")+"}))(self);";var s=new window.Blob([o],{type:"text/javascript"});if(e.bare)return s;var u=window.URL||window.webkitURL||window.mozURL||window.msURL,d=u.createObjectURL(s),c=new window.Worker(d);return c.objectURL=d,c}},"./src/config.js":function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r("./src/controller/abr-controller.js"),n=r("./src/controller/buffer-controller.js"),a=r("./src/controller/cap-level-controller.js"),o=r("./src/controller/fps-controller.js"),s=r("./src/utils/xhr-loader.js"),l=r("./src/controller/audio-track-controller.js"),u=r("./src/controller/audio-stream-controller.js"),d=r("./src/utils/cues.js"),c=r("./src/controller/timeline-controller.js"),f=r("./src/controller/subtitle-track-controller.js"),h=r("./src/controller/subtitle-stream-controller.js"),p=r("./src/controller/eme-controller.js"),g=r("./src/utils/mediakeys-helper.js");e.hlsDefaultConfig={autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,maxBufferSize:6e7,maxBufferHole:.5,lowBufferWatchdogPeriod:.5,highBufferWatchdogPeriod:3,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,liveDurationInfinity:!1,liveBackBufferLength:1/0,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:s.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,abrController:i.default,bufferController:n.default,capLevelController:a.default,fpsController:o.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,requestMediaKeySystemAccessFunc:g.requestMediaKeySystemAccess},e.hlsDefaultConfig.subtitleStreamController=h.SubtitleStreamController,e.hlsDefaultConfig.subtitleTrackController=f.default,e.hlsDefaultConfig.timelineController=c.default,e.hlsDefaultConfig.cueHandler=d,e.hlsDefaultConfig.enableCEA708Captions=!0,e.hlsDefaultConfig.enableWebVTT=!0,e.hlsDefaultConfig.captionsTextTrack1Label="English",e.hlsDefaultConfig.captionsTextTrack1LanguageCode="en",e.hlsDefaultConfig.captionsTextTrack2Label="Spanish",e.hlsDefaultConfig.captionsTextTrack2LanguageCode="es",e.hlsDefaultConfig.audioStreamController=u.default,e.hlsDefaultConfig.audioTrackController=l.default,e.hlsDefaultConfig.emeController=p.default},"./src/controller/abr-controller.js":function(t,e,r){"use strict";(function(t){var i=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var n=r("./src/events.js"),a=r("./src/event-handler.js"),o=r("./src/utils/buffer-helper.js"),s=r("./src/errors.js"),l=r("./src/utils/logger.js"),u=r("./src/utils/ewma-bandwidth-estimator.js"),d=window.performance,c=function(e){function r(t){var r=e.call(this,t,n.default.FRAG_LOADING,n.default.FRAG_LOADED,n.default.FRAG_BUFFERED,n.default.ERROR)||this;return r.lastLoadedFragLevel=0,r._nextAutoLevel=-1,r.hls=t,r.timer=null,r._bwEstimator=null,r.onCheck=r._abandonRulesCheck.bind(r),r}return i(r,e),r.prototype.destroy=function(){this.clearTimer(),a.default.prototype.destroy.call(this)},r.prototype.onFragLoading=function(t){var e=t.frag;if("main"===e.type&&(this.timer||(this.fragCurrent=e,this.timer=setInterval(this.onCheck,100)),!this._bwEstimator)){var r=this.hls,i=r.config,n=e.level,a=r.levels[n].details.live,o=void 0,s=void 0;a?(o=i.abrEwmaFastLive,s=i.abrEwmaSlowLive):(o=i.abrEwmaFastVoD,s=i.abrEwmaSlowVoD),this._bwEstimator=new u.default(r,s,o,i.abrEwmaDefaultEstimate)}},r.prototype._abandonRulesCheck=function(){var t=this.hls,e=t.media,r=this.fragCurrent;if(r){var i=r.loader,a=t.minAutoLevel;if(!i||i.stats&&i.stats.aborted)return l.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),void(this._nextAutoLevel=-1);var s=i.stats;if(e&&s&&(!e.paused&&0!==e.playbackRate||!e.readyState)&&r.autoLevel&&r.level){var u=d.now()-s.trequest,c=Math.abs(e.playbackRate);if(u>500*r.duration/c){var f=t.levels,h=Math.max(1,s.bw?s.bw/8:1e3*s.loaded/u),p=f[r.level],g=p.realBitrate?Math.max(p.realBitrate,p.bitrate):p.bitrate,y=s.total?s.total:Math.max(s.loaded,Math.round(r.duration*g/8)),m=e.currentTime,v=(y-s.loaded)/h,A=(o.BufferHelper.bufferInfo(e,m,t.config.maxBufferHole).end-m)/c;if(A<2*r.duration/c&&v>A){var _=void 0,b=void 0;for(b=r.level-1;b>a;b--){var E=f[b].realBitrate?Math.max(f[b].realBitrate,f[b].bitrate):f[b].bitrate;if((_=r.duration*E/(6.4*h))<A)break}_<v&&(l.logger.warn("loading too slow, abort fragment loading and switch to level "+b+":fragLoadedDelay["+b+"]<fragLoadedDelay["+(r.level-1)+"];bufferStarvationDelay:"+_.toFixed(1)+"<"+v.toFixed(1)+":"+A.toFixed(1)),t.nextLoadLevel=b,this._bwEstimator.sample(u,s.loaded),i.abort(),this.clearTimer(),t.trigger(n.default.FRAG_LOAD_EMERGENCY_ABORTED,{frag:r,stats:s}))}}}}},r.prototype.onFragLoaded=function(e){var r=e.frag;if("main"===r.type&&t.isFinite(r.sn)){if(this.clearTimer(),this.lastLoadedFragLevel=r.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var i=this.hls.levels[r.level],n=(i.loaded?i.loaded.bytes:0)+e.stats.loaded,a=(i.loaded?i.loaded.duration:0)+e.frag.duration;i.loaded={bytes:n,duration:a},i.realBitrate=Math.round(8*n/a)}if(e.frag.bitrateTest){var o=e.stats;o.tparsed=o.tbuffered=o.tload,this.onFragBuffered(e)}}},r.prototype.onFragBuffered=function(e){var r=e.stats,i=e.frag;if(!0!==r.aborted&&"main"===i.type&&t.isFinite(i.sn)&&(!i.bitrateTest||r.tload===r.tbuffered)){var n=r.tparsed-r.trequest;l.logger.log("latency/loading/parsing/append/kbps:"+Math.round(r.tfirst-r.trequest)+"/"+Math.round(r.tload-r.tfirst)+"/"+Math.round(r.tparsed-r.tload)+"/"+Math.round(r.tbuffered-r.tparsed)+"/"+Math.round(8*r.loaded/(r.tbuffered-r.trequest))),this._bwEstimator.sample(n,r.loaded),r.bwEstimate=this._bwEstimator.getEstimate(),i.bitrateTest?this.bitrateTestDelay=n/1e3:this.bitrateTestDelay=0}},r.prototype.onError=function(t){switch(t.details){case s.ErrorDetails.FRAG_LOAD_ERROR:case s.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer()}},r.prototype.clearTimer=function(){clearInterval(this.timer),this.timer=null},Object.defineProperty(r.prototype,"nextAutoLevel",{get:function(){var t=this._nextAutoLevel,e=this._bwEstimator;if(!(-1===t||e&&e.canEstimate()))return t;var r=this._nextABRAutoLevel;return-1!==t&&(r=Math.min(t,r)),r},set:function(t){this._nextAutoLevel=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"_nextABRAutoLevel",{get:function(){var t=this.hls,e=t.maxAutoLevel,r=t.levels,i=t.config,n=t.minAutoLevel,a=t.media,s=this.lastLoadedFragLevel,u=this.fragCurrent?this.fragCurrent.duration:0,d=a?a.currentTime:0,c=a&&0!==a.playbackRate?Math.abs(a.playbackRate):1,f=this._bwEstimator?this._bwEstimator.getEstimate():i.abrEwmaDefaultEstimate,h=(o.BufferHelper.bufferInfo(a,d,i.maxBufferHole).end-d)/c,p=this._findBestLevel(s,u,f,n,e,h,i.abrBandWidthFactor,i.abrBandWidthUpFactor,r);if(p>=0)return p;l.logger.trace("rebuffering expected to happen, lets try to find a quality level minimizing the rebuffering");var g=u?Math.min(u,i.maxStarvationDelay):i.maxStarvationDelay,y=i.abrBandWidthFactor,m=i.abrBandWidthUpFactor;if(0===h){var v=this.bitrateTestDelay;if(v){g=(u?Math.min(u,i.maxLoadingDelay):i.maxLoadingDelay)-v,l.logger.trace("bitrate test took "+Math.round(1e3*v)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*g)+" ms"),y=m=1}}return p=this._findBestLevel(s,u,f,n,e,h+g,y,m,r),Math.max(p,0)},enumerable:!0,configurable:!0}),r.prototype._findBestLevel=function(t,e,r,i,n,a,o,s,u){for(var d=n;d>=i;d--){var c=u[d];if(c){var f=c.details,h=f?f.totalduration/f.fragments.length:e,p=!!f&&f.live,g=void 0;g=d<=t?o*r:s*r;var y=u[d].realBitrate?Math.max(u[d].realBitrate,u[d].bitrate):u[d].bitrate,m=y*h/g;if(l.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+d+"/"+Math.round(g)+"/"+y+"/"+h+"/"+a+"/"+m),g>y&&(!m||p&&!this.bitrateTestDelay||m<a))return d}}return-1},r}(a.default);e.default=c}).call(this,r("./src/polyfills/number.js").Number)},"./src/controller/audio-stream-controller.js":function(t,e,r){"use strict";(function(t){var i=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var n=r("./src/utils/binary-search.js"),a=r("./src/utils/buffer-helper.js"),o=r("./src/demux/demuxer.js"),s=r("./src/events.js"),l=r("./src/controller/level-helper.js"),u=r("./src/utils/time-ranges.js"),d=r("./src/errors.js"),c=r("./src/utils/logger.js"),f=r("./src/utils/discontinuities.js"),h=r("./src/controller/fragment-tracker.js"),p=r("./src/loader/fragment.js"),g=r("./src/controller/base-stream-controller.js"),y=window.performance,m=function(e){function r(t,r){var i=e.call(this,t,s.default.MEDIA_ATTACHED,s.default.MEDIA_DETACHING,s.default.AUDIO_TRACKS_UPDATED,s.default.AUDIO_TRACK_SWITCHING,s.default.AUDIO_TRACK_LOADED,s.default.KEY_LOADED,s.default.FRAG_LOADED,s.default.FRAG_PARSING_INIT_SEGMENT,s.default.FRAG_PARSING_DATA,s.default.FRAG_PARSED,s.default.ERROR,s.default.BUFFER_RESET,s.default.BUFFER_CREATED,s.default.BUFFER_APPENDED,s.default.BUFFER_FLUSHED,s.default.INIT_PTS_FOUND)||this;return i.fragmentTracker=r,i.config=t.config,i.audioCodecSwap=!1,i._state=g.State.STOPPED,i.initPTS=[],i.waitingFragment=null,i.videoTrackCC=null,i}return i(r,e),r.prototype.onHandlerDestroying=function(){this.stopLoad(),e.prototype.onHandlerDestroying.call(this)},r.prototype.onHandlerDestroyed=function(){this.state=g.State.STOPPED,this.fragmentTracker=null,e.prototype.onHandlerDestroyed.call(this)},r.prototype.onInitPtsFound=function(t){var e=t.id,r=t.frag.cc,i=t.initPTS;"main"===e&&(this.initPTS[r]=i,this.videoTrackCC=r,c.logger.log("InitPTS for cc: "+r+" found from video track: "+i),this.state===g.State.WAITING_INIT_PTS&&this.tick())},r.prototype.startLoad=function(t){if(this.tracks){var e=this.lastCurrentTime;this.stopLoad(),this.setInterval(100),this.fragLoadError=0,e>0&&-1===t?(c.logger.log("audio:override startPosition with lastCurrentTime @"+e.toFixed(3)),this.state=g.State.IDLE):(this.lastCurrentTime=this.startPosition?this.startPosition:t,this.state=g.State.STARTING),this.nextLoadPosition=this.startPosition=this.lastCurrentTime,this.tick()}else this.startPosition=t,this.state=g.State.STOPPED},r.prototype.stopLoad=function(){var t=this.fragCurrent;t&&(t.loader&&t.loader.abort(),this.fragmentTracker.removeFragment(t),this.fragCurrent=null),this.fragPrevious=null,this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.state=g.State.STOPPED},Object.defineProperty(r.prototype,"state",{get:function(){return this._state},set:function(t){if(this.state!==t){var e=this.state;this._state=t,c.logger.log("audio stream:"+e+"->"+t)}},enumerable:!0,configurable:!0}),r.prototype.doTick=function(){var e,r,i,o=this.hls,l=o.config;switch(this.state){case g.State.ERROR:case g.State.PAUSED:case g.State.BUFFER_FLUSHING:break;case g.State.STARTING:this.state=g.State.WAITING_TRACK,this.loadedmetadata=!1;break;case g.State.IDLE:var u=this.tracks;if(!u)break;if(!this.media&&(this.startFragRequested||!l.startFragPrefetch))break;if(this.loadedmetadata)e=this.media.currentTime;else if(void 0===(e=this.nextLoadPosition))break;var d=this.mediaBuffer?this.mediaBuffer:this.media,p=this.videoBuffer?this.videoBuffer:this.media,m=a.BufferHelper.bufferInfo(d,e,l.maxBufferHole),v=a.BufferHelper.bufferInfo(p,e,l.maxBufferHole),A=m.len,_=m.end,b=this.fragPrevious,E=Math.min(l.maxBufferLength,l.maxMaxBufferLength),T=Math.max(E,v.len),S=this.audioSwitch,L=this.trackId;if((A<T||S)&&L<u.length){if(void 0===(i=u[L].details)){this.state=g.State.WAITING_TRACK;break}if(!S&&this._streamEnded(m,i))return this.hls.trigger(s.default.BUFFER_EOS,{type:"audio"}),void(this.state=g.State.ENDED);var k=i.fragments,R=k.length,C=k[0].start,w=k[R-1].start+k[R-1].duration,O=void 0;if(S)if(i.live&&!i.PTSKnown)c.logger.log("switching audiotrack, live stream, unknown PTS,load first fragment"),_=0;else if(_=e,i.PTSKnown&&e<C){if(!(m.end>C||m.nextStart))return;c.logger.log("alt audio track ahead of main track, seek to start of alt audio track"),this.media.currentTime=C+.05}if(i.initSegment&&!i.initSegment.data)O=i.initSegment;else if(_<=C){if(O=k[0],null!==this.videoTrackCC&&O.cc!==this.videoTrackCC&&(O=f.findFragWithCC(k,this.videoTrackCC)),i.live&&O.loadIdx&&O.loadIdx===this.fragLoadIdx){var P=m.nextStart?m.nextStart:C;return c.logger.log("no alt audio available @currentTime:"+this.media.currentTime+", seeking @"+(P+.05)),void(this.media.currentTime=P+.05)}}else{var D=void 0,I=l.maxFragLookUpTolerance,x=b?k[b.sn-k[0].sn+1]:void 0,M=function(t){var e=Math.min(I,t.duration);return t.start+t.duration-e<=_?1:t.start-e>_&&t.start?-1:0};_<w?(_>w-I&&(I=0),D=x&&!M(x)?x:n.default.search(k,M)):D=k[R-1],D&&(O=D,C=D.start,b&&O.level===b.level&&O.sn===b.sn&&(O.sn<i.endSN?(O=k[O.sn+1-i.startSN],c.logger.log("SN just loaded, load next one: "+O.sn)):O=null))}O&&(O.encrypted?(c.logger.log("Loading key for "+O.sn+" of ["+i.startSN+" ,"+i.endSN+"],track "+L),this.state=g.State.KEY_LOADING,o.trigger(s.default.KEY_LOADING,{frag:O})):(c.logger.log("Loading "+O.sn+", cc: "+O.cc+" of ["+i.startSN+" ,"+i.endSN+"],track "+L+", currentTime:"+e+",bufferEnd:"+_.toFixed(3)),this.fragCurrent=O,(S||this.fragmentTracker.getState(O)===h.FragmentState.NOT_LOADED)&&(this.startFragRequested=!0,t.isFinite(O.sn)&&(this.nextLoadPosition=O.start+O.duration),o.trigger(s.default.FRAG_LOADING,{frag:O}),this.state=g.State.FRAG_LOADING)))}break;case g.State.WAITING_TRACK:r=this.tracks[this.trackId],r&&r.details&&(this.state=g.State.IDLE);break;case g.State.FRAG_LOADING_WAITING_RETRY:var N=y.now(),F=this.retryDate;d=this.media;var B=d&&d.seeking;(!F||N>=F||B)&&(c.logger.log("audioStreamController: retryDate reached, switch back to IDLE state"),this.state=g.State.IDLE);break;case g.State.WAITING_INIT_PTS:var U=this.videoTrackCC;if(void 0===this.initPTS[U])break;var j=this.waitingFragment;if(j){var G=j.frag.cc;U!==G?(r=this.tracks[this.trackId],r.details&&r.details.live&&(c.logger.warn("Waiting fragment CC ("+G+") does not match video track CC ("+U+")"),this.waitingFragment=null,this.state=g.State.IDLE)):(this.state=g.State.FRAG_LOADING,this.onFragLoaded(this.waitingFragment),this.waitingFragment=null)}else this.state=g.State.IDLE;break;case g.State.STOPPED:case g.State.FRAG_LOADING:case g.State.PARSING:case g.State.PARSED:case g.State.ENDED:}},r.prototype.onMediaAttached=function(t){var e=this.media=this.mediaBuffer=t.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),e.addEventListener("seeking",this.onvseeking),e.addEventListener("ended",this.onvended);var r=this.config;this.tracks&&r.autoStartLoad&&this.startLoad(r.startPosition)},r.prototype.onMediaDetaching=function(){var t=this.media;t&&t.ended&&(c.logger.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),t&&(t.removeEventListener("seeking",this.onvseeking),t.removeEventListener("ended",this.onvended),this.onvseeking=this.onvseeked=this.onvended=null),this.media=this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1,this.stopLoad()},r.prototype.onAudioTracksUpdated=function(t){c.logger.log("audio tracks updated"),this.tracks=t.audioTracks},r.prototype.onAudioTrackSwitching=function(t){var e=!!t.url;this.trackId=t.id,this.fragCurrent=null,this.state=g.State.PAUSED,this.waitingFragment=null,e?this.setInterval(100):this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),e&&(this.audioSwitch=!0,this.state=g.State.IDLE),this.tick()},r.prototype.onAudioTrackLoaded=function(e){var r=e.details,i=e.id,n=this.tracks[i],a=r.totalduration,o=0;if(c.logger.log("track "+i+" loaded ["+r.startSN+","+r.endSN+"],duration:"+a),r.live){var s=n.details;s&&r.fragments.length>0?(l.mergeDetails(s,r),o=r.fragments[0].start,r.PTSKnown?c.logger.log("live audio playlist sliding:"+o.toFixed(3)):c.logger.log("live audio playlist - outdated PTS, unknown sliding")):(r.PTSKnown=!1,c.logger.log("live audio playlist - first load, unknown sliding"))}else r.PTSKnown=!1;if(n.details=r,!this.startFragRequested){if(-1===this.startPosition){var u=r.startTimeOffset;t.isFinite(u)?(c.logger.log("start time offset found in playlist, adjust startPosition to "+u),this.startPosition=u):this.startPosition=0}this.nextLoadPosition=this.startPosition}this.state===g.State.WAITING_TRACK&&(this.state=g.State.IDLE),this.tick()},r.prototype.onKeyLoaded=function(){this.state===g.State.KEY_LOADING&&(this.state=g.State.IDLE,this.tick())},r.prototype.onFragLoaded=function(t){var e=this.fragCurrent,r=t.frag;if(this.state===g.State.FRAG_LOADING&&e&&"audio"===r.type&&r.level===e.level&&r.sn===e.sn){var i=this.tracks[this.trackId],n=i.details,a=n.totalduration,l=e.level,u=e.sn,d=e.cc,f=this.config.defaultAudioCodec||i.audioCodec||"mp4a.40.2",h=this.stats=t.stats;if("initSegment"===u)this.state=g.State.IDLE,h.tparsed=h.tbuffered=y.now(),n.initSegment.data=t.payload,this.hls.trigger(s.default.FRAG_BUFFERED,{stats:h,frag:e,id:"audio"}),this.tick();else{this.state=g.State.PARSING,this.appended=!1,this.demuxer||(this.demuxer=new o.default(this.hls,"audio"));var p=this.initPTS[d],m=n.initSegment?n.initSegment.data:[];if(n.initSegment||void 0!==p){this.pendingBuffering=!0,c.logger.log("Demuxing "+u+" of ["+n.startSN+" ,"+n.endSN+"],track "+l);this.demuxer.push(t.payload,m,f,null,e,a,!1,p)}else c.logger.log("unknown video PTS for continuity counter "+d+", waiting for video PTS before demuxing audio frag "+u+" of ["+n.startSN+" ,"+n.endSN+"],track "+l),this.waitingFragment=t,this.state=g.State.WAITING_INIT_PTS}}this.fragLoadError=0},r.prototype.onFragParsingInitSegment=function(t){var e=this.fragCurrent,r=t.frag;if(e&&"audio"===t.id&&r.sn===e.sn&&r.level===e.level&&this.state===g.State.PARSING){var i=t.tracks,n=void 0;if(i.video&&delete i.video,n=i.audio){n.levelCodec=n.codec,n.id=t.id,this.hls.trigger(s.default.BUFFER_CODECS,i),c.logger.log("audio track:audio,container:"+n.container+",codecs[level/parsed]=["+n.levelCodec+"/"+n.codec+"]");var a=n.initSegment;if(a){var o={type:"audio",data:a,parent:"audio",content:"initSegment"};this.audioSwitch?this.pendingData=[o]:(this.appended=!0,this.pendingBuffering=!0,this.hls.trigger(s.default.BUFFER_APPENDING,o))}this.tick()}}},r.prototype.onFragParsingData=function(e){var r=this,i=this.fragCurrent,n=e.frag;if(i&&"audio"===e.id&&"audio"===e.type&&n.sn===i.sn&&n.level===i.level&&this.state===g.State.PARSING){var a=this.trackId,o=this.tracks[a],u=this.hls;t.isFinite(e.endPTS)||(e.endPTS=e.startPTS+i.duration,e.endDTS=e.startDTS+i.duration),i.addElementaryStream(p.default.ElementaryStreamTypes.AUDIO),c.logger.log("parsed "+e.type+",PTS:["+e.startPTS.toFixed(3)+","+e.endPTS.toFixed(3)+"],DTS:["+e.startDTS.toFixed(3)+"/"+e.endDTS.toFixed(3)+"],nb:"+e.nb),l.updateFragPTSDTS(o.details,i,e.startPTS,e.endPTS);var f=this.audioSwitch,h=this.media,y=!1;if(f&&h)if(h.readyState){var m=h.currentTime;c.logger.log("switching audio track : currentTime:"+m),m>=e.startPTS&&(c.logger.log("switching audio track : flushing all audio"),this.state=g.State.BUFFER_FLUSHING,u.trigger(s.default.BUFFER_FLUSHING,{startOffset:0,endOffset:t.POSITIVE_INFINITY,type:"audio"}),y=!0,this.audioSwitch=!1,u.trigger(s.default.AUDIO_TRACK_SWITCHED,{id:a}))}else this.audioSwitch=!1,u.trigger(s.default.AUDIO_TRACK_SWITCHED,{id:a});var v=this.pendingData;if(!v)return c.logger.warn("Apparently attempt to enqueue media payload without codec initialization data upfront"),void u.trigger(s.default.ERROR,{type:d.ErrorTypes.MEDIA_ERROR,details:null,fatal:!0});this.audioSwitch||([e.data1,e.data2].forEach(function(t){t&&t.length&&v.push({type:e.type,data:t,parent:"audio",content:"data"})}),!y&&v.length&&(v.forEach(function(t){r.state===g.State.PARSING&&(r.pendingBuffering=!0,r.hls.trigger(s.default.BUFFER_APPENDING,t))}),this.pendingData=[],this.appended=!0)),this.tick()}},r.prototype.onFragParsed=function(t){var e=this.fragCurrent,r=t.frag;e&&"audio"===t.id&&r.sn===e.sn&&r.level===e.level&&this.state===g.State.PARSING&&(this.stats.tparsed=y.now(),this.state=g.State.PARSED,this._checkAppendedParsed())},r.prototype.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},r.prototype.onBufferCreated=function(t){var e=t.tracks.audio;e&&(this.mediaBuffer=e.buffer,this.loadedmetadata=!0),t.tracks.video&&(this.videoBuffer=t.tracks.video.buffer)},r.prototype.onBufferAppended=function(t){if("audio"===t.parent){var e=this.state;e!==g.State.PARSING&&e!==g.State.PARSED||(this.pendingBuffering=t.pending>0,this._checkAppendedParsed())}},r.prototype._checkAppendedParsed=function(){if(!(this.state!==g.State.PARSED||this.appended&&this.pendingBuffering)){var t=this.fragCurrent,e=this.stats,r=this.hls;if(t){this.fragPrevious=t,e.tbuffered=y.now(),r.trigger(s.default.FRAG_BUFFERED,{stats:e,frag:t,id:"audio"});var i=this.mediaBuffer?this.mediaBuffer:this.media;c.logger.log("audio buffered : "+u.default.toString(i.buffered)),this.audioSwitch&&this.appended&&(this.audioSwitch=!1,r.trigger(s.default.AUDIO_TRACK_SWITCHED,{id:this.trackId})),this.state=g.State.IDLE}this.tick()}},r.prototype.onError=function(e){var r=e.frag;if(!r||"audio"===r.type)switch(e.details){case d.ErrorDetails.FRAG_LOAD_ERROR:case d.ErrorDetails.FRAG_LOAD_TIMEOUT:var i=e.frag;if(i&&"audio"!==i.type)break;if(!e.fatal){var n=this.fragLoadError;n?n++:n=1;var o=this.config;if(n<=o.fragLoadingMaxRetry){this.fragLoadError=n;var l=Math.min(Math.pow(2,n-1)*o.fragLoadingRetryDelay,o.fragLoadingMaxRetryTimeout);c.logger.warn("AudioStreamController: frag loading failed, retry in "+l+" ms"),this.retryDate=y.now()+l,this.state=g.State.FRAG_LOADING_WAITING_RETRY}else c.logger.error("AudioStreamController: "+e.details+" reaches max retry, redispatch as fatal ..."),e.fatal=!0,this.state=g.State.ERROR}break;case d.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case d.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:case d.ErrorDetails.KEY_LOAD_ERROR:case d.ErrorDetails.KEY_LOAD_TIMEOUT:this.state!==g.State.ERROR&&(this.state=e.fatal?g.State.ERROR:g.State.IDLE,c.logger.warn("AudioStreamController: "+e.details+" while loading frag, now switching to "+this.state+" state ..."));break;case d.ErrorDetails.BUFFER_FULL_ERROR:if("audio"===e.parent&&(this.state===g.State.PARSING||this.state===g.State.PARSED)){var u=this.mediaBuffer,f=this.media.currentTime;if(u&&a.BufferHelper.isBuffered(u,f)&&a.BufferHelper.isBuffered(u,f+.5)){var o=this.config;o.maxMaxBufferLength>=o.maxBufferLength&&(o.maxMaxBufferLength/=2,c.logger.warn("AudioStreamController: reduce max buffer length to "+o.maxMaxBufferLength+"s")),this.state=g.State.IDLE}else c.logger.warn("AudioStreamController: buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,this.state=g.State.BUFFER_FLUSHING,this.hls.trigger(s.default.BUFFER_FLUSHING,{startOffset:0,endOffset:t.POSITIVE_INFINITY,type:"audio"})}}},r.prototype.onBufferFlushed=function(){var t=this,e=this.pendingData;e&&e.length?(c.logger.log("AudioStreamController: appending pending audio data after buffer flushed"),e.forEach(function(e){t.hls.trigger(s.default.BUFFER_APPENDING,e)}),this.appended=!0,this.pendingData=[],this.state=g.State.PARSED):(this.state=g.State.IDLE,this.fragPrevious=null,this.tick())},r}(g.default);e.default=m}).call(this,r("./src/polyfills/number.js").Number)},"./src/controller/audio-track-controller.js":function(t,e,r){"use strict";var i=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var n=r("./src/events.js"),a=r("./src/task-loop.js"),o=r("./src/utils/logger.js"),s=r("./src/errors.js"),l=function(t){function e(e){var r=t.call(this,e,n.default.MANIFEST_LOADING,n.default.MANIFEST_PARSED,n.default.AUDIO_TRACK_LOADED,n.default.AUDIO_TRACK_SWITCHED,n.default.LEVEL_LOADED,n.default.ERROR)||this;return r._trackId=-1,r._selectDefaultTrack=!0,r.tracks=[],r.trackIdBlacklist=Object.create(null),r.audioGroupId=null,r}return i(e,t),e.prototype.onManifestLoading=function(){this.tracks=[],this._trackId=-1,this._selectDefaultTrack=!0},e.prototype.onManifestParsed=function(t){var e=this.tracks=t.audioTracks||[];this.hls.trigger(n.default.AUDIO_TRACKS_UPDATED,{audioTracks:e})},e.prototype.onAudioTrackLoaded=function(t){if(t.id>=this.tracks.length)return void o.logger.warn("Invalid audio track id:",t.id);if(o.logger.log("audioTrack "+t.id+" loaded"),this.tracks[t.id].details=t.details,t.details.live&&!this.hasInterval()){var e=1e3*t.details.targetduration;this.setInterval(e)}!t.details.live&&this.hasInterval()&&this.clearInterval()},e.prototype.onAudioTrackSwitched=function(t){var e=this.tracks[t.id].groupId;e&&this.audioGroupId!==e&&(this.audioGroupId=e)},e.prototype.onLevelLoaded=function(t){var e=this.hls.levels[t.level];if(e.audioGroupIds){var r=e.audioGroupIds[e.urlId];this.audioGroupId!==r&&(this.audioGroupId=r,this._selectInitialAudioTrack())}},e.prototype.onError=function(t){t.type===s.ErrorTypes.NETWORK_ERROR&&(t.fatal&&this.clearInterval(),t.details===s.ErrorDetails.AUDIO_TRACK_LOAD_ERROR&&(o.logger.warn("Network failure on audio-track id:",t.context.id),this._handleLoadError()))},Object.defineProperty(e.prototype,"audioTracks",{get:function(){return this.tracks},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"audioTrack",{get:function(){return this._trackId},set:function(t){this._setAudioTrack(t),this._selectDefaultTrack=!1},enumerable:!0,configurable:!0}),e.prototype._setAudioTrack=function(t){if(this._trackId===t&&this.tracks[this._trackId].details)return void o.logger.debug("Same id as current audio-track passed, and track details available -> no-op");if(t<0||t>=this.tracks.length)return void o.logger.warn("Invalid id passed to audio-track controller");var e=this.tracks[t];o.logger.log("Now switching to audio-track index "+t),this.clearInterval(),this._trackId=t;var r=e.url,i=e.type,a=e.id;this.hls.trigger(n.default.AUDIO_TRACK_SWITCHING,{id:a,type:i,url:r}),this._loadTrackDetailsIfNeeded(e)},e.prototype.doTick=function(){this._updateTrack(this._trackId)},e.prototype._selectInitialAudioTrack=function(){var t=this,e=this.tracks;if(e.length){var r=this.tracks[this._trackId],i=null;if(r&&(i=r.name),this._selectDefaultTrack){var a=e.filter(function(t){return t.default});a.length?e=a:o.logger.warn("No default audio tracks defined")}var l=!1,u=function(){e.forEach(function(e){l||t.audioGroupId&&e.groupId!==t.audioGroupId||i&&i!==e.name||(t._setAudioTrack(e.id),l=!0)})};u(),l||(i=null,u()),l||(o.logger.error("No track found for running audio group-ID: "+this.audioGroupId),this.hls.trigger(n.default.ERROR,{type:s.ErrorTypes.MEDIA_ERROR,details:s.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))}},e.prototype._needsTrackLoading=function(t){var e=t.details,r=t.url;return!(e&&!e.live)&&!!r},e.prototype._loadTrackDetailsIfNeeded=function(t){if(this._needsTrackLoading(t)){var e=t.url,r=t.id;o.logger.log("loading audio-track playlist for id: "+r),this.hls.trigger(n.default.AUDIO_TRACK_LOADING,{url:e,id:r})}},e.prototype._updateTrack=function(t){if(!(t<0||t>=this.tracks.length)){this.clearInterval(),this._trackId=t,o.logger.log("trying to update audio-track "+t);var e=this.tracks[t];this._loadTrackDetailsIfNeeded(e)}},e.prototype._handleLoadError=function(){this.trackIdBlacklist[this._trackId]=!0;var t=this._trackId,e=this.tracks[t],r=e.name,i=e.language,n=e.groupId;o.logger.warn("Loading failed on audio track id: "+t+", group-id: "+n+', name/language: "'+r+'" / "'+i+'"');for(var a=t,s=0;s<this.tracks.length;s++)if(!this.trackIdBlacklist[s]){var l=this.tracks[s];if(l.name===r){a=s;break}}if(a===t)return void o.logger.warn('No fallback audio-track found for name/language: "'+r+'" / "'+i+'"');o.logger.log("Attempting audio-track fallback id:",a,"group-id:",this.tracks[a].groupId),this._setAudioTrack(a)},e}(a.default);e.default=l},"./src/controller/base-stream-controller.js":function(t,e,r){"use strict";(function(t){var i=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var n=r("./src/task-loop.js"),a=r("./src/controller/fragment-tracker.js"),o=r("./src/utils/buffer-helper.js"),s=r("./src/utils/logger.js");e.State={STOPPED:"STOPPED",STARTING:"STARTING",IDLE:"IDLE",PAUSED:"PAUSED",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",BUFFER_FLUSHING:"BUFFER_FLUSHING",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"};var l=function(r){function n(){return null!==r&&r.apply(this,arguments)||this}return i(n,r),n.prototype.doTick=function(){},n.prototype._streamEnded=function(t,e){var r=this,i=r.fragCurrent,n=r.fragmentTracker;if(!e.live&&i&&!i.backtracked&&i.sn===e.endSN&&!t.nextStart){var o=n.getState(i);return o===a.FragmentState.PARTIAL||o===a.FragmentState.OK}return!1},n.prototype.onMediaSeeking=function(){var r=this,i=r.config,n=r.media,a=r.mediaBuffer,l=r.state,u=n?n.currentTime:null,d=o.BufferHelper.bufferInfo(a||n,u,this.config.maxBufferHole);if(t.isFinite(u)&&s.logger.log("media seeking to "+u.toFixed(3)),l===e.State.FRAG_LOADING){var c=this.fragCurrent;if(0===d.len&&c){var f=i.maxFragLookUpTolerance,h=c.start-f,p=c.start+c.duration+f;u<h||u>p?(c.loader&&(s.logger.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),c.loader.abort()),this.fragCurrent=null,this.fragPrevious=null,this.state=e.State.IDLE):s.logger.log("seeking outside of buffer but within currently loaded fragment range")}}else l===e.State.ENDED&&(0===d.len&&(this.fragPrevious=null,this.fragCurrent=null),this.state=e.State.IDLE);n&&(this.lastCurrentTime=u),this.loadedmetadata||(this.nextLoadPosition=this.startPosition=u),this.tick()},n.prototype.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},n}(n.default);e.default=l}).call(this,r("./src/polyfills/number.js").Number)},"./src/controller/buffer-controller.js":function(t,e,r){"use strict";(function(t){var i=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var n=r("./src/events.js"),a=r("./src/event-handler.js"),o=r("./src/utils/logger.js"),s=r("./src/errors.js"),l=r("./src/utils/mediasource-helper.js"),u=l.getMediaSource(),d=function(e){function r(t){var r=e.call(this,t,n.default.MEDIA_ATTACHING,n.default.MEDIA_DETACHING,n.default.MANIFEST_PARSED,n.default.BUFFER_RESET,n.default.BUFFER_APPENDING,n.default.BUFFER_CODECS,n.default.BUFFER_EOS,n.default.BUFFER_FLUSHING,n.default.LEVEL_PTS_UPDATED,n.default.LEVEL_UPDATED)||this;return r._msDuration=null,r._levelDuration=null,r._levelTargetDuration=10,r._live=null,r._objectUrl=null,r.bufferCodecEventsExpected=0,r.onsbue=r.onSBUpdateEnd.bind(r),r.onsbe=r.onSBUpdateError.bind(r),r.pendingTracks={},r.tracks={},r}return i(r,e),r.prototype.destroy=function(){a.default.prototype.destroy.call(this)},r.prototype.onLevelPtsUpdated=function(t){var e=t.type,r=this.tracks.audio;if("audio"===e&&r&&"audio/mpeg"===r.container){var i=this.sourceBuffer.audio;if(Math.abs(i.timestampOffset-t.start)>.1){var n=i.updating;try{i.abort()}catch(t){o.logger.warn("can not abort audio buffer: "+t)}n?this.audioTimestampOffset=t.start:(o.logger.warn("change mpeg audio timestamp offset from "+i.timestampOffset+" to "+t.start),i.timestampOffset=t.start)}}},r.prototype.onManifestParsed=function(t){this.bufferCodecEventsExpected=t.altAudio?2:1,o.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},r.prototype.onMediaAttaching=function(t){var e=this.media=t.media;if(e){var r=this.mediaSource=new u;this.onmso=this.onMediaSourceOpen.bind(this),this.onmse=this.onMediaSourceEnded.bind(this),this.onmsc=this.onMediaSourceClose.bind(this),r.addEventListener("sourceopen",this.onmso),r.addEventListener("sourceended",this.onmse),r.addEventListener("sourceclose",this.onmsc),e.src=window.URL.createObjectURL(r),this._objectUrl=e.src}},r.prototype.onMediaDetaching=function(){o.logger.log("media source detaching");var t=this.mediaSource;if(t){if("open"===t.readyState)try{t.endOfStream()}catch(t){o.logger.warn("onMediaDetaching:"+t.message+" while calling endOfStream")}t.removeEventListener("sourceopen",this.onmso),t.removeEventListener("sourceended",this.onmse),t.removeEventListener("sourceclose",this.onmsc),this.media&&(window.URL.revokeObjectURL(this._objectUrl),this.media.src===this._objectUrl?(this.media.removeAttribute("src"),this.media.load()):o.logger.warn("media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.pendingTracks={},this.tracks={},this.sourceBuffer={},this.flushRange=[],this.segments=[],this.appended=0}this.onmso=this.onmse=this.onmsc=null,this.hls.trigger(n.default.MEDIA_DETACHED)},r.prototype.onMediaSourceOpen=function(){o.logger.log("media source opened"),this.hls.trigger(n.default.MEDIA_ATTACHED,{media:this.media});var t=this.mediaSource;t&&t.removeEventListener("sourceopen",this.onmso),this.checkPendingTracks()},r.prototype.checkPendingTracks=function(){var t=this,e=t.bufferCodecEventsExpected,r=t.pendingTracks,i=Object.keys(r).length;(i&&!e||2===i)&&(this.createSourceBuffers(r),this.pendingTracks={},this.doAppending())},r.prototype.onMediaSourceClose=function(){o.logger.log("media source closed")},r.prototype.onMediaSourceEnded=function(){o.logger.log("media source ended")},r.prototype.onSBUpdateEnd=function(){if(this.audioTimestampOffset){var t=this.sourceBuffer.audio;o.logger.warn("change mpeg audio timestamp offset from "+t.timestampOffset+" to "+this.audioTimestampOffset),t.timestampOffset=this.audioTimestampOffset,delete this.audioTimestampOffset}this._needsFlush&&this.doFlush(),this._needsEos&&this.checkEos(),this.appending=!1;var e=this.parent,r=this.segments.reduce(function(t,r){return r.parent===e?t+1:t},0),i={},a=this.sourceBuffer;for(var s in a)i[s]=a[s].buffered;this.hls.trigger(n.default.BUFFER_APPENDED,{parent:e,pending:r,timeRanges:i}),this._needsFlush||this.doAppending(),this.updateMediaElementDuration(),0===r&&this.flushLiveBackBuffer()},r.prototype.onSBUpdateError=function(t){o.logger.error("sourceBuffer error:",t),this.hls.trigger(n.default.ERROR,{type:s.ErrorTypes.MEDIA_ERROR,details:s.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1})},r.prototype.onBufferReset=function(){var t=this.sourceBuffer;for(var e in t){var r=t[e];try{this.mediaSource.removeSourceBuffer(r),r.removeEventListener("updateend",this.onsbue),r.removeEventListener("error",this.onsbe)}catch(t){}}this.sourceBuffer={},this.flushRange=[],this.segments=[],this.appended=0},r.prototype.onBufferCodecs=function(t){var e=this;if(!Object.keys(this.sourceBuffer).length){Object.keys(t).forEach(function(r){e.pendingTracks[r]=t[r]});var r=this.mediaSource;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),r&&"open"===r.readyState&&this.checkPendingTracks()}},r.prototype.createSourceBuffers=function(t){var e=this.sourceBuffer,r=this.mediaSource;for(var i in t)if(!e[i]){var a=t[i],l=a.levelCodec||a.codec,u=a.container+";codecs="+l;o.logger.log("creating sourceBuffer("+u+")");try{var d=e[i]=r.addSourceBuffer(u);d.addEventListener("updateend",this.onsbue),d.addEventListener("error",this.onsbe),this.tracks[i]={codec:l,container:a.container},a.buffer=d}catch(t){o.logger.error("error while trying to add sourceBuffer:"+t.message),this.hls.trigger(n.default.ERROR,{type:s.ErrorTypes.MEDIA_ERROR,details:s.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,err:t,mimeType:u})}}this.hls.trigger(n.default.BUFFER_CREATED,{tracks:t})},r.prototype.onBufferAppending=function(t){this._needsFlush||(this.segments?this.segments.push(t):this.segments=[t],this.doAppending())},r.prototype.onBufferAppendFail=function(t){o.logger.error("sourceBuffer error:",t.event),this.hls.trigger(n.default.ERROR,{type:s.ErrorTypes.MEDIA_ERROR,details:s.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1})},r.prototype.onBufferEos=function(t){var e=this.sourceBuffer,r=t.type;for(var i in e)r&&i!==r||e[i].ended||(e[i].ended=!0,o.logger.log(i+" sourceBuffer now EOS"));this.checkEos()},r.prototype.checkEos=function(){var t=this.sourceBuffer,e=this.mediaSource;if(!e||"open"!==e.readyState)return void(this._needsEos=!1);for(var r in t){var i=t[r];if(!i.ended)return;if(i.updating)return void(this._needsEos=!0)}o.logger.log("all media data are available, signal endOfStream() to MediaSource and stop loading fragment");try{e.endOfStream()}catch(t){o.logger.warn("exception while calling mediaSource.endOfStream()")}this._needsEos=!1},r.prototype.onBufferFlushing=function(t){this.flushRange.push({start:t.startOffset,end:t.endOffset,type:t.type}),this.flushBufferCounter=0,this.doFlush()},r.prototype.flushLiveBackBuffer=function(){if(this._live){var t=this.hls.config.liveBackBufferLength;if(isFinite(t)&&!(t<0))for(var e=this.media.currentTime,r=this.sourceBuffer,i=Object.keys(r),n=e-Math.max(t,this._levelTargetDuration),a=i.length-1;a>=0;a--){var o=i[a],s=r[o].buffered;s.length>0&&n>s.start(0)&&this.removeBufferRange(o,r[o],0,n)}}},r.prototype.onLevelUpdated=function(t){var e=t.details;e.fragments.length>0&&(this._levelDuration=e.totalduration+e.fragments[0].start,this._levelTargetDuration=e.averagetargetduration||e.targetduration||10,this._live=e.live,this.updateMediaElementDuration())},r.prototype.updateMediaElementDuration=function(){var e,r=this.hls.config;if(null!==this._levelDuration&&this.media&&this.mediaSource&&this.sourceBuffer&&0!==this.media.readyState&&"open"===this.mediaSource.readyState){for(var i in this.sourceBuffer)if(!0===this.sourceBuffer[i].updating)return;e=this.media.duration,null===this._msDuration&&(this._msDuration=this.mediaSource.duration),!0===this._live&&!0===r.liveDurationInfinity?(o.logger.log("Media Source duration is set to Infinity"),this._msDuration=this.mediaSource.duration=1/0):(this._levelDuration>this._msDuration&&this._levelDuration>e||!t.isFinite(e))&&(o.logger.log("Updating Media Source duration to "+this._levelDuration.toFixed(3)),this._msDuration=this.mediaSource.duration=this._levelDuration)}},r.prototype.doFlush=function(){for(;this.flushRange.length;){var t=this.flushRange[0];if(!this.flushBuffer(t.start,t.end,t.type))return void(this._needsFlush=!0);this.flushRange.shift(),this.flushBufferCounter=0}if(0===this.flushRange.length){this._needsFlush=!1;var e=0,r=this.sourceBuffer;try{for(var i in r)e+=r[i].buffered.length}catch(t){o.logger.error("error while accessing sourceBuffer.buffered")}this.appended=e,this.hls.trigger(n.default.BUFFER_FLUSHED)}},r.prototype.doAppending=function(){var t=this,e=t.hls,r=t.segments,i=t.sourceBuffer;if(Object.keys(i).length){if(this.media.error)return this.segments=[],void o.logger.error("trying to append although a media error occured, flush segment and abort");if(this.appending)return;if(r&&r.length){var a=r.shift();try{var l=a.type,u=i[l];u?u.updating?r.unshift(a):(u.ended=!1,this.parent=a.parent,u.appendBuffer(a.data),this.appendError=0,this.appended++,this.appending=!0):this.onSBUpdateEnd()}catch(t){o.logger.error("error while trying to append buffer:"+t.message),r.unshift(a);var d={type:s.ErrorTypes.MEDIA_ERROR,parent:a.parent};22!==t.code?(this.appendError?this.appendError++:this.appendError=1,d.details=s.ErrorDetails.BUFFER_APPEND_ERROR,this.appendError>e.config.appendErrorMaxRetry?(o.logger.log("fail "+e.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),this.segments=[],d.fatal=!0,e.trigger(n.default.ERROR,d)):(d.fatal=!1,e.trigger(n.default.ERROR,d))):(this.segments=[],d.details=s.ErrorDetails.BUFFER_FULL_ERROR,d.fatal=!1,e.trigger(n.default.ERROR,d))}}}},r.prototype.flushBuffer=function(t,e,r){var i,n=this.sourceBuffer;if(Object.keys(n).length){if(o.logger.log("flushBuffer,pos/start/end: "+this.media.currentTime.toFixed(3)+"/"+t+"/"+e),this.flushBufferCounter<this.appended){for(var a in n)if(!r||a===r){if(i=n[a],i.ended=!1,i.updating)return o.logger.warn("cannot flush, sb updating in progress"),!1;if(this.removeBufferRange(a,i,t,e))return this.flushBufferCounter++,!1}}else o.logger.warn("abort flushing too many retries");o.logger.log("buffer flushed")}return!0},r.prototype.removeBufferRange=function(t,e,r,i){try{for(var n=0;n<e.buffered.length;n++){var a=e.buffered.start(n),s=e.buffered.end(n),l=Math.max(a,r),u=Math.min(s,i);if(Math.min(u,s)-l>.5)return o.logger.log("sb remove "+t+" ["+l+","+u+"], of ["+a+","+s+"], pos:"+this.media.currentTime),e.remove(l,u),!0}}catch(t){o.logger.warn("removeBufferRange failed",t)}return!1},r}(a.default);e.default=d}).call(this,r("./src/polyfills/number.js").Number)},"./src/controller/cap-level-controller.js":function(t,e,r){"use strict";(function(t){var i=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var n=r("./src/events.js"),a=r("./src/event-handler.js"),o=function(e){function r(r){var i=e.call(this,r,n.default.FPS_DROP_LEVEL_CAPPING,n.default.MEDIA_ATTACHING,n.default.MANIFEST_PARSED,n.default.BUFFER_CODECS,n.default.MEDIA_DETACHING)||this;return i.autoLevelCapping=t.POSITIVE_INFINITY,i.firstLevel=null,i.levels=[],i.media=null,i.restrictedLevels=[],i.timer=null,i}return i(r,e),r.prototype.destroy=function(){this.hls.config.capLevelToPlayerSize&&(this.media=null,this._stopCapping())},r.prototype.onFpsDropLevelCapping=function(t){r.isLevelAllowed(t.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(t.droppedLevel)},r.prototype.onMediaAttaching=function(t){this.media=t.media instanceof window.HTMLVideoElement?t.media:null},r.prototype.onManifestParsed=function(t){var e=this.hls;this.restrictedLevels=[],this.levels=t.levels,this.firstLevel=t.firstLevel,e.config.capLevelToPlayerSize&&t.video&&this._startCapping()},r.prototype.onBufferCodecs=function(t){this.hls.config.capLevelToPlayerSize&&t.video&&this._startCapping()},r.prototype.onLevelsUpdated=function(t){this.levels=t.levels},r.prototype.onMediaDetaching=function(){this._stopCapping()},r.prototype.detectPlayerSize=function(){if(this.media){var t=this.levels?this.levels.length:0;if(t){var e=this.hls;e.autoLevelCapping=this.getMaxLevel(t-1),e.autoLevelCapping>this.autoLevelCapping&&e.streamController.nextLevelSwitch(),this.autoLevelCapping=e.autoLevelCapping}}},r.prototype.getMaxLevel=function(t){var e=this;if(!this.levels)return-1;var i=this.levels.filter(function(i,n){return r.isLevelAllowed(n,e.restrictedLevels)&&n<=t});return r.getMaxLevelByMediaSize(i,this.mediaWidth,this.mediaHeight)},r.prototype._startCapping=function(){this.timer||(this.autoLevelCapping=t.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),clearInterval(this.timer),this.timer=setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())},r.prototype._stopCapping=function(){this.restrictedLevels=[],this.firstLevel=null,this.autoLevelCapping=t.POSITIVE_INFINITY,this.timer&&(this.timer=clearInterval(this.timer),this.timer=null)},Object.defineProperty(r.prototype,"mediaWidth",{get:function(){var t,e=this.media;return e&&(t=e.width||e.clientWidth||e.offsetWidth,t*=r.contentScaleFactor),t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"mediaHeight",{get:function(){var t,e=this.media;return e&&(t=e.height||e.clientHeight||e.offsetHeight,t*=r.contentScaleFactor),t},enumerable:!0,configurable:!0}),Object.defineProperty(r,"contentScaleFactor",{get:function(){var t=1;try{t=window.devicePixelRatio}catch(t){}return t},enumerable:!0,configurable:!0}),r.isLevelAllowed=function(t,e){return void 0===e&&(e=[]),-1===e.indexOf(t)},r.getMaxLevelByMediaSize=function(t,e,r){if(!t||t&&!t.length)return-1;for(var i=t.length-1,n=0;n<t.length;n+=1){var a=t[n];if((a.width>=e||a.height>=r)&&function(t,e){return!e||(t.width!==e.width||t.height!==e.height)}(a,t[n+1])){i=n;break}}return i},r}(a.default);e.default=o}).call(this,r("./src/polyfills/number.js").Number)},"./src/controller/eme-controller.js":function(t,e,r){"use strict";var i=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var n=r("./src/event-handler.js"),a=r("./src/events.js"),o=r("./src/errors.js"),s=r("./src/utils/logger.js"),l=window.XMLHttpRequest,u={WIDEVINE:"com.widevine.alpha",PLAYREADY:"com.microsoft.playready"},d=function(t,e,r){var i={videoCapabilities:[]};return e.forEach(function(t){i.videoCapabilities.push({contentType:'video/mp4; codecs="'+t+'"'})}),[i]},c=function(t,e,r){switch(t){case u.WIDEVINE:return d(0,r);default:throw Error("Unknown key-system: "+t)}},f=function(t){function e(e){var r=t.call(this,e,a.default.MEDIA_ATTACHED,a.default.MANIFEST_PARSED)||this;return r._widevineLicenseUrl=e.config.widevineLicenseUrl,r._licenseXhrSetup=e.config.licenseXhrSetup,r._emeEnabled=e.config.emeEnabled,r._requestMediaKeySystemAccess=e.config.requestMediaKeySystemAccessFunc,r._mediaKeysList=[],r._media=null,r._hasSetMediaKeys=!1,r._isMediaEncrypted=!1,r._requestLicenseFailureCount=0,r}return i(e,t),e.prototype.getLicenseServerUrl=function(t){var e;switch(t){case u.WIDEVINE:e=this._widevineLicenseUrl;break;default:e=null}return e||(s.logger.error('No license server URL configured for key-system "'+t+'"'),this.hls.trigger(a.default.ERROR,{type:o.ErrorTypes.KEY_SYSTEM_ERROR,details:o.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})),e},e.prototype._attemptKeySystemAccess=function(t,e,r){var i=this,n=c(t,0,r);if(!n)return void s.logger.warn("Can not create config for key-system (maybe because platform is not supported):",t);s.logger.log("Requesting encrypted media key-system access"),this.requestMediaKeySystemAccess(t,n).then(function(e){i._onMediaKeySystemAccessObtained(t,e)}).catch(function(e){s.logger.error('Failed to obtain key-system "'+t+'" access:',e)})},Object.defineProperty(e.prototype,"requestMediaKeySystemAccess",{get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess},enumerable:!0,configurable:!0}),e.prototype._onMediaKeySystemAccessObtained=function(t,e){var r=this;s.logger.log('Access for key-system "'+t+'" obtained');var i={mediaKeys:null,mediaKeysSession:null,mediaKeysSessionInitialized:!1,mediaKeySystemAccess:e,mediaKeySystemDomain:t};this._mediaKeysList.push(i),e.createMediaKeys().then(function(e){i.mediaKeys=e,s.logger.log('Media-keys created for key-system "'+t+'"'),r._onMediaKeysCreated()}).catch(function(t){s.logger.error("Failed to create media-keys:",t)})},e.prototype._onMediaKeysCreated=function(){var t=this;this._mediaKeysList.forEach(function(e){e.mediaKeysSession||(e.mediaKeysSession=e.mediaKeys.createSession(),t._onNewMediaKeySession(e.mediaKeysSession))})},e.prototype._onNewMediaKeySession=function(t){var e=this;s.logger.log("New key-system session "+t.sessionId),t.addEventListener("message",function(r){e._onKeySessionMessage(t,r.message)},!1)},e.prototype._onKeySessionMessage=function(t,e){s.logger.log("Got EME message event, creating license request"),this._requestLicense(e,function(e){s.logger.log("Received license data, updating key-session"),t.update(e)})},e.prototype._onMediaEncrypted=function(t,e){s.logger.log('Media is encrypted using "'+t+'" init data type'),this._isMediaEncrypted=!0,this._mediaEncryptionInitDataType=t,this._mediaEncryptionInitData=e,this._attemptSetMediaKeys(),this._generateRequestWithPreferredKeySession()},e.prototype._attemptSetMediaKeys=function(){if(!this._hasSetMediaKeys){var t=this._mediaKeysList[0];if(!t||!t.mediaKeys)return s.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),void this.hls.trigger(a.default.ERROR,{type:o.ErrorTypes.KEY_SYSTEM_ERROR,details:o.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});s.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(t.mediaKeys),this._hasSetMediaKeys=!0}},e.prototype._generateRequestWithPreferredKeySession=function(){var t=this,e=this._mediaKeysList[0];if(!e)return s.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),void this.hls.trigger(a.default.ERROR,{type:o.ErrorTypes.KEY_SYSTEM_ERROR,details:o.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});if(e.mediaKeysSessionInitialized)return void s.logger.warn("Key-Session already initialized but requested again");var r=e.mediaKeysSession;r||(s.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(a.default.ERROR,{type:o.ErrorTypes.KEY_SYSTEM_ERROR,details:o.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0}));var i=this._mediaEncryptionInitDataType,n=this._mediaEncryptionInitData;s.logger.log('Generating key-session request for "'+i+'" init data type'),e.mediaKeysSessionInitialized=!0,r.generateRequest(i,n).then(function(){s.logger.debug("Key-session generation succeeded")}).catch(function(e){s.logger.error("Error generating key-session request:",e),t.hls.trigger(a.default.ERROR,{type:o.ErrorTypes.KEY_SYSTEM_ERROR,details:o.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},e.prototype._createLicenseXhr=function(t,e,r){var i=new l,n=this._licenseXhrSetup;try{if(n)try{n(i,t)}catch(e){i.open("POST",t,!0),n(i,t)}i.readyState||i.open("POST",t,!0)}catch(t){return s.logger.error("Error setting up key-system license XHR",t),void this.hls.trigger(a.default.ERROR,{type:o.ErrorTypes.KEY_SYSTEM_ERROR,details:o.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}return i.responseType="arraybuffer",i.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,i,t,e,r),i},e.prototype._onLicenseRequestReadyStageChange=function(t,e,r,i){switch(t.readyState){case 4:if(200===t.status)this._requestLicenseFailureCount=0,s.logger.log("License request succeeded"),i(t.response);else{if(s.logger.error("License Request XHR failed ("+e+"). Status: "+t.status+" ("+t.statusText+")"),++this._requestLicenseFailureCount<=3){var n=3-this._requestLicenseFailureCount+1;return s.logger.warn("Retrying license request, "+n+" attempts left"),void this._requestLicense(r,i)}this.hls.trigger(a.default.ERROR,{type:o.ErrorTypes.KEY_SYSTEM_ERROR,details:o.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}}},e.prototype._generateLicenseRequestChallenge=function(t,e){var r;return t.mediaKeySystemDomain===u.PLAYREADY?s.logger.error("PlayReady is not supported (yet)"):t.mediaKeySystemDomain===u.WIDEVINE?r=e:s.logger.error("Unsupported key-system:",t.mediaKeySystemDomain),r},e.prototype._requestLicense=function(t,e){s.logger.log("Requesting content license for key-system");var r=this._mediaKeysList[0];if(!r)return s.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),void this.hls.trigger(a.default.ERROR,{type:o.ErrorTypes.KEY_SYSTEM_ERROR,details:o.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});var i=this.getLicenseServerUrl(r.mediaKeySystemDomain),n=this._createLicenseXhr(i,t,e);s.logger.log("Sending license request to URL: "+i),n.send(this._generateLicenseRequestChallenge(r,t))},e.prototype.onMediaAttached=function(t){var e=this;if(this._emeEnabled){var r=t.media;this._media=r,r.addEventListener("encrypted",function(t){e._onMediaEncrypted(t.initDataType,t.initData)})}},e.prototype.onManifestParsed=function(t){if(this._emeEnabled){var e=t.levels.map(function(t){return t.audioCodec}),r=t.levels.map(function(t){return t.videoCodec});this._attemptKeySystemAccess(u.WIDEVINE,e,r)}},e}(n.default);e.default=f},"./src/controller/fps-controller.js":function(t,e,r){"use strict";var i=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var n=r("./src/events.js"),a=r("./src/event-handler.js"),o=r("./src/utils/logger.js"),s=window.performance,l=function(t){function e(e){return t.call(this,e,n.default.MEDIA_ATTACHING)||this}return i(e,t),e.prototype.destroy=function(){this.timer&&clearInterval(this.timer),this.isVideoPlaybackQualityAvailable=!1},e.prototype.onMediaAttaching=function(t){var e=this.hls.config;if(e.capLevelOnFPSDrop){"function"==typeof(this.video=t.media instanceof window.HTMLVideoElement?t.media:null).getVideoPlaybackQuality&&(this.isVideoPlaybackQualityAvailable=!0),clearInterval(this.timer),this.timer=setInterval(this.checkFPSInterval.bind(this),e.fpsDroppedMonitoringPeriod)}},e.prototype.checkFPS=function(t,e,r){var i=s.now();if(e){if(this.lastTime){var a=i-this.lastTime,l=r-this.lastDroppedFrames,u=e-this.lastDecodedFrames,d=1e3*l/a,c=this.hls;if(c.trigger(n.default.FPS_DROP,{currentDropped:l,currentDecoded:u,totalDroppedFrames:r}),d>0&&l>c.config.fpsDroppedMonitoringThreshold*u){var f=c.currentLevel;o.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+f),f>0&&(-1===c.autoLevelCapping||c.autoLevelCapping>=f)&&(f-=1,c.trigger(n.default.FPS_DROP_LEVEL_CAPPING,{level:f,droppedLevel:c.currentLevel}),c.autoLevelCapping=f,c.streamController.nextLevelSwitch())}}this.lastTime=i,this.lastDroppedFrames=r,this.lastDecodedFrames=e}},e.prototype.checkFPSInterval=function(){var t=this.video;if(t)if(this.isVideoPlaybackQualityAvailable){var e=t.getVideoPlaybackQuality();this.checkFPS(t,e.totalVideoFrames,e.droppedVideoFrames)}else this.checkFPS(t,t.webkitDecodedFrameCount,t.webkitDroppedFrameCount)},e}(a.default);e.default=l},"./src/controller/fragment-finders.js":function(t,e,r){"use strict";(function(t){function i(e,r,i){if(!Array.isArray(e)||!e.length||!t.isFinite(r))return null;if(r<e[0].programDateTime)return null;if(r>=e[e.length-1].endProgramDateTime)return null;i=i||0;for(var n=0;n<e.length;++n){var a=e[n];if(o(r,i,a))return a}return null}function n(t,e,r,i){void 0===r&&(r=0),void 0===i&&(i=0);var n=t?e[t.sn-e[0].sn+1]:null;return n&&!a(r,i,n)?n:s.default.search(e,a.bind(null,r,i))}function a(t,e,r){void 0===t&&(t=0),void 0===e&&(e=0);var i=Math.min(e,r.duration+(r.deltaPTS?r.deltaPTS:0));return r.start+r.duration-i<=t?1:r.start-i>t&&r.start?-1:0}function o(t,e,r){var i=1e3*Math.min(e,r.duration+(r.deltaPTS?r.deltaPTS:0));return r.endProgramDateTime-i>t}Object.defineProperty(e,"__esModule",{value:!0});var s=r("./src/utils/binary-search.js");e.findFragmentByPDT=i,e.findFragmentByPTS=n,e.fragmentWithinToleranceTest=a,e.pdtWithinToleranceTest=o}).call(this,r("./src/polyfills/number.js").Number)},"./src/controller/fragment-tracker.js":function(t,e,r){"use strict";(function(t){var i=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var n=r("./src/event-handler.js"),a=r("./src/events.js");e.FragmentState={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"};var o=function(r){function o(t){var e=r.call(this,t,a.default.BUFFER_APPENDED,a.default.FRAG_BUFFERED,a.default.FRAG_LOADED)||this;return e.bufferPadding=.2,e.fragments=Object.create(null),e.timeRanges=Object.create(null),e.config=t.config,e}return i(o,r),o.prototype.destroy=function(){this.fragments=null,this.timeRanges=null,this.config=null,n.default.prototype.destroy.call(this),r.prototype.destroy.call(this)},o.prototype.getBufferedFrag=function(t,e){var r=this.fragments,i=Object.keys(r).filter(function(i){var n=r[i];if(n.body.type!==e)return!1;if(!n.buffered)return!1;var a=n.body;return a.startPTS<=t&&t<=a.endPTS});if(0===i.length)return null;var n=i.pop();return r[n].body},o.prototype.detectEvictedFragments=function(t,e){var r,i,n=this;Object.keys(this.fragments).forEach(function(a){var o=n.fragments[a];if(!0===o.buffered){var s=o.range[t];if(s){r=s.time;for(var l=0;l<r.length;l++)if(i=r[l],!1===n.isTimeBuffered(i.startPTS,i.endPTS,e)){n.removeFragment(o.body);break}}}})},o.prototype.detectPartialFragments=function(t){var e=this,r=this.getFragmentKey(t),i=this.fragments[r];i&&(i.buffered=!0,Object.keys(this.timeRanges).forEach(function(r){if(t.hasElementaryStream(r)){var n=e.timeRanges[r];i.range[r]=e.getBufferedTimes(t.startPTS,t.endPTS,n)}}))},o.prototype.getBufferedTimes=function(t,e,r){for(var i,n,a=[],o=!1,s=0;s<r.length;s++){if(i=r.start(s)-this.bufferPadding,n=r.end(s)+this.bufferPadding,t>=i&&e<=n){a.push({startPTS:Math.max(t,r.start(s)),endPTS:Math.min(e,r.end(s))});break}if(t<n&&e>i)a.push({startPTS:Math.max(t,r.start(s)),endPTS:Math.min(e,r.end(s))}),o=!0;else if(e<=i)break}return{time:a,partial:o}},o.prototype.getFragmentKey=function(t){return t.type+"_"+t.level+"_"+t.urlId+"_"+t.sn},o.prototype.getPartialFragment=function(t){var e,r,i,n=this,a=null,o=0;return Object.keys(this.fragments).forEach(function(s){var l=n.fragments[s];n.isPartial(l)&&(r=l.body.startPTS-n.bufferPadding,i=l.body.endPTS+n.bufferPadding,t>=r&&t<=i&&(e=Math.min(t-r,i-t),o<=e&&(a=l.body,o=e)))}),a},o.prototype.getState=function(t){var r=this.getFragmentKey(t),i=this.fragments[r],n=e.FragmentState.NOT_LOADED;return void 0!==i&&(n=i.buffered?!0===this.isPartial(i)?e.FragmentState.PARTIAL:e.FragmentState.OK:e.FragmentState.APPENDING),n},o.prototype.isPartial=function(t){return!0===t.buffered&&(void 0!==t.range.video&&!0===t.range.video.partial||void 0!==t.range.audio&&!0===t.range.audio.partial)},o.prototype.isTimeBuffered=function(t,e,r){for(var i,n,a=0;a<r.length;a++){if(i=r.start(a)-this.bufferPadding,n=r.end(a)+this.bufferPadding,t>=i&&e<=n)return!0;if(e<=i)return!1}return!1},o.prototype.onFragLoaded=function(e){var r=e.frag;t.isFinite(r.sn)&&!r.bitrateTest&&(this.fragments[this.getFragmentKey(r)]={body:r,range:Object.create(null),buffered:!1})},o.prototype.onBufferAppended=function(t){var e=this;this.timeRanges=t.timeRanges,Object.keys(this.timeRanges).forEach(function(t){var r=e.timeRanges[t];e.detectEvictedFragments(t,r)})},o.prototype.onFragBuffered=function(t){this.detectPartialFragments(t.frag)},o.prototype.hasFragment=function(t){var e=this.getFragmentKey(t);return void 0!==this.fragments[e]},o.prototype.removeFragment=function(t){var e=this.getFragmentKey(t);delete this.fragments[e]},o.prototype.removeAllFragments=function(){this.fragments=Object.create(null)},o}(n.default);e.FragmentTracker=o}).call(this,r("./src/polyfills/number.js").Number)},"./src/controller/gap-controller.js":function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r("./src/utils/buffer-helper.js"),n=r("./src/errors.js"),a=r("./src/events.js"),o=r("./src/utils/logger.js"),s=function(){function t(t,e,r,i){this.config=t,this.media=e,this.fragmentTracker=r,this.hls=i,this.stallReported=!1}return t.prototype.poll=function(t,e){var r=this,n=r.config,a=r.media,s=a.currentTime,l=window.performance.now();if(s!==t)return this.stallReported&&(o.logger.warn("playback not stuck anymore @"+s+", after "+Math.round(l-this.stalled)+"ms"),this.stallReported=!1),this.stalled=null,void(this.nudgeRetry=0);if(!(a.ended||!a.buffered.length||a.readyState>2||a.seeking&&i.BufferHelper.isBuffered(a,s))){var u=l-this.stalled,d=i.BufferHelper.bufferInfo(a,s,n.maxBufferHole);if(!this.stalled)return void(this.stalled=l);u>=1e3&&this._reportStall(d.len),this._tryFixBufferStall(d,u)}},t.prototype._tryFixBufferStall=function(t,e){var r=this,i=r.config,n=r.fragmentTracker,a=r.media,o=a.currentTime,s=n.getPartialFragment(o);s&&this._trySkipBufferHole(s),t.len>.5&&e>1e3*i.highBufferWatchdogPeriod&&(this.stalled=null,this._tryNudgeBuffer())},t.prototype._reportStall=function(t){var e=this,r=e.hls,i=e.media;e.stallReported||(this.stallReported=!0,o.logger.warn("Playback stalling at @"+i.currentTime+" due to low buffer"),r.trigger(a.default.ERROR,{type:n.ErrorTypes.MEDIA_ERROR,details:n.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:t}))},t.prototype._trySkipBufferHole=function(t){for(var e=this,r=e.hls,i=e.media,s=i.currentTime,l=0,u=0;u<i.buffered.length;u++){var d=i.buffered.start(u);if(s>=l&&s<d)return i.currentTime=Math.max(d,i.currentTime+.1),o.logger.warn("skipping hole, adjusting currentTime from "+s+" to "+i.currentTime),this.stalled=null,void r.trigger(a.default.ERROR,{type:n.ErrorTypes.MEDIA_ERROR,details:n.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+s+" to "+i.currentTime,frag:t});l=i.buffered.end(u)}},t.prototype._tryNudgeBuffer=function(){var t=this,e=t.config,r=t.hls,i=t.media,s=i.currentTime,l=(this.nudgeRetry||0)+1;if(this.nudgeRetry=l,l<e.nudgeMaxRetry){var u=s+l*e.nudgeOffset;o.logger.log("adjust currentTime from "+s+" to "+u),i.currentTime=u,r.trigger(a.default.ERROR,{type:n.ErrorTypes.MEDIA_ERROR,details:n.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else o.logger.error("still stuck in high buffer @"+s+" after "+e.nudgeMaxRetry+", raise fatal error"),r.trigger(a.default.ERROR,{type:n.ErrorTypes.MEDIA_ERROR,details:n.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},t}();e.default=s},"./src/controller/id3-track-controller.js":function(t,e,r){"use strict";var i=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var n=r("./src/events.js"),a=r("./src/event-handler.js"),o=r("./src/demux/id3.js"),s=r("./src/utils/texttrack-utils.js"),l=function(t){function e(e){var r=t.call(this,e,n.default.MEDIA_ATTACHED,n.default.MEDIA_DETACHING,n.default.FRAG_PARSING_METADATA)||this;return r.id3Track=void 0,r.media=void 0,r}return i(e,t),e.prototype.destroy=function(){a.default.prototype.destroy.call(this)},e.prototype.onMediaAttached=function(t){this.media=t.media,this.media},e.prototype.onMediaDetaching=function(){s.clearCurrentCues(this.id3Track),this.id3Track=void 0,this.media=void 0},e.prototype.getID3Track=function(t){for(var e=0;e<t.length;e++){var r=t[e];if("metadata"===r.kind&&"id3"===r.label)return s.sendAddTrackEvent(r,this.media),r}return this.media.addTextTrack("metadata","id3")},e.prototype.onFragParsingMetadata=function(t){var e=t.frag,r=t.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var i=window.WebKitDataCue||window.VTTCue||window.TextTrackCue,n=0;n<r.length;n++){var a=o.default.getID3Frames(r[n].data);if(a){var s=r[n].pts,l=n<r.length-1?r[n+1].pts:e.endPTS;s===l&&(l+=1e-4);for(var u=0;u<a.length;u++){var d=a[u];if(!o.default.isTimeStampFrame(d)){var c=new i(s,l,"");c.value=d,this.id3Track.addCue(c)}}}}},e}(a.default);e.default=l},"./src/controller/level-controller.js":function(t,e,r){"use strict";var i=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var n,a=r("./src/events.js"),o=r("./src/event-handler.js"),s=r("./src/utils/logger.js"),l=r("./src/errors.js"),u=r("./src/utils/codecs.js"),d=r("./src/controller/level-helper.js"),c=window.performance,f=function(t){function e(e){var r=t.call(this,e,a.default.MANIFEST_LOADED,a.default.LEVEL_LOADED,a.default.AUDIO_TRACK_SWITCHED,a.default.FRAG_LOADED,a.default.ERROR)||this;return r.canload=!1,r.currentLevelIndex=null,r.manualLevelIndex=-1,r.timer=null,n=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),r}return i(e,t),e.prototype.onHandlerDestroying=function(){this.clearTimer(),this.manualLevelIndex=-1},e.prototype.clearTimer=function(){null!==this.timer&&(clearTimeout(this.timer),this.timer=null)},e.prototype.startLoad=function(){var t=this._levels;this.canload=!0,this.levelRetryCount=0,t&&t.forEach(function(t){t.loadError=0;var e=t.details;e&&e.live&&(t.details=void 0)}),null!==this.timer&&this.loadLevel()},e.prototype.stopLoad=function(){this.canload=!1},e.prototype.onManifestLoaded=function(t){var e,r=[],i=[],o={},c=null,f=!1,h=!1;if(t.levels.forEach(function(t){var e=t.attrs;t.loadError=0,t.fragmentError=!1,f=f||!!t.videoCodec,h=h||!!t.audioCodec,n&&t.audioCodec&&-1!==t.audioCodec.indexOf("mp4a.40.34")&&(t.audioCodec=void 0),c=o[t.bitrate],c?c.url.push(t.url):(t.url=[t.url],t.urlId=0,o[t.bitrate]=t,r.push(t)),e&&(e.AUDIO&&(h=!0,d.addGroupId(c||t,"audio",e.AUDIO)),e.SUBTITLES&&d.addGroupId(c||t,"text",e.SUBTITLES))}),f&&h&&(r=r.filter(function(t){return!!t.videoCodec})),r=r.filter(function(t){var e=t.audioCodec,r=t.videoCodec;return(!e||u.isCodecSupportedInMp4(e,"audio"))&&(!r||u.isCodecSupportedInMp4(r,"video"))}),t.audioTracks&&(i=t.audioTracks.filter(function(t){return!t.audioCodec||u.isCodecSupportedInMp4(t.audioCodec,"audio")}),i.forEach(function(t,e){t.id=e})),r.length>0){e=r[0].bitrate,r.sort(function(t,e){return t.bitrate-e.bitrate}),this._levels=r;for(var p=0;p<r.length;p++)if(r[p].bitrate===e){this._firstLevel=p,s.logger.log("manifest loaded,"+r.length+" level(s) found, first bitrate:"+e);break}this.hls.trigger(a.default.MANIFEST_PARSED,{levels:r,audioTracks:i,firstLevel:this._firstLevel,stats:t.stats,audio:h,video:f,altAudio:i.some(function(t){return!!t.url})})}else this.hls.trigger(a.default.ERROR,{type:l.ErrorTypes.MEDIA_ERROR,details:l.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:this.hls.url,reason:"no level with compatible codecs found in manifest"})},Object.defineProperty(e.prototype,"levels",{get:function(){return this._levels},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"level",{get:function(){return this.currentLevelIndex},set:function(t){var e=this._levels;e&&(t=Math.min(t,e.length-1),this.currentLevelIndex===t&&e[t].details||this.setLevelInternal(t))},enumerable:!0,configurable:!0}),e.prototype.setLevelInternal=function(t){var e=this._levels,r=this.hls;if(t>=0&&t<e.length){if(this.clearTimer(),this.currentLevelIndex!==t){s.logger.log("switching to level "+t),this.currentLevelIndex=t;var i=e[t];i.level=t,r.trigger(a.default.LEVEL_SWITCHING,i)}var n=e[t],o=n.details;if(!o||o.live){var u=n.urlId;r.trigger(a.default.LEVEL_LOADING,{url:n.url[u],level:t,id:u})}}else r.trigger(a.default.ERROR,{type:l.ErrorTypes.OTHER_ERROR,details:l.ErrorDetails.LEVEL_SWITCH_ERROR,level:t,fatal:!1,reason:"invalid level idx"})},Object.defineProperty(e.prototype,"manualLevel",{get:function(){return this.manualLevelIndex},set:function(t){this.manualLevelIndex=t,void 0===this._startLevel&&(this._startLevel=t),-1!==t&&(this.level=t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"firstLevel",{get:function(){return this._firstLevel},set:function(t){this._firstLevel=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"startLevel",{get:function(){if(void 0===this._startLevel){var t=this.hls.config.startLevel;return void 0!==t?t:this._firstLevel}return this._startLevel},set:function(t){this._startLevel=t},enumerable:!0,configurable:!0}),e.prototype.onError=function(t){if(t.fatal)return void(t.type===l.ErrorTypes.NETWORK_ERROR&&this.clearTimer());var e,r=!1,i=!1;switch(t.details){case l.ErrorDetails.FRAG_LOAD_ERROR:case l.ErrorDetails.FRAG_LOAD_TIMEOUT:case l.ErrorDetails.KEY_LOAD_ERROR:case l.ErrorDetails.KEY_LOAD_TIMEOUT:e=t.frag.level,i=!0;break;case l.ErrorDetails.LEVEL_LOAD_ERROR:case l.ErrorDetails.LEVEL_LOAD_TIMEOUT:e=t.context.level,r=!0;break;case l.ErrorDetails.REMUX_ALLOC_ERROR:e=t.level,r=!0}void 0!==e&&this.recoverLevel(t,e,r,i)},e.prototype.recoverLevel=function(t,e,r,i){var n,a,o,l=this,u=this.hls.config,d=t.details,c=this._levels[e];if(c.loadError++,c.fragmentError=i,r){if(!(this.levelRetryCount+1<=u.levelLoadingMaxRetry))return s.logger.error("level controller, cannot recover from "+d+" error"),this.currentLevelIndex=null,this.clearTimer(),void(t.fatal=!0);a=Math.min(Math.pow(2,this.levelRetryCount)*u.levelLoadingRetryDelay,u.levelLoadingMaxRetryTimeout),this.timer=setTimeout(function(){return l.loadLevel()},a),t.levelRetry=!0,this.levelRetryCount++,s.logger.warn("level controller, "+d+", retry in "+a+" ms, current retry count is "+this.levelRetryCount)}(r||i)&&(n=c.url.length,n>1&&c.loadError<n?(c.urlId=(c.urlId+1)%n,c.details=void 0,s.logger.warn("level controller, "+d+" for level "+e+": switching to redundant URL-id "+c.urlId)):-1===this.manualLevelIndex?(o=0===e?this._levels.length-1:e-1,s.logger.warn("level controller, "+d+": switch to "+o),this.hls.nextAutoLevel=this.currentLevelIndex=o):i&&(s.logger.warn("level controller, "+d+": reload a fragment"),this.currentLevelIndex=null))},e.prototype.onFragLoaded=function(t){var e=t.frag;if(void 0!==e&&"main"===e.type){var r=this._levels[e.level];void 0!==r&&(r.fragmentError=!1,r.loadError=0,this.levelRetryCount=0)}},e.prototype.onLevelLoaded=function(t){var e=this,r=t.level;if(r===this.currentLevelIndex){var i=this._levels[r];i.fragmentError||(i.loadError=0,this.levelRetryCount=0);var n=t.details;if(n.live){var a=1e3*(n.averagetargetduration?n.averagetargetduration:n.targetduration),o=a,l=i.details;l&&n.endSN===l.endSN&&(o/=2,s.logger.log("same live playlist, reload twice faster")),o-=c.now()-t.stats.trequest,o=Math.max(a/2,Math.round(o)),s.logger.log("live playlist, reload in "+Math.round(o)+" ms"),this.timer=setTimeout(function(){return e.loadLevel()},o)}else this.clearTimer()}},e.prototype.onAudioTrackSwitched=function(t){var e=this.hls.audioTracks[t.id].groupId,r=this.hls.levels[this.currentLevelIndex];if(r&&r.audioGroupIds){var i=r.audioGroupIds.findIndex(function(t){return t===e});i!==r.urlId&&(r.urlId=i,this.startLoad())}},e.prototype.loadLevel=function(){if(s.logger.debug("call to loadLevel"),null!==this.currentLevelIndex&&this.canload){var t=this._levels[this.currentLevelIndex];if("object"==typeof t&&t.url.length>0){var e=this.currentLevelIndex,r=t.urlId,i=t.url[r];s.logger.log("Attempt loading level index "+e+" with URL-id "+r),this.hls.trigger(a.default.LEVEL_LOADING,{url:i,level:e,id:r})}}},Object.defineProperty(e.prototype,"nextLoadLevel",{get:function(){return-1!==this.manualLevelIndex?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(t){this.level=t,-1===this.manualLevelIndex&&(this.hls.nextAutoLevel=t)},enumerable:!0,configurable:!0}),e}(o.default);e.default=f},"./src/controller/level-helper.js":function(t,e,r){"use strict";(function(t){function i(t,e,r){switch(e){case"audio":t.audioGroupIds||(t.audioGroupIds=[]),t.audioGroupIds.push(r);break;case"text":t.textGroupIds||(t.textGroupIds=[]),t.textGroupIds.push(r)}}function n(e,r,i){var n=e[r],a=e[i],o=a.startPTS;t.isFinite(o)?i>r?(n.duration=o-n.start,n.duration<0&&s.logger.warn("negative duration computed for frag "+n.sn+",level "+n.level+", there should be some duration drift between playlist and fragment!")):(a.duration=n.start-o,a.duration<0&&s.logger.warn("negative duration computed for frag "+a.sn+",level "+a.level+", there should be some duration drift between playlist and fragment!")):a.start=i>r?n.start+n.duration:Math.max(n.start-a.duration,0)}function a(e,r,i,a,o,s){var l=i;if(t.isFinite(r.startPTS)){var u=Math.abs(r.startPTS-i);t.isFinite(r.deltaPTS)?r.deltaPTS=Math.max(u,r.deltaPTS):r.deltaPTS=u,l=Math.max(i,r.startPTS),i=Math.min(i,r.startPTS),a=Math.max(a,r.endPTS),o=Math.min(o,r.startDTS),s=Math.max(s,r.endDTS)}var d=i-r.start;r.start=r.startPTS=i,r.maxStartPTS=l,r.endPTS=a,r.startDTS=o,r.endDTS=s,r.duration=a-i;var c=r.sn;if(!e||c<e.startSN||c>e.endSN)return 0;var f,h,p;for(f=c-e.startSN,h=e.fragments,h[f]=r,p=f;p>0;p--)n(h,p,p-1);for(p=f;p<h.length-1;p++)n(h,p,p+1);return e.PTSKnown=!0,d}function o(e,r){var i,n=Math.max(e.startSN,r.startSN)-r.startSN,o=Math.min(e.endSN,r.endSN)-r.startSN,l=r.startSN-e.startSN,u=e.fragments,d=r.fragments,c=0;if(r.initSegment&&e.initSegment&&(r.initSegment=e.initSegment),o<n)return void(r.PTSKnown=!1);for(var f=n;f<=o;f++){var h=u[l+f],p=d[f];p&&h&&(c=h.cc-p.cc,t.isFinite(h.startPTS)&&(p.start=p.startPTS=h.startPTS,p.endPTS=h.endPTS,p.duration=h.duration,p.backtracked=h.backtracked,p.dropped=h.dropped,i=p))}if(c)for(s.logger.log("discontinuity sliding from playlist, take drift into account"),f=0;f<d.length;f++)d[f].cc+=c;if(i)a(r,i,i.startPTS,i.endPTS,i.startDTS,i.endDTS);else if(l>=0&&l<u.length){var g=u[l].start;for(f=0;f<d.length;f++)d[f].start+=g}r.PTSKnown=e.PTSKnown}Object.defineProperty(e,"__esModule",{value:!0});var s=r("./src/utils/logger.js");e.addGroupId=i,e.updatePTS=n,e.updateFragPTSDTS=a,e.mergeDetails=o}).call(this,r("./src/polyfills/number.js").Number)},"./src/controller/stream-controller.js":function(t,e,r){"use strict";(function(t){var i=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var n=r("./src/utils/binary-search.js"),a=r("./src/utils/buffer-helper.js"),o=r("./src/demux/demuxer.js"),s=r("./src/events.js"),l=r("./src/controller/fragment-tracker.js"),u=r("./src/loader/fragment.js"),d=r("./src/loader/playlist-loader.js"),c=r("./src/controller/level-helper.js"),f=r("./src/utils/time-ranges.js"),h=r("./src/errors.js"),p=r("./src/utils/logger.js"),g=r("./src/utils/discontinuities.js"),y=r("./src/controller/fragment-finders.js"),m=r("./src/controller/gap-controller.js"),v=r("./src/controller/base-stream-controller.js"),A=function(e){function r(t,r){var i=e.call(this,t,s.default.MEDIA_ATTACHED,s.default.MEDIA_DETACHING,s.default.MANIFEST_LOADING,s.default.MANIFEST_PARSED,s.default.LEVEL_LOADED,s.default.KEY_LOADED,s.default.FRAG_LOADED,s.default.FRAG_LOAD_EMERGENCY_ABORTED,s.default.FRAG_PARSING_INIT_SEGMENT,s.default.FRAG_PARSING_DATA,s.default.FRAG_PARSED,s.default.ERROR,s.default.AUDIO_TRACK_SWITCHING,s.default.AUDIO_TRACK_SWITCHED,s.default.BUFFER_CREATED,s.default.BUFFER_APPENDED,s.default.BUFFER_FLUSHED)||this;return i.fragmentTracker=r,i.config=t.config,i.audioCodecSwap=!1,i._state=v.State.STOPPED,i.stallReported=!1,i.gapController=null,i}return i(r,e),r.prototype.onHandlerDestroying=function(){this.stopLoad(),e.prototype.onHandlerDestroying.call(this)},r.prototype.onHandlerDestroyed=function(){this.state=v.State.STOPPED,this.fragmentTracker=null,e.prototype.onHandlerDestroyed.call(this)},r.prototype.startLoad=function(t){if(this.levels){var e=this.lastCurrentTime,r=this.hls;if(this.stopLoad(),this.setInterval(100),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var i=r.startLevel;-1===i&&(i=0,this.bitrateTest=!0),this.level=r.nextLoadLevel=i,this.loadedmetadata=!1}e>0&&-1===t&&(p.logger.log("override startPosition with lastCurrentTime @"+e.toFixed(3)),t=e),this.state=v.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=t,this.tick()}else this.forceStartLoad=!0,this.state=v.State.STOPPED},r.prototype.stopLoad=function(){var t=this.fragCurrent;t&&(t.loader&&t.loader.abort(),this.fragmentTracker.removeFragment(t),this.fragCurrent=null),this.fragPrevious=null,this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.clearInterval(),this.state=v.State.STOPPED,this.forceStartLoad=!1},r.prototype.doTick=function(){switch(this.state){case v.State.BUFFER_FLUSHING:this.fragLoadError=0;break;case v.State.IDLE:this._doTickIdle();break;case v.State.WAITING_LEVEL:var t=this.levels[this.level];t&&t.details&&(this.state=v.State.IDLE);break;case v.State.FRAG_LOADING_WAITING_RETRY:var e=window.performance.now(),r=this.retryDate;(!r||e>=r||this.media&&this.media.seeking)&&(p.logger.log("mediaController: retryDate reached, switch back to IDLE state"),this.state=v.State.IDLE);break;case v.State.ERROR:case v.State.STOPPED:case v.State.FRAG_LOADING:case v.State.PARSING:case v.State.PARSED:case v.State.ENDED:}this._checkBuffer(),this._checkFragmentChanged()},r.prototype._doTickIdle=function(){var t=this.hls,e=t.config,r=this.media;if(void 0!==this.levelLastLoaded&&(r||!this.startFragRequested&&e.startFragPrefetch)){var i;i=this.loadedmetadata?r.currentTime:this.nextLoadPosition;var n=t.nextLoadLevel,o=this.levels[n];if(o){var l,u=o.bitrate;l=u?Math.max(8*e.maxBufferSize/u,e.maxBufferLength):e.maxBufferLength,l=Math.min(l,e.maxMaxBufferLength);var d=a.BufferHelper.bufferInfo(this.mediaBuffer?this.mediaBuffer:r,i,e.maxBufferHole),c=d.len;if(!(c>=l)){p.logger.trace("buffer length of "+c.toFixed(3)+" is below max of "+l.toFixed(3)+". checking for more payload ..."),this.level=t.nextLoadLevel=n;var f=o.details;if(!f||f.live&&this.levelLastLoaded!==n)return void(this.state=v.State.WAITING_LEVEL);if(this._streamEnded(d,f)){var h={};return this.altAudio&&(h.type="video"),this.hls.trigger(s.default.BUFFER_EOS,h),void(this.state=v.State.ENDED)}this._fetchPayloadOrEos(i,d,f)}}}},r.prototype._fetchPayloadOrEos=function(t,e,r){var i=this.fragPrevious,n=this.level,a=r.fragments,o=a.length;if(0!==o){var s,l=a[0].start,u=a[o-1].start+a[o-1].duration,d=e.end;if(r.initSegment&&!r.initSegment.data)s=r.initSegment;else if(r.live){var c=this.config.initialLiveManifestSize;if(o<c)return void p.logger.warn("Can not start playback of a level, reason: not enough fragments "+o+" < "+c);if(null===(s=this._ensureFragmentAtLivePoint(r,d,l,u,i,a,o)))return}else d<l&&(s=a[0]);s||(s=this._findFragment(l,i,o,a,d,u,r)),s&&(s.encrypted?(p.logger.log("Loading key for "+s.sn+" of ["+r.startSN+" ,"+r.endSN+"],level "+n),this._loadKey(s)):(p.logger.log("Loading "+s.sn+" of ["+r.startSN+" ,"+r.endSN+"],level "+n+", currentTime:"+t.toFixed(3)+",bufferEnd:"+d.toFixed(3)),this._loadFragment(s)))}},r.prototype._ensureFragmentAtLivePoint=function(t,e,r,i,a,o,s){var l,u=this.hls.config,d=this.media,c=void 0!==u.liveMaxLatencyDuration?u.liveMaxLatencyDuration:u.liveMaxLatencyDurationCount*t.targetduration;if(e<Math.max(r-u.maxFragLookUpTolerance,i-c)){var f=this.liveSyncPosition=this.computeLivePosition(r,t);p.logger.log("buffer end: "+e.toFixed(3)+" is located too far from the end of live sliding playlist, reset currentTime to : "+f.toFixed(3)),e=f,d&&d.readyState&&d.duration>f&&(d.currentTime=f),this.nextLoadPosition=f}if(t.PTSKnown&&e>i&&d&&d.readyState)return null;if(this.startFragRequested&&!t.PTSKnown){if(a)if(t.hasProgramDateTime)p.logger.log("live playlist, switching playlist, load frag with same PDT: "+a.programDateTime),l=y.findFragmentByPDT(o,a.endProgramDateTime,u.maxFragLookUpTolerance);else{var h=a.sn+1;if(h>=t.startSN&&h<=t.endSN){var g=o[h-t.startSN];a.cc===g.cc&&(l=g,p.logger.log("live playlist, switching playlist, load frag with next SN: "+l.sn))}l||(l=n.default.search(o,function(t){return a.cc-t.cc}))&&p.logger.log("live playlist, switching playlist, load frag with same CC: "+l.sn)}l||(l=o[Math.min(s-1,Math.round(s/2))],p.logger.log("live playlist, switching playlist, unknown, load middle frag : "+l.sn))}return l},r.prototype._findFragment=function(t,e,r,i,n,a,o){var s,l=this.hls.config;if(n<a){var u=n>a-l.maxFragLookUpTolerance?0:l.maxFragLookUpTolerance;s=y.findFragmentByPTS(e,i,n,u)}else s=i[r-1];if(s){var d=s.sn-o.startSN,c=e&&s.level===e.level,f=i[d-1],h=i[d+1];if(e&&s.sn===e.sn)if(c&&!s.backtracked)if(s.sn<o.endSN){var g=e.deltaPTS;g&&g>l.maxBufferHole&&e.dropped&&d?(s=f,p.logger.warn("SN just loaded, with large PTS gap between audio and video, maybe frag is not starting with a keyframe ? load previous one to try to overcome this")):(s=h,p.logger.log("SN just loaded, load next one: "+s.sn,s))}else s=null;else s.backtracked&&(h&&h.backtracked?(p.logger.warn("Already backtracked from fragment "+h.sn+", will not backtrack to fragment "+s.sn+". Loading fragment "+h.sn),s=h):(p.logger.warn("Loaded fragment with dropped frames, backtracking 1 segment to find a keyframe"),s.dropped=0,f?(s=f,s.backtracked=!0):d&&(s=null)))}return s},r.prototype._loadKey=function(t){this.state=v.State.KEY_LOADING,this.hls.trigger(s.default.KEY_LOADING,{frag:t})},r.prototype._loadFragment=function(e){var r=this.fragmentTracker.getState(e);this.fragCurrent=e,this.startFragRequested=!0,t.isFinite(e.sn)&&!e.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),e.backtracked||r===l.FragmentState.NOT_LOADED||r===l.FragmentState.PARTIAL?(e.autoLevel=this.hls.autoLevelEnabled,e.bitrateTest=this.bitrateTest,this.hls.trigger(s.default.FRAG_LOADING,{frag:e}),this.demuxer||(this.demuxer=new o.default(this.hls,"main")),this.state=v.State.FRAG_LOADING):r===l.FragmentState.APPENDING&&this._reduceMaxBufferLength(e.duration)&&this.fragmentTracker.removeFragment(e)},Object.defineProperty(r.prototype,"state",{get:function(){return this._state},set:function(t){if(this.state!==t){var e=this.state;this._state=t,p.logger.log("main stream:"+e+"->"+t),this.hls.trigger(s.default.STREAM_STATE_TRANSITION,{previousState:e,nextState:t})}},enumerable:!0,configurable:!0}),r.prototype.getBufferedFrag=function(t){return this.fragmentTracker.getBufferedFrag(t,d.default.LevelType.MAIN)},Object.defineProperty(r.prototype,"currentLevel",{get:function(){var t=this.media;if(t){var e=this.getBufferedFrag(t.currentTime);if(e)return e.level}return-1},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"nextBufferedFrag",{get:function(){var t=this.media;return t?this.followingBufferedFrag(this.getBufferedFrag(t.currentTime)):null},enumerable:!0,configurable:!0}),r.prototype.followingBufferedFrag=function(t){return t?this.getBufferedFrag(t.endPTS+.5):null},Object.defineProperty(r.prototype,"nextLevel",{get:function(){var t=this.nextBufferedFrag;return t?t.level:-1},enumerable:!0,configurable:!0}),r.prototype._checkFragmentChanged=function(){var t,e,r=this.media;if(r&&r.readyState&&!1===r.seeking&&(e=r.currentTime,e>this.lastCurrentTime&&(this.lastCurrentTime=e),a.BufferHelper.isBuffered(r,e)?t=this.getBufferedFrag(e):a.BufferHelper.isBuffered(r,e+.1)&&(t=this.getBufferedFrag(e+.1)),t)){var i=t;if(i!==this.fragPlaying){this.hls.trigger(s.default.FRAG_CHANGED,{frag:i});var n=i.level;this.fragPlaying&&this.fragPlaying.level===n||this.hls.trigger(s.default.LEVEL_SWITCHED,{level:n}),this.fragPlaying=i}}},r.prototype.immediateLevelSwitch=function(){if(p.logger.log("immediateLevelSwitch"),!this.immediateSwitch){this.immediateSwitch=!0;var e=this.media,r=void 0;e?(r=e.paused,e.pause()):r=!0,this.previouslyPaused=r}var i=this.fragCurrent;i&&i.loader&&i.loader.abort(),this.fragCurrent=null,this.flushMainBuffer(0,t.POSITIVE_INFINITY)},r.prototype.immediateLevelSwitchEnd=function(){var t=this.media;t&&t.buffered.length&&(this.immediateSwitch=!1,a.BufferHelper.isBuffered(t,t.currentTime)&&(t.currentTime-=1e-4),this.previouslyPaused||t.play())},r.prototype.nextLevelSwitch=function(){var e=this.media;if(e&&e.readyState){var r=void 0,i=void 0,n=void 0;if(i=this.getBufferedFrag(e.currentTime),i&&i.startPTS>1&&this.flushMainBuffer(0,i.startPTS-1),e.paused)r=0;else{var a=this.hls.nextLoadLevel,o=this.levels[a],s=this.fragLastKbps;r=s&&this.fragCurrent?this.fragCurrent.duration*o.bitrate/(1e3*s)+1:0}if((n=this.getBufferedFrag(e.currentTime+r))&&(n=this.followingBufferedFrag(n))){var l=this.fragCurrent;l&&l.loader&&l.loader.abort(),this.fragCurrent=null,this.flushMainBuffer(n.maxStartPTS,t.POSITIVE_INFINITY)}}},r.prototype.flushMainBuffer=function(t,e){this.state=v.State.BUFFER_FLUSHING;var r={startOffset:t,endOffset:e};this.altAudio&&(r.type="video"),this.hls.trigger(s.default.BUFFER_FLUSHING,r)},r.prototype.onMediaAttached=function(t){var e=this.media=this.mediaBuffer=t.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),this.onvended=this.onMediaEnded.bind(this),e.addEventListener("seeking",this.onvseeking),e.addEventListener("seeked",this.onvseeked),e.addEventListener("ended",this.onvended);var r=this.config;this.levels&&r.autoStartLoad&&this.hls.startLoad(r.startPosition),this.gapController=new m.default(r,e,this.fragmentTracker,this.hls)},r.prototype.onMediaDetaching=function(){var t=this.media;t&&t.ended&&(p.logger.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0);var e=this.levels;e&&e.forEach(function(t){t.details&&t.details.fragments.forEach(function(t){t.backtracked=void 0})}),t&&(t.removeEventListener("seeking",this.onvseeking),t.removeEventListener("seeked",this.onvseeked),t.removeEventListener("ended",this.onvended),this.onvseeking=this.onvseeked=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.stopLoad()},r.prototype.onMediaSeeked=function(){var e=this.media,r=e?e.currentTime:void 0;t.isFinite(r)&&p.logger.log("media seeked to "+r.toFixed(3)),this.tick()},r.prototype.onManifestLoading=function(){p.logger.log("trigger BUFFER_RESET"),this.hls.trigger(s.default.BUFFER_RESET),this.fragmentTracker.removeAllFragments(),this.stalled=!1,this.startPosition=this.lastCurrentTime=0},r.prototype.onManifestParsed=function(t){var e,r=!1,i=!1;t.levels.forEach(function(t){(e=t.audioCodec)&&(-1!==e.indexOf("mp4a.40.2")&&(r=!0),-1!==e.indexOf("mp4a.40.5")&&(i=!0))}),this.audioCodecSwitch=r&&i,this.audioCodecSwitch&&p.logger.log("both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=t.levels,this.startFragRequested=!1;var n=this.config;(n.autoStartLoad||this.forceStartLoad)&&this.hls.startLoad(n.startPosition)},r.prototype.onLevelLoaded=function(e){var r=e.details,i=e.level,n=this.levels[this.levelLastLoaded],a=this.levels[i],o=r.totalduration,l=0;if(p.logger.log("level "+i+" loaded ["+r.startSN+","+r.endSN+"],duration:"+o),r.live){var u=a.details;u&&r.fragments.length>0?(c.mergeDetails(u,r),l=r.fragments[0].start,this.liveSyncPosition=this.computeLivePosition(l,u),r.PTSKnown&&t.isFinite(l)?p.logger.log("live playlist sliding:"+l.toFixed(3)):(p.logger.log("live playlist - outdated PTS, unknown sliding"),g.alignStream(this.fragPrevious,n,r))):(p.logger.log("live playlist - first load, unknown sliding"),r.PTSKnown=!1,g.alignStream(this.fragPrevious,n,r))}else r.PTSKnown=!1;if(a.details=r,this.levelLastLoaded=i,this.hls.trigger(s.default.LEVEL_UPDATED,{details:r,level:i}),!1===this.startFragRequested){if(-1===this.startPosition||-1===this.lastCurrentTime){var d=r.startTimeOffset;t.isFinite(d)?(d<0&&(p.logger.log("negative start time offset "+d+", count from end of last fragment"),d=l+o+d),p.logger.log("start time offset found in playlist, adjust startPosition to "+d),this.startPosition=d):r.live?(this.startPosition=this.computeLivePosition(l,r),p.logger.log("configure startPosition to "+this.startPosition)):this.startPosition=0,this.lastCurrentTime=this.startPosition}this.nextLoadPosition=this.startPosition}this.state===v.State.WAITING_LEVEL&&(this.state=v.State.IDLE),this.tick()},r.prototype.onKeyLoaded=function(){this.state===v.State.KEY_LOADING&&(this.state=v.State.IDLE,this.tick())},r.prototype.onFragLoaded=function(t){var e=this,r=e.fragCurrent,i=e.hls,n=e.levels,a=e.media,l=t.frag;if(this.state===v.State.FRAG_LOADING&&r&&"main"===l.type&&l.level===r.level&&l.sn===r.sn){var u=t.stats,d=n[r.level],c=d.details;if(this.bitrateTest=!1,this.stats=u,p.logger.log("Loaded "+r.sn+" of ["+c.startSN+" ,"+c.endSN+"],level "+r.level),l.bitrateTest&&i.nextLoadLevel)this.state=v.State.IDLE,this.startFragRequested=!1,u.tparsed=u.tbuffered=window.performance.now(),i.trigger(s.default.FRAG_BUFFERED,{stats:u,frag:r,id:"main"}),this.tick();else if("initSegment"===l.sn)this.state=v.State.IDLE,u.tparsed=u.tbuffered=window.performance.now(),c.initSegment.data=t.payload,i.trigger(s.default.FRAG_BUFFERED,{stats:u,frag:r,id:"main"}),this.tick();else{p.logger.log("Parsing "+r.sn+" of ["+c.startSN+" ,"+c.endSN+"],level "+r.level+", cc "+r.cc),this.state=v.State.PARSING,this.pendingBuffering=!0,this.appended=!1,l.bitrateTest&&(l.bitrateTest=!1,this.fragmentTracker.onFragLoaded({frag:l}));var f=!(a&&a.seeking)&&(c.PTSKnown||!c.live),h=c.initSegment?c.initSegment.data:[],g=this._getAudioCodec(d),y=this.demuxer=this.demuxer||new o.default(this.hls,"main");y.push(t.payload,h,g,d.videoCodec,r,c.totalduration,f)}}this.fragLoadError=0},r.prototype.onFragParsingInitSegment=function(t){var e=this.fragCurrent,r=t.frag;if(e&&"main"===t.id&&r.sn===e.sn&&r.level===e.level&&this.state===v.State.PARSING){var i=t.tracks,n=void 0,a=void 0;if(i.audio&&this.altAudio&&delete i.audio,a=i.audio){var o=this.levels[this.level].audioCodec,l=navigator.userAgent.toLowerCase();o&&this.audioCodecSwap&&(p.logger.log("swapping playlist audio codec"),o=-1!==o.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5"),this.audioCodecSwitch&&1!==a.metadata.channelCount&&-1===l.indexOf("firefox")&&(o="mp4a.40.5"),-1!==l.indexOf("android")&&"audio/mpeg"!==a.container&&(o="mp4a.40.2",p.logger.log("Android: force audio codec to "+o)),a.levelCodec=o,a.id=t.id}a=i.video,a&&(a.levelCodec=this.levels[this.level].videoCodec,a.id=t.id),this.hls.trigger(s.default.BUFFER_CODECS,i);for(n in i){a=i[n],p.logger.log("main track:"+n+",container:"+a.container+",codecs[level/parsed]=["+a.levelCodec+"/"+a.codec+"]");var u=a.initSegment;u&&(this.appended=!0,this.pendingBuffering=!0,this.hls.trigger(s.default.BUFFER_APPENDING,{type:n,data:u,parent:"main",content:"initSegment"}))}this.tick()}},r.prototype.onFragParsingData=function(e){var r=this,i=this.fragCurrent,n=e.frag;if(i&&"main"===e.id&&n.sn===i.sn&&n.level===i.level&&("audio"!==e.type||!this.altAudio)&&this.state===v.State.PARSING){var a=this.levels[this.level],o=i;if(t.isFinite(e.endPTS)||(e.endPTS=e.startPTS+i.duration,e.endDTS=e.startDTS+i.duration),!0===e.hasAudio&&o.addElementaryStream(u.default.ElementaryStreamTypes.AUDIO),!0===e.hasVideo&&o.addElementaryStream(u.default.ElementaryStreamTypes.VIDEO),p.logger.log("Parsed "+e.type+",PTS:["+e.startPTS.toFixed(3)+","+e.endPTS.toFixed(3)+"],DTS:["+e.startDTS.toFixed(3)+"/"+e.endDTS.toFixed(3)+"],nb:"+e.nb+",dropped:"+(e.dropped||0)),"video"===e.type)if(o.dropped=e.dropped,o.dropped)if(o.backtracked)p.logger.warn("Already backtracked on this fragment, appending with the gap",o.sn);else{var l=a.details;if(!l||o.sn!==l.startSN)return p.logger.warn("missing video frame(s), backtracking fragment",o.sn),this.fragmentTracker.removeFragment(o),o.backtracked=!0,this.nextLoadPosition=e.startPTS,this.state=v.State.IDLE,this.fragPrevious=o,void this.tick();p.logger.warn("missing video frame(s) on first frag, appending with gap",o.sn)}else o.backtracked=!1;var d=c.updateFragPTSDTS(a.details,o,e.startPTS,e.endPTS,e.startDTS,e.endDTS),f=this.hls;f.trigger(s.default.LEVEL_PTS_UPDATED,{details:a.details,level:this.level,drift:d,type:e.type,start:e.startPTS,end:e.endPTS}),[e.data1,e.data2].forEach(function(t){t&&t.length&&r.state===v.State.PARSING&&(r.appended=!0,r.pendingBuffering=!0,f.trigger(s.default.BUFFER_APPENDING,{type:e.type,data:t,parent:"main",content:"data"}))}),this.tick()}},r.prototype.onFragParsed=function(t){var e=this.fragCurrent,r=t.frag;e&&"main"===t.id&&r.sn===e.sn&&r.level===e.level&&this.state===v.State.PARSING&&(this.stats.tparsed=window.performance.now(),this.state=v.State.PARSED,this._checkAppendedParsed())},r.prototype.onAudioTrackSwitching=function(e){var r=!!e.url,i=e.id;if(!r){if(this.mediaBuffer!==this.media){p.logger.log("switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var n=this.fragCurrent;n.loader&&(p.logger.log("switching to main audio track, cancel main fragment load"),n.loader.abort()),this.fragCurrent=null,this.fragPrevious=null,this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.state=v.State.IDLE}var a=this.hls;a.trigger(s.default.BUFFER_FLUSHING,{startOffset:0,endOffset:t.POSITIVE_INFINITY,type:"audio"}),a.trigger(s.default.AUDIO_TRACK_SWITCHED,{id:i}),this.altAudio=!1}},r.prototype.onAudioTrackSwitched=function(t){var e=t.id,r=!!this.hls.audioTracks[e].url;if(r){var i=this.videoBuffer;i&&this.mediaBuffer!==i&&(p.logger.log("switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=i)}this.altAudio=r,this.tick()},r.prototype.onBufferCreated=function(t){var e,r,i=t.tracks,n=!1;for(var a in i){var o=i[a];"main"===o.id?(r=a,e=o,"video"===a&&(this.videoBuffer=i[a].buffer)):n=!0}n&&e?(p.logger.log("alternate track found, use "+r+".buffered to schedule main fragment loading"),this.mediaBuffer=e.buffer):this.mediaBuffer=this.media},r.prototype.onBufferAppended=function(t){if("main"===t.parent){var e=this.state;e!==v.State.PARSING&&e!==v.State.PARSED||(this.pendingBuffering=t.pending>0,this._checkAppendedParsed())}},r.prototype._checkAppendedParsed=function(){if(!(this.state!==v.State.PARSED||this.appended&&this.pendingBuffering)){var t=this.fragCurrent;if(t){var e=this.mediaBuffer?this.mediaBuffer:this.media;p.logger.log("main buffered : "+f.default.toString(e.buffered)),this.fragPrevious=t;var r=this.stats;r.tbuffered=window.performance.now(),this.fragLastKbps=Math.round(8*r.total/(r.tbuffered-r.tfirst)),this.hls.trigger(s.default.FRAG_BUFFERED,{stats:r,frag:t,id:"main"}),this.state=v.State.IDLE}this.tick()}},r.prototype.onError=function(e){var r=e.frag||this.fragCurrent;if(!r||"main"===r.type){var i=!!this.media&&a.BufferHelper.isBuffered(this.media,this.media.currentTime)&&a.BufferHelper.isBuffered(this.media,this.media.currentTime+.5);switch(e.details){case h.ErrorDetails.FRAG_LOAD_ERROR:case h.ErrorDetails.FRAG_LOAD_TIMEOUT:case h.ErrorDetails.KEY_LOAD_ERROR:case h.ErrorDetails.KEY_LOAD_TIMEOUT:if(!e.fatal)if(this.fragLoadError+1<=this.config.fragLoadingMaxRetry){var n=Math.min(Math.pow(2,this.fragLoadError)*this.config.fragLoadingRetryDelay,this.config.fragLoadingMaxRetryTimeout);p.logger.warn("mediaController: frag loading failed, retry in "+n+" ms"),this.retryDate=window.performance.now()+n,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.fragLoadError++,this.state=v.State.FRAG_LOADING_WAITING_RETRY}else p.logger.error("mediaController: "+e.details+" reaches max retry, redispatch as fatal ..."),e.fatal=!0,this.state=v.State.ERROR;break;case h.ErrorDetails.LEVEL_LOAD_ERROR:case h.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==v.State.ERROR&&(e.fatal?(this.state=v.State.ERROR,p.logger.warn("streamController: "+e.details+",switch to "+this.state+" state ...")):e.levelRetry||this.state!==v.State.WAITING_LEVEL||(this.state=v.State.IDLE));break;case h.ErrorDetails.BUFFER_FULL_ERROR:"main"!==e.parent||this.state!==v.State.PARSING&&this.state!==v.State.PARSED||(i?(this._reduceMaxBufferLength(this.config.maxBufferLength),this.state=v.State.IDLE):(p.logger.warn("buffer full error also media.currentTime is not buffered, flush everything"),this.fragCurrent=null,this.flushMainBuffer(0,t.POSITIVE_INFINITY)))}}},r.prototype._reduceMaxBufferLength=function(t){var e=this.config;return e.maxMaxBufferLength>=t&&(e.maxMaxBufferLength/=2,p.logger.warn("main:reduce max buffer length to "+e.maxMaxBufferLength+"s"),!0)},r.prototype._checkBuffer=function(){var t=this.media;if(t&&0!==t.readyState){var e=this.mediaBuffer?this.mediaBuffer:t,r=e.buffered;!this.loadedmetadata&&r.length?(this.loadedmetadata=!0,this._seekToStartPos()):this.immediateSwitch?this.immediateLevelSwitchEnd():this.gapController.poll(this.lastCurrentTime,r)}},r.prototype.onFragLoadEmergencyAborted=function(){this.state=v.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tick()},r.prototype.onBufferFlushed=function(){var t=this.mediaBuffer?this.mediaBuffer:this.media;t&&this.fragmentTracker.detectEvictedFragments(u.default.ElementaryStreamTypes.VIDEO,t.buffered),this.state=v.State.IDLE,this.fragPrevious=null},r.prototype.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},r.prototype.computeLivePosition=function(t,e){var r=void 0!==this.config.liveSyncDuration?this.config.liveSyncDuration:this.config.liveSyncDurationCount*e.targetduration;return t+Math.max(0,e.totalduration-r)},r.prototype._seekToStartPos=function(){var t=this.media,e=t.currentTime,r=t.seeking?e:this.startPosition;e!==r&&(p.logger.log("target start position not buffered, seek to buffered.start(0) "+r+" from current time "+e+" "),t.currentTime=r)},r.prototype._getAudioCodec=function(t){var e=this.config.defaultAudioCodec||t.audioCodec;return this.audioCodecSwap&&(p.logger.log("swapping playlist audio codec"),e&&(e=-1!==e.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5")),e},Object.defineProperty(r.prototype,"liveSyncPosition",{get:function(){return this._liveSyncPosition},set:function(t){this._liveSyncPosition=t},enumerable:!0,configurable:!0}),r}(v.default);e.default=A}).call(this,r("./src/polyfills/number.js").Number)},"./src/controller/subtitle-stream-controller.js":function(t,e,r){"use strict";var i=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var n=r("./src/events.js"),a=r("./src/utils/logger.js"),o=r("./src/crypt/decrypter.js"),s=r("./src/task-loop.js"),l=r("./src/utils/buffer-helper.js"),u=r("./src/controller/fragment-finders.js"),d=r("./src/controller/fragment-tracker.js"),c=window.performance;e.SubtitleStreamControllerState={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING"};var f=e.SubtitleStreamControllerState,h=function(t){function e(e,r){var i=t.call(this,e,n.default.MEDIA_ATTACHED,n.default.MEDIA_DETACHING,n.default.ERROR,n.default.KEY_LOADED,n.default.FRAG_LOADED,n.default.SUBTITLE_TRACKS_UPDATED,n.default.SUBTITLE_TRACK_SWITCH,n.default.SUBTITLE_TRACK_LOADED,n.default.SUBTITLE_FRAG_PROCESSED)||this;return i.fragmentTracker=r,i.config=e.config,i.state=f.STOPPED,i.tracks=[],i.tracksBuffered=[],i.currentTrackId=-1,i.decrypter=new o.default(e,e.config),i}return i(e,t),e.prototype.onHandlerDestroyed=function(){this.fragmentTracker=null,this.state=f.STOPPED,t.prototype.onHandlerDestroyed.call(this)},e.prototype.onSubtitleFragProcessed=function(t){if(this.state=f.IDLE,t.success){var e=this.tracksBuffered[this.currentTrackId],r=t.frag;if(this.fragPrevious=r,e){for(var i,n=0;n<e.length;n++)if(r.start>=e[n].start&&r.start<=e[n].end){i=e[n];break}i?i.end=r.start+r.duration:e.push({start:r.start,end:r.start+r.duration})}}},e.prototype.onMediaAttached=function(t){this.media=t.media,this.state=f.IDLE},e.prototype.onMediaDetaching=function(){this.media=null,this.state=f.STOPPED},e.prototype.onError=function(t){var e=t.frag;e&&"subtitle"===e.type&&(this.state=f.IDLE)},e.prototype.onSubtitleTracksUpdated=function(t){var e=this;a.logger.log("subtitle tracks updated"),this.tracksBuffered=[],this.tracks=t.subtitleTracks,this.tracks.forEach(function(t){e.tracksBuffered[t.id]=[]})},e.prototype.onSubtitleTrackSwitch=function(t){if(this.currentTrackId=t.id,!this.tracks||-1===this.currentTrackId)return void this.clearInterval();var e=this.tracks[this.currentTrackId];e&&e.details&&this.setInterval(500)},e.prototype.onSubtitleTrackLoaded=function(t){var e=t.id,r=t.details;if(!this.tracks)return void a.logger.warn("Can not update subtitle details, no tracks found");this.tracks[e]&&(a.logger.log("Updating subtitle track details"),this.tracks[e].details=r),this.setInterval(500)},e.prototype.onKeyLoaded=function(){this.state===f.KEY_LOADING&&(this.state=f.IDLE)},e.prototype.onFragLoaded=function(t){var e=this.fragCurrent,r=t.frag.decryptdata,i=t.frag,a=this.hls;if(this.state===f.FRAG_LOADING&&e&&"subtitle"===t.frag.type&&e.sn===t.frag.sn&&t.payload.byteLength>0&&r&&r.key&&"AES-128"===r.method){var o=c.now();this.decrypter.decrypt(t.payload,r.key.buffer,r.iv.buffer,function(t){var e=c.now();a.trigger(n.default.FRAG_DECRYPTED,{frag:i,payload:t,stats:{tstart:o,tdecrypt:e}})})}},e.prototype.doTick=function(){if(!this.media)return void(this.state=f.IDLE);switch(this.state){case f.IDLE:var t=this.tracks,e=this.currentTrackId;if(!t||!t[e]||!t[e].details)break;var r=t[e].details,i=this.config,o=i.maxBufferHole,s=Math.min(i.maxBufferLength,i.maxMaxBufferLength),c=i.maxFragLookUpTolerance,h=l.BufferHelper.bufferedInfo(this._getBuffered(),this.media.currentTime,o),p=h.end,g=h.len,y=r.fragments,m=y.length,v=y[m-1].start+y[m-1].duration,A=void 0;g<s&&p<v?A=u.findFragmentByPTS(this.fragPrevious,y,p,c):r.hasProgramDateTime&&this.fragPrevious&&(A=u.findFragmentByPDT(y,this.fragPrevious.endProgramDateTime,c)),A&&A.encrypted?(a.logger.log("Loading key for "+A.sn),this.state=f.KEY_LOADING,this.hls.trigger(n.default.KEY_LOADING,{frag:A})):A&&this.fragmentTracker.getState(A)===d.FragmentState.NOT_LOADED&&(A.trackId=e,this.fragCurrent=A,this.state=f.FRAG_LOADING,this.hls.trigger(n.default.FRAG_LOADING,{frag:A}))}},e.prototype._getBuffered=function(){return this.tracksBuffered[this.currentTrackId]||[]},e}(s.default);e.SubtitleStreamController=h},"./src/controller/subtitle-track-controller.js":function(t,e,r){"use strict";function i(t){for(var e=[],r=0;r<t.length;r++)"subtitles"===t[r].kind&&e.push(t[r]);return e}var n=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var a=r("./src/events.js"),o=r("./src/event-handler.js"),s=r("./src/utils/logger.js"),l=function(t){function e(e){var r=t.call(this,e,a.default.MEDIA_ATTACHED,a.default.MEDIA_DETACHING,a.default.MANIFEST_LOADING,a.default.MANIFEST_LOADED,a.default.SUBTITLE_TRACK_LOADED)||this;return r.tracks=[],r.trackId=-1,r.media=null,r.subtitleDisplay=!0,r}return n(e,t),e.prototype._onTextTracksChanged=function(){if(this.media){for(var t=-1,e=i(this.media.textTracks),r=0;r<e.length;r++)if("hidden"===e[r].mode)t=r;else if("showing"===e[r].mode){t=r;break}this.subtitleTrack=t}},e.prototype.destroy=function(){o.default.prototype.destroy.call(this)},e.prototype.onMediaAttached=function(t){var e=this;this.media=t.media,this.media&&(this.queuedDefaultTrack&&(this.subtitleTrack=this.queuedDefaultTrack,delete this.queuedDefaultTrack),this.trackChangeListener=this._onTextTracksChanged.bind(this),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.subtitlePollingInterval=setInterval(function(){e.trackChangeListener()},500):this.media.textTracks.addEventListener("change",this.trackChangeListener))},e.prototype.onMediaDetaching=function(){this.media&&(this.useTextTrackPolling?clearInterval(this.subtitlePollingInterval):this.media.textTracks.removeEventListener("change",this.trackChangeListener),this.media=null)},e.prototype.onManifestLoading=function(){this.tracks=[],this.trackId=-1},e.prototype.onManifestLoaded=function(t){var e=this,r=t.subtitles||[];this.tracks=r,this.trackId=-1,this.hls.trigger(a.default.SUBTITLE_TRACKS_UPDATED,{subtitleTracks:r}),r.forEach(function(t){t.default&&(e.media?e.subtitleTrack=t.id:e.queuedDefaultTrack=t.id)})},e.prototype.onTick=function(){var t=this.trackId,e=this.tracks[t];if(e){var r=e.details;r&&!r.live||(s.logger.log("(re)loading playlist for subtitle track "+t),this.hls.trigger(a.default.SUBTITLE_TRACK_LOADING,{url:e.url,id:t}))}},e.prototype.onSubtitleTrackLoaded=function(t){var e=this;t.id<this.tracks.length&&(s.logger.log("subtitle track "+t.id+" loaded"),this.tracks[t.id].details=t.details,t.details.live&&!this.timer&&(this.timer=setInterval(function(){e.onTick()},1e3*t.details.targetduration,this)),!t.details.live&&this.timer&&this._stopTimer())},Object.defineProperty(e.prototype,"subtitleTracks",{get:function(){return this.tracks},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"subtitleTrack",{get:function(){return this.trackId},set:function(t){this.trackId!==t&&(this._toggleTrackModes(t),this.setSubtitleTrackInternal(t))},enumerable:!0,configurable:!0}),e.prototype.setSubtitleTrackInternal=function(t){var e=this,r=e.hls,i=e.tracks;if(!("number"!=typeof t||t<-1||t>=i.length)&&(this._stopTimer(),this.trackId=t,s.logger.log("switching to subtitle track "+t),r.trigger(a.default.SUBTITLE_TRACK_SWITCH,{id:t}),-1!==t)){var n=i[t],o=n.details;o&&!o.live||(s.logger.log("(re)loading playlist for subtitle track "+t),r.trigger(a.default.SUBTITLE_TRACK_LOADING,{url:n.url,id:t}))}},e.prototype._stopTimer=function(){this.timer&&(clearInterval(this.timer),this.timer=null)},e.prototype._toggleTrackModes=function(t){var e=this,r=e.media,n=e.subtitleDisplay,a=e.trackId;if(r){var o=i(r.textTracks);if(-1===t)[].slice.call(o).forEach(function(t){t.mode="disabled"});else{var s=o[a];s&&(s.mode="disabled")}var l=o[t];l&&(l.mode=n?"showing":"hidden")}},e}(o.default);e.default=l},"./src/controller/timeline-controller.js":function(t,e,r){"use strict";(function(t){function i(t,e){return t&&t.label===e.name&&!(t.textTrack1||t.textTrack2)}function n(t,e,r,i){return Math.min(e,i)-Math.max(t,r)}var a=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=r("./src/events.js"),s=r("./src/event-handler.js"),l=r("./src/utils/cea-608-parser.js"),u=r("./src/utils/output-filter.js"),d=r("./src/utils/webvtt-parser.js"),c=r("./src/utils/logger.js"),f=r("./src/utils/texttrack-utils.js"),h=function(e){function r(t){var r=e.call(this,t,o.default.MEDIA_ATTACHING,o.default.MEDIA_DETACHING,o.default.FRAG_PARSING_USERDATA,o.default.FRAG_DECRYPTED,o.default.MANIFEST_LOADING,o.default.MANIFEST_LOADED,o.default.FRAG_LOADED,o.default.LEVEL_SWITCHING,o.default.INIT_PTS_FOUND)||this;if(r.hls=t,r.config=t.config,r.enabled=!0,r.Cues=t.config.cueHandler,r.textTracks=[],r.tracks=[],r.unparsedVttFrags=[],r.initPTS=[],r.cueRanges=[],r.captionsTracks={},r.captionsProperties={textTrack1:{label:r.config.captionsTextTrack1Label,languageCode:r.config.captionsTextTrack1LanguageCode},textTrack2:{label:r.config.captionsTextTrack2Label,languageCode:r.config.captionsTextTrack2LanguageCode}},r.config.enableCEA708Captions){var i=new u.default(r,"textTrack1"),n=new u.default(r,"textTrack2");r.cea608Parser=new l.default(0,i,n)}return r}return a(r,e),r.prototype.addCues=function(t,e,r,i){for(var a=this.cueRanges,o=!1,s=a.length;s--;){var l=a[s],u=n(l[0],l[1],e,r);if(u>=0&&(l[0]=Math.min(l[0],e),l[1]=Math.max(l[1],r),o=!0,u/(r-e)>.5))return}o||a.push([e,r]),this.Cues.newCue(this.captionsTracks[t],e,r,i)},r.prototype.onInitPtsFound=function(t){var e=this;if("main"===t.id&&(this.initPTS[t.frag.cc]=t.initPTS),this.unparsedVttFrags.length){var r=this.unparsedVttFrags;this.unparsedVttFrags=[],r.forEach(function(t){e.onFragLoaded(t)})}},r.prototype.getExistingTrack=function(t){var e=this.media;if(e)for(var r=0;r<e.textTracks.length;r++){var i=e.textTracks[r];if(i[t])return i}return null},r.prototype.createCaptionsTrack=function(t){var e=this.captionsProperties[t],r=e.label,i=e.languageCode,n=this.captionsTracks;if(!n[t]){var a=this.getExistingTrack(t);if(a)n[t]=a,f.clearCurrentCues(n[t]),f.sendAddTrackEvent(n[t],this.media);else{var o=this.createTextTrack("captions",r,i);o&&(o[t]=!0,n[t]=o)}}},r.prototype.createTextTrack=function(t,e,r){var i=this.media;if(i)return i.addTextTrack(t,e,r)},r.prototype.destroy=function(){s.default.prototype.destroy.call(this)},r.prototype.onMediaAttaching=function(t){this.media=t.media,this._cleanTracks()},r.prototype.onMediaDetaching=function(){var t=this.captionsTracks;Object.keys(t).forEach(function(e){f.clearCurrentCues(t[e]),delete t[e]})},r.prototype.onManifestLoading=function(){this.lastSn=-1,this.prevCC=-1,this.vttCCs={ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}},this._cleanTracks()},r.prototype._cleanTracks=function(){var t=this.media;if(t){var e=t.textTracks;if(e)for(var r=0;r<e.length;r++)f.clearCurrentCues(e[r])}},r.prototype.onManifestLoaded=function(t){var e=this;if(this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.cueRanges=[],this.config.enableWebVTT){this.tracks=t.subtitles||[];var r=this.media?this.media.textTracks:[];this.tracks.forEach(function(t,n){var a;if(n<r.length){var o=[].slice.call(r).find(function(e){return i(e,t)});o&&(a=o)}a||(a=e.createTextTrack("subtitles",t.name,t.lang)),t.default?a.mode=e.hls.subtitleDisplay?"showing":"hidden":a.mode="disabled",e.textTracks.push(a)})}},r.prototype.onLevelSwitching=function(){this.enabled="NONE"!==this.hls.currentLevel.closedCaptions},r.prototype.onFragLoaded=function(e){var r=e.frag,i=e.payload;if("main"===r.type){var n=r.sn;if(n!==this.lastSn+1){var a=this.cea608Parser;a&&a.reset()}this.lastSn=n}else if("subtitle"===r.type)if(i.byteLength){if(!t.isFinite(this.initPTS[r.cc]))return this.unparsedVttFrags.push(e),void(this.initPTS.length&&this.hls.trigger(o.default.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:r}));var s=r.decryptdata;null!=s&&null!=s.key&&"AES-128"===s.method||this._parseVTTs(r,i)}else this.hls.trigger(o.default.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:r})},r.prototype._parseVTTs=function(t,e){var r=this.vttCCs;r[t.cc]||(r[t.cc]={start:t.start,prevCC:this.prevCC,new:!0},this.prevCC=t.cc);var i=this.textTracks,n=this.hls;d.default.parse(e,this.initPTS[t.cc],r,t.cc,function(e){var r=i[t.trackId];if("disabled"===r.mode)return void n.trigger(o.default.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t});e.forEach(function(t){if(!r.cues.getCueById(t.id))try{r.addCue(t)}catch(i){var e=new window.TextTrackCue(t.startTime,t.endTime,t.text);e.id=t.id,r.addCue(e)}}),n.trigger(o.default.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:t})},function(e){c.logger.log("Failed to parse VTT cue: "+e),n.trigger(o.default.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t})})},r.prototype.onFragDecrypted=function(e){var r=e.payload,i=e.frag;if("subtitle"===i.type){if(!t.isFinite(this.initPTS[i.cc]))return void this.unparsedVttFrags.push(e);this._parseVTTs(i,r)}},r.prototype.onFragParsingUserdata=function(t){if(this.enabled&&this.config.enableCEA708Captions)for(var e=0;e<t.samples.length;e++){var r=this.extractCea608Data(t.samples[e].bytes);this.cea608Parser.addData(t.samples[e].pts,r)}},r.prototype.extractCea608Data=function(t){for(var e,r,i,n,a,o=31&t[0],s=2,l=[],u=0;u<o;u++)e=t[s++],r=127&t[s++],i=127&t[s++],n=0!=(4&e),a=3&e,0===r&&0===i||n&&0===a&&(l.push(r),l.push(i));return l},r}(s.default);e.default=h}).call(this,r("./src/polyfills/number.js").Number)},"./src/crypt/aes-crypto.js":function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){this.subtle=t,this.aesIV=e}return t.prototype.decrypt=function(t,e){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},e,t)},t}();e.default=i},"./src/crypt/aes-decryptor.js":function(t,e,r){"use strict";function i(t){var e=t.byteLength,r=e&&new DataView(t).getUint8(e-1);return r?t.slice(0,e-r):t}Object.defineProperty(e,"__esModule",{value:!0}),e.removePadding=i;var n=function(){function t(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.initTable()}return t.prototype.uint8ArrayToUint32Array_=function(t){for(var e=new DataView(t),r=new Uint32Array(4),i=0;i<4;i++)r[i]=e.getUint32(4*i);return r},t.prototype.initTable=function(){var t=this.sBox,e=this.invSBox,r=this.subMix,i=r[0],n=r[1],a=r[2],o=r[3],s=this.invSubMix,l=s[0],u=s[1],d=s[2],c=s[3],f=new Uint32Array(256),h=0,p=0,g=0;for(g=0;g<256;g++)f[g]=g<128?g<<1:g<<1^283;for(g=0;g<256;g++){var y=p^p<<1^p<<2^p<<3^p<<4;y=y>>>8^255&y^99,t[h]=y,e[y]=h;var m=f[h],v=f[m],A=f[v],_=257*f[y]^16843008*y;i[h]=_<<24|_>>>8,n[h]=_<<16|_>>>16,a[h]=_<<8|_>>>24,o[h]=_,_=16843009*A^65537*v^257*m^16843008*h,l[y]=_<<24|_>>>8,u[y]=_<<16|_>>>16,d[y]=_<<8|_>>>24,c[y]=_,h?(h=m^f[f[f[A^m]]],p^=f[f[p]]):h=p=1}},t.prototype.expandKey=function(t){for(var e=this.uint8ArrayToUint32Array_(t),r=!0,i=0;i<e.length&&r;)r=e[i]===this.key[i],i++;if(!r){this.key=e;var n=this.keySize=e.length;if(4!==n&&6!==n&&8!==n)throw new Error("Invalid aes key size="+n);var a,o,s,l,u=this.ksRows=4*(n+6+1),d=this.keySchedule=new Uint32Array(u),c=this.invKeySchedule=new Uint32Array(u),f=this.sBox,h=this.rcon,p=this.invSubMix,g=p[0],y=p[1],m=p[2],v=p[3];for(a=0;a<u;a++)a<n?s=d[a]=e[a]:(l=s,a%n==0?(l=l<<8|l>>>24,l=f[l>>>24]<<24|f[l>>>16&255]<<16|f[l>>>8&255]<<8|f[255&l],l^=h[a/n|0]<<24):n>6&&a%n==4&&(l=f[l>>>24]<<24|f[l>>>16&255]<<16|f[l>>>8&255]<<8|f[255&l]),d[a]=s=(d[a-n]^l)>>>0);for(o=0;o<u;o++)a=u-o,l=3&o?d[a]:d[a-4],c[o]=o<4||a<=4?l:g[f[l>>>24]]^y[f[l>>>16&255]]^m[f[l>>>8&255]]^v[f[255&l]],c[o]=c[o]>>>0}},t.prototype.networkToHostOrderSwap=function(t){return t<<24|(65280&t)<<8|(16711680&t)>>8|t>>>24},t.prototype.decrypt=function(t,e,r,n){for(var a,o,s,l,u,d,c,f,h,p,g,y,m,v,A=this.keySize+6,_=this.invKeySchedule,b=this.invSBox,E=this.invSubMix,T=E[0],S=E[1],L=E[2],k=E[3],R=this.uint8ArrayToUint32Array_(r),C=R[0],w=R[1],O=R[2],P=R[3],D=new Int32Array(t),I=new Int32Array(D.length),x=this.networkToHostOrderSwap;e<D.length;){for(h=x(D[e]),p=x(D[e+1]),g=x(D[e+2]),y=x(D[e+3]),u=h^_[0],d=y^_[1],c=g^_[2],f=p^_[3],m=4,v=1;v<A;v++)a=T[u>>>24]^S[d>>16&255]^L[c>>8&255]^k[255&f]^_[m],o=T[d>>>24]^S[c>>16&255]^L[f>>8&255]^k[255&u]^_[m+1],s=T[c>>>24]^S[f>>16&255]^L[u>>8&255]^k[255&d]^_[m+2],l=T[f>>>24]^S[u>>16&255]^L[d>>8&255]^k[255&c]^_[m+3],u=a,d=o,c=s,f=l,m+=4;a=b[u>>>24]<<24^b[d>>16&255]<<16^b[c>>8&255]<<8^b[255&f]^_[m],o=b[d>>>24]<<24^b[c>>16&255]<<16^b[f>>8&255]<<8^b[255&u]^_[m+1],s=b[c>>>24]<<24^b[f>>16&255]<<16^b[u>>8&255]<<8^b[255&d]^_[m+2],l=b[f>>>24]<<24^b[u>>16&255]<<16^b[d>>8&255]<<8^b[255&c]^_[m+3],m+=3,I[e]=x(a^C),I[e+1]=x(l^w),I[e+2]=x(s^O),I[e+3]=x(o^P),C=h,w=p,O=g,P=y,e+=4}return n?i(I.buffer):I.buffer},t.prototype.destroy=function(){this.key=void 0,this.keySize=void 0,this.ksRows=void 0,this.sBox=void 0,this.invSBox=void 0,this.subMix=void 0,this.invSubMix=void 0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.rcon=void 0},t}();e.default=n},"./src/crypt/decrypter.js":function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r("./src/crypt/aes-crypto.js"),n=r("./src/crypt/fast-aes-key.js"),a=r("./src/crypt/aes-decryptor.js"),o=r("./src/errors.js"),s=r("./src/utils/logger.js"),l=r("./src/events.js"),u=r("./src/utils/get-self-scope.js"),d=u.getSelfScope(),c=function(){function t(t,e,r){var i=(void 0===r?{}:r).removePKCS7Padding,n=void 0===i||i;if(this.logEnabled=!0,this.observer=t,this.config=e,this.removePKCS7Padding=n,n)try{var a=d.crypto;a&&(this.subtle=a.subtle||a.webkitSubtle)}catch(t){}this.disableWebCrypto=!this.subtle}return t.prototype.isSync=function(){return this.disableWebCrypto&&this.config.enableSoftwareAES},t.prototype.decrypt=function(t,e,r,o){var l=this;if(this.disableWebCrypto&&this.config.enableSoftwareAES){this.logEnabled&&(s.logger.log("JS AES decrypt"),this.logEnabled=!1);var u=this.decryptor;u||(this.decryptor=u=new a.default),u.expandKey(e),o(u.decrypt(t,0,r,this.removePKCS7Padding))}else{this.logEnabled&&(s.logger.log("WebCrypto AES decrypt"),this.logEnabled=!1);var d=this.subtle;this.key!==e&&(this.key=e,this.fastAesKey=new n.default(d,e)),this.fastAesKey.expandKey().then(function(n){new i.default(d,r).decrypt(t,n).catch(function(i){l.onWebCryptoError(i,t,e,r,o)}).then(function(t){o(t)})}).catch(function(i){l.onWebCryptoError(i,t,e,r,o)})}},t.prototype.onWebCryptoError=function(t,e,r,i,n){this.config.enableSoftwareAES?(s.logger.log("WebCrypto Error, disable WebCrypto API"),this.disableWebCrypto=!0,this.logEnabled=!0,this.decrypt(e,r,i,n)):(s.logger.error("decrypting error : "+t.message),this.observer.trigger(l.default.ERROR,{type:o.ErrorTypes.MEDIA_ERROR,details:o.ErrorDetails.FRAG_DECRYPT_ERROR,fatal:!0,reason:t.message}))},t.prototype.destroy=function(){var t=this.decryptor;t&&(t.destroy(),this.decryptor=void 0)},t}();e.default=c},"./src/crypt/fast-aes-key.js":function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){this.subtle=t,this.key=e}return t.prototype.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},t}();e.default=i},"./src/demux/aacdemuxer.js":function(t,e,r){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});var i=r("./src/demux/adts.js"),n=r("./src/utils/logger.js"),a=r("./src/demux/id3.js"),o=function(){function e(t,e,r){this.observer=t,this.config=r,this.remuxer=e}return e.prototype.resetInitSegment=function(t,e,r,i){this._audioTrack={container:"audio/adts",type:"audio",id:0,sequenceNumber:0,isAAC:!0,samples:[],len:0,manifestCodec:e,duration:i,inputTimeScale:9e4}},e.prototype.resetTimeStamp=function(){},e.probe=function(t){if(!t)return!1;for(var e=a.default.getID3Data(t,0)||[],r=e.length,o=t.length;r<o;r++)if(i.probe(t,r))return n.logger.log("ADTS sync word found !"),!0;return!1},e.prototype.append=function(e,r,o,s){for(var l=this._audioTrack,u=a.default.getID3Data(e,0)||[],d=a.default.getTimeStamp(u),c=t.isFinite(d)?90*d:9e4*r,f=0,h=c,p=e.length,g=u.length,y=[{pts:h,dts:h,data:u}];g<p-1;)if(i.isHeader(e,g)&&g+5<p){i.initTrackConfig(l,this.observer,e,g,l.manifestCodec);var m=i.appendFrame(l,e,g,c,f);if(!m){n.logger.log("Unable to parse AAC frame");break}g+=m.length,h=m.sample.pts,f++}else a.default.isHeader(e,g)?(u=a.default.getID3Data(e,g),y.push({pts:h,dts:h,data:u}),g+=u.length):g++;this.remuxer.remux(l,{samples:[]},{samples:y,inputTimeScale:9e4},{samples:[]},r,o,s)},e.prototype.destroy=function(){},e}();e.default=o}).call(this,r("./src/polyfills/number.js").Number)},"./src/demux/adts.js":function(t,e,r){"use strict";function i(t,e,r,i){var n,a,o,s,l,u=navigator.userAgent.toLowerCase(),d=i,c=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];return n=1+((192&e[r+2])>>>6),(a=(60&e[r+2])>>>2)>c.length-1?void t.trigger(g.default.ERROR,{type:p.ErrorTypes.MEDIA_ERROR,details:p.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+a}):(s=(1&e[r+2])<<2,s|=(192&e[r+3])>>>6,h.logger.log("manifest codec:"+i+",ADTS data:type:"+n+",sampleingIndex:"+a+"["+c[a]+"Hz],channelConfig:"+s),/firefox/i.test(u)?a>=6?(n=5,l=new Array(4),o=a-3):(n=2,l=new Array(2),o=a):-1!==u.indexOf("android")?(n=2,l=new Array(2),o=a):(n=5,l=new Array(4),i&&(-1!==i.indexOf("mp4a.40.29")||-1!==i.indexOf("mp4a.40.5"))||!i&&a>=6?o=a-3:((i&&-1!==i.indexOf("mp4a.40.2")&&(a>=6&&1===s||/vivaldi/i.test(u))||!i&&1===s)&&(n=2,l=new Array(2)),o=a)),l[0]=n<<3,l[0]|=(14&a)>>1,l[1]|=(1&a)<<7,l[1]|=s<<3,5===n&&(l[1]|=(14&o)>>1,l[2]=(1&o)<<7,l[2]|=8,l[3]=0),{config:l,samplerate:c[a],channelCount:s,codec:"mp4a.40."+n,manifestCodec:d})}function n(t,e){return 255===t[e]&&240==(246&t[e+1])}function a(t,e){return 1&t[e+1]?7:9}function o(t,e){return(3&t[e+3])<<11|t[e+4]<<3|(224&t[e+5])>>>5}function s(t,e){return!!(e+1<t.length&&n(t,e))}function l(t,e){if(e+1<t.length&&n(t,e)){var r=a(t,e),i=r;e+5<t.length&&(i=o(t,e));var s=e+i;if(s===t.length||s+1<t.length&&n(t,s))return!0}return!1}function u(t,e,r,n,a){if(!t.samplerate){var o=i(e,r,n,a);t.config=o.config,t.samplerate=o.samplerate,t.channelCount=o.channelCount,t.codec=o.codec,t.manifestCodec=o.manifestCodec,h.logger.log("parsed codec:"+t.codec+",rate:"+o.samplerate+",nb channel:"+o.channelCount)}}function d(t){return 9216e4/t}function c(t,e,r,i,n){var s,l,u,d=t.length;if(s=a(t,e),l=o(t,e),(l-=s)>0&&e+s+l<=d)return u=r+i*n,{headerLength:s,frameLength:l,stamp:u}}function f(t,e,r,i,n){var a=d(t.samplerate),o=c(e,r,i,n,a);if(o){var s=o.stamp,l=o.headerLength,u=o.frameLength,f={unit:e.subarray(r+l,r+l+u),pts:s,dts:s};return t.samples.push(f),t.len+=u,{sample:f,length:u+l}}}Object.defineProperty(e,"__esModule",{value:!0});var h=r("./src/utils/logger.js"),p=r("./src/errors.js"),g=r("./src/events.js");e.getAudioConfig=i,e.isHeaderPattern=n,e.getHeaderLength=a,e.getFullFrameLength=o,e.isHeader=s,e.probe=l,e.initTrackConfig=u,e.getFrameDuration=d,e.parseFrameHeader=c,e.appendFrame=f},"./src/demux/demuxer-inline.js":function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,n=r("./src/events.js"),a=r("./src/errors.js"),o=r("./src/crypt/decrypter.js"),s=r("./src/demux/aacdemuxer.js"),l=r("./src/demux/mp4demuxer.js"),u=r("./src/demux/tsdemuxer.js"),d=r("./src/demux/mp3demuxer.js"),c=r("./src/remux/mp4-remuxer.js"),f=r("./src/remux/passthrough-remuxer.js"),h=r("./src/utils/get-self-scope.js"),p=r("./src/utils/logger.js"),g=h.getSelfScope();try{i=g.performance.now.bind(g.performance)}catch(t){p.logger.debug("Unable to use Performance API on this environment"),i=g.Date.now}var y=function(){function t(t,e,r,i){this.observer=t,this.typeSupported=e,this.config=r,this.vendor=i}return t.prototype.destroy=function(){var t=this.demuxer;t&&t.destroy()},t.prototype.push=function(t,e,r,a,s,l,u,d,c,f,h,p){var g=this;if(t.byteLength>0&&null!=e&&null!=e.key&&"AES-128"===e.method){var y=this.decrypter;null==y&&(y=this.decrypter=new o.default(this.observer,this.config));var m=i();y.decrypt(t,e.key.buffer,e.iv.buffer,function(t){var o=i();g.observer.trigger(n.default.FRAG_DECRYPTED,{stats:{tstart:m,tdecrypt:o}}),g.pushDecrypted(new Uint8Array(t),e,new Uint8Array(r),a,s,l,u,d,c,f,h,p)})}else this.pushDecrypted(new Uint8Array(t),e,new Uint8Array(r),a,s,l,u,d,c,f,h,p)},t.prototype.pushDecrypted=function(t,e,r,i,o,h,p,g,y,m,v,A){var _=this.demuxer;if(!_||(p||g)&&!this.probe(t)){for(var b=this.observer,E=this.typeSupported,T=this.config,S=[{demux:u.default,remux:c.default},{demux:l.default,remux:f.default},{demux:s.default,remux:c.default},{demux:d.default,remux:c.default}],L=0,k=S.length;L<k;L++){var R=S[L],C=R.demux.probe;if(C(t)){var w=this.remuxer=new R.remux(b,T,E,this.vendor);_=new R.demux(b,w,T,E),this.probe=C;break}}if(!_)return void b.trigger(n.default.ERROR,{type:a.ErrorTypes.MEDIA_ERROR,details:a.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"});this.demuxer=_}var O=this.remuxer;(p||g)&&(_.resetInitSegment(r,i,o,m),O.resetInitSegment()),p&&(_.resetTimeStamp(A),O.resetTimeStamp(A)),"function"==typeof _.setDecryptData&&_.setDecryptData(e),_.append(t,h,y,v)},t}();e.default=y},"./src/demux/demuxer-worker.js":function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r("./src/demux/demuxer-inline.js"),n=r("./src/events.js"),a=r("./src/utils/logger.js"),o=r("./node_modules/node-libs-browser/node_modules/events/events.js"),s=function(t){var e=new o.EventEmitter;e.trigger=function(t){for(var r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];e.emit.apply(e,[t,t].concat(r))},e.off=function(t){for(var r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];e.removeListener.apply(e,[t].concat(r))};var r=function(e,r){t.postMessage({event:e,data:r})};t.addEventListener("message",function(n){var o=n.data;switch(o.cmd){case"init":var s=JSON.parse(o.config);t.demuxer=new i.default(e,o.typeSupported,s,o.vendor),a.enableLogs(s.debug),r("init",null);break;case"demux":t.demuxer.push(o.data,o.decryptdata,o.initSegment,o.audioCodec,o.videoCodec,o.timeOffset,o.discontinuity,o.trackSwitch,o.contiguous,o.duration,o.accurateTimeOffset,o.defaultInitPTS)}}),e.on(n.default.FRAG_DECRYPTED,r),e.on(n.default.FRAG_PARSING_INIT_SEGMENT,r),e.on(n.default.FRAG_PARSED,r),e.on(n.default.ERROR,r),e.on(n.default.FRAG_PARSING_METADATA,r),e.on(n.default.FRAG_PARSING_USERDATA,r),e.on(n.default.INIT_PTS_FOUND,r),e.on(n.default.FRAG_PARSING_DATA,function(e,r){var i=[],n={event:e,data:r};r.data1&&(n.data1=r.data1.buffer,i.push(r.data1.buffer),delete r.data1),r.data2&&(n.data2=r.data2.buffer,i.push(r.data2.buffer),delete r.data2),t.postMessage(n,i)})};e.default=s},"./src/demux/demuxer.js":function(t,e,r){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});var i=r("./node_modules/webworkify-webpack/index.js"),n=r("./src/events.js"),a=r("./src/demux/demuxer-inline.js"),o=r("./src/utils/logger.js"),s=r("./src/errors.js"),l=r("./src/utils/mediasource-helper.js"),u=r("./src/utils/get-self-scope.js"),d=r("./src/observer.js"),c=u.getSelfScope(),f=l.getMediaSource(),h=function(){function e(t,e){var r=this;this.hls=t,this.id=e;var l=this.observer=new d.Observer,u=t.config,h=function(e,i){i=i||{},i.frag=r.frag,i.id=r.id,t.trigger(e,i)};l.on(n.default.FRAG_DECRYPTED,h),l.on(n.default.FRAG_PARSING_INIT_SEGMENT,h),l.on(n.default.FRAG_PARSING_DATA,h),l.on(n.default.FRAG_PARSED,h),l.on(n.default.ERROR,h),l.on(n.default.FRAG_PARSING_METADATA,h),l.on(n.default.FRAG_PARSING_USERDATA,h),l.on(n.default.INIT_PTS_FOUND,h);var p={mp4:f.isTypeSupported("video/mp4"),mpeg:f.isTypeSupported("audio/mpeg"),mp3:f.isTypeSupported('audio/mp4; codecs="mp3"')},g=navigator.vendor;if(u.enableWorker&&"undefined"!=typeof Worker){o.logger.log("demuxing in webworker");var y=void 0;try{y=this.w=i("./src/demux/demuxer-worker.js"),this.onwmsg=this.onWorkerMessage.bind(this),y.addEventListener("message",this.onwmsg),y.onerror=function(e){t.trigger(n.default.ERROR,{type:s.ErrorTypes.OTHER_ERROR,details:s.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",err:{message:e.message+" ("+e.filename+":"+e.lineno+")"}})},y.postMessage({cmd:"init",typeSupported:p,vendor:g,id:e,config:JSON.stringify(u)})}catch(t){o.logger.warn("Error in worker:",t),o.logger.error("Error while initializing DemuxerWorker, fallback on DemuxerInline"),y&&c.URL.revokeObjectURL(y.objectURL),this.demuxer=new a.default(l,p,u,g),this.w=void 0}}else this.demuxer=new a.default(l,p,u,g)}return e.prototype.destroy=function(){var t=this.w;if(t)t.removeEventListener("message",this.onwmsg),t.terminate(),this.w=null;else{var e=this.demuxer;e&&(e.destroy(),this.demuxer=null)}var r=this.observer;r&&(r.removeAllListeners(),this.observer=null)},e.prototype.push=function(e,r,i,n,a,s,l,u){var d=this.w,c=t.isFinite(a.startPTS)?a.startPTS:a.start,f=a.decryptdata,h=this.frag,p=!(h&&a.cc===h.cc),g=!(h&&a.level===h.level),y=h&&a.sn===h.sn+1,m=!g&&y;if(p&&o.logger.log(this.id+":discontinuity detected"),g&&o.logger.log(this.id+":switch detected"),this.frag=a,d)d.postMessage({cmd:"demux",data:e,decryptdata:f,initSegment:r,audioCodec:i,videoCodec:n,timeOffset:c,discontinuity:p,trackSwitch:g,contiguous:m,duration:s,accurateTimeOffset:l,defaultInitPTS:u},e instanceof ArrayBuffer?[e]:[]);else{var v=this.demuxer;v&&v.push(e,f,r,i,n,c,p,g,m,s,l,u)}},e.prototype.onWorkerMessage=function(t){var e=t.data,r=this.hls;switch(e.event){case"init":c.URL.revokeObjectURL(this.w.objectURL);break;case n.default.FRAG_PARSING_DATA:e.data.data1=new Uint8Array(e.data1),e.data2&&(e.data.data2=new Uint8Array(e.data2));default:e.data=e.data||{},e.data.frag=this.frag,e.data.id=this.id,r.trigger(e.event,e.data)}},e}();e.default=h}).call(this,r("./src/polyfills/number.js").Number)},"./src/demux/exp-golomb.js":function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r("./src/utils/logger.js"),n=function(){function t(t){this.data=t,this.bytesAvailable=t.byteLength,this.word=0,this.bitsAvailable=0}return t.prototype.loadWord=function(){var t=this.data,e=this.bytesAvailable,r=t.byteLength-e,i=new Uint8Array(4),n=Math.min(4,e);if(0===n)throw new Error("no bytes available");i.set(t.subarray(r,r+n)),this.word=new DataView(i.buffer).getUint32(0),this.bitsAvailable=8*n,this.bytesAvailable-=n},t.prototype.skipBits=function(t){var e;this.bitsAvailable>t?(this.word<<=t,this.bitsAvailable-=t):(t-=this.bitsAvailable,e=t>>3,t-=e>>3,this.bytesAvailable-=e,this.loadWord(),this.word<<=t,this.bitsAvailable-=t)},t.prototype.readBits=function(t){var e=Math.min(this.bitsAvailable,t),r=this.word>>>32-e;return t>32&&i.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=e,this.bitsAvailable>0?this.word<<=e:this.bytesAvailable>0&&this.loadWord(),e=t-e,e>0&&this.bitsAvailable?r<<e|this.readBits(e):r},t.prototype.skipLZ=function(){var t;for(t=0;t<this.bitsAvailable;++t)if(0!=(this.word&2147483648>>>t))return this.word<<=t,this.bitsAvailable-=t,t;return this.loadWord(),t+this.skipLZ()},t.prototype.skipUEG=function(){this.skipBits(1+this.skipLZ())},t.prototype.skipEG=function(){this.skipBits(1+this.skipLZ())},t.prototype.readUEG=function(){var t=this.skipLZ();return this.readBits(t+1)-1},t.prototype.readEG=function(){var t=this.readUEG();return 1&t?1+t>>>1:-1*(t>>>1)},t.prototype.readBoolean=function(){return 1===this.readBits(1)},t.prototype.readUByte=function(){return this.readBits(8)},t.prototype.readUShort=function(){return this.readBits(16)},t.prototype.readUInt=function(){return this.readBits(32)},t.prototype.skipScalingList=function(t){var e,r,i=8,n=8;for(e=0;e<t;e++)0!==n&&(r=this.readEG(),n=(i+r+256)%256),i=0===n?i:n},t.prototype.readSPS=function(){var t,e,r,i,n,a,o,s=0,l=0,u=0,d=0,c=this.readUByte.bind(this),f=this.readBits.bind(this),h=this.readUEG.bind(this),p=this.readBoolean.bind(this),g=this.skipBits.bind(this),y=this.skipEG.bind(this),m=this.skipUEG.bind(this),v=this.skipScalingList.bind(this);if(c(),t=c(),f(5),g(3),c(),m(),100===t||110===t||122===t||244===t||44===t||83===t||86===t||118===t||128===t){var A=h();if(3===A&&g(1),m(),m(),g(1),p())for(a=3!==A?8:12,o=0;o<a;o++)p()&&v(o<6?16:64)}m();var _=h();if(0===_)h();else if(1===_)for(g(1),y(),y(),e=h(),o=0;o<e;o++)y();m(),g(1),r=h(),i=h(),n=f(1),0===n&&g(1),g(1),p()&&(s=h(),l=h(),u=h(),d=h());var b=[1,1];if(p()&&p()){switch(c()){case 1:b=[1,1];break;case 2:b=[12,11];break;case 3:b=[10,11];break;case 4:b=[16,11];break;case 5:b=[40,33];break;case 6:b=[24,11];break;case 7:b=[20,11];break;case 8:b=[32,11];break;case 9:b=[80,33];break;case 10:b=[18,11];break;case 11:b=[15,11];break;case 12:b=[64,33];break;case 13:b=[160,99];break;case 14:b=[4,3];break;case 15:b=[3,2];break;case 16:b=[2,1];break;case 255:b=[c()<<8|c(),c()<<8|c()]}}return{width:Math.ceil(16*(r+1)-2*s-2*l),height:(2-n)*(i+1)*16-(n?2:4)*(u+d),pixelRatio:b}},t.prototype.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},t}();e.default=n},"./src/demux/id3.js":function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(){}return t.isHeader=function(t,e){return e+10<=t.length&&73===t[e]&&68===t[e+1]&&51===t[e+2]&&t[e+3]<255&&t[e+4]<255&&t[e+6]<128&&t[e+7]<128&&t[e+8]<128&&t[e+9]<128},t.isFooter=function(t,e){return e+10<=t.length&&51===t[e]&&68===t[e+1]&&73===t[e+2]&&t[e+3]<255&&t[e+4]<255&&t[e+6]<128&&t[e+7]<128&&t[e+8]<128&&t[e+9]<128},t.getID3Data=function(e,r){for(var i=r,n=0;t.isHeader(e,r);){n+=10;n+=t._readSize(e,r+6),t.isFooter(e,r+10)&&(n+=10),r+=n}if(n>0)return e.subarray(i,i+n)},t._readSize=function(t,e){var r=0;return r=(127&t[e])<<21,r|=(127&t[e+1])<<14,r|=(127&t[e+2])<<7,r|=127&t[e+3]},t.getTimeStamp=function(e){for(var r=t.getID3Frames(e),i=0;i<r.length;i++){var n=r[i];if(t.isTimeStampFrame(n))return t._readTimeStamp(n)}},t.isTimeStampFrame=function(t){return t&&"PRIV"===t.key&&"com.apple.streaming.transportStreamTimestamp"===t.info},t._getFrameData=function(e){var r=String.fromCharCode(e[0],e[1],e[2],e[3]),i=t._readSize(e,4);return{type:r,size:i,data:e.subarray(10,10+i)}},t.getID3Frames=function(e){for(var r=0,i=[];t.isHeader(e,r);){var n=t._readSize(e,r+6);r+=10;for(var a=r+n;r+8<a;){var o=t._getFrameData(e.subarray(r)),s=t._decodeFrame(o);s&&i.push(s),r+=o.size+10}t.isFooter(e,r)&&(r+=10)}return i},t._decodeFrame=function(e){return"PRIV"===e.type?t._decodePrivFrame(e):"T"===e.type[0]?t._decodeTextFrame(e):"W"===e.type[0]?t._decodeURLFrame(e):void 0},t._readTimeStamp=function(t){if(8===t.data.byteLength){var e=new Uint8Array(t.data),r=1&e[3],i=(e[4]<<23)+(e[5]<<15)+(e[6]<<7)+e[7];return i/=45,r&&(i+=47721858.84),Math.round(i)}},t._decodePrivFrame=function(e){if(!(e.size<2)){var r=t._utf8ArrayToStr(e.data,!0),i=new Uint8Array(e.data.subarray(r.length+1));return{key:e.type,info:r,data:i.buffer}}},t._decodeTextFrame=function(e){if(!(e.size<2)){if("TXXX"===e.type){var r=1,i=t._utf8ArrayToStr(e.data.subarray(r));r+=i.length+1;var n=t._utf8ArrayToStr(e.data.subarray(r));return{key:e.type,info:i,data:n}}var a=t._utf8ArrayToStr(e.data.subarray(1));return{key:e.type,data:a}}},t._decodeURLFrame=function(e){if("WXXX"===e.type){if(e.size<2)return;var r=1,i=t._utf8ArrayToStr(e.data.subarray(r));r+=i.length+1;var n=t._utf8ArrayToStr(e.data.subarray(r));return{key:e.type,info:i,data:n}}var a=t._utf8ArrayToStr(e.data);return{key:e.type,data:a}},t._utf8ArrayToStr=function(t,e){void 0===e&&(e=!1);for(var r,i,n,a=t.length,o="",s=0;s<a;){if(0===(r=t[s++])&&e)return o;if(0!==r&&3!==r)switch(r>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:o+=String.fromCharCode(r);break;case 12:case 13:i=t[s++],o+=String.fromCharCode((31&r)<<6|63&i);break;case 14:i=t[s++],n=t[s++],o+=String.fromCharCode((15&r)<<12|(63&i)<<6|(63&n)<<0)}}return o},t}(),n=i._utf8ArrayToStr;e.utf8ArrayToStr=n,e.default=i},"./src/demux/mp3demuxer.js":function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r("./src/demux/id3.js"),n=r("./src/utils/logger.js"),a=r("./src/demux/mpegaudio.js"),o=function(){function t(t,e,r){this.observer=t,this.config=r,this.remuxer=e}return t.prototype.resetInitSegment=function(t,e,r,i){this._audioTrack={container:"audio/mpeg",type:"audio",id:-1,sequenceNumber:0,isAAC:!1,samples:[],len:0,manifestCodec:e,duration:i,inputTimeScale:9e4}},t.prototype.resetTimeStamp=function(){},t.probe=function(t){var e,r,o=i.default.getID3Data(t,0);if(o&&void 0!==i.default.getTimeStamp(o))for(e=o.length,r=Math.min(t.length-1,e+100);e<r;e++)if(a.default.probe(t,e))return n.logger.log("MPEG Audio sync word found !"),!0;return!1},t.prototype.append=function(t,e,r,n){for(var o=i.default.getID3Data(t,0),s=i.default.getTimeStamp(o),l=s?90*s:9e4*e,u=o.length,d=t.length,c=0,f=0,h=this._audioTrack,p=[{pts:l,dts:l,data:o}];u<d;)if(a.default.isHeader(t,u)){var g=a.default.appendFrame(h,t,u,l,c);if(!g)break;u+=g.length,f=g.sample.pts,c++}else i.default.isHeader(t,u)?(o=i.default.getID3Data(t,u),p.push({pts:f,dts:f,data:o}),u+=o.length):u++;this.remuxer.remux(h,{samples:[]},{samples:p,inputTimeScale:9e4},{samples:[]},e,r,n)},t.prototype.destroy=function(){},t}();e.default=o},"./src/demux/mp4demuxer.js":function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r("./src/utils/logger.js"),n=r("./src/events.js"),a=Math.pow(2,32)-1,o=function(){function t(t,e){this.observer=t,this.remuxer=e}return t.prototype.resetTimeStamp=function(t){this.initPTS=t},t.prototype.resetInitSegment=function(e,r,i,a){if(e&&e.byteLength){var o=this.initData=t.parseInitSegment(e);null==r&&(r="mp4a.40.5"),null==i&&(i="avc1.42e01e");var s={};o.audio&&o.video?s.audiovideo={container:"video/mp4",codec:r+","+i,initSegment:a?e:null}:(o.audio&&(s.audio={container:"audio/mp4",codec:r,initSegment:a?e:null}),o.video&&(s.video={container:"video/mp4",codec:i,initSegment:a?e:null})),this.observer.trigger(n.default.FRAG_PARSING_INIT_SEGMENT,{tracks:s})}else r&&(this.audioCodec=r),i&&(this.videoCodec=i)},t.probe=function(e){return t.findBox({data:e,start:0,end:Math.min(e.length,16384)},["moof"]).length>0},t.bin2str=function(t){return String.fromCharCode.apply(null,t)},t.readUint16=function(t,e){t.data&&(e+=t.start,t=t.data);var r=t[e]<<8|t[e+1];return r<0?65536+r:r},t.readUint32=function(t,e){t.data&&(e+=t.start,t=t.data);var r=t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3];return r<0?4294967296+r:r},t.writeUint32=function(t,e,r){t.data&&(e+=t.start,t=t.data),t[e]=r>>24,t[e+1]=r>>16&255,t[e+2]=r>>8&255,t[e+3]=255&r},t.findBox=function(e,r){var i,n,a,o,s,l,u,d=[];if(e.data?(l=e.start,o=e.end,e=e.data):(l=0,o=e.byteLength),!r.length)return null;for(i=l;i<o;)n=t.readUint32(e,i),a=t.bin2str(e.subarray(i+4,i+8)),u=n>1?i+n:o,a===r[0]&&(1===r.length?d.push({data:e,start:i+8,end:u}):(s=t.findBox({data:e,start:i+8,end:u},r.slice(1)),s.length&&(d=d.concat(s)))),i=u;return d},t.parseSegmentIndex=function(e){var r,i=t.findBox(e,["moov"])[0],n=i?i.end:null,a=0,o=t.findBox(e,["sidx"]);if(!o||!o[0])return null;r=[],o=o[0];var s=o.data[0];a=0===s?8:16;var l=t.readUint32(o,a);a+=4;a+=0===s?8:16,a+=2;var u=o.end+0,d=t.readUint16(o,a);a+=2;for(var c=0;c<d;c++){var f=a,h=t.readUint32(o,f);f+=4;var p=2147483647&h;if(1===(2147483648&h)>>>31)return void console.warn("SIDX has hierarchical references (not supported)");var g=t.readUint32(o,f);f+=4,r.push({referenceSize:p,subsegmentDuration:g,info:{duration:g/l,start:u,end:u+p-1}}),u+=p,f+=4,a=f}return{earliestPresentationTime:0,timescale:l,version:s,referencesCount:d,references:r,moovEndOffset:n}},t.parseInitSegment=function(e){var r=[];return t.findBox(e,["moov","trak"]).forEach(function(e){var n=t.findBox(e,["tkhd"])[0];if(n){var a=n.data[n.start],o=0===a?12:20,s=t.readUint32(n,o),l=t.findBox(e,["mdia","mdhd"])[0];if(l){a=l.data[l.start],o=0===a?12:20;var u=t.readUint32(l,o),d=t.findBox(e,["mdia","hdlr"])[0];if(d){var c=t.bin2str(d.data.subarray(d.start+8,d.start+12)),f={soun:"audio",vide:"video"}[c];if(f){var h=t.findBox(e,["mdia","minf","stbl","stsd"]);if(h.length){h=h[0];var p=t.bin2str(h.data.subarray(h.start+12,h.start+16));i.logger.log("MP4Demuxer:"+f+":"+p+" found")}r[s]={timescale:u,type:f},r[f]={timescale:u,id:s}}}}}}),r},t.getStartDTS=function(e,r){var i,n,a;return i=t.findBox(r,["moof","traf"]),n=[].concat.apply([],i.map(function(r){return t.findBox(r,["tfhd"]).map(function(i){var n,a;return n=t.readUint32(i,4),a=e[n].timescale||9e4,t.findBox(r,["tfdt"]).map(function(e){var r,i;return r=e.data[e.start],i=t.readUint32(e,4),1===r&&(i*=Math.pow(2,32),i+=t.readUint32(e,8)),i})[0]/a})})),a=Math.min.apply(null,n),isFinite(a)?a:0},t.offsetStartDTS=function(e,r,i){t.findBox(r,["moof","traf"]).map(function(r){return t.findBox(r,["tfhd"]).map(function(n){var o=t.readUint32(n,4),s=e[o].timescale||9e4;t.findBox(r,["tfdt"]).map(function(e){var r=e.data[e.start],n=t.readUint32(e,4);if(0===r)t.writeUint32(e,4,n-i*s);else{n*=Math.pow(2,32),n+=t.readUint32(e,8),n-=i*s,n=Math.max(n,0);var o=Math.floor(n/(a+1)),l=Math.floor(n%(a+1));t.writeUint32(e,4,o),t.writeUint32(e,8,l)}})})})},t.prototype.append=function(e,r,i,a){var o=this.initData;o||(this.resetInitSegment(e,this.audioCodec,this.videoCodec,!1),o=this.initData);var s,l=this.initPTS;if(void 0===l){var u=t.getStartDTS(o,e);this.initPTS=l=u-r,this.observer.trigger(n.default.INIT_PTS_FOUND,{initPTS:l})}t.offsetStartDTS(o,e,l),s=t.getStartDTS(o,e),this.remuxer.remux(o.audio,o.video,null,null,s,i,a,e)},t.prototype.destroy=function(){},t}();e.default=o},"./src/demux/mpegaudio.js":function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i={BitratesMap:[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],SamplingRateMap:[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],SamplesCoefficients:[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],BytesInSlot:[0,1,1,4],appendFrame:function(t,e,r,i,n){if(!(r+24>e.length)){var a=this.parseHeader(e,r);if(a&&r+a.frameLength<=e.length){var o=9e4*a.samplesPerFrame/a.sampleRate,s=i+n*o,l={unit:e.subarray(r,r+a.frameLength),pts:s,dts:s};return t.config=[],t.channelCount=a.channelCount,t.samplerate=a.sampleRate,t.samples.push(l),t.len+=a.frameLength,{sample:l,length:a.frameLength}}}},parseHeader:function(t,e){var r=t[e+1]>>3&3,n=t[e+1]>>1&3,a=t[e+2]>>4&15,o=t[e+2]>>2&3,s=t[e+2]>>1&1;if(1!==r&&0!==a&&15!==a&&3!==o){var l=3===r?3-n:3===n?3:4,u=1e3*i.BitratesMap[14*l+a-1],d=3===r?0:2===r?1:2,c=i.SamplingRateMap[3*d+o],f=t[e+3]>>6==3?1:2,h=i.SamplesCoefficients[r][n],p=i.BytesInSlot[n],g=8*h*p;return{sampleRate:c,channelCount:f,frameLength:parseInt(h*u/c+s,10)*p,samplesPerFrame:g}}},isHeaderPattern:function(t,e){return 255===t[e]&&224==(224&t[e+1])&&0!=(6&t[e+1])},isHeader:function(t,e){return!!(e+1<t.length&&this.isHeaderPattern(t,e))},probe:function(t,e){if(e+1<t.length&&this.isHeaderPattern(t,e)){var r=this.parseHeader(t,e),i=4;r&&r.frameLength&&(i=r.frameLength);var n=e+i;if(n===t.length||n+1<t.length&&this.isHeaderPattern(t,n))return!0}return!1}};e.default=i},"./src/demux/sample-aes.js":function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r("./src/crypt/decrypter.js"),n=function(){function t(t,e,r,n){this.decryptdata=r,this.discardEPB=n,this.decrypter=new i.default(t,e,{removePKCS7Padding:!1})}return t.prototype.decryptBuffer=function(t,e){this.decrypter.decrypt(t,this.decryptdata.key.buffer,this.decryptdata.iv.buffer,e)},t.prototype.decryptAacSample=function(t,e,r,i){var n=t[e].unit,a=n.subarray(16,n.length-n.length%16),o=a.buffer.slice(a.byteOffset,a.byteOffset+a.length),s=this;this.decryptBuffer(o,function(a){a=new Uint8Array(a),n.set(a,16),i||s.decryptAacSamples(t,e+1,r)})},t.prototype.decryptAacSamples=function(t,e,r){for(;;e++){if(e>=t.length)return void r();if(!(t[e].unit.length<32)){var i=this.decrypter.isSync();if(this.decryptAacSample(t,e,r,i),!i)return}}},t.prototype.getAvcEncryptedData=function(t){for(var e=16*Math.floor((t.length-48)/160)+16,r=new Int8Array(e),i=0,n=32;n<=t.length-16;n+=160,i+=16)r.set(t.subarray(n,n+16),i);return r},t.prototype.getAvcDecryptedUnit=function(t,e){e=new Uint8Array(e);for(var r=0,i=32;i<=t.length-16;i+=160,r+=16)t.set(e.subarray(r,r+16),i);return t},t.prototype.decryptAvcSample=function(t,e,r,i,n,a){var o=this.discardEPB(n.data),s=this.getAvcEncryptedData(o),l=this;this.decryptBuffer(s.buffer,function(s){n.data=l.getAvcDecryptedUnit(o,s),a||l.decryptAvcSamples(t,e,r+1,i)})},t.prototype.decryptAvcSamples=function(t,e,r,i){for(;;e++,r=0){if(e>=t.length)return void i();for(var n=t[e].units;!(r>=n.length);r++){var a=n[r];if(!(a.length<=48||1!==a.type&&5!==a.type)){var o=this.decrypter.isSync();if(this.decryptAvcSample(t,e,r,i,a,o),!o)return}}}},t}();e.default=n},"./src/demux/tsdemuxer.js":function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r("./src/demux/adts.js"),n=r("./src/demux/mpegaudio.js"),a=r("./src/events.js"),o=r("./src/demux/exp-golomb.js"),s=r("./src/demux/sample-aes.js"),l=r("./src/utils/logger.js"),u=r("./src/errors.js"),d={video:1,audio:2,id3:3,text:4},c=function(){function t(t,e,r,i){this.observer=t,this.config=r,this.typeSupported=i,this.remuxer=e,this.sampleAes=null}return t.prototype.setDecryptData=function(t){null!=t&&null!=t.key&&"SAMPLE-AES"===t.method?this.sampleAes=new s.default(this.observer,this.config,t,this.discardEPB):this.sampleAes=null},t.probe=function(e){var r=t._syncOffset(e);return!(r<0)&&(r&&l.logger.warn("MPEG2-TS detected but first sync word found @ offset "+r+", junk ahead ?"),!0)},t._syncOffset=function(t){for(var e=Math.min(1e3,t.length-564),r=0;r<e;){if(71===t[r]&&71===t[r+188]&&71===t[r+376])return r;r++}return-1},t.createTrack=function(t,e){return{container:"video"===t||"audio"===t?"video/mp2t":void 0,type:t,id:d[t],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],len:0,dropped:"video"===t?0:void 0,isAAC:"audio"===t||void 0,duration:"audio"===t?e:void 0}},t.prototype.resetInitSegment=function(e,r,i,n){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=t.createTrack("video",n),this._audioTrack=t.createTrack("audio",n),this._id3Track=t.createTrack("id3",n),this._txtTrack=t.createTrack("text",n),this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=r,this.videoCodec=i,this._duration=n},t.prototype.resetTimeStamp=function(){},t.prototype.append=function(e,r,i,n){var o,s,d,c,f,h=e.length,p=!1;this.contiguous=i;var g=this.pmtParsed,y=this._avcTrack,m=this._audioTrack,v=this._id3Track,A=y.pid,_=m.pid,b=v.pid,E=this._pmtId,T=y.pesData,S=m.pesData,L=v.pesData,k=this._parsePAT,R=this._parsePMT,C=this._parsePES,w=this._parseAVCPES.bind(this),O=this._parseAACPES.bind(this),P=this._parseMPEGPES.bind(this),D=this._parseID3PES.bind(this),I=t._syncOffset(e);for(h-=(h+I)%188,o=I;o<h;o+=188)if(71===e[o]){if(s=!!(64&e[o+1]),d=((31&e[o+1])<<8)+e[o+2],(48&e[o+3])>>4>1){if((c=o+5+e[o+4])===o+188)continue}else c=o+4;switch(d){case A:s&&(T&&(f=C(T))&&void 0!==f.pts&&w(f,!1),T={data:[],size:0}),T&&(T.data.push(e.subarray(c,o+188)),T.size+=o+188-c);break;case _:s&&(S&&(f=C(S))&&void 0!==f.pts&&(m.isAAC?O(f):P(f)),S={data:[],size:0}),S&&(S.data.push(e.subarray(c,o+188)),S.size+=o+188-c);break;case b:s&&(L&&(f=C(L))&&void 0!==f.pts&&D(f),L={data:[],size:0}),L&&(L.data.push(e.subarray(c,o+188)),L.size+=o+188-c);break;case 0:s&&(c+=e[c]+1),E=this._pmtId=k(e,c);break;case E:s&&(c+=e[c]+1);var x=R(e,c,!0===this.typeSupported.mpeg||!0===this.typeSupported.mp3,null!=this.sampleAes);A=x.avc,A>0&&(y.pid=A),_=x.audio,_>0&&(m.pid=_,m.isAAC=x.isAAC),b=x.id3,b>0&&(v.pid=b),p&&!g&&(l.logger.log("reparse from beginning"),p=!1,o=I-188),g=this.pmtParsed=!0;break;case 17:case 8191:break;default:p=!0}}else this.observer.trigger(a.default.ERROR,{type:u.ErrorTypes.MEDIA_ERROR,details:u.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});T&&(f=C(T))&&void 0!==f.pts?(w(f,!0),y.pesData=null):y.pesData=T,S&&(f=C(S))&&void 0!==f.pts?(m.isAAC?O(f):P(f),m.pesData=null):(S&&S.size&&l.logger.log("last AAC PES packet truncated,might overlap between fragments"),m.pesData=S),L&&(f=C(L))&&void 0!==f.pts?(D(f),v.pesData=null):v.pesData=L,null==this.sampleAes?this.remuxer.remux(m,y,v,this._txtTrack,r,i,n):this.decryptAndRemux(m,y,v,this._txtTrack,r,i,n)},t.prototype.decryptAndRemux=function(t,e,r,i,n,a,o){if(t.samples&&t.isAAC){var s=this;this.sampleAes.decryptAacSamples(t.samples,0,function(){s.decryptAndRemuxAvc(t,e,r,i,n,a,o)})}else this.decryptAndRemuxAvc(t,e,r,i,n,a,o)},t.prototype.decryptAndRemuxAvc=function(t,e,r,i,n,a,o){if(e.samples){var s=this;this.sampleAes.decryptAvcSamples(e.samples,0,0,function(){s.remuxer.remux(t,e,r,i,n,a,o)})}else this.remuxer.remux(t,e,r,i,n,a,o)},t.prototype.destroy=function(){this._initPTS=this._initDTS=void 0,this._duration=0},t.prototype._parsePAT=function(t,e){return(31&t[e+10])<<8|t[e+11]},t.prototype._parsePMT=function(t,e,r,i){var n,a,o,s,u={audio:-1,avc:-1,id3:-1,isAAC:!0};for(n=(15&t[e+1])<<8|t[e+2],a=e+3+n-4,o=(15&t[e+10])<<8|t[e+11],e+=12+o;e<a;){switch(s=(31&t[e+1])<<8|t[e+2],t[e]){case 207:if(!i){l.logger.log("unkown stream type:"+t[e]);break}case 15:-1===u.audio&&(u.audio=s);break;case 21:-1===u.id3&&(u.id3=s);break;case 219:if(!i){l.logger.log("unkown stream type:"+t[e]);break}case 27:-1===u.avc&&(u.avc=s);break;case 3:case 4:r?-1===u.audio&&(u.audio=s,u.isAAC=!1):l.logger.log("MPEG audio found, not supported in this browser for now");break;case 36:l.logger.warn("HEVC stream type found, not supported for now");break;default:l.logger.log("unkown stream type:"+t[e])}e+=5+((15&t[e+3])<<8|t[e+4])}return u},t.prototype._parsePES=function(t){var e,r,i,n,a,o,s,u,d=0,c=t.data;if(!t||0===t.size)return null;for(;c[0].length<19&&c.length>1;){var f=new Uint8Array(c[0].length+c[1].length);f.set(c[0]),f.set(c[1],c[0].length),c[0]=f,c.splice(1,1)}if(e=c[0],1===(e[0]<<16)+(e[1]<<8)+e[2]){if((i=(e[4]<<8)+e[5])&&i>t.size-6)return null;r=e[7],192&r&&(o=536870912*(14&e[9])+4194304*(255&e[10])+16384*(254&e[11])+128*(255&e[12])+(254&e[13])/2,o>4294967295&&(o-=8589934592),64&r?(s=536870912*(14&e[14])+4194304*(255&e[15])+16384*(254&e[16])+128*(255&e[17])+(254&e[18])/2,s>4294967295&&(s-=8589934592),o-s>54e5&&(l.logger.warn(Math.round((o-s)/9e4)+"s delta between PTS and DTS, align them"),o=s)):s=o),n=e[8],u=n+9,t.size-=u,a=new Uint8Array(t.size);for(var h=0,p=c.length;h<p;h++){e=c[h];var g=e.byteLength;if(u){if(u>g){u-=g;continue}e=e.subarray(u),g-=u,u=0}a.set(e,d),d+=g}return i&&(i-=n+3),{data:a,pts:o,dts:s,len:i}}return null},t.prototype.pushAccesUnit=function(t,e){if(t.units.length&&t.frame){var r=e.samples,i=r.length;!this.config.forceKeyFrameOnDiscontinuity||!0===t.key||e.sps&&(i||this.contiguous)?(t.id=i,r.push(t)):e.dropped++}t.debug.length&&l.logger.log(t.pts+"/"+t.dts+":"+t.debug)},t.prototype._parseAVCPES=function(t,e){var r,i,n,a=this,s=this._avcTrack,l=this._parseAVCNALu(t.data),u=this.avcSample,d=!1,c=this.pushAccesUnit.bind(this),f=function(t,e,r,i){return{key:t,pts:e,dts:r,units:[],debug:i}};t.data=null,u&&l.length&&!s.audFound&&(c(u,s),u=this.avcSample=f(!1,t.pts,t.dts,"")),l.forEach(function(e){switch(e.type){case 1:i=!0,u||(u=a.avcSample=f(!0,t.pts,t.dts,"")),u.frame=!0;var l=e.data;if(d&&l.length>4){var h=new o.default(l).readSliceType();2!==h&&4!==h&&7!==h&&9!==h||(u.key=!0)}break;case 5:i=!0,u||(u=a.avcSample=f(!0,t.pts,t.dts,"")),u.key=!0,u.frame=!0;break;case 6:i=!0,r=new o.default(a.discardEPB(e.data)),r.readUByte();for(var p=0,g=0,y=!1,m=0;!y&&r.bytesAvailable>1;){p=0;do{m=r.readUByte(),p+=m}while(255===m);g=0;do{m=r.readUByte(),g+=m}while(255===m);if(4===p&&0!==r.bytesAvailable){y=!0;if(181===r.readUByte()){if(49===r.readUShort()){if(1195456820===r.readUInt()){if(3===r.readUByte()){var v=r.readUByte(),A=r.readUByte(),_=31&v,b=[v,A];for(n=0;n<_;n++)b.push(r.readUByte()),b.push(r.readUByte()),b.push(r.readUByte());a._insertSampleInOrder(a._txtTrack.samples,{type:3,pts:t.pts,bytes:b})}}}}}else if(g<r.bytesAvailable)for(n=0;n<g;n++)r.readUByte()}break;case 7:if(i=!0,d=!0,!s.sps){r=new o.default(e.data);var E=r.readSPS();s.width=E.width,s.height=E.height,s.pixelRatio=E.pixelRatio,s.sps=[e.data],s.duration=a._duration;var T=e.data.subarray(1,4),S="avc1.";for(n=0;n<3;n++){var L=T[n].toString(16);L.length<2&&(L="0"+L),S+=L}s.codec=S}break;case 8:i=!0,s.pps||(s.pps=[e.data]);break;case 9:i=!1,s.audFound=!0,u&&c(u,s),u=a.avcSample=f(!1,t.pts,t.dts,"");break;case 12:i=!1;break;default:i=!1,u&&(u.debug+="unknown NAL "+e.type+" ")}if(u&&i){u.units.push(e)}}),e&&u&&(c(u,s),this.avcSample=null)},t.prototype._insertSampleInOrder=function(t,e){var r=t.length;if(r>0){if(e.pts>=t[r-1].pts)t.push(e);else for(var i=r-1;i>=0;i--)if(e.pts<t[i].pts){t.splice(i,0,e);break}}else t.push(e)},t.prototype._getLastNalUnit=function(){var t,e=this.avcSample;if(!e||0===e.units.length){var r=this._avcTrack,i=r.samples;e=i[i.length-1]}if(e){var n=e.units;t=n[n.length-1]}return t},t.prototype._parseAVCNALu=function(t){var e,r,i,n,a,o=0,s=t.byteLength,l=this._avcTrack,u=l.naluState||0,d=u,c=[],f=-1;for(-1===u&&(f=0,a=31&t[0],u=0,o=1);o<s;)if(e=t[o++],u)if(1!==u)if(e)if(1===e){if(f>=0)i={data:t.subarray(f,o-u-1),type:a},c.push(i);else{var h=this._getLastNalUnit();if(h&&(d&&o<=4-d&&h.state&&(h.data=h.data.subarray(0,h.data.byteLength-d)),(r=o-u-1)>0)){var p=new Uint8Array(h.data.byteLength+r);p.set(h.data,0),p.set(t.subarray(0,r),h.data.byteLength),h.data=p}}o<s?(n=31&t[o],f=o,a=n,u=0):u=-1}else u=0;else u=3;else u=e?0:2;else u=e?0:1;if(f>=0&&u>=0&&(i={data:t.subarray(f,s),type:a,state:u},c.push(i)),0===c.length){var h=this._getLastNalUnit();if(h){var p=new Uint8Array(h.data.byteLength+t.byteLength);p.set(h.data,0),p.set(t,h.data.byteLength),h.data=p}}return l.naluState=u,c},t.prototype.discardEPB=function(t){for(var e,r,i=t.byteLength,n=[],a=1;a<i-2;)0===t[a]&&0===t[a+1]&&3===t[a+2]?(n.push(a+2),a+=2):a++;if(0===n.length)return t;e=i-n.length,r=new Uint8Array(e);var o=0;for(a=0;a<e;o++,a++)o===n[0]&&(o++,n.shift()),r[a]=t[o];return r},t.prototype._parseAACPES=function(t){var e,r,n,o,s,d=this._audioTrack,c=t.data,f=t.pts,h=this.aacOverFlow,p=this.aacLastPTS;if(h){var g=new Uint8Array(h.byteLength+c.byteLength);g.set(h,0),g.set(c,h.byteLength),c=g}for(n=0,s=c.length;n<s-1&&!i.isHeader(c,n);n++);if(n){var y=void 0,m=void 0;if(n<s-1?(y="AAC PES did not start with ADTS header,offset:"+n,m=!1):(y="no ADTS header found in AAC PES",m=!0),l.logger.warn("parsing error:"+y),this.observer.trigger(a.default.ERROR,{type:u.ErrorTypes.MEDIA_ERROR,details:u.ErrorDetails.FRAG_PARSING_ERROR,fatal:m,reason:y}),m)return}if(i.initTrackConfig(d,this.observer,c,n,this.audioCodec),r=0,e=i.getFrameDuration(d.samplerate),h&&p){var v=p+e;Math.abs(v-f)>1&&(l.logger.log("AAC: align PTS for overlapping frames by "+Math.round((v-f)/90)),f=v)}for(;n<s;)if(i.isHeader(c,n)&&n+5<s){var A=i.appendFrame(d,c,n,f,r);if(!A)break;n+=A.length,o=A.sample.pts,r++}else n++;h=n<s?c.subarray(n,s):null,this.aacOverFlow=h,this.aacLastPTS=o},t.prototype._parseMPEGPES=function(t){for(var e=t.data,r=e.length,i=0,a=0,o=t.pts;a<r;)if(n.default.isHeader(e,a)){var s=n.default.appendFrame(this._audioTrack,e,a,o,i);if(!s)break;a+=s.length,i++}else a++},t.prototype._parseID3PES=function(t){this._id3Track.samples.push(t)},t}();e.default=c},"./src/errors.js":function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ErrorTypes={NETWORK_ERROR:"networkError",MEDIA_ERROR:"mediaError",KEY_SYSTEM_ERROR:"keySystemError",MUX_ERROR:"muxError",OTHER_ERROR:"otherError"},e.ErrorDetails={KEY_SYSTEM_NO_KEYS:"keySystemNoKeys",KEY_SYSTEM_NO_ACCESS:"keySystemNoAccess",KEY_SYSTEM_NO_SESSION:"keySystemNoSession",KEY_SYSTEM_LICENSE_REQUEST_FAILED:"keySystemLicenseRequestFailed",MANIFEST_LOAD_ERROR:"manifestLoadError",MANIFEST_LOAD_TIMEOUT:"manifestLoadTimeOut",MANIFEST_PARSING_ERROR:"manifestParsingError",MANIFEST_INCOMPATIBLE_CODECS_ERROR:"manifestIncompatibleCodecsError",LEVEL_LOAD_ERROR:"levelLoadError",LEVEL_LOAD_TIMEOUT:"levelLoadTimeOut",LEVEL_SWITCH_ERROR:"levelSwitchError",AUDIO_TRACK_LOAD_ERROR:"audioTrackLoadError",AUDIO_TRACK_LOAD_TIMEOUT:"audioTrackLoadTimeOut",FRAG_LOAD_ERROR:"fragLoadError",FRAG_LOAD_TIMEOUT:"fragLoadTimeOut",FRAG_DECRYPT_ERROR:"fragDecryptError",FRAG_PARSING_ERROR:"fragParsingError",REMUX_ALLOC_ERROR:"remuxAllocError",KEY_LOAD_ERROR:"keyLoadError",KEY_LOAD_TIMEOUT:"keyLoadTimeOut",BUFFER_ADD_CODEC_ERROR:"bufferAddCodecError",BUFFER_APPEND_ERROR:"bufferAppendError",BUFFER_APPENDING_ERROR:"bufferAppendingError",BUFFER_STALLED_ERROR:"bufferStalledError",BUFFER_FULL_ERROR:"bufferFullError",BUFFER_SEEK_OVER_HOLE:"bufferSeekOverHole",BUFFER_NUDGE_ON_STALL:"bufferNudgeOnStall",INTERNAL_EXCEPTION:"internalException"}},"./src/event-handler.js":function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r("./src/utils/logger.js"),n=r("./src/errors.js"),a=r("./src/events.js"),o={hlsEventGeneric:!0,hlsHandlerDestroying:!0,hlsHandlerDestroyed:!0},s=function(){function t(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];this.hls=t,this.onEvent=this.onEvent.bind(this),this.handledEvents=e,this.useGenericHandler=!0,this.registerListeners()}return t.prototype.destroy=function(){this.onHandlerDestroying(),this.unregisterListeners(),this.onHandlerDestroyed()},t.prototype.onHandlerDestroying=function(){},t.prototype.onHandlerDestroyed=function(){},t.prototype.isEventHandler=function(){return"object"==typeof this.handledEvents&&this.handledEvents.length&&"function"==typeof this.onEvent},t.prototype.registerListeners=function(){this.isEventHandler()&&this.handledEvents.forEach(function(t){if(o[t])throw new Error("Forbidden event-name: "+t);this.hls.on(t,this.onEvent)},this)},t.prototype.unregisterListeners=function(){this.isEventHandler()&&this.handledEvents.forEach(function(t){this.hls.off(t,this.onEvent)},this)},t.prototype.onEvent=function(t,e){this.onEventGeneric(t,e)},t.prototype.onEventGeneric=function(t,e){var r=function(t,e){var r="on"+t.replace("hls","");if("function"!=typeof this[r])throw new Error("Event "+t+" has no generic handler in this "+this.constructor.name+" class (tried "+r+")");return this[r].bind(this,e)};try{r.call(this,t,e).call()}catch(e){i.logger.error("An internal error happened while handling event "+t+'. Error message: "'+e.message+'". Here is a stacktrace:',e),this.hls.trigger(a.default.ERROR,{type:n.ErrorTypes.OTHER_ERROR,details:n.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:t,err:e})}},t}();e.default=s},"./src/events.js":function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i={MEDIA_ATTACHING:"hlsMediaAttaching",MEDIA_ATTACHED:"hlsMediaAttached",MEDIA_DETACHING:"hlsMediaDetaching",MEDIA_DETACHED:"hlsMediaDetached",BUFFER_RESET:"hlsBufferReset",BUFFER_CODECS:"hlsBufferCodecs",BUFFER_CREATED:"hlsBufferCreated",BUFFER_APPENDING:"hlsBufferAppending",BUFFER_APPENDED:"hlsBufferAppended",BUFFER_EOS:"hlsBufferEos",BUFFER_FLUSHING:"hlsBufferFlushing",BUFFER_FLUSHED:"hlsBufferFlushed",MANIFEST_LOADING:"hlsManifestLoading",MANIFEST_LOADED:"hlsManifestLoaded",MANIFEST_PARSED:"hlsManifestParsed",LEVEL_SWITCHING:"hlsLevelSwitching",LEVEL_SWITCHED:"hlsLevelSwitched",LEVEL_LOADING:"hlsLevelLoading",LEVEL_LOADED:"hlsLevelLoaded",LEVEL_UPDATED:"hlsLevelUpdated",LEVEL_PTS_UPDATED:"hlsLevelPtsUpdated",AUDIO_TRACKS_UPDATED:"hlsAudioTracksUpdated",AUDIO_TRACK_SWITCHING:"hlsAudioTrackSwitching",AUDIO_TRACK_SWITCHED:"hlsAudioTrackSwitched",AUDIO_TRACK_LOADING:"hlsAudioTrackLoading",AUDIO_TRACK_LOADED:"hlsAudioTrackLoaded",SUBTITLE_TRACKS_UPDATED:"hlsSubtitleTracksUpdated",SUBTITLE_TRACK_SWITCH:"hlsSubtitleTrackSwitch",SUBTITLE_TRACK_LOADING:"hlsSubtitleTrackLoading",SUBTITLE_TRACK_LOADED:"hlsSubtitleTrackLoaded",SUBTITLE_FRAG_PROCESSED:"hlsSubtitleFragProcessed",INIT_PTS_FOUND:"hlsInitPtsFound",FRAG_LOADING:"hlsFragLoading",FRAG_LOAD_PROGRESS:"hlsFragLoadProgress",FRAG_LOAD_EMERGENCY_ABORTED:"hlsFragLoadEmergencyAborted",FRAG_LOADED:"hlsFragLoaded",FRAG_DECRYPTED:"hlsFragDecrypted",FRAG_PARSING_INIT_SEGMENT:"hlsFragParsingInitSegment",FRAG_PARSING_USERDATA:"hlsFragParsingUserdata",FRAG_PARSING_METADATA:"hlsFragParsingMetadata",FRAG_PARSING_DATA:"hlsFragParsingData",FRAG_PARSED:"hlsFragParsed",FRAG_BUFFERED:"hlsFragBuffered",FRAG_CHANGED:"hlsFragChanged",FPS_DROP:"hlsFpsDrop",FPS_DROP_LEVEL_CAPPING:"hlsFpsDropLevelCapping",ERROR:"hlsError",DESTROYING:"hlsDestroying",KEY_LOADING:"hlsKeyLoading",KEY_LOADED:"hlsKeyLoaded",STREAM_STATE_TRANSITION:"hlsStreamStateTransition"};e.default=i},"./src/hls.js":function(t,e,r){"use strict";var i=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var n=r("./node_modules/url-toolkit/src/url-toolkit.js"),a=r("./src/errors.js"),o=r("./src/loader/playlist-loader.js"),s=r("./src/loader/fragment-loader.js"),l=r("./src/loader/key-loader.js"),u=r("./src/controller/fragment-tracker.js"),d=r("./src/controller/stream-controller.js"),c=r("./src/controller/level-controller.js"),f=r("./src/controller/id3-track-controller.js"),h=r("./src/is-supported.js"),p=r("./src/utils/logger.js"),g=r("./src/config.js"),y=r("./src/events.js"),m=r("./src/observer.js"),v=function(t){function e(r){void 0===r&&(r={});var i=t.call(this)||this,n=e.DefaultConfig;if((r.liveSyncDurationCount||r.liveMaxLatencyDurationCount)&&(r.liveSyncDuration||r.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");for(var a in n)a in r||(r[a]=n[a]);if(void 0!==r.liveMaxLatencyDurationCount&&r.liveMaxLatencyDurationCount<=r.liveSyncDurationCount)throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be gt "liveSyncDurationCount"');if(void 0!==r.liveMaxLatencyDuration&&(r.liveMaxLatencyDuration<=r.liveSyncDuration||void 0===r.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be gt "liveSyncDuration"');p.enableLogs(r.debug),i.config=r,i._autoLevelCapping=-1;var h=i.abrController=new r.abrController(i),g=new r.bufferController(i),y=new r.capLevelController(i),m=new r.fpsController(i),v=new o.default(i),A=new s.default(i),_=new l.default(i),b=new f.default(i),E=i.levelController=new c.default(i),T=new u.FragmentTracker(i),S=i.streamController=new d.default(i,T),L=[E,S],k=r.audioStreamController;k&&L.push(new k(i,T)),i.networkControllers=L;var R=[v,A,_,h,g,y,m,b,T];if(k=r.audioTrackController){var C=new k(i);i.audioTrackController=C,R.push(C)}if(k=r.subtitleTrackController){var w=new k(i);i.subtitleTrackController=w,R.push(w)}if(k=r.emeController){var O=new k(i);i.emeController=O,R.push(O)}return k=r.subtitleStreamController,k&&R.push(new k(i,T)),k=r.timelineController,k&&R.push(new k(i)),i.coreComponents=R,i}return i(e,t),Object.defineProperty(e,"version",{get:function(){return"0.12.2"},enumerable:!0,configurable:!0}),e.isSupported=function(){return h.isSupported()},Object.defineProperty(e,"Events",{get:function(){return y.default},enumerable:!0,configurable:!0}),Object.defineProperty(e,"ErrorTypes",{get:function(){return a.ErrorTypes},enumerable:!0,configurable:!0}),Object.defineProperty(e,"ErrorDetails",{get:function(){return a.ErrorDetails},enumerable:!0,configurable:!0}),Object.defineProperty(e,"DefaultConfig",{get:function(){return e.defaultConfig?e.defaultConfig:g.hlsDefaultConfig},set:function(t){e.defaultConfig=t},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){p.logger.log("destroy"),this.trigger(y.default.DESTROYING),this.detachMedia(),this.coreComponents.concat(this.networkControllers).forEach(function(t){t.destroy()}),this.url=null,this.removeAllListeners(),this._autoLevelCapping=-1},e.prototype.attachMedia=function(t){p.logger.log("attachMedia"),this.media=t,this.trigger(y.default.MEDIA_ATTACHING,{media:t})},e.prototype.detachMedia=function(){p.logger.log("detachMedia"),this.trigger(y.default.MEDIA_DETACHING),this.media=null},e.prototype.loadSource=function(t){t=n.buildAbsoluteURL(window.location.href,t,{alwaysNormalize:!0}),p.logger.log("loadSource:"+t),this.url=t,this.trigger(y.default.MANIFEST_LOADING,{url:t})},e.prototype.startLoad=function(t){void 0===t&&(t=-1),p.logger.log("startLoad("+t+")"),this.networkControllers.forEach(function(e){e.startLoad(t)})},e.prototype.stopLoad=function(){p.logger.log("stopLoad"),this.networkControllers.forEach(function(t){t.stopLoad()})},e.prototype.swapAudioCodec=function(){p.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},e.prototype.recoverMediaError=function(){p.logger.log("recoverMediaError");var t=this.media;this.detachMedia(),this.attachMedia(t)},Object.defineProperty(e.prototype,"levels",{get:function(){return this.levelController.levels},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentLevel",{get:function(){return this.streamController.currentLevel},set:function(t){p.logger.log("set currentLevel:"+t),this.loadLevel=t,this.streamController.immediateLevelSwitch()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"nextLevel",{get:function(){return this.streamController.nextLevel},set:function(t){p.logger.log("set nextLevel:"+t),this.levelController.manualLevel=t,this.streamController.nextLevelSwitch()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"loadLevel",{get:function(){return this.levelController.level},set:function(t){p.logger.log("set loadLevel:"+t),this.levelController.manualLevel=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"nextLoadLevel",{get:function(){return this.levelController.nextLoadLevel},set:function(t){this.levelController.nextLoadLevel=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"firstLevel",{get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(t){p.logger.log("set firstLevel:"+t),this.levelController.firstLevel=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"startLevel",{get:function(){return this.levelController.startLevel},set:function(t){p.logger.log("set startLevel:"+t);var e=this;-1!==t&&(t=Math.max(t,e.minAutoLevel)),e.levelController.startLevel=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"autoLevelCapping",{get:function(){return this._autoLevelCapping},set:function(t){p.logger.log("set autoLevelCapping:"+t),this._autoLevelCapping=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"autoLevelEnabled",{get:function(){return-1===this.levelController.manualLevel},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"manualLevel",{get:function(){return this.levelController.manualLevel},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"minAutoLevel",{get:function(){for(var t=this,e=t.levels,r=t.config.minAutoBitrate,i=e?e.length:0,n=0;n<i;n++){if((e[n].realBitrate?Math.max(e[n].realBitrate,e[n].bitrate):e[n].bitrate)>r)return n}return 0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"maxAutoLevel",{get:function(){var t=this,e=t.levels,r=t.autoLevelCapping;return-1===r&&e&&e.length?e.length-1:r},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"nextAutoLevel",{get:function(){var t=this;return Math.min(Math.max(t.abrController.nextAutoLevel,t.minAutoLevel),t.maxAutoLevel)},set:function(t){var e=this;e.abrController.nextAutoLevel=Math.max(e.minAutoLevel,t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"audioTracks",{get:function(){var t=this.audioTrackController;return t?t.audioTracks:[]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"audioTrack",{get:function(){var t=this.audioTrackController;return t?t.audioTrack:-1},set:function(t){var e=this.audioTrackController;e&&(e.audioTrack=t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"liveSyncPosition",{get:function(){return this.streamController.liveSyncPosition},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"subtitleTracks",{get:function(){var t=this.subtitleTrackController;return t?t.subtitleTracks:[]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"subtitleTrack",{get:function(){var t=this.subtitleTrackController;return t?t.subtitleTrack:-1},set:function(t){var e=this.subtitleTrackController;e&&(e.subtitleTrack=t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"subtitleDisplay",{get:function(){var t=this.subtitleTrackController;return!!t&&t.subtitleDisplay},set:function(t){var e=this.subtitleTrackController;e&&(e.subtitleDisplay=t)},enumerable:!0,configurable:!0}),e}(m.Observer);e.default=v},"./src/is-supported.js":function(t,e,r){"use strict";function i(){var t=n.getMediaSource(),e=window.SourceBuffer||window.WebKitSourceBuffer,r=t&&"function"==typeof t.isTypeSupported&&t.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),i=!e||e.prototype&&"function"==typeof e.prototype.appendBuffer&&"function"==typeof e.prototype.remove;return!!r&&!!i}Object.defineProperty(e,"__esModule",{value:!0});var n=r("./src/utils/mediasource-helper.js");e.isSupported=i},"./src/loader/fragment-loader.js":function(t,e,r){"use strict";(function(t){var i=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var n=r("./src/events.js"),a=r("./src/event-handler.js"),o=r("./src/errors.js"),s=r("./src/utils/logger.js"),l=function(e){function r(t){var r=e.call(this,t,n.default.FRAG_LOADING)||this;return r.loaders={},r}return i(r,e),r.prototype.destroy=function(){var t=this.loaders;for(var r in t){var i=t[r];i&&i.destroy()}this.loaders={},e.prototype.destroy.call(this)},r.prototype.onFragLoading=function(e){var r=e.frag,i=r.type,n=this.loaders,a=this.hls.config,o=a.fLoader,l=a.loader;r.loaded=0;var u=n[i];u&&(s.logger.warn("abort previous fragment loader for type: "+i),u.abort()),u=n[i]=r.loader=a.fLoader?new o(a):new l(a);var d,c,f;d={url:r.url,frag:r,responseType:"arraybuffer",progressData:!1};var h=r.byteRangeStartOffset,p=r.byteRangeEndOffset;t.isFinite(h)&&t.isFinite(p)&&(d.rangeStart=h,d.rangeEnd=p),c={timeout:a.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:a.fragLoadingMaxRetryTimeout},f={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this),onProgress:this.loadprogress.bind(this)},u.load(d,c,f)},r.prototype.loadsuccess=function(t,e,r,i){void 0===i&&(i=null);var a=t.data,o=r.frag;o.loader=void 0,this.loaders[o.type]=void 0,this.hls.trigger(n.default.FRAG_LOADED,{payload:a,frag:o,stats:e,networkDetails:i})},r.prototype.loaderror=function(t,e,r){void 0===r&&(r=null);var i=e.frag,a=i.loader;a&&a.abort(),this.loaders[i.type]=void 0,this.hls.trigger(n.default.ERROR,{type:o.ErrorTypes.NETWORK_ERROR,details:o.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:e.frag,response:t,networkDetails:r})},r.prototype.loadtimeout=function(t,e,r){void 0===r&&(r=null);var i=e.frag,a=i.loader;a&&a.abort(),this.loaders[i.type]=void 0,this.hls.trigger(n.default.ERROR,{type:o.ErrorTypes.NETWORK_ERROR,details:o.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e.frag,networkDetails:r})},r.prototype.loadprogress=function(t,e,r,i){void 0===i&&(i=null);var a=e.frag;a.loaded=t.loaded,this.hls.trigger(n.default.FRAG_LOAD_PROGRESS,{frag:a,stats:t,networkDetails:i})},r}(a.default);e.default=l}).call(this,r("./src/polyfills/number.js").Number)},"./src/loader/fragment.js":function(t,e,r){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});var i=r("./node_modules/url-toolkit/src/url-toolkit.js"),n=r("./src/loader/level-key.js"),a=function(){function e(){var t;this._url=null,this._byteRange=null,this._decryptdata=null,this.tagList=[],this.programDateTime=null,this.rawProgramDateTime=null,this._elementaryStreams=(t={},t[e.ElementaryStreamTypes.AUDIO]=!1,t[e.ElementaryStreamTypes.VIDEO]=!1,t)}return Object.defineProperty(e,"ElementaryStreamTypes",{get:function(){return{AUDIO:"audio",VIDEO:"video"}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"url",{get:function(){return!this._url&&this.relurl&&(this._url=i.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url},set:function(t){this._url=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"byteRange",{get:function(){if(!this._byteRange&&!this.rawByteRange)return[];if(this._byteRange)return this._byteRange;var t=[];if(this.rawByteRange){var e=this.rawByteRange.split("@",2);if(1===e.length){var r=this.lastByteRangeEndOffset;t[0]=r||0}else t[0]=parseInt(e[1]);t[1]=parseInt(e[0])+t[0],this._byteRange=t}return t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"byteRangeStartOffset",{get:function(){return this.byteRange[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"byteRangeEndOffset",{get:function(){return this.byteRange[1]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"decryptdata",{get:function(){return this._decryptdata||(this._decryptdata=this.fragmentDecryptdataFromLevelkey(this.levelkey,this.sn)),this._decryptdata},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"endProgramDateTime",{get:function(){if(!t.isFinite(this.programDateTime))return null;var e=t.isFinite(this.duration)?this.duration:0;return this.programDateTime+1e3*e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"encrypted",{get:function(){return!(!this.decryptdata||null===this.decryptdata.uri||null!==this.decryptdata.key)},enumerable:!0,configurable:!0}),e.prototype.addElementaryStream=function(t){this._elementaryStreams[t]=!0},e.prototype.hasElementaryStream=function(t){return!0===this._elementaryStreams[t]},e.prototype.createInitializationVector=function(t){for(var e=new Uint8Array(16),r=12;r<16;r++)e[r]=t>>8*(15-r)&255;return e},e.prototype.fragmentDecryptdataFromLevelkey=function(t,e){var r=t;return t&&t.method&&t.uri&&!t.iv&&(r=new n.default,r.method=t.method,r.baseuri=t.baseuri,r.reluri=t.reluri,r.iv=this.createInitializationVector(e)),r},e}();e.default=a}).call(this,r("./src/polyfills/number.js").Number)},"./src/loader/key-loader.js":function(t,e,r){"use strict";var i=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var n=r("./src/events.js"),a=r("./src/event-handler.js"),o=r("./src/errors.js"),s=r("./src/utils/logger.js"),l=function(t){function e(e){var r=t.call(this,e,n.default.KEY_LOADING)||this;return r.loaders={},r.decryptkey=null,r.decrypturl=null,r}return i(e,t),e.prototype.destroy=function(){for(var t in this.loaders){var e=this.loaders[t];e&&e.destroy()}this.loaders={},a.default.prototype.destroy.call(this)},e.prototype.onKeyLoading=function(t){var e=t.frag,r=e.type,i=this.loaders[r],a=e.decryptdata,o=a.uri;if(o!==this.decrypturl||null===this.decryptkey){var l=this.hls.config;i&&(s.logger.warn("abort previous key loader for type:"+r),i.abort()),e.loader=this.loaders[r]=new l.loader(l),this.decrypturl=o,this.decryptkey=null;var u=void 0,d=void 0,c=void 0;u={url:o,frag:e,responseType:"arraybuffer"},d={timeout:l.fragLoadingTimeOut,maxRetry:0,retryDelay:l.fragLoadingRetryDelay,maxRetryDelay:l.fragLoadingMaxRetryTimeout},c={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)},e.loader.load(u,d,c)}else this.decryptkey&&(a.key=this.decryptkey,this.hls.trigger(n.default.KEY_LOADED,{frag:e}))},e.prototype.loadsuccess=function(t,e,r){var i=r.frag;this.decryptkey=i.decryptdata.key=new Uint8Array(t.data),i.loader=void 0,this.loaders[i.type]=void 0,this.hls.trigger(n.default.KEY_LOADED,{frag:i})},e.prototype.loaderror=function(t,e){var r=e.frag,i=r.loader;i&&i.abort(),this.loaders[e.type]=void 0,this.hls.trigger(n.default.ERROR,{type:o.ErrorTypes.NETWORK_ERROR,details:o.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:r,response:t})},e.prototype.loadtimeout=function(t,e){var r=e.frag,i=r.loader;i&&i.abort(),this.loaders[e.type]=void 0,this.hls.trigger(n.default.ERROR,{type:o.ErrorTypes.NETWORK_ERROR,details:o.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:r})},e}(a.default);e.default=l},"./src/loader/level-key.js":function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r("./node_modules/url-toolkit/src/url-toolkit.js"),n=function(){function t(){this.method=null,this.key=null,this.iv=null,this._uri=null}return Object.defineProperty(t.prototype,"uri",{get:function(){return!this._uri&&this.reluri&&(this._uri=i.buildAbsoluteURL(this.baseuri,this.reluri,{alwaysNormalize:!0})),this._uri},enumerable:!0,configurable:!0}),t}();e.default=n},"./src/loader/level.js":function(t,e,r){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function e(t){this.endCC=0,this.endSN=0,this.fragments=[],this.initSegment=null,this.live=!0,this.needSidxRanges=!1,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=t,this.version=null}return Object.defineProperty(e.prototype,"hasProgramDateTime",{get:function(){return!(!this.fragments[0]||!t.isFinite(this.fragments[0].programDateTime))},enumerable:!0,configurable:!0}),e}();e.default=r}).call(this,r("./src/polyfills/number.js").Number)},"./src/loader/m3u8-parser.js":function(t,e,r){"use strict";(function(t){function i(t,e){for(var r=t[e],i=e-1;i>=0;i--){var n=t[i];n.programDateTime=r.programDateTime-1e3*n.duration,r=n}}function n(e,r){e.rawProgramDateTime?e.programDateTime=Date.parse(e.rawProgramDateTime):r&&r.programDateTime&&(e.programDateTime=r.endProgramDateTime),t.isFinite(e.programDateTime)||(e.programDateTime=null,e.rawProgramDateTime=null)}Object.defineProperty(e,"__esModule",{value:!0});var a=r("./node_modules/url-toolkit/src/url-toolkit.js"),o=r("./src/loader/fragment.js"),s=r("./src/loader/level.js"),l=r("./src/loader/level-key.js"),u=r("./src/utils/attr-list.js"),d=r("./src/utils/logger.js"),c=r("./src/utils/codecs.js"),f=/#EXT-X-STREAM-INF:([^\n\r]*)[\r\n]+([^\r\n]+)/g,h=/#EXT-X-MEDIA:(.*)/g,p=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/|(?!#)([\S+ ?]+)/.source,/|#EXT-X-BYTERANGE:*(.+)/.source,/|#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/|#.*/.source].join(""),"g"),g=/(?:(?:#(EXTM3U))|(?:#EXT-X-(PLAYLIST-TYPE):(.+))|(?:#EXT-X-(MEDIA-SEQUENCE): *(\d+))|(?:#EXT-X-(TARGETDURATION): *(\d+))|(?:#EXT-X-(KEY):(.+))|(?:#EXT-X-(START):(.+))|(?:#EXT-X-(ENDLIST))|(?:#EXT-X-(DISCONTINUITY-SEQ)UENCE:(\d+))|(?:#EXT-X-(DIS)CONTINUITY))|(?:#EXT-X-(VERSION):(\d+))|(?:#EXT-X-(MAP):(.+))|(?:(#)([^:]*):(.*))|(?:(#)(.*))(?:.*)\r?\n?/,y=/\.(mp4|m4s|m4v|m4a)$/i,m=function(){function e(){}return e.findGroup=function(t,e){if(!t)return null;for(var r=null,i=0;i<t.length;i++){var n=t[i];n.id===e&&(r=n)}return r},e.convertAVC1ToAVCOTI=function(t){var e,r=t.split(".");return r.length>2?(e=r.shift()+".",e+=parseInt(r.shift()).toString(16),e+=("000"+parseInt(r.shift()).toString(16)).substr(-4)):e=t,e},e.resolve=function(t,e){return a.buildAbsoluteURL(e,t,{alwaysNormalize:!0})},e.parseMasterPlaylist=function(t,r){var i,n=[];for(f.lastIndex=0;null!=(i=f.exec(t));){var a={},o=a.attrs=new u.default(i[1]);a.url=e.resolve(i[2],r);var s=o.decimalResolution("RESOLUTION");s&&(a.width=s.width,a.height=s.height),a.bitrate=o.decimalInteger("AVERAGE-BANDWIDTH")||o.decimalInteger("BANDWIDTH"),a.name=o.NAME,function(t,e){["video","audio"].forEach(function(r){var i=t.filter(function(t){return c.isCodecType(t,r)});if(i.length){var n=i.filter(function(t){return 0===t.lastIndexOf("avc1",0)||0===t.lastIndexOf("mp4a",0)});e[r+"Codec"]=n.length>0?n[0]:i[0],t=t.filter(function(t){return-1===i.indexOf(t)})}}),e.unknownCodecs=t}([].concat((o.CODECS||"").split(/[ ,]+/)),a),a.videoCodec&&-1!==a.videoCodec.indexOf("avc1")&&(a.videoCodec=e.convertAVC1ToAVCOTI(a.videoCodec)),n.push(a)}return n},e.parseMasterPlaylistMedia=function(t,r,i,n){void 0===n&&(n=[]);var a,o=[],s=0;for(h.lastIndex=0;null!==(a=h.exec(t));){var l={},d=new u.default(a[1]);if(d.TYPE===i){if(l.groupId=d["GROUP-ID"],l.name=d.NAME,l.type=i,l.default="YES"===d.DEFAULT,l.autoselect="YES"===d.AUTOSELECT,l.forced="YES"===d.FORCED,d.URI&&(l.url=e.resolve(d.URI,r)),l.lang=d.LANGUAGE,l.name||(l.name=l.lang),n.length){var c=e.findGroup(n,l.groupId);l.audioCodec=c?c.codec:n[0].codec}l.id=s++,o.push(l)}}return o},e.parseLevelPlaylist=function(e,r,a,c,f){var h,m,v=0,A=0,_=new s.default(r),b=new l.default,E=0,T=null,S=new o.default,L=null;for(p.lastIndex=0;null!==(h=p.exec(e));){var k=h[1];if(k){S.duration=parseFloat(k);var R=(" "+h[2]).slice(1);S.title=R||null,S.tagList.push(R?["INF",k,R]:["INF",k])}else if(h[3]){if(t.isFinite(S.duration)){var C=v++;S.type=c,S.start=A,S.levelkey=b,S.sn=C,S.level=a,S.cc=E,S.urlId=f,S.baseurl=r,S.relurl=(" "+h[3]).slice(1),n(S,T),_.fragments.push(S),T=S,A+=S.duration,S=new o.default}}else if(h[4]){if(S.rawByteRange=(" "+h[4]).slice(1),T){var w=T.byteRangeEndOffset;w&&(S.lastByteRangeEndOffset=w)}}else if(h[5])S.rawProgramDateTime=(" "+h[5]).slice(1),S.tagList.push(["PROGRAM-DATE-TIME",S.rawProgramDateTime]),null===L&&(L=_.fragments.length);else{for(h=h[0].match(g),m=1;m<h.length&&void 0===h[m];m++);var O=(" "+h[m+1]).slice(1),P=(" "+h[m+2]).slice(1);switch(h[m]){case"#":S.tagList.push(P?[O,P]:[O]);break;case"PLAYLIST-TYPE":_.type=O.toUpperCase();break;case"MEDIA-SEQUENCE":v=_.startSN=parseInt(O);break;case"TARGETDURATION":_.targetduration=parseFloat(O);break;case"VERSION":_.version=parseInt(O);break;case"EXTM3U":break;case"ENDLIST":_.live=!1;break;case"DIS":E++,S.tagList.push(["DIS"]);break;case"DISCONTINUITY-SEQ":E=parseInt(O);break;case"KEY":var D=O,I=new u.default(D),x=I.enumeratedString("METHOD"),M=I.URI,N=I.hexadecimalInteger("IV");x&&(b=new l.default,M&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(x)>=0&&(b.method=x,b.baseuri=r,b.reluri=M,b.key=null,b.iv=N));break;case"START":var F=O,B=new u.default(F),U=B.decimalFloatingPoint("TIME-OFFSET");t.isFinite(U)&&(_.startTimeOffset=U);break;case"MAP":var j=new u.default(O);S.relurl=j.URI,S.rawByteRange=j.BYTERANGE,S.baseurl=r,S.level=a,S.type=c,S.sn="initSegment",_.initSegment=S,S=new o.default,S.rawProgramDateTime=_.initSegment.rawProgramDateTime;break;default:d.logger.warn("line parsed but not handled: "+h)}}}return S=T,S&&!S.relurl&&(_.fragments.pop(),A-=S.duration),_.totalduration=A,_.averagetargetduration=A/_.fragments.length,_.endSN=v-1,_.startCC=_.fragments[0]?_.fragments[0].cc:0,_.endCC=E,!_.initSegment&&_.fragments.length&&_.fragments.every(function(t){return y.test(t.relurl)})&&(d.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),S=new o.default,S.relurl=_.fragments[0].relurl,S.baseurl=r,S.level=a,S.type=c,S.sn="initSegment",_.initSegment=S,_.needSidxRanges=!0),L&&i(_.fragments,L),_},e}();e.default=m}).call(this,r("./src/polyfills/number.js").Number)},"./src/loader/playlist-loader.js":function(t,e,r){"use strict";(function(t){var i=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var n=r("./src/events.js"),a=r("./src/event-handler.js"),o=r("./src/errors.js"),s=r("./src/utils/logger.js"),l=r("./src/demux/mp4demuxer.js"),u=r("./src/loader/m3u8-parser.js"),d=window.performance,c={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},f={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"},h=function(e){function r(t){var r=e.call(this,t,n.default.MANIFEST_LOADING,n.default.LEVEL_LOADING,n.default.AUDIO_TRACK_LOADING,n.default.SUBTITLE_TRACK_LOADING)||this;return r.loaders={},r}return i(r,e),Object.defineProperty(r,"ContextType",{get:function(){return c},enumerable:!0,configurable:!0}),Object.defineProperty(r,"LevelType",{get:function(){return f},enumerable:!0,configurable:!0}),r.canHaveQualityLevels=function(t){return t!==c.AUDIO_TRACK&&t!==c.SUBTITLE_TRACK},r.mapContextToLevelType=function(t){switch(t.type){case c.AUDIO_TRACK:return f.AUDIO;case c.SUBTITLE_TRACK:return f.SUBTITLE;default:return f.MAIN}},r.getResponseUrl=function(t,e){var r=t.url;return void 0!==r&&0!==r.indexOf("data:")||(r=e.url),r},r.prototype.createInternalLoader=function(t){var e=this.hls.config,r=e.pLoader,i=e.loader,n=r||i,a=new n(e);return t.loader=a,this.loaders[t.type]=a,a},r.prototype.getInternalLoader=function(t){return this.loaders[t.type]},r.prototype.resetInternalLoader=function(t){this.loaders[t]&&delete this.loaders[t]},r.prototype.destroyInternalLoaders=function(){for(var t in this.loaders){var e=this.loaders[t];e&&e.destroy(),this.resetInternalLoader(t)}},r.prototype.destroy=function(){this.destroyInternalLoaders(),e.prototype.destroy.call(this)},r.prototype.onManifestLoading=function(t){this.load(t.url,{type:c.MANIFEST,level:0,id:null})},r.prototype.onLevelLoading=function(t){this.load(t.url,{type:c.LEVEL,level:t.level,id:t.id})},r.prototype.onAudioTrackLoading=function(t){this.load(t.url,{type:c.AUDIO_TRACK,level:null,id:t.id})},r.prototype.onSubtitleTrackLoading=function(t){this.load(t.url,{type:c.SUBTITLE_TRACK,level:null,id:t.id})},r.prototype.load=function(t,e){var r=this.hls.config;s.logger.debug("Loading playlist of type "+e.type+", level: "+e.level+", id: "+e.id);var i=this.getInternalLoader(e);if(i){var n=i.context;if(n&&n.url===t)return s.logger.trace("playlist request ongoing"),!1;s.logger.warn("aborting previous loader for type: "+e.type),i.abort()}var a,o,l,u;switch(e.type){case c.MANIFEST:a=r.manifestLoadingMaxRetry,o=r.manifestLoadingTimeOut,l=r.manifestLoadingRetryDelay,u=r.manifestLoadingMaxRetryTimeout;break;case c.LEVEL:a=0,o=r.levelLoadingTimeOut;break;default:a=r.levelLoadingMaxRetry,o=r.levelLoadingTimeOut,l=r.levelLoadingRetryDelay,u=r.levelLoadingMaxRetryTimeout}i=this.createInternalLoader(e),e.url=t,e.responseType=e.responseType||"";var d={timeout:o,maxRetry:a,retryDelay:l,maxRetryDelay:u},f={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};return s.logger.debug("Calling internal loader delegate for URL: "+t),i.load(e,d,f),!0},r.prototype.loadsuccess=function(t,e,r,i){if(void 0===i&&(i=null),r.isSidxRequest)return this._handleSidxRequest(t,r),void this._handlePlaylistLoaded(t,e,r,i);this.resetInternalLoader(r.type);var n=t.data;if(e.tload=d.now(),0!==n.indexOf("#EXTM3U"))return void this._handleManifestParsingError(t,r,"no EXTM3U delimiter",i);n.indexOf("#EXTINF:")>0||n.indexOf("#EXT-X-TARGETDURATION:")>0?this._handleTrackOrLevelPlaylist(t,e,r,i):this._handleMasterPlaylist(t,e,r,i)},r.prototype.loaderror=function(t,e,r){void 0===r&&(r=null),this._handleNetworkError(e,r,!1,t)},r.prototype.loadtimeout=function(t,e,r){void 0===r&&(r=null),this._handleNetworkError(e,r,!0)},r.prototype._handleMasterPlaylist=function(t,e,i,a){var o=this.hls,l=t.data,d=r.getResponseUrl(t,i),c=u.default.parseMasterPlaylist(l,d);if(!c.length)return void this._handleManifestParsingError(t,i,"no level found in manifest",a);var f=c.map(function(t){return{id:t.attrs.AUDIO,codec:t.audioCodec}}),h=u.default.parseMasterPlaylistMedia(l,d,"AUDIO",f),p=u.default.parseMasterPlaylistMedia(l,d,"SUBTITLES");if(h.length){var g=!1;h.forEach(function(t){t.url||(g=!0)}),!1===g&&c[0].audioCodec&&!c[0].attrs.AUDIO&&(s.logger.log("audio codec signaled in quality level, but no embedded audio track signaled, create one"),h.unshift({type:"main",name:"main"}))}o.trigger(n.default.MANIFEST_LOADED,{levels:c,audioTracks:h,subtitles:p,url:d,stats:e,networkDetails:a})},r.prototype._handleTrackOrLevelPlaylist=function(e,i,a,o){var s=this.hls,l=a.id,f=a.level,h=a.type,p=r.getResponseUrl(e,a),g=t.isFinite(l)?l:0,y=t.isFinite(f)?f:g,m=r.mapContextToLevelType(a),v=u.default.parseLevelPlaylist(e.data,p,y,m,g);if(v.tload=i.tload,h===c.MANIFEST){var A={url:p,details:v};s.trigger(n.default.MANIFEST_LOADED,{levels:[A],audioTracks:[],url:p,stats:i,networkDetails:o})}if(i.tparsed=d.now(),v.needSidxRanges){var _=v.initSegment.url;return void this.load(_,{isSidxRequest:!0,type:h,level:f,levelDetails:v,id:l,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer"})}a.levelDetails=v,this._handlePlaylistLoaded(e,i,a,o)},r.prototype._handleSidxRequest=function(t,e){var r=l.default.parseSegmentIndex(new Uint8Array(t.data));if(r){var i=r.references,n=e.levelDetails;i.forEach(function(t,e){var r=t.info,i=n.fragments[e];0===i.byteRange.length&&(i.rawByteRange=String(1+r.end-r.start)+"@"+String(r.start))}),n.initSegment.rawByteRange=String(r.moovEndOffset)+"@0"}},r.prototype._handleManifestParsingError=function(t,e,r,i){this.hls.trigger(n.default.ERROR,{type:o.ErrorTypes.NETWORK_ERROR,details:o.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:!0,url:t.url,reason:r,networkDetails:i})},r.prototype._handleNetworkError=function(t,e,r,i){void 0===r&&(r=!1),void 0===i&&(i=null),s.logger.info("A network error occured while loading a "+t.type+"-type playlist");var a,l,u=this.getInternalLoader(t);switch(t.type){case c.MANIFEST:a=r?o.ErrorDetails.MANIFEST_LOAD_TIMEOUT:o.ErrorDetails.MANIFEST_LOAD_ERROR,l=!0;break;case c.LEVEL:a=r?o.ErrorDetails.LEVEL_LOAD_TIMEOUT:o.ErrorDetails.LEVEL_LOAD_ERROR,l=!1;break;case c.AUDIO_TRACK:a=r?o.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:o.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,l=!1;break;default:l=!1}u&&(u.abort(),this.resetInternalLoader(t.type));var d={type:o.ErrorTypes.NETWORK_ERROR,details:a,fatal:l,url:u.url,loader:u,context:t,networkDetails:e};i&&(d.response=i),this.hls.trigger(n.default.ERROR,d)},r.prototype._handlePlaylistLoaded=function(t,e,i,a){var o=i.type,s=i.level,l=i.id,u=i.levelDetails;if(!u.targetduration)return void this._handleManifestParsingError(t,i,"invalid target duration",a);if(r.canHaveQualityLevels(i.type))this.hls.trigger(n.default.LEVEL_LOADED,{details:u,level:s||0,id:l||0,stats:e,networkDetails:a});else switch(o){case c.AUDIO_TRACK:this.hls.trigger(n.default.AUDIO_TRACK_LOADED,{details:u,id:l,stats:e,networkDetails:a});break;case c.SUBTITLE_TRACK:this.hls.trigger(n.default.SUBTITLE_TRACK_LOADED,{details:u,id:l,stats:e,networkDetails:a})}},r}(a.default);e.default=h}).call(this,r("./src/polyfills/number.js").Number)},"./src/observer.js":function(t,e,r){"use strict";var i=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var n=r("./node_modules/eventemitter3/index.js"),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.trigger=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];this.emit.apply(this,[t,t].concat(e))},e}(n.EventEmitter);e.Observer=a},"./src/polyfills/number.js":function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r("./src/utils/get-self-scope.js"),n=i.getSelfScope(),a=n.Number;e.Number=a,a.isFinite=a.isFinite||function(t){return"number"==typeof t&&isFinite(t)}},"./src/remux/aac-helper.js":function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(){}return t.getSilentFrame=function(t,e){switch(t){case"mp4a.40.2":if(1===e)return new Uint8Array([0,200,0,128,35,128]);if(2===e)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(6===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(1===e)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(2===e)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(3===e)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}return null},t}();e.default=i},"./src/remux/mp4-generator.js":function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=Math.pow(2,32)-1,n=function(){function t(){}return t.init=function(){t.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};var e;for(e in t.types)t.types.hasOwnProperty(e)&&(t.types[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);var r=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),i=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);t.HDLR_TYPES={video:r,audio:i};var n=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),a=new Uint8Array([0,0,0,0,0,0,0,0]);t.STTS=t.STSC=t.STCO=a,t.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),t.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),t.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),t.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var o=new Uint8Array([105,115,111,109]),s=new Uint8Array([97,118,99,49]),l=new Uint8Array([0,0,0,1]);t.FTYP=t.box(t.types.ftyp,o,l,o,s),t.DINF=t.box(t.types.dinf,t.box(t.types.dref,n))},t.box=function(t){for(var e,r=Array.prototype.slice.call(arguments,1),i=8,n=r.length,a=n;n--;)i+=r[n].byteLength;for(e=new Uint8Array(i),e[0]=i>>24&255,e[1]=i>>16&255,e[2]=i>>8&255,e[3]=255&i,e.set(t,4),n=0,i=8;n<a;n++)e.set(r[n],i),i+=r[n].byteLength;return e},t.hdlr=function(e){return t.box(t.types.hdlr,t.HDLR_TYPES[e])},t.mdat=function(e){return t.box(t.types.mdat,e)},t.mdhd=function(e,r){r*=e;var n=Math.floor(r/(i+1)),a=Math.floor(r%(i+1));return t.box(t.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,255&e,n>>24,n>>16&255,n>>8&255,255&n,a>>24,a>>16&255,a>>8&255,255&a,85,196,0,0]))},t.mdia=function(e){return t.box(t.types.mdia,t.mdhd(e.timescale,e.duration),t.hdlr(e.type),t.minf(e))},t.mfhd=function(e){return t.box(t.types.mfhd,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,255&e]))},t.minf=function(e){return"audio"===e.type?t.box(t.types.minf,t.box(t.types.smhd,t.SMHD),t.DINF,t.stbl(e)):t.box(t.types.minf,t.box(t.types.vmhd,t.VMHD),t.DINF,t.stbl(e))},t.moof=function(e,r,i){return t.box(t.types.moof,t.mfhd(e),t.traf(i,r))},t.moov=function(e){for(var r=e.length,i=[];r--;)i[r]=t.trak(e[r]);return t.box.apply(null,[t.types.moov,t.mvhd(e[0].timescale,e[0].duration)].concat(i).concat(t.mvex(e)))},t.mvex=function(e){for(var r=e.length,i=[];r--;)i[r]=t.trex(e[r]);return t.box.apply(null,[t.types.mvex].concat(i))},t.mvhd=function(e,r){r*=e;var n=Math.floor(r/(i+1)),a=Math.floor(r%(i+1)),o=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,255&e,n>>24,n>>16&255,n>>8&255,255&n,a>>24,a>>16&255,a>>8&255,255&a,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return t.box(t.types.mvhd,o)},t.sdtp=function(e){var r,i,n=e.samples||[],a=new Uint8Array(4+n.length);for(i=0;i<n.length;i++)r=n[i].flags,a[i+4]=r.dependsOn<<4|r.isDependedOn<<2|r.hasRedundancy;return t.box(t.types.sdtp,a)},t.stbl=function(e){return t.box(t.types.stbl,t.stsd(e),t.box(t.types.stts,t.STTS),t.box(t.types.stsc,t.STSC),t.box(t.types.stsz,t.STSZ),t.box(t.types.stco,t.STCO))},t.avc1=function(e){var r,i,n,a=[],o=[];for(r=0;r<e.sps.length;r++)i=e.sps[r],n=i.byteLength,a.push(n>>>8&255),a.push(255&n),a=a.concat(Array.prototype.slice.call(i));for(r=0;r<e.pps.length;r++)i=e.pps[r],n=i.byteLength,o.push(n>>>8&255),o.push(255&n),o=o.concat(Array.prototype.slice.call(i));var s=t.box(t.types.avcC,new Uint8Array([1,a[3],a[4],a[5],255,224|e.sps.length].concat(a).concat([e.pps.length]).concat(o))),l=e.width,u=e.height,d=e.pixelRatio[0],c=e.pixelRatio[1];return t.box(t.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,l>>8&255,255&l,u>>8&255,255&u,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),s,t.box(t.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),t.box(t.types.pasp,new Uint8Array([d>>24,d>>16&255,d>>8&255,255&d,c>>24,c>>16&255,c>>8&255,255&c])))},t.esds=function(t){var e=t.config.length;return new Uint8Array([0,0,0,0,3,23+e,0,1,0,4,15+e,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([e]).concat(t.config).concat([6,1,2]))},t.mp4a=function(e){var r=e.samplerate;return t.box(t.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,r>>8&255,255&r,0,0]),t.box(t.types.esds,t.esds(e)))},t.mp3=function(e){var r=e.samplerate;return t.box(t.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,r>>8&255,255&r,0,0]))},t.stsd=function(e){return"audio"===e.type?e.isAAC||"mp3"!==e.codec?t.box(t.types.stsd,t.STSD,t.mp4a(e)):t.box(t.types.stsd,t.STSD,t.mp3(e)):t.box(t.types.stsd,t.STSD,t.avc1(e))},t.tkhd=function(e){var r=e.id,n=e.duration*e.timescale,a=e.width,o=e.height,s=Math.floor(n/(i+1)),l=Math.floor(n%(i+1));return t.box(t.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,r>>24&255,r>>16&255,r>>8&255,255&r,0,0,0,0,s>>24,s>>16&255,s>>8&255,255&s,l>>24,l>>16&255,l>>8&255,255&l,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,a>>8&255,255&a,0,0,o>>8&255,255&o,0,0]))},t.traf=function(e,r){var n=t.sdtp(e),a=e.id,o=Math.floor(r/(i+1)),s=Math.floor(r%(i+1));return t.box(t.types.traf,t.box(t.types.tfhd,new Uint8Array([0,0,0,0,a>>24,a>>16&255,a>>8&255,255&a])),t.box(t.types.tfdt,new Uint8Array([1,0,0,0,o>>24,o>>16&255,o>>8&255,255&o,s>>24,s>>16&255,s>>8&255,255&s])),t.trun(e,n.length+16+20+8+16+8+8),n)},t.trak=function(e){return e.duration=e.duration||4294967295,t.box(t.types.trak,t.tkhd(e),t.mdia(e))},t.trex=function(e){var r=e.id;return t.box(t.types.trex,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},t.trun=function(e,r){var i,n,a,o,s,l,u=e.samples||[],d=u.length,c=12+16*d,f=new Uint8Array(c);for(r+=8+c,f.set([0,0,15,1,d>>>24&255,d>>>16&255,d>>>8&255,255&d,r>>>24&255,r>>>16&255,r>>>8&255,255&r],0),i=0;i<d;i++)n=u[i],a=n.duration,o=n.size,s=n.flags,l=n.cts,f.set([a>>>24&255,a>>>16&255,a>>>8&255,255&a,o>>>24&255,o>>>16&255,o>>>8&255,255&o,s.isLeading<<2|s.dependsOn,s.isDependedOn<<6|s.hasRedundancy<<4|s.paddingValue<<1|s.isNonSync,61440&s.degradPrio,15&s.degradPrio,l>>>24&255,l>>>16&255,l>>>8&255,255&l],12+16*i);return t.box(t.types.trun,f)},t.initSegment=function(e){t.types||t.init();var r,i=t.moov(e);return r=new Uint8Array(t.FTYP.byteLength+i.byteLength),r.set(t.FTYP),r.set(i,t.FTYP.byteLength),r},t}();e.default=n},"./src/remux/mp4-remuxer.js":function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r("./src/remux/aac-helper.js"),n=r("./src/remux/mp4-generator.js"),a=r("./src/events.js"),o=r("./src/errors.js"),s=r("./src/utils/logger.js"),l=function(){function t(t,e,r,i){this.observer=t,this.config=e,this.typeSupported=r;var n=navigator.userAgent;this.isSafari=i&&i.indexOf("Apple")>-1&&n&&!n.match("CriOS"),this.ISGenerated=!1}return t.prototype.destroy=function(){},t.prototype.resetTimeStamp=function(t){this._initPTS=this._initDTS=t},t.prototype.resetInitSegment=function(){this.ISGenerated=!1},t.prototype.remux=function(t,e,r,i,n,o,l){if(this.ISGenerated||this.generateIS(t,e,n),this.ISGenerated){var u=t.samples.length,d=e.samples.length,c=n,f=n;if(u&&d){var h=(t.samples[0].pts-e.samples[0].pts)/e.inputTimeScale;c+=Math.max(0,h),f+=Math.max(0,-h)}if(u){t.timescale||(s.logger.warn("regenerate InitSegment as audio detected"),this.generateIS(t,e,n));var p=this.remuxAudio(t,c,o,l);if(d){var g=void 0;p&&(g=p.endPTS-p.startPTS),e.timescale||(s.logger.warn("regenerate InitSegment as video detected"),this.generateIS(t,e,n)),this.remuxVideo(e,f,o,g,l)}}else if(d){var y=this.remuxVideo(e,f,o,0,l);y&&t.codec&&this.remuxEmptyAudio(t,c,o,y)}}r.samples.length&&this.remuxID3(r,n),i.samples.length&&this.remuxText(i,n),this.observer.trigger(a.default.FRAG_PARSED)},t.prototype.generateIS=function(t,e,r){var i,l,u=this.observer,d=t.samples,c=e.samples,f=this.typeSupported,h="audio/mp4",p={},g={tracks:p},y=void 0===this._initPTS;if(y&&(i=l=1/0),t.config&&d.length&&(t.timescale=t.samplerate,s.logger.log("audio sampling rate : "+t.samplerate),t.isAAC||(f.mpeg?(h="audio/mpeg",t.codec=""):f.mp3&&(t.codec="mp3")),p.audio={container:h,codec:t.codec,initSegment:!t.isAAC&&f.mpeg?new Uint8Array:n.default.initSegment([t]),metadata:{channelCount:t.channelCount}},y&&(i=l=d[0].pts-t.inputTimeScale*r)),e.sps&&e.pps&&c.length){var m=e.inputTimeScale;e.timescale=m,p.video={container:"video/mp4",codec:e.codec,initSegment:n.default.initSegment([e]),metadata:{width:e.width,height:e.height}},y&&(i=Math.min(i,c[0].pts-m*r),l=Math.min(l,c[0].dts-m*r),this.observer.trigger(a.default.INIT_PTS_FOUND,{initPTS:i}))}Object.keys(p).length?(u.trigger(a.default.FRAG_PARSING_INIT_SEGMENT,g),this.ISGenerated=!0,y&&(this._initPTS=i,this._initDTS=l)):u.trigger(a.default.ERROR,{type:o.ErrorTypes.MEDIA_ERROR,details:o.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"no audio/video samples found"})},t.prototype.remuxVideo=function(t,e,r,i,l){var u,d,c,f,h,p,g,y=8,m=t.timescale,v=t.samples,A=[],_=v.length,b=this._PTSNormalize,E=this._initPTS,T=this.nextAvcDts,S=this.isSafari;if(0!==_){S&&(r|=v.length&&T&&(l&&Math.abs(e-T/m)<.1||Math.abs(v[0].pts-T-E)<m/5)),r||(T=e*m),v.forEach(function(t){t.pts=b(t.pts-E,T),t.dts=b(t.dts-E,T)}),v.sort(function(t,e){var r=t.dts-e.dts,i=t.pts-e.pts;return r||i||t.id-e.id});var L=v.reduce(function(t,e){return Math.max(Math.min(t,e.pts-e.dts),-18e3)},0);if(L<0){s.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Math.round(L/90)+" ms to overcome this issue");for(var k=0;k<v.length;k++)v[k].dts+=L}var R=v[0];h=Math.max(R.dts,0),f=Math.max(R.pts,0);var C=Math.round((h-T)/90);r&&C&&(C>1?s.logger.log("AVC:"+C+" ms hole between fragments detected,filling it"):C<-1&&s.logger.log("AVC:"+-C+" ms overlapping between fragments detected"),h=T,v[0].dts=h,f=Math.max(f-C,T),v[0].pts=f,s.logger.log("Video/PTS/DTS adjusted: "+Math.round(f/90)+"/"+Math.round(h/90)+",delta:"+C+" ms")),R=v[v.length-1],g=Math.max(R.dts,0),p=Math.max(R.pts,0,g),S&&(u=Math.round((g-h)/(v.length-1)));for(var w=0,O=0,k=0;k<_;k++){for(var P=v[k],D=P.units,I=D.length,x=0,M=0;M<I;M++)x+=D[M].data.length;O+=x,w+=I,P.length=x,P.dts=S?h+k*u:Math.max(P.dts,h),P.pts=Math.max(P.pts,P.dts)}var N=O+4*w+8;try{d=new Uint8Array(N)}catch(t){return void this.observer.trigger(a.default.ERROR,{type:o.ErrorTypes.MUX_ERROR,details:o.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:N,reason:"fail allocating video mdat "+N})}var F=new DataView(d.buffer);F.setUint32(0,N),d.set(n.default.types.mdat,4);for(var k=0;k<_;k++){for(var B=v[k],U=B.units,j=0,G=void 0,M=0,I=U.length;M<I;M++){var K=U[M],V=K.data,Y=K.data.byteLength;F.setUint32(y,Y),y+=4,d.set(V,y),y+=Y,j+=4+Y}if(S)G=Math.max(0,u*Math.round((B.pts-B.dts)/u));else{if(k<_-1)u=v[k+1].dts-B.dts;else{var H=this.config,$=B.dts-v[k>0?k-1:k].dts;if(H.stretchShortVideoTrack){var W=H.maxBufferHole,z=Math.floor(W*m),q=(i?f+i*m:this.nextAudioPts)-B.pts;q>z?(u=q-$,u<0&&(u=$),s.logger.log("It is approximately "+q/90+" ms to the next segment; using duration "+u/90+" ms for the last video frame.")):u=$}else u=$}G=Math.round(B.pts-B.dts)}A.push({size:j,duration:u,cts:G,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:B.key?2:1,isNonSync:B.key?0:1}})}this.nextAvcDts=g+u;var X=t.dropped;if(t.len=0,t.nbNalu=0,t.dropped=0,A.length&&navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var Z=A[0].flags;Z.dependsOn=2,Z.isNonSync=0}t.samples=A,c=n.default.moof(t.sequenceNumber++,h,t),t.samples=[];var Q={data1:c,data2:d,startPTS:f/m,endPTS:(p+u)/m,startDTS:h/m,endDTS:this.nextAvcDts/m,type:"video",hasAudio:!1,hasVideo:!0,nb:A.length,dropped:X};return this.observer.trigger(a.default.FRAG_PARSING_DATA,Q),Q}},t.prototype.remuxAudio=function(t,e,r,l){var u,d,c,f,h,p,g,y=t.inputTimeScale,m=t.timescale,v=y/m,A=t.isAAC?1024:1152,_=A*v,b=this._PTSNormalize,E=this._initPTS,T=!t.isAAC&&this.typeSupported.mpeg,S=t.samples,L=[],k=this.nextAudioPts;if(r|=S.length&&k&&(l&&Math.abs(e-k/y)<.1||Math.abs(S[0].pts-k-E)<20*_),S.forEach(function(t){t.pts=t.dts=b(t.pts-E,e*y)}),S=S.filter(function(t){return t.pts>=0}),0!==S.length){if(r||(k=l?e*y:S[0].pts),t.isAAC)for(var R=this.config.maxAudioFramesDrift,C=0,w=k;C<S.length;){var O,P=S[C],D=P.pts;O=D-w;var I=Math.abs(1e3*O/y);if(O<=-R*_)s.logger.warn("Dropping 1 audio frame @ "+(w/y).toFixed(3)+"s due to "+Math.round(I)+" ms overlap."),S.splice(C,1),t.len-=P.unit.length;else if(O>=R*_&&I<1e4&&w){var x=Math.round(O/_);s.logger.warn("Injecting "+x+" audio frame @ "+(w/y).toFixed(3)+"s due to "+Math.round(1e3*O/y)+" ms gap.");for(var M=0;M<x;M++){var N=Math.max(w,0);c=i.default.getSilentFrame(t.manifestCodec||t.codec,t.channelCount),c||(s.logger.log("Unable to get silent frame for given audio codec; duplicating last frame instead."),c=P.unit.subarray()),S.splice(C,0,{unit:c,pts:N,dts:N}),t.len+=c.length,w+=_,C++}P.pts=P.dts=w,w+=_,C++}else Math.abs(O),P.pts=P.dts=w,w+=_,C++}for(var M=0,F=S.length;M<F;M++){var B=S[M],U=B.unit,D=B.pts;if(void 0!==g)d.duration=Math.round((D-g)/v);else{var j=Math.round(1e3*(D-k)/y),G=0;if(r&&t.isAAC&&j){if(j>0&&j<1e4)G=Math.round((D-k)/_),s.logger.log(j+" ms hole between AAC samples detected,filling it"),G>0&&(c=i.default.getSilentFrame(t.manifestCodec||t.codec,t.channelCount),c||(c=U.subarray()),t.len+=G*c.length);else if(j<-12){s.logger.log("drop overlapping AAC sample, expected/parsed/delta:"+(k/y).toFixed(3)+"s/"+(D/y).toFixed(3)+"s/"+-j+"ms"),t.len-=U.byteLength;continue}D=k}if(p=D,!(t.len>0))return;var K=T?t.len:t.len+8;u=T?0:8;try{f=new Uint8Array(K)}catch(t){return void this.observer.trigger(a.default.ERROR,{type:o.ErrorTypes.MUX_ERROR,details:o.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:K,reason:"fail allocating audio mdat "+K})}if(!T){new DataView(f.buffer).setUint32(0,K),f.set(n.default.types.mdat,4)}for(var C=0;C<G;C++)c=i.default.getSilentFrame(t.manifestCodec||t.codec,t.channelCount),c||(s.logger.log("Unable to get silent frame for given audio codec; duplicating this frame instead."),c=U.subarray()),f.set(c,u),u+=c.byteLength,d={size:c.byteLength,cts:0,duration:1024,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:1}},L.push(d)}f.set(U,u);var V=U.byteLength;u+=V,d={size:V,cts:0,duration:0,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:1}},L.push(d),g=D}var Y=0,H=L.length;if(H>=2&&(Y=L[H-2].duration,d.duration=Y),H){this.nextAudioPts=k=g+v*Y,t.len=0,t.samples=L,h=T?new Uint8Array:n.default.moof(t.sequenceNumber++,p/v,t),t.samples=[];var $=p/y,W=k/y,z={data1:h,data2:f,startPTS:$,endPTS:W,startDTS:$,endDTS:W,type:"audio",hasAudio:!0,hasVideo:!1,nb:H};return this.observer.trigger(a.default.FRAG_PARSING_DATA,z),z}return null}},t.prototype.remuxEmptyAudio=function(t,e,r,n){var a=t.inputTimeScale,o=t.samplerate?t.samplerate:a,l=a/o,u=this.nextAudioPts,d=(void 0!==u?u:n.startDTS*a)+this._initDTS,c=n.endDTS*a+this._initDTS,f=1024*l,h=Math.ceil((c-d)/f),p=i.default.getSilentFrame(t.manifestCodec||t.codec,t.channelCount);if(s.logger.warn("remux empty Audio"),!p)return void s.logger.trace("Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec!");for(var g=[],y=0;y<h;y++){var m=d+y*f;g.push({unit:p,pts:m,dts:m}),t.len+=p.length}t.samples=g,this.remuxAudio(t,e,r)},t.prototype.remuxID3=function(t){var e,r=t.samples.length,i=t.inputTimeScale,n=this._initPTS,o=this._initDTS;if(r){for(var s=0;s<r;s++)e=t.samples[s],e.pts=(e.pts-n)/i,e.dts=(e.dts-o)/i;this.observer.trigger(a.default.FRAG_PARSING_METADATA,{samples:t.samples})}t.samples=[]},t.prototype.remuxText=function(t){t.samples.sort(function(t,e){return t.pts-e.pts});var e,r=t.samples.length,i=t.inputTimeScale,n=this._initPTS;if(r){for(var o=0;o<r;o++)e=t.samples[o],e.pts=(e.pts-n)/i;this.observer.trigger(a.default.FRAG_PARSING_USERDATA,{samples:t.samples})}t.samples=[]},t.prototype._PTSNormalize=function(t,e){var r;if(void 0===e)return t;for(r=e<t?-8589934592:8589934592;Math.abs(t-e)>4294967296;)t+=r;return t},t}();e.default=l},"./src/remux/passthrough-remuxer.js":function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r("./src/events.js"),n=function(){function t(t){this.observer=t}return t.prototype.destroy=function(){},t.prototype.resetTimeStamp=function(){},t.prototype.resetInitSegment=function(){},t.prototype.remux=function(t,e,r,n,a,o,s,l){var u=this.observer,d="";t&&(d+="audio"),e&&(d+="video"),u.trigger(i.default.FRAG_PARSING_DATA,{data1:l,startPTS:a,startDTS:a,type:d,hasAudio:!!t,hasVideo:!!e,nb:1,dropped:0}),u.trigger(i.default.FRAG_PARSED)},t}();e.default=n},"./src/task-loop.js":function(t,e,r){"use strict";var i=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var n=r("./src/event-handler.js"),a=function(t){function e(e){for(var r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];var n=t.apply(this,[e].concat(r))||this;return n._tickInterval=null,n._tickTimer=null,n._tickCallCount=0,n._boundTick=n.tick.bind(n),n}return i(e,t),e.prototype.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},e.prototype.hasInterval=function(){return!!this._tickInterval},e.prototype.hasNextTick=function(){return!!this._tickTimer},e.prototype.setInterval=function(t){return!this._tickInterval&&(this._tickInterval=setInterval(this._boundTick,t),!0)},e.prototype.clearInterval=function(){return!!this._tickInterval&&(clearInterval(this._tickInterval),this._tickInterval=null,!0)},e.prototype.clearNextTick=function(){return!!this._tickTimer&&(clearTimeout(this._tickTimer),this._tickTimer=null,!0)},e.prototype.tick=function(){1===++this._tickCallCount&&(this.doTick(),this._tickCallCount>1&&(this.clearNextTick(),this._tickTimer=setTimeout(this._boundTick,0)),this._tickCallCount=0)},e.prototype.doTick=function(){},e}(n.default);e.default=a},"./src/utils/attr-list.js":function(t,e,r){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});var r=/^(\d+)x(\d+)$/,i=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,n=function(){function e(t){"string"==typeof t&&(t=e.parseAttrList(t));for(var r in t)t.hasOwnProperty(r)&&(this[r]=t[r])}return e.prototype.decimalInteger=function(e){var r=parseInt(this[e],10);return r>t.MAX_SAFE_INTEGER?1/0:r},e.prototype.hexadecimalInteger=function(t){if(this[t]){var e=(this[t]||"0x").slice(2);e=(1&e.length?"0":"")+e;for(var r=new Uint8Array(e.length/2),i=0;i<e.length/2;i++)r[i]=parseInt(e.slice(2*i,2*i+2),16);return r}return null},e.prototype.hexadecimalIntegerAsNumber=function(e){var r=parseInt(this[e],16);return r>t.MAX_SAFE_INTEGER?1/0:r},e.prototype.decimalFloatingPoint=function(t){return parseFloat(this[t])},e.prototype.enumeratedString=function(t){return this[t]},e.prototype.decimalResolution=function(t){var e=r.exec(this[t]);if(null!==e)return{width:parseInt(e[1],10),height:parseInt(e[2],10)}},e.parseAttrList=function(t){var e,r={};for(i.lastIndex=0;null!==(e=i.exec(t));){var n=e[2];0===n.indexOf('"')&&n.lastIndexOf('"')===n.length-1&&(n=n.slice(1,-1)),r[e[1]]=n}return r},e}();e.default=n}).call(this,r("./src/polyfills/number.js").Number)},"./src/utils/binary-search.js":function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i={search:function(t,e){for(var r=0,i=t.length-1,n=null,a=null;r<=i;){n=(r+i)/2|0,a=t[n];var o=e(a);if(o>0)r=n+1;else{if(!(o<0))return a;i=n-1}}return null}};e.default=i},"./src/utils/buffer-helper.js":function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(){}return t.isBuffered=function(t,e){try{if(t)for(var r=t.buffered,i=0;i<r.length;i++)if(e>=r.start(i)&&e<=r.end(i))return!0}catch(t){}return!1},t.bufferInfo=function(t,e,r){try{if(t){var i=t.buffered,n=[],a=void 0;for(a=0;a<i.length;a++)n.push({start:i.start(a),end:i.end(a)});return this.bufferedInfo(n,e,r)}}catch(t){}return{len:0,start:e,end:e,nextStart:void 0}},t.bufferedInfo=function(t,e,r){var i,n,a,o,s,l=[];for(t.sort(function(t,e){var r=t.start-e.start;return r||e.end-t.end}),s=0;s<t.length;s++){var u=l.length;if(u){var d=l[u-1].end;t[s].start-d<r?t[s].end>d&&(l[u-1].end=t[s].end):l.push(t[s])}else l.push(t[s])}for(s=0,i=0,n=a=e;s<l.length;s++){var c=l[s].start,f=l[s].end;if(e+r>=c&&e<f)n=c,a=f,i=a-e;else if(e+r<c){o=c;break}}return{len:i,start:n,end:a,nextStart:o}},t}();e.BufferHelper=i},"./src/utils/cea-608-parser.js":function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},n=function(t){var e=t;return i.hasOwnProperty(t)&&(e=i[t]),String.fromCharCode(e)},a=15,o=100,s={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},l={17:2,18:4,21:6,22:8,23:10,19:13,20:15},u={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},d={25:2,26:4,29:6,30:8,31:10,27:13,28:15},c=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],f={verboseFilter:{DATA:3,DEBUG:3,INFO:2,WARNING:2,TEXT:1,ERROR:0},time:null,verboseLevel:0,setTime:function(t){this.time=t},log:function(t,e){this.verboseFilter[t];this.verboseLevel}},h=function(t){for(var e=[],r=0;r<t.length;r++)e.push(t[r].toString(16));return e},p=function(){function t(t,e,r,i,n){this.foreground=t||"white",this.underline=e||!1,this.italics=r||!1,this.background=i||"black",this.flash=n||!1}return t.prototype.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},t.prototype.setStyles=function(t){for(var e=["foreground","underline","italics","background","flash"],r=0;r<e.length;r++){var i=e[r];t.hasOwnProperty(i)&&(this[i]=t[i])}},t.prototype.isDefault=function(){return"white"===this.foreground&&!this.underline&&!this.italics&&"black"===this.background&&!this.flash},t.prototype.equals=function(t){return this.foreground===t.foreground&&this.underline===t.underline&&this.italics===t.italics&&this.background===t.background&&this.flash===t.flash},t.prototype.copy=function(t){this.foreground=t.foreground,this.underline=t.underline,this.italics=t.italics,this.background=t.background,this.flash=t.flash},t.prototype.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},t}(),g=function(){function t(t,e,r,i,n,a){this.uchar=t||" ",this.penState=new p(e,r,i,n,a)}return t.prototype.reset=function(){this.uchar=" ",this.penState.reset()},t.prototype.setChar=function(t,e){this.uchar=t,this.penState.copy(e)},t.prototype.setPenState=function(t){this.penState.copy(t)},t.prototype.equals=function(t){return this.uchar===t.uchar&&this.penState.equals(t.penState)},t.prototype.copy=function(t){this.uchar=t.uchar,this.penState.copy(t.penState)},t.prototype.isEmpty=function(){return" "===this.uchar&&this.penState.isDefault()},t}(),y=function(){function t(){this.chars=[];for(var t=0;t<o;t++)this.chars.push(new g);this.pos=0,this.currPenState=new p}return t.prototype.equals=function(t){for(var e=!0,r=0;r<o;r++)if(!this.chars[r].equals(t.chars[r])){e=!1;break}return e},t.prototype.copy=function(t){for(var e=0;e<o;e++)this.chars[e].copy(t.chars[e])},t.prototype.isEmpty=function(){for(var t=!0,e=0;e<o;e++)if(!this.chars[e].isEmpty()){t=!1;break}return t},t.prototype.setCursor=function(t){this.pos!==t&&(this.pos=t),this.pos<0?(f.log("ERROR","Negative cursor position "+this.pos),this.pos=0):this.pos>o&&(f.log("ERROR","Too large cursor position "+this.pos),this.pos=o)},t.prototype.moveCursor=function(t){var e=this.pos+t;if(t>1)for(var r=this.pos+1;r<e+1;r++)this.chars[r].setPenState(this.currPenState);this.setCursor(e)},t.prototype.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},t.prototype.insertChar=function(t){t>=144&&this.backSpace();var e=n(t);if(this.pos>=o)return void f.log("ERROR","Cannot insert "+t.toString(16)+" ("+e+") at position "+this.pos+". Skipping it!");this.chars[this.pos].setChar(e,this.currPenState),this.moveCursor(1)},t.prototype.clearFromPos=function(t){var e;for(e=t;e<o;e++)this.chars[e].reset()},t.prototype.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},t.prototype.clearToEndOfRow=function(){this.clearFromPos(this.pos)},t.prototype.getTextString=function(){for(var t=[],e=!0,r=0;r<o;r++){var i=this.chars[r].uchar;" "!==i&&(e=!1),t.push(i)}return e?"":t.join("")},t.prototype.setPenStyles=function(t){this.currPenState.setStyles(t),this.chars[this.pos].setPenState(this.currPenState)},t}(),m=function(){function t(){this.rows=[];for(var t=0;t<a;t++)this.rows.push(new y);this.currRow=a-1,this.nrRollUpRows=null,this.reset()}return t.prototype.reset=function(){for(var t=0;t<a;t++)this.rows[t].clear();this.currRow=a-1},t.prototype.equals=function(t){for(var e=!0,r=0;r<a;r++)if(!this.rows[r].equals(t.rows[r])){e=!1;break}return e},t.prototype.copy=function(t){for(var e=0;e<a;e++)this.rows[e].copy(t.rows[e])},t.prototype.isEmpty=function(){for(var t=!0,e=0;e<a;e++)if(!this.rows[e].isEmpty()){t=!1;break}return t},t.prototype.backSpace=function(){this.rows[this.currRow].backSpace()},t.prototype.clearToEndOfRow=function(){this.rows[this.currRow].clearToEndOfRow()},t.prototype.insertChar=function(t){this.rows[this.currRow].insertChar(t)},t.prototype.setPen=function(t){this.rows[this.currRow].setPenStyles(t)},t.prototype.moveCursor=function(t){this.rows[this.currRow].moveCursor(t)},t.prototype.setCursor=function(t){f.log("INFO","setCursor: "+t),this.rows[this.currRow].setCursor(t)},t.prototype.setPAC=function(t){f.log("INFO","pacData = "+JSON.stringify(t));var e=t.row-1;if(this.nrRollUpRows&&e<this.nrRollUpRows-1&&(e=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==e){for(var r=0;r<a;r++)this.rows[r].clear();var i=this.currRow+1-this.nrRollUpRows,n=this.lastOutputScreen;if(n){var o=n.rows[i].cueStartTime;if(o&&o<f.time)for(var r=0;r<this.nrRollUpRows;r++)this.rows[e-this.nrRollUpRows+r+1].copy(n.rows[i+r])}}this.currRow=e;var s=this.rows[this.currRow];if(null!==t.indent){var l=t.indent,u=Math.max(l-1,0);s.setCursor(t.indent),t.color=s.chars[u].penState.foreground}var d={foreground:t.color,underline:t.underline,italics:t.italics,background:"black",flash:!1};this.setPen(d)},t.prototype.setBkgData=function(t){f.log("INFO","bkgData = "+JSON.stringify(t)),this.backSpace(),this.setPen(t),this.insertChar(32)},t.prototype.setRollUpRows=function(t){this.nrRollUpRows=t},t.prototype.rollUp=function(){if(null===this.nrRollUpRows)return void f.log("DEBUG","roll_up but nrRollUpRows not set yet");f.log("TEXT",this.getDisplayText());var t=this.currRow+1-this.nrRollUpRows,e=this.rows.splice(t,1)[0];e.clear(),this.rows.splice(this.currRow,0,e),f.log("INFO","Rolling up")},t.prototype.getDisplayText=function(t){t=t||!1;for(var e=[],r="",i=-1,n=0;n<a;n++){var o=this.rows[n].getTextString();o&&(i=n+1,t?e.push("Row "+i+": '"+o+"'"):e.push(o.trim()))}return e.length>0&&(r=t?"["+e.join(" | ")+"]":e.join("\n")),r},t.prototype.getTextAndFormat=function(){return this.rows},t}(),v=function(){function t(t,e){this.chNr=t,this.outputFilter=e,this.mode=null,this.verbose=0,this.displayedMemory=new m,this.nonDisplayedMemory=new m,this.lastOutputScreen=new m,this.currRollUpRow=this.displayedMemory.rows[a-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}return t.prototype.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.currRollUpRow=this.displayedMemory.rows[a-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.lastCueEndTime=null},t.prototype.getHandler=function(){return this.outputFilter},t.prototype.setHandler=function(t){this.outputFilter=t},t.prototype.setPAC=function(t){this.writeScreen.setPAC(t)},t.prototype.setBkgData=function(t){this.writeScreen.setBkgData(t)},t.prototype.setMode=function(t){t!==this.mode&&(this.mode=t,f.log("INFO","MODE="+t),"MODE_POP-ON"===this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=t)},t.prototype.insertChars=function(t){for(var e=0;e<t.length;e++)this.writeScreen.insertChar(t[e]);var r=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";f.log("INFO",r+": "+this.writeScreen.getDisplayText(!0)),"MODE_PAINT-ON"!==this.mode&&"MODE_ROLL-UP"!==this.mode||(f.log("TEXT","DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},t.prototype.ccRCL=function(){f.log("INFO","RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},t.prototype.ccBS=function(){f.log("INFO","BS - BackSpace"),"MODE_TEXT"!==this.mode&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())},t.prototype.ccAOF=function(){},t.prototype.ccAON=function(){},t.prototype.ccDER=function(){f.log("INFO","DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},t.prototype.ccRU=function(t){f.log("INFO","RU("+t+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(t)},t.prototype.ccFON=function(){f.log("INFO","FON - Flash On"),this.writeScreen.setPen({flash:!0})},t.prototype.ccRDC=function(){f.log("INFO","RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},t.prototype.ccTR=function(){f.log("INFO","TR"),this.setMode("MODE_TEXT")},t.prototype.ccRTD=function(){f.log("INFO","RTD"),this.setMode("MODE_TEXT")},t.prototype.ccEDM=function(){f.log("INFO","EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},t.prototype.ccCR=function(){f.log("CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},t.prototype.ccENM=function(){f.log("INFO","ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},t.prototype.ccEOC=function(){if(f.log("INFO","EOC - End Of Caption"),"MODE_POP-ON"===this.mode){var t=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=t,this.writeScreen=this.nonDisplayedMemory,f.log("TEXT","DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},t.prototype.ccTO=function(t){f.log("INFO","TO("+t+") - Tab Offset"),this.writeScreen.moveCursor(t)},t.prototype.ccMIDROW=function(t){var e={flash:!1};if(e.underline=t%2==1,e.italics=t>=46,e.italics)e.foreground="white";else{var r=Math.floor(t/2)-16,i=["white","green","blue","cyan","red","yellow","magenta"];e.foreground=i[r]}f.log("INFO","MIDROW: "+JSON.stringify(e)),this.writeScreen.setPen(e)},t.prototype.outputDataUpdate=function(t){void 0===t&&(t=!1);var e=f.time;null!==e&&this.outputFilter&&(null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue&&(this.outputFilter.newCue(this.cueStartTime,e,this.lastOutputScreen),!0===t&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue()),this.cueStartTime=this.displayedMemory.isEmpty()?null:e):this.cueStartTime=e,this.lastOutputScreen.copy(this.displayedMemory))},t.prototype.cueSplitAtTime=function(t){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,t,this.displayedMemory),this.cueStartTime=t))},t}(),A=function(){function t(t,e,r){this.field=t||1,this.outputs=[e,r],this.channels=[new v(1,e),new v(2,r)],this.currChNr=-1,this.lastCmdA=null,this.lastCmdB=null,this.bufferedData=[],this.startTime=null,this.lastTime=null,this.dataCounters={padding:0,char:0,cmd:0,other:0}}return t.prototype.getHandler=function(t){return this.channels[t].getHandler()},t.prototype.setHandler=function(t,e){this.channels[t].setHandler(e)},t.prototype.addData=function(t,e){var r,i,n,a=!1;this.lastTime=t,f.setTime(t);for(var o=0;o<e.length;o+=2)if(i=127&e[o],n=127&e[o+1],0!==i||0!==n){if(f.log("DATA","["+h([e[o],e[o+1]])+"] -> ("+h([i,n])+")"),r=this.parseCmd(i,n),r||(r=this.parseMidrow(i,n)),r||(r=this.parsePAC(i,n)),r||(r=this.parseBackgroundAttributes(i,n)),!r&&(a=this.parseChars(i,n)))if(this.currChNr&&this.currChNr>=0){var s=this.channels[this.currChNr-1];s.insertChars(a)}else f.log("WARNING","No channel found yet. TEXT-MODE?");r?this.dataCounters.cmd+=2:a?this.dataCounters.char+=2:(this.dataCounters.other+=2,f.log("WARNING","Couldn't parse cleaned data "+h([i,n])+" orig: "+h([e[o],e[o+1]])))}else this.dataCounters.padding+=2},t.prototype.parseCmd=function(t,e){var r=null,i=(20===t||28===t)&&e>=32&&e<=47,n=(23===t||31===t)&&e>=33&&e<=35;if(!i&&!n)return!1;if(t===this.lastCmdA&&e===this.lastCmdB)return this.lastCmdA=null,this.lastCmdB=null,f.log("DEBUG","Repeated command ("+h([t,e])+") is dropped"),!0;r=20===t||23===t?1:2;var a=this.channels[r-1];return 20===t||28===t?32===e?a.ccRCL():33===e?a.ccBS():34===e?a.ccAOF():35===e?a.ccAON():36===e?a.ccDER():37===e?a.ccRU(2):38===e?a.ccRU(3):39===e?a.ccRU(4):40===e?a.ccFON():41===e?a.ccRDC():42===e?a.ccTR():43===e?a.ccRTD():44===e?a.ccEDM():45===e?a.ccCR():46===e?a.ccENM():47===e&&a.ccEOC():a.ccTO(e-32),this.lastCmdA=t,this.lastCmdB=e,this.currChNr=r,!0},t.prototype.parseMidrow=function(t,e){var r=null;if((17===t||25===t)&&e>=32&&e<=47){if((r=17===t?1:2)!==this.currChNr)return f.log("ERROR","Mismatch channel in midrow parsing"),!1;return this.channels[r-1].ccMIDROW(e),f.log("DEBUG","MIDROW ("+h([t,e])+")"),!0}return!1},t.prototype.parsePAC=function(t,e){var r=null,i=null,n=(t>=17&&t<=23||t>=25&&t<=31)&&e>=64&&e<=127,a=(16===t||24===t)&&e>=64&&e<=95;if(!n&&!a)return!1;if(t===this.lastCmdA&&e===this.lastCmdB)return this.lastCmdA=null,this.lastCmdB=null,!0;r=t<=23?1:2,i=e>=64&&e<=95?1===r?s[t]:u[t]:1===r?l[t]:d[t];var o=this.interpretPAC(i,e);return this.channels[r-1].setPAC(o),this.lastCmdA=t,this.lastCmdB=e,this.currChNr=r,!0},t.prototype.interpretPAC=function(t,e){var r=e,i={color:null,italics:!1,indent:null,underline:!1,row:t};return r=e>95?e-96:e-64,i.underline=1==(1&r),r<=13?i.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(r/2)]:r<=15?(i.italics=!0,i.color="white"):i.indent=4*Math.floor((r-16)/2),i},t.prototype.parseChars=function(t,e){var r=null,i=null,a=null;if(t>=25?(r=2,a=t-8):(r=1,a=t),a>=17&&a<=19){var o=e;o=17===a?e+80:18===a?e+112:e+144,f.log("INFO","Special char '"+n(o)+"' in channel "+r),i=[o]}else t>=32&&t<=127&&(i=0===e?[t]:[t,e]);if(i){var s=h(i);f.log("DEBUG","Char codes = "+s.join(",")),this.lastCmdA=null,this.lastCmdB=null}return i},t.prototype.parseBackgroundAttributes=function(t,e){var r,i,n,a,o=(16===t||24===t)&&e>=32&&e<=47,s=(23===t||31===t)&&e>=45&&e<=47;return!(!o&&!s)&&(r={},16===t||24===t?(i=Math.floor((e-32)/2),r.background=c[i],e%2==1&&(r.background=r.background+"_semi")):45===e?r.background="transparent":(r.foreground="black",47===e&&(r.underline=!0)),n=t<24?1:2,a=this.channels[n-1],a.setBkgData(r),this.lastCmdA=null,this.lastCmdB=null,!0)},t.prototype.reset=function(){for(var t=0;t<this.channels.length;t++)this.channels[t]&&this.channels[t].reset();this.lastCmdA=null,this.lastCmdB=null},t.prototype.cueSplitAtTime=function(t){for(var e=0;e<this.channels.length;e++)this.channels[e]&&this.channels[e].cueSplitAtTime(t)},t}();e.default=A},"./src/utils/codecs.js":function(t,e,r){"use strict";function i(t,e){var r=a[e];return!!r&&!0===r[t.slice(0,4)]}function n(t,e){return window.MediaSource.isTypeSupported((e||"video")+'/mp4;codecs="'+t+'"')}Object.defineProperty(e,"__esModule",{value:!0});var a={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0}};e.isCodecType=i,e.isCodecSupportedInMp4=n},"./src/utils/cues.js":function(t,e,r){"use strict";function i(t,e,r,i){for(var a,o,s,l,u,d=window.VTTCue||window.TextTrackCue,c=0;c<i.rows.length;c++)if(a=i.rows[c],s=!0,l=0,u="",!a.isEmpty()){for(var f=0;f<a.chars.length;f++)a.chars[f].uchar.match(/\s/)&&s?l++:(u+=a.chars[f].uchar,s=!1);a.cueStartTime=e,e===r&&(r+=1e-4),o=new d(e,r,n.fixLineBreaks(u.trim())),l>=16?l--:l++,navigator.userAgent.match(/Firefox\//)?o.line=c+1:o.line=c>7?c-2:c+1,o.align="left",o.position=Math.max(0,Math.min(100,l/32*100+(navigator.userAgent.match(/Firefox\//)?50:0))),t.addCue(o)}}Object.defineProperty(e,"__esModule",{value:!0});var n=r("./src/utils/vttparser.js");e.newCue=i},"./src/utils/discontinuities.js":function(t,e,r){"use strict";(function(t){function i(t,e){for(var r=null,i=0;i<t.length;i+=1){var n=t[i];if(n&&n.cc===e){r=n;break}}return r}function n(t,e){return c.default.search(t,function(t){return t.cc<e?1:t.cc>e?-1:0})}function a(t,e,r){var i=!1;return e&&e.details&&r&&(r.endCC>r.startCC||t&&t.cc<r.startCC)&&(i=!0),i}function o(t,e){var r=t.fragments,n=e.fragments;if(!n.length||!r.length)return void f.logger.log("No fragments to align");var a=i(r,n[0].cc);return!a||a&&!a.startPTS?void f.logger.log("No frag in previous level to align on"):a}function s(t,e){e.fragments.forEach(function(e){if(e){var r=e.start+t;e.start=e.startPTS=r,e.endPTS=r+e.duration}}),e.PTSKnown=!0}function l(t,e,r){u(t,r,e),!r.PTSKnown&&e&&d(r,e.details)}function u(t,e,r){if(a(t,r,e)){var i=o(r.details,e);i&&(f.logger.log("Adjusting PTS using last level due to CC increase within current level"),s(i.start,e))}}function d(e,r){if(r&&r.fragments.length){if(!e.hasProgramDateTime||!r.hasProgramDateTime)return;var i=r.fragments[0].programDateTime,n=e.fragments[0].programDateTime,a=(n-i)/1e3+r.fragments[0].start;t.isFinite(a)&&(f.logger.log("adjusting PTS using programDateTime delta, sliding:"+a.toFixed(3)),s(a,e))}}Object.defineProperty(e,"__esModule",{value:!0});var c=r("./src/utils/binary-search.js"),f=r("./src/utils/logger.js");e.findFirstFragWithCC=i,e.findFragWithCC=n,e.shouldAlignOnDiscontinuities=a,e.findDiscontinuousReferenceFrag=o,e.adjustPts=s,e.alignStream=l,e.alignDiscontinuities=u,e.alignPDT=d}).call(this,r("./src/polyfills/number.js").Number)},"./src/utils/ewma-bandwidth-estimator.js":function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r("./src/utils/ewma.js"),n=function(){function t(t,e,r,n){this.hls=t,this.defaultEstimate_=n,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new i.default(e),this.fast_=new i.default(r)}return t.prototype.sample=function(t,e){t=Math.max(t,this.minDelayMs_);var r=8e3*e/t,i=t/1e3;this.fast_.sample(i,r),this.slow_.sample(i,r)},t.prototype.canEstimate=function(){var t=this.fast_;return t&&t.getTotalWeight()>=this.minWeight_},t.prototype.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},t.prototype.destroy=function(){},t}();e.default=n},"./src/utils/ewma.js":function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t){this.alpha_=t?Math.exp(Math.log(.5)/t):0,this.estimate_=0,this.totalWeight_=0}return t.prototype.sample=function(t,e){var r=Math.pow(this.alpha_,t);this.estimate_=e*(1-r)+r*this.estimate_,this.totalWeight_+=t},t.prototype.getTotalWeight=function(){return this.totalWeight_},t.prototype.getEstimate=function(){if(this.alpha_){var t=1-Math.pow(this.alpha_,this.totalWeight_);return this.estimate_/t}return this.estimate_},t}();e.default=i},"./src/utils/get-self-scope.js":function(t,e,r){"use strict";function i(){return"undefined"==typeof window?self:window}Object.defineProperty(e,"__esModule",{value:!0}),e.getSelfScope=i},"./src/utils/logger.js":function(t,e,r){"use strict";function i(){}function n(t,e){return e="["+t+"] > "+e}function a(t){var e=d.console[t];return e?function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];r[0]&&(r[0]=n(t,r[0])),e.apply(d.console,r)}:i}function o(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];e.forEach(function(e){u[e]=t[e]?t[e].bind(t):a(e)})}Object.defineProperty(e,"__esModule",{value:!0});var s=r("./src/utils/get-self-scope.js"),l={trace:i,debug:i,log:i,warn:i,info:i,error:i},u=l,d=s.getSelfScope();e.enableLogs=function(t){if(!0===t||"object"==typeof t){o(t,"debug","log","info","warn","error");try{u.log()}catch(t){u=l}}else u=l},e.logger=u},"./src/utils/mediakeys-helper.js":function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){return"undefined"!=typeof window&&window.navigator&&window.navigator.requestMediaKeySystemAccess?window.navigator.requestMediaKeySystemAccess.bind(window.navigator):null}();e.requestMediaKeySystemAccess=i},"./src/utils/mediasource-helper.js":function(t,e,r){"use strict";function i(){if("undefined"!=typeof window)return window.MediaSource||window.WebKitMediaSource}Object.defineProperty(e,"__esModule",{value:!0}),e.getMediaSource=i},"./src/utils/output-filter.js":function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){this.timelineController=t,this.trackName=e,this.startTime=null,this.endTime=null,this.screen=null}return t.prototype.dispatchCue=function(){null!==this.startTime&&(this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen),this.startTime=null)},t.prototype.newCue=function(t,e,r){(null===this.startTime||this.startTime>t)&&(this.startTime=t),this.endTime=e,this.screen=r,this.timelineController.createCaptionsTrack(this.trackName)},t}();e.default=i},"./src/utils/texttrack-utils.js":function(t,e,r){"use strict";function i(t,e){var r=null;try{r=new window.Event("addtrack")}catch(t){r=document.createEvent("Event"),r.initEvent("addtrack",!1,!1)}r.track=t,e.dispatchEvent(r)}function n(t){if(t&&t.cues)for(;t.cues.length>0;)t.removeCue(t.cues[0])}Object.defineProperty(e,"__esModule",{value:!0}),e.sendAddTrackEvent=i,e.clearCurrentCues=n},"./src/utils/time-ranges.js":function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i={toString:function(t){for(var e="",r=t.length,i=0;i<r;i++)e+="["+t.start(i).toFixed(3)+","+t.end(i).toFixed(3)+"]";return e}};e.default=i},"./src/utils/vttcue.js":function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){function t(t){return"string"==typeof t&&(!!a[t.toLowerCase()]&&t.toLowerCase())}function e(t){return"string"==typeof t&&(!!o[t.toLowerCase()]&&t.toLowerCase())}function r(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var i in r)t[i]=r[i]}return t}function i(i,a,o){var s=this,l=function(){if("undefined"!=typeof navigator)return/MSIE\s8\.0/.test(navigator.userAgent)}(),u={};l?s=document.createElement("custom"):u.enumerable=!0,s.hasBeenReset=!1;var d="",c=!1,f=i,h=a,p=o,g=null,y="",m=!0,v="auto",A="start",_=50,b="middle",E=50,T="middle";if(Object.defineProperty(s,"id",r({},u,{get:function(){return d},set:function(t){d=""+t}})),Object.defineProperty(s,"pauseOnExit",r({},u,{get:function(){return c},set:function(t){c=!!t}})),Object.defineProperty(s,"startTime",r({},u,{get:function(){return f},set:function(t){if("number"!=typeof t)throw new TypeError("Start time must be set to a number.");f=t,this.hasBeenReset=!0}})),Object.defineProperty(s,"endTime",r({},u,{get:function(){return h},set:function(t){if("number"!=typeof t)throw new TypeError("End time must be set to a number.");h=t,this.hasBeenReset=!0}})),Object.defineProperty(s,"text",r({},u,{get:function(){return p},set:function(t){p=""+t,this.hasBeenReset=!0}})),Object.defineProperty(s,"region",r({},u,{get:function(){return g},set:function(t){g=t,this.hasBeenReset=!0}})),Object.defineProperty(s,"vertical",r({},u,{get:function(){return y},set:function(e){var r=t(e);if(!1===r)throw new SyntaxError("An invalid or illegal string was specified.");y=r,this.hasBeenReset=!0}})),Object.defineProperty(s,"snapToLines",r({},u,{get:function(){return m},set:function(t){m=!!t,this.hasBeenReset=!0}})),Object.defineProperty(s,"line",r({},u,{get:function(){return v},set:function(t){if("number"!=typeof t&&t!==n)throw new SyntaxError("An invalid number or illegal string was specified.");v=t,this.hasBeenReset=!0}})),Object.defineProperty(s,"lineAlign",r({},u,{get:function(){return A},set:function(t){var r=e(t);if(!r)throw new SyntaxError("An invalid or illegal string was specified.");A=r,this.hasBeenReset=!0}})),Object.defineProperty(s,"position",r({},u,{get:function(){return _},set:function(t){if(t<0||t>100)throw new Error("Position must be between 0 and 100.");_=t,this.hasBeenReset=!0}})),Object.defineProperty(s,"positionAlign",r({},u,{get:function(){return b},set:function(t){var r=e(t);if(!r)throw new SyntaxError("An invalid or illegal string was specified.");b=r,this.hasBeenReset=!0}})),Object.defineProperty(s,"size",r({},u,{get:function(){return E},set:function(t){if(t<0||t>100)throw new Error("Size must be between 0 and 100.");E=t,this.hasBeenReset=!0}})),Object.defineProperty(s,"align",r({},u,{get:function(){return T},set:function(t){var r=e(t);if(!r)throw new SyntaxError("An invalid or illegal string was specified.");T=r,this.hasBeenReset=!0}})),s.displayState=void 0,l)return s}if("undefined"!=typeof window&&window.VTTCue)return window.VTTCue;var n="auto",a={"":!0,lr:!0,rl:!0},o={start:!0,middle:!0,end:!0,left:!0,right:!0};return i.prototype.getCueAsHTML=function(){return window.WebVTT.convertCueToDOMTree(window,this.text)},i}()},"./src/utils/vttparser.js":function(t,e,r){"use strict";function i(){this.window=window,this.state="INITIAL",this.buffer="",this.decoder=new d,this.regionList=[]}function n(t){function e(t,e,r,i){return 3600*(0|t)+60*(0|e)+(0|r)+(0|i)/1e3}var r=t.match(/^(\d+):(\d{2})(:\d{2})?\.(\d{3})/);return r?r[3]?e(r[1],r[2],r[3].replace(":",""),r[4]):r[1]>59?e(r[1],r[2],0,r[4]):e(0,r[1],r[2],r[4]):null}function a(){this.values=Object.create(null)}function o(t,e,r,i){var n=i?t.split(i):[t];for(var a in n)if("string"==typeof n[a]){var o=n[a].split(r);if(2===o.length){var s=o[0],l=o[1];e(s,l)}}}function s(t,e,r){function i(){var e=n(t);if(null===e)throw new Error("Malformed timestamp: "+l);return t=t.replace(/^[^\sa-zA-Z-]+/,""),e}function s(){t=t.replace(/^\s+/,"")}var l=t;if(s(),e.startTime=i(),s(),"--\x3e"!==t.substr(0,3))throw new Error("Malformed time stamp (time stamps must be separated by '--\x3e'): "+l);t=t.substr(3),s(),e.endTime=i(),s(),function(t,e){var i=new a;o(t,function(t,e){switch(t){case"region":for(var n=r.length-1;n>=0;n--)if(r[n].id===e){i.set(t,r[n].region);break}break;case"vertical":i.alt(t,e,["rl","lr"]);break;case"line":var a=e.split(","),o=a[0];i.integer(t,o),i.percent(t,o)&&i.set("snapToLines",!1),i.alt(t,o,["auto"]),2===a.length&&i.alt("lineAlign",a[1],["start",f,"end"]);break;case"position":a=e.split(","),i.percent(t,a[0]),2===a.length&&i.alt("positionAlign",a[1],["start",f,"end","line-left","line-right","auto"]);break;case"size":i.percent(t,e);break;case"align":i.alt(t,e,["start",f,"end","left","right"])}},/:/,/\s/),e.region=i.get("region",null),e.vertical=i.get("vertical","");var n=i.get("line","auto");"auto"===n&&-1===c.line&&(n=-1),e.line=n,e.lineAlign=i.get("lineAlign","start"),e.snapToLines=i.get("snapToLines",!0),e.size=i.get("size",100),e.align=i.get("align",f);var s=i.get("position","auto");"auto"===s&&50===c.position&&(s="start"===e.align||"left"===e.align?0:"end"===e.align||"right"===e.align?100:50),e.position=s}(t,e)}function l(t){return t.replace(/<br(?: \/)?>/gi,"\n")}Object.defineProperty(e,"__esModule",{value:!0});var u=r("./src/utils/vttcue.js"),d=function(){return{decode:function(t){if(!t)return"";if("string"!=typeof t)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(t))}}};a.prototype={set:function(t,e){this.get(t)||""===e||(this.values[t]=e)},get:function(t,e,r){return r?this.has(t)?this.values[t]:e[r]:this.has(t)?this.values[t]:e},has:function(t){return t in this.values},alt:function(t,e,r){for(var i=0;i<r.length;++i)if(e===r[i]){this.set(t,e);break}},integer:function(t,e){/^-?\d+$/.test(e)&&this.set(t,parseInt(e,10))},percent:function(t,e){return!!(e.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&(e=parseFloat(e))>=0&&e<=100)&&(this.set(t,e),!0)}};var c=new u.default(0,0,0),f="middle"===c.align?"middle":"center";e.fixLineBreaks=l,i.prototype={parse:function(t){function e(){var t=r.buffer,e=0;for(t=l(t);e<t.length&&"\r"!==t[e]&&"\n"!==t[e];)++e;var i=t.substr(0,e);return"\r"===t[e]&&++e,"\n"===t[e]&&++e,r.buffer=t.substr(e),i}var r=this;t&&(r.buffer+=r.decoder.decode(t,{stream:!0}));try{var i=void 0;if("INITIAL"===r.state){if(!/\r\n|\n/.test(r.buffer))return this;i=e();var n=i.match(/^()?WEBVTT([ \t].*)?$/);if(!n||!n[0])throw new Error("Malformed WebVTT signature.");r.state="HEADER"}for(var a=!1;r.buffer;){if(!/\r\n|\n/.test(r.buffer))return this;switch(a?a=!1:i=e(),r.state){case"HEADER":/:/.test(i)?function(t){o(t,function(t,e){},/:/)}(i):i||(r.state="ID");continue;case"NOTE":i||(r.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(i)){r.state="NOTE";break}if(!i)continue;if(r.cue=new u.default(0,0,""),r.state="CUE",-1===i.indexOf("--\x3e")){r.cue.id=i;continue}case"CUE":try{s(i,r.cue,r.regionList)}catch(t){r.cue=null,r.state="BADCUE";continue}r.state="CUETEXT";continue;case"CUETEXT":var d=-1!==i.indexOf("--\x3e");if(!i||d&&(a=!0)){r.oncue&&r.oncue(r.cue),r.cue=null,r.state="ID";continue}r.cue.text&&(r.cue.text+="\n"),r.cue.text+=i;continue;case"BADCUE":i||(r.state="ID");continue}}}catch(t){"CUETEXT"===r.state&&r.cue&&r.oncue&&r.oncue(r.cue),r.cue=null,r.state="INITIAL"===r.state?"BADWEBVTT":"BADCUE"}return this},flush:function(){var t=this;try{if(t.buffer+=t.decoder.decode(),(t.cue||"HEADER"===t.state)&&(t.buffer+="\n\n",t.parse()),"INITIAL"===t.state)throw new Error("Malformed WebVTT signature.")}catch(t){throw t}return t.onflush&&t.onflush(),this}},e.default=i},"./src/utils/webvtt-parser.js":function(t,e,r){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});var i=r("./src/utils/vttparser.js"),n=r("./src/demux/id3.js"),a=function(t,e,r){return t.substr(r||0,e.length)===e},o=function(e){var r=parseInt(e.substr(-3)),i=parseInt(e.substr(-6,2)),n=parseInt(e.substr(-9,2)),a=e.length>9?parseInt(e.substr(0,e.indexOf(":"))):0;return t.isFinite(r)&&t.isFinite(i)&&t.isFinite(n)&&t.isFinite(a)?(r+=1e3*i,r+=6e4*n,r+=36e5*a):-1},s=function(t){for(var e=5381,r=t.length;r;)e=33*e^t.charCodeAt(--r);return(e>>>0).toString()},l=function(t,e,r){var i=t[e],n=t[i.prevCC];if(!n||!n.new&&i.new)return t.ccOffset=t.presentationOffset=i.start,void(i.new=!1);for(;n&&n.new;)t.ccOffset+=i.start-n.start,i.new=!1,i=n,n=t[i.prevCC];t.presentationOffset=r},u={parse:function(t,e,r,u,d,c){var f,h=/\r\n|\n\r|\n|\r/g,p=n.utf8ArrayToStr(new Uint8Array(t)).trim().replace(h,"\n").split("\n"),g="00:00.000",y=0,m=0,v=0,A=[],_=!0,b=new i.default;b.oncue=function(t){var e=r[u],i=r.ccOffset;e&&e.new&&(void 0!==m?i=r.ccOffset=e.start:l(r,u,v)),v&&(i=v-r.presentationOffset),t.startTime+=i-m,t.endTime+=i-m,t.id=s(t.startTime.toString())+s(t.endTime.toString())+s(t.text),t.text=decodeURIComponent(encodeURIComponent(t.text)),t.endTime>0&&A.push(t)},b.onparsingerror=function(t){f=t},b.onflush=function(){if(f&&c)return void c(f);d(A)},p.forEach(function(t){if(_){if(a(t,"X-TIMESTAMP-MAP=")){_=!1,t.substr(16).split(",").forEach(function(t){a(t,"LOCAL:")?g=t.substr(6):a(t,"MPEGTS:")&&(y=parseInt(t.substr(7)))});try{e+(9e4*r[u].start||0)<0&&(e+=8589934592),y-=e,m=o(g)/1e3,v=y/9e4,-1===m&&(f=new Error("Malformed X-TIMESTAMP-MAP: "+t))}catch(e){f=new Error("Malformed X-TIMESTAMP-MAP: "+t)}return}""===t&&(_=!1)}b.parse(t+"\n")}),b.flush()}};e.default=u}).call(this,r("./src/polyfills/number.js").Number)},"./src/utils/xhr-loader.js":function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r("./src/utils/logger.js"),n=window.performance,a=window.XMLHttpRequest,o=function(){function t(t){t&&t.xhrSetup&&(this.xhrSetup=t.xhrSetup)}return t.prototype.destroy=function(){this.abort(),this.loader=null},t.prototype.abort=function(){var t=this.loader;t&&4!==t.readyState&&(this.stats.aborted=!0,t.abort()),window.clearTimeout(this.requestTimeout),this.requestTimeout=null,window.clearTimeout(this.retryTimeout),this.retryTimeout=null},t.prototype.load=function(t,e,r){this.context=t,this.config=e,this.callbacks=r,this.stats={trequest:n.now(),retry:0},this.retryDelay=e.retryDelay,this.loadInternal()},t.prototype.loadInternal=function(){var t,e=this.context;t=this.loader=new a;var r=this.stats;r.tfirst=0,r.loaded=0;var i=this.xhrSetup;try{if(i)try{i(t,e.url)}catch(r){t.open("GET",e.url,!0),i(t,e.url)}t.readyState||t.open("GET",e.url,!0)}catch(r){return void this.callbacks.onError({code:t.status,text:r.message},e,t)}e.rangeEnd&&t.setRequestHeader("Range","bytes="+e.rangeStart+"-"+(e.rangeEnd-1)),t.onreadystatechange=this.readystatechange.bind(this),t.onprogress=this.loadprogress.bind(this),t.responseType=e.responseType,this.requestTimeout=window.setTimeout(this.loadtimeout.bind(this),this.config.timeout),t.send()},t.prototype.readystatechange=function(t){var e=t.currentTarget,r=e.readyState,a=this.stats,o=this.context,s=this.config;if(!a.aborted&&r>=2)if(window.clearTimeout(this.requestTimeout),0===a.tfirst&&(a.tfirst=Math.max(n.now(),a.trequest)),4===r){var l=e.status;if(l>=200&&l<300){a.tload=Math.max(a.tfirst,n.now());var u=void 0,d=void 0;"arraybuffer"===o.responseType?(u=e.response,d=u.byteLength):(u=e.responseText,d=u.length),a.loaded=a.total=d;var c={url:e.responseURL,data:u};this.callbacks.onSuccess(c,a,o,e)}else a.retry>=s.maxRetry||l>=400&&l<499?(i.logger.error(l+" while loading "+o.url),this.callbacks.onError({code:l,text:e.statusText},o,e)):(i.logger.warn(l+" while loading "+o.url+", retrying in "+this.retryDelay+"..."),this.destroy(),this.retryTimeout=window.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,s.maxRetryDelay),a.retry++)}else this.requestTimeout=window.setTimeout(this.loadtimeout.bind(this),s.timeout)},t.prototype.loadtimeout=function(){i.logger.warn("timeout while loading "+this.context.url),this.callbacks.onTimeout(this.stats,this.context,null)},t.prototype.loadprogress=function(t){var e=t.currentTarget,r=this.stats;r.loaded=t.loaded,t.lengthComputable&&(r.total=t.total);var i=this.callbacks.onProgress;i&&i(r,this.context,null,e)},t}();e.default=o}}).default})},function(t,e,r){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=r(0),a=i(n),o=r(1),s=i(o),l=r(3),u=i(l),d=r(2),c=i(d),f=r(10),h=i(f),p=r(4),g=i(p);r(190);var y=function(t){function e(r){(0,a.default)(this,e);var i=(0,s.default)(this,t.call(this,r));return i.el.src=r.src,i}return(0,c.default)(e,t),e.prototype.getPlaybackType=function(){return h.default.NO_OP},(0,u.default)(e,[{key:"name",get:function(){return"html_img"}},{key:"tagName",get:function(){return"img"}},{key:"attributes",get:function(){return{"data-html-img":""}}},{key:"events",get:function(){return{load:"_onLoad",abort:"_onError",error:"_onError"}}}]),e.prototype.render=function(){return this.trigger(g.default.PLAYBACK_READY,this.name),this},e.prototype._onLoad=function(){this.trigger(g.default.PLAYBACK_ENDED,this.name)},e.prototype._onError=function(t){var e="error"===t.type?"load error":"loading aborted";this.trigger(g.default.PLAYBACK_ERROR,{message:e},this.name)},e}(h.default);e.default=y,y.canPlay=function(t){return/\.(png|jpg|jpeg|gif|bmp|tiff|pgm|pnm|webp)(|\?.*)$/i.test(t)},t.exports=e.default},function(t,e,r){var i=r(191);"string"==typeof i&&(i=[[t.i,i,""]]);var n={singleton:!0,hmr:!0};n.transform=void 0,n.insertInto=void 0;r(9)(i,n);i.locals&&(t.exports=i.locals)},function(t,e,r){e=t.exports=r(8)(!1),e.push([t.i,"[data-html-img]{max-width:100%;max-height:100%}",""])},function(t,e,r){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=r(0),a=i(n),o=r(1),s=i(o),l=r(3),u=i(l),d=r(2),c=i(d),f=r(5),h=r(10),p=i(h),g=r(7),y=i(g),m=r(4),v=i(m),A=r(193),_=i(A);r(194);var b=function(t){function e(){(0,a.default)(this,e);for(var r=arguments.length,i=Array(r),n=0;n<r;n++)i[n]=arguments[n];var o=(0,s.default)(this,t.call.apply(t,[this].concat(i)));return o._noiseFrameNum=-1,o}return(0,c.default)(e,t),(0,u.default)(e,[{key:"name",get:function(){return"no_op"}},{key:"template",get:function(){return(0,y.default)(_.default)}},{key:"attributes",get:function(){return{"data-no-op":""}}}]),e.prototype.render=function(){var t=this.options.playbackNotSupportedMessage||this.i18n.t("playback_not_supported");this.$el.html(this.template({message:t})),this.trigger(v.default.PLAYBACK_READY,this.name);var e=!(!this.options.poster||!this.options.poster.showForNoOp);return!this.options.autoPlay&&e||this._animate(),this},e.prototype._noise=function(){if(this._noiseFrameNum=(this._noiseFrameNum+1)%5,!this._noiseFrameNum){var t=this.context.createImageData(this.context.canvas.width,this.context.canvas.height),e=void 0;try{e=new Uint32Array(t.data.buffer)}catch(n){e=new Uint32Array(this.context.canvas.width*this.context.canvas.height*4);for(var r=t.data,i=0;i<r.length;i++)e[i]=r[i]}for(var n=e.length,a=6*Math.random()+4,o=0,s=0,l=0;l<n;){if(o<0){o=a*Math.random();s=255*Math.pow(Math.random(),.4)<<24}o-=1,e[l++]=s}this.context.putImageData(t,0,0)}},e.prototype._loop=function(){var t=this;this._stop||(this._noise(),this._animationHandle=(0,f.requestAnimationFrame)(function(){return t._loop()}))},e.prototype.destroy=function(){this._animationHandle&&((0,f.cancelAnimationFrame)(this._animationHandle),this._stop=!0)},e.prototype._animate=function(){this.canvas=this.$el.find("canvas[data-no-op-canvas]")[0],this.context=this.canvas.getContext("2d"),this._loop()},e}(p.default);e.default=b,b.canPlay=function(t){return!0},t.exports=e.default},function(t,e){t.exports="<canvas data-no-op-canvas></canvas>\n<p data-no-op-msg><%=message%><p>\n"},function(t,e,r){var i=r(195);"string"==typeof i&&(i=[[t.i,i,""]]);var n={singleton:!0,hmr:!0};n.transform=void 0,n.insertInto=void 0;r(9)(i,n);i.locals&&(t.exports=i.locals)},function(t,e,r){e=t.exports=r(8)(!1),e.push([t.i,"[data-no-op]{position:absolute;height:100%;width:100%;text-align:center}[data-no-op] p[data-no-op-msg]{position:absolute;text-align:center;font-size:25px;left:0;right:0;color:#fff;padding:10px;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);max-height:100%;overflow:auto}[data-no-op] canvas[data-no-op-canvas]{background-color:#777;height:100%;width:100%}",""])},function(t,e,r){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=r(0),a=i(n),o=r(1),s=i(o),l=r(3),u=i(l),d=r(2),c=i(d),f=r(42),h=i(f),p=r(4),g=i(p),y=r(7),m=i(y),v=r(197),A=i(v);r(198);var _=function(t){function e(r){(0,a.default)(this,e);var i=(0,s.default)(this,t.call(this,r));return i.template=(0,m.default)(A.default),i.showTimeout=null,i.listenTo(i.container,g.default.CONTAINER_STATE_BUFFERING,i.onBuffering),i.listenTo(i.container,g.default.CONTAINER_STATE_BUFFERFULL,i.onBufferFull),i.listenTo(i.container,g.default.CONTAINER_STOP,i.onStop),i.listenTo(i.container,g.default.CONTAINER_ENDED,i.onStop),i.listenTo(i.container,g.default.CONTAINER_ERROR,i.onStop),i.render(),i}return(0,c.default)(e,t),(0,u.default)(e,[{key:"name",get:function(){return"spinner"}},{key:"attributes",get:function(){return{"data-spinner":"",class:"spinner-three-bounce"}}}]),e.prototype.onBuffering=function(){this.show()},e.prototype.onBufferFull=function(){this.hide()},e.prototype.onStop=function(){this.hide()},e.prototype.show=function(){var t=this;null===this.showTimeout&&(this.showTimeout=setTimeout(function(){return t.$el.show()},300))},e.prototype.hide=function(){null!==this.showTimeout&&(clearTimeout(this.showTimeout),this.showTimeout=null),this.$el.hide()},e.prototype.render=function(){return this.$el.html(this.template()),this.container.$el.append(this.$el),this.$el.hide(),this.container.buffering&&this.onBuffering(),this},e}(h.default);e.default=_,t.exports=e.default},function(t,e){t.exports="<div data-bounce1></div><div data-bounce2></div><div data-bounce3></div>\n"},function(t,e,r){var i=r(199);"string"==typeof i&&(i=[[t.i,i,""]]);var n={singleton:!0,hmr:!0};n.transform=void 0,n.insertInto=void 0;r(9)(i,n);i.locals&&(t.exports=i.locals)},function(t,e,r){e=t.exports=r(8)(!1),e.push([t.i,".spinner-three-bounce[data-spinner]{position:absolute;margin:0 auto;width:70px;text-align:center;z-index:999;left:0;right:0;margin-left:auto;margin-right:auto;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.spinner-three-bounce[data-spinner]>div{width:18px;height:18px;background-color:#fff;border-radius:100%;display:inline-block;-webkit-animation:bouncedelay 1.4s infinite ease-in-out;animation:bouncedelay 1.4s infinite ease-in-out;-webkit-animation-fill-mode:both;animation-fill-mode:both}.spinner-three-bounce[data-spinner] [data-bounce1]{-webkit-animation-delay:-.32s;animation-delay:-.32s}.spinner-three-bounce[data-spinner] [data-bounce2]{-webkit-animation-delay:-.16s;animation-delay:-.16s}@-webkit-keyframes bouncedelay{0%,80%,to{-webkit-transform:scale(0);transform:scale(0)}40%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes bouncedelay{0%,80%,to{-webkit-transform:scale(0);transform:scale(0)}40%{-webkit-transform:scale(1);transform:scale(1)}}",""])},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(201),n=function(t){return t&&t.__esModule?t:{default:t}}(i);e.default=n.default,t.exports=e.default},function(t,e,r){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=r(0),a=i(n),o=r(1),s=i(o),l=r(3),u=i(l),d=r(2),c=i(d),f=r(43),h=i(f),p=r(4),g=i(p),y=r(6),m=i(y),v=function(t){function e(r){(0,a.default)(this,e);var i=(0,s.default)(this,t.call(this,r));return i.setInitialAttrs(),i.reportInterval=i.options.reportInterval||5e3,i.state="IDLE",i}return(0,c.default)(e,t),(0,u.default)(e,[{key:"name",get:function(){return"stats"}}]),e.prototype.bindEvents=function(){this.listenTo(this.container.playback,g.default.PLAYBACK_PLAY,this.onPlay),this.listenTo(this.container,g.default.CONTAINER_STOP,this.onStop),this.listenTo(this.container,g.default.CONTAINER_ENDED,this.onStop),this.listenTo(this.container,g.default.CONTAINER_DESTROYED,this.onStop),this.listenTo(this.container,g.default.CONTAINER_STATE_BUFFERING,this.onBuffering),this.listenTo(this.container,g.default.CONTAINER_STATE_BUFFERFULL,this.onBufferFull),this.listenTo(this.container,g.default.CONTAINER_STATS_ADD,this.onStatsAdd),this.listenTo(this.container,g.default.CONTAINER_BITRATE,this.onStatsAdd),this.listenTo(this.container.playback,g.default.PLAYBACK_STATS_ADD,this.onStatsAdd)},e.prototype.setInitialAttrs=function(){this.firstPlay=!0,this.startupTime=0,this.rebufferingTime=0,this.watchingTime=0,this.rebuffers=0,this.externalMetrics={}},e.prototype.onPlay=function(){this.state="PLAYING",this.watchingTimeInit=Date.now(),this.intervalId||(this.intervalId=setInterval(this.report.bind(this),this.reportInterval))},e.prototype.onStop=function(){clearInterval(this.intervalId),this.report(),this.intervalId=void 0,this.state="STOPPED"},e.prototype.onBuffering=function(){this.firstPlay?this.startupTimeInit=Date.now():this.rebufferingTimeInit=Date.now(),this.state="BUFFERING",this.rebuffers++},e.prototype.onBufferFull=function(){this.firstPlay&&this.startupTimeInit?(this.firstPlay=!1,this.startupTime=Date.now()-this.startupTimeInit,this.watchingTimeInit=Date.now()):this.rebufferingTimeInit&&(this.rebufferingTime+=this.getRebufferingTime()),this.rebufferingTimeInit=void 0,this.state="PLAYING"},e.prototype.getRebufferingTime=function(){return Date.now()-this.rebufferingTimeInit},e.prototype.getWatchingTime=function(){return Date.now()-this.watchingTimeInit-this.rebufferingTime},e.prototype.isRebuffering=function(){return!!this.rebufferingTimeInit},e.prototype.onStatsAdd=function(t){m.default.extend(this.externalMetrics,t)},e.prototype.getStats=function(){var t={startupTime:this.startupTime,rebuffers:this.rebuffers,rebufferingTime:this.isRebuffering()?this.rebufferingTime+this.getRebufferingTime():this.rebufferingTime,watchingTime:this.isRebuffering()?this.getWatchingTime()-this.getRebufferingTime():this.getWatchingTime()};return m.default.extend(t,this.externalMetrics),t},e.prototype.report=function(){this.container.statsReport(this.getStats())},e}(h.default);e.default=v,t.exports=e.default},function(t,e,r){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=r(0),a=i(n),o=r(1),s=i(o),l=r(3),u=i(l),d=r(2),c=i(d),f=r(42),h=i(f),p=r(4),g=i(p),y=r(7),m=i(y),v=r(203),A=i(v);r(204);var _=function(t){function e(r){(0,a.default)(this,e);var i=(0,s.default)(this,t.call(this,r));return i.configure(),i}return(0,c.default)(e,t),(0,u.default)(e,[{key:"name",get:function(){return"watermark"}},{key:"template",get:function(){return(0,m.default)(A.default)}}]),e.prototype.bindEvents=function(){this.listenTo(this.container,g.default.CONTAINER_PLAY,this.onPlay),this.listenTo(this.container,g.default.CONTAINER_STOP,this.onStop),this.listenTo(this.container,g.default.CONTAINER_OPTIONS_CHANGE,this.configure)},e.prototype.configure=function(){this.position=this.options.position||"bottom-right",this.options.watermark?(this.imageUrl=this.options.watermark,this.imageLink=this.options.watermarkLink,this.render()):this.$el.remove()},e.prototype.onPlay=function(){this.hidden||this.$el.show()},e.prototype.onStop=function(){this.$el.hide()},e.prototype.render=function(){this.$el.hide();var t={position:this.position,imageUrl:this.imageUrl,imageLink:this.imageLink};return this.$el.html(this.template(t)),this.container.$el.append(this.$el),this},e}(h.default);e.default=_,t.exports=e.default},function(t,e){t.exports='<div class="clappr-watermark" data-watermark data-watermark-<%=position %>>\n<% if(typeof imageLink !== \'undefined\') { %>\n<a target=_blank href="<%= imageLink %>">\n<% } %>\n<img src="<%= imageUrl %>">\n<% if(typeof imageLink !== \'undefined\') { %>\n</a>\n<% } %>\n</div>\n'},function(t,e,r){var i=r(205);"string"==typeof i&&(i=[[t.i,i,""]]);var n={singleton:!0,hmr:!0};n.transform=void 0,n.insertInto=void 0;r(9)(i,n);i.locals&&(t.exports=i.locals)},function(t,e,r){e=t.exports=r(8)(!1),e.push([t.i,".clappr-watermark[data-watermark]{position:absolute;min-width:70px;max-width:200px;width:12%;text-align:center;z-index:10}.clappr-watermark[data-watermark] a{outline:none;cursor:pointer}.clappr-watermark[data-watermark] img{max-width:100%}.clappr-watermark[data-watermark-bottom-left]{bottom:10px;left:10px}.clappr-watermark[data-watermark-bottom-right]{bottom:10px;right:42px}.clappr-watermark[data-watermark-top-left]{top:10px;left:10px}.clappr-watermark[data-watermark-top-right]{top:10px;right:37px}",""])},function(t,e,r){"use strict";(function(i){function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var a=r(0),o=n(a),s=r(1),l=n(s),u=r(3),d=n(u),c=r(2),f=n(c),h=r(42),p=n(h),g=r(4),y=n(g),m=r(7),v=n(m),A=r(10),_=n(A),b=r(79),E=n(b),T=r(207),S=n(T),L=r(64),k=n(L);r(208);var R=function(t){function e(r){(0,o.default)(this,e);var n=(0,l.default)(this,t.call(this,r));return n.hasStartedPlaying=!1,n.playRequested=!1,n.render(),i.nextTick(function(){return n.update()}),n}return(0,f.default)(e,t),(0,d.default)(e,[{key:"name",get:function(){return"poster"}},{key:"template",get:function(){return(0,v.default)(S.default)}},{key:"shouldRender",get:function(){var t=!(!this.options.poster||!this.options.poster.showForNoOp);return"html_img"!==this.container.playback.name&&(this.container.playback.getPlaybackType()!==_.default.NO_OP||t)}},{key:"attributes",get:function(){return{class:"player-poster","data-poster":""}}},{key:"events",get:function(){return{click:"clicked"}}},{key:"showOnVideoEnd",get:function(){return!this.options.poster||this.options.poster.showOnVideoEnd||void 0===this.options.poster.showOnVideoEnd}}]),e.prototype.bindEvents=function(){this.listenTo(this.container,y.default.CONTAINER_STOP,this.onStop),this.listenTo(this.container,y.default.CONTAINER_PLAY,this.onPlay),this.listenTo(this.container,y.default.CONTAINER_STATE_BUFFERING,this.update),this.listenTo(this.container,y.default.CONTAINER_STATE_BUFFERFULL,this.update),this.listenTo(this.container,y.default.CONTAINER_OPTIONS_CHANGE,this.render),this.listenTo(this.container,y.default.CONTAINER_ERROR,this.onError),this.showOnVideoEnd&&this.listenTo(this.container,y.default.CONTAINER_ENDED,this.onStop)},e.prototype.onError=function(t){this.hasFatalError=t.level===E.default.Levels.FATAL,this.hasFatalError&&(this.hasStartedPlaying=!1,this.playRequested=!1,this.showPlayButton())},e.prototype.onPlay=function(){this.hasStartedPlaying=!0,this.update()},e.prototype.onStop=function(){this.hasStartedPlaying=!1,this.playRequested=!1,this.update()},e.prototype.updatePlayButton=function(t){!t||this.options.chromeless&&!this.options.allowUserInteraction?this.hidePlayButton():this.showPlayButton()},e.prototype.showPlayButton=function(){this.hasFatalError&&!this.options.disableErrorScreen||(this.$playButton.show(),this.$el.addClass("clickable"))},e.prototype.hidePlayButton=function(){this.$playButton.hide(),this.$el.removeClass("clickable")},e.prototype.clicked=function(){return this.options.chromeless&&!this.options.allowUserInteraction||(this.playRequested=!0,this.update(),this.container.play()),!1},e.prototype.shouldHideOnPlay=function(){return!this.container.playback.isAudioOnly},e.prototype.update=function(){if(this.shouldRender){var t=!this.playRequested&&!this.hasStartedPlaying&&!this.container.buffering;this.updatePlayButton(t),this.updatePoster()}},e.prototype.updatePoster=function(){this.hasStartedPlaying?this.hidePoster():this.showPoster()},e.prototype.showPoster=function(){this.container.disableMediaControl(),this.$el.show()},e.prototype.hidePoster=function(){this.container.enableMediaControl(),this.shouldHideOnPlay()&&this.$el.hide()},e.prototype.render=function(){if(this.shouldRender){this.$el.html(this.template());if(this.options.poster&&void 0===this.options.poster.custom){var t=this.options.poster.url||this.options.poster;this.$el.css({"background-image":"url("+t+")"})}else this.options.poster&&this.$el.css({background:this.options.poster.custom});this.container.$el.append(this.el),this.$playWrapper=this.$el.find(".play-wrapper"),this.$playWrapper.append(k.default),this.$playButton=this.$playWrapper.find("svg"),this.$playButton.addClass("poster-icon"),this.$playButton.attr("data-poster","");var e=this.options.mediacontrol&&this.options.mediacontrol.buttons;return e&&this.$el.find("svg path").css("fill",e),this.options.mediacontrol&&this.options.mediacontrol.buttons&&(e=this.options.mediacontrol.buttons,this.$playButton.css("color",e)),this.update(),this}},e}(p.default);e.default=R,t.exports=e.default}).call(e,r(62))},function(t,e){t.exports='<div class="play-wrapper" data-poster></div>\n'},function(t,e,r){var i=r(209);"string"==typeof i&&(i=[[t.i,i,""]]);var n={singleton:!0,hmr:!0};n.transform=void 0,n.insertInto=void 0;r(9)(i,n);i.locals&&(t.exports=i.locals)},function(t,e,r){e=t.exports=r(8)(!1),e.push([t.i,".player-poster[data-poster]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;position:absolute;height:100%;width:100%;z-index:998;top:0;left:0;background-color:#000;background-size:cover;background-repeat:no-repeat;background-position:50% 50%}.player-poster[data-poster].clickable{cursor:pointer}.player-poster[data-poster]:hover .play-wrapper[data-poster]{opacity:1}.player-poster[data-poster] .play-wrapper[data-poster]{width:100%;height:25%;margin:0 auto;opacity:.75;transition:opacity .1s ease}.player-poster[data-poster] .play-wrapper[data-poster] svg{height:100%}.player-poster[data-poster] .play-wrapper[data-poster] svg path{fill:#fff}",""])},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(211),n=function(t){return t&&t.__esModule?t:{default:t}}(i);e.default=n.default,t.exports=e.default},function(t,e,r){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=r(0),a=i(n),o=r(1),s=i(o),l=r(3),u=i(l),d=r(2),c=i(d),f=r(43),h=i(f),p=r(4),g=i(p),y=function(t){function e(r){(0,a.default)(this,e);var i=(0,s.default)(this,t.call(this,r));return i.container.options.gaAccount&&(i.account=i.container.options.gaAccount,i.trackerName=i.container.options.gaTrackerName?i.container.options.gaTrackerName+".":"Clappr.",i.domainName=i.container.options.gaDomainName,i.currentHDState=void 0,i.embedScript()),i}return(0,c.default)(e,t),(0,u.default)(e,[{key:"name",get:function(){return"google_analytics"}}]),e.prototype.embedScript=function(){var t=this;if(window._gat)this.addEventListeners();else{var e=document.createElement("script");e.setAttribute("type","text/javascript"),e.setAttribute("async","async"),e.setAttribute("src","//www.google-analytics.com/ga.js"),e.onload=function(){return t.addEventListeners()},document.body.appendChild(e)}},e.prototype.addEventListeners=function(){var t=this;this.container&&(this.listenTo(this.container,g.default.CONTAINER_READY,this.onReady),this.listenTo(this.container,g.default.CONTAINER_PLAY,this.onPlay),this.listenTo(this.container,g.default.CONTAINER_STOP,this.onStop),this.listenTo(this.container,g.default.CONTAINER_PAUSE,this.onPause),this.listenTo(this.container,g.default.CONTAINER_ENDED,this.onEnded),this.listenTo(this.container,g.default.CONTAINER_STATE_BUFFERING,this.onBuffering),this.listenTo(this.container,g.default.CONTAINER_STATE_BUFFERFULL,this.onBufferFull),this.listenTo(this.container,g.default.CONTAINER_ERROR,this.onError),this.listenTo(this.container,g.default.CONTAINER_PLAYBACKSTATE,this.onPlaybackChanged),this.listenTo(this.container,g.default.CONTAINER_VOLUME,function(e){return t.onVolumeChanged(e)}),this.listenTo(this.container,g.default.CONTAINER_SEEK,function(e){return t.onSeek(e)}),this.listenTo(this.container,g.default.CONTAINER_FULL_SCREEN,this.onFullscreen),this.listenTo(this.container,g.default.CONTAINER_HIGHDEFINITIONUPDATE,this.onHD),this.listenTo(this.container,g.default.CONTAINER_PLAYBACKDVRSTATECHANGED,this.onDVR)),_gaq.push([this.trackerName+"_setAccount",this.account]),this.domainName&&_gaq.push([this.trackerName+"_setDomainName",this.domainName])},e.prototype.onReady=function(){this.push(["Video","Playback",this.container.playback.name])},e.prototype.onPlay=function(){this.push(["Video","Play",this.container.playback.src])},e.prototype.onStop=function(){this.push(["Video","Stop",this.container.playback.src])},e.prototype.onEnded=function(){this.push(["Video","Ended",this.container.playback.src])},e.prototype.onBuffering=function(){this.push(["Video","Buffering",this.container.playback.src])},e.prototype.onBufferFull=function(){this.push(["Video","Bufferfull",this.container.playback.src])},e.prototype.onError=function(){this.push(["Video","Error",this.container.playback.src])},e.prototype.onHD=function(t){var e=t?"ON":"OFF";e!==this.currentHDState&&(this.currentHDState=e,this.push(["Video","HD - "+e,this.container.playback.src]))},e.prototype.onPlaybackChanged=function(t){null!==t.type&&this.push(["Video","Playback Type - "+t.type,this.container.playback.src])},e.prototype.onDVR=function(t){var e=t?"ON":"OFF";this.push(["Interaction","DVR - "+e,this.container.playback.src])},e.prototype.onPause=function(){this.push(["Video","Pause",this.container.playback.src])},e.prototype.onSeek=function(){this.push(["Video","Seek",this.container.playback.src])},e.prototype.onVolumeChanged=function(){this.push(["Interaction","Volume",this.container.playback.src])},e.prototype.onFullscreen=function(){this.push(["Interaction","Fullscreen",this.container.playback.src])},e.prototype.push=function(t){var e=[this.trackerName+"_trackEvent"].concat(t);_gaq.push(e)},e}(h.default);e.default=y,t.exports=e.default},function(t,e,r){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=r(0),a=i(n),o=r(1),s=i(o),l=r(3),u=i(l),d=r(2),c=i(d),f=r(43),h=i(f),p=r(4),g=i(p),y=r(10),m=i(y),v=function(t){function e(r){return(0,a.default)(this,e),(0,s.default)(this,t.call(this,r))}return(0,c.default)(e,t),(0,u.default)(e,[{key:"name",get:function(){return"click_to_pause"}}]),e.prototype.bindEvents=function(){this.listenTo(this.container,g.default.CONTAINER_CLICK,this.click),this.listenTo(this.container,g.default.CONTAINER_SETTINGSUPDATE,this.settingsUpdate)},e.prototype.click=function(){(this.container.getPlaybackType()!==m.default.LIVE||this.container.isDvrEnabled())&&(this.container.isPlaying()?this.container.pause():this.container.play())},e.prototype.settingsUpdate=function(){var t=this.container.getPlaybackType()!==m.default.LIVE||this.container.isDvrEnabled();if(t!==this.pointerEnabled){var e=t?"addClass":"removeClass";this.container.$el[e]("pointer-enabled"),this.pointerEnabled=t}},e}(h.default);e.default=v,t.exports=e.default},function(t,e,r){"use strict";(function(i){function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var a=r(88),o=n(a),s=r(0),l=n(s),u=r(1),d=n(u),c=r(3),f=n(c),h=r(2),p=n(h),g=r(5),y=r(60),m=r(4),v=n(m),A=r(23),_=n(A),b=r(14),E=n(b),T=r(31),S=n(T),L=r(7),k=n(L),R=r(10),C=n(R),w=r(6),O=n(w);r(214);var P=r(216),D=n(P),I=r(64),x=n(I),M=r(97),N=n(M),F=r(217),B=n(F),U=r(218),j=n(U),G=r(219),K=n(G),V=r(220),Y=n(V),H=r(221),$=n(H),W=r(222),z=n(W),q=function(t){function e(r){(0,l.default)(this,e);var i=(0,d.default)(this,t.call(this,r));return i.persistConfig=i.options.persistConfig,i.currentPositionValue=null,i.currentDurationValue=null,i.keepVisible=!1,i.fullScreenOnVideoTagSupported=null,i.setInitialVolume(),i.settings={left:["play","stop","pause"],right:["volume"],default:["position","seekbar","duration"]},i.kibo=new y.Kibo(i.options.focusElement),i.bindKeyEvents(),i.container?O.default.isEmptyObject(i.container.settings)||(i.settings=O.default.extend({},i.container.settings)):i.settings={},i.userDisabled=!1,(i.container&&i.container.mediaControlDisabled||i.options.chromeless)&&i.disable(),i.stopDragHandler=function(t){return i.stopDrag(t)},i.updateDragHandler=function(t){return i.updateDrag(t)},(0,O.default)(document).bind("mouseup",i.stopDragHandler),(0,O.default)(document).bind("mousemove",i.updateDragHandler),i}return(0,p.default)(e,t),(0,f.default)(e,[{key:"name",get:function(){return"media_control"}},{key:"disabled",get:function(){var t=this.container&&this.container.getPlaybackType()===C.default.NO_OP;return this.userDisabled||t}},{key:"container",get:function(){return this.core&&this.core.activeContainer}},{key:"playback",get:function(){return this.core&&this.core.activePlayback}},{key:"attributes",get:function(){return{class:"media-control","data-media-control":""}}},{key:"events",get:function(){return{"click [data-play]":"play","click [data-pause]":"pause","click [data-playpause]":"togglePlayPause","click [data-stop]":"stop","click [data-playstop]":"togglePlayStop","click [data-fullscreen]":"toggleFullscreen","click .bar-container[data-seekbar]":"seek","click .bar-container[data-volume]":"onVolumeClick","click .drawer-icon[data-volume]":"toggleMute","mouseenter .drawer-container[data-volume]":"showVolumeBar","mouseleave .drawer-container[data-volume]":"hideVolumeBar","mousedown .bar-container[data-volume]":"startVolumeDrag","mousemove .bar-container[data-volume]":"mousemoveOnVolumeBar","mousedown .bar-scrubber[data-seekbar]":"startSeekDrag","mousemove .bar-container[data-seekbar]":"mousemoveOnSeekBar","mouseleave .bar-container[data-seekbar]":"mouseleaveOnSeekBar","mouseenter .media-control-layer[data-controls]":"setUserKeepVisible","mouseleave .media-control-layer[data-controls]":"resetUserKeepVisible"}}},{key:"template",get:function(){return(0,k.default)(D.default)}},{key:"volume",get:function(){return this.container&&this.container.isReady?this.container.volume:this.intendedVolume}},{key:"muted",get:function(){return 0===this.volume}}]),e.prototype.getExternalInterface=function(){var t=this;return{setVolume:this.setVolume,getVolume:function(){return t.volume}}},e.prototype.bindEvents=function(){var t=this;this.stopListening(),this.listenTo(this.core,v.default.CORE_ACTIVE_CONTAINER_CHANGED,this.onActiveContainerChanged),this.listenTo(this.core,v.default.CORE_MOUSE_MOVE,this.show),this.listenTo(this.core,v.default.CORE_MOUSE_LEAVE,function(){return t.hide(t.options.hideMediaControlDelay)}),this.listenTo(this.core,v.default.CORE_FULLSCREEN,this.show),this.listenTo(this.core,v.default.CORE_OPTIONS_CHANGE,this.configure),S.default.on(this.options.playerId+":"+v.default.PLAYER_RESIZE,this.playerResize,this),this.bindContainerEvents()},e.prototype.bindContainerEvents=function(){this.container&&(this.listenTo(this.container,v.default.CONTAINER_PLAY,this.changeTogglePlay),this.listenTo(this.container,v.default.CONTAINER_PAUSE,this.changeTogglePlay),this.listenTo(this.container,v.default.CONTAINER_STOP,this.changeTogglePlay),this.listenTo(this.container,v.default.CONTAINER_DBLCLICK,this.toggleFullscreen),this.listenTo(this.container,v.default.CONTAINER_TIMEUPDATE,this.onTimeUpdate),this.listenTo(this.container,v.default.CONTAINER_PROGRESS,this.updateProgressBar),this.listenTo(this.container,v.default.CONTAINER_SETTINGSUPDATE,this.settingsUpdate),this.listenTo(this.container,v.default.CONTAINER_PLAYBACKDVRSTATECHANGED,this.settingsUpdate),this.listenTo(this.container,v.default.CONTAINER_HIGHDEFINITIONUPDATE,this.highDefinitionUpdate),this.listenTo(this.container,v.default.CONTAINER_MEDIACONTROL_DISABLE,this.disable),this.listenTo(this.container,v.default.CONTAINER_MEDIACONTROL_ENABLE,this.enable),this.listenTo(this.container,v.default.CONTAINER_ENDED,this.ended),this.listenTo(this.container,v.default.CONTAINER_VOLUME,this.onVolumeChanged),this.listenTo(this.container,v.default.CONTAINER_OPTIONS_CHANGE,this.setInitialVolume),"video"===this.container.playback.el.nodeName.toLowerCase()&&this.listenToOnce(this.container,v.default.CONTAINER_LOADEDMETADATA,this.onLoadedMetadataOnVideoTag))},e.prototype.disable=function(){this.userDisabled=!0,this.hide(),this.unbindKeyEvents(),this.$el.hide()},e.prototype.enable=function(){this.options.chromeless||(this.userDisabled=!1,this.bindKeyEvents(),this.show())},e.prototype.play=function(){this.container&&this.container.play()},e.prototype.pause=function(){this.container&&this.container.pause()},e.prototype.stop=function(){this.container&&this.container.stop()},e.prototype.setInitialVolume=function(){var t=this.persistConfig?g.Config.restore("volume"):100,e=this.container&&this.container.options||this.options;this.setVolume(e.mute?0:t,!0)},e.prototype.onVolumeChanged=function(){this.updateVolumeUI()},e.prototype.onLoadedMetadataOnVideoTag=function(){var t=this.playback&&this.playback.el;!g.Fullscreen.fullscreenEnabled()&&t.webkitSupportsFullscreen&&(this.fullScreenOnVideoTagSupported=!0,this.settingsUpdate())},e.prototype.updateVolumeUI=function(){if(this.rendered){this.$volumeBarContainer.find(".bar-fill-2").css({});var t=this.$volumeBarContainer.width(),e=this.$volumeBarBackground.width(),r=(t-e)/2,i=e*this.volume/100+r;this.$volumeBarFill.css({width:this.volume+"%"}),this.$volumeBarScrubber.css({left:i}),this.$volumeBarContainer.find(".segmented-bar-element").removeClass("fill");var n=Math.ceil(this.volume/10);this.$volumeBarContainer.find(".segmented-bar-element").slice(0,n).addClass("fill"),this.$volumeIcon.html(""),this.$volumeIcon.removeClass("muted"),this.muted?(this.$volumeIcon.append(K.default),this.$volumeIcon.addClass("muted")):this.$volumeIcon.append(j.default),this.applyButtonStyle(this.$volumeIcon)}},e.prototype.changeTogglePlay=function(){this.$playPauseToggle.html(""),this.$playStopToggle.html(""),this.container&&this.container.isPlaying()?(this.$playPauseToggle.append(N.default),this.$playStopToggle.append(B.default),this.trigger(v.default.MEDIACONTROL_PLAYING)):(this.$playPauseToggle.append(x.default),this.$playStopToggle.append(x.default),this.trigger(v.default.MEDIACONTROL_NOTPLAYING),E.default.isMobile&&this.show()),this.applyButtonStyle(this.$playPauseToggle),this.applyButtonStyle(this.$playStopToggle)},e.prototype.mousemoveOnSeekBar=function(t){if(this.settings.seekEnabled){var e=t.pageX-this.$seekBarContainer.offset().left-this.$seekBarHover.width()/2;this.$seekBarHover.css({left:e})}this.trigger(v.default.MEDIACONTROL_MOUSEMOVE_SEEKBAR,t)},e.prototype.mouseleaveOnSeekBar=function(t){this.trigger(v.default.MEDIACONTROL_MOUSELEAVE_SEEKBAR,t)},e.prototype.onVolumeClick=function(t){this.setVolume(this.getVolumeFromUIEvent(t))},e.prototype.mousemoveOnVolumeBar=function(t){this.draggingVolumeBar&&this.setVolume(this.getVolumeFromUIEvent(t))},e.prototype.playerResize=function(t){this.$fullscreenToggle.html("");var e=g.Fullscreen.isFullscreen()?$.default:Y.default;this.$fullscreenToggle.append(e),this.applyButtonStyle(this.$fullscreenToggle),0!==this.$el.find(".media-control").length&&this.$el.removeClass("w320"),(t.width<=320||this.options.hideVolumeBar)&&this.$el.addClass("w320")},e.prototype.togglePlayPause=function(){return this.container.isPlaying()?this.container.pause():this.container.play(),!1},e.prototype.togglePlayStop=function(){this.container.isPlaying()?this.container.stop():this.container.play()},e.prototype.startSeekDrag=function(t){this.settings.seekEnabled&&(this.draggingSeekBar=!0,this.$el.addClass("dragging"),this.$seekBarLoaded.addClass("media-control-notransition"),this.$seekBarPosition.addClass("media-control-notransition"),this.$seekBarScrubber.addClass("media-control-notransition"),t&&t.preventDefault())},e.prototype.startVolumeDrag=function(t){this.draggingVolumeBar=!0,this.$el.addClass("dragging"),t&&t.preventDefault()},e.prototype.stopDrag=function(t){this.draggingSeekBar&&this.seek(t),this.$el.removeClass("dragging"),this.$seekBarLoaded.removeClass("media-control-notransition"),this.$seekBarPosition.removeClass("media-control-notransition"),this.$seekBarScrubber.removeClass("media-control-notransition dragging"),this.draggingSeekBar=!1,this.draggingVolumeBar=!1},e.prototype.updateDrag=function(t){if(this.draggingSeekBar){t.preventDefault();var e=t.pageX-this.$seekBarContainer.offset().left,r=e/this.$seekBarContainer.width()*100;r=Math.min(100,Math.max(r,0)),this.setSeekPercentage(r)}else this.draggingVolumeBar&&(t.preventDefault(),this.setVolume(this.getVolumeFromUIEvent(t)))},e.prototype.getVolumeFromUIEvent=function(t){return(t.pageX-this.$volumeBarContainer.offset().left)/this.$volumeBarContainer.width()*100},e.prototype.toggleMute=function(){this.setVolume(this.muted?100:0)},e.prototype.setVolume=function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t=Math.min(100,Math.max(t,0)),this.intendedVolume=t,this.persistConfig&&!r&&g.Config.persist("volume",t);var i=function(){e.container&&e.container.isReady?e.container.setVolume(t):e.listenToOnce(e.container,v.default.CONTAINER_READY,function(){e.container.setVolume(t)})};this.container?i():this.listenToOnce(this,v.default.MEDIACONTROL_CONTAINERCHANGED,function(){return i()})},e.prototype.toggleFullscreen=function(){this.trigger(v.default.MEDIACONTROL_FULLSCREEN,this.name),this.container.fullscreen(),this.core.toggleFullscreen(),this.resetUserKeepVisible()},e.prototype.onActiveContainerChanged=function(){this.fullScreenOnVideoTagSupported=null,this.bindEvents(),S.default.off(this.options.playerId+":"+v.default.PLAYER_RESIZE,this.playerResize,this),this.setInitialVolume(),this.changeTogglePlay(),this.bindContainerEvents(),this.settingsUpdate(),this.container&&this.container.trigger(v.default.CONTAINER_PLAYBACKDVRSTATECHANGED,this.container.isDvrInUse()),this.container&&this.container.mediaControlDisabled&&this.disable(),this.trigger(v.default.MEDIACONTROL_CONTAINERCHANGED)},e.prototype.showVolumeBar=function(){this.hideVolumeId&&clearTimeout(this.hideVolumeId),this.$volumeBarContainer.removeClass("volume-bar-hide")},e.prototype.hideVolumeBar=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:400;this.$volumeBarContainer&&(this.draggingVolumeBar?this.hideVolumeId=setTimeout(function(){return t.hideVolumeBar()},e):(this.hideVolumeId&&clearTimeout(this.hideVolumeId),this.hideVolumeId=setTimeout(function(){return t.$volumeBarContainer.addClass("volume-bar-hide")},e)))},e.prototype.ended=function(){this.changeTogglePlay()},e.prototype.updateProgressBar=function(t){var e=t.start/t.total*100,r=t.current/t.total*100;this.$seekBarLoaded.css({left:e+"%",width:r-e+"%"})},e.prototype.onTimeUpdate=function(t){if(!this.draggingSeekBar){var e=t.current<0?t.total:t.current;this.currentPositionValue=e,this.currentDurationValue=t.total,this.renderSeekBar()}},e.prototype.renderSeekBar=function(){if(null!==this.currentPositionValue&&null!==this.currentDurationValue){this.currentSeekBarPercentage=100,this.container&&(this.container.getPlaybackType()!==C.default.LIVE||this.container.isDvrInUse())&&(this.currentSeekBarPercentage=this.currentPositionValue/this.currentDurationValue*100),this.setSeekPercentage(this.currentSeekBarPercentage);var t=(0,g.formatTime)(this.currentPositionValue),e=(0,g.formatTime)(this.currentDurationValue);t!==this.displayedPosition&&(this.$position.text(t),this.displayedPosition=t),e!==this.displayedDuration&&(this.$duration.text(e),this.displayedDuration=e)}},e.prototype.seek=function(t){if(this.settings.seekEnabled){var e=t.pageX-this.$seekBarContainer.offset().left,r=e/this.$seekBarContainer.width()*100;return r=Math.min(100,Math.max(r,0)),this.container&&this.container.seekPercentage(r),this.setSeekPercentage(r),!1}},e.prototype.setKeepVisible=function(){this.keepVisible=!0},e.prototype.resetKeepVisible=function(){this.keepVisible=!1},e.prototype.setUserKeepVisible=function(){this.userKeepVisible=!0},e.prototype.resetUserKeepVisible=function(){this.userKeepVisible=!1},e.prototype.isVisible=function(){return!this.$el.hasClass("media-control-hide")},e.prototype.show=function(t){var e=this;if(!this.disabled){var r=t&&t.clientX!==this.lastMouseX&&t.clientY!==this.lastMouseY;(!t||r||navigator.userAgent.match(/firefox/i))&&(clearTimeout(this.hideId),this.$el.show(),this.trigger(v.default.MEDIACONTROL_SHOW,this.name),this.container&&this.container.trigger(v.default.CONTAINER_MEDIACONTROL_SHOW,this.name),this.$el.removeClass("media-control-hide"),this.hideId=setTimeout(function(){return e.hide()},2e3),t&&(this.lastMouseX=t.clientX,this.lastMouseY=t.clientY));this.updateCursorStyle(!0)}},e.prototype.hide=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(this.isVisible()){var r=e||2e3;if(clearTimeout(this.hideId),this.disabled||!1!==this.options.hideMediaControl){var i=this.userKeepVisible||this.keepVisible,n=this.draggingSeekBar||this.draggingVolumeBar;if(!this.disabled&&(e||i||n))this.hideId=setTimeout(function(){return t.hide()},r);else{this.trigger(v.default.MEDIACONTROL_HIDE,this.name),this.container&&this.container.trigger(v.default.CONTAINER_MEDIACONTROL_HIDE,this.name),this.$el.addClass("media-control-hide"),this.hideVolumeBar(0);this.updateCursorStyle(!1)}}}},e.prototype.updateCursorStyle=function(t){t?this.core.$el.removeClass("nocursor"):g.Fullscreen.isFullscreen()&&this.core.$el.addClass("nocursor")},e.prototype.settingsUpdate=function(){var t=this.getSettings();!t||this.fullScreenOnVideoTagSupported||g.Fullscreen.fullscreenEnabled()||(t.default&&(0,g.removeArrayItem)(t.default,"fullscreen"),t.left&&(0,g.removeArrayItem)(t.left,"fullscreen"),t.right&&(0,g.removeArrayItem)(t.right,"fullscreen")),(0,o.default)(this.settings)!==(0,o.default)(t)&&(this.settings=t,this.render())},e.prototype.getSettings=function(){return O.default.extend(!0,{},this.container&&this.container.settings)},e.prototype.highDefinitionUpdate=function(t){this.isHD=t;var e=t?"addClass":"removeClass";this.$hdIndicator[e]("enabled")},e.prototype.createCachedElements=function(){var t=this.$el.find(".media-control-layer");this.$duration=t.find(".media-control-indicator[data-duration]"),this.$fullscreenToggle=t.find("button.media-control-button[data-fullscreen]"),this.$playPauseToggle=t.find("button.media-control-button[data-playpause]"),this.$playStopToggle=t.find("button.media-control-button[data-playstop]"),this.$position=t.find(".media-control-indicator[data-position]"),this.$seekBarContainer=t.find(".bar-container[data-seekbar]"),this.$seekBarHover=t.find(".bar-hover[data-seekbar]"),this.$seekBarLoaded=t.find(".bar-fill-1[data-seekbar]"),this.$seekBarPosition=t.find(".bar-fill-2[data-seekbar]"),this.$seekBarScrubber=t.find(".bar-scrubber[data-seekbar]"),this.$volumeBarContainer=t.find(".bar-container[data-volume]"),this.$volumeContainer=t.find(".drawer-container[data-volume]"),this.$volumeIcon=t.find(".drawer-icon[data-volume]"),this.$volumeBarBackground=this.$el.find(".bar-background[data-volume]"),this.$volumeBarFill=this.$el.find(".bar-fill-1[data-volume]"),this.$volumeBarScrubber=this.$el.find(".bar-scrubber[data-volume]"),this.$hdIndicator=this.$el.find("button.media-control-button[data-hd-indicator]"),this.resetIndicators(),this.initializeIcons()},e.prototype.resetIndicators=function(){this.displayedPosition=this.$position.text(),this.displayedDuration=this.$duration.text()},e.prototype.initializeIcons=function(){var t=this.$el.find(".media-control-layer");t.find("button.media-control-button[data-play]").append(x.default),t.find("button.media-control-button[data-pause]").append(N.default),t.find("button.media-control-button[data-stop]").append(B.default),this.$playPauseToggle.append(x.default),this.$playStopToggle.append(x.default),this.$volumeIcon.append(j.default),this.$fullscreenToggle.append(Y.default),this.$hdIndicator.append(z.default)},e.prototype.setSeekPercentage=function(t){t=Math.max(Math.min(t,100),0),this.displayedSeekBarPercentage!==t&&(this.displayedSeekBarPercentage=t,this.$seekBarPosition.removeClass("media-control-notransition"),this.$seekBarScrubber.removeClass("media-control-notransition"),this.$seekBarPosition.css({width:t+"%"}),this.$seekBarScrubber.css({left:t+"%"}))},e.prototype.seekRelative=function(t){if(this.settings.seekEnabled){var e=this.container.getCurrentTime(),r=this.container.getDuration(),i=Math.min(Math.max(e+t,0),r);i=Math.min(100*i/r,100),this.container.seekPercentage(i)}},e.prototype.bindKeyAndShow=function(t,e){var r=this;this.kibo.down(t,function(){return r.show(),e()})},e.prototype.bindKeyEvents=function(){var t=this;if(!E.default.isMobile&&!this.options.disableKeyboardShortcuts){this.unbindKeyEvents(),this.kibo=new y.Kibo(this.options.focusElement||this.options.parentElement),this.bindKeyAndShow("space",function(){return t.togglePlayPause()}),this.bindKeyAndShow("left",function(){return t.seekRelative(-5)}),this.bindKeyAndShow("right",function(){return t.seekRelative(5)}),this.bindKeyAndShow("shift left",function(){return t.seekRelative(-10)}),this.bindKeyAndShow("shift right",function(){return t.seekRelative(10)}),this.bindKeyAndShow("shift ctrl left",function(){return t.seekRelative(-15)}),this.bindKeyAndShow("shift ctrl right",function(){return t.seekRelative(15)});["1","2","3","4","5","6","7","8","9","0"].forEach(function(e){t.bindKeyAndShow(e,function(){t.settings.seekEnabled&&t.container&&t.container.seekPercentage(10*e)})})}},e.prototype.unbindKeyEvents=function(){this.kibo&&(this.kibo.off("space"),this.kibo.off("left"),this.kibo.off("right"),this.kibo.off("shift left"),this.kibo.off("shift right"),this.kibo.off("shift ctrl left"),this.kibo.off("shift ctrl right"),this.kibo.off(["1","2","3","4","5","6","7","8","9","0"]))},e.prototype.parseColors=function(){if(this.options.mediacontrol){this.buttonsColor=this.options.mediacontrol.buttons;var t=this.options.mediacontrol.seekbar;this.$el.find(".bar-fill-2[data-seekbar]").css("background-color",t),this.$el.find(".media-control-icon svg path").css("fill",this.buttonsColor),this.$el.find(".segmented-bar-element[data-volume]").css("boxShadow","inset 2px 0 0 "+this.buttonsColor)}},e.prototype.applyButtonStyle=function(t){this.buttonsColor&&t&&(0,O.default)(t).find("svg path").css("fill",this.buttonsColor)},e.prototype.destroy=function(){(0,O.default)(document).unbind("mouseup",this.stopDragHandler),(0,O.default)(document).unbind("mousemove",this.updateDragHandler),this.unbindKeyEvents(),this.stopListening(),t.prototype.destroy.call(this)},e.prototype.configure=function(){this.options.chromeless?this.disable():this.enable(),this.trigger(v.default.MEDIACONTROL_OPTIONS_CHANGE)},e.prototype.render=function(){var t=this,e=this.options.hideMediaControlDelay||2e3;this.settings&&this.$el.html(this.template({settings:this.settings})),this.createCachedElements(),this.$playPauseToggle.addClass("paused"),this.$playStopToggle.addClass("stopped"),this.changeTogglePlay(),this.container&&(this.hideId=setTimeout(function(){return t.hide()},e),this.disabled&&this.hide()),E.default.isSafari&&E.default.isMobile&&(E.default.version<10?this.$volumeContainer.css("display","none"):this.$volumeBarContainer.css("display","none")),this.$seekBarPosition.addClass("media-control-notransition"),this.$seekBarScrubber.addClass("media-control-notransition");var r=0;return this.displayedSeekBarPercentage&&(r=this.displayedSeekBarPercentage),this.displayedSeekBarPercentage=null,this.setSeekPercentage(r),i.nextTick(function(){!t.settings.seekEnabled&&t.$seekBarContainer.addClass("seek-disabled"),!E.default.isMobile&&!t.options.disableKeyboardShortcuts&&t.bindKeyEvents(),t.playerResize({width:t.options.width,height:t.options.height}),t.hideVolumeBar(0)}),this.parseColors(),this.highDefinitionUpdate(this.isHD),this.core.$el.append(this.el),this.rendered=!0,this.updateVolumeUI(),this.trigger(v.default.MEDIACONTROL_RENDERED),this},e}(_.default);e.default=q,q.extend=function(t){return(0,g.extend)(q,t)},t.exports=e.default}).call(e,r(62))},function(t,e,r){var i=r(215);"string"==typeof i&&(i=[[t.i,i,""]]);var n={singleton:!0,hmr:!0};n.transform=void 0,n.insertInto=void 0;r(9)(i,n);i.locals&&(t.exports=i.locals)},function(t,e,r){var i=r(81);e=t.exports=r(8)(!1),e.push([t.i,".media-control-notransition{transition:none!important}.media-control[data-media-control]{position:absolute;width:100%;height:100%;z-index:9999;pointer-events:none}.media-control[data-media-control].dragging{pointer-events:auto;cursor:-webkit-grabbing!important;cursor:grabbing!important;cursor:url("+i(r(96))+"),move}.media-control[data-media-control].dragging *{cursor:-webkit-grabbing!important;cursor:grabbing!important;cursor:url("+i(r(96))+'),move}.media-control[data-media-control] .media-control-background[data-background]{position:absolute;height:40%;width:100%;bottom:0;background:linear-gradient(transparent,rgba(0,0,0,.9));transition:opacity .6s ease-out}.media-control[data-media-control] .media-control-icon{line-height:0;letter-spacing:0;speak:none;color:#fff;opacity:.5;vertical-align:middle;text-align:left;transition:all .1s ease}.media-control[data-media-control] .media-control-icon:hover{color:#fff;opacity:.75;text-shadow:hsla(0,0%,100%,.8) 0 0 5px}.media-control[data-media-control].media-control-hide .media-control-background[data-background]{opacity:0}.media-control[data-media-control].media-control-hide .media-control-layer[data-controls]{bottom:-50px}.media-control[data-media-control].media-control-hide .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-scrubber[data-seekbar]{opacity:0}.media-control[data-media-control] .media-control-layer[data-controls]{position:absolute;bottom:7px;width:100%;height:32px;font-size:0;vertical-align:middle;pointer-events:auto;transition:bottom .4s ease-out}.media-control[data-media-control] .media-control-layer[data-controls] .media-control-left-panel[data-media-control]{position:absolute;top:0;left:4px;height:100%}.media-control[data-media-control] .media-control-layer[data-controls] .media-control-center-panel[data-media-control]{height:100%;text-align:center;line-height:32px}.media-control[data-media-control] .media-control-layer[data-controls] .media-control-right-panel[data-media-control]{position:absolute;top:0;right:4px;height:100%}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button{background-color:transparent;border:0;margin:0 6px;padding:0;cursor:pointer;display:inline-block;width:32px;height:100%}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button svg{width:100%;height:22px}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button svg path{fill:#fff}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button:focus{outline:none}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-pause],.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-play],.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-stop]{float:left;height:100%}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-fullscreen]{float:right;background-color:transparent;border:0;height:100%}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-hd-indicator]{background-color:transparent;border:0;cursor:default;display:none;float:right;height:100%}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-hd-indicator].enabled{display:block;opacity:1}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-hd-indicator].enabled:hover{opacity:1;text-shadow:none}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-playpause],.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-playstop]{float:left}.media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-duration],.media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-position]{display:inline-block;font-size:10px;color:#fff;cursor:default;line-height:32px;position:relative}.media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-position]{margin:0 6px 0 7px}.media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-duration]{color:hsla(0,0%,100%,.5);margin-right:6px}.media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-duration]:before{content:"|";margin-right:7px}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar]{position:absolute;top:-20px;left:0;display:inline-block;vertical-align:middle;width:100%;height:25px;cursor:pointer}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar]{width:100%;height:1px;position:relative;top:12px;background-color:#666}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] .bar-fill-1[data-seekbar]{position:absolute;top:0;left:0;width:0;height:100%;background-color:#c2c2c2;transition:all .1s ease-out}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] .bar-fill-2[data-seekbar]{position:absolute;top:0;left:0;width:0;height:100%;background-color:#005aff;transition:all .1s ease-out}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] .bar-hover[data-seekbar]{opacity:0;position:absolute;top:-3px;width:5px;height:7px;background-color:hsla(0,0%,100%,.5);transition:opacity .1s ease}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar]:hover .bar-background[data-seekbar] .bar-hover[data-seekbar]{opacity:1}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar].seek-disabled{cursor:default}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar].seek-disabled:hover .bar-background[data-seekbar] .bar-hover[data-seekbar]{opacity:0}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-scrubber[data-seekbar]{position:absolute;-webkit-transform:translateX(-50%);transform:translateX(-50%);top:2px;left:0;width:20px;height:20px;opacity:1;transition:all .1s ease-out}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-scrubber[data-seekbar] .bar-scrubber-icon[data-seekbar]{position:absolute;left:6px;top:6px;width:8px;height:8px;border-radius:10px;box-shadow:0 0 0 6px hsla(0,0%,100%,.2);background-color:#fff}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume]{float:right;display:inline-block;height:32px;cursor:pointer;margin:0 6px;box-sizing:border-box}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume]{float:left;bottom:0}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume]{background-color:transparent;border:0;box-sizing:content-box;width:32px;height:32px;opacity:.5}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume]:hover{opacity:.75}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume] svg{height:24px;position:relative;top:3px}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume] svg path{fill:#fff}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume].muted svg{margin-left:2px}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume]{float:left;position:relative;overflow:hidden;top:6px;width:42px;height:18px;padding:3px 0;transition:width .2s ease-out}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-background[data-volume]{height:1px;position:relative;top:7px;margin:0 3px;background-color:#666}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-background[data-volume] .bar-fill-1[data-volume]{position:absolute;top:0;left:0;width:0;height:100%;background-color:#c2c2c2;transition:all .1s ease-out}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-background[data-volume] .bar-fill-2[data-volume]{position:absolute;top:0;left:0;width:0;height:100%;background-color:#005aff;transition:all .1s ease-out}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-background[data-volume] .bar-hover[data-volume]{opacity:0;position:absolute;top:-3px;width:5px;height:7px;background-color:hsla(0,0%,100%,.5);transition:opacity .1s ease}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-scrubber[data-volume]{position:absolute;-webkit-transform:translateX(-50%);transform:translateX(-50%);top:0;left:0;width:20px;height:20px;opacity:1;transition:all .1s ease-out}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-scrubber[data-volume] .bar-scrubber-icon[data-volume]{position:absolute;left:6px;top:6px;width:8px;height:8px;border-radius:10px;box-shadow:0 0 0 6px hsla(0,0%,100%,.2);background-color:#fff}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .segmented-bar-element[data-volume]{float:left;width:4px;padding-left:2px;height:12px;opacity:.5;box-shadow:inset 2px 0 0 #fff;transition:-webkit-transform .2s ease-out;transition:transform .2s ease-out;transition:transform .2s ease-out,-webkit-transform .2s ease-out}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .segmented-bar-element[data-volume].fill{box-shadow:inset 2px 0 0 #fff;opacity:1}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .segmented-bar-element[data-volume]:first-of-type{padding-left:0}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .segmented-bar-element[data-volume]:hover{-webkit-transform:scaleY(1.5);transform:scaleY(1.5)}.media-control[data-media-control].w320 .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume].volume-bar-hide{width:0;height:12px;top:9px;padding:0}',""])},function(t,e){t.exports='<div class="media-control-background" data-background></div>\n<div class="media-control-layer" data-controls>\n <% var renderBar = function(name) { %>\n <div class="bar-container" data-<%= name %>>\n <div class="bar-background" data-<%= name %>>\n <div class="bar-fill-1" data-<%= name %>></div>\n <div class="bar-fill-2" data-<%= name %>></div>\n <div class="bar-hover" data-<%= name %>></div>\n </div>\n <div class="bar-scrubber" data-<%= name %>>\n <div class="bar-scrubber-icon" data-<%= name %>></div>\n </div>\n </div>\n <% }; %>\n <% var renderSegmentedBar = function(name, segments) {\n segments = segments || 10; %>\n <div class="bar-container" data-<%= name %>>\n <% for (var i = 0; i < segments; i++) { %>\n <div class="segmented-bar-element" data-<%= name %>></div>\n <% } %>\n </div>\n <% }; %>\n <% var renderDrawer = function(name, renderContent) { %>\n <div class="drawer-container" data-<%= name %>>\n <div class="drawer-icon-container" data-<%= name %>>\n <div class="drawer-icon media-control-icon" data-<%= name %>></div>\n <span class="drawer-text" data-<%= name %>></span>\n </div>\n <% renderContent(name); %>\n </div>\n <% }; %>\n <% var renderIndicator = function(name) { %>\n <div class="media-control-indicator" data-<%= name %>></div>\n <% }; %>\n <% var renderButton = function(name) { %>\n <button type="button" class="media-control-button media-control-icon" data-<%= name %> aria-label="<%= name %>"></button>\n <% }; %>\n <% var templates = {\n bar: renderBar,\n segmentedBar: renderSegmentedBar,\n };\n var render = function(settingsList) {\n settingsList.forEach(function(setting) {\n if(setting === "seekbar") {\n renderBar(setting);\n } else if (setting === "volume") {\n renderDrawer(setting, settings.volumeBarTemplate ? templates[settings.volumeBarTemplate] : function(name) { return renderSegmentedBar(name); });\n } else if (setting === "duration" || setting === "position") {\n renderIndicator(setting);\n } else {\n renderButton(setting);\n }\n });\n }; %>\n <% if (settings.default && settings.default.length) { %>\n <div class="media-control-center-panel" data-media-control>\n <% render(settings.default); %>\n </div>\n <% } %>\n <% if (settings.left && settings.left.length) { %>\n <div class="media-control-left-panel" data-media-control>\n <% render(settings.left); %>\n </div>\n <% } %>\n <% if (settings.right && settings.right.length) { %>\n <div class="media-control-right-panel" data-media-control>\n <% render(settings.right); %>\n </div>\n <% } %>\n</div>\n'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" fill="#010101" d="M1.712 1.24h12.6v13.52h-12.6z"></path></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" fill="#010101" d="M11.5 11h-.002v1.502L7.798 10H4.5V6h3.297l3.7-2.502V4.5h.003V11zM11 4.49L7.953 6.5H5v3h2.953L11 11.51V4.49z"></path></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" fill="#010101" d="M9.75 11.51L6.7 9.5H3.75v-3H6.7L9.75 4.49v.664l.497.498V3.498L6.547 6H3.248v4h3.296l3.7 2.502v-2.154l-.497.5v.662zm3-5.165L12.404 6l-1.655 1.653L9.093 6l-.346.345L10.402 8 8.747 9.654l.346.347 1.655-1.653L12.403 10l.348-.346L11.097 8l1.655-1.655z"></path></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#010101" d="M7.156 8L4 11.156V8.5H3V13h4.5v-1H4.844L8 8.844 7.156 8zM8.5 3v1h2.657L8 7.157 8.846 8 12 4.844V7.5h1V3H8.5z"></path></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#010101" d="M13.5 3.344l-.844-.844L9.5 5.656V3h-1v4.5H13v-1h-2.656L13.5 3.344zM3 9.5h2.656L2.5 12.656l.844.844L6.5 10.344V13h1V8.5H3v1z"></path></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#010101" d="M5.375 7.062H2.637V4.26H.502v7.488h2.135V8.9h2.738v2.848h2.133V4.26H5.375v2.802zm5.97-2.81h-2.84v7.496h2.798c2.65 0 4.195-1.607 4.195-3.77v-.022c0-2.162-1.523-3.704-4.154-3.704zm2.06 3.758c0 1.21-.81 1.896-2.03 1.896h-.83V6.093h.83c1.22 0 2.03.696 2.03 1.896v.02z"></path></svg>'},function(t,e,r){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=r(0),a=i(n),o=r(1),s=i(o),l=r(3),u=i(l),d=r(2),c=i(d),f=r(23),h=i(f),p=r(7),g=i(p),y=r(10),m=i(y),v=r(4),A=i(v),_=r(224),b=i(_);r(225);var E=function(t){function e(r){(0,a.default)(this,e);var i=(0,s.default)(this,t.call(this,r));return i.settingsUpdate(),i}return(0,c.default)(e,t),(0,u.default)(e,[{key:"template",get:function(){return(0,g.default)(b.default)}},{key:"name",get:function(){return"dvr_controls"}},{key:"events",get:function(){return{"click .live-button":"click"}}},{key:"attributes",get:function(){return{class:"dvr-controls","data-dvr-controls":""}}}]),e.prototype.bindEvents=function(){this.listenTo(this.core.mediaControl,A.default.MEDIACONTROL_CONTAINERCHANGED,this.containerChanged),this.listenTo(this.core.mediaControl,A.default.MEDIACONTROL_RENDERED,this.settingsUpdate),this.listenTo(this.core,A.default.CORE_OPTIONS_CHANGE,this.render),this.core.getCurrentContainer()&&(this.listenToOnce(this.core.getCurrentContainer(),A.default.CONTAINER_TIMEUPDATE,this.render),this.listenTo(this.core.getCurrentContainer(),A.default.CONTAINER_PLAYBACKDVRSTATECHANGED,this.dvrChanged))},e.prototype.containerChanged=function(){this.stopListening(),this.bindEvents()},e.prototype.dvrChanged=function(t){this.core.getPlaybackType()===m.default.LIVE&&(this.settingsUpdate(),this.core.mediaControl.$el.addClass("live"),t?(this.core.mediaControl.$el.addClass("dvr"),this.core.mediaControl.$el.find(".media-control-indicator[data-position], .media-control-indicator[data-duration]").hide()):this.core.mediaControl.$el.removeClass("dvr"))},e.prototype.click=function(){var t=this.core.mediaControl,e=t.container;e.isPlaying()||e.play(),t.$el.hasClass("dvr")&&e.seek(e.getDuration())},e.prototype.settingsUpdate=function(){var t=this;this.stopListening(),this.core.mediaControl.$el.removeClass("live"),this.shouldRender()&&(this.render(),this.$el.click(function(){return t.click()})),this.bindEvents()},e.prototype.shouldRender=function(){return(void 0===this.core.options.useDvrControls||!!this.core.options.useDvrControls)&&this.core.getPlaybackType()===m.default.LIVE},e.prototype.render=function(){return this.$el.html(this.template({live:this.core.i18n.t("live"),backToLive:this.core.i18n.t("back_to_live")})),this.shouldRender()&&(this.core.mediaControl.$el.addClass("live"),this.core.mediaControl.$(".media-control-left-panel[data-media-control]").append(this.$el)),this},e}(h.default);e.default=E,t.exports=e.default},function(t,e){t.exports='<div class="live-info"><%= live %></div>\n<button type="button" class="live-button" aria-label="<%= backToLive %>"><%= backToLive %></button>\n'},function(t,e,r){var i=r(226);"string"==typeof i&&(i=[[t.i,i,""]]);var n={singleton:!0,hmr:!0};n.transform=void 0,n.insertInto=void 0;r(9)(i,n);i.locals&&(t.exports=i.locals)},function(t,e,r){e=t.exports=r(8)(!1),e.push([t.i,'.dvr-controls[data-dvr-controls]{display:inline-block;float:left;color:#fff;line-height:32px;font-size:10px;font-weight:700;margin-left:6px}.dvr-controls[data-dvr-controls] .live-info{cursor:default;font-family:Roboto,Open Sans,Arial,sans-serif;text-transform:uppercase}.dvr-controls[data-dvr-controls] .live-info:before{content:"";display:inline-block;position:relative;width:7px;height:7px;border-radius:3.5px;margin-right:3.5px;background-color:#ff0101}.dvr-controls[data-dvr-controls] .live-info.disabled{opacity:.3}.dvr-controls[data-dvr-controls] .live-info.disabled:before{background-color:#fff}.dvr-controls[data-dvr-controls] .live-button{cursor:pointer;outline:none;display:none;border:0;color:#fff;background-color:transparent;height:32px;padding:0;opacity:.7;font-family:Roboto,Open Sans,Arial,sans-serif;text-transform:uppercase;transition:all .1s ease}.dvr-controls[data-dvr-controls] .live-button:before{content:"";display:inline-block;position:relative;width:7px;height:7px;border-radius:3.5px;margin-right:3.5px;background-color:#fff}.dvr-controls[data-dvr-controls] .live-button:hover{opacity:1;text-shadow:hsla(0,0%,100%,.75) 0 0 5px}.dvr .dvr-controls[data-dvr-controls] .live-info{display:none}.dvr .dvr-controls[data-dvr-controls] .live-button{display:block}.dvr.media-control.live[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] .bar-fill-2[data-seekbar]{background-color:#005aff}.media-control.live[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] .bar-fill-2[data-seekbar]{background-color:#ff0101}',""])},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(228),n=function(t){return t&&t.__esModule?t:{default:t}}(i);e.default=n.default,t.exports=e.default},function(t,e,r){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=r(0),a=i(n),o=r(1),s=i(o),l=r(3),u=i(l),d=r(2),c=i(d),f=r(23),h=i(f),p=r(7),g=i(p),y=r(4),m=i(y),v=r(229),A=i(v),_=r(230),b=i(_);r(231);var E=function(t){function e(r){(0,a.default)(this,e);var i=(0,s.default)(this,t.call(this,r)),n=r.options.closedCaptionsConfig;return i._title=n&&n.title?n.title:null,i._ariaLabel=n&&n.ariaLabel?n.ariaLabel:"cc-button",i._labelCb=n&&n.labelCallback&&"function"==typeof n.labelCallback?n.labelCallback:function(t){return t.name},i}return(0,c.default)(e,t),(0,u.default)(e,[{key:"name",get:function(){return"closed_captions"}},{key:"template",get:function(){return(0,g.default)(b.default)}},{key:"events",get:function(){return{"click [data-cc-button]":"toggleContextMenu","click [data-cc-select]":"onTrackSelect"}}},{key:"attributes",get:function(){return{class:"cc-controls","data-cc-controls":""}}}]),e.prototype.bindEvents=function(){this.listenTo(this.core,m.default.CORE_ACTIVE_CONTAINER_CHANGED,this.containerChanged),this.listenTo(this.core.mediaControl,m.default.MEDIACONTROL_RENDERED,this.render),this.listenTo(this.core.mediaControl,m.default.MEDIACONTROL_HIDE,this.hideContextMenu),this.container=this.core.getCurrentContainer(),this.container&&(this.listenTo(this.container,m.default.CONTAINER_SUBTITLE_AVAILABLE,this.onSubtitleAvailable),this.listenTo(this.container,m.default.CONTAINER_SUBTITLE_CHANGED,this.onSubtitleChanged),this.listenTo(this.container,m.default.CONTAINER_STOP,this.onContainerStop))},e.prototype.onContainerStop=function(){this.ccAvailable(!1)},e.prototype.containerChanged=function(){this.ccAvailable(!1),this.stopListening(),this.bindEvents()},e.prototype.onSubtitleAvailable=function(){this.renderCcButton(),this.ccAvailable(!0)},e.prototype.onSubtitleChanged=function(t){this.setCurrentContextMenuElement(t.id)},e.prototype.onTrackSelect=function(t){var e=parseInt(t.target.dataset.ccSelect,10);return this.container.closedCaptionsTrackId=e,this.hideContextMenu(),t.stopPropagation(),!1},e.prototype.ccAvailable=function(t){var e=t?"addClass":"removeClass";this.$el[e]("available")},e.prototype.toggleContextMenu=function(){this.$el.find("ul").toggle()},e.prototype.hideContextMenu=function(){this.$el.find("ul").hide()},e.prototype.contextMenuElement=function(t){return this.$el.find("ul a"+(isNaN(t)?"":'[data-cc-select="'+t+'"]')).parent()},e.prototype.setCurrentContextMenuElement=function(t){if(this._trackId!==t){this.contextMenuElement().removeClass("current"),this.contextMenuElement(t).addClass("current");var e=t>-1?"addClass":"removeClass";this.$ccButton[e]("enabled"),this._trackId=t}},e.prototype.renderCcButton=function(){for(var t=this.container?this.container.closedCaptionsTracks:[],e=0;e<t.length;e++)t[e].label=this._labelCb(t[e]);this.$el.html(this.template({ariaLabel:this._ariaLabel,disabledLabel:this.core.i18n.t("disabled"),title:this._title,tracks:t})),this.$ccButton=this.$el.find("button.cc-button[data-cc-button]"),this.$ccButton.append(A.default),this.$el.append(this.style)},e.prototype.render=function(){this.renderCcButton();var t=this.core.mediaControl.$el.find("button[data-fullscreen]");return t[0]?this.$el.insertAfter(t):this.core.mediaControl.$el.find(".media-control-right-panel[data-media-control]").prepend(this.$el),this},e}(h.default);e.default=E,t.exports=e.default},function(t,e){t.exports='<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 49 41.8" style="enable-background:new 0 0 49 41.8;" xml:space="preserve"><path d="M47.1,0H3.2C1.6,0,0,1.2,0,2.8v31.5C0,35.9,1.6,37,3.2,37h11.9l3.2,1.9l4.7,2.7c0.9,0.5,2-0.1,2-1.1V37h22.1 c1.6,0,1.9-1.1,1.9-2.7V2.8C49,1.2,48.7,0,47.1,0z M7.2,18.6c0-4.8,3.5-9.3,9.9-9.3c4.8,0,7.1,2.7,7.1,2.7l-2.5,4 c0,0-1.7-1.7-4.2-1.7c-2.8,0-4.3,2.1-4.3,4.3c0,2.1,1.5,4.4,4.5,4.4c2.5,0,4.9-2.1,4.9-2.1l2.2,4.2c0,0-2.7,2.9-7.6,2.9 C10.8,27.9,7.2,23.5,7.2,18.6z M36.9,27.9c-6.4,0-9.9-4.4-9.9-9.3c0-4.8,3.5-9.3,9.9-9.3C41.7,9.3,44,12,44,12l-2.5,4 c0,0-1.7-1.7-4.2-1.7c-2.8,0-4.3,2.1-4.3,4.3c0,2.1,1.5,4.4,4.5,4.4c2.5,0,4.9-2.1,4.9-2.1l2.2,4.2C44.5,25,41.9,27.9,36.9,27.9z"></path></svg>'},function(t,e){t.exports='<button type="button" class="cc-button media-control-button media-control-icon" data-cc-button aria-label="<%= ariaLabel %>"></button>\n<ul>\n <% if (title) { %>\n <li data-title><%= title %></li>\n <% }; %>\n <li><a href="#" data-cc-select="-1"><%= disabledLabel %></a></li>\n <% for (var i = 0; i < tracks.length; i++) { %>\n <li><a href="#" data-cc-select="<%= tracks[i].id %>"><%= tracks[i].label %></a></li>\n <% }; %>\n</ul>\n'},function(t,e,r){var i=r(232);"string"==typeof i&&(i=[[t.i,i,""]]);var n={singleton:!0,hmr:!0};n.transform=void 0,n.insertInto=void 0;r(9)(i,n);i.locals&&(t.exports=i.locals)},function(t,e,r){e=t.exports=r(8)(!1),e.push([t.i,".cc-controls[data-cc-controls]{float:right;position:relative;display:none}.cc-controls[data-cc-controls].available{display:block}.cc-controls[data-cc-controls] .cc-button{padding:6px!important}.cc-controls[data-cc-controls] .cc-button.enabled{display:block;opacity:1}.cc-controls[data-cc-controls] .cc-button.enabled:hover{opacity:1;text-shadow:none}.cc-controls[data-cc-controls]>ul{list-style-type:none;position:absolute;bottom:25px;border:1px solid #000;display:none;background-color:#e6e6e6}.cc-controls[data-cc-controls] li{font-size:10px}.cc-controls[data-cc-controls] li[data-title]{background-color:#c3c2c2;padding:5px}.cc-controls[data-cc-controls] li a{color:#444;padding:2px 10px;display:block;text-decoration:none}.cc-controls[data-cc-controls] li a:hover{background-color:#555;color:#fff}.cc-controls[data-cc-controls] li a:hover a{color:#fff;text-decoration:none}.cc-controls[data-cc-controls] li.current a{color:red}",""])},function(t,e,r){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=r(0),a=i(n),o=r(1),s=i(o),l=r(3),u=i(l),d=r(2),c=i(d),f=r(35),h=i(f),p=r(4),g=i(p),y=r(6),m=i(y),v=r(64),A=i(v),_=r(97),b=i(_),E=(0,m.default)('link[rel="shortcut icon"]'),T=function(t){function e(r){(0,a.default)(this,e);var i=(0,s.default)(this,t.call(this,r));return i._container=null,i.configure(),i}return(0,c.default)(e,t),(0,u.default)(e,[{key:"name",get:function(){return"favicon"}},{key:"oldIcon",get:function(){return E}}]),e.prototype.configure=function(){this.core.options.changeFavicon?this.enabled||(this.stopListening(this.core,g.default.CORE_OPTIONS_CHANGE),this.enable()):this.enabled&&(this.disable(),this.listenTo(this.core,g.default.CORE_OPTIONS_CHANGE,this.configure))},e.prototype.bindEvents=function(){this.listenTo(this.core,g.default.CORE_OPTIONS_CHANGE,this.configure),this.listenTo(this.core,g.default.CORE_ACTIVE_CONTAINER_CHANGED,this.containerChanged),this.core.activeContainer&&this.containerChanged()},e.prototype.containerChanged=function(){this._container&&this.stopListening(this._container),this._container=this.core.activeContainer,this.listenTo(this._container,g.default.CONTAINER_PLAY,this.setPlayIcon),this.listenTo(this._container,g.default.CONTAINER_PAUSE,this.setPauseIcon),this.listenTo(this._container,g.default.CONTAINER_STOP,this.resetIcon),this.listenTo(this._container,g.default.CONTAINER_ENDED,this.resetIcon),this.listenTo(this._container,g.default.CONTAINER_ERROR,this.resetIcon),this.resetIcon()},e.prototype.disable=function(){t.prototype.disable.call(this),this.resetIcon()},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.resetIcon()},e.prototype.createIcon=function(t){var e=(0,m.default)("<canvas/>");e[0].width=16,e[0].height=16;var r=e[0].getContext("2d");r.fillStyle="#000";var i=(0,m.default)(t).find("path").attr("d"),n=new Path2D(i);r.fill(n);var a=(0,m.default)('<link rel="shortcut icon" type="image/png"/>');return a.attr("href",e[0].toDataURL("image/png")),a},e.prototype.setPlayIcon=function(){this.playIcon||(this.playIcon=this.createIcon(A.default)),this.changeIcon(this.playIcon)},e.prototype.setPauseIcon=function(){this.pauseIcon||(this.pauseIcon=this.createIcon(b.default)),this.changeIcon(this.pauseIcon)},e.prototype.resetIcon=function(){(0,m.default)('link[rel="shortcut icon"]').remove(),(0,m.default)("head").append(this.oldIcon)},e.prototype.changeIcon=function(t){t&&((0,m.default)('link[rel="shortcut icon"]').remove(),(0,m.default)("head").append(t))},e}(h.default);e.default=T,t.exports=e.default},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(235),n=function(t){return t&&t.__esModule?t:{default:t}}(i);e.default=n.default,t.exports=e.default},function(t,e,r){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=r(0),a=i(n),o=r(1),s=i(o),l=r(3),u=i(l),d=r(2),c=i(d),f=r(5),h=r(23),p=i(h),g=r(7),y=i(g),m=r(4),v=i(m),A=r(10),_=i(A),b=r(236),E=i(b);r(237);var T=function(t){function e(r){(0,a.default)(this,e);var i=(0,s.default)(this,t.call(this,r));return i.hoveringOverSeekBar=!1,i.hoverPosition=null,i.duration=null,i.firstFragDateTime=null,i.actualLiveTime=!!i.mediaControl.options.actualLiveTime,i.actualLiveTime&&(i.mediaControl.options.actualLiveServerTime?i.actualLiveServerTimeDiff=(new Date).getTime()-new Date(i.mediaControl.options.actualLiveServerTime).getTime():i.actualLiveServerTimeDiff=0),i}return(0,c.default)(e,t),(0,u.default)(e,[{key:"name",get:function(){return"seek_time"}},{key:"template",get:function(){return(0,y.default)(E.default)}},{key:"attributes",get:function(){return{class:"seek-time","data-seek-time":""}}},{key:"mediaControl",get:function(){return this.core.mediaControl}},{key:"mediaControlContainer",get:function(){return this.mediaControl.container}},{key:"isLiveStreamWithDvr",get:function(){return this.mediaControlContainer&&this.mediaControlContainer.getPlaybackType()===_.default.LIVE&&this.mediaControlContainer.isDvrEnabled()}},{key:"durationShown",get:function(){return this.isLiveStreamWithDvr&&!this.actualLiveTime}},{key:"useActualLiveTime",get:function(){return this.actualLiveTime&&this.isLiveStreamWithDvr}}]),e.prototype.bindEvents=function(){this.listenTo(this.mediaControl,v.default.MEDIACONTROL_RENDERED,this.render),this.listenTo(this.mediaControl,v.default.MEDIACONTROL_MOUSEMOVE_SEEKBAR,this.showTime),this.listenTo(this.mediaControl,v.default.MEDIACONTROL_MOUSELEAVE_SEEKBAR,this.hideTime),this.listenTo(this.mediaControl,v.default.MEDIACONTROL_CONTAINERCHANGED,this.onContainerChanged),this.mediaControlContainer&&(this.listenTo(this.mediaControlContainer,v.default.CONTAINER_PLAYBACKDVRSTATECHANGED,this.update),this.listenTo(this.mediaControlContainer,v.default.CONTAINER_TIMEUPDATE,this.updateDuration))},e.prototype.onContainerChanged=function(){this.stopListening(),this.bindEvents()},e.prototype.updateDuration=function(t){this.duration=t.total,this.firstFragDateTime=t.firstFragDateTime,this.update()},e.prototype.showTime=function(t){this.hoveringOverSeekBar=!0,this.calculateHoverPosition(t),this.update()},e.prototype.hideTime=function(){this.hoveringOverSeekBar=!1,this.update()},e.prototype.calculateHoverPosition=function(t){var e=t.pageX-this.mediaControl.$seekBarContainer.offset().left;this.hoverPosition=Math.min(1,Math.max(e/this.mediaControl.$seekBarContainer.width(),0))},e.prototype.getSeekTime=function(){var t=void 0,e=void 0,r=void 0,i=void 0;return this.useActualLiveTime?(this.firstFragDateTime?(i=new Date(this.firstFragDateTime),r=new Date(this.firstFragDateTime),r.setHours(0,0,0,0),e=(i.getTime()-r.getTime())/1e3+this.duration):(r=new Date((new Date).getTime()-this.actualLiveServerTimeDiff),i=new Date(r),e=(i-r.setHours(0,0,0,0))/1e3),(t=e-this.duration+this.hoverPosition*this.duration)<0&&(t+=86400)):t=this.hoverPosition*this.duration,{seekTime:t,secondsSinceMidnight:e}},e.prototype.update=function(){if(this.rendered)if(this.shouldBeVisible()){var t=this.getSeekTime(),e=(0,f.formatTime)(t.seekTime,this.useActualLiveTime);if(e!==this.displayedSeekTime&&(this.$seekTimeEl.text(e),this.displayedSeekTime=e),this.durationShown){this.$durationEl.show();var r=(0,f.formatTime)(this.actualLiveTime?t.secondsSinceMidnight:this.duration,this.actualLiveTime);r!==this.displayedDuration&&(this.$durationEl.text(r),this.displayedDuration=r)}else this.$durationEl.hide();this.$el.show();var i=this.mediaControl.$seekBarContainer.width(),n=this.$el.width(),a=this.hoverPosition*i;a-=n/2,a=Math.max(0,Math.min(a,i-n)),this.$el.css("left",a)}else this.$el.hide(),this.$el.css("left","-100%")},e.prototype.shouldBeVisible=function(){return this.mediaControlContainer&&this.mediaControlContainer.settings.seekEnabled&&this.hoveringOverSeekBar&&null!==this.hoverPosition&&null!==this.duration},e.prototype.render=function(){this.rendered=!0,this.displayedDuration=null,this.displayedSeekTime=null,this.$el.html(this.template()),this.$el.hide(),this.mediaControl.$el.append(this.el),this.$seekTimeEl=this.$el.find("[data-seek-time]"),this.$durationEl=this.$el.find("[data-duration]"),this.$durationEl.hide(),this.update()},e}(p.default);e.default=T,t.exports=e.default},function(t,e){t.exports="<span data-seek-time></span>\n<span data-duration></span>\n"},function(t,e,r){var i=r(238);"string"==typeof i&&(i=[[t.i,i,""]]);var n={singleton:!0,hmr:!0};n.transform=void 0,n.insertInto=void 0;r(9)(i,n);i.locals&&(t.exports=i.locals)},function(t,e,r){e=t.exports=r(8)(!1),e.push([t.i,'.seek-time[data-seek-time]{position:absolute;white-space:nowrap;height:20px;line-height:20px;font-size:0;left:-100%;bottom:55px;background-color:rgba(2,2,2,.5);z-index:9999;transition:opacity .1s ease}.seek-time[data-seek-time].hidden[data-seek-time]{opacity:0}.seek-time[data-seek-time] [data-seek-time]{display:inline-block;color:#fff;font-size:10px;padding-left:7px;padding-right:7px;vertical-align:top}.seek-time[data-seek-time] [data-duration]{display:inline-block;color:hsla(0,0%,100%,.5);font-size:10px;padding-right:7px;vertical-align:top}.seek-time[data-seek-time] [data-duration]:before{content:"|";margin-right:7px}',""])},function(t,e,r){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=r(0),a=i(n),o=r(3),s=i(o),l=r(1),u=i(l),d=r(2),c=i(d),f=r(35),h=i(f),p=r(4),g=i(p),y=function(t){function e(){return(0,a.default)(this,e),(0,u.default)(this,t.apply(this,arguments))}return(0,c.default)(e,t),e.prototype.bindEvents=function(){this.listenTo(this.core,g.default.CORE_CONTAINERS_CREATED,this.onContainersCreated)},e.prototype.onContainersCreated=function(){var t=this.core.containers.filter(function(t){return"no_op"!==t.playback.name})[0]||this.core.containers[0];t&&this.core.containers.forEach(function(e){e!==t&&e.destroy()})},(0,s.default)(e,[{key:"name",get:function(){return"sources"}}]),e}(h.default);e.default=y,t.exports=e.default},function(t,e,r){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=r(0),a=i(n),o=r(3),s=i(o),l=r(1),u=i(l),d=r(2),c=i(d),f=r(4),h=i(f),p=r(35),g=i(p),y=r(5),m=function(t){function e(){return(0,a.default)(this,e),(0,u.default)(this,t.apply(this,arguments))}return(0,c.default)(e,t),e.prototype.bindEvents=function(){this.listenTo(this.core,h.default.CORE_ACTIVE_CONTAINER_CHANGED,this.containerChanged);var t=this.core.activeContainer;t&&(this.listenTo(t,h.default.CONTAINER_ENDED,this.ended),this.listenTo(t,h.default.CONTAINER_STOP,this.ended))},e.prototype.containerChanged=function(){this.stopListening(),this.bindEvents()},e.prototype.ended=function(){(void 0===this.core.options.exitFullscreenOnEnd||this.core.options.exitFullscreenOnEnd)&&y.Fullscreen.isFullscreen()&&this.core.toggleFullscreen()},(0,s.default)(e,[{key:"name",get:function(){return"end_video"}}]),e}(g.default);e.default=m,t.exports=e.default},function(t,e,r){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=r(0),a=i(n),o=r(1),s=i(o),l=r(3),u=i(l),d=r(2),c=i(d),f=r(5),h=r(6),p=i(h),g=r(35),y=i(g),m=function(t){function e(r){(0,a.default)(this,e);var i=(0,s.default)(this,t.call(this,r));return i._initializeMessages(),i}return(0,c.default)(e,t),(0,u.default)(e,[{key:"name",get:function(){return"strings"}}]),e.prototype.t=function(t){var e=this._language(),r=this._messages.en;return(e&&this._messages[e]||r)[t]||r[t]||t},e.prototype._language=function(){return this.core.options.language||(0,f.getBrowserLanguage)()},e.prototype._initializeMessages=function(){var t={en:{live:"live",back_to_live:"back to live",disabled:"Disabled",playback_not_supported:"Your browser does not support the playback of this video. Please try using a different browser.",default_error_title:"Could not play video.",default_error_message:"There was a problem trying to load the video."},pt:{live:"ao vivo",back_to_live:"voltar para o ao vivo",disabled:"Desativado",playback_not_supported:"Seu navegador não supporta a reprodução deste video. Por favor, tente usar um navegador diferente.",default_error_title:"Não foi possível reproduzir o vídeo.",default_error_message:"Ocorreu um problema ao tentar carregar o vídeo."},es:{live:"vivo",back_to_live:"volver en vivo",disabled:"Discapacitado",playback_not_supported:"Su navegador no soporta la reproducción de un video. Por favor, trate de usar un navegador diferente."},ru:{live:"прямой эфир",back_to_live:"к прямому эфиру",disabled:"Отключено",playback_not_supported:"Ваш браузер не поддерживает воспроизведение этого видео. Пожалуйста, попробуйте другой браузер."},fr:{live:"en direct",back_to_live:"retour au direct",disabled:"Désactivé",playback_not_supported:"Votre navigateur ne supporte pas la lecture de cette vidéo. Merci de tenter sur un autre navigateur.",default_error_title:"Impossible de lire la vidéo.",default_error_message:"Un problème est survenu lors du chargement de la vidéo."},tr:{live:"canlı",back_to_live:"canlı yayına dön",disabled:"Engelli",playback_not_supported:"Tarayıcınız bu videoyu oynatma desteğine sahip değil. Lütfen farklı bir tarayıcı ile deneyin."},et:{live:"Otseülekanne",back_to_live:"Tagasi otseülekande juurde",disabled:"Keelatud",playback_not_supported:"Teie brauser ei toeta selle video taasesitust. Proovige kasutada muud brauserit."}};this._messages=p.default.extend(!0,t,this.core.options.strings||{}),this._messages["pt-BR"]=this._messages.pt,this._messages["en-US"]=this._messages.en,this._messages["es-419"]=this._messages.es,this._messages["fr-FR"]=this._messages.fr,this._messages["tr-TR"]=this._messages.tr,this._messages["et-EE"]=this._messages.et},e}(y.default);e.default=m,t.exports=e.default},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(243),n=function(t){return t&&t.__esModule?t:{default:t}}(i);e.default=n.default,t.exports=e.default},function(t,e,r){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=r(0),a=i(n),o=r(1),s=i(o),l=r(3),u=i(l),d=r(2),c=i(d),f=r(4),h=i(f),p=r(23),g=i(p),y=r(7),m=i(y),v=r(24),A=i(v),_=r(244),b=i(_),E=r(245),T=i(E);r(246);var S=function(t){function e(r){var i;(0,a.default)(this,e);var n=(0,s.default)(this,t.call(this,r));return n.options.disableErrorScreen?(i=n.disable(),(0,s.default)(n,i)):n}return(0,c.default)(e,t),(0,u.default)(e,[{key:"name",get:function(){return"error_screen"}},{key:"template",get:function(){return(0,m.default)(T.default)}},{key:"container",get:function(){return this.core.getCurrentContainer()}},{key:"attributes",get:function(){return{class:"player-error-screen","data-error-screen":""}}}]),e.prototype.bindEvents=function(){this.listenTo(this.core,h.default.ERROR,this.onError),this.listenTo(this.core,h.default.CORE_ACTIVE_CONTAINER_CHANGED,this.onContainerChanged)},e.prototype.bindReload=function(){this.reloadButton=this.$el.find(".player-error-screen__reload"),this.reloadButton&&this.reloadButton.on("click",this.reload.bind(this))},e.prototype.reload=function(){var t=this;this.listenToOnce(this.core,h.default.CORE_READY,function(){return t.container.play()}),this.core.load(this.options.sources,this.options.mimeType),this.unbindReload()},e.prototype.unbindReload=function(){this.reloadButton&&this.reloadButton.off("click")},e.prototype.onContainerChanged=function(){this.err=null,this.unbindReload(),this.hide()},e.prototype.onError=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.level===A.default.Levels.FATAL&&(this.err=t,this.container.disableMediaControl(),this.container.stop(),this.show())},e.prototype.show=function(){this.render(),this.$el.show()},e.prototype.hide=function(){this.$el.hide()},e.prototype.render=function(){if(this.err)return this.$el.html(this.template({title:this.err.UI.title,message:this.err.UI.message,code:this.err.code,icon:this.err.UI.icon||"",reloadIcon:b.default})),this.core.$el.append(this.el),this.bindReload(),this},e}(g.default);e.default=S,t.exports=e.default},function(t,e){t.exports='<svg fill="#FFFFFF" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"></path><path d="M0 0h24v24H0z" fill="none"></path></svg>'},function(t,e){t.exports='<div class="player-error-screen__content" data-error-screen>\n <% if (icon) { %>\n <div class="player-error-screen__icon" data-error-screen><%= icon %></div>\n <% } %>\n <div class="player-error-screen__title" data-error-screen><%= title %></div>\n <div class="player-error-screen__message" data-error-screen><%= message %></div>\n <div class="player-error-screen__code" data-error-screen>Error code: <%= code %></div>\n <div class="player-error-screen__reload" data-error-screen><%= reloadIcon %></div>\n</div>\n'},function(t,e,r){var i=r(247);"string"==typeof i&&(i=[[t.i,i,""]]);var n={singleton:!0,hmr:!0};n.transform=void 0,n.insertInto=void 0;r(9)(i,n);i.locals&&(t.exports=i.locals)},function(t,e,r){e=t.exports=r(8)(!1),e.push([t.i,"div.player-error-screen{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;color:#cccaca;position:absolute;top:0;height:100%;width:100%;background-color:rgba(0,0,0,.7);z-index:2000;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}div.player-error-screen__content[data-error-screen]{font-size:14px;color:#cccaca;margin-top:45px}div.player-error-screen__title[data-error-screen]{font-weight:700;line-height:30px;font-size:18px}div.player-error-screen__message[data-error-screen]{width:90%;margin:0 auto}div.player-error-screen__code[data-error-screen]{font-size:13px;margin-top:15px}div.player-error-screen__reload{cursor:pointer;width:30px;margin:15px auto 0}",""])}])});
+//# sourceMappingURL=clappr.min.js.map \ No newline at end of file