video.js
Version:
An HTML5 video player that supports HLS and DASH with a common API and skin.
12 lines • 241 kB
JavaScript
/**
* @license
* Video.js 8.21.0 <http://videojs.com/>
* Copyright Brightcove, Inc. <https://www.brightcove.com/>
* Available under Apache License Version 2.0
* <https://github.com/videojs/video.js/blob/main/LICENSE>
*
* Includes vtt.js <https://github.com/mozilla/vtt.js>
* Available under Apache License Version 2.0
* <https://github.com/mozilla/vtt.js/blob/main/LICENSE>
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).videojs=t()}(this,function(){var L="8.21.0";let s={},F=function(e,t){return s[e]=s[e]||[],t&&(s[e]=s[e].concat(t)),s[e]};function B(e,t){return!((t=F(e).indexOf(t))<=-1||(s[e]=s[e].slice(),s[e].splice(t,1),0))}let R={prefixed:!0};var H=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"]],z=H[0];let V;for(let e=0;e<H.length;e++)if(H[e][1]in document){V=H[e];break}if(V){for(let e=0;e<V.length;e++)R[z[e]]=V[e];R.prefixed=V[0]!==z[0]}let d=[];function q(e){return n(e)?Object.keys(e):[]}let o=function i(r,n=":",a=""){let t="info",s;function o(...e){s("log",t,e)}var l,h,c;return s=(l=r,c=a,(t,s,i)=>{var e,s=h.levels[s],r=new RegExp(`^(${s})$`);let n=l;if("log"!==t&&i.unshift(t.toUpperCase()+":"),c&&(n="%c"+l,i.unshift(c)),i.unshift(n+":"),d&&(d.push([].concat(i)),e=d.length-1e3,d.splice(0,0<e?e:0)),window.console){let e=window.console[t];(e=e||"debug"!==t?e:window.console.info||window.console.log)&&s&&r.test(t)&&e[Array.isArray(i)?"apply":"call"](window.console,i)}}),(h=o).createLogger=(e,t,s)=>i(r+` ${t=void 0!==t?t:n} `+e,t,void 0!==s?s:a),o.createNewLogger=(e,t,s)=>i(e,t,s),o.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:t},o.level=e=>{if("string"==typeof e){if(!o.levels.hasOwnProperty(e))throw new Error(`"${e}" in not a valid log level`);t=e}return t},(o.history=()=>d?[].concat(d):[]).filter=t=>(d||[]).filter(e=>new RegExp(`.*${t}.*`).test(e[0])),o.history.clear=()=>{d&&(d.length=0)},o.history.disable=()=>{null!==d&&(d.length=0,d=null)},o.history.enable=()=>{null===d&&(d=[])},o.error=(...e)=>s("error",t,e),o.warn=(...e)=>s("warn",t,e),o.debug=(...e)=>s("debug",t,e),o}("VIDEOJS"),U=o.createLogger,W=Object.prototype.toString;function $(t,s){q(t).forEach(e=>s(t[e],e))}function K(s,i,e=0){return q(s).reduce((e,t)=>i(e,s[t],t),e)}function n(e){return!!e&&"object"==typeof e}function G(e){return n(e)&&"[object Object]"===W.call(e)&&e.constructor===Object}function h(...e){let s={};return e.forEach(e=>{e&&$(e,(e,t)=>{G(e)?(G(s[t])||(s[t]={}),s[t]=h(s[t],e)):s[t]=e})}),s}function X(e={}){var t,s,i=[];for(t in e)e.hasOwnProperty(t)&&(s=e[t],i.push(s));return i}function Y(t,s,i,e=!0){let r=e=>Object.defineProperty(t,s,{value:e,enumerable:!0,writable:!0});var n={configurable:!0,enumerable:!0,get(){var e=i();return r(e),e}};return e&&(n.set=r),Object.defineProperty(t,s,n)}let Q=Object.freeze({__proto__:null,each:$,reduce:K,isObject:n,isPlain:G,merge:h,values:X,defineLazyProperty:Y}),J=!1,Z=null,l=!1,ee,te=!1,se=!1,ie=!1,c=!1,re=null,ne=null;var e=Boolean(window.cast&&window.cast.framework&&window.cast.framework.CastReceiverContext);let ae=null,oe=!1,le=!1,he=!1,ce=!1,de=!1,ue=!1,pe=!1,ge=Boolean(fe()&&("ontouchstart"in window||window.navigator.maxTouchPoints||window.DocumentTouch&&window.document instanceof window.DocumentTouch));var me,t=window.navigator&&window.navigator.userAgentData;if(t&&t.platform&&t.brands&&(l="Android"===t.platform,se=Boolean(t.brands.find(e=>"Microsoft Edge"===e.brand)),ie=Boolean(t.brands.find(e=>"Chromium"===e.brand)),c=!se&&ie,re=ne=(t.brands.find(e=>"Chromium"===e.brand)||{}).version||null,le="Windows"===t.platform),!ie){let s=window.navigator&&window.navigator.userAgent||"";J=/iPod/i.test(s),Z=(t=s.match(/OS (\d+)_/i))&&t[1]?t[1]:null,l=/Android/i.test(s),ee=(t=s.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i))?(ls=t[1]&&parseFloat(t[1]),me=t[2]&&parseFloat(t[2]),ls&&me?parseFloat(t[1]+"."+t[2]):ls||null):null,te=/Firefox/i.test(s),se=/Edg/i.test(s),ie=/Chrome/i.test(s)||/CriOS/i.test(s),c=!se&&ie,re=ne=(me=s.match(/(Chrome|CriOS)\/(\d+)/))&&me[2]?parseFloat(me[2]):null,ae=function(){var e=/MSIE\s(\d+)\.\d/.exec(s);let t=e&&parseFloat(e[1]);return t=!t&&/Trident\/7.0/i.test(s)&&/rv:11.0/.test(s)?11:t}(),de=/Tizen/i.test(s),ue=/Web0S/i.test(s),pe=de||ue,oe=/Safari/i.test(s)&&!c&&!l&&!se&&!pe,le=/Windows/i.test(s),he=/iPad/i.test(s)||oe&&ge&&!/iPhone/i.test(s),ce=/iPhone/i.test(s)&&!he}let u=ce||he||J,_e=(oe||u)&&!c;var ve=Object.freeze({__proto__:null,get IS_IPOD(){return J},get IOS_VERSION(){return Z},get IS_ANDROID(){return l},get ANDROID_VERSION(){return ee},get IS_FIREFOX(){return te},get IS_EDGE(){return se},get IS_CHROMIUM(){return ie},get IS_CHROME(){return c},get CHROMIUM_VERSION(){return re},get CHROME_VERSION(){return ne},IS_CHROMECAST_RECEIVER:e,get IE_VERSION(){return ae},get IS_SAFARI(){return oe},get IS_WINDOWS(){return le},get IS_IPAD(){return he},get IS_IPHONE(){return ce},get IS_TIZEN(){return de},get IS_WEBOS(){return ue},get IS_SMART_TV(){return pe},TOUCH_ENABLED:ge,IS_IOS:u,IS_ANY_SAFARI:_e});function ye(e){return"string"==typeof e&&Boolean(e.trim())}function fe(){return document===window.document}function be(e){return n(e)&&1===e.nodeType}function Te(){try{return window.parent!==window.self}catch(e){return!0}}function Ce(s){return function(e,t){return ye(e)?(t=be(t=ye(t)?document.querySelector(t):t)?t:document)[s]&&t[s](e):document[s](null)}}function p(e="div",s={},t={},i){let r=document.createElement(e);return Object.getOwnPropertyNames(s).forEach(function(e){var t=s[e];"textContent"===e?ke(r,t):r[e]===t&&"tabIndex"!==e||(r[e]=t)}),Object.getOwnPropertyNames(t).forEach(function(e){r.setAttribute(e,t[e])}),i&&Ve(r,i),r}function ke(e,t){return"undefined"==typeof e.textContent?e.innerText=t:e.textContent=t,e}function we(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}function Se(e,t){if(0<=t.indexOf(" "))throw new Error("class has illegal whitespace characters");return e.classList.contains(t)}function Ee(e,...t){return e.classList.add(...t.reduce((e,t)=>e.concat(t.split(/\s+/)),[])),e}function xe(e,...t){return e?(e.classList.remove(...t.reduce((e,t)=>e.concat(t.split(/\s+/)),[])),e):(o.warn("removeClass was called with an element that doesn't exist"),null)}function Pe(t,e,s){return"boolean"!=typeof(s="function"==typeof s?s(t,e):s)&&(s=void 0),e.split(/\s+/).forEach(e=>t.classList.toggle(e,s)),t}function je(s,i){Object.getOwnPropertyNames(i).forEach(function(e){var t=i[e];null===t||"undefined"==typeof t||!1===t?s.removeAttribute(e):s.setAttribute(e,!0===t?"":t)})}function Ie(e){var s={},i=["autoplay","controls","playsinline","loop","muted","default","defaultMuted"];if(e&&e.attributes&&0<e.attributes.length){var r=e.attributes;for(let t=r.length-1;0<=t;t--){var n=r[t].name;let e=r[t].value;i.includes(n)&&(e=null!==e),s[n]=e}}return s}function Me(e,t){return e.getAttribute(t)}function Ae(e,t,s){e.setAttribute(t,s)}function Oe(e,t){e.removeAttribute(t)}function De(){document.body.focus(),document.onselectstart=function(){return!1}}function Ne(){document.onselectstart=function(){return!0}}function Le(e){if(e&&e.getBoundingClientRect&&e.parentNode){let t=e.getBoundingClientRect(),s={};return["bottom","height","left","right","top","width"].forEach(e=>{void 0!==t[e]&&(s[e]=t[e])}),s.height||(s.height=parseFloat(Ke(e,"height"))),s.width||(s.width=parseFloat(Ke(e,"width"))),s}}function Fe(e){if(!e||!e.offsetParent)return{left:0,top:0,width:0,height:0};var t=e.offsetWidth,s=e.offsetHeight;let i=0,r=0;for(;e.offsetParent&&e!==document[R.fullscreenElement];)i+=e.offsetLeft,r+=e.offsetTop,e=e.offsetParent;return{left:i,top:r,width:t,height:s}}function Be(t,e){var s={x:0,y:0};if(u){let e=t;for(;e&&"html"!==e.nodeName.toLowerCase();){var i,r=Ke(e,"transform");/^matrix/.test(r)?(i=r.slice(7,-1).split(/,\s/).map(Number),s.x+=i[4],s.y+=i[5]):/^matrix3d/.test(r)&&(i=r.slice(9,-1).split(/,\s/).map(Number),s.x+=i[12],s.y+=i[13]),e.assignedSlot&&e.assignedSlot.parentElement&&window.WebKitCSSMatrix&&(r=window.getComputedStyle(e.assignedSlot.parentElement).transform,r=new window.WebKitCSSMatrix(r),s.x+=r.m41,s.y+=r.m42),e=e.parentNode||e.host}}var n={},a=Fe(e.target),t=Fe(t),o=t.width,l=t.height;let h=e.offsetY-(t.top-a.top),c=e.offsetX-(t.left-a.left);return e.changedTouches&&(c=e.changedTouches[0].pageX-t.left,h=e.changedTouches[0].pageY+t.top,u)&&(c-=s.x,h-=s.y),n.y=1-Math.max(0,Math.min(1,h/l)),n.x=Math.max(0,Math.min(1,c/o)),n}function Re(e){return n(e)&&3===e.nodeType}function He(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function ze(e){return"function"==typeof e&&(e=e()),(Array.isArray(e)?e:[e]).map(e=>be(e="function"==typeof e?e():e)||Re(e)?e:"string"==typeof e&&/\S/.test(e)?document.createTextNode(e):void 0).filter(e=>e)}function Ve(t,e){return ze(e).forEach(e=>t.appendChild(e)),t}function qe(e,t){return Ve(He(e),t)}function Ue(e){return void 0===e.button&&void 0===e.buttons||0===e.button&&void 0===e.buttons||"mouseup"===e.type&&0===e.button&&0===e.buttons||"mousedown"===e.type&&0===e.button&&0===e.buttons||0===e.button&&1===e.buttons}let We=Ce("querySelector"),$e=Ce("querySelectorAll");function Ke(t,s){if(!t||!s)return"";if("function"!=typeof window.getComputedStyle)return"";{let e;try{e=window.getComputedStyle(t)}catch(e){return""}return e?e.getPropertyValue(s)||e[s]:""}}function Ge(i){[...document.styleSheets].forEach(t=>{try{var s=[...t.cssRules].map(e=>e.cssText).join(""),e=document.createElement("style");e.textContent=s,i.document.head.appendChild(e)}catch(e){s=document.createElement("link");s.rel="stylesheet",s.type=t.type,s.media=t.media.mediaText,s.href=t.href,i.document.head.appendChild(s)}})}var Xe=Object.freeze({__proto__:null,isReal:fe,isEl:be,isInFrame:Te,createEl:p,textContent:ke,prependTo:we,hasClass:Se,addClass:Ee,removeClass:xe,toggleClass:Pe,setAttributes:je,getAttributes:Ie,getAttribute:Me,setAttribute:Ae,removeAttribute:Oe,blockTextSelection:De,unblockTextSelection:Ne,getBoundingClientRect:Le,findPosition:Fe,getPointerPosition:Be,isTextNode:Re,emptyEl:He,normalizeContent:ze,appendContent:Ve,insertContent:qe,isSingleLeftClick:Ue,$:We,$$:$e,computedStyle:Ke,copyStyleSheetsToWindow:Ge});function Ye(){if(!1!==Je.options.autoSetup){var e=Array.prototype.slice.call(document.getElementsByTagName("video")),t=Array.prototype.slice.call(document.getElementsByTagName("audio")),s=Array.prototype.slice.call(document.getElementsByTagName("video-js")),i=e.concat(t,s);if(i&&0<i.length)for(let e=0,t=i.length;e<t;e++){var r=i[e];if(!r||!r.getAttribute){Ze(1);break}void 0===r.player&&null!==r.getAttribute("data-setup")&&Je(r)}else Qe||Ze(1)}}let Qe=!1,Je;function Ze(e,t){fe()&&(t&&(Je=t),window.setTimeout(Ye,e))}function et(){Qe=!0,window.removeEventListener("load",et)}fe()&&("complete"===document.readyState?et():window.addEventListener("load",et));function tt(e){var t=document.createElement("style");return t.className=e,t}function st(e,t){e.styleSheet?e.styleSheet.cssText=t:e.textContent=t}var g=new WeakMap;let m=3;function it(e,t){var s;g.has(e)&&(0===(s=g.get(e)).handlers[t].length&&(delete s.handlers[t],e.removeEventListener?e.removeEventListener(t,s.dispatcher,!1):e.detachEvent&&e.detachEvent("on"+t,s.dispatcher)),Object.getOwnPropertyNames(s.handlers).length<=0&&(delete s.handlers,delete s.dispatcher,delete s.disabled),0===Object.getOwnPropertyNames(s).length)&&g.delete(e)}function rt(t,s,e,i){e.forEach(function(e){t(s,e,i)})}function nt(t){if(!t.fixed_){if(!t||!t.isPropagationStopped||!t.isImmediatePropagationStopped){let e=t||window.event;t={};var s,i,r,n=["layerX","layerY","keyLocation","path","webkitMovementX","webkitMovementY","mozPressure","mozInputSource"];for(s in e)n.includes(s)||"returnValue"===s&&e.preventDefault||(t[s]=e[s]);t.target||(t.target=t.srcElement||document),t.relatedTarget||(t.relatedTarget=t.fromElement===t.target?t.toElement:t.fromElement),t.preventDefault=function(){e.preventDefault&&e.preventDefault(),t.returnValue=!1,e.returnValue=!1,t.defaultPrevented=!0},t.defaultPrevented=!1,t.stopPropagation=function(){e.stopPropagation&&e.stopPropagation(),t.cancelBubble=!0,e.cancelBubble=!0,t.isPropagationStopped=a},t.isPropagationStopped=o,t.stopImmediatePropagation=function(){e.stopImmediatePropagation&&e.stopImmediatePropagation(),t.isImmediatePropagationStopped=a,t.stopPropagation()},t.isImmediatePropagationStopped=o,null!=t.clientX&&(i=document.documentElement,r=document.body,t.pageX=t.clientX+(i&&i.scrollLeft||r&&r.scrollLeft||0)-(i&&i.clientLeft||r&&r.clientLeft||0),t.pageY=t.clientY+(i&&i.scrollTop||r&&r.scrollTop||0)-(i&&i.clientTop||r&&r.clientTop||0)),t.which=t.charCode||t.keyCode,null!=t.button&&(t.button=1&t.button?0:4&t.button?1:2&t.button?2:0)}t.fixed_=!0}return t;function a(){return!0}function o(){return!1}}let at,ot=["touchstart","touchmove"];function r(n,t,e){if(Array.isArray(t))return rt(r,n,t,e);g.has(n)||g.set(n,{});let a=g.get(n);if(a.handlers||(a.handlers={}),a.handlers[t]||(a.handlers[t]=[]),e.guid||(e.guid=m++),a.handlers[t].push(e),a.dispatcher||(a.disabled=!1,a.dispatcher=function(s,i){if(!a.disabled){s=nt(s);var e=a.handlers[s.type];if(e){var r=e.slice(0);for(let e=0,t=r.length;e<t&&!s.isImmediatePropagationStopped();e++)try{r[e].call(n,s,i)}catch(e){o.error(e)}}}}),1===a.handlers[t].length)if(n.addEventListener){let e=!1;(function(){if("boolean"!=typeof at){at=!1;try{var e=Object.defineProperty({},"passive",{get(){at=!0}});window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(e){}}return at})()&&-1<ot.indexOf(t)&&(e={passive:!0}),n.addEventListener(t,a.dispatcher,e)}else n.attachEvent&&n.attachEvent("on"+t,a.dispatcher)}function _(e,t,i){if(g.has(e)){let s=g.get(e);if(s.handlers){if(Array.isArray(t))return rt(_,e,t,i);var r=function(e,t){s.handlers[t]=[],it(e,t)};if(void 0===t)for(var n in s.handlers)Object.prototype.hasOwnProperty.call(s.handlers||{},n)&&r(e,n);else{var a=s.handlers[t];if(a)if(i){if(i.guid)for(let e=0;e<a.length;e++)a[e].guid===i.guid&&a.splice(e--,1);it(e,t)}else r(e,t)}}}}function lt(e,t,s){var i=g.has(e)?g.get(e):{},r=e.parentNode||e.ownerDocument;return"string"==typeof t?t={type:t,target:e}:t.target||(t.target=e),t=nt(t),i.dispatcher&&i.dispatcher.call(e,t,s),r&&!t.isPropagationStopped()&&!0===t.bubbles?lt.call(null,r,t,s):!r&&!t.defaultPrevented&&t.target&&t.target[t.type]&&(g.has(t.target)||g.set(t.target,{}),i=g.get(t.target),t.target[t.type])&&(i.disabled=!0,"function"==typeof t.target[t.type]&&t.target[t.type](),i.disabled=!1),!t.defaultPrevented}function ht(e,t,s){if(Array.isArray(t))return rt(ht,e,t,s);function i(){_(e,t,i),s.apply(this,arguments)}i.guid=s.guid=s.guid||m++,r(e,t,i)}function ct(e,t,s){function i(){_(e,t,i),s.apply(this,arguments)}i.guid=s.guid=s.guid||m++,r(e,t,i)}var dt=Object.freeze({__proto__:null,fixEvent:nt,on:r,off:_,trigger:lt,one:ht,any:ct});function v(e,t,s){return t.guid||(t.guid=m++),(e=t.bind(e)).guid=s?s+"_"+t.guid:t.guid,e}function a(s,i){let r=window.performance.now();return function(...e){var t=window.performance.now();t-r>=i&&(s(...e),r=t)}}function ut(i,r,n,a=window){let o;function e(){let e=this,t=arguments,s=function(){o=null,s=null,n||i.apply(e,t)};!o&&n&&i.apply(e,t),a.clearTimeout(o),o=a.setTimeout(s,r)}return e.cancel=()=>{a.clearTimeout(o),o=null},e}let pt=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:30,bind_:v,throttle:a,debounce:ut}),gt;class i{on(e,t){var s=this.addEventListener;this.addEventListener=()=>{},r(this,e,t),this.addEventListener=s}off(e,t){_(this,e,t)}one(e,t){var s=this.addEventListener;this.addEventListener=()=>{},ht(this,e,t),this.addEventListener=s}any(e,t){var s=this.addEventListener;this.addEventListener=()=>{},ct(this,e,t),this.addEventListener=s}trigger(e){var t=e.type||e;e=nt(e="string"==typeof e?{type:t}:e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),lt(this,e)}queueTrigger(e){gt=gt||new Map;let t=e.type||e,s=gt.get(this);s||(s=new Map,gt.set(this,s));var i=s.get(t),i=(s.delete(t),window.clearTimeout(i),window.setTimeout(()=>{s.delete(t),0===s.size&&(s=null,gt.delete(this)),this.trigger(e)},0));s.set(t,i)}}i.prototype.allowedEvents_={},i.prototype.addEventListener=i.prototype.on,i.prototype.removeEventListener=i.prototype.off,i.prototype.dispatchEvent=i.prototype.trigger;let mt=e=>"function"==typeof e.name?e.name():"string"==typeof e.name?e.name:e.name_||(e.constructor&&e.constructor.name?e.constructor.name:typeof e),y=t=>t instanceof i||!!t.eventBusEl_&&["on","one","off","trigger"].every(e=>"function"==typeof t[e]),_t=e=>"string"==typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length,vt=(e,t,s)=>{if(!e||!e.nodeName&&!y(e))throw new Error(`Invalid target for ${mt(t)}#${s}; must be a DOM node or evented object.`)},yt=(e,t,s)=>{if(!_t(e))throw new Error(`Invalid event type for ${mt(t)}#${s}; must be a non-empty string or array.`)},ft=(e,t,s)=>{if("function"!=typeof e)throw new Error(`Invalid listener for ${mt(t)}#${s}; must be a function.`)},bt=(e,t,s)=>{var i=t.length<3||t[0]===e||t[0]===e.eventBusEl_;let r,n,a;return i?(r=e.eventBusEl_,3<=t.length&&t.shift(),[n,a]=t):(r=t[0],n=t[1],a=t[2]),vt(r,e,s),yt(n,e,s),ft(a,e,s),a=v(e,a),{isTargetingSelf:i,target:r,type:n,listener:a}},Tt=(e,t,s,i)=>{vt(e,e,t),e.nodeName?dt[t](e,s,i):e[t](s,i)},Ct={on(...t){let{isTargetingSelf:e,target:s,type:i,listener:r}=bt(this,t,"on");if(Tt(s,"on",i,r),!e){let e=()=>this.off(s,i,r);e.guid=r.guid;t=()=>this.off("dispose",e);t.guid=r.guid,Tt(this,"on","dispose",e),Tt(s,"on","dispose",t)}},one(...e){let{isTargetingSelf:t,target:s,type:i,listener:r}=bt(this,e,"one");if(t)Tt(s,"one",i,r);else{let t=(...e)=>{this.off(s,i,t),r.apply(null,e)};t.guid=r.guid,Tt(s,"one",i,t)}},any(...e){let{isTargetingSelf:t,target:s,type:i,listener:r}=bt(this,e,"any");if(t)Tt(s,"any",i,r);else{let t=(...e)=>{this.off(s,i,t),r.apply(null,e)};t.guid=r.guid,Tt(s,"any",i,t)}},off(e,t,s){!e||_t(e)?_(this.eventBusEl_,e,t):(e=e,t=t,vt(e,this,"off"),yt(t,this,"off"),ft(s,this,"off"),s=v(this,s),this.off("dispose",s),e.nodeName?(_(e,t,s),_(e,"dispose",s)):y(e)&&(e.off(t,s),e.off("dispose",s)))},trigger(e,t){vt(this.eventBusEl_,this,"trigger");var s=e&&"string"!=typeof e?e.type:e;if(_t(s))return lt(this.eventBusEl_,e,t);throw new Error(`Invalid event type for ${mt(this)}#trigger; `+"must be a non-empty string or object with a type key that has a non-empty value.")}};function kt(e,t={}){t=t.eventBusKey;if(t){if(!e[t].nodeName)throw new Error(`The eventBusKey "${t}" does not refer to an element.`);e.eventBusEl_=e[t]}else e.eventBusEl_=p("span",{className:"vjs-event-bus"});Object.assign(e,Ct),e.eventedCallbacks&&e.eventedCallbacks.forEach(e=>{e()}),e.on("dispose",()=>{e.off(),[e,e.el_,e.eventBusEl_].forEach(function(e){e&&g.has(e)&&g.delete(e)}),window.setTimeout(()=>{e.eventBusEl_=null},0)})}let wt={state:{},setState(e){"function"==typeof e&&(e=e());let s;return $(e,(e,t)=>{this.state[t]!==e&&((s=s||{})[t]={from:this.state[t],to:e}),this.state[t]=e}),s&&y(this)&&this.trigger({changes:s,type:"statechanged"}),s}};function St(e,t){Object.assign(e,wt),e.state=Object.assign({},e.state,t),"function"==typeof e.handleStateChanged&&y(e)&&e.on("statechanged",e.handleStateChanged)}function Et(e){return"string"!=typeof e?e:e.replace(/./,e=>e.toLowerCase())}function f(e){return"string"!=typeof e?e:e.replace(/./,e=>e.toUpperCase())}function xt(e,t){return f(e)===f(t)}let Pt=Object.freeze({__proto__:null,toLowerCase:Et,toTitleCase:f,titleCaseEquals:xt});class b{constructor(e,t,s){!e&&this.play?this.player_=e=this:this.player_=e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=h({},this.options_),t=this.options_=h(this.options_,t),this.id_=t.id||t.el&&t.el.id,this.id_||(e=e&&e.id&&e.id()||"no_player",this.id_=e+"_component_"+m++),this.name_=t.name||null,t.el?this.el_=t.el:!1!==t.createEl&&(this.el_=this.createEl()),t.className&&this.el_&&t.className.split(" ").forEach(e=>this.addClass(e)),["on","off","one","any","trigger"].forEach(e=>{this[e]=void 0}),!1!==t.evented&&(kt(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),St(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new Set,this.setIntervalIds_=new Set,this.rafIds_=new Set,this.namedRafs_=new Map,(this.clearingTimersOnDispose_=!1)!==t.initChildren&&this.initChildren(),this.ready(s),!1!==t.reportTouchActivity&&this.enableTouchActivity()}dispose(e={}){if(!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(let e=this.children_.length-1;0<=e;e--)this.children_[e].dispose&&this.children_[e].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&(e.restoreEl?this.el_.parentNode.replaceChild(e.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null),this.player_=null}}isDisposed(){return Boolean(this.isDisposed_)}player(){return this.player_}options(e){return e&&(this.options_=h(this.options_,e)),this.options_}el(){return this.el_}createEl(e,t,s){return p(e,t,s)}localize(e,i,t=e){var s=this.player_.language&&this.player_.language(),r=this.player_.languages&&this.player_.languages(),n=r&&r[s],s=s&&s.split("-")[0],r=r&&r[s];let a=t;return n&&n[e]?a=n[e]:r&&r[e]&&(a=r[e]),a=i?a.replace(/\{(\d+)\}/g,function(e,t){t=i[t-1];let s="undefined"==typeof t?e:t;return s}):a}handleLanguagechange(){}contentEl(){return this.contentEl_||this.el_}id(){return this.id_}name(){return this.name_}children(){return this.children_}getChildById(e){return this.childIndex_[e]}getChild(e){if(e)return this.childNameIndex_[e]}getDescendant(...t){t=t.reduce((e,t)=>e.concat(t),[]);let s=this;for(let e=0;e<t.length;e++)if(!(s=s.getChild(t[e]))||!s.getChild)return;return s}setIcon(e,t=this.el()){var s,i,r;if(this.player_.options_.experimentalSvgIcons)return r="http://www.w3.org/2000/svg",s=p("span",{className:"vjs-icon-placeholder vjs-svg-icon"},{"aria-hidden":"true"}),(i=document.createElementNS(r,"svg")).setAttributeNS(null,"viewBox","0 0 512 512"),r=document.createElementNS(r,"use"),i.appendChild(r),r.setAttributeNS(null,"href","#vjs-icon-"+e),s.appendChild(i),this.iconIsSet_?t.replaceChild(s,t.querySelector(".vjs-icon-placeholder")):t.appendChild(s),this.iconIsSet_=!0,s}addChild(e,t={},s=this.children_.length){let i,r;if("string"==typeof e){r=f(e);var n=t.componentClass||r,a=(t.name=r,b.getComponent(n));if(!a)throw new Error(`Component ${n} does not exist`);if("function"!=typeof a)return null;i=new a(this.player_||this,t)}else i=e;if(i.parentComponent_&&i.parentComponent_.removeChild(i),this.children_.splice(s,0,i),i.parentComponent_=this,"function"==typeof i.id&&(this.childIndex_[i.id()]=i),(r=r||i.name&&f(i.name()))&&(this.childNameIndex_[r]=i,this.childNameIndex_[Et(r)]=i),"function"==typeof i.el&&i.el()){let e=null;this.children_[s+1]&&(this.children_[s+1].el_?e=this.children_[s+1].el_:be(this.children_[s+1])&&(e=this.children_[s+1])),this.contentEl().insertBefore(i.el(),e)}return i}removeChild(s){if((s="string"==typeof s?this.getChild(s):s)&&this.children_){let t=!1;for(let e=this.children_.length-1;0<=e;e--)if(this.children_[e]===s){t=!0,this.children_.splice(e,1);break}var e;t&&(s.parentComponent_=null,this.childIndex_[s.id()]=null,this.childNameIndex_[f(s.name())]=null,this.childNameIndex_[Et(s.name())]=null,e=s.el())&&e.parentNode===this.contentEl()&&this.contentEl().removeChild(s.el())}}initChildren(){let r=this.options_.children;if(r){let i=this.options_;let e,t=b.getComponent("Tech");(e=Array.isArray(r)?r:Object.keys(r)).concat(Object.keys(this.options_).filter(function(t){return!e.some(function(e){return"string"==typeof e?t===e:t===e.name})})).map(e=>{let t,s;return s="string"==typeof e?(t=e,r[t]||this.options_[t]||{}):(t=e.name,e),{name:t,opts:s}}).filter(e=>{e=b.getComponent(e.opts.componentClass||f(e.name));return e&&!t.isTech(e)}).forEach(e=>{var t=e.name;let s=e.opts;!1!==(s=void 0!==i[t]?i[t]:s)&&((s=!0===s?{}:s).playerOptions=this.options_.playerOptions,e=this.addChild(t,s))&&(this[t]=e)})}}buildCSSClass(){return""}ready(e,t=!1){e&&(this.isReady_?t?e.call(this):this.setTimeout(e,1):(this.readyQueue_=this.readyQueue_||[],this.readyQueue_.push(e)))}triggerReady(){this.isReady_=!0,this.setTimeout(function(){var e=this.readyQueue_;this.readyQueue_=[],e&&0<e.length&&e.forEach(function(e){e.call(this)},this),this.trigger("ready")},1)}$(e,t){return We(e,t||this.contentEl())}$$(e,t){return $e(e,t||this.contentEl())}hasClass(e){return Se(this.el_,e)}addClass(...e){Ee(this.el_,...e)}removeClass(...e){xe(this.el_,...e)}toggleClass(e,t){Pe(this.el_,e,t)}show(){this.removeClass("vjs-hidden")}hide(){this.addClass("vjs-hidden")}lockShowing(){this.addClass("vjs-lock-showing")}unlockShowing(){this.removeClass("vjs-lock-showing")}getAttribute(e){return Me(this.el_,e)}setAttribute(e,t){Ae(this.el_,e,t)}removeAttribute(e){Oe(this.el_,e)}width(e,t){return this.dimension("width",e,t)}height(e,t){return this.dimension("height",e,t)}dimensions(e,t){this.width(e,!0),this.height(t)}dimension(e,t,s){var i,r;if(void 0===t)return this.el_?-1!==(r=(i=this.el_.style[e]).indexOf("px"))?parseInt(i.slice(0,r),10):parseInt(this.el_["offset"+f(e)],10):0;-1!==(""+(t=null!==t&&t==t?t:0)).indexOf("%")||-1!==(""+t).indexOf("px")?this.el_.style[e]=t:this.el_.style[e]="auto"===t?"":t+"px",s||this.trigger("componentresize")}currentDimension(e){let t=0;if("width"!==e&&"height"!==e)throw new Error("currentDimension only accepts width or height value");return t=Ke(this.el_,e),0!==(t=parseFloat(t))&&!isNaN(t)||(e="offset"+f(e),t=this.el_[e]),t}currentDimensions(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}}currentWidth(){return this.currentDimension("width")}currentHeight(){return this.currentDimension("height")}getPositions(){var e=this.el_.getBoundingClientRect();return{boundingClientRect:{x:e.x,y:e.y,width:e.width,height:e.height,top:e.top,right:e.right,bottom:e.bottom,left:e.left},center:{x:e.left+e.width/2,y:e.top+e.height/2,width:0,height:0,top:e.top+e.height/2,right:e.left+e.width/2,bottom:e.top+e.height/2,left:e.left+e.width/2}}}focus(){this.el_.focus()}blur(){this.el_.blur()}handleKeyDown(e){this.player_&&("Tab"===e.key||this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled||e.stopPropagation(),this.player_.handleKeyDown(e))}handleKeyPress(e){this.handleKeyDown(e)}emitTapEvents(){let t=0,s=null,i;this.on("touchstart",function(e){1===e.touches.length&&(s={pageX:e.touches[0].pageX,pageY:e.touches[0].pageY},t=window.performance.now(),i=!0)}),this.on("touchmove",function(e){var t;(1<e.touches.length||s&&(t=e.touches[0].pageX-s.pageX,e=e.touches[0].pageY-s.pageY,10<Math.sqrt(t*t+e*e)))&&(i=!1)});function e(){i=!1}this.on("touchleave",e),this.on("touchcancel",e),this.on("touchend",function(e){!(s=null)===i&&window.performance.now()-t<200&&(e.preventDefault(),this.trigger("tap"))})}enableTouchActivity(){if(this.player()&&this.player().reportUserActivity){let t=v(this.player(),this.player().reportUserActivity),s;this.on("touchstart",function(){t(),this.clearInterval(s),s=this.setInterval(t,250)});var e=function(e){t(),this.clearInterval(s)};this.on("touchmove",t),this.on("touchend",e),this.on("touchcancel",e)}}setTimeout(e,t){var s;return e=v(this,e),this.clearTimersOnDispose_(),s=window.setTimeout(()=>{this.setTimeoutIds_.has(s)&&this.setTimeoutIds_.delete(s),e()},t),this.setTimeoutIds_.add(s),s}clearTimeout(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),window.clearTimeout(e)),e}setInterval(e,t){e=v(this,e),this.clearTimersOnDispose_();e=window.setInterval(e,t);return this.setIntervalIds_.add(e),e}clearInterval(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),window.clearInterval(e)),e}requestAnimationFrame(e){var t;return this.clearTimersOnDispose_(),e=v(this,e),t=window.requestAnimationFrame(()=>{this.rafIds_.has(t)&&this.rafIds_.delete(t),e()}),this.rafIds_.add(t),t}requestNamedAnimationFrame(e,t){this.namedRafs_.has(e)&&this.cancelNamedAnimationFrame(e),this.clearTimersOnDispose_(),t=v(this,t);var s=this.requestAnimationFrame(()=>{t(),this.namedRafs_.has(e)&&this.namedRafs_.delete(e)});return this.namedRafs_.set(e,s),e}cancelNamedAnimationFrame(e){this.namedRafs_.has(e)&&(this.cancelAnimationFrame(this.namedRafs_.get(e)),this.namedRafs_.delete(e))}cancelAnimationFrame(e){return this.rafIds_.has(e)&&(this.rafIds_.delete(e),window.cancelAnimationFrame(e)),e}clearTimersOnDispose_(){this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",()=>{[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(([e,s])=>{this[e].forEach((e,t)=>this[s](t))}),this.clearingTimersOnDispose_=!1}))}getIsDisabled(){return Boolean(this.el_.disabled)}getIsExpresslyInert(){return this.el_.inert&&!this.el_.ownerDocument.documentElement.inert}getIsFocusable(e){return 0<=(e||this.el_).tabIndex&&!(this.getIsDisabled()||this.getIsExpresslyInert())}getIsAvailableToBeFocused(e){function t(e){var e=window.getComputedStyle(e,null),t=e.getPropertyValue("visibility");return"none"!==e.getPropertyValue("display")&&!["hidden","collapse"].includes(t)}var s;return!(!function(t){if(t.offsetWidth+t.offsetHeight+t.getBoundingClientRect().height+t.getBoundingClientRect().width!==0){var s={x:t.getBoundingClientRect().left+t.offsetWidth/2,y:t.getBoundingClientRect().top+t.offsetHeight/2};if(!(s.x<0||s.x>(document.documentElement.clientWidth||window.innerWidth)||s.y<0||s.y>(document.documentElement.clientHeight||window.innerHeight))){let e=document.elementFromPoint(s.x,s.y);for(;e;){if(e===t)return 1;if(!e.parentNode)return;e=e.parentNode}}}}(e=e||this.el())||!t((s=e).parentElement)||!t(s)||"0"===s.style.opacity||"0px"===window.getComputedStyle(s).height||"0px"===window.getComputedStyle(s).width||e.parentElement&&!(0<=e.tabIndex))}static registerComponent(t,e){if("string"!=typeof t||!t)throw new Error(`Illegal component name, "${t}"; must be a non-empty string.`);var s=b.getComponent("Tech"),s=s&&s.isTech(e),i=b===e||b.prototype.isPrototypeOf(e.prototype);if(s||!i){let e;throw e=s?"techs must be registered using Tech.registerTech()":"must be a Component subclass",new Error(`Illegal component, "${t}"; ${e}.`)}t=f(t),b.components_||(b.components_={});i=b.getComponent("Player");if("Player"===t&&i&&i.players){let t=i.players;s=Object.keys(t);if(t&&0<s.length&&s.map(e=>t[e]).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return b.components_[t]=e,b.components_[Et(t)]=e}static getComponent(e){if(e&&b.components_)return b.components_[e]}}function jt(e,t,s,i){var r=i,n=s.length-1;if("number"!=typeof r||r<0||n<r)throw new Error(`Failed to execute '${e}' on 'TimeRanges': The index provided (${r}) is non-numeric or out of bounds (0-${n}).`);return s[i][t]}function It(e){let t;return t=void 0===e||0===e.length?{length:0,start(){throw new Error("This TimeRanges object is empty")},end(){throw new Error("This TimeRanges object is empty")}}:{length:e.length,start:jt.bind(null,"start",0,e),end:jt.bind(null,"end",1,e)},window.Symbol&&window.Symbol.iterator&&(t[window.Symbol.iterator]=()=>(e||[]).values()),t}function T(e,t){return Array.isArray(e)?It(e):void 0===e||void 0===t?It():It([[e,t]])}b.registerComponent("Component",b);function Mt(e,t){e=e<0?0:e;let s=Math.floor(e%60),i=Math.floor(e/60%60),r=Math.floor(e/3600);var n=Math.floor(t/60%60),t=Math.floor(t/3600);return r=0<(r=!isNaN(e)&&e!==1/0?r:i=s="-")||0<t?r+":":"",i=((r||10<=n)&&i<10?"0"+i:i)+":",s=s<10?"0"+s:s,r+i+s}let At=Mt;function Ot(e){At=e}function Dt(){At=Mt}function Nt(e,t=e){return At(e,t)}t=Object.freeze({__proto__:null,createTimeRanges:T,createTimeRange:T,setFormatTime:Ot,resetFormatTime:Dt,formatTime:Nt});function Lt(t,s){let i=0;var r;let n;if(!s)return 0;t&&t.length||(t=T(0,0));for(let e=0;e<t.length;e++)r=t.start(e),(n=t.end(e))>s&&(n=s),i+=n-r;return i/s}function C(e){if(e instanceof C)return e;"number"==typeof e?this.code=e:"string"==typeof e?this.message=e:n(e)&&("number"==typeof e.code&&(this.code=e.code),Object.assign(this,e)),this.message||(this.message=C.defaultMessages[this.code]||"")}function Ft(e){return null!=e&&"function"==typeof e.then}function k(e){Ft(e)&&e.then(null,e=>{})}C.prototype.code=0,C.prototype.message="",C.prototype.status=null,C.prototype.metadata=null,C.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],C.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."},C.MEDIA_ERR_CUSTOM=0,C.prototype.MEDIA_ERR_CUSTOM=0,C.MEDIA_ERR_ABORTED=1,C.prototype.MEDIA_ERR_ABORTED=1,C.MEDIA_ERR_NETWORK=2,C.prototype.MEDIA_ERR_NETWORK=2,C.MEDIA_ERR_DECODE=3,C.prototype.MEDIA_ERR_DECODE=3,C.MEDIA_ERR_SRC_NOT_SUPPORTED=4,C.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED=4,C.MEDIA_ERR_ENCRYPTED=5,C.prototype.MEDIA_ERR_ENCRYPTED=5;function Bt(i){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce((e,t,s)=>(i[t]&&(e[t]=i[t]),e),{cues:i.cues&&Array.prototype.map.call(i.cues,function(e){return{startTime:e.startTime,endTime:e.endTime,text:e.text,id:e.id}})})}var Rt,Ht=function(e){var t=e.$$("track");let s=Array.prototype.map.call(t,e=>e.track);return Array.prototype.map.call(t,function(e){var t=Bt(e.track);return e.src&&(t.src=e.src),t}).concat(Array.prototype.filter.call(e.textTracks(),function(e){return-1===s.indexOf(e)}).map(Bt))},zt=function(e,s){return e.forEach(function(e){let t=s.addRemoteTextTrack(e).track;!e.src&&e.cues&&e.cues.forEach(e=>t.addCue(e))}),s.textTracks()};Bt;let Vt="vjs-modal-dialog";class qt extends b{constructor(e,t){super(e,t),this.handleKeyDown_=e=>this.handleKeyDown(e),this.close_=e=>this.close(e),this.opened_=this.hasBeenOpened_=this.hasBeenFilled_=!1,this.closeable(!this.options_.uncloseable),this.content(this.options_.content),this.contentEl_=p("div",{className:Vt+"-content"},{role:"document"}),this.descEl_=p("p",{className:Vt+"-description vjs-control-text",id:this.el().getAttribute("aria-describedby")}),ke(this.descEl_,this.description()),this.el_.appendChild(this.descEl_),this.el_.appendChild(this.contentEl_)}createEl(){return super.createEl("div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":this.id()+"_description","aria-hidden":"true","aria-label":this.label(),role:"dialog","aria-live":"polite"})}dispose(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,super.dispose()}buildCSSClass(){return Vt+" vjs-hidden "+super.buildCSSClass()}label(){return this.localize(this.options_.label||"Modal Window")}description(){let e=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),e}open(){var e;this.opened_?this.options_.fillAlways&&this.fill():(e=this.player(),this.trigger("beforemodalopen"),this.opened_=!0,!this.options_.fillAlways&&(this.hasBeenOpened_||this.hasBeenFilled_)||this.fill(),this.wasPlaying_=!e.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&e.pause(),this.on("keydown",this.handleKeyDown_),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0)}opened(e){return"boolean"==typeof e&&this[e?"open":"close"](),this.opened_}close(){var e;this.opened_&&(e=this.player(),this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.off("keydown",this.handleKeyDown_),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger({type:"modalclose",bubbles:!0}),this.conditionalBlur_(),this.options_.temporary)&&this.dispose()}closeable(t){if("boolean"==typeof t){var s,t=this.closeable_=!!t;let e=this.getChild("closeButton");t&&!e&&(s=this.contentEl_,this.contentEl_=this.el_,e=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=s,this.on(e,"close",this.close_)),!t&&e&&(this.off(e,"close",this.close_),this.removeChild(e),e.dispose())}return this.closeable_}fill(){this.fillWith(this.content())}fillWith(e){var t=this.contentEl(),s=t.parentNode,i=t.nextSibling,e=(this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,s.removeChild(t),this.empty(),qe(t,e),this.trigger("modalfill"),i?s.insertBefore(t,i):s.appendChild(t),this.getChild("closeButton"));e&&s.appendChild(e.el_),this.trigger("aftermodalfill")}empty(){this.trigger("beforemodalempty"),He(this.contentEl()),this.trigger("modalempty")}content(e){return"undefined"!=typeof e&&(this.content_=e),this.content_}conditionalFocus_(){var e=document.activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,!t.contains(e)&&t!==e||(this.previouslyActiveEl_=e,this.focus())}conditionalBlur_(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)}handleKeyDown(e){if(this.trigger({type:"modalKeydown",originalEvent:e,target:this,bubbles:!0}),e.stopPropagation(),"Escape"===e.key&&this.closeable())e.preventDefault(),this.close();else if("Tab"===e.key){var s=this.focusableEls_(),i=this.el_.querySelector(":focus");let t;for(let e=0;e<s.length;e++)if(i===s[e]){t=e;break}document.activeElement===this.el_&&(t=0),e.shiftKey&&0===t?(s[s.length-1].focus(),e.preventDefault()):e.shiftKey||t!==s.length-1||(s[0].focus(),e.preventDefault())}}focusableEls_(){var e=this.el_.querySelectorAll("*");return Array.prototype.filter.call(e,e=>(e instanceof window.HTMLAnchorElement||e instanceof window.HTMLAreaElement)&&e.hasAttribute("href")||(e instanceof window.HTMLInputElement||e instanceof window.HTMLSelectElement||e instanceof window.HTMLTextAreaElement||e instanceof window.HTMLButtonElement)&&!e.hasAttribute("disabled")||e instanceof window.HTMLIFrameElement||e instanceof window.HTMLObjectElement||e instanceof window.HTMLEmbedElement||e.hasAttribute("tabindex")&&-1!==e.getAttribute("tabindex")||e.hasAttribute("contenteditable"))}}qt.prototype.options_={pauseOnOpen:!0,temporary:!0},b.registerComponent("ModalDialog",qt);class Ut extends i{constructor(t=[]){super(),this.tracks_=[],Object.defineProperty(this,"length",{get(){return this.tracks_.length}});for(let e=0;e<t.length;e++)this.addTrack(t[e])}addTrack(e){let t=this.tracks_.length;""+t in this||Object.defineProperty(this,t,{get(){return this.tracks_[t]}}),-1===this.tracks_.indexOf(e)&&(this.tracks_.push(e),this.trigger({track:e,type:"addtrack",target:this})),e.labelchange_=()=>{this.trigger({track:e,type:"labelchange",target:this})},y(e)&&e.addEventListener("labelchange",e.labelchange_)}removeTrack(s){let i;for(let e=0,t=this.length;e<t;e++)if(this[e]===s){(i=this[e]).off&&i.off(),this.tracks_.splice(e,1);break}i&&this.trigger({track:i,type:"removetrack",target:this})}getTrackById(s){let i=null;for(let e=0,t=this.length;e<t;e++){var r=this[e];if(r.id===s){i=r;break}}return i}}for(Rt in Ut.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"})Ut.prototype["on"+Rt]=null;function Wt(t,s){for(let e=0;e<t.length;e++)Object.keys(t[e]).length&&s.id!==t[e].id&&(t[e].enabled=!1)}class $t extends Ut{constructor(t=[]){for(let e=t.length-1;0<=e;e--)if(t[e].enabled){Wt(t,t[e]);break}super(t),this.changing_=!1}addTrack(e){e.enabled&&Wt(this,e),super.addTrack(e),e.addEventListener&&(e.enabledChange_=()=>{this.changing_||(this.changing_=!0,Wt(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("enabledchange",e.enabledChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener("enabledchange",e.enabledChange_),e.enabledChange_=null)}}function Kt(t,s){for(let e=0;e<t.length;e++)Object.keys(t[e]).length&&s.id!==t[e].id&&(t[e].selected=!1)}class Gt extends Ut{constructor(t=[]){for(let e=t.length-1;0<=e;e--)if(t[e].selected){Kt(t,t[e]);break}super(t),this.changing_=!1,Object.defineProperty(this,"selectedIndex",{get(){for(let e=0;e<this.length;e++)if(this[e].selected)return e;return-1},set(){}})}addTrack(e){e.selected&&Kt(this,e),super.addTrack(e),e.addEventListener&&(e.selectedChange_=()=>{this.changing_||(this.changing_=!0,Kt(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("selectedchange",e.selectedChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.selectedChange_&&(e.removeEventListener("selectedchange",e.selectedChange_),e.selectedChange_=null)}}class Xt extends Ut{addTrack(e){super.addTrack(e),this.queueChange_||(this.queueChange_=()=>this.queueTrigger("change")),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=()=>this.trigger("selectedlanguagechange")),e.addEventListener("modechange",this.queueChange_);-1===["metadata","chapters"].indexOf(e.kind)&&e.addEventListener("modechange",this.triggerSelectedlanguagechange_)}removeTrack(e){super.removeTrack(e),e.removeEventListener&&(this.queueChange_&&e.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_)&&e.removeEventListener("modechange",this.triggerSelectedlanguagechange_)}}class Yt{constructor(e){Yt.prototype.setCues_.call(this,e),Object.defineProperty(this,"length",{get(){return this.length_}})}setCues_(e){var t=this.length||0;let s=0;function i(e){""+e in this||Object.defineProperty(this,""+e,{get(){return this.cues_[e]}})}var r=e.length;this.cues_=e,this.length_=e.length;if(t<r)for(s=t;s<r;s++)i.call(this,s)}getCueById(s){let i=null;for(let e=0,t=this.length;e<t;e++){var r=this[e];if(r.id===s){i=r;break}}return i}}let Qt={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},Jt={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},Zt={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},es={disabled:"disabled",hidden:"hidden",showing:"showing"};class ts extends i{constructor(e={}){super();let t={id:e.id||"vjs_track_"+m++,kind:e.kind||"",language:e.language||""},s=e.label||"";for(let e in t)Object.defineProperty(this,e,{get(){return t[e]},set(){}});Object.defineProperty(this,"label",{get(){return s},set(e){e!==s&&(s=e,this.trigger("labelchange"))}})}}function ss(e){return new URL(e,document.baseURI)}function is(e){return new URL(e,document.baseURI).href}function rs(e,t=window.location){return ss(e).origin!==t.origin}let ns=function(e){if("string"==typeof e){e=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/.exec(e);if(e)return e.pop().toLowerCase()}return""},as=Object.freeze({__proto__:null,parseUrl:ss,getAbsoluteURL:is,getFileExtension:ns,isCrossOrigin:rs}),os="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var ls,hs="undefined"!=typeof window?window:"undefined"!=typeof os?os:"undefined"!=typeof self?self:{},cs=(function(e){function t(){return e.exports=t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s,i=arguments[t];for(s in i)!{}.hasOwnProperty.call(i,s)||(e[s]=i[s])}return e},e.exports.__esModule=!0,e.exports.default=e.exports,t.apply(null,arguments)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(ls={exports:{}}),ls.exports),ds=((e=cs)&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")&&e.default,function(e){var t;return!!e&&("[object Function]"===(t=us.call(e))||"function"==typeof e&&"[object RegExp]"!==t||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt))}),us=Object.prototype.toString;function ps(e,t){var s,i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(i)return(i=i.call(e)).next.bind(i);if(Array.isArray(e)||(i=function(e,t){var s;if(e)return"string"==typeof e?gs(e,t):"Map"===(s="Object"===(s=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:s)||"Set"===s?Array.from(e):"Arguments"===s||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s)?gs(e,t):void 0}(e))||t&&e&&"number"==typeof e.length)return i&&(e=i),s=0,function(){return s>=e.length?{done:!0}:{done:!1,value:e[s++]}};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function gs(e,t){(null==t||t>e.length)&&(t=e.length);for(var s=0,i=new Array(t);s<t;s++)i[s]=e[s];return i}var e=function(){function e(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1}var t=e.prototype;return t.getIsEnabled=function(){return this.enabled_},t.enable=function(){this.enabled_=!0},t.disable=function(){this.enabled_=!1},t.reset=function(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1},t.addInterceptor=function(e,t){this.typeToInterceptorsMap_.has(e)||this.typeToInterceptorsMap_.set(e,new Set);e=this.typeToInterceptorsMap_.get(e);return!e.has(t)&&(e.add(t),!0)},t.removeInterceptor=function(e,t){e=this.typeToInterceptorsMap_.get(e);return!(!e||!e.has(t)||(e.delete(t),0))},t.clearInterceptorsByType=function(e){return!!this.typeToInterceptorsMap_.get(e)&&(this.typeToInterceptorsMap_.delete(e),this.typeToInterceptorsMap_.set(e,new Set),!0)},t.clear=function(){return!!this.typeToInterceptorsMap_.size&&(this.typeToInterceptorsMap_=new Map,!0)},t.getForType=function(e){return this.typeToInterceptorsMap_.get(e)||new Set},t.execute=function(e,t){for(var s=ps(this.getForType(e));!(i=s()).done;){var i=i.value;try{t=i(t)}catch(e){}}return t},e}(),w=function(){function e(){this.maxAttempts_=1,this.delayFactor_=.1,this.fuzzFactor_=.1,this.initialDelay_=1e3,this.enabled_=!1}var t=e.prototype;return t.getIsEnabled=function(){return this.enabled_},t.enable=function(){this.enabled_=!0},t.disable=function(){this.enabled_=!1},t.reset=function(){this.maxAttempts_=1,this.delayFactor_=.1,this.fuzzFactor_=.1,this.initialDelay_=1e3,this.enabled_=!1},t.getMaxAttempts=function(){return this.maxAttempts_},t.setMaxAttempts=function(e){this.maxAttempts_=e},t.getDelayFactor=function(){return this.delayFactor_},t.setDelayFactor=function(e){this.delayFactor_=e},t.getFuzzFactor=function(){return this.fuzzFactor_},t.setFuzzFactor=function(e){this.fuzzFactor_=e},t.getInitialDelay=function(){return this.initialDelay_},t.setInitialDelay=function(e){this.initialDelay_=e},t.createRetry=function(e){var e=void 0===e?{}:e,t=e.maxAttempts;return new ms({maxAttempts:t||this.maxAttempts_,delayFactor:e.delayFactor||this.delayFactor_,fuzzFactor:e.fuzzFactor||this.fuzzFactor_,initialDelay:e.initialDelay||this.initialDelay_})},e}(),ms=function(){function e(e){this.maxAttempts_=e.maxAttempts,this.delayFactor_=e.delayFactor,this.fuzzFactor_=e.fuzzFactor,this.currentDelay_=e.initialDelay,this.currentAttempt_=1}var t=e.prototype;return t.moveToNextAttempt=function(){this.currentAttempt_++;var e=this.currentDelay_*this.delayFactor_;this.currentDelay_=this.currentDelay_+e},t.shouldRetry=function(){return this.currentAttempt_<this.maxAttempts_},t.getCurrentDelay=function(){return this.currentDelay_},t.getCurrentMinPossibleDelay=function(){return(1-this.fuzzFactor_)*this.currentDelay_},t.getCurrentMaxPossibleDelay=function(){return(1+this.fuzzFactor_)*this.currentDelay_},t.getCurrentFuzzedDelay=function(){var e=this.getCurrentMinPossibleDelay(),t=this.getCurrentMaxPossibleDelay();return e+Math.random()*(t-e)},e}();S.httpHandler=function(i,r){return void 0===r&&(r=!1),function(e,t,s){if(e)i(e);else if(400<=t.statusCode&&t.statusCode<=599){e=s;if(r)if(hs.TextDecoder){t=function(e){void 0===e&&(e="");return e.toLowerCase().split(";").reduce(function(e,t){var t=t.split("="),s=t[0],t=t[1];return"charset"===s.trim()?t.trim():e},"utf-8")}(t.headers&&t.headers["content-type"]);try{e=new TextDecoder(t).decode(s)}catch(e){}}else e=String.fromCharCode.apply(null,new Uint8Array(s));i({cause:e})}else i(null,s)}},S.requestInterceptorsStorage=new e,S.responseInterceptorsStorage=new e,S.retryManager=new w;for(var _s=function(e){var i={};return e&&e.trim().split("\n").forEach(function(e){var t=e.indexOf(":"),s=e.slice(0,t).trim().toLowerCase(),e=e.slice(t+1).trim();"undefined"==typeof i[s]?i[s]=e:Array.isArray(i[s])?i[s].push(e):i[s]=[i[s],e]}),i},vs=S,e=S,ys=(S.XMLHttpRequest=hs.XMLHttpRequest||function(){},S.XDomainRequest="withCredentials"in new S.XMLHttpRequest?S.XMLHttpRequest:hs.XDomainRequest,["get","put","post","patch","head","delete"]),fs=function(i){S["delete"===i?"del":i]=function(e,t,s){return(t=Ts(e,t,s)).method=i.toUpperCase(),Cs(t)}},bs=0;bs<ys.length;bs++)fs(ys[bs]);function Ts(e,t,s){var i=e;return ds(t)?(s=t,"string"==typeof e&&(i={uri:e})):i=cs({},t,{uri:e}),i.callback=s,i}function S(e,t,s){return Cs(t=Ts(e,t,s))}function Cs(i){if("undefined"==typeof i.callback)throw new Error("callback argument missing");i.requestType&&S.requestIntercept