oraInstreamConfig = {tag:'https://pubads.g.doubleclick.net/gampad/ads?iu=/323841319/abqjournal_large/Preroll&description_url='+window.location.protocol+'\/\/'+window.location.host+'&env=vp&impl=s&correlator=&tfcd=0&gdfp_req=1&output=vast&sz=640x480&unviewed_position_start=1'};var linkElement = document.createElement('link');linkElement.setAttribute('rel', 'stylesheet');linkElement.setAttribute('href', 'https://f.ora.tv/c/ora-instream.min.css');document.getElementsByTagName('head')[0].appendChild(linkElement);if(document.getElementsByClassName('ora-player-container').length==0){document.write('<div style="overflow:hidden" class="ora-player-container"><ora-instream></ora-instream></div>');} var ora_height=Math.round((document.querySelector('div.ora-player-container').clientWidth/16)*9);document.querySelector('div.ora-player-container').style.height=ora_height+'px';!function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=28)}([function(t,e,n){
/**
 * @license
 * Video.js 6.10.3 <http://videojs.com/>
 * Copyright Brightcove, Inc. <https://www.brightcove.com/>
 * Available under Apache License Version 2.0
 * <https://github.com/videojs/video.js/blob/master/LICENSE>
 *
 * Includes vtt.js <https://github.com/mozilla/vtt.js>
 * Available under Apache License Version 2.0
 * <https://github.com/mozilla/vtt.js/blob/master/LICENSE>
 */
function r(t){return t&&"object"==typeof t&&"default"in t?t.default:t}var i=r(n(1)),o=r(n(2)),s=r(n(26)),a=r(n(25)),l=r(n(24)),c=r(n(17)),u="6.10.3",h=i.navigator&&i.navigator.userAgent||"",d=/AppleWebKit\/([\d.]+)/i.exec(h),p=d?parseFloat(d.pop()):null,f=/iPad/i.test(h),y=/iPhone/i.test(h)&&!f,v=/iPod/i.test(h),g=y||f||v,m=function(){var t=h.match(/OS (\d+)_/i);return t&&t[1]?t[1]:null}(),_=/Android/i.test(h),b=function(){var t=h.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!t)return null;var e=t[1]&&parseFloat(t[1]),n=t[2]&&parseFloat(t[2]);return e&&n?parseFloat(t[1]+"."+t[2]):e||null}(),T=_&&/webkit/i.test(h)&&b<2.3,C=_&&b<5&&p<537,k=/Firefox/i.test(h),E=/Edge/i.test(h),w=!E&&/Chrome/i.test(h),A=function(){var t=h.match(/Chrome\/(\d+)/);return t&&t[1]?parseFloat(t[1]):null}(),S=/MSIE\s8\.0/.test(h),P=function(){var t=/MSIE\s(\d+)\.\d/.exec(h),e=t&&parseFloat(t[1]);return!e&&/Trident\/7.0/i.test(h)&&/rv:11.0/.test(h)&&(e=11),e}(),j=/Safari/i.test(h)&&!w&&!_&&!E,x=j||g,M=tt()&&("ontouchstart"in i||i.DocumentTouch&&i.document instanceof i.DocumentTouch),L=tt()&&"backgroundSize"in i.document.createElement("video").style,D=(Object.freeze||Object)({IS_IPAD:f,IS_IPHONE:y,IS_IPOD:v,IS_IOS:g,IOS_VERSION:m,IS_ANDROID:_,ANDROID_VERSION:b,IS_OLD_ANDROID:T,IS_NATIVE_ANDROID:C,IS_FIREFOX:k,IS_EDGE:E,IS_CHROME:w,CHROME_VERSION:A,IS_IE8:S,IE_VERSION:P,IS_SAFARI:j,IS_ANY_SAFARI:x,TOUCH_ENABLED:M,BACKGROUND_SIZE_SUPPORTED:L}),R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},I=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},O=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},N=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},B=function(t,e){return t.raw=e,t},F=Object.prototype.toString,H=function(t){return U(t)?Object.keys(t):[]};function V(t,e){H(t).forEach(function(n){return e(t[n],n)})}function W(t){for(var e=arguments.length,n=Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return Object.assign?Object.assign.apply(Object,[t].concat(n)):(n.forEach(function(e){e&&V(e,function(e,n){t[n]=e})}),t)}function U(t){return!!t&&"object"===(void 0===t?"undefined":R(t))}function z(t){return U(t)&&"[object Object]"===F.call(t)&&t.constructor===Object}var q=void 0,X="info",K=[],$=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:!!P&&P<11,r=q.levels[X],o=new RegExp("^("+r+")$");if("log"!==t&&e.unshift(t.toUpperCase()+":"),K&&K.push([].concat(e)),e.unshift("VIDEOJS:"),i.console){var s=i.console[t];s||"debug"!==t||(s=i.console.info||i.console.log),s&&r&&o.test(t)&&(n&&(e=e.map(function(t){if(U(t)||Array.isArray(t))try{return JSON.stringify(t)}catch(e){return String(t)}return String(t)}).join(" ")),s.apply?s[Array.isArray(e)?"apply":"call"](i.console,e):s(e))}};(q=function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];$("log",e)}).levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:X},q.level=function(t){if("string"==typeof t){if(!q.levels.hasOwnProperty(t))throw new Error('"'+t+'" in not a valid log level');X=t}return X},q.history=function(){return K?[].concat(K):[]},q.history.clear=function(){K&&(K.length=0)},q.history.disable=function(){null!==K&&(K.length=0,K=null)},q.history.enable=function(){null===K&&(K=[])},q.error=function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];return $("error",e)},q.warn=function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];return $("warn",e)},q.debug=function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];return $("debug",e)};var G=q;function Y(t,e){if(!t||!e)return"";if("function"==typeof i.getComputedStyle){var n=i.getComputedStyle(t);return n?n[e]:""}return t.currentStyle[e]||""}var J=B(["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 "," to ","."],["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 "," to ","."]);function Q(t){return"string"==typeof t&&/\S/.test(t)}function Z(t){if(/\s/.test(t))throw new Error("class has illegal whitespace characters")}function tt(){return o===i.document&&void 0!==o.createElement}function et(t){return U(t)&&1===t.nodeType}function nt(){try{return i.parent!==i.self}catch(t){return!0}}function rt(t){return function(e,n){if(!Q(e))return o[t](null);Q(n)&&(n=o.querySelector(n));var r=et(n)?n:o;return r[t]&&r[t](e)}}function it(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments[3],i=o.createElement(t);return Object.getOwnPropertyNames(e).forEach(function(t){var n=e[t];-1!==t.indexOf("aria-")||"role"===t||"type"===t?(G.warn(s(J,t,n)),i.setAttribute(t,n)):"textContent"===t?ot(i,n):i[t]=n}),Object.getOwnPropertyNames(n).forEach(function(t){i.setAttribute(t,n[t])}),r&&Et(i,r),i}function ot(t,e){return void 0===t.textContent?t.innerText=e:t.textContent=e,t}function st(t,e){e.firstChild?e.insertBefore(t,e.firstChild):e.appendChild(t)}function at(t,e){return Z(e),t.classList?t.classList.contains(e):function(t){return new RegExp("(^|\\s)"+t+"($|\\s)")}(e).test(t.className)}function lt(t,e){return t.classList?t.classList.add(e):at(t,e)||(t.className=(t.className+" "+e).trim()),t}function ct(t,e){return t.classList?t.classList.remove(e):(Z(e),t.className=t.className.split(/\s+/).filter(function(t){return t!==e}).join(" ")),t}function ut(t,e,n){var r=at(t,e);if("function"==typeof n&&(n=n(t,e)),"boolean"!=typeof n&&(n=!r),n!==r)return n?lt(t,e):ct(t,e),t}function ht(t,e){Object.getOwnPropertyNames(e).forEach(function(n){var r=e[n];null===r||void 0===r||!1===r?t.removeAttribute(n):t.setAttribute(n,!0===r?"":r)})}function dt(t){var e={},n=",autoplay,controls,playsinline,loop,muted,default,defaultMuted,";if(t&&t.attributes&&t.attributes.length>0)for(var r=t.attributes,i=r.length-1;i>=0;i--){var o=r[i].name,s=r[i].value;"boolean"!=typeof t[o]&&-1===n.indexOf(","+o+",")||(s=null!==s),e[o]=s}return e}function pt(t,e){return t.getAttribute(e)}function ft(t,e,n){t.setAttribute(e,n)}function yt(t,e){t.removeAttribute(e)}function vt(){o.body.focus(),o.onselectstart=function(){return!1}}function gt(){o.onselectstart=function(){return!0}}function mt(t){if(t&&t.getBoundingClientRect&&t.parentNode){var e=t.getBoundingClientRect(),n={};return["bottom","height","left","right","top","width"].forEach(function(t){void 0!==e[t]&&(n[t]=e[t])}),n.height||(n.height=parseFloat(Y(t,"height"))),n.width||(n.width=parseFloat(Y(t,"width"))),n}}function _t(t){var e=void 0;if(t.getBoundingClientRect&&t.parentNode&&(e=t.getBoundingClientRect()),!e)return{left:0,top:0};var n=o.documentElement,r=o.body,s=n.clientLeft||r.clientLeft||0,a=i.pageXOffset||r.scrollLeft,l=e.left+a-s,c=n.clientTop||r.clientTop||0,u=i.pageYOffset||r.scrollTop,h=e.top+u-c;return{left:Math.round(l),top:Math.round(h)}}function bt(t,e){var n={},r=_t(t),i=t.offsetWidth,o=t.offsetHeight,s=r.top,a=r.left,l=e.pageY,c=e.pageX;return e.changedTouches&&(c=e.changedTouches[0].pageX,l=e.changedTouches[0].pageY),n.y=Math.max(0,Math.min(1,(s-l+o)/o)),n.x=Math.max(0,Math.min(1,(c-a)/i)),n}function Tt(t){return U(t)&&3===t.nodeType}function Ct(t){for(;t.firstChild;)t.removeChild(t.firstChild);return t}function kt(t){return"function"==typeof t&&(t=t()),(Array.isArray(t)?t:[t]).map(function(t){return"function"==typeof t&&(t=t()),et(t)||Tt(t)?t:"string"==typeof t&&/\S/.test(t)?o.createTextNode(t):void 0}).filter(function(t){return t})}function Et(t,e){return kt(e).forEach(function(e){return t.appendChild(e)}),t}function wt(t,e){return Et(Ct(t),e)}function At(t){return void 0===t.button&&void 0===t.buttons||(0===t.button&&void 0===t.buttons||(9===P||0===t.button&&1===t.buttons))}var St=rt("querySelector"),Pt=rt("querySelectorAll"),jt=(Object.freeze||Object)({isReal:tt,isEl:et,isInFrame:nt,createEl:it,textContent:ot,prependTo:st,hasClass:at,addClass:lt,removeClass:ct,toggleClass:ut,setAttributes:ht,getAttributes:dt,getAttribute:pt,setAttribute:ft,removeAttribute:yt,blockTextSelection:vt,unblockTextSelection:gt,getBoundingClientRect:mt,findPosition:_t,getPointerPosition:bt,isTextNode:Tt,emptyEl:Ct,normalizeContent:kt,appendContent:Et,insertContent:wt,isSingleLeftClick:At,$:St,$$:Pt}),xt=1;function Mt(){return xt++}var Lt={},Dt="vdata"+(new Date).getTime();function Rt(t){var e=t[Dt];return e||(e=t[Dt]=Mt()),Lt[e]||(Lt[e]={}),Lt[e]}function It(t){var e=t[Dt];return!!e&&!!Object.getOwnPropertyNames(Lt[e]).length}function Ot(t){var e=t[Dt];if(e){delete Lt[e];try{delete t[Dt]}catch(e){t.removeAttribute?t.removeAttribute(Dt):t[Dt]=null}}}function Nt(t,e){var n=Rt(t);0===n.handlers[e].length&&(delete n.handlers[e],t.removeEventListener?t.removeEventListener(e,n.dispatcher,!1):t.detachEvent&&t.detachEvent("on"+e,n.dispatcher)),Object.getOwnPropertyNames(n.handlers).length<=0&&(delete n.handlers,delete n.dispatcher,delete n.disabled),0===Object.getOwnPropertyNames(n).length&&Ot(t)}function Bt(t,e,n,r){n.forEach(function(n){t(e,n,r)})}function Ft(t){function e(){return!0}function n(){return!1}if(!t||!t.isPropagationStopped){var r=t||i.event;for(var s in t={},r)"layerX"!==s&&"layerY"!==s&&"keyLocation"!==s&&"webkitMovementX"!==s&&"webkitMovementY"!==s&&("returnValue"===s&&r.preventDefault||(t[s]=r[s]));if(t.target||(t.target=t.srcElement||o),t.relatedTarget||(t.relatedTarget=t.fromElement===t.target?t.toElement:t.fromElement),t.preventDefault=function(){r.preventDefault&&r.preventDefault(),t.returnValue=!1,r.returnValue=!1,t.defaultPrevented=!0},t.defaultPrevented=!1,t.stopPropagation=function(){r.stopPropagation&&r.stopPropagation(),t.cancelBubble=!0,r.cancelBubble=!0,t.isPropagationStopped=e},t.isPropagationStopped=n,t.stopImmediatePropagation=function(){r.stopImmediatePropagation&&r.stopImmediatePropagation(),t.isImmediatePropagationStopped=e,t.stopPropagation()},t.isImmediatePropagationStopped=n,null!==t.clientX&&void 0!==t.clientX){var a=o.documentElement,l=o.body;t.pageX=t.clientX+(a&&a.scrollLeft||l&&l.scrollLeft||0)-(a&&a.clientLeft||l&&l.clientLeft||0),t.pageY=t.clientY+(a&&a.scrollTop||l&&l.scrollTop||0)-(a&&a.clientTop||l&&l.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}var Ht=!1;!function(){try{var t=Object.defineProperty({},"passive",{get:function(){Ht=!0}});i.addEventListener("test",null,t),i.removeEventListener("test",null,t)}catch(t){}}();var Vt=["touchstart","touchmove"];function Wt(t,e,n){if(Array.isArray(e))return Bt(Wt,t,e,n);var r=Rt(t);if(r.handlers||(r.handlers={}),r.handlers[e]||(r.handlers[e]=[]),n.guid||(n.guid=Mt()),r.handlers[e].push(n),r.dispatcher||(r.disabled=!1,r.dispatcher=function(e,n){if(!r.disabled){e=Ft(e);var i=r.handlers[e.type];if(i)for(var o=i.slice(0),s=0,a=o.length;s<a&&!e.isImmediatePropagationStopped();s++)try{o[s].call(t,e,n)}catch(t){G.error(t)}}}),1===r.handlers[e].length)if(t.addEventListener){var i=!1;Ht&&Vt.indexOf(e)>-1&&(i={passive:!0}),t.addEventListener(e,r.dispatcher,i)}else t.attachEvent&&t.attachEvent("on"+e,r.dispatcher)}function Ut(t,e,n){if(It(t)){var r=Rt(t);if(r.handlers){if(Array.isArray(e))return Bt(Ut,t,e,n);var i=function(t,e){r.handlers[e]=[],Nt(t,e)};if(void 0!==e){var o=r.handlers[e];if(o)if(n){if(n.guid)for(var s=0;s<o.length;s++)o[s].guid===n.guid&&o.splice(s--,1);Nt(t,e)}else i(t,e)}else for(var a in r.handlers)Object.prototype.hasOwnProperty.call(r.handlers||{},a)&&i(t,a)}}}function zt(t,e,n){var r=It(t)?Rt(t):{},i=t.parentNode||t.ownerDocument;if("string"==typeof e?e={type:e,target:t}:e.target||(e.target=t),e=Ft(e),r.dispatcher&&r.dispatcher.call(t,e,n),i&&!e.isPropagationStopped()&&!0===e.bubbles)zt.call(null,i,e,n);else if(!i&&!e.defaultPrevented){var o=Rt(e.target);e.target[e.type]&&(o.disabled=!0,"function"==typeof e.target[e.type]&&e.target[e.type](),o.disabled=!1)}return!e.defaultPrevented}function qt(t,e,n){if(Array.isArray(e))return Bt(qt,t,e,n);var r=function r(){Ut(t,e,r),n.apply(this,arguments)};r.guid=n.guid=n.guid||Mt(),Wt(t,e,r)}var Xt=(Object.freeze||Object)({fixEvent:Ft,on:Wt,off:Ut,trigger:zt,one:qt}),Kt=!1,$t=void 0,Gt=function(){if(tt()&&!1!==$t.options.autoSetup){var t=o.getElementsByTagName("video"),e=o.getElementsByTagName("audio"),n=o.getElementsByTagName("video-js"),r=[];if(t&&t.length>0)for(var i=0,s=t.length;i<s;i++)r.push(t[i]);if(e&&e.length>0)for(var a=0,l=e.length;a<l;a++)r.push(e[a]);if(n&&n.length>0)for(var c=0,u=n.length;c<u;c++)r.push(n[c]);if(r&&r.length>0)for(var h=0,d=r.length;h<d;h++){var p=r[h];if(!p||!p.getAttribute){Yt(1);break}void 0===p.player&&null!==p.getAttribute("data-setup")&&$t(p)}else Kt||Yt(1)}};function Yt(t,e){e&&($t=e),i.setTimeout(Gt,t)}tt()&&"complete"===o.readyState?Kt=!0:qt(i,"load",function(){Kt=!0});var Jt=function(t){var e=o.createElement("style");return e.className=t,e},Qt=function(t,e){t.styleSheet?t.styleSheet.cssText=e:t.textContent=e},Zt=function(t,e,n){e.guid||(e.guid=Mt());var r=function(){return e.apply(t,arguments)};return r.guid=n?n+"_"+e.guid:e.guid,r},te=function(t,e){var n=Date.now();return function(){var r=Date.now();r-n>=e&&(t.apply(void 0,arguments),n=r)}},ee=function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:i,o=void 0;return function(){var i=this,s=arguments,a=function(){o=null,a=null,n||t.apply(i,s)};!o&&n&&t.apply(i,s),r.clearTimeout(o),o=r.setTimeout(a,e)}},ne=function(){};ne.prototype.allowedEvents_={},ne.prototype.on=function(t,e){var n=this.addEventListener;this.addEventListener=function(){},Wt(this,t,e),this.addEventListener=n},ne.prototype.addEventListener=ne.prototype.on,ne.prototype.off=function(t,e){Ut(this,t,e)},ne.prototype.removeEventListener=ne.prototype.off,ne.prototype.one=function(t,e){var n=this.addEventListener;this.addEventListener=function(){},qt(this,t,e),this.addEventListener=n},ne.prototype.trigger=function(t){var e=t.type||t;"string"==typeof t&&(t={type:e}),t=Ft(t),this.allowedEvents_[e]&&this["on"+e]&&this["on"+e](t),zt(this,t)},ne.prototype.dispatchEvent=ne.prototype.trigger;var re=function(t){return t instanceof ne||!!t.eventBusEl_&&["on","one","off","trigger"].every(function(e){return"function"==typeof t[e]})},ie=function(t){return"string"==typeof t&&/\S/.test(t)||Array.isArray(t)&&!!t.length},oe=function(t){if(!t.nodeName&&!re(t))throw new Error("Invalid target; must be a DOM node or evented object.")},se=function(t){if(!ie(t))throw new Error("Invalid event type; must be a non-empty string or array.")},ae=function(t){if("function"!=typeof t)throw new Error("Invalid listener; must be a function.")},le=function(t,e){var n=e.length<3||e[0]===t||e[0]===t.eventBusEl_,r=void 0,i=void 0,o=void 0;return n?(r=t.eventBusEl_,e.length>=3&&e.shift(),i=e[0],o=e[1]):(r=e[0],i=e[1],o=e[2]),oe(r),se(i),ae(o),{isTargetingSelf:n,target:r,type:i,listener:o=Zt(t,o)}},ce=function(t,e,n,r){oe(t),t.nodeName?Xt[e](t,n,r):t[e](n,r)},ue={on:function(){for(var t=this,e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];var i=le(this,n),o=i.isTargetingSelf,s=i.target,a=i.type,l=i.listener;if(ce(s,"on",a,l),!o){var c=function(){return t.off(s,a,l)};c.guid=l.guid;var u=function(){return t.off("dispose",c)};u.guid=l.guid,ce(this,"on","dispose",c),ce(s,"on","dispose",u)}},one:function(){for(var t=this,e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];var i=le(this,n),o=i.isTargetingSelf,s=i.target,a=i.type,l=i.listener;if(o)ce(s,"one",a,l);else{var c=function e(){for(var n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];t.off(s,a,e),l.apply(null,r)};c.guid=l.guid,ce(s,"one",a,c)}},off:function(t,e,n){if(!t||ie(t))Ut(this.eventBusEl_,t,e);else{var r=t,i=e;oe(r),se(i),ae(n),n=Zt(this,n),this.off("dispose",n),r.nodeName?(Ut(r,i,n),Ut(r,"dispose",n)):re(r)&&(r.off(i,n),r.off("dispose",n))}},trigger:function(t,e){return zt(this.eventBusEl_,t,e)}};function he(t){var e=(arguments.length>1&&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_=it("span",{className:"vjs-event-bus"});return W(t,ue),t.on("dispose",function(){t.off(),i.setTimeout(function(){t.eventBusEl_=null},0)}),t}var de={state:{},setState:function(t){var e=this;"function"==typeof t&&(t=t());var n=void 0;return V(t,function(t,r){e.state[r]!==t&&((n=n||{})[r]={from:e.state[r],to:t}),e.state[r]=t}),n&&re(this)&&this.trigger({changes:n,type:"statechanged"}),n}};function pe(t,e){return W(t,de),t.state=W({},t.state,e),"function"==typeof t.handleStateChanged&&re(t)&&t.on("statechanged",t.handleStateChanged),t}function fe(t){return"string"!=typeof t?t:t.charAt(0).toUpperCase()+t.slice(1)}function ye(){for(var t={},e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return n.forEach(function(e){e&&V(e,function(e,n){z(e)?(z(t[n])||(t[n]={}),t[n]=ye(t[n],e)):t[n]=e})}),t}var ve=function(){function t(e,n,r){if(I(this,t),!e&&this.play?this.player_=e=this:this.player_=e,this.options_=ye({},this.options_),n=this.options_=ye(this.options_,n),this.id_=n.id||n.el&&n.el.id,!this.id_){var i=e&&e.id&&e.id()||"no_player";this.id_=i+"_component_"+Mt()}this.name_=n.name||null,n.el?this.el_=n.el:!1!==n.createEl&&(this.el_=this.createEl()),!1!==n.evented&&he(this,{eventBusKey:this.el_?"el_":null}),pe(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},!1!==n.initChildren&&this.initChildren(),this.ready(r),!1!==n.reportTouchActivity&&this.enableTouchActivity()}return t.prototype.dispose=function(){if(this.trigger({type:"dispose",bubbles:!1}),this.children_)for(var t=this.children_.length-1;t>=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_),Ot(this.el_),this.el_=null),this.player_=null},t.prototype.player=function(){return this.player_},t.prototype.options=function(t){return G.warn("this.options() has been deprecated and will be moved to the constructor in 6.0"),t?(this.options_=ye(this.options_,t),this.options_):this.options_},t.prototype.el=function(){return this.el_},t.prototype.createEl=function(t,e,n){return it(t,e,n)},t.prototype.localize=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,r=this.player_.language&&this.player_.language(),i=this.player_.languages&&this.player_.languages(),o=i&&i[r],s=r&&r.split("-")[0],a=i&&i[s],l=n;return o&&o[t]?l=o[t]:a&&a[t]&&(l=a[t]),e&&(l=l.replace(/\{(\d+)\}/g,function(t,n){var r=e[n-1],i=r;return void 0===r&&(i=t),i})),l},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=fe(t),this.childNameIndex_[t]},t.prototype.addChild=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.children_.length,i=void 0,o=void 0;if("string"==typeof e){o=fe(e);var s=n.componentClass||o;n.name=o;var a=t.getComponent(s);if(!a)throw new Error("Component "+s+" does not exist");if("function"!=typeof a)return null;i=new a(this.player_||this,n)}else i=e;if(this.children_.splice(r,0,i),"function"==typeof i.id&&(this.childIndex_[i.id()]=i),(o=o||i.name&&fe(i.name()))&&(this.childNameIndex_[o]=i),"function"==typeof i.el&&i.el()){var l=this.contentEl().children[r]||null;this.contentEl().insertBefore(i.el(),l)}return i},t.prototype.removeChild=function(t){if("string"==typeof t&&(t=this.getChild(t)),t&&this.children_){for(var e=!1,n=this.children_.length-1;n>=0;n--)if(this.children_[n]===t){e=!0,this.children_.splice(n,1);break}if(e){this.childIndex_[t.id()]=null,this.childNameIndex_[t.name()]=null;var r=t.el();r&&r.parentNode===this.contentEl()&&this.contentEl().removeChild(t.el())}}},t.prototype.initChildren=function(){var e=this,n=this.options_.children;if(n){var r=this.options_,i=void 0,o=t.getComponent("Tech");(i=Array.isArray(n)?n:Object.keys(n)).concat(Object.keys(this.options_).filter(function(t){return!i.some(function(e){return"string"==typeof e?t===e:t===e.name})})).map(function(t){var r=void 0,i=void 0;return"string"==typeof t?i=n[r=t]||e.options_[r]||{}:(r=t.name,i=t),{name:r,opts:i}}).filter(function(e){var n=t.getComponent(e.opts.componentClass||fe(e.name));return n&&!o.isTech(n)}).forEach(function(t){var n=t.name,i=t.opts;if(void 0!==r[n]&&(i=r[n]),!1!==i){!0===i&&(i={}),i.playerOptions=e.options_.playerOptions;var o=e.addChild(n,i);o&&(e[n]=o)}})}},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 St(t,e||this.contentEl())},t.prototype.$$=function(t,e){return Pt(t,e||this.contentEl())},t.prototype.hasClass=function(t){return at(this.el_,t)},t.prototype.addClass=function(t){lt(this.el_,t)},t.prototype.removeClass=function(t){ct(this.el_,t)},t.prototype.toggleClass=function(t,e){ut(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 pt(this.el_,t)},t.prototype.setAttribute=function(t,e){ft(this.el_,t,e)},t.prototype.removeAttribute=function(t){yt(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,n){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(n||this.trigger("componentresize"));if(!this.el_)return 0;var r=this.el_.style[t],i=r.indexOf("px");return-1!==i?parseInt(r.slice(0,i),10):parseInt(this.el_["offset"+fe(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 i.getComputedStyle){var n=i.getComputedStyle(this.el_);e=n.getPropertyValue(t)||n[t]}if(0===(e=parseFloat(e))){var r="offset"+fe(t);e=this.el_[r]}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,n=void 0;this.on("touchstart",function(r){1===r.touches.length&&(e={pageX:r.touches[0].pageX,pageY:r.touches[0].pageY},t=(new Date).getTime(),n=!0)}),this.on("touchmove",function(t){if(t.touches.length>1)n=!1;else if(e){var r=t.touches[0].pageX-e.pageX,i=t.touches[0].pageY-e.pageY;Math.sqrt(r*r+i*i)>10&&(n=!1)}});var r=function(){n=!1};this.on("touchleave",r),this.on("touchcancel",r),this.on("touchend",function(r){(e=null,!0===n)&&((new Date).getTime()-t<200&&(r.preventDefault(),this.trigger("tap")))})},t.prototype.enableTouchActivity=function(){if(this.player()&&this.player().reportUserActivity){var t=Zt(this.player(),this.player().reportUserActivity),e=void 0;this.on("touchstart",function(){t(),this.clearInterval(e),e=this.setInterval(t,250)});var n=function(n){t(),this.clearInterval(e)};this.on("touchmove",t),this.on("touchend",n),this.on("touchcancel",n)}},t.prototype.setTimeout=function(t,e){var n=this;t=Zt(this,t);var r=i.setTimeout(t,e),o=function(){return n.clearTimeout(r)};return o.guid="vjs-timeout-"+r,this.on("dispose",o),r},t.prototype.clearTimeout=function(t){i.clearTimeout(t);var e=function(){};return e.guid="vjs-timeout-"+t,this.off("dispose",e),t},t.prototype.setInterval=function(t,e){var n=this;t=Zt(this,t);var r=i.setInterval(t,e),o=function(){return n.clearInterval(r)};return o.guid="vjs-interval-"+r,this.on("dispose",o),r},t.prototype.clearInterval=function(t){i.clearInterval(t);var e=function(){};return e.guid="vjs-interval-"+t,this.off("dispose",e),t},t.prototype.requestAnimationFrame=function(t){var e=this;if(this.supportsRaf_){t=Zt(this,t);var n=i.requestAnimationFrame(t),r=function(){return e.cancelAnimationFrame(n)};return r.guid="vjs-raf-"+n,this.on("dispose",r),n}return this.setTimeout(t,1e3/60)},t.prototype.cancelAnimationFrame=function(t){if(this.supportsRaf_){i.cancelAnimationFrame(t);var e=function(){};return e.guid="vjs-raf-"+t,this.off("dispose",e),t}return this.clearTimeout(t)},t.registerComponent=function(e,n){if("string"!=typeof e||!e)throw new Error('Illegal component name, "'+e+'"; must be a non-empty string.');var r=t.getComponent("Tech"),i=r&&r.isTech(n),o=t===n||t.prototype.isPrototypeOf(n.prototype);if(i||!o){var s=void 0;throw s=i?"techs must be registered using Tech.registerTech()":"must be a Component subclass",new Error('Illegal component, "'+e+'"; '+s+".")}e=fe(e),t.components_||(t.components_={});var a=t.getComponent("Player");if("Player"===e&&a&&a.players){var l=a.players,c=Object.keys(l);if(l&&c.length>0&&c.map(function(t){return l[t]}).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return t.components_[e]=n,n},t.getComponent=function(e){if(e)return e=fe(e),t.components_&&t.components_[e]?t.components_[e]:void 0},t}();function ge(t,e,n,r){return function(t,e,n){if("number"!=typeof e||e<0||e>n)throw new Error("Failed to execute '"+t+"' on 'TimeRanges': The index provided ("+e+") is non-numeric or out of bounds (0-"+n+").")}(t,r,n.length-1),n[r][e]}function me(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:ge.bind(null,"start",0,t),end:ge.bind(null,"end",1,t)}}function _e(t,e){return Array.isArray(t)?me(t):void 0===t||void 0===e?me():me([[t,e]])}function be(t,e){var n=0,r=void 0,i=void 0;if(!e)return 0;t&&t.length||(t=_e(0,0));for(var o=0;o<t.length;o++)r=t.start(o),(i=t.end(o))>e&&(i=e),n+=i-r;return n/e}ve.prototype.supportsRaf_="function"==typeof i.requestAnimationFrame&&"function"==typeof i.cancelAnimationFrame,ve.registerComponent("Component",ve);for(var Te={},Ce=[["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"]],ke=Ce[0],Ee=void 0,we=0;we<Ce.length;we++)if(Ce[we][1]in o){Ee=Ce[we];break}if(Ee)for(var Ae=0;Ae<Ee.length;Ae++)Te[ke[Ae]]=Ee[Ae];function Se(t){if(t instanceof Se)return t;"number"==typeof t?this.code=t:"string"==typeof t?this.message=t:U(t)&&("number"==typeof t.code&&(this.code=t.code),W(this,t)),this.message||(this.message=Se.defaultMessages[this.code]||"")}Se.prototype.code=0,Se.prototype.message="",Se.prototype.status=null,Se.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],Se.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."};for(var Pe=0;Pe<Se.errorTypes.length;Pe++)Se[Se.errorTypes[Pe]]=Pe,Se.prototype[Se.errorTypes[Pe]]=Pe;function je(t){return void 0!==t&&null!==t&&"function"==typeof t.then}function xe(t){je(t)&&t.then(null,function(t){})}var Me=function(t){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce(function(e,n,r){return t[n]&&(e[n]=t[n]),e},{cues:t.cues&&Array.prototype.map.call(t.cues,function(t){return{startTime:t.startTime,endTime:t.endTime,text:t.text,id:t.id}})})},Le=function(t){var e=t.$$("track"),n=Array.prototype.map.call(e,function(t){return t.track});return Array.prototype.map.call(e,function(t){var e=Me(t.track);return t.src&&(e.src=t.src),e}).concat(Array.prototype.filter.call(t.textTracks(),function(t){return-1===n.indexOf(t)}).map(Me))},De=function(t,e){return t.forEach(function(t){var n=e.addRemoteTextTrack(t).track;!t.src&&t.cues&&t.cues.forEach(function(t){return n.addCue(t)})}),e.textTracks()},Re="vjs-modal-dialog",Ie=function(t){function e(n,r){I(this,e);var i=N(this,t.call(this,n,r));return i.opened_=i.hasBeenOpened_=i.hasBeenFilled_=!1,i.closeable(!i.options_.uncloseable),i.content(i.options_.content),i.contentEl_=it("div",{className:Re+"-content"},{role:"document"}),i.descEl_=it("p",{className:Re+"-description vjs-control-text",id:i.el().getAttribute("aria-describedby")}),ot(i.descEl_,i.description()),i.el_.appendChild(i.descEl_),i.el_.appendChild(i.contentEl_),i}return O(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":this.id()+"_description","aria-hidden":"true","aria-label":this.label(),role:"dialog"})},e.prototype.dispose=function(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,t.prototype.dispose.call(this)},e.prototype.buildCSSClass=function(){return Re+" vjs-hidden "+t.prototype.buildCSSClass.call(this)},e.prototype.handleKeyPress=function(t){27===t.which&&this.closeable()&&this.close()},e.prototype.label=function(){return this.localize(this.options_.label||"Modal Window")},e.prototype.description=function(){var t=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(t+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),t},e.prototype.open=function(){if(!this.opened_){var t=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!t.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&t.pause(),this.closeable()&&this.on(this.el_.ownerDocument,"keydown",Zt(this,this.handleKeyPress)),this.hadControls_=t.controls(),t.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}},e.prototype.opened=function(t){return"boolean"==typeof t&&this[t?"open":"close"](),this.opened_},e.prototype.close=function(){if(this.opened_){var t=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&t.play(),this.closeable()&&this.off(this.el_.ownerDocument,"keydown",Zt(this,this.handleKeyPress)),this.hadControls_&&t.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger("modalclose"),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}},e.prototype.closeable=function(t){if("boolean"==typeof t){var e=this.closeable_=!!t,n=this.getChild("closeButton");if(e&&!n){var r=this.contentEl_;this.contentEl_=this.el_,n=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=r,this.on(n,"close",this.close)}!e&&n&&(this.off(n,"close",this.close),this.removeChild(n),n.dispose())}return this.closeable_},e.prototype.fill=function(){this.fillWith(this.content())},e.prototype.fillWith=function(t){var e=this.contentEl(),n=e.parentNode,r=e.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,n.removeChild(e),this.empty(),wt(e,t),this.trigger("modalfill"),r?n.insertBefore(e,r):n.appendChild(e);var i=this.getChild("closeButton");i&&n.appendChild(i.el_)},e.prototype.empty=function(){this.trigger("beforemodalempty"),Ct(this.contentEl()),this.trigger("modalempty")},e.prototype.content=function(t){return void 0!==t&&(this.content_=t),this.content_},e.prototype.conditionalFocus_=function(){var t=o.activeElement,e=this.player_.el_;this.previouslyActiveEl_=null,(e.contains(t)||e===t)&&(this.previouslyActiveEl_=t,this.focus(),this.on(o,"keydown",this.handleKeyDown))},e.prototype.conditionalBlur_=function(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null),this.off(o,"keydown",this.handleKeyDown)},e.prototype.handleKeyDown=function(t){if(9===t.which){for(var e=this.focusableEls_(),n=this.el_.querySelector(":focus"),r=void 0,i=0;i<e.length;i++)if(n===e[i]){r=i;break}o.activeElement===this.el_&&(r=0),t.shiftKey&&0===r?(e[e.length-1].focus(),t.preventDefault()):t.shiftKey||r!==e.length-1||(e[0].focus(),t.preventDefault())}},e.prototype.focusableEls_=function(){var t=this.el_.querySelectorAll("*");return Array.prototype.filter.call(t,function(t){return(t instanceof i.HTMLAnchorElement||t instanceof i.HTMLAreaElement)&&t.hasAttribute("href")||(t instanceof i.HTMLInputElement||t instanceof i.HTMLSelectElement||t instanceof i.HTMLTextAreaElement||t instanceof i.HTMLButtonElement)&&!t.hasAttribute("disabled")||t instanceof i.HTMLIFrameElement||t instanceof i.HTMLObjectElement||t instanceof i.HTMLEmbedElement||t.hasAttribute("tabindex")&&-1!==t.getAttribute("tabindex")||t.hasAttribute("contenteditable")})},e}(ve);Ie.prototype.options_={pauseOnOpen:!0,temporary:!0},ve.registerComponent("ModalDialog",Ie);var Oe=function(t){function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;I(this,e);var i=N(this,t.call(this));if(!r&&(r=i,S))for(var s in r=o.createElement("custom"),e.prototype)"constructor"!==s&&(r[s]=e.prototype[s]);r.tracks_=[],Object.defineProperty(r,"length",{get:function(){return this.tracks_.length}});for(var a=0;a<n.length;a++)r.addTrack(n[a]);return N(i,r)}return O(e,t),e.prototype.addTrack=function(t){var e=this.tracks_.length;""+e in this||Object.defineProperty(this,e,{get:function(){return this.tracks_[e]}}),-1===this.tracks_.indexOf(t)&&(this.tracks_.push(t),this.trigger({track:t,type:"addtrack"}))},e.prototype.removeTrack=function(t){for(var e=void 0,n=0,r=this.length;n<r;n++)if(this[n]===t){(e=this[n]).off&&e.off(),this.tracks_.splice(n,1);break}e&&this.trigger({track:e,type:"removetrack"})},e.prototype.getTrackById=function(t){for(var e=null,n=0,r=this.length;n<r;n++){var i=this[n];if(i.id===t){e=i;break}}return e},e}(ne);for(var Ne in Oe.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack"},Oe.prototype.allowedEvents_)Oe.prototype["on"+Ne]=null;var Be=function(t,e){for(var n=0;n<t.length;n++)Object.keys(t[n]).length&&e.id!==t[n].id&&(t[n].enabled=!1)},Fe=function(t){function e(){var n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];I(this,e);for(var i=void 0,s=r.length-1;s>=0;s--)if(r[s].enabled){Be(r,r[s]);break}if(S){for(var a in i=o.createElement("custom"),Oe.prototype)"constructor"!==a&&(i[a]=Oe.prototype[a]);for(var l in e.prototype)"constructor"!==l&&(i[l]=e.prototype[l])}return(i=n=N(this,t.call(this,r,i))).changing_=!1,N(n,i)}return O(e,t),e.prototype.addTrack=function(e){var n=this;e.enabled&&Be(this,e),t.prototype.addTrack.call(this,e),e.addEventListener&&e.addEventListener("enabledchange",function(){n.changing_||(n.changing_=!0,Be(n,e),n.changing_=!1,n.trigger("change"))})},e}(Oe),He=function(t,e){for(var n=0;n<t.length;n++)Object.keys(t[n]).length&&e.id!==t[n].id&&(t[n].selected=!1)},Ve=function(t){function e(){var n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];I(this,e);for(var i=void 0,s=r.length-1;s>=0;s--)if(r[s].selected){He(r,r[s]);break}if(S){for(var a in i=o.createElement("custom"),Oe.prototype)"constructor"!==a&&(i[a]=Oe.prototype[a]);for(var l in e.prototype)"constructor"!==l&&(i[l]=e.prototype[l])}return(i=n=N(this,t.call(this,r,i))).changing_=!1,Object.defineProperty(i,"selectedIndex",{get:function(){for(var t=0;t<this.length;t++)if(this[t].selected)return t;return-1},set:function(){}}),N(n,i)}return O(e,t),e.prototype.addTrack=function(e){var n=this;e.selected&&He(this,e),t.prototype.addTrack.call(this,e),e.addEventListener&&e.addEventListener("selectedchange",function(){n.changing_||(n.changing_=!0,He(n,e),n.changing_=!1,n.trigger("change"))})},e}(Oe),We=function(t){function e(){var n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];I(this,e);var i=void 0;if(S){for(var s in i=o.createElement("custom"),Oe.prototype)"constructor"!==s&&(i[s]=Oe.prototype[s]);for(var a in e.prototype)"constructor"!==a&&(i[a]=e.prototype[a])}return n=N(this,t.call(this,r,i)),N(n,i=n)}return O(e,t),e.prototype.addTrack=function(e){t.prototype.addTrack.call(this,e),e.addEventListener("modechange",Zt(this,function(){this.trigger("change")}));-1===["metadata","chapters"].indexOf(e.kind)&&e.addEventListener("modechange",Zt(this,function(){this.trigger("selectedlanguagechange")}))},e}(Oe),Ue=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];I(this,t);var n=this;if(S)for(var r in n=o.createElement("custom"),t.prototype)"constructor"!==r&&(n[r]=t.prototype[r]);n.trackElements_=[],Object.defineProperty(n,"length",{get:function(){return this.trackElements_.length}});for(var i=0,s=e.length;i<s;i++)n.addTrackElement_(e[i]);if(S)return n}return t.prototype.addTrackElement_=function(t){var e=this.trackElements_.length;""+e in this||Object.defineProperty(this,e,{get:function(){return this.trackElements_[e]}}),-1===this.trackElements_.indexOf(t)&&this.trackElements_.push(t)},t.prototype.getTrackElementByTrack_=function(t){for(var e=void 0,n=0,r=this.trackElements_.length;n<r;n++)if(t===this.trackElements_[n].track){e=this.trackElements_[n];break}return e},t.prototype.removeTrackElement_=function(t){for(var e=0,n=this.trackElements_.length;e<n;e++)if(t===this.trackElements_[e]){this.trackElements_.splice(e,1);break}},t}(),ze=function(){function t(e){I(this,t);var n=this;if(S)for(var r in n=o.createElement("custom"),t.prototype)"constructor"!==r&&(n[r]=t.prototype[r]);if(t.prototype.setCues_.call(n,e),Object.defineProperty(n,"length",{get:function(){return this.length_}}),S)return n}return t.prototype.setCues_=function(t){var e=this.length||0,n=0,r=t.length;this.cues_=t,this.length_=t.length;var i=function(t){""+t in this||Object.defineProperty(this,""+t,{get:function(){return this.cues_[t]}})};if(e<r)for(n=e;n<r;n++)i.call(this,n)},t.prototype.getCueById=function(t){for(var e=null,n=0,r=this.length;n<r;n++){var i=this[n];if(i.id===t){e=i;break}}return e},t}(),qe={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},Xe={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},Ke={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},$e={disabled:"disabled",hidden:"hidden",showing:"showing"},Ge=function(t){function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};I(this,e);var r=N(this,t.call(this)),i=r;if(S)for(var s in i=o.createElement("custom"),e.prototype)"constructor"!==s&&(i[s]=e.prototype[s]);var a={id:n.id||"vjs_track_"+Mt(),kind:n.kind||"",label:n.label||"",language:n.language||""},l=function(t){Object.defineProperty(i,t,{get:function(){return a[t]},set:function(){}})};for(var c in a)l(c);return N(r,i)}return O(e,t),e}(ne),Ye=function(t){var e=["protocol","hostname","port","pathname","search","hash","host"],n=o.createElement("a");n.href=t;var r=""===n.host&&"file:"!==n.protocol,s=void 0;r&&((s=o.createElement("div")).innerHTML='<a href="'+t+'"></a>',n=s.firstChild,s.setAttribute("style","display:none; position:absolute;"),o.body.appendChild(s));for(var a={},l=0;l<e.length;l++)a[e[l]]=n[e[l]];return"http:"===a.protocol&&(a.host=a.host.replace(/:80$/,"")),"https:"===a.protocol&&(a.host=a.host.replace(/:443$/,"")),a.protocol||(a.protocol=i.location.protocol),r&&o.body.removeChild(s),a},Je=function(t){if(!t.match(/^https?:\/\//)){var e=o.createElement("div");e.innerHTML='<a href="'+t+'">x</a>',t=e.firstChild.href}return t},Qe=function(t){if("string"==typeof t){var e=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/i.exec(t);if(e)return e.pop().toLowerCase()}return""},Ze=function(t){var e=i.location,n=Ye(t);return(":"===n.protocol?e.protocol:n.protocol)+n.host!==e.protocol+e.host},tn=(Object.freeze||Object)({parseUrl:Ye,getAbsoluteURL:Je,getFileExtension:Qe,isCrossOrigin:Ze}),en=function(t,e){var n=new i.WebVTT.Parser(i,i.vttjs,i.WebVTT.StringDecoder()),r=[];n.oncue=function(t){e.addCue(t)},n.onparsingerror=function(t){r.push(t)},n.onflush=function(){e.trigger({type:"loadeddata",target:e})},n.parse(t),r.length>0&&(i.console&&i.console.groupCollapsed&&i.console.groupCollapsed("Text Track parsing errors for "+e.src),r.forEach(function(t){return G.error(t)}),i.console&&i.console.groupEnd&&i.console.groupEnd()),n.flush()},nn=function(t,e){var n={uri:t},r=Ze(t);r&&(n.cors=r),l(n,Zt(this,function(t,n,r){if(t)return G.error(t,n);if(e.loaded_=!0,"function"!=typeof i.WebVTT){if(e.tech_){var o=function(){return en(r,e)};e.tech_.on("vttjsloaded",o),e.tech_.on("vttjserror",function(){G.error("vttjs failed to load, stopping trying to process "+e.src),e.tech_.off("vttjsloaded",o)})}}else en(r,e)}))},rn=function(t){function e(){var n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(I(this,e),!r.tech)throw new Error("A tech was not provided.");var i=ye(r,{kind:Ke[r.kind]||"subtitles",language:r.language||r.srclang||""}),o=$e[i.mode]||"disabled",s=i.default;"metadata"!==i.kind&&"chapters"!==i.kind||(o="hidden");var a=n=N(this,t.call(this,i));if(a.tech_=i.tech,S)for(var l in e.prototype)"constructor"!==l&&(a[l]=e.prototype[l]);a.cues_=[],a.activeCues_=[];var c=new ze(a.cues_),u=new ze(a.activeCues_),h=!1,d=Zt(a,function(){this.activeCues,h&&(this.trigger("cuechange"),h=!1)});return"disabled"!==o&&a.tech_.ready(function(){a.tech_.on("timeupdate",d)},!0),Object.defineProperty(a,"default",{get:function(){return s},set:function(){}}),Object.defineProperty(a,"mode",{get:function(){return o},set:function(t){var e=this;$e[t]&&("showing"===(o=t)&&this.tech_.ready(function(){e.tech_.on("timeupdate",d)},!0),this.trigger("modechange"))}}),Object.defineProperty(a,"cues",{get:function(){return this.loaded_?c:null},set:function(){}}),Object.defineProperty(a,"activeCues",{get:function(){if(!this.loaded_)return null;if(0===this.cues.length)return u;for(var t=this.tech_.currentTime(),e=[],n=0,r=this.cues.length;n<r;n++){var i=this.cues[n];i.startTime<=t&&i.endTime>=t?e.push(i):i.startTime===i.endTime&&i.startTime<=t&&i.startTime+.5>=t&&e.push(i)}if(h=!1,e.length!==this.activeCues_.length)h=!0;else for(var o=0;o<e.length;o++)-1===this.activeCues_.indexOf(e[o])&&(h=!0);return this.activeCues_=e,u.setCues_(this.activeCues_),u},set:function(){}}),i.src?(a.src=i.src,nn(i.src,a)):a.loaded_=!0,N(n,a)}return O(e,t),e.prototype.addCue=function(t){var e=t;if(i.vttjs&&!(t instanceof i.vttjs.VTTCue)){for(var n in e=new i.vttjs.VTTCue(t.startTime,t.endTime,t.text),t)n in e||(e[n]=t[n]);e.id=t.id,e.originalCue_=t}for(var r=this.tech_.textTracks(),o=0;o<r.length;o++)r[o]!==this&&r[o].removeCue(e);this.cues_.push(e),this.cues.setCues_(this.cues_)},e.prototype.removeCue=function(t){for(var e=this.cues_.length;e--;){var n=this.cues_[e];if(n===t||n.originalCue_&&n.originalCue_===t){this.cues_.splice(e,1),this.cues.setCues_(this.cues_);break}}},e}(Ge);rn.prototype.allowedEvents_={cuechange:"cuechange"};var on=function(t){function e(){var n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};I(this,e);var i=ye(r,{kind:Xe[r.kind]||""}),o=n=N(this,t.call(this,i)),s=!1;if(S)for(var a in e.prototype)"constructor"!==a&&(o[a]=e.prototype[a]);return Object.defineProperty(o,"enabled",{get:function(){return s},set:function(t){"boolean"==typeof t&&t!==s&&(s=t,this.trigger("enabledchange"))}}),i.enabled&&(o.enabled=i.enabled),o.loaded_=!0,N(n,o)}return O(e,t),e}(Ge),sn=function(t){function e(){var n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};I(this,e);var i=ye(r,{kind:qe[r.kind]||""}),o=n=N(this,t.call(this,i)),s=!1;if(S)for(var a in e.prototype)"constructor"!==a&&(o[a]=e.prototype[a]);return Object.defineProperty(o,"selected",{get:function(){return s},set:function(t){"boolean"==typeof t&&t!==s&&(s=t,this.trigger("selectedchange"))}}),i.selected&&(o.selected=i.selected),N(n,o)}return O(e,t),e}(Ge),an=0,ln=2,cn=function(t){function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};I(this,e);var r=N(this,t.call(this)),i=void 0,s=r;if(S)for(var a in s=o.createElement("custom"),e.prototype)"constructor"!==a&&(s[a]=e.prototype[a]);var l=new rn(n);return s.kind=l.kind,s.src=l.src,s.srclang=l.language,s.label=l.label,s.default=l.default,Object.defineProperty(s,"readyState",{get:function(){return i}}),Object.defineProperty(s,"track",{get:function(){return l}}),i=an,l.addEventListener("loadeddata",function(){i=ln,s.trigger({type:"load",target:s})}),S?N(r,s):r}return O(e,t),e}(ne);cn.prototype.allowedEvents_={load:"load"},cn.NONE=an,cn.LOADING=1,cn.LOADED=ln,cn.ERROR=3;var un={audio:{ListClass:Fe,TrackClass:on,capitalName:"Audio"},video:{ListClass:Ve,TrackClass:sn,capitalName:"Video"},text:{ListClass:We,TrackClass:rn,capitalName:"Text"}};Object.keys(un).forEach(function(t){un[t].getterName=t+"Tracks",un[t].privateName=t+"Tracks_"});var hn={remoteText:{ListClass:We,TrackClass:rn,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:Ue,TrackClass:cn,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},dn=ye(un,hn);hn.names=Object.keys(hn),un.names=Object.keys(un),dn.names=[].concat(hn.names).concat(un.names);var pn=function(t){function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};I(this,e),n.reportTouchActivity=!1;var i=N(this,t.call(this,null,n,r));return i.hasStarted_=!1,i.on("playing",function(){this.hasStarted_=!0}),i.on("loadstart",function(){this.hasStarted_=!1}),dn.names.forEach(function(t){var e=dn[t];n&&n[e.getterName]&&(i[e.privateName]=n[e.getterName])}),i.featuresProgressEvents||i.manualProgressOn(),i.featuresTimeupdateEvents||i.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(function(t){!1===n["native"+t+"Tracks"]&&(i["featuresNative"+t+"Tracks"]=!1)}),!1===n.nativeCaptions||!1===n.nativeTextTracks?i.featuresNativeTextTracks=!1:!0!==n.nativeCaptions&&!0!==n.nativeTextTracks||(i.featuresNativeTextTracks=!0),i.featuresNativeTextTracks||i.emulateTextTracks(),i.autoRemoteTextTracks_=new dn.text.ListClass,i.initTrackListeners(),n.nativeControlsForTouch||i.emitTapEvents(),i.constructor&&(i.name_=i.constructor.name||"Unknown Tech"),i}return O(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(Zt(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 _e(0,0)},e.prototype.bufferedPercent=function(){return be(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(un.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 n=e[t+"Tracks"]()||[],r=n.length;r--;){var i=n[r];"text"===t&&e.removeRemoteTextTrack(i),n.removeTrack(i)}})},e.prototype.cleanupAutoTextTracks=function(){for(var t=this.autoRemoteTextTracks_||[],e=t.length;e--;){var n=t[e];this.removeRemoteTextTrack(n)}},e.prototype.reset=function(){},e.prototype.error=function(t){return void 0!==t&&(this.error_=new Se(t),this.trigger("error")),this.error_},e.prototype.played=function(){return this.hasStarted_?_e(0,0):_e()},e.prototype.setCurrentTime=function(){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},e.prototype.initTrackListeners=function(){var t=this;un.names.forEach(function(e){var n=un[e],r=function(){t.trigger(e+"trackchange")},i=t[n.getterName]();i.addEventListener("removetrack",r),i.addEventListener("addtrack",r),t.on("dispose",function(){i.removeEventListener("removetrack",r),i.removeEventListener("addtrack",r)})})},e.prototype.addWebVttScript_=function(){var t=this;if(!i.WebVTT)if(o.body.contains(this.el())){if(!this.options_["vtt.js"]&&z(c)&&Object.keys(c).length>0)return void this.trigger("vttjsloaded");var e=o.createElement("script");e.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.12.4/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}),i.WebVTT=!0,this.el().parentNode.appendChild(e)}else this.ready(this.addWebVttScript_)},e.prototype.emulateTextTracks=function(){var t=this,e=this.textTracks(),n=this.remoteTextTracks(),r=function(t){return e.addTrack(t.track)},i=function(t){return e.removeTrack(t.track)};n.on("addtrack",r),n.on("removetrack",i),this.addWebVttScript_();var o=function(){return t.trigger("texttrackchange")},s=function(){o();for(var t=0;t<e.length;t++){var n=e[t];n.removeEventListener("cuechange",o),"showing"===n.mode&&n.addEventListener("cuechange",o)}};s(),e.addEventListener("change",s),e.addEventListener("addtrack",s),e.addEventListener("removetrack",s),this.on("dispose",function(){n.off("addtrack",r),n.off("removetrack",i),e.removeEventListener("change",s),e.removeEventListener("addtrack",s),e.removeEventListener("removetrack",s);for(var t=0;t<e.length;t++){e[t].removeEventListener("cuechange",o)}})},e.prototype.addTextTrack=function(t,e,n){if(!t)throw new Error("TextTrack kind is required but was not provided");return function(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=t.textTracks();i.kind=e,n&&(i.label=n),r&&(i.language=r),i.tech=t;var s=new dn.text.TrackClass(i);return o.addTrack(s),s}(this,t,e,n)},e.prototype.createRemoteTextTrack=function(t){var e=ye(t,{tech:this});return new hn.remoteTextEl.TrackClass(e)},e.prototype.addRemoteTextTrack=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments[1],r=this.createRemoteTextTrack(e);return!0!==n&&!1!==n&&(G.warn('Calling addRemoteTextTrack without explicitly setting the "manualCleanup" parameter to `true` is deprecated and default to `false` in future version of video.js'),n=!0),this.remoteTextTrackEls().addTrackElement_(r),this.remoteTextTracks().addTrack(r.track),!0!==n&&this.ready(function(){return t.autoRemoteTextTracks_.addTrack(r.track)}),r},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.canPlayType=function(){return""},e.canPlayType=function(){return""},e.canPlaySource=function(t,n){return e.canPlayType(t.type)},e.isTech=function(t){return t.prototype instanceof e||t instanceof e||t===e},e.registerTech=function(t,n){if(e.techs_||(e.techs_={}),!e.isTech(n))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=fe(t),e.techs_[t]=n,"Tech"!==t&&e.defaultTechOrder_.push(t),n},e.getTech=function(t){if(t)return t=fe(t),e.techs_&&e.techs_[t]?e.techs_[t]:i&&i.videojs&&i.videojs[t]?(G.warn("The "+t+" tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)"),i.videojs[t]):void 0},e}(ve);dn.names.forEach(function(t){var e=dn[t];pn.prototype[e.getterName]=function(){return this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName]}}),pn.prototype.featuresVolumeControl=!0,pn.prototype.featuresFullscreenResize=!1,pn.prototype.featuresPlaybackRate=!1,pn.prototype.featuresProgressEvents=!1,pn.prototype.featuresSourceset=!1,pn.prototype.featuresTimeupdateEvents=!1,pn.prototype.featuresNativeTextTracks=!1,pn.withSourceHandlers=function(t){t.registerSourceHandler=function(e,n){var r=t.sourceHandlers;r||(r=t.sourceHandlers=[]),void 0===n&&(n=r.length),r.splice(n,0,e)},t.canPlayType=function(e){for(var n=t.sourceHandlers||[],r=void 0,i=0;i<n.length;i++)if(r=n[i].canPlayType(e))return r;return""},t.selectSourceHandler=function(e,n){for(var r=t.sourceHandlers||[],i=0;i<r.length;i++)if(r[i].canHandleSource(e,n))return r[i];return null},t.canPlaySource=function(e,n){var r=t.selectSourceHandler(e,n);return r?r.canHandleSource(e,n):""};["seekable","seeking","duration"].forEach(function(t){var e=this[t];"function"==typeof e&&(this[t]=function(){return this.sourceHandler_&&this.sourceHandler_[t]?this.sourceHandler_[t].apply(this.sourceHandler_,arguments):e.apply(this,arguments)})},t.prototype),t.prototype.setSource=function(e){var n=t.selectSourceHandler(e,this.options_);n||(t.nativeSourceHandler?n=t.nativeSourceHandler:G.error("No source hander found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler),n!==t.nativeSourceHandler&&(this.currentSource_=e),this.sourceHandler_=n.handleSource(e,this,this.options_),this.on("dispose",this.disposeSourceHandler)},t.prototype.disposeSourceHandler=function(){this.currentSource_&&(this.clearTracks(["audio","video"]),this.currentSource_=null),this.cleanupAutoTextTracks(),this.sourceHandler_&&(this.sourceHandler_.dispose&&this.sourceHandler_.dispose(),this.sourceHandler_=null)}},ve.registerComponent("Tech",pn),pn.registerTech("Tech",pn),pn.defaultTechOrder_=[];var fn={},yn={},vn={};function gn(t,e,n){t.setTimeout(function(){return function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];var r=arguments[2];var i=arguments[3];var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];var s=arguments.length>5&&void 0!==arguments[5]&&arguments[5];var a=n[0],l=n.slice(1);if("string"==typeof a)t(e,fn[a],r,i,o,s);else if(a){var c=function(t,e){var n=yn[t.id()],r=null;if(void 0===n||null===n)return r=e(t),yn[t.id()]=[[e,r]],r;for(var i=0;i<n.length;i++){var o=n[i],s=o[0],a=o[1];s===e&&(r=a)}null===r&&(r=e(t),n.push([e,r]));return r}(i,a);c.setSource(W({},e),function(n,a){if(n)return t(e,l,r,i,o,s);o.push(c),t(a,e.type===a.type?l:fn[a.type],r,i,o,s)})}else l.length?t(e,l,r,i,o,s):s?r(e,o):t(e,fn["*"],r,i,o,!0)}(e,fn[e.type],n,t)},1)}function mn(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i="call"+fe(n),o=t.reduce(Cn(i),r),s=o===vn,a=s?null:e[n](o);return function(t,e,n,r){for(var i=t.length-1;i>=0;i--){var o=t[i];o[e]&&o[e](r,n)}}(t,n,a,s),a}var _n={buffered:1,currentTime:1,duration:1,seekable:1,played:1,paused:1},bn={setCurrentTime:1},Tn={play:1,pause:1};function Cn(t){return function(e,n){return e===vn?vn:n[t]?n[t](e):e}}var kn={opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",mp3:"audio/mpeg",aac:"audio/aac",oga:"audio/ogg",m3u8:"application/x-mpegURL"},En=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=Qe(t);return kn[e.toLowerCase()]||""};function wn(t){var e=En(t.src);return!t.type&&e&&(t.type=e),t}var An=function(t){function e(n,r,i){I(this,e);var o=ye({createEl:!1},r),s=N(this,t.call(this,n,o,i));if(r.playerOptions.sources&&0!==r.playerOptions.sources.length)n.src(r.playerOptions.sources);else for(var a=0,l=r.playerOptions.techOrder;a<l.length;a++){var c=fe(l[a]),u=pn.getTech(c);if(c||(u=ve.getComponent(c)),u&&u.isSupported()){n.loadTech_(c);break}}return s}return O(e,t),e}(ve);ve.registerComponent("MediaLoader",An);var Sn=function(t){function e(n,r){I(this,e);var i=N(this,t.call(this,n,r));return i.emitTapEvents(),i.enable(),i}return O(e,t),e.prototype.createEl=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};n=W({innerHTML:'<span aria-hidden="true" class="vjs-icon-placeholder"></span>',className:this.buildCSSClass(),tabIndex:0},n),"button"===e&&G.error("Creating a ClickableComponent with an HTML element of "+e+" is not supported; use a Button instead."),r=W({role:"button"},r),this.tabIndex_=n.tabIndex;var i=t.prototype.createEl.call(this,e,n,r);return this.createControlTextEl(i),i},e.prototype.dispose=function(){this.controlTextEl_=null,t.prototype.dispose.call(this)},e.prototype.createControlTextEl=function(t){return this.controlTextEl_=it("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 n=this.localize(t);this.controlText_=t,ot(this.controlTextEl_,n),this.nonIconControl||e.setAttribute("title",n)},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){Wt(o,"keydown",Zt(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){Ut(o,"keydown",Zt(this,this.handleKeyPress))},e}(ve);ve.registerComponent("ClickableComponent",Sn);var Pn=function(t){function e(n,r){I(this,e);var i=N(this,t.call(this,n,r));return i.update(),n.on("posterchange",Zt(i,i.update)),i}return O(e,t),e.prototype.dispose=function(){this.player().off("posterchange",this.update),t.prototype.dispose.call(this)},e.prototype.createEl=function(){var t=it("div",{className:"vjs-poster",tabIndex:-1});return L||(this.fallbackImg_=it("img"),t.appendChild(this.fallbackImg_)),t},e.prototype.update=function(t){var e=this.player().poster();this.setSrc(e),e?this.show():this.hide()},e.prototype.setSrc=function(t){if(this.fallbackImg_)this.fallbackImg_.src=t;else{var e="";t&&(e='url("'+t+'")'),this.el_.style.backgroundImage=e}},e.prototype.handleClick=function(t){this.player_.controls()&&(this.player_.paused()?xe(this.player_.play()):this.player_.pause())},e}(Sn);ve.registerComponent("PosterImage",Pn);var jn={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'};function xn(t,e){return"rgba("+parseInt(t[1]+t[1],16)+","+parseInt(t[2]+t[2],16)+","+parseInt(t[3]+t[3],16)+","+e+")"}function Mn(t,e,n){try{t.style[e]=n}catch(t){return}}var Ln=function(t){function e(n,r,i){I(this,e);var o=N(this,t.call(this,n,r,i));return n.on("loadstart",Zt(o,o.toggleDisplay)),n.on("texttrackchange",Zt(o,o.updateDisplay)),n.on("loadstart",Zt(o,o.preselectTrack)),n.ready(Zt(o,function(){if(n.tech_&&n.tech_.featuresNativeTextTracks)this.hide();else{n.on("fullscreenchange",Zt(this,this.updateDisplay));for(var t=this.options_.playerOptions.tracks||[],e=0;e<t.length;e++)this.player_.addRemoteTextTrack(t[e],!0);this.preselectTrack()}})),o}return O(e,t),e.prototype.preselectTrack=function(){for(var t={captions:1,subtitles:1},e=this.player_.textTracks(),n=this.player_.cache_.selectedLanguage,r=void 0,i=void 0,o=void 0,s=0;s<e.length;s++){var a=e[s];n&&n.enabled&&n.language===a.language?a.kind===n.kind?o=a:o||(o=a):n&&!n.enabled?(o=null,r=null,i=null):a.default&&("descriptions"!==a.kind||r?a.kind in t&&!i&&(i=a):r=a)}o?o.mode="showing":i?i.mode="showing":r&&(r.mode="showing")},e.prototype.toggleDisplay=function(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show()},e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-text-track-display"},{"aria-live":"off","aria-atomic":"true"})},e.prototype.clearDisplay=function(){"function"==typeof i.WebVTT&&i.WebVTT.processCues(i,[],this.el_)},e.prototype.updateDisplay=function(){var t=this.player_.textTracks();this.clearDisplay();for(var e=null,n=null,r=t.length;r--;){var i=t[r];"showing"===i.mode&&("descriptions"===i.kind?e=i:n=i)}n?("off"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","off"),this.updateForTrack(n)):e&&("assertive"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","assertive"),this.updateForTrack(e))},e.prototype.updateForTrack=function(t){if("function"==typeof i.WebVTT&&t.activeCues){for(var e=[],n=0;n<t.activeCues.length;n++)e.push(t.activeCues[n]);if(i.WebVTT.processCues(i,e,this.el_),this.player_.textTrackSettings)for(var r=this.player_.textTrackSettings.getValues(),o=e.length;o--;){var s=e[o];if(s){var a=s.displayState;if(r.color&&(a.firstChild.style.color=r.color),r.textOpacity&&Mn(a.firstChild,"color",xn(r.color||"#fff",r.textOpacity)),r.backgroundColor&&(a.firstChild.style.backgroundColor=r.backgroundColor),r.backgroundOpacity&&Mn(a.firstChild,"backgroundColor",xn(r.backgroundColor||"#000",r.backgroundOpacity)),r.windowColor&&(r.windowOpacity?Mn(a,"backgroundColor",xn(r.windowColor,r.windowOpacity)):a.style.backgroundColor=r.windowColor),r.edgeStyle&&("dropshadow"===r.edgeStyle?a.firstChild.style.textShadow="2px 2px 3px #222, 2px 2px 4px #222, 2px 2px 5px #222":"raised"===r.edgeStyle?a.firstChild.style.textShadow="1px 1px #222, 2px 2px #222, 3px 3px #222":"depressed"===r.edgeStyle?a.firstChild.style.textShadow="1px 1px #ccc, 0 1px #ccc, -1px -1px #222, 0 -1px #222":"uniform"===r.edgeStyle&&(a.firstChild.style.textShadow="0 0 4px #222, 0 0 4px #222, 0 0 4px #222, 0 0 4px #222")),r.fontPercent&&1!==r.fontPercent){var l=i.parseFloat(a.style.fontSize);a.style.fontSize=l*r.fontPercent+"px",a.style.height="auto",a.style.top="auto",a.style.bottom="2px"}r.fontFamily&&"default"!==r.fontFamily&&("small-caps"===r.fontFamily?a.firstChild.style.fontVariant="small-caps":a.firstChild.style.fontFamily=jn[r.fontFamily])}}}},e}(ve);ve.registerComponent("TextTrackDisplay",Ln);var Dn=function(t){function e(){return I(this,e),N(this,t.apply(this,arguments))}return O(e,t),e.prototype.createEl=function(){var e=this.player_.isAudio(),n=this.localize(e?"Audio Player":"Video Player"),r=it("span",{className:"vjs-control-text",innerHTML:this.localize("{1} is loading.",[n])}),i=t.prototype.createEl.call(this,"div",{className:"vjs-loading-spinner",dir:"ltr"});return i.appendChild(r),i},e}(ve);ve.registerComponent("LoadingSpinner",Dn);var Rn=function(t){function e(){return I(this,e),N(this,t.apply(this,arguments))}return O(e,t),e.prototype.createEl=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};e=W({innerHTML:'<span aria-hidden="true" class="vjs-icon-placeholder"></span>',className:this.buildCSSClass()},e),n=W({type:"button"},n);var r=ve.prototype.createEl.call(this,"button",e,n);return this.createControlTextEl(r),r},e.prototype.addChild=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.constructor.name;return G.warn("Adding an actionable (user controllable) child to a Button ("+n+") is not supported; use a ClickableComponent instead."),ve.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}(Sn);ve.registerComponent("Button",Rn);var In=function(t){function e(n,r){I(this,e);var i=N(this,t.call(this,n,r));return i.mouseused_=!1,i.on("mousedown",i.handleMouseDown),i}return O(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)xe(e);else{var n=this.player_.getChild("controlBar"),r=n&&n.getChild("playToggle");if(r){var i=function(){return r.focus()};je(e)?e.then(i,function(){}):this.setTimeout(i,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}(Rn);In.prototype.controlText_="Play Video",ve.registerComponent("BigPlayButton",In);var On=function(t){function e(n,r){I(this,e);var i=N(this,t.call(this,n,r));return i.controlText(r&&r.controlText||i.localize("Close")),i}return O(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}(Rn);ve.registerComponent("CloseButton",On);var Nn=function(t){function e(n,r){I(this,e);var i=N(this,t.call(this,n,r));return i.on(n,"play",i.handlePlay),i.on(n,"pause",i.handlePause),i.on(n,"ended",i.handleEnded),i}return O(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}(Rn);Nn.prototype.controlText_="Play",ve.registerComponent("PlayToggle",Nn);var Bn=function(t,e){t=t<0?0:t;var n=Math.floor(t%60),r=Math.floor(t/60%60),i=Math.floor(t/3600),o=Math.floor(e/60%60),s=Math.floor(e/3600);return(isNaN(t)||t===1/0)&&(i=r=n="-"),(i=i>0||s>0?i+":":"")+(r=((i||o>=10)&&r<10?"0"+r:r)+":")+(n=n<10?"0"+n:n)},Fn=Bn;var Hn=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return Fn(t,e)},Vn=function(t){function e(n,r){I(this,e);var i=N(this,t.call(this,n,r));return i.throttledUpdateContent=te(Zt(i,i.updateContent),25),i.on(n,"timeupdate",i.throttledUpdateContent),i}return O(e,t),e.prototype.createEl=function(e){var n=this.buildCSSClass(),r=t.prototype.createEl.call(this,"div",{className:n+" vjs-time-control vjs-control",innerHTML:'<span class="vjs-control-text">'+this.localize(this.labelText_)+" </span>"});return this.contentEl_=it("span",{className:n+"-display"},{"aria-live":"off"}),this.updateTextNode_(),r.appendChild(this.contentEl_),r},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_=o.createTextNode(this.formattedTime_||this.formatTime_(0)),this.contentEl_.appendChild(this.textNode_)}},e.prototype.formatTime_=function(t){return Hn(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}(ve);Vn.prototype.labelText_="Time",Vn.prototype.controlText_="Time",ve.registerComponent("TimeDisplay",Vn);var Wn=function(t){function e(n,r){I(this,e);var i=N(this,t.call(this,n,r));return i.on(n,"ended",i.handleEnded),i}return O(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}(Vn);Wn.prototype.labelText_="Current Time",Wn.prototype.controlText_="Current Time",ve.registerComponent("CurrentTimeDisplay",Wn);var Un=function(t){function e(n,r){I(this,e);var i=N(this,t.call(this,n,r));return i.on(n,"durationchange",i.updateContent),i.on(n,"loadedmetadata",i.throttledUpdateContent),i}return O(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}(Vn);Un.prototype.labelText_="Duration",Un.prototype.controlText_="Duration",ve.registerComponent("DurationDisplay",Un);var zn=function(t){function e(){return I(this,e),N(this,t.apply(this,arguments))}return O(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider",innerHTML:"<div><span>/</span></div>"})},e}(ve);ve.registerComponent("TimeDivider",zn);var qn=function(t){function e(n,r){I(this,e);var i=N(this,t.call(this,n,r));return i.on(n,"durationchange",i.throttledUpdateContent),i.on(n,"ended",i.handleEnded),i}return O(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}(Vn);qn.prototype.labelText_="Remaining Time",qn.prototype.controlText_="Remaining Time",ve.registerComponent("RemainingTimeDisplay",qn);var Xn=function(t){function e(n,r){I(this,e);var i=N(this,t.call(this,n,r));return i.updateShowing(),i.on(i.player(),"durationchange",i.updateShowing),i}return O(e,t),e.prototype.createEl=function(){var e=t.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});return this.contentEl_=it("div",{className:"vjs-live-display",innerHTML:'<span class="vjs-control-text">'+this.localize("Stream Type")+" </span>"+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}(ve);ve.registerComponent("LiveDisplay",Xn);var Kn=function(t){function e(n,r){I(this,e);var i=N(this,t.call(this,n,r));return i.bar=i.getChild(i.options_.barName),i.vertical(!!i.options_.vertical),i.enable(),i}return O(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 n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return n.className=n.className+" vjs-slider",n=W({tabIndex:0},n),r=W({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},r),t.prototype.createEl.call(this,e,n,r)},e.prototype.handleMouseDown=function(t){var e=this.bar.el_.ownerDocument;"mousedown"===t.type&&t.preventDefault(),"touchstart"!==t.type||w||t.preventDefault(),vt(),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;gt(),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 n=(100*t).toFixed(2)+"%",r=e.el().style;return this.vertical()?r.height=n:r.width=n,t}}},e.prototype.calculateDistance=function(t){var e=bt(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}(ve);ve.registerComponent("Slider",Kn);var $n=function(t){function e(n,r){I(this,e);var i=N(this,t.call(this,n,r));return i.partEls_=[],i.on(n,"progress",i.update),i}return O(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-load-progress",innerHTML:'<span class="vjs-control-text"><span>'+this.localize("Loaded")+"</span>: 0%</span>"})},e.prototype.dispose=function(){this.partEls_=null,t.prototype.dispose.call(this)},e.prototype.update=function(t){var e=this.player_.buffered(),n=this.player_.duration(),r=this.player_.bufferedEnd(),i=this.partEls_,o=function(t,e){var n=t/e||0;return 100*(n>=1?1:n)+"%"};this.el_.style.width=o(r,n);for(var s=0;s<e.length;s++){var a=e.start(s),l=e.end(s),c=i[s];c||(c=this.el_.appendChild(it()),i[s]=c),c.style.left=o(a,r),c.style.width=o(l-a,r)}for(var u=i.length;u>e.length;u--)this.el_.removeChild(i[u-1]);i.length=e.length},e}(ve);ve.registerComponent("LoadProgressBar",$n);var Gn=function(t){function e(){return I(this,e),N(this,t.apply(this,arguments))}return O(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"})},e.prototype.update=function(t,e,n){var r=mt(this.el_),i=mt(this.player_.el()),o=t.width*e;if(i&&r){var s=t.left-i.left+o,a=t.width-o+(i.right-t.right),l=r.width/2;s<l?l+=l-s:a<l&&(l=a),l<0?l=0:l>r.width&&(l=r.width),this.el_.style.right="-"+l+"px",ot(this.el_,n)}},e}(ve);ve.registerComponent("TimeTooltip",Gn);var Yn=function(t){function e(){return I(this,e),N(this,t.apply(this,arguments))}return O(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar",innerHTML:'<span class="vjs-control-text"><span>'+this.localize("Progress")+"</span>: 0%</span>"})},e.prototype.update=function(t,e){var n=this;this.rafId_&&this.cancelAnimationFrame(this.rafId_),this.rafId_=this.requestAnimationFrame(function(){var r=n.player_.scrubbing()?n.player_.getCache().currentTime:n.player_.currentTime(),i=Hn(r,n.player_.duration()),o=n.getChild("timeTooltip");o&&o.update(t,e,i)})},e}(ve);Yn.prototype.options_={children:[]},P&&!(P>8)||g||_||Yn.prototype.options_.children.push("timeTooltip"),ve.registerComponent("PlayProgressBar",Yn);var Jn=function(t){function e(n,r){I(this,e);var i=N(this,t.call(this,n,r));return i.update=te(Zt(i,i.update),25),i}return O(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},e.prototype.update=function(t,e){var n=this;this.rafId_&&this.cancelAnimationFrame(this.rafId_),this.rafId_=this.requestAnimationFrame(function(){var r=n.player_.duration(),i=Hn(e*r,r);n.el_.style.left=t.width*e+"px",n.getChild("timeTooltip").update(t,e,i)})},e}(ve);Jn.prototype.options_={children:["timeTooltip"]},ve.registerComponent("MouseTimeDisplay",Jn);var Qn=function(t){function e(n,r){I(this,e);var i=N(this,t.call(this,n,r));return i.setEventHandlers_(),i}return O(e,t),e.prototype.setEventHandlers_=function(){var t=this;this.update=te(Zt(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 n=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}",[Hn(t,n),Hn(n,n)],"{1} of {2}")),this.bar.update(mt(this.el_),e)},e.prototype.update=function(e){var n=t.prototype.update.call(this);return this.update_(this.getCurrentTime_(),n),n},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},e.prototype.handleMouseDown=function(e){At(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(At(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&&xe(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}(Kn);Qn.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},P&&!(P>8)||g||_||Qn.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),Qn.prototype.playerEvent="timeupdate",ve.registerComponent("SeekBar",Qn);var Zn=function(t){function e(n,r){I(this,e);var i=N(this,t.call(this,n,r));return i.handleMouseMove=te(Zt(i,i.handleMouseMove),25),i.throttledHandleMouseSeek=te(Zt(i,i.handleMouseSeek),25),i.enable(),i}return O(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 n=e.getChild("mouseTimeDisplay"),r=e.el(),i=mt(r),o=bt(r,t).x;o>1?o=1:o<0&&(o=0),n&&n.update(i,o)}},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,n=this.getChild("seekBar");n&&n.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,n=this.getChild("seekBar");n&&n.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}(ve);Zn.prototype.options_={children:["seekBar"]},ve.registerComponent("ProgressControl",Zn);var tr=function(t){function e(n,r){I(this,e);var i=N(this,t.call(this,n,r));return i.on(n,"fullscreenchange",i.handleFullscreenChange),i}return O(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}(Rn);tr.prototype.controlText_="Fullscreen",ve.registerComponent("FullscreenToggle",tr);var er=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")})},nr=function(t){function e(){return I(this,e),N(this,t.apply(this,arguments))}return O(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-volume-level",innerHTML:'<span class="vjs-control-text"></span>'})},e}(ve);ve.registerComponent("VolumeLevel",nr);var rr=function(t){function e(n,r){I(this,e);var i=N(this,t.call(this,n,r));return i.on("slideractive",i.updateLastVolume_),i.on(n,"volumechange",i.updateARIAAttributes),n.ready(function(){return i.updateARIAAttributes()}),i}return O(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){At(e)&&t.prototype.handleMouseDown.call(this,e)},e.prototype.handleMouseMove=function(t){At(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}(Kn);rr.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},rr.prototype.playerEvent="volumechange",ve.registerComponent("VolumeBar",rr);var ir=function(t){function e(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};I(this,e),r.vertical=r.vertical||!1,(void 0===r.volumeBar||z(r.volumeBar))&&(r.volumeBar=r.volumeBar||{},r.volumeBar.vertical=r.vertical);var i=N(this,t.call(this,n,r));return er(i,n),i.throttledHandleMouseMove=te(Zt(i,i.handleMouseMove),25),i.on("mousedown",i.handleMouseDown),i.on("touchstart",i.handleMouseDown),i.on(i.volumeBar,["focus","slideractive"],function(){i.volumeBar.addClass("vjs-slider-active"),i.addClass("vjs-slider-active"),i.trigger("slideractive")}),i.on(i.volumeBar,["blur","sliderinactive"],function(){i.volumeBar.removeClass("vjs-slider-active"),i.removeClass("vjs-slider-active"),i.trigger("sliderinactive")}),i}return O(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}(ve);ir.prototype.options_={children:["volumeBar"]},ve.registerComponent("VolumeControl",ir);var or=function(t){function e(n,r){I(this,e);var i=N(this,t.call(this,n,r));return er(i,n),i.on(n,["loadstart","volumechange"],i.update),i}return O(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(),n=this.player_.lastVolume_();if(0===e){var r=n<.1?.1:n;this.player_.volume(r),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;0===t||this.player_.muted()?e=0:t<.33?e=1:t<.67&&(e=2);for(var n=0;n<4;n++)ct(this.el_,"vjs-vol-"+n);lt(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}(Rn);or.prototype.controlText_="Mute",ve.registerComponent("MuteToggle",or);var sr=function(t){function e(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};I(this,e),void 0!==r.inline?r.inline=r.inline:r.inline=!0,(void 0===r.volumeControl||z(r.volumeControl))&&(r.volumeControl=r.volumeControl||{},r.volumeControl.vertical=!r.inline);var i=N(this,t.call(this,n,r));return er(i,n),i.on(i.volumeControl,["slideractive"],i.sliderActive_),i.on(i.volumeControl,["sliderinactive"],i.sliderInactive_),i}return O(e,t),e.prototype.sliderActive_=function(){this.addClass("vjs-slider-active")},e.prototype.sliderInactive_=function(){this.removeClass("vjs-slider-active")},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}(ve);sr.prototype.options_={children:["muteToggle","volumeControl"]},ve.registerComponent("VolumePanel",sr);var ar=function(t){function e(n,r){I(this,e);var i=N(this,t.call(this,n,r));return r&&(i.menuButton_=r.menuButton),i.focusedChild_=-1,i.on("keydown",i.handleKeyPress),i}return O(e,t),e.prototype.addItem=function(t){this.addChild(t),t.on("click",Zt(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_=it(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");var n=t.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return n.appendChild(this.contentEl_),Wt(n,"click",function(t){t.preventDefault(),t.stopImmediatePropagation()}),n},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}(ve);ve.registerComponent("Menu",ar);var lr=function(t){function e(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};I(this,e);var i=N(this,t.call(this,n,r));i.menuButton_=new Rn(n,r),i.menuButton_.controlText(i.controlText_),i.menuButton_.el_.setAttribute("aria-haspopup","true");var o=Rn.prototype.buildCSSClass();return i.menuButton_.el_.className=i.buildCSSClass()+" "+o,i.menuButton_.removeClass("vjs-control"),i.addChild(i.menuButton_),i.update(),i.enabled_=!0,i.on(i.menuButton_,"tap",i.handleClick),i.on(i.menuButton_,"click",i.handleClick),i.on(i.menuButton_,"focus",i.handleFocus),i.on(i.menuButton_,"blur",i.handleBlur),i.on("keydown",i.handleSubmenuKeyPress),i}return O(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 ar(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var e=it("li",{className:"vjs-menu-title",innerHTML:fe(this.options_.title),tabIndex:-1});this.hideThreshold_+=1,t.children_.unshift(e),st(e,t.contentEl())}if(this.items=this.createItems(),this.items)for(var n=0;n<this.items.length;n++)t.addItem(this.items[n]);return t},e.prototype.createItems=function(){},e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:this.buildWrapperCSSClass()},{})},e.prototype.buildWrapperCSSClass=function(){var e="vjs-menu-button";return!0===this.options_.inline?e+="-inline":e+="-popup","vjs-menu-button "+e+" "+Rn.prototype.buildCSSClass()+" "+t.prototype.buildCSSClass.call(this)},e.prototype.buildCSSClass=function(){var e="vjs-menu-button";return!0===this.options_.inline?e+="-inline":e+="-popup","vjs-menu-button "+e+" "+t.prototype.buildCSSClass.call(this)},e.prototype.controlText=function(t){var e=arguments.length>1&&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",Zt(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(){Wt(o,"keydown",Zt(this,this.handleKeyPress))},e.prototype.handleBlur=function(){Ut(o,"keydown",Zt(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"),g&&nt())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}(ve);ve.registerComponent("MenuButton",lr);var cr=function(t){function e(n,r){I(this,e);var i=r.tracks,o=N(this,t.call(this,n,r));if(o.items.length<=1&&o.hide(),!i)return N(o);var s=Zt(o,o.update);return i.addEventListener("removetrack",s),i.addEventListener("addtrack",s),o.player_.on("ready",s),o.player_.on("dispose",function(){i.removeEventListener("removetrack",s),i.removeEventListener("addtrack",s)}),o}return O(e,t),e}(lr);ve.registerComponent("TrackButton",cr);var ur=function(t){function e(n,r){I(this,e);var i=N(this,t.call(this,n,r));return i.selectable=r.selectable,i.isSelected_=r.selected||!1,i.multiSelectable=r.multiSelectable,i.selected(i.isSelected_),i.selectable?i.multiSelectable?i.el_.setAttribute("role","menuitemcheckbox"):i.el_.setAttribute("role","menuitemradio"):i.el_.setAttribute("role","menuitem"),i}return O(e,t),e.prototype.createEl=function(e,n,r){return this.nonIconControl=!0,t.prototype.createEl.call(this,"li",W({className:"vjs-menu-item",innerHTML:'<span class="vjs-menu-item-text">'+this.localize(this.options_.label)+"</span>",tabIndex:-1},n),r)},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}(Sn);ve.registerComponent("MenuItem",ur);var hr=function(t){function e(n,r){I(this,e);var s=r.track,a=n.textTracks();r.label=s.label||s.language||"Unknown",r.selected="showing"===s.mode;var l=N(this,t.call(this,n,r));l.track=s;var c=function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];l.handleTracksChange.apply(l,e)},u=function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];l.handleSelectedLanguageChange.apply(l,e)};if(n.on(["loadstart","texttrackchange"],c),a.addEventListener("change",c),a.addEventListener("selectedlanguagechange",u),l.on("dispose",function(){n.off(["loadstart","texttrackchange"],c),a.removeEventListener("change",c),a.removeEventListener("selectedlanguagechange",u)}),void 0===a.onchange){var h=void 0;l.on(["tap","click"],function(){if("object"!==R(i.Event))try{h=new i.Event("change")}catch(t){}h||(h=o.createEvent("Event")).initEvent("change",!0,!0),a.dispatchEvent(h)})}return l.handleTracksChange(),l}return O(e,t),e.prototype.handleClick=function(e){var n=this.track.kind,r=this.track.kinds,i=this.player_.textTracks();if(r||(r=[n]),t.prototype.handleClick.call(this,e),i)for(var o=0;o<i.length;o++){var s=i[o];s===this.track&&r.indexOf(s.kind)>-1?"showing"!==s.mode&&(s.mode="showing"):"disabled"!==s.mode&&(s.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}(ur);ve.registerComponent("TextTrackMenuItem",hr);var dr=function(t){function e(n,r){return I(this,e),r.track={player:n,kind:r.kind,kinds:r.kinds,default:!1,mode:"disabled"},r.kinds||(r.kinds=[r.kind]),r.label?r.track.label=r.label:r.track.label=r.kinds.join(" and ")+" off",r.selectable=!0,r.multiSelectable=!1,N(this,t.call(this,n,r))}return O(e,t),e.prototype.handleTracksChange=function(t){for(var e=this.player().textTracks(),n=!0,r=0,i=e.length;r<i;r++){var o=e[r];if(this.options_.kinds.indexOf(o.kind)>-1&&"showing"===o.mode){n=!1;break}}n!==this.isSelected_&&this.selected(n)},e.prototype.handleSelectedLanguageChange=function(t){for(var e=this.player().textTracks(),n=!0,r=0,i=e.length;r<i;r++){var o=e[r];if(["captions","descriptions","subtitles"].indexOf(o.kind)>-1&&"showing"===o.mode){n=!1;break}}n&&(this.player_.cache_.selectedLanguage={enabled:!1})},e}(hr);ve.registerComponent("OffTextTrackMenuItem",dr);var pr=function(t){function e(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return I(this,e),r.tracks=n.textTracks(),N(this,t.call(this,n,r))}return O(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]:hr,n=void 0;this.label_&&(n=this.label_+" off"),t.push(new dr(this.player_,{kinds:this.kinds_,kind:this.kind_,label:n})),this.hideThreshold_+=1;var r=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(var i=0;i<r.length;i++){var o=r[i];if(this.kinds_.indexOf(o.kind)>-1){var s=new e(this.player_,{track:o,selectable:!0,multiSelectable:!1});s.addClass("vjs-"+o.kind+"-menu-item"),t.push(s)}}return t},e}(cr);ve.registerComponent("TextTrackButton",pr);var fr=function(t){function e(n,r){I(this,e);var i=r.track,o=r.cue,s=n.currentTime();r.selectable=!0,r.multiSelectable=!1,r.label=o.text,r.selected=o.startTime<=s&&s<o.endTime;var a=N(this,t.call(this,n,r));return a.track=i,a.cue=o,i.addEventListener("cuechange",Zt(a,a.update)),a}return O(e,t),e.prototype.handleClick=function(e){t.prototype.handleClick.call(this),this.player_.currentTime(this.cue.startTime),this.update(this.cue.startTime)},e.prototype.update=function(t){var e=this.cue,n=this.player_.currentTime();this.selected(e.startTime<=n&&n<e.endTime)},e}(ur);ve.registerComponent("ChaptersTrackMenuItem",fr);var yr=function(t){function e(n,r,i){return I(this,e),N(this,t.call(this,n,r,i))}return O(e,t),e.prototype.buildCSSClass=function(){return"vjs-chapters-button "+t.prototype.buildCSSClass.call(this)},e.prototype.buildWrapperCSSClass=function(){return"vjs-chapters-button "+t.prototype.buildWrapperCSSClass.call(this)},e.prototype.update=function(e){this.track_&&(!e||"addtrack"!==e.type&&"removetrack"!==e.type)||this.setTrack(this.findChaptersTrack()),t.prototype.update.call(this)},e.prototype.setTrack=function(t){if(this.track_!==t){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){var e=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);e&&e.removeEventListener("load",this.updateHandler_),this.track_=null}if(this.track_=t,this.track_){this.track_.mode="hidden";var n=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);n&&n.addEventListener("load",this.updateHandler_)}}},e.prototype.findChaptersTrack=function(){for(var t=this.player_.textTracks()||[],e=t.length-1;e>=0;e--){var n=t[e];if(n.kind===this.kind_)return n}},e.prototype.getMenuCaption=function(){return this.track_&&this.track_.label?this.track_.label:this.localize(fe(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 n=0,r=e.length;n<r;n++){var i=e[n],o=new fr(this.player_,{track:this.track_,cue:i});t.push(o)}return t},e}(pr);yr.prototype.kind_="chapters",yr.prototype.controlText_="Chapters",ve.registerComponent("ChaptersButton",yr);var vr=function(t){function e(n,r,i){I(this,e);var o=N(this,t.call(this,n,r,i)),s=n.textTracks(),a=Zt(o,o.handleTracksChange);return s.addEventListener("change",a),o.on("dispose",function(){s.removeEventListener("change",a)}),o}return O(e,t),e.prototype.handleTracksChange=function(t){for(var e=this.player().textTracks(),n=!1,r=0,i=e.length;r<i;r++){var o=e[r];if(o.kind!==this.kind_&&"showing"===o.mode){n=!0;break}}n?this.disable():this.enable()},e.prototype.buildCSSClass=function(){return"vjs-descriptions-button "+t.prototype.buildCSSClass.call(this)},e.prototype.buildWrapperCSSClass=function(){return"vjs-descriptions-button "+t.prototype.buildWrapperCSSClass.call(this)},e}(pr);vr.prototype.kind_="descriptions",vr.prototype.controlText_="Descriptions",ve.registerComponent("DescriptionsButton",vr);var gr=function(t){function e(n,r,i){return I(this,e),N(this,t.call(this,n,r,i))}return O(e,t),e.prototype.buildCSSClass=function(){return"vjs-subtitles-button "+t.prototype.buildCSSClass.call(this)},e.prototype.buildWrapperCSSClass=function(){return"vjs-subtitles-button "+t.prototype.buildWrapperCSSClass.call(this)},e}(pr);gr.prototype.kind_="subtitles",gr.prototype.controlText_="Subtitles",ve.registerComponent("SubtitlesButton",gr);var mr=function(t){function e(n,r){I(this,e),r.track={player:n,kind:r.kind,label:r.kind+" settings",selectable:!1,default:!1,mode:"disabled"},r.selectable=!1,r.name="CaptionSettingsMenuItem";var i=N(this,t.call(this,n,r));return i.addClass("vjs-texttrack-settings"),i.controlText(", opens "+r.kind+" settings dialog"),i}return O(e,t),e.prototype.handleClick=function(t){this.player().getChild("textTrackSettings").open()},e}(hr);ve.registerComponent("CaptionSettingsMenuItem",mr);var _r=function(t){function e(n,r,i){return I(this,e),N(this,t.call(this,n,r,i))}return O(e,t),e.prototype.buildCSSClass=function(){return"vjs-captions-button "+t.prototype.buildCSSClass.call(this)},e.prototype.buildWrapperCSSClass=function(){return"vjs-captions-button "+t.prototype.buildWrapperCSSClass.call(this)},e.prototype.createItems=function(){var e=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(e.push(new mr(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),t.prototype.createItems.call(this,e)},e}(pr);_r.prototype.kind_="captions",_r.prototype.controlText_="Captions",ve.registerComponent("CaptionsButton",_r);var br=function(t){function e(){return I(this,e),N(this,t.apply(this,arguments))}return O(e,t),e.prototype.createEl=function(e,n,r){var i='<span class="vjs-menu-item-text">'+this.localize(this.options_.label);return"captions"===this.options_.track.kind&&(i+='\n        <span aria-hidden="true" class="vjs-icon-placeholder"></span>\n        <span class="vjs-control-text"> '+this.localize("Captions")+"</span>\n      "),i+="</span>",t.prototype.createEl.call(this,e,W({innerHTML:i},n),r)},e}(hr);ve.registerComponent("SubsCapsMenuItem",br);var Tr=function(t){function e(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};I(this,e);var i=N(this,t.call(this,n,r));return i.label_="subtitles",["en","en-us","en-ca","fr-ca"].indexOf(i.player_.language_)>-1&&(i.label_="captions"),i.menuButton_.controlText(fe(i.label_)),i}return O(e,t),e.prototype.buildCSSClass=function(){return"vjs-subs-caps-button "+t.prototype.buildCSSClass.call(this)},e.prototype.buildWrapperCSSClass=function(){return"vjs-subs-caps-button "+t.prototype.buildWrapperCSSClass.call(this)},e.prototype.createItems=function(){var e=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(e.push(new mr(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=t.prototype.createItems.call(this,e,br)},e}(pr);Tr.prototype.kinds_=["captions","subtitles"],Tr.prototype.controlText_="Subtitles",ve.registerComponent("SubsCapsButton",Tr);var Cr=function(t){function e(n,r){I(this,e);var i=r.track,o=n.audioTracks();r.label=i.label||i.language||"Unknown",r.selected=i.enabled;var s=N(this,t.call(this,n,r));s.track=i;var a=function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];s.handleTracksChange.apply(s,e)};return o.addEventListener("change",a),s.on("dispose",function(){o.removeEventListener("change",a)}),s}return O(e,t),e.prototype.handleClick=function(e){var n=this.player_.audioTracks();t.prototype.handleClick.call(this,e);for(var r=0;r<n.length;r++){var i=n[r];i.enabled=i===this.track}},e.prototype.handleTracksChange=function(t){this.selected(this.track.enabled)},e}(ur);ve.registerComponent("AudioTrackMenuItem",Cr);var kr=function(t){function e(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return I(this,e),r.tracks=n.audioTracks(),N(this,t.call(this,n,r))}return O(e,t),e.prototype.buildCSSClass=function(){return"vjs-audio-button "+t.prototype.buildCSSClass.call(this)},e.prototype.buildWrapperCSSClass=function(){return"vjs-audio-button "+t.prototype.buildWrapperCSSClass.call(this)},e.prototype.createItems=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.hideThreshold_=1;for(var e=this.player_.audioTracks(),n=0;n<e.length;n++){var r=e[n];t.push(new Cr(this.player_,{track:r,selectable:!0,multiSelectable:!1}))}return t},e}(cr);kr.prototype.controlText_="Audio Track",ve.registerComponent("AudioTrackButton",kr);var Er=function(t){function e(n,r){I(this,e);var i=r.rate,o=parseFloat(i,10);r.label=i,r.selected=1===o,r.selectable=!0,r.multiSelectable=!1;var s=N(this,t.call(this,n,r));return s.label=i,s.rate=o,s.on(n,"ratechange",s.update),s}return O(e,t),e.prototype.handleClick=function(e){t.prototype.handleClick.call(this),this.player().playbackRate(this.rate)},e.prototype.update=function(t){this.selected(this.player().playbackRate()===this.rate)},e}(ur);Er.prototype.contentElType="button",ve.registerComponent("PlaybackRateMenuItem",Er);var wr=function(t){function e(n,r){I(this,e);var i=N(this,t.call(this,n,r));return i.updateVisibility(),i.updateLabel(),i.on(n,"loadstart",i.updateVisibility),i.on(n,"ratechange",i.updateLabel),i}return O(e,t),e.prototype.createEl=function(){var e=t.prototype.createEl.call(this);return this.labelEl_=it("div",{className:"vjs-playback-rate-value",innerHTML:"1x"}),e.appendChild(this.labelEl_),e},e.prototype.dispose=function(){this.labelEl_=null,t.prototype.dispose.call(this)},e.prototype.buildCSSClass=function(){return"vjs-playback-rate "+t.prototype.buildCSSClass.call(this)},e.prototype.buildWrapperCSSClass=function(){return"vjs-playback-rate "+t.prototype.buildWrapperCSSClass.call(this)},e.prototype.createMenu=function(){var t=new ar(this.player()),e=this.playbackRates();if(e)for(var n=e.length-1;n>=0;n--)t.addChild(new Er(this.player(),{rate:e[n]+"x"}));return t},e.prototype.updateARIAAttributes=function(){this.el().setAttribute("aria-valuenow",this.player().playbackRate())},e.prototype.handleClick=function(t){for(var e=this.player().playbackRate(),n=this.playbackRates(),r=n[0],i=0;i<n.length;i++)if(n[i]>e){r=n[i];break}this.player().playbackRate(r)},e.prototype.playbackRates=function(){return this.options_.playbackRates||this.options_.playerOptions&&this.options_.playerOptions.playbackRates},e.prototype.playbackRateSupported=function(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0},e.prototype.updateVisibility=function(t){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")},e.prototype.updateLabel=function(t){this.playbackRateSupported()&&(this.labelEl_.innerHTML=this.player().playbackRate()+"x")},e}(lr);wr.prototype.controlText_="Playback Rate",ve.registerComponent("PlaybackRateMenuButton",wr);var Ar=function(t){function e(){return I(this,e),N(this,t.apply(this,arguments))}return O(e,t),e.prototype.buildCSSClass=function(){return"vjs-spacer "+t.prototype.buildCSSClass.call(this)},e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:this.buildCSSClass()})},e}(ve);ve.registerComponent("Spacer",Ar);var Sr=function(t){function e(){return I(this,e),N(this,t.apply(this,arguments))}return O(e,t),e.prototype.buildCSSClass=function(){return"vjs-custom-control-spacer "+t.prototype.buildCSSClass.call(this)},e.prototype.createEl=function(){var e=t.prototype.createEl.call(this,{className:this.buildCSSClass()});return e.innerHTML=" ",e},e}(Ar);ve.registerComponent("CustomControlSpacer",Sr);var Pr=function(t){function e(){return I(this,e),N(this,t.apply(this,arguments))}return O(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-control-bar",dir:"ltr"})},e}(ve);Pr.prototype.options_={children:["playToggle","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","fullscreenToggle"]},ve.registerComponent("ControlBar",Pr);var jr=function(t){function e(n,r){I(this,e);var i=N(this,t.call(this,n,r));return i.on(n,"error",i.open),i}return O(e,t),e.prototype.buildCSSClass=function(){return"vjs-error-display "+t.prototype.buildCSSClass.call(this)},e.prototype.content=function(){var t=this.player().error();return t?this.localize(t.message):""},e}(Ie);jr.prototype.options_=ye(Ie.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),ve.registerComponent("ErrorDisplay",jr);var xr=["#000","Black"],Mr=["#00F","Blue"],Lr=["#0FF","Cyan"],Dr=["#0F0","Green"],Rr=["#F0F","Magenta"],Ir=["#F00","Red"],Or=["#FFF","White"],Nr=["#FF0","Yellow"],Br=["1","Opaque"],Fr=["0.5","Semi-Transparent"],Hr=["0","Transparent"],Vr={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[xr,Or,Ir,Dr,Mr,Nr,Rr,Lr]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Transparency",options:[Br,Fr,Hr]},color:{selector:".vjs-fg-color > select",id:"captions-foreground-color-%s",label:"Color",options:[Or,xr,Ir,Dr,Mr,Nr,Rr,Lr]},edgeStyle:{selector:".vjs-edge-style > select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Dropshadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"captions-font-family-%s",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"captions-font-size-%s",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:function(t){return"1.00"===t?null:Number(t)}},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Transparency",options:[Br,Fr]},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Transparency",options:[Hr,Fr,Br]}};function Wr(t,e){if(e&&(t=e(t)),t&&"none"!==t)return t}Vr.windowColor.options=Vr.backgroundColor.options;var Ur=function(t){function e(n,r){I(this,e),r.temporary=!1;var i=N(this,t.call(this,n,r));return i.updateDisplay=Zt(i,i.updateDisplay),i.fill(),i.hasBeenOpened_=i.hasBeenFilled_=!0,i.endDialog=it("p",{className:"vjs-control-text",textContent:i.localize("End of dialog window.")}),i.el().appendChild(i.endDialog),i.setDefaults(),void 0===r.persistTextTrackSettings&&(i.options_.persistTextTrackSettings=i.options_.playerOptions.persistTextTrackSettings),i.on(i.$(".vjs-done-button"),"click",function(){i.saveSettings(),i.close()}),i.on(i.$(".vjs-default-button"),"click",function(){i.setDefaults(),i.updateDisplay()}),V(Vr,function(t){i.on(i.$(t.selector),"change",i.updateDisplay)}),i.options_.persistTextTrackSettings&&i.restoreSettings(),i}return O(e,t),e.prototype.dispose=function(){this.endDialog=null,t.prototype.dispose.call(this)},e.prototype.createElSelect_=function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"label",i=Vr[t],o=i.id.replace("%s",this.id_),s=[n,o].join(" ").trim();return["<"+r+' id="'+o+'" class="'+("label"===r?"vjs-label":"")+'">',this.localize(i.label),"</"+r+">",'<select aria-labelledby="'+s+'">'].concat(i.options.map(function(t){var n=o+"-"+t[1].replace(/\W+/g,"");return['<option id="'+n+'" value="'+t[0]+'" ','aria-labelledby="'+s+" "+n+'">',e.localize(t[1]),"</option>"].join("")})).concat("</select>").join("")},e.prototype.createElFgColor_=function(){var t="captions-text-legend-"+this.id_;return['<fieldset class="vjs-fg-color vjs-track-setting">','<legend id="'+t+'">',this.localize("Text"),"</legend>",this.createElSelect_("color",t),'<span class="vjs-text-opacity vjs-opacity">',this.createElSelect_("textOpacity",t),"</span>","</fieldset>"].join("")},e.prototype.createElBgColor_=function(){var t="captions-background-"+this.id_;return['<fieldset class="vjs-bg-color vjs-track-setting">','<legend id="'+t+'">',this.localize("Background"),"</legend>",this.createElSelect_("backgroundColor",t),'<span class="vjs-bg-opacity vjs-opacity">',this.createElSelect_("backgroundOpacity",t),"</span>","</fieldset>"].join("")},e.prototype.createElWinColor_=function(){var t="captions-window-"+this.id_;return['<fieldset class="vjs-window-color vjs-track-setting">','<legend id="'+t+'">',this.localize("Window"),"</legend>",this.createElSelect_("windowColor",t),'<span class="vjs-window-opacity vjs-opacity">',this.createElSelect_("windowOpacity",t),"</span>","</fieldset>"].join("")},e.prototype.createElColors_=function(){return it("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})},e.prototype.createElFont_=function(){return it("div",{className:"vjs-track-settings-font",innerHTML:['<fieldset class="vjs-font-percent vjs-track-setting">',this.createElSelect_("fontPercent","","legend"),"</fieldset>",'<fieldset class="vjs-edge-style vjs-track-setting">',this.createElSelect_("edgeStyle","","legend"),"</fieldset>",'<fieldset class="vjs-font-family vjs-track-setting">',this.createElSelect_("fontFamily","","legend"),"</fieldset>"].join("")})},e.prototype.createElControls_=function(){var t=this.localize("restore all settings to the default values");return it("div",{className:"vjs-track-settings-controls",innerHTML:['<button class="vjs-default-button" title="'+t+'">',this.localize("Reset"),'<span class="vjs-control-text"> '+t+"</span>","</button>",'<button class="vjs-done-button">'+this.localize("Done")+"</button>"].join("")})},e.prototype.content=function(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]},e.prototype.label=function(){return this.localize("Caption Settings Dialog")},e.prototype.description=function(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")},e.prototype.buildCSSClass=function(){return t.prototype.buildCSSClass.call(this)+" vjs-text-track-settings"},e.prototype.getValues=function(){var t=this;return function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return H(t).reduce(function(n,r){return e(n,t[r],r)},n)}(Vr,function(e,n,r){var i=function(t,e){return Wr(t.options[t.options.selectedIndex].value,e)}(t.$(n.selector),n.parser);return void 0!==i&&(e[r]=i),e},{})},e.prototype.setValues=function(t){var e=this;V(Vr,function(n,r){!function(t,e,n){if(e)for(var r=0;r<t.options.length;r++)if(Wr(t.options[r].value,n)===e){t.selectedIndex=r;break}}(e.$(n.selector),t[r],n.parser)})},e.prototype.setDefaults=function(){var t=this;V(Vr,function(e){var n=e.hasOwnProperty("default")?e.default:0;t.$(e.selector).selectedIndex=n})},e.prototype.restoreSettings=function(){var t=void 0;try{t=JSON.parse(i.localStorage.getItem("vjs-text-track-settings"))}catch(t){G.warn(t)}t&&this.setValues(t)},e.prototype.saveSettings=function(){if(this.options_.persistTextTrackSettings){var t=this.getValues();try{Object.keys(t).length?i.localStorage.setItem("vjs-text-track-settings",JSON.stringify(t)):i.localStorage.removeItem("vjs-text-track-settings")}catch(t){G.warn(t)}}},e.prototype.updateDisplay=function(){var t=this.player_.getChild("textTrackDisplay");t&&t.updateDisplay()},e.prototype.conditionalBlur_=function(){this.previouslyActiveEl_=null,this.off(o,"keydown",this.handleKeyDown);var t=this.player_.controlBar,e=t&&t.subsCapsButton,n=t&&t.captionsButton;e?e.focus():n&&n.focus()},e}(Ie);ve.registerComponent("TextTrackSettings",Ur);var zr=function(t){function e(n,r){I(this,e);var o=r.ResizeObserver||i.ResizeObserver;null===r.ResizeObserver&&(o=!1);var s=ye({createEl:!o},r),a=N(this,t.call(this,n,s));return a.ResizeObserver=r.ResizeObserver||i.ResizeObserver,a.loadListener_=null,a.resizeObserver_=null,a.debouncedHandler_=ee(function(){a.resizeHandler()},100,!1,n),o?(a.resizeObserver_=new a.ResizeObserver(a.debouncedHandler_),a.resizeObserver_.observe(n.el())):(a.loadListener_=function(){a.el_.contentWindow&&Wt(a.el_.contentWindow,"resize",a.debouncedHandler_),a.off("load",a.loadListener_)},a.on("load",a.loadListener_)),a}return O(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"iframe",{className:"vjs-resize-manager"})},e.prototype.resizeHandler=function(){this.player_.trigger("playerresize")},e.prototype.dispose=function(){this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.el_&&this.el_.contentWindow&&Ut(this.el_.contentWindow,"resize",this.debouncedHandler_),this.loadListener_&&this.off("load",this.loadListener_),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null},e}(ve);ve.registerComponent("ResizeManager",zr);var qr=function(t){var e=t.el();if(e.hasAttribute("src"))return t.triggerSourceset(e.src),!0;var n=t.$$("source"),r=[],i="";if(!n.length)return!1;for(var o=0;o<n.length;o++){var s=n[o].src;s&&-1===r.indexOf(s)&&r.push(s)}return!!r.length&&(1===r.length&&(i=r[0]),t.triggerSourceset(i),!0)},Xr={};S||(Xr=Object.defineProperty({},"innerHTML",{get:function(){return this.cloneNode(!0).innerHTML},set:function(t){var e=o.createElement(this.nodeName.toLowerCase());e.innerHTML=t;for(var n=o.createDocumentFragment();e.childNodes.length;)n.appendChild(e.childNodes[0]);return this.innerText="",i.Element.prototype.appendChild.call(this,n),this.innerHTML}}));var Kr=function(t,e){for(var n={},r=0;r<t.length&&!((n=Object.getOwnPropertyDescriptor(t[r],e))&&n.set&&n.get);r++);return n.enumerable=!0,n.configurable=!0,n},$r=function(t){var e=t.el();if(!e.resetSourceWatch_){var n={},r=function(t){return Kr([t.el(),i.HTMLMediaElement.prototype,i.Element.prototype,Xr],"innerHTML")}(t),o=function(n){return function(){for(var r=arguments.length,i=Array(r),o=0;o<r;o++)i[o]=arguments[o];var s=n.apply(e,i);return qr(t),s}};["append","appendChild","insertAdjacentHTML"].forEach(function(t){e[t]&&(n[t]=e[t],e[t]=o(n[t]))}),Object.defineProperty(e,"innerHTML",ye(r,{set:o(r.set)})),e.resetSourceWatch_=function(){e.resetSourceWatch_=null,Object.keys(n).forEach(function(t){e[t]=n[t]}),Object.defineProperty(e,"innerHTML",r)},t.one("sourceset",e.resetSourceWatch_)}},Gr={};S||(Gr=Object.defineProperty({},"src",{get:function(){return this.hasAttribute("src")?Je(i.Element.prototype.getAttribute.call(this,"src")):""},set:function(t){return i.Element.prototype.setAttribute.call(this,"src",t),t}}));var Yr=function(t){if(t.featuresSourceset){var e=t.el();if(!e.resetSourceset_){var n=function(t){return Kr([t.el(),i.HTMLMediaElement.prototype,Gr],"src")}(t),r=e.setAttribute,o=e.load;Object.defineProperty(e,"src",ye(n,{set:function(r){var i=n.set.call(e,r);return t.triggerSourceset(e.src),i}})),e.setAttribute=function(n,i){var o=r.call(e,n,i);return/src/i.test(n)&&t.triggerSourceset(e.src),o},e.load=function(){var n=o.call(e);return qr(t)||(t.triggerSourceset(""),$r(t)),n},e.currentSrc?t.triggerSourceset(e.currentSrc):qr(t)||$r(t),e.resetSourceset_=function(){e.resetSourceset_=null,e.load=o,e.setAttribute=r,Object.defineProperty(e,"src",n),e.resetSourceWatch_&&e.resetSourceWatch_()}}}},Jr=B(["Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\n            This may prevent text tracks from loading."],["Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\n            This may prevent text tracks from loading."]),Qr=function(t){function e(n,r){I(this,e);var i=N(this,t.call(this,n,r)),o=n.source,a=!1;if(o&&(i.el_.currentSrc!==o.src||n.tag&&3===n.tag.initNetworkState_)?i.setSource(o):i.handleLateInit_(i.el_),n.enableSourceset&&i.setupSourcesetHandling_(),i.el_.hasChildNodes()){for(var l=i.el_.childNodes,c=l.length,u=[];c--;){var h=l[c];"track"===h.nodeName.toLowerCase()&&(i.featuresNativeTextTracks?(i.remoteTextTrackEls().addTrackElement_(h),i.remoteTextTracks().addTrack(h.track),i.textTracks().addTrack(h.track),a||i.el_.hasAttribute("crossorigin")||!Ze(h.src)||(a=!0)):u.push(h))}for(var d=0;d<u.length;d++)i.el_.removeChild(u[d])}return i.proxyNativeTracks_(),i.featuresNativeTextTracks&&a&&G.warn(s(Jr)),i.restoreMetadataTracksInIOSNativePlayer_(),(M||y||C)&&!0===n.nativeControlsForTouch&&i.setControls(!0),i.proxyWebkitFullscreen_(),i.triggerReady(),i}return O(e,t),e.prototype.dispose=function(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),e.disposeMediaElement(this.el_),this.options_=null,t.prototype.dispose.call(this)},e.prototype.setupSourcesetHandling_=function(){Yr(this)},e.prototype.restoreMetadataTracksInIOSNativePlayer_=function(){var t=this.textTracks(),e=void 0,n=function(){e=[];for(var n=0;n<t.length;n++){var r=t[n];"metadata"===r.kind&&e.push({track:r,storedMode:r.mode})}};n(),t.addEventListener("change",n),this.on("dispose",function(){return t.removeEventListener("change",n)});var r=function n(){for(var r=0;r<e.length;r++){var i=e[r];"disabled"===i.track.mode&&i.track.mode!==i.storedMode&&(i.track.mode=i.storedMode)}t.removeEventListener("change",n)};this.on("webkitbeginfullscreen",function(){t.removeEventListener("change",n),t.removeEventListener("change",r),t.addEventListener("change",r)}),this.on("webkitendfullscreen",function(){t.removeEventListener("change",n),t.addEventListener("change",n),t.removeEventListener("change",r)})},e.prototype.proxyNativeTracks_=function(){var t=this;un.names.forEach(function(e){var n=un[e],r=t.el()[n.getterName],i=t[n.getterName]();if(t["featuresNative"+n.capitalName+"Tracks"]&&r&&r.addEventListener){var o={change:function(t){i.trigger({type:"change",target:i,currentTarget:i,srcElement:i})},addtrack:function(t){i.addTrack(t.track)},removetrack:function(t){i.removeTrack(t.track)}},s=function(){for(var t=[],e=0;e<i.length;e++){for(var n=!1,o=0;o<r.length;o++)if(r[o]===i[e]){n=!0;break}n||t.push(i[e])}for(;t.length;)i.removeTrack(t.shift())};Object.keys(o).forEach(function(e){var n=o[e];r.addEventListener(e,n),t.on("dispose",function(t){return r.removeEventListener(e,n)})}),t.on("loadstart",s),t.on("dispose",function(e){return t.off("loadstart",s)})}})},e.prototype.createEl=function(){var t=this.options_.tag;if(!t||!this.options_.playerElIngest&&!this.movingMediaElementInDOM){if(t){var n=t.cloneNode(!0);t.parentNode&&t.parentNode.insertBefore(n,t),e.disposeMediaElement(t),t=n}else{t=o.createElement("video");var r=ye({},this.options_.tag&&dt(this.options_.tag));M&&!0===this.options_.nativeControlsForTouch||delete r.controls,ht(t,W(r,{id:this.options_.techId,class:"vjs-tech"}))}t.playerId=this.options_.playerId}void 0!==this.options_.preload&&ft(t,"preload",this.options_.preload);for(var i=["loop","muted","playsinline","autoplay"],s=0;s<i.length;s++){var a=i[s],l=this.options_[a];void 0!==l&&(l?ft(t,a,a):yt(t,a),t[a]=l)}return t},e.prototype.handleLateInit_=function(t){if(0!==t.networkState&&3!==t.networkState){if(0===t.readyState){var e=!1,n=function(){e=!0};this.on("loadstart",n);var r=function(){e||this.trigger("loadstart")};return this.on("loadedmetadata",r),void this.ready(function(){this.off("loadstart",n),this.off("loadedmetadata",r),e||this.trigger("loadstart")})}var i=["loadstart"];i.push("loadedmetadata"),t.readyState>=2&&i.push("loadeddata"),t.readyState>=3&&i.push("canplay"),t.readyState>=4&&i.push("canplaythrough"),this.ready(function(){i.forEach(function(t){this.trigger(t)},this)})}},e.prototype.setCurrentTime=function(t){try{this.el_.currentTime=t}catch(t){G(t,"Video is not ready. (Video.js)")}},e.prototype.duration=function(){var t=this;if(this.el_.duration===1/0&&_&&w&&0===this.el_.currentTime){return this.on("timeupdate",function e(){t.el_.currentTime>0&&(t.el_.duration===1/0&&t.trigger("durationchange"),t.off("timeupdate",e))}),NaN}return this.el_.duration||NaN},e.prototype.width=function(){return this.el_.offsetWidth},e.prototype.height=function(){return this.el_.offsetHeight},e.prototype.proxyWebkitFullscreen_=function(){var t=this;if("webkitDisplayingFullscreen"in this.el_){var e=function(){this.trigger("fullscreenchange",{isFullscreen:!1})},n=function(){"webkitPresentationMode"in this.el_&&"picture-in-picture"!==this.el_.webkitPresentationMode&&(this.one("webkitendfullscreen",e),this.trigger("fullscreenchange",{isFullscreen:!0}))};this.on("webkitbeginfullscreen",n),this.on("dispose",function(){t.off("webkitbeginfullscreen",n),t.off("webkitendfullscreen",e)})}},e.prototype.supportsFullScreen=function(){if("function"==typeof this.el_.webkitEnterFullScreen){var t=i.navigator&&i.navigator.userAgent||"";if(/Android/.test(t)||!/Chrome|Mac OS X 10.5/.test(t))return!0}return!1},e.prototype.enterFullScreen=function(){var t=this.el_;t.paused&&t.networkState<=t.HAVE_METADATA?(this.el_.play(),this.setTimeout(function(){t.pause(),t.webkitEnterFullScreen()},0)):t.webkitEnterFullScreen()},e.prototype.exitFullScreen=function(){this.el_.webkitExitFullScreen()},e.prototype.src=function(t){if(void 0===t)return this.el_.src;this.setSrc(t)},e.prototype.reset=function(){e.resetMediaElement(this.el_)},e.prototype.currentSrc=function(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc},e.prototype.setControls=function(t){this.el_.controls=!!t},e.prototype.addTextTrack=function(e,n,r){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,n,r):t.prototype.addTextTrack.call(this,e,n,r)},e.prototype.createRemoteTextTrack=function(e){if(!this.featuresNativeTextTracks)return t.prototype.createRemoteTextTrack.call(this,e);var n=o.createElement("track");return e.kind&&(n.kind=e.kind),e.label&&(n.label=e.label),(e.language||e.srclang)&&(n.srclang=e.language||e.srclang),e.default&&(n.default=e.default),e.id&&(n.id=e.id),e.src&&(n.src=e.src),n},e.prototype.addRemoteTextTrack=function(e,n){var r=t.prototype.addRemoteTextTrack.call(this,e,n);return this.featuresNativeTextTracks&&this.el().appendChild(r),r},e.prototype.removeRemoteTextTrack=function(e){if(t.prototype.removeRemoteTextTrack.call(this,e),this.featuresNativeTextTracks)for(var n=this.$$("track"),r=n.length;r--;)e!==n[r]&&e!==n[r].track||this.el().removeChild(n[r])},e.prototype.getVideoPlaybackQuality=function(){if("function"==typeof this.el().getVideoPlaybackQuality)return this.el().getVideoPlaybackQuality();var t={};return void 0!==this.el().webkitDroppedFrameCount&&void 0!==this.el().webkitDecodedFrameCount&&(t.droppedVideoFrames=this.el().webkitDroppedFrameCount,t.totalVideoFrames=this.el().webkitDecodedFrameCount),i.performance&&"function"==typeof i.performance.now?t.creationTime=i.performance.now():i.performance&&i.performance.timing&&"number"==typeof i.performance.timing.navigationStart&&(t.creationTime=i.Date.now()-i.performance.timing.navigationStart),t},e}(pn);if(tt()){Qr.TEST_VID=o.createElement("video");var Zr=o.createElement("track");Zr.kind="captions",Zr.srclang="en",Zr.label="English",Qr.TEST_VID.appendChild(Zr)}Qr.isSupported=function(){try{Qr.TEST_VID.volume=.5}catch(t){return!1}return!(!Qr.TEST_VID||!Qr.TEST_VID.canPlayType)},Qr.canPlayType=function(t){return Qr.TEST_VID.canPlayType(t)},Qr.canPlaySource=function(t,e){return Qr.canPlayType(t.type)},Qr.canControlVolume=function(){try{var t=Qr.TEST_VID.volume;return Qr.TEST_VID.volume=t/2+.1,t!==Qr.TEST_VID.volume}catch(t){return!1}},Qr.canControlPlaybackRate=function(){if(_&&w&&A<58)return!1;try{var t=Qr.TEST_VID.playbackRate;return Qr.TEST_VID.playbackRate=t/2+.1,t!==Qr.TEST_VID.playbackRate}catch(t){return!1}},Qr.canOverrideAttributes=function(){if(S)return!1;try{var t=function(){};Object.defineProperty(o.createElement("video"),"src",{get:t,set:t}),Object.defineProperty(o.createElement("audio"),"src",{get:t,set:t}),Object.defineProperty(o.createElement("video"),"innerHTML",{get:t,set:t}),Object.defineProperty(o.createElement("audio"),"innerHTML",{get:t,set:t})}catch(t){return!1}return!0},Qr.supportsNativeTextTracks=function(){return x},Qr.supportsNativeVideoTracks=function(){return!(!Qr.TEST_VID||!Qr.TEST_VID.videoTracks)},Qr.supportsNativeAudioTracks=function(){return!(!Qr.TEST_VID||!Qr.TEST_VID.audioTracks)},Qr.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],Qr.prototype.featuresVolumeControl=Qr.canControlVolume(),Qr.prototype.featuresPlaybackRate=Qr.canControlPlaybackRate(),Qr.prototype.featuresSourceset=Qr.canOverrideAttributes(),Qr.prototype.movingMediaElementInDOM=!g,Qr.prototype.featuresFullscreenResize=!0,Qr.prototype.featuresProgressEvents=!0,Qr.prototype.featuresTimeupdateEvents=!0,Qr.prototype.featuresNativeTextTracks=Qr.supportsNativeTextTracks(),Qr.prototype.featuresNativeVideoTracks=Qr.supportsNativeVideoTracks(),Qr.prototype.featuresNativeAudioTracks=Qr.supportsNativeAudioTracks();var ti=Qr.TEST_VID&&Qr.TEST_VID.constructor.prototype.canPlayType,ei=/^application\/(?:x-|vnd\.apple\.)mpegurl/i,ni=/^video\/mp4/i;Qr.patchCanPlayType=function(){b>=4&&!k&&!w?Qr.TEST_VID.constructor.prototype.canPlayType=function(t){return t&&ei.test(t)?"maybe":ti.call(this,t)}:T&&(Qr.TEST_VID.constructor.prototype.canPlayType=function(t){return t&&ni.test(t)?"maybe":ti.call(this,t)})},Qr.unpatchCanPlayType=function(){var t=Qr.TEST_VID.constructor.prototype.canPlayType;return Qr.TEST_VID.constructor.prototype.canPlayType=ti,t},Qr.patchCanPlayType(),Qr.disposeMediaElement=function(t){if(t){for(t.parentNode&&t.parentNode.removeChild(t);t.hasChildNodes();)t.removeChild(t.firstChild);t.removeAttribute("src"),"function"==typeof t.load&&function(){try{t.load()}catch(t){}}()}},Qr.resetMediaElement=function(t){if(t){for(var e=t.querySelectorAll("source"),n=e.length;n--;)t.removeChild(e[n]);t.removeAttribute("src"),"function"==typeof t.load&&function(){try{t.load()}catch(t){}}()}},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(t){Qr.prototype[t]=function(){return this.el_[t]||this.el_.hasAttribute(t)}}),["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(t){Qr.prototype["set"+fe(t)]=function(e){this.el_[t]=e,e?this.el_.setAttribute(t,t):this.el_.removeAttribute(t)}}),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","played","networkState","readyState","videoWidth","videoHeight"].forEach(function(t){Qr.prototype[t]=function(){return this.el_[t]}}),["volume","src","poster","preload","playbackRate","defaultPlaybackRate"].forEach(function(t){Qr.prototype["set"+fe(t)]=function(e){this.el_[t]=e}}),["pause","load","play"].forEach(function(t){Qr.prototype[t]=function(){return this.el_[t]()}}),pn.withSourceHandlers(Qr),Qr.nativeSourceHandler={},Qr.nativeSourceHandler.canPlayType=function(t){try{return Qr.TEST_VID.canPlayType(t)}catch(t){return""}},Qr.nativeSourceHandler.canHandleSource=function(t,e){if(t.type)return Qr.nativeSourceHandler.canPlayType(t.type);if(t.src){var n=Qe(t.src);return Qr.nativeSourceHandler.canPlayType("video/"+n)}return""},Qr.nativeSourceHandler.handleSource=function(t,e,n){e.setSrc(t.src)},Qr.nativeSourceHandler.dispose=function(){},Qr.registerSourceHandler(Qr.nativeSourceHandler),pn.registerTech("Html5",Qr);var ri=B(["\n        Using the tech directly can be dangerous. I hope you know what you're doing.\n        See https://github.com/videojs/video.js/issues/2617 for more info.\n      "],["\n        Using the tech directly can be dangerous. I hope you know what you're doing.\n        See https://github.com/videojs/video.js/issues/2617 for more info.\n      "]),ii=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],oi={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},si=function(t){function e(n,r,i){if(I(this,e),n.id=n.id||r.id||"vjs_video_"+Mt(),(r=W(e.getTagSettings(n),r)).initChildren=!1,r.createEl=!1,r.evented=!1,r.reportTouchActivity=!1,!r.language)if("function"==typeof n.closest){var o=n.closest("[lang]");o&&o.getAttribute&&(r.language=o.getAttribute("lang"))}else for(var s=n;s&&1===s.nodeType;){if(dt(s).hasOwnProperty("lang")){r.language=s.getAttribute("lang");break}s=s.parentNode}var a=N(this,t.call(this,null,r,i));if(a.isPosterFromTech_=!1,a.queuedCallbacks_=[],a.isReady_=!1,a.hasStarted_=!1,a.userActive_=!1,!a.options_||!a.options_.techOrder||!a.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(a.tag=n,a.tagAttributes=n&&dt(n),a.language(a.options_.language),r.languages){var l={};Object.getOwnPropertyNames(r.languages).forEach(function(t){l[t.toLowerCase()]=r.languages[t]}),a.languages_=l}else a.languages_=e.prototype.options_.languages;a.cache_={},a.poster_=r.poster||"",a.controls_=!!r.controls,a.cache_.lastVolume=1,n.controls=!1,n.removeAttribute("controls"),a.scrubbing_=!1,a.el_=a.createEl(),a.cache_.lastPlaybackRate=a.defaultPlaybackRate(),he(a,{eventBusKey:"el_"});var c=ye(a.options_);if(r.plugins){var h=r.plugins;Object.keys(h).forEach(function(t){if("function"!=typeof this[t])throw new Error('plugin "'+t+'" does not exist');this[t](h[t])},a)}a.options_.playerOptions=c,a.middleware_=[],a.initChildren(),a.isAudio("audio"===n.nodeName.toLowerCase()),a.controls()?a.addClass("vjs-controls-enabled"):a.addClass("vjs-controls-disabled"),a.el_.setAttribute("role","region"),a.isAudio()?a.el_.setAttribute("aria-label",a.localize("Audio Player")):a.el_.setAttribute("aria-label",a.localize("Video Player")),a.isAudio()&&a.addClass("vjs-audio"),a.flexNotSupported_()&&a.addClass("vjs-no-flex"),g||a.addClass("vjs-workinghover"),e.players[a.id_]=a;var d=u.split(".")[0];return a.addClass("vjs-v"+d),a.userActive(!0),a.reportUserActivity(),a.one("play",a.listenForUserActivity_),a.on("fullscreenchange",a.handleFullscreenChange_),a.on("stageclick",a.handleStageClick_),a.changingSrc_=!1,a.playWaitingForReady_=!1,a.playOnLoadstart_=null,a}return O(e,t),e.prototype.dispose=function(){this.trigger("dispose"),this.off("dispose"),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),e.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),function(t){yn[t.id()]=null}(this),t.prototype.dispose.call(this)},e.prototype.createEl=function(){var e=this.tag,n=void 0,r=this.playerElIngest_=e.parentNode&&e.parentNode.hasAttribute&&e.parentNode.hasAttribute("data-vjs-player"),s="video-js"===this.tag.tagName.toLowerCase();r?n=this.el_=e.parentNode:s||(n=this.el_=t.prototype.createEl.call(this,"div"));var a=dt(e);if(s){for(n=this.el_=e,e=this.tag=o.createElement("video");n.children.length;)e.appendChild(n.firstChild);at(n,"video-js")||lt(n,"video-js"),n.appendChild(e),r=this.playerElIngest_=n,["autoplay","controls","crossOrigin","defaultMuted","defaultPlaybackRate","loop","muted","playbackRate","src","volume"].forEach(function(t){void 0!==n[t]&&(e[t]=n[t])})}if(e.setAttribute("tabindex","-1"),P&&e.setAttribute("role","application"),e.removeAttribute("width"),e.removeAttribute("height"),Object.getOwnPropertyNames(a).forEach(function(t){"class"===t?(n.className+=" "+a[t],s&&(e.className+=" "+a[t])):(n.setAttribute(t,a[t]),s&&e.setAttribute(t,a[t]))}),e.playerId=e.id,e.id+="_html5_api",e.className="vjs-tech",e.player=n.player=this,this.addClass("vjs-paused"),!0!==i.VIDEOJS_NO_DYNAMIC_STYLE){this.styleEl_=Jt("vjs-styles-dimensions");var l=St(".vjs-styles-defaults"),c=St("head");c.insertBefore(this.styleEl_,l?l.nextSibling:c.firstChild)}this.width(this.options_.width),this.height(this.options_.height),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio);for(var u=e.getElementsByTagName("a"),h=0;h<u.length;h++){var d=u.item(h);lt(d,"vjs-hidden"),d.setAttribute("hidden","hidden")}return e.initNetworkState_=e.networkState,e.parentNode&&!r&&e.parentNode.insertBefore(n,e),st(e,n),this.children_.unshift(e),this.el_.setAttribute("lang",this.language_),this.el_=n,n},e.prototype.width=function(t){return this.dimension("width",t)},e.prototype.height=function(t){return this.dimension("height",t)},e.prototype.dimension=function(t,e){var n=t+"_";if(void 0===e)return this[n]||0;if(""===e)return this[n]=void 0,void this.updateStyleEl_();var r=parseFloat(e);isNaN(r)?G.error('Improper value "'+e+'" supplied for for '+t):(this[n]=r,this.updateStyleEl_())},e.prototype.fluid=function(t){if(void 0===t)return!!this.fluid_;this.fluid_=!!t,t?this.addClass("vjs-fluid"):this.removeClass("vjs-fluid"),this.updateStyleEl_()},e.prototype.aspectRatio=function(t){if(void 0===t)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(t))throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=t,this.fluid(!0),this.updateStyleEl_()},e.prototype.updateStyleEl_=function(){if(!0!==i.VIDEOJS_NO_DYNAMIC_STYLE){var t=void 0,e=void 0,n=void 0,r=(void 0!==this.aspectRatio_&&"auto"!==this.aspectRatio_?this.aspectRatio_:this.videoWidth()>0?this.videoWidth()+":"+this.videoHeight():"16:9").split(":"),o=r[1]/r[0];t=void 0!==this.width_?this.width_:void 0!==this.height_?this.height_/o:this.videoWidth()||300,e=void 0!==this.height_?this.height_:t*o,n=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(n),Qt(this.styleEl_,"\n      ."+n+" {\n        width: "+t+"px;\n        height: "+e+"px;\n      }\n\n      ."+n+".vjs-fluid {\n        padding-top: "+100*o+"%;\n      }\n    ")}else{var s="number"==typeof this.width_?this.width_:this.options_.width,a="number"==typeof this.height_?this.height_:this.options_.height,l=this.tech_&&this.tech_.el();l&&(s>=0&&(l.width=s),a>=0&&(l.height=a))}},e.prototype.loadTech_=function(t,e){var n=this;this.tech_&&this.unloadTech_();var r=fe(t),i=t.charAt(0).toLowerCase()+t.slice(1);"Html5"!==r&&this.tag&&(pn.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=r,this.isReady_=!1;var o={source:e,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:this.id()+"_"+r+"_api",autoplay:this.options_.autoplay,playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset};dn.names.forEach(function(t){var e=dn[t];o[e.getterName]=n[e.privateName]}),W(o,this.options_[r]),W(o,this.options_[i]),W(o,this.options_[t.toLowerCase()]),this.tag&&(o.tag=this.tag),e&&e.src===this.cache_.src&&this.cache_.currentTime>0&&(o.startTime=this.cache_.currentTime);var s=pn.getTech(t);if(!s)throw new Error("No Tech named '"+r+"' exists! '"+r+"' should be registered using videojs.registerTech()'");this.tech_=new s(o),this.tech_.ready(Zt(this,this.handleTechReady_),!0),De(this.textTracksJson_||[],this.tech_),ii.forEach(function(t){n.on(n.tech_,t,n["handleTech"+fe(t)+"_"])}),Object.keys(oi).forEach(function(t){n.on(n.tech_,t,function(e){0===n.tech_.playbackRate()&&n.tech_.seeking()?n.queuedCallbacks_.push({callback:n["handleTech"+oi[t]+"_"].bind(n),event:e}):n["handleTech"+oi[t]+"_"](e)})}),this.on(this.tech_,"loadstart",this.handleTechLoadStart_),this.on(this.tech_,"sourceset",this.handleTechSourceset_),this.on(this.tech_,"waiting",this.handleTechWaiting_),this.on(this.tech_,"ended",this.handleTechEnded_),this.on(this.tech_,"seeking",this.handleTechSeeking_),this.on(this.tech_,"play",this.handleTechPlay_),this.on(this.tech_,"firstplay",this.handleTechFirstPlay_),this.on(this.tech_,"pause",this.handleTechPause_),this.on(this.tech_,"durationchange",this.handleTechDurationChange_),this.on(this.tech_,"fullscreenchange",this.handleTechFullscreenChange_),this.on(this.tech_,"error",this.handleTechError_),this.on(this.tech_,"loadedmetadata",this.updateStyleEl_),this.on(this.tech_,"posterchange",this.handleTechPosterChange_),this.on(this.tech_,"textdata",this.handleTechTextData_),this.on(this.tech_,"ratechange",this.handleTechRateChange_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode===this.el()||"Html5"===r&&this.tag||st(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)},e.prototype.unloadTech_=function(){var t=this;dn.names.forEach(function(e){var n=dn[e];t[n.privateName]=t[n.getterName]()}),this.textTracksJson_=Le(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1},e.prototype.tech=function(t){return void 0===t&&G.warn(s(ri)),this.tech_},e.prototype.addTechControlsListeners_=function(){this.removeTechControlsListeners_(),this.on(this.tech_,"mousedown",this.handleTechClick_),this.on(this.tech_,"touchstart",this.handleTechTouchStart_),this.on(this.tech_,"touchmove",this.handleTechTouchMove_),this.on(this.tech_,"touchend",this.handleTechTouchEnd_),this.on(this.tech_,"tap",this.handleTechTap_)},e.prototype.removeTechControlsListeners_=function(){this.off(this.tech_,"tap",this.handleTechTap_),this.off(this.tech_,"touchstart",this.handleTechTouchStart_),this.off(this.tech_,"touchmove",this.handleTechTouchMove_),this.off(this.tech_,"touchend",this.handleTechTouchEnd_),this.off(this.tech_,"mousedown",this.handleTechClick_)},e.prototype.handleTechReady_=function(){if(this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_(),(this.src()||this.currentSrc())&&this.tag&&this.options_.autoplay&&this.paused())try{delete this.tag.poster}catch(t){G("deleting tag.poster throws in some browsers",t)}},e.prototype.handleTechLoadStart_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-seeking"),this.error(null),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):(this.trigger("loadstart"),this.trigger("firstplay"))},e.prototype.updateSourceCaches_=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=t,n="";"string"!=typeof e&&(e=t.src,n=t.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],e&&!n&&(n=function(t,e){if(!e)return"";if(t.cache_.source.src===e&&t.cache_.source.type)return t.cache_.source.type;var n=t.cache_.sources.filter(function(t){return t.src===e});if(n.length)return n[0].type;for(var r=t.$$("source"),i=0;i<r.length;i++){var o=r[i];if(o.type&&o.src&&o.src===e)return o.type}return En(e)}(this,e)),this.cache_.source=ye({},t,{src:e,type:n});for(var r=this.cache_.sources.filter(function(t){return t.src&&t.src===e}),i=[],o=this.$$("source"),s=[],a=0;a<o.length;a++){var l=dt(o[a]);i.push(l),l.src&&l.src===e&&s.push(l.src)}s.length&&!r.length?this.cache_.sources=i:r.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=e},e.prototype.handleTechSourceset_=function(t){var e=this;if(!this.changingSrc_&&(this.updateSourceCaches_(t.src),!t.src)){this.tech_.one(["sourceset","loadstart"],function t(n){"sourceset"!==n.type&&e.updateSourceCaches_(e.techGet_("currentSrc")),e.tech_.off(["sourceset","loadstart"],t)})}this.trigger({src:t.src,type:"sourceset"})},e.prototype.hasStarted=function(t){if(void 0===t)return this.hasStarted_;t!==this.hasStarted_&&(this.hasStarted_=t,this.hasStarted_?(this.addClass("vjs-has-started"),this.trigger("firstplay")):this.removeClass("vjs-has-started"))},e.prototype.handleTechPlay_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")},e.prototype.handleTechRateChange_=function(){this.tech_.playbackRate()>0&&0===this.cache_.lastPlaybackRate&&(this.queuedCallbacks_.forEach(function(t){return t.callback(t.event)}),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")},e.prototype.handleTechWaiting_=function(){var t=this;this.addClass("vjs-waiting"),this.trigger("waiting"),this.one("timeupdate",function(){return t.removeClass("vjs-waiting")})},e.prototype.handleTechCanPlay_=function(){this.removeClass("vjs-waiting"),this.trigger("canplay")},e.prototype.handleTechCanPlayThrough_=function(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")},e.prototype.handleTechPlaying_=function(){this.removeClass("vjs-waiting"),this.trigger("playing")},e.prototype.handleTechSeeking_=function(){this.addClass("vjs-seeking"),this.trigger("seeking")},e.prototype.handleTechSeeked_=function(){this.removeClass("vjs-seeking"),this.trigger("seeked")},e.prototype.handleTechFirstPlay_=function(){this.options_.starttime&&(G.warn("Passing the `starttime` option to the player will be deprecated in 6.0"),this.currentTime(this.options_.starttime)),this.addClass("vjs-has-started"),this.trigger("firstplay")},e.prototype.handleTechPause_=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")},e.prototype.handleTechEnded_=function(){this.addClass("vjs-ended"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")},e.prototype.handleTechDurationChange_=function(){this.duration(this.techGet_("duration"))},e.prototype.handleTechClick_=function(t){At(t)&&this.controls_&&(this.paused()?xe(this.play()):this.pause())},e.prototype.handleTechTap_=function(){this.userActive(!this.userActive())},e.prototype.handleTechTouchStart_=function(){this.userWasActive=this.userActive()},e.prototype.handleTechTouchMove_=function(){this.userWasActive&&this.reportUserActivity()},e.prototype.handleTechTouchEnd_=function(t){t.preventDefault()},e.prototype.handleFullscreenChange_=function(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")},e.prototype.handleStageClick_=function(){this.reportUserActivity()},e.prototype.handleTechFullscreenChange_=function(t,e){e&&this.isFullscreen(e.isFullscreen),this.trigger("fullscreenchange")},e.prototype.handleTechError_=function(){var t=this.tech_.error();this.error(t)},e.prototype.handleTechTextData_=function(){var t=null;arguments.length>1&&(t=arguments[1]),this.trigger("textdata",t)},e.prototype.getCache=function(){return this.cache_},e.prototype.techCall_=function(t,e){this.ready(function(){if(t in bn)return function(t,e,n,r){return e[n](t.reduce(Cn(n),r))}(this.middleware_,this.tech_,t,e);if(t in Tn)return mn(this.middleware_,this.tech_,t,e);try{this.tech_&&this.tech_[t](e)}catch(t){throw G(t),t}},!0)},e.prototype.techGet_=function(t){if(this.tech_&&this.tech_.isReady_){if(t in _n)return function(t,e,n){return t.reduceRight(Cn(n),e[n]())}(this.middleware_,this.tech_,t);if(t in Tn)return mn(this.middleware_,this.tech_,t);try{return this.tech_[t]()}catch(e){if(void 0===this.tech_[t])throw G("Video.js: "+t+" method not defined for "+this.techName_+" playback technology.",e),e;if("TypeError"===e.name)throw G("Video.js: "+t+" unavailable on "+this.techName_+" playback technology element.",e),this.tech_.isReady_=!1,e;throw G(e),e}}},e.prototype.play=function(){var t=this;if(this.playOnLoadstart_&&this.off("loadstart",this.playOnLoadstart_),this.isReady_){if(!this.changingSrc_&&(this.src()||this.currentSrc()))return this.techGet_("play");this.playOnLoadstart_=function(){t.playOnLoadstart_=null,xe(t.play())},this.one("loadstart",this.playOnLoadstart_)}else{if(this.playWaitingForReady_)return;this.playWaitingForReady_=!0,this.ready(function(){t.playWaitingForReady_=!1,xe(t.play())})}},e.prototype.pause=function(){this.techCall_("pause")},e.prototype.paused=function(){return!1!==this.techGet_("paused")},e.prototype.played=function(){return this.techGet_("played")||_e(0,0)},e.prototype.scrubbing=function(t){if(void 0===t)return this.scrubbing_;this.scrubbing_=!!t,t?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")},e.prototype.currentTime=function(t){return void 0!==t?(t<0&&(t=0),void this.techCall_("setCurrentTime",t)):(this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime)},e.prototype.duration=function(t){if(void 0===t)return void 0!==this.cache_.duration?this.cache_.duration:NaN;(t=parseFloat(t))<0&&(t=1/0),t!==this.cache_.duration&&(this.cache_.duration=t,t===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),this.trigger("durationchange"))},e.prototype.remainingTime=function(){return this.duration()-this.currentTime()},e.prototype.remainingTimeDisplay=function(){return Math.floor(this.duration())-Math.floor(this.currentTime())},e.prototype.buffered=function(){var t=this.techGet_("buffered");return t&&t.length||(t=_e(0,0)),t},e.prototype.bufferedPercent=function(){return be(this.buffered(),this.duration())},e.prototype.bufferedEnd=function(){var t=this.buffered(),e=this.duration(),n=t.end(t.length-1);return n>e&&(n=e),n},e.prototype.volume=function(t){var e=void 0;return void 0!==t?(e=Math.max(0,Math.min(1,parseFloat(t))),this.cache_.volume=e,this.techCall_("setVolume",e),void(e>0&&this.lastVolume_(e))):(e=parseFloat(this.techGet_("volume")),isNaN(e)?1:e)},e.prototype.muted=function(t){if(void 0===t)return this.techGet_("muted")||!1;this.techCall_("setMuted",t)},e.prototype.defaultMuted=function(t){return void 0!==t?this.techCall_("setDefaultMuted",t):this.techGet_("defaultMuted")||!1},e.prototype.lastVolume_=function(t){if(void 0===t||0===t)return this.cache_.lastVolume;this.cache_.lastVolume=t},e.prototype.supportsFullScreen=function(){return this.techGet_("supportsFullScreen")||!1},e.prototype.isFullscreen=function(t){if(void 0===t)return!!this.isFullscreen_;this.isFullscreen_=!!t},e.prototype.requestFullscreen=function(){var t=Te;this.isFullscreen(!0),t.requestFullscreen?(Wt(o,t.fullscreenchange,Zt(this,function e(n){this.isFullscreen(o[t.fullscreenElement]),!1===this.isFullscreen()&&Ut(o,t.fullscreenchange,e),this.trigger("fullscreenchange")})),this.el_[t.requestFullscreen]()):this.tech_.supportsFullScreen()?this.techCall_("enterFullScreen"):(this.enterFullWindow(),this.trigger("fullscreenchange"))},e.prototype.exitFullscreen=function(){var t=Te;this.isFullscreen(!1),t.requestFullscreen?o[t.exitFullscreen]():this.tech_.supportsFullScreen()?this.techCall_("exitFullScreen"):(this.exitFullWindow(),this.trigger("fullscreenchange"))},e.prototype.enterFullWindow=function(){this.isFullWindow=!0,this.docOrigOverflow=o.documentElement.style.overflow,Wt(o,"keydown",Zt(this,this.fullWindowOnEscKey)),o.documentElement.style.overflow="hidden",lt(o.body,"vjs-full-window"),this.trigger("enterFullWindow")},e.prototype.fullWindowOnEscKey=function(t){27===t.keyCode&&(!0===this.isFullscreen()?this.exitFullscreen():this.exitFullWindow())},e.prototype.exitFullWindow=function(){this.isFullWindow=!1,Ut(o,"keydown",this.fullWindowOnEscKey),o.documentElement.style.overflow=this.docOrigOverflow,ct(o.body,"vjs-full-window"),this.trigger("exitFullWindow")},e.prototype.canPlayType=function(t){for(var e=void 0,n=0,r=this.options_.techOrder;n<r.length;n++){var i=r[n],o=pn.getTech(i);if(o||(o=ve.getComponent(i)),o){if(o.isSupported()&&(e=o.canPlayType(t)))return e}else G.error('The "'+i+'" tech is undefined. Skipped browser support check for that tech.')}return""},e.prototype.selectSource=function(t){var e=this,n=this.options_.techOrder.map(function(t){return[t,pn.getTech(t)]}).filter(function(t){var e=t[0],n=t[1];return n?n.isSupported():(G.error('The "'+e+'" tech is undefined. Skipped browser support check for that tech.'),!1)}),r=function(t,e,n){var r=void 0;return t.some(function(t){return e.some(function(e){if(r=n(t,e))return!0})}),r},i=function(t,n){var r=t[0];if(t[1].canPlaySource(n,e.options_[r.toLowerCase()]))return{source:n,tech:r}};return(this.options_.sourceOrder?r(t,n,function(t){return function(e,n){return t(n,e)}}(i)):r(n,t,i))||!1},e.prototype.src=function(t){var e=this;if(void 0===t)return this.cache_.src||"";var n=function t(e){if(Array.isArray(e)){var n=[];e.forEach(function(e){e=t(e),Array.isArray(e)?n=n.concat(e):U(e)&&n.push(e)}),e=n}else e="string"==typeof e&&e.trim()?[wn({src:e})]:U(e)&&"string"==typeof e.src&&e.src&&e.src.trim()?[wn(e)]:[];return e}(t);n.length?(this.changingSrc_=!0,this.cache_.sources=n,this.updateSourceCaches_(n[0]),gn(this,n[0],function(t,r){if(e.middleware_=r,e.cache_.sources=n,e.updateSourceCaches_(t),e.src_(t))return n.length>1?e.src(n.slice(1)):(e.changingSrc_=!1,e.setTimeout(function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})},0),void e.triggerReady());!function(t,e){t.forEach(function(t){return t.setTech&&t.setTech(e)})}(r,e.tech_)})):this.setTimeout(function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})},0)},e.prototype.src_=function(t){var e=this,n=this.selectSource([t]);return!n||(function(t,e){return fe(t)===fe(e)}(n.tech,this.techName_)?(this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",t):this.techCall_("src",t.src),this.changingSrc_=!1},!0),!1):(this.changingSrc_=!0,this.loadTech_(n.tech,n.source),this.tech_.ready(function(){e.changingSrc_=!1}),!1))},e.prototype.load=function(){this.techCall_("load")},e.prototype.reset=function(){this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset")},e.prototype.currentSources=function(){var t=this.currentSource(),e=[];return 0!==Object.keys(t).length&&e.push(t),this.cache_.sources||e},e.prototype.currentSource=function(){return this.cache_.source||{}},e.prototype.currentSrc=function(){return this.currentSource()&&this.currentSource().src||""},e.prototype.currentType=function(){return this.currentSource()&&this.currentSource().type||""},e.prototype.preload=function(t){return void 0!==t?(this.techCall_("setPreload",t),void(this.options_.preload=t)):this.techGet_("preload")},e.prototype.autoplay=function(t){return void 0!==t?(this.techCall_("setAutoplay",t),void(this.options_.autoplay=t)):this.techGet_("autoplay",t)},e.prototype.playsinline=function(t){return void 0!==t?(this.techCall_("setPlaysinline",t),this.options_.playsinline=t,this):this.techGet_("playsinline")},e.prototype.loop=function(t){return void 0!==t?(this.techCall_("setLoop",t),void(this.options_.loop=t)):this.techGet_("loop")},e.prototype.poster=function(t){if(void 0===t)return this.poster_;t||(t=""),t!==this.poster_&&(this.poster_=t,this.techCall_("setPoster",t),this.isPosterFromTech_=!1,this.trigger("posterchange"))},e.prototype.handleTechPosterChange_=function(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){var t=this.tech_.poster()||"";t!==this.poster_&&(this.poster_=t,this.isPosterFromTech_=!0,this.trigger("posterchange"))}},e.prototype.controls=function(t){if(void 0===t)return!!this.controls_;t=!!t,this.controls_!==t&&(this.controls_=t,this.usingNativeControls()&&this.techCall_("setControls",t),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))},e.prototype.usingNativeControls=function(t){if(void 0===t)return!!this.usingNativeControls_;t=!!t,this.usingNativeControls_!==t&&(this.usingNativeControls_=t,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))},e.prototype.error=function(t){return void 0===t?this.error_||null:null===t?(this.error_=t,this.removeClass("vjs-error"),void(this.errorDisplay&&this.errorDisplay.close())):(this.error_=new Se(t),this.addClass("vjs-error"),G.error("(CODE:"+this.error_.code+" "+Se.errorTypes[this.error_.code]+")",this.error_.message,this.error_),void this.trigger("error"))},e.prototype.reportUserActivity=function(t){this.userActivity_=!0},e.prototype.userActive=function(t){if(void 0===t)return this.userActive_;if((t=!!t)!==this.userActive_){if(this.userActive_=t,this.userActive_)return this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),void this.trigger("useractive");this.tech_&&this.tech_.one("mousemove",function(t){t.stopPropagation(),t.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}},e.prototype.listenForUserActivity_=function(){var t=void 0,e=void 0,n=void 0,r=Zt(this,this.reportUserActivity);this.on("mousedown",function(){r(),this.clearInterval(t),t=this.setInterval(r,250)}),this.on("mousemove",function(t){t.screenX===e&&t.screenY===n||(e=t.screenX,n=t.screenY,r())}),this.on("mouseup",function(e){r(),this.clearInterval(t)}),this.on("keydown",r),this.on("keyup",r);var i=void 0;this.setInterval(function(){if(this.userActivity_){this.userActivity_=!1,this.userActive(!0),this.clearTimeout(i);var t=this.options_.inactivityTimeout;t<=0||(i=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},t))}},250)},e.prototype.playbackRate=function(t){if(void 0===t)return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1;this.techCall_("setPlaybackRate",t)},e.prototype.defaultPlaybackRate=function(t){return void 0!==t?this.techCall_("setDefaultPlaybackRate",t):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1},e.prototype.isAudio=function(t){if(void 0===t)return!!this.isAudio_;this.isAudio_=!!t},e.prototype.addTextTrack=function(t,e,n){if(this.tech_)return this.tech_.addTextTrack(t,e,n)},e.prototype.addRemoteTextTrack=function(t,e){if(this.tech_)return this.tech_.addRemoteTextTrack(t,e)},e.prototype.removeRemoteTextTrack=function(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).track,e=void 0===t?arguments[0]:t;if(this.tech_)return this.tech_.removeRemoteTextTrack(e)},e.prototype.getVideoPlaybackQuality=function(){return this.techGet_("getVideoPlaybackQuality")},e.prototype.videoWidth=function(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0},e.prototype.videoHeight=function(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0},e.prototype.language=function(t){if(void 0===t)return this.language_;this.language_=String(t).toLowerCase()},e.prototype.languages=function(){return ye(e.prototype.options_.languages,this.languages_)},e.prototype.toJSON=function(){var t=ye(this.options_),e=t.tracks;t.tracks=[];for(var n=0;n<e.length;n++){var r=e[n];(r=ye(r)).player=void 0,t.tracks[n]=r}return t},e.prototype.createModal=function(t,e){var n=this;(e=e||{}).content=t||"";var r=new Ie(this,e);return this.addChild(r),r.on("dispose",function(){n.removeChild(r)}),r.open(),r},e.getTagSettings=function(t){var e={sources:[],tracks:[]},n=dt(t),r=n["data-setup"];if(at(t,"vjs-fluid")&&(n.fluid=!0),null!==r){var i=a(r||"{}"),o=i[0],s=i[1];o&&G.error(o),W(n,s)}if(W(e,n),t.hasChildNodes())for(var l=t.childNodes,c=0,u=l.length;c<u;c++){var h=l[c],d=h.nodeName.toLowerCase();"source"===d?e.sources.push(dt(h)):"track"===d&&e.tracks.push(dt(h))}return e},e.prototype.flexNotSupported_=function(){var t=o.createElement("i");return!("flexBasis"in t.style||"webkitFlexBasis"in t.style||"mozFlexBasis"in t.style||"msFlexBasis"in t.style||"msFlexOrder"in t.style)},e}(ve);dn.names.forEach(function(t){var e=dn[t];si.prototype[e.getterName]=function(){return this.tech_?this.tech_[e.getterName]():(this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName])}}),si.players={};var ai=i.navigator;si.prototype.options_={techOrder:pn.defaultTechOrder_,html5:{},flash:{},inactivityTimeout:2e3,playbackRates:[],children:["mediaLoader","posterImage","textTrackDisplay","loadingSpinner","bigPlayButton","controlBar","errorDisplay","textTrackSettings"],language:ai&&(ai.languages&&ai.languages[0]||ai.userLanguage||ai.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media."},S||si.prototype.options_.children.push("resizeManager"),["ended","seeking","seekable","networkState","readyState"].forEach(function(t){si.prototype[t]=function(){return this.techGet_(t)}}),ii.forEach(function(t){si.prototype["handleTech"+fe(t)+"_"]=function(){return this.trigger(t)}}),ve.registerComponent("Player",si);var li={},ci=function(t){return li.hasOwnProperty(t)},ui=function(t){return ci(t)?li[t]:void 0},hi=function(t,e){t.activePlugins_=t.activePlugins_||{},t.activePlugins_[e]=!0},di=function(t,e,n){var r=(n?"before":"")+"pluginsetup";t.trigger(r,e),t.trigger(r+":"+e.name,e)},pi=function(t,e){return e.prototype.name=t,function(){di(this,{name:t,plugin:e,instance:null},!0);for(var n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];var o=new(Function.prototype.bind.apply(e,[null].concat([this].concat(r))));return this[t]=function(){return o},di(this,o.getEventHash()),o}},fi=function(){function t(e){if(I(this,t),this.constructor===t)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=e,he(this),delete this.trigger,pe(this,this.constructor.defaultState),hi(e,this.name),this.dispose=Zt(this,this.dispose),e.on("dispose",this.dispose)}return t.prototype.version=function(){return this.constructor.VERSION},t.prototype.getEventHash=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.name=this.name,t.plugin=this.constructor,t.instance=this,t},t.prototype.trigger=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return zt(this.eventBusEl_,t,this.getEventHash(e))},t.prototype.handleStateChanged=function(t){},t.prototype.dispose=function(){var t=this.name,e=this.player;this.trigger("dispose"),this.off(),e.off("dispose",this.dispose),e.activePlugins_[t]=!1,this.player=this.state=null,e[t]=pi(t,li[t])},t.isBasic=function(e){var n="string"==typeof e?ui(e):e;return"function"==typeof n&&!t.prototype.isPrototypeOf(n.prototype)},t.registerPlugin=function(e,n){if("string"!=typeof e)throw new Error('Illegal plugin name, "'+e+'", must be a string, was '+(void 0===e?"undefined":R(e))+".");if(ci(e))G.warn('A plugin named "'+e+'" already exists. You may want to avoid re-registering plugins!');else if(si.prototype.hasOwnProperty(e))throw new Error('Illegal plugin name, "'+e+'", cannot share a name with an existing player method!');if("function"!=typeof n)throw new Error('Illegal plugin for "'+e+'", must be a function, was '+(void 0===n?"undefined":R(n))+".");return li[e]=n,"plugin"!==e&&(t.isBasic(n)?si.prototype[e]=function(t,e){var n=function(){di(this,{name:t,plugin:e,instance:null},!0);var n=e.apply(this,arguments);return hi(this,t),di(this,{name:t,plugin:e,instance:n}),n};return Object.keys(e).forEach(function(t){n[t]=e[t]}),n}(e,n):si.prototype[e]=pi(e,n)),n},t.deregisterPlugin=function(t){if("plugin"===t)throw new Error("Cannot de-register base plugin.");ci(t)&&(delete li[t],delete si.prototype[t])},t.getPlugins=function(){var t=void 0;return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:Object.keys(li)).forEach(function(e){var n=ui(e);n&&((t=t||{})[e]=n)}),t},t.getPluginVersion=function(t){var e=ui(t);return e&&e.VERSION||""},t}();fi.getPlugin=ui,fi.BASE_PLUGIN_NAME="plugin",fi.registerPlugin("plugin",fi),si.prototype.usingPlugin=function(t){return!!this.activePlugins_&&!0===this.activePlugins_[t]},si.prototype.hasPlugin=function(t){return!!ci(t)};"undefined"==typeof HTMLVideoElement&&tt()&&(o.createElement("video"),o.createElement("audio"),o.createElement("track"),o.createElement("video-js"));var yi=function(t){return 0===t.indexOf("#")?t.slice(1):t};function vi(t,e,n){var r=vi.getPlayer(t);if(r)return e&&G.warn('Player "'+t+'" is already initialised. Options will not be applied.'),n&&r.ready(n),r;var i="string"==typeof t?St("#"+yi(t)):t;if(!et(i))throw new TypeError("The element or ID supplied is not valid. (videojs)");o.body.contains(i)||G.warn("The element supplied is not included in the DOM"),e=e||{},vi.hooks("beforesetup").forEach(function(t){var n=t(i,ye(e));U(n)&&!Array.isArray(n)?e=ye(e,n):G.error("please return an object in beforesetup hooks")});var s=ve.getComponent("Player");return r=new s(i,e,n),vi.hooks("setup").forEach(function(t){return t(r)}),r}if(vi.hooks_={},vi.hooks=function(t,e){return vi.hooks_[t]=vi.hooks_[t]||[],e&&(vi.hooks_[t]=vi.hooks_[t].concat(e)),vi.hooks_[t]},vi.hook=function(t,e){vi.hooks(t,e)},vi.hookOnce=function(t,e){vi.hooks(t,[].concat(e).map(function(e){return function n(){return vi.removeHook(t,n),e.apply(void 0,arguments)}}))},vi.removeHook=function(t,e){var n=vi.hooks(t).indexOf(e);return!(n<=-1)&&(vi.hooks_[t]=vi.hooks_[t].slice(),vi.hooks_[t].splice(n,1),!0)},!0!==i.VIDEOJS_NO_DYNAMIC_STYLE&&tt()){var gi=St(".vjs-styles-defaults");if(!gi){gi=Jt("vjs-styles-defaults");var mi=St("head");mi&&mi.insertBefore(gi,mi.firstChild),Qt(gi,"\n      .video-js {\n        width: 300px;\n        height: 150px;\n      }\n\n      .vjs-fluid {\n        padding-top: 56.25%\n      }\n    ")}}Yt(1,vi),vi.VERSION=u,vi.options=si.prototype.options_,vi.getPlayers=function(){return si.players},vi.getPlayer=function(t){var e=si.players,n=void 0;if("string"==typeof t){var r=yi(t),i=e[r];if(i)return i;n=St("#"+r)}else n=t;if(et(n)){var o=n,s=o.player,a=o.playerId;if(s||e[a])return s||e[a]}},vi.getAllPlayers=function(){return Object.keys(si.players).map(function(t){return si.players[t]}).filter(Boolean)},vi.players=si.players,vi.getComponent=ve.getComponent,vi.registerComponent=function(t,e){pn.isTech(e)&&G.warn("The "+t+" tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)"),ve.registerComponent.call(ve,t,e)},vi.getTech=pn.getTech,vi.registerTech=pn.registerTech,vi.use=function(t,e){fn[t]=fn[t]||[],fn[t].push(e)},!S&&Object.defineProperty?(Object.defineProperty(vi,"middleware",{value:{},writeable:!1,enumerable:!0}),Object.defineProperty(vi.middleware,"TERMINATOR",{value:vn,writeable:!1,enumerable:!0})):vi.middleware={TERMINATOR:vn},vi.browser=D,vi.TOUCH_ENABLED=M,vi.extend=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=function(){t.apply(this,arguments)},r={};for(var i in"object"===(void 0===e?"undefined":R(e))?(e.constructor!==Object.prototype.constructor&&(n=e.constructor),r=e):"function"==typeof e&&(n=e),function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(void 0===e?"undefined":R(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.super_=e)}(n,t),r)r.hasOwnProperty(i)&&(n.prototype[i]=r[i]);return n},vi.mergeOptions=ye,vi.bind=Zt,vi.registerPlugin=fi.registerPlugin,vi.plugin=function(t,e){return G.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),fi.registerPlugin(t,e)},vi.getPlugins=fi.getPlugins,vi.getPlugin=fi.getPlugin,vi.getPluginVersion=fi.getPluginVersion,vi.addLanguage=function(t,e){var n;return t=(""+t).toLowerCase(),vi.options.languages=ye(vi.options.languages,((n={})[t]=e,n)),vi.options.languages[t]},vi.log=G,vi.createTimeRange=vi.createTimeRanges=_e,vi.formatTime=Hn,vi.setFormatTime=function(t){Fn=t},vi.resetFormatTime=function(){Fn=Bn},vi.parseUrl=Ye,vi.isCrossOrigin=Ze,vi.EventTarget=ne,vi.on=Wt,vi.one=qt,vi.off=Ut,vi.trigger=zt,vi.xhr=l,vi.TextTrack=rn,vi.AudioTrack=on,vi.VideoTrack=sn,["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(function(t){vi[t]=function(){return G.warn("videojs."+t+"() is deprecated; use videojs.dom."+t+"() instead"),jt[t].apply(null,arguments)}}),vi.computedStyle=Y,vi.dom=jt,vi.url=tn,t.exports=vi},function(t,e,n){(function(e){var n;n="undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{},t.exports=n}).call(this,n(3))},function(t,e,n){(function(e){var r,i=void 0!==e?e:"undefined"!=typeof window?window:{},o=n(27);"undefined"!=typeof document?r=document:(r=i["__GLOBAL_DOCUMENT_CACHE@4"])||(r=i["__GLOBAL_DOCUMENT_CACHE@4"]=o),t.exports=r}).call(this,n(3))},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},,function(t,e,n){},,function(t,e,n){},,function(t,e,n){},,function(t,e,n){},function(t,e,n){!function(t){"use strict";t=t&&t.hasOwnProperty("default")?t.default:t;var e=function(t,e,n){this.vjsPlayer=t,this.controller=n,this.contentTrackingTimer=null,this.contentComplete=!1,this.updateTimeIntervalHandle=null,this.updateTimeInterval=1e3,this.seekCheckIntervalHandle=null,this.seekCheckInterval=1e3,this.resizeCheckIntervalHandle=null,this.resizeCheckInterval=250,this.seekThreshold=100,this.contentEndedListeners=[],this.contentSource="",this.contentPlayheadTracker={currentTime:0,previousTime:0,seeking:!1,duration:0},this.vjsPlayerDimensions={width:this.getPlayerWidth(),height:this.getPlayerHeight()},this.vjsControls=this.vjsPlayer.getChild("controlBar"),this.h5Player=null,this.vjsPlayer.one("play",this.setUpPlayerIntervals.bind(this)),this.boundContentEndedListener=this.localContentEndedListener.bind(this),this.vjsPlayer.on("contentended",this.boundContentEndedListener),this.vjsPlayer.on("dispose",this.playerDisposedListener.bind(this)),this.vjsPlayer.on("readyforpreroll",this.onReadyForPreroll.bind(this)),this.vjsPlayer.ready(this.onPlayerReady.bind(this)),this.vjsPlayer.ads(e)};e.prototype.setUpPlayerIntervals=function(){this.updateTimeIntervalHandle=setInterval(this.updateCurrentTime.bind(this),this.updateTimeInterval),this.seekCheckIntervalHandle=setInterval(this.checkForSeeking.bind(this),this.seekCheckInterval),this.resizeCheckIntervalHandle=setInterval(this.checkForResize.bind(this),this.resizeCheckInterval)},e.prototype.updateCurrentTime=function(){this.contentPlayheadTracker.seeking||(this.contentPlayheadTracker.currentTime=this.vjsPlayer.currentTime())},e.prototype.checkForSeeking=function(){var t=this.vjsPlayer.currentTime(),e=1e3*(t-this.contentPlayheadTracker.previousTime);Math.abs(e)>this.seekCheckInterval+this.seekThreshold?this.contentPlayheadTracker.seeking=!0:this.contentPlayheadTracker.seeking=!1,this.contentPlayheadTracker.previousTime=this.vjsPlayer.currentTime()},e.prototype.checkForResize=function(){var t=this.getPlayerWidth(),e=this.getPlayerHeight();t==this.vjsPlayerDimensions.width&&e==this.vjsPlayerDimensions.height||(this.vjsPlayerDimensions.width=t,this.vjsPlayerDimensions.height=e,this.controller.onPlayerResize(t,e))},e.prototype.localContentEndedListener=function(){for(var t in this.contentComplete||(this.contentComplete=!0,this.controller.onContentComplete()),this.contentEndedListeners)"function"==typeof this.contentEndedListeners[t]&&this.contentEndedListeners[t]();clearInterval(this.updateTimeIntervalHandle),clearInterval(this.seekCheckIntervalHandle),clearInterval(this.resizeCheckIntervalHandle),this.vjsPlayer.el()&&this.vjsPlayer.one("play",this.setUpPlayerIntervals.bind(this))},e.prototype.onNoPostroll=function(){this.vjsPlayer.trigger("nopostroll")},e.prototype.playerDisposedListener=function(){this.contentEndedListeners=[],this.controller.onPlayerDisposed(),this.contentComplete=!0,this.vjsPlayer.off("contentended",this.boundContentEndedListener),this.vjsPlayer.ads.adTimeoutTimeout&&clearTimeout(this.vjsPlayer.ads.adTimeoutTimeout);var t=[this.updateTimeIntervalHandle,this.seekCheckIntervalHandle,this.resizeCheckIntervalHandle];for(var e in t)t[e]&&clearInterval(t[e])},e.prototype.onReadyForPreroll=function(){this.controller.onPlayerReadyForPreroll()},e.prototype.onPlayerReady=function(){this.h5Player=document.getElementById(this.getPlayerId()).getElementsByClassName("vjs-tech")[0],this.h5Player.hasAttribute("autoplay")&&this.controller.setSetting("adWillAutoPlay",!0),this.onVolumeChange(),this.vjsPlayer.on("fullscreenchange",this.onFullscreenChange.bind(this)),this.vjsPlayer.on("volumechange",this.onVolumeChange.bind(this)),this.controller.onPlayerReady()},e.prototype.onFullscreenChange=function(){this.vjsPlayer.isFullscreen()?this.controller.onPlayerEnterFullscreen():this.controller.onPlayerExitFullscreen()},e.prototype.onVolumeChange=function(){var t=this.vjsPlayer.muted()?0:this.vjsPlayer.volume();this.controller.onPlayerVolumeChanged(t)},e.prototype.injectAdContainerDiv=function(t){this.vjsControls.el().parentNode.appendChild(t)},e.prototype.getContentPlayer=function(){return this.h5Player},e.prototype.getVolume=function(){return this.vjsPlayer.muted()?0:this.vjsPlayer.volume()},e.prototype.setVolume=function(t){this.vjsPlayer.volume(t),0==t?this.vjsPlayer.muted(!0):this.vjsPlayer.muted(!1)},e.prototype.unmute=function(){this.vjsPlayer.muted(!1)},e.prototype.mute=function(){this.vjsPlayer.muted(!0)},e.prototype.play=function(){this.vjsPlayer.play()},e.prototype.getPlayerWidth=function(){var t=(getComputedStyle(this.vjsPlayer.el())||{}).width;return t&&0!==parseInt(t,10)||(t=(this.vjsPlayer.el().getBoundingClientRect()||{}).width),parseInt(t,10)||this.vjsPlayer.width()},e.prototype.getPlayerHeight=function(){var t=(getComputedStyle(this.vjsPlayer.el())||{}).height;return t&&0!==parseInt(t,10)||(t=(this.vjsPlayer.el().getBoundingClientRect()||{}).height),parseInt(t,10)||this.vjsPlayer.height()},e.prototype.getPlayerOptions=function(){return this.vjsPlayer.options_},e.prototype.getPlayerId=function(){return this.vjsPlayer.id()},e.prototype.toggleFullscreen=function(){this.vjsPlayer.isFullscreen()?this.vjsPlayer.exitFullscreen():this.vjsPlayer.requestFullscreen()},e.prototype.getContentPlayheadTracker=function(){return this.contentPlayheadTracker},e.prototype.onAdError=function(t){this.vjsControls.show();var e=void 0!==t.getError?t.getError():t.stack;this.vjsPlayer.trigger({type:"adserror",data:{AdError:e,AdErrorEvent:t}})},e.prototype.onAdBreakStart=function(){this.contentSource=this.vjsPlayer.currentSrc(),this.vjsPlayer.off("contentended",this.boundContentEndedListener),this.vjsPlayer.ads.startLinearAdMode(),this.vjsControls.hide(),this.vjsPlayer.pause()},e.prototype.onAdBreakEnd=function(){this.vjsPlayer.on("contentended",this.boundContentEndedListener),this.vjsPlayer.ads.inAdBreak()&&this.vjsPlayer.ads.endLinearAdMode(),this.vjsControls.show()},e.prototype.onAdStart=function(){this.vjsPlayer.trigger("ads-ad-started")},e.prototype.onAllAdsCompleted=function(){1==this.contentComplete&&(this.h5Player.src!=this.contentSource&&this.vjsPlayer.src(this.contentSource),this.controller.onContentAndAdsCompleted())},e.prototype.onAdsReady=function(){this.vjsPlayer.trigger("adsready")},e.prototype.changeSource=function(t,e){this.vjsPlayer.currentSrc()&&(this.vjsPlayer.currentTime(0),this.vjsPlayer.pause()),t&&this.vjsPlayer.src(t),e?this.vjsPlayer.one("loadedmetadata",this.playContentFromZero.bind(this)):this.vjsPlayer.one("loadedmetadata",this.seekContentToZero.bind(this))},e.prototype.seekContentToZero=function(){this.vjsPlayer.currentTime(0)},e.prototype.playContentFromZero=function(){this.vjsPlayer.currentTime(0),this.vjsPlayer.play()},e.prototype.triggerPlayerEvent=function(t,e){this.vjsPlayer.trigger(t,e)},e.prototype.addContentEndedListener=function(t){this.contentEndedListeners.push(t)},e.prototype.reset=function(){this.vjsPlayer.on("contentended",this.boundContentEndedListener),this.vjsControls.show(),this.vjsPlayer.ads.inAdBreak()&&this.vjsPlayer.ads.endLinearAdMode(),this.contentPlayheadTracker.currentTime=0,this.contentComplete=!1};var n=function(t){this.controller=t,this.adContainerDiv=document.createElement("div"),this.controlsDiv=document.createElement("div"),this.countdownDiv=document.createElement("div"),this.seekBarDiv=document.createElement("div"),this.progressDiv=document.createElement("div"),this.playPauseDiv=document.createElement("div"),this.muteDiv=document.createElement("div"),this.sliderDiv=document.createElement("div"),this.sliderLevelDiv=document.createElement("div"),this.fullscreenDiv=document.createElement("div"),this.boundOnMouseUp=this.onMouseUp.bind(this),this.boundOnMouseMove=this.onMouseMove.bind(this),this.adPlayheadTracker={currentTime:0,duration:0,isPod:!1,adPosition:0,totalAds:0},this.controlPrefix=this.controller.getPlayerId()+"_",this.showCountdown=!0,!1===this.controller.getSettings().showCountdown&&(this.showCountdown=!1),this.createAdContainer()};n.prototype.createAdContainer=function(){this.assignControlAttributes(this.adContainerDiv,"ima-ad-container"),this.adContainerDiv.style.position="absolute",this.adContainerDiv.style.zIndex=1111,this.adContainerDiv.addEventListener("mouseenter",this.showAdControls.bind(this),!1),this.adContainerDiv.addEventListener("mouseleave",this.hideAdControls.bind(this),!1),this.createControls(),this.controller.injectAdContainerDiv(this.adContainerDiv)},n.prototype.createControls=function(){this.assignControlAttributes(this.controlsDiv,"ima-controls-div"),this.controlsDiv.style.width="100%",this.assignControlAttributes(this.countdownDiv,"ima-countdown-div"),this.countdownDiv.innerHTML=this.controller.getSettings().adLabel,this.countdownDiv.style.display=this.showCountdown?"block":"none",this.assignControlAttributes(this.seekBarDiv,"ima-seek-bar-div"),this.seekBarDiv.style.width="100%",this.assignControlAttributes(this.progressDiv,"ima-progress-div"),this.assignControlAttributes(this.playPauseDiv,"ima-play-pause-div"),this.addClass(this.playPauseDiv,"ima-playing"),this.playPauseDiv.addEventListener("click",this.onAdPlayPauseClick.bind(this),!1),this.assignControlAttributes(this.muteDiv,"ima-mute-div"),this.addClass(this.muteDiv,"ima-non-muted"),this.muteDiv.addEventListener("click",this.onAdMuteClick.bind(this),!1),this.assignControlAttributes(this.sliderDiv,"ima-slider-div"),this.sliderDiv.addEventListener("mousedown",this.onAdVolumeSliderMouseDown.bind(this),!1),this.controller.getIsIos()&&(this.sliderDiv.style.display="none"),this.assignControlAttributes(this.sliderLevelDiv,"ima-slider-level-div"),this.assignControlAttributes(this.fullscreenDiv,"ima-fullscreen-div"),this.addClass(this.fullscreenDiv,"ima-non-fullscreen"),this.fullscreenDiv.addEventListener("click",this.onAdFullscreenClick.bind(this),!1),this.adContainerDiv.appendChild(this.controlsDiv),this.controlsDiv.appendChild(this.countdownDiv),this.controlsDiv.appendChild(this.seekBarDiv),this.controlsDiv.appendChild(this.playPauseDiv),this.controlsDiv.appendChild(this.muteDiv),this.controlsDiv.appendChild(this.sliderDiv),this.controlsDiv.appendChild(this.fullscreenDiv),this.seekBarDiv.appendChild(this.progressDiv),this.sliderDiv.appendChild(this.sliderLevelDiv)},n.prototype.onAdPlayPauseClick=function(){this.controller.onAdPlayPauseClick()},n.prototype.onAdMuteClick=function(){this.controller.onAdMuteClick()},n.prototype.onAdFullscreenClick=function(){this.controller.toggleFullscreen()},n.prototype.onAdsPaused=function(){this.addClass(this.playPauseDiv,"ima-paused"),this.removeClass(this.playPauseDiv,"ima-playing"),this.showAdControls()},n.prototype.onAdsResumed=function(){this.onAdsPlaying(),this.showAdControls()},n.prototype.onAdsPlaying=function(){this.addClass(this.playPauseDiv,"ima-playing"),this.removeClass(this.playPauseDiv,"ima-paused")},n.prototype.updateAdUi=function(t,e,n,r,i){var o=Math.floor(e/60),s=Math.floor(e%60);s.toString().length<2&&(s="0"+s);var a=": ";i>1&&(a=" ("+r+" "+this.controller.getSettings().adLabelNofN+" "+i+"): "),this.countdownDiv.innerHTML=this.controller.getSettings().adLabel+a+o+":"+s;var l=t/n,c=100*l;this.progressDiv.style.width=c+"%"},n.prototype.unmute=function(){this.addClass(this.muteDiv,"ima-non-muted"),this.removeClass(this.muteDiv,"ima-muted"),this.sliderLevelDiv.style.width=100*this.controller.getPlayerVolume()+"%"},n.prototype.mute=function(){this.addClass(this.muteDiv,"ima-muted"),this.removeClass(this.muteDiv,"ima-non-muted"),this.sliderLevelDiv.style.width="0%"},n.prototype.onAdVolumeSliderMouseDown=function(){document.addEventListener("mouseup",this.boundOnMouseUp,!1),document.addEventListener("mousemove",this.boundOnMouseMove,!1)},n.prototype.onMouseMove=function(t){this.changeVolume(t)},n.prototype.onMouseUp=function(t){this.changeVolume(t),document.removeEventListener("mouseup",this.boundOnMouseUp),document.removeEventListener("mousemove",this.boundOnMouseMove)},n.prototype.changeVolume=function(t){var e=(t.clientX-this.sliderDiv.getBoundingClientRect().left)/this.sliderDiv.offsetWidth;e*=100,e=Math.min(Math.max(e,0),100),this.sliderLevelDiv.style.width=e+"%",0==this.percent?(this.addClass(this.muteDiv,"ima-muted"),this.removeClass(this.muteDiv,"ima-non-muted")):(this.addClass(this.muteDiv,"ima-non-muted"),this.removeClass(this.muteDiv,"ima-muted")),this.controller.setVolume(e/100)},n.prototype.showAdContainer=function(){this.adContainerDiv.style.display="block"},n.prototype.onAdError=function(){this.adContainerDiv.style.display="none"},n.prototype.onAdBreakStart=function(t){this.adContainerDiv.style.display="block";var e=t.getAd().getContentType();"application/javascript"!==e||this.controller.getSettings().showControlsForJSAds?this.controlsDiv.style.display="block":this.controlsDiv.style.display="none",this.onAdsPlaying(),this.hideAdControls()},n.prototype.onAdBreakEnd=function(){var t=this.controller.getCurrentAd();(null==t||t.isLinear())&&(this.adContainerDiv.style.display="none"),this.controlsDiv.style.display="none",this.countdownDiv.innerHTML=""},n.prototype.onAllAdsCompleted=function(){this.adContainerDiv.style.display="none"},n.prototype.onLinearAdStart=function(){this.removeClass(this.adContainerDiv,"bumpable-ima-ad-container")},n.prototype.onNonLinearAdLoad=function(){this.adContainerDiv.style.display="block",this.addClass(this.adContainerDiv,"bumpable-ima-ad-container")},n.prototype.onPlayerEnterFullscreen=function(){this.addClass(this.fullscreenDiv,"ima-fullscreen"),this.removeClass(this.fullscreenDiv,"ima-non-fullscreen")},n.prototype.onPlayerExitFullscreen=function(){this.addClass(this.fullscreenDiv,"ima-non-fullscreen"),this.removeClass(this.fullscreenDiv,"ima-fullscreen")},n.prototype.onPlayerVolumeChanged=function(t){0==t?(this.addClass(this.muteDiv,"ima-muted"),this.removeClass(this.muteDiv,"ima-non-muted"),this.sliderLevelDiv.style.width="0%"):(this.addClass(this.muteDiv,"ima-non-muted"),this.removeClass(this.muteDiv,"ima-muted"),this.sliderLevelDiv.style.width=100*t+"%")},n.prototype.showAdControls=function(){this.addClass(this.controlsDiv,"ima-controls-div-showing"),this.playPauseDiv.style.display="block",this.muteDiv.style.display="block",this.fullscreenDiv.style.display="block",this.controller.getIsIos()||(this.sliderDiv.style.display="block")},n.prototype.hideAdControls=function(){this.removeClass(this.controlsDiv,"ima-controls-div-showing"),this.playPauseDiv.style.display="none",this.muteDiv.style.display="none",this.sliderDiv.style.display="none",this.fullscreenDiv.style.display="none"},n.prototype.assignControlAttributes=function(t,e){t.id=this.controlPrefix+e,t.className=this.controlPrefix+e+" "+e},n.prototype.getClassRegexp=function(t){return new RegExp("(^|[^A-Za-z-])"+t+"((?![A-Za-z-])|$)","gi")},n.prototype.elementHasClass=function(t,e){var n=this.getClassRegexp(e);return n.test(t.className)},n.prototype.addClass=function(t,e){t.className=t.className.trim()+" "+e},n.prototype.removeClass=function(t,e){var n=this.getClassRegexp(e);t.className=t.className.trim().replace(n,"")},n.prototype.getAdContainerDiv=function(){return this.adContainerDiv},n.prototype.setShowCountdown=function(t){this.showCountdown=t,this.countdownDiv.style.display=this.showCountdown?"block":"none"};var r={name:"videojs-ima",version:"1.5.1",license:"Apache-2.0",main:"./dist/videojs.ima.js",author:{name:"Google Inc."},engines:{node:">=0.8.0"},scripts:{contBuild:"watch 'npm run rollup:max' src",predevServer:'echo "Starting up server on localhost:8000."',devServer:"forever start ./node_modules/http-server/bin/http-server -p 8000 && npm run contBuild",postdevServer:"forever stop ./node_modules/http-server/bin/http-server",lint:'eslint "src/*.js"',rollup:"npm-run-all rollup:*","rollup:max":"rollup -c configs/rollup.config.js","rollup:min":"rollup -c configs/rollup.config.min.js",pretest:"npm run rollup",start:"npm run devServer",test:"npm-run-all test:*","test:vjs5":"npm install video.js@5.19.2 --no-save && npm-run-all -p -r testServer webdriver","test:vjs6":"npm install video.js@6 --no-save && npm-run-all -p -r testServer webdriver",testServer:"http-server --cors -p 8000 --silent",preversion:"node scripts/preversion.js && npm run lint && npm test",version:"node scripts/version.js",postversion:"node scripts/postversion.js",webdriver:"mocha test/webdriver/*.js --no-timeouts"},repository:{type:"git",url:"https://github.com/googleads/videojs-ima"},files:["CHANGELOG.md","LICENSE","README.md","dist/","src/"],dependencies:{"can-autoplay":"^3.0.0","video.js":"^5.19.2 || ^6","videojs-contrib-ads":"^6"},devDependencies:{"babel-core":"^6.26.0","babel-preset-env":"^1.6.1",child_process:"^1.0.2",chromedriver:"^2.35.0","conventional-changelog-cli":"^1.3.5","conventional-changelog-videojs":"^3.0.0",eslint:"^4.11.0","eslint-config-google":"^0.9.1","eslint-plugin-jsdoc":"^3.2.0",forever:"^0.15.3",geckodriver:"^1.10.0","http-server":"^0.10.0",mocha:"^4.0.1","npm-run-all":"^4.1.2",path:"^0.12.7",rimraf:"^2.6.2",rollup:"^0.51.8","rollup-plugin-babel":"^3.0.3","rollup-plugin-copy":"^0.2.3","rollup-plugin-json":"^2.3.0","rollup-plugin-uglify":"^2.0.1","selenium-webdriver":"^3.6.0","uglify-es":"^3.1.10",watch:"^1.0.2"},keywords:["videojs","videojs-plugin"]},i=function(t){this.controller=t,this.adDisplayContainer=null,this.adDisplayContainerInitialized=!1,this.adsLoader=null,this.adsManager=null,this.adsRenderingSettings=null,this.adTagUrl=null,this.adsResponse=null,this.currentAd=null,this.adTrackingTimer=null,this.allAdsCompleted=!1,this.adsActive=!1,this.adPlaying=!1,this.adMuted=!1,this.adBreakReadyListener=void 0,this.contentCompleteCalled=!1,this.adsManagerDimensions={width:0,height:0},this.autoPlayAdBreaks=!0,!1===this.controller.getSettings().autoPlayAdBreaks&&(this.autoPlayAdBreaks=!1),this.controller.getSettings().locale&&google.ima.settings.setLocale(this.controller.getSettings().locale),this.controller.getSettings().disableFlashAds&&google.ima.settings.setDisableFlashAds(this.controller.getSettings().disableFlashAds),this.controller.getSettings().disableCustomPlaybackForIOS10Plus&&google.ima.settings.setDisableCustomPlaybackForIOS10Plus(this.controller.getSettings().disableCustomPlaybackForIOS10Plus)};i.prototype.initAdObjects=function(){this.adDisplayContainer=new google.ima.AdDisplayContainer(this.controller.getAdContainerDiv(),this.controller.getContentPlayer()),this.adsLoader=new google.ima.AdsLoader(this.adDisplayContainer),this.adsLoader.getSettings().setVpaidMode(google.ima.ImaSdkSettings.VpaidMode.ENABLED),0==this.controller.getSettings().vpaidAllowed&&this.adsLoader.getSettings().setVpaidMode(google.ima.ImaSdkSettings.VpaidMode.DISABLED),this.controller.getSettings().vpaidMode&&this.adsLoader.getSettings().setVpaidMode(this.controller.getSettings().vpaidMode),this.controller.getSettings().locale&&this.adsLoader.getSettings().setLocale(this.controller.getSettings().locale),this.controller.getSettings().numRedirects&&this.adsLoader.getSettings().setNumRedirects(this.controller.getSettings().numRedirects),this.adsLoader.getSettings().setPlayerType("videojs-ima"),this.adsLoader.getSettings().setPlayerVersion(r.version),this.adsLoader.getSettings().setAutoPlayAdBreaks(this.autoPlayAdBreaks),this.adsLoader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.onAdsManagerLoaded.bind(this),!1),this.adsLoader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,this.onAdsLoaderError.bind(this),!1)},i.prototype.requestAds=function(){var t=new google.ima.AdsRequest;this.controller.getSettings().adTagUrl?t.adTagUrl=this.controller.getSettings().adTagUrl:t.adsResponse=this.controller.getSettings().adsResponse,this.controller.getSettings().forceNonLinearFullSlot&&(t.forceNonLinearFullSlot=!0),this.controller.getSettings().vastLoadTimeout&&(t.vastLoadTimeout=this.controller.getSettings().vastLoadTimeout),t.linearAdSlotWidth=this.controller.getPlayerWidth(),t.linearAdSlotHeight=this.controller.getPlayerHeight(),t.nonLinearAdSlotWidth=this.controller.getSettings().nonLinearWidth||this.controller.getPlayerWidth(),t.nonLinearAdSlotHeight=this.controller.getSettings().nonLinearHeight||this.controller.getPlayerHeight(),t.setAdWillAutoPlay(this.controller.adsWillAutoplay()),t.setAdWillPlayMuted(this.controller.adsWillPlayMuted()),this.adsLoader.requestAds(t),this.controller.triggerPlayerEvent("ads-request",t)},i.prototype.onAdsManagerLoaded=function(t){this.createAdsRenderingSettings(),this.adsManager=t.getAdsManager(this.controller.getContentPlayheadTracker(),this.adsRenderingSettings),this.adsManager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,this.onAdError.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.AD_BREAK_READY,this.onAdBreakReady.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED,this.onContentPauseRequested.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED,this.onContentResumeRequested.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.ALL_ADS_COMPLETED,this.onAllAdsCompleted.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.LOADED,this.onAdLoaded.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.STARTED,this.onAdStarted.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.CLICK,this.onAdPaused.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.COMPLETE,this.onAdComplete.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.SKIPPED,this.onAdComplete.bind(this)),this.controller.getIsMobile()&&(this.adsManager.addEventListener(google.ima.AdEvent.Type.PAUSED,this.onAdPaused.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.RESUMED,this.onAdResumed.bind(this))),this.autoPlayAdBreaks||this.initAdsManager(),this.controller.onAdsReady(),this.controller.getSettings().adsManagerLoadedCallback&&this.controller.getSettings().adsManagerLoadedCallback()},i.prototype.onAdsLoaderError=function(t){window.console.warn("AdsLoader error: "+t.getError()),this.controller.onErrorLoadingAds(t),this.adsManager&&this.adsManager.destroy()},i.prototype.initAdsManager=function(){try{var t=this.controller.getPlayerWidth(),e=this.controller.getPlayerHeight();this.adsManagerDimensions.width=t,this.adsManagerDimensions.height=e,this.adsManager.init(t,e,google.ima.ViewMode.NORMAL),this.adsManager.setVolume(this.controller.getPlayerVolume()),this.adDisplayContainerInitialized||(this.adDisplayContainer.initialize(),this.adDisplayContainer.initialized=!0)}catch(t){this.onAdError(t)}},i.prototype.createAdsRenderingSettings=function(){if(this.adsRenderingSettings=new google.ima.AdsRenderingSettings,this.adsRenderingSettings.restoreCustomPlaybackStateOnAdBreakComplete=!0,this.controller.getSettings().adsRenderingSettings)for(var t in this.controller.getSettings().adsRenderingSettings)""!==t&&(this.adsRenderingSettings[t]=this.controller.getSettings().adsRenderingSettings[t])},i.prototype.onAdError=function(t){var e=void 0!==t.getError?t.getError():t.stack;window.console.warn("Ad error: "+e),this.adsManager.destroy(),this.controller.onAdError(t),this.adsActive=!1,this.adPlaying=!1},i.prototype.onAdBreakReady=function(t){this.adBreakReadyListener(t)},i.prototype.onContentPauseRequested=function(t){this.adsActive=!0,this.adPlaying=!0,this.controller.onAdBreakStart(t)},i.prototype.onContentResumeRequested=function(t){this.adsActive=!1,this.adPlaying=!1,this.controller.onAdBreakEnd()},i.prototype.onAllAdsCompleted=function(t){this.allAdsCompleted=!0,this.controller.onAllAdsCompleted()},i.prototype.onAdLoaded=function(t){t.getAd().isLinear()||(this.controller.onNonLinearAdLoad(),this.controller.playContent())},i.prototype.onAdStarted=function(t){this.currentAd=t.getAd(),this.currentAd.isLinear()?(this.adTrackingTimer=setInterval(this.onAdPlayheadTrackerInterval.bind(this),250),this.controller.onLinearAdStart()):this.controller.onNonLinearAdStart()},i.prototype.onAdPaused=function(){this.controller.onAdsPaused()},i.prototype.onAdResumed=function(t){this.controller.onAdsResumed()},i.prototype.onAdComplete=function(){this.currentAd.isLinear()&&clearInterval(this.adTrackingTimer)},i.prototype.onAdPlayheadTrackerInterval=function(){var t=this.adsManager.getRemainingTime(),e=this.currentAd.getDuration(),n=e-t;n=n>0?n:0;var r=0,i=void 0;this.currentAd.getAdPodInfo()&&(i=this.currentAd.getAdPodInfo().getAdPosition(),r=this.currentAd.getAdPodInfo().getTotalAds()),this.controller.onAdPlayheadUpdated(n,t,e,i,r)},i.prototype.onContentComplete=function(){this.adsLoader&&(this.adsLoader.contentComplete(),this.contentCompleteCalled=!0),this.adsManager&&this.adsManager.getCuePoints()&&!this.adsManager.getCuePoints().includes(-1)&&this.controller.onNoPostroll(),this.allAdsCompleted&&this.controller.onContentAndAdsCompleted()},i.prototype.onPlayerDisposed=function(){this.adTrackingTimer&&clearInterval(this.adTrackingTimer),this.adsManager&&(this.adsManager.destroy(),this.adsManager=null)},i.prototype.onPlayerReadyForPreroll=function(){if(this.autoPlayAdBreaks){this.initAdsManager();try{this.controller.showAdContainer(),this.adsManager.setVolume(this.controller.getPlayerVolume()),this.adsManager.start()}catch(t){this.onAdError(t)}}},i.prototype.onPlayerReady=function(){this.initAdObjects(),(this.controller.getSettings().adTagUrl||this.controller.getSettings().adsResponse)&&this.requestAds()},i.prototype.onPlayerEnterFullscreen=function(){this.adsManager&&this.adsManager.resize(window.screen.width,window.screen.height,google.ima.ViewMode.FULLSCREEN)},i.prototype.onPlayerExitFullscreen=function(){this.adsManager&&this.adsManager.resize(this.controller.getPlayerWidth(),this.controller.getPlayerHeight(),google.ima.ViewMode.NORMAL)},i.prototype.onPlayerVolumeChanged=function(t){this.adsManager&&this.adsManager.setVolume(t),this.adMuted=0==t},i.prototype.onPlayerResize=function(t,e){this.adsManager&&(this.adsManagerDimensions.width=t,this.adsManagerDimensions.height=e,this.adsManager.resize(t,e,google.ima.ViewMode.NORMAL))},i.prototype.getCurrentAd=function(){return this.currentAd},i.prototype.setAdBreakReadyListener=function(t){this.adBreakReadyListener=t},i.prototype.isAdPlaying=function(){return this.adPlaying},i.prototype.isAdMuted=function(){return this.adMuted},i.prototype.pauseAds=function(){this.adsManager.pause(),this.adPlaying=!1},i.prototype.resumeAds=function(){setTimeout(this.adsManager.resume(),100),this.adPlaying=!0},i.prototype.unmute=function(){this.adsManager.setVolume(1),this.adMuted=!1},i.prototype.mute=function(){this.adsManager.setVolume(0),this.adMuted=!0},i.prototype.setVolume=function(t){this.adsManager.setVolume(t),this.adMuted=0==t},i.prototype.initializeAdDisplayContainer=function(){this.adDisplayContainer&&(this.adDisplayContainerInitialized=!0,this.adDisplayContainer.initialize())},i.prototype.playAdBreak=function(){this.autoPlayAdBreaks||(this.controller.showAdContainer(),this.adsManager.setVolume(this.controller.getPlayerVolume()),this.adsManager.start())},i.prototype.addEventListener=function(t,e){this.adsManager&&this.adsManager.addEventListener(t,e)},i.prototype.getAdsManager=function(){return this.adsManager},i.prototype.reset=function(){this.adsActive=!1,this.adPlaying=!1,this.adTrackingTimer&&clearInterval(this.adTrackingTimer),this.adsManager&&(this.adsManager.destroy(),this.adsManager=null),this.adsLoader&&!this.contentCompleteCalled&&this.adsLoader.contentComplete(),this.contentCompleteCalled=!1,this.allAdsCompleted=!1};var o=function(t,r){this.settings={},this.contentAndAdsEndedListeners=[],this.isMobile=navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i),this.isIos=navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i),this.initWithSettings(r);var o={debug:this.settings.debug,timeout:this.settings.timeout,prerollTimeout:this.settings.prerollTimeout},s=this.extend({},o,r.contribAdsSettings||{});this.playerWrapper=new e(t,s,this),this.adUi=new n(this),this.sdkImpl=new i(this)};o.IMA_DEFAULTS={debug:!1,timeout:5e3,prerollTimeout:1e3,adLabel:"Advertisement",adLabelNofN:"of",showControlsForJSAds:!0},o.prototype.initWithSettings=function(t){this.settings=this.extend({},o.IMA_DEFAULTS,t||{}),this.warnAboutDeprecatedSettings(),this.showCountdown=!0,!1===this.settings.showCountdown&&(this.showCountdown=!1)},o.prototype.warnAboutDeprecatedSettings=function(){var t=this;["adWillAutoplay","adsWillAutoplay","adWillPlayMuted","adsWillPlayMuted"].forEach(function(e){t.settings[e]})},o.prototype.getSettings=function(){return this.settings},o.prototype.getIsMobile=function(){return this.isMobile},o.prototype.getIsIos=function(){return this.isIos},o.prototype.injectAdContainerDiv=function(t){this.playerWrapper.injectAdContainerDiv(t)},o.prototype.getAdContainerDiv=function(){return this.adUi.getAdContainerDiv()},o.prototype.getContentPlayer=function(){return this.playerWrapper.getContentPlayer()},o.prototype.getContentPlayheadTracker=function(){return this.playerWrapper.getContentPlayheadTracker()},o.prototype.requestAds=function(){this.sdkImpl.requestAds()},o.prototype.setSetting=function(t,e){this.settings[t]=e},o.prototype.onErrorLoadingAds=function(t){this.adUi.onAdError(),this.playerWrapper.onAdError(t)},o.prototype.onAdPlayPauseClick=function(){this.sdkImpl.isAdPlaying()?(this.adUi.onAdsPaused(),this.sdkImpl.pauseAds()):(this.adUi.onAdsPlaying(),this.sdkImpl.resumeAds())},o.prototype.onAdMuteClick=function(){this.sdkImpl.isAdMuted()?(this.playerWrapper.unmute(),this.adUi.unmute(),this.sdkImpl.unmute()):(this.playerWrapper.mute(),this.adUi.mute(),this.sdkImpl.mute())},o.prototype.setVolume=function(t){this.playerWrapper.setVolume(t),this.sdkImpl.setVolume(t)},o.prototype.getPlayerVolume=function(){return this.playerWrapper.getVolume()},o.prototype.toggleFullscreen=function(){this.playerWrapper.toggleFullscreen()},o.prototype.onAdError=function(t){this.adUi.onAdError(),this.playerWrapper.onAdError(t)},o.prototype.onAdBreakStart=function(t){this.playerWrapper.onAdBreakStart(),this.adUi.onAdBreakStart(t)},o.prototype.showAdContainer=function(){this.adUi.showAdContainer()},o.prototype.onAdBreakEnd=function(){this.playerWrapper.onAdBreakEnd(),this.adUi.onAdBreakEnd()},o.prototype.onAllAdsCompleted=function(){this.adUi.onAllAdsCompleted(),this.playerWrapper.onAllAdsCompleted()},o.prototype.onAdsPaused=function(){this.adUi.onAdsPaused()},o.prototype.onAdsResumed=function(){this.adUi.onAdsResumed()},o.prototype.onAdPlayheadUpdated=function(t,e,n,r,i){this.adUi.updateAdUi(t,e,n,r,i)},o.prototype.getCurrentAd=function(){return this.sdkImpl.getCurrentAd()},o.prototype.playContent=function(){this.playerWrapper.play()},o.prototype.onLinearAdStart=function(){this.adUi.onLinearAdStart(),this.playerWrapper.onAdStart()},o.prototype.onNonLinearAdLoad=function(){this.adUi.onNonLinearAdLoad()},o.prototype.onNonLinearAdStart=function(){this.adUi.onNonLinearAdLoad(),this.playerWrapper.onAdStart()},o.prototype.getPlayerWidth=function(){return this.playerWrapper.getPlayerWidth()},o.prototype.getPlayerHeight=function(){return this.playerWrapper.getPlayerHeight()},o.prototype.onAdsReady=function(){this.playerWrapper.onAdsReady()},o.prototype.onPlayerResize=function(t,e){this.sdkImpl.onPlayerResize(t,e)},o.prototype.onContentComplete=function(){this.sdkImpl.onContentComplete()},o.prototype.onNoPostroll=function(){this.playerWrapper.onNoPostroll()},o.prototype.onContentAndAdsCompleted=function(){for(var t in this.contentAndAdsEndedListeners)"function"==typeof this.contentAndAdsEndedListeners[t]&&this.contentAndAdsEndedListeners[t]()},o.prototype.onPlayerDisposed=function(){this.contentAndAdsEndedListeners=[],this.sdkImpl.onPlayerDisposed()},o.prototype.onPlayerReadyForPreroll=function(){this.sdkImpl.onPlayerReadyForPreroll()},o.prototype.onPlayerReady=function(){this.sdkImpl.onPlayerReady()},o.prototype.onPlayerEnterFullscreen=function(){this.adUi.onPlayerEnterFullscreen(),this.sdkImpl.onPlayerEnterFullscreen()},o.prototype.onPlayerExitFullscreen=function(){this.adUi.onPlayerExitFullscreen(),this.sdkImpl.onPlayerExitFullscreen()},o.prototype.onPlayerVolumeChanged=function(t){this.adUi.onPlayerVolumeChanged(t),this.sdkImpl.onPlayerVolumeChanged(t)},o.prototype.setContentWithAdTag=function(t,e,n){this.reset(),this.settings.adTagUrl=e||this.settings.adTagUrl,this.playerWrapper.changeSource(t,n)},o.prototype.setContentWithAdsResponse=function(t,e,n){this.reset(),this.settings.adsResponse=e||this.settings.adsResponse,this.playerWrapper.changeSource(t,n)},o.prototype.reset=function(){this.sdkImpl.reset(),this.playerWrapper.reset()},o.prototype.addContentEndedListener=function(t){this.playerWrapper.addContentEndedListener(t)},o.prototype.addContentAndAdsEndedListener=function(t){this.contentAndAdsEndedListeners.push(t)},o.prototype.setAdBreakReadyListener=function(t){this.sdkImpl.setAdBreakReadyListener(t)},o.prototype.setShowCountdown=function(t){this.adUi.setShowCountdown(t),this.showCountdown=t,this.countdownDiv.style.display=this.showCountdown?"block":"none"},o.prototype.initializeAdDisplayContainer=function(){this.sdkImpl.initializeAdDisplayContainer()},o.prototype.playAdBreak=function(){this.sdkImpl.playAdBreak()},o.prototype.addEventListener=function(t,e){this.sdkImpl.addEventListener(t,e)},o.prototype.getAdsManager=function(){return this.sdkImpl.getAdsManager()},o.prototype.getPlayerId=function(){return this.playerWrapper.getPlayerId()},o.prototype.changeAdTag=function(t){this.reset(),this.settings.adTagUrl=t},o.prototype.pauseAd=function(){this.adUi.onAdsPaused(),this.sdkImpl.pauseAds()},o.prototype.resumeAd=function(){this.adUi.onAdsPlaying(),this.sdkImpl.resumeAds()},o.prototype.adsWillAutoplay=function(){return void 0!==this.settings.adsWillAutoplay?this.settings.adsWillAutoplay:void 0!==this.settings.adWillAutoplay?this.settings.adWillAutoplay:!!this.playerWrapper.getPlayerOptions().autoplay},o.prototype.adsWillPlayMuted=function(){return void 0!==this.settings.adsWillPlayMuted?this.settings.adsWillPlayMuted:void 0!==this.settings.adWillPlayMuted?this.settings.adWillPlayMuted:void 0!==this.playerWrapper.getPlayerOptions().muted?this.playerWrapper.getPlayerOptions().muted:0==this.playerWrapper.getVolume()},o.prototype.triggerPlayerEvent=function(t,e){this.playerWrapper.triggerPlayerEvent(t,e)},o.prototype.extend=function(t){for(var e=void 0,n=void 0,r=void 0,i=arguments.length,o=Array(i>1?i-1:0),s=1;s<i;s++)o[s-1]=arguments[s];for(n=0;n<o.length;n++)for(r in e=o[n])e.hasOwnProperty(r)&&(t[r]=e[r]);return t},(t.registerPlugin||t.plugin)("ima",function(t){this.ima=new function(t,e){this.controller=new o(t,e),this.addContentAndAdsEndedListener=function(t){this.controller.addContentAndAdsEndedListener(t)}.bind(this),this.addContentEndedListener=function(t){this.controller.addContentEndedListener(t)}.bind(this),this.addEventListener=function(t,e){this.controller.addEventListener(t,e)}.bind(this),this.changeAdTag=function(t){this.controller.changeAdTag(t)}.bind(this),this.getAdsManager=function(){return this.controller.getAdsManager()}.bind(this),this.initializeAdDisplayContainer=function(){this.controller.initializeAdDisplayContainer()}.bind(this),this.pauseAd=function(){this.controller.pauseAd()}.bind(this),this.playAdBreak=function(){this.controller.playAdBreak()}.bind(this),this.requestAds=function(){this.controller.requestAds()}.bind(this),this.resumeAd=function(){this.controller.resumeAd()}.bind(this),this.setAdBreakReadyListener=function(t){this.controller.setAdBreakReadyListener(t)}.bind(this),this.setContentWithAdTag=function(t,e,n){this.controller.setContentWithAdTag(t,e,n)}.bind(this),this.setContentWithAdsResponse=function(t,e,n){this.controller.setContentWithAdsResponse(t,e,n)}.bind(this),this.setShowCountdown=function(t){this.controller.setShowCountdown(t)}.bind(this)}(this,t)})}(n(0))},function(t,e,n){"use strict";n.r(e);var r=n(0),i=n.n(r),o=n(1),s=n.n(o),a=n(2),l=n.n(a),c="6.4.1";var u=function(t,e){e.isImmediatePropagationStopped=function(){return!0},e.cancelBubble=!0,e.isPropagationStopped=function(){return!0}},h=function(t,e,n){u(0,n),t.trigger({type:e+n.type,originalEvent:n})},d=function(t,e){t.ads.isInAdMode()&&(t.ads.isContentResuming()?t.ads._contentEnding&&h(t,"content",e):h(t,"ad",e))},p=function(t,e){t.ads.isInAdMode()?t.ads.isContentResuming()?(u(0,e),t.trigger("resumeended")):h(t,"ad",e):t.ads._contentHasEnded||(h(t,"content",e),t.trigger("readyforpostroll"))},f=function(t,e){if(!("loadstart"===e.type&&!t.ads._hasThereBeenALoadStartDuringPlayerLife||"loadeddata"===e.type&&!t.ads._hasThereBeenALoadedData||"loadedmetadata"===e.type&&!t.ads._hasThereBeenALoadedMetaData))if(t.ads.inAdBreak())h(t,"ad",e);else{if(t.currentSrc()!==t.ads.contentSrc)return;h(t,"content",e)}},y=function(t,e){t.ads.inAdBreak()?h(t,"ad",e):t.ads.isContentResuming()&&h(t,"content",e)};function v(t){"playing"===t.type?d(this,t):"ended"===t.type?p(this,t):"loadstart"===t.type||"loadeddata"===t.type||"loadedmetadata"===t.type?f(this,t):"play"===t.type?y(this,t):this.ads.isInAdMode()&&(this.ads.isContentResuming()?h(this,"content",t):h(this,"ad",t))}var g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},m=(function(){function t(t){this.value=t}function e(e){var n,r;function i(n,r){try{var s=e[n](r),a=s.value;a instanceof t?Promise.resolve(a.value).then(function(t){i("next",t)},function(t){i("throw",t)}):o(s.done?"return":"normal",s.value)}catch(t){o("throw",t)}}function o(t,e){switch(t){case"return":n.resolve({value:e,done:!0});break;case"throw":n.reject(e);break;default:n.resolve({value:e,done:!1})}(n=n.next)?i(n.key,n.arg):r=null}this._invoke=function(t,e){return new Promise(function(o,s){var a={key:t,arg:e,resolve:o,reject:s,next:null};r?r=r.next=a:(n=r=a,i(t,e))})},"function"!=typeof e.return&&(this.return=void 0)}"function"==typeof Symbol&&Symbol.asyncIterator&&(e.prototype[Symbol.asyncIterator]=function(){return this}),e.prototype.next=function(t){return this._invoke("next",t)},e.prototype.throw=function(t){return this._invoke("throw",t)},e.prototype.return=function(t){return this._invoke("return",t)}}(),function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}),_=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},b=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},T=function(t,e){return e?encodeURIComponent(t):t},C=function(t,e,n){if(t&&t[n])for(var r=t[n],i=Object.keys(r),o=0;o<i.length;o++){e["{mediainfo."+n+"."+i[o]+"}"]=r[i[o]]}};var k={processMetadataTracks:function(t,e){for(var n=t.textTracks(),r=function(n){"metadata"===n.kind&&(t.ads.cueTextTracks.setMetadataTrackMode(n),e(t,n))},i=0;i<n.length;i++)r(n[i]);n.addEventListener("addtrack",function(t){r(t.track)})},setMetadataTrackMode:function(t){},getSupportedAdCue:function(t,e){return e},isSupportedAdCue:function(t,e){return!0},getCueId:function(t,e){return e.id}},E=function(t,e){return void 0!==e&&t.ads.includedCues[e]},w=function(t,e){void 0!==e&&""!==e&&(t.ads.includedCues[e]=!0)};function A(){!1!==this.ads._shouldBlockPlay&&(this.paused()||(this.ads.debug("Playback was canceled by cancelContentPlay"),this.pause()),this.ads._cancelledPlay=!0)}k.processAdTrack=function(t,e,n,r){t.ads.includedCues={};for(var o=0;o<e.length;o++){var s=e[o],a=this.getSupportedAdCue(t,s);if(!this.isSupportedAdCue(t,s))return void i.a.log.warn("Skipping as this is not a supported ad cue.",s);var l=this.getCueId(t,s),c=s.startTime;if(E(t,l))return void i.a.log("Skipping ad already seen with ID "+l);r&&r(t,a,l,c),n(t,a,l,c),w(t,l)}};var S={},P=i.a;S.isMiddlewareMediatorSupported=function(){return!P.browser.IS_IOS&&!P.browser.IS_ANDROID&&!!(P.use&&P.middleware&&P.middleware.TERMINATOR)},S.playMiddleware=function(t){return{setSource:function(t,e){e(null,t)},callPlay:function(){if(t.ads&&!0===t.ads._shouldBlockPlay)return t.ads.debug("Using playMiddleware to block content playback"),t.ads._playBlocked=!0,P.middleware.TERMINATOR},play:function(e,n){t.ads&&t.ads._playBlocked&&e&&(t.ads.debug("Play call to Tech was terminated."),t.trigger("play"),t.addClass("vjs-has-started"),t.ads._playBlocked=!1)}}},S.testHook=function(t){P=t};var j=function(){function t(e){m(this,t),this.player=e}return t._getName=function(){return"Anonymous State"},t.prototype.transitionTo=function(t){var e=this.player;this.cleanup(e);var n=new t(e);e.ads._state=n,e.ads.debug(this.constructor._getName()+" -> "+n.constructor._getName());for(var r=arguments.length,i=Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];n.init.apply(n,[e].concat(i))},t.prototype.init=function(){},t.prototype.cleanup=function(){},t.prototype.onPlay=function(){},t.prototype.onPlaying=function(){},t.prototype.onEnded=function(){},t.prototype.onAdsReady=function(){i.a.log.warn("Unexpected adsready event")},t.prototype.onAdsError=function(){},t.prototype.onAdsCanceled=function(){},t.prototype.onAdTimeout=function(){},t.prototype.onAdStarted=function(){},t.prototype.onContentChanged=function(){},t.prototype.onContentResumed=function(){},t.prototype.onReadyForPostroll=function(){i.a.log.warn("Unexpected readyforpostroll event")},t.prototype.onNoPreroll=function(){},t.prototype.onNoPostroll=function(){},t.prototype.startLinearAdMode=function(){i.a.log.warn("Unexpected startLinearAdMode invocation (State via "+this.constructor._getName()+")")},t.prototype.endLinearAdMode=function(){i.a.log.warn("Unexpected endLinearAdMode invocation (State via "+this.constructor._getName()+")")},t.prototype.skipLinearAdMode=function(){i.a.log.warn("Unexpected skipLinearAdMode invocation (State via "+this.constructor._getName()+")")},t.prototype.isAdState=function(){throw new Error("isAdState unimplemented for "+this.constructor._getName())},t.prototype.isWaitingForAdBreak=function(){return!1},t.prototype.isContentResuming=function(){return!1},t.prototype.inAdBreak=function(){return!1},t.prototype.handleEvent=function(t){var e=this.player;"play"===t?this.onPlay(e):"adsready"===t?this.onAdsReady(e):"adserror"===t?this.onAdsError(e):"adscanceled"===t?this.onAdsCanceled(e):"adtimeout"===t?this.onAdTimeout(e):"ads-ad-started"===t?this.onAdStarted(e):"contentchanged"===t?this.onContentChanged(e):"contentresumed"===t?this.onContentResumed(e):"readyforpostroll"===t?this.onReadyForPostroll(e):"playing"===t?this.onPlaying(e):"ended"===t?this.onEnded(e):"nopreroll"===t?this.onNoPreroll(e):"nopostroll"===t&&this.onNoPostroll(e)},t}(),x=function(t){function e(n){m(this,e);var r=b(this,t.call(this,n));return r.contentResuming=!1,r.waitingForAdBreak=!1,r}return _(e,t),e.prototype.isAdState=function(){return!0},e.prototype.onPlaying=function(){this.contentResuming&&this.transitionTo(B)},e.prototype.onContentResumed=function(){this.contentResuming&&this.transitionTo(B)},e.prototype.isWaitingForAdBreak=function(){return this.waitingForAdBreak},e.prototype.isContentResuming=function(){return this.contentResuming},e.prototype.inAdBreak=function(){return!0===this.player.ads._inLinearAdMode},e}(j),M=function(t){function e(){return m(this,e),b(this,t.apply(this,arguments))}return _(e,t),e.prototype.isAdState=function(){return!1},e.prototype.onContentChanged=function(t){t.ads.debug("Received contentchanged event (ContentState)"),t.paused()?this.transitionTo(N):(this.transitionTo(R,!1),t.pause(),t.ads._pausedOnContentupdate=!0)},e}(j),L=void 0;var D={start:function(t){t.ads.debug("Starting ad break"),t.ads._inLinearAdMode=!0,t.trigger("adstart"),t.ads.shouldPlayContentBehindAd(t)||(t.ads.snapshot=function(t){var e=void 0;e=i.a.browser.IS_IOS&&t.ads.isLive(t)&&t.seekable().length>0?t.currentTime()-t.seekable().end(0):t.currentTime();var n=t.$(".vjs-tech"),r=t.textTracks?t.textTracks():[],o=[],s={ended:t.ended(),currentSrc:t.currentSrc(),src:t.tech_.src(),currentTime:e,type:t.currentType()};n&&(s.style=n.getAttribute("style"));for(var a=0;a<r.length;a++){var l=r[a];o.push({track:l,mode:l.mode}),l.mode="disabled"}return s.suppressedTracks=o,s}(t)),t.ads.shouldPlayContentBehindAd(t)&&(t.ads.preAdVolume_=t.volume(),t.volume(0)),t.addClass("vjs-ad-playing"),t.hasClass("vjs-live")&&t.removeClass("vjs-live"),t.ads.removeNativePoster()},end:function(t,e){t.ads.debug("Ending ad break"),void 0===e&&(e=function(){}),t.ads.adType=null,t.ads._inLinearAdMode=!1,t.trigger("adend"),t.removeClass("vjs-ad-playing"),t.ads.isLive(t)&&t.addClass("vjs-live"),t.ads.shouldPlayContentBehindAd(t)?(t.volume(t.ads.preAdVolume_),e()):function(t,e,n){if(void 0===n&&(n=function(){}),!0===t.ads.disableNextSnapshotRestore)return t.ads.disableNextSnapshotRestore=!1,void n();var r=t.$(".vjs-tech"),o=20,s=e.suppressedTracks,a=void 0,l=function(){for(var t=0;t<s.length;t++)(a=s[t]).track.mode=a.mode},c=function(){var n=void 0;if(i.a.browser.IS_IOS&&t.ads.isLive(t))e.currentTime<0&&(n=t.seekable().length>0?t.seekable().end(0)+e.currentTime:t.currentTime(),t.currentTime(n));else if(e.ended)t.currentTime(t.duration());else{t.currentTime(e.currentTime);var r=t.play();r&&r.catch&&r.catch(function(t){i.a.log.warn("Play promise rejected in snapshot resume",t)})}t.ads.shouldRemoveAutoplay_&&(t.autoplay(!1),t.ads.shouldRemoveAutoplay_=!1)},u=function e(){if(t.off("contentcanplay",e),L&&t.clearTimeout(L),(r=t.el().querySelector(".vjs-tech")).readyState>1)return c();if(void 0===r.seekable)return c();if(r.seekable.length>0)return c();if(o--)t.setTimeout(e,50);else try{c()}catch(t){i.a.log.warn("Failed to resume the content after an advertisement",t)}};if("style"in e&&r.setAttribute("style",e.style||""),t.ads.videoElementRecycled())t.one("resumeended",n),t.one("contentloadedmetadata",l),i.a.browser.IS_IOS&&!t.autoplay()&&(t.autoplay(!0),t.ads.shouldRemoveAutoplay_=!0),t.src({src:e.currentSrc,type:e.type}),t.one("contentcanplay",u),L=t.setTimeout(u,2e3);else{if(l(),!t.ended()){var h=t.play();h&&h.catch&&h.catch(function(t){i.a.log.warn("Play promise rejected in snapshot restore",t)})}n()}}(t,t.ads.snapshot,e)}},R=function(t){function e(){return m(this,e),b(this,t.apply(this,arguments))}return _(e,t),e._getName=function(){return"Preroll"},e.prototype.init=function(t,e,n){if(this.waitingForAdBreak=!0,t.addClass("vjs-ad-loading"),n||t.ads.nopreroll_)return this.resumeAfterNoPreroll(t);var r=t.ads.settings.timeout;"number"==typeof t.ads.settings.prerollTimeout&&(r=t.ads.settings.prerollTimeout),this._timeout=t.setTimeout(function(){t.trigger("adtimeout")},r),e?this.handleAdsReady():this.adsReady=!1},e.prototype.onAdsReady=function(t){t.ads.inAdBreak()?i.a.log.warn("Unexpected adsready event (Preroll)"):(t.ads.debug("Received adsready event (Preroll)"),this.handleAdsReady())},e.prototype.handleAdsReady=function(){this.adsReady=!0,this.readyForPreroll()},e.prototype.afterLoadStart=function(t){var e=this.player;e.ads._hasThereBeenALoadStartDuringPlayerLife?t():(e.ads.debug("Waiting for loadstart..."),e.one("loadstart",function(){e.ads.debug("Received loadstart event"),t()}))},e.prototype.noPreroll=function(){var t=this;this.afterLoadStart(function(){t.player.ads.debug("Skipping prerolls due to nopreroll event (Preroll)"),t.resumeAfterNoPreroll(t.player)})},e.prototype.readyForPreroll=function(){var t=this.player;this.afterLoadStart(function(){t.ads.debug("Triggered readyforpreroll event (Preroll)"),t.trigger("readyforpreroll")})},e.prototype.onAdsCanceled=function(t){var e=this;t.ads.debug("adscanceled (Preroll)"),this.afterLoadStart(function(){e.resumeAfterNoPreroll(t)})},e.prototype.onAdsError=function(t){var e=this;i.a.log("adserror (Preroll)"),this.inAdBreak()?t.ads.endLinearAdMode():this.afterLoadStart(function(){e.resumeAfterNoPreroll(t)})},e.prototype.startLinearAdMode=function(){var t=this.player;!this.adsReady||t.ads.inAdBreak()||this.isContentResuming()?i.a.log.warn("Unexpected startLinearAdMode invocation (Preroll)"):(t.clearTimeout(this._timeout),t.ads.adType="preroll",this.waitingForAdBreak=!1,D.start(t),t.ads._shouldBlockPlay=!1)},e.prototype.onAdStarted=function(t){t.removeClass("vjs-ad-loading")},e.prototype.endLinearAdMode=function(){var t=this.player;this.inAdBreak()&&(t.removeClass("vjs-ad-loading"),t.addClass("vjs-ad-content-resuming"),D.end(t),this.contentResuming=!0)},e.prototype.skipLinearAdMode=function(){var t=this,e=this.player;e.ads.inAdBreak()||this.isContentResuming()?i.a.log.warn("Unexpected skipLinearAdMode invocation"):this.afterLoadStart(function(){e.trigger("adskip"),e.ads.debug("skipLinearAdMode (Preroll)"),t.resumeAfterNoPreroll(e)})},e.prototype.onAdTimeout=function(t){var e=this;this.afterLoadStart(function(){t.ads.debug("adtimeout (Preroll)"),e.resumeAfterNoPreroll(t)})},e.prototype.onNoPreroll=function(t){t.ads.inAdBreak()||this.isContentResuming()?i.a.log.warn("Unexpected nopreroll event (Preroll)"):this.noPreroll()},e.prototype.resumeAfterNoPreroll=function(t){this.contentResuming=!0,t.ads._shouldBlockPlay=!1,t.paused()&&(t.ads._playRequested||t.ads._pausedOnContentupdate)&&t.play()},e.prototype.cleanup=function(t){t.ads._hasThereBeenALoadStartDuringPlayerLife||i.a.log.warn("Leaving Preroll state before loadstart event can cause issues."),t.removeClass("vjs-ad-loading"),t.removeClass("vjs-ad-content-resuming"),t.clearTimeout(this._timeout)},e}(x),I=function(t){function e(){return m(this,e),b(this,t.apply(this,arguments))}return _(e,t),e._getName=function(){return"Midroll"},e.prototype.init=function(t){t.ads.adType="midroll",D.start(t),t.addClass("vjs-ad-loading")},e.prototype.onAdStarted=function(t){t.removeClass("vjs-ad-loading")},e.prototype.endLinearAdMode=function(){var t=this.player;this.inAdBreak()&&(this.contentResuming=!0,t.addClass("vjs-ad-content-resuming"),t.removeClass("vjs-ad-loading"),D.end(t))},e.prototype.onAdsError=function(t){this.inAdBreak()&&t.ads.endLinearAdMode()},e.prototype.cleanup=function(t){t.removeClass("vjs-ad-loading"),t.removeClass("vjs-ad-content-resuming")},e}(x),O=function(t){function e(){return m(this,e),b(this,t.apply(this,arguments))}return _(e,t),e._getName=function(){return"Postroll"},e.prototype.init=function(t){if(this.waitingForAdBreak=!0,t.ads._contentEnding=!0,t.ads.nopostroll_)this.resumeContent(t),this.transitionTo(F);else{t.addClass("vjs-ad-loading");var e=t.ads.settings.timeout;"number"==typeof t.ads.settings.postrollTimeout&&(e=t.ads.settings.postrollTimeout),this._postrollTimeout=t.setTimeout(function(){t.trigger("adtimeout")},e)}},e.prototype.startLinearAdMode=function(){var t=this.player;t.ads.inAdBreak()||this.isContentResuming()?i.a.log.warn("Unexpected startLinearAdMode invocation (Postroll)"):(t.ads.adType="postroll",t.clearTimeout(this._postrollTimeout),this.waitingForAdBreak=!1,D.start(t))},e.prototype.onAdStarted=function(t){t.removeClass("vjs-ad-loading")},e.prototype.endLinearAdMode=function(){var t=this,e=this.player;this.inAdBreak()&&(e.removeClass("vjs-ad-loading"),this.resumeContent(e),D.end(e,function(){t.transitionTo(F)}))},e.prototype.skipLinearAdMode=function(){var t=this.player;t.ads.inAdBreak()||this.isContentResuming()?i.a.log.warn("Unexpected skipLinearAdMode invocation"):(t.ads.debug("Postroll abort (skipLinearAdMode)"),t.trigger("adskip"),this.abort(t))},e.prototype.onAdTimeout=function(t){t.ads.debug("Postroll abort (adtimeout)"),this.abort(t)},e.prototype.onAdsError=function(t){t.ads.debug("Postroll abort (adserror)"),t.ads.inAdBreak()?t.ads.endLinearAdMode():this.abort(t)},e.prototype.onContentChanged=function(t){this.isContentResuming()?this.transitionTo(N):this.inAdBreak()||this.transitionTo(R)},e.prototype.onNoPostroll=function(t){this.isContentResuming()||this.inAdBreak()?i.a.log.warn("Unexpected nopostroll event (Postroll)"):this.abort(t)},e.prototype.resumeContent=function(t){this.contentResuming=!0,t.addClass("vjs-ad-content-resuming")},e.prototype.abort=function(t){this.resumeContent(t),t.removeClass("vjs-ad-loading"),this.transitionTo(F)},e.prototype.cleanup=function(t){t.removeClass("vjs-ad-content-resuming"),t.clearTimeout(this._postrollTimeout),t.ads._contentEnding=!1},e}(x),N=function(t){function e(){return m(this,e),b(this,t.apply(this,arguments))}return _(e,t),e._getName=function(){return"BeforePreroll"},e.prototype.init=function(t){this.adsReady=!1,this.shouldResumeToContent=!1,t.ads._shouldBlockPlay=!0},e.prototype.onAdsReady=function(t){t.ads.debug("Received adsready event (BeforePreroll)"),this.adsReady=!0},e.prototype.onPlay=function(t){t.ads.debug("Received play event (BeforePreroll)"),this.transitionTo(R,this.adsReady,this.shouldResumeToContent)},e.prototype.onAdsCanceled=function(t){t.ads.debug("adscanceled (BeforePreroll)"),this.shouldResumeToContent=!0},e.prototype.onAdsError=function(){this.player.ads.debug("adserror (BeforePreroll)"),this.shouldResumeToContent=!0},e.prototype.onNoPreroll=function(){this.player.ads.debug("Skipping prerolls due to nopreroll event (BeforePreroll)"),this.shouldResumeToContent=!0},e.prototype.skipLinearAdMode=function(){var t=this.player;t.trigger("adskip"),t.ads.debug("skipLinearAdMode (BeforePreroll)"),this.shouldResumeToContent=!0},e.prototype.onContentChanged=function(){},e}(M),B=function(t){function e(){return m(this,e),b(this,t.apply(this,arguments))}return _(e,t),e._getName=function(){return"ContentPlayback"},e.prototype.init=function(t){t.ads._shouldBlockPlay=!1},e.prototype.onAdsReady=function(t){t.ads.debug("Received adsready event (ContentPlayback)"),t.ads.nopreroll_||(t.ads.debug("Triggered readyforpreroll event (ContentPlayback)"),t.trigger("readyforpreroll"))},e.prototype.onReadyForPostroll=function(t){t.ads.debug("Received readyforpostroll event"),this.transitionTo(O)},e.prototype.startLinearAdMode=function(){this.transitionTo(I)},e}(M),F=function(t){function e(){return m(this,e),b(this,t.apply(this,arguments))}return _(e,t),e._getName=function(){return"AdsDone"},e.prototype.init=function(t){t.ads._contentHasEnded=!0,t.trigger("ended")},e.prototype.startLinearAdMode=function(){i.a.log.warn("Unexpected startLinearAdMode invocation (AdsDone)")},e}(M),H=S.playMiddleware,V=S.isMiddlewareMediatorSupported,W=i.a.getTech("Html5").Events,U={timeout:5e3,prerollTimeout:void 0,postrollTimeout:void 0,debug:!1,stitchedAds:!1,contentIsLive:void 0},z=function(t){var e=this,n=i.a.mergeOptions(U,t),r=W.concat(["firstplay","loadedalldata","playing"]);e.on(r,v),V()&&n.debug?i.a.log("ADS:","Play middleware has been registered with videojs"):function(t,e){e&&i.a.log("ADS:","Using cancelContentPlay to block content playback"),t.on("play",A)}(e,n.debug),e.setTimeout(function(){e.ads._hasThereBeenALoadStartDuringPlayerLife||""===e.src()||i.a.log.error("videojs-contrib-ads has not seen a loadstart event 5 seconds after being initialized, but a source is present. This indicates that videojs-contrib-ads was initialized too late. It must be initialized immediately after video.js in the same tick. As a result, some ads will not play and some media events will be incorrect. For more information, see http://videojs.github.io/videojs-contrib-ads/integrator/getting-started.html")},5e3),e.on("ended",function(){e.hasClass("vjs-has-started")||e.addClass("vjs-has-started")}),e.on("contenttimeupdate",function(){e.removeClass("vjs-waiting")}),e.on(["addurationchange","adcanplay"],function(){if((!e.ads.snapshot||e.currentSrc()!==e.ads.snapshot.currentSrc)&&e.ads.inAdBreak()){var t=e.play();t&&t.catch&&t.catch(function(t){i.a.log.warn("Play promise rejected when playing ad",t)})}}),e.on("nopreroll",function(){e.ads.debug("Received nopreroll event"),e.ads.nopreroll_=!0}),e.on("nopostroll",function(){e.ads.debug("Received nopostroll event"),e.ads.nopostroll_=!0}),e.on("playing",function(){e.ads._cancelledPlay=!1,e.ads._pausedOnContentupdate=!1}),e.on("play",function(){e.ads._playRequested=!0}),e.one("loadstart",function(){e.ads._hasThereBeenALoadStartDuringPlayerLife=!0}),e.on("loadeddata",function(){e.ads._hasThereBeenALoadedData=!0}),e.on("loadedmetadata",function(){e.ads._hasThereBeenALoadedMetaData=!0}),e.ads=function(t){return{disableNextSnapshotRestore:!1,_contentEnding:!1,_contentHasEnded:!1,_hasThereBeenALoadStartDuringPlayerLife:!1,_hasThereBeenALoadedData:!1,_hasThereBeenALoadedMetaData:!1,_inLinearAdMode:!1,_shouldBlockPlay:!1,_playBlocked:!1,_playRequested:!1,adType:null,VERSION:c,reset:function(){t.ads.disableNextSnapshotRestore=!1,t.ads._contentEnding=!1,t.ads._contentHasEnded=!1,t.ads.snapshot=null,t.ads.adType=null,t.ads._hasThereBeenALoadedData=!1,t.ads._hasThereBeenALoadedMetaData=!1,t.ads._cancelledPlay=!1,t.ads._shouldBlockPlay=!1,t.ads._playBlocked=!1,t.ads.nopreroll_=!1,t.ads.nopostroll_=!1,t.ads._playRequested=!1},startLinearAdMode:function(){t.ads._state.startLinearAdMode()},endLinearAdMode:function(){t.ads._state.endLinearAdMode()},skipLinearAdMode:function(){t.ads._state.skipLinearAdMode()},stitchedAds:function(t){return void 0!==t&&(this._stitchedAds=!!t),this._stitchedAds},videoElementRecycled:function(){if(t.ads.shouldPlayContentBehindAd(t))return!1;if(!this.snapshot)throw new Error("You cannot use videoElementRecycled while there is no snapshot.");var e=t.tech_.src()!==this.snapshot.src,n=t.currentSrc()!==this.snapshot.currentSrc;return e||n},isLive:function(t){return"boolean"==typeof t.ads.settings.contentIsLive?t.ads.settings.contentIsLive:t.duration()===1/0||"8"===i.a.browser.IOS_VERSION&&0===t.duration()},shouldPlayContentBehindAd:function(t){return!i.a.browser.IS_IOS&&!i.a.browser.IS_ANDROID&&t.duration()===1/0},isInAdMode:function(){return this._state.isAdState()},isWaitingForAdBreak:function(){return this._state.isWaitingForAdBreak()},isContentResuming:function(){return this._state.isContentResuming()},isAdPlaying:function(){return this._state.inAdBreak()},inAdBreak:function(){return this._state.inAdBreak()},removeNativePoster:function(){var e=t.$(".vjs-tech");e&&e.removeAttribute("poster")},debug:function(){if(this.settings.debug){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];1===e.length&&"string"==typeof e[0]?i.a.log("ADS: "+e[0]):i.a.log.apply(i.a,["ADS:"].concat(e))}}}}(e),e.ads.settings=n,e.ads._state=new N(e),e.ads._state.init(e),e.ads.stitchedAds(n.stitchedAds),e.ads.cueTextTracks=k,e.ads.adMacroReplacement=function(t,e,n){var r=this,o={};t=t.replace(/{([^}=]+)=([^}]+)}/g,function(t,e,n){return o["{"+e+"}"]=n,"{"+e+"}"}),void 0===e&&(e=!1);var a={};for(var c in void 0!==n&&(a=n),a["{player.id}"]=this.options_["data-player"],a["{mediainfo.id}"]=this.mediainfo?this.mediainfo.id:"",a["{mediainfo.name}"]=this.mediainfo?this.mediainfo.name:"",a["{mediainfo.duration}"]=this.mediainfo?this.mediainfo.duration:"",a["{player.duration}"]=this.duration(),a["{timestamp}"]=(new Date).getTime(),a["{document.referrer}"]=l.a.referrer,a["{window.location.href}"]=s.a.location.href,a["{random}"]=Math.floor(1e12*Math.random()),["description","tags","reference_id","ad_keys"].forEach(function(t){r.mediainfo&&r.mediainfo[t]?a["{mediainfo."+t+"}"]=r.mediainfo[t]:o["{mediainfo."+t+"}"]?a["{mediainfo."+t+"}"]=o["{mediainfo."+t+"}"]:a["{mediainfo."+t+"}"]=""}),C(this.mediainfo,a,"custom_fields"),C(this.mediainfo,a,"customFields"),a)t=t.split(c).join(T(a[c],e));for(var u in t=t.replace(/{pageVariable\.([^}]+)}/g,function(t,n){for(var r=void 0,a=s.a,l=n.split("."),c=0;c<l.length;c++)c===l.length-1?r=a[l[c]]:a=a[l[c]];var u=void 0===r?"undefined":g(r);return null===r?"null":void 0===r?o["{pageVariable."+n+"}"]?o["{pageVariable."+n+"}"]:(i.a.log.warn('Page variable "'+n+'" not found'),""):"string"!==u&&"number"!==u&&"boolean"!==u?(i.a.log.warn('Page variable "'+n+'" is not a supported type'),""):T(String(r),e)}),o)t=t.replace(u,o[u]);return t}.bind(e),function(t){t.ads.contentSrc=t.currentSrc(),t.ads._seenInitialLoadstart=!1,t.on("loadstart",function(){if(!t.ads.inAdBreak()){var e=t.currentSrc();e!==t.ads.contentSrc&&(t.ads._seenInitialLoadstart&&t.trigger({type:"contentchanged"}),t.trigger({type:"contentupdate",oldValue:t.ads.contentSrc,newValue:e}),t.ads.contentSrc=e),t.ads._seenInitialLoadstart=!0}})}(e),e.on("contentchanged",e.ads.reset);var o=function(){var t=e.textTracks();if(!e.ads.shouldPlayContentBehindAd(e)&&e.ads.inAdBreak()&&e.tech_.featuresNativeTextTracks&&i.a.browser.IS_IOS&&!Array.isArray(e.textTracks()))for(var n=0;n<t.length;n++){var r=t[n];"showing"===r.mode&&(r.mode="disabled")}};e.ready(function(){e.textTracks().addEventListener("change",o)}),e.on(["play","playing","ended","adsready","adscanceled","adskip","adserror","adtimeout","ads-ad-started","contentchanged","contentresumed","readyforpostroll","nopreroll","nopostroll"],function(t){e.ads._state.handleEvent(t.type)}),e.on("dispose",function(){e.textTracks().removeEventListener("change",o)})};(i.a.registerPlugin||i.a.plugin)("ads",z),V()&&i.a.use("*",H),e.default=z},function(t,e){var n={"":!0,up:!0};function r(t){return"number"==typeof t&&t>=0&&t<=100}t.exports=function(){var t=100,e=3,i=0,o=100,s=0,a=100,l="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return t},set:function(e){if(!r(e))throw new Error("Width must be between 0 and 100.");t=e}},lines:{enumerable:!0,get:function(){return e},set:function(t){if("number"!=typeof t)throw new TypeError("Lines must be set to a number.");e=t}},regionAnchorY:{enumerable:!0,get:function(){return o},set:function(t){if(!r(t))throw new Error("RegionAnchorX must be between 0 and 100.");o=t}},regionAnchorX:{enumerable:!0,get:function(){return i},set:function(t){if(!r(t))throw new Error("RegionAnchorY must be between 0 and 100.");i=t}},viewportAnchorY:{enumerable:!0,get:function(){return a},set:function(t){if(!r(t))throw new Error("ViewportAnchorY must be between 0 and 100.");a=t}},viewportAnchorX:{enumerable:!0,get:function(){return s},set:function(t){if(!r(t))throw new Error("ViewportAnchorX must be between 0 and 100.");s=t}},scroll:{enumerable:!0,get:function(){return l},set:function(t){var e=function(t){return"string"==typeof t&&!!n[t.toLowerCase()]&&t.toLowerCase()}(t);if(!1===e)throw new SyntaxError("An invalid or illegal string was specified.");l=e}}})}},function(t,e){var n="auto",r={"":!0,lr:!0,rl:!0},i={start:!0,middle:!0,end:!0,left:!0,right:!0};function o(t){return"string"==typeof t&&(!!i[t.toLowerCase()]&&t.toLowerCase())}function s(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)t[r]=n[r]}return t}function a(t,e,i){var a=this,l=/MSIE\s8\.0/.test(navigator.userAgent),c={};l?a=document.createElement("custom"):c.enumerable=!0,a.hasBeenReset=!1;var u="",h=!1,d=t,p=e,f=i,y=null,v="",g=!0,m="auto",_="start",b=50,T="middle",C=50,k="middle";if(Object.defineProperty(a,"id",s({},c,{get:function(){return u},set:function(t){u=""+t}})),Object.defineProperty(a,"pauseOnExit",s({},c,{get:function(){return h},set:function(t){h=!!t}})),Object.defineProperty(a,"startTime",s({},c,{get:function(){return d},set:function(t){if("number"!=typeof t)throw new TypeError("Start time must be set to a number.");d=t,this.hasBeenReset=!0}})),Object.defineProperty(a,"endTime",s({},c,{get:function(){return p},set:function(t){if("number"!=typeof t)throw new TypeError("End time must be set to a number.");p=t,this.hasBeenReset=!0}})),Object.defineProperty(a,"text",s({},c,{get:function(){return f},set:function(t){f=""+t,this.hasBeenReset=!0}})),Object.defineProperty(a,"region",s({},c,{get:function(){return y},set:function(t){y=t,this.hasBeenReset=!0}})),Object.defineProperty(a,"vertical",s({},c,{get:function(){return v},set:function(t){var e=function(t){return"string"==typeof t&&!!r[t.toLowerCase()]&&t.toLowerCase()}(t);if(!1===e)throw new SyntaxError("An invalid or illegal string was specified.");v=e,this.hasBeenReset=!0}})),Object.defineProperty(a,"snapToLines",s({},c,{get:function(){return g},set:function(t){g=!!t,this.hasBeenReset=!0}})),Object.defineProperty(a,"line",s({},c,{get:function(){return m},set:function(t){if("number"!=typeof t&&t!==n)throw new SyntaxError("An invalid number or illegal string was specified.");m=t,this.hasBeenReset=!0}})),Object.defineProperty(a,"lineAlign",s({},c,{get:function(){return _},set:function(t){var e=o(t);if(!e)throw new SyntaxError("An invalid or illegal string was specified.");_=e,this.hasBeenReset=!0}})),Object.defineProperty(a,"position",s({},c,{get:function(){return b},set:function(t){if(t<0||t>100)throw new Error("Position must be between 0 and 100.");b=t,this.hasBeenReset=!0}})),Object.defineProperty(a,"positionAlign",s({},c,{get:function(){return T},set:function(t){var e=o(t);if(!e)throw new SyntaxError("An invalid or illegal string was specified.");T=e,this.hasBeenReset=!0}})),Object.defineProperty(a,"size",s({},c,{get:function(){return C},set:function(t){if(t<0||t>100)throw new Error("Size must be between 0 and 100.");C=t,this.hasBeenReset=!0}})),Object.defineProperty(a,"align",s({},c,{get:function(){return k},set:function(t){var e=o(t);if(!e)throw new SyntaxError("An invalid or illegal string was specified.");k=e,this.hasBeenReset=!0}})),a.displayState=void 0,l)return a}a.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},t.exports=a},function(t,e){var n=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}}();function r(t,e){this.name="ParsingError",this.code=t.code,this.message=e||t.message}function i(t){function e(t,e,n,r){return 3600*(0|t)+60*(0|e)+(0|n)+(0|r)/1e3}var n=t.match(/^(\d+):(\d{2})(:\d{2})?\.(\d{3})/);return n?n[3]?e(n[1],n[2],n[3].replace(":",""),n[4]):n[1]>59?e(n[1],n[2],0,n[4]):e(0,n[1],n[2],n[4]):null}function o(){this.values=n(null)}function s(t,e,n,r){var i=r?t.split(r):[t];for(var o in i)if("string"==typeof i[o]){var s=i[o].split(n);if(2===s.length)e(s[0],s[1])}}function a(t,e,n){var a=t;function l(){var e=i(t);if(null===e)throw new r(r.Errors.BadTimeStamp,"Malformed timestamp: "+a);return t=t.replace(/^[^\sa-zA-Z-]+/,""),e}function c(){t=t.replace(/^\s+/,"")}if(c(),e.startTime=l(),c(),"--\x3e"!==t.substr(0,3))throw new r(r.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+a);t=t.substr(3),c(),e.endTime=l(),c(),function(t,e){var r=new o;s(t,function(t,e){switch(t){case"region":for(var i=n.length-1;i>=0;i--)if(n[i].id===e){r.set(t,n[i].region);break}break;case"vertical":r.alt(t,e,["rl","lr"]);break;case"line":var o=e.split(","),s=o[0];r.integer(t,s),r.percent(t,s)&&r.set("snapToLines",!1),r.alt(t,s,["auto"]),2===o.length&&r.alt("lineAlign",o[1],["start","middle","end"]);break;case"position":o=e.split(","),r.percent(t,o[0]),2===o.length&&r.alt("positionAlign",o[1],["start","middle","end"]);break;case"size":r.percent(t,e);break;case"align":r.alt(t,e,["start","middle","end","left","right"])}},/:/,/\s/),e.region=r.get("region",null),e.vertical=r.get("vertical",""),e.line=r.get("line","auto"),e.lineAlign=r.get("lineAlign","start"),e.snapToLines=r.get("snapToLines",!0),e.size=r.get("size",100),e.align=r.get("align","middle"),e.position=r.get("position",{start:0,left:0,middle:50,end:100,right:100},e.align),e.positionAlign=r.get("positionAlign",{start:"start",left:"start",middle:"middle",end:"end",right:"end"},e.align)}(t,e)}r.prototype=n(Error.prototype),r.prototype.constructor=r,r.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},o.prototype={set:function(t,e){this.get(t)||""===e||(this.values[t]=e)},get:function(t,e,n){return n?this.has(t)?this.values[t]:e[n]:this.has(t)?this.values[t]:e},has:function(t){return t in this.values},alt:function(t,e,n){for(var r=0;r<n.length;++r)if(e===n[r]){this.set(t,e);break}},integer:function(t,e){/^-?\d+$/.test(e)&&this.set(t,parseInt(e,10))},percent:function(t,e){return!!(e.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&(e=parseFloat(e))>=0&&e<=100)&&(this.set(t,e),!0)}};var l={"&amp;":"&","&lt;":"<","&gt;":">","&lrm;":"‎","&rlm;":"‏","&nbsp;":" "},c={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},u={v:"title",lang:"lang"},h={rt:"ruby"};function d(t,e){function n(){if(!e)return null;var t=e.match(/^([^<]*)(<[^>]*>?)?/);return function(t){return e=e.substr(t.length),t}(t[1]?t[1]:t[2])}function r(t){return l[t]}function o(t){for(;m=t.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)t=t.replace(m[0],r);return t}function s(t,e){return!h[e.localName]||h[e.localName]===t.localName}function a(e,n){var r=c[e];if(!r)return null;var i=t.document.createElement(r);i.localName=r;var o=u[e];return o&&n&&(i[o]=n.trim()),i}for(var d,p=t.document.createElement("div"),f=p,y=[];null!==(d=n());)if("<"!==d[0])f.appendChild(t.document.createTextNode(o(d)));else{if("/"===d[1]){y.length&&y[y.length-1]===d.substr(2).replace(">","")&&(y.pop(),f=f.parentNode);continue}var v,g=i(d.substr(1,d.length-2));if(g){v=t.document.createProcessingInstruction("timestamp",g),f.appendChild(v);continue}var m=d.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!m)continue;if(!(v=a(m[1],m[3])))continue;if(!s(f,v))continue;m[2]&&(v.className=m[2].substr(1).replace("."," ")),y.push(m[1]),f.appendChild(v),f=v}return p}var p=[[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 f(t){for(var e=0;e<p.length;e++){var n=p[e];if(t>=n[0]&&t<=n[1])return!0}return!1}function y(){}function v(t,e,n){var r=/MSIE\s8\.0/.test(navigator.userAgent),i="rgba(255, 255, 255, 1)",o="rgba(0, 0, 0, 0.8)";r&&(i="rgb(255, 255, 255)",o="rgb(0, 0, 0)"),y.call(this),this.cue=e,this.cueDiv=d(t,e.text);var s={color:i,backgroundColor:o,position:"relative",left:0,right:0,top:0,bottom:0,display:"inline"};r||(s.writingMode=""===e.vertical?"horizontal-tb":"lr"===e.vertical?"vertical-lr":"vertical-rl",s.unicodeBidi="plaintext"),this.applyStyles(s,this.cueDiv),this.div=t.document.createElement("div"),s={textAlign:"middle"===e.align?"center":e.align,font:n.font,whiteSpace:"pre-line",position:"absolute"},r||(s.direction=function(t){var e=[],n="";if(!t||!t.childNodes)return"ltr";function r(t,e){for(var n=e.childNodes.length-1;n>=0;n--)t.push(e.childNodes[n])}function i(t){if(!t||!t.length)return null;var e=t.pop(),n=e.textContent||e.innerText;if(n){var o=n.match(/^.*(\n|\r)/);return o?(t.length=0,o[0]):n}return"ruby"===e.tagName?i(t):e.childNodes?(r(t,e),i(t)):void 0}for(r(e,t);n=i(e);)for(var o=0;o<n.length;o++)if(f(n.charCodeAt(o)))return"rtl";return"ltr"}(this.cueDiv),s.writingMode=""===e.vertical?"horizontal-tb":"lr"===e.vertical?"vertical-lr":"vertical-rl".stylesunicodeBidi="plaintext"),this.applyStyles(s),this.div.appendChild(this.cueDiv);var a=0;switch(e.positionAlign){case"start":a=e.position;break;case"middle":a=e.position-e.size/2;break;case"end":a=e.position-e.size}""===e.vertical?this.applyStyles({left:this.formatStyle(a,"%"),width:this.formatStyle(e.size,"%")}):this.applyStyles({top:this.formatStyle(a,"%"),height:this.formatStyle(e.size,"%")}),this.move=function(t){this.applyStyles({top:this.formatStyle(t.top,"px"),bottom:this.formatStyle(t.bottom,"px"),left:this.formatStyle(t.left,"px"),right:this.formatStyle(t.right,"px"),height:this.formatStyle(t.height,"px"),width:this.formatStyle(t.width,"px")})}}function g(t){var e,n,r,i,o=/MSIE\s8\.0/.test(navigator.userAgent);if(t.div){n=t.div.offsetHeight,r=t.div.offsetWidth,i=t.div.offsetTop;var s=(s=t.div.childNodes)&&(s=s[0])&&s.getClientRects&&s.getClientRects();t=t.div.getBoundingClientRect(),e=s?Math.max(s[0]&&s[0].height||0,t.height/s.length):0}this.left=t.left,this.right=t.right,this.top=t.top||i,this.height=t.height||n,this.bottom=t.bottom||i+(t.height||n),this.width=t.width||r,this.lineHeight=void 0!==e?e:t.lineHeight,o&&!this.lineHeight&&(this.lineHeight=13)}function m(t,e,n,r){var i=new g(e),o=e.cue,s=function(t){if("number"==typeof t.line&&(t.snapToLines||t.line>=0&&t.line<=100))return t.line;if(!t.track||!t.track.textTrackList||!t.track.textTrackList.mediaElement)return-1;for(var e=t.track,n=e.textTrackList,r=0,i=0;i<n.length&&n[i]!==e;i++)"showing"===n[i].mode&&r++;return-1*++r}(o),a=[];if(o.snapToLines){var l;switch(o.vertical){case"":a=["+y","-y"],l="height";break;case"rl":a=["+x","-x"],l="width";break;case"lr":a=["-x","+x"],l="width"}var c=i.lineHeight,u=c*Math.round(s),h=n[l]+c,d=a[0];Math.abs(u)>h&&(u=u<0?-1:1,u*=Math.ceil(h/c)*c),s<0&&(u+=""===o.vertical?n.height:n.width,a=a.reverse()),i.move(d,u)}else{var p=i.lineHeight/n.height*100;switch(o.lineAlign){case"middle":s-=p/2;break;case"end":s-=p}switch(o.vertical){case"":e.applyStyles({top:e.formatStyle(s,"%")});break;case"rl":e.applyStyles({left:e.formatStyle(s,"%")});break;case"lr":e.applyStyles({right:e.formatStyle(s,"%")})}a=["+y","-x","+x","-y"],i=new g(e)}var f=function(t,e){for(var i,o=new g(t),s=1,a=0;a<e.length;a++){for(;t.overlapsOppositeAxis(n,e[a])||t.within(n)&&t.overlapsAny(r);)t.move(e[a]);if(t.within(n))return t;var l=t.intersectPercentage(n);s>l&&(i=new g(t),s=l),t=new g(o)}return i||o}(i,a);e.move(f.toCSSCompatValues(n))}function _(){}y.prototype.applyStyles=function(t,e){for(var n in e=e||this.div,t)t.hasOwnProperty(n)&&(e.style[n]=t[n])},y.prototype.formatStyle=function(t,e){return 0===t?0:t+e},v.prototype=n(y.prototype),v.prototype.constructor=v,g.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}},g.prototype.overlaps=function(t){return this.left<t.right&&this.right>t.left&&this.top<t.bottom&&this.bottom>t.top},g.prototype.overlapsAny=function(t){for(var e=0;e<t.length;e++)if(this.overlaps(t[e]))return!0;return!1},g.prototype.within=function(t){return this.top>=t.top&&this.bottom<=t.bottom&&this.left>=t.left&&this.right<=t.right},g.prototype.overlapsOppositeAxis=function(t,e){switch(e){case"+x":return this.left<t.left;case"-x":return this.right>t.right;case"+y":return this.top<t.top;case"-y":return this.bottom>t.bottom}},g.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)},g.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}},g.getSimpleBoxPosition=function(t){var e=t.div?t.div.offsetHeight:t.tagName?t.offsetHeight:0,n=t.div?t.div.offsetWidth:t.tagName?t.offsetWidth:0,r=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||r,height:t.height||e,bottom:t.bottom||r+(t.height||e),width:t.width||n}},_.StringDecoder=function(){return{decode:function(t){if(!t)return"";if("string"!=typeof t)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(t))}}},_.convertCueToDOMTree=function(t,e){return t&&e?d(t,e):null};_.processCues=function(t,e,n){if(!t||!e||!n)return null;for(;n.firstChild;)n.removeChild(n.firstChild);var r=t.document.createElement("div");if(r.style.position="absolute",r.style.left="0",r.style.right="0",r.style.top="0",r.style.bottom="0",r.style.margin="1.5%",n.appendChild(r),function(t){for(var e=0;e<t.length;e++)if(t[e].hasBeenReset||!t[e].displayState)return!0;return!1}(e)){var i=[],o=g.getSimpleBoxPosition(r),s={font:Math.round(.05*o.height*100)/100+"px sans-serif"};!function(){for(var n,a,l=0;l<e.length;l++)a=e[l],n=new v(t,a,s),r.appendChild(n.div),m(0,n,o,i),a.displayState=n.div,i.push(g.getSimpleBoxPosition(n))}()}else for(var a=0;a<e.length;a++)r.appendChild(e[a].displayState)},_.Parser=function(t,e,n){n||(n=e,e={}),e||(e={}),this.window=t,this.vttjs=e,this.state="INITIAL",this.buffer="",this.decoder=n||new TextDecoder("utf8"),this.regionList=[]},_.Parser.prototype={reportOrThrowError:function(t){if(!(t instanceof r))throw t;this.onparsingerror&&this.onparsingerror(t)},parse:function(t){var e=this;function n(){for(var t=e.buffer,n=0;n<t.length&&"\r"!==t[n]&&"\n"!==t[n];)++n;var r=t.substr(0,n);return"\r"===t[n]&&++n,"\n"===t[n]&&++n,e.buffer=t.substr(n),r}function l(t){t.match(/X-TIMESTAMP-MAP/)?s(t,function(t,n){switch(t){case"X-TIMESTAMP-MAP":!function(t){var n=new o;s(t,function(t,e){switch(t){case"MPEGT":n.integer(t+"S",e);break;case"LOCA":n.set(t+"L",i(e))}},/[^\d]:/,/,/),e.ontimestampmap&&e.ontimestampmap({MPEGTS:n.get("MPEGTS"),LOCAL:n.get("LOCAL")})}(n)}},/=/):s(t,function(t,n){switch(t){case"Region":!function(t){var n=new o;if(s(t,function(t,e){switch(t){case"id":n.set(t,e);break;case"width":n.percent(t,e);break;case"lines":n.integer(t,e);break;case"regionanchor":case"viewportanchor":var r=e.split(",");if(2!==r.length)break;var i=new o;if(i.percent("x",r[0]),i.percent("y",r[1]),!i.has("x")||!i.has("y"))break;n.set(t+"X",i.get("x")),n.set(t+"Y",i.get("y"));break;case"scroll":n.alt(t,e,["up"])}},/=/,/\s/),n.has("id")){var r=new(e.vttjs.VTTRegion||e.window.VTTRegion);r.width=n.get("width",100),r.lines=n.get("lines",3),r.regionAnchorX=n.get("regionanchorX",0),r.regionAnchorY=n.get("regionanchorY",100),r.viewportAnchorX=n.get("viewportanchorX",0),r.viewportAnchorY=n.get("viewportanchorY",100),r.scroll=n.get("scroll",""),e.onregion&&e.onregion(r),e.regionList.push({id:n.get("id"),region:r})}}(n)}},/:/)}t&&(e.buffer+=e.decoder.decode(t,{stream:!0}));try{var c;if("INITIAL"===e.state){if(!/\r\n|\n/.test(e.buffer))return this;var u=(c=n()).match(/^WEBVTT([ \t].*)?$/);if(!u||!u[0])throw new r(r.Errors.BadSignature);e.state="HEADER"}for(var h=!1;e.buffer;){if(!/\r\n|\n/.test(e.buffer))return this;switch(h?h=!1:c=n(),e.state){case"HEADER":/:/.test(c)?l(c):c||(e.state="ID");continue;case"NOTE":c||(e.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(c)){e.state="NOTE";break}if(!c)continue;if(e.cue=new(e.vttjs.VTTCue||e.window.VTTCue)(0,0,""),e.state="CUE",-1===c.indexOf("--\x3e")){e.cue.id=c;continue}case"CUE":try{a(c,e.cue,e.regionList)}catch(t){e.reportOrThrowError(t),e.cue=null,e.state="BADCUE";continue}e.state="CUETEXT";continue;case"CUETEXT":var d=-1!==c.indexOf("--\x3e");if(!c||d&&(h=!0)){e.oncue&&e.oncue(e.cue),e.cue=null,e.state="ID";continue}e.cue.text&&(e.cue.text+="\n"),e.cue.text+=c;continue;case"BADCUE":c||(e.state="ID");continue}}}catch(t){e.reportOrThrowError(t),"CUETEXT"===e.state&&e.cue&&e.oncue&&e.oncue(e.cue),e.cue=null,e.state="INITIAL"===e.state?"BADWEBVTT":"BADCUE"}return this},flush:function(){try{if(this.buffer+=this.decoder.decode(),(this.cue||"HEADER"===this.state)&&(this.buffer+="\n\n",this.parse()),"INITIAL"===this.state)throw new r(r.Errors.BadSignature)}catch(t){this.reportOrThrowError(t)}return this.onflush&&this.onflush(),this}},t.exports=_},function(t,e,n){var r=n(1),i=t.exports={WebVTT:n(16),VTTCue:n(15),VTTRegion:n(14)};r.vttjs=i,r.WebVTT=i.WebVTT;var o=i.VTTCue,s=i.VTTRegion,a=r.VTTCue,l=r.VTTRegion;i.shim=function(){r.VTTCue=o,r.VTTRegion=s},i.restore=function(){r.VTTCue=a,r.VTTRegion=l},r.VTTCue||i.shim()},function(t,e){t.exports=function(){for(var t={},e=0;e<arguments.length;e++){var r=arguments[e];for(var i in r)n.call(r,i)&&(t[i]=r[i])}return t};var n=Object.prototype.hasOwnProperty},function(t,e,n){"use strict";var r=Function.prototype.toString,i=/^\s*class /,o=function(t){try{var e=r.call(t).replace(/\/\/.*\n/g,"").replace(/\/\*[.\s\S]*\*\//g,"").replace(/\n/gm," ").replace(/ {2}/g," ");return i.test(e)}catch(t){return!1}},s=Object.prototype.toString,a="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;t.exports=function(t){if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(a)return function(t){try{return!o(t)&&(r.call(t),!0)}catch(t){return!1}}(t);if(o(t))return!1;var e=s.call(t);return"[object Function]"===e||"[object GeneratorFunction]"===e}},function(t,e,n){"use strict";var r=n(19),i=Object.prototype.toString,o=Object.prototype.hasOwnProperty;t.exports=function(t,e,n){if(!r(e))throw new TypeError("iterator must be a function");var s;arguments.length>=3&&(s=n),"[object Array]"===i.call(t)?function(t,e,n){for(var r=0,i=t.length;r<i;r++)o.call(t,r)&&(null==n?e(t[r],r,t):e.call(n,t[r],r,t))}(t,e,s):"string"==typeof t?function(t,e,n){for(var r=0,i=t.length;r<i;r++)null==n?e(t.charAt(r),r,t):e.call(n,t.charAt(r),r,t)}(t,e,s):function(t,e,n){for(var r in t)o.call(t,r)&&(null==n?e(t[r],r,t):e.call(n,t[r],r,t))}(t,e,s)}},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*$/,"")}},function(t,e,n){var r=n(21),i=n(20);t.exports=function(t){if(!t)return{};var e={};return i(r(t).split("\n"),function(t){var n=t.indexOf(":"),i=r(t.slice(0,n)).toLowerCase(),o=r(t.slice(n+1));void 0===e[i]?e[i]=o:!function(t){return"[object Array]"===Object.prototype.toString.call(t)}(e[i])?e[i]=[e[i],o]:e[i].push(o)}),e}},function(t,e){t.exports=function(t){var e=n.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)};var n=Object.prototype.toString},function(t,e,n){"use strict";var r=n(1),i=n(23),o=n(22),s=n(18);function a(t,e,n){var r=t;return i(e)?(n=e,"string"==typeof t&&(r={uri:t})):r=s(e,{uri:t}),r.callback=n,r}function l(t,e,n){return c(e=a(t,e,n))}function c(t){if(void 0===t.callback)throw new Error("callback argument missing");var e=!1,n=function(n,r,i){e||(e=!0,t.callback(n,r,i))};function r(t){return clearTimeout(u),t instanceof Error||(t=new Error(""+(t||"Unknown XMLHttpRequest Error"))),t.statusCode=0,n(t,g)}function i(){if(!a){var e;clearTimeout(u),e=t.useXDR&&void 0===c.status?200:1223===c.status?204:c.status;var r=g,i=null;return 0!==e?(r={body:function(){var t=void 0;if(t=c.response?c.response:c.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}(c),v)try{t=JSON.parse(t)}catch(t){}return t}(),statusCode:e,method:d,headers:{},url:h,rawRequest:c},c.getAllResponseHeaders&&(r.headers=o(c.getAllResponseHeaders()))):i=new Error("Internal XMLHttpRequest Error"),n(i,r,r.body)}}var s,a,c=t.xhr||null;c||(c=t.cors||t.useXDR?new l.XDomainRequest:new l.XMLHttpRequest);var u,h=c.url=t.uri||t.url,d=c.method=t.method||"GET",p=t.body||t.data,f=c.headers=t.headers||{},y=!!t.sync,v=!1,g={body:void 0,headers:{},statusCode:0,method:d,url:h,rawRequest:c};if("json"in t&&!1!==t.json&&(v=!0,f.accept||f.Accept||(f.Accept="application/json"),"GET"!==d&&"HEAD"!==d&&(f["content-type"]||f["Content-Type"]||(f["Content-Type"]="application/json"),p=JSON.stringify(!0===t.json?p:t.json))),c.onreadystatechange=function(){4===c.readyState&&setTimeout(i,0)},c.onload=i,c.onerror=r,c.onprogress=function(){},c.onabort=function(){a=!0},c.ontimeout=r,c.open(d,h,!y,t.username,t.password),y||(c.withCredentials=!!t.withCredentials),!y&&t.timeout>0&&(u=setTimeout(function(){if(!a){a=!0,c.abort("timeout");var t=new Error("XMLHttpRequest timeout");t.code="ETIMEDOUT",r(t)}},t.timeout)),c.setRequestHeader)for(s in f)f.hasOwnProperty(s)&&c.setRequestHeader(s,f[s]);else if(t.headers&&!function(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0}(t.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in t&&(c.responseType=t.responseType),"beforeSend"in t&&"function"==typeof t.beforeSend&&t.beforeSend(c),c.send(p||null),c}t.exports=l,l.XMLHttpRequest=r.XMLHttpRequest||function(){},l.XDomainRequest="withCredentials"in new l.XMLHttpRequest?l.XMLHttpRequest:r.XDomainRequest,function(t,e){for(var n=0;n<t.length;n++)e(t[n])}(["get","put","post","patch","head","delete"],function(t){l["delete"===t?"del":t]=function(e,n,r){return(n=a(e,n,r)).method=t.toUpperCase(),c(n)}})},function(t,e){t.exports=function(t,e){var n,r=null;try{n=JSON.parse(t,e)}catch(t){r=t}return[r,n]}},function(t,e){function n(t){return t.replace(/\n\r?\s*/g,"")}t.exports=function(t){for(var e="",r=0;r<arguments.length;r++)e+=n(t[r])+(arguments[r+1]||"");return e}},function(t,e){},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=function(t){return t&&t.__esModule?t:{default:t}}(n(0));function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}n(13),n(12),n(11),n(9),n(7),n(5);var o=function(){var t={beenseen:!1,npa:0,api:0},e=function(){function e(n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);for(var r=this.guid();null!==document.getElementById(r);)r=this.guid();var i=document.createElement("video");i.className="video-js vjs-default-skin",i.style.backgroundColor="transparent",i.preload="auto",i.setAttribute("muted",!0),i.setAttribute("playsinline",!0),i.setAttribute("autoplay",!0),i.id=r,this._params=t,this._video=i,this._id=r,this._element=n,this._element.className="ora-instream",this._element.style.display="block",this._element.style.overflow="hidden",this._element.appendChild(i),this._ticking=!1,this._canPlay=!1,this._playing=!1}return function(t,e,n){e&&i(t.prototype,e),n&&i(t,n)}(e,[{key:"connectedCallback",value:function(t){var e=this._element.getBoundingClientRect().width,n=Math.round(e/16*9);window.innerHeight<n&&(n=window.innerHeight),this._video.width=e,this._video.height=n,void 0===t.beenseen&&(t.beenseen=this._params.beenseen),void 0===t.npa&&(t.npa=this._params.npa);var i=(0,r.default)(this._video,{muted:!0,playsinline:!0,autoplay:this._params.beenseen,aspectRatio:"16:9",fluid:1,controls:!0,sources:this.videoSources()});if(i.on("adsready",function(){i.ima.addEventListener(google.ima.AdEvent.Type.CLICK,function(){}),i.ima.addEventListener(google.ima.AdEvent.Type.COMPLETE,function(){}),i.ima.addEventListener(google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED,function(){i.play()}),i.ima.addEventListener(google.ima.AdEvent.Type.ALL_ADS_COMPLETED,function(){})}),i.on("ended",function(){i.pause(),i.dispose(),setTimeout(function(){s(t)},1e3)}),void 0===t)t={npa:0};var o={id:this._id,adTagUrl:'https://pubads.g.doubleclick.net/gampad/ads?iu=/323841319/abqjournal_large/Preroll&description_url='+window.location.protocol+'\/\/'+window.location.host+'&env=vp&impl=s&correlator=&tfcd=0&gdfp_req=1&output=vast&sz=640x480&unviewed_position_start=1&npa='+t.npa,debug:!!this._element.attributes.debug,autoPlayAdBreaks:!0,numRedirects:15,vastLoadTimeout:15e3,vpaidMode:google.ima.ImaSdkSettings.VpaidMode.INSECURE,disableCustomPlaybackForIOS10Plus:!0,adsManagerLoadedCallback:this.adsManagerLoadedCallback.bind(this),contribAdsSettings:{debug:!!this._element.attributes.debug},adsRenderingSettings:{enablePreloading:!0}};i.ima(o),this._player=i,this.checkVisibility(),window.addEventListener("scroll",this.handleScroll.bind(this))}},{key:"videoSources",value:function(){var t=["https:\/\/videocdn-pmd.ora.tv\/larrykingnow\/video-61683\/basic600.mp4","https:\/\/videocdn-pmd.ora.tv\/larrykingnow\/video-61791\/basic600.mp4","https:\/\/videocdn-pmd.ora.tv\/larrykingnow\/video-61839\/basic600.mp4","https:\/\/videocdn-pmd.ora.tv\/larrykingnow\/video-61849\/basic600.mp4"],e=Math.floor(Math.random()*t.length),n=t[e];if(Array.isArray("")){document.getElementById("ora_title")&&(document.getElementById("ora_title").remove(),document.getElementById("ora_description").remove());var r=document.createElement("div");r.setAttribute("id","ora_title"),r.style.height="20px",r.style.fontWeight="bold",r.style.whiteSpace="nowrap",r.style.overflow="hidden",r.style.textOverflow="ellipsis",r.innerHTML=""[e].title;var i=document.createElement("div");i.setAttribute("id","ora_description"),i.style.height="40px",i.style.whiteSpace="nowrap",i.style.overflow="hidden",i.style.textOverflow="ellipsis",i.innerHTML=""[e].description,document.getElementsByTagName("ora-instream")[0].insertBefore(r,document.getElementsByTagName("ora-instream")[0].childNodes[0]),document.getElementsByClassName("ora-player-container")[0].appendChild(i)}return[{src:n,type:"video/mp4"}]}},{key:"disconnectedCallback",value:function(){window.removeEventListener("scroll",this.handleScroll.bind(this))}},{key:"attributeChangedCallback",value:function(t,e,n){}},{key:"adsManagerLoadedCallback",value:function(){var t=this;Object.values(google.ima.AdEvent.Type).forEach(function(e){t._player.ima.addEventListener(e,function(n){return t.handleEvent(e,n)})}),this._canPlay=!0,this._player.ima.controller.showAdContainer(),this.checkVisibility()}},{key:"handleEvent",value:function(t,e){switch(t){case google.ima.AdEvent.Type.LOADED:break;case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED:this.layoutFromAd(e.getAd());break;case google.ima.AdEvent.Type.AD_CAN_PLAY:break;case google.ima.AdEvent.Type.COMPLETE:case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:this.continuePlaying()}}},{key:"handleAdsError",value:function(t){this._error=t}},{key:"handleScroll",value:function(){if(!this._ticking){var t=this;window.requestAnimationFrame(function(){t.checkVisibility(),t._ticking=!1})}this._ticking=!0}},{key:"checkVisibility",value:function(){var e=window.innerHeight,n=this._element.getBoundingClientRect();if(!this._error){if((n.height>e&&n.top<0&&n.top+n.height>e?1:n.top>0?(e-n.top)/n.height:(n.top+n.height)/n.height)>.5&&!this._player.ads.isAdPlaying()){t.beenseen=!0;try{this._player.play()}catch(t){}try{this.play()}catch(t){}}}}},{key:"layoutFromAd",value:function(t){if(t){var e=this._element.getBoundingClientRect(),n=e.width,r=Math.floor(9*n/16);this._player.width(e.width),r>window.innerHeight?this._player.height(window.innerHeight):this._player.height(r),this._player.ima.controller.playerWrapper.checkForResize()}}},{key:"play",value:function(){this._canPlay&&(this._playing?this._player.ima.resumeAd():(this._playing=!0,this._player.ima.playAdBreak()))}},{key:"pause",value:function(){this._playing&&this._player.ima.pauseAd()}},{key:"complete",value:function(){this.replay()}},{key:"makeReplay",value:function(){}},{key:"continuePlaying",value:function(){this._canPlay=!0,this._playing=!0}},{key:"replay",value:function(){this._canPlay=!1,this._playing=!1,this._player.ima.setContentWithAdTag(null,null,!1),this._player.ima.requestAds()}},{key:"guid",value:function(){function t(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return t()+t()+"-"+t()+"-"+t()+"-"+t()+"-"+t()+t()+t()}}]),e}();var n=0,o=10;function s(t){if(void 0===t&&(t={}),window.google&&window.google.ima){if("undefined"!=typeof oraInstreamConfig){var r=oraInstreamConfig.spots||[];Array.isArray(r)||(r=[r]),r.forEach(function(t){var e=document.querySelector(t.selector);if(e){var n=document.createElement("ora-instream");n.setAttribute("data-tag",t.tag),e.nextSibling?e.parentNode.insertBefore(n,e.nextSibling):e.parentNode.appendChild(n)}})}var i=document.getElementsByTagName("ora-instream");if(0==document.getElementsByTagName("ora-instream")[0].getElementsByClassName("video-js").length){var a=!0,l=!1,c=void 0;try{for(var u,h=i[Symbol.iterator]();!(a=(u=h.next()).done);a=!0){var d=u.value,p=new e(d);p.connectedCallback(t),setTimeout(p.checkVisibility(),2e3)}}catch(t){l=!0,c=t}finally{try{a||null==h.return||h.return()}finally{if(l)throw c}}}!function(){for(var t=document.styleSheets,e=0,n=t.length;e<n;e++)if("https://f.ora.tv/c/ora-instream.min.css"==t[e].href)return;var r=document.createElement("link");r.rel="stylesheet",r.href="https://f.ora.tv/c/ora-instream.min.css",document.getElementsByTagName("head")[0].appendChild(r)}()}else++n<o&&setTimeout(s(t),50)}if(t.api)return {create:s,destroy:function(){var t=document.getElementsByTagName("ora-instream"),e=!0,n=!1,r=void 0;try{for(var i,o=t[Symbol.iterator]();!(e=(i=o.next()).done);e=!0){var s=i.value;delete s.oraInstreamPlayer,s.innerHTML=""}}catch(t){n=!0,r=t}finally{try{e||null==o.return||o.return()}finally{if(n)throw r}}}};setTimeout(function(){s(t)},38)}();window.OraInstreamPlayer=o;var s=o;e.default=s}]);
