iBet uBet web content aggregator. Adding the entire web to your favor.
iBet uBet web content aggregator. Adding the entire web to your favor.



Link to original content: http://www.superyachts.com/_nuxt/13154b3.js
/*! For license information please see LICENSES */ (window.webpackJsonp=window.webpackJsonp||[]).push([[0],{1523:function(e,t,n){"use strict";n.r(t),function(e){for(var r,o=n(1976),l=n.n(o),c=n(2352),d=n.n(c),h=n(852),f=n.n(h),m=n(2783),v=n.n(m),y=n(2520),_=n.n(y),T=n(2521),S=n.n(T),E=n(2784),k=n.n(E),C=n(2785),w=n.n(C),I=n(2788),x=n.n(I),A=n(2792),P=n.n(A),O=n(2794),L=n.n(O),D=n(2522),M=n(2987),R=n(2796),N=n(2797),U=n(2111),B=n(2988),j=n(2802),F=n.n(j),H=n(2525),V=n(2983),W=n(2804),z="7.19.2",G={},X=function(e,t){return G[e]=G[e]||[],t&&(G[e]=G[e].concat(t)),G[e]},K=function(e,t){var n=X(e).indexOf(t);return!(n<=-1)&&(G[e]=G[e].slice(),G[e].splice(n,1),!0)},Y={prefixed:!0},Q=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror","-moz-full-screen"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError","-ms-fullscreen"]],$=Q[0],i=0;i0?h:0)}if(l.a.console){var f=l.a.console[n];f||"debug"!==n||(f=l.a.console.info||l.a.console.log),f&&c&&d.test(n)&&f[Array.isArray(o)?"apply":"call"](l.a.console,o)}}}(t,o),o.createLogger=function(n){return e(t+": "+n)},o.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:r},o.level=function(e){if("string"==typeof e){if(!o.levels.hasOwnProperty(e))throw new Error('"'+e+'" in not a valid log level');r=e}return r},(o.history=function(){return Z?[].concat(Z):[]}).filter=function(e){return(Z||[]).filter((function(t){return new RegExp(".*"+e+".*").test(t[0])}))},o.history.clear=function(){Z&&(Z.length=0)},o.history.disable=function(){null!==Z&&(Z.length=0,Z=null)},o.history.enable=function(){null===Z&&(Z=[])},o.error=function(){for(var e=arguments.length,t=new Array(e),o=0;o1?t-1:0),r=1;r=0)throw new Error("class has illegal whitespace characters")}function De(){return d.a===l.a.document}function Me(e){return se(e)&&1===e.nodeType}function Re(){try{return l.a.parent!==l.a.self}catch(e){return!0}}function Ne(e){return function(t,n){if(!Oe(t))return d.a[e](null);Oe(n)&&(n=d.a.querySelector(n));var r=Me(n)?n:d.a;return r[e]&&r[e](t)}}function Ue(e,t,n,content){void 0===e&&(e="div"),void 0===t&&(t={}),void 0===n&&(n={});var r=d.a.createElement(e);return Object.getOwnPropertyNames(t).forEach((function(e){var n=t[e];-1!==e.indexOf("aria-")||"role"===e||"type"===e?(ee.warn("Setting attributes in the second argument of createEl()\nhas been deprecated. Use the third argument instead.\ncreateEl(type, properties, attributes). Attempting to set "+e+" to "+n+"."),r.setAttribute(e,n)):"textContent"===e?Be(r,n):r[e]===n&&"tabIndex"!==e||(r[e]=n)})),Object.getOwnPropertyNames(n).forEach((function(e){r.setAttribute(e,n[e])})),content&&nt(r,content),r}function Be(e,text){return void 0===e.textContent?e.innerText=text:e.textContent=text,e}function je(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}function Fe(element,e){return Le(e),element.classList?element.classList.contains(e):(t=e,new RegExp("(^|\\s)"+t+"($|\\s)")).test(element.className);var t}function He(element,e){return element.classList?element.classList.add(e):Fe(element,e)||(element.className=(element.className+" "+e).trim()),element}function qe(element,e){return element?(element.classList?element.classList.remove(e):(Le(e),element.className=element.className.split(/\s+/).filter((function(t){return t!==e})).join(" ")),element):(ee.warn("removeClass was called with an element that doesn't exist"),null)}function Ve(element,e,t){var n=Fe(element,e);if("function"==typeof t&&(t=t(element,e)),"boolean"!=typeof t&&(t=!n),t!==n)return t?He(element,e):qe(element,e),element}function We(e,t){Object.getOwnPropertyNames(t).forEach((function(n){var r=t[n];null==r||!1===r?e.removeAttribute(n):e.setAttribute(n,!0===r?"":r)}))}function ze(e){var t={},n=",autoplay,controls,playsinline,loop,muted,default,defaultMuted,";if(e&&e.attributes&&e.attributes.length>0)for(var r=e.attributes,i=r.length-1;i>=0;i--){var o=r[i].name,l=r[i].value;"boolean"!=typeof e[o]&&-1===n.indexOf(","+o+",")||(l=null!==l),t[o]=l}return t}function Ge(e,t){return e.getAttribute(t)}function Xe(e,t,n){e.setAttribute(t,n)}function Ke(e,t){e.removeAttribute(t)}function Ye(){d.a.body.focus(),d.a.onselectstart=function(){return!1}}function Qe(){d.a.onselectstart=function(){return!0}}function $e(e){if(e&&e.getBoundingClientRect&&e.parentNode){var rect=e.getBoundingClientRect(),t={};return["bottom","height","left","right","top","width"].forEach((function(e){void 0!==rect[e]&&(t[e]=rect[e])})),t.height||(t.height=parseFloat(ue(e,"height"))),t.width||(t.width=parseFloat(ue(e,"width"))),t}}function Je(e){if(!e||e&&!e.offsetParent)return{left:0,top:0,width:0,height:0};for(var t=e.offsetWidth,n=e.offsetHeight,r=0,o=0;e.offsetParent&&e!==d.a[Y.fullscreenElement];)r+=e.offsetLeft,o+=e.offsetTop,e=e.offsetParent;return{left:r,top:o,width:t,height:n}}function Ze(e,t){var n={x:0,y:0};if(xe)for(var r=e;r&&"html"!==r.nodeName.toLowerCase();){var o=ue(r,"transform");if(/^matrix/.test(o)){var l=o.slice(7,-1).split(/,\s/).map(Number);n.x+=l[4],n.y+=l[5]}else if(/^matrix3d/.test(o)){var c=o.slice(9,-1).split(/,\s/).map(Number);n.x+=c[12],n.y+=c[13]}r=r.parentNode}var d={},h=Je(t.target),f=Je(e),m=f.width,v=f.height,y=t.offsetY-(f.top-h.top),_=t.offsetX-(f.left-h.left);return t.changedTouches&&(_=t.changedTouches[0].pageX-f.left,y=t.changedTouches[0].pageY+f.top,xe&&(_-=n.x,y-=n.y)),d.y=1-Math.max(0,Math.min(1,y/v)),d.x=Math.max(0,Math.min(1,_/m)),d}function et(e){return se(e)&&3===e.nodeType}function tt(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function it(content){return"function"==typeof content&&(content=content()),(Array.isArray(content)?content:[content]).map((function(e){return"function"==typeof e&&(e=e()),Me(e)||et(e)?e:"string"==typeof e&&/\S/.test(e)?d.a.createTextNode(e):void 0})).filter((function(e){return e}))}function nt(e,content){return it(content).forEach((function(t){return e.appendChild(t)})),e}function at(e,content){return nt(tt(e),content)}function st(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||0===e.button&&1===e.buttons))}var ot,ut=Ne("querySelector"),lt=Ne("querySelectorAll"),ct=Object.freeze({__proto__:null,isReal:De,isEl:Me,isInFrame:Re,createEl:Ue,textContent:Be,prependTo:je,hasClass:Fe,addClass:He,removeClass:qe,toggleClass:Ve,setAttributes:We,getAttributes:ze,getAttribute:Ge,setAttribute:Xe,removeAttribute:Ke,blockTextSelection:Ye,unblockTextSelection:Qe,getBoundingClientRect:$e,findPosition:Je,getPointerPosition:Ze,isTextNode:et,emptyEl:tt,normalizeContent:it,appendContent:nt,insertContent:at,isSingleLeftClick:st,$:ut,$$:lt}),ht=!1,pt=function(){if(!1!==ot.options.autoSetup){var e=Array.prototype.slice.call(d.a.getElementsByTagName("video")),t=Array.prototype.slice.call(d.a.getElementsByTagName("audio")),n=Array.prototype.slice.call(d.a.getElementsByTagName("video-js")),r=e.concat(t,n);if(r&&r.length>0)for(var i=0,o=r.length;i-1&&(r={passive:!0}),e.addEventListener(t,data.dispatcher,r)}else e.attachEvent&&e.attachEvent("on"+t,data.dispatcher)}function xt(e,t,n){if(St.has(e)){var data=St.get(e);if(data.handlers){if(Array.isArray(t))return kt(xt,e,t,n);var r=function(e,t){data.handlers[t]=[],Et(e,t)};if(void 0!==t){var o=data.handlers[t];if(o)if(n){if(n.guid)for(var l=0;l=t&&(e.apply(void 0,arguments),n=r)}},Ut=function(){};Ut.prototype.allowedEvents_={},Ut.prototype.on=function(e,t){var n=this.addEventListener;this.addEventListener=function(){},It(this,e,t),this.addEventListener=n},Ut.prototype.addEventListener=Ut.prototype.on,Ut.prototype.off=function(e,t){xt(this,e,t)},Ut.prototype.removeEventListener=Ut.prototype.off,Ut.prototype.one=function(e,t){var n=this.addEventListener;this.addEventListener=function(){},Pt(this,e,t),this.addEventListener=n},Ut.prototype.any=function(e,t){var n=this.addEventListener;this.addEventListener=function(){},Ot(this,e,t),this.addEventListener=n},Ut.prototype.trigger=function(e){var t=e.type||e;"string"==typeof e&&(e={type:t}),e=Ct(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),At(this,e)},Ut.prototype.dispatchEvent=Ut.prototype.trigger,Ut.prototype.queueTrigger=function(e){var t=this;Lt||(Lt=new Map);var n=e.type||e,map=Lt.get(this);map||(map=new Map,Lt.set(this,map));var r=map.get(n);map.delete(n),l.a.clearTimeout(r);var o=l.a.setTimeout((function(){0===map.size&&(map=null,Lt.delete(t)),t.trigger(e)}),0);map.set(n,o)};var Bt=function(e){return"function"==typeof e.name?e.name():"string"==typeof e.name?e.name:e.name_?e.name_:e.constructor&&e.constructor.name?e.constructor.name:typeof e},jt=function(object){return object instanceof Ut||!!object.eventBusEl_&&["on","one","off","trigger"].every((function(e){return"function"==typeof object[e]}))},Ft=function(e){return"string"==typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length},Ht=function(e,t,n){if(!e||!e.nodeName&&!jt(e))throw new Error("Invalid target for "+Bt(t)+"#"+n+"; must be a DOM node or evented object.")},qt=function(e,t,n){if(!Ft(e))throw new Error("Invalid event type for "+Bt(t)+"#"+n+"; must be a non-empty string or array.")},Vt=function(e,t,n){if("function"!=typeof e)throw new Error("Invalid listener for "+Bt(t)+"#"+n+"; must be a function.")},Wt=function(e,t,n){var r,o,l,c=t.length<3||t[0]===e||t[0]===e.eventBusEl_;return c?(r=e.eventBusEl_,t.length>=3&&t.shift(),o=t[0],l=t[1]):(r=t[0],o=t[1],l=t[2]),Ht(r,e,n),qt(o,e,n),Vt(l,e,n),{isTargetingSelf:c,target:r,type:o,listener:l=Rt(e,l)}},zt=function(e,t,n,r){Ht(e,e,t),e.nodeName?Dt[t](e,n,r):e[t](n,r)},Gt={on:function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r=0;i--)this.children_[i].dispose&&this.children_[i].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&this.el_.parentNode.removeChild(this.el_),this.el_=null),this.player_=null}},t.isDisposed=function(){return Boolean(this.isDisposed_)},t.player=function(){return this.player_},t.options=function(e){return e?(this.options_=Jt(this.options_,e),this.options_):this.options_},t.el=function(){return this.el_},t.createEl=function(e,t,n){return Ue(e,t,n)},t.localize=function(e,t,n){void 0===n&&(n=e);var code=this.player_.language&&this.player_.language(),r=this.player_.languages&&this.player_.languages(),o=r&&r[code],l=code&&code.split("-")[0],c=r&&r[l],d=n;return o&&o[e]?d=o[e]:c&&c[e]&&(d=c[e]),t&&(d=d.replace(/\{(\d+)\}/g,(function(e,n){var r=t[n-1],o=r;return void 0===r&&(o=e),o}))),d},t.handleLanguagechange=function(){},t.contentEl=function(){return this.contentEl_||this.el_},t.id=function(){return this.id_},t.name=function(){return this.name_},t.children=function(){return this.children_},t.getChildById=function(e){return this.childIndex_[e]},t.getChild=function(e){if(e)return this.childNameIndex_[e]},t.getDescendant=function(){for(var e=arguments.length,t=new Array(e),n=0;n=0;i--)if(this.children_[i]===component){e=!0,this.children_.splice(i,1);break}if(e){component.parentComponent_=null,this.childIndex_[component.id()]=null,this.childNameIndex_[$t(component.name())]=null,this.childNameIndex_[Qt(component.name())]=null;var t=component.el();t&&t.parentNode===this.contentEl()&&this.contentEl().removeChild(component.el())}}},t.initChildren=function(){var t=this,n=this.options_.children;if(n){var r,o=this.options_,l=e.getComponent("Tech");(r=Array.isArray(n)?n:Object.keys(n)).concat(Object.keys(this.options_).filter((function(e){return!r.some((function(t){return"string"==typeof t?e===t:e===t.name}))}))).map((function(e){var r,o;return"string"==typeof e?o=n[r=e]||t.options_[r]||{}:(r=e.name,o=e),{name:r,opts:o}})).filter((function(t){var n=e.getComponent(t.opts.componentClass||$t(t.name));return n&&!l.isTech(n)})).forEach((function(e){var n=e.name,r=e.opts;if(void 0!==o[n]&&(r=o[n]),!1!==r){!0===r&&(r={}),r.playerOptions=t.options_.playerOptions;var l=t.addChild(n,r);l&&(t[n]=l)}}))}},t.buildCSSClass=function(){return""},t.ready=function(e,t){if(void 0===t&&(t=!1),e)return this.isReady_?void(t?e.call(this):this.setTimeout(e,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(e))},t.triggerReady=function(){this.isReady_=!0,this.setTimeout((function(){var e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach((function(e){e.call(this)}),this),this.trigger("ready")}),1)},t.$=function(e,t){return ut(e,t||this.contentEl())},t.$$=function(e,t){return lt(e,t||this.contentEl())},t.hasClass=function(e){return Fe(this.el_,e)},t.addClass=function(e){He(this.el_,e)},t.removeClass=function(e){qe(this.el_,e)},t.toggleClass=function(e,t){Ve(this.el_,e,t)},t.show=function(){this.removeClass("vjs-hidden")},t.hide=function(){this.addClass("vjs-hidden")},t.lockShowing=function(){this.addClass("vjs-lock-showing")},t.unlockShowing=function(){this.removeClass("vjs-lock-showing")},t.getAttribute=function(e){return Ge(this.el_,e)},t.setAttribute=function(e,t){Xe(this.el_,e,t)},t.removeAttribute=function(e){Ke(this.el_,e)},t.width=function(e,t){return this.dimension("width",e,t)},t.height=function(e,t){return this.dimension("height",e,t)},t.dimensions=function(e,t){this.width(e,!0),this.height(t)},t.dimension=function(e,t,n){if(void 0!==t)return null!==t&&t==t||(t=0),-1!==(""+t).indexOf("%")||-1!==(""+t).indexOf("px")?this.el_.style[e]=t:this.el_.style[e]="auto"===t?"":t+"px",void(n||this.trigger("componentresize"));if(!this.el_)return 0;var r=this.el_.style[e],o=r.indexOf("px");return-1!==o?parseInt(r.slice(0,o),10):parseInt(this.el_["offset"+$t(e)],10)},t.currentDimension=function(e){var t=0;if("width"!==e&&"height"!==e)throw new Error("currentDimension only accepts width or height value");if(t=ue(this.el_,e),0===(t=parseFloat(t))||isNaN(t)){var n="offset"+$t(e);t=this.el_[n]}return t},t.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}},t.currentWidth=function(){return this.currentDimension("width")},t.currentHeight=function(){return this.currentDimension("height")},t.focus=function(){this.el_.focus()},t.blur=function(){this.el_.blur()},t.handleKeyDown=function(e){this.player_&&(v.a.isEventKey(e,"Tab")||e.stopPropagation(),this.player_.handleKeyDown(e))},t.handleKeyPress=function(e){this.handleKeyDown(e)},t.emitTapEvents=function(){var e,t=0,n=null;this.on("touchstart",(function(r){1===r.touches.length&&(n={pageX:r.touches[0].pageX,pageY:r.touches[0].pageY},t=l.a.performance.now(),e=!0)})),this.on("touchmove",(function(t){if(t.touches.length>1)e=!1;else if(n){var r=t.touches[0].pageX-n.pageX,o=t.touches[0].pageY-n.pageY;Math.sqrt(r*r+o*o)>10&&(e=!1)}}));var r=function(){e=!1};this.on("touchleave",r),this.on("touchcancel",r),this.on("touchend",(function(r){(n=null,!0===e)&&(l.a.performance.now()-t<200&&(r.preventDefault(),this.trigger("tap")))}))},t.enableTouchActivity=function(){if(this.player()&&this.player().reportUserActivity){var e,t=Rt(this.player(),this.player().reportUserActivity);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.setTimeout=function(e,t){var n,r=this;return e=Rt(this,e),this.clearTimersOnDispose_(),n=l.a.setTimeout((function(){r.setTimeoutIds_.has(n)&&r.setTimeoutIds_.delete(n),e()}),t),this.setTimeoutIds_.add(n),n},t.clearTimeout=function(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),l.a.clearTimeout(e)),e},t.setInterval=function(e,t){e=Rt(this,e),this.clearTimersOnDispose_();var n=l.a.setInterval(e,t);return this.setIntervalIds_.add(n),n},t.clearInterval=function(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),l.a.clearInterval(e)),e},t.requestAnimationFrame=function(e){var t,n=this;return this.supportsRaf_?(this.clearTimersOnDispose_(),e=Rt(this,e),t=l.a.requestAnimationFrame((function(){n.rafIds_.has(t)&&n.rafIds_.delete(t),e()})),this.rafIds_.add(t),t):this.setTimeout(e,1e3/60)},t.requestNamedAnimationFrame=function(e,t){var n=this;if(!this.namedRafs_.has(e)){this.clearTimersOnDispose_(),t=Rt(this,t);var r=this.requestAnimationFrame((function(){t(),n.namedRafs_.has(e)&&n.namedRafs_.delete(e)}));return this.namedRafs_.set(e,r),e}},t.cancelNamedAnimationFrame=function(e){this.namedRafs_.has(e)&&(this.cancelAnimationFrame(this.namedRafs_.get(e)),this.namedRafs_.delete(e))},t.cancelAnimationFrame=function(e){return this.supportsRaf_?(this.rafIds_.has(e)&&(this.rafIds_.delete(e),l.a.cancelAnimationFrame(e)),e):this.clearTimeout(e)},t.clearTimersOnDispose_=function(){var e=this;this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",(function(){[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach((function(t){var n=t[0],r=t[1];e[n].forEach((function(t,n){return e[r](n)}))})),e.clearingTimersOnDispose_=!1})))},e.registerComponent=function(t,n){if("string"!=typeof t||!t)throw new Error('Illegal component name, "'+t+'"; must be a non-empty string.');var r,o=e.getComponent("Tech"),l=o&&o.isTech(n),c=e===n||e.prototype.isPrototypeOf(n.prototype);if(l||!c)throw r=l?"techs must be registered using Tech.registerTech()":"must be a Component subclass",new Error('Illegal component, "'+t+'"; '+r+".");t=$t(t),e.components_||(e.components_={});var d=e.getComponent("Player");if("Player"===t&&d&&d.players){var h=d.players,f=Object.keys(h);if(h&&f.length>0&&f.map((function(e){return h[e]})).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return e.components_[t]=n,e.components_[Qt(t)]=n,n},e.getComponent=function(t){if(t&&e.components_)return e.components_[t]},e}();function ri(e,t,n,r){return function(e,t,n){if("number"!=typeof t||t<0||t>n)throw new Error("Failed to execute '"+e+"' on 'TimeRanges': The index provided ("+t+") is non-numeric or out of bounds (0-"+n+").")}(e,r,n.length-1),n[r][t]}function ai(e){var t;return t=void 0===e||0===e.length?{length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}:{length:e.length,start:ri.bind(null,"start",0,e),end:ri.bind(null,"end",1,e)},l.a.Symbol&&l.a.Symbol.iterator&&(t[l.a.Symbol.iterator]=function(){return(e||[]).values()}),t}function si(e,t){return Array.isArray(e)?ai(e):void 0===e||void 0===t?ai():ai([[e,t]])}function oi(e,t){var n,r,o=0;if(!t)return 0;e&&e.length||(e=si(0,0));for(var i=0;it&&(r=t),o+=r-n;return o/t}function ui(e){if(e instanceof ui)return e;"number"==typeof e?this.code=e:"string"==typeof e?this.message=e:se(e)&&("number"==typeof e.code&&(this.code=e.code),ae(this,e)),this.message||(this.message=ui.defaultMessages[this.code]||"")}ni.prototype.supportsRaf_="function"==typeof l.a.requestAnimationFrame&&"function"==typeof l.a.cancelAnimationFrame,ni.registerComponent("Component",ni),ui.prototype.code=0,ui.prototype.message="",ui.prototype.status=null,ui.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],ui.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 ci=0;ci=0;i--)if(t[i].enabled){_i(t,t[i]);break}return(n=e.call(this,t)||this).changing_=!1,n}S()(t,e);var n=t.prototype;return n.addTrack=function(track){var t=this;track.enabled&&_i(this,track),e.prototype.addTrack.call(this,track),track.addEventListener&&(track.enabledChange_=function(){t.changing_||(t.changing_=!0,_i(t,track),t.changing_=!1,t.trigger("change"))},track.addEventListener("enabledchange",track.enabledChange_))},n.removeTrack=function(t){e.prototype.removeTrack.call(this,t),t.removeEventListener&&t.enabledChange_&&(t.removeEventListener("enabledchange",t.enabledChange_),t.enabledChange_=null)},t}(vi),Ti=function(e,track){for(var i=0;i=0;i--)if(t[i].selected){Ti(t,t[i]);break}return(n=e.call(this,t)||this).changing_=!1,Object.defineProperty(_()(n),"selectedIndex",{get:function(){for(var e=0;e0&&(l.a.console&&l.a.console.groupCollapsed&&l.a.console.groupCollapsed("Text Track parsing errors for "+track.src),n.forEach((function(e){return ee.error(e)})),l.a.console&&l.a.console.groupEnd&&l.a.console.groupEnd()),t.flush()},Ui=function(e,track){var t={uri:e},n=Mi(e);n&&(t.cors=n);var r="use-credentials"===track.tech_.crossOrigin();r&&(t.withCredentials=r),w()(t,Rt(this,(function(e,t,n){if(e)return ee.error(e,t);track.loaded_=!0,"function"!=typeof l.a.WebVTT?track.tech_&&track.tech_.any(["vttjsloaded","vttjserror"],(function(e){if("vttjserror"!==e.type)return Ni(n,track);ee.error("vttjs failed to load, stopping trying to process "+track.src)})):Ni(n,track)})))},Bi=function(e){function t(t){var n;if(void 0===t&&(t={}),!t.tech)throw new Error("A tech was not provided.");var r=Jt(t,{kind:xi[t.kind]||"subtitles",language:t.language||t.srclang||""}),o=Ai[r.mode]||"disabled",l=r.default;"metadata"!==r.kind&&"chapters"!==r.kind||(o="hidden"),(n=e.call(this,r)||this).tech_=r.tech,n.cues_=[],n.activeCues_=[],n.preload_=!1!==n.tech_.preloadTextTracks;var c=new Ci(n.cues_),d=new Ci(n.activeCues_),h=!1;n.timeupdateHandler=Rt(_()(n),(function(){this.tech_.isDisposed()||(this.tech_.isReady_?(this.activeCues=this.activeCues,h&&(this.trigger("cuechange"),h=!1),this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler)):this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))}));return n.tech_.one("dispose",(function(){n.stopTracking()})),"disabled"!==o&&n.startTracking(),Object.defineProperties(_()(n),{default:{get:function(){return l},set:function(){}},mode:{get:function(){return o},set:function(e){Ai[e]&&o!==e&&(o=e,this.preload_||"disabled"===o||0!==this.cues.length||Ui(this.src,this),this.stopTracking(),"disabled"!==o&&this.startTracking(),this.trigger("modechange"))}},cues:{get:function(){return this.loaded_?c:null},set:function(){}},activeCues:{get:function(){if(!this.loaded_)return null;if(0===this.cues.length)return d;for(var e=this.tech_.currentTime(),t=[],i=0,n=this.cues.length;i=e||r.startTime===r.endTime&&r.startTime<=e&&r.startTime+.5>=e)&&t.push(r)}if(h=!1,t.length!==this.activeCues_.length)h=!0;else for(var o=0;o0)return void this.trigger("vttjsloaded");var script=d.a.createElement("script");script.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",script.onload=function(){e.trigger("vttjsloaded")},script.onerror=function(){e.trigger("vttjserror")},this.on("dispose",(function(){script.onload=null,script.onerror=null})),l.a.WebVTT=!0,this.el().parentNode.appendChild(script)}else this.ready(this.addWebVttScript_)},n.emulateTextTracks=function(){var e=this,t=this.textTracks(),n=this.remoteTextTracks(),r=function(e){return t.addTrack(e.track)},o=function(e){return t.removeTrack(e.track)};n.on("addtrack",r),n.on("removetrack",o),this.addWebVttScript_();var l=function(){return e.trigger("texttrackchange")},c=function(){l();for(var i=0;i=0;i--){var o=e[i];o[t]&&o[t](r,n)}}(e,n,d,c),d}var $i={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},Ji={setCurrentTime:1,setMuted:1,setVolume:1},Zi={play:1,pause:1};function en(e){return function(t,n){return t===Ki?Ki:n[e]?n[e](t):t}}function tn(e,t,n,r,o,l){void 0===e&&(e={}),void 0===t&&(t=[]),void 0===o&&(o=[]),void 0===l&&(l=!1);var c=t,d=c[0],h=c.slice(1);if("string"==typeof d)tn(e,Gi[d],n,r,o,l);else if(d){var f=function(e,t){var n=Xi[e.id()],r=null;if(null==n)return r=t(e),Xi[e.id()]=[[t,r]],r;for(var i=0;i0;!this.player_.tech(!0)||(Se||_e)&&t||this.player_.tech(!0).focus(),this.player_.paused()?hi(this.player_.play()):this.player_.pause()}},t}(un);ni.registerComponent("PosterImage",ln);var cn={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 dn(e,t){var n;if(4===e.length)n=e[1]+e[1]+e[2]+e[2]+e[3]+e[3];else{if(7!==e.length)throw new Error("Invalid color code provided, "+e+"; must be formatted as e.g. #f0e or #f604e2.");n=e.slice(1)}return"rgba("+parseInt(n.slice(0,2),16)+","+parseInt(n.slice(2,4),16)+","+parseInt(n.slice(4,6),16)+","+t+")"}function hn(e,style,t){try{e.style[style]=t}catch(e){return}}var pn=function(e){function t(t,n,r){var o;o=e.call(this,t,n,r)||this;var c=function(e){return o.updateDisplay(e)};return t.on("loadstart",(function(e){return o.toggleDisplay(e)})),t.on("texttrackchange",c),t.on("loadedmetadata",(function(e){return o.preselectTrack(e)})),t.ready(Rt(_()(o),(function(){if(t.tech_&&t.tech_.featuresNativeTextTracks)this.hide();else{t.on("fullscreenchange",c),t.on("playerresize",c),l.a.addEventListener("orientationchange",c),t.on("dispose",(function(){return l.a.removeEventListener("orientationchange",c)}));for(var e=this.options_.playerOptions.tracks||[],i=0;i0;return hi(t),void(!this.player_.tech(!0)||(Se||_e)&&n||this.player_.tech(!0).focus())}var r=this.player_.getChild("controlBar"),o=r&&r.getChild("playToggle");if(o){var l=function(){return o.focus()};di(t)?t.then(l,(function(){})):this.setTimeout(l,1)}else this.player_.tech(!0).focus()},n.handleKeyDown=function(t){this.mouseused_=!1,e.prototype.handleKeyDown.call(this,t)},n.handleMouseDown=function(e){this.mouseused_=!0},t}(mn);gn.prototype.controlText_="Play Video",ni.registerComponent("BigPlayButton",gn);var vn=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).controlText(n&&n.controlText||r.localize("Close")),r}S()(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-close-button "+e.prototype.buildCSSClass.call(this)},n.handleClick=function(e){this.trigger({type:"close",bubbles:!1})},n.handleKeyDown=function(t){v.a.isEventKey(t,"Esc")?(t.preventDefault(),t.stopPropagation(),this.trigger("click")):e.prototype.handleKeyDown.call(this,t)},t}(mn);ni.registerComponent("CloseButton",vn);var yn=function(e){function t(t,n){var r;return void 0===n&&(n={}),r=e.call(this,t,n)||this,n.replay=void 0===n.replay||n.replay,r.on(t,"play",(function(e){return r.handlePlay(e)})),r.on(t,"pause",(function(e){return r.handlePause(e)})),n.replay&&r.on(t,"ended",(function(e){return r.handleEnded(e)})),r}S()(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-play-control "+e.prototype.buildCSSClass.call(this)},n.handleClick=function(e){this.player_.paused()?hi(this.player_.play()):this.player_.pause()},n.handleSeeked=function(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)},n.handlePlay=function(e){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.controlText("Pause")},n.handlePause=function(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("Play")},n.handleEnded=function(e){var t=this;this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.controlText("Replay"),this.one(this.player_,"seeked",(function(e){return t.handleSeeked(e)}))},t}(mn);yn.prototype.controlText_="Play",ni.registerComponent("PlayToggle",yn);var _n=function(e,t){e=e<0?0:e;var s=Math.floor(e%60),n=Math.floor(e/60%60),r=Math.floor(e/3600),o=Math.floor(t/60%60),l=Math.floor(t/3600);return(isNaN(e)||e===1/0)&&(r=n=s="-"),(r=r>0||l>0?r+":":"")+(n=((r||o>=10)&&n<10?"0"+n:n)+":")+(s=s<10?"0"+s:s)},bn=_n;function Tn(e,t){return void 0===t&&(t=e),bn(e,t)}var Sn=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).on(t,["timeupdate","ended"],(function(e){return r.updateContent(e)})),r.updateTextNode_(),r}S()(t,e);var n=t.prototype;return n.createEl=function(){var t=this.buildCSSClass(),n=e.prototype.createEl.call(this,"div",{className:t+" vjs-time-control vjs-control"}),span=Ue("span",{className:"vjs-control-text",textContent:this.localize(this.labelText_)+" "},{role:"presentation"});return n.appendChild(span),this.contentEl_=Ue("span",{className:t+"-display"},{"aria-live":"off",role:"presentation"}),n.appendChild(this.contentEl_),n},n.dispose=function(){this.contentEl_=null,this.textNode_=null,e.prototype.dispose.call(this)},n.updateTextNode_=function(time){var e=this;void 0===time&&(time=0),time=Tn(time),this.formattedTime_!==time&&(this.formattedTime_=time,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",(function(){if(e.contentEl_){var t=e.textNode_;t&&e.contentEl_.firstChild!==t&&(t=null,ee.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),e.textNode_=d.a.createTextNode(e.formattedTime_),e.textNode_&&(t?e.contentEl_.replaceChild(e.textNode_,t):e.contentEl_.appendChild(e.textNode_))}})))},n.updateContent=function(e){},t}(ni);Sn.prototype.labelText_="Time",Sn.prototype.controlText_="Time",ni.registerComponent("TimeDisplay",Sn);var En=function(e){function t(){return e.apply(this,arguments)||this}S()(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-current-time"},n.updateContent=function(e){var time;time=this.player_.ended()?this.player_.duration():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(time)},t}(Sn);En.prototype.labelText_="Current Time",En.prototype.controlText_="Current Time",ni.registerComponent("CurrentTimeDisplay",En);var kn=function(e){function t(t,n){var r,o=function(e){return r.updateContent(e)};return(r=e.call(this,t,n)||this).on(t,"durationchange",o),r.on(t,"loadstart",o),r.on(t,"loadedmetadata",o),r}S()(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-duration"},n.updateContent=function(e){var t=this.player_.duration();this.updateTextNode_(t)},t}(Sn);kn.prototype.labelText_="Duration",kn.prototype.controlText_="Duration",ni.registerComponent("DurationDisplay",kn);var Cn=function(e){function t(){return e.apply(this,arguments)||this}return S()(t,e),t.prototype.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),div=e.prototype.createEl.call(this,"div"),span=e.prototype.createEl.call(this,"span",{textContent:"/"});return div.appendChild(span),t.appendChild(div),t},t}(ni);ni.registerComponent("TimeDivider",Cn);var wn=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).on(t,"durationchange",(function(e){return r.updateContent(e)})),r}S()(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-remaining-time"},n.createEl=function(){var t=e.prototype.createEl.call(this);return!1!==this.options_.displayNegative&&t.insertBefore(Ue("span",{},{"aria-hidden":!0},"-"),this.contentEl_),t},n.updateContent=function(e){var time;"number"==typeof this.player_.duration()&&(time=this.player_.ended()?0:this.player_.remainingTimeDisplay?this.player_.remainingTimeDisplay():this.player_.remainingTime(),this.updateTextNode_(time))},t}(Sn);wn.prototype.labelText_="Remaining Time",wn.prototype.controlText_="Remaining Time",ni.registerComponent("RemainingTimeDisplay",wn);var In=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).updateShowing(),r.on(r.player(),"durationchange",(function(e){return r.updateShowing(e)})),r}S()(t,e);var n=t.prototype;return n.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});return this.contentEl_=Ue("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(Ue("span",{className:"vjs-control-text",textContent:this.localize("Stream Type")+" "})),this.contentEl_.appendChild(d.a.createTextNode(this.localize("LIVE"))),t.appendChild(this.contentEl_),t},n.dispose=function(){this.contentEl_=null,e.prototype.dispose.call(this)},n.updateShowing=function(e){this.player().duration()===1/0?this.show():this.hide()},t}(ni);ni.registerComponent("LiveDisplay",In);var xn=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).updateLiveEdgeStatus(),r.player_.liveTracker&&(r.updateLiveEdgeStatusHandler_=function(e){return r.updateLiveEdgeStatus(e)},r.on(r.player_.liveTracker,"liveedgechange",r.updateLiveEdgeStatusHandler_)),r}S()(t,e);var n=t.prototype;return n.createEl=function(){var t=e.prototype.createEl.call(this,"button",{className:"vjs-seek-to-live-control vjs-control"});return this.textEl_=Ue("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),t.appendChild(this.textEl_),t},n.updateLiveEdgeStatus=function(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))},n.handleClick=function(){this.player_.liveTracker.seekToLiveEdge()},n.dispose=function(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,e.prototype.dispose.call(this)},t}(mn);xn.prototype.controlText_="Seek to live, currently playing live",ni.registerComponent("SeekToLive",xn);var An=function(e,t,n){return e=Number(e),Math.min(n,Math.max(t,isNaN(e)?t:e))},Pn=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).handleMouseDown_=function(e){return r.handleMouseDown(e)},r.handleMouseUp_=function(e){return r.handleMouseUp(e)},r.handleKeyDown_=function(e){return r.handleKeyDown(e)},r.handleClick_=function(e){return r.handleClick(e)},r.handleMouseMove_=function(e){return r.handleMouseMove(e)},r.update_=function(e){return r.update(e)},r.bar=r.getChild(r.options_.barName),r.vertical(!!r.options_.vertical),r.enable(),r}S()(t,e);var n=t.prototype;return n.enabled=function(){return this.enabled_},n.enable=function(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),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)},n.disable=function(){if(this.enabled()){var e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}},n.createEl=function(t,n,r){return void 0===n&&(n={}),void 0===r&&(r={}),n.className=n.className+" vjs-slider",n=ae({tabIndex:0},n),r=ae({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},r),e.prototype.createEl.call(this,t,n,r)},n.handleMouseDown=function(e){var t=this.bar.el_.ownerDocument;"mousedown"===e.type&&e.preventDefault(),"touchstart"!==e.type||be||e.preventDefault(),Ye(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(t,"mousemove",this.handleMouseMove_),this.on(t,"mouseup",this.handleMouseUp_),this.on(t,"touchmove",this.handleMouseMove_),this.on(t,"touchend",this.handleMouseUp_),this.handleMouseMove(e,!0)},n.handleMouseMove=function(e){},n.handleMouseUp=function(){var e=this.bar.el_.ownerDocument;Qe(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.update()},n.update=function(){var e=this;if(this.el_&&this.bar){var progress=this.getProgress();return progress===this.progress_||(this.progress_=progress,this.requestNamedAnimationFrame("Slider#update",(function(){var t=e.vertical()?"height":"width";e.bar.el().style[t]=(100*progress).toFixed(2)+"%"}))),progress}},n.getProgress=function(){return Number(An(this.getPercent(),0,1).toFixed(4))},n.calculateDistance=function(e){var t=Ze(this.el_,e);return this.vertical()?t.y:t.x},n.handleKeyDown=function(t){v.a.isEventKey(t,"Left")||v.a.isEventKey(t,"Down")?(t.preventDefault(),t.stopPropagation(),this.stepBack()):v.a.isEventKey(t,"Right")||v.a.isEventKey(t,"Up")?(t.preventDefault(),t.stopPropagation(),this.stepForward()):e.prototype.handleKeyDown.call(this,t)},n.handleClick=function(e){e.stopPropagation(),e.preventDefault()},n.vertical=function(e){if(void 0===e)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")},t}(ni);ni.registerComponent("Slider",Pn);var On=function(time,e){return An(time/e*100,0,100).toFixed(2)+"%"},Ln=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).partEls_=[],r.on(t,"progress",(function(e){return r.update(e)})),r}S()(t,e);var n=t.prototype;return n.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-load-progress"}),n=Ue("span",{className:"vjs-control-text"}),r=Ue("span",{textContent:this.localize("Loaded")}),o=d.a.createTextNode(": ");return this.percentageEl_=Ue("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),t.appendChild(n),n.appendChild(r),n.appendChild(o),n.appendChild(this.percentageEl_),t},n.dispose=function(){this.partEls_=null,this.percentageEl_=null,e.prototype.dispose.call(this)},n.update=function(e){var t=this;this.requestNamedAnimationFrame("LoadProgressBar#update",(function(){var e=t.player_.liveTracker,n=t.player_.buffered(),r=e&&e.isLive()?e.seekableEnd():t.player_.duration(),o=t.player_.bufferedEnd(),l=t.partEls_,c=On(o,r);t.percent_!==c&&(t.el_.style.width=c,Be(t.percentageEl_,c),t.percent_=c);for(var i=0;in.length;m--)t.el_.removeChild(l[m-1]);l.length=n.length}))},t}(ni);ni.registerComponent("LoadProgressBar",Ln);var Dn=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).update=Nt(Rt(_()(r),r.update),Mt),r}S()(t,e);var n=t.prototype;return n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})},n.update=function(e,t,content){var n=Je(this.el_),r=$e(this.player_.el()),o=e.width*t;if(r&&n){var l=e.left-r.left+o,c=e.width-o+(r.right-e.right),d=n.width/2;ln.width&&(d=n.width),d=Math.round(d),this.el_.style.right="-"+d+"px",this.write(content)}},n.write=function(content){Be(this.el_,content)},n.updateTime=function(e,t,time,n){var r=this;this.requestNamedAnimationFrame("TimeTooltip#updateTime",(function(){var content,o=r.player_.duration();if(r.player_.liveTracker&&r.player_.liveTracker.isLive()){var l=r.player_.liveTracker.liveWindow(),c=l-t*l;content=(c<1?"":"-")+Tn(c,l)}else content=Tn(time,o);r.update(e,t,content),n&&n()}))},t}(ni);ni.registerComponent("TimeTooltip",Dn);var Mn=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).update=Nt(Rt(_()(r),r.update),Mt),r}S()(t,e);var n=t.prototype;return n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})},n.update=function(e,t){var n=this.getChild("timeTooltip");if(n){var time=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();n.updateTime(e,t,time)}},t}(ni);Mn.prototype.options_={children:[]},xe||me||Mn.prototype.options_.children.push("timeTooltip"),ni.registerComponent("PlayProgressBar",Mn);var Rn=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).update=Nt(Rt(_()(r),r.update),Mt),r}S()(t,e);var n=t.prototype;return n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},n.update=function(e,t){var n=this,time=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,time,(function(){n.el_.style.left=e.width*t+"px"}))},t}(ni);Rn.prototype.options_={children:["timeTooltip"]},ni.registerComponent("MouseTimeDisplay",Rn);var Nn=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).setEventHandlers_(),r}S()(t,e);var n=t.prototype;return n.setEventHandlers_=function(){var e=this;this.update_=Rt(this,this.update),this.update=Nt(this.update_,Mt),this.on(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=function(t){return e.enableInterval_(t)},this.disableIntervalHandler_=function(t){return e.disableInterval_(t)},this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in d.a&&"visibilityState"in d.a&&this.on(d.a,"visibilitychange",this.toggleVisibility_)},n.toggleVisibility_=function(e){"hidden"===d.a.visibilityState?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(this.player_.ended()||this.player_.paused()||this.enableInterval_(),this.update())},n.enableInterval_=function(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,Mt))},n.disableInterval_=function(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&"ended"!==e.type||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)},n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},n.update=function(t){var n=this;if("hidden"!==d.a.visibilityState){var r=e.prototype.update.call(this);return this.requestNamedAnimationFrame("SeekBar#update",(function(){var e=n.player_.ended()?n.player_.duration():n.getCurrentTime_(),t=n.player_.liveTracker,o=n.player_.duration();t&&t.isLive()&&(o=n.player_.liveTracker.liveCurrentTime()),n.percent_!==r&&(n.el_.setAttribute("aria-valuenow",(100*r).toFixed(2)),n.percent_=r),n.currentTime_===e&&n.duration_===o||(n.el_.setAttribute("aria-valuetext",n.localize("progress bar timing: currentTime={1} duration={2}",[Tn(e,o),Tn(o,o)],"{1} of {2}")),n.currentTime_=e,n.duration_=o),n.bar&&n.bar.update($e(n.el()),n.getProgress())})),r}},n.userSeek_=function(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)},n.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()},n.getPercent=function(){var e,t=this.getCurrentTime_(),n=this.player_.liveTracker;return n&&n.isLive()?(e=(t-n.seekableStart())/n.liveWindow(),n.atLiveEdge()&&(e=1)):e=t/this.player_.duration(),e},n.handleMouseDown=function(t){st(t)&&(t.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),e.prototype.handleMouseDown.call(this,t))},n.handleMouseMove=function(e,t){if(void 0===t&&(t=!1),st(e)){var n;t||this.player_.scrubbing()||this.player_.scrubbing(!0);var r=this.calculateDistance(e),o=this.player_.liveTracker;if(o&&o.isLive()){if(r>=.99)return void o.seekToLiveEdge();var l=o.seekableStart(),c=o.liveCurrentTime();if((n=l+r*o.liveWindow())>=c&&(n=c),n<=l&&(n=l+.1),n===1/0)return}else(n=r*this.player_.duration())===this.player_.duration()&&(n-=.1);this.userSeek_(n)}},n.enable=function(){e.prototype.enable.call(this);var t=this.getChild("mouseTimeDisplay");t&&t.show()},n.disable=function(){e.prototype.disable.call(this);var t=this.getChild("mouseTimeDisplay");t&&t.hide()},n.handleMouseUp=function(t){e.prototype.handleMouseUp.call(this,t),t&&t.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?hi(this.player_.play()):this.update_()},n.stepForward=function(){this.userSeek_(this.player_.currentTime()+5)},n.stepBack=function(){this.userSeek_(this.player_.currentTime()-5)},n.handleAction=function(e){this.player_.paused()?this.player_.play():this.player_.pause()},n.handleKeyDown=function(t){var n=this.player_.liveTracker;if(v.a.isEventKey(t,"Space")||v.a.isEventKey(t,"Enter"))t.preventDefault(),t.stopPropagation(),this.handleAction(t);else if(v.a.isEventKey(t,"Home"))t.preventDefault(),t.stopPropagation(),this.userSeek_(0);else if(v.a.isEventKey(t,"End"))t.preventDefault(),t.stopPropagation(),n&&n.isLive()?this.userSeek_(n.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(v()(t))){t.preventDefault(),t.stopPropagation();var r=10*(v.a.codes[v()(t)]-v.a.codes[0])/100;n&&n.isLive()?this.userSeek_(n.seekableStart()+n.liveWindow()*r):this.userSeek_(this.player_.duration()*r)}else v.a.isEventKey(t,"PgDn")?(t.preventDefault(),t.stopPropagation(),this.userSeek_(this.player_.currentTime()-60)):v.a.isEventKey(t,"PgUp")?(t.preventDefault(),t.stopPropagation(),this.userSeek_(this.player_.currentTime()+60)):e.prototype.handleKeyDown.call(this,t)},n.dispose=function(){this.disableInterval_(),this.off(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in d.a&&"visibilityState"in d.a&&this.off(d.a,"visibilitychange",this.toggleVisibility_),e.prototype.dispose.call(this)},t}(Pn);Nn.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},xe||me||Nn.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),ni.registerComponent("SeekBar",Nn);var Un=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).handleMouseMove=Nt(Rt(_()(r),r.handleMouseMove),Mt),r.throttledHandleMouseSeek=Nt(Rt(_()(r),r.handleMouseSeek),Mt),r.handleMouseUpHandler_=function(e){return r.handleMouseUp(e)},r.handleMouseDownHandler_=function(e){return r.handleMouseDown(e)},r.enable(),r}S()(t,e);var n=t.prototype;return n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},n.handleMouseMove=function(e){var t=this.getChild("seekBar");if(t){var n=t.getChild("playProgressBar"),r=t.getChild("mouseTimeDisplay");if(n||r){var o=t.el(),l=Je(o),c=Ze(o,e).x;c=An(c,0,1),r&&r.update(l,c),n&&n.update(l,t.getProgress())}}},n.handleMouseSeek=function(e){var t=this.getChild("seekBar");t&&t.handleMouseMove(e)},n.enabled=function(){return this.enabled_},n.disable=function(){if(this.children().forEach((function(e){return e.disable&&e.disable()})),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,"mousemove",this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){var e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&hi(this.player_.play())}},n.enable=function(){this.children().forEach((function(e){return e.enable&&e.enable()})),this.enabled()||(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)},n.removeListenersAddedOnMousedownAndTouchstart=function(){var e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUpHandler_),this.off(e,"touchend",this.handleMouseUpHandler_)},n.handleMouseDown=function(e){var t=this.el_.ownerDocument,n=this.getChild("seekBar");n&&n.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)},n.handleMouseUp=function(e){var t=this.getChild("seekBar");t&&t.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()},t}(ni);Un.prototype.options_={children:["seekBar"]},ni.registerComponent("ProgressControl",Un);var Bn=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).on(t,["enterpictureinpicture","leavepictureinpicture"],(function(e){return r.handlePictureInPictureChange(e)})),r.on(t,["disablepictureinpicturechanged","loadedmetadata"],(function(e){return r.handlePictureInPictureEnabledChange(e)})),r.on(t,["loadedmetadata","audioonlymodechange","audiopostermodechange"],(function(){"audio"===t.currentType().substring(0,5)||t.audioPosterMode()||t.audioOnlyMode()?(t.isInPictureInPicture()&&t.exitPictureInPicture(),r.hide()):r.show()})),r.disable(),r}S()(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-picture-in-picture-control "+e.prototype.buildCSSClass.call(this)},n.handlePictureInPictureEnabledChange=function(){d.a.pictureInPictureEnabled&&!1===this.player_.disablePictureInPicture()?this.enable():this.disable()},n.handlePictureInPictureChange=function(e){this.player_.isInPictureInPicture()?this.controlText("Exit Picture-in-Picture"):this.controlText("Picture-in-Picture"),this.handlePictureInPictureEnabledChange()},n.handleClick=function(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()},t}(mn);Bn.prototype.controlText_="Picture-in-Picture",ni.registerComponent("PictureInPictureToggle",Bn);var jn=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).on(t,"fullscreenchange",(function(e){return r.handleFullscreenChange(e)})),!1===d.a[t.fsApi_.fullscreenEnabled]&&r.disable(),r}S()(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-fullscreen-control "+e.prototype.buildCSSClass.call(this)},n.handleFullscreenChange=function(e){this.player_.isFullscreen()?this.controlText("Non-Fullscreen"):this.controlText("Fullscreen")},n.handleClick=function(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()},t}(mn);jn.prototype.controlText_="Fullscreen",ni.registerComponent("FullscreenToggle",jn);var Fn=function(e){function t(){return e.apply(this,arguments)||this}return S()(t,e),t.prototype.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-volume-level"});return t.appendChild(e.prototype.createEl.call(this,"span",{className:"vjs-control-text"})),t},t}(ni);ni.registerComponent("VolumeLevel",Fn);var Hn=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).update=Nt(Rt(_()(r),r.update),Mt),r}S()(t,e);var n=t.prototype;return n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})},n.update=function(e,t,n,content){if(!n){var r=$e(this.el_),o=$e(this.player_.el()),l=e.width*t;if(!o||!r)return;var c=e.left-o.left+l,d=e.width-l+(o.right-e.right),h=r.width/2;cr.width&&(h=r.width),this.el_.style.right="-"+h+"px"}this.write(content+"%")},n.write=function(content){Be(this.el_,content)},n.updateVolume=function(e,t,n,r,o){var l=this;this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",(function(){l.update(e,t,n,r.toFixed(0)),o&&o()}))},t}(ni);ni.registerComponent("VolumeLevelTooltip",Hn);var qn=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).update=Nt(Rt(_()(r),r.update),Mt),r}S()(t,e);var n=t.prototype;return n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},n.update=function(e,t,n){var r=this,o=100*t;this.getChild("volumeLevelTooltip").updateVolume(e,t,n,o,(function(){n?r.el_.style.bottom=e.height*t+"px":r.el_.style.left=e.width*t+"px"}))},t}(ni);qn.prototype.options_={children:["volumeLevelTooltip"]},ni.registerComponent("MouseVolumeLevelDisplay",qn);var Vn=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).on("slideractive",(function(e){return r.updateLastVolume_(e)})),r.on(t,"volumechange",(function(e){return r.updateARIAAttributes(e)})),t.ready((function(){return r.updateARIAAttributes()})),r}S()(t,e);var n=t.prototype;return n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})},n.handleMouseDown=function(t){st(t)&&e.prototype.handleMouseDown.call(this,t)},n.handleMouseMove=function(e){var t=this.getChild("mouseVolumeLevelDisplay");if(t){var n=this.el(),r=$e(n),o=this.vertical(),l=Ze(n,e);l=o?l.y:l.x,l=An(l,0,1),t.update(r,l,o)}st(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))},n.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1)},n.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},n.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)},n.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)},n.updateARIAAttributes=function(e){var t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")},n.volumeAsPercentage_=function(){return Math.round(100*this.player_.volume())},n.updateLastVolume_=function(){var e=this,t=this.player_.volume();this.one("sliderinactive",(function(){0===e.player_.volume()&&e.player_.lastVolume_(t)}))},t}(Pn);Vn.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},xe||me||Vn.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay"),Vn.prototype.playerEvent="volumechange",ni.registerComponent("VolumeBar",Vn);var Wn=function(e){function t(t,n){var r;return void 0===n&&(n={}),n.vertical=n.vertical||!1,(void 0===n.volumeBar||oe(n.volumeBar))&&(n.volumeBar=n.volumeBar||{},n.volumeBar.vertical=n.vertical),r=e.call(this,t,n)||this,function(e,t){t.tech_&&!t.tech_.featuresVolumeControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",(function(){t.tech_.featuresVolumeControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")}))}(_()(r),t),r.throttledHandleMouseMove=Nt(Rt(_()(r),r.handleMouseMove),Mt),r.handleMouseUpHandler_=function(e){return r.handleMouseUp(e)},r.on("mousedown",(function(e){return r.handleMouseDown(e)})),r.on("touchstart",(function(e){return r.handleMouseDown(e)})),r.on("mousemove",(function(e){return r.handleMouseMove(e)})),r.on(r.volumeBar,["focus","slideractive"],(function(){r.volumeBar.addClass("vjs-slider-active"),r.addClass("vjs-slider-active"),r.trigger("slideractive")})),r.on(r.volumeBar,["blur","sliderinactive"],(function(){r.volumeBar.removeClass("vjs-slider-active"),r.removeClass("vjs-slider-active"),r.trigger("sliderinactive")})),r}S()(t,e);var n=t.prototype;return n.createEl=function(){var t="vjs-volume-horizontal";return this.options_.vertical&&(t="vjs-volume-vertical"),e.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control "+t})},n.handleMouseDown=function(e){var t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove),this.on(t,"touchmove",this.throttledHandleMouseMove),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)},n.handleMouseUp=function(e){var t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove),this.off(t,"touchmove",this.throttledHandleMouseMove),this.off(t,"mouseup",this.handleMouseUpHandler_),this.off(t,"touchend",this.handleMouseUpHandler_)},n.handleMouseMove=function(e){this.volumeBar.handleMouseMove(e)},t}(ni);Wn.prototype.options_={children:["volumeBar"]},ni.registerComponent("VolumeControl",Wn);var zn=function(e){function t(t,n){var r;return r=e.call(this,t,n)||this,function(e,t){t.tech_&&!t.tech_.featuresMuteControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",(function(){t.tech_.featuresMuteControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")}))}(_()(r),t),r.on(t,["loadstart","volumechange"],(function(e){return r.update(e)})),r}S()(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-mute-control "+e.prototype.buildCSSClass.call(this)},n.handleClick=function(e){var t=this.player_.volume(),n=this.player_.lastVolume_();if(0===t){var r=n<.1?.1:n;this.player_.volume(r),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())},n.update=function(e){this.updateIcon_(),this.updateControlText_()},n.updateIcon_=function(){var e=this.player_.volume(),t=3;xe&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),0===e||this.player_.muted()?t=0:e<.33?t=1:e<.67&&(t=2);for(var i=0;i<4;i++)qe(this.el_,"vjs-vol-"+i);He(this.el_,"vjs-vol-"+t)},n.updateControlText_=function(){var text=this.player_.muted()||0===this.player_.volume()?"Unmute":"Mute";this.controlText()!==text&&this.controlText(text)},t}(mn);zn.prototype.controlText_="Mute",ni.registerComponent("MuteToggle",zn);var Gn=function(e){function t(t,n){var r;return void 0===n&&(n={}),void 0!==n.inline?n.inline=n.inline:n.inline=!0,(void 0===n.volumeControl||oe(n.volumeControl))&&(n.volumeControl=n.volumeControl||{},n.volumeControl.vertical=!n.inline),(r=e.call(this,t,n)||this).handleKeyPressHandler_=function(e){return r.handleKeyPress(e)},r.on(t,["loadstart"],(function(e){return r.volumePanelState_(e)})),r.on(r.muteToggle,"keyup",(function(e){return r.handleKeyPress(e)})),r.on(r.volumeControl,"keyup",(function(e){return r.handleVolumeControlKeyUp(e)})),r.on("keydown",(function(e){return r.handleKeyPress(e)})),r.on("mouseover",(function(e){return r.handleMouseOver(e)})),r.on("mouseout",(function(e){return r.handleMouseOut(e)})),r.on(r.volumeControl,["slideractive"],r.sliderActive_),r.on(r.volumeControl,["sliderinactive"],r.sliderInactive_),r}S()(t,e);var n=t.prototype;return n.sliderActive_=function(){this.addClass("vjs-slider-active")},n.sliderInactive_=function(){this.removeClass("vjs-slider-active")},n.volumePanelState_=function(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")},n.createEl=function(){var t="vjs-volume-panel-horizontal";return this.options_.inline||(t="vjs-volume-panel-vertical"),e.prototype.createEl.call(this,"div",{className:"vjs-volume-panel vjs-control "+t})},n.dispose=function(){this.handleMouseOut(),e.prototype.dispose.call(this)},n.handleVolumeControlKeyUp=function(e){v.a.isEventKey(e,"Esc")&&this.muteToggle.focus()},n.handleMouseOver=function(e){this.addClass("vjs-hover"),It(d.a,"keyup",this.handleKeyPressHandler_)},n.handleMouseOut=function(e){this.removeClass("vjs-hover"),xt(d.a,"keyup",this.handleKeyPressHandler_)},n.handleKeyPress=function(e){v.a.isEventKey(e,"Esc")&&this.handleMouseOut()},t}(ni);Gn.prototype.options_={children:["muteToggle","volumeControl"]},ni.registerComponent("VolumePanel",Gn);var Xn=function(e){function t(t,n){var r;return r=e.call(this,t,n)||this,n&&(r.menuButton_=n.menuButton),r.focusedChild_=-1,r.on("keydown",(function(e){return r.handleKeyDown(e)})),r.boundHandleBlur_=function(e){return r.handleBlur(e)},r.boundHandleTapClick_=function(e){return r.handleTapClick(e)},r}S()(t,e);var n=t.prototype;return n.addEventListenerForItem=function(component){component instanceof ni&&(this.on(component,"blur",this.boundHandleBlur_),this.on(component,["tap","click"],this.boundHandleTapClick_))},n.removeEventListenerForItem=function(component){component instanceof ni&&(this.off(component,"blur",this.boundHandleBlur_),this.off(component,["tap","click"],this.boundHandleTapClick_))},n.removeChild=function(component){"string"==typeof component&&(component=this.getChild(component)),this.removeEventListenerForItem(component),e.prototype.removeChild.call(this,component)},n.addItem=function(component){var e=this.addChild(component);e&&this.addEventListenerForItem(e)},n.createEl=function(){var t=this.options_.contentElType||"ul";this.contentEl_=Ue(t,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");var n=e.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return n.appendChild(this.contentEl_),It(n,"click",(function(e){e.preventDefault(),e.stopImmediatePropagation()})),n},n.dispose=function(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,e.prototype.dispose.call(this)},n.handleBlur=function(e){var t=e.relatedTarget||d.a.activeElement;if(!this.children().some((function(element){return element.el()===t}))){var n=this.menuButton_;n&&n.buttonPressed_&&t!==n.el().firstChild&&n.unpressButton()}},n.handleTapClick=function(e){if(this.menuButton_){this.menuButton_.unpressButton();var t=this.children();if(!Array.isArray(t))return;var n=t.filter((function(component){return component.el()===e.target}))[0];if(!n)return;"CaptionSettingsMenuItem"!==n.name()&&this.menuButton_.focus()}},n.handleKeyDown=function(e){v.a.isEventKey(e,"Left")||v.a.isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(v.a.isEventKey(e,"Right")||v.a.isEventKey(e,"Up"))&&(e.preventDefault(),e.stopPropagation(),this.stepBack())},n.stepForward=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_+1),this.focus(e)},n.stepBack=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_-1),this.focus(e)},n.focus=function(e){void 0===e&&(e=0);var t=this.children().slice();t.length&&t[0].hasClass("vjs-menu-title")&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus())},t}(ni);ni.registerComponent("Menu",Xn);var Kn=function(e){function t(t,n){var r;void 0===n&&(n={}),(r=e.call(this,t,n)||this).menuButton_=new mn(t,n),r.menuButton_.controlText(r.controlText_),r.menuButton_.el_.setAttribute("aria-haspopup","true");var o=mn.prototype.buildCSSClass();r.menuButton_.el_.className=r.buildCSSClass()+" "+o,r.menuButton_.removeClass("vjs-control"),r.addChild(r.menuButton_),r.update(),r.enabled_=!0;var l=function(e){return r.handleClick(e)};return r.handleMenuKeyUp_=function(e){return r.handleMenuKeyUp(e)},r.on(r.menuButton_,"tap",l),r.on(r.menuButton_,"click",l),r.on(r.menuButton_,"keydown",(function(e){return r.handleKeyDown(e)})),r.on(r.menuButton_,"mouseenter",(function(){r.addClass("vjs-hover"),r.menu.show(),It(d.a,"keyup",r.handleMenuKeyUp_)})),r.on("mouseleave",(function(e){return r.handleMouseLeave(e)})),r.on("keydown",(function(e){return r.handleSubmenuKeyDown(e)})),r}S()(t,e);var n=t.prototype;return n.update=function(){var menu=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=menu,this.addChild(menu),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?(this.hide(),this.menu.contentEl_.removeAttribute("role")):(this.show(),this.menu.contentEl_.setAttribute("role","menu"))},n.createMenu=function(){var menu=new Xn(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var e=Ue("li",{className:"vjs-menu-title",textContent:$t(this.options_.title),tabIndex:-1}),t=new ni(this.player_,{el:e});menu.addItem(t)}if(this.items=this.createItems(),this.items)for(var i=0;i-1&&"showing"===track.mode){n=!1;break}}n!==this.isSelected_&&this.selected(n)},n.handleSelectedLanguageChange=function(e){for(var t=this.player().textTracks(),n=!0,i=0,r=t.length;i-1&&"showing"===track.mode){n=!1;break}}n&&(this.player_.cache_.selectedLanguage={enabled:!1})},t}(Jn);ni.registerComponent("OffTextTrackMenuItem",Zn);var er=function(e){function t(t,n){return void 0===n&&(n={}),n.tracks=t.textTracks(),e.call(this,t,n)||this}return S()(t,e),t.prototype.createItems=function(e,t){var label;void 0===e&&(e=[]),void 0===t&&(t=Jn),this.label_&&(label=this.label_+" off"),e.push(new Zn(this.player_,{kinds:this.kinds_,kind:this.kind_,label:label})),this.hideThreshold_+=1;var n=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(var i=0;i-1){var r=new t(this.player_,{track:track,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});r.addClass("vjs-"+track.kind+"-menu-item"),e.push(r)}}return e},t}(Yn);ni.registerComponent("TextTrackButton",er);var ir=function(e){function t(t,n){var r,track=n.track,o=n.cue,l=t.currentTime();return n.selectable=!0,n.multiSelectable=!1,n.label=o.text,n.selected=o.startTime<=l&&l=0;i--){var track=e[i];if(track.kind===this.kind_)return track}},n.getMenuCaption=function(){return this.track_&&this.track_.label?this.track_.label:this.localize($t(this.kind_))},n.createMenu=function(){return this.options_.title=this.getMenuCaption(),e.prototype.createMenu.call(this)},n.createItems=function(){var e=[];if(!this.track_)return e;var t=this.track_.cues;if(!t)return e;for(var i=0,n=t.length;i-1&&(r.label_="captions"),r.menuButton_.controlText($t(r.label_)),r}S()(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-subs-caps-button "+e.prototype.buildCSSClass.call(this)},n.buildWrapperCSSClass=function(){return"vjs-subs-caps-button "+e.prototype.buildWrapperCSSClass.call(this)},n.createItems=function(){var t=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(t.push(new sr(this.player_,{kind:this.label_})),this.hideThreshold_+=1),t=e.prototype.createItems.call(this,t,ur)},t}(er);lr.prototype.kinds_=["captions","subtitles"],lr.prototype.controlText_="Subtitles",ni.registerComponent("SubsCapsButton",lr);var cr=function(e){function t(t,n){var r,track=n.track,o=t.audioTracks();n.label=track.label||track.language||"Unknown",n.selected=track.enabled,(r=e.call(this,t,n)||this).track=track,r.addClass("vjs-"+track.kind+"-menu-item");var l=function(){for(var e=arguments.length,t=new Array(e),n=0;n=0;i--)t.push(new pr(this.player(),{rate:e[i]+"x"}));return t},n.updateARIAAttributes=function(){this.el().setAttribute("aria-valuenow",this.player().playbackRate())},n.handleClick=function(e){var t=this.player().playbackRate(),n=this.playbackRates(),r=(n.indexOf(t)+1)%n.length;this.player().playbackRate(n[r])},n.handlePlaybackRateschange=function(e){this.update()},n.playbackRates=function(){var e=this.player();return e.playbackRates&&e.playbackRates()||[]},n.playbackRateSupported=function(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0},n.updateVisibility=function(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")},n.updateLabel=function(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")},t}(Kn);fr.prototype.controlText_="Playback Rate",ni.registerComponent("PlaybackRateMenuButton",fr);var mr=function(e){function t(){return e.apply(this,arguments)||this}S()(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-spacer "+e.prototype.buildCSSClass.call(this)},n.createEl=function(t,n,r){return void 0===t&&(t="div"),void 0===n&&(n={}),void 0===r&&(r={}),n.className||(n.className=this.buildCSSClass()),e.prototype.createEl.call(this,t,n,r)},t}(ni);ni.registerComponent("Spacer",mr);var gr=function(e){function t(){return e.apply(this,arguments)||this}S()(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-custom-control-spacer "+e.prototype.buildCSSClass.call(this)},n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),textContent:" "})},t}(mr);ni.registerComponent("CustomControlSpacer",gr);var vr=function(e){function t(){return e.apply(this,arguments)||this}return S()(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-control-bar",dir:"ltr"})},t}(ni);vr.prototype.options_={children:["playToggle","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","fullscreenToggle"]},"exitPictureInPicture"in d.a&&vr.prototype.options_.children.splice(vr.prototype.options_.children.length-1,0,"pictureInPictureToggle"),ni.registerComponent("ControlBar",vr);var yr=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).on(t,"error",(function(e){return r.open(e)})),r}S()(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-error-display "+e.prototype.buildCSSClass.call(this)},n.content=function(){var e=this.player().error();return e?this.localize(e.message):""},t}(gi);yr.prototype.options_=f()({},gi.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),ni.registerComponent("ErrorDisplay",yr);var _r="vjs-text-track-settings",Tr=["#000","Black"],Sr=["#00F","Blue"],Er=["#0FF","Cyan"],kr=["#0F0","Green"],Cr=["#F0F","Magenta"],wr=["#F00","Red"],Ir=["#FFF","White"],xr=["#FF0","Yellow"],Ar=["1","Opaque"],Pr=["0.5","Semi-Transparent"],Or=["0","Transparent"],Lr={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[Tr,Ir,wr,kr,Sr,xr,Cr,Er]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Transparency",options:[Ar,Pr,Or]},color:{selector:".vjs-fg-color > select",id:"captions-foreground-color-%s",label:"Color",options:[Ir,Tr,wr,kr,Sr,xr,Cr,Er]},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(e){return"1.00"===e?null:Number(e)}},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Transparency",options:[Ar,Pr]},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:[Or,Pr,Ar]}};function Dr(e,t){if(t&&(e=t(e)),e&&"none"!==e)return e}Lr.windowColor.options=Lr.backgroundColor.options;var Mr=function(e){function t(t,n){var r;return n.temporary=!1,(r=e.call(this,t,n)||this).updateDisplay=r.updateDisplay.bind(_()(r)),r.fill(),r.hasBeenOpened_=r.hasBeenFilled_=!0,r.endDialog=Ue("p",{className:"vjs-control-text",textContent:r.localize("End of dialog window.")}),r.el().appendChild(r.endDialog),r.setDefaults(),void 0===n.persistTextTrackSettings&&(r.options_.persistTextTrackSettings=r.options_.playerOptions.persistTextTrackSettings),r.on(r.$(".vjs-done-button"),"click",(function(){r.saveSettings(),r.close()})),r.on(r.$(".vjs-default-button"),"click",(function(){r.setDefaults(),r.updateDisplay()})),re(Lr,(function(e){r.on(r.$(e.selector),"change",r.updateDisplay)})),r.options_.persistTextTrackSettings&&r.restoreSettings(),r}S()(t,e);var n=t.prototype;return n.dispose=function(){this.endDialog=null,e.prototype.dispose.call(this)},n.createElSelect_=function(e,t,n){var r=this;void 0===t&&(t=""),void 0===n&&(n="label");var o=Lr[e],l=o.id.replace("%s",this.id_),c=[t,l].join(" ").trim();return["<"+n+' id="'+l+'" class="'+("label"===n?"vjs-label":"")+'">',this.localize(o.label),"",'").join("")},n.createElFgColor_=function(){var e="captions-text-legend-"+this.id_;return['
','',this.localize("Text"),"",this.createElSelect_("color",e),'',this.createElSelect_("textOpacity",e),"","
"].join("")},n.createElBgColor_=function(){var e="captions-background-"+this.id_;return['
','',this.localize("Background"),"",this.createElSelect_("backgroundColor",e),'',this.createElSelect_("backgroundOpacity",e),"","
"].join("")},n.createElWinColor_=function(){var e="captions-window-"+this.id_;return['
','',this.localize("Window"),"",this.createElSelect_("windowColor",e),'',this.createElSelect_("windowOpacity",e),"","
"].join("")},n.createElColors_=function(){return Ue("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})},n.createElFont_=function(){return Ue("div",{className:"vjs-track-settings-font",innerHTML:['
',this.createElSelect_("fontPercent","","legend"),"
",'
',this.createElSelect_("edgeStyle","","legend"),"
",'
',this.createElSelect_("fontFamily","","legend"),"
"].join("")})},n.createElControls_=function(){var e=this.localize("restore all settings to the default values");return Ue("div",{className:"vjs-track-settings-controls",innerHTML:['",'"].join("")})},n.content=function(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]},n.label=function(){return this.localize("Caption Settings Dialog")},n.description=function(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")},n.buildCSSClass=function(){return e.prototype.buildCSSClass.call(this)+" vjs-text-track-settings"},n.getValues=function(){var object,e,t,n=this;return e=function(e,t,r){var o,l,c=(o=n.$(t.selector),l=t.parser,Dr(o.options[o.options.selectedIndex].value,l));return void 0!==c&&(e[r]=c),e},void 0===(t={})&&(t=0),ne(object=Lr).reduce((function(t,n){return e(t,object[n],n)}),t)},n.setValues=function(e){var t=this;re(Lr,(function(n,r){!function(e,t,n){if(t)for(var i=0;ithis.options_.liveTolerance;this.timeupdateSeen_&&r!==1/0||(c=!1),c!==this.behindLiveEdge_&&(this.behindLiveEdge_=c,this.trigger("liveedgechange"))}},n.handleDurationchange=function(){this.toggleTracking()},n.toggleTracking=function(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())},n.startTracking=function(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,Mt),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)))},n.handleFirstTimeupdate=function(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)},n.handleSeeked=function(){var e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_()},n.handlePlay=function(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)},n.reset_=function(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)},n.nextSeekedFromUser=function(){this.nextSeekedFromUser_=!0},n.stopTracking=function(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))},n.seekableEnd=function(){for(var e=this.player_.seekable(),t=[],i=e?e.length:0;i--;)t.push(e.end(i));return t.length?t.sort()[t.length-1]:1/0},n.seekableStart=function(){for(var e=this.player_.seekable(),t=[],i=e?e.length:0;i--;)t.push(e.start(i));return t.length?t.sort()[0]:0},n.liveWindow=function(){var e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()},n.isLive=function(){return this.isTracking()},n.atLiveEdge=function(){return!this.behindLiveEdge()},n.liveCurrentTime=function(){return this.pastSeekEnd()+this.seekableEnd()},n.pastSeekEnd=function(){var e=this.seekableEnd();return-1!==this.lastSeekEnd_&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_},n.behindLiveEdge=function(){return this.behindLiveEdge_},n.isTracking=function(){return"number"==typeof this.trackingInterval_},n.seekToLiveEdge=function(){this.seekedBehindLive_=!1,this.atLiveEdge()||(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))},n.dispose=function(){this.off(d.a,"visibilitychange",this.handleVisibilityChange_),this.stopTracking(),e.prototype.dispose.call(this)},t}(ni);ni.registerComponent("LiveTracker",Ur);var Br,jr=function(e){var t=e.el();if(t.hasAttribute("src"))return e.triggerSourceset(t.src),!0;var n=e.$$("source"),r=[],o="";if(!n.length)return!1;for(var i=0;i=2&&o.push("loadeddata"),e.readyState>=3&&o.push("canplay"),e.readyState>=4&&o.push("canplaythrough"),this.ready((function(){o.forEach((function(e){this.trigger(e)}),this)}))}},n.setScrubbing=function(e){this.isScrubbing_=e},n.scrubbing=function(){return this.isScrubbing_},n.setCurrentTime=function(e){try{this.isScrubbing_&&this.el_.fastSeek&&Ae?this.el_.fastSeek(e):this.el_.currentTime=e}catch(e){ee(e,"Video is not ready. (Video.js)")}},n.duration=function(){var e=this;if(this.el_.duration===1/0&&me&&be&&0===this.el_.currentTime){return this.on("timeupdate",(function t(){e.el_.currentTime>0&&(e.el_.duration===1/0&&e.trigger("durationchange"),e.off("timeupdate",t))})),NaN}return this.el_.duration||NaN},n.width=function(){return this.el_.offsetWidth},n.height=function(){return this.el_.offsetHeight},n.proxyWebkitFullscreen_=function(){var e=this;if("webkitDisplayingFullscreen"in this.el_){var t=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},n=function(){"webkitPresentationMode"in this.el_&&"picture-in-picture"!==this.el_.webkitPresentationMode&&(this.one("webkitendfullscreen",t),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",n),this.on("dispose",(function(){e.off("webkitbeginfullscreen",n),e.off("webkitendfullscreen",t)}))}},n.supportsFullScreen=function(){if("function"==typeof this.el_.webkitEnterFullScreen){var e=l.a.navigator&&l.a.navigator.userAgent||"";if(/Android/.test(e)||!/Chrome|Mac OS X 10.5/.test(e))return!0}return!1},n.enterFullScreen=function(){var video=this.el_;if(video.paused&&video.networkState<=video.HAVE_METADATA)hi(this.el_.play()),this.setTimeout((function(){video.pause();try{video.webkitEnterFullScreen()}catch(e){this.trigger("fullscreenerror",e)}}),0);else try{video.webkitEnterFullScreen()}catch(e){this.trigger("fullscreenerror",e)}},n.exitFullScreen=function(){this.el_.webkitDisplayingFullscreen?this.el_.webkitExitFullScreen():this.trigger("fullscreenerror",new Error("The video is not fullscreen"))},n.requestPictureInPicture=function(){return this.el_.requestPictureInPicture()},n.requestVideoFrameCallback=function(t){return this.featuresVideoFrameCallback?this.el_.requestVideoFrameCallback(t):e.prototype.requestVideoFrameCallback.call(this,t)},n.cancelVideoFrameCallback=function(t){this.featuresVideoFrameCallback?this.el_.cancelVideoFrameCallback(t):e.prototype.cancelVideoFrameCallback.call(this,t)},n.src=function(e){if(void 0===e)return this.el_.src;this.setSrc(e)},n.reset=function(){t.resetMediaElement(this.el_)},n.currentSrc=function(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc},n.setControls=function(e){this.el_.controls=!!e},n.addTextTrack=function(t,label,n){return this.featuresNativeTextTracks?this.el_.addTextTrack(t,label,n):e.prototype.addTextTrack.call(this,t,label,n)},n.createRemoteTextTrack=function(t){if(!this.featuresNativeTextTracks)return e.prototype.createRemoteTextTrack.call(this,t);var n=d.a.createElement("track");return t.kind&&(n.kind=t.kind),t.label&&(n.label=t.label),(t.language||t.srclang)&&(n.srclang=t.language||t.srclang),t.default&&(n.default=t.default),t.id&&(n.id=t.id),t.src&&(n.src=t.src),n},n.addRemoteTextTrack=function(t,n){var r=e.prototype.addRemoteTextTrack.call(this,t,n);return this.featuresNativeTextTracks&&this.el().appendChild(r),r},n.removeRemoteTextTrack=function(track){if(e.prototype.removeRemoteTextTrack.call(this,track),this.featuresNativeTextTracks)for(var t=this.$$("track"),i=t.length;i--;)track!==t[i]&&track!==t[i].track||this.el().removeChild(t[i])},n.getVideoPlaybackQuality=function(){if("function"==typeof this.el().getVideoPlaybackQuality)return this.el().getVideoPlaybackQuality();var e={};return void 0!==this.el().webkitDroppedFrameCount&&void 0!==this.el().webkitDecodedFrameCount&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),l.a.performance&&"function"==typeof l.a.performance.now?e.creationTime=l.a.performance.now():l.a.performance&&l.a.performance.timing&&"number"==typeof l.a.performance.timing.navigationStart&&(e.creationTime=l.a.Date.now()-l.a.performance.timing.navigationStart),e},t}(zi);zr(Gr,"TEST_VID",(function(){if(De()){var video=d.a.createElement("video"),track=d.a.createElement("track");return track.kind="captions",track.srclang="en",track.label="English",video.appendChild(track),video}})),Gr.isSupported=function(){try{Gr.TEST_VID.volume=.5}catch(e){return!1}return!(!Gr.TEST_VID||!Gr.TEST_VID.canPlayType)},Gr.canPlayType=function(e){return Gr.TEST_VID.canPlayType(e)},Gr.canPlaySource=function(e,t){return Gr.canPlayType(e.type)},Gr.canControlVolume=function(){try{var e=Gr.TEST_VID.volume;Gr.TEST_VID.volume=e/2+.1;var t=e!==Gr.TEST_VID.volume;return t&&xe?(l.a.setTimeout((function(){Gr&&Gr.prototype&&(Gr.prototype.featuresVolumeControl=e!==Gr.TEST_VID.volume)})),!1):t}catch(e){return!1}},Gr.canMuteVolume=function(){try{var e=Gr.TEST_VID.muted;return Gr.TEST_VID.muted=!e,Gr.TEST_VID.muted?Xe(Gr.TEST_VID,"muted","muted"):Ke(Gr.TEST_VID,"muted"),e!==Gr.TEST_VID.muted}catch(e){return!1}},Gr.canControlPlaybackRate=function(){if(me&&be&&Te<58)return!1;try{var e=Gr.TEST_VID.playbackRate;return Gr.TEST_VID.playbackRate=e/2+.1,e!==Gr.TEST_VID.playbackRate}catch(e){return!1}},Gr.canOverrideAttributes=function(){try{var e=function(){};Object.defineProperty(d.a.createElement("video"),"src",{get:e,set:e}),Object.defineProperty(d.a.createElement("audio"),"src",{get:e,set:e}),Object.defineProperty(d.a.createElement("video"),"innerHTML",{get:e,set:e}),Object.defineProperty(d.a.createElement("audio"),"innerHTML",{get:e,set:e})}catch(e){return!1}return!0},Gr.supportsNativeTextTracks=function(){return Ae||xe&&be},Gr.supportsNativeVideoTracks=function(){return!(!Gr.TEST_VID||!Gr.TEST_VID.videoTracks)},Gr.supportsNativeAudioTracks=function(){return!(!Gr.TEST_VID||!Gr.TEST_VID.audioTracks)},Gr.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],[["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach((function(e){var t=e[0],n=e[1];zr(Gr.prototype,t,(function(){return Gr[n]()}),!0)})),Gr.prototype.featuresVolumeControl=Gr.canControlVolume(),Gr.prototype.movingMediaElementInDOM=!xe,Gr.prototype.featuresFullscreenResize=!0,Gr.prototype.featuresProgressEvents=!0,Gr.prototype.featuresTimeupdateEvents=!0,Gr.prototype.featuresVideoFrameCallback=!(!Gr.TEST_VID||!Gr.TEST_VID.requestVideoFrameCallback),Gr.patchCanPlayType=function(){ge>=4&&!ye&&!be&&(Br=Gr.TEST_VID&&Gr.TEST_VID.constructor.prototype.canPlayType,Gr.TEST_VID.constructor.prototype.canPlayType=function(e){return e&&/^application\/(?:x-|vnd\.apple\.)mpegurl/i.test(e)?"maybe":Br.call(this,e)})},Gr.unpatchCanPlayType=function(){var e=Gr.TEST_VID.constructor.prototype.canPlayType;return Br&&(Gr.TEST_VID.constructor.prototype.canPlayType=Br),e},Gr.patchCanPlayType(),Gr.disposeMediaElement=function(e){if(e){for(e.parentNode&&e.parentNode.removeChild(e);e.hasChildNodes();)e.removeChild(e.firstChild);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch(e){}}()}},Gr.resetMediaElement=function(e){if(e){for(var t=e.querySelectorAll("source"),i=t.length;i--;)e.removeChild(t[i]);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch(e){}}()}},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach((function(e){Gr.prototype[e]=function(){return this.el_[e]||this.el_.hasAttribute(e)}})),["muted","defaultMuted","autoplay","loop","playsinline"].forEach((function(e){Gr.prototype["set"+$t(e)]=function(t){this.el_[e]=t,t?this.el_.setAttribute(e,e):this.el_.removeAttribute(e)}})),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach((function(e){Gr.prototype[e]=function(){return this.el_[e]}})),["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach((function(e){Gr.prototype["set"+$t(e)]=function(t){this.el_[e]=t}})),["pause","load","play"].forEach((function(e){Gr.prototype[e]=function(){return this.el_[e]()}})),zi.withSourceHandlers(Gr),Gr.nativeSourceHandler={},Gr.nativeSourceHandler.canPlayType=function(e){try{return Gr.TEST_VID.canPlayType(e)}catch(e){return""}},Gr.nativeSourceHandler.canHandleSource=function(source,e){if(source.type)return Gr.nativeSourceHandler.canPlayType(source.type);if(source.src){var t=Di(source.src);return Gr.nativeSourceHandler.canPlayType("video/"+t)}return""},Gr.nativeSourceHandler.handleSource=function(source,e,t){e.setSrc(source.src)},Gr.nativeSourceHandler.dispose=function(){},Gr.registerSourceHandler(Gr.nativeSourceHandler),zi.registerTech("Html5",Gr);var Xr=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],Kr={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},Yr=["tiny","xsmall","small","medium","large","xlarge","huge"],Qr={};Yr.forEach((function(e){var t="x"===e.charAt(0)?"x-"+e.substring(1):e;Qr[e]="vjs-layout-"+t}));var $r={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0},Jr=function(e){function t(n,r,o){var l;if(n.id=n.id||r.id||"vjs_video_"+bt(),(r=ae(t.getTagSettings(n),r)).initChildren=!1,r.createEl=!1,r.evented=!1,r.reportTouchActivity=!1,!r.language)if("function"==typeof n.closest){var c=n.closest("[lang]");c&&c.getAttribute&&(r.language=c.getAttribute("lang"))}else for(var element=n;element&&1===element.nodeType;){if(ze(element).hasOwnProperty("lang")){r.language=element.getAttribute("lang");break}element=element.parentNode}if((l=e.call(this,null,r,o)||this).boundDocumentFullscreenChange_=function(e){return l.documentFullscreenChange_(e)},l.boundFullWindowOnEscKey_=function(e){return l.fullWindowOnEscKey(e)},l.boundUpdateStyleEl_=function(e){return l.updateStyleEl_(e)},l.boundApplyInitTime_=function(e){return l.applyInitTime_(e)},l.boundUpdateCurrentBreakpoint_=function(e){return l.updateCurrentBreakpoint_(e)},l.boundHandleTechClick_=function(e){return l.handleTechClick_(e)},l.boundHandleTechDoubleClick_=function(e){return l.handleTechDoubleClick_(e)},l.boundHandleTechTouchStart_=function(e){return l.handleTechTouchStart_(e)},l.boundHandleTechTouchMove_=function(e){return l.handleTechTouchMove_(e)},l.boundHandleTechTouchEnd_=function(e){return l.handleTechTouchEnd_(e)},l.boundHandleTechTap_=function(e){return l.handleTechTap_(e)},l.isFullscreen_=!1,l.log=te(l.id_),l.fsApi_=Y,l.isPosterFromTech_=!1,l.queuedCallbacks_=[],l.isReady_=!1,l.hasStarted_=!1,l.userActive_=!1,l.debugEnabled_=!1,l.audioOnlyMode_=!1,l.audioPosterMode_=!1,l.audioOnlyCache_={playerHeight:null,hiddenChildren:[]},!l.options_||!l.options_.techOrder||!l.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(l.tag=n,l.tagAttributes=n&&ze(n),l.language(l.options_.language),r.languages){var h={};Object.getOwnPropertyNames(r.languages).forEach((function(e){h[e.toLowerCase()]=r.languages[e]})),l.languages_=h}else l.languages_=t.prototype.options_.languages;l.resetCache_(),l.poster_=r.poster||"",l.controls_=!!r.controls,n.controls=!1,n.removeAttribute("controls"),l.changingSrc_=!1,l.playCallbacks_=[],l.playTerminatedQueue_=[],n.hasAttribute("autoplay")?l.autoplay(!0):l.autoplay(l.options_.autoplay),r.plugins&&Object.keys(r.plugins).forEach((function(e){if("function"!=typeof l[e])throw new Error('plugin "'+e+'" does not exist')})),l.scrubbing_=!1,l.el_=l.createEl(),Xt(_()(l),{eventBusKey:"el_"}),l.fsApi_.requestFullscreen&&(It(d.a,l.fsApi_.fullscreenchange,l.boundDocumentFullscreenChange_),l.on(l.fsApi_.fullscreenchange,l.boundDocumentFullscreenChange_)),l.fluid_&&l.on(["playerreset","resize"],l.boundUpdateStyleEl_);var f=Jt(l.options_);r.plugins&&Object.keys(r.plugins).forEach((function(e){l[e](r.plugins[e])})),r.debug&&l.debug(!0),l.options_.playerOptions=f,l.middleware_=[],l.playbackRates(r.playbackRates),l.initChildren(),l.isAudio("audio"===n.nodeName.toLowerCase()),l.controls()?l.addClass("vjs-controls-enabled"):l.addClass("vjs-controls-disabled"),l.el_.setAttribute("role","region"),l.isAudio()?l.el_.setAttribute("aria-label",l.localize("Audio Player")):l.el_.setAttribute("aria-label",l.localize("Video Player")),l.isAudio()&&l.addClass("vjs-audio"),l.flexNotSupported_()&&l.addClass("vjs-no-flex"),Ce&&l.addClass("vjs-touch-enabled"),xe||l.addClass("vjs-workinghover"),t.players[l.id_]=_()(l);var m=z.split(".")[0];return l.addClass("vjs-v"+m),l.userActive(!0),l.reportUserActivity(),l.one("play",(function(e){return l.listenForUserActivity_(e)})),l.on("stageclick",(function(e){return l.handleStageClick_(e)})),l.on("keydown",(function(e){return l.handleKeyDown(e)})),l.on("languagechange",(function(e){return l.handleLanguagechange(e)})),l.breakpoints(l.options_.breakpoints),l.responsive(l.options_.responsive),l.on("ready",(function(){l.audioPosterMode(l.options_.audioPosterMode),l.audioOnlyMode(l.options_.audioOnlyMode)})),l}S()(t,e);var n=t.prototype;return n.dispose=function(){var n=this;this.trigger("dispose"),this.off("dispose"),xt(d.a,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),xt(d.a,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),t.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),Xi[this.id()]=null,Wi.names.forEach((function(e){var t=Wi[e],r=n[t.getterName]();r&&r.off&&r.off()})),e.prototype.dispose.call(this)},n.createEl=function(){var t,n=this.tag,r=this.playerElIngest_=n.parentNode&&n.parentNode.hasAttribute&&n.parentNode.hasAttribute("data-vjs-player"),o="video-js"===this.tag.tagName.toLowerCase();r?t=this.el_=n.parentNode:o||(t=this.el_=e.prototype.createEl.call(this,"div"));var c=ze(n);if(o){for(t=this.el_=n,n=this.tag=d.a.createElement("video");t.children.length;)n.appendChild(t.firstChild);Fe(t,"video-js")||He(t,"video-js"),t.appendChild(n),r=this.playerElIngest_=t,Object.keys(t).forEach((function(e){try{n[e]=t[e]}catch(e){}}))}if(n.setAttribute("tabindex","-1"),c.tabindex="-1",(Se||be&&ke)&&(n.setAttribute("role","application"),c.role="application"),n.removeAttribute("width"),n.removeAttribute("height"),"width"in c&&delete c.width,"height"in c&&delete c.height,Object.getOwnPropertyNames(c).forEach((function(e){o&&"class"===e||t.setAttribute(e,c[e]),o&&n.setAttribute(e,c[e])})),n.playerId=n.id,n.id+="_html5_api",n.className="vjs-tech",n.player=t.player=this,this.addClass("vjs-paused"),!0!==l.a.VIDEOJS_NO_DYNAMIC_STYLE){this.styleEl_=vt("vjs-styles-dimensions");var h=ut(".vjs-styles-defaults"),head=ut("head");head.insertBefore(this.styleEl_,h?h.nextSibling:head.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);for(var f=n.getElementsByTagName("a"),i=0;i0?this.videoWidth()+":"+this.videoHeight():"16:9").split(":"),o=r[1]/r[0];e=void 0!==this.width_?this.width_:void 0!==this.height_?this.height_/o:this.videoWidth()||300,t=void 0!==this.height_?this.height_:e*o,n=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(n),yt(this.styleEl_,"\n ."+n+" {\n width: "+e+"px;\n height: "+t+"px;\n }\n\n ."+n+".vjs-fluid:not(.vjs-audio-only-mode) {\n padding-top: "+100*o+"%;\n }\n ")}else{var c="number"==typeof this.width_?this.width_:this.options_.width,d="number"==typeof this.height_?this.height_:this.options_.height,h=this.tech_&&this.tech_.el();h&&(c>=0&&(h.width=c),d>=0&&(h.height=d))}},n.loadTech_=function(e,source){var t=this;this.tech_&&this.unloadTech_();var n=$t(e),r=e.charAt(0).toLowerCase()+e.slice(1);"Html5"!==n&&this.tag&&(zi.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=n,this.isReady_=!1;var o=this.autoplay();("string"==typeof this.autoplay()||!0===this.autoplay()&&this.options_.normalizeAutoplay)&&(o=!1);var l={source:source,autoplay:o,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:this.id()+"_"+r+"_api",playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,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,Promise:this.options_.Promise};Wi.names.forEach((function(e){var n=Wi[e];l[n.getterName]=t[n.privateName]})),ae(l,this.options_[n]),ae(l,this.options_[r]),ae(l,this.options_[e.toLowerCase()]),this.tag&&(l.tag=this.tag),source&&source.src===this.cache_.src&&this.cache_.currentTime>0&&(l.startTime=this.cache_.currentTime);var c=zi.getTech(e);if(!c)throw new Error("No Tech named '"+n+"' exists! '"+n+"' should be registered using videojs.registerTech()'");this.tech_=new c(l),this.tech_.ready(Rt(this,this.handleTechReady_),!0),mi(this.textTracksJson_||[],this.tech_),Xr.forEach((function(e){t.on(t.tech_,e,(function(n){return t["handleTech"+$t(e)+"_"](n)}))})),Object.keys(Kr).forEach((function(e){t.on(t.tech_,e,(function(n){0===t.tech_.playbackRate()&&t.tech_.seeking()?t.queuedCallbacks_.push({callback:t["handleTech"+Kr[e]+"_"].bind(t),event:n}):t["handleTech"+Kr[e]+"_"](n)}))})),this.on(this.tech_,"loadstart",(function(e){return t.handleTechLoadStart_(e)})),this.on(this.tech_,"sourceset",(function(e){return t.handleTechSourceset_(e)})),this.on(this.tech_,"waiting",(function(e){return t.handleTechWaiting_(e)})),this.on(this.tech_,"ended",(function(e){return t.handleTechEnded_(e)})),this.on(this.tech_,"seeking",(function(e){return t.handleTechSeeking_(e)})),this.on(this.tech_,"play",(function(e){return t.handleTechPlay_(e)})),this.on(this.tech_,"firstplay",(function(e){return t.handleTechFirstPlay_(e)})),this.on(this.tech_,"pause",(function(e){return t.handleTechPause_(e)})),this.on(this.tech_,"durationchange",(function(e){return t.handleTechDurationChange_(e)})),this.on(this.tech_,"fullscreenchange",(function(e,data){return t.handleTechFullscreenChange_(e,data)})),this.on(this.tech_,"fullscreenerror",(function(e,n){return t.handleTechFullscreenError_(e,n)})),this.on(this.tech_,"enterpictureinpicture",(function(e){return t.handleTechEnterPictureInPicture_(e)})),this.on(this.tech_,"leavepictureinpicture",(function(e){return t.handleTechLeavePictureInPicture_(e)})),this.on(this.tech_,"error",(function(e){return t.handleTechError_(e)})),this.on(this.tech_,"posterchange",(function(e){return t.handleTechPosterChange_(e)})),this.on(this.tech_,"textdata",(function(e){return t.handleTechTextData_(e)})),this.on(this.tech_,"ratechange",(function(e){return t.handleTechRateChange_(e)})),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode===this.el()||"Html5"===n&&this.tag||je(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)},n.unloadTech_=function(){var e=this;Wi.names.forEach((function(t){var n=Wi[t];e[n.privateName]=e[n.getterName]()})),this.textTracksJson_=fi(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1},n.tech=function(e){return void 0===e&&ee.warn("Using the tech directly can be dangerous. I hope you know what you're doing.\nSee https://github.com/videojs/video.js/issues/2617 for more info.\n"),this.tech_},n.addTechControlsListeners_=function(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)},n.removeTechControlsListeners_=function(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)},n.handleTechReady_=function(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()},n.handleTechLoadStart_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):(this.trigger("loadstart"),this.trigger("firstplay")),this.manualAutoplay_(!0===this.autoplay()&&this.options_.normalizeAutoplay?"play":this.autoplay())},n.manualAutoplay_=function(e){var t=this;if(this.tech_&&"string"==typeof e){var n,r=function(){var e=t.muted();t.muted(!0);var n=function(){t.muted(e)};t.playTerminatedQueue_.push(n);var r=t.play();if(di(r))return r.catch((function(e){throw n(),new Error("Rejection at manualAutoplay. Restoring muted value. "+(e||""))}))};if("any"!==e||this.muted()?n="muted"!==e||this.muted()?this.play():r():di(n=this.play())&&(n=n.catch(r)),di(n))return n.then((function(){t.trigger({type:"autoplay-success",autoplay:e})})).catch((function(){t.trigger({type:"autoplay-failure",autoplay:e})}))}},n.updateSourceCaches_=function(e){void 0===e&&(e="");var t=e,n="";"string"!=typeof t&&(t=e.src,n=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!n&&(n=function(e,t){if(!t)return"";if(e.cache_.source.src===t&&e.cache_.source.type)return e.cache_.source.type;var n=e.cache_.sources.filter((function(s){return s.src===t}));if(n.length)return n[0].type;for(var r=e.$$("source"),i=0;i0&&0===this.cache_.lastPlaybackRate&&(this.queuedCallbacks_.forEach((function(e){return e.callback(e.event)})),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")},n.handleTechWaiting_=function(){var e=this;this.addClass("vjs-waiting"),this.trigger("waiting");var t=this.currentTime();this.on("timeupdate",(function n(){t!==e.currentTime()&&(e.removeClass("vjs-waiting"),e.off("timeupdate",n))}))},n.handleTechCanPlay_=function(){this.removeClass("vjs-waiting"),this.trigger("canplay")},n.handleTechCanPlayThrough_=function(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")},n.handleTechPlaying_=function(){this.removeClass("vjs-waiting"),this.trigger("playing")},n.handleTechSeeking_=function(){this.addClass("vjs-seeking"),this.trigger("seeking")},n.handleTechSeeked_=function(){this.removeClass("vjs-seeking"),this.removeClass("vjs-ended"),this.trigger("seeked")},n.handleTechFirstPlay_=function(){this.options_.starttime&&(ee.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")},n.handleTechPause_=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")},n.handleTechEnded_=function(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")},n.handleTechDurationChange_=function(){this.duration(this.techGet_("duration"))},n.handleTechClick_=function(e){this.controls_&&(void 0!==this.options_&&void 0!==this.options_.userActions&&void 0!==this.options_.userActions.click&&!1===this.options_.userActions.click||(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.click?this.options_.userActions.click.call(this,e):this.paused()?hi(this.play()):this.pause()))},n.handleTechDoubleClick_=function(e){this.controls_&&(Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),(function(t){return t.contains(e.target)}))||void 0!==this.options_&&void 0!==this.options_.userActions&&void 0!==this.options_.userActions.doubleClick&&!1===this.options_.userActions.doubleClick||(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.doubleClick?this.options_.userActions.doubleClick.call(this,e):this.isFullscreen()?this.exitFullscreen():this.requestFullscreen()))},n.handleTechTap_=function(){this.userActive(!this.userActive())},n.handleTechTouchStart_=function(){this.userWasActive=this.userActive()},n.handleTechTouchMove_=function(){this.userWasActive&&this.reportUserActivity()},n.handleTechTouchEnd_=function(e){e.cancelable&&e.preventDefault()},n.handleStageClick_=function(){this.reportUserActivity()},n.toggleFullscreenClass_=function(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")},n.documentFullscreenChange_=function(e){var t=e.target.player;if(!t||t===this){var n=this.el(),r=d.a[this.fsApi_.fullscreenElement]===n;!r&&n.matches?r=n.matches(":"+this.fsApi_.fullscreen):!r&&n.msMatchesSelector&&(r=n.msMatchesSelector(":"+this.fsApi_.fullscreen)),this.isFullscreen(r)}},n.handleTechFullscreenChange_=function(e,data){var t=this;data&&(data.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",(function(){t.removeClass("vjs-ios-native-fs")}))),this.isFullscreen(data.isFullscreen))},n.handleTechFullscreenError_=function(e,t){this.trigger("fullscreenerror",t)},n.togglePictureInPictureClass_=function(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")},n.handleTechEnterPictureInPicture_=function(e){this.isInPictureInPicture(!0)},n.handleTechLeavePictureInPicture_=function(e){this.isInPictureInPicture(!1)},n.handleTechError_=function(){var e=this.tech_.error();this.error(e)},n.handleTechTextData_=function(){var data=null;arguments.length>1&&(data=arguments[1]),this.trigger("textdata",data)},n.getCache=function(){return this.cache_},n.resetCache_=function(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}},n.techCall_=function(e,t){this.ready((function(){if(e in Ji)return function(e,t,n,r){return t[n](e.reduce(en(n),r))}(this.middleware_,this.tech_,e,t);if(e in Zi)return Qi(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(e){throw ee(e),e}}),!0)},n.techGet_=function(e){if(this.tech_&&this.tech_.isReady_){if(e in $i)return function(e,t,n){return e.reduceRight(en(n),t[n]())}(this.middleware_,this.tech_,e);if(e in Zi)return Qi(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){if(void 0===this.tech_[e])throw ee("Video.js: "+e+" method not defined for "+this.techName_+" playback technology.",t),t;if("TypeError"===t.name)throw ee("Video.js: "+e+" unavailable on "+this.techName_+" playback technology element.",t),this.tech_.isReady_=!1,t;throw ee(t),t}}},n.play=function(){var e=this,t=this.options_.Promise||l.a.Promise;return t?new t((function(t){e.play_(t)})):this.play_()},n.play_=function(e){var t=this;void 0===e&&(e=hi),this.playCallbacks_.push(e);var n=Boolean(!this.changingSrc_&&(this.src()||this.currentSrc()));if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!n)return this.waitToPlay_=function(e){t.play_()},this.one(["ready","loadstart"],this.waitToPlay_),void(n||!Ae&&!xe||this.load());var r=this.techGet_("play");null===r?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(r)},n.runPlayTerminatedQueue_=function(){var e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach((function(q){q()}))},n.runPlayCallbacks_=function(e){var t=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],t.forEach((function(t){t(e)}))},n.pause=function(){this.techCall_("pause")},n.paused=function(){return!1!==this.techGet_("paused")},n.played=function(){return this.techGet_("played")||si(0,0)},n.scrubbing=function(e){if(void 0===e)return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")},n.currentTime=function(e){return void 0!==e?(e<0&&(e=0),this.isReady_&&!this.changingSrc_&&this.tech_&&this.tech_.isReady_?(this.techCall_("setCurrentTime",e),void(this.cache_.initTime=0)):(this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),void this.one("canplay",this.boundApplyInitTime_))):(this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime)},n.applyInitTime_=function(){this.currentTime(this.cache_.initTime)},n.duration=function(e){if(void 0===e)return void 0!==this.cache_.duration?this.cache_.duration:NaN;(e=parseFloat(e))<0&&(e=1/0),e!==this.cache_.duration&&(this.cache_.duration=e,e===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(e)||this.trigger("durationchange"))},n.remainingTime=function(){return this.duration()-this.currentTime()},n.remainingTimeDisplay=function(){return Math.floor(this.duration())-Math.floor(this.currentTime())},n.buffered=function(){var e=this.techGet_("buffered");return e&&e.length||(e=si(0,0)),e},n.bufferedPercent=function(){return oi(this.buffered(),this.duration())},n.bufferedEnd=function(){var e=this.buffered(),t=this.duration(),n=e.end(e.length-1);return n>t&&(n=t),n},n.volume=function(e){var t;return void 0!==e?(t=Math.max(0,Math.min(1,parseFloat(e))),this.cache_.volume=t,this.techCall_("setVolume",t),void(t>0&&this.lastVolume_(t))):(t=parseFloat(this.techGet_("volume")),isNaN(t)?1:t)},n.muted=function(e){if(void 0===e)return this.techGet_("muted")||!1;this.techCall_("setMuted",e)},n.defaultMuted=function(e){return void 0!==e?this.techCall_("setDefaultMuted",e):this.techGet_("defaultMuted")||!1},n.lastVolume_=function(e){if(void 0===e||0===e)return this.cache_.lastVolume;this.cache_.lastVolume=e},n.supportsFullScreen=function(){return this.techGet_("supportsFullScreen")||!1},n.isFullscreen=function(e){if(void 0!==e){var t=this.isFullscreen_;return this.isFullscreen_=Boolean(e),this.isFullscreen_!==t&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),void this.toggleFullscreenClass_()}return this.isFullscreen_},n.requestFullscreen=function(e){var t=this.options_.Promise||l.a.Promise;if(t){var n=this;return new t((function(t,r){function o(){n.off("fullscreenerror",c),n.off("fullscreenchange",l)}function l(){o(),t()}function c(e,t){o(),r(t)}n.one("fullscreenchange",l),n.one("fullscreenerror",c);var d=n.requestFullscreenHelper_(e);d&&(d.then(o,o),d.then(t,r))}))}return this.requestFullscreenHelper_()},n.requestFullscreenHelper_=function(e){var t,n=this;if(this.fsApi_.prefixed||(t=this.options_.fullscreen&&this.options_.fullscreen.options||{},void 0!==e&&(t=e)),this.fsApi_.requestFullscreen){var r=this.el_[this.fsApi_.requestFullscreen](t);return r&&r.then((function(){return n.isFullscreen(!0)}),(function(){return n.isFullscreen(!1)})),r}this.tech_.supportsFullScreen()&&!0==!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()},n.exitFullscreen=function(){var e=this.options_.Promise||l.a.Promise;if(e){var t=this;return new e((function(e,n){function r(){t.off("fullscreenerror",l),t.off("fullscreenchange",o)}function o(){r(),e()}function l(e,t){r(),n(t)}t.one("fullscreenchange",o),t.one("fullscreenerror",l);var c=t.exitFullscreenHelper_();c&&(c.then(r,r),c.then(e,n))}))}return this.exitFullscreenHelper_()},n.exitFullscreenHelper_=function(){var e=this;if(this.fsApi_.requestFullscreen){var t=d.a[this.fsApi_.exitFullscreen]();return t&&hi(t.then((function(){return e.isFullscreen(!1)}))),t}this.tech_.supportsFullScreen()&&!0==!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()},n.enterFullWindow=function(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=d.a.documentElement.style.overflow,It(d.a,"keydown",this.boundFullWindowOnEscKey_),d.a.documentElement.style.overflow="hidden",He(d.a.body,"vjs-full-window"),this.trigger("enterFullWindow")},n.fullWindowOnEscKey=function(e){v.a.isEventKey(e,"Esc")&&!0===this.isFullscreen()&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())},n.exitFullWindow=function(){this.isFullscreen(!1),this.isFullWindow=!1,xt(d.a,"keydown",this.boundFullWindowOnEscKey_),d.a.documentElement.style.overflow=this.docOrigOverflow,qe(d.a.body,"vjs-full-window"),this.trigger("exitFullWindow")},n.disablePictureInPicture=function(e){if(void 0===e)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")},n.isInPictureInPicture=function(e){return void 0!==e?(this.isInPictureInPicture_=!!e,void this.togglePictureInPictureClass_()):!!this.isInPictureInPicture_},n.requestPictureInPicture=function(){if("pictureInPictureEnabled"in d.a&&!1===this.disablePictureInPicture())return this.techGet_("requestPictureInPicture")},n.exitPictureInPicture=function(){if("pictureInPictureEnabled"in d.a)return d.a.exitPictureInPicture()},n.handleKeyDown=function(e){var t=this.options_.userActions;if(t&&t.hotkeys){(function(e){var t=e.tagName.toLowerCase();if(e.isContentEditable)return!0;if("input"===t)return-1===["button","checkbox","hidden","radio","reset","submit"].indexOf(e.type);return-1!==["textarea"].indexOf(t)})(this.el_.ownerDocument.activeElement)||("function"==typeof t.hotkeys?t.hotkeys.call(this,e):this.handleHotkeys(e))}},n.handleHotkeys=function(e){var t=this.options_.userActions?this.options_.userActions.hotkeys:{},n=t.fullscreenKey,r=void 0===n?function(e){return v.a.isEventKey(e,"f")}:n,o=t.muteKey,l=void 0===o?function(e){return v.a.isEventKey(e,"m")}:o,c=t.playPauseKey,h=void 0===c?function(e){return v.a.isEventKey(e,"k")||v.a.isEventKey(e,"Space")}:c;if(r.call(this,e)){e.preventDefault(),e.stopPropagation();var f=ni.getComponent("FullscreenToggle");!1!==d.a[this.fsApi_.fullscreenEnabled]&&f.prototype.handleClick.call(this,e)}else if(l.call(this,e)){e.preventDefault(),e.stopPropagation(),ni.getComponent("MuteToggle").prototype.handleClick.call(this,e)}else if(h.call(this,e)){e.preventDefault(),e.stopPropagation(),ni.getComponent("PlayToggle").prototype.handleClick.call(this,e)}},n.canPlayType=function(e){for(var t,i=0,n=this.options_.techOrder;i1?t.handleSrc_(n.slice(1)):(t.changingSrc_=!1,t.setTimeout((function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})}),0),void t.triggerReady());l=o,c=t.tech_,l.forEach((function(e){return e.setTech&&e.setTech(c)}))})),this.options_.retryOnError&&n.length>1){var r=function(){t.error(null),t.handleSrc_(n.slice(1),!0)},o=function(){t.off("error",r)};this.one("error",r),this.one("playing",o),this.resetRetryOnError_=function(){t.off("error",r),t.off("playing",o)}}}else this.setTimeout((function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})}),0)},n.src=function(source){return this.handleSrc_(source,!1)},n.src_=function(source){var e,t,n=this,r=this.selectSource([source]);return!r||(e=r.tech,t=this.techName_,$t(e)!==$t(t)?(this.changingSrc_=!0,this.loadTech_(r.tech,r.source),this.tech_.ready((function(){n.changingSrc_=!1})),!1):(this.ready((function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",source):this.techCall_("src",source.src),this.changingSrc_=!1}),!0),!1))},n.load=function(){this.techCall_("load")},n.reset=function(){var e=this,t=this.options_.Promise||l.a.Promise;this.paused()||!t?this.doReset_():hi(this.play().then((function(){return e.doReset_()})))},n.doReset_=function(){this.tech_&&this.tech_.clearTracks("text"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),jt(this)&&this.trigger("playerreset")},n.resetControlBarUI_=function(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()},n.resetProgressBar_=function(){this.currentTime(0);var e=this.controlBar,t=e.durationDisplay,n=e.remainingTimeDisplay;t&&t.updateContent(),n&&n.updateContent()},n.resetPlaybackRate_=function(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()},n.resetVolumeBar_=function(){this.volume(1),this.trigger("volumechange")},n.currentSources=function(){var source=this.currentSource(),e=[];return 0!==Object.keys(source).length&&e.push(source),this.cache_.sources||e},n.currentSource=function(){return this.cache_.source||{}},n.currentSrc=function(){return this.currentSource()&&this.currentSource().src||""},n.currentType=function(){return this.currentSource()&&this.currentSource().type||""},n.preload=function(e){return void 0!==e?(this.techCall_("setPreload",e),void(this.options_.preload=e)):this.techGet_("preload")},n.autoplay=function(e){if(void 0===e)return this.options_.autoplay||!1;var t;"string"==typeof e&&/(any|play|muted)/.test(e)||!0===e&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_("string"==typeof e?e:"play"),t=!1):this.options_.autoplay=!!e,t=void 0===t?this.options_.autoplay:t,this.tech_&&this.techCall_("setAutoplay",t)},n.playsinline=function(e){return void 0!==e?(this.techCall_("setPlaysinline",e),this.options_.playsinline=e,this):this.techGet_("playsinline")},n.loop=function(e){return void 0!==e?(this.techCall_("setLoop",e),void(this.options_.loop=e)):this.techGet_("loop")},n.poster=function(e){if(void 0===e)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))},n.handleTechPosterChange_=function(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){var e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}},n.controls=function(e){if(void 0===e)return!!this.controls_;e=!!e,this.controls_!==e&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),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_()))},n.usingNativeControls=function(e){if(void 0===e)return!!this.usingNativeControls_;e=!!e,this.usingNativeControls_!==e&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))},n.error=function(e){var t=this;if(void 0===e)return this.error_||null;if(X("beforeerror").forEach((function(n){var r=n(t,e);se(r)&&!Array.isArray(r)||"string"==typeof r||"number"==typeof r||null===r?e=r:t.log.error("please return a value that MediaError expects in beforeerror hooks")})),this.options_.suppressNotSupportedError&&e&&4===e.code){var n=function(){this.error(e)};return this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],n),void this.one("loadstart",(function(){this.off(["click","touchstart"],n)}))}if(null===e)return this.error_=e,this.removeClass("vjs-error"),void(this.errorDisplay&&this.errorDisplay.close());this.error_=new ui(e),this.addClass("vjs-error"),ee.error("(CODE:"+this.error_.code+" "+ui.errorTypes[this.error_.code]+")",this.error_.message,this.error_),this.trigger("error"),X("error").forEach((function(e){return e(t,t.error_)}))},n.reportUserActivity=function(e){this.userActivity_=!0},n.userActive=function(e){if(void 0===e)return this.userActive_;if((e=!!e)!==this.userActive_){if(this.userActive_=e,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(e){e.stopPropagation(),e.preventDefault()})),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}},n.listenForUserActivity_=function(){var e,t,n,r=Rt(this,this.reportUserActivity),o=function(t){r(),this.clearInterval(e)};this.on("mousedown",(function(){r(),this.clearInterval(e),e=this.setInterval(r,250)})),this.on("mousemove",(function(e){e.screenX===t&&e.screenY===n||(t=e.screenX,n=e.screenY,r())})),this.on("mouseup",o),this.on("mouseleave",o);var l,c=this.getChild("controlBar");!c||xe||me||(c.on("mouseenter",(function(e){0!==this.player().options_.inactivityTimeout&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0})),c.on("mouseleave",(function(e){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout}))),this.on("keydown",r),this.on("keyup",r),this.setInterval((function(){if(this.userActivity_){this.userActivity_=!1,this.userActive(!0),this.clearTimeout(l);var e=this.options_.inactivityTimeout;e<=0||(l=this.setTimeout((function(){this.userActivity_||this.userActive(!1)}),e))}}),250)},n.playbackRate=function(e){if(void 0===e)return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1;this.techCall_("setPlaybackRate",e)},n.defaultPlaybackRate=function(e){return void 0!==e?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1},n.isAudio=function(e){if(void 0===e)return!!this.isAudio_;this.isAudio_=!!e},n.enableAudioOnlyUI_=function(){var e=this;this.addClass("vjs-audio-only-mode");var t=this.children(),n=this.getChild("ControlBar"),r=n&&n.currentHeight();t.forEach((function(t){t!==n&&t.el_&&!t.hasClass("vjs-hidden")&&(t.hide(),e.audioOnlyCache_.hiddenChildren.push(t))})),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.height(r),this.trigger("audioonlymodechange")},n.disableAudioOnlyUI_=function(){this.removeClass("vjs-audio-only-mode"),this.audioOnlyCache_.hiddenChildren.forEach((function(e){return e.show()})),this.height(this.audioOnlyCache_.playerHeight),this.trigger("audioonlymodechange")},n.audioOnlyMode=function(e){var t=this;if("boolean"!=typeof e||e===this.audioOnlyMode_)return this.audioOnlyMode_;this.audioOnlyMode_=e;var n=this.options_.Promise||l.a.Promise;if(n){if(e){var r=[];return this.isInPictureInPicture()&&r.push(this.exitPictureInPicture()),this.isFullscreen()&&r.push(this.exitFullscreen()),this.audioPosterMode()&&r.push(this.audioPosterMode(!1)),n.all(r).then((function(){return t.enableAudioOnlyUI_()}))}return n.resolve().then((function(){return t.disableAudioOnlyUI_()}))}e?(this.isInPictureInPicture()&&this.exitPictureInPicture(),this.isFullscreen()&&this.exitFullscreen(),this.enableAudioOnlyUI_()):this.disableAudioOnlyUI_()},n.enablePosterModeUI_=function(){(this.tech_&&this.tech_).hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")},n.disablePosterModeUI_=function(){(this.tech_&&this.tech_).show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")},n.audioPosterMode=function(e){var t=this;if("boolean"!=typeof e||e===this.audioPosterMode_)return this.audioPosterMode_;this.audioPosterMode_=e;var n=this.options_.Promise||l.a.Promise;return n?e?this.audioOnlyMode()?this.audioOnlyMode(!1).then((function(){t.enablePosterModeUI_()})):n.resolve().then((function(){t.enablePosterModeUI_()})):n.resolve().then((function(){t.disablePosterModeUI_()})):e?(this.audioOnlyMode()&&this.audioOnlyMode(!1),void this.enablePosterModeUI_()):void this.disablePosterModeUI_()},n.addTextTrack=function(e,label,t){if(this.tech_)return this.tech_.addTextTrack(e,label,t)},n.addRemoteTextTrack=function(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)},n.removeRemoteTextTrack=function(e){void 0===e&&(e={});var track=e.track;if(track||(track=e),this.tech_)return this.tech_.removeRemoteTextTrack(track)},n.getVideoPlaybackQuality=function(){return this.techGet_("getVideoPlaybackQuality")},n.videoWidth=function(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0},n.videoHeight=function(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0},n.language=function(code){if(void 0===code)return this.language_;this.language_!==String(code).toLowerCase()&&(this.language_=String(code).toLowerCase(),jt(this)&&this.trigger("languagechange"))},n.languages=function(){return Jt(t.prototype.options_.languages,this.languages_)},n.toJSON=function(){var e=Jt(this.options_),t=e.tracks;e.tracks=[];for(var i=0;i"):function(){}},pa=1/30,fa=.1,ma=function(e,t){var i,n=[];if(e&&e.length)for(i=0;i=time}))},va=function(e,time){return ma(e,(function(e){return e-pa>=time}))},ya=function(e){var t=[];if(!e||!e.length)return"";for(var i=0;i "+e.end(i));return t.join(", ")},_a=function(e){for(var t=[],i=0;ir||(time+=t>n&&t<=r?r-t:r-n)}return time},Sa=la.createTimeRange,Ea=function(e,t){if(!t.preload)return t.duration;var n=0;return(t.parts||[]).forEach((function(p){n+=p.duration})),(t.preloadHints||[]).forEach((function(p){"PART"===p.type&&(n+=e.partTargetDuration)})),n},ka=function(e){return(e.segments||[]).reduce((function(e,t,n){return t.parts?t.parts.forEach((function(r,o){e.push({duration:r.duration,segmentIndex:n,partIndex:o,part:r,segment:t})})):e.push({duration:t.duration,segmentIndex:n,partIndex:null,segment:t,part:null}),e}),[])},Ca=function(e){var t=e.segments&&e.segments.length&&e.segments[e.segments.length-1];return t&&t.parts||[]},wa=function(e){var t=e.preloadSegment;if(t){var n=t.parts,r=(t.preloadHints||[]).reduce((function(e,t){return e+("PART"===t.type?1:0)}),0);return r+=n&&n.length?n.length:0}},Ia=function(e,t){if(t.endList)return 0;if(e&&e.suggestedPresentationDelay)return e.suggestedPresentationDelay;var n=Ca(t).length>0;return n&&t.serverControl&&t.serverControl.partHoldBack?t.serverControl.partHoldBack:n&&t.partTargetDuration?3*t.partTargetDuration:t.serverControl&&t.serverControl.holdBack?t.serverControl.holdBack:t.targetDuration?3*t.targetDuration:0},xa=function(e,t,n){if(void 0===t&&(t=e.mediaSequence+e.segments.length),to){var c=[o,r];r=c[0],o=c[1]}if(r<0){for(var i=r;iDate.now()},Da=function(e){return e.excludeUntil&&e.excludeUntil===1/0},Ma=function(e){var t=La(e);return!e.disabled&&!t},Ra=function(e,t){return t.attributes&&t.attributes[e]},Na=function(e,t){if(1===e.playlists.length)return!0;var n=t.attributes.BANDWIDTH||Number.MAX_VALUE;return 0===e.playlists.filter((function(e){return!!Ma(e)&&(e.attributes.BANDWIDTH||0)0)for(var m=h-1;m>=0;m--){var v=d[m];if(time+=v.duration,c){if(time<0)continue}else if(time+pa<=0)continue;return{partIndex:v.partIndex,segmentIndex:v.segmentIndex,startTime:l-Pa({defaultDuration:t.targetDuration,durationList:d,startIndex:h,endIndex:m})}}return{partIndex:d[0]&&d[0].partIndex||null,segmentIndex:d[0]&&d[0].segmentIndex||0,startTime:n}}if(h<0){for(var y=h;y<0;y++)if((time-=t.targetDuration)<0)return{partIndex:d[0]&&d[0].partIndex||null,segmentIndex:d[0]&&d[0].segmentIndex||0,startTime:n};h=0}for(var _=h;_0)continue}else if(time-pa>=0)continue;return{partIndex:T.partIndex,segmentIndex:T.segmentIndex,startTime:l+Pa({defaultDuration:t.targetDuration,durationList:d,startIndex:h,endIndex:_})}}return{segmentIndex:d[d.length-1].segmentIndex,partIndex:d[d.length-1].partIndex,startTime:n}},isEnabled:Ma,isDisabled:function(e){return e.disabled},isBlacklisted:La,isIncompatible:Da,playlistEnd:Oa,isAes:function(e){for(var i=0;i-1&&d!==c.length-1&&(n._HLS_part=d),(d>-1||c.length)&&o--}n._HLS_msn=o}if(t.serverControl&&t.serverControl.canSkipUntil&&(n._HLS_skip=t.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(n).length){var h=new l.a.URL(e);["_HLS_skip","_HLS_msn","_HLS_part"].forEach((function(e){n.hasOwnProperty(e)&&h.searchParams.set(e,n[e])})),e=h.toString()}return e}(n,t)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:n,withCredentials:this.withCredentials},(function(t,n){if(e.request)return t?e.playlistRequestError(e.request,e.media(),"HAVE_METADATA"):void e.haveMetadata({playlistString:e.request.responseText,url:e.media().uri,id:e.media().id})}))}},n.playlistRequestError=function(e,t,n){var r=t.uri,o=t.id;this.request=null,n&&(this.state=n),this.error={playlist:this.master.playlists[o],status:e.status,message:"HLS playlist request error at URL: "+r+".",responseText:e.responseText,code:e.status>=500?4:2},this.trigger("error")},n.parseManifest_=function(e){var t=this,n=e.url;return function(e){var t=e.onwarn,n=e.oninfo,r=e.manifestString,o=e.customTagParsers,l=void 0===o?[]:o,c=e.customTagMappers,d=void 0===c?[]:c,h=e.experimentalLLHLS,f=new M.a;t&&f.on("warn",t),n&&f.on("info",n),l.forEach((function(e){return f.addParser(e)})),d.forEach((function(e){return f.addTagMapper(e)})),f.push(r),f.end();var m=f.manifest;if(h||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach((function(e){m.hasOwnProperty(e)&&delete m[e]})),m.segments&&m.segments.forEach((function(e){["parts","preloadHints"].forEach((function(t){e.hasOwnProperty(t)&&delete e[t]}))}))),!m.targetDuration){var v=10;m.segments&&m.segments.length&&(v=m.segments.reduce((function(e,s){return Math.max(e,s.duration)}),0)),t&&t("manifest has no targetDuration defaulting to "+v),m.targetDuration=v}var y=Ca(m);if(y.length&&!m.partTargetDuration){var _=y.reduce((function(e,p){return Math.max(e,p.duration)}),0);t&&(t("manifest has no partTargetDuration defaulting to "+_),Ha.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.")),m.partTargetDuration=_}return m}({onwarn:function(e){var r=e.message;return t.logger_("m3u8-parser warn for "+n+": "+r)},oninfo:function(e){var r=e.message;return t.logger_("m3u8-parser info for "+n+": "+r)},manifestString:e.manifestString,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,experimentalLLHLS:this.experimentalLLHLS})},n.haveMetadata=function(e){var t=e.playlistString,n=e.playlistObject,r=e.url,o=e.id;this.request=null,this.state="HAVE_METADATA";var l=n||this.parseManifest_({url:r,manifestString:t});l.lastRequest=Date.now(),Wa({playlist:l,uri:r,id:o});var c=Ja(this.master,l);this.targetDuration=l.partTargetDuration||l.targetDuration,this.pendingMedia_=null,c?(this.master=c,this.media_=this.master.playlists[o]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(Za(this.media(),!!c)),this.trigger("loadedplaylist")},n.dispose=function(){this.trigger("dispose"),this.stopRequest(),l.a.clearTimeout(this.mediaUpdateTimeout),l.a.clearTimeout(this.finalRenditionTimeout),this.off()},n.stopRequest=function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}},n.media=function(e,t){var n=this;if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);if("string"==typeof e){if(!this.master.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.master.playlists[e]}if(l.a.clearTimeout(this.finalRenditionTimeout),t){var r=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=l.a.setTimeout(this.media.bind(this,e,!1),r)}else{var o=this.state,c=!this.media_||e.id!==this.media_.id,d=this.master.playlists[e.id];if(d&&d.endList||e.endList&&e.segments.length)return this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,void(c&&(this.trigger("mediachanging"),"HAVE_MASTER"===o?this.trigger("loadedmetadata"):this.trigger("mediachange")));if(this.updateMediaUpdateTimeout_(Za(e,!0)),c){if(this.state="SWITCHING_MEDIA",this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=e,this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials},(function(t,r){if(n.request){if(e.lastRequest=Date.now(),e.resolvedUri=da(n.handleManifestRedirects,e.resolvedUri,r),t)return n.playlistRequestError(n.request,e,o);n.haveMetadata({playlistString:r.responseText,url:e.uri,id:e.id}),"HAVE_MASTER"===o?n.trigger("loadedmetadata"):n.trigger("mediachange")}}))}}},n.pause=function(){this.mediaUpdateTimeout&&(l.a.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),"HAVE_NOTHING"===this.state&&(this.started=!1),"SWITCHING_MEDIA"===this.state?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MASTER":"HAVE_CURRENT_METADATA"===this.state&&(this.state="HAVE_METADATA")},n.load=function(e){var t=this;this.mediaUpdateTimeout&&(l.a.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);var n=this.media();if(e){var r=n?(n.partTargetDuration||n.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=l.a.setTimeout((function(){t.mediaUpdateTimeout=null,t.load()}),r)}else this.started?n&&!n.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist"):this.start()},n.updateMediaUpdateTimeout_=function(e){var t=this;this.mediaUpdateTimeout&&(l.a.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.media()&&!this.media().endList&&(this.mediaUpdateTimeout=l.a.setTimeout((function(){t.mediaUpdateTimeout=null,t.trigger("mediaupdatetimeout"),t.updateMediaUpdateTimeout_(e)}),e))},n.start=function(){var e=this;if(this.started=!0,"object"==typeof this.src)return this.src.uri||(this.src.uri=l.a.location.href),this.src.resolvedUri=this.src.uri,void setTimeout((function(){e.setupInitialPlaylist(e.src)}),0);this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials},(function(t,n){if(e.request){if(e.request=null,t)return e.error={status:n.status,message:"HLS playlist request error at URL: "+e.src+".",responseText:n.responseText,code:2},"HAVE_NOTHING"===e.state&&(e.started=!1),e.trigger("error");e.src=da(e.handleManifestRedirects,e.src,n);var r=e.parseManifest_({manifestString:n.responseText,url:e.src});e.setupInitialPlaylist(r)}}))},n.srcUri=function(){return"string"==typeof this.src?this.src:this.src.uri},n.setupInitialPlaylist=function(e){if(this.state="HAVE_MASTER",e.playlists)return this.master=e,za(this.master,this.srcUri()),e.playlists.forEach((function(e){e.segments=Qa(e),e.segments.forEach((function(t){Ya(t,e.resolvedUri)}))})),this.trigger("loadedplaylist"),void(this.request||this.media(this.master.playlists[0]));var t=this.srcUri()||l.a.location.href;this.master=function(e,t){var n=qa(0,t),r={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:l.a.location.href,resolvedUri:l.a.location.href,playlists:[{uri:t,id:n,resolvedUri:t,attributes:{}}]};return r.playlists[n]=r.playlists[0],r.playlists[t]=r.playlists[0],r}(0,t),this.haveMetadata({playlistObject:e,url:t,id:this.master.playlists[0].id}),this.trigger("loadedmetadata")},t}(Xa),ts=la.xhr,is=la.mergeOptions,ns=function(e,t,n,r){var o="arraybuffer"===e.responseType?e.response:e.responseText;!t&&o&&(e.responseTime=Date.now(),e.roundTripTime=e.responseTime-e.requestTime,e.bytesReceived=o.byteLength||o.length,e.bandwidth||(e.bandwidth=Math.floor(e.bytesReceived/e.roundTripTime*8*1e3))),n.headers&&(e.responseHeaders=n.headers),t&&"ETIMEDOUT"===t.code&&(e.timedout=!0),t||e.aborted||200===n.statusCode||206===n.statusCode||0===n.statusCode||(t=new Error("XHR Failed with a response of: "+(e&&(o||e.responseText)))),r(t,e)},rs=function(){var e=function e(t,n){t=is({timeout:45e3},t);var r=e.beforeRequest||la.Vhs.xhr.beforeRequest;if(r&&"function"==typeof r){var o=r(t);o&&(t=o)}var l=(!0===la.Vhs.xhr.original?ts:la.Vhs.xhr)(t,(function(e,t){return ns(l,e,t,n)})),c=l.abort;return l.abort=function(){return l.aborted=!0,c.apply(l,arguments)},l.uri=t.uri,l.requestTime=Date.now(),l};return e.original=!0,e},as=function(e){var t,n={};return e.byterange&&(n.Range="bytes="+(t=e.byterange).offset+"-"+("bigint"==typeof t.offset||"bigint"==typeof t.length?l.a.BigInt(t.offset)+l.a.BigInt(t.length)-l.a.BigInt(1):t.offset+t.length-1)),n},ss=function(e,i){return e.start(i)+"-"+e.end(i)},os=function(e,i){var t=e.toString(16);return"00".substring(0,2-t.length)+t+(i%2?" ":"")},us=function(e){return e>=32&&e<126?String.fromCharCode(e):"."},ls=function(e){var t={};return Object.keys(e).forEach((function(n){var r=e[n];Object(U.e)(r)?t[n]={bytes:r.buffer,byteOffset:r.byteOffset,byteLength:r.byteLength}:t[n]=r})),t},cs=function(e){var t=e.byterange||{length:1/0,offset:0};return[t.length,t.offset,e.resolvedUri].join(",")},ds=function(e){return e.resolvedUri},hs=function(data){for(var e=Array.prototype.slice.call(data),t=16,n="",r=0;rn){if(time>n+.25*r.duration)return null;t=r}return{segment:t,estimatedStart:t.videoTimingInfo?t.videoTimingInfo.transmuxedPresentationStart:n-t.duration,type:t.videoTimingInfo?"accurate":"estimate"}}(time,t);if(!o)return r({message:"valid programTime was not found"});if("estimate"===o.type)return r({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:o.estimatedStart});var l={mediaSeconds:time},c=function(e,t){if(!t.dateTimeObject)return null;var n=t.videoTimingInfo.transmuxerPrependedSeconds,r=e-(t.videoTimingInfo.transmuxedPresentationStart+n);return new Date(t.dateTimeObject.getTime()+1e3*r)}(time,o.segment);return c&&(l.programDateTime=c.toISOString()),r(null,l)},ms=function e(t){var n=t.programTime,r=t.playlist,o=t.retryCount,l=void 0===o?2:o,c=t.seekTo,d=t.pauseAfterSeek,h=void 0===d||d,f=t.tech,m=t.callback;if(!m)throw new Error("seekToProgramTime: callback must be provided");if(void 0===n||!r||!c)return m({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!r.endList&&!f.hasStarted_)return m({message:"player must be playing a live stream to start buffering"});if(!function(e){if(!e.segments||0===e.segments.length)return!1;for(var i=0;inew Date(c.getTime()+1e3*d)?null:(n>c&&(r=l),{segment:r,estimatedStart:r.videoTimingInfo?r.videoTimingInfo.transmuxedPresentationStart:Fa.duration(t,t.mediaSequence+t.segments.indexOf(r)),type:r.videoTimingInfo?"accurate":"estimate"})}(n,r);if(!v)return m({message:n+" was not found in the stream"});var y=v.segment,_=function(e,t){var n,r;try{n=new Date(e),r=new Date(t)}catch(e){}var o=n.getTime();return(r.getTime()-o)/1e3}(y.dateTimeObject,n);if("estimate"===v.type)return 0===l?m({message:n+" is not buffered yet. Try again"}):(c(v.estimatedStart+_),void f.one("seeked",(function(){e({programTime:n,playlist:r,retryCount:l-1,seekTo:c,pauseAfterSeek:h,tech:f,callback:m})})));var T=y.start+_;f.one("seeked",(function(){return m(null,f.currentTime())})),h&&f.pause(),c(T)},gs=function(e,t){if(4===e.readyState)return t()},vs=la.EventTarget,ys=la.mergeOptions,_s=function(a,b){if(!$a(a,b))return!1;if(a.sidx&&b.sidx&&(a.sidx.offset!==b.sidx.offset||a.sidx.length!==b.sidx.length))return!1;if(!a.sidx&&b.sidx||a.sidx&&!b.sidx)return!1;if(a.segments&&!b.segments||!a.segments&&b.segments)return!1;if(!a.segments&&!b.segments)return!0;for(var i=0;i=m+f)return d(t,{response:l.subarray(f,f+m),status:n.status,uri:n.uri});r.request=r.vhs_.xhr({uri:c,responseType:"arraybuffer",headers:as({byterange:e.sidx.byterange})},d)}))}else this.mediaRequest_=l.a.setTimeout((function(){return n(!1)}),0)},n.dispose=function(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},l.a.clearTimeout(this.minimumUpdatePeriodTimeout_),l.a.clearTimeout(this.mediaRequest_),l.a.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.off()},n.hasPendingRequest=function(){return this.request||this.mediaRequest_},n.stopRequest=function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}},n.media=function(e){var t=this;if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);var n=this.state;if("string"==typeof e){if(!this.masterPlaylistLoader_.master.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.masterPlaylistLoader_.master.playlists[e]}var r=!this.media_||e.id!==this.media_.id;if(r&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList)return this.state="HAVE_METADATA",this.media_=e,void(r&&(this.trigger("mediachanging"),this.trigger("mediachange")));r&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,n,(function(r){t.haveMetadata({startingState:n,playlist:e})})))},n.haveMetadata=function(e){var t=e.startingState,n=e.playlist;this.state="HAVE_METADATA",this.loadedPlaylists_[n.id]=n,this.mediaRequest_=null,this.refreshMedia_(n.id),"HAVE_MASTER"===t?this.trigger("loadedmetadata"):this.trigger("mediachange")},n.pause=function(){this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),l.a.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMaster_&&(l.a.clearTimeout(this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_),this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_=null),"HAVE_NOTHING"===this.state&&(this.started=!1)},n.load=function(e){var t=this;l.a.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;var n=this.media();if(e){var r=n?n.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=l.a.setTimeout((function(){return t.load()}),r)}else this.started?n&&!n.endList?(this.isMaster_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist"):this.start()},n.start=function(){var e=this;this.started=!0,this.isMaster_?this.requestMaster_((function(t,n){e.haveMaster_(),e.hasPendingRequest()||e.media_||e.media(e.masterPlaylistLoader_.master.playlists[0])})):this.mediaRequest_=l.a.setTimeout((function(){return e.haveMaster_()}),0)},n.requestMaster_=function(e){var t=this;this.request=this.vhs_.xhr({uri:this.masterPlaylistLoader_.srcUrl,withCredentials:this.withCredentials},(function(n,r){if(!t.requestErrored_(n,r)){var o=r.responseText!==t.masterPlaylistLoader_.masterXml_;return t.masterPlaylistLoader_.masterXml_=r.responseText,r.responseHeaders&&r.responseHeaders.date?t.masterLoaded_=Date.parse(r.responseHeaders.date):t.masterLoaded_=Date.now(),t.masterPlaylistLoader_.srcUrl=da(t.handleManifestRedirects,t.masterPlaylistLoader_.srcUrl,r),o?(t.handleMaster_(),void t.syncClientServerClock_((function(){return e(r,o)}))):e(r,o)}"HAVE_NOTHING"===t.state&&(t.started=!1)}))},n.syncClientServerClock_=function(e){var t=this,n=Object(B.d)(this.masterPlaylistLoader_.masterXml_);return null===n?(this.masterPlaylistLoader_.clientOffset_=this.masterLoaded_-Date.now(),e()):"DIRECT"===n.method?(this.masterPlaylistLoader_.clientOffset_=n.value-Date.now(),e()):void(this.request=this.vhs_.xhr({uri:ca(this.masterPlaylistLoader_.srcUrl,n.value),method:n.method,withCredentials:this.withCredentials},(function(r,o){if(t.request){if(r)return t.masterPlaylistLoader_.clientOffset_=t.masterLoaded_-Date.now(),e();var l;l="HEAD"===n.method?o.responseHeaders&&o.responseHeaders.date?Date.parse(o.responseHeaders.date):t.masterLoaded_:Date.parse(o.responseText),t.masterPlaylistLoader_.clientOffset_=l-Date.now(),e()}})))},n.haveMaster_=function(){this.state="HAVE_MASTER",this.isMaster_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)},n.handleMaster_=function(){this.mediaRequest_=null;var e,t,n,r,o,l,c,d=this.masterPlaylistLoader_.master,h=(e={masterXml:this.masterPlaylistLoader_.masterXml_,srcUrl:this.masterPlaylistLoader_.srcUrl,clientOffset:this.masterPlaylistLoader_.clientOffset_,sidxMapping:this.masterPlaylistLoader_.sidxMapping_,previousManifest:d},t=e.masterXml,n=e.srcUrl,r=e.clientOffset,o=e.sidxMapping,l=e.previousManifest,c=Object(B.c)(t,{manifestUri:n,clientOffset:r,sidxMapping:o,previousManifest:l}),za(c,n),c);d&&(h=function(e,t,n){for(var r=!0,o=ys(e,{duration:t.duration,minimumUpdatePeriod:t.minimumUpdatePeriod,timelineStarts:t.timelineStarts}),i=0;i-1)},this.trigger=function(t){var n,i,r,o;if(n=e[t])if(2===arguments.length)for(r=n.length,i=0;i>>1,track.samplingfrequencyindex<<7|track.channelcount<<3,6,1,2]))},E=function(e){return n(P.hdlr,N[e])},S=function(track){var e=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,track.duration>>>24&255,track.duration>>>16&255,track.duration>>>8&255,255&track.duration,85,196,0,0]);return track.samplerate&&(e[12]=track.samplerate>>>24&255,e[13]=track.samplerate>>>16&255,e[14]=track.samplerate>>>8&255,e[15]=255&track.samplerate),n(P.mdhd,e)},T=function(track){return n(P.mdia,S(track),E(track.type),d(track))},c=function(e){return n(P.mfhd,new Uint8Array([0,0,0,0,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e]))},d=function(track){return n(P.minf,"video"===track.type?n(P.vmhd,U):n(P.smhd,B),r(),C(track))},h=function(e,t){for(var r=[],i=t.length;i--;)r[i]=I(t[i]);return n.apply(null,[P.moof,c(e)].concat(r))},f=function(e){for(var i=e.length,t=[];i--;)t[i]=y(e[i]);return n.apply(null,[P.moov,v(4294967295)].concat(t).concat(m(e)))},m=function(e){for(var i=e.length,t=[];i--;)t[i]=x(e[i]);return n.apply(null,[P.mvex].concat(t))},v=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return n(P.mvhd,t)},k=function(track){var e,i,t=track.samples||[],r=new Uint8Array(4+t.length);for(i=0;i>>8),o.push(255&t[i].byteLength),o=o.concat(Array.prototype.slice.call(t[i]));for(i=0;i>>8),l.push(255&r[i].byteLength),l=l.concat(Array.prototype.slice.call(r[i]));if(e=[P.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(65280&track.width)>>8,255&track.width,(65280&track.height)>>8,255&track.height,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),n(P.avcC,new Uint8Array([1,track.profileIdc,track.profileCompatibility,track.levelIdc,255].concat([t.length],o,[r.length],l))),n(P.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],track.sarRatio){var c=track.sarRatio[0],d=track.sarRatio[1];e.push(n(P.pasp,new Uint8Array([(4278190080&c)>>24,(16711680&c)>>16,(65280&c)>>8,255&c,(4278190080&d)>>24,(16711680&d)>>16,(65280&d)>>8,255&d])))}return n.apply(null,e)},G=function(track){return n(P.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&track.channelcount)>>8,255&track.channelcount,(65280&track.samplesize)>>8,255&track.samplesize,0,0,0,0,(65280&track.samplerate)>>8,255&track.samplerate,0,0]),o(track))},_=function(track){var e=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&track.id)>>24,(16711680&track.id)>>16,(65280&track.id)>>8,255&track.id,0,0,0,0,(4278190080&track.duration)>>24,(16711680&track.duration)>>16,(65280&track.duration)>>8,255&track.duration,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(65280&track.width)>>8,255&track.width,0,0,(65280&track.height)>>8,255&track.height,0,0]);return n(P.tkhd,e)},I=function(track){var e,t,r,o,l,c;return e=n(P.tfhd,new Uint8Array([0,0,0,58,(4278190080&track.id)>>24,(16711680&track.id)>>16,(65280&track.id)>>8,255&track.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),l=Math.floor(track.baseMediaDecodeTime/Z),c=Math.floor(track.baseMediaDecodeTime%Z),t=n(P.tfdt,new Uint8Array([1,0,0,0,l>>>24&255,l>>>16&255,l>>>8&255,255&l,c>>>24&255,c>>>16&255,c>>>8&255,255&c])),92,"audio"===track.type?(r=A(track,92),n(P.traf,e,t,r)):(o=k(track),r=A(track,o.length+92),n(P.traf,e,t,r,o))},y=function(track){return track.duration=track.duration||4294967295,n(P.trak,_(track),T(track))},x=function(track){var e=new Uint8Array([0,0,0,0,(4278190080&track.id)>>24,(16711680&track.id)>>16,(65280&track.id)>>8,255&track.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return"video"!==track.type&&(e[e.length-1]=0),n(P.trex,e)},Y=function(e,t){var n=0,r=0,o=0,l=0;return e.length&&(void 0!==e[0].duration&&(n=1),void 0!==e[0].size&&(r=2),void 0!==e[0].flags&&(o=4),void 0!==e[0].compositionTimeOffset&&(l=8)),[0,0,n|r|o|l,1,(4278190080&e.length)>>>24,(16711680&e.length)>>>16,(65280&e.length)>>>8,255&e.length,(4278190080&t)>>>24,(16711680&t)>>>16,(65280&t)>>>8,255&t]},K=function(track,e){var t,r,header,o,l,i;for(e+=20+16*(o=track.samples||[]).length,header=Y(o,e),(r=new Uint8Array(header.length+16*o.length)).set(header),t=header.length,i=0;i>>24,r[t++]=(16711680&l.duration)>>>16,r[t++]=(65280&l.duration)>>>8,r[t++]=255&l.duration,r[t++]=(4278190080&l.size)>>>24,r[t++]=(16711680&l.size)>>>16,r[t++]=(65280&l.size)>>>8,r[t++]=255&l.size,r[t++]=l.flags.isLeading<<2|l.flags.dependsOn,r[t++]=l.flags.isDependedOn<<6|l.flags.hasRedundancy<<4|l.flags.paddingValue<<1|l.flags.isNonSyncSample,r[t++]=61440&l.flags.degradationPriority,r[t++]=15&l.flags.degradationPriority,r[t++]=(4278190080&l.compositionTimeOffset)>>>24,r[t++]=(16711680&l.compositionTimeOffset)>>>16,r[t++]=(65280&l.compositionTimeOffset)>>>8,r[t++]=255&l.compositionTimeOffset;return n(P.trun,r)},X=function(track,e){var t,r,header,o,l,i;for(e+=20+8*(o=track.samples||[]).length,header=Y(o,e),(t=new Uint8Array(header.length+8*o.length)).set(header),r=header.length,i=0;i>>24,t[r++]=(16711680&l.duration)>>>16,t[r++]=(65280&l.duration)>>>8,t[r++]=255&l.duration,t[r++]=(4278190080&l.size)>>>24,t[r++]=(16711680&l.size)>>>16,t[r++]=(65280&l.size)>>>8,t[r++]=255&l.size;return n(P.trun,t)},A=function(track,e){return"audio"===track.type?X(track,e):K(track,e)};l=function(){return n(P.ftyp,O,L,O,D)};var ee,te,ie,ne,re,ae,se,oe,ue=function(data){return n(P.mdat,data)},le=h,ce=function(e){var t,n=l(),r=f(e);return(t=new Uint8Array(n.byteLength+r.byteLength)).set(n),t.set(r,n.byteLength),t},de=function(e,t){var n={size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}};return n.dataOffset=t,n.compositionTimeOffset=e.pts-e.dts,n.duration=e.duration,n.size=4*e.length,n.size+=e.byteLength,e.keyFrame&&(n.flags.dependsOn=2,n.flags.isNonSyncSample=0),n},he=function(e){var i,t,n=[],r=[];for(r.byteLength=0,r.nalCount=0,r.duration=0,n.byteLength=0,i=0;i1&&(t=e.shift(),e.byteLength-=t.byteLength,e.nalCount-=t.nalCount,e[0][0].dts=t.dts,e[0][0].pts=t.pts,e[0][0].duration+=t.duration),e},me=function(e,t){var n,i,r,o,l,c=t||0,d=[];for(n=0;nSe/2))){for((l=be()[track.samplerate])||(l=e[0].data),i=0;i=t?e:(track.minSegmentDts=1/0,e.filter((function(e){return e.dts>=t&&(track.minSegmentDts=Math.min(track.minSegmentDts,e.dts),track.minSegmentPts=track.minSegmentDts,!0)})))},Pe=function(e){var i,t,n=[];for(i=0;i=this.virtualRowCount&&"function"==typeof this.beforeRowOverflow&&this.beforeRowOverflow(e),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},We.prototype.isEmpty=function(){return 0===this.rows.length||1===this.rows.length&&""===this.rows[0]},We.prototype.addText=function(text){this.rows[this.rowIdx]+=text},We.prototype.backspace=function(){if(!this.isEmpty()){var e=this.rows[this.rowIdx];this.rows[this.rowIdx]=e.substr(0,e.length-1)}};var ze=function(e,t,n){this.serviceNum=e,this.text="",this.currentWindow=new We(-1),this.windows=[],this.stream=n,"string"==typeof t&&this.createTextDecoder(t)};ze.prototype.init=function(e,t){this.startPts=e;for(var n=0;n<8;n++)this.windows[n]=new We(n),"function"==typeof t&&(this.windows[n].beforeRowOverflow=t)},ze.prototype.setCurrentWindow=function(e){this.currentWindow=this.windows[e]},ze.prototype.createTextDecoder=function(e){if("undefined"==typeof TextDecoder)this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(e)}catch(t){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+e+" encoding. "+t})}};var Ge=function e(t){t=t||{},e.prototype.init.call(this);var n,r=this,o=t.captionServices||{},l={};Object.keys(o).forEach((function(e){n=o[e],/^SERVICE/.test(e)&&(l[e]=n.encoding)})),this.serviceEncodings=l,this.current708Packet=null,this.services={},this.push=function(e){3===e.type?(r.new708Packet(),r.add708Bytes(e)):(null===r.current708Packet&&r.new708Packet(),r.add708Bytes(e))}};Ge.prototype=new Q,Ge.prototype.new708Packet=function(){null!==this.current708Packet&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},Ge.prototype.add708Bytes=function(e){var data=e.ccData,t=data>>>8,n=255&data;this.current708Packet.ptsVals.push(e.pts),this.current708Packet.data.push(t),this.current708Packet.data.push(n)},Ge.prototype.push708Packet=function(){var e=this.current708Packet,t=e.data,n=null,r=null,i=0,b=t[i++];for(e.seq=b>>6,e.sizeCode=63&b;i>5)&&r>0&&(n=b=t[i++]),this.pushServiceBlock(n,i,r),r>0&&(i+=r-1)},Ge.prototype.pushServiceBlock=function(e,t,n){var b,i=t,r=this.current708Packet.data,o=this.services[e];for(o||(o=this.initService(e,i));i>5,r.rowLock=(16&b)>>4,r.columnLock=(8&b)>>3,r.priority=7&b,b=t[++i],r.relativePositioning=(128&b)>>7,r.anchorVertical=127&b,b=t[++i],r.anchorHorizontal=b,b=t[++i],r.anchorPoint=(240&b)>>4,r.rowCount=15&b,b=t[++i],r.columnCount=63&b,b=t[++i],r.windowStyle=(56&b)>>3,r.penStyle=7&b,r.virtualRowCount=r.rowCount+1,i},Ge.prototype.setWindowAttributes=function(i,e){var t=this.current708Packet.data,b=t[i],n=e.currentWindow.winAttr;return b=t[++i],n.fillOpacity=(192&b)>>6,n.fillRed=(48&b)>>4,n.fillGreen=(12&b)>>2,n.fillBlue=3&b,b=t[++i],n.borderType=(192&b)>>6,n.borderRed=(48&b)>>4,n.borderGreen=(12&b)>>2,n.borderBlue=3&b,b=t[++i],n.borderType+=(128&b)>>5,n.wordWrap=(64&b)>>6,n.printDirection=(48&b)>>4,n.scrollDirection=(12&b)>>2,n.justify=3&b,b=t[++i],n.effectSpeed=(240&b)>>4,n.effectDirection=(12&b)>>2,n.displayEffect=3&b,i},Ge.prototype.flushDisplayed=function(e,t){for(var n=[],r=0;r<8;r++)t.windows[r].visible&&!t.windows[r].isEmpty()&&n.push(t.windows[r].getText());t.endPts=e,t.text=n.join("\n\n"),this.pushCaption(t),t.startPts=e},Ge.prototype.pushCaption=function(e){""!==e.text&&(this.trigger("data",{startPts:e.startPts,endPts:e.endPts,text:e.text,stream:"cc708_"+e.serviceNum}),e.text="",e.startPts=e.endPts)},Ge.prototype.displayWindows=function(i,e){var b=this.current708Packet.data[++i],t=this.getPts(i);this.flushDisplayed(t,e);for(var n=0;n<8;n++)b&1<>4,n.offset=(12&b)>>2,n.penSize=3&b,b=t[++i],n.italics=(128&b)>>7,n.underline=(64&b)>>6,n.edgeType=(56&b)>>3,n.fontStyle=7&b,i},Ge.prototype.setPenColor=function(i,e){var t=this.current708Packet.data,b=t[i],n=e.currentWindow.penColor;return b=t[++i],n.fgOpacity=(192&b)>>6,n.fgRed=(48&b)>>4,n.fgGreen=(12&b)>>2,n.fgBlue=3&b,b=t[++i],n.bgOpacity=(192&b)>>6,n.bgRed=(48&b)>>4,n.bgGreen=(12&b)>>2,n.bgBlue=3&b,b=t[++i],n.edgeRed=(48&b)>>4,n.edgeGreen=(12&b)>>2,n.edgeBlue=3&b,i},Ge.prototype.setPenLocation=function(i,e){var t=this.current708Packet.data,b=t[i],n=e.currentWindow.penLoc;return e.currentWindow.pendingNewLine=!0,b=t[++i],n.row=15&b,b=t[++i],n.column=63&b,i},Ge.prototype.reset=function(i,e){var t=this.getPts(i);return this.flushDisplayed(t,e),this.initService(e.serviceNum,i)};var Xe={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},Ke=function(code){return null===code?"":(code=Xe[code]||code,String.fromCharCode(code))},Ye=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],Qe=function(){for(var e=[],i=15;i--;)e.push("");return e},$e=function e(t,n){e.prototype.init.call(this),this.field_=t||0,this.dataChannel_=n||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(e){var data,t,n,r,text;if((data=32639&e.ccData)!==this.lastControlCode_){if(4096==(61440&data)?this.lastControlCode_=data:data!==this.PADDING_&&(this.lastControlCode_=null),n=data>>>8,r=255&data,data!==this.PADDING_)if(data===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(data===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(e.pts),this.flushDisplayed(e.pts),t=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=t,this.startPts_=e.pts;else if(data===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(e.pts);else if(data===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(e.pts);else if(data===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(e.pts);else if(data===this.CARRIAGE_RETURN_)this.clearFormatting(e.pts),this.flushDisplayed(e.pts),this.shiftRowsUp_(),this.startPts_=e.pts;else if(data===this.BACKSPACE_)"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1);else if(data===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(e.pts),this.displayed_=Qe();else if(data===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=Qe();else if(data===this.RESUME_DIRECT_CAPTIONING_)"paintOn"!==this.mode_&&(this.flushDisplayed(e.pts),this.displayed_=Qe()),this.mode_="paintOn",this.startPts_=e.pts;else if(this.isSpecialCharacter(n,r))text=Ke((n=(3&n)<<8)|r),this[this.mode_](e.pts,text),this.column_++;else if(this.isExtCharacter(n,r))"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1),text=Ke((n=(3&n)<<8)|r),this[this.mode_](e.pts,text),this.column_++;else if(this.isMidRowCode(n,r))this.clearFormatting(e.pts),this[this.mode_](e.pts," "),this.column_++,14==(14&r)&&this.addFormatting(e.pts,["i"]),1==(1&r)&&this.addFormatting(e.pts,["u"]);else if(this.isOffsetControlCode(n,r))this.column_+=3&r;else if(this.isPAC(n,r)){var o=Ye.indexOf(7968&data);"rollUp"===this.mode_&&(o-this.rollUpRows_+1<0&&(o=this.rollUpRows_-1),this.setRollUp(e.pts,o)),o!==this.row_&&(this.clearFormatting(e.pts),this.row_=o),1&r&&-1===this.formatting_.indexOf("u")&&this.addFormatting(e.pts,["u"]),16==(16&data)&&(this.column_=4*((14&data)>>1)),this.isColorPAC(r)&&14==(14&r)&&this.addFormatting(e.pts,["i"])}else this.isNormalChar(n)&&(0===r&&(r=null),text=Ke(n),text+=Ke(r),this[this.mode_](e.pts,text),this.column_+=text.length)}else this.lastControlCode_=null}};$e.prototype=new Q,$e.prototype.flushDisplayed=function(e){var content=this.displayed_.map((function(e,t){try{return e.trim()}catch(e){return this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+t+"."}),""}}),this).join("\n").replace(/^\n+|\n+$/g,"");content.length&&this.trigger("data",{startPts:this.startPts_,endPts:e,text:content,stream:this.name_})},$e.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=Qe(),this.nonDisplayed_=Qe(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,this.formatting_=[]},$e.prototype.setConstants=function(){0===this.dataChannel_?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):1===this.dataChannel_&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_},$e.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&t>=48&&t<=63},$e.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&t>=32&&t<=63},$e.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&t>=32&&t<=47},$e.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&t>=33&&t<=35},$e.prototype.isPAC=function(e,t){return e>=this.BASE_&&e=64&&t<=127},$e.prototype.isColorPAC=function(e){return e>=64&&e<=79||e>=96&&e<=127},$e.prototype.isNormalChar=function(e){return e>=32&&e<=127},$e.prototype.setRollUp=function(e,t){if("rollUp"!==this.mode_&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(e),this.nonDisplayed_=Qe(),this.displayed_=Qe()),void 0!==t&&t!==this.row_)for(var i=0;i"}),"");this[this.mode_](e,text)},$e.prototype.clearFormatting=function(e){if(this.formatting_.length){var text=this.formatting_.reverse().reduce((function(text,e){return text+""}),"");this.formatting_=[],this[this.mode_](e,text)}},$e.prototype.popOn=function(e,text){var t=this.nonDisplayed_[this.row_];t+=text,this.nonDisplayed_[this.row_]=t},$e.prototype.rollUp=function(e,text){var t=this.displayed_[this.row_];t+=text,this.displayed_[this.row_]=t},$e.prototype.shiftRowsUp_=function(){var i;for(i=0;it&&(n=-1);Math.abs(t-e)>4294967296;)e+=8589934592*n;return e},it=function e(t){var n,r;e.prototype.init.call(this),this.type_=t||et,this.push=function(data){this.type_!==et&&data.type!==this.type_||(void 0===r&&(r=data.dts),data.dts=tt(data.dts,r),data.pts=tt(data.pts,r),n=data.dts,this.trigger("data",data))},this.flush=function(){r=n,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){r=void 0,n=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};it.prototype=new Q;var nt,at=it,st=tt,ot=function(e,t,n){var i,r="";for(i=t;i>>2;f*=4,f+=3&h[7],d.timeStamp=f,void 0===t.pts&&void 0===t.dts&&(t.pts=d.timeStamp,t.dts=d.timeStamp),this.trigger("timestamp",d)}t.frames.push(d),l+=10,l+=c}while(l>>4>1&&(r+=t[r]+1),0===n.pid)n.type="pat",e(t.subarray(r),n),this.trigger("data",n);else if(n.pid===this.pmtPid)for(n.type="pmt",e(t.subarray(r),n),this.trigger("data",n);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else void 0===this.programMapTable?this.packetsWaitingForPmt.push([t,r,n]):this.processPes_(t,r,n)},this.processPes_=function(e,t,n){n.pid===this.programMapTable.video?n.streamType=Ze.H264_STREAM_TYPE:n.pid===this.programMapTable.audio?n.streamType=Ze.ADTS_STREAM_TYPE:n.streamType=this.programMapTable["timed-metadata"][n.pid],n.type="pes",n.data=e.subarray(t),this.trigger("data",n)}}).prototype=new Q,pt.STREAM_TYPES={h264:27,adts:15},(ft=function(){var e,t=this,n=!1,video={data:[],size:0},audio={data:[],size:0},r={data:[],size:0},o=function(e,n,r){var o,l,c=new Uint8Array(e.size),d={type:n},i=0,h=0;if(e.data.length&&!(e.size<9)){for(d.trackId=e.data[0].pid,i=0;i>>3,m.pts*=4,m.pts+=(6&f[13])>>>1,m.dts=m.pts,64&v&&(m.dts=(14&f[14])<<27|(255&f[15])<<20|(254&f[16])<<12|(255&f[17])<<5|(254&f[18])>>>3,m.dts*=4,m.dts+=(6&f[18])>>>1)),m.data=f.subarray(9+f[8])),o="video"===n||d.packetLength<=e.size,(r||o)&&(e.size=0,e.data.length=0),o&&t.trigger("data",d)}};ft.prototype.init.call(this),this.push=function(data){({pat:function(){},pes:function(){var e,t;switch(data.streamType){case Ze.H264_STREAM_TYPE:e=video,t="video";break;case Ze.ADTS_STREAM_TYPE:e=audio,t="audio";break;case Ze.METADATA_STREAM_TYPE:e=r,t="timed-metadata";break;default:return}data.payloadUnitStartIndicator&&o(e,t,!0),e.data.push(data),e.size+=data.data.byteLength},pmt:function(){var r={type:"metadata",tracks:[]};null!==(e=data.programMapTable).video&&r.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.video,codec:"avc",type:"video"}),null!==e.audio&&r.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.audio,codec:"adts",type:"audio"}),n=!0,t.trigger("data",r)}})[data.type]()},this.reset=function(){video.size=0,video.data.length=0,audio.size=0,audio.data.length=0,this.trigger("reset")},this.flushStreams_=function(){o(video,"video"),o(audio,"audio"),o(r,"timed-metadata")},this.flush=function(){if(!n&&e){var r={type:"metadata",tracks:[]};null!==e.video&&r.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.video,codec:"avc",type:"video"}),null!==e.audio&&r.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.audio,codec:"adts",type:"audio"}),t.trigger("data",r)}n=!1,this.flushStreams_(),this.trigger("done")}}).prototype=new Q;var yt={PAT_PID:0,MP2T_PACKET_LENGTH:vt,TransportPacketStream:ht,TransportParseStream:pt,ElementaryStream:ft,TimestampRolloverStream:gt,CaptionStream:Je.CaptionStream,Cea608Stream:Je.Cea608Stream,Cea708Stream:Je.Cea708Stream,MetadataStream:mt};for(var _t in Ze)Ze.hasOwnProperty(_t)&&(yt[_t]=Ze[_t]);var bt,Tt=yt,St=Se,Et=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];(bt=function(e){var t,n=0;bt.prototype.init.call(this),this.skipWarn_=function(e,t){this.trigger("log",{level:"warn",message:"adts skiping bytes "+e+" to "+t+" in frame "+n+" outside syncword"})},this.push=function(r){var o,l,c,d,h,i=0;if(e||(n=0),"audio"===r.type){var f;for(t&&t.length?(c=t,(t=new Uint8Array(c.byteLength+r.data.byteLength)).set(c),t.set(r.data,c.byteLength)):t=r.data;i+7>5,h=(d=1024*(1+(3&t[i+6])))*St/Et[(60&t[i+2])>>>2],t.byteLength-i>>6&3),channelcount:(1&t[i+2])<<2|(192&t[i+3])>>>6,samplerate:Et[(60&t[i+2])>>>2],samplingfrequencyindex:(60&t[i+2])>>>2,samplesize:16,data:t.subarray(i+7+l,i+o)}),n++,i+=o}else"number"!=typeof f&&(f=i),i++;"number"==typeof f&&(this.skipWarn_(f,i),f=null),t=t.subarray(i)}},this.flush=function(){n=0,this.trigger("done")},this.reset=function(){t=void 0,this.trigger("reset")},this.endTimeline=function(){t=void 0,this.trigger("endedtimeline")}}).prototype=new Q;var kt,Ct,wt,It=bt,xt=function(e){var t=e.byteLength,n=0,r=0;this.length=function(){return 8*t},this.bitsAvailable=function(){return 8*t+r},this.loadWord=function(){var o=e.byteLength-t,l=new Uint8Array(4),c=Math.min(4,t);if(0===c)throw new Error("no bytes available");l.set(e.subarray(o,o+c)),n=new DataView(l.buffer).getUint32(0),r=8*c,t-=c},this.skipBits=function(e){var o;r>e?(n<<=e,r-=e):(e-=r,e-=8*(o=Math.floor(e/8)),t-=o,this.loadWord(),n<<=e,r-=e)},this.readBits=function(e){var o=Math.min(r,e),l=n>>>32-o;return(r-=o)>0?n<<=o:t>0&&this.loadWord(),(o=e-o)>0?l<>>e))return n<<=e,r-=e,e;return this.loadWord(),e+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var e=this.skipLeadingZeros();return this.readBits(e+1)-1},this.readExpGolomb=function(){var e=this.readUnsignedExpGolomb();return 1&e?1+e>>>1:-1*(e>>>1)},this.readBoolean=function(){return 1===this.readBits(1)},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};(Ct=function(){var i,e,t=0;Ct.prototype.init.call(this),this.push=function(data){var n;e?((n=new Uint8Array(e.byteLength+data.data.byteLength)).set(e),n.set(data.data,e.byteLength),e=n):e=data.data;for(var r=e.byteLength;t3&&this.trigger("data",e.subarray(t+3)),e=null,t=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}}).prototype=new Q,wt={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},(kt=function(){var e,t,n,r,o,l,c,d=new Ct;kt.prototype.init.call(this),e=this,this.push=function(e){"video"===e.type&&(t=e.trackId,n=e.pts,r=e.dts,d.push(e))},d.on("data",(function(data){var c={trackId:t,pts:n,dts:r,data:data,nalUnitTypeCode:31&data[0]};switch(c.nalUnitTypeCode){case 5:c.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:c.nalUnitType="sei_rbsp",c.escapedRBSP=o(data.subarray(1));break;case 7:c.nalUnitType="seq_parameter_set_rbsp",c.escapedRBSP=o(data.subarray(1)),c.config=l(c.escapedRBSP);break;case 8:c.nalUnitType="pic_parameter_set_rbsp";break;case 9:c.nalUnitType="access_unit_delimiter_rbsp"}e.trigger("data",c)})),d.on("done",(function(){e.trigger("done")})),d.on("partialdone",(function(){e.trigger("partialdone")})),d.on("reset",(function(){e.trigger("reset")})),d.on("endedtimeline",(function(){e.trigger("endedtimeline")})),this.flush=function(){d.flush()},this.partialFlush=function(){d.partialFlush()},this.reset=function(){d.reset()},this.endTimeline=function(){d.endTimeline()},c=function(e,t){var n,r=8,o=8;for(n=0;n=0?t:0,(16&header[e+5])>>4?t+20:t+10},Dt=function e(data,t){return data.length-t<10||data[t]!=="I".charCodeAt(0)||data[t+1]!=="D".charCodeAt(0)||data[t+2]!=="3".charCodeAt(0)?t:e(data,t+=Lt(data,t))},Mt=function(data){return data[0]<<21|data[1]<<14|data[2]<<7|data[3]},Rt={isLikelyAacData:function(data){var e=Dt(data,0);return data.length>=e+2&&255==(255&data[e])&&240==(240&data[e+1])&&16==(22&data[e+1])},parseId3TagSize:Lt,parseAdtsSize:function(header,e){var t=(224&header[e+5])>>5,n=header[e+4]<<3;return 6144&header[e+3]|n|t},parseType:function(header,e){return header[e]==="I".charCodeAt(0)&&header[e+1]==="D".charCodeAt(0)&&header[e+2]==="3".charCodeAt(0)?"timed-metadata":!0&header[e]&&240==(240&header[e+1])?"audio":null},parseSampleRate:function(e){for(var i=0;i+5>>2];i++}return null},parseAacTimestamp:function(e){var t,n,r;t=10,64&e[5]&&(t+=4,t+=Mt(e.subarray(10,14)));do{if((n=Mt(e.subarray(t+4,t+8)))<1)return null;if("PRIV"===String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3])){r=e.subarray(t+10,t+n+10);for(var i=0;i>>2;return l*=4,l+=3&o[7]}break}}t+=10,t+=n}while(t=3;)if(e[h]!=="I".charCodeAt(0)||e[h+1]!=="D".charCodeAt(0)||e[h+2]!=="3".charCodeAt(0))if(255!=(255&e[h])||240!=(240&e[h+1]))h++;else{if(e.length-h<7)break;if(h+(d=Rt.parseAdtsSize(e,h))>e.length)break;l={type:"audio",data:e.subarray(h,h+d),pts:t,dts:t},this.trigger("data",l),h+=d}else{if(e.length-h<10)break;if(h+(d=Rt.parseId3TagSize(e,h))>e.length)break;o={type:"timed-metadata",data:e.subarray(h,h+d)},this.trigger("data",o),h+=d}r=e.length-h,e=r>0?e.subarray(h):new Uint8Array},this.reset=function(){e=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){e=new Uint8Array,this.trigger("endedtimeline")}}).prototype=new Q;var Nt,Ut,Bt,jt,Ft=At,Ht=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],qt=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],Vt=Pt.H264Stream,Wt=Rt.isLikelyAacData,zt=Se,Gt=function(e,t){t.stream=e,this.trigger("log",t)},Xt=function(e,t){for(var n=Object.keys(t),i=0;i=-1e4&&t<=45e3&&(!n||l>t)&&(n=o,l=t));return n?n.gop:null},this.alignGopsAtStart_=function(e){var t,n,r,o,c,d,h,f;for(c=e.byteLength,d=e.nalCount,h=e.duration,t=n=0;tr.pts?t++:(n++,c-=o.byteLength,d-=o.nalCount,h-=o.duration);return 0===n?e:n===e.length?null:((f=e.slice(n)).byteLength=c,f.duration=h,f.nalCount=d,f.pts=f[0].pts,f.dts=f[0].dts,f)},this.alignGopsAtEnd_=function(e){var t,n,r,o,c,d,h;for(t=l.length-1,n=e.length-1,c=null,d=!1;t>=0&&n>=0;){if(r=l[t],o=e[n],r.pts===o.pts){d=!0;break}r.pts>o.pts?t--:(t===l.length-1&&(c=n),n--)}if(!d&&null===c)return null;if(0===(h=d?n:c))return e;var f=e.slice(h),m=f.reduce((function(e,t){return e.byteLength+=t.byteLength,e.duration+=t.duration,e.nalCount+=t.nalCount,e}),{byteLength:0,duration:0,nalCount:0});return f.byteLength=m.byteLength,f.duration=m.duration,f.nalCount=m.nalCount,f.pts=f[0].pts,f.dts=f[0].dts,f},this.alignGopsWith=function(e){l=e}}).prototype=new Q,(jt=function(e,t){this.numberOfTracks=0,this.metadataStream=t,void 0!==(e=e||{}).remux?this.remuxTracks=!!e.remux:this.remuxTracks=!0,"boolean"==typeof e.keepOriginalTimestamps?this.keepOriginalTimestamps=e.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,jt.prototype.init.call(this),this.push=function(output){return output.text?this.pendingCaptions.push(output):output.frames?this.pendingMetadata.push(output):(this.pendingTracks.push(output.track),this.pendingBytes+=output.boxes.byteLength,"video"===output.track.type&&(this.videoTrack=output.track,this.pendingBoxes.push(output.boxes)),void("audio"===output.track.type&&(this.audioTrack=output.track,this.pendingBoxes.unshift(output.boxes))))}}).prototype=new Q,jt.prototype.flush=function(e){var caption,t,n,i,r=0,o={captions:[],captionStreams:{},metadata:[],info:{}},l=0;if(this.pendingTracks.length=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0))}if(this.videoTrack?(l=this.videoTrack.timelineStartInfo.pts,qt.forEach((function(e){o.info[e]=this.videoTrack[e]}),this)):this.audioTrack&&(l=this.audioTrack.timelineStartInfo.pts,Ht.forEach((function(e){o.info[e]=this.audioTrack[e]}),this)),this.videoTrack||this.audioTrack){for(1===this.pendingTracks.length?o.type=this.pendingTracks[0].type:o.type="combined",this.emittedTracks+=this.pendingTracks.length,n=ce(this.pendingTracks),o.initSegment=new Uint8Array(n.byteLength),o.initSegment.set(n),o.data=new Uint8Array(this.pendingBytes),i=0;i=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},jt.prototype.setRemux=function(e){this.remuxTracks=e},(Bt=function(e){var t,n,r=this,o=!0;Bt.prototype.init.call(this),e=e||{},this.baseMediaDecodeTime=e.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var o={};this.transmuxPipeline_=o,o.type="aac",o.metadataStream=new Tt.MetadataStream,o.aacStream=new Ft,o.audioTimestampRolloverStream=new Tt.TimestampRolloverStream("audio"),o.timedMetadataTimestampRolloverStream=new Tt.TimestampRolloverStream("timed-metadata"),o.adtsStream=new It,o.coalesceStream=new jt(e,o.metadataStream),o.headOfPipeline=o.aacStream,o.aacStream.pipe(o.audioTimestampRolloverStream).pipe(o.adtsStream),o.aacStream.pipe(o.timedMetadataTimestampRolloverStream).pipe(o.metadataStream).pipe(o.coalesceStream),o.metadataStream.on("timestamp",(function(e){o.aacStream.setTimestamp(e.timeStamp)})),o.aacStream.on("data",(function(data){"timed-metadata"!==data.type&&"audio"!==data.type||o.audioSegmentStream||(n=n||{timelineStartInfo:{baseMediaDecodeTime:r.baseMediaDecodeTime},codec:"adts",type:"audio"},o.coalesceStream.numberOfTracks++,o.audioSegmentStream=new Ut(n,e),o.audioSegmentStream.on("log",r.getLogTrigger_("audioSegmentStream")),o.audioSegmentStream.on("timingInfo",r.trigger.bind(r,"audioTimingInfo")),o.adtsStream.pipe(o.audioSegmentStream).pipe(o.coalesceStream),r.trigger("trackinfo",{hasAudio:!!n,hasVideo:!!t}))})),o.coalesceStream.on("data",this.trigger.bind(this,"data")),o.coalesceStream.on("done",this.trigger.bind(this,"done")),Xt(this,o)},this.setupTsPipeline=function(){var o={};this.transmuxPipeline_=o,o.type="ts",o.metadataStream=new Tt.MetadataStream,o.packetStream=new Tt.TransportPacketStream,o.parseStream=new Tt.TransportParseStream,o.elementaryStream=new Tt.ElementaryStream,o.timestampRolloverStream=new Tt.TimestampRolloverStream,o.adtsStream=new It,o.h264Stream=new Vt,o.captionStream=new Tt.CaptionStream(e),o.coalesceStream=new jt(e,o.metadataStream),o.headOfPipeline=o.packetStream,o.packetStream.pipe(o.parseStream).pipe(o.elementaryStream).pipe(o.timestampRolloverStream),o.timestampRolloverStream.pipe(o.h264Stream),o.timestampRolloverStream.pipe(o.adtsStream),o.timestampRolloverStream.pipe(o.metadataStream).pipe(o.coalesceStream),o.h264Stream.pipe(o.captionStream).pipe(o.coalesceStream),o.elementaryStream.on("data",(function(data){var i;if("metadata"===data.type){for(i=data.tracks.length;i--;)t||"video"!==data.tracks[i].type?n||"audio"!==data.tracks[i].type||((n=data.tracks[i]).timelineStartInfo.baseMediaDecodeTime=r.baseMediaDecodeTime):(t=data.tracks[i]).timelineStartInfo.baseMediaDecodeTime=r.baseMediaDecodeTime;t&&!o.videoSegmentStream&&(o.coalesceStream.numberOfTracks++,o.videoSegmentStream=new Nt(t,e),o.videoSegmentStream.on("log",r.getLogTrigger_("videoSegmentStream")),o.videoSegmentStream.on("timelineStartInfo",(function(t){n&&!e.keepOriginalTimestamps&&(n.timelineStartInfo=t,o.audioSegmentStream.setEarliestDts(t.dts-r.baseMediaDecodeTime))})),o.videoSegmentStream.on("processedGopsInfo",r.trigger.bind(r,"gopInfo")),o.videoSegmentStream.on("segmentTimingInfo",r.trigger.bind(r,"videoSegmentTimingInfo")),o.videoSegmentStream.on("baseMediaDecodeTime",(function(e){n&&o.audioSegmentStream.setVideoBaseMediaDecodeTime(e)})),o.videoSegmentStream.on("timingInfo",r.trigger.bind(r,"videoTimingInfo")),o.h264Stream.pipe(o.videoSegmentStream).pipe(o.coalesceStream)),n&&!o.audioSegmentStream&&(o.coalesceStream.numberOfTracks++,o.audioSegmentStream=new Ut(n,e),o.audioSegmentStream.on("log",r.getLogTrigger_("audioSegmentStream")),o.audioSegmentStream.on("timingInfo",r.trigger.bind(r,"audioTimingInfo")),o.audioSegmentStream.on("segmentTimingInfo",r.trigger.bind(r,"audioSegmentTimingInfo")),o.adtsStream.pipe(o.audioSegmentStream).pipe(o.coalesceStream)),r.trigger("trackinfo",{hasAudio:!!n,hasVideo:!!t})}})),o.coalesceStream.on("data",this.trigger.bind(this,"data")),o.coalesceStream.on("id3Frame",(function(e){e.dispatchType=o.metadataStream.dispatchType,r.trigger("id3Frame",e)})),o.coalesceStream.on("caption",this.trigger.bind(this,"caption")),o.coalesceStream.on("done",this.trigger.bind(this,"done")),Xt(this,o)},this.setBaseMediaDecodeTime=function(r){var o=this.transmuxPipeline_;e.keepOriginalTimestamps||(this.baseMediaDecodeTime=r),n&&(n.timelineStartInfo.dts=void 0,n.timelineStartInfo.pts=void 0,De(n),o.audioTimestampRolloverStream&&o.audioTimestampRolloverStream.discontinuity()),t&&(o.videoSegmentStream&&(o.videoSegmentStream.gopCache_=[]),t.timelineStartInfo.dts=void 0,t.timelineStartInfo.pts=void 0,De(t),o.captionStream.reset()),o.timestampRolloverStream&&o.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(e){n&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(e)},this.setRemux=function(t){var n=this.transmuxPipeline_;e.remux=t,n&&n.coalesceStream&&n.coalesceStream.setRemux(t)},this.alignGopsWith=function(e){t&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(e)},this.getLogTrigger_=function(e){var t=this;return function(n){n.stream=e,t.trigger("log",n)}},this.push=function(data){if(o){var e=Wt(data);e&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():e||"ts"===this.transmuxPipeline_.type||this.setupTsPipeline(),o=!1}this.transmuxPipeline_.headOfPipeline.push(data)},this.flush=function(){o=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}}).prototype=new Q;var Qt,$t,Jt,Zt={Transmuxer:Bt,VideoSegmentStream:Nt,AudioSegmentStream:Ut,AUDIO_PROPERTIES:Ht,VIDEO_PROPERTIES:qt,generateSegmentTimingInfo:Yt},ei=function(e){return e>>>0},ti=function(e){var t="";return t+=String.fromCharCode(e[0]),t+=String.fromCharCode(e[1]),t+=String.fromCharCode(e[2]),t+=String.fromCharCode(e[3])},ii=ei,ni=function e(data,path){var i,t,n,r,o,l=[];if(!path.length)return null;for(i=0;i1?i+t:data.byteLength,n===path[0]&&(1===path.length?l.push(data.subarray(i+8,r)):(o=e(data.subarray(i+8,r),path.slice(1))).length&&(l=l.concat(o))),i=r;return l},ri=ei,ai=J.getUint64,si=function(data){var e={version:data[0],flags:new Uint8Array(data.subarray(1,4))};return 1===e.version?e.baseMediaDecodeTime=ai(data.subarray(4)):e.baseMediaDecodeTime=ri(data[4]<<24|data[5]<<16|data[6]<<8|data[7]),e},oi=function(e){return{isLeading:(12&e[0])>>>2,dependsOn:3&e[0],isDependedOn:(192&e[1])>>>6,hasRedundancy:(48&e[1])>>>4,paddingValue:(14&e[1])>>>1,isNonSyncSample:1&e[1],degradationPriority:e[2]<<8|e[3]}},ui=function(data){var e,t={version:data[0],flags:new Uint8Array(data.subarray(1,4)),samples:[]},view=new DataView(data.buffer,data.byteOffset,data.byteLength),n=1&t.flags[2],r=4&t.flags[2],o=1&t.flags[1],l=2&t.flags[1],c=4&t.flags[1],d=8&t.flags[1],h=view.getUint32(4),f=8;for(n&&(t.dataOffset=view.getInt32(f),f+=4),r&&h&&(e={flags:oi(data.subarray(f,f+4))},f+=4,o&&(e.duration=view.getUint32(f),f+=4),l&&(e.size=view.getUint32(f),f+=4),d&&(1===t.version?e.compositionTimeOffset=view.getInt32(f):e.compositionTimeOffset=view.getUint32(f),f+=4),t.samples.push(e),h--);h--;)e={},o&&(e.duration=view.getUint32(f),f+=4),l&&(e.size=view.getUint32(f),f+=4),c&&(e.flags=oi(data.subarray(f,f+4)),f+=4),d&&(1===t.version?e.compositionTimeOffset=view.getInt32(f):e.compositionTimeOffset=view.getUint32(f),f+=4),t.samples.push(e);return t},ci=function(data){var i,view=new DataView(data.buffer,data.byteOffset,data.byteLength),e={version:data[0],flags:new Uint8Array(data.subarray(1,4)),trackId:view.getUint32(4)},t=1&e.flags[2],n=2&e.flags[2],r=8&e.flags[2],o=16&e.flags[2],l=32&e.flags[2],c=65536&e.flags[0],d=131072&e.flags[0];return i=8,t&&(i+=4,e.baseDataOffset=view.getUint32(12),i+=4),n&&(e.sampleDescriptionIndex=view.getUint32(i),i+=4),r&&(e.defaultSampleDuration=view.getUint32(i),i+=4),o&&(e.defaultSampleSize=view.getUint32(i),i+=4),l&&(e.defaultSampleFlags=view.getUint32(i)),c&&(e.durationIsEmpty=!0),!t&&d&&(e.baseDataOffsetIsMoof=!0),e},di="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{},hi="undefined"!=typeof window?window:void 0!==di?di:"undefined"!=typeof self?self:{},pi=je,fi=Je.CaptionStream,mi=function(e,t){for(var n=e,i=0;i0?si(f[0]).baseMediaDecodeTime:0,v=ni(l,["trun"]);t===h&&v.length>0&&(n=function(e,t,n){var r,i,o,l,c=new DataView(e.buffer,e.byteOffset,e.byteLength),d={logs:[],seiNals:[]};for(i=0;i+40;){var h=t.shift();this.parse(h,l,c)}return(d=function(e,t,n){if(null===t)return null;var r=gi(e,t)[t]||{};return{seiNals:r.seiNals,logs:r.logs,timescale:n}}(e,n,r))&&d.logs&&(o.logs=o.logs.concat(d.logs)),null!==d&&d.seiNals?(this.pushNals(d.seiNals),this.flushStream(),o):o.logs.length?{logs:o.logs,captions:[],captionStreams:[]}:null},this.pushNals=function(t){if(!this.isInitialized()||!t||0===t.length)return null;t.forEach((function(t){e.push(t)}))},this.flushStream=function(){if(!this.isInitialized())return null;l?e.partialFlush():e.flush()},this.clearParsedCaptions=function(){o.captions=[],o.captionStreams={},o.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;e.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){t=[],n=null,r=null,o?this.clearParsedCaptions():o={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},yi=ei,_i=function(e){return("00"+e.toString(16)).slice(-2)},bi=J.getUint64;Qt=function(e,t){var n=ni(t,["moof","traf"]).reduce((function(t,n){var r,o,l=ni(n,["tfhd"])[0],c=yi(l[4]<<24|l[5]<<16|l[6]<<8|l[7]),d=e[c]||9e4,h=ni(n,["tfdt"])[0],f=new DataView(h.buffer,h.byteOffset,h.byteLength);return"bigint"==typeof(r=1===h[0]?bi(h.subarray(4,12)):f.getUint32(4))?o=r/hi.BigInt(d):"number"!=typeof r||isNaN(r)||(o=r/d),o11?(track.codec+=".",track.codec+=_i(h[9]),track.codec+=_i(h[10]),track.codec+=_i(h[11])):track.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(track.codec)?(h=f.subarray(28),"esds"===ti(h.subarray(4,8))&&h.length>20&&0!==h[19]?(track.codec+="."+_i(h[19]),track.codec+="."+_i(h[20]>>>2&63).replace(/^0/,"")):track.codec="mp4a.40.2"):track.codec=track.codec.toLowerCase())}var m=ni(e,["mdia","mdhd"])[0];m&&(track.timescale=Jt(m)),n.push(track)})),n};var Ti=Qt,Si=$t,Ei=(Jt=function(e){var t=0===e[0]?12:20;return yi(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])},function(e){var t=31&e[1];return t<<=8,t|=e[2]}),ki=function(e){return!!(64&e[1])},Ci=function(e){var t=0;return(48&e[3])>>>4>1&&(t+=e[4]+1),t},wi=function(e){switch(e){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}},Ii={parseType:function(e,t){var n=Ei(e);return 0===n?"pat":n===t?"pmt":t?"pes":null},parsePat:function(e){var t=ki(e),n=4+Ci(e);return t&&(n+=e[n]+1),(31&e[n+10])<<8|e[n+11]},parsePmt:function(e){var t={},n=ki(e),r=4+Ci(e);if(n&&(r+=e[r]+1),1&e[r+5]){var o;o=3+((15&e[r+1])<<8|e[r+2])-4;for(var l=12+((15&e[r+10])<<8|e[r+11]);l=e.byteLength)return null;var n,r=null;return 192&(n=e[t+7])&&((r={}).pts=(14&e[t+9])<<27|(255&e[t+10])<<20|(254&e[t+11])<<12|(255&e[t+12])<<5|(254&e[t+13])>>>3,r.pts*=4,r.pts+=(6&e[t+13])>>>1,r.dts=r.pts,64&n&&(r.dts=(14&e[t+14])<<27|(255&e[t+15])<<20|(254&e[t+16])<<12|(255&e[t+17])<<5|(254&e[t+18])>>>3,r.dts*=4,r.dts+=(6&e[t+18])>>>1)),r},videoPacketContainsKeyFrame:function(e){for(var t=4+Ci(e),n=e.subarray(t),r=0,o=0,l=!1;o3&&"slice_layer_without_partitioning_rbsp_idr"===wi(31&n[o+3])&&(l=!0),l}},xi=st,Ai={};Ai.ts=Ii,Ai.aac=Rt;var Pi=Se,Oi=188,Li=71,Di=function(e,t,n){for(var r,o,l,c,d=0,h=Oi,f=!1;h<=e.byteLength;)if(e[d]!==Li||e[h]!==Li&&h!==e.byteLength)d++,h++;else{switch(r=e.subarray(d,h),Ai.ts.parseType(r,t.pid)){case"pes":o=Ai.ts.parsePesType(r,t.table),l=Ai.ts.parsePayloadUnitStartIndicator(r),"audio"===o&&l&&(c=Ai.ts.parsePesTime(r))&&(c.type="audio",n.audio.push(c),f=!0)}if(f)break;d+=Oi,h+=Oi}for(d=(h=e.byteLength)-Oi,f=!1;d>=0;)if(e[d]!==Li||e[h]!==Li&&h!==e.byteLength)d--,h--;else{switch(r=e.subarray(d,h),Ai.ts.parseType(r,t.pid)){case"pes":o=Ai.ts.parsePesType(r,t.table),l=Ai.ts.parsePayloadUnitStartIndicator(r),"audio"===o&&l&&(c=Ai.ts.parsePesTime(r))&&(c.type="audio",n.audio.push(c),f=!0)}if(f)break;d-=Oi,h-=Oi}},Mi=function(e,t,n){for(var r,o,l,c,d,i,h,f=0,m=Oi,v=!1,y={data:[],size:0};m=0;)if(e[f]!==Li||e[m]!==Li)f--,m--;else{switch(r=e.subarray(f,m),Ai.ts.parseType(r,t.pid)){case"pes":o=Ai.ts.parsePesType(r,t.table),l=Ai.ts.parsePayloadUnitStartIndicator(r),"video"===o&&l&&(c=Ai.ts.parsePesTime(r))&&(c.type="video",n.video.push(c),v=!0)}if(v)break;f-=Oi,m-=Oi}},Ri=function(e){var t={pid:null,table:null},n={};for(var r in function(e,t){for(var n,r=0,o=Oi;o=3;){switch(Ai.aac.parseType(e,d)){case"timed-metadata":if(e.length-d<10){n=!0;break}if((c=Ai.aac.parseId3TagSize(e,d))>e.length){n=!0;break}null===l&&(t=e.subarray(d,d+c),l=Ai.aac.parseAacTimestamp(t)),d+=c;break;case"audio":if(e.length-d<7){n=!0;break}if((c=Ai.aac.parseAdtsSize(e,d))>e.length){n=!0;break}null===o&&(t=e.subarray(d,d+c),o=Ai.aac.parseSampleRate(t)),r++,d+=c;break;default:d++}if(n)return null}if(null===o||null===l)return null;var h=Pi/o;return{audio:[{type:"audio",dts:l,pts:l},{type:"audio",dts:l+1024*r*h,pts:l+1024*r*h}]}}(e):Ri(e))&&(n.audio||n.video)?(function(e,t){if(e.audio&&e.audio.length){var n=t;(void 0===n||isNaN(n))&&(n=e.audio[0].dts),e.audio.forEach((function(e){e.dts=xi(e.dts,n),e.pts=xi(e.pts,n),e.dtsTime=e.dts/Pi,e.ptsTime=e.pts/Pi}))}if(e.video&&e.video.length){var r=t;if((void 0===r||isNaN(r))&&(r=e.video[0].dts),e.video.forEach((function(e){e.dts=xi(e.dts,r),e.pts=xi(e.pts,r),e.dtsTime=e.dts/Pi,e.ptsTime=e.pts/Pi})),e.firstKeyFrame){var o=e.firstKeyFrame;o.dts=xi(o.dts,r),o.pts=xi(o.pts,r),o.dtsTime=o.dts/Pi,o.ptsTime=o.pts/Pi}}}(n,t),n):null},Ui=function(){function e(e,t){this.options=t||{},this.self=e,this.init()}var t=e.prototype;return t.init=function(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new Zt.Transmuxer(this.options),function(e,t){t.on("data",(function(t){var n=t.initSegment;t.initSegment={data:n.buffer,byteOffset:n.byteOffset,byteLength:n.byteLength};var r=t.data;t.data=r.buffer,e.postMessage({action:"data",segment:t,byteOffset:r.byteOffset,byteLength:r.byteLength},[t.data])})),t.on("done",(function(data){e.postMessage({action:"done"})})),t.on("gopInfo",(function(t){e.postMessage({action:"gopInfo",gopInfo:t})})),t.on("videoSegmentTimingInfo",(function(t){var n={start:{decode:ke(t.start.dts),presentation:ke(t.start.pts)},end:{decode:ke(t.end.dts),presentation:ke(t.end.pts)},baseMediaDecodeTime:ke(t.baseMediaDecodeTime)};t.prependedContentDuration&&(n.prependedContentDuration=ke(t.prependedContentDuration)),e.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:n})})),t.on("audioSegmentTimingInfo",(function(t){var n={start:{decode:ke(t.start.dts),presentation:ke(t.start.pts)},end:{decode:ke(t.end.dts),presentation:ke(t.end.pts)},baseMediaDecodeTime:ke(t.baseMediaDecodeTime)};t.prependedContentDuration&&(n.prependedContentDuration=ke(t.prependedContentDuration)),e.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:n})})),t.on("id3Frame",(function(t){e.postMessage({action:"id3Frame",id3Frame:t})})),t.on("caption",(function(caption){e.postMessage({action:"caption",caption:caption})})),t.on("trackinfo",(function(t){e.postMessage({action:"trackinfo",trackInfo:t})})),t.on("audioTimingInfo",(function(t){e.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:ke(t.start),end:ke(t.end)}})})),t.on("videoTimingInfo",(function(t){e.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:ke(t.start),end:ke(t.end)}})})),t.on("log",(function(t){e.postMessage({action:"log",log:t})}))}(this.self,this.transmuxer)},t.pushMp4Captions=function(data){this.captionParser||(this.captionParser=new vi,this.captionParser.init());var e=new Uint8Array(data.data,data.byteOffset,data.byteLength),t=this.captionParser.parse(e,data.trackIds,data.timescales);this.self.postMessage({action:"mp4Captions",captions:t&&t.captions||[],logs:t&&t.logs||[],data:e.buffer},[e.buffer])},t.probeMp4StartTime=function(e){var t=e.timescales,data=e.data,n=Ti(t,data);this.self.postMessage({action:"probeMp4StartTime",startTime:n,data:data},[data.buffer])},t.probeMp4Tracks=function(e){var data=e.data,t=Si(data);this.self.postMessage({action:"probeMp4Tracks",tracks:t,data:data},[data.buffer])},t.probeTs=function(e){var data=e.data,t=e.baseStartTime,n="number"!=typeof t||isNaN(t)?void 0:t*Se,r=Ni(data,n),o=null;r&&((o={hasVideo:r.video&&2===r.video.length||!1,hasAudio:r.audio&&2===r.audio.length||!1}).hasVideo&&(o.videoStart=r.video[0].ptsTime),o.hasAudio&&(o.audioStart=r.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:o,data:data},[data.buffer])},t.clearAllMp4Captions=function(){this.captionParser&&this.captionParser.clearAllCaptions()},t.clearParsedMp4Captions=function(){this.captionParser&&this.captionParser.clearParsedCaptions()},t.push=function(data){var e=new Uint8Array(data.data,data.byteOffset,data.byteLength);this.transmuxer.push(e)},t.reset=function(){this.transmuxer.reset()},t.setTimestampOffset=function(data){var e=data.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(Ee(e)))},t.setAudioAppendStart=function(data){this.transmuxer.setAudioAppendStart(Math.ceil(Ee(data.appendStart)))},t.setRemux=function(data){this.transmuxer.setRemux(data.remux)},t.flush=function(data){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})},t.endTimeline=function(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})},t.alignGopsWith=function(data){this.transmuxer.alignGopsWith(data.gopsToAlignWith.slice())},e}();self.onmessage=function(e){"init"===e.data.action&&e.data.options?this.messageHandlers=new Ui(self,e.data.options):(this.messageHandlers||(this.messageHandlers=new Ui(self)),e.data&&e.data.action&&"init"!==e.data.action&&this.messageHandlers[e.data.action]&&this.messageHandlers[e.data.action](e.data))}})))),xs=function(e){var t=e.transmuxer,n=e.bytes,r=e.audioAppendStart,o=e.gopsToAlignWith,l=e.remux,c=e.onData,d=e.onTrackInfo,h=e.onAudioTimingInfo,f=e.onVideoTimingInfo,m=e.onVideoSegmentTimingInfo,v=e.onAudioSegmentTimingInfo,y=e.onId3,_=e.onCaptions,T=e.onDone,S=e.onEndedTimeline,E=e.onTransmuxerLog,k=e.isEndOfTimeline,C={buffer:[]},w=k;if(t.onmessage=function(n){t.currentTransmux===e&&("data"===n.data.action&&function(e,t,n){var r=e.data.segment,o=r.type,l=r.initSegment,c=r.captions,d=r.captionStreams,h=r.metadata,f=r.videoFrameDtsTime,m=r.videoFramePtsTime;t.buffer.push({captions:c,captionStreams:d,metadata:h});var v=e.data.segment.boxes||{data:e.data.segment.data},y={type:o,data:new Uint8Array(v.data,v.data.byteOffset,v.data.byteLength),initSegment:new Uint8Array(l.data,l.byteOffset,l.byteLength)};void 0!==f&&(y.videoFrameDtsTime=f),void 0!==m&&(y.videoFramePtsTime=m),n(y)}(n,C,c),"trackinfo"===n.data.action&&d(n.data.trackInfo),"gopInfo"===n.data.action&&function(e,t){t.gopInfo=e.data.gopInfo}(n,C),"audioTimingInfo"===n.data.action&&h(n.data.audioTimingInfo),"videoTimingInfo"===n.data.action&&f(n.data.videoTimingInfo),"videoSegmentTimingInfo"===n.data.action&&m(n.data.videoSegmentTimingInfo),"audioSegmentTimingInfo"===n.data.action&&v(n.data.audioSegmentTimingInfo),"id3Frame"===n.data.action&&y([n.data.id3Frame],n.data.id3Frame.dispatchType),"caption"===n.data.action&&_(n.data.caption),"endedtimeline"===n.data.action&&(w=!1,S()),"log"===n.data.action&&E(n.data.log),"transmuxed"===n.data.type&&(w||(t.onmessage=null,function(e){var t=e.transmuxedData,n=e.callback;t.buffer=[],n(t)}({transmuxedData:C,callback:T}),As(t))))},r&&t.postMessage({action:"setAudioAppendStart",appendStart:r}),Array.isArray(o)&&t.postMessage({action:"alignGopsWith",gopsToAlignWith:o}),void 0!==l&&t.postMessage({action:"setRemux",remux:l}),n.byteLength){var I=n instanceof ArrayBuffer?n:n.buffer,x=n instanceof ArrayBuffer?0:n.byteOffset;t.postMessage({action:"push",data:I,byteOffset:x,byteLength:n.byteLength},[I])}k&&t.postMessage({action:"endTimeline"}),t.postMessage({action:"flush"})},As=function(e){e.currentTransmux=null,e.transmuxQueue.length&&(e.currentTransmux=e.transmuxQueue.shift(),"function"==typeof e.currentTransmux?e.currentTransmux():xs(e.currentTransmux))},Ps=function(e,t){e.postMessage({action:t}),As(e)},Os=function(e,t){if(!t.currentTransmux)return t.currentTransmux=e,void Ps(t,e);t.transmuxQueue.push(Ps.bind(null,t,e))},Ls=function(e){if(!e.transmuxer.currentTransmux)return e.transmuxer.currentTransmux=e,void xs(e);e.transmuxer.transmuxQueue.push(e)},Ds=function(e){Os("reset",e)},Ms=function(e){var t=new Is;t.currentTransmux=null,t.transmuxQueue=[];var n=t.terminate;return t.terminate=function(){return t.currentTransmux=null,t.transmuxQueue.length=0,n.call(t)},t.postMessage({action:"init",options:e}),t},Rs=function(e){var t=e.transmuxer,n=e.endAction||e.action,r=e.callback,o=f()({},e,{endAction:null,transmuxer:null,callback:null});if(t.addEventListener("message",(function o(l){l.data.action===n&&(t.removeEventListener("message",o),l.data.data&&(l.data.data=new Uint8Array(l.data.data,e.byteOffset||0,e.byteLength||l.data.data.byteLength),e.data&&(e.data=l.data.data)),r(l.data))})),e.data){var l=e.data instanceof ArrayBuffer;o.byteOffset=l?0:e.data.byteOffset,o.byteLength=e.data.byteLength;var c=[l?e.data:e.data.buffer];t.postMessage(o,c)}else t.postMessage(o)},Ns=2,Us=-101,Bs=-102,js=function(e){e.forEach((function(e){e.abort()}))},Fs=function(e,t){return t.timedout?{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:Us,xhr:t}:t.aborted?{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:Bs,xhr:t}:e?{status:t.status,message:"HLS request errored at URL: "+t.uri,code:Ns,xhr:t}:"arraybuffer"===t.responseType&&0===t.response.byteLength?{status:t.status,message:"Empty HLS response at URL: "+t.uri,code:Ns,xhr:t}:null},Hs=function(e,t,n){return function(r,o){var l=o.response,c=Fs(r,o);if(c)return n(c,e);if(16!==l.byteLength)return n({status:o.status,message:"Invalid HLS key at URL: "+o.uri,code:Ns,xhr:o},e);for(var view=new DataView(l),d=new Uint32Array([view.getUint32(0),view.getUint32(4),view.getUint32(8),view.getUint32(12)]),i=0;i1)return Qs("multiple "+e+" codecs found as attributes: "+t[e].join(", ")+". Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs."),void(t[e]=null);t[e]=t[e][0]})),t},Zs=function(e){var t=0;return e.audio&&t++,e.video&&t++,t},eo=function(e,t){var n=t.attributes||{},r=Js(function(e){var t=e.attributes||{};if(t.CODECS)return Object(R.h)(t.CODECS)}(t)||[]);if($s(e,t)&&!r.audio&&!function(e,t){if(!$s(e,t))return!0;var n=t.attributes||{},r=e.mediaGroups.AUDIO[n.AUDIO];for(var o in r)if(!r[o].uri&&!r[o].playlists)return!0;return!1}(e,t)){var o=Js(Object(R.d)(e,n.AUDIO)||[]);o.audio&&(r.audio=o.audio)}return r},to=ha("PlaylistSelector"),io=function(e){if(e&&e.playlist){var t=e.playlist;return JSON.stringify({id:t.id,bandwidth:e.bandwidth,width:e.width,height:e.height,codecs:t.attributes&&t.attributes.CODECS||""})}},no=function(e,t){if(!e)return"";var n=l.a.getComputedStyle(e);return n?n[t]:""},ro=function(e,t){var n=e.slice();e.sort((function(e,r){var o=t(e,r);return 0===o?n.indexOf(e)-n.indexOf(r):o}))},ao=function(e,t){var n,r;return e.attributes.BANDWIDTH&&(n=e.attributes.BANDWIDTH),n=n||l.a.Number.MAX_VALUE,t.attributes.BANDWIDTH&&(r=t.attributes.BANDWIDTH),n-(r=r||l.a.Number.MAX_VALUE)},so=function(e,t,n,r,o,c){if(e){var d={bandwidth:t,width:n,height:r,limitRenditionByPlayerDimensions:o},h=e.playlists;Fa.isAudioOnly(e)&&(h=c.getAudioTrackPlaylists_(),d.audioOnly=!0);var f=h.map((function(e){var t=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width,n=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height;return{bandwidth:e.attributes&&e.attributes.BANDWIDTH||l.a.Number.MAX_VALUE,width:t,height:n,playlist:e}}));ro(f,(function(e,t){return e.bandwidth-t.bandwidth}));var m=(f=f.filter((function(e){return!Fa.isIncompatible(e.playlist)}))).filter((function(e){return Fa.isEnabled(e.playlist)}));m.length||(m=f.filter((function(e){return!Fa.isDisabled(e.playlist)})));var v=m.filter((function(e){return e.bandwidth*Ss.BANDWIDTH_VARIANCEn||e.height>r}))).filter((function(e){return e.width===C[0].width&&e.height===C[0].height})),y=w[w.length-1],I=w.filter((function(e){return e.bandwidth===y.bandwidth}))[0]),c.experimentalLeastPixelDiffSelector){var P=E.map((function(e){return e.pixelDiff=Math.abs(e.width-n)+Math.abs(e.height-r),e}));ro(P,(function(e,t){return e.pixelDiff===t.pixelDiff?t.bandwidth-e.bandwidth:e.pixelDiff-t.pixelDiff})),x=P[0]}var O=x||I||A||_||m[0]||f[0];if(O&&O.playlist){var L="sortedPlaylistReps";return x?L="leastPixelDiffRep":I?L="resolutionPlusOneRep":A?L="resolutionBestRep":_?L="bandwidthBestRep":m[0]&&(L="enabledPlaylistReps"),to("choosing "+io(O)+" using "+L+" with options",d),O.playlist}return to("could not choose a playlist with options",d),null}},oo=function(){var e=this.useDevicePixelRatio&&l.a.devicePixelRatio||1;return so(this.playlists.master,this.systemBandwidth,parseInt(no(this.tech_.el(),"width"),10)*e,parseInt(no(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)},uo=function(e){var t=e.inbandTextTracks,n=e.metadataArray,r=e.timestampOffset,o=e.videoDuration;if(n){var c=l.a.WebKitDataCue||l.a.VTTCue,d=t.metadataTrack_;if(d&&(n.forEach((function(e){var time=e.cueTime+r;!("number"!=typeof time||l.a.isNaN(time)||time<0)&&time<1/0&&e.frames.forEach((function(e){var t=new c(time,time,e.value||e.url||e.data||"");t.frame=e,t.value=e,function(e){Object.defineProperties(e.frame,{id:{get:function(){return la.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),e.value.key}},value:{get:function(){return la.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),e.value.data}},privateData:{get:function(){return la.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),e.value.data}}})}(t),d.addCue(t)}))})),d.cues&&d.cues.length)){for(var h=d.cues,f=[],i=0;i=e&&n.endTime<=t&&track.removeCue(n)},co=function(e){return"number"==typeof e&&isFinite(e)},ho=1/60,po=function(e){var t=e.startOfSegment,n=e.duration,r=e.segment,o=e.part,l=e.playlist,c=l.mediaSequence,d=l.id,h=l.segments,f=void 0===h?[]:h,m=e.mediaIndex,v=e.partIndex,y=e.timeline,_=f.length-1,T="mediaIndex/partIndex increment";e.getMediaInfoForTime?T="getMediaInfoForTime ("+e.getMediaInfoForTime+")":e.isSyncRequest&&(T="getSyncSegmentCandidate (isSyncRequest)"),e.independent&&(T+=" with independent "+e.independent);var S="number"==typeof v,E=e.segment.uri?"segment":"pre-segment",k=S?wa({preloadSegment:r})-1:0;return E+" ["+(c+m)+"/"+(c+_)+"]"+(S?" part ["+v+"/"+k+"]":"")+" segment start/end ["+r.start+" => "+r.end+"]"+(S?" part start/end ["+o.start+" => "+o.end+"]":"")+" startOfSegment ["+t+"] duration ["+n+"] timeline ["+y+"] selected by ["+T+"] playlist ["+d+"]"},fo=function(e){return e+"TimingInfo"},mo=function(e){var t=e.timelineChangeController,n=e.currentTimeline,r=e.segmentTimeline,o=e.loaderType,l=e.audioDisabled;if(n===r)return!1;if("audio"===o){var c=t.lastTimelineChange({type:"main"});return!c||c.to!==r}if("main"===o&&l){var d=t.pendingTimelineChange({type:"audio"});return!d||d.to!==r}return!1},go=function(e){var t=e.segmentDuration,n=e.maxDuration;return!!t&&Math.round(t)>n+pa},vo=function(e,t){if("hls"!==t)return null;var n,r,o=(n={audioTimingInfo:e.audioTimingInfo,videoTimingInfo:e.videoTimingInfo},r=0,["video","audio"].forEach((function(e){var t=n[e+"TimingInfo"];if(t){var o,c=t.start,d=t.end;"bigint"==typeof c||"bigint"==typeof d?o=l.a.BigInt(d)-l.a.BigInt(c):"number"==typeof c&&"number"==typeof d&&(o=d-c),void 0!==o&&o>r&&(r=o)}})),"bigint"==typeof r&&r=11,r.appendInitSegment_={audio:!0,video:!0},r.playlistOfLastInitSegment_={audio:null,video:null},r.callQueue_=[],r.loadQueue_=[],r.metadataQueue_={id3:[],caption:[]},r.waitingOnRemove_=!1,r.quotaExceededErrorRetryTimeout_=null,r.activeInitSegmentId_=null,r.initSegments_={},r.cacheEncryptionKeys_=t.cacheEncryptionKeys,r.keyCache_={},r.decrypter_=t.decrypter,r.syncController_=t.syncController,r.syncPoint_={segmentIndex:0,time:0},r.transmuxer_=r.createTransmuxer_(),r.triggerSyncInfoUpdate_=function(){return r.trigger("syncinfoupdate")},r.syncController_.on("syncinfoupdate",r.triggerSyncInfoUpdate_),r.mediaSource_.addEventListener("sourceopen",(function(){r.isEndOfStream_()||(r.ended_=!1)})),r.fetchAtBuffer_=!1,r.logger_=ha("SegmentLoader["+r.loaderType_+"]"),Object.defineProperty(_()(r),"state",{get:function(){return this.state_},set:function(e){e!==this.state_&&(this.logger_(this.state_+" -> "+e),this.state_=e,this.trigger("statechange"))}}),r.sourceUpdater_.on("ready",(function(){r.hasEnoughInfoToAppend_()&&r.processCallQueue_()})),"main"===r.loaderType_&&r.timelineChangeController_.on("pendingtimelinechange",(function(){r.hasEnoughInfoToAppend_()&&r.processCallQueue_()})),"audio"===r.loaderType_&&r.timelineChangeController_.on("timelinechange",(function(){r.hasEnoughInfoToLoad_()&&r.processLoadQueue_(),r.hasEnoughInfoToAppend_()&&r.processCallQueue_()})),r}S()(t,e);var n=t.prototype;return n.createTransmuxer_=function(){return Ms({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})},n.resetStats_=function(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0},n.dispose=function(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&l.a.clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()},n.setAudio=function(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())},n.abort=function(){"WAITING"===this.state?(this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()):this.pendingSegment_&&(this.pendingSegment_=null)},n.abort_=function(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,l.a.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null},n.checkForAbort_=function(e){return"APPENDING"!==this.state||this.pendingSegment_?!this.pendingSegment_||this.pendingSegment_.requestId!==e:(this.state="READY",!0)},n.error=function(e){return void 0!==e&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_},n.endOfStream=function(){this.ended_=!0,this.transmuxer_&&Ds(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")},n.buffered_=function(){var e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return la.createTimeRanges();if("main"===this.loaderType_){var t=e.hasAudio,n=e.hasVideo,r=e.isMuxed;if(n&&t&&!this.audioDisabled_&&!r)return this.sourceUpdater_.buffered();if(n)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()},n.initSegmentForMap=function(map,e){if(void 0===e&&(e=!1),!map)return null;var t=cs(map),n=this.initSegments_[t];return e&&!n&&map.bytes&&(this.initSegments_[t]=n={resolvedUri:map.resolvedUri,byterange:map.byterange,bytes:map.bytes,tracks:map.tracks,timescales:map.timescales}),n||map},n.segmentKey=function(e,t){if(void 0===t&&(t=!1),!e)return null;var n=ds(e),r=this.keyCache_[n];this.cacheEncryptionKeys_&&t&&!r&&e.bytes&&(this.keyCache_[n]=r={resolvedUri:e.resolvedUri,bytes:e.bytes});var o={resolvedUri:(r||e).resolvedUri};return r&&(o.bytes=r.bytes),o},n.couldBeginLoading_=function(){return this.playlist_&&!this.paused()},n.load=function(){if(this.monitorBuffer_(),this.playlist_)return"INIT"===this.state&&this.couldBeginLoading_()?this.init_():void(!this.couldBeginLoading_()||"READY"!==this.state&&"INIT"!==this.state||(this.state="READY"))},n.init_=function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()},n.playlist=function(e,t){if(void 0===t&&(t={}),e){var n=this.playlist_,r=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,"INIT"===this.state&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},"main"===this.loaderType_&&this.syncController_.setDateTimeMappingForStart(e));var o=null;if(n&&(n.id?o=n.id:n.uri&&(o=n.uri)),this.logger_("playlist update ["+o+" => "+(e.id||e.uri)+"]"),this.trigger("syncinfoupdate"),"INIT"===this.state&&this.couldBeginLoading_())return this.init_();if(!n||n.uri!==e.uri)return null!==this.mediaIndex&&(e.endList?this.resyncLoader():this.resetLoader()),this.currentMediaInfo_=void 0,void this.trigger("playlistupdate");var l=e.mediaSequence-n.mediaSequence;if(this.logger_("live window shift ["+l+"]"),null!==this.mediaIndex)if(this.mediaIndex-=l,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{var c=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!c.parts||!c.parts.length||!c.parts[this.partIndex])){var d=this.mediaIndex;this.logger_("currently processing part (index "+this.partIndex+") no longer exists."),this.resetLoader(),this.mediaIndex=d}}r&&(r.mediaIndex-=l,r.mediaIndex<0?(r.mediaIndex=null,r.partIndex=null):(r.mediaIndex>=0&&(r.segment=e.segments[r.mediaIndex]),r.partIndex>=0&&r.segment.parts&&(r.part=r.segment.parts[r.partIndex]))),this.syncController_.saveExpiredSegmentInfo(n,e)}},n.pause=function(){this.checkBufferTimeout_&&(l.a.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)},n.paused=function(){return null===this.checkBufferTimeout_},n.resetEverything=function(e){this.ended_=!1,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))},n.resetLoader=function(){this.fetchAtBuffer_=!1,this.resyncLoader()},n.resyncLoader=function(){this.transmuxer_&&Ds(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})},n.remove=function(e,t,n,r){if(void 0===n&&(n=function(){}),void 0===r&&(r=!1),t===1/0&&(t=this.duration_()),t<=e)this.logger_("skipping remove because end ${end} is <= start ${start}");else if(this.sourceUpdater_&&this.getMediaInfo_()){var o=1,l=function(){0===--o&&n()};for(var track in!r&&this.audioDisabled_||(o++,this.sourceUpdater_.removeAudio(e,t,l)),(r||"main"===this.loaderType_)&&(this.gopBuffer_=function(e,t,n,r){for(var o=Math.ceil((t-r)*W.ONE_SECOND_IN_TS),l=Math.ceil((n-r)*W.ONE_SECOND_IN_TS),c=e.slice(),i=e.length;i--&&!(e[i].pts<=l););if(-1===i)return c;for(var d=i+1;d--&&!(e[d].pts<=o););return d=Math.max(d,0),c.splice(d,i-d+1),c}(this.gopBuffer_,e,t,this.timeMapping_),o++,this.sourceUpdater_.removeVideo(e,t,l)),this.inbandTextTracks_)lo(e,t,this.inbandTextTracks_[track]);lo(e,t,this.segmentMetadataTrack_),l()}else this.logger_("skipping remove because no source updater or starting media info")},n.monitorBuffer_=function(){this.checkBufferTimeout_&&l.a.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=l.a.setTimeout(this.monitorBufferTick_.bind(this),1)},n.monitorBufferTick_=function(){"READY"===this.state&&this.fillBuffer_(),this.checkBufferTimeout_&&l.a.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=l.a.setTimeout(this.monitorBufferTick_.bind(this),500)},n.fillBuffer_=function(){if(!this.sourceUpdater_.updating()){var e=this.chooseNextRequest_();e&&("number"==typeof e.timestampOffset&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e))}},n.isEndOfStream_=function(e,t,n){if(void 0===e&&(e=this.mediaIndex),void 0===t&&(t=this.playlist_),void 0===n&&(n=this.partIndex),!t||!this.mediaSource_)return!1;var r="number"==typeof e&&t.segments[e],o=e+1===t.segments.length,l=!r||!r.parts||n+1===r.parts.length;return t.endList&&"open"===this.mediaSource_.readyState&&o&&l},n.chooseNextRequest_=function(){var e=this.buffered_(),t=ba(e)||0,n=Ta(e,this.currentTime_()),r=!this.hasPlayed_()&&n>=1,o=n>=this.goalBufferLength_(),l=this.playlist_.segments;if(!l.length||r||o)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_());var c={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:Boolean(!this.syncPoint_)};if(c.isSyncRequest)c.mediaIndex=function(e,t,n){t=t||[];for(var r=[],time=0,i=0;in))return i}return 0===r.length?0:r[r.length-1]}(this.currentTimeline_,l,t);else if(null!==this.mediaIndex){var d=l[this.mediaIndex],h="number"==typeof this.partIndex?this.partIndex:-1;c.startOfSegment=d.end?d.end:t,d.parts&&d.parts[h+1]?(c.mediaIndex=this.mediaIndex,c.partIndex=h+1):c.mediaIndex=this.mediaIndex+1}else{var f=Fa.getMediaInfoForTime({experimentalExactManifestTimings:this.experimentalExactManifestTimings,playlist:this.playlist_,currentTime:this.fetchAtBuffer_?t:this.currentTime_(),startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time}),m=f.segmentIndex,v=f.startTime,y=f.partIndex;c.getMediaInfoForTime=this.fetchAtBuffer_?"bufferedEnd "+t:"currentTime "+this.currentTime_(),c.mediaIndex=m,c.startOfSegment=v,c.partIndex=y}var _=l[c.mediaIndex],T=_&&"number"==typeof c.partIndex&&_.parts&&_.parts[c.partIndex];if(!_||"number"==typeof c.partIndex&&!T)return null;if("number"!=typeof c.partIndex&&_.parts&&(c.partIndex=0,T=_.parts[0]),!n&&T&&!T.independent)if(0===c.partIndex){var S=l[c.mediaIndex-1],E=S.parts&&S.parts.length&&S.parts[S.parts.length-1];E&&E.independent&&(c.mediaIndex-=1,c.partIndex=S.parts.length-1,c.independent="previous segment")}else _.parts[c.partIndex-1].independent&&(c.partIndex-=1,c.independent="previous part");var k=this.mediaSource_&&"ended"===this.mediaSource_.readyState;return c.mediaIndex>=l.length-1&&k&&!this.seeking_()?null:this.generateSegmentInfo_(c)},n.generateSegmentInfo_=function(e){var t=e.independent,n=e.playlist,r=e.mediaIndex,o=e.startOfSegment,l=e.isSyncRequest,c=e.partIndex,d=e.forceTimestampOffset,h=e.getMediaInfoForTime,f=n.segments[r],m="number"==typeof c&&f.parts[c],v={requestId:"segment-loader-"+Math.random(),uri:m&&m.resolvedUri||f.resolvedUri,mediaIndex:r,partIndex:m?c:null,isSyncRequest:l,startOfSegment:o,playlist:n,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:f.timeline,duration:m&&m.duration||f.duration,segment:f,part:m,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:h,independent:t},y=void 0!==d?d:this.isPendingTimestampOffset_;v.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:f.timeline,currentTimeline:this.currentTimeline_,startOfSegment:o,buffered:this.buffered_(),overrideCheck:y});var _=ba(this.sourceUpdater_.audioBuffered());return"number"==typeof _&&(v.audioAppendStart=_-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(v.gopsToAlignWith=function(e,t,n){if(null==t||!e.length)return[];var i,r=Math.ceil((t-n+3)*W.ONE_SECOND_IN_TS);for(i=0;ir);i++);return e.slice(i)}(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),v},n.timestampOffsetForSegment_=function(e){return n=(t=e).segmentTimeline,r=t.currentTimeline,o=t.startOfSegment,l=t.buffered,t.overrideCheck||n!==r?n "+d+" for "+e),function(e,t,n){if(!e[n]){t.trigger({type:"usage",name:"vhs-608"}),t.trigger({type:"usage",name:"hls-608"});var r=n;/^cc708_/.test(n)&&(r="SERVICE"+n.split("_")[1]);var track=t.textTracks().getTrackById(r);if(track)e[n]=track;else{var label=n,o=n,l=!1,c=(t.options_.vhs&&t.options_.vhs.captionServices||{})[r];c&&(label=c.label,o=c.language,l=c.default),e[n]=t.addRemoteTextTrack({kind:"captions",id:r,default:l,label:label,language:o},!1).track}}}(f,n.vhs_.tech_,e),lo(c,d,f[e]),function(e){var t=e.inbandTextTracks,n=e.captionArray,r=e.timestampOffset;if(n){var o=l.a.WebKitDataCue||l.a.VTTCue;n.forEach((function(caption){var track=caption.stream;t[track].addCue(new o(caption.startTime+r,caption.endTime+r,caption.text))}))}}({captionArray:h,inbandTextTracks:f,timestampOffset:r})})),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}else this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,e,t));else this.logger_("SegmentLoader received no captions from a caption event")},n.handleId3_=function(e,t,n){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId))if(this.pendingSegment_.hasAppendedData_){var r=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();!function(e,t,n){e.metadataTrack_||(e.metadataTrack_=n.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,e.metadataTrack_.inBandMetadataTrackDispatchType=t)}(this.inbandTextTracks_,n,this.vhs_.tech_),uo({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:r,videoDuration:this.duration_()})}else this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,n))},n.processMetadataQueue_=function(){this.metadataQueue_.id3.forEach((function(e){return e()})),this.metadataQueue_.caption.forEach((function(e){return e()})),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]},n.processCallQueue_=function(){var e=this.callQueue_;this.callQueue_=[],e.forEach((function(e){return e()}))},n.processLoadQueue_=function(){var e=this.loadQueue_;this.loadQueue_=[],e.forEach((function(e){return e()}))},n.hasEnoughInfoToLoad_=function(){if("audio"!==this.loaderType_)return!0;var e=this.pendingSegment_;return!!e&&(!this.getCurrentMediaInfo_()||!mo({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))},n.getCurrentMediaInfo_=function(e){return void 0===e&&(e=this.pendingSegment_),e&&e.trackInfo||this.currentMediaInfo_},n.getMediaInfo_=function(e){return void 0===e&&(e=this.pendingSegment_),this.getCurrentMediaInfo_(e)||this.startingMediaInfo_},n.hasEnoughInfoToAppend_=function(){if(!this.sourceUpdater_.ready())return!1;if(this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;var e=this.pendingSegment_,t=this.getCurrentMediaInfo_();if(!e||!t)return!1;var n=t.hasAudio,r=t.hasVideo,o=t.isMuxed;return!(r&&!e.videoTimingInfo)&&(!(n&&!this.audioDisabled_&&!o&&!e.audioTimingInfo)&&!mo({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))},n.handleData_=function(e,t){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId))if(!this.callQueue_.length&&this.hasEnoughInfoToAppend_()){var n=this.pendingSegment_;if(this.setTimeMapping_(n.timeline),this.updateMediaSecondsLoaded_(n.part||n.segment),"closed"!==this.mediaSource_.readyState){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),n.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),n.isFmp4=e.isFmp4,n.timingInfo=n.timingInfo||{},n.isFmp4)this.trigger("fmp4"),n.timingInfo.start=n[fo(t.type)].start;else{var r,o=this.getCurrentMediaInfo_(),l="main"===this.loaderType_&&o&&o.hasVideo;l&&(r=n.videoTimingInfo.start),n.timingInfo.start=this.trueSegmentStart_({currentStart:n.timingInfo.start,playlist:n.playlist,mediaIndex:n.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:l,firstVideoFrameTimeForData:r,videoTimingInfo:n.videoTimingInfo,audioTimingInfo:n.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(n,t.type),this.updateSourceBufferTimestampOffset_(n),n.isSyncRequest){this.updateTimingInfoEnd_(n),this.syncController_.saveSegmentTimingInfo({segmentInfo:n,shouldSaveTimelineMapping:"main"===this.loaderType_});var c=this.chooseNextRequest_();if(c.mediaIndex!==n.mediaIndex||c.partIndex!==n.partIndex)return void this.logger_("sync segment was incorrect, not appending");this.logger_("sync segment was correct, appending")}n.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(n,t)}}else this.callQueue_.push(this.handleData_.bind(this,e,t))},n.updateAppendInitSegmentStatus=function(e,t){"main"!==this.loaderType_||"number"!=typeof e.timestampOffset||e.changedTimestampOffset||(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[t]!==e.playlist&&(this.appendInitSegment_[t]=!0)},n.getInitSegmentAndUpdateState_=function(e){var t=e.type,n=e.initSegment,map=e.map,r=e.playlist;if(map){var o=cs(map);if(this.activeInitSegmentId_===o)return null;n=this.initSegmentForMap(map,!0).bytes,this.activeInitSegmentId_=o}return n&&this.appendInitSegment_[t]?(this.playlistOfLastInitSegment_[t]=r,this.appendInitSegment_[t]=!1,this.activeInitSegmentId_=null,n):null},n.handleQuotaExceededError_=function(e,t){var n=this,r=e.segmentInfo,o=e.type,c=e.bytes,d=this.sourceUpdater_.audioBuffered(),h=this.sourceUpdater_.videoBuffered();d.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+_a(d).join(", ")),h.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+_a(h).join(", "));var f=d.length?d.start(0):0,m=d.length?d.end(d.length-1):0,v=h.length?h.start(0):0,y=h.length?h.end(h.length-1):0;if(m-f<=1&&y-v<=1)return this.logger_("On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: "+c.byteLength+", audio buffer: "+_a(d).join(", ")+", video buffer: "+_a(h).join(", ")+", "),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),void this.trigger("error");this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:r,type:o,bytes:c}));var _=this.currentTime_()-1;this.logger_("On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to "+_),this.remove(0,_,(function(){n.logger_("On QUOTA_EXCEEDED_ERR, retrying append in 1s"),n.waitingOnRemove_=!1,n.quotaExceededErrorRetryTimeout_=l.a.setTimeout((function(){n.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),n.quotaExceededErrorRetryTimeout_=null,n.processCallQueue_()}),1e3)}),!0)},n.handleAppendError_=function(e,t){var n=e.segmentInfo,r=e.type,o=e.bytes;t&&(22!==t.code?(this.logger_("Received non QUOTA_EXCEEDED_ERR on append",t),this.error(r+" append of "+o.length+"b failed for segment #"+n.mediaIndex+" in playlist "+n.playlist.id),this.trigger("appenderror")):this.handleQuotaExceededError_({segmentInfo:n,type:r,bytes:o}))},n.appendToSourceBuffer_=function(e){var t,n,r,o=e.segmentInfo,l=e.type,c=e.initSegment,data=e.data,d=e.bytes;if(!d){var h=[data],f=data.byteLength;c&&(h.unshift(c),f+=c.byteLength),r=0,(t={bytes:f,segments:h}).bytes&&(n=new Uint8Array(t.bytes),t.segments.forEach((function(e){n.set(e,r),r+=e.byteLength}))),d=n}this.sourceUpdater_.appendBuffer({segmentInfo:o,type:l,bytes:d},this.handleAppendError_.bind(this,{segmentInfo:o,type:l,bytes:d}))},n.handleSegmentTimingInfo_=function(e,t,n){if(this.pendingSegment_&&t===this.pendingSegment_.requestId){var r=this.pendingSegment_.segment,o=e+"TimingInfo";r[o]||(r[o]={}),r[o].transmuxerPrependedSeconds=n.prependedContentDuration||0,r[o].transmuxedPresentationStart=n.start.presentation,r[o].transmuxedDecodeStart=n.start.decode,r[o].transmuxedPresentationEnd=n.end.presentation,r[o].transmuxedDecodeEnd=n.end.decode,r[o].baseMediaDecodeTime=n.baseMediaDecodeTime}},n.appendData_=function(e,t){var n=t.type,data=t.data;if(data&&data.byteLength&&("audio"!==n||!this.audioDisabled_)){var r=this.getInitSegmentAndUpdateState_({type:n,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:n,initSegment:r,data:data})}},n.loadSegment_=function(e){var t=this;this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),"number"==typeof e.timestampOffset&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.hasEnoughInfoToLoad_()?this.updateTransmuxerAndRequestSegment_(e):this.loadQueue_.push((function(){var n=f()({},e,{forceTimestampOffset:!0});f()(e,t.generateSegmentInfo_(n)),t.isPendingTimestampOffset_=!1,t.updateTransmuxerAndRequestSegment_(e)}))},n.updateTransmuxerAndRequestSegment_=function(e){var t=this;this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));var n=this.createSimplifiedSegmentObj_(e),r=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),o=null!==this.mediaIndex,l=e.timeline!==this.currentTimeline_&&e.timeline>0,c=r||o&&l;this.logger_("Requesting "+po(e)),n.map&&!n.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=Ys({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:n,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:c,endedTimelineFn:function(){t.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:function(n){var r=n.message,o=n.level,l=n.stream;t.logger_(po(e)+" logged from transmuxer stream "+l+" as a "+o+": "+r)}})},n.trimBackBuffer_=function(e){var t=function(e,t,n){var r=t-Ss.BACK_BUFFER_LENGTH;e.length&&(r=Math.max(r,e.start(0)));var o=t-n;return Math.min(o,r)}(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)},n.createSimplifiedSegmentObj_=function(e){var t=e.segment,n=e.part,r={resolvedUri:n?n.resolvedUri:t.resolvedUri,byterange:n?n.byterange:t.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part},o=e.playlist.segments[e.mediaIndex-1];if(o&&o.timeline===t.timeline&&(o.videoTimingInfo?r.baseStartTime=o.videoTimingInfo.transmuxedDecodeEnd:o.audioTimingInfo&&(r.baseStartTime=o.audioTimingInfo.transmuxedDecodeEnd)),t.key){var l=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);r.key=this.segmentKey(t.key),r.key.iv=l}return t.map&&(r.map=this.initSegmentForMap(t.map)),r},n.saveTransferStats_=function(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)},n.saveBandwidthRelatedStats_=function(e,t){this.pendingSegment_.byteLength=t.bytesReceived,e=r);i++);return e.slice(0,i).concat(t)}(this.gopBuffer_,n.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(r)}},n.setTimeMapping_=function(e){var t=this.syncController_.mappingForTimeline(e);null!==t&&(this.timeMapping_=t)},n.updateMediaSecondsLoaded_=function(e){"number"==typeof e.start&&"number"==typeof e.end?this.mediaSecondsLoaded+=e.end-e.start:this.mediaSecondsLoaded+=e.duration},n.shouldUpdateTransmuxerTimestampOffset_=function(e){return null!==e&&("main"===this.loaderType_&&e!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&e!==this.sourceUpdater_.audioTimestampOffset())},n.trueSegmentStart_=function(e){var t=e.currentStart,n=e.playlist,r=e.mediaIndex,o=e.firstVideoFrameTimeForData,l=e.currentVideoTimestampOffset,c=e.useVideoTimingInfo,d=e.videoTimingInfo,h=e.audioTimingInfo;if(void 0!==t)return t;if(!c)return h.start;var f=n.segments[r-1];return 0!==r&&f&&void 0!==f.start&&f.end===o+l?d.start:o},n.waitForAppendsToComplete_=function(e){var t=this.getCurrentMediaInfo_(e);if(!t)return this.error({message:"No starting media returned, likely due to an unsupported media format.",blacklistDuration:1/0}),void this.trigger("error");var n=t.hasAudio,r=t.hasVideo,o=t.isMuxed,l="main"===this.loaderType_&&r,c=!this.audioDisabled_&&n&&!o;if(e.waitingOnAppends=0,!e.hasAppendedData_)return e.timingInfo||"number"!=typeof e.timestampOffset||(this.isPendingTimestampOffset_=!0),e.timingInfo={start:0},e.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(e),this.processMetadataQueue_()),void this.checkAppendsDone_(e);l&&e.waitingOnAppends++,c&&e.waitingOnAppends++,l&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),c&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))},n.checkAppendsDone_=function(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,0===e.waitingOnAppends&&this.handleAppendsDone_())},n.checkForIllegalMediaSwitch=function(e){var t=function(e,t,n){return"main"===e&&t&&n?n.hasAudio||n.hasVideo?t.hasVideo&&!n.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!t.hasVideo&&n.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null:"Neither audio nor video found in segment.":null}(this.loaderType_,this.getCurrentMediaInfo_(),e);return!!t&&(this.error({message:t,blacklistDuration:1/0}),this.trigger("error"),!0)},n.updateSourceBufferTimestampOffset_=function(e){if(null!==e.timestampOffset&&"number"==typeof e.timingInfo.start&&!e.changedTimestampOffset&&"main"===this.loaderType_){var t=!1;e.timestampOffset-=this.getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e.segment.videoTimingInfo,audioTimingInfo:e.segment.audioTimingInfo,timingInfo:e.timingInfo}),e.changedTimestampOffset=!0,e.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(e.timestampOffset),t=!0),e.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(e.timestampOffset),t=!0),t&&this.trigger("timestampoffset")}},n.getSegmentStartTimeForTimestampOffsetCalculation_=function(e){var t=e.videoTimingInfo,n=e.audioTimingInfo,r=e.timingInfo;return this.useDtsForTimestampOffset_?t&&"number"==typeof t.transmuxedDecodeStart?t.transmuxedDecodeStart:n&&"number"==typeof n.transmuxedDecodeStart?n.transmuxedDecodeStart:r.start:r.start},n.updateTimingInfoEnd_=function(e){e.timingInfo=e.timingInfo||{};var t=this.getMediaInfo_(),n="main"===this.loaderType_&&t&&t.hasVideo&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;n&&(e.timingInfo.end="number"==typeof n.end?n.end:n.start+e.duration)},n.handleAppendsDone_=function(){if(this.pendingSegment_&&this.trigger("appendsdone"),!this.pendingSegment_)return this.state="READY",void(this.paused()||this.monitorBuffer_());var e=this.pendingSegment_;this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:"main"===this.loaderType_});var t=vo(e,this.sourceType_);if(t&&("warn"===t.severity?la.log.warn(t.message):this.logger_(t.message)),this.recordThroughput_(e),this.pendingSegment_=null,this.state="READY",!e.isSyncRequest||(this.trigger("syncinfoupdate"),e.hasAppendedData_)){this.logger_("Appended "+po(e)),this.addSegmentMetadataCue_(e),this.fetchAtBuffer_=!0,this.currentTimeline_!==e.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline}),"main"!==this.loaderType_||this.audioDisabled_||this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:e.timeline})),this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate");var n=e.segment,r=e.part,o=n.end&&this.currentTime_()-n.end>3*e.playlist.targetDuration,l=r&&r.end&&this.currentTime_()-r.end>3*e.playlist.partTargetDuration;if(o||l)return this.logger_("bad "+(o?"segment":"part")+" "+po(e)),void this.resetEverything();null!==this.mediaIndex&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()}else this.logger_("Throwing away un-appended sync request "+po(e))},n.recordThroughput_=function(e){if(e.duration=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e},n.stopForError=function(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")},n.segmentRequestFinished_=function(e,t,n){var r=this;if(this.subtitlesTrack_){if(this.saveTransferStats_(t.stats),!this.pendingSegment_)return this.state="READY",void(this.mediaRequestsAborted+=1);if(e)return e.code===Us&&this.handleTimeout_(),e.code===Bs?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,void this.stopForError(e);var o=this.pendingSegment_;this.saveBandwidthRelatedStats_(o.duration,t.stats),this.state="APPENDING",this.trigger("appending");var c=o.segment;if(c.map&&(c.map.bytes=t.map.bytes),o.bytes=t.bytes,"function"!=typeof l.a.WebVTT&&this.subtitlesTrack_&&this.subtitlesTrack_.tech_){var d,h=function(){r.subtitlesTrack_.tech_.off("vttjsloaded",d),r.stopForError({message:"Error loading vtt.js"})};return d=function(){r.subtitlesTrack_.tech_.off("vttjserror",h),r.segmentRequestFinished_(e,t,n)},this.state="WAITING_ON_VTTJS",this.subtitlesTrack_.tech_.one("vttjsloaded",d),void this.subtitlesTrack_.tech_.one("vttjserror",h)}c.requested=!0;try{this.parseVTTCues_(o)}catch(e){return void this.stopForError({message:e.message})}if(this.updateTimeMapping_(o,this.syncController_.timelines[o.timeline],this.playlist_),o.cues.length?o.timingInfo={start:o.cues[0].startTime,end:o.cues[o.cues.length-1].endTime}:o.timingInfo={start:o.startOfSegment,end:o.startOfSegment+o.duration},o.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");o.byteLength=o.bytes.byteLength,this.mediaSecondsLoaded+=c.duration,o.cues.forEach((function(e){r.subtitlesTrack_.addCue(r.featuresNativeTextTracks_?new l.a.VTTCue(e.startTime,e.endTime,e.text):e)})),function(track){var e=track.cues;if(e)for(var i=0;i1&&t.push(e[r]);t.length&&t.forEach((function(e){return track.removeCue(e)}))}}(this.subtitlesTrack_),this.handleAppendsDone_()}else this.state="READY"},n.handleData_=function(){},n.updateTimingInfoEnd_=function(){},n.parseVTTCues_=function(e){var t,n=!1;"function"==typeof l.a.TextDecoder?t=new l.a.TextDecoder("utf8"):(t=l.a.WebVTT.StringDecoder(),n=!0);var r=new l.a.WebVTT.Parser(l.a,l.a.vttjs,t);if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},r.oncue=e.cues.push.bind(e.cues),r.ontimestampmap=function(map){e.timestampmap=map},r.onparsingerror=function(e){la.log.warn("Error encountered when parsing cues: "+e.message)},e.segment.map){var o=e.segment.map.bytes;n&&(o=Fo(o)),r.parse(o)}var c=e.bytes;n&&(c=Fo(c)),r.parse(c),r.flush()},n.updateTimeMapping_=function(e,t,n){var r=e.segment;if(t)if(e.cues.length){var o=e.timestampmap,l=o.MPEGTS/W.ONE_SECOND_IN_TS-o.LOCAL+t.mapping;if(e.cues.forEach((function(e){e.startTime+=l,e.endTime+=l})),!n.syncInfo){var c=e.cues[0].startTime,d=e.cues[e.cues.length-1].startTime;n.syncInfo={mediaSequence:n.mediaSequence+e.mediaIndex,time:Math.min(c,d-r.duration)}}}else r.empty=!0},t}(yo),Vo=function(track,e){for(var t=track.cues,i=0;i=n.adStartTime&&e<=n.adEndTime)return n}return null},Wo=[{name:"VOD",run:function(e,t,n,r,o){if(n!==1/0){return{time:0,segmentIndex:0,partIndex:null}}return null}},{name:"ProgramDateTime",run:function(e,t,n,r,o){if(!Object.keys(e.timelineToDatetimeMappings).length)return null;var l=null,c=null,d=ka(t);o=o||0;for(var i=0;i=v)&&(c=v,l={time:m,segmentIndex:h.segmentIndex,partIndex:h.partIndex})}}return l}},{name:"Discontinuity",run:function(e,t,n,r,o){var l=null;if(o=o||0,t.discontinuityStarts&&t.discontinuityStarts.length)for(var c=null,i=0;i=m)&&(c=m,l={time:f.time,segmentIndex:d,partIndex:null})}}return l}},{name:"Playlist",run:function(e,t,n,r,o){return t.syncInfo?{time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence,partIndex:null}:null}}],zo=function(e){function t(t){var n;return(n=e.call(this)||this).timelines=[],n.discontinuities=[],n.timelineToDatetimeMappings={},n.logger_=ha("SyncController"),n}S()(t,e);var n=t.prototype;return n.getSyncPoint=function(e,t,n,r){var o=this.runStrategies_(e,t,n,r);return o.length?this.selectSyncPoint_(o,{key:"time",value:r}):null},n.getExpiredTime=function(e,t){if(!e||!e.segments)return null;var n=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!n.length)return null;var r=this.selectSyncPoint_(n,{key:"segmentIndex",value:0});return r.segmentIndex>0&&(r.time*=-1),Math.abs(r.time+Pa({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:r.segmentIndex,endIndex:0}))},n.runStrategies_=function(e,t,n,r){for(var o=[],i=0;i86400)la.log.warn("Not saving expired segment info. Media sequence gap "+n+" is too large.");else for(var i=n-1;i>=0;i--){var r=e.segments[i];if(r&&void 0!==r.start){t.syncInfo={mediaSequence:e.mediaSequence+i,time:r.start},this.logger_("playlist refresh sync: [time:"+t.syncInfo.time+", mediaSequence: "+t.syncInfo.mediaSequence+"]"),this.trigger("syncinfoupdate");break}}},n.setDateTimeMappingForStart=function(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){var t=e.segments[0],n=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-n}},n.saveSegmentTimingInfo=function(e){var t=e.segmentInfo,n=e.shouldSaveTimelineMapping,r=this.calculateSegmentTimeMapping_(t,t.timingInfo,n),o=t.segment;r&&(this.saveDiscontinuitySyncInfo_(t),t.playlist.syncInfo||(t.playlist.syncInfo={mediaSequence:t.playlist.mediaSequence+t.mediaIndex,time:o.start}));var l=o.dateTimeObject;o.discontinuity&&n&&l&&(this.timelineToDatetimeMappings[o.timeline]=-l.getTime()/1e3)},n.timestampOffsetForTimeline=function(e){return void 0===this.timelines[e]?null:this.timelines[e].time},n.mappingForTimeline=function(e){return void 0===this.timelines[e]?null:this.timelines[e].mapping},n.calculateSegmentTimeMapping_=function(e,t,n){var r,o,l=e.segment,c=e.part,d=this.timelines[e.timeline];if("number"==typeof e.timestampOffset)d={time:e.startOfSegment,mapping:e.startOfSegment-t.start},n&&(this.timelines[e.timeline]=d,this.trigger("timestampoffset"),this.logger_("time mapping for timeline "+e.timeline+": [time: "+d.time+"] [mapping: "+d.mapping+"]")),r=e.startOfSegment,o=t.end+d.mapping;else{if(!d)return!1;r=t.start+d.mapping,o=t.end+d.mapping}return c&&(c.start=r,c.end=o),(!l.start||rc){var time=void 0;time=l<0?n.start-Pa({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:r}):n.end+Pa({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:r}),this.discontinuities[o]={time:time,accuracy:c}}}},n.dispose=function(){this.trigger("dispose"),this.off()},t}(la.EventTarget),Go=function(e){function t(){var t;return(t=e.call(this)||this).pendingTimelineChanges_={},t.lastTimelineChanges_={},t}S()(t,e);var n=t.prototype;return n.clearPendingTimelineChange=function(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")},n.pendingTimelineChange=function(e){var t=e.type,n=e.from,r=e.to;return"number"==typeof n&&"number"==typeof r&&(this.pendingTimelineChanges_[t]={type:t,from:n,to:r},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[t]},n.lastTimelineChange=function(e){var t=e.type,n=e.from,r=e.to;return"number"==typeof n&&"number"==typeof r&&(this.lastTimelineChanges_[t]={type:t,from:n,to:r},delete this.pendingTimelineChanges_[t],this.trigger("timelinechange")),this.lastTimelineChanges_[t]},n.dispose=function(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()},t}(la.EventTarget),Xo=ks(Cs(ws((function(){var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{};function n(e,t,n){return e(n={path:t,exports:{},require:function(path,base){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==base&&n.path)}},n.exports),n.exports}var r=n((function(e){function t(e,t){for(var i=0;i-1},t.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var n=t.length,i=0;i>7))^i]=i;for(e=t=0;!f[e];e^=n||1,t=th[t]||1)for(s=(s=t^t<<1^t<<2^t<<3^t<<4)>>8^255&s^99,f[e]=s,m[s]=e,l=16843009*v[r=v[n=v[e]]]^65537*r^257*n^16843008*e,o=257*v[s]^16843008*s,i=0;i<4;i++)d[i][e]=o=o<<24^o>>>8,h[i][s]=l=l<<24^l>>>8;for(i=0;i<5;i++)d[i]=d[i].slice(0),h[i]=h[i].slice(0);return c}()),this._tables=[[h[0][0].slice(),h[0][1].slice(),h[0][2].slice(),h[0][3].slice(),h[0][4].slice()],[h[1][0].slice(),h[1][1].slice(),h[1][2].slice(),h[1][3].slice(),h[1][4].slice()]];var r=this._tables[0][4],o=this._tables[1],l=e.length,c=1;if(4!==l&&6!==l&&8!==l)throw new Error("Invalid aes key size");var d=e.slice(0),f=[];for(this._key=[d,f],i=l;i<4*l+28;i++)n=d[i-1],(i%l==0||8===l&&i%l==4)&&(n=r[n>>>24]<<24^r[n>>16&255]<<16^r[n>>8&255]<<8^r[255&n],i%l==0&&(n=n<<8^n>>>24^c<<24,c=c<<1^283*(c>>7))),d[i]=d[i-l]^n;for(t=0;i;t++,i--)n=d[3&t?i:i-4],f[t]=i<=4||t<4?n:o[0][r[n>>>24]]^o[1][r[n>>16&255]]^o[2][r[n>>8&255]]^o[3][r[255&n]]}return e.prototype.decrypt=function(e,t,n,r,o,l){var c,d,h,i,f=this._key[1],a=e^f[0],b=r^f[1],m=n^f[2],v=t^f[3],y=f.length/4-2,_=4,table=this._tables[1],T=table[0],S=table[1],E=table[2],k=table[3],C=table[4];for(i=0;i>>24]^S[b>>16&255]^E[m>>8&255]^k[255&v]^f[_],d=T[b>>>24]^S[m>>16&255]^E[v>>8&255]^k[255&a]^f[_+1],h=T[m>>>24]^S[v>>16&255]^E[a>>8&255]^k[255&b]^f[_+2],v=T[v>>>24]^S[a>>16&255]^E[b>>8&255]^k[255&m]^f[_+3],_+=4,a=c,b=d,m=h;for(i=0;i<4;i++)o[(3&-i)+l]=C[a>>>24]<<24^C[b>>16&255]<<16^C[m>>8&255]<<8^C[255&v]^f[_++],c=a,a=b,b=m,m=v,v=c},e}(),m=function(e){function t(){var t;return(t=e.call(this,c)||this).jobs=[],t.delay=1,t.timeout_=null,t}l(t,e);var n=t.prototype;return n.processJob_=function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null},n.push=function(e){this.jobs.push(e),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},t}(c),v=function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24},y=function(){function e(t,n,r,o){var l=e.STEP,c=new Int32Array(t.buffer),d=new Uint8Array(t.byteLength),i=0;for(this.asyncStream_=new m,this.asyncStream_.push(this.decryptChunk_(c.subarray(i,i+l),n,r,d)),i=l;i>2),S=new f(Array.prototype.slice.call(t)),E=new Uint8Array(e.byteLength),k=new Int32Array(E.buffer);for(r=n[0],o=n[1],l=n[2],c=n[3],_=0;_=0&&(t="main-desc"),t},Yo=function(e,t){e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},Qo=function(e,t){t.activePlaylistLoader=e,e.load()},$o={AUDIO:function(e,t){return function(){var n=t.segmentLoaders[e],r=t.mediaTypes[e],o=t.blacklistCurrentPlaylist;Yo(n,r);var l=r.activeTrack(),c=r.activeGroup(),d=(c.filter((function(e){return e.default}))[0]||c[0]).id,h=r.tracks[d];if(l!==h){for(var f in la.log.warn("Problem encountered loading the alternate audio track.Switching back to default."),r.tracks)r.tracks[f].enabled=r.tracks[f]===h;r.onTrackChanged()}else o({message:"Problem encountered loading the default audio track."})}},SUBTITLES:function(e,t){return function(){var n=t.segmentLoaders[e],r=t.mediaTypes[e];la.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),Yo(n,r);var track=r.activeTrack();track&&(track.mode="disabled"),r.onTrackChanged()}}},Jo={AUDIO:function(e,t,n){if(t){var r=n.tech,o=n.requestOptions,l=n.segmentLoaders[e];t.on("loadedmetadata",(function(){var e=t.media();l.playlist(e,o),(!r.paused()||e.endList&&"none"!==r.preload())&&l.load()})),t.on("loadedplaylist",(function(){l.playlist(t.media(),o),r.paused()||l.load()})),t.on("error",$o[e](e,n))}},SUBTITLES:function(e,t,n){var r=n.tech,o=n.requestOptions,l=n.segmentLoaders[e],c=n.mediaTypes[e];t.on("loadedmetadata",(function(){var e=t.media();l.playlist(e,o),l.track(c.activeTrack()),(!r.paused()||e.endList&&"none"!==r.preload())&&l.load()})),t.on("loadedplaylist",(function(){l.playlist(t.media(),o),r.paused()||l.load()})),t.on("error",$o[e](e,n))}},Zo={AUDIO:function(e,t){var n=t.vhs,r=t.sourceType,o=t.segmentLoaders[e],l=t.requestOptions,c=t.master.mediaGroups,d=t.mediaTypes[e],h=d.groups,f=d.tracks,m=d.logger_,v=t.masterPlaylistLoader,y=ja(v.master);for(var _ in c[e]&&0!==Object.keys(c[e]).length||(c[e]={main:{default:{default:!0}}},y&&(c[e].main.default.playlists=v.master.playlists)),c[e])for(var T in h[_]||(h[_]=[]),c[e][_]){var S=c[e][_][T],E=void 0;if(y?(m("AUDIO group '"+_+"' label '"+T+"' is a master playlist"),S.isMasterPlaylist=!0,E=null):E="vhs-json"===r&&S.playlists?new es(S.playlists[0],n,l):S.resolvedUri?new es(S.resolvedUri,n,l):S.playlists&&"dash"===r?new Ts(S.playlists[0],n,l,v):null,S=la.mergeOptions({id:T,playlistLoader:E},S),Jo[e](e,S.playlistLoader,t),h[_].push(S),void 0===f[T]){var track=new la.AudioTrack({id:T,kind:Ko(S),enabled:!1,language:S.language,default:S.default,label:T});f[T]=track}}o.on("error",$o[e](e,t))},SUBTITLES:function(e,t){var n=t.tech,r=t.vhs,o=t.sourceType,l=t.segmentLoaders[e],c=t.requestOptions,d=t.master.mediaGroups,h=t.mediaTypes[e],f=h.groups,m=h.tracks,v=t.masterPlaylistLoader;for(var y in d[e])for(var _ in f[y]||(f[y]=[]),d[e][y])if(!d[e][y][_].forced){var T=d[e][y][_],S=void 0;if("hls"===o)S=new es(T.resolvedUri,r,c);else if("dash"===o){if(!T.playlists.filter((function(p){return p.excludeUntil!==1/0})).length)return;S=new Ts(T.playlists[0],r,c,v)}else"vhs-json"===o&&(S=new es(T.playlists?T.playlists[0]:T.resolvedUri,r,c));if(T=la.mergeOptions({id:_,playlistLoader:S},T),Jo[e](e,T.playlistLoader,t),f[y].push(T),void 0===m[_]){var track=n.addRemoteTextTrack({id:_,kind:"subtitles",default:T.default&&T.autoselect,language:T.language,label:_},!1).track;m[_]=track}}l.on("error",$o[e](e,t))},"CLOSED-CAPTIONS":function(e,t){var n=t.tech,r=t.master.mediaGroups,o=t.mediaTypes[e],l=o.groups,c=o.tracks;for(var d in r[e])for(var h in l[d]||(l[d]=[]),r[e][d]){var f=r[e][d][h];if(/^(?:CC|SERVICE)/.test(f.instreamId)){var m=n.options_.vhs&&n.options_.vhs.captionServices||{},v={label:h,language:f.language,instreamId:f.instreamId,default:f.default&&f.autoselect};if(m[v.instreamId]&&(v=la.mergeOptions(v,m[v.instreamId])),void 0===v.default&&delete v.default,l[d].push(la.mergeOptions({id:h},f)),void 0===c[h]){var track=n.addRemoteTextTrack({id:v.instreamId,kind:"captions",default:v.default,language:v.language,label:v.label},!1).track;c[h]=track}}}}},eu=function e(t,n){for(var i=0;i1&&ja(t.master))for(var i=0;i "+l+" from "+t),this.tech_.trigger({type:"usage",name:"vhs-rendition-change-"+t})),this.masterPlaylistLoader_.media(e,n)},n.startABRTimer_=function(){var e=this;this.stopABRTimer_(),this.abrTimer_=l.a.setInterval((function(){return e.checkABR_()}),250)},n.stopABRTimer_=function(){this.tech_.scrubbing&&this.tech_.scrubbing()||(l.a.clearInterval(this.abrTimer_),this.abrTimer_=null)},n.getAudioTrackPlaylists_=function(){var e=this.master(),t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return t;var track,n=e.mediaGroups.AUDIO,r=Object.keys(n);if(Object.keys(this.mediaTypes_.AUDIO.groups).length)track=this.mediaTypes_.AUDIO.activeTrack();else{var o=n.main||r.length&&n[r[0]];for(var label in o)if(o[label].default){track={label:label};break}}if(!track)return t;var l=[];for(var c in n)if(n[c][track.label]){var d=n[c][track.label];if(d.playlists&&d.playlists.length)l.push.apply(l,d.playlists);else if(d.uri)l.push(d);else if(e.playlists.length)for(var i=0;i1&&(this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.tech_.trigger({type:"usage",name:"hls-alternate-audio"})),this.useCueTags_&&(this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"}),this.tech_.trigger({type:"usage",name:"hls-playlist-cue-tags"}))},n.shouldSwitchToMedia_=function(e){var t=this.masterPlaylistLoader_.media()||this.masterPlaylistLoader_.pendingMedia_,n=this.tech_.currentTime(),r=this.bufferLowWaterLine(),o=this.bufferHighWaterLine();return function(e){var t=e.currentPlaylist,n=e.buffered,r=e.currentTime,o=e.nextPlaylist,l=e.bufferLowWaterLine,c=e.bufferHighWaterLine,d=e.duration,h=e.experimentalBufferBasedABR,f=e.log;if(!o)return la.log.warn("We received no playlist to switch to. Please check your stream."),!1;var m="allowing switch "+(t&&t.id||"null")+" -> "+o.id;if(!t)return f(m+" as current playlist is not set"),!0;if(o.id===t.id)return!1;var v=Boolean(ga(n,r).length);if(!t.endList)return v||"number"!=typeof t.partTargetDuration?(f(m+" as current playlist is live"),!0):(f("not "+m+" as current playlist is live llhls, but currentTime isn't in buffered."),!1);var y=Ta(n,r),_=h?Ss.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:Ss.MAX_BUFFER_LOW_WATER_LINE;if(d<_)return f(m+" as duration < max low water line ("+d+" < "+_+")"),!0;var T=o.attributes.BANDWIDTH,S=t.attributes.BANDWIDTH;if(TS)&&y>=l){var k=m+" as forwardBuffer >= bufferLowWaterLine ("+y+" >= "+l+")";return h&&(k+=" and next bandwidth > current bandwidth ("+T+" > "+S+")"),f(k),!0}return f("not "+m+" as no switching criteria met"),!1}({buffered:this.tech_.buffered(),currentTime:n,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:r,bufferHighWaterLine:o,duration:this.duration(),experimentalBufferBasedABR:this.experimentalBufferBasedABR,log:this.logger_})},n.setupSegmentLoaderListeners_=function(){var e=this;this.experimentalBufferBasedABR||(this.mainSegmentLoader_.on("bandwidthupdate",(function(){var t=e.selectPlaylist();e.shouldSwitchToMedia_(t)&&e.switchMedia_(t,"bandwidthupdate"),e.tech_.trigger("bandwidthupdate")})),this.mainSegmentLoader_.on("progress",(function(){e.trigger("progress")}))),this.mainSegmentLoader_.on("error",(function(){e.blacklistCurrentPlaylist(e.mainSegmentLoader_.error())})),this.mainSegmentLoader_.on("appenderror",(function(){e.error=e.mainSegmentLoader_.error_,e.trigger("error")})),this.mainSegmentLoader_.on("syncinfoupdate",(function(){e.onSyncInfoUpdate_()})),this.mainSegmentLoader_.on("timestampoffset",(function(){e.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"}),e.tech_.trigger({type:"usage",name:"hls-timestamp-offset"})})),this.audioSegmentLoader_.on("syncinfoupdate",(function(){e.onSyncInfoUpdate_()})),this.audioSegmentLoader_.on("appenderror",(function(){e.error=e.audioSegmentLoader_.error_,e.trigger("error")})),this.mainSegmentLoader_.on("ended",(function(){e.logger_("main segment loader ended"),e.onEndOfStream()})),this.mainSegmentLoader_.on("earlyabort",(function(t){e.experimentalBufferBasedABR||(e.delegateLoaders_("all",["abort"]),e.blacklistCurrentPlaylist({message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},120))}));var t=function(){if(!e.sourceUpdater_.hasCreatedSourceBuffers())return e.tryToCreateSourceBuffers_();var t=e.getCodecsOrExclude_();t&&e.sourceUpdater_.addOrChangeSourceBuffers(t)};this.mainSegmentLoader_.on("trackinfo",t),this.audioSegmentLoader_.on("trackinfo",t),this.mainSegmentLoader_.on("fmp4",(function(){e.triggeredFmp4Usage||(e.tech_.trigger({type:"usage",name:"vhs-fmp4"}),e.tech_.trigger({type:"usage",name:"hls-fmp4"}),e.triggeredFmp4Usage=!0)})),this.audioSegmentLoader_.on("fmp4",(function(){e.triggeredFmp4Usage||(e.tech_.trigger({type:"usage",name:"vhs-fmp4"}),e.tech_.trigger({type:"usage",name:"hls-fmp4"}),e.triggeredFmp4Usage=!0)})),this.audioSegmentLoader_.on("ended",(function(){e.logger_("audioSegmentLoader ended"),e.onEndOfStream()}))},n.mediaSecondsLoaded_=function(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)},n.load=function(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()},n.smoothQualityChange_=function(e){void 0===e&&(e=this.selectPlaylist()),this.fastQualityChange_(e)},n.fastQualityChange_=function(e){var t=this;void 0===e&&(e=this.selectPlaylist()),e!==this.masterPlaylistLoader_.media()?(this.switchMedia_(e,"fast-quality"),this.mainSegmentLoader_.resetEverything((function(){la.browser.IE_VERSION||la.browser.IS_EDGE?t.tech_.setCurrentTime(t.tech_.currentTime()+.04):t.tech_.setCurrentTime(t.tech_.currentTime())}))):this.logger_("skipping fastQualityChange because new media is same as old")},n.play=function(){if(!this.setupFirstPlay()){this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();var e=this.tech_.seekable();return this.tech_.duration()===1/0&&this.tech_.currentTime()this.maxPlaylistRetries?1/0:Date.now()+1e3*t,n.excludeUntil=r,e.reason&&(n.lastExcludeReason_=e.reason),this.tech_.trigger("blacklistplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-blacklisted"}),this.tech_.trigger({type:"usage",name:"hls-rendition-blacklisted"});var h=this.selectPlaylist();if(!h)return this.error="Playback cannot continue. No available working or supported playlists.",void this.trigger("error");var f=e.internal?this.logger_:la.log.warn,m=e.message?" "+e.message:"";f((e.internal?"Internal problem":"Problem")+" encountered with playlist "+n.id+"."+m+" Switching to playlist "+h.id+"."),h.attributes.AUDIO!==n.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),h.attributes.SUBTITLES!==n.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);var v=h.targetDuration/2*1e3||5e3,y="number"==typeof h.lastRequest&&Date.now()-h.lastRequest<=v;return this.switchMedia_(h,"exclude",c||y)},n.pauseLoading=function(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()},n.delegateLoaders_=function(filter,e){var t=this,n=[],r="all"===filter;(r||"main"===filter)&&n.push(this.masterPlaylistLoader_);var o=[];(r||"audio"===filter)&&o.push("AUDIO"),(r||"subtitle"===filter)&&(o.push("CLOSED-CAPTIONS"),o.push("SUBTITLES")),o.forEach((function(e){var r=t.mediaTypes_[e]&&t.mediaTypes_[e].activePlaylistLoader;r&&n.push(r)})),["main","audio","subtitle"].forEach((function(e){var r=t[e+"SegmentLoader_"];!r||filter!==e&&"all"!==filter||n.push(r)})),n.forEach((function(t){return e.forEach((function(e){"function"==typeof t[e]&&t[e]()}))}))},n.setCurrentTime=function(e){var t=ga(this.tech_.buffered(),e);return this.masterPlaylistLoader_&&this.masterPlaylistLoader_.media()&&this.masterPlaylistLoader_.media().segments?t&&t.length?e:(this.mainSegmentLoader_.resetEverything(),this.mainSegmentLoader_.abort(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.resetEverything(),this.audioSegmentLoader_.abort()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.resetEverything(),this.subtitleSegmentLoader_.abort()),void this.load()):0},n.duration=function(){if(!this.masterPlaylistLoader_)return 0;var e=this.masterPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:bo.Playlist.duration(e):1/0:0},n.seekable=function(){return this.seekable_},n.onSyncInfoUpdate_=function(){var e;if(this.masterPlaylistLoader_){var t=this.masterPlaylistLoader_.media();if(t){var n=this.syncController_.getExpiredTime(t,this.duration());if(null!==n){var r=this.masterPlaylistLoader_.master,o=bo.Playlist.seekable(t,n,bo.Playlist.liveEdgeDelay(r,t));if(0!==o.length){if(this.mediaTypes_.AUDIO.activePlaylistLoader){if(t=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),null===(n=this.syncController_.getExpiredTime(t,this.duration())))return;if(0===(e=bo.Playlist.seekable(t,n,bo.Playlist.liveEdgeDelay(r,t))).length)return}var l,c;this.seekable_&&this.seekable_.length&&(l=this.seekable_.end(0),c=this.seekable_.start(0)),e?e.start(0)>o.end(0)||o.start(0)>e.end(0)?this.seekable_=o:this.seekable_=la.createTimeRanges([[e.start(0)>o.start(0)?e.start(0):o.start(0),e.end(0)0&&(r=Math.max(r,n.end(n.length-1))),this.mediaSource.duration!==r&&this.sourceUpdater_.setDuration(r)}},n.dispose=function(){var e=this;this.trigger("dispose"),this.decrypter_.terminate(),this.masterPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach((function(t){var n=e.mediaTypes_[t].groups;for(var r in n)n[r].forEach((function(e){e.playlistLoader&&e.playlistLoader.dispose()}))})),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()},n.master=function(){return this.masterPlaylistLoader_.master},n.media=function(){return this.masterPlaylistLoader_.media()||this.initialMedia_},n.areMediaTypesKnown_=function(){var e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),n=!e||!!this.audioSegmentLoader_.getCurrentMediaInfo_();return!(!t||!n)},n.getCodecsOrExclude_=function(){var e=this,t={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}};t.video=t.main;var n=eo(this.master(),this.media()),r={},o=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(t.main.hasVideo&&(r.video=n.video||t.main.videoCodec||R.b),t.main.isMuxed&&(r.video+=","+(n.audio||t.main.audioCodec||R.a)),(t.main.hasAudio&&!t.main.isMuxed||t.audio.hasAudio||o)&&(r.audio=n.audio||t.main.audioCodec||t.audio.audioCodec||R.a,t.audio.isFmp4=t.main.hasAudio&&!t.main.isMuxed?t.main.isFmp4:t.audio.isFmp4),r.audio||r.video){var l,c={};if(["video","audio"].forEach((function(e){if(r.hasOwnProperty(e)&&(o=t[e].isFmp4,d=r[e],!(o?Object(R.c)(d):Object(R.g)(d)))){var n=t[e].isFmp4?"browser":"muxer";c[n]=c[n]||[],c[n].push(r[e]),"audio"===e&&(l=n)}var o,d})),o&&l&&this.media().attributes.AUDIO){var d=this.media().attributes.AUDIO;this.master().playlists.forEach((function(t){(t.attributes&&t.attributes.AUDIO)===d&&t!==e.media()&&(t.excludeUntil=1/0)})),this.logger_("excluding audio group "+d+" as "+l+' does not support codec(s): "'+r.audio+'"')}if(!Object.keys(c).length){if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){var h=[];if(["video","audio"].forEach((function(t){var n=(Object(R.h)(e.sourceUpdater_.codecs[t]||"")[0]||{}).type,o=(Object(R.h)(r[t]||"")[0]||{}).type;n&&o&&n.toLowerCase()!==o.toLowerCase()&&h.push('"'+e.sourceUpdater_.codecs[t]+'" -> "'+r[t]+'"')})),h.length)return void this.blacklistCurrentPlaylist({playlist:this.media(),message:"Codec switching not supported: "+h.join(", ")+".",blacklistDuration:1/0,internal:!0})}return r}var f=Object.keys(c).reduce((function(e,t){return e&&(e+=", "),e+=t+' does not support codec(s): "'+c[t].join(",")+'"'}),"")+".";this.blacklistCurrentPlaylist({playlist:this.media(),internal:!0,message:f,blacklistDuration:1/0})}else this.blacklistCurrentPlaylist({playlist:this.media(),message:"Could not determine codecs for playlist.",blacklistDuration:1/0})},n.tryToCreateSourceBuffers_=function(){if("open"===this.mediaSource.readyState&&!this.sourceUpdater_.hasCreatedSourceBuffers()&&this.areMediaTypesKnown_()){var e=this.getCodecsOrExclude_();if(e){this.sourceUpdater_.createSourceBuffers(e);var t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t)}}},n.excludeUnsupportedVariants_=function(){var e=this,t=this.master().playlists,n=[];Object.keys(t).forEach((function(r){var o=t[r];if(-1===n.indexOf(o.id)){n.push(o.id);var l=eo(e.master,o),c=[];!l.audio||Object(R.g)(l.audio)||Object(R.c)(l.audio)||c.push("audio codec "+l.audio),!l.video||Object(R.g)(l.video)||Object(R.c)(l.video)||c.push("video codec "+l.video),l.text&&"stpp.ttml.im1t"===l.text&&c.push("text codec "+l.text),c.length&&(o.excludeUntil=1/0,e.logger_("excluding "+o.id+" for unsupported: "+c.join(", ")))}}))},n.excludeIncompatibleVariants_=function(e){var t=this,n=[],r=this.master().playlists,o=Js(Object(R.h)(e)),l=Zs(o),c=o.video&&Object(R.h)(o.video)[0]||null,d=o.audio&&Object(R.h)(o.audio)[0]||null;Object.keys(r).forEach((function(e){var o=r[e];if(-1===n.indexOf(o.id)&&o.excludeUntil!==1/0){n.push(o.id);var h=[],f=eo(t.masterPlaylistLoader_.master,o),m=Zs(f);if(f.audio||f.video){if(m!==l&&h.push('codec count "'+m+'" !== "'+l+'"'),!t.sourceUpdater_.canChangeType()){var v=f.video&&Object(R.h)(f.video)[0]||null,y=f.audio&&Object(R.h)(f.audio)[0]||null;v&&c&&v.type.toLowerCase()!==c.type.toLowerCase()&&h.push('video codec "'+v.type+'" !== "'+c.type+'"'),y&&d&&y.type.toLowerCase()!==d.type.toLowerCase()&&h.push('audio codec "'+y.type+'" !== "'+d.type+'"')}h.length&&(o.excludeUntil=1/0,t.logger_("blacklisting "+o.id+": "+h.join(" && ")))}}}))},n.updateAdCues_=function(e){var t=0,n=this.seekable();n.length&&(t=n.start(0)),function(e,track,t){if(void 0===t&&(t=0),e.segments)for(var n,r=t,i=0;i0&&this.logger_("resetting possible stalled download count for "+e+" loader"),this[e+"StalledDownloads_"]=0,this[e+"Buffered_"]=t.buffered_()},t.checkSegmentDownloads_=function(e){var t=this.masterPlaylistController_,n=t[e+"SegmentLoader_"],r=n.buffered_(),o=function(a,b){if(a===b)return!1;if(!a&&b||!b&&a)return!0;if(a.length!==b.length)return!0;for(var i=0;i=t.end(t.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&e===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):e===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=e)}},t.cancelTimer_=function(){this.consecutiveUpdates=0,this.timer_&&(this.logger_("cancelTimer_"),clearTimeout(this.timer_)),this.timer_=null},t.fixesBadSeeks_=function(){if(!this.tech_.seeking())return!1;var e,t=this.seekable(),n=this.tech_.currentTime();this.afterSeekableWindow_(t,n,this.media(),this.allowSeeksWithinUnsafeLiveWindow)&&(e=t.end(t.length-1));if(this.beforeSeekableWindow_(t,n)){var r=t.start(0);e=r+(r===t.end(0)?0:fa)}if(void 0!==e)return this.logger_("Trying to seek outside of seekable at time "+n+" with seekable range "+ya(t)+". Seeking to "+e+"."),this.tech_.setCurrentTime(e),!0;for(var o=this.masterPlaylistController_.sourceUpdater_,l=this.tech_.buffered(),c=o.audioBuffer?o.audioBuffered():null,d=o.videoBuffer?o.videoBuffered():null,h=this.media(),f=h.partTargetDuration?h.partTargetDuration:2*(h.targetDuration-pa),m=[c,d],i=0;i "+n.end(0)+"]. Attempting to resume playback by seeking to the current time."),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"}),void this.tech_.trigger({type:"usage",name:"hls-unknown-waiting"})):void 0}},t.techWaiting_=function(){var e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking()||null!==this.timer_)return!0;if(this.beforeSeekableWindow_(e,t)){var n=e.end(e.length-1);return this.logger_("Fell out of live window at time "+t+". Seeking to live point (seekable end) "+n),this.cancelTimer_(),this.tech_.setCurrentTime(n),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),this.tech_.trigger({type:"usage",name:"hls-live-resync"}),!0}var r=this.tech_.vhs.masterPlaylistController_.sourceUpdater_,o=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:r.audioBuffered(),videoBuffered:r.videoBuffered(),currentTime:t}))return this.cancelTimer_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),this.tech_.trigger({type:"usage",name:"hls-video-underflow"}),!0;var l=va(o,t);if(l.length>0){var c=l.start(0)-t;return this.logger_("Stopped at "+t+", setting timer for "+c+", seeking to "+l.start(0)),this.cancelTimer_(),this.timer_=setTimeout(this.skipTheGap_.bind(this),1e3*c,t),!0}return!1},t.afterSeekableWindow_=function(e,t,n,r){if(void 0===r&&(r=!1),!e.length)return!1;var o=e.end(e.length-1)+fa;return!n.endList&&r&&(o=e.end(e.length-1)+3*n.targetDuration),t>o},t.beforeSeekableWindow_=function(e,t){return!!(e.length&&e.start(0)>0&&t2)return{start:r,end:o}}return null},e}(),lu={errorInterval:30,getSource:function(e){return e(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource())}},cu=function e(t,n){var r=0,o=0,l=la.mergeOptions(lu,n);t.ready((function(){t.trigger({type:"usage",name:"vhs-error-reload-initialized"}),t.trigger({type:"usage",name:"hls-error-reload-initialized"})}));var c=function(){o&&t.currentTime(o)},d=function(e){null!=e&&(o=t.duration()!==1/0&&t.currentTime()||0,t.one("loadedmetadata",c),t.src(e),t.trigger({type:"usage",name:"vhs-error-reload"}),t.trigger({type:"usage",name:"hls-error-reload"}),t.play())},h=function(){return Date.now()-r<1e3*l.errorInterval?(t.trigger({type:"usage",name:"vhs-error-reload-canceled"}),void t.trigger({type:"usage",name:"hls-error-reload-canceled"})):l.getSource&&"function"==typeof l.getSource?(r=Date.now(),l.getSource.call(t,d)):void la.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")},f=function e(){t.off("loadedmetadata",c),t.off("error",h),t.off("dispose",e)};t.on("error",h),t.on("dispose",f),t.reloadSourceOnError=function(n){f(),e(t,n)}},du="2.14.2",hu={PlaylistLoader:es,Playlist:Fa,utils:ps,STANDARD_PLAYLIST_SELECTOR:oo,INITIAL_PLAYLIST_SELECTOR:function(){var e=this,t=this.playlists.master.playlists.filter(Fa.isEnabled);return ro(t,(function(a,b){return ao(a,b)})),t.filter((function(t){return!!eo(e.playlists.master,t).video}))[0]||null},lastBandwidthSelector:oo,movingAverageBandwidthSelector:function(e){var t=-1,n=-1;if(e<0||e>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){var r=this.useDevicePixelRatio&&l.a.devicePixelRatio||1;return t<0&&(t=this.systemBandwidth,n=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==n&&(t=e*this.systemBandwidth+(1-e)*t,n=this.systemBandwidth),so(this.playlists.master,t,parseInt(no(this.tech_.el(),"width"),10)*r,parseInt(no(this.tech_.el(),"height"),10)*r,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)}},comparePlaylistBandwidth:ao,comparePlaylistResolution:function(e,t){var n,r;return e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(n=e.attributes.RESOLUTION.width),n=n||l.a.Number.MAX_VALUE,t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(r=t.attributes.RESOLUTION.width),n===(r=r||l.a.Number.MAX_VALUE)&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH?e.attributes.BANDWIDTH-t.attributes.BANDWIDTH:n-r},xhr:rs()};Object.keys(Ss).forEach((function(e){Object.defineProperty(hu,e,{get:function(){return la.log.warn("using Vhs."+e+" is UNSAFE be sure you know what you are doing"),Ss[e]},set:function(t){la.log.warn("using Vhs."+e+" is UNSAFE be sure you know what you are doing"),"number"!=typeof t||t<0?la.log.warn("value of Vhs."+e+" must be greater than or equal to 0"):Ss[e]=t}})}));var pu="videojs-vhs",fu=function(e,t){for(var n=t.media(),r=-1,i=0;i=n&&e>=n?Math.max(e,r):r}return e},set:function(e){this.masterPlaylistController_.mainSegmentLoader_.bandwidth=e,this.masterPlaylistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get:function(){var e,t=1/(this.bandwidth||1);return e=this.throughput>0?1/this.throughput:0,Math.floor(1/(t+e))},set:function(){la.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:function(){return n.bandwidth||0},enumerable:!0},mediaRequests:{get:function(){return n.masterPlaylistController_.mediaRequests_()||0},enumerable:!0},mediaRequestsAborted:{get:function(){return n.masterPlaylistController_.mediaRequestsAborted_()||0},enumerable:!0},mediaRequestsTimedout:{get:function(){return n.masterPlaylistController_.mediaRequestsTimedout_()||0},enumerable:!0},mediaRequestsErrored:{get:function(){return n.masterPlaylistController_.mediaRequestsErrored_()||0},enumerable:!0},mediaTransferDuration:{get:function(){return n.masterPlaylistController_.mediaTransferDuration_()||0},enumerable:!0},mediaBytesTransferred:{get:function(){return n.masterPlaylistController_.mediaBytesTransferred_()||0},enumerable:!0},mediaSecondsLoaded:{get:function(){return n.masterPlaylistController_.mediaSecondsLoaded_()||0},enumerable:!0},mediaAppends:{get:function(){return n.masterPlaylistController_.mediaAppends_()||0},enumerable:!0},mainAppendsToLoadedData:{get:function(){return n.masterPlaylistController_.mainAppendsToLoadedData_()||0},enumerable:!0},audioAppendsToLoadedData:{get:function(){return n.masterPlaylistController_.audioAppendsToLoadedData_()||0},enumerable:!0},appendsToLoadedData:{get:function(){return n.masterPlaylistController_.appendsToLoadedData_()||0},enumerable:!0},timeToLoadedData:{get:function(){return n.masterPlaylistController_.timeToLoadedData_()||0},enumerable:!0},buffered:{get:function(){return _a(n.tech_.buffered())},enumerable:!0},currentTime:{get:function(){return n.tech_.currentTime()},enumerable:!0},currentSource:{get:function(){return n.tech_.currentSource_},enumerable:!0},currentTech:{get:function(){return n.tech_.name_},enumerable:!0},duration:{get:function(){return n.tech_.duration()},enumerable:!0},master:{get:function(){return n.playlists.master},enumerable:!0},playerDimensions:{get:function(){return n.tech_.currentDimensions()},enumerable:!0},seekable:{get:function(){return _a(n.tech_.seekable())},enumerable:!0},timestamp:{get:function(){return Date.now()},enumerable:!0},videoPlaybackQuality:{get:function(){return n.tech_.getVideoPlaybackQuality()},enumerable:!0}}),this.tech_.one("canplay",this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_)),this.tech_.on("bandwidthupdate",(function(){n.options_.useBandwidthFromLocalStorage&&function(e){if(!l.a.localStorage)return!1;var t=vu();t=t?la.mergeOptions(t,e):e;try{l.a.localStorage.setItem(pu,JSON.stringify(t))}catch(e){return!1}}({bandwidth:n.bandwidth,throughput:Math.round(n.throughput)})})),this.masterPlaylistController_.on("selectedinitialmedia",(function(){var e;(e=n).representations=function(){var t=e.masterPlaylistController_.master(),n=ja(t)?e.masterPlaylistController_.getAudioTrackPlaylists_():t.playlists;return n?n.filter((function(e){return!Da(e)})).map((function(t,i){return new su(e,t,t.id)})):[]}})),this.masterPlaylistController_.sourceUpdater_.on("createdsourcebuffers",(function(){n.setupEme_()})),this.on(this.masterPlaylistController_,"progress",(function(){this.tech_.trigger("progress")})),this.on(this.masterPlaylistController_,"firstplay",(function(){this.ignoreNextSeekingEvent_=!0})),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=l.a.URL.createObjectURL(this.masterPlaylistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}},n.createKeySessions_=function(){var e=this,t=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),mu({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:t&&t.media(),mainPlaylists:this.playlists.master.playlists}).then((function(){e.logger_("created EME key session"),e.masterPlaylistController_.sourceUpdater_.initializedEme()})).catch((function(t){e.logger_("error while creating EME key session",t),e.player_.error({message:"Failed to initialize media keys for EME",code:3})}))},n.handleWaitingForKey_=function(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()},n.setupEme_=function(){var e=this,t=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader,n=gu({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:t&&t.media()});this.player_.tech_.on("keystatuschange",(function(t){"output-restricted"===t.status&&e.masterPlaylistController_.blacklistCurrentPlaylist({playlist:e.masterPlaylistController_.media(),message:"DRM keystatus changed to "+t.status+". Playlist will fail to play. Check for HDCP content.",blacklistDuration:1/0})})),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),11!==la.browser.IE_VERSION&&n?this.createKeySessions_():this.masterPlaylistController_.sourceUpdater_.initializedEme()},n.setupQualityLevels_=function(){var e=this,t=la.players[this.tech_.options_.playerId];t&&t.qualityLevels&&!this.qualityLevels_&&(this.qualityLevels_=t.qualityLevels(),this.masterPlaylistController_.on("selectedinitialmedia",(function(){var t,n;t=e.qualityLevels_,(n=e).representations().forEach((function(e){t.addQualityLevel(e)})),fu(t,n.playlists)})),this.playlists.on("mediachange",(function(){fu(e.qualityLevels_,e.playlists)})))},t.version=function(){return{"@videojs/http-streaming":du,"mux.js":"6.0.1","mpd-parser":"0.21.1","m3u8-parser":"4.7.1","aes-decrypter":"3.1.3"}},n.version=function(){return this.constructor.version()},n.canChangeType=function(){return jo.canChangeType()},n.play=function(){this.masterPlaylistController_.play()},n.setCurrentTime=function(e){this.masterPlaylistController_.setCurrentTime(e)},n.duration=function(){return this.masterPlaylistController_.duration()},n.seekable=function(){return this.masterPlaylistController_.seekable()},n.dispose=function(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.masterPlaylistController_&&this.masterPlaylistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.player_&&(delete this.player_.vhs,delete this.player_.dash,delete this.player_.hls),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.tech_&&delete this.tech_.hls,this.mediaSourceUrl_&&l.a.URL.revokeObjectURL&&(l.a.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),e.prototype.dispose.call(this)},n.convertToProgramTime=function(time,e){return fs({playlist:this.masterPlaylistController_.media(),time:time,callback:e})},n.seekToProgramTime=function(e,t,n,r){return void 0===n&&(n=!0),void 0===r&&(r=2),ms({programTime:e,playlist:this.masterPlaylistController_.media(),retryCount:r,pauseAfterSeek:n,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})},t}(la.getComponent("Component")),_u={name:"videojs-http-streaming",VERSION:du,canHandleSource:function(e,t){void 0===t&&(t={});var n=la.mergeOptions(la.options,t);return _u.canPlayType(e.type,n)},handleSource:function(source,e,t){void 0===t&&(t={});var n=la.mergeOptions(la.options,t);return e.vhs=new yu(source,e,n),la.hasOwnProperty("hls")||Object.defineProperty(e,"hls",{get:function(){return la.log.warn("player.tech().hls is deprecated. Use player.tech().vhs instead."),e.vhs},configurable:!0}),e.vhs.xhr=rs(),e.vhs.src(source.src,source.type),e.vhs},canPlayType:function(e,t){void 0===t&&(t={});var n=la.mergeOptions(la.options,t),r=n.vhs,o=(r=void 0===r?{}:r).overrideNative,l=void 0===o?!la.browser.IS_ANY_SAFARI:o,c=n.hls,d=(c=void 0===c?{}:c).overrideNative,h=void 0!==d&&d,f=Object(N.a)(e);return f&&(!hu.supportsTypeNatively(f)||h||l)?"maybe":""}};(Object(R.c)("avc1.4d400d,mp4a.40.2")&&la.getTech("Html5").registerSourceHandler(_u,0),la.VhsHandler=yu,Object.defineProperty(la,"HlsHandler",{get:function(){return la.log.warn("videojs.HlsHandler is deprecated. Use videojs.VhsHandler instead."),yu},configurable:!0}),la.VhsSourceHandler=_u,Object.defineProperty(la,"HlsSourceHandler",{get:function(){return la.log.warn("videojs.HlsSourceHandler is deprecated. Use videojs.VhsSourceHandler instead."),_u},configurable:!0}),la.Vhs=hu,Object.defineProperty(la,"Hls",{get:function(){return la.log.warn("videojs.Hls is deprecated. Use videojs.Vhs instead."),hu},configurable:!0}),la.use||(la.registerComponent("Hls",hu),la.registerComponent("Vhs",hu)),la.options.vhs=la.options.vhs||{},la.options.hls=la.options.hls||{},la.getPlugin&&la.getPlugin("reloadSourceOnError"))||(la.registerPlugin||la.plugin)("reloadSourceOnError",(function(e){cu(this,e)}));t.default=la}.call(this,n(74))},1976:function(e,t,n){(function(t){var n;n="undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{},e.exports=n}).call(this,n(74))},2111:function(e,t,n){"use strict";n.d(t,"g",(function(){return o})),n.d(t,"e",(function(){return l})),n.d(t,"k",(function(){return c})),n.d(t,"j",(function(){return d})),n.d(t,"i",(function(){return h})),n.d(t,"b",(function(){return v})),n.d(t,"f",(function(){return y})),n.d(t,"c",(function(){return _})),n.d(t,"h",(function(){return T})),n.d(t,"d",(function(){return S})),n.d(t,"a",(function(){return E}));var a,b,r=n(1976),o=function(b,e,t){return void 0===t&&(t=" "),(function(e,t){for(var n="";t--;)n+=e;return n}(t,e)+b.toString()).slice(-e)},l=function(e){return"function"===ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer},c=function(e){return e instanceof Uint8Array?e:(Array.isArray(e)||l(e)||e instanceof ArrayBuffer||(e="number"!=typeof e||"number"==typeof e&&e!=e?0:[e]),new Uint8Array(e&&e.buffer||e,e&&e.byteOffset||0,e&&e.byteLength||0))},d=function(e){e=c(e);for(var t="",i=0;iy&&(v-=y,v-=y,v-=f(2))}return Number(v)}),y=function(e,t){var n=(void 0===t?{}:t).le,r=void 0!==n&&n;("bigint"!=typeof e&&"number"!=typeof e||"number"==typeof e&&e!=e)&&(e=0),e=f(e);for(var o,l=(o=e,Math.ceil(function(e){return e.toString(2).length}(o)/8)),c=new Uint8Array(new ArrayBuffer(l)),i=0;i=b.length&&l.call(b,(function(e,i){return e===(mask[i]?mask[i]&a[r+i]:a[r+i])}))}},2352:function(e,t,n){(function(t){var r,o=void 0!==t?t:"undefined"!=typeof window?window:{},l=n(1637);"undefined"!=typeof document?r=document:(r=o["__GLOBAL_DOCUMENT_CACHE@4"])||(r=o["__GLOBAL_DOCUMENT_CACHE@4"]=l),e.exports=r}).call(this,n(74))},2353:function(e,t,n){"use strict";function r(object,e){return void 0===e&&(e=Object),e&&"function"==typeof e.freeze?e.freeze(object):object}var o=r({HTML:"text/html",isHTML:function(e){return e===o.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),l=r({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(e){return e===l.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});t.freeze=r,t.MIME_TYPE=o,t.NAMESPACE=l},2414:function(e,t){function n(t,p){return e.exports=n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,p){return e.__proto__=p,e},e.exports.__esModule=!0,e.exports.default=e.exports,n(t,p)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports},2520:function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports},2521:function(e,t,n){var r=n(2414);e.exports=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,r(e,t)},e.exports.__esModule=!0,e.exports.default=e.exports},2522:function(e,t,n){"use strict";var r=n(2795),o=n.n(r),l=n(1976),c=n.n(l),d="http://example.com";t.a=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=c.a.location&&c.a.location.href||"");var n="function"==typeof c.a.URL,r=/^\/\//.test(e),l=!c.a.location&&!/\/\//i.test(e);if(n?e=new c.a.URL(e,c.a.location||d):/\/\//i.test(e)||(e=o.a.buildAbsoluteURL(c.a.location&&c.a.location.href||"",e)),n){var h=new URL(t,e);return l?h.href.slice(d.length):r?h.href.slice(h.protocol.length):h.href}return o.a.buildAbsoluteURL(e,t)}},2523:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return l}));var r=n(1976),o=n.n(r);function l(t){for(var s,n=(s=t,o.a.atob?o.a.atob(s):e.from(s,"base64").toString("binary")),r=new Uint8Array(n.length),i=0;i=0))throw M(L,new Error(e.tagName+"@"+n));for(var r=t.length-1;i"==e&&">")||"&"==e&&"&"||'"'==e&&"""||"&#"+e.charCodeAt()+";"}function G(e,t){if(t(e))return!0;if(e=e.firstChild)do{if(G(e,t))return!0}while(e=e.nextSibling)}function X(){}function K(e,t,n,o){e&&e._inc++,n.namespaceURI===r.XMLNS&&delete t._nsMap[n.prefix?n.localName:""]}function Y(e,t,n){if(e&&e._inc){e._inc++;var r=t.childNodes;if(n)r[r.length++]=n;else{for(var o=t.firstChild,i=0;o;)r[i++]=o,o=o.nextSibling;r.length=i}}}function Q(e,t){var n=t.previousSibling,r=t.nextSibling;return n?n.nextSibling=r:e.firstChild=r,r?r.previousSibling=n:e.lastChild=n,Y(e.ownerDocument,e),t}function $(e,t,n){var r=t.parentNode;if(r&&r.removeChild(t),t.nodeType===I){var o=t.firstChild;if(null==o)return t;var l=t.lastChild}else o=l=t;var pre=n?n.previousSibling:e.lastChild;o.previousSibling=pre,l.nextSibling=n,pre?pre.nextSibling=o:e.firstChild=o,null==n?e.lastChild=l:n.previousSibling=l;do{o.parentNode=e}while(o!==l&&(o=o.nextSibling));return Y(e.ownerDocument||e,e),t.nodeType==I&&(t.firstChild=t.lastChild=null),t}function J(){this._nsMap={}}function Z(){}function ee(){}function te(){}function ie(){}function ne(){}function re(){}function ae(){}function se(){}function oe(){}function ue(){}function le(){}function ce(){}function de(e,t){var n=[],r=9==this.nodeType&&this.documentElement||this,o=r.prefix,l=r.namespaceURI;if(l&&null==o&&null==(o=r.lookupPrefix(l)))var c=[{namespace:l,prefix:null}];return fe(this,n,e,t,c),n.join("")}function he(e,t,n){var o=e.prefix||"",l=e.namespaceURI;if(!l)return!1;if("xml"===o&&l===r.XML||l===r.XMLNS)return!1;for(var i=n.length;i--;){var c=n[i];if(c.prefix===o)return c.namespace!==l}return!0}function pe(e,t,n){e.push(" ",t,'="',n.replace(/[<&"]/g,z),'"')}function fe(e,t,n,o,l){if(l||(l=[]),o){if(!(e=o(e)))return;if("string"==typeof e)return void t.push(e)}switch(e.nodeType){case m:var c=e.attributes,d=c.length,h=e.firstChild,f=e.tagName,S=f;if(!(n=r.isHTML(e.namespaceURI)||n)&&!e.prefix&&e.namespaceURI){for(var x,A=0;A=0;P--){if(""===(O=l[P]).prefix&&O.namespace===e.namespaceURI){x=O.namespace;break}}if(x!==e.namespaceURI)for(P=l.length-1;P>=0;P--){var O;if((O=l[P]).namespace===e.namespaceURI){O.prefix&&(S=O.prefix+":"+f);break}}}t.push("<",S);for(var i=0;i"),n&&/^script$/i.test(f))for(;h;)h.data?t.push(h.data):fe(h,t,n,o,l.slice()),h=h.nextSibling;else for(;h;)fe(h,t,n,o,l.slice()),h=h.nextSibling;t.push("")}else t.push("/>");return;case C:case I:for(h=e.firstChild;h;)fe(h,t,n,o,l.slice()),h=h.nextSibling;return;case v:return pe(t,e.name,e.value);case y:return t.push(e.data.replace(/[<&]/g,z).replace(/]]>/g,"]]>"));case _:return t.push("");case k:return t.push("\x3c!--",e.data,"--\x3e");case w:var R=e.publicId,N=e.systemId;if(t.push("");else if(N&&"."!=N)t.push(" SYSTEM ",N,">");else{var sub=e.internalSubset;sub&&t.push(" [",sub,"]"),t.push(">")}return;case E:return t.push("");case T:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function me(e,t,n){var r;switch(t.nodeType){case m:(r=t.cloneNode(!1)).ownerDocument=e;case I:break;case v:n=!0}if(r||(r=t.cloneNode(!1)),r.ownerDocument=e,r.parentNode=null,n)for(var o=t.firstChild;o;)r.appendChild(me(e,o,n)),o=o.nextSibling;return r}function ge(e,t,n){var r=new t.constructor;for(var o in t){var l=t[o];"object"!=typeof l&&l!=r[o]&&(r[o]=l)}switch(t.childNodes&&(r.childNodes=new R),r.ownerDocument=e,r.nodeType){case m:var c=t.attributes,d=r.attributes=new B,h=c.length;d._ownerElement=r;for(var i=0;i0},lookupPrefix:function(e){for(var t=this;t;){var map=t._nsMap;if(map)for(var n in map)if(map[n]==e)return n;t=t.nodeType==v?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var map=t._nsMap;if(map&&e in map)return map[e];t=t.nodeType==v?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return null==this.lookupPrefix(e)}},d(f,W),d(f,W.prototype),X.prototype={nodeName:"#document",nodeType:C,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==I){for(var n=e.firstChild;n;){var r=n.nextSibling;this.insertBefore(n,t),n=r}return e}return null==this.documentElement&&e.nodeType==m&&(this.documentElement=e),$(this,e,t),e.ownerDocument=this,e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),Q(this,e)},importNode:function(e,t){return me(this,e,t)},getElementById:function(e){var t=null;return G(this.documentElement,(function(n){if(n.nodeType==m&&n.getAttribute("id")==e)return t=n,!0})),t},getElementsByClassName:function(e){var t=c(e);return new N(this,(function(base){var n=[];return t.length>0&&G(base.documentElement,(function(r){if(r!==base&&r.nodeType===m){var o=r.getAttribute("class");if(o){var l=e===o;if(!l){var d=c(o);l=t.every((h=d,function(element){return h&&-1!==h.indexOf(element)}))}l&&n.push(r)}}var h})),n}))},createElement:function(e){var t=new J;return t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.localName=e,t.childNodes=new R,(t.attributes=new B)._ownerElement=t,t},createDocumentFragment:function(){var e=new ue;return e.ownerDocument=this,e.childNodes=new R,e},createTextNode:function(data){var e=new te;return e.ownerDocument=this,e.appendData(data),e},createComment:function(data){var e=new ie;return e.ownerDocument=this,e.appendData(data),e},createCDATASection:function(data){var e=new ne;return e.ownerDocument=this,e.appendData(data),e},createProcessingInstruction:function(e,data){var t=new le;return t.ownerDocument=this,t.tagName=t.target=e,t.nodeValue=t.data=data,t},createAttribute:function(e){var t=new Z;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new oe;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var n=new J,r=t.split(":"),o=n.attributes=new B;return n.childNodes=new R,n.ownerDocument=this,n.nodeName=t,n.tagName=t,n.namespaceURI=e,2==r.length?(n.prefix=r[0],n.localName=r[1]):n.localName=t,o._ownerElement=n,n},createAttributeNS:function(e,t){var n=new Z,r=t.split(":");return n.ownerDocument=this,n.nodeName=t,n.name=t,n.namespaceURI=e,n.specified=!0,2==r.length?(n.prefix=r[0],n.localName=r[1]):n.localName=t,n}},h(X,W),J.prototype={nodeType:m,hasAttribute:function(e){return null!=this.getAttributeNode(e)},getAttribute:function(e){var t=this.getAttributeNode(e);return t&&t.value||""},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){var n=this.ownerDocument.createAttribute(e);n.value=n.nodeValue=""+t,this.setAttributeNode(n)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){return e.nodeType===I?this.insertBefore(e,null):function(e,t){var n=t.parentNode;if(n){var pre=e.lastChild;n.removeChild(t),pre=e.lastChild}return pre=e.lastChild,t.parentNode=e,t.previousSibling=pre,t.nextSibling=null,pre?pre.nextSibling=t:e.firstChild=t,e.lastChild=t,Y(e.ownerDocument,e,t),t}(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);n&&this.removeAttributeNode(n)},hasAttributeNS:function(e,t){return null!=this.getAttributeNodeNS(e,t)},getAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);return n&&n.value||""},setAttributeNS:function(e,t,n){var r=this.ownerDocument.createAttributeNS(e,t);r.value=r.nodeValue=""+n,this.setAttributeNode(r)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new N(this,(function(base){var t=[];return G(base,(function(n){n===base||n.nodeType!=m||"*"!==e&&n.tagName!=e||t.push(n)})),t}))},getElementsByTagNameNS:function(e,t){return new N(this,(function(base){var n=[];return G(base,(function(r){r===base||r.nodeType!==m||"*"!==e&&r.namespaceURI!==e||"*"!==t&&r.localName!=t||n.push(r)})),n}))}},X.prototype.getElementsByTagName=J.prototype.getElementsByTagName,X.prototype.getElementsByTagNameNS=J.prototype.getElementsByTagNameNS,h(J,W),Z.prototype.nodeType=v,h(Z,W),ee.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(text){text=this.data+text,this.nodeValue=this.data=text,this.length=text.length},insertData:function(e,text){this.replaceData(e,0,text)},appendChild:function(e){throw new Error(P[O])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,text){text=this.data.substring(0,e)+text+this.data.substring(e+t),this.nodeValue=this.data=text,this.length=text.length}},h(ee,W),te.prototype={nodeName:"#text",nodeType:y,splitText:function(e){var text=this.data,t=text.substring(e);text=text.substring(0,e),this.data=this.nodeValue=text,this.length=text.length;var n=this.ownerDocument.createTextNode(t);return this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling),n}},h(te,ee),ie.prototype={nodeName:"#comment",nodeType:k},h(ie,ee),ne.prototype={nodeName:"#cdata-section",nodeType:_},h(ne,ee),re.prototype.nodeType=w,h(re,W),ae.prototype.nodeType=x,h(ae,W),se.prototype.nodeType=S,h(se,W),oe.prototype.nodeType=T,h(oe,W),ue.prototype.nodeName="#document-fragment",ue.prototype.nodeType=I,h(ue,W),le.prototype.nodeType=E,h(le,W),ce.prototype.serializeToString=function(e,t,n){return de.call(e,t,n)},W.prototype.toString=de;try{if(Object.defineProperty){function ye(e){switch(e.nodeType){case m:case I:var t=[];for(e=e.firstChild;e;)7!==e.nodeType&&8!==e.nodeType&&t.push(ye(e)),e=e.nextSibling;return t.join("");default:return e.nodeValue}}Object.defineProperty(N.prototype,"length",{get:function(){return U(this),this.$$length}}),Object.defineProperty(W.prototype,"textContent",{get:function(){return ye(this)},set:function(data){switch(this.nodeType){case m:case I:for(;this.firstChild;)this.removeChild(this.firstChild);(data||String(data))&&this.appendChild(this.ownerDocument.createTextNode(data));break;default:this.data=data,this.value=data,this.nodeValue=data}}}),ve=function(object,e,t){object["$$"+e]=t}}}catch(e){}t.DocumentType=re,t.DOMException=M,t.DOMImplementation=V,t.Element=J,t.Node=W,t.NodeList=R,t.XMLSerializer=ce},2525:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(2111),o=Object(r.k)([73,68,51]),l=function e(t,n){return void 0===n&&(n=0),(t=Object(r.k)(t)).length-n<10||!Object(r.a)(t,o,{offset:n})?n:(n+=function(e,t){void 0===t&&(t=0);var n=(e=Object(r.k)(e))[t+5],o=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9];return(16&n)>>4?o+20:o+10}(t,n),e(t,n))}},2783:function(e,t){function n(e){if(e&&"object"==typeof e){var t=e.which||e.keyCode||e.charCode;t&&(e=t)}if("number"==typeof e)return l[e];var n,c=String(e);return(n=r[c.toLowerCase()])?n:(n=o[c.toLowerCase()])||(1===c.length?c.charCodeAt(0):void 0)}n.isEventKey=function(e,t){if(e&&"object"==typeof e){var n=e.which||e.keyCode||e.charCode;if(null==n)return!1;if("string"==typeof t){var l;if(l=r[t.toLowerCase()])return l===n;if(l=o[t.toLowerCase()])return l===n}else if("number"==typeof t)return t===n;return!1}};var r=(t=e.exports=n).code=t.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19,"caps lock":20,esc:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,command:91,"left command":91,"right command":93,"numpad *":106,"numpad +":107,"numpad -":109,"numpad .":110,"numpad /":111,"num lock":144,"scroll lock":145,"my computer":182,"my calculator":183,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},o=t.aliases={windows:91,"⇧":16,"⌥":18,"⌃":17,"⌘":91,ctl:17,control:17,option:18,pause:19,break:19,caps:20,return:13,escape:27,spc:32,spacebar:32,pgup:33,pgdn:34,ins:45,del:46,cmd:91};for(i=97;i<123;i++)r[String.fromCharCode(i)]=i-32;for(var i=48;i<58;i++)r[i-48]=i;for(i=1;i<13;i++)r["f"+i]=i+111;for(i=0;i<10;i++)r["numpad "+i]=i+96;var l=t.names=t.title={};for(i in r)l[r[i]]=i;for(var c in o)r[c]=o[c]},2784:function(e,t){e.exports=function(e,t){var n,r=null;try{n=JSON.parse(e,t)}catch(e){r=e}return[r,n]}},2785:function(e,t,n){"use strict";var r=n(1976),o=n(852),l=n(2786);d.httpHandler=n(2787);function c(e,t,n){var r=e;return l(t)?(n=t,"string"==typeof e&&(r={uri:e})):r=o({},t,{uri:e}),r.callback=n,r}function d(e,t,n){return h(t=c(e,t,n))}function h(e){if(void 0===e.callback)throw new Error("callback argument missing");var t=!1,n=function(n,r,body){t||(t=!0,e.callback(n,r,body))};function r(){var body=void 0;if(body=f.response?f.response:f.responseText||function(e){try{if("document"===e.responseType)return e.responseXML;var t=e.responseXML&&"parsererror"===e.responseXML.documentElement.nodeName;if(""===e.responseType&&!t)return e.responseXML}catch(e){}return null}(f),S)try{body=JSON.parse(body)}catch(e){}return body}function o(e){return clearTimeout(m),e instanceof Error||(e=new Error(""+(e||"Unknown XMLHttpRequest Error"))),e.statusCode=0,n(e,E)}function l(){if(!h){var t;clearTimeout(m),t=e.useXDR&&void 0===f.status?200:1223===f.status?204:f.status;var o=E,l=null;return 0!==t?(o={body:r(),statusCode:t,method:y,headers:{},url:v,rawRequest:f},f.getAllResponseHeaders&&(o.headers=function(e){var t={};return e?(e.trim().split("\n").forEach((function(e){var n=e.indexOf(":"),r=e.slice(0,n).trim().toLowerCase(),o=e.slice(n+1).trim();void 0===t[r]?t[r]=o:Array.isArray(t[r])?t[r].push(o):t[r]=[t[r],o]})),t):t}(f.getAllResponseHeaders()))):l=new Error("Internal XMLHttpRequest Error"),n(l,o,o.body)}}var c,h,f=e.xhr||null;f||(f=e.cors||e.useXDR?new d.XDomainRequest:new d.XMLHttpRequest);var m,v=f.url=e.uri||e.url,y=f.method=e.method||"GET",body=e.body||e.data,_=f.headers=e.headers||{},T=!!e.sync,S=!1,E={body:void 0,headers:{},statusCode:0,method:y,url:v,rawRequest:f};if("json"in e&&!1!==e.json&&(S=!0,_.accept||_.Accept||(_.Accept="application/json"),"GET"!==y&&"HEAD"!==y&&(_["content-type"]||_["Content-Type"]||(_["Content-Type"]="application/json"),body=JSON.stringify(!0===e.json?body:e.json))),f.onreadystatechange=function(){4===f.readyState&&setTimeout(l,0)},f.onload=l,f.onerror=o,f.onprogress=function(){},f.onabort=function(){h=!0},f.ontimeout=o,f.open(y,v,!T,e.username,e.password),T||(f.withCredentials=!!e.withCredentials),!T&&e.timeout>0&&(m=setTimeout((function(){if(!h){h=!0,f.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",o(e)}}),e.timeout)),f.setRequestHeader)for(c in _)_.hasOwnProperty(c)&&f.setRequestHeader(c,_[c]);else if(e.headers&&!function(e){for(var i in e)if(e.hasOwnProperty(i))return!1;return!0}(e.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(f.responseType=e.responseType),"beforeSend"in e&&"function"==typeof e.beforeSend&&e.beforeSend(f),f.send(body||null),f}e.exports=d,e.exports.default=d,d.XMLHttpRequest=r.XMLHttpRequest||function(){},d.XDomainRequest="withCredentials"in new d.XMLHttpRequest?d.XMLHttpRequest:r.XDomainRequest,function(e,t){for(var i=0;i=400&&o.statusCode<=599){var c=l;if(t)if(r.TextDecoder){var d=function(e){void 0===e&&(e="");return e.toLowerCase().split(";").reduce((function(e,t){var n=t.split("="),r=n[0],o=n[1];return"charset"===r.trim()?o.trim():e}),"utf-8")}(o.headers&&o.headers["content-type"]);try{c=new TextDecoder(d).decode(l)}catch(e){}}else c=String.fromCharCode.apply(null,new Uint8Array(l));e({cause:c})}else e(null,l)}}},2788:function(e,t,n){var r=n(1976),o=e.exports={WebVTT:n(2789),VTTCue:n(2790),VTTRegion:n(2791)};r.vttjs=o,r.WebVTT=o.WebVTT;var l=o.VTTCue,c=o.VTTRegion,d=r.VTTCue,h=r.VTTRegion;o.shim=function(){r.VTTCue=l,r.VTTRegion=c},o.restore=function(){r.VTTCue=d,r.VTTRegion=h},r.VTTCue||o.shim()},2789:function(e,t,n){var r=n(2352),o=Object.create||function(){function e(){}return function(t){if(1!==arguments.length)throw new Error("Object.create shim only accepts one parameter.");return e.prototype=t,new e}}();function l(e,t){this.name="ParsingError",this.code=e.code,this.message=t||e.message}function c(input){function e(e,t,s,n){return 3600*(0|e)+60*(0|t)+(0|s)+(0|n)/1e3}var t=input.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return t?t[3]?e(t[1],t[2],t[3].replace(":",""),t[4]):t[1]>59?e(t[1],t[2],0,t[4]):e(0,t[1],t[2],t[4]):null}function d(){this.values=o(null)}function h(input,e,t,n){var r=n?input.split(n):[input];for(var i in r)if("string"==typeof r[i]){var o=r[i].split(t);if(2===o.length)e(o[0],o[1])}}function f(input,e,t){var n=input;function r(){var e=c(input);if(null===e)throw new l(l.Errors.BadTimeStamp,"Malformed timestamp: "+n);return input=input.replace(/^[^\sa-zA-Z-]+/,""),e}function o(){input=input.replace(/^\s+/,"")}if(o(),e.startTime=r(),o(),"--\x3e"!==input.substr(0,3))throw new l(l.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+n);input=input.substr(3),o(),e.endTime=r(),o(),function(input,e){var n=new d;h(input,(function(e,r){switch(e){case"region":for(var i=t.length-1;i>=0;i--)if(t[i].id===r){n.set(e,t[i].region);break}break;case"vertical":n.alt(e,r,["rl","lr"]);break;case"line":var o=r.split(","),l=o[0];n.integer(e,l),n.percent(e,l)&&n.set("snapToLines",!1),n.alt(e,l,["auto"]),2===o.length&&n.alt("lineAlign",o[1],["start","center","end"]);break;case"position":o=r.split(","),n.percent(e,o[0]),2===o.length&&n.alt("positionAlign",o[1],["start","center","end"]);break;case"size":n.percent(e,r);break;case"align":n.alt(e,r,["start","center","end","left","right"])}}),/:/,/\s/),e.region=n.get("region",null),e.vertical=n.get("vertical","");try{e.line=n.get("line","auto")}catch(e){}e.lineAlign=n.get("lineAlign","start"),e.snapToLines=n.get("snapToLines",!0),e.size=n.get("size",100);try{e.align=n.get("align","center")}catch(t){e.align=n.get("align","middle")}try{e.position=n.get("position","auto")}catch(t){e.position=n.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},e.align)}e.positionAlign=n.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},e.align)}(input,e)}l.prototype=o(Error.prototype),l.prototype.constructor=l,l.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},d.prototype={set:function(e,t){this.get(e)||""===t||(this.values[e]=t)},get:function(e,t,n){return n?this.has(e)?this.values[e]:t[n]:this.has(e)?this.values[e]:t},has:function(e){return e in this.values},alt:function(e,t,a){for(var n=0;n=0&&t<=100)&&(this.set(e,t),!0)}};var m=r.createElement&&r.createElement("textarea"),v={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},y={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"},_={v:"title",lang:"lang"},T={rt:"ruby"};function S(e,input){function t(){if(!input)return null;var e,t=input.match(/^([^<]*)(<[^>]*>?)?/);return e=t[1]?t[1]:t[2],input=input.substr(e.length),e}function n(e,element){return!T[element.localName]||T[element.localName]===e.localName}function r(t,n){var r=v[t];if(!r)return null;var element=e.document.createElement(r),o=_[t];return o&&n&&(element[o]=n.trim()),element}for(var o,s,l=e.document.createElement("div"),d=l,h=[];null!==(o=t());)if("<"!==o[0])d.appendChild(e.document.createTextNode((s=o,m.innerHTML=s,s=m.textContent,m.textContent="",s)));else{if("/"===o[1]){h.length&&h[h.length-1]===o.substr(2).replace(">","")&&(h.pop(),d=d.parentNode);continue}var f,S=c(o.substr(1,o.length-2));if(S){f=e.document.createProcessingInstruction("timestamp",S),d.appendChild(f);continue}var E=o.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!E)continue;if(!(f=r(E[1],E[3])))continue;if(!n(d,f))continue;if(E[2]){var k=E[2].split(".");k.forEach((function(e){var t=/^bg_/.test(e),n=t?e.slice(3):e;if(y.hasOwnProperty(n)){var r=t?"background-color":"color",o=y[n];f.style[r]=o}})),f.className=k.join(" ")}h.push(E[1]),d.appendChild(f),d=f}return l}var E=[[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 k(e){for(var i=0;i=t[0]&&e<=t[1])return!0}return!1}function C(e){var t=[],text="";if(!e||!e.childNodes)return"ltr";function n(e,t){for(var i=t.childNodes.length-1;i>=0;i--)e.push(t.childNodes[i])}function r(e){if(!e||!e.length)return null;var t=e.pop(),text=t.textContent||t.innerText;if(text){var o=text.match(/^.*(\n|\r)/);return o?(e.length=0,o[0]):text}return"ruby"===t.tagName?r(e):t.childNodes?(n(e,t),r(e)):void 0}for(n(t,e);text=r(t);)for(var i=0;i=0&&e.line<=100))return e.line;if(!e.track||!e.track.textTrackList||!e.track.textTrackList.mediaElement)return-1;for(var track=e.track,t=track.textTrackList,n=0,i=0;iv&&(m=m<0?-1:1,m*=Math.ceil(v/f)*f),c<0&&(m+=""===l.vertical?n.height:n.width,d=d.reverse()),o.move(y,m)}else{var _=o.lineHeight/n.height*100;switch(l.lineAlign){case"center":c-=_/2;break;case"end":c-=_}switch(l.vertical){case"":t.applyStyles({top:t.formatStyle(c,"%")});break;case"rl":t.applyStyles({left:t.formatStyle(c,"%")});break;case"lr":t.applyStyles({right:t.formatStyle(c,"%")})}d=["+y","-x","+x","-y"],o=new x(t)}var T=function(b,e){for(var t,o=new x(b),l=1,i=0;ip&&(t=new x(b),l=p),b=new x(o)}return t||o}(o,d);t.move(T.toCSSCompatValues(n))}function P(){}w.prototype.applyStyles=function(e,div){for(var t in div=div||this.div,e)e.hasOwnProperty(t)&&(div.style[t]=e[t])},w.prototype.formatStyle=function(e,t){return 0===e?0:e+t},I.prototype=o(w.prototype),I.prototype.constructor=I,x.prototype.move=function(e,t){switch(t=void 0!==t?t:this.lineHeight,e){case"+x":this.left+=t,this.right+=t;break;case"-x":this.left-=t,this.right-=t;break;case"+y":this.top+=t,this.bottom+=t;break;case"-y":this.top-=t,this.bottom-=t}},x.prototype.overlaps=function(e){return this.lefte.left&&this.tope.top},x.prototype.overlapsAny=function(e){for(var i=0;i=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right},x.prototype.overlapsOppositeAxis=function(e,t){switch(t){case"+x":return this.lefte.right;case"+y":return this.tope.bottom}},x.prototype.intersectPercentage=function(e){return Math.max(0,Math.min(this.right,e.right)-Math.max(this.left,e.left))*Math.max(0,Math.min(this.bottom,e.bottom)-Math.max(this.top,e.top))/(this.height*this.width)},x.prototype.toCSSCompatValues=function(e){return{top:this.top-e.top,bottom:e.bottom-this.bottom,left:this.left-e.left,right:e.right-this.right,height:this.height,width:this.width}},x.getSimpleBoxPosition=function(e){var t=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0,n=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0,r=e.div?e.div.offsetTop:e.tagName?e.offsetTop:0;return{left:(e=e.div?e.div.getBoundingClientRect():e.tagName?e.getBoundingClientRect():e).left,right:e.right,top:e.top||r,height:e.height||t,bottom:e.bottom||r+(e.height||t),width:e.width||n}},P.StringDecoder=function(){return{decode:function(data){if(!data)return"";if("string"!=typeof data)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(data))}}},P.convertCueToDOMTree=function(e,t){return e&&t?S(e,t):null};P.processCues=function(e,t,n){if(!e||!t||!n)return null;for(;n.firstChild;)n.removeChild(n.firstChild);var r=e.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(e){for(var i=0;i100)throw new Error("Position must be between 0 and 100.");T=e,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return S},set:function(e){var t=o(e);t?(S=t,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return E},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");E=e,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return k},set:function(e){var t=o(e);if(!t)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");k=t,this.hasBeenReset=!0}}}),this.displayState=void 0}l.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},e.exports=l},2791:function(e,t){var n={"":!0,up:!0};function r(e){return"number"==typeof e&&e>=0&&e<=100}e.exports=function(){var e=100,t=3,o=0,l=100,c=0,d=100,h="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return e},set:function(t){if(!r(t))throw new Error("Width must be between 0 and 100.");e=t}},lines:{enumerable:!0,get:function(){return t},set:function(e){if("number"!=typeof e)throw new TypeError("Lines must be set to a number.");t=e}},regionAnchorY:{enumerable:!0,get:function(){return l},set:function(e){if(!r(e))throw new Error("RegionAnchorX must be between 0 and 100.");l=e}},regionAnchorX:{enumerable:!0,get:function(){return o},set:function(e){if(!r(e))throw new Error("RegionAnchorY must be between 0 and 100.");o=e}},viewportAnchorY:{enumerable:!0,get:function(){return d},set:function(e){if(!r(e))throw new Error("ViewportAnchorY must be between 0 and 100.");d=e}},viewportAnchorX:{enumerable:!0,get:function(){return c},set:function(e){if(!r(e))throw new Error("ViewportAnchorX must be between 0 and 100.");c=e}},scroll:{enumerable:!0,get:function(){return h},set:function(e){var t=function(e){return"string"==typeof e&&!!n[e.toLowerCase()]&&e.toLowerCase()}(e);!1===t?console.warn("Scroll: an invalid or illegal string was specified."):h=t}}})}},2792:function(e,t,n){var r=n(2414),o=n(2793);function l(t,n,c){return o()?(e.exports=l=Reflect.construct.bind(),e.exports.__esModule=!0,e.exports.default=e.exports):(e.exports=l=function(e,t,n){var a=[null];a.push.apply(a,t);var o=new(Function.bind.apply(e,a));return n&&r(o,n.prototype),o},e.exports.__esModule=!0,e.exports.default=e.exports),l.apply(null,arguments)}e.exports=l,e.exports.__esModule=!0,e.exports.default=e.exports},2793:function(e,t){e.exports=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}},e.exports.__esModule=!0,e.exports.default=e.exports},2794:function(e,t,n){var r=n(2414);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&r(e,t)},e.exports.__esModule=!0,e.exports.default=e.exports},2795:function(e,t,n){var r,o,l,c,d;r=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,o=/^(?=([^\/?#]*))\1([^]*)$/,l=/(?:\/|^)\.(?=\/)/g,c=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,d={buildAbsoluteURL:function(e,t,n){if(n=n||{},e=e.trim(),!(t=t.trim())){if(!n.alwaysNormalize)return e;var r=d.parseURL(e);if(!r)throw new Error("Error trying to parse base URL.");return r.path=d.normalizePath(r.path),d.buildURLFromParts(r)}var l=d.parseURL(t);if(!l)throw new Error("Error trying to parse relative URL.");if(l.scheme)return n.alwaysNormalize?(l.path=d.normalizePath(l.path),d.buildURLFromParts(l)):t;var c=d.parseURL(e);if(!c)throw new Error("Error trying to parse base URL.");if(!c.netLoc&&c.path&&"/"!==c.path[0]){var h=o.exec(c.path);c.netLoc=h[1],c.path=h[2]}c.netLoc&&!c.path&&(c.path="/");var f={scheme:c.scheme,netLoc:l.netLoc,path:null,params:l.params,query:l.query,fragment:l.fragment};if(!l.netLoc&&(f.netLoc=c.netLoc,"/"!==l.path[0]))if(l.path){var m=c.path,v=m.substring(0,m.lastIndexOf("/")+1)+l.path;f.path=d.normalizePath(v)}else f.path=c.path,l.params||(f.params=c.params,l.query||(f.query=c.query));return null===f.path&&(f.path=n.alwaysNormalize?d.normalizePath(l.path):l.path),d.buildURLFromParts(f)},parseURL:function(e){var t=r.exec(e);return t?{scheme:t[1]||"",netLoc:t[2]||"",path:t[3]||"",params:t[4]||"",query:t[5]||"",fragment:t[6]||""}:null},normalizePath:function(path){for(path=path.split("").reverse().join("").replace(l,"");path.length!==(path=path.replace(c,"")).length;);return path.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}},e.exports=d},2796:function(e,t,n){"use strict";n.d(t,"i",(function(){return h})),n.d(t,"h",(function(){return f})),n.d(t,"d",(function(){return m})),n.d(t,"f",(function(){return v})),n.d(t,"e",(function(){return y})),n.d(t,"c",(function(){return _})),n.d(t,"g",(function(){return T})),n.d(t,"a",(function(){return S})),n.d(t,"b",(function(){return E}));var r=n(1976),o=n.n(r),l={mp4:/^(av0?1|avc0?[1234]|vp0?9|flac|opus|mp3|mp4a|mp4v|stpp.ttml.im1t)/,webm:/^(vp0?[89]|av0?1|opus|vorbis)/,ogg:/^(vp0?[89]|theora|flac|opus|vorbis)/,video:/^(av0?1|avc0?[1234]|vp0?[89]|hvc1|hev1|theora|mp4v)/,audio:/^(mp4a|flac|vorbis|opus|ac-[34]|ec-3|alac|mp3|speex|aac)/,text:/^(stpp.ttml.im1t)/,muxerVideo:/^(avc0?1)/,muxerAudio:/^(mp4a)/,muxerText:/a^/},c=["video","audio","text"],d=["Video","Audio","Text"],h=function(e){return e?e.replace(/avc1\.(\d+)\.(\d+)/i,(function(e,t,n){return"avc1."+("00"+Number(t).toString(16)).slice(-2)+"00"+("00"+Number(n).toString(16)).slice(-2)})):e},f=function(e){void 0===e&&(e="");var t=e.split(","),n=[];return t.forEach((function(e){var t;e=e.trim(),c.forEach((function(r){var o=l[r].exec(e.toLowerCase());if(o&&!(o.length<=1)){t=r;var c=e.substring(0,o[1].length),details=e.replace(c,"");n.push({type:c,details:details,mediaType:r})}})),t||n.push({type:e,details:"",mediaType:"unknown"})})),n},m=function(e,t){if(!e.mediaGroups.AUDIO||!t)return null;var n=e.mediaGroups.AUDIO[t];if(!n)return null;for(var r in n){var o=n[r];if(o.default&&o.playlists)return f(o.playlists[0].attributes.CODECS)}return null},v=function(e){return void 0===e&&(e=""),l.audio.test(e.trim().toLowerCase())},y=function(e){if(e&&"string"==typeof e){var t,n=e.toLowerCase().split(",").map((function(e){return h(e.trim())})),r="video";1===n.length&&v(n[0])?r="audio":1===n.length&&(void 0===(t=n[0])&&(t=""),l.text.test(t.trim().toLowerCase()))&&(r="application");var o="mp4";return n.every((function(e){return l.mp4.test(e)}))?o="mp4":n.every((function(e){return l.webm.test(e)}))?o="webm":n.every((function(e){return l.ogg.test(e)}))&&(o="ogg"),r+"/"+o+';codecs="'+e+'"'}},_=function(e){return void 0===e&&(e=""),o.a.MediaSource&&o.a.MediaSource.isTypeSupported&&o.a.MediaSource.isTypeSupported(y(e))||!1},T=function(e){return void 0===e&&(e=""),e.toLowerCase().split(",").every((function(e){e=e.trim();for(var i=0;i=t+n||t?new java.lang.String(e,t,n)+"":e}function E(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}v.prototype.parseFromString=function(source,e){var t=this.options,n=new m,r=t.domBuilder||new y,o=t.errorHandler,c=t.locator,d=t.xmlns||{},f=/\/x?html?$/.test(e),v=f?l.HTML_ENTITIES:l.XML_ENTITIES;return c&&r.setDocumentLocator(c),n.errorHandler=function(e,t,n){if(!e){if(t instanceof y)return t;e=t}var r={},o=e instanceof Function;function l(t){var l=e[t];!l&&o&&(l=2==e.length?function(n){e(t,n)}:e),r[t]=l&&function(e){l("[xmldom "+t+"]\t"+e+T(n))}||function(){}}return n=n||{},l("warning"),l("error"),l("fatalError"),r}(o,r,c),n.domBuilder=t.domBuilder||r,f&&(d[""]=h.HTML),d.xml=d.xml||h.XML,source&&"string"==typeof source?n.parse(source,d,v):n.errorHandler.error("invalid doc source"),r.doc},y.prototype={startDocument:function(){this.doc=(new d).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,n,r){var o=this.doc,l=o.createElementNS(e,n||t),c=r.length;E(this,l),this.currentElement=l,this.locator&&_(this.locator,l);for(var i=0;i",lt:"<",quot:'"'}),t.HTML_ENTITIES=r({lt:"<",gt:">",amp:"&",quot:'"',apos:"'",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",times:"×",divide:"÷",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",euro:"€",trade:"™",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"}),t.entityMap=t.HTML_ENTITIES},2801:function(e,t,n){var r=n(2353).NAMESPACE,o=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,l=new RegExp("[\\-\\.0-9"+o.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),c=new RegExp("^"+o.source+l.source+"*(?::"+o.source+l.source+"*)?$");function d(e,t){this.message=e,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,d)}function h(){}function f(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function m(source,e,t,n,o,l){function c(e,n,r){t.attributeNames.hasOwnProperty(e)&&l.fatalError("Attribute "+e+" redefined"),t.addValue(e,n,r)}for(var d,p=++e,s=0;;){var h=source.charAt(p);switch(h){case"=":if(1===s)d=source.slice(e,p),s=3;else{if(2!==s)throw new Error("attribute equal must after attrName");s=3}break;case"'":case'"':if(3===s||1===s){if(1===s&&(l.warning('attribute value must after "="'),d=source.slice(e,p)),e=p+1,!((p=source.indexOf(h,e))>0))throw new Error("attribute value no end '"+h+"' match");c(d,f=source.slice(e,p).replace(/&#?\w+;/g,o),e-1),s=5}else{if(4!=s)throw new Error('attribute value must after "="');c(d,f=source.slice(e,p).replace(/&#?\w+;/g,o),e),l.warning('attribute "'+d+'" missed start quot('+h+")!!"),e=p+1,s=5}break;case"/":switch(s){case 0:t.setTagName(source.slice(e,p));case 5:case 6:case 7:s=7,t.closed=!0;case 4:case 1:case 2:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return l.error("unexpected end of input"),0==s&&t.setTagName(source.slice(e,p)),p;case">":switch(s){case 0:t.setTagName(source.slice(e,p));case 5:case 6:case 7:break;case 4:case 1:"/"===(f=source.slice(e,p)).slice(-1)&&(t.closed=!0,f=f.slice(0,-1));case 2:2===s&&(f=d),4==s?(l.warning('attribute "'+f+'" missed quot(")!'),c(d,f.replace(/&#?\w+;/g,o),e)):(r.isHTML(n[""])&&f.match(/^(?:disabled|checked|selected)$/i)||l.warning('attribute "'+f+'" missed value!! "'+f+'" instead!!'),c(f,f,e));break;case 3:throw new Error("attribute value missed!!")}return p;case"€":h=" ";default:if(h<=" ")switch(s){case 0:t.setTagName(source.slice(e,p)),s=6;break;case 1:d=source.slice(e,p),s=2;break;case 4:var f=source.slice(e,p).replace(/&#?\w+;/g,o);l.warning('attribute "'+f+'" missed quot(")!!'),c(d,f,e);case 5:s=6}else switch(s){case 2:t.tagName;r.isHTML(n[""])&&d.match(/^(?:disabled|checked|selected)$/i)||l.warning('attribute "'+d+'" missed value!! "'+d+'" instead2!!'),c(d,d,e),e=p,s=1;break;case 5:l.warning('attribute space is required"'+d+'"!!');case 6:s=1,e=p;break;case 3:s=4,e=p;break;case 7:throw new Error("elements closed character '/' and '>' must be connected to")}}p++}}function v(e,t,n){for(var o=e.tagName,l=null,i=e.length;i--;){var a=e[i],c=a.qName,d=a.value;if((v=c.indexOf(":"))>0)var h=a.prefix=c.slice(0,v),f=c.slice(v+1),m="xmlns"===h&&f;else f=c,h=null,m="xmlns"===c&&"";a.localName=f,!1!==m&&(null==l&&(l={},T(n,n={})),n[m]=l[m]=d,a.uri=r.XMLNS,t.startPrefixMapping(m,d))}for(i=e.length;i--;){(h=(a=e[i]).prefix)&&("xml"===h&&(a.uri=r.XML),"xmlns"!==h&&(a.uri=n[h||""]))}var v;(v=o.indexOf(":"))>0?(h=e.prefix=o.slice(0,v),f=e.localName=o.slice(v+1)):(h=null,f=e.localName=o);var y=e.uri=n[h||""];if(t.startElement(y,f,o,e),!e.closed)return e.currentNSMap=n,e.localNSMap=l,!0;if(t.endElement(y,f,o),l)for(h in l)t.endPrefixMapping(h)}function y(source,e,t,n,r){if(/^(?:script|textarea)$/i.test(t)){var o=source.indexOf("",e),text=source.substring(e+1,o);if(/[&<]/.test(text))return/^script$/i.test(t)?(r.characters(text,0,text.length),o):(text=text.replace(/&#?\w+;/g,n),r.characters(text,0,text.length),o)}return e+1}function _(source,e,t,n){var r=n[t];return null==r&&((r=source.lastIndexOf(""))e?(t.comment(source,e+4,r-e-4),r+3):(n.error("Unclosed comment"),-1):-1;default:if("CDATA["==source.substr(e+3,6)){var r=source.indexOf("]]>",e+9);return t.startCDATA(),t.characters(source,e+9,r-e-9),t.endCDATA(),r+3}var o=function(source,e){var t,n=[],r=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;r.lastIndex=e,r.exec(source);for(;t=r.exec(source);)if(n.push(t),t[1])return n}(source,e),l=o.length;if(l>1&&/!doctype/i.test(o[0][0])){var c=o[1][0],d=!1,h=!1;l>3&&(/^public$/i.test(o[2][0])?(d=o[3][0],h=l>4&&o[4][0]):/^system$/i.test(o[2][0])&&(h=o[3][0]));var f=o[l-1];return t.startDTD(c,d,h),t.endDTD(),f.index+f[0].length}}return-1}function E(source,e,t){var n=source.indexOf("?>",e);if(n){var r=source.substring(e,n).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);if(r){r[0].length;return t.processingInstruction(r[1],r[2]),n+2}return-1}return-1}function k(){this.attributeNames={}}d.prototype=new Error,d.prototype.name=d.name,h.prototype={parse:function(source,e,t){var n=this.domBuilder;n.startDocument(),T(e,e={}),function(source,e,t,n,o){function l(code){if(code>65535){var e=55296+((code-=65536)>>10),t=56320+(1023&code);return String.fromCharCode(e,t)}return String.fromCharCode(code)}function c(a){var e=a.slice(1,-1);return e in t?t[e]:"#"===e.charAt(0)?l(parseInt(e.substr(1).replace("x","0x"))):(o.error("entity not found:"+a),a)}function h(e){if(e>O){var t=source.substring(O,e).replace(/&#?\w+;/g,c);x&&T(O),n.characters(t,0,e-O),O=e}}function T(p,e){for(;p>=w&&(e=I.exec(source));)C=e.index,w=C+e[0].length,x.lineNumber++;x.columnNumber=p-C+1}var C=0,w=0,I=/.*(?:\r\n?|\n)|.*$/g,x=n.locator,A=[{currentNSMap:e}],P={},O=0;for(;;){try{var L=source.indexOf("<",O);if(L<0){if(!source.substr(O).match(/^\s*$/)){var D=n.doc,text=D.createTextNode(source.substr(O));D.appendChild(text),n.currentElement=text}return}switch(L>O&&h(L),source.charAt(L+1)){case"/":var M=source.indexOf(">",L+3),R=source.substring(L+2,M).replace(/[ \t\n\r]+$/g,""),N=A.pop();M<0?(R=source.substring(L+2).replace(/[\s<].*/,""),o.error("end tag name: "+R+" is not complete:"+N.tagName),M=L+1+R.length):R.match(/\sO?O=M:h(Math.max(L,O)+1)}}(source,e,t,n,this.errorHandler),n.endDocument()}},k.prototype={setTagName:function(e){if(!c.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},addValue:function(e,t,n){if(!c.test(e))throw new Error("invalid attribute:"+e);this.attributeNames[e]=this.length,this[this.length++]={qName:e,value:t,offset:n}},length:0,getLocalName:function(i){return this[i].localName},getLocator:function(i){return this[i].locator},getQName:function(i){return this[i].qName},getURI:function(i){return this[i].uri},getValue:function(i){return this[i].value}},t.XMLReader=h,t.ParseError=d},2802:function(e,t,n){var r=n(2803).getUint64;e.exports=function(data){var view=new DataView(data.buffer,data.byteOffset,data.byteLength),e={version:data[0],flags:new Uint8Array(data.subarray(1,4)),references:[],referenceId:view.getUint32(4),timescale:view.getUint32(8)},i=12;0===e.version?(e.earliestPresentationTime=view.getUint32(i),e.firstOffset=view.getUint32(i+4),i+=8):(e.earliestPresentationTime=r(data.subarray(i)),e.firstOffset=r(data.subarray(i+8)),i+=16),i+=2;var t=view.getUint16(i);for(i+=2;t>0;i+=12,t--)e.references.push({referenceType:(128&data[i])>>>7,referencedSize:2147483647&view.getUint32(i),subsegmentDuration:view.getUint32(i+4),startsWithSap:!!(128&data[i+8]),sapType:(112&data[i+8])>>>4,sapDeltaTime:268435455&view.getUint32(i+8)});return e}},2803:function(e,t){var n=Math.pow(2,32);e.exports={getUint64:function(e){var t,r=new DataView(e.buffer,e.byteOffset,e.byteLength);return r.getBigUint64?(t=r.getBigUint64(0))i;){var n=e[i],l=0,c=0,d=e[++c];for(c++;128&d;)l=(127&d)<<7,d=e[c],c++;l+=127&d;for(var h=0;h>>0,h=t.subarray(i+4,i+8);if(0===d)break;var f=i+d;if(f>t.length){if(r)break;f=t.length}var data=t.subarray(i+8,f);Object(o.a)(h,n[0])&&(1===n.length?c.push(data):c.push.apply(c,e(data,n.slice(1),r))),i=f}return c},h={EBML:Object(o.k)([26,69,223,163]),DocType:Object(o.k)([66,130]),Segment:Object(o.k)([24,83,128,103]),SegmentInfo:Object(o.k)([21,73,169,102]),Tracks:Object(o.k)([22,84,174,107]),Track:Object(o.k)([174]),TrackNumber:Object(o.k)([215]),DefaultDuration:Object(o.k)([35,227,131]),TrackEntry:Object(o.k)([174]),TrackType:Object(o.k)([131]),FlagDefault:Object(o.k)([136]),CodecID:Object(o.k)([134]),CodecPrivate:Object(o.k)([99,162]),VideoTrack:Object(o.k)([224]),AudioTrack:Object(o.k)([225]),Cluster:Object(o.k)([31,67,182,117]),Timestamp:Object(o.k)([231]),TimestampScale:Object(o.k)([42,215,177]),BlockGroup:Object(o.k)([160]),BlockDuration:Object(o.k)([155]),Block:Object(o.k)([161]),SimpleBlock:Object(o.k)([163])},f=[128,64,32,16,8,4,2,1],m=function(e,t,n,r){void 0===n&&(n=!0),void 0===r&&(r=!1);var l=function(e){for(var t=1,i=0;i=n.length)return n.length;var l=m(n,r,!1);if(Object(o.a)(t.bytes,l.bytes))return r;var c=m(n,r+l.length);return e(t,n,r+c.length+c.value+l.length)},_=function e(t,n){n=function(e){return Array.isArray(e)?e.map((function(p){return v(p)})):[v(e)]}(n),t=Object(o.k)(t);var r=[];if(!n.length)return r;for(var i=0;it.length?t.length:d+c.value,data=t.subarray(d,h);Object(o.a)(n[0],l.bytes)&&(1===n.length?r.push(data):r=r.concat(e(data,n.slice(1)))),i+=l.length+c.length+data.length}return r},T=n(2525),S=Object(o.k)([0,0,0,1]),E=Object(o.k)([0,0,1]),k=Object(o.k)([0,0,3]),C=function(e){for(var t=[],i=1;i>1&63),-1!==n.indexOf(h)&&(l=i+d),i+=d+("h264"===t?1:2)}else i++}return e.subarray(0,0)},I={webm:Object(o.k)([119,101,98,109]),matroska:Object(o.k)([109,97,116,114,111,115,107,97]),flac:Object(o.k)([102,76,97,67]),ogg:Object(o.k)([79,103,103,83]),ac3:Object(o.k)([11,119]),riff:Object(o.k)([82,73,70,70]),avi:Object(o.k)([65,86,73]),wav:Object(o.k)([87,65,86,69]),"3gp":Object(o.k)([102,116,121,112,51,103]),mp4:Object(o.k)([102,116,121,112]),fmp4:Object(o.k)([115,116,121,112]),mov:Object(o.k)([102,116,121,112,113,116]),moov:Object(o.k)([109,111,111,118]),moof:Object(o.k)([109,111,111,102])},x={aac:function(e){var t=Object(T.a)(e);return Object(o.a)(e,[255,16],{offset:t,mask:[255,22]})},mp3:function(e){var t=Object(T.a)(e);return Object(o.a)(e,[255,2],{offset:t,mask:[255,6]})},webm:function(e){var t=_(e,[h.EBML,h.DocType])[0];return Object(o.a)(t,I.webm)},mkv:function(e){var t=_(e,[h.EBML,h.DocType])[0];return Object(o.a)(t,I.matroska)},mp4:function(e){return!x["3gp"](e)&&!x.mov(e)&&(!(!Object(o.a)(e,I.mp4,{offset:4})&&!Object(o.a)(e,I.fmp4,{offset:4}))||(!(!Object(o.a)(e,I.moof,{offset:4})&&!Object(o.a)(e,I.moov,{offset:4}))||void 0))},mov:function(e){return Object(o.a)(e,I.mov,{offset:4})},"3gp":function(e){return Object(o.a)(e,I["3gp"],{offset:4})},ac3:function(e){var t=Object(T.a)(e);return Object(o.a)(e,I.ac3,{offset:t})},ts:function(e){if(e.length<189&&e.length>=1)return 71===e[0];for(var i=0;i+1880}},2987:function(e,t,n){"use strict";n.d(t,"a",(function(){return C}));var r=n(2521),o=n.n(r),l=function(){function e(){this.listeners={}}var t=e.prototype;return t.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.off=function(e,t){if(!this.listeners[e])return!1;var n=this.listeners[e].indexOf(t);return this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(n,1),n>-1},t.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var n=t.length,i=0;i-1;e=this.buffer.indexOf("\n"))this.trigger("data",this.buffer.substring(0,e)),this.buffer=this.buffer.substring(e+1)},t}(l),y=String.fromCharCode(9),_=function(e){var t=/([0-9.]*)?@?([0-9.]*)?/.exec(e||""),n={};return t[1]&&(n.length=parseInt(t[1],10)),t[2]&&(n.offset=parseInt(t[2],10)),n},T=function(e){for(var t,n=e.split(new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))')),r={},i=n.length;i--;)""!==n[i]&&((t=/([^=]*)=(.*)/.exec(n[i]).slice(1))[0]=t[0].replace(/^\s+|\s+$/g,""),t[1]=t[1].replace(/^\s+|\s+$/g,""),t[1]=t[1].replace(/^['"](.*)['"]$/g,"$1"),r[t[0]]=t[1]);return r},S=function(e){function t(){var t;return(t=e.call(this)||this).customParsers=[],t.tagMappers=[],t}o()(t,e);var n=t.prototype;return n.push=function(line){var e,t,n=this;0!==(line=line.trim()).length&&("#"===line[0]?this.tagMappers.reduce((function(e,t){var n=t(line);return n===line?e:e.concat([n])}),[line]).forEach((function(r){for(var i=0;i0&&(c.duration=e.duration),0===e.duration&&(c.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=l},key:function(){if(e.attributes)if("NONE"!==e.attributes.METHOD)if(e.attributes.URI){if("com.apple.streamingkeydelivery"===e.attributes.KEYFORMAT)return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:e.attributes});if("com.microsoft.playready"===e.attributes.KEYFORMAT)return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.microsoft.playready"]={uri:e.attributes.URI});if("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"===e.attributes.KEYFORMAT){return-1===["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(e.attributes.METHOD)?void this.trigger("warn",{message:"invalid key method provided for Widevine"}):("SAMPLE-AES-CENC"===e.attributes.METHOD&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),"data:text/plain;base64,"!==e.attributes.URI.substring(0,23)?void this.trigger("warn",{message:"invalid key URI provided for Widevine"}):e.attributes.KEYID&&"0x"===e.attributes.KEYID.substring(0,2)?(this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:e.attributes.KEYFORMAT,keyId:e.attributes.KEYID.substring(2)},pssh:Object(m.a)(e.attributes.URI.split(",")[1])})):void this.trigger("warn",{message:"invalid key ID provided for Widevine"}))}e.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),r={method:e.attributes.METHOD||"AES-128",uri:e.attributes.URI},void 0!==e.attributes.IV&&(r.iv=e.attributes.IV)}else this.trigger("warn",{message:"ignoring key declaration without URI"});else r=null;else this.trigger("warn",{message:"ignoring key declaration without attribute list"})},"media-sequence":function(){isFinite(e.number)?this.manifest.mediaSequence=e.number:this.trigger("warn",{message:"ignoring invalid media sequence: "+e.number})},"discontinuity-sequence":function(){isFinite(e.number)?(this.manifest.discontinuitySequence=e.number,T=e.number):this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+e.number})},"playlist-type":function(){/VOD|EVENT/.test(e.playlistType)?this.manifest.playlistType=e.playlistType:this.trigger("warn",{message:"ignoring unknown playlist type: "+e.playlist})},map:function(){n={},e.uri&&(n.uri=e.uri),e.byterange&&(n.byterange=e.byterange),r&&(n.key=r)},"stream-inf":function(){this.manifest.playlists=l,this.manifest.mediaGroups=this.manifest.mediaGroups||_,e.attributes?(c.attributes||(c.attributes={}),d()(c.attributes,e.attributes)):this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},media:function(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||_,e.attributes&&e.attributes.TYPE&&e.attributes["GROUP-ID"]&&e.attributes.NAME){var n=this.manifest.mediaGroups[e.attributes.TYPE];n[e.attributes["GROUP-ID"]]=n[e.attributes["GROUP-ID"]]||{},t=n[e.attributes["GROUP-ID"]],(f={default:/yes/i.test(e.attributes.DEFAULT)}).default?f.autoselect=!0:f.autoselect=/yes/i.test(e.attributes.AUTOSELECT),e.attributes.LANGUAGE&&(f.language=e.attributes.LANGUAGE),e.attributes.URI&&(f.uri=e.attributes.URI),e.attributes["INSTREAM-ID"]&&(f.instreamId=e.attributes["INSTREAM-ID"]),e.attributes.CHARACTERISTICS&&(f.characteristics=e.attributes.CHARACTERISTICS),e.attributes.FORCED&&(f.forced=/yes/i.test(e.attributes.FORCED)),t[e.attributes.NAME]=f}else this.trigger("warn",{message:"ignoring incomplete or missing media group"})},discontinuity:function(){T+=1,c.discontinuity=!0,this.manifest.discontinuityStarts.push(l.length)},"program-date-time":function(){void 0===this.manifest.dateTimeString&&(this.manifest.dateTimeString=e.dateTimeString,this.manifest.dateTimeObject=e.dateTimeObject),c.dateTimeString=e.dateTimeString,c.dateTimeObject=e.dateTimeObject},targetduration:function(){!isFinite(e.duration)||e.duration<0?this.trigger("warn",{message:"ignoring invalid target duration: "+e.duration}):(this.manifest.targetDuration=e.duration,k.call(this,this.manifest))},start:function(){e.attributes&&!isNaN(e.attributes["TIME-OFFSET"])?this.manifest.start={timeOffset:e.attributes["TIME-OFFSET"],precise:e.attributes.PRECISE}:this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"})},"cue-out":function(){c.cueOut=e.data},"cue-out-cont":function(){c.cueOutCont=e.data},"cue-in":function(){c.cueIn=e.data},skip:function(){this.manifest.skip=E(e.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",e.attributes,["SKIPPED-SEGMENTS"])},part:function(){var t=this;h=!0;var n=this.manifest.segments.length,r=E(e.attributes);c.parts=c.parts||[],c.parts.push(r),r.byterange&&(r.byterange.hasOwnProperty("offset")||(r.byterange.offset=w),w=r.byterange.offset+r.byterange.length);var o=c.parts.length-1;this.warnOnMissingAttributes_("#EXT-X-PART #"+o+" for segment #"+n,e.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach((function(e,i){e.hasOwnProperty("lastPart")||t.trigger("warn",{message:"#EXT-X-RENDITION-REPORT #"+i+" lacks required attribute(s): LAST-PART"})}))},"server-control":function(){var t=this.manifest.serverControl=E(e.attributes);t.hasOwnProperty("canBlockReload")||(t.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),k.call(this,this.manifest),t.canSkipDateranges&&!t.hasOwnProperty("canSkipUntil")&&this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})},"preload-hint":function(){var t=this.manifest.segments.length,n=E(e.attributes),r=n.type&&"PART"===n.type;c.preloadHints=c.preloadHints||[],c.preloadHints.push(n),n.byterange&&(n.byterange.hasOwnProperty("offset")||(n.byterange.offset=r?w:0,r&&(w=n.byterange.offset+n.byterange.length)));var o=c.preloadHints.length-1;if(this.warnOnMissingAttributes_("#EXT-X-PRELOAD-HINT #"+o+" for segment #"+t,e.attributes,["TYPE","URI"]),n.type)for(var i=0;ib.timeline?1:-1}));var t,n},R=function(e){var t,n,r=[];return t=e,n=function(e,t,n,label){r=r.concat(e.playlists||[])},D.forEach((function(e){for(var r in t.mediaGroups[e])for(var o in t.mediaGroups[e][r]){var l=t.mediaGroups[e][r][o];n(l,e,r,o)}})),r},N=function(e){var t=e.playlist,n=e.mediaSequence;t.mediaSequence=n,t.segments.forEach((function(e,n){e.number=t.mediaSequence+n}))},U=function(e){var t=e.oldManifest,n=e.newManifest,r=t.playlists.concat(R(t)),o=n.playlists.concat(R(n));return n.timelineStarts=M([t.timelineStarts,n.timelineStarts]),function(e){var t=e.oldPlaylists,n=e.newPlaylists,r=e.timelineStarts;n.forEach((function(e){e.discontinuitySequence=_(r,(function(t){return t.timeline===e.timeline}));var n=function(e,t){for(var i=0;in.timeline||n.segments.length&&e.timeline>n.segments[n.segments.length-1].timeline)&&e.discontinuitySequence--);n.segments[l].discontinuity&&!o.discontinuity&&(o.discontinuity=!0,e.discontinuityStarts.unshift(0),e.discontinuitySequence--),N({playlist:e,mediaSequence:n.segments[l].number})}}))}({oldPlaylists:r,newPlaylists:o,timelineStarts:n.timelineStarts}),n},B=function(e){return e&&e.uri+"-"+(t=e.byterange,n="bigint"==typeof t.offset||"bigint"==typeof t.length?l.a.BigInt(t.offset)+l.a.BigInt(t.length)-l.a.BigInt(1):t.offset+t.length-1,t.offset+"-"+n);var t,n},j=function(e){return m(e.reduce((function(e,t){var n=t.attributes.id+(t.attributes.lang||"");if(e[n]){var r;if(t.segments)t.segments[0]&&(t.segments[0].discontinuity=!0),(r=e[n].segments).push.apply(r,t.segments);t.attributes.contentProtection&&(e[n].attributes.contentProtection=t.attributes.contentProtection)}else e[n]=t,e[n].attributes.timelineStarts=[];return e[n].attributes.timelineStarts.push({start:t.attributes.periodStart,timeline:t.attributes.periodStart}),e}),{})).map((function(e){var t,n;return e.discontinuityStarts=(t=e.segments||[],n="discontinuity",t.reduce((function(a,e,i){return e[n]&&a.push(i),a}),[])),e}))},F=function(e,t){var n=B(e.sidx),r=n&&t[n]&&t[n].sidx;return r&&L(e,r,e.sidx.resolvedUri),e},H=function(e,t){if(void 0===t&&(t={}),!Object.keys(t).length)return e;for(var i in e)e[i]=F(e[i],t);return e},V=function(e){var t,n=e.attributes,r=e.segments,o=e.sidx,l=e.discontinuityStarts,c={attributes:(t={NAME:n.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:n.width,height:n.height},CODECS:n.codecs,BANDWIDTH:n.bandwidth},t["PROGRAM-ID"]=1,t),uri:"",endList:"static"===n.type,timeline:n.periodStart,resolvedUri:"",targetDuration:n.duration,discontinuityStarts:l,timelineStarts:n.timelineStarts,segments:r};return n.contentProtection&&(c.contentProtection=n.contentProtection),o&&(c.sidx=o),c},W=function(e){var t=e.attributes;return"video/mp4"===t.mimeType||"video/webm"===t.mimeType||"video"===t.contentType},z=function(e){var t=e.attributes;return"audio/mp4"===t.mimeType||"audio/webm"===t.mimeType||"audio"===t.contentType},G=function(e){var t=e.attributes;return"text/vtt"===t.mimeType||"text"===t.contentType},X=function(e){return e?Object.keys(e).reduce((function(t,label){var n=e[label];return t.concat(n.playlists)}),[]):[]},K=function(e){var t,n=e.dashPlaylists,r=e.locations,o=e.sidxMapping,l=void 0===o?{}:o,c=e.previousManifest;if(!n.length)return{};var d=n[0].attributes,h=d.sourceDuration,f=d.type,m=d.suggestedPresentationDelay,v=d.minimumUpdatePeriod,y=j(n.filter(W)).map(V),T=j(n.filter(z)),S=j(n.filter(G)),E=n.map((function(e){return e.attributes.captionServices})).filter(Boolean),k={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:(t={AUDIO:{},VIDEO:{}},t["CLOSED-CAPTIONS"]={},t.SUBTITLES={},t),uri:"",duration:h,playlists:H(y,l)};v>=0&&(k.minimumUpdatePeriod=1e3*v),r&&(k.locations=r),"dynamic"===f&&(k.suggestedPresentationDelay=m);var C,w,I=0===k.playlists.length,x=T.length?function(e,t,n){var r;void 0===t&&(t={}),void 0===n&&(n=!1);var o=e.reduce((function(a,e){var o=e.attributes.role&&e.attributes.role.value||"",l=e.attributes.lang||"",label=e.attributes.label||"main";if(l&&!e.attributes.label){var c=o?" ("+o+")":"";label=""+e.attributes.lang+c}a[label]||(a[label]={language:l,autoselect:!0,default:"main"===o,playlists:[],uri:""});var d=F(function(e,t){var n,r=e.attributes,o=e.segments,l=e.sidx,c=e.mediaSequence,d=e.discontinuitySequence,h=e.discontinuityStarts,f={attributes:(n={NAME:r.id,BANDWIDTH:r.bandwidth,CODECS:r.codecs},n["PROGRAM-ID"]=1,n),uri:"",endList:"static"===r.type,timeline:r.periodStart,resolvedUri:"",targetDuration:r.duration,discontinuitySequence:d,discontinuityStarts:h,timelineStarts:r.timelineStarts,mediaSequence:c,segments:o};return r.contentProtection&&(f.contentProtection=r.contentProtection),l&&(f.sidx=l),t&&(f.attributes.AUDIO="audio",f.attributes.SUBTITLES="subs"),f}(e,n),t);return a[label].playlists.push(d),void 0===r&&"main"===o&&((r=e).default=!0),a}),{});return r||(o[Object.keys(o)[0]].default=!0),o}(T,l,I):null,A=S.length?function(e,t){return void 0===t&&(t={}),e.reduce((function(a,e){var label=e.attributes.lang||"text";return a[label]||(a[label]={language:label,default:!1,autoselect:!1,playlists:[],uri:""}),a[label].playlists.push(F(function(e){var t,n=e.attributes,r=e.segments,o=e.mediaSequence,l=e.discontinuityStarts,c=e.discontinuitySequence;void 0===r&&(r=[{uri:n.baseUrl,timeline:n.periodStart,resolvedUri:n.baseUrl||"",duration:n.sourceDuration,number:0}],n.duration=n.sourceDuration);var d=((t={NAME:n.id,BANDWIDTH:n.bandwidth})["PROGRAM-ID"]=1,t);return n.codecs&&(d.CODECS=n.codecs),{attributes:d,uri:"",endList:"static"===n.type,timeline:n.periodStart,resolvedUri:n.baseUrl||"",targetDuration:n.duration,timelineStarts:n.timelineStarts,discontinuityStarts:l,discontinuitySequence:c,mediaSequence:o,segments:r}}(e),t)),a}),{})}(S,l):null,P=y.concat(X(x),X(A)),O=P.map((function(e){return e.timelineStarts}));return k.timelineStarts=M(O),C=P,w=k.timelineStarts,C.forEach((function(e){e.mediaSequence=0,e.discontinuitySequence=_(w,(function(t){return t.timeline===e.timeline})),e.segments&&e.segments.forEach((function(e,t){e.number=t}))})),x&&(k.mediaGroups.AUDIO.audio=x),A&&(k.mediaGroups.SUBTITLES.subs=A),E.length&&(k.mediaGroups["CLOSED-CAPTIONS"].cc=E.reduce((function(e,t){return t?(t.forEach((function(t){var n=t.channel,r=t.language;e[r]={autoselect:!1,default:!1,instreamId:n,language:r},t.hasOwnProperty("aspectRatio")&&(e[r].aspectRatio=t.aspectRatio),t.hasOwnProperty("easyReader")&&(e[r].easyReader=t.easyReader),t.hasOwnProperty("3D")&&(e[r]["3D"]=t["3D"])})),e):e}),{})),c?U({oldManifest:c,newManifest:k}):k},Y=function(e,time,t){var n=e.NOW,r=e.clientOffset,o=e.availabilityStartTime,l=e.timescale,c=void 0===l?1:l,d=e.periodStart,h=void 0===d?0:d,f=e.minimumUpdatePeriod,m=(n+r)/1e3+(void 0===f?0:f)-(o+h);return Math.ceil((m*c-time)/t)},Q=function(e,t){for(var n=e.type,r=e.minimumUpdatePeriod,o=void 0===r?0:r,l=e.media,c=void 0===l?"":l,d=e.sourceDuration,h=e.timescale,f=void 0===h?1:h,m=e.startNumber,v=void 0===m?1:m,y=e.periodStart,_=[],time=-1,T=0;Ttime&&(time=C);var w=void 0;if(k<0){var I=T+1;w=I===t.length?"dynamic"===n&&o>0&&c.indexOf("$Number$")>0?Y(e,time,E):(d*f-time)/E:(t[I].t-time)/E}else w=k+1;for(var x=v+_.length+w,A=v+_.length;A=o?l:""+new Array(o-l.length+1).join("0")+l)}}(t))},Z=function(e,t){var n={RepresentationID:e.id,Bandwidth:e.bandwidth||0},o=e.initialization,l=void 0===o?{sourceURL:"",range:""}:o,c=I({baseUrl:e.baseUrl,source:J(l.sourceURL,n),range:l.range});return function(e,t){return e.duration||t?e.duration?P(e):Q(e,t):[{number:e.startNumber||1,duration:e.sourceDuration,time:0,timeline:e.periodStart}]}(e,t).map((function(t){n.Number=t.number,n.Time=t.time;var o=J(e.media||"",n),l=e.timescale||1,d=e.presentationTimeOffset||0,h=e.periodStart+(t.time-d)/l;return{uri:o,timeline:t.timeline,duration:t.duration,resolvedUri:Object(r.a)(e.baseUrl||"",o),map:c,number:t.number,presentationTime:h}}))},ee=function(e,t){var n=e.duration,r=e.segmentUrls,o=void 0===r?[]:r,l=e.periodStart;if(!n&&!t||n&&t)throw new Error(C);var c,d=o.map((function(t){return function(e,t){var n=e.baseUrl,r=e.initialization,o=void 0===r?{}:r,l=I({baseUrl:n,source:o.sourceURL,range:o.range}),c=I({baseUrl:n,source:t.media,range:t.mediaRange});return c.map=l,c}(e,t)}));return n&&(c=P(e)),t&&(c=Q(e,t)),c.map((function(t,n){if(d[n]){var r=d[n],o=e.timescale||1,c=e.presentationTimeOffset||0;return r.timeline=t.timeline,r.duration=t.duration,r.number=t.number,r.presentationTime=l+(t.time-c)/o,r}})).filter((function(e){return e}))},te=function(e){var t,n,r=e.attributes,o=e.segmentInfo;o.template?(n=Z,t=f(r,o.template)):o.base?(n=O,t=f(r,o.base)):o.list&&(n=ee,t=f(r,o.list));var l={attributes:r};if(!n)return l;var c=n(t,o.segmentTimeline);if(t.duration){var d=t,h=d.duration,m=d.timescale,v=void 0===m?1:m;t.duration=h/v}else c.length?t.duration=c.reduce((function(e,t){return Math.max(e,Math.ceil(t.duration))}),0):t.duration=0;return l.attributes=t,l.segments=c,o.base&&t.indexRange&&(l.sidx=c[0],l.segments=[]),l},ie=function(element,e){return y(element.childNodes).filter((function(t){return t.tagName===e}))},ne=function(element){return element.textContent.trim()},re=function(e){var t=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(e);if(!t)return 0;var n=t.slice(1),r=n[0],o=n[1],l=n[2],c=n[3],d=n[4],h=n[5];return 31536e3*parseFloat(r||0)+2592e3*parseFloat(o||0)+86400*parseFloat(l||0)+3600*parseFloat(c||0)+60*parseFloat(d||0)+parseFloat(h||0)},ae={mediaPresentationDuration:function(e){return re(e)},availabilityStartTime:function(e){return/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(t=e)&&(t+="Z"),Date.parse(t)/1e3;var t},minimumUpdatePeriod:function(e){return re(e)},suggestedPresentationDelay:function(e){return re(e)},type:function(e){return e},timeShiftBufferDepth:function(e){return re(e)},start:function(e){return re(e)},width:function(e){return parseInt(e,10)},height:function(e){return parseInt(e,10)},bandwidth:function(e){return parseInt(e,10)},startNumber:function(e){return parseInt(e,10)},timescale:function(e){return parseInt(e,10)},presentationTimeOffset:function(e){return parseInt(e,10)},duration:function(e){var t=parseInt(e,10);return isNaN(t)?re(e):t},d:function(e){return parseInt(e,10)},t:function(e){return parseInt(e,10)},r:function(e){return parseInt(e,10)},DEFAULT:function(e){return e}},se=function(e){return e&&e.attributes?y(e.attributes).reduce((function(a,e){var t=ae[e.name]||ae.DEFAULT;return a[e.name]=t(e.value),a}),{}):{}},oe={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime"},ue=function(e,t){return t.length?v(e.map((function(e){return t.map((function(t){return Object(r.a)(e,ne(t))}))}))):e},le=function(e){var t=ie(e,"SegmentTemplate")[0],n=ie(e,"SegmentList")[0],r=n&&ie(n,"SegmentURL").map((function(s){return f({tag:"SegmentURL"},se(s))})),o=ie(e,"SegmentBase")[0],l=n||t,c=l&&ie(l,"SegmentTimeline")[0],d=n||o||t,h=d&&ie(d,"Initialization")[0],template=t&&se(t);template&&h?template.initialization=h&&se(h):template&&template.initialization&&(template.initialization={sourceURL:template.initialization});var m={template:template,segmentTimeline:c&&ie(c,"S").map((function(s){return se(s)})),list:n&&f(se(n),{segmentUrls:r,initialization:se(h)}),base:o&&f(se(o),{initialization:se(h)})};return Object.keys(m).forEach((function(e){m[e]||delete m[e]})),m},ce=function(e,t,n){return function(r){var o,l=se(r),d=ue(t,ie(r,"BaseURL")),h=ie(r,"Role")[0],m={role:se(h)},y=f(e,l,m),_=ie(r,"Accessibility")[0],T="urn:scte:dash:cc:cea-608:2015"===(o=se(_)).schemeIdUri?("string"!=typeof o.value?[]:o.value.split(";")).map((function(e){var t,n;if(n=e,/^CC\d=/.test(e)){var r=e.split("=");t=r[0],n=r[1]}else/^CC\d$/.test(e)&&(t=e);return{channel:t,language:n}})):"urn:scte:dash:cc:cea-708:2015"===o.schemeIdUri?("string"!=typeof o.value?[]:o.value.split(";")).map((function(e){var t={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(e)){var n=e.split("="),r=n[0],o=n[1],l=void 0===o?"":o;t.channel=r,t.language=e,l.split(",").forEach((function(e){var n=e.split(":"),r=n[0],o=n[1];"lang"===r?t.language=o:"er"===r?t.easyReader=Number(o):"war"===r?t.aspectRatio=Number(o):"3D"===r&&(t["3D"]=Number(o))}))}else t.language=e;return t.channel&&(t.channel="SERVICE"+t.channel),t})):void 0;T&&(y=f(y,{captionServices:T}));var label=ie(r,"Label")[0];if(label&&label.childNodes.length){var S=label.childNodes[0].nodeValue.trim();y=f(y,{label:S})}var E=ie(r,"ContentProtection").reduce((function(e,t){var n=se(t);n.schemeIdUri&&(n.schemeIdUri=n.schemeIdUri.toLowerCase());var r=oe[n.schemeIdUri];if(r){e[r]={attributes:n};var o=ie(t,"cenc:pssh")[0];if(o){var l=ne(o);e[r].pssh=l&&Object(c.a)(l)}}return e}),{});Object.keys(E).length&&(y=f(y,{contentProtection:E}));var k=le(r),C=ie(r,"Representation"),w=f(n,k);return v(C.map(function(e,t,n){return function(r){var o=ie(r,"BaseURL"),l=ue(t,o),c=f(e,se(r)),d=le(r);return l.map((function(e){return{segmentInfo:f(n,d),attributes:f(c,{baseUrl:e})}}))}}(y,d,w)))}},de=function(e,t){return function(n,r){var o=ue(t,ie(n.node,"BaseURL")),l=f(e,{periodStart:n.attributes.start});"number"==typeof n.attributes.duration&&(l.periodDuration=n.attributes.duration);var c=ie(n.node,"AdaptationSet"),d=le(n.node);return v(c.map(ce(l,o,d)))}},he=function(e){if(""===e)throw new Error(S);var t,n,r=new d.DOMParser;try{n=(t=r.parseFromString(e,"application/xml"))&&"MPD"===t.documentElement.tagName?t.documentElement:null}catch(e){}if(!n||n&&n.getElementsByTagName("parsererror").length>0)throw new Error(E);return n},pe=function(e,t){void 0===t&&(t={});var n=function(e,t){void 0===t&&(t={});var n=t,r=n.manifestUri,o=void 0===r?"":r,l=n.NOW,c=void 0===l?Date.now():l,d=n.clientOffset,h=void 0===d?0:d,f=ie(e,"Period");if(!f.length)throw new Error(T);var m=ie(e,"Location"),y=se(e),_=ue([o],ie(e,"BaseURL"));y.type=y.type||"static",y.sourceDuration=y.mediaPresentationDuration||0,y.NOW=c,y.clientOffset=h,m.length&&(y.locations=m.map(ne));var S=[];return f.forEach((function(e,t){var n=se(e),r=S[t-1];n.start=function(e){var t=e.attributes,n=e.priorPeriodAttributes,r=e.mpdType;return"number"==typeof t.start?t.start:n&&"number"==typeof n.start&&"number"==typeof n.duration?n.start+n.duration:n||"static"!==r?null:0}({attributes:n,priorPeriodAttributes:r?r.attributes:null,mpdType:y.type}),S.push({node:e,attributes:n})})),{locations:y.locations,representationInfo:v(S.map(de(y,_)))}}(he(e),t),r=n.representationInfo.map(te);return K({dashPlaylists:r,locations:n.locations,sidxMapping:t.sidxMapping,previousManifest:t.previousManifest})},fe=function(e){return function(e){var t=ie(e,"UTCTiming")[0];if(!t)return null;var n=se(t);switch(n.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":n.method="HEAD";break;case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":n.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":n.method="DIRECT",n.value=Date.parse(n.value);break;case"urn:mpeg:dash:utc:http-ntp:2014":case"urn:mpeg:dash:utc:ntp:2014":case"urn:mpeg:dash:utc:sntp:2014":default:throw new Error(w)}return n}(he(e))}}}]);