window.HELP_IMPROVE_VIDEOJS = false;(function(global,factory){typeof exports==="object"&&typeof module!=="undefined"?module.exports=factory(require("global/window"),require("global/document")):typeof define==="function"&&define.amd?define(["global/window","global/document"],factory):(global=global||self,global.videojs=factory(global.window,global.document))})(this,function(window$1,document){window$1=window$1&&window$1.hasOwnProperty("default")?window$1["default"]:window$1;document=document&&document.hasOwnProperty("default")?document["default"]:document;var version="7.6.6";var history=[];var LogByTypeFactory=function LogByTypeFactory(name,log){return function(type,level,args){var lvl=log.levels[level];var lvlRegExp=new RegExp("^("+lvl+")$");if(type!=="log"){args.unshift(type.toUpperCase()+":")}args.unshift(name+":");if(history){history.push([].concat(args))}if(!window$1.console){return}var fn=window$1.console[type];if(!fn&&type==="debug"){fn=window$1.console.info||window$1.console.log}if(!fn||!lvl||!lvlRegExp.test(type)){return}fn[Array.isArray(args)?"apply":"call"](window$1.console,args)}};function createLogger(name){var level="info";var logByType;var log=function log(){for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key]}logByType("log",level,args)};logByType=LogByTypeFactory(name,log);log.createLogger=function(subname){return createLogger(name+": "+subname)};log.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:level};log.level=function(lvl){if(typeof lvl==="string"){if(!log.levels.hasOwnProperty(lvl)){throw new Error('"'+lvl+'" in not a valid log level')}level=lvl}return level};log.history=function(){return history?[].concat(history):[]};log.history.filter=function(fname){return(history||[]).filter(function(historyItem){return new RegExp(".*"+fname+".*").test(historyItem[0])})};log.history.clear=function(){if(history){history.length=0}};log.history.disable=function(){if(history!==null){history.length=0;history=null}};log.history.enable=function(){if(history===null){history=[]}};log.error=function(){for(var _len2=arguments.length,args=new Array(_len2),_key2=0;_key2<_len2;_key2++){args[_key2]=arguments[_key2]}return logByType("error",level,args)};log.warn=function(){for(var _len3=arguments.length,args=new Array(_len3),_key3=0;_key3<_len3;_key3++){args[_key3]=arguments[_key3]}return logByType("warn",level,args)};log.debug=function(){for(var _len4=arguments.length,args=new Array(_len4),_key4=0;_key4<_len4;_key4++){args[_key4]=arguments[_key4]}return logByType("debug",level,args)};return log}var log=createLogger("VIDEOJS");var createLogger$1=log.createLogger;var toString=Object.prototype.toString;var keys=function keys(object){return isObject(object)?Object.keys(object):[]};function each(object,fn){keys(object).forEach(function(key){return fn(object[key],key)})}function reduce(object,fn,initial){if(initial===void 0){initial=0}return keys(object).reduce(function(accum,key){return fn(accum,object[key],key)},initial)}function assign(target){for(var _len=arguments.length,sources=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){sources[_key-1]=arguments[_key]}if(Object.assign){return Object.assign.apply(Object,[target].concat(sources))}sources.forEach(function(source){if(!source){return}each(source,function(value,key){target[key]=value})});return target}function isObject(value){return!!value&&typeof value==="object"}function isPlain(value){return isObject(value)&&toString.call(value)==="[object Object]"&&value.constructor===Object}function computedStyle(el,prop){if(!el||!prop){return""}if(typeof window$1.getComputedStyle==="function"){var computedStyleValue=window$1.getComputedStyle(el);return computedStyleValue?computedStyleValue.getPropertyValue(prop)||computedStyleValue[prop]:""}return""}function isNonBlankString(str){return typeof str==="string"&&/\S/.test(str)}function throwIfWhitespace(str){if(/\s/.test(str)){throw new Error("class has illegal whitespace characters")}}function classRegExp(className){return new RegExp("(^|\\s)"+className+"($|\\s)")}function isReal(){return document===window$1.document}function isEl(value){return isObject(value)&&value.nodeType===1}function isInFrame(){try{return window$1.parent!==window$1.self}catch(x){return true}}function createQuerier(method){return function(selector,context){if(!isNonBlankString(selector)){return document[method](null)}if(isNonBlankString(context)){context=document.querySelector(context)}var ctx=isEl(context)?context:document;return ctx[method]&&ctx[method](selector)}}function createEl(tagName,properties,attributes,content){if(tagName===void 0){tagName="div"}if(properties===void 0){properties={}}if(attributes===void 0){attributes={}}var el=document.createElement(tagName);Object.getOwnPropertyNames(properties).forEach(function(propName){var val=properties[propName];if(propName.indexOf("aria-")!==-1||propName==="role"||propName==="type"){log.warn("Setting attributes in the second argument of createEl()\n"+"has been deprecated. Use the third argument instead.\n"+("createEl(type, properties, attributes). Attempting to set "+propName+" to "+val+"."));el.setAttribute(propName,val)}else if(propName==="textContent"){textContent(el,val)}else{el[propName]=val}});Object.getOwnPropertyNames(attributes).forEach(function(attrName){el.setAttribute(attrName,attributes[attrName])});if(content){appendContent(el,content)}return el}function textContent(el,text){if(typeof el.textContent==="undefined"){el.innerText=text}else{el.textContent=text}return el}function prependTo(child,parent){if(parent.firstChild){parent.insertBefore(child,parent.firstChild)}else{parent.appendChild(child)}}function hasClass(element,classToCheck){throwIfWhitespace(classToCheck);if(element.classList){return element.classList.contains(classToCheck)}return classRegExp(classToCheck).test(element.className)}function addClass(element,classToAdd){if(element.classList){element.classList.add(classToAdd)}else if(!hasClass(element,classToAdd)){element.className=(element.className+" "+classToAdd).trim()}return element}function removeClass(element,classToRemove){if(element.classList){element.classList.remove(classToRemove)}else{throwIfWhitespace(classToRemove);element.className=element.className.split(/\s+/).filter(function(c){return c!==classToRemove}).join(" ")}return element}function toggleClass(element,classToToggle,predicate){var has=hasClass(element,classToToggle);if(typeof predicate==="function"){predicate=predicate(element,classToToggle)}if(typeof predicate!=="boolean"){predicate=!has}if(predicate===has){return}if(predicate){addClass(element,classToToggle)}else{removeClass(element,classToToggle)}return element}function setAttributes(el,attributes){Object.getOwnPropertyNames(attributes).forEach(function(attrName){var attrValue=attributes[attrName];if(attrValue===null||typeof attrValue==="undefined"||attrValue===false){el.removeAttribute(attrName)}else{el.setAttribute(attrName,attrValue===true?"":attrValue)}})}function getAttributes(tag){var obj={};var knownBooleans=","+"autoplay,controls,playsinline,loop,muted,default,defaultMuted"+",";if(tag&&tag.attributes&&tag.attributes.length>0){var attrs=tag.attributes;for(var i=attrs.length-1;i>=0;i--){var attrName=attrs[i].name;var attrVal=attrs[i].value;if(typeof tag[attrName]==="boolean"||knownBooleans.indexOf(","+attrName+",")!==-1){attrVal=attrVal!==null?true:false}obj[attrName]=attrVal}}return obj}function getAttribute(el,attribute){return el.getAttribute(attribute)}function setAttribute(el,attribute,value){el.setAttribute(attribute,value)}function removeAttribute(el,attribute){el.removeAttribute(attribute)}function blockTextSelection(){document.body.focus();document.onselectstart=function(){return false}}function unblockTextSelection(){document.onselectstart=function(){return true}}function getBoundingClientRect(el){if(el&&el.getBoundingClientRect&&el.parentNode){var rect=el.getBoundingClientRect();var result={};["bottom","height","left","right","top","width"].forEach(function(k){if(rect[k]!==undefined){result[k]=rect[k]}});if(!result.height){result.height=parseFloat(computedStyle(el,"height"))}if(!result.width){result.width=parseFloat(computedStyle(el,"width"))}return result}}function findPosition(el){var box;if(el.getBoundingClientRect&&el.parentNode){box=el.getBoundingClientRect()}if(!box){return{left:0,top:0}}var docEl=document.documentElement;var body=document.body;var clientLeft=docEl.clientLeft||body.clientLeft||0;var scrollLeft=window$1.pageXOffset||body.scrollLeft;var left=box.left+scrollLeft-clientLeft;var clientTop=docEl.clientTop||body.clientTop||0;var scrollTop=window$1.pageYOffset||body.scrollTop;var top=box.top+scrollTop-clientTop;return{left:Math.round(left),top:Math.round(top)}}function getPointerPosition(el,event){var position={};var box=findPosition(el);var boxW=el.offsetWidth;var boxH=el.offsetHeight;var boxY=box.top;var boxX=box.left;var pageY=event.pageY;var pageX=event.pageX;if(event.changedTouches){pageX=event.changedTouches[0].pageX;pageY=event.changedTouches[0].pageY}position.y=Math.max(0,Math.min(1,(boxY-pageY+boxH)/boxH));position.x=Math.max(0,Math.min(1,(pageX-boxX)/boxW));return position}function isTextNode(value){return isObject(value)&&value.nodeType===3}function emptyEl(el){while(el.firstChild){el.removeChild(el.firstChild)}return el}function normalizeContent(content){if(typeof content==="function"){content=content()}return(Array.isArray(content)?content:[content]).map(function(value){if(typeof value==="function"){value=value()}if(isEl(value)||isTextNode(value)){return value}if(typeof value==="string"&&/\S/.test(value)){return document.createTextNode(value)}}).filter(function(value){return value})}function appendContent(el,content){normalizeContent(content).forEach(function(node){return el.appendChild(node)});return el}function insertContent(el,content){return appendContent(emptyEl(el),content)}function isSingleLeftClick(event){if(event.button===undefined&&event.buttons===undefined){return true}if(event.button===0&&event.buttons===undefined){return true}if(event.type==="mouseup"&&event.button===0&&event.buttons===0){return true}if(event.button!==0||event.buttons!==1){return false}return true}var $=createQuerier("querySelector");var $$=createQuerier("querySelectorAll");var Dom=Object.freeze({isReal:isReal,isEl:isEl,isInFrame:isInFrame,createEl:createEl,textContent:textContent,prependTo:prependTo,hasClass:hasClass,addClass:addClass,removeClass:removeClass,toggleClass:toggleClass,setAttributes:setAttributes,getAttributes:getAttributes,getAttribute:getAttribute,setAttribute:setAttribute,removeAttribute:removeAttribute,blockTextSelection:blockTextSelection,unblockTextSelection:unblockTextSelection,getBoundingClientRect:getBoundingClientRect,findPosition:findPosition,getPointerPosition:getPointerPosition,isTextNode:isTextNode,emptyEl:emptyEl,normalizeContent:normalizeContent,appendContent:appendContent,insertContent:insertContent,isSingleLeftClick:isSingleLeftClick,$:$,$$:$$});var _windowLoaded=false;var videojs;var autoSetup=function autoSetup(){if(!isReal()||videojs.options.autoSetup===false){return}var vids=Array.prototype.slice.call(document.getElementsByTagName("video"));var audios=Array.prototype.slice.call(document.getElementsByTagName("audio"));var divs=Array.prototype.slice.call(document.getElementsByTagName("video-js"));var mediaEls=vids.concat(audios,divs);if(mediaEls&&mediaEls.length>0){for(var i=0,e=mediaEls.length;i-1){options={passive:true}}elem.addEventListener(type,data.dispatcher,options)}else if(elem.attachEvent){elem.attachEvent("on"+type,data.dispatcher)}}}function off(elem,type,fn){if(!DomData.has(elem)){return}var data=DomData.get(elem);if(!data.handlers){return}if(Array.isArray(type)){return _handleMultipleEvents(off,elem,type,fn)}var removeType=function removeType(el,t){data.handlers[t]=[];_cleanUpEvents(el,t)};if(type===undefined){for(var t in data.handlers){if(Object.prototype.hasOwnProperty.call(data.handlers||{},t)){removeType(elem,t)}}return}var handlers=data.handlers[type];if(!handlers){return}if(!fn){removeType(elem,type);return}if(fn.guid){for(var n=0;n=wait){fn.apply(void 0,arguments);last=now}};return throttled};var debounce=function debounce(func,wait,immediate,context){if(context===void 0){context=window$1}var timeout;var cancel=function cancel(){context.clearTimeout(timeout);timeout=null};var debounced=function debounced(){var self=this;var args=arguments;var _later=function later(){timeout=null;_later=null;if(!immediate){func.apply(self,args)}};if(!timeout&&immediate){func.apply(self,args)}context.clearTimeout(timeout);timeout=context.setTimeout(_later,wait)};debounced.cancel=cancel;return debounced};var EventTarget=function EventTarget(){};EventTarget.prototype.allowedEvents_={};EventTarget.prototype.on=function(type,fn){var ael=this.addEventListener;this.addEventListener=function(){};on(this,type,fn);this.addEventListener=ael};EventTarget.prototype.addEventListener=EventTarget.prototype.on;EventTarget.prototype.off=function(type,fn){off(this,type,fn)};EventTarget.prototype.removeEventListener=EventTarget.prototype.off;EventTarget.prototype.one=function(type,fn){var ael=this.addEventListener;this.addEventListener=function(){};one(this,type,fn);this.addEventListener=ael};EventTarget.prototype.any=function(type,fn){var ael=this.addEventListener;this.addEventListener=function(){};any(this,type,fn);this.addEventListener=ael};EventTarget.prototype.trigger=function(event){var type=event.type||event;if(typeof event==="string"){event={type:type}}event=fixEvent(event);if(this.allowedEvents_[type]&&this["on"+type]){this["on"+type](event)}trigger(this,event)};EventTarget.prototype.dispatchEvent=EventTarget.prototype.trigger;var EVENT_MAP;EventTarget.prototype.queueTrigger=function(event){var _this=this;if(!EVENT_MAP){EVENT_MAP=new Map}var type=event.type||event;var map=EVENT_MAP.get(this);if(!map){map=new Map;EVENT_MAP.set(this,map)}var oldTimeout=map.get(type);map["delete"](type);window$1.clearTimeout(oldTimeout);var timeout=window$1.setTimeout(function(){if(map.size===0){map=null;EVENT_MAP["delete"](_this)}_this.trigger(event)},0);map.set(type,timeout)};var isEvented=function isEvented(object){return object instanceof EventTarget||!!object.eventBusEl_&&["on","one","off","trigger"].every(function(k){return typeof object[k]==="function"})};var addEventedCallback=function addEventedCallback(target,callback){if(isEvented(target)){callback()}else{if(!target.eventedCallbacks){target.eventedCallbacks=[]}target.eventedCallbacks.push(callback)}};var isValidEventType=function isValidEventType(type){return typeof type==="string"&&/\S/.test(type)||Array.isArray(type)&&!!type.length};var validateTarget=function validateTarget(target){if(!target.nodeName&&!isEvented(target)){throw new Error("Invalid target; must be a DOM node or evented object.")}};var validateEventType=function validateEventType(type){if(!isValidEventType(type)){throw new Error("Invalid event type; must be a non-empty string or array.")}};var validateListener=function validateListener(listener){if(typeof listener!=="function"){throw new Error("Invalid listener; must be a function.")}};var normalizeListenArgs=function normalizeListenArgs(self,args){var isTargetingSelf=args.length<3||args[0]===self||args[0]===self.eventBusEl_;var target;var type;var listener;if(isTargetingSelf){target=self.eventBusEl_;if(args.length>=3){args.shift()}type=args[0];listener=args[1]}else{target=args[0];type=args[1];listener=args[2]}validateTarget(target);validateEventType(type);validateListener(listener);listener=bind(self,listener);return{isTargetingSelf:isTargetingSelf,target:target,type:type,listener:listener}};var listen=function listen(target,method,type,listener){validateTarget(target);if(target.nodeName){Events[method](target,type,listener)}else{target[method](type,listener)}};var EventedMixin={on:function on(){var _this=this;for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key]}var _normalizeListenArgs=normalizeListenArgs(this,args),isTargetingSelf=_normalizeListenArgs.isTargetingSelf,target=_normalizeListenArgs.target,type=_normalizeListenArgs.type,listener=_normalizeListenArgs.listener;listen(target,"on",type,listener);if(!isTargetingSelf){var removeListenerOnDispose=function removeListenerOnDispose(){return _this.off(target,type,listener)};removeListenerOnDispose.guid=listener.guid;var removeRemoverOnTargetDispose=function removeRemoverOnTargetDispose(){return _this.off("dispose",removeListenerOnDispose)};removeRemoverOnTargetDispose.guid=listener.guid;listen(this,"on","dispose",removeListenerOnDispose);listen(target,"on","dispose",removeRemoverOnTargetDispose)}},one:function one(){var _this2=this;for(var _len2=arguments.length,args=new Array(_len2),_key2=0;_key2<_len2;_key2++){args[_key2]=arguments[_key2]}var _normalizeListenArgs2=normalizeListenArgs(this,args),isTargetingSelf=_normalizeListenArgs2.isTargetingSelf,target=_normalizeListenArgs2.target,type=_normalizeListenArgs2.type,listener=_normalizeListenArgs2.listener;if(isTargetingSelf){listen(target,"one",type,listener)}else{var wrapper=function wrapper(){_this2.off(target,type,wrapper);for(var _len3=arguments.length,largs=new Array(_len3),_key3=0;_key3<_len3;_key3++){largs[_key3]=arguments[_key3]}listener.apply(null,largs)};wrapper.guid=listener.guid;listen(target,"one",type,wrapper)}},any:function any(){var _this3=this;for(var _len4=arguments.length,args=new Array(_len4),_key4=0;_key4<_len4;_key4++){args[_key4]=arguments[_key4]}var _normalizeListenArgs3=normalizeListenArgs(this,args),isTargetingSelf=_normalizeListenArgs3.isTargetingSelf,target=_normalizeListenArgs3.target,type=_normalizeListenArgs3.type,listener=_normalizeListenArgs3.listener;if(isTargetingSelf){listen(target,"any",type,listener)}else{var wrapper=function wrapper(){_this3.off(target,type,wrapper);for(var _len5=arguments.length,largs=new Array(_len5),_key5=0;_key5<_len5;_key5++){largs[_key5]=arguments[_key5]}listener.apply(null,largs)};wrapper.guid=listener.guid;listen(target,"any",type,wrapper)}},off:function off$1(targetOrType,typeOrListener,listener){if(!targetOrType||isValidEventType(targetOrType)){off(this.eventBusEl_,targetOrType,typeOrListener)}else{var target=targetOrType;var type=typeOrListener;validateTarget(target);validateEventType(type);validateListener(listener);listener=bind(this,listener);this.off("dispose",listener);if(target.nodeName){off(target,type,listener);off(target,"dispose",listener)}else if(isEvented(target)){target.off(type,listener);target.off("dispose",listener)}}},trigger:function trigger$1(event,hash){return trigger(this.eventBusEl_,event,hash)}};function evented(target,options){if(options===void 0){options={}}var _options=options,eventBusKey=_options.eventBusKey;if(eventBusKey){if(!target[eventBusKey].nodeName){throw new Error('The eventBusKey "'+eventBusKey+'" does not refer to an element.')}target.eventBusEl_=target[eventBusKey]}else{target.eventBusEl_=createEl("span",{className:"vjs-event-bus"})}assign(target,EventedMixin);if(target.eventedCallbacks){target.eventedCallbacks.forEach(function(callback){callback()})}target.on("dispose",function(){target.off();window$1.setTimeout(function(){target.eventBusEl_=null},0)});return target}var StatefulMixin={state:{},setState:function setState(stateUpdates){var _this=this;if(typeof stateUpdates==="function"){stateUpdates=stateUpdates()}var changes;each(stateUpdates,function(value,key){if(_this.state[key]!==value){changes=changes||{};changes[key]={from:_this.state[key],to:value}}_this.state[key]=value});if(changes&&isEvented(this)){this.trigger({changes:changes,type:"statechanged"})}return changes}};function stateful(target,defaultState){assign(target,StatefulMixin);target.state=assign({},target.state,defaultState);if(typeof target.handleStateChanged==="function"&&isEvented(target)){target.on("statechanged",target.handleStateChanged)}return target}var toLowerCase=function toLowerCase(string){if(typeof string!=="string"){return string}return string.replace(/./,function(w){return w.toLowerCase()})};var toTitleCase=function toTitleCase(string){if(typeof string!=="string"){return string}return string.replace(/./,function(w){return w.toUpperCase()})};var titleCaseEquals=function titleCaseEquals(str1,str2){return toTitleCase(str1)===toTitleCase(str2)};function mergeOptions(){var result={};for(var _len=arguments.length,sources=new Array(_len),_key=0;_key<_len;_key++){sources[_key]=arguments[_key]}sources.forEach(function(source){if(!source){return}each(source,function(value,key){if(!isPlain(value)){result[key]=value;return}if(!isPlain(result[key])){result[key]={}}result[key]=mergeOptions(result[key],value)})});return result}var Component=function(){function Component(player,options,ready){if(!player&&this.play){this.player_=player=this}else{this.player_=player}this.parentComponent_=null;this.options_=mergeOptions({},this.options_);options=this.options_=mergeOptions(this.options_,options);this.id_=options.id||options.el&&options.el.id;if(!this.id_){var id=player&&player.id&&player.id()||"no_player";this.id_=id+"_component_"+newGUID()}this.name_=options.name||null;if(options.el){this.el_=options.el}else if(options.createEl!==false){this.el_=this.createEl()}if(options.evented!==false){evented(this,{eventBusKey:this.el_?"el_":null})}stateful(this,this.constructor.defaultState);this.children_=[];this.childIndex_={};this.childNameIndex_={};var SetSham;if(!window$1.Set){SetSham=function(){function SetSham(){this.set_={}}var _proto2=SetSham.prototype;_proto2.has=function has(key){return key in this.set_};_proto2["delete"]=function _delete(key){var has=this.has(key);delete this.set_[key];return has};_proto2.add=function add(key){this.set_[key]=1;return this};_proto2.forEach=function forEach(callback,thisArg){for(var key in this.set_){callback.call(thisArg,key,key,this)}};return SetSham}()}this.setTimeoutIds_=window$1.Set?new Set:new SetSham;this.setIntervalIds_=window$1.Set?new Set:new SetSham;this.rafIds_=window$1.Set?new Set:new SetSham;this.clearingTimersOnDispose_=false;if(options.initChildren!==false){this.initChildren()}this.ready(ready);if(options.reportTouchActivity!==false){this.enableTouchActivity()}}var _proto=Component.prototype;_proto.dispose=function dispose(){this.trigger({type:"dispose",bubbles:false});if(this.children_){for(var i=this.children_.length-1;i>=0;i--){if(this.children_[i].dispose){this.children_[i].dispose()}}}this.children_=null;this.childIndex_=null;this.childNameIndex_=null;this.parentComponent_=null;if(this.el_){if(this.el_.parentNode){this.el_.parentNode.removeChild(this.el_)}if(DomData.has(this.el_)){DomData["delete"](this.el_)}this.el_=null}this.player_=null};_proto.player=function player(){return this.player_};_proto.options=function options(obj){if(!obj){return this.options_}this.options_=mergeOptions(this.options_,obj);return this.options_};_proto.el=function el(){return this.el_};_proto.createEl=function createEl$1(tagName,properties,attributes){return createEl(tagName,properties,attributes)};_proto.localize=function localize(string,tokens,defaultValue){if(defaultValue===void 0){defaultValue=string}var code=this.player_.language&&this.player_.language();var languages=this.player_.languages&&this.player_.languages();var language=languages&&languages[code];var primaryCode=code&&code.split("-")[0];var primaryLang=languages&&languages[primaryCode];var localizedString=defaultValue;if(language&&language[string]){localizedString=language[string]}else if(primaryLang&&primaryLang[string]){localizedString=primaryLang[string]}if(tokens){localizedString=localizedString.replace(/\{(\d+)\}/g,function(match,index){var value=tokens[index-1];var ret=value;if(typeof value==="undefined"){ret=match}return ret})}return localizedString};_proto.contentEl=function contentEl(){return this.contentEl_||this.el_};_proto.id=function id(){return this.id_};_proto.name=function name(){return this.name_};_proto.children=function children(){return this.children_};_proto.getChildById=function getChildById(id){return this.childIndex_[id]};_proto.getChild=function getChild(name){if(!name){return}return this.childNameIndex_[name]};_proto.addChild=function addChild(child,options,index){if(options===void 0){options={}}if(index===void 0){index=this.children_.length}var component;var componentName;if(typeof child==="string"){componentName=toTitleCase(child);var componentClassName=options.componentClass||componentName;options.name=componentName;var ComponentClass=Component.getComponent(componentClassName);if(!ComponentClass){throw new Error("Component "+componentClassName+" does not exist")}if(typeof ComponentClass!=="function"){return null}component=new ComponentClass(this.player_||this,options)}else{component=child}if(component.parentComponent_){component.parentComponent_.removeChild(component)}this.children_.splice(index,0,component);component.parentComponent_=this;if(typeof component.id==="function"){this.childIndex_[component.id()]=component}componentName=componentName||component.name&&toTitleCase(component.name());if(componentName){this.childNameIndex_[componentName]=component;this.childNameIndex_[toLowerCase(componentName)]=component}if(typeof component.el==="function"&&component.el()){var childNodes=this.contentEl().children;var refNode=childNodes[index]||null;this.contentEl().insertBefore(component.el(),refNode)}return component};_proto.removeChild=function removeChild(component){if(typeof component==="string"){component=this.getChild(component)}if(!component||!this.children_){return}var childFound=false;for(var i=this.children_.length-1;i>=0;i--){if(this.children_[i]===component){childFound=true;this.children_.splice(i,1);break}}if(!childFound){return}component.parentComponent_=null;this.childIndex_[component.id()]=null;this.childNameIndex_[toTitleCase(component.name())]=null;this.childNameIndex_[toLowerCase(component.name())]=null;var compEl=component.el();if(compEl&&compEl.parentNode===this.contentEl()){this.contentEl().removeChild(component.el())}};_proto.initChildren=function initChildren(){var _this=this;var children=this.options_.children;if(children){var parentOptions=this.options_;var handleAdd=function handleAdd(child){var name=child.name;var opts=child.opts;if(parentOptions[name]!==undefined){opts=parentOptions[name]}if(opts===false){return}if(opts===true){opts={}}opts.playerOptions=_this.options_.playerOptions;var newChild=_this.addChild(name,opts);if(newChild){_this[name]=newChild}};var workingChildren;var Tech=Component.getComponent("Tech");if(Array.isArray(children)){workingChildren=children}else{workingChildren=Object.keys(children)}workingChildren.concat(Object.keys(this.options_).filter(function(child){return!workingChildren.some(function(wchild){if(typeof wchild==="string"){return child===wchild}return child===wchild.name})})).map(function(child){var name;var opts;if(typeof child==="string"){name=child;opts=children[name]||_this.options_[name]||{}}else{name=child.name;opts=child}return{name:name,opts:opts}}).filter(function(child){var c=Component.getComponent(child.opts.componentClass||toTitleCase(child.name));return c&&!Tech.isTech(c)}).forEach(handleAdd)}};_proto.buildCSSClass=function buildCSSClass(){return""};_proto.ready=function ready(fn,sync){if(sync===void 0){sync=false}if(!fn){return}if(!this.isReady_){this.readyQueue_=this.readyQueue_||[];this.readyQueue_.push(fn);return}if(sync){fn.call(this)}else{this.setTimeout(fn,1)}};_proto.triggerReady=function triggerReady(){this.isReady_=true;this.setTimeout(function(){var readyQueue=this.readyQueue_;this.readyQueue_=[];if(readyQueue&&readyQueue.length>0){readyQueue.forEach(function(fn){fn.call(this)},this)}this.trigger("ready")},1)};_proto.$=function $$1(selector,context){return $(selector,context||this.contentEl())};_proto.$$=function $$$1(selector,context){return $$(selector,context||this.contentEl())};_proto.hasClass=function hasClass$1(classToCheck){return hasClass(this.el_,classToCheck)};_proto.addClass=function addClass$1(classToAdd){addClass(this.el_,classToAdd)};_proto.removeClass=function removeClass$1(classToRemove){removeClass(this.el_,classToRemove)};_proto.toggleClass=function toggleClass$1(classToToggle,predicate){toggleClass(this.el_,classToToggle,predicate)};_proto.show=function show(){this.removeClass("vjs-hidden")};_proto.hide=function hide(){this.addClass("vjs-hidden")};_proto.lockShowing=function lockShowing(){this.addClass("vjs-lock-showing")};_proto.unlockShowing=function unlockShowing(){this.removeClass("vjs-lock-showing")};_proto.getAttribute=function getAttribute$1(attribute){return getAttribute(this.el_,attribute)};_proto.setAttribute=function setAttribute$1(attribute,value){setAttribute(this.el_,attribute,value)};_proto.removeAttribute=function removeAttribute$1(attribute){removeAttribute(this.el_,attribute)};_proto.width=function width(num,skipListeners){return this.dimension("width",num,skipListeners)};_proto.height=function height(num,skipListeners){return this.dimension("height",num,skipListeners)};_proto.dimensions=function dimensions(width,height){this.width(width,true);this.height(height)};_proto.dimension=function dimension(widthOrHeight,num,skipListeners){if(num!==undefined){if(num===null||num!==num){num=0}if((""+num).indexOf("%")!==-1||(""+num).indexOf("px")!==-1){this.el_.style[widthOrHeight]=num}else if(num==="auto"){this.el_.style[widthOrHeight]=""}else{this.el_.style[widthOrHeight]=num+"px"}if(!skipListeners){this.trigger("componentresize")}return}if(!this.el_){return 0}var val=this.el_.style[widthOrHeight];var pxIndex=val.indexOf("px");if(pxIndex!==-1){return parseInt(val.slice(0,pxIndex),10)}return parseInt(this.el_["offset"+toTitleCase(widthOrHeight)],10)};_proto.currentDimension=function currentDimension(widthOrHeight){var computedWidthOrHeight=0;if(widthOrHeight!=="width"&&widthOrHeight!=="height"){throw new Error("currentDimension only accepts width or height value")}computedWidthOrHeight=computedStyle(this.el_,widthOrHeight);computedWidthOrHeight=parseFloat(computedWidthOrHeight);if(computedWidthOrHeight===0||isNaN(computedWidthOrHeight)){var rule="offset"+toTitleCase(widthOrHeight);computedWidthOrHeight=this.el_[rule]}return computedWidthOrHeight};_proto.currentDimensions=function currentDimensions(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}};_proto.currentWidth=function currentWidth(){return this.currentDimension("width")};_proto.currentHeight=function currentHeight(){return this.currentDimension("height")};_proto.focus=function focus(){this.el_.focus()};_proto.blur=function blur(){this.el_.blur()};_proto.handleKeyDown=function handleKeyDown(event){if(this.player_){event.stopPropagation();this.player_.handleKeyDown(event)}};_proto.handleKeyPress=function handleKeyPress(event){this.handleKeyDown(event)};_proto.emitTapEvents=function emitTapEvents(){var touchStart=0;var firstTouch=null;var tapMovementThreshold=10;var touchTimeThreshold=200;var couldBeTap;this.on("touchstart",function(event){if(event.touches.length===1){firstTouch={pageX:event.touches[0].pageX,pageY:event.touches[0].pageY};touchStart=window$1.performance.now();couldBeTap=true}});this.on("touchmove",function(event){if(event.touches.length>1){couldBeTap=false}else if(firstTouch){var xdiff=event.touches[0].pageX-firstTouch.pageX;var ydiff=event.touches[0].pageY-firstTouch.pageY;var touchDistance=Math.sqrt(xdiff*xdiff+ydiff*ydiff);if(touchDistance>tapMovementThreshold){couldBeTap=false}}});var noTap=function noTap(){couldBeTap=false};this.on("touchleave",noTap);this.on("touchcancel",noTap);this.on("touchend",function(event){firstTouch=null;if(couldBeTap===true){var touchTime=window$1.performance.now()-touchStart;if(touchTime0&&playerNames.map(function(pname){return players[pname]}).every(Boolean)){throw new Error("Can not register Player component after player has been created.")}}Component.components_[name]=ComponentToRegister;Component.components_[toLowerCase(name)]=ComponentToRegister;return ComponentToRegister};Component.getComponent=function getComponent(name){if(!name||!Component.components_){return}return Component.components_[name]};return Component}();Component.prototype.supportsRaf_=typeof window$1.requestAnimationFrame==="function"&&typeof window$1.cancelAnimationFrame==="function";Component.registerComponent("Component",Component);function _inheritsLoose(subClass,superClass){subClass.prototype=Object.create(superClass.prototype);subClass.prototype.constructor=subClass;subClass.__proto__=superClass}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){o.__proto__=p;return o};return _setPrototypeOf(o,p)}function isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return true}catch(e){return false}}function _construct(Parent,args,Class){if(isNativeReflectConstruct()){_construct=Reflect.construct}else{_construct=function _construct(Parent,args,Class){var a=[null];a.push.apply(a,args);var Constructor=Function.bind.apply(Parent,a);var instance=new Constructor;if(Class)_setPrototypeOf(instance,Class.prototype);return instance}}return _construct.apply(null,arguments)}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return self}var USER_AGENT=window$1.navigator&&window$1.navigator.userAgent||"";var webkitVersionMap=/AppleWebKit\/([\d.]+)/i.exec(USER_AGENT);var appleWebkitVersion=webkitVersionMap?parseFloat(webkitVersionMap.pop()):null;var IS_IPAD=/iPad/i.test(USER_AGENT);var IS_IPHONE=/iPhone/i.test(USER_AGENT)&&!IS_IPAD;var IS_IPOD=/iPod/i.test(USER_AGENT);var IS_IOS=IS_IPHONE||IS_IPAD||IS_IPOD;var IOS_VERSION=function(){var match=USER_AGENT.match(/OS (\d+)_/i);if(match&&match[1]){return match[1]}return null}();var IS_ANDROID=/Android/i.test(USER_AGENT);var ANDROID_VERSION=function(){var match=USER_AGENT.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!match){return null}var major=match[1]&&parseFloat(match[1]);var minor=match[2]&&parseFloat(match[2]);if(major&&minor){return parseFloat(match[1]+"."+match[2])}else if(major){return major}return null}();var IS_NATIVE_ANDROID=IS_ANDROID&&ANDROID_VERSION<5&&appleWebkitVersion<537;var IS_FIREFOX=/Firefox/i.test(USER_AGENT);var IS_EDGE=/Edge/i.test(USER_AGENT);var IS_CHROME=!IS_EDGE&&(/Chrome/i.test(USER_AGENT)||/CriOS/i.test(USER_AGENT));var CHROME_VERSION=function(){var match=USER_AGENT.match(/(Chrome|CriOS)\/(\d+)/);if(match&&match[2]){return parseFloat(match[2])}return null}();var IE_VERSION=function(){var result=/MSIE\s(\d+)\.\d/.exec(USER_AGENT);var version=result&&parseFloat(result[1]);if(!version&&/Trident\/7.0/i.test(USER_AGENT)&&/rv:11.0/.test(USER_AGENT)){version=11}return version}();var IS_SAFARI=/Safari/i.test(USER_AGENT)&&!IS_CHROME&&!IS_ANDROID&&!IS_EDGE;var IS_ANY_SAFARI=(IS_SAFARI||IS_IOS)&&!IS_CHROME;var IS_WINDOWS=/Windows/i.test(USER_AGENT);var TOUCH_ENABLED=isReal()&&("ontouchstart"in window$1||window$1.navigator.maxTouchPoints||window$1.DocumentTouch&&window$1.document instanceof window$1.DocumentTouch);var browser=Object.freeze({IS_IPAD:IS_IPAD,IS_IPHONE:IS_IPHONE,IS_IPOD:IS_IPOD,IS_IOS:IS_IOS,IOS_VERSION:IOS_VERSION,IS_ANDROID:IS_ANDROID,ANDROID_VERSION:ANDROID_VERSION,IS_NATIVE_ANDROID:IS_NATIVE_ANDROID,IS_FIREFOX:IS_FIREFOX,IS_EDGE:IS_EDGE,IS_CHROME:IS_CHROME,CHROME_VERSION:CHROME_VERSION,IE_VERSION:IE_VERSION,IS_SAFARI:IS_SAFARI,IS_ANY_SAFARI:IS_ANY_SAFARI,IS_WINDOWS:IS_WINDOWS,TOUCH_ENABLED:TOUCH_ENABLED});function rangeCheck(fnName,index,maxIndex){if(typeof index!=="number"||index<0||index>maxIndex){throw new Error("Failed to execute '"+fnName+"' on 'TimeRanges': The index provided ("+index+") is non-numeric or out of bounds (0-"+maxIndex+").")}}function getRange(fnName,valueIndex,ranges,rangeIndex){rangeCheck(fnName,rangeIndex,ranges.length-1);return ranges[rangeIndex][valueIndex]}function createTimeRangesObj(ranges){if(ranges===undefined||ranges.length===0){return{length:0,start:function start(){throw new Error("This TimeRanges object is empty")},end:function end(){throw new Error("This TimeRanges object is empty")}}}return{length:ranges.length,start:getRange.bind(null,"start",0,ranges),end:getRange.bind(null,"end",1,ranges)}}function createTimeRanges(start,end){if(Array.isArray(start)){return createTimeRangesObj(start)}else if(start===undefined||end===undefined){return createTimeRangesObj()}return createTimeRangesObj([[start,end]])}function bufferedPercent(buffered,duration){var bufferedDuration=0;var start;var end;if(!duration){return 0}if(!buffered||!buffered.length){buffered=createTimeRanges(0,0)}for(var i=0;iduration){end=duration}bufferedDuration+=end-start}return bufferedDuration/duration}var FullscreenApi={prefixed:true};var apiMap=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror","-moz-full-screen"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError","-ms-fullscreen"]];var specApi=apiMap[0];var browserApi;for(var i=0;i=0;i--){if(tracks[i].enabled){disableOthers(tracks,tracks[i]);break}}_this=_TrackList.call(this,tracks)||this;_this.changing_=false;return _this}var _proto=AudioTrackList.prototype;_proto.addTrack=function addTrack(track){var _this2=this;if(track.enabled){disableOthers(this,track)}_TrackList.prototype.addTrack.call(this,track);if(!track.addEventListener){return}track.enabledChange_=function(){if(_this2.changing_){return}_this2.changing_=true;disableOthers(_this2,track);_this2.changing_=false;_this2.trigger("change")};track.addEventListener("enabledchange",track.enabledChange_)};_proto.removeTrack=function removeTrack(rtrack){_TrackList.prototype.removeTrack.call(this,rtrack);if(rtrack.removeEventListener&&rtrack.enabledChange_){rtrack.removeEventListener("enabledchange",rtrack.enabledChange_);rtrack.enabledChange_=null}};return AudioTrackList}(TrackList);var disableOthers$1=function disableOthers(list,track){for(var i=0;i=0;i--){if(tracks[i].selected){disableOthers$1(tracks,tracks[i]);break}}_this=_TrackList.call(this,tracks)||this;_this.changing_=false;Object.defineProperty(_assertThisInitialized(_this),"selectedIndex",{get:function get(){for(var _i=0;_i';a=div.firstChild;div.setAttribute("style","display:none; position:absolute;");document.body.appendChild(div)}var details={};for(var i=0;ix';url=div.firstChild.href}return url};var getFileExtension=function getFileExtension(path){if(typeof path==="string"){var splitPathRe=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/;var pathParts=splitPathRe.exec(path);if(pathParts){return pathParts.pop().toLowerCase()}}return""};var isCrossOrigin=function isCrossOrigin(url){var winLoc=window$1.location;var urlInfo=parseUrl(url);var srcProtocol=urlInfo.protocol===":"?winLoc.protocol:urlInfo.protocol;var crossOrigin=srcProtocol+urlInfo.host!==winLoc.protocol+winLoc.host;return crossOrigin};var Url=Object.freeze({parseUrl:parseUrl,getAbsoluteURL:getAbsoluteURL,getFileExtension:getFileExtension,isCrossOrigin:isCrossOrigin});var isFunction_1=isFunction;var toString$1=Object.prototype.toString;function isFunction(fn){var string=toString$1.call(fn);return string==="[object Function]"||typeof fn==="function"&&string!=="[object RegExp]"||typeof window!=="undefined"&&(fn===window.setTimeout||fn===window.alert||fn===window.confirm||fn===window.prompt)}var ERROR_MESSAGE="Function.prototype.bind called on incompatible ";var slice=Array.prototype.slice;var toStr=Object.prototype.toString;var funcType="[object Function]";var implementation=function bind(that){var target=this;if(typeof target!=="function"||toStr.call(target)!==funcType){throw new TypeError(ERROR_MESSAGE+target)}var args=slice.call(arguments,1);var bound;var binder=function binder(){if(this instanceof bound){var result=target.apply(this,args.concat(slice.call(arguments)));if(Object(result)===result){return result}return this}else{return target.apply(that,args.concat(slice.call(arguments)))}};var boundLength=Math.max(0,target.length-args.length);var boundArgs=[];for(var i=0;i=0&&toStr$1.call(value.callee)==="[object Function]"}return isArgs};var keysShim;if(!Object.keys){var has=Object.prototype.hasOwnProperty;var toStr$2=Object.prototype.toString;var isArgs=isArguments;var isEnumerable=Object.prototype.propertyIsEnumerable;var hasDontEnumBug=!isEnumerable.call({toString:null},"toString");var hasProtoEnumBug=isEnumerable.call(function(){},"prototype");var dontEnums=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"];var equalsConstructorPrototype=function equalsConstructorPrototype(o){var ctor=o.constructor;return ctor&&ctor.prototype===o};var excludedKeys={$applicationCache:true,$console:true,$external:true,$frame:true,$frameElement:true,$frames:true,$innerHeight:true,$innerWidth:true,$onmozfullscreenchange:true,$onmozfullscreenerror:true,$outerHeight:true,$outerWidth:true,$pageXOffset:true,$pageYOffset:true,$parent:true,$scrollLeft:true,$scrollTop:true,$scrollX:true,$scrollY:true,$self:true,$webkitIndexedDB:true,$webkitStorageInfo:true,$window:true};var hasAutomationEqualityBug=function(){if(typeof window==="undefined"){return false}for(var k in window){try{if(!excludedKeys["$"+k]&&has.call(window,k)&&window[k]!==null&&typeof window[k]==="object"){try{equalsConstructorPrototype(window[k])}catch(e){return true}}}catch(e){return true}}return false}();var equalsConstructorPrototypeIfNotBuggy=function equalsConstructorPrototypeIfNotBuggy(o){if(typeof window==="undefined"||!hasAutomationEqualityBug){return equalsConstructorPrototype(o)}try{return equalsConstructorPrototype(o)}catch(e){return false}};keysShim=function keys(object){var isObject=object!==null&&typeof object==="object";var isFunction=toStr$2.call(object)==="[object Function]";var isArguments=isArgs(object);var isString=isObject&&toStr$2.call(object)==="[object String]";var theKeys=[];if(!isObject&&!isFunction&&!isArguments){throw new TypeError("Object.keys called on a non-object")}var skipProto=hasProtoEnumBug&&isFunction;if(isString&&object.length>0&&!has.call(object,0)){for(var i=0;i0){for(var j=0;j2?arguments[2]:{};var props=objectKeys(map);if(hasSymbols){props=concat.call(props,Object.getOwnPropertySymbols(map))}for(var i=0;i1&&typeof allowMissing!=="boolean"){throw new TypeError('"allowMissing" argument must be a boolean')}var key="$ "+name;if(!(key in INTRINSICS)){throw new SyntaxError("intrinsic "+name+" does not exist!")}if(typeof INTRINSICS[key]==="undefined"&&!allowMissing){throw new TypeError("intrinsic "+name+" exists, but is not available. Please file an issue!")}return INTRINSICS[key]};var src=functionBind.call(Function.call,Object.prototype.hasOwnProperty);var $TypeError=GetIntrinsic("%TypeError%");var $SyntaxError=GetIntrinsic("%SyntaxError%");var predicates={"Property Descriptor":function isPropertyDescriptor(ES,Desc){if(ES.Type(Desc)!=="Object"){return false}var allowed={"[[Configurable]]":true,"[[Enumerable]]":true,"[[Get]]":true,"[[Set]]":true,"[[Value]]":true,"[[Writable]]":true};for(var key in Desc){if(src(Desc,key)&&!allowed[key]){return false}}var isData=src(Desc,"[[Value]]");var IsAccessor=src(Desc,"[[Get]]")||src(Desc,"[[Set]]");if(isData&&IsAccessor){throw new $TypeError("Property Descriptors may not be both accessor and data descriptors")}return true}};var assertRecord=function assertRecord(ES,recordType,argumentName,value){var predicate=predicates[recordType];if(typeof predicate!=="function"){throw new $SyntaxError("unknown record type: "+recordType)}if(!predicate(ES,value)){throw new $TypeError(argumentName+" must be a "+recordType)}console.log(predicate(ES,value),value)};var _isNaN=Number.isNaN||function isNaN(a){return a!==a};var $isNaN=Number.isNaN||function(a){return a!==a};var _isFinite=Number.isFinite||function(x){return typeof x==="number"&&!$isNaN(x)&&x!==Infinity&&x!==-Infinity};var sign=function sign(number){return number>=0?1:-1};var mod=function mod(number,modulo){var remain=number%modulo;return Math.floor(remain>=0?remain:remain+modulo)};var fnToStr=Function.prototype.toString;var constructorRegex=/^\s*class\b/;var isES6ClassFn=function isES6ClassFunction(value){try{var fnStr=fnToStr.call(value);return constructorRegex.test(fnStr)}catch(e){return false}};var tryFunctionObject=function tryFunctionToStr(value){try{if(isES6ClassFn(value)){return false}fnToStr.call(value);return true}catch(e){return false}};var toStr$4=Object.prototype.toString;var fnClass="[object Function]";var genClass="[object GeneratorFunction]";var hasToStringTag=typeof Symbol==="function"&&typeof Symbol.toStringTag==="symbol";var isCallable=function isCallable(value){if(!value){return false}if(typeof value!=="function"&&typeof value!=="object"){return false}if(typeof value==="function"&&!value.prototype){return true}if(hasToStringTag){return tryFunctionObject(value)}if(isES6ClassFn(value)){return false}var strClass=toStr$4.call(value);return strClass===fnClass||strClass===genClass};var isPrimitive=function isPrimitive(value){return value===null||typeof value!=="function"&&typeof value!=="object"};var toStr$5=Object.prototype.toString;var ES5internalSlots={"[[DefaultValue]]":function DefaultValue(O){var actualHint;if(arguments.length>1){actualHint=arguments[1]}else{actualHint=toStr$5.call(O)==="[object Date]"?String:Number}if(actualHint===String||actualHint===Number){var methods=actualHint===String?["toString","valueOf"]:["valueOf","toString"];var value,i;for(i=0;i1){return ES5internalSlots["[[DefaultValue]]"](input,arguments[1])}return ES5internalSlots["[[DefaultValue]]"](input)};var $Object=GetIntrinsic("%Object%");var $TypeError$1=GetIntrinsic("%TypeError%");var $String=GetIntrinsic("%String%");var ES5={ToPrimitive:es5,ToBoolean:function ToBoolean(value){return!!value},ToNumber:function ToNumber(value){return+value},ToInteger:function ToInteger(value){var number=this.ToNumber(value);if(_isNaN(number)){return 0}if(number===0||!_isFinite(number)){return number}return sign(number)*Math.floor(Math.abs(number))},ToInt32:function ToInt32(x){return this.ToNumber(x)>>0},ToUint32:function ToUint32(x){return this.ToNumber(x)>>>0},ToUint16:function ToUint16(value){var number=this.ToNumber(value);if(_isNaN(number)||number===0||!_isFinite(number)){return 0}var posInt=sign(number)*Math.floor(Math.abs(number));return mod(posInt,65536)},ToString:function ToString(value){return $String(value)},ToObject:function ToObject(value){this.CheckObjectCoercible(value);return $Object(value)},CheckObjectCoercible:function CheckObjectCoercible(value,optMessage){if(value==null){throw new $TypeError$1(optMessage||"Cannot call method on "+value)}return value},IsCallable:isCallable,SameValue:function SameValue(x,y){if(x===y){if(x===0){return 1/x===1/y}return true}return _isNaN(x)&&_isNaN(y)},Type:function Type(x){if(x===null){return"Null"}if(typeof x==="undefined"){return"Undefined"}if(typeof x==="function"||typeof x==="object"){return"Object"}if(typeof x==="number"){return"Number"}if(typeof x==="boolean"){return"Boolean"}if(typeof x==="string"){return"String"}},IsPropertyDescriptor:function IsPropertyDescriptor(Desc){if(this.Type(Desc)!=="Object"){return false}var allowed={"[[Configurable]]":true,"[[Enumerable]]":true,"[[Get]]":true,"[[Set]]":true,"[[Value]]":true,"[[Writable]]":true};for(var key in Desc){if(src(Desc,key)&&!allowed[key]){return false}}var isData=src(Desc,"[[Value]]");var IsAccessor=src(Desc,"[[Get]]")||src(Desc,"[[Set]]");if(isData&&IsAccessor){throw new $TypeError$1("Property Descriptors may not be both accessor and data descriptors")}return true},IsAccessorDescriptor:function IsAccessorDescriptor(Desc){if(typeof Desc==="undefined"){return false}assertRecord(this,"Property Descriptor","Desc",Desc);if(!src(Desc,"[[Get]]")&&!src(Desc,"[[Set]]")){return false}return true},IsDataDescriptor:function IsDataDescriptor(Desc){if(typeof Desc==="undefined"){return false}assertRecord(this,"Property Descriptor","Desc",Desc);if(!src(Desc,"[[Value]]")&&!src(Desc,"[[Writable]]")){return false}return true},IsGenericDescriptor:function IsGenericDescriptor(Desc){if(typeof Desc==="undefined"){return false}assertRecord(this,"Property Descriptor","Desc",Desc);if(!this.IsAccessorDescriptor(Desc)&&!this.IsDataDescriptor(Desc)){return true}return false},FromPropertyDescriptor:function FromPropertyDescriptor(Desc){if(typeof Desc==="undefined"){return Desc}assertRecord(this,"Property Descriptor","Desc",Desc);if(this.IsDataDescriptor(Desc)){return{value:Desc["[[Value]]"],writable:!!Desc["[[Writable]]"],enumerable:!!Desc["[[Enumerable]]"],configurable:!!Desc["[[Configurable]]"]}}else if(this.IsAccessorDescriptor(Desc)){return{get:Desc["[[Get]]"],set:Desc["[[Set]]"],enumerable:!!Desc["[[Enumerable]]"],configurable:!!Desc["[[Configurable]]"]}}else{throw new $TypeError$1("FromPropertyDescriptor must be called with a fully populated Property Descriptor")}},ToPropertyDescriptor:function ToPropertyDescriptor(Obj){if(this.Type(Obj)!=="Object"){throw new $TypeError$1("ToPropertyDescriptor requires an object")}var desc={};if(src(Obj,"enumerable")){desc["[[Enumerable]]"]=this.ToBoolean(Obj.enumerable)}if(src(Obj,"configurable")){desc["[[Configurable]]"]=this.ToBoolean(Obj.configurable)}if(src(Obj,"value")){desc["[[Value]]"]=Obj.value}if(src(Obj,"writable")){desc["[[Writable]]"]=this.ToBoolean(Obj.writable)}if(src(Obj,"get")){var getter=Obj.get;if(typeof getter!=="undefined"&&!this.IsCallable(getter)){throw new TypeError("getter must be a function")}desc["[[Get]]"]=getter}if(src(Obj,"set")){var setter=Obj.set;if(typeof setter!=="undefined"&&!this.IsCallable(setter)){throw new $TypeError$1("setter must be a function")}desc["[[Set]]"]=setter}if((src(desc,"[[Get]]")||src(desc,"[[Set]]"))&&(src(desc,"[[Value]]")||src(desc,"[[Writable]]"))){throw new $TypeError$1("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute")}return desc}};var es5$1=ES5;var replace=functionBind.call(Function.call,String.prototype.replace);var leftWhitespace=/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/;var rightWhitespace=/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;var implementation$2=function trim(){var S=es5$1.ToString(es5$1.CheckObjectCoercible(this));return replace(replace(S,leftWhitespace,""),rightWhitespace,"")};var zeroWidthSpace="​";var polyfill=function getPolyfill(){if(String.prototype.trim&&zeroWidthSpace.trim()===zeroWidthSpace){return String.prototype.trim}return implementation$2};var shim=function shimStringTrim(){var polyfill$1=polyfill();defineProperties_1(String.prototype,{trim:polyfill$1},{trim:function testTrim(){return String.prototype.trim!==polyfill$1}});return polyfill$1};var boundTrim=functionBind.call(Function.call,polyfill());defineProperties_1(boundTrim,{getPolyfill:polyfill,implementation:implementation$2,shim:shim});var string_prototype_trim=boundTrim;var toStr$6=Object.prototype.toString;var hasOwnProperty=Object.prototype.hasOwnProperty;var forEachArray=function forEachArray(array,iterator,receiver){for(var i=0,len=array.length;i=3){receiver=thisArg}if(toStr$6.call(list)==="[object Array]"){forEachArray(list,iterator,receiver)}else if(typeof list==="string"){forEachString(list,iterator,receiver)}else{forEachObject(list,iterator,receiver)}};var forEach_1=forEach;var isArray=function isArray(arg){return Object.prototype.toString.call(arg)==="[object Array]"};var parseHeaders=function parseHeaders(headers){if(!headers)return{};var result={};forEach_1(string_prototype_trim(headers).split("\n"),function(row){var index=row.indexOf(":"),key=string_prototype_trim(row.slice(0,index)).toLowerCase(),value=string_prototype_trim(row.slice(index+1));if(typeof result[key]==="undefined"){result[key]=value}else if(isArray(result[key])){result[key].push(value)}else{result[key]=[result[key],value]}});return result};var immutable=extend;var hasOwnProperty$1=Object.prototype.hasOwnProperty;function extend(){var target={};for(var i=0;i0){timeoutTimer=setTimeout(function(){if(aborted)return;aborted=true;xhr.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT";errorFunc(e)},options.timeout)}if(xhr.setRequestHeader){for(key in headers){if(headers.hasOwnProperty(key)){xhr.setRequestHeader(key,headers[key])}}}else if(options.headers&&!isEmpty(options.headers)){throw new Error("Headers cannot be set on an XDomainRequest object")}if("responseType"in options){xhr.responseType=options.responseType}if("beforeSend"in options&&typeof options.beforeSend==="function"){options.beforeSend(xhr)}xhr.send(body||null);return xhr}function getXml(xhr){if(xhr.responseType==="document"){return xhr.responseXML}var firefoxBugTakenEffect=xhr.responseXML&&xhr.responseXML.documentElement.nodeName==="parsererror";if(xhr.responseType===""&&!firefoxBugTakenEffect){return xhr.responseXML}return null}function noop(){}var parseCues=function parseCues(srcContent,track){var parser=new window$1.WebVTT.Parser(window$1,window$1.vttjs,window$1.WebVTT.StringDecoder());var errors=[];parser.oncue=function(cue){track.addCue(cue)};parser.onparsingerror=function(error){errors.push(error)};parser.onflush=function(){track.trigger({type:"loadeddata",target:track})};parser.parse(srcContent);if(errors.length>0){if(window$1.console&&window$1.console.groupCollapsed){window$1.console.groupCollapsed("Text Track parsing errors for "+track.src)}errors.forEach(function(error){return log.error(error)});if(window$1.console&&window$1.console.groupEnd){window$1.console.groupEnd()}}parser.flush()};var loadTrack=function loadTrack(src,track){var opts={uri:src};var crossOrigin=isCrossOrigin(src);if(crossOrigin){opts.cors=crossOrigin}xhr(opts,bind(this,function(err,response,responseBody){if(err){return log.error(err,response)}track.loaded_=true;if(typeof window$1.WebVTT!=="function"){if(track.tech_){track.tech_.any(["vttjsloaded","vttjserror"],function(event){if(event.type==="vttjserror"){log.error("vttjs failed to load, stopping trying to process "+track.src);return}return parseCues(responseBody,track)})}}else{parseCues(responseBody,track)}}))};var TextTrack=function(_Track){_inheritsLoose(TextTrack,_Track);function TextTrack(options){var _this;if(options===void 0){options={}}if(!options.tech){throw new Error("A tech was not provided.")}var settings=mergeOptions(options,{kind:TextTrackKind[options.kind]||"subtitles",language:options.language||options.srclang||""});var mode=TextTrackMode[settings.mode]||"disabled";var default_=settings["default"];if(settings.kind==="metadata"||settings.kind==="chapters"){mode="hidden"}_this=_Track.call(this,settings)||this;_this.tech_=settings.tech;_this.cues_=[];_this.activeCues_=[];var cues=new TextTrackCueList(_this.cues_);var activeCues=new TextTrackCueList(_this.activeCues_);var changed=false;var timeupdateHandler=bind(_assertThisInitialized(_this),function(){this.activeCues=this.activeCues;if(changed){this.trigger("cuechange");changed=false}});if(mode!=="disabled"){_this.tech_.ready(function(){_this.tech_.on("timeupdate",timeupdateHandler)},true)}Object.defineProperties(_assertThisInitialized(_this),{default:{get:function get(){return default_},set:function set(){}},mode:{get:function get(){return mode},set:function set(newMode){var _this2=this;if(!TextTrackMode[newMode]){return}mode=newMode;if(mode!=="disabled"){this.tech_.ready(function(){_this2.tech_.on("timeupdate",timeupdateHandler)},true)}else{this.tech_.off("timeupdate",timeupdateHandler)}this.trigger("modechange")}},cues:{get:function get(){if(!this.loaded_){return null}return cues},set:function set(){}},activeCues:{get:function get(){if(!this.loaded_){return null}if(this.cues.length===0){return activeCues}var ct=this.tech_.currentTime();var active=[];for(var i=0,l=this.cues.length;i=ct){active.push(cue)}else if(cue.startTime===cue.endTime&&cue.startTime<=ct&&cue.startTime+.5>=ct){active.push(cue)}}changed=false;if(active.length!==this.activeCues_.length){changed=true}else{for(var _i=0;_i59){return computeSeconds(m[1],m[2],0,m[4])}else{return computeSeconds(0,m[1],m[2],m[4])}}function Settings(){this.values=_objCreate(null)}Settings.prototype={set:function set(k,v){if(!this.get(k)&&v!==""){this.values[k]=v}},get:function get(k,dflt,defaultKey){if(defaultKey){return this.has(k)?this.values[k]:dflt[defaultKey]}return this.has(k)?this.values[k]:dflt},has:function has(k){return k in this.values},alt:function alt(k,v,a){for(var n=0;n=0&&v<=100){this.set(k,v);return true}}return false}};function parseOptions(input,callback,keyValueDelim,groupDelim){var groups=groupDelim?input.split(groupDelim):[input];for(var i in groups){if(typeof groups[i]!=="string"){continue}var kv=groups[i].split(keyValueDelim);if(kv.length!==2){continue}var k=kv[0];var v=kv[1];callback(k,v)}}function parseCue(input,cue,regionList){var oInput=input;function consumeTimeStamp(){var ts=parseTimeStamp(input);if(ts===null){throw new ParsingError(ParsingError.Errors.BadTimeStamp,"Malformed timestamp: "+oInput)}input=input.replace(/^[^\sa-zA-Z-]+/,"");return ts}function consumeCueSettings(input,cue){var settings=new Settings;parseOptions(input,function(k,v){switch(k){case"region":for(var i=regionList.length-1;i>=0;i--){if(regionList[i].id===v){settings.set(k,regionList[i].region);break}}break;case"vertical":settings.alt(k,v,["rl","lr"]);break;case"line":var vals=v.split(","),vals0=vals[0];settings.integer(k,vals0);settings.percent(k,vals0)?settings.set("snapToLines",false):null;settings.alt(k,vals0,["auto"]);if(vals.length===2){settings.alt("lineAlign",vals[1],["start","middle","end"])}break;case"position":vals=v.split(",");settings.percent(k,vals[0]);if(vals.length===2){settings.alt("positionAlign",vals[1],["start","middle","end"])}break;case"size":settings.percent(k,v);break;case"align":settings.alt(k,v,["start","middle","end","left","right"]);break}},/:/,/\s/);cue.region=settings.get("region",null);cue.vertical=settings.get("vertical","");cue.line=settings.get("line","auto");cue.lineAlign=settings.get("lineAlign","start");cue.snapToLines=settings.get("snapToLines",true);cue.size=settings.get("size",100);cue.align=settings.get("align","middle");cue.position=settings.get("position",{start:0,left:0,middle:50,end:100,right:100},cue.align);cue.positionAlign=settings.get("positionAlign",{start:"start",left:"start",middle:"middle",end:"end",right:"end"},cue.align)}function skipWhitespace(){input=input.replace(/^\s+/,"")}skipWhitespace();cue.startTime=consumeTimeStamp();skipWhitespace();if(input.substr(0,3)!=="--\x3e"){throw new ParsingError(ParsingError.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+oInput)}input=input.substr(3);skipWhitespace();cue.endTime=consumeTimeStamp();skipWhitespace();consumeCueSettings(input,cue)}var ESCAPE={"&":"&","<":"<",">":">","‎":"‎","‏":"‏"," ":" "};var TAG_NAME={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"};var TAG_ANNOTATION={v:"title",lang:"lang"};var NEEDS_PARENT={rt:"ruby"};function parseContent(window,input){function nextToken(){if(!input){return null}function consume(result){input=input.substr(result.length);return result}var m=input.match(/^([^<]*)(<[^>]*>?)?/);return consume(m[1]?m[1]:m[2])}function unescape1(e){return ESCAPE[e]}function unescape(s){while(m=s.match(/&(amp|lt|gt|lrm|rlm|nbsp);/)){s=s.replace(m[0],unescape1)}return s}function shouldAdd(current,element){return!NEEDS_PARENT[element.localName]||NEEDS_PARENT[element.localName]===current.localName}function createElement(type,annotation){var tagName=TAG_NAME[type];if(!tagName){return null}var element=window.document.createElement(tagName);element.localName=tagName;var name=TAG_ANNOTATION[type];if(name&&annotation){element[name]=annotation.trim()}return element}var rootDiv=window.document.createElement("div"),current=rootDiv,t,tagStack=[];while((t=nextToken())!==null){if(t[0]==="<"){if(t[1]==="/"){if(tagStack.length&&tagStack[tagStack.length-1]===t.substr(2).replace(">","")){tagStack.pop();current=current.parentNode}continue}var ts=parseTimeStamp(t.substr(1,t.length-2));var node;if(ts){node=window.document.createProcessingInstruction("timestamp",ts);current.appendChild(node);continue}var m=t.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!m){continue}node=createElement(m[1],m[3]);if(!node){continue}if(!shouldAdd(current,node)){continue}if(m[2]){node.className=m[2].substr(1).replace("."," ")}tagStack.push(m[1]);current.appendChild(node);current=node;continue}current.appendChild(window.document.createTextNode(unescape(t)))}return rootDiv}var strongRTLRanges=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function isStrongRTLChar(charCode){for(var i=0;i=currentRange[0]&&charCode<=currentRange[1]){return true}}return false}function determineBidi(cueDiv){var nodeStack=[],text="",charCode;if(!cueDiv||!cueDiv.childNodes){return"ltr"}function pushNodes(nodeStack,node){for(var i=node.childNodes.length-1;i>=0;i--){nodeStack.push(node.childNodes[i])}}function nextTextNode(nodeStack){if(!nodeStack||!nodeStack.length){return null}var node=nodeStack.pop(),text=node.textContent||node.innerText;if(text){var m=text.match(/^.*(\n|\r)/);if(m){nodeStack.length=0;return m[0]}return text}if(node.tagName==="ruby"){return nextTextNode(nodeStack)}if(node.childNodes){pushNodes(nodeStack,node);return nextTextNode(nodeStack)}}pushNodes(nodeStack,cueDiv);while(text=nextTextNode(nodeStack)){for(var i=0;i=0&&cue.line<=100)){return cue.line}if(!cue.track||!cue.track.textTrackList||!cue.track.textTrackList.mediaElement){return-1}var track=cue.track,trackList=track.textTrackList,count=0;for(var i=0;ib2.left&&this.topb2.top};BoxPosition.prototype.overlapsAny=function(boxes){for(var i=0;i=container.top&&this.bottom<=container.bottom&&this.left>=container.left&&this.right<=container.right};BoxPosition.prototype.overlapsOppositeAxis=function(container,axis){switch(axis){case"+x":return this.leftcontainer.right;case"+y":return this.topcontainer.bottom}};BoxPosition.prototype.intersectPercentage=function(b2){var x=Math.max(0,Math.min(this.right,b2.right)-Math.max(this.left,b2.left)),y=Math.max(0,Math.min(this.bottom,b2.bottom)-Math.max(this.top,b2.top)),intersectArea=x*y;return intersectArea/(this.height*this.width)};BoxPosition.prototype.toCSSCompatValues=function(reference){return{top:this.top-reference.top,bottom:reference.bottom-this.bottom,left:this.left-reference.left,right:reference.right-this.right,height:this.height,width:this.width}};BoxPosition.getSimpleBoxPosition=function(obj){var height=obj.div?obj.div.offsetHeight:obj.tagName?obj.offsetHeight:0;var width=obj.div?obj.div.offsetWidth:obj.tagName?obj.offsetWidth:0;var top=obj.div?obj.div.offsetTop:obj.tagName?obj.offsetTop:0;obj=obj.div?obj.div.getBoundingClientRect():obj.tagName?obj.getBoundingClientRect():obj;var ret={left:obj.left,right:obj.right,top:obj.top||top,height:obj.height||height,bottom:obj.bottom||top+(obj.height||height),width:obj.width||width};return ret};function moveBoxToLinePosition(window,styleBox,containerBox,boxPositions){function findBestPosition(b,axis){var bestPosition,specifiedPosition=new BoxPosition(b),percentage=1;for(var i=0;ip){bestPosition=new BoxPosition(b);percentage=p}b=new BoxPosition(specifiedPosition)}return bestPosition||specifiedPosition}var boxPosition=new BoxPosition(styleBox),cue=styleBox.cue,linePos=computeLinePos(cue),axis=[];if(cue.snapToLines){var size;switch(cue.vertical){case"":axis=["+y","-y"];size="height";break;case"rl":axis=["+x","-x"];size="width";break;case"lr":axis=["-x","+x"];size="width";break}var step=boxPosition.lineHeight,position=step*Math.round(linePos),maxPosition=containerBox[size]+step,initialAxis=axis[0];if(Math.abs(position)>maxPosition){position=position<0?-1:1;position*=Math.ceil(maxPosition/step)*step}if(linePos<0){position+=cue.vertical===""?containerBox.height:containerBox.width;axis=axis.reverse()}boxPosition.move(initialAxis,position)}else{var calculatedPercentage=boxPosition.lineHeight/containerBox.height*100;switch(cue.lineAlign){case"middle":linePos-=calculatedPercentage/2;break;case"end":linePos-=calculatedPercentage;break}switch(cue.vertical){case"":styleBox.applyStyles({top:styleBox.formatStyle(linePos,"%")});break;case"rl":styleBox.applyStyles({left:styleBox.formatStyle(linePos,"%")});break;case"lr":styleBox.applyStyles({right:styleBox.formatStyle(linePos,"%")});break}axis=["+y","-x","+x","-y"];boxPosition=new BoxPosition(styleBox)}var bestPosition=findBestPosition(boxPosition,axis);styleBox.move(bestPosition.toCSSCompatValues(containerBox))}function WebVTT$1(){}WebVTT$1.StringDecoder=function(){return{decode:function decode(data){if(!data){return""}if(typeof data!=="string"){throw new Error("Error - expected string data.")}return decodeURIComponent(encodeURIComponent(data))}}};WebVTT$1.convertCueToDOMTree=function(window,cuetext){if(!window||!cuetext){return null}return parseContent(window,cuetext)};var FONT_SIZE_PERCENT=.05;var FONT_STYLE="sans-serif";var CUE_BACKGROUND_PADDING="1.5%";WebVTT$1.processCues=function(window,cues,overlay){if(!window||!cues||!overlay){return null}while(overlay.firstChild){overlay.removeChild(overlay.firstChild)}var paddedOverlay=window.document.createElement("div");paddedOverlay.style.position="absolute";paddedOverlay.style.left="0";paddedOverlay.style.right="0";paddedOverlay.style.top="0";paddedOverlay.style.bottom="0";paddedOverlay.style.margin=CUE_BACKGROUND_PADDING;overlay.appendChild(paddedOverlay);function shouldCompute(cues){for(var i=0;i100){throw new Error("Position must be between 0 and 100.")}_position=value;this.hasBeenReset=true}},positionAlign:{enumerable:true,get:function get(){return _positionAlign},set:function set(value){var setting=findAlignSetting(value);if(!setting){throw new SyntaxError("An invalid or illegal string was specified.")}_positionAlign=setting;this.hasBeenReset=true}},size:{enumerable:true,get:function get(){return _size},set:function set(value){if(value<0||value>100){throw new Error("Size must be between 0 and 100.")}_size=value;this.hasBeenReset=true}},align:{enumerable:true,get:function get(){return _align},set:function set(value){var setting=findAlignSetting(value);if(!setting){throw new SyntaxError("An invalid or illegal string was specified.")}_align=setting;this.hasBeenReset=true}}});this.displayState=undefined}VTTCue.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)};var vttcue=VTTCue;var scrollSetting={"":true,up:true};function findScrollSetting(value){if(typeof value!=="string"){return false}var scroll=scrollSetting[value.toLowerCase()];return scroll?value.toLowerCase():false}function isValidPercentValue(value){return typeof value==="number"&&value>=0&&value<=100}function VTTRegion(){var _width=100;var _lines=3;var _regionAnchorX=0;var _regionAnchorY=100;var _viewportAnchorX=0;var _viewportAnchorY=100;var _scroll="";Object.defineProperties(this,{width:{enumerable:true,get:function get(){return _width},set:function set(value){if(!isValidPercentValue(value)){throw new Error("Width must be between 0 and 100.")}_width=value}},lines:{enumerable:true,get:function get(){return _lines},set:function set(value){if(typeof value!=="number"){throw new TypeError("Lines must be set to a number.")}_lines=value}},regionAnchorY:{enumerable:true,get:function get(){return _regionAnchorY},set:function set(value){if(!isValidPercentValue(value)){throw new Error("RegionAnchorX must be between 0 and 100.")}_regionAnchorY=value}},regionAnchorX:{enumerable:true,get:function get(){return _regionAnchorX},set:function set(value){if(!isValidPercentValue(value)){throw new Error("RegionAnchorY must be between 0 and 100.")}_regionAnchorX=value}},viewportAnchorY:{enumerable:true,get:function get(){return _viewportAnchorY},set:function set(value){if(!isValidPercentValue(value)){throw new Error("ViewportAnchorY must be between 0 and 100.")}_viewportAnchorY=value}},viewportAnchorX:{enumerable:true,get:function get(){return _viewportAnchorX},set:function set(value){if(!isValidPercentValue(value)){throw new Error("ViewportAnchorX must be between 0 and 100.")}_viewportAnchorX=value}},scroll:{enumerable:true,get:function get(){return _scroll},set:function set(value){var setting=findScrollSetting(value);if(setting===false){throw new SyntaxError("An invalid or illegal string was specified.")}_scroll=setting}}})}var vttregion=VTTRegion;var browserIndex=createCommonjsModule(function(module){var vttjs=module.exports={WebVTT:vtt,VTTCue:vttcue,VTTRegion:vttregion};window$1.vttjs=vttjs;window$1.WebVTT=vttjs.WebVTT;var cueShim=vttjs.VTTCue;var regionShim=vttjs.VTTRegion;var nativeVTTCue=window$1.VTTCue;var nativeVTTRegion=window$1.VTTRegion;vttjs.shim=function(){window$1.VTTCue=cueShim;window$1.VTTRegion=regionShim};vttjs.restore=function(){window$1.VTTCue=nativeVTTCue;window$1.VTTRegion=nativeVTTRegion};if(!window$1.VTTCue){vttjs.shim()}});var browserIndex_1=browserIndex.WebVTT;var browserIndex_2=browserIndex.VTTCue;var browserIndex_3=browserIndex.VTTRegion;function createTrackHelper(self,kind,label,language,options){if(options===void 0){options={}}var tracks=self.textTracks();options.kind=kind;if(label){options.label=label}if(language){options.language=language}options.tech=self;var track=new ALL.text.TrackClass(options);tracks.addTrack(track);return track}var Tech=function(_Component){_inheritsLoose(Tech,_Component);function Tech(options,ready){var _this;if(options===void 0){options={}}if(ready===void 0){ready=function ready(){}}options.reportTouchActivity=false;_this=_Component.call(this,null,options,ready)||this;_this.hasStarted_=false;_this.on("playing",function(){this.hasStarted_=true});_this.on("loadstart",function(){this.hasStarted_=false});ALL.names.forEach(function(name){var props=ALL[name];if(options&&options[props.getterName]){_this[props.privateName]=options[props.getterName]}});if(!_this.featuresProgressEvents){_this.manualProgressOn()}if(!_this.featuresTimeupdateEvents){_this.manualTimeUpdatesOn()}["Text","Audio","Video"].forEach(function(track){if(options["native"+track+"Tracks"]===false){_this["featuresNative"+track+"Tracks"]=false}});if(options.nativeCaptions===false||options.nativeTextTracks===false){_this.featuresNativeTextTracks=false}else if(options.nativeCaptions===true||options.nativeTextTracks===true){_this.featuresNativeTextTracks=true}if(!_this.featuresNativeTextTracks){_this.emulateTextTracks()}_this.autoRemoteTextTracks_=new ALL.text.ListClass;_this.initTrackListeners();if(!options.nativeControlsForTouch){_this.emitTapEvents()}if(_this.constructor){_this.name_=_this.constructor.name||"Unknown Tech"}return _this}var _proto=Tech.prototype;_proto.triggerSourceset=function triggerSourceset(src){var _this2=this;if(!this.isReady_){this.one("ready",function(){return _this2.setTimeout(function(){return _this2.triggerSourceset(src)},1)})}this.trigger({src:src,type:"sourceset"})};_proto.manualProgressOn=function manualProgressOn(){this.on("durationchange",this.onDurationChange);this.manualProgress=true;this.one("ready",this.trackProgress)};_proto.manualProgressOff=function manualProgressOff(){this.manualProgress=false;this.stopTrackingProgress();this.off("durationchange",this.onDurationChange)};_proto.trackProgress=function trackProgress(event){this.stopTrackingProgress();this.progressInterval=this.setInterval(bind(this,function(){var numBufferedPercent=this.bufferedPercent();if(this.bufferedPercent_!==numBufferedPercent){this.trigger("progress")}this.bufferedPercent_=numBufferedPercent;if(numBufferedPercent===1){this.stopTrackingProgress()}}),500)};_proto.onDurationChange=function onDurationChange(event){this.duration_=this.duration()};_proto.buffered=function buffered(){return createTimeRanges(0,0)};_proto.bufferedPercent=function bufferedPercent$1(){return bufferedPercent(this.buffered(),this.duration_)};_proto.stopTrackingProgress=function stopTrackingProgress(){this.clearInterval(this.progressInterval)};_proto.manualTimeUpdatesOn=function manualTimeUpdatesOn(){this.manualTimeUpdates=true;this.on("play",this.trackCurrentTime);this.on("pause",this.stopTrackingCurrentTime)};_proto.manualTimeUpdatesOff=function manualTimeUpdatesOff(){this.manualTimeUpdates=false;this.stopTrackingCurrentTime();this.off("play",this.trackCurrentTime);this.off("pause",this.stopTrackingCurrentTime)};_proto.trackCurrentTime=function trackCurrentTime(){if(this.currentTimeInterval){this.stopTrackingCurrentTime()}this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:true})},250)};_proto.stopTrackingCurrentTime=function stopTrackingCurrentTime(){this.clearInterval(this.currentTimeInterval);this.trigger({type:"timeupdate",target:this,manuallyTriggered:true})};_proto.dispose=function dispose(){this.clearTracks(NORMAL.names);if(this.manualProgress){this.manualProgressOff()}if(this.manualTimeUpdates){this.manualTimeUpdatesOff()}_Component.prototype.dispose.call(this)};_proto.clearTracks=function clearTracks(types){var _this3=this;types=[].concat(types);types.forEach(function(type){var list=_this3[type+"Tracks"]()||[];var i=list.length;while(i--){var track=list[i];if(type==="text"){_this3.removeRemoteTextTrack(track)}list.removeTrack(track)}})};_proto.cleanupAutoTextTracks=function cleanupAutoTextTracks(){var list=this.autoRemoteTextTracks_||[];var i=list.length;while(i--){var track=list[i];this.removeRemoteTextTrack(track)}};_proto.reset=function reset(){};_proto.error=function error(err){if(err!==undefined){this.error_=new MediaError(err);this.trigger("error")}return this.error_};_proto.played=function played(){if(this.hasStarted_){return createTimeRanges(0,0)}return createTimeRanges()};_proto.setCurrentTime=function setCurrentTime(){if(this.manualTimeUpdates){this.trigger({type:"timeupdate",target:this,manuallyTriggered:true})}};_proto.initTrackListeners=function initTrackListeners(){var _this4=this;NORMAL.names.forEach(function(name){var props=NORMAL[name];var trackListChanges=function trackListChanges(){_this4.trigger(name+"trackchange")};var tracks=_this4[props.getterName]();tracks.addEventListener("removetrack",trackListChanges);tracks.addEventListener("addtrack",trackListChanges);_this4.on("dispose",function(){tracks.removeEventListener("removetrack",trackListChanges);tracks.removeEventListener("addtrack",trackListChanges)})})};_proto.addWebVttScript_=function addWebVttScript_(){var _this5=this;if(window$1.WebVTT){return}if(document.body.contains(this.el())){if(!this.options_["vtt.js"]&&isPlain(browserIndex)&&Object.keys(browserIndex).length>0){this.trigger("vttjsloaded");return}var script=document.createElement("script");script.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js";script.onload=function(){_this5.trigger("vttjsloaded")};script.onerror=function(){_this5.trigger("vttjserror")};this.on("dispose",function(){script.onload=null;script.onerror=null});window$1.WebVTT=true;this.el().parentNode.appendChild(script)}else{this.ready(this.addWebVttScript_)}};_proto.emulateTextTracks=function emulateTextTracks(){var _this6=this;var tracks=this.textTracks();var remoteTracks=this.remoteTextTracks();var handleAddTrack=function handleAddTrack(e){return tracks.addTrack(e.track)};var handleRemoveTrack=function handleRemoveTrack(e){return tracks.removeTrack(e.track)};remoteTracks.on("addtrack",handleAddTrack);remoteTracks.on("removetrack",handleRemoveTrack);this.addWebVttScript_();var updateDisplay=function updateDisplay(){return _this6.trigger("texttrackchange")};var textTracksChanges=function textTracksChanges(){updateDisplay();for(var i=0;i=0;i--){var mw=mws[i];if(mw[method]){mw[method](terminated,value)}}}function clearCacheForPlayer(player){middlewareInstances[player.id()]=null}function getOrCreateFactory(player,mwFactory){var mws=middlewareInstances[player.id()];var mw=null;if(mws===undefined||mws===null){mw=mwFactory(player);middlewareInstances[player.id()]=[[mwFactory,mw]];return mw}for(var i=0;i