!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.videojs=e()}(this,function(){function t(t,e){return t(e={exports:{}},e.exports),e.exports}function e(t){return t.replace(/\n\r?\s*/g,"")}function A(t,e){Ae(t).forEach(function(A){return e(t[A],A)})}function i(t){for(var e=arguments.length,i=Array(e>1?e-1:0),n=1;n0&&void 0!==arguments[0]?arguments[0]:"div",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments[3],n=Ht.createElement(t);return Object.getOwnPropertyNames(e).forEach(function(t){var A=e[t];-1!==t.indexOf("aria-")||"role"===t||"type"===t?(Vt.warn(Wt(ie,t,A)),n.setAttribute(t,A)):"textContent"===t?l(n,A):n[t]=A}),Object.getOwnPropertyNames(A).forEach(function(t){n.setAttribute(t,A[t])}),i&&v(n,i),n}function l(t,e){return void 0===t.textContent?t.innerText=e:t.textContent=e,t}function h(t,e){e.firstChild?e.insertBefore(t,e.firstChild):e.appendChild(t)}function d(t,e){return s(e),t.classList?t.classList.contains(e):function(t){return new RegExp("(^|\\s)"+t+"($|\\s)")}(e).test(t.className)}function T(t,e){return t.classList?t.classList.add(e):d(t,e)||(t.className=(t.className+" "+e).trim()),t}function E(t,e){return t.classList?t.classList.remove(e):(s(e),t.className=t.className.split(/\s+/).filter(function(t){return t!==e}).join(" ")),t}function N(t,e,A){var i=d(t,e);if("function"==typeof A&&(A=A(t,e)),"boolean"!=typeof A&&(A=!i),A!==i)return A?T(t,e):E(t,e),t}function f(t,e){Object.getOwnPropertyNames(e).forEach(function(A){var i=e[A];null===i||void 0===i||!1===i?t.removeAttribute(A):t.setAttribute(A,!0===i?"":i)})}function C(t){var e={};if(t&&t.attributes&&t.attributes.length>0)for(var A=t.attributes,i=A.length-1;i>=0;i--){var n=A[i].name,r=A[i].value;"boolean"!=typeof t[n]&&-1===",autoplay,stretch,fluent,controls,playsinline,loop,muted,default,defaultMuted,".indexOf(","+n+",")||(r=null!==r),e[n]=r}return e}function y(t,e){return t.getAttribute(e)}function D(t,e,A){t.setAttribute(e,A)}function B(t,e){t.removeAttribute(e)}function p(){Ht.body.focus(),Ht.onselectstart=function(){return!1}}function m(){Ht.onselectstart=function(){return!0}}function w(t){if(t&&t.getBoundingClientRect&&t.parentNode){var e=t.getBoundingClientRect(),A={};return["bottom","height","left","right","top","width"].forEach(function(t){void 0!==e[t]&&(A[t]=e[t])}),A.height||(A.height=parseFloat(a(t,"height"))),A.width||(A.width=parseFloat(a(t,"width"))),A}}function Q(t){var e=void 0;if(t.getBoundingClientRect&&t.parentNode&&(e=t.getBoundingClientRect()),!e)return{left:0,top:0};var A=Ht.documentElement,i=Ht.body,n=A.clientLeft||i.clientLeft||0,r=zt.pageXOffset||i.scrollLeft,a=e.left+r-n,o=A.clientTop||i.clientTop||0,s=zt.pageYOffset||i.scrollTop,g=e.top+s-o;return{left:Math.round(a),top:Math.round(g)}}function L(t,e){var A={},i=Q(t),n=t.offsetWidth,r=t.offsetHeight,a=i.top,o=i.left,s=e.pageY,g=e.pageX;return e.changedTouches&&(g=e.changedTouches[0].pageX,s=e.changedTouches[0].pageY),A.y=Math.max(0,Math.min(1,(a-s+r)/r)),A.x=Math.max(0,Math.min(1,(g-o)/n)),A}function j(t){return n(t)&&3===t.nodeType}function S(t){for(;t.firstChild;)t.removeChild(t.firstChild);return t}function x(t){return"function"==typeof t&&(t=t()),(Array.isArray(t)?t:[t]).map(function(t){return"function"==typeof t&&(t=t()),M(t)||j(t)?t:"string"==typeof t&&/\S/.test(t)?Ht.createTextNode(t):void 0}).filter(function(t){return t})}function v(t,e){return x(e).forEach(function(e){return t.appendChild(e)}),t}function Y(t,e){return v(S(t),e)}function U(t){return void 0===t.button&&void 0===t.buttons||0===t.button&&void 0===t.buttons||0===t.button&&1===t.buttons}function O(){return oe++}function b(t){var e=t[ge];return e||(e=t[ge]=O()),se[e]||(se[e]={}),se[e]}function z(t){var e=t[ge];return!!e&&!!Object.getOwnPropertyNames(se[e]).length}function k(t){var e=t[ge];if(e){delete se[e];try{delete t[ge]}catch(e){t.removeAttribute?t.removeAttribute(ge):t[ge]=null}}}function F(t,e){var A=b(t);0===A.handlers[e].length&&(delete A.handlers[e],t.removeEventListener?t.removeEventListener(e,A.dispatcher,!1):t.detachEvent&&t.detachEvent("on"+e,A.dispatcher)),Object.getOwnPropertyNames(A.handlers).length<=0&&(delete A.handlers,delete A.dispatcher,delete A.disabled),0===Object.getOwnPropertyNames(A).length&&k(t)}function R(t,e,A,i){A.forEach(function(A){t(e,A,i)})}function G(t){function e(){return!0}function A(){return!1}if(!t||!t.isPropagationStopped){var i=t||zt.event;for(var n in t={},i)"layerX"!==n&&"layerY"!==n&&"keyLocation"!==n&&"webkitMovementX"!==n&&"webkitMovementY"!==n&&("returnValue"===n&&i.preventDefault||(t[n]=i[n]));if(t.target||(t.target=t.srcElement||Ht),t.relatedTarget||(t.relatedTarget=t.fromElement===t.target?t.toElement:t.fromElement),t.preventDefault=function(){i.preventDefault&&i.preventDefault(),t.returnValue=!1,i.returnValue=!1,t.defaultPrevented=!0},t.defaultPrevented=!1,t.stopPropagation=function(){i.stopPropagation&&i.stopPropagation(),t.cancelBubble=!0,i.cancelBubble=!0,t.isPropagationStopped=e},t.isPropagationStopped=A,t.stopImmediatePropagation=function(){i.stopImmediatePropagation&&i.stopImmediatePropagation(),t.isImmediatePropagationStopped=e,t.stopPropagation()},t.isImmediatePropagationStopped=A,null!==t.clientX&&void 0!==t.clientX){var r=Ht.documentElement,a=Ht.body;t.pageX=t.clientX+(r&&r.scrollLeft||a&&a.scrollLeft||0)-(r&&r.clientLeft||a&&a.clientLeft||0),t.pageY=t.clientY+(r&&r.scrollTop||a&&a.scrollTop||0)-(r&&r.clientTop||a&&a.clientTop||0)}t.which=t.charCode||t.keyCode,null!==t.button&&void 0!==t.button&&(t.button=1&t.button?0:4&t.button?1:2&t.button?2:0)}return t}function H(t,e,A){if(Array.isArray(e))return R(H,t,e,A);var i=b(t);if(i.handlers||(i.handlers={}),i.handlers[e]||(i.handlers[e]=[]),A.guid||(A.guid=O()),i.handlers[e].push(A),i.dispatcher||(i.disabled=!1,i.dispatcher=function(e,A){if(!i.disabled){e=G(e);var n=i.handlers[e.type];if(n)for(var r=n.slice(0),a=0,o=r.length;a-1&&(n={passive:!0}),t.addEventListener(e,i.dispatcher,n)}else t.attachEvent&&t.attachEvent("on"+e,i.dispatcher)}function J(t,e,A){if(z(t)){var i=b(t);if(i.handlers){if(Array.isArray(e))return R(J,t,e,A);var n=function(t,e){i.handlers[e]=[],F(t,e)};if(void 0!==e){var r=i.handlers[e];if(r){if(!A)return void n(t,e);if(A.guid)for(var a=0;a1&&void 0!==arguments[1]?arguments[1]:{}).eventBusKey;if(e){if(!t[e].nodeName)throw new Error('The eventBusKey "'+e+'" does not refer to an element.');t.eventBusEl_=t[e]}else t.eventBusEl_=I("span",{className:"vjs-event-bus"});return i(t,je),t.on("dispose",function(){t.off(),zt.setTimeout(function(){t.eventBusEl_=null},0)}),t}function W(t,e){return i(t,Se),t.state=i({},t.state,e),"function"==typeof t.handleStateChanged&&De(t)&&t.on("statechanged",t.handleStateChanged),t}function K(t){return"string"!=typeof t?t:t.charAt(0).toUpperCase()+t.slice(1)}function Z(){for(var t={},e=arguments.length,i=Array(e),n=0;nA)throw new Error("Failed to execute '"+t+"' on 'TimeRanges': The index provided ("+e+") is non-numeric or out of bounds (0-"+A+").")}(t,i,A.length-1),A[i][e]}function $(t){return void 0===t||0===t.length?{length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}:{length:t.length,start:q.bind(null,"start",0,t),end:q.bind(null,"end",1,t)}}function tt(t,e){return Array.isArray(t)?$(t):void 0===t||void 0===e?$():$([[t,e]])}function et(t,e){var A=0,i=void 0,n=void 0;if(!e)return 0;t&&t.length||(t=tt(0,0));for(var r=0;re&&(n=e),A+=n-i;return A/e}function At(t){if(t instanceof At)return t;"number"==typeof t?this.code=t:"string"==typeof t?this.message=t:n(t)&&("number"==typeof t.code&&(this.code=t.code),i(this,t)),this.message||(this.message=At.defaultMessages[this.code]||"")}function it(t){return void 0!==t&&null!==t&&"function"==typeof t.then}function nt(t){it(t)&&t.then(null,function(t){})}function rt(t,e,A){var i=t;return zA(e)?(A=e,"string"==typeof t&&(i={uri:t})):i=ZA(e,{uri:t}),i.callback=A,i}function at(t,e,A){return ot(e=rt(t,e,A))}function ot(t){function e(t){return clearTimeout(s),t instanceof Error||(t=new Error(""+(t||"Unknown XMLHttpRequest Error"))),t.statusCode=0,n(t,h)}function A(){if(!o){var e;clearTimeout(s),e=t.useXDR&&void 0===r.status?200:1223===r.status?204:r.status;var A=h,i=null;return 0!==e?(A={body:function(){var t=void 0;if(t=r.response?r.response:r.responseText||function(t){if("document"===t.responseType)return t.responseXML;var e=t.responseXML&&"parsererror"===t.responseXML.documentElement.nodeName;return""!==t.responseType||e?null:t.responseXML}(r),l)try{t=JSON.parse(t)}catch(t){}return t}(),statusCode:e,method:M,headers:{},url:g,rawRequest:r},r.getAllResponseHeaders&&(A.headers=KA(r.getAllResponseHeaders()))):i=new Error("Internal XMLHttpRequest Error"),n(i,A,A.body)}}if(void 0===t.callback)throw new Error("callback argument missing");var i=!1,n=function(e,A,n){i||(i=!0,t.callback(e,A,n))},r=t.xhr||null;r||(r=t.cors||t.useXDR?new at.XDomainRequest:new at.XMLHttpRequest);var a,o,s,g=r.url=t.uri||t.url,M=r.method=t.method||"GET",c=t.body||t.data,u=r.headers=t.headers||{},I=!!t.sync,l=!1,h={body:void 0,headers:{},statusCode:0,method:M,url:g,rawRequest:r};if("json"in t&&!1!==t.json&&(l=!0,u.accept||u.Accept||(u.Accept="application/json"),"GET"!==M&&"HEAD"!==M&&(u["content-type"]||u["Content-Type"]||(u["Content-Type"]="application/json"),c=JSON.stringify(!0===t.json?c:t.json))),r.onreadystatechange=function(){4===r.readyState&&setTimeout(A,0)},r.onload=A,r.onerror=e,r.onprogress=function(){},r.onabort=function(){o=!0},r.ontimeout=e,r.open(M,g,!I,t.username,t.password),I||(r.withCredentials=!!t.withCredentials),!I&&t.timeout>0&&(s=setTimeout(function(){if(!o){o=!0,r.abort("timeout");var t=new Error("XMLHttpRequest timeout");t.code="ETIMEDOUT",e(t)}},t.timeout)),r.setRequestHeader)for(a in u)u.hasOwnProperty(a)&&r.setRequestHeader(a,u[a]);else t.headers&&function(t){for(var e in t)if(t.hasOwnProperty(e))return!1}(t.headers);return"responseType"in t&&(r.responseType=t.responseType),"beforeSend"in t&&"function"==typeof t.beforeSend&&t.beforeSend(r),r.send(c||null),r}function st(t,e){this.name="ParsingError",this.code=t.code,this.message=e||t.message}function gt(t){function e(t,e,A,i){return 3600*(0|t)+60*(0|e)+(0|A)+(0|i)/1e3}var A=t.match(/^(\d+):(\d{2})(:\d{2})?\.(\d{3})/);return A?A[3]?e(A[1],A[2],A[3].replace(":",""),A[4]):A[1]>59?e(A[1],A[2],0,A[4]):e(0,A[1],A[2],A[4]):null}function Mt(){this.values=Mi(null)}function ct(t,e,A,i){var n=i?t.split(i):[t];for(var r in n)if("string"==typeof n[r]){var a=n[r].split(A);if(2===a.length)e(a[0],a[1])}}function ut(t,e,A){function i(){var e=gt(t);if(null===e)throw new st(st.Errors.BadTimeStamp,"Malformed timestamp: "+r);return t=t.replace(/^[^\sa-zA-Z-]+/,""),e}function n(){t=t.replace(/^\s+/,"")}var r=t;if(n(),e.startTime=i(),n(),"--\x3e"!==t.substr(0,3))throw new st(st.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+r);t=t.substr(3),n(),e.endTime=i(),n(),function(t,e){var i=new Mt;ct(t,function(t,e){switch(t){case"region":for(var n=A.length-1;n>=0;n--)if(A[n].id===e){i.set(t,A[n].region);break}break;case"vertical":i.alt(t,e,["rl","lr"]);break;case"line":var r=e.split(","),a=r[0];i.integer(t,a),i.percent(t,a)&&i.set("snapToLines",!1),i.alt(t,a,["auto"]),2===r.length&&i.alt("lineAlign",r[1],["start","middle","end"]);break;case"position":r=e.split(","),i.percent(t,r[0]),2===r.length&&i.alt("positionAlign",r[1],["start","middle","end"]);break;case"size":i.percent(t,e);break;case"align":i.alt(t,e,["start","middle","end","left","right"])}},/:/,/\s/),e.region=i.get("region",null),e.vertical=i.get("vertical",""),e.line=i.get("line","auto"),e.lineAlign=i.get("lineAlign","start"),e.snapToLines=i.get("snapToLines",!0),e.size=i.get("size",100),e.align=i.get("align","middle"),e.position=i.get("position",{start:0,left:0,middle:50,end:100,right:100},e.align),e.positionAlign=i.get("positionAlign",{start:"start",left:"start",middle:"middle",end:"end",right:"end"},e.align)}(t,e)}function It(t,e){function A(t){return ci[t]}for(var i,n=t.document.createElement("div"),r=n,a=[];null!==(i=function(){if(!e)return null;var t=e.match(/^([^<]*)(<[^>]*>?)?/);return function(t){return e=e.substr(t.length),t}(t[1]?t[1]:t[2])}());)if("<"!==i[0])r.appendChild(t.document.createTextNode(function(t){for(;g=t.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)t=t.replace(g[0],A);return t}(i)));else{if("/"===i[1]){a.length&&a[a.length-1]===i.substr(2).replace(">","")&&(a.pop(),r=r.parentNode);continue}var o,s=gt(i.substr(1,i.length-2));if(s){o=t.document.createProcessingInstruction("timestamp",s),r.appendChild(o);continue}var g=i.match(/^<([^.\s\/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!g)continue;if(!(o=function(e,A){var i=ui[e];if(!i)return null;var n=t.document.createElement(i);n.localName=i;var r=Ii[e];return r&&A&&(n[r]=A.trim()),n}(g[1],g[3])))continue;if(!function(t,e){return!li[e.localName]||li[e.localName]===t.localName}(r,o))continue;g[2]&&(o.className=g[2].substr(1).replace("."," ")),a.push(g[1]),r.appendChild(o),r=o}return n}function lt(t){for(var e=0;e=A[0]&&t<=A[1])return!0}return!1}function ht(){}function dt(t,e,A){ht.call(this),this.cue=e,this.cueDiv=It(t,e.text);var i={color:"rgba(255, 255, 255, 1)",backgroundColor:"rgba(0, 0, 0, 0.8)",position:"relative",left:0,right:0,top:0,bottom:0,display:"inline",writingMode:""===e.vertical?"horizontal-tb":"lr"===e.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(i,this.cueDiv),this.div=t.document.createElement("div"),i={direction:function(t){function e(t,e){for(var A=e.childNodes.length-1;A>=0;A--)t.push(e.childNodes[A])}function A(t){if(!t||!t.length)return null;var i=t.pop(),n=i.textContent||i.innerText;if(n){var r=n.match(/^.*(\n|\r)/);return r?(t.length=0,r[0]):n}return"ruby"===i.tagName?A(t):i.childNodes?(e(t,i),A(t)):void 0}var i=[],n="";if(!t||!t.childNodes)return"ltr";for(e(i,t);n=A(i);)for(var r=0;r=0&&t.line<=100))return t.line;if(!t.track||!t.track.textTrackList||!t.track.textTrackList.mediaElement)return-1;for(var e=t.track,A=e.textTrackList,i=0,n=0;nc&&(M=M<0?-1:1,M*=Math.ceil(c/g)*g),a<0&&(M+=""===r.vertical?A.height:A.width,o=o.reverse()),n.move(u,M)}else{var I=n.lineHeight/A.height*100;switch(r.lineAlign){case"middle":a-=I/2;break;case"end":a-=I}switch(r.vertical){case"":e.applyStyles({top:e.formatStyle(a,"%")});break;case"rl":e.applyStyles({left:e.formatStyle(a,"%")});break;case"lr":e.applyStyles({right:e.formatStyle(a,"%")})}o=["+y","-x","+x","-y"],n=new Tt(e)}var l=function(t,e){for(var n,r=new Tt(t),a=1,o=0;os&&(n=new Tt(t),a=s),t=new Tt(r)}return n||r}(n,o);e.move(l.toCSSCompatValues(A))}function Nt(){}function ft(t){return"string"==typeof t&&!!fi[t.toLowerCase()]&&t.toLowerCase()}function Ct(t,e,A){this.hasBeenReset=!1;var i="",n=!1,r=t,a=e,o=A,s=null,g="",M=!0,c="auto",u="start",I=50,l="middle",h=50,d="middle";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return i},set:function(t){i=""+t}},pauseOnExit:{enumerable:!0,get:function(){return n},set:function(t){n=!!t}},startTime:{enumerable:!0,get:function(){return r},set:function(t){if("number"!=typeof t)throw new TypeError("Start time must be set to a number.");r=t,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return a},set:function(t){if("number"!=typeof t)throw new TypeError("End time must be set to a number.");a=t,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return o},set:function(t){o=""+t,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return s},set:function(t){s=t,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return g},set:function(t){var e=function(t){return"string"==typeof t&&!!Ni[t.toLowerCase()]&&t.toLowerCase()}(t);if(!1===e)throw new SyntaxError("An invalid or illegal string was specified.");g=e,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return M},set:function(t){M=!!t,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return c},set:function(t){if("number"!=typeof t&&t!==Ei)throw new SyntaxError("An invalid number or illegal string was specified.");c=t,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return u},set:function(t){var e=ft(t);if(!e)throw new SyntaxError("An invalid or illegal string was specified.");u=e,this.hasBeenReset=!0}},position:{enumerable:!0,get:function(){return I},set:function(t){if(t<0||t>100)throw new Error("Position must be between 0 and 100.");I=t,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return l},set:function(t){var e=ft(t);if(!e)throw new SyntaxError("An invalid or illegal string was specified.");l=e,this.hasBeenReset=!0}},size:{enumerable:!0,get:function(){return h},set:function(t){if(t<0||t>100)throw new Error("Size must be between 0 and 100.");h=t,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return d},set:function(t){var e=ft(t);if(!e)throw new SyntaxError("An invalid or illegal string was specified.");d=e,this.hasBeenReset=!0}}}),this.displayState=void 0}function yt(t){return"number"==typeof t&&t>=0&&t<=100}function Dt(t,e,A){t.setTimeout(function(){return function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments[2],r=arguments[3],a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],o=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=A[0],g=A.slice(1);if("string"==typeof s)t(e,Si[s],n,r,a,o);else if(s){var M=function(t,e){var A=xi[t.id()],i=null;if(void 0===A||null===A)return i=e(t),xi[t.id()]=[[e,i]],i;for(var n=0;n3&&void 0!==arguments[3]?arguments[3]:null,n="call"+K(A),r=t.reduce(pt(n),i),a=r===vi,o=a?null:e[A](r);return function(t,e,A,i){for(var n=t.length-1;n>=0;n--){var r=t[n];r[e]&&r[e](i,A)}}(t,A,o,a),o}function pt(t){return function(e,A){return e===vi?vi:A[t]?A[t](e):e}}function mt(t){var e=zi(t.src);return!t.type&&e&&(t.type=e),t}function wt(t,e){var A=void 0;if(4===t.length)A=t[1]+t[1]+t[2]+t[2]+t[3]+t[3];else{if(7!==t.length)throw new Error("Invalid color code provided, "+t+"; must be formatted as e.g. #f0e or #f604e2.");A=t.slice(1)}return"rgba("+parseInt(A.slice(0,2),16)+","+parseInt(A.slice(2,4),16)+","+parseInt(A.slice(4,6),16)+","+e+")"}function Qt(t,e,A){try{t.style[e]=A}catch(t){return}}function Lt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return Ki(t,e)}function jt(t,e){if(e&&(t=e(t)),t&&"none"!==t)return t}function St(t,e,A){var i=St.getPlayer(t);if(i)return e&&Vt.warn('Player "'+t+'" is already initialised. Options will not be applied.'),A&&i.ready(A),i;var r="string"==typeof t?ne("#"+pr(t)):t;if(!M(r))throw new TypeError("The element or ID supplied is not valid. (videojs)");Ht.body.contains(r)||Vt.warn("The element supplied is not included in the DOM"),e=e||{},St.hooks("beforesetup").forEach(function(t){var A=t(r,Z(e));n(A)&&!Array.isArray(A)?e=Z(e,A):Vt.error("please return an object in beforesetup hooks")});var a=xe.getComponent("Player");return i=new a(r,e,A),St.hooks("setup").forEach(function(t){return t(i)}),i}function xt(t,e){return function(A){var i=this;if(!e)return new Wc(t);if(Wc&&!A){var n=vt(e.toString().replace(/^function.+?{/,"").slice(0,-1));return this[Pc]=new Wc(n),function(t,e){if(t&&e){var A=t.terminate;t.objURL=e,t.terminate=function(){t.objURL&&Vc.revokeObjectURL(t.objURL),A.call(t)}}}(this[Pc],n),this[Pc]}var r={postMessage:function(t){i.onmessage&&setTimeout(function(){i.onmessage({data:t,target:r})})}};e.call(r),this.postMessage=function(t){setTimeout(function(){r.onmessage({data:t,target:i})})},this.isThisThread=!0}}function vt(t){try{return Vc.createObjectURL(new Blob([t],{type:_c}))}catch(A){var e=new Xc;return e.append(t),Vc.createObjectURL(e.getBlob(type))}}function Yt(){}var Ut,Ot="7.2.4",bt="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},zt="undefined"!=typeof window?window:void 0!==bt?bt:"undefined"!=typeof self?self:{},kt={},Ft=Object.freeze({default:kt}),Rt=Ft&&kt||Ft,Gt=void 0!==bt?bt:"undefined"!=typeof window?window:{};"undefined"!=typeof document?Ut=document:(Ut=Gt["__GLOBAL_DOCUMENT_CACHE@4"])||(Ut=Gt["__GLOBAL_DOCUMENT_CACHE@4"]=Rt);var Ht=Ut,Jt=void 0,Pt="info",_t=[],Xt=function(t,e){var A=Jt.levels[Pt],i=new RegExp("^("+A+")$");if("log"!==t&&e.unshift(t.toUpperCase()+":"),_t&&_t.push([].concat(e)),e.unshift("VIDEOJS:"),zt.console){var n=zt.console[t];n||"debug"!==t||(n=zt.console.info||zt.console.log),!n||!A||i.test(t)}};(Jt=function(){for(var t=arguments.length,e=Array(t),A=0;A0)for(var n=0,r=i.length;n=e&&(t.apply(void 0,arguments),A=i)}},fe=function(t,e,A){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:zt,n=void 0,r=function(){var r=this,a=arguments,o=function(){n=null,o=null,A||t.apply(r,a)};!n&&A&&t.apply(r,a),i.clearTimeout(n),n=i.setTimeout(o,e)};return r.cancel=function(){i.clearTimeout(n),n=null},r},Ce=function(){};Ce.prototype.allowedEvents_={},Ce.prototype.on=function(t,e){var A=this.addEventListener;this.addEventListener=function(){},H(this,t,e),this.addEventListener=A},Ce.prototype.addEventListener=Ce.prototype.on,Ce.prototype.off=function(t,e){J(this,t,e)},Ce.prototype.removeEventListener=Ce.prototype.off,Ce.prototype.one=function(t,e){var A=this.addEventListener;this.addEventListener=function(){},_(this,t,e),this.addEventListener=A},Ce.prototype.trigger=function(t){var e=t.type||t;"string"==typeof t&&(t={type:e}),t=G(t),this.allowedEvents_[e]&&this["on"+e]&&this["on"+e](t),P(this,t)},Ce.prototype.dispatchEvent=Ce.prototype.trigger;var ye=void 0;Ce.prototype.queueTrigger=function(t){var e=this;ye||(ye=new Map);var A=t.type||t,i=ye.get(this);i||(i=new Map,ye.set(this,i));var n=i.get(A);i.delete(A),zt.clearTimeout(n);var r=zt.setTimeout(function(){0===i.size&&(i=null,ye.delete(e)),e.trigger(t)},0);i.set(A,r)};var De=function(t){return t instanceof Ce||!!t.eventBusEl_&&["on","one","off","trigger"].every(function(e){return"function"==typeof t[e]})},Be=function(t){return"string"==typeof t&&/\S/.test(t)||Array.isArray(t)&&!!t.length},pe=function(t){if(!t.nodeName&&!De(t))throw new Error("Invalid target; must be a DOM node or evented object.")},me=function(t){if(!Be(t))throw new Error("Invalid event type; must be a non-empty string or array.")},we=function(t){if("function"!=typeof t)throw new Error("Invalid listener; must be a function.")},Qe=function(t,e){var A=e.length<3||e[0]===t||e[0]===t.eventBusEl_,i=void 0,n=void 0,r=void 0;return A?(i=t.eventBusEl_,e.length>=3&&e.shift(),n=e[0],r=e[1]):(i=e[0],n=e[1],r=e[2]),pe(i),me(n),we(r),{isTargetingSelf:A,target:i,type:n,listener:r=Ee(t,r)}},Le=function(t,e,A,i){pe(t),t.nodeName?ue[e](t,A,i):t[e](A,i)},je={on:function(){for(var t=this,e=arguments.length,A=Array(e),i=0;i=0;t--)this.children_[t].dispose&&this.children_[t].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.el_&&(this.el_.parentNode&&this.el_.parentNode.removeChild(this.el_),k(this.el_),this.el_=null),this.player_=null},t.prototype.player=function(){return this.player_},t.prototype.options=function(t){return Vt.warn("this.options() has been deprecated and will be moved to the constructor in 6.0"),t?(this.options_=Z(this.options_,t),this.options_):this.options_},t.prototype.el=function(){return this.el_},t.prototype.createEl=function(t,e,A){return I(t,e,A)},t.prototype.localize=function(t,e){var A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,i=this.player_.language&&this.player_.language(),n=this.player_.languages&&this.player_.languages(),r=n&&n[i],a=i&&i.split("-")[0],o=n&&n[a],s=A;return r&&r[t]?s=r[t]:o&&o[t]&&(s=o[t]),e&&(s=s.replace(/\{(\d+)\}/g,function(t,A){var i=e[A-1],n=i;return void 0===i&&(n=t),n})),s},t.prototype.contentEl=function(){return this.contentEl_||this.el_},t.prototype.id=function(){return this.id_},t.prototype.name=function(){return this.name_},t.prototype.children=function(){return this.children_},t.prototype.getChildById=function(t){return this.childIndex_[t]},t.prototype.getChild=function(t){if(t)return t=K(t),this.childNameIndex_[t]},t.prototype.addChild=function(e){var A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.children_.length,n=void 0,r=void 0;if("string"==typeof e){r=K(e);var a=A.componentClass||r;A.name=r;var o=t.getComponent(a);if(!o)throw new Error("Component "+a+" does not exist");if("function"!=typeof o)return null;n=new o(this.player_||this,A)}else n=e;if(this.children_.splice(i,0,n),"function"==typeof n.id&&(this.childIndex_[n.id()]=n),(r=r||n.name&&K(n.name()))&&(this.childNameIndex_[r]=n),"function"==typeof n.el&&n.el()){var s=this.contentEl().children[i]||null;this.contentEl().insertBefore(n.el(),s)}return n},t.prototype.removeChild=function(t){if("string"==typeof t&&(t=this.getChild(t)),t&&this.children_){for(var e=!1,A=this.children_.length-1;A>=0;A--)if(this.children_[A]===t){e=!0,this.children_.splice(A,1);break}if(e){this.childIndex_[t.id()]=null,this.childNameIndex_[t.name()]=null;var i=t.el();i&&i.parentNode===this.contentEl()&&this.contentEl().removeChild(t.el())}}},t.prototype.initChildren=function(){var e=this,A=this.options_.children;if(A){var i=this.options_,n=void 0,r=t.getComponent("Tech");(n=Array.isArray(A)?A:Object.keys(A)).concat(Object.keys(this.options_).filter(function(t){return!n.some(function(e){return"string"==typeof e?t===e:t===e.name})})).map(function(t){var i=void 0,n=void 0;return"string"==typeof t?n=A[i=t]||e.options_[i]||{}:(i=t.name,n=t),{name:i,opts:n}}).filter(function(e){var A=t.getComponent(e.opts.componentClass||K(e.name));return A&&!r.isTech(A)}).forEach(function(t){var A=t.name,n=t.opts;if(void 0!==i[A]&&(n=i[A]),!1!==n){!0===n&&(n={}),n.playerOptions=e.options_.playerOptions;var r=e.addChild(A,n);r&&(e[A]=r)}})}},t.prototype.buildCSSClass=function(){return""},t.prototype.ready=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t)return this.isReady_?void(e?t.call(this):this.setTimeout(t,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(t))},t.prototype.triggerReady=function(){this.isReady_=!0,this.setTimeout(function(){var t=this.readyQueue_;this.readyQueue_=[],t&&t.length>0&&t.forEach(function(t){t.call(this)},this),this.trigger("ready")},1)},t.prototype.$=function(t,e){return ne(t,e||this.contentEl())},t.prototype.$$=function(t,e){return re(t,e||this.contentEl())},t.prototype.hasClass=function(t){return d(this.el_,t)},t.prototype.addClass=function(t){T(this.el_,t)},t.prototype.removeClass=function(t){E(this.el_,t)},t.prototype.toggleClass=function(t,e){N(this.el_,t,e)},t.prototype.show=function(){this.removeClass("vjs-hidden")},t.prototype.hide=function(){this.addClass("vjs-hidden")},t.prototype.lockShowing=function(){this.addClass("vjs-lock-showing")},t.prototype.unlockShowing=function(){this.removeClass("vjs-lock-showing")},t.prototype.getAttribute=function(t){return y(this.el_,t)},t.prototype.setAttribute=function(t,e){D(this.el_,t,e)},t.prototype.removeAttribute=function(t){B(this.el_,t)},t.prototype.width=function(t,e){return this.dimension("width",t,e)},t.prototype.height=function(t,e){return this.dimension("height",t,e)},t.prototype.dimensions=function(t,e){this.width(t,!0),this.height(e)},t.prototype.dimension=function(t,e,A){if(void 0!==e)return null!==e&&e==e||(e=0),-1!==(""+e).indexOf("%")||-1!==(""+e).indexOf("px")?this.el_.style[t]=e:this.el_.style[t]="auto"===e?"":e+"px",void(A||this.trigger("componentresize"));if(!this.el_)return 0;var i=this.el_.style[t],n=i.indexOf("px");return-1!==n?parseInt(i.slice(0,n),10):parseInt(this.el_["offset"+K(t)],10)},t.prototype.currentDimension=function(t){var e=0;if("width"!==t&&"height"!==t)throw new Error("currentDimension only accepts width or height value");if("function"==typeof zt.getComputedStyle){var A=zt.getComputedStyle(this.el_);e=A.getPropertyValue(t)||A[t]}if(0===(e=parseFloat(e))){var i="offset"+K(t);e=this.el_[i]}return e},t.prototype.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}},t.prototype.currentWidth=function(){return this.currentDimension("width")},t.prototype.currentHeight=function(){return this.currentDimension("height")},t.prototype.focus=function(){this.el_.focus()},t.prototype.blur=function(){this.el_.blur()},t.prototype.emitTapEvents=function(){var t=0,e=null,A=void 0;this.on("touchstart",function(i){1===i.touches.length&&(e={pageX:i.touches[0].pageX,pageY:i.touches[0].pageY},t=(new Date).getTime(),A=!0)}),this.on("touchmove",function(t){if(t.touches.length>1)A=!1;else if(e){var i=t.touches[0].pageX-e.pageX,n=t.touches[0].pageY-e.pageY;Math.sqrt(i*i+n*n)>10&&(A=!1)}});var i=function(){A=!1};this.on("touchleave",i),this.on("touchcancel",i),this.on("touchend",function(i){e=null,!0===A&&(new Date).getTime()-t<200&&(i.preventDefault(),this.trigger("tap"))})},t.prototype.enableTouchActivity=function(){if(this.player()&&this.player().reportUserActivity){var t=Ee(this.player(),this.player().reportUserActivity),e=void 0;this.on("touchstart",function(){t(),this.clearInterval(e),e=this.setInterval(t,250)});var A=function(A){t(),this.clearInterval(e)};this.on("touchmove",t),this.on("touchend",A),this.on("touchcancel",A)}},t.prototype.setTimeout=function(t,e){var A,i,n=this;return t=Ee(this,t),A=zt.setTimeout(function(){n.off("dispose",i),t()},e),(i=function(){return n.clearTimeout(A)}).guid="vjs-timeout-"+A,this.on("dispose",i),A},t.prototype.clearTimeout=function(t){zt.clearTimeout(t);var e=function(){};return e.guid="vjs-timeout-"+t,this.off("dispose",e),t},t.prototype.setInterval=function(t,e){var A=this;t=Ee(this,t);var i=zt.setInterval(t,e),n=function(){return A.clearInterval(i)};return n.guid="vjs-interval-"+i,this.on("dispose",n),i},t.prototype.clearInterval=function(t){zt.clearInterval(t);var e=function(){};return e.guid="vjs-interval-"+t,this.off("dispose",e),t},t.prototype.requestAnimationFrame=function(t){var e,A,i=this;return this.supportsRaf_?(t=Ee(this,t),e=zt.requestAnimationFrame(function(){i.off("dispose",A),t()}),(A=function(){return i.cancelAnimationFrame(e)}).guid="vjs-raf-"+e,this.on("dispose",A),e):this.setTimeout(t,1e3/60)},t.prototype.cancelAnimationFrame=function(t){if(this.supportsRaf_){zt.cancelAnimationFrame(t);var e=function(){};return e.guid="vjs-raf-"+t,this.off("dispose",e),t}return this.clearTimeout(t)},t.registerComponent=function(e,A){if("string"!=typeof e||!e)throw new Error('Illegal component name, "'+e+'"; must be a non-empty string.');var i=t.getComponent("Tech"),n=i&&i.isTech(A),r=t===A||t.prototype.isPrototypeOf(A.prototype);if(n||!r){throw new Error('Illegal component, "'+e+'"; '+(n?"techs must be registered using Tech.registerTech()":"must be a Component subclass")+".")}e=K(e),t.components_||(t.components_={});var a=t.getComponent("Player");if("Player"===e&&a&&a.players){var o=a.players,s=Object.keys(o);if(o&&s.length>0&&s.map(function(t){return o[t]}).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return t.components_[e]=A,A},t.getComponent=function(e){if(e)return e=K(e),t.components_&&t.components_[e]?t.components_[e]:void 0},t}();xe.prototype.supportsRaf_="function"==typeof zt.requestAnimationFrame&&"function"==typeof zt.cancelAnimationFrame,xe.registerComponent("Component",xe);for(var ve=zt.navigator&&zt.navigator.userAgent||"",Ye=/AppleWebKit\/([\d.]+)/i.exec(ve),Ue=Ye?parseFloat(Ye.pop()):null,Oe=/iPad/i.test(ve),be=/iPhone/i.test(ve)&&!Oe,ze=/iPod/i.test(ve),ke=be||Oe||ze,Fe=function(){var t=ve.match(/OS (\d+)_/i);return t&&t[1]?t[1]:null}(),Re=/Android/i.test(ve),Ge=function(){var t=ve.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!t)return null;var e=t[1]&&parseFloat(t[1]),A=t[2]&&parseFloat(t[2]);return e&&A?parseFloat(t[1]+"."+t[2]):e||null}(),He=Re&&Ge<5&&Ue<537,Je=/Firefox/i.test(ve),Pe=/Edge/i.test(ve),_e=!Pe&&(/Chrome/i.test(ve)||/CriOS/i.test(ve)),Xe=function(){var t=ve.match(/(Chrome|CriOS)\/(\d+)/);return t&&t[2]?parseFloat(t[2]):null}(),Ve=function(){var t=/MSIE\s(\d+)\.\d/.exec(ve),e=t&&parseFloat(t[1]);return!e&&/Trident\/7.0/i.test(ve)&&/rv:11.0/.test(ve)&&(e=11),e}(),We=/Safari/i.test(ve)&&!_e&&!Re&&!Pe,Ke=(We||ke)&&!_e,Ze=(g()&&("ontouchstart"in zt||zt.navigator.maxTouchPoints||zt.DocumentTouch&&zt.document instanceof zt.DocumentTouch)),qe=Object.freeze({IS_IPAD:Oe,IS_IPHONE:be,IS_IPOD:ze,IS_IOS:ke,IOS_VERSION:Fe,IS_ANDROID:Re,ANDROID_VERSION:Ge,IS_NATIVE_ANDROID:He,IS_FIREFOX:Je,IS_EDGE:Pe,IS_CHROME:_e,CHROME_VERSION:Xe,IE_VERSION:Ve,IS_SAFARI:We,IS_ANY_SAFARI:Ke,TOUCH_ENABLED:Ze}),$e={},tA=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],eA=tA[0],AA=void 0,iA=0;iA0&&void 0!==arguments[0]?arguments[0]:[];Zt(this,e);var i=$t(this,t.call(this));i.tracks_=[],Object.defineProperty(i,"length",{get:function(){return this.tracks_.length}});for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:[];Zt(this,e);for(var i=A.length-1;i>=0;i--)if(A[i].enabled){lA(A,A[i]);break}var n=$t(this,t.call(this,A));return n.changing_=!1,n}return qt(e,t),e.prototype.addTrack=function(e){var A=this;e.enabled&&lA(this,e),t.prototype.addTrack.call(this,e),e.addEventListener&&e.addEventListener("enabledchange",function(){A.changing_||(A.changing_=!0,lA(A,e),A.changing_=!1,A.trigger("change"))})},e}(uA),dA=function(t,e){for(var A=0;A0&&void 0!==arguments[0]?arguments[0]:[];Zt(this,e);for(var i=A.length-1;i>=0;i--)if(A[i].selected){dA(A,A[i]);break}var n=$t(this,t.call(this,A));return n.changing_=!1,Object.defineProperty(n,"selectedIndex",{get:function(){for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:[];Zt(this,t),this.trackElements_=[],Object.defineProperty(this,"length",{get:function(){return this.trackElements_.length}});for(var A=0,i=e.length;A0&&void 0!==arguments[0]?arguments[0]:{};Zt(this,e);var i=$t(this,t.call(this)),n={id:A.id||"vjs_track_"+O(),kind:A.kind||"",label:A.label||"",language:A.language||""};for(var r in n)!function(t){Object.defineProperty(i,t,{get:function(){return n[t]},set:function(){}})}(r);return i}return qt(e,t),e}(Ce),mA=function(t){var e=["protocol","hostname","port","pathname","search","hash","host"],A=Ht.createElement("a");A.href=t;var i=""===A.host&&"file:"!==A.protocol,n=void 0;i&&((n=Ht.createElement("div")).innerHTML='',A=n.firstChild,n.setAttribute("style","display:none; position:absolute;"),Ht.body.appendChild(n));for(var r={},a=0;ax',t=e.firstChild.href}return t},QA=function(t){if("string"==typeof t){var e=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/i.exec(t);if(e)return e.pop().toLowerCase()}return""},LA=function(t){var e=zt.location,A=mA(t);return(":"===A.protocol?e.protocol:A.protocol)+A.host!==e.protocol+e.host},jA=Object.freeze({parseUrl:mA,getAbsoluteURL:wA,getFileExtension:QA,isCrossOrigin:LA}),SA=function(t){var e=xA.call(t);return"[object Function]"===e||"function"==typeof t&&"[object RegExp]"!==e||"undefined"!=typeof window&&(t===window.setTimeout||t===window.alert||t===window.confirm||t===window.prompt)},xA=Object.prototype.toString,vA=Object.freeze({default:SA,__moduleExports:SA}),YA=t(function(t,e){(e=t.exports=function(t){return t.replace(/^\s*|\s*$/g,"")}).left=function(t){return t.replace(/^\s*/,"")},e.right=function(t){return t.replace(/\s*$/,"")}}),UA=YA.left,OA=YA.right,bA=Object.freeze({default:YA,__moduleExports:YA,left:UA,right:OA}),zA=vA&&SA||vA,kA=function(t,e,A){if(!zA(e))throw new TypeError("iterator must be a function");arguments.length<3&&(A=this),"[object Array]"===FA.call(t)?function(t,e,A){for(var i=0,n=t.length;i0&&(zt.console&&zt.console.groupCollapsed&&zt.console.groupCollapsed("Text Track parsing errors for "+e.src),i.forEach(function(t){return Vt.error(t)}),zt.console&&zt.console.groupEnd&&zt.console.groupEnd()),A.flush()},ti=function(t,e){var A={uri:t},i=LA(t);i&&(A.cors=i),qA(A,Ee(this,function(t,A,i){if(t)return Vt.error(t,A);if(e.loaded_=!0,"function"!=typeof zt.WebVTT){if(e.tech_){var n=function(){return $A(i,e)};e.tech_.on("vttjsloaded",n),e.tech_.on("vttjserror",function(){Vt.error("vttjs failed to load, stopping trying to process "+e.src),e.tech_.off("vttjsloaded",n)})}}else $A(i,e)}))},ei=function(t){function e(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Zt(this,e),!A.tech)throw new Error("A tech was not provided.");var i=Z(A,{kind:DA[A.kind]||"subtitles",language:A.language||A.srclang||""}),n=BA[i.mode]||"disabled",r=i.default;"metadata"!==i.kind&&"chapters"!==i.kind||(n="hidden");var a=$t(this,t.call(this,i));a.tech_=i.tech,a.cues_=[],a.activeCues_=[];var o=new fA(a.cues_),s=new fA(a.activeCues_),g=!1,M=Ee(a,function(){this.activeCues=this.activeCues,g&&(this.trigger("cuechange"),g=!1)});return"disabled"!==n&&a.tech_.ready(function(){a.tech_.on("timeupdate",M)},!0),Object.defineProperties(a,{default:{get:function(){return r},set:function(){}},mode:{get:function(){return n},set:function(t){var e=this;BA[t]&&("disabled"!==(n=t)?this.tech_.ready(function(){e.tech_.on("timeupdate",M)},!0):this.tech_.off("timeupdate",M),this.trigger("modechange"))}},cues:{get:function(){return this.loaded_?o:null},set:function(){}},activeCues:{get:function(){if(!this.loaded_)return null;if(0===this.cues.length)return s;for(var t=this.tech_.currentTime(),e=[],A=0,i=this.cues.length;A=t?e.push(n):n.startTime===n.endTime&&n.startTime<=t&&n.startTime+.5>=t&&e.push(n)}if(g=!1,e.length!==this.activeCues_.length)g=!0;else for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};Zt(this,e);var i=Z(A,{kind:yA[A.kind]||""}),n=$t(this,t.call(this,i)),r=!1;return Object.defineProperty(n,"enabled",{get:function(){return r},set:function(t){"boolean"==typeof t&&t!==r&&(r=t,this.trigger("enabledchange"))}}),i.enabled&&(n.enabled=i.enabled),n.loaded_=!0,n}return qt(e,t),e}(pA),ii=function(t){function e(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Zt(this,e);var i=Z(A,{kind:CA[A.kind]||""}),n=$t(this,t.call(this,i)),r=!1;return Object.defineProperty(n,"selected",{get:function(){return r},set:function(t){"boolean"==typeof t&&t!==r&&(r=t,this.trigger("selectedchange"))}}),i.selected&&(n.selected=i.selected),n}return qt(e,t),e}(pA),ni=0,ri=2,ai=function(t){function e(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Zt(this,e);var i=$t(this,t.call(this)),n=void 0,r=new ei(A);return i.kind=r.kind,i.src=r.src,i.srclang=r.language,i.label=r.label,i.default=r.default,Object.defineProperties(i,{readyState:{get:function(){return n}},track:{get:function(){return r}}}),n=ni,r.addEventListener("loadeddata",function(){n=ri,i.trigger({type:"load",target:i})}),i}return qt(e,t),e}(Ce);ai.prototype.allowedEvents_={load:"load"},ai.NONE=ni,ai.LOADING=1,ai.LOADED=ri,ai.ERROR=3;var oi={audio:{ListClass:hA,TrackClass:Ai,capitalName:"Audio"},video:{ListClass:TA,TrackClass:ii,capitalName:"Video"},text:{ListClass:EA,TrackClass:ei,capitalName:"Text"}};Object.keys(oi).forEach(function(t){oi[t].getterName=t+"Tracks",oi[t].privateName=t+"Tracks_"});var si={remoteText:{ListClass:EA,TrackClass:ei,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:NA,TrackClass:ai,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},gi=Z(oi,si);si.names=Object.keys(si),oi.names=Object.keys(oi),gi.names=[].concat(si.names).concat(oi.names);var Mi=Object.create||function(){function t(){}return function(e){if(1!==arguments.length)throw new Error("Object.create shim only accepts one parameter.");return t.prototype=e,new t}}();st.prototype=Mi(Error.prototype),st.prototype.constructor=st,st.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},Mt.prototype={set:function(t,e){this.get(t)||""===e||(this.values[t]=e)},get:function(t,e,A){return A?this.has(t)?this.values[t]:e[A]:this.has(t)?this.values[t]:e},has:function(t){return t in this.values},alt:function(t,e,A){for(var i=0;i=0&&e<=100)&&(this.set(t,e),!0)}};var ci={"&":"&","<":"<",">":">","‎":"‎","‏":"‏"," ":" "},ui={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},Ii={v:"title",lang:"lang"},li={rt:"ruby"},hi=[[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]];ht.prototype.applyStyles=function(t,e){for(var A in e=e||this.div,t)t.hasOwnProperty(A)&&(e.style[A]=t[A])},ht.prototype.formatStyle=function(t,e){return 0===t?0:t+e},dt.prototype=Mi(ht.prototype),dt.prototype.constructor=dt,Tt.prototype.move=function(t,e){switch(e=void 0!==e?e:this.lineHeight,t){case"+x":this.left+=e,this.right+=e;break;case"-x":this.left-=e,this.right-=e;break;case"+y":this.top+=e,this.bottom+=e;break;case"-y":this.top-=e,this.bottom-=e}},Tt.prototype.overlaps=function(t){return this.leftt.left&&this.topt.top},Tt.prototype.overlapsAny=function(t){for(var e=0;e=t.top&&this.bottom<=t.bottom&&this.left>=t.left&&this.right<=t.right},Tt.prototype.overlapsOppositeAxis=function(t,e){switch(e){case"+x":return this.leftt.right;case"+y":return this.topt.bottom}},Tt.prototype.intersectPercentage=function(t){return Math.max(0,Math.min(this.right,t.right)-Math.max(this.left,t.left))*Math.max(0,Math.min(this.bottom,t.bottom)-Math.max(this.top,t.top))/(this.height*this.width)},Tt.prototype.toCSSCompatValues=function(t){return{top:this.top-t.top,bottom:t.bottom-this.bottom,left:this.left-t.left,right:t.right-this.right,height:this.height,width:this.width}},Tt.getSimpleBoxPosition=function(t){var e=t.div?t.div.offsetHeight:t.tagName?t.offsetHeight:0,A=t.div?t.div.offsetWidth:t.tagName?t.offsetWidth:0,i=t.div?t.div.offsetTop:t.tagName?t.offsetTop:0;return{left:(t=t.div?t.div.getBoundingClientRect():t.tagName?t.getBoundingClientRect():t).left,right:t.right,top:t.top||i,height:t.height||e,bottom:t.bottom||i+(t.height||e),width:t.width||A}},Nt.StringDecoder=function(){return{decode:function(t){if(!t)return"";if("string"!=typeof t)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(t))}}},Nt.convertCueToDOMTree=function(t,e){return t&&e?It(t,e):null},Nt.processCues=function(t,e,A){if(!t||!e||!A)return null;for(;A.firstChild;)A.removeChild(A.firstChild);var i=t.document.createElement("div");if(i.style.position="absolute",i.style.left="0",i.style.right="0",i.style.top="0",i.style.bottom="0",i.style.margin="1.5%",A.appendChild(i),function(t){for(var e=0;e0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};Zt(this,e),A.reportTouchActivity=!1;var n=$t(this,t.call(this,null,A,i));return n.hasStarted_=!1,n.on("playing",function(){this.hasStarted_=!0}),n.on("loadstart",function(){this.hasStarted_=!1}),gi.names.forEach(function(t){var e=gi[t];A&&A[e.getterName]&&(n[e.privateName]=A[e.getterName])}),n.featuresProgressEvents||n.manualProgressOn(),n.featuresTimeupdateEvents||n.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(function(t){!1===A["native"+t+"Tracks"]&&(n["featuresNative"+t+"Tracks"]=!1)}),!1===A.nativeCaptions||!1===A.nativeTextTracks?n.featuresNativeTextTracks=!1:!0!==A.nativeCaptions&&!0!==A.nativeTextTracks||(n.featuresNativeTextTracks=!0),n.featuresNativeTextTracks||n.emulateTextTracks(),n.autoRemoteTextTracks_=new gi.text.ListClass,n.initTrackListeners(),A.nativeControlsForTouch||n.emitTapEvents(),n.constructor&&(n.name_=n.constructor.name||"Unknown Tech"),n}return qt(e,t),e.prototype.triggerSourceset=function(t){var e=this;this.isReady_||this.one("ready",function(){return e.setTimeout(function(){return e.triggerSourceset(t)},1)}),this.trigger({src:t,type:"sourceset"})},e.prototype.manualProgressOn=function(){this.on("durationchange",this.onDurationChange),this.manualProgress=!0,this.one("ready",this.trackProgress)},e.prototype.manualProgressOff=function(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange)},e.prototype.trackProgress=function(t){this.stopTrackingProgress(),this.progressInterval=this.setInterval(Ee(this,function(){var t=this.bufferedPercent();this.bufferedPercent_!==t&&this.trigger("progress"),this.bufferedPercent_=t,1===t&&this.stopTrackingProgress()}),500)},e.prototype.onDurationChange=function(t){this.duration_=this.duration()},e.prototype.buffered=function(){return tt(0,0)},e.prototype.bufferedPercent=function(){return et(this.buffered(),this.duration_)},e.prototype.stopTrackingProgress=function(){this.clearInterval(this.progressInterval)},e.prototype.manualTimeUpdatesOn=function(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime),this.on("pause",this.stopTrackingCurrentTime)},e.prototype.manualTimeUpdatesOff=function(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime),this.off("pause",this.stopTrackingCurrentTime)},e.prototype.trackCurrentTime=function(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)},e.prototype.stopTrackingCurrentTime=function(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},e.prototype.dispose=function(){this.clearTracks(oi.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),t.prototype.dispose.call(this)},e.prototype.clearTracks=function(t){var e=this;(t=[].concat(t)).forEach(function(t){for(var A=e[t+"Tracks"]()||[],i=A.length;i--;){var n=A[i];"text"===t&&e.removeRemoteTextTrack(n),A.removeTrack(n)}})},e.prototype.cleanupAutoTextTracks=function(){for(var t=this.autoRemoteTextTracks_||[],e=t.length;e--;){var A=t[e];this.removeRemoteTextTrack(A)}},e.prototype.reset=function(){},e.prototype.error=function(t){return void 0!==t&&(this.error_=new At(t),this.trigger("error")),this.error_},e.prototype.played=function(){return this.hasStarted_?tt(0,0):tt()},e.prototype.setCurrentTime=function(){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},e.prototype.initTrackListeners=function(){var t=this;oi.names.forEach(function(e){var A=oi[e],i=function(){t.trigger(e+"trackchange")},n=t[A.getterName]();n.addEventListener("removetrack",i),n.addEventListener("addtrack",i),t.on("dispose",function(){n.removeEventListener("removetrack",i),n.removeEventListener("addtrack",i)})})},e.prototype.addWebVttScript_=function(){var t=this;if(!zt.WebVTT)if(Ht.body.contains(this.el())){if(!this.options_["vtt.js"]&&r(Li)&&Object.keys(Li).length>0)return void this.trigger("vttjsloaded");var e=Ht.createElement("script");e.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",e.onload=function(){t.trigger("vttjsloaded")},e.onerror=function(){t.trigger("vttjserror")},this.on("dispose",function(){e.onload=null,e.onerror=null}),zt.WebVTT=!0,this.el().parentNode.appendChild(e)}else this.ready(this.addWebVttScript_)},e.prototype.emulateTextTracks=function(){var t=this,e=this.textTracks(),A=this.remoteTextTracks(),i=function(t){return e.addTrack(t.track)},n=function(t){return e.removeTrack(t.track)};A.on("addtrack",i),A.on("removetrack",n),this.addWebVttScript_();var r=function(){return t.trigger("texttrackchange")},a=function(){r();for(var t=0;t4&&void 0!==arguments[4]?arguments[4]:{},r=t.textTracks();n.kind=e,A&&(n.label=A),i&&(n.language=i),n.tech=t;var a=new gi.text.TrackClass(n);return r.addTrack(a),a}(this,t,e,A)},e.prototype.createRemoteTextTrack=function(t){var e=Z(t,{tech:this});return new si.remoteTextEl.TrackClass(e)},e.prototype.addRemoteTextTrack=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},A=arguments[1],i=this.createRemoteTextTrack(e);return!0!==A&&!1!==A&&(Vt.warn('Calling addRemoteTextTrack without explicitly setting the "manualCleanup" parameter to `true` is deprecated and default to `false` in future version of video.js'),A=!0),this.remoteTextTrackEls().addTrackElement_(i),this.remoteTextTracks().addTrack(i.track),!0!==A&&this.ready(function(){return t.autoRemoteTextTracks_.addTrack(i.track)}),i},e.prototype.removeRemoteTextTrack=function(t){var e=this.remoteTextTrackEls().getTrackElementByTrack_(t);this.remoteTextTrackEls().removeTrackElement_(e),this.remoteTextTracks().removeTrack(t),this.autoRemoteTextTracks_.removeTrack(t)},e.prototype.getVideoPlaybackQuality=function(){return{}},e.prototype.setPoster=function(){},e.prototype.playsinline=function(){},e.prototype.setPlaysinline=function(){},e.prototype.overrideNativeAudioTracks=function(){},e.prototype.overrideNativeVideoTracks=function(){},e.prototype.canPlayType=function(){return""},e.canPlayType=function(){return""},e.canPlaySource=function(t,A){return e.canPlayType(t.type)},e.isTech=function(t){return t.prototype instanceof e||t instanceof e||t===e},e.registerTech=function(t,A){if(e.techs_||(e.techs_={}),!e.isTech(A))throw new Error("Tech "+t+" must be a Tech");if(!e.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!e.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return t=K(t),e.techs_[t]=A,"Tech"!==t&&e.defaultTechOrder_.push(t),A},e.getTech=function(t){if(t)return t=K(t),e.techs_&&e.techs_[t]?e.techs_[t]:zt&&zt.videojs&&zt.videojs[t]?(Vt.warn("The "+t+" tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)"),zt.videojs[t]):void 0},e}(xe));gi.names.forEach(function(t){var e=gi[t];ji.prototype[e.getterName]=function(){return this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName]}}),ji.prototype.featuresVolumeControl=!0,ji.prototype.featuresMuteControl=!0,ji.prototype.featuresFullscreenResize=!1,ji.prototype.featuresPlaybackRate=!1,ji.prototype.featuresProgressEvents=!1,ji.prototype.featuresSourceset=!1,ji.prototype.featuresTimeupdateEvents=!1,ji.prototype.featuresNativeTextTracks=!1,ji.withSourceHandlers=function(t){t.registerSourceHandler=function(e,A){var i=t.sourceHandlers;i||(i=t.sourceHandlers=[]),void 0===A&&(A=i.length),i.splice(A,0,e)},t.canPlayType=function(e){for(var A=t.sourceHandlers||[],i=void 0,n=0;n0&&void 0!==arguments[0]?arguments[0]:"",e=QA(t);return bi[e.toLowerCase()]||""},ki=function(t){function e(A,i,n){Zt(this,e);var r=Z({createEl:!1},i),a=$t(this,t.call(this,A,r,n));if(i.playerOptions.sources&&0!==i.playerOptions.sources.length)A.src(i.playerOptions.sources);else for(var o=0,s=i.playerOptions.techOrder;o0&&void 0!==arguments[0]?arguments[0]:"div",A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};A=i({innerHTML:'',className:this.buildCSSClass(),tabIndex:0},A),"button"===e&&Vt.error("Creating a ClickableComponent with an HTML element of "+e+" is not supported; use a Button instead."),n=i({role:"button"},n),this.tabIndex_=A.tabIndex;var r=t.prototype.createEl.call(this,e,A,n);return this.createControlTextEl(r),r},e.prototype.dispose=function(){this.controlTextEl_=null,t.prototype.dispose.call(this)},e.prototype.createControlTextEl=function(t){return this.controlTextEl_=I("span",{className:"vjs-control-text"},{"aria-live":"polite"}),t&&t.appendChild(this.controlTextEl_),this.controlText(this.controlText_,t),this.controlTextEl_},e.prototype.controlText=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.el();if(void 0===t)return this.controlText_||"Need Text";var A=this.localize(t);this.controlText_=t,l(this.controlTextEl_,A),this.nonIconControl||e.setAttribute("title",A)},e.prototype.buildCSSClass=function(){return"vjs-control vjs-button "+t.prototype.buildCSSClass.call(this)},e.prototype.enable=function(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),void 0!==this.tabIndex_&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick),this.on("focus",this.handleFocus),this.on("blur",this.handleBlur))},e.prototype.disable=function(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),void 0!==this.tabIndex_&&this.el_.removeAttribute("tabIndex"),this.off(["tap","click"],this.handleClick),this.off("focus",this.handleFocus),this.off("blur",this.handleBlur)},e.prototype.handleClick=function(t){},e.prototype.handleFocus=function(t){H(Ht,"keydown",Ee(this,this.handleKeyPress))},e.prototype.handleKeyPress=function(e){32===e.which||13===e.which?(e.preventDefault(),this.trigger("click")):t.prototype.handleKeyPress&&t.prototype.handleKeyPress.call(this,e)},e.prototype.handleBlur=function(t){J(Ht,"keydown",Ee(this,this.handleKeyPress))},e}(xe);xe.registerComponent("ClickableComponent",Fi);var Ri=function(t){function e(A,i){Zt(this,e);var n=$t(this,t.call(this,A,i));return n.update(),A.on("posterchange",Ee(n,n.update)),n}return qt(e,t),e.prototype.dispose=function(){this.player().off("posterchange",this.update),t.prototype.dispose.call(this)},e.prototype.createEl=function(){return I("div",{className:"vjs-poster",tabIndex:-1})},e.prototype.update=function(t){var e=this.player().poster();this.setSrc(e),e?this.show():this.hide()},e.prototype.setSrc=function(t){var e="";t&&(e='url("'+t+'")'),this.el_.style.backgroundImage=e},e.prototype.handleClick=function(t){this.player_.controls()&&(this.player_.paused()?nt(this.player_.play()):this.player_.pause())},e}(Fi);xe.registerComponent("PosterImage",Ri);var Gi={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'},Hi=function(t){function e(A,i,n){Zt(this,e);var r=$t(this,t.call(this,A,i,n)),a=Ee(r,r.updateDisplay);return A.on("loadstart",Ee(r,r.toggleDisplay)),A.on("texttrackchange",a),A.on("loadstart",Ee(r,r.preselectTrack)),A.ready(Ee(r,function(){if(A.tech_&&A.tech_.featuresNativeTextTracks)this.hide();else{A.on("fullscreenchange",a),A.on("playerresize",a),zt.addEventListener("orientationchange",a),A.on("dispose",function(){return zt.removeEventListener("orientationchange",a)});for(var t=this.options_.playerOptions.tracks||[],e=0;e1&&void 0!==arguments[1]?arguments[1]:{},A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};t="button",e=i({innerHTML:'',className:this.buildCSSClass()},e),A=i({type:"button"},A);var n=xe.prototype.createEl.call(this,t,e,A);return this.createControlTextEl(n),n},e.prototype.addChild=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},A=this.constructor.name;return Vt.warn("Adding an actionable (user controllable) child to a Button ("+A+") is not supported; use a ClickableComponent instead."),xe.prototype.addChild.call(this,t,e)},e.prototype.enable=function(){t.prototype.enable.call(this),this.el_.removeAttribute("disabled")},e.prototype.disable=function(){t.prototype.disable.call(this),this.el_.setAttribute("disabled","disabled")},e.prototype.handleKeyPress=function(e){32!==e.which&&13!==e.which&&t.prototype.handleKeyPress.call(this,e)},e}(Fi);xe.registerComponent("Button",Pi);var _i=function(t){function e(A,i){Zt(this,e);var n=$t(this,t.call(this,A,i));return n.mouseused_=!1,n.on("mousedown",n.handleMouseDown),n}return qt(e,t),e.prototype.buildCSSClass=function(){return"vjs-big-play-button"},e.prototype.handleClick=function(t){var e=this.player_.play();if(this.mouseused_&&t.clientX&&t.clientY)nt(e);else{var A=this.player_.getChild("controlBar"),i=A&&A.getChild("playToggle");if(i){var n=function(){return i.focus()};it(e)?e.then(n,function(){}):this.setTimeout(n,1)}else this.player_.focus()}},e.prototype.handleKeyPress=function(e){this.mouseused_=!1,t.prototype.handleKeyPress.call(this,e)},e.prototype.handleMouseDown=function(t){this.mouseused_=!0},e}(Pi);_i.prototype.controlText_="Play Video",xe.registerComponent("BigPlayButton",_i);var Xi=function(t){function e(A,i){Zt(this,e);var n=$t(this,t.call(this,A,i));return n.controlText(i&&i.controlText||n.localize("Close")),n}return qt(e,t),e.prototype.buildCSSClass=function(){return"vjs-close-button "+t.prototype.buildCSSClass.call(this)},e.prototype.handleClick=function(t){this.trigger({type:"close",bubbles:!1})},e}(Pi);xe.registerComponent("CloseButton",Xi);var Vi=function(t){function e(A,i){Zt(this,e);var n=$t(this,t.call(this,A,i));return n.on(A,"play",n.handlePlay),n.on(A,"pause",n.handlePause),n.on(A,"ended",n.handleEnded),n}return qt(e,t),e.prototype.buildCSSClass=function(){return"vjs-play-control "+t.prototype.buildCSSClass.call(this)},e.prototype.handleClick=function(t){this.player_.paused()?this.player_.play():this.player_.pause()},e.prototype.handleSeeked=function(t){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(t):this.handlePlay(t)},e.prototype.handlePlay=function(t){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.controlText("Pause")},e.prototype.handlePause=function(t){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("Play")},e.prototype.handleEnded=function(t){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.controlText("Replay"),this.one(this.player_,"seeked",this.handleSeeked)},e}(Pi);Vi.prototype.controlText_="Play",xe.registerComponent("PlayToggle",Vi);var Wi=function(t,e){t=t<0?0:t;var A=Math.floor(t%60),i=Math.floor(t/60%60),n=Math.floor(t/3600),r=Math.floor(e/60%60),a=Math.floor(e/3600);return(isNaN(t)||t===1/0)&&(n=i=A="-"),(n=n>0||a>0?n+":":"")+(i=((n||r>=10)&&i<10?"0"+i:i)+":")+(A=A<10?"0"+A:A)},Ki=Wi,Zi=function(t){function e(A,i){Zt(this,e);var n=$t(this,t.call(this,A,i));return n.throttledUpdateContent=Ne(Ee(n,n.updateContent),25),n.on(A,"timeupdate",n.throttledUpdateContent),n}return qt(e,t),e.prototype.createEl=function(e){var A=this.buildCSSClass(),i=t.prototype.createEl.call(this,"div",{className:A+" vjs-time-control vjs-control",innerHTML:''+this.localize(this.labelText_)+" "});return this.contentEl_=I("span",{className:A+"-display"},{"aria-live":"off"}),this.updateTextNode_(),i.appendChild(this.contentEl_),i},e.prototype.dispose=function(){this.contentEl_=null,this.textNode_=null,t.prototype.dispose.call(this)},e.prototype.updateTextNode_=function(){if(this.contentEl_){for(;this.contentEl_.firstChild;)this.contentEl_.removeChild(this.contentEl_.firstChild);this.textNode_=Ht.createTextNode(this.formattedTime_||this.formatTime_(0)),this.contentEl_.appendChild(this.textNode_)}},e.prototype.formatTime_=function(t){return Lt(t)},e.prototype.updateFormattedTime_=function(t){var e=this.formatTime_(t);e!==this.formattedTime_&&(this.formattedTime_=e,this.requestAnimationFrame(this.updateTextNode_))},e.prototype.updateContent=function(t){},e}(xe);Zi.prototype.labelText_="Time",Zi.prototype.controlText_="Time",xe.registerComponent("TimeDisplay",Zi);var qi=function(t){function e(A,i){Zt(this,e);var n=$t(this,t.call(this,A,i));return n.on(A,"ended",n.handleEnded),n}return qt(e,t),e.prototype.buildCSSClass=function(){return"vjs-current-time"},e.prototype.updateContent=function(t){var e=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();this.updateFormattedTime_(e)},e.prototype.handleEnded=function(t){this.player_.duration()&&this.updateFormattedTime_(this.player_.duration())},e}(Zi);qi.prototype.labelText_="Current Time",qi.prototype.controlText_="Current Time",xe.registerComponent("CurrentTimeDisplay",qi);var $i=function(t){function e(A,i){Zt(this,e);var n=$t(this,t.call(this,A,i));return n.on(A,"durationchange",n.updateContent),n.on(A,"loadedmetadata",n.throttledUpdateContent),n}return qt(e,t),e.prototype.buildCSSClass=function(){return"vjs-duration"},e.prototype.updateContent=function(t){var e=this.player_.duration();e&&this.duration_!==e&&(this.duration_=e,this.updateFormattedTime_(e))},e}(Zi);$i.prototype.labelText_="Duration",$i.prototype.controlText_="Duration",xe.registerComponent("DurationDisplay",$i);var tn=function(t){function e(){return Zt(this,e),$t(this,t.apply(this,arguments))}return qt(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider",innerHTML:"
/
"})},e}(xe);xe.registerComponent("TimeDivider",tn);var en=function(t){function e(A,i){Zt(this,e);var n=$t(this,t.call(this,A,i));return n.on(A,"durationchange",n.throttledUpdateContent),n.on(A,"ended",n.handleEnded),n}return qt(e,t),e.prototype.buildCSSClass=function(){return"vjs-remaining-time"},e.prototype.formatTime_=function(e){return"-"+t.prototype.formatTime_.call(this,e)},e.prototype.updateContent=function(t){this.player_.duration()&&(this.player_.remainingTimeDisplay?this.updateFormattedTime_(this.player_.remainingTimeDisplay()):this.updateFormattedTime_(this.player_.remainingTime()))},e.prototype.handleEnded=function(t){this.player_.duration()&&this.updateFormattedTime_(0)},e}(Zi);en.prototype.labelText_="Remaining Time",en.prototype.controlText_="Remaining Time",xe.registerComponent("RemainingTimeDisplay",en);var An=function(t){function e(A,i){Zt(this,e);var n=$t(this,t.call(this,A,i));return n.updateShowing(),n.on(n.player(),"durationchange",n.updateShowing),n}return qt(e,t),e.prototype.createEl=function(){var e=t.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});return this.contentEl_=I("div",{className:"vjs-live-display",innerHTML:''+this.localize("Stream Type")+" "+this.localize("LIVE")},{"aria-live":"off"}),e.appendChild(this.contentEl_),e},e.prototype.dispose=function(){this.contentEl_=null,t.prototype.dispose.call(this)},e.prototype.updateShowing=function(t){this.player().duration()===1/0?this.show():this.hide()},e}(xe);xe.registerComponent("LiveDisplay",An);var nn=function(t){function e(A,i){Zt(this,e);var n=$t(this,t.call(this,A,i));return n.bar=n.getChild(n.options_.barName),n.vertical(!!n.options_.vertical),n.enable(),n}return qt(e,t),e.prototype.enabled=function(){return this.enabled_},e.prototype.enable=function(){this.enabled()||(this.on("mousedown",this.handleMouseDown),this.on("touchstart",this.handleMouseDown),this.on("focus",this.handleFocus),this.on("blur",this.handleBlur),this.on("click",this.handleClick),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)},e.prototype.disable=function(){if(this.enabled()){var t=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown),this.off("touchstart",this.handleMouseDown),this.off("focus",this.handleFocus),this.off("blur",this.handleBlur),this.off("click",this.handleClick),this.off(this.player_,"controlsvisible",this.update),this.off(t,"mousemove",this.handleMouseMove),this.off(t,"mouseup",this.handleMouseUp),this.off(t,"touchmove",this.handleMouseMove),this.off(t,"touchend",this.handleMouseUp),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}},e.prototype.createEl=function(e){var A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return A.className=A.className+" vjs-slider",A=i({tabIndex:0},A),n=i({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},n),t.prototype.createEl.call(this,e,A,n)},e.prototype.handleMouseDown=function(t){var e=this.bar.el_.ownerDocument;"mousedown"===t.type&&t.preventDefault(),"touchstart"!==t.type||_e||t.preventDefault(),p(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(e,"mousemove",this.handleMouseMove),this.on(e,"mouseup",this.handleMouseUp),this.on(e,"touchmove",this.handleMouseMove),this.on(e,"touchend",this.handleMouseUp),this.handleMouseMove(t)},e.prototype.handleMouseMove=function(t){},e.prototype.handleMouseUp=function(){var t=this.bar.el_.ownerDocument;m(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(t,"mousemove",this.handleMouseMove),this.off(t,"mouseup",this.handleMouseUp),this.off(t,"touchmove",this.handleMouseMove),this.off(t,"touchend",this.handleMouseUp),this.update()},e.prototype.update=function(){if(this.el_){var t=this.getPercent(),e=this.bar;if(e){("number"!=typeof t||t!=t||t<0||t===1/0)&&(t=0);var A=(100*t).toFixed(2)+"%",i=e.el().style;return this.vertical()?i.height=A:i.width=A,t}}},e.prototype.calculateDistance=function(t){var e=L(this.el_,t);return this.vertical()?e.y:e.x},e.prototype.handleFocus=function(){this.on(this.bar.el_.ownerDocument,"keydown",this.handleKeyPress)},e.prototype.handleKeyPress=function(t){37===t.which||40===t.which?(t.preventDefault(),this.stepBack()):38!==t.which&&39!==t.which||(t.preventDefault(),this.stepForward())},e.prototype.handleBlur=function(){this.off(this.bar.el_.ownerDocument,"keydown",this.handleKeyPress)},e.prototype.handleClick=function(t){t.stopImmediatePropagation(),t.preventDefault()},e.prototype.vertical=function(t){if(void 0===t)return this.vertical_||!1;this.vertical_=!!t,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")},e}(xe);xe.registerComponent("Slider",nn);var rn=function(t){function e(A,i){Zt(this,e);var n=$t(this,t.call(this,A,i));return n.partEls_=[],n.on(A,"progress",n.update),n}return qt(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-load-progress",innerHTML:''+this.localize("Loaded")+": 0%"})},e.prototype.dispose=function(){this.partEls_=null,t.prototype.dispose.call(this)},e.prototype.update=function(t){var e=this.player_.buffered(),A=this.player_.duration(),i=this.player_.bufferedEnd(),n=this.partEls_,r=function(t,e){var A=t/e||0;return 100*(A>=1?1:A)+"%"};this.el_.style.width=r(i,A);for(var a=0;ae.length;M--)this.el_.removeChild(n[M-1]);n.length=e.length},e}(xe);xe.registerComponent("LoadProgressBar",rn);var an=function(t){function e(){return Zt(this,e),$t(this,t.apply(this,arguments))}return qt(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"})},e.prototype.update=function(t,e,A){var i=w(this.el_),n=w(this.player_.el()),r=t.width*e;if(n&&i){var a=t.left-n.left+r,o=t.width-r+(n.right-t.right),s=i.width/2;ai.width&&(s=i.width),this.el_.style.right="-"+s+"px",l(this.el_,A)}},e}(xe);xe.registerComponent("TimeTooltip",an);var on=function(t){function e(){return Zt(this,e),$t(this,t.apply(this,arguments))}return qt(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar",innerHTML:''+this.localize("Progress")+": 0%"})},e.prototype.update=function(t,e){var A=this;this.rafId_&&this.cancelAnimationFrame(this.rafId_),this.rafId_=this.requestAnimationFrame(function(){var i=Lt(A.player_.scrubbing()?A.player_.getCache().currentTime:A.player_.currentTime(),A.player_.duration()),n=A.getChild("timeTooltip");n&&n.update(t,e,i)})},e}(xe);on.prototype.options_={children:[]},ke||Re||on.prototype.options_.children.push("timeTooltip"),xe.registerComponent("PlayProgressBar",on);var sn=function(t){function e(A,i){Zt(this,e);var n=$t(this,t.call(this,A,i));return n.update=Ne(Ee(n,n.update),25),n}return qt(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},e.prototype.update=function(t,e){var A=this;this.rafId_&&this.cancelAnimationFrame(this.rafId_),this.rafId_=this.requestAnimationFrame(function(){var i=A.player_.duration(),n=Lt(e*i,i);A.el_.style.left=t.width*e+"px",A.getChild("timeTooltip").update(t,e,n)})},e}(xe);sn.prototype.options_={children:["timeTooltip"]},xe.registerComponent("MouseTimeDisplay",sn);var gn=function(t){function e(A,i){Zt(this,e);var n=$t(this,t.call(this,A,i));return n.setEventHandlers_(),n}return qt(e,t),e.prototype.setEventHandlers_=function(){var t=this;this.update=Ne(Ee(this,this.update),30),this.on(this.player_,"timeupdate",this.update),this.on(this.player_,"ended",this.handleEnded),this.updateInterval=null,this.on(this.player_,["playing"],function(){t.clearInterval(t.updateInterval),t.updateInterval=t.setInterval(function(){t.requestAnimationFrame(function(){t.update()})},30)}),this.on(this.player_,["ended","pause","waiting"],function(){t.clearInterval(t.updateInterval)}),this.on(this.player_,["timeupdate","ended"],this.update)},e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},e.prototype.update_=function(t,e){var A=this.player_.duration();this.el_.setAttribute("aria-valuenow",(100*e).toFixed(2)),this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[Lt(t,A),Lt(A,A)],"{1} of {2}")),this.bar.update(w(this.el_),e)},e.prototype.update=function(e){var A=t.prototype.update.call(this);return this.update_(this.getCurrentTime_(),A),A},e.prototype.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()},e.prototype.handleEnded=function(t){this.update_(this.player_.duration(),1)},e.prototype.getPercent=function(){var t=this.getCurrentTime_()/this.player_.duration();return t>=1?1:t||0},e.prototype.handleMouseDown=function(e){U(e)&&(e.stopPropagation(),this.player_.scrubbing(!0),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),t.prototype.handleMouseDown.call(this,e))},e.prototype.handleMouseMove=function(t){if(U(t)){var e=this.calculateDistance(t)*this.player_.duration();e===this.player_.duration()&&(e-=.1),this.player_.currentTime(e)}},e.prototype.enable=function(){t.prototype.enable.call(this);var e=this.getChild("mouseTimeDisplay");e&&e.show()},e.prototype.disable=function(){t.prototype.disable.call(this);var e=this.getChild("mouseTimeDisplay");e&&e.hide()},e.prototype.handleMouseUp=function(e){t.prototype.handleMouseUp.call(this,e),e&&e.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying&&nt(this.player_.play())},e.prototype.stepForward=function(){this.player_.currentTime(this.player_.currentTime()+5)},e.prototype.stepBack=function(){this.player_.currentTime(this.player_.currentTime()-5)},e.prototype.handleAction=function(t){this.player_.paused()?this.player_.play():this.player_.pause()},e.prototype.handleKeyPress=function(e){32===e.which||13===e.which?(e.preventDefault(),this.handleAction(e)):t.prototype.handleKeyPress&&t.prototype.handleKeyPress.call(this,e)},e}(nn);gn.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},ke||Re||gn.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),gn.prototype.playerEvent="timeupdate",xe.registerComponent("SeekBar",gn);var Mn=function(t){function e(A,i){Zt(this,e);var n=$t(this,t.call(this,A,i));return n.handleMouseMove=Ne(Ee(n,n.handleMouseMove),25),n.throttledHandleMouseSeek=Ne(Ee(n,n.handleMouseSeek),25),n.enable(),n}return qt(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},e.prototype.handleMouseMove=function(t){var e=this.getChild("seekBar");if(e){var A=e.getChild("mouseTimeDisplay"),i=e.el(),n=w(i),r=L(i,t).x;r>1?r=1:r<0&&(r=0),A&&A.update(n,r)}},e.prototype.handleMouseSeek=function(t){var e=this.getChild("seekBar");e&&e.handleMouseMove(t)},e.prototype.enabled=function(){return this.enabled_},e.prototype.disable=function(){this.children().forEach(function(t){return t.disable&&t.disable()}),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDown),this.off(this.el_,"mousemove",this.handleMouseMove),this.handleMouseUp(),this.addClass("disabled"),this.enabled_=!1)},e.prototype.enable=function(){this.children().forEach(function(t){return t.enable&&t.enable()}),this.enabled()||(this.on(["mousedown","touchstart"],this.handleMouseDown),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)},e.prototype.handleMouseDown=function(t){var e=this.el_.ownerDocument,A=this.getChild("seekBar");A&&A.handleMouseDown(t),this.on(e,"mousemove",this.throttledHandleMouseSeek),this.on(e,"touchmove",this.throttledHandleMouseSeek),this.on(e,"mouseup",this.handleMouseUp),this.on(e,"touchend",this.handleMouseUp)},e.prototype.handleMouseUp=function(t){var e=this.el_.ownerDocument,A=this.getChild("seekBar");A&&A.handleMouseUp(t),this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUp),this.off(e,"touchend",this.handleMouseUp)},e}(xe);Mn.prototype.options_={children:["seekBar"]},xe.registerComponent("ProgressControl",Mn);var cn=function(t){function e(A,i){Zt(this,e);var n=$t(this,t.call(this,A,i));return n.on(A,"fullscreenchange",n.handleFullscreenChange),!1===Ht[$e.fullscreenEnabled]&&n.disable(),n}return qt(e,t),e.prototype.buildCSSClass=function(){return"vjs-fullscreen-control "+t.prototype.buildCSSClass.call(this)},e.prototype.handleFullscreenChange=function(t){this.player_.isFullscreen()?this.controlText("Non-Fullscreen"):this.controlText("Fullscreen")},e.prototype.handleClick=function(t){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()},e}(Pi);cn.prototype.controlText_="Fullscreen",xe.registerComponent("FullscreenToggle",cn);var un=function(t,e){e.tech_&&!e.tech_.featuresVolumeControl&&t.addClass("vjs-hidden"),t.on(e,"loadstart",function(){e.tech_.featuresVolumeControl?t.removeClass("vjs-hidden"):t.addClass("vjs-hidden")})},In=function(t){function e(){return Zt(this,e),$t(this,t.apply(this,arguments))}return qt(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-volume-level",innerHTML:''})},e}(xe);xe.registerComponent("VolumeLevel",In);var ln=function(t){function e(A,i){Zt(this,e);var n=$t(this,t.call(this,A,i));return n.on("slideractive",n.updateLastVolume_),n.on(A,"volumechange",n.updateARIAAttributes),A.ready(function(){return n.updateARIAAttributes()}),n}return qt(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})},e.prototype.handleMouseDown=function(e){U(e)&&t.prototype.handleMouseDown.call(this,e)},e.prototype.handleMouseMove=function(t){U(t)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(t)))},e.prototype.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1)},e.prototype.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},e.prototype.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)},e.prototype.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)},e.prototype.updateARIAAttributes=function(t){var e=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",e),this.el_.setAttribute("aria-valuetext",e+"%")},e.prototype.volumeAsPercentage_=function(){return Math.round(100*this.player_.volume())},e.prototype.updateLastVolume_=function(){var t=this,e=this.player_.volume();this.one("sliderinactive",function(){0===t.player_.volume()&&t.player_.lastVolume_(e)})},e}(nn);ln.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},ln.prototype.playerEvent="volumechange",xe.registerComponent("VolumeBar",ln);var hn=function(t){function e(A){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Zt(this,e),i.vertical=i.vertical||!1,(void 0===i.volumeBar||r(i.volumeBar))&&(i.volumeBar=i.volumeBar||{},i.volumeBar.vertical=i.vertical);var n=$t(this,t.call(this,A,i));return un(n,A),n.throttledHandleMouseMove=Ne(Ee(n,n.handleMouseMove),25),n.on("mousedown",n.handleMouseDown),n.on("touchstart",n.handleMouseDown),n.on(n.volumeBar,["focus","slideractive"],function(){n.volumeBar.addClass("vjs-slider-active"),n.addClass("vjs-slider-active"),n.trigger("slideractive")}),n.on(n.volumeBar,["blur","sliderinactive"],function(){n.volumeBar.removeClass("vjs-slider-active"),n.removeClass("vjs-slider-active"),n.trigger("sliderinactive")}),n}return qt(e,t),e.prototype.createEl=function(){var e="vjs-volume-horizontal";return this.options_.vertical&&(e="vjs-volume-vertical"),t.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control "+e})},e.prototype.handleMouseDown=function(t){var e=this.el_.ownerDocument;this.on(e,"mousemove",this.throttledHandleMouseMove),this.on(e,"touchmove",this.throttledHandleMouseMove),this.on(e,"mouseup",this.handleMouseUp),this.on(e,"touchend",this.handleMouseUp)},e.prototype.handleMouseUp=function(t){var e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseMove),this.off(e,"touchmove",this.throttledHandleMouseMove),this.off(e,"mouseup",this.handleMouseUp),this.off(e,"touchend",this.handleMouseUp)},e.prototype.handleMouseMove=function(t){this.volumeBar.handleMouseMove(t)},e}(xe);hn.prototype.options_={children:["volumeBar"]},xe.registerComponent("VolumeControl",hn);var dn=function(t,e){e.tech_&&!e.tech_.featuresMuteControl&&t.addClass("vjs-hidden"),t.on(e,"loadstart",function(){e.tech_.featuresMuteControl?t.removeClass("vjs-hidden"):t.addClass("vjs-hidden")})},Tn=function(t){function e(A,i){Zt(this,e);var n=$t(this,t.call(this,A,i));return dn(n,A),n.on(A,["loadstart","volumechange"],n.update),n}return qt(e,t),e.prototype.buildCSSClass=function(){return"vjs-mute-control "+t.prototype.buildCSSClass.call(this)},e.prototype.handleClick=function(t){var e=this.player_.volume(),A=this.player_.lastVolume_();if(0===e){var i=A<.1?.1:A;this.player_.volume(i),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())},e.prototype.update=function(t){this.updateIcon_(),this.updateControlText_()},e.prototype.updateIcon_=function(){var t=this.player_.volume(),e=3;ke&&this.player_.muted(this.player_.tech_.el_.muted),0===t||this.player_.muted()?e=0:t<.33?e=1:t<.67&&(e=2);for(var A=0;A<4;A++)E(this.el_,"vjs-vol-"+A);T(this.el_,"vjs-vol-"+e)},e.prototype.updateControlText_=function(){var t=this.player_.muted()||0===this.player_.volume()?"Unmute":"Mute";this.controlText()!==t&&this.controlText(t)},e}(Pi);Tn.prototype.controlText_="Mute",xe.registerComponent("MuteToggle",Tn);var En=function(t){function e(A){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Zt(this,e),void 0!==i.inline?i.inline=i.inline:i.inline=!0,(void 0===i.volumeControl||r(i.volumeControl))&&(i.volumeControl=i.volumeControl||{},i.volumeControl.vertical=!i.inline);var n=$t(this,t.call(this,A,i));return n.on(A,["loadstart"],n.volumePanelState_),n.on(n.volumeControl,["slideractive"],n.sliderActive_),n.on(n.volumeControl,["sliderinactive"],n.sliderInactive_),n}return qt(e,t),e.prototype.sliderActive_=function(){this.addClass("vjs-slider-active")},e.prototype.sliderInactive_=function(){this.removeClass("vjs-slider-active")},e.prototype.volumePanelState_=function(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")},e.prototype.createEl=function(){var e="vjs-volume-panel-horizontal";return this.options_.inline||(e="vjs-volume-panel-vertical"),t.prototype.createEl.call(this,"div",{className:"vjs-volume-panel vjs-control "+e})},e}(xe);En.prototype.options_={children:["muteToggle","volumeControl"]},xe.registerComponent("VolumePanel",En);var Nn=function(t){function e(A,i){Zt(this,e);var n=$t(this,t.call(this,A,i));return i&&(n.menuButton_=i.menuButton),n.focusedChild_=-1,n.on("keydown",n.handleKeyPress),n}return qt(e,t),e.prototype.addItem=function(t){this.addChild(t),t.on("click",Ee(this,function(e){this.menuButton_&&(this.menuButton_.unpressButton(),"CaptionSettingsMenuItem"!==t.name()&&this.menuButton_.focus())}))},e.prototype.createEl=function(){var e=this.options_.contentElType||"ul";this.contentEl_=I(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");var A=t.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return A.appendChild(this.contentEl_),H(A,"click",function(t){t.preventDefault(),t.stopImmediatePropagation()}),A},e.prototype.dispose=function(){this.contentEl_=null,t.prototype.dispose.call(this)},e.prototype.handleKeyPress=function(t){37===t.which||40===t.which?(t.preventDefault(),this.stepForward()):38!==t.which&&39!==t.which||(t.preventDefault(),this.stepBack())},e.prototype.stepForward=function(){var t=0;void 0!==this.focusedChild_&&(t=this.focusedChild_+1),this.focus(t)},e.prototype.stepBack=function(){var t=0;void 0!==this.focusedChild_&&(t=this.focusedChild_-1),this.focus(t)},e.prototype.focus=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=this.children().slice();e.length&&e[0].className&&/vjs-menu-title/.test(e[0].className)&&e.shift(),e.length>0&&(t<0?t=0:t>=e.length&&(t=e.length-1),this.focusedChild_=t,e[t].el_.focus())},e}(xe);xe.registerComponent("Menu",Nn);var fn=function(t){function e(A){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Zt(this,e);var n=$t(this,t.call(this,A,i));n.menuButton_=new Pi(A,i),n.menuButton_.controlText(n.controlText_),n.menuButton_.el_.setAttribute("aria-haspopup","true");var r=Pi.prototype.buildCSSClass();return n.menuButton_.el_.className=n.buildCSSClass()+" "+r,n.menuButton_.removeClass("vjs-control"),n.addChild(n.menuButton_),n.update(),n.enabled_=!0,n.on(n.menuButton_,"tap",n.handleClick),n.on(n.menuButton_,"click",n.handleClick),n.on(n.menuButton_,"focus",n.handleFocus),n.on(n.menuButton_,"blur",n.handleBlur),n.on("keydown",n.handleSubmenuKeyPress),n}return qt(e,t),e.prototype.update=function(){var t=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=t,this.addChild(t),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?this.hide():this.show()},e.prototype.createMenu=function(){var t=new Nn(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var e=I("li",{className:"vjs-menu-title",innerHTML:K(this.options_.title),tabIndex:-1});this.hideThreshold_+=1,t.children_.unshift(e),h(e,t.contentEl())}if(this.items=this.createItems(),this.items)for(var A=0;A1&&void 0!==arguments[1]?arguments[1]:this.menuButton_.el();return this.menuButton_.controlText(t,e)},e.prototype.handleClick=function(t){this.one(this.menu.contentEl(),"mouseleave",Ee(this,function(t){this.unpressButton(),this.el_.blur()})),this.buttonPressed_?this.unpressButton():this.pressButton()},e.prototype.focus=function(){this.menuButton_.focus()},e.prototype.blur=function(){this.menuButton_.blur()},e.prototype.handleFocus=function(){H(Ht,"keydown",Ee(this,this.handleKeyPress))},e.prototype.handleBlur=function(){J(Ht,"keydown",Ee(this,this.handleKeyPress))},e.prototype.handleKeyPress=function(t){27===t.which||9===t.which?(this.buttonPressed_&&this.unpressButton(),9!==t.which&&(t.preventDefault(),this.menuButton_.el_.focus())):38!==t.which&&40!==t.which||this.buttonPressed_||(this.pressButton(),t.preventDefault())},e.prototype.handleSubmenuKeyPress=function(t){27!==t.which&&9!==t.which||(this.buttonPressed_&&this.unpressButton(),9!==t.which&&(t.preventDefault(),this.menuButton_.el_.focus()))},e.prototype.pressButton=function(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),ke&&c())return;this.menu.focus()}},e.prototype.unpressButton=function(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","false"))},e.prototype.disable=function(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()},e.prototype.enable=function(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()},e}(xe);xe.registerComponent("MenuButton",fn);var Cn=function(t){function e(A,i){Zt(this,e);var n=i.tracks,r=$t(this,t.call(this,A,i));if(r.items.length<=1&&r.hide(),!n)return $t(r);var a=Ee(r,r.update);return n.addEventListener("removetrack",a),n.addEventListener("addtrack",a),r.player_.on("ready",a),r.player_.on("dispose",function(){n.removeEventListener("removetrack",a),n.removeEventListener("addtrack",a)}),r}return qt(e,t),e}(fn);xe.registerComponent("TrackButton",Cn);var yn=function(t){function e(A,i){Zt(this,e);var n=$t(this,t.call(this,A,i));return n.selectable=i.selectable,n.isSelected_=i.selected||!1,n.multiSelectable=i.multiSelectable,n.selected(n.isSelected_),n.selectable?n.multiSelectable?n.el_.setAttribute("role","menuitemcheckbox"):n.el_.setAttribute("role","menuitemradio"):n.el_.setAttribute("role","menuitem"),n}return qt(e,t),e.prototype.createEl=function(e,A,n){return this.nonIconControl=!0,t.prototype.createEl.call(this,"li",i({className:"vjs-menu-item",innerHTML:''+this.localize(this.options_.label)+"",tabIndex:-1},A),n)},e.prototype.handleClick=function(t){this.selected(!0)},e.prototype.selected=function(t){this.selectable&&(t?(this.addClass("vjs-selected"),this.el_.setAttribute("aria-checked","true"),this.controlText(", selected"),this.isSelected_=!0):(this.removeClass("vjs-selected"),this.el_.setAttribute("aria-checked","false"),this.controlText(""),this.isSelected_=!1))},e}(Fi);xe.registerComponent("MenuItem",yn);var Dn=function(t){function e(A,i){Zt(this,e);var n=i.track,r=A.textTracks();i.label=n.label||n.language||"Unknown",i.selected="showing"===n.mode;var a=$t(this,t.call(this,A,i));a.track=n;var o=function(){for(var t=arguments.length,e=Array(t),A=0;A-1?"showing"!==a.mode&&(a.mode="showing"):"disabled"!==a.mode&&(a.mode="disabled")}},e.prototype.handleTracksChange=function(t){var e="showing"===this.track.mode;e!==this.isSelected_&&this.selected(e)},e.prototype.handleSelectedLanguageChange=function(t){if("showing"===this.track.mode){var e=this.player_.cache_.selectedLanguage;if(e&&e.enabled&&e.language===this.track.language&&e.kind!==this.track.kind)return;this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind}}},e.prototype.dispose=function(){this.track=null,t.prototype.dispose.call(this)},e}(yn);xe.registerComponent("TextTrackMenuItem",Dn);var Bn=function(t){function e(A,i){return Zt(this,e),i.track={player:A,kind:i.kind,kinds:i.kinds,default:!1,mode:"disabled"},i.kinds||(i.kinds=[i.kind]),i.label?i.track.label=i.label:i.track.label=i.kinds.join(" and ")+" off",i.selectable=!0,i.multiSelectable=!1,$t(this,t.call(this,A,i))}return qt(e,t),e.prototype.handleTracksChange=function(t){for(var e=this.player().textTracks(),A=!0,i=0,n=e.length;i-1&&"showing"===r.mode){A=!1;break}}A!==this.isSelected_&&this.selected(A)},e.prototype.handleSelectedLanguageChange=function(t){for(var e=this.player().textTracks(),A=!0,i=0,n=e.length;i-1&&"showing"===r.mode){A=!1;break}}A&&(this.player_.cache_.selectedLanguage={enabled:!1})},e}(Dn);xe.registerComponent("OffTextTrackMenuItem",Bn);var pn=function(t){function e(A){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Zt(this,e),i.tracks=A.textTracks(),$t(this,t.call(this,A,i))}return qt(e,t),e.prototype.createItems=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Dn,A=void 0;this.label_&&(A=this.label_+" off"),t.push(new Bn(this.player_,{kinds:this.kinds_,kind:this.kind_,label:A})),this.hideThreshold_+=1;var i=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(var n=0;n-1){var a=new e(this.player_,{track:r,selectable:!0,multiSelectable:!1});a.addClass("vjs-"+r.kind+"-menu-item"),t.push(a)}}return t},e}(Cn);xe.registerComponent("TextTrackButton",pn);var mn=function(t){function e(A,i){Zt(this,e);var n=i.track,r=i.cue,a=A.currentTime();i.selectable=!0,i.multiSelectable=!1,i.label=r.text,i.selected=r.startTime<=a&&a=0;e--){var A=t[e];if(A.kind===this.kind_)return A}},e.prototype.getMenuCaption=function(){return this.track_&&this.track_.label?this.track_.label:this.localize(K(this.kind_))},e.prototype.createMenu=function(){return this.options_.title=this.getMenuCaption(),t.prototype.createMenu.call(this)},e.prototype.createItems=function(){var t=[];if(!this.track_)return t;var e=this.track_.cues;if(!e)return t;for(var A=0,i=e.length;A