!function(e,t){"object"==typeofexports&&"undefined"!=typeofmodule?module.exports=t(require("global/window"),require("global/document")):"function"==typeofdefine&&define.amd?define(["global/window","global/document"],t):(e=e||self).videojs=t(e.window,e.document)}(this,function(v,h){v=v&&v.hasOwnProperty("default")?v.default:v,h=h&&h.hasOwnProperty("default")?h.default:h;vard="7.6.6",u=[],e=function(s,o){returnfunction(e,t,i){varn=o.levels[t],r=newRegExp("^("+n+")$");if("log"!==e&&i.unshift(e.toUpperCase()+":"),i.unshift(s+":"),u&&u.push([].concat(i)),v.console){vara=v.console[e];a||"debug"!==e||(a=v.console.info||v.console.log),a&&n&&r.test(e)&&a[Array.isArray(i)?"apply":"call"](v.console,i)}}};varp=functiont(i){functionn(){for(vare=arguments.length,t=newArray(e),i=0;i<e;i++)t[i]=arguments[i];r("log",a,t)}varr,a="info";returnr=e(i,n),n.createLogger=function(e){returnt(i+": "+e)},n.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:a},n.level=function(e){if("string"==typeofe){if(!n.levels.hasOwnProperty(e))thrownewError('"'+e+'" in not a valid log level');a=e}returna},(n.history=function(){returnu?[].concat(u):[]}).filter=function(t){return(u||[]).filter(function(e){returnnewRegExp(".*"+t+".*").test(e[0])})},n.history.clear=function(){u&&(u.length=0)},n.history.disable=function(){null!==u&&(u.length=0,u=null)},n.history.enable=function(){null===u&&(u=[])},n.error=function(){for(vare=arguments.length,t=newArray(e),i=0;i<e;i++)t[i]=arguments[i];returnr("error",a,t)},n.warn=function(){for(vare=arguments.length,t=newArray(e),i=0;i<e;i++)t[i]=arguments[i];returnr("warn",a,t)},n.debug=function(){for(vare=arguments.length,t=newArray(e),i=0;i<e;i++)t[i]=arguments[i];returnr("debug",a,t)},n}("VIDEOJS"),f=p.createLogger,t=Object.prototype.toString,a=function(e){returns(e)?Object.keys(e):[]};functionr(t,i){a(t).forEach(function(e){returni(t[e],e)})}functionm(i){for(vare=arguments.length,t=newArray(1<e?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];returnObject.assign?Object.assign.apply(Object,[i].concat(t)):(t.forEach(function(e){e&&r(e,function(e,t){i[t]=e})}),i)}functions(e){return!!e&&"object"==typeofe}functiono(e){returns(e)&&"[object Object]"===t.call(e)&&e.constructor===Object}functionn(e,t){if(!e||!t)return"";if("function"!=typeofv.getComputedStyle)return"";vari=v.getComputedStyle(e);returni?i.getPropertyValue(t)||i[t]:""}functionl(e){return"string"==typeofe&&/\S/.test(e)}functioni(e){if(/\s/.test(e))thrownewError("class has illegal whitespace characters")}functionc(){returnh===v.document}functiong(e){returns(e)&&1===e.nodeType}functiony(){try{returnv.parent!==v.self}catch(e){return!0}}function_(n){returnfunction(e,t){if(!l(e))returnh[n](null);l(t)&&(t=h.querySelector(t));vari=g(t)?t:h;returni[n]&&i[n](e)}}functionb(e,i,t,n){void0===e&&(e="div"),void0===i&&(i={}),void0===t&&(t={});varr=h.createElement(e);returnObject.getOwnPropertyNames(i).forEach(function(e){vart=i[e];-1!==e.indexOf("aria-")||"role"===e||"type"===e?(p.warn("Setting attributes in the second argument of createEl()\nhas been deprecated. Use the third argument instead.\ncreateEl(type, properties, attributes). Attempting to set "+e+" to "+t+"."),r.setAttribute(e,t)):"textContent"===e?T(r,t):r[e]=t}),Object.getOwnPropertyNames(t).forEach(function(e){r.setAttribute(e,t[e])}),n&&F(r,n),r}functionT(e,t){return"undefined"==typeofe.textContent?e.innerText=t:e.textContent=t,e}functionS(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}functionk(e,t){returni(t),e.classList?e.classList.contains(t):function(e){returnnewRegExp("(^|\\s)"+e+"($|\\s)")}(t).test(e.className)}functionC(e,t){returne.classList?e.classList.add(t):k(e,t)||(e.className=(e.className+" "+t).trim()),e}functionE(e,t){returne.classList?e.classList.remove(t):(i(t),e.className=e.className.split(/\s+/).filter(function(e){returne!==t}).join(" ")),e}functionw(e,t,i){varn=k(e,t);if("function"==typeofi&&(i=i(e,t)),"boolean"!=typeofi&&(i=!
varNu=function(e,t,i){returnt&&Bu(e.prototype,t),i&&Bu(e,i),e};functionBu(e,t){for(vari=0;i<t.length;i++){varn=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"inn&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}functionju(e,t){if("function"!=typeoft&&null!==t)thrownewTypeError("Super expression must either be null or a function, not "+typeoft);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}functionFu(e,t){if(!e)thrownewReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeoft&&"function"!=typeoft?e:t}functionHu(r,a){["AUDIO","SUBTITLES"].forEach(function(e){for(vartinr.mediaGroups[e])for(variinr.mediaGroups[e][t]){varn=r.mediaGroups[e][t][i];a(n,e,t,i)}})}functionVu(e,t){vari=Gu(e,{}),n=i.playlists[t.uri];if(!n)returnnull;if(n.segments&&t.segments&&n.segments.length===t.segments.length&&n.endList===t.endList&&n.mediaSequence===t.mediaSequence)returnnull;varr=Gu(n,t);n.segments&&(r.segments=function(e,t,i){varn=t.slice();i=i||0;for(varr=Math.min(e.length,t.length+i),a=i;a<r;a++)n[a-i]=Gu(e[a],n[a-i]);returnn}(n.segments,t.segments,t.mediaSequence-n.mediaSequence)),r.segments.forEach(function(e){!function(e,t){e.resolvedUri||(e.resolvedUri=Uu(t,e.uri)),e.key&&!e.key.resolvedUri&&(e.key.resolvedUri=Uu(t,e.key.uri)),e.map&&!e.map.resolvedUri&&(e.map.resolvedUri=Uu(t,e.map.uri))}(e,r.resolvedUri)});for(vara=0;a<i.playlists.length;a++)i.playlists[a].uri===t.uri&&(i.playlists[a]=r);returni.playlists[t.uri]=r,i}functionqu(e){for(vart=e.playlists.length;t--;){vari=e.playlists[t];(e.playlists[i.uri]=i).resolvedUri=Uu(e.uri,i.uri),i.id=t,i.attributes||(i.attributes={},Xu.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute."))}}functionWu(t){Hu(t,function(e){e.uri&&(e.resolvedUri=Uu(t.uri,e.uri))})}functionzu(e,t){vari=e.segments[e.segments.length-1];returnt&&i&&i.duration?1e3*i.duration:500*(e.targetDuration||10)}var$u=function(e,t){if(Array.isArray(e))returne;if(Symbol.iteratorinObject(e))returnfunction(e,t){vari=[],n=!0,r=!1,a=void0;try{for(vars,o=e[Symbol.iterator]();!(n=(s=o.next()).done)&&(i.push(s.value),!t||i.length!==t);n=!0);}catch(e){r=!0,a=e}finally{try{!n&&o.return&&o.return()}finally{if(r)throwa}}returni}(e,t);thrownewTypeError("Invalid attempt to destructure non-iterable instance")},Gu=fs.mergeOptions,Xu=fs.log,Ku=(ju(Yu,fs.EventTarget),Nu(Yu,[{key:"playlistRequestError",value:function(e,t,i){this.request=null,i&&(this.state=i),this.error={playlist:this.master.playlists[t],status:e.status,message:"HLS playlist request error at URL: "+t+".",responseText:e.responseText,code:500<=e.status?4:2},this.trigger("error")}},{key:"haveMetadata",value:function(e,t){vari=this;this.request=null,this.state="HAVE_METADATA";varn=newPs;this.customTagParsers.forEach(function(e){returnn.addParser(e)}),this.customTagMappers.forEach(function(e){returnn.addTagMapper(e)}),n.push(e.responseText),n.end(),n.manifest.uri=t,n.manifest.attributes=n.manifest.attributes||{};varr=Vu(this.master,n.manifest);this.targetDuration=n.manifest.targetDuration,r?(this.master=r,this.media_=this.master.playlists[n.manifest.uri]):this.trigger("playlistunchanged"),this.media().endList||(v.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=v.setTimeout(function(){i.trigger("mediaupdatetimeout")},zu(this.media(),!!r))),this.trigger("loadedplaylist")}},{key:"dispose",value:function(){this.stopRequest(),v.clearTimeout(this.mediaUpdateTimeout),v.clearTimeout(this.finalRenditionTimeout)}},{key:"stopRequest",value:function(){if(this.request){vare=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}},{key:"media",value:function(i,e){varn=this;if(!i)returnthis.media_;if("HAVE_NOTHING"===this.state)thrownewError("Cannot switch media playlist from "+this.state);if("string"==typeofi){if(!this.master.playlists[i])thrownewError("Unknown playlist URI: "+i);i=this.master.playlist