mistserver/embed/players/video.min.js

1 line
No EOL
524 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(function(e,t){typeof exports==="object"&&typeof module!=="undefined"?module.exports=t(require("global/window"),require("global/document")):typeof define==="function"&&define.amd?define(["global/window","global/document"],t):(e=e||self,e.videojs=t(e.window,e.document))})(this,function(e,t){e=e&&e.hasOwnProperty("default")?e["default"]:e;t=t&&t.hasOwnProperty("default")?t["default"]:t;var i="7.5.4";function r(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.__proto__=t}function n(e,t){n=Object.setPrototypeOf||function e(t,i){t.__proto__=i;return t};return n(e,t)}function a(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return true}catch(e){return false}}function s(e,t,i){if(a()){s=Reflect.construct}else{s=function e(t,i,r){var a=[null];a.push.apply(a,i);var s=Function.bind.apply(t,a);var o=new s;if(r)n(o,r.prototype);return o}}return s.apply(null,arguments)}function o(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function u(e,t){if(!t){t=e.slice(0)}e.raw=t;return e}var l=[];var c=function t(i,r){return function(t,n,a){var s=r.levels[n];var o=new RegExp("^("+s+")$");if(t!=="log"){a.unshift(t.toUpperCase()+":")}a.unshift(i+":");if(l){l.push([].concat(a))}if(!e.console){return}var u=e.console[t];if(!u&&t==="debug"){u=e.console.info||e.console.log}if(!u||!s||!o.test(t)){return}u[Array.isArray(a)?"apply":"call"](e.console,a)}};function f(e){var t="info";var i;var r=function e(){for(var r=arguments.length,n=new Array(r),a=0;a<r;a++){n[a]=arguments[a]}i("log",t,n)};i=c(e,r);r.createLogger=function(t){return f(e+": "+t)};r.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:t};r.level=function(e){if(typeof e==="string"){if(!r.levels.hasOwnProperty(e)){throw new Error('"'+e+'" in not a valid log level')}t=e}return t};r.history=function(){return l?[].concat(l):[]};r.history.filter=function(e){return(l||[]).filter(function(t){return new RegExp(".*"+e+".*").test(t[0])})};r.history.clear=function(){if(l){l.length=0}};r.history.disable=function(){if(l!==null){l.length=0;l=null}};r.history.enable=function(){if(l===null){l=[]}};r.error=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++){r[n]=arguments[n]}return i("error",t,r)};r.warn=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++){r[n]=arguments[n]}return i("warn",t,r)};r.debug=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++){r[n]=arguments[n]}return i("debug",t,r)};return r}var d=f("VIDEOJS");var h=d.createLogger;function p(e){return e.replace(/\n\r?\s*/g,"")}var m=function e(t){var i="",r=0;for(;r<arguments.length;r++){i+=p(t[r])+(arguments[r+1]||"")}return i};var v=Object.prototype.toString;var g=function e(t){return T(t)?Object.keys(t):[]};function y(e,t){g(e).forEach(function(i){return t(e[i],i)})}function _(e,t,i){if(i===void 0){i=0}return g(e).reduce(function(i,r){return t(i,e[r],r)},i)}function b(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++){i[r-1]=arguments[r]}if(Object.assign){return Object.assign.apply(Object,[e].concat(i))}i.forEach(function(t){if(!t){return}y(t,function(t,i){e[i]=t})});return e}function T(e){return!!e&&typeof e==="object"}function S(e){return T(e)&&v.call(e)==="[object Object]"&&e.constructor===Object}function k(t,i){if(!t||!i){return""}if(typeof e.getComputedStyle==="function"){var r=e.getComputedStyle(t);return r?r[i]:""}return""}function w(){var e=u(["Setting attributes in the second argument of createEl()\n has been deprecated. Use the third argument instead.\n createEl(type, properties, attributes). Attempting to set "," to ","."]);w=function t(){return e};return e}function C(e){return typeof e==="string"&&/\S/.test(e)}function E(e){if(/\s/.test(e)){throw new Error("class has illegal whitespace characters")}}function A(e){return new RegExp("(^|\\s)"+e+"($|\\s)")}function L(){return t===e.document}function I(e){return T(e)&&e.nodeType===1}function P(){try{return e.parent!==e.self}catch(e){return true}}function O(e){return function(i,r){if(!C(i)){return t[e](null)}if(C(r)){r=t.querySelector(r)}var n=I(r)?r:t;return n[e]&&n[e](i)}}function U(e,i,r,n){if(e===void 0){e="div"}if(i===void 0){i={}}if(r===void 0){r={}}var a=t.createElement(e);Object.getOwnPropertyNames(i).forEach(function(e){var t=i[e];if(e.indexOf("aria-")!==-1||e==="role"||e==="type"){d.warn(m(w(),e,t));a.setAttribute(e,t)}else if(e==="textContent"){D(a,t)}else{a[e]=t}});Object.getOwnPropertyNames(r).forEach(function(e){a.setAttribute(e,r[e])});if(n){J(a,n)}return a}function D(e,t){if(typeof e.textContent==="undefined"){e.innerText=t}else{e.textContent=t}return e}function x(e,t){if(t.firstChild){t.insertBefore(e,t.firstChild)}else{t.appendChild(e)}}function R(e,t){E(t);if(e.classList){return e.classList.contains(t)}return A(t).test(e.className)}function M(e,t){if(e.classList){e.classList.add(t)}else if(!R(e,t)){e.className=(e.className+" "+t).trim()}return e}function B(e,t){if(e.classList){e.classList.remove(t)}else{E(t);e.className=e.className.split(/\s+/).filter(function(e){return e!==t}).join(" ")}return e}function N(e,t,i){var r=R(e,t);if(typeof i==="function"){i=i(e,t)}if(typeof i!=="boolean"){i=!r}if(i===r){return}if(i){M(e,t)}else{B(e,t)}return e}function j(e,t){Object.getOwnPropertyNames(t).forEach(function(i){var r=t[i];if(r===null||typeof r==="undefined"||r===false){e.removeAttribute(i)}else{e.setAttribute(i,r===true?"":r)}})}function F(e){var t={};var i=","+"autoplay,controls,playsinline,loop,muted,default,defaultMuted"+",";if(e&&e.attributes&&e.attributes.length>0){var r=e.attributes;for(var n=r.length-1;n>=0;n--){var a=r[n].name;var s=r[n].value;if(typeof e[a]==="boolean"||i.indexOf(","+a+",")!==-1){s=s!==null?true:false}t[a]=s}}return t}function V(e,t){return e.getAttribute(t)}function H(e,t,i){e.setAttribute(t,i)}function q(e,t){e.removeAttribute(t)}function z(){t.body.focus();t.onselectstart=function(){return false}}function W(){t.onselectstart=function(){return true}}function G(e){if(e&&e.getBoundingClientRect&&e.parentNode){var t=e.getBoundingClientRect();var i={};["bottom","height","left","right","top","width"].forEach(function(e){if(t[e]!==undefined){i[e]=t[e]}});if(!i.height){i.height=parseFloat(k(e,"height"))}if(!i.width){i.width=parseFloat(k(e,"width"))}return i}}function X(i){var r;if(i.getBoundingClientRect&&i.parentNode){r=i.getBoundingClientRect()}if(!r){return{left:0,top:0}}var n=t.documentElement;var a=t.body;var s=n.clientLeft||a.clientLeft||0;var o=e.pageXOffset||a.scrollLeft;var u=r.left+o-s;var l=n.clientTop||a.clientTop||0;var c=e.pageYOffset||a.scrollTop;var f=r.top+c-l;return{left:Math.round(u),top:Math.round(f)}}function Y(e,t){var i={};var r=X(e);var n=e.offsetWidth;var a=e.offsetHeight;var s=r.top;var o=r.left;var u=t.pageY;var l=t.pageX;if(t.changedTouches){l=t.changedTouches[0].pageX;u=t.changedTouches[0].pageY}i.y=Math.max(0,Math.min(1,(s-u+a)/a));i.x=Math.max(0,Math.min(1,(l-o)/n));return i}function K(e){return T(e)&&e.nodeType===3}function $(e){while(e.firstChild){e.removeChild(e.firstChild)}return e}function Q(e){if(typeof e==="function"){e=e()}return(Array.isArray(e)?e:[e]).map(function(e){if(typeof e==="function"){e=e()}if(I(e)||K(e)){return e}if(typeof e==="string"&&/\S/.test(e)){return t.createTextNode(e)}}).filter(function(e){return e})}function J(e,t){Q(t).forEach(function(t){return e.appendChild(t)});return e}function Z(e,t){return J($(e),t)}function ee(e){if(e.button===undefined&&e.buttons===undefined){return true}if(e.button===0&&e.buttons===undefined){return true}if(e.button!==0||e.buttons!==1){return false}return true}var te=O("querySelector");var ie=O("querySelectorAll");var re=Object.freeze({isReal:L,isEl:I,isInFrame:P,createEl:U,textContent:D,prependTo:x,hasClass:R,addClass:M,removeClass:B,toggleClass:N,setAttributes:j,getAttributes:F,getAttribute:V,setAttribute:H,removeAttribute:q,blockTextSelection:z,unblockTextSelection:W,getBoundingClientRect:G,findPosition:X,getPointerPosition:Y,isTextNode:K,emptyEl:$,normalizeContent:Q,appendContent:J,insertContent:Z,isSingleLeftClick:ee,$:te,$$:ie});var ne=1;function ae(){return ne++}var se={};var oe="vdata"+(new Date).getTime();function ue(e){var t=e[oe];if(!t){t=e[oe]=ae()}if(!se[t]){se[t]={}}return se[t]}function le(e){var t=e[oe];if(!t){return false}return!!Object.getOwnPropertyNames(se[t]).length}function ce(e){var t=e[oe];if(!t){return}delete se[t];try{delete e[oe]}catch(t){if(e.removeAttribute){e.removeAttribute(oe)}else{e[oe]=null}}}function fe(e,t){var i=ue(e);if(i.handlers[t].length===0){delete i.handlers[t];if(e.removeEventListener){e.removeEventListener(t,i.dispatcher,false)}else if(e.detachEvent){e.detachEvent("on"+t,i.dispatcher)}}if(Object.getOwnPropertyNames(i.handlers).length<=0){delete i.handlers;delete i.dispatcher;delete i.disabled}if(Object.getOwnPropertyNames(i).length===0){ce(e)}}function de(e,t,i,r){i.forEach(function(i){e(t,i,r)})}function he(i){function r(){return true}function n(){return false}if(!i||!i.isPropagationStopped){var a=i||e.event;i={};for(var s in a){if(s!=="layerX"&&s!=="layerY"&&s!=="keyLocation"&&s!=="webkitMovementX"&&s!=="webkitMovementY"){if(!(s==="returnValue"&&a.preventDefault)){i[s]=a[s]}}}if(!i.target){i.target=i.srcElement||t}if(!i.relatedTarget){i.relatedTarget=i.fromElement===i.target?i.toElement:i.fromElement}i.preventDefault=function(){if(a.preventDefault){a.preventDefault()}i.returnValue=false;a.returnValue=false;i.defaultPrevented=true};i.defaultPrevented=false;i.stopPropagation=function(){if(a.stopPropagation){a.stopPropagation()}i.cancelBubble=true;a.cancelBubble=true;i.isPropagationStopped=r};i.isPropagationStopped=n;i.stopImmediatePropagation=function(){if(a.stopImmediatePropagation){a.stopImmediatePropagation()}i.isImmediatePropagationStopped=r;i.stopPropagation()};i.isImmediatePropagationStopped=n;if(i.clientX!==null&&i.clientX!==undefined){var o=t.documentElement;var u=t.body;i.pageX=i.clientX+(o&&o.scrollLeft||u&&u.scrollLeft||0)-(o&&o.clientLeft||u&&u.clientLeft||0);i.pageY=i.clientY+(o&&o.scrollTop||u&&u.scrollTop||0)-(o&&o.clientTop||u&&u.clientTop||0)}i.which=i.charCode||i.keyCode;if(i.button!==null&&i.button!==undefined){i.button=i.button&1?0:i.button&4?1:i.button&2?2:0}}return i}var pe=false;(function(){try{var t=Object.defineProperty({},"passive",{get:function e(){pe=true}});e.addEventListener("test",null,t);e.removeEventListener("test",null,t)}catch(e){}})();var me=["touchstart","touchmove"];function ve(e,t,i){if(Array.isArray(t)){return de(ve,e,t,i)}var r=ue(e);if(!r.handlers){r.handlers={}}if(!r.handlers[t]){r.handlers[t]=[]}if(!i.guid){i.guid=ae()}r.handlers[t].push(i);if(!r.dispatcher){r.disabled=false;r.dispatcher=function(t,i){if(r.disabled){return}t=he(t);var n=r.handlers[t.type];if(n){var a=n.slice(0);for(var s=0,o=a.length;s<o;s++){if(t.isImmediatePropagationStopped()){break}else{try{a[s].call(e,t,i)}catch(e){d.error(e)}}}}}}if(r.handlers[t].length===1){if(e.addEventListener){var n=false;if(pe&&me.indexOf(t)>-1){n={passive:true}}e.addEventListener(t,r.dispatcher,n)}else if(e.attachEvent){e.attachEvent("on"+t,r.dispatcher)}}}function ge(e,t,i){if(!le(e)){return}var r=ue(e);if(!r.handlers){return}if(Array.isArray(t)){return de(ge,e,t,i)}var n=function e(t,i){r.handlers[i]=[];fe(t,i)};if(t===undefined){for(var a in r.handlers){if(Object.prototype.hasOwnProperty.call(r.handlers||{},a)){n(e,a)}}return}var s=r.handlers[t];if(!s){return}if(!i){n(e,t);return}if(i.guid){for(var o=0;o<s.length;o++){if(s[o].guid===i.guid){s.splice(o--,1)}}}fe(e,t)}function ye(e,t,i){var r=le(e)?ue(e):{};var n=e.parentNode||e.ownerDocument;if(typeof t==="string"){t={type:t,target:e}}else if(!t.target){t.target=e}t=he(t);if(r.dispatcher){r.dispatcher.call(e,t,i)}if(n&&!t.isPropagationStopped()&&t.bubbles===true){ye.call(null,n,t,i)}else if(!n&&!t.defaultPrevented&&t.target&&t.target[t.type]){var a=ue(t.target);if(t.target[t.type]){a.disabled=true;if(typeof t.target[t.type]==="function"){t.target[t.type]()}a.disabled=false}}return!t.defaultPrevented}function _e(e,t,i){if(Array.isArray(t)){return de(_e,e,t,i)}var r=function r(){ge(e,t,r);i.apply(this,arguments)};r.guid=i.guid=i.guid||ae();ve(e,t,r)}var be=Object.freeze({fixEvent:he,on:ve,off:ge,trigger:ye,one:_e});var Te=false;var Se;var ke=function e(){if(!L()||Se.options.autoSetup===false){return}var i=Array.prototype.slice.call(t.getElementsByTagName("video"));var r=Array.prototype.slice.call(t.getElementsByTagName("audio"));var n=Array.prototype.slice.call(t.getElementsByTagName("video-js"));var a=i.concat(r,n);if(a&&a.length>0){for(var s=0,o=a.length;s<o;s++){var u=a[s];if(u&&u.getAttribute){if(u.player===undefined){var l=u.getAttribute("data-setup");if(l!==null){Se(u)}}}else{we(1);break}}}else if(!Te){we(1)}};function we(t,i){if(i){Se=i}e.setTimeout(ke,t)}if(L()&&t.readyState==="complete"){Te=true}else{_e(e,"load",function(){Te=true})}var Ce=function e(i){var r=t.createElement("style");r.className=i;return r};var Ee=function e(t,i){if(t.styleSheet){t.styleSheet.cssText=i}else{t.textContent=i}};var Ae=function e(t,i,r){if(!i.guid){i.guid=ae()}var n=function e(){return i.apply(t,arguments)};n.guid=r?r+"_"+i.guid:i.guid;return n};var Le=function e(t,i){var r=Date.now();var n=function e(){var n=Date.now();if(n-r>=i){t.apply(void 0,arguments);r=n}};return n};var Ie=function t(i,r,n,a){if(a===void 0){a=e}var s;var o=function e(){a.clearTimeout(s);s=null};var u=function e(){var t=this;var o=arguments;var u=function e(){s=null;u=null;if(!n){i.apply(t,o)}};if(!s&&n){i.apply(t,o)}a.clearTimeout(s);s=a.setTimeout(u,r)};u.cancel=o;return u};var Pe=function e(){};Pe.prototype.allowedEvents_={};Pe.prototype.on=function(e,t){var i=this.addEventListener;this.addEventListener=function(){};ve(this,e,t);this.addEventListener=i};Pe.prototype.addEventListener=Pe.prototype.on;Pe.prototype.off=function(e,t){ge(this,e,t)};Pe.prototype.removeEventListener=Pe.prototype.off;Pe.prototype.one=function(e,t){var i=this.addEventListener;this.addEventListener=function(){};_e(this,e,t);this.addEventListener=i};Pe.prototype.trigger=function(e){var t=e.type||e;if(typeof e==="string"){e={type:t}}e=he(e);if(this.allowedEvents_[t]&&this["on"+t]){this["on"+t](e)}ye(this,e)};Pe.prototype.dispatchEvent=Pe.prototype.trigger;var Oe;Pe.prototype.queueTrigger=function(t){var i=this;if(!Oe){Oe=new Map}var r=t.type||t;var n=Oe.get(this);if(!n){n=new Map;Oe.set(this,n)}var a=n.get(r);n.delete(r);e.clearTimeout(a);var s=e.setTimeout(function(){if(n.size===0){n=null;Oe.delete(i)}i.trigger(t)},0);n.set(r,s)};var Ue=function e(t){return t instanceof Pe||!!t.eventBusEl_&&["on","one","off","trigger"].every(function(e){return typeof t[e]==="function"})};var De=function e(t,i){if(Ue(t)){i()}else{if(!t.eventedCallbacks){t.eventedCallbacks=[]}t.eventedCallbacks.push(i)}};var xe=function e(t){return typeof t==="string"&&/\S/.test(t)||Array.isArray(t)&&!!t.length};var Re=function e(t){if(!t.nodeName&&!Ue(t)){throw new Error("Invalid target; must be a DOM node or evented object.")}};var Me=function e(t){if(!xe(t)){throw new Error("Invalid event type; must be a non-empty string or array.")}};var Be=function e(t){if(typeof t!=="function"){throw new Error("Invalid listener; must be a function.")}};var Ne=function e(t,i){var r=i.length<3||i[0]===t||i[0]===t.eventBusEl_;var n;var a;var s;if(r){n=t.eventBusEl_;if(i.length>=3){i.shift()}a=i[0];s=i[1]}else{n=i[0];a=i[1];s=i[2]}Re(n);Me(a);Be(s);s=Ae(t,s);return{isTargetingSelf:r,target:n,type:a,listener:s}};var je=function e(t,i,r,n){Re(t);if(t.nodeName){be[i](t,r,n)}else{t[i](r,n)}};var Fe={on:function e(){var t=this;for(var i=arguments.length,r=new Array(i),n=0;n<i;n++){r[n]=arguments[n]}var a=Ne(this,r),s=a.isTargetingSelf,o=a.target,u=a.type,l=a.listener;je(o,"on",u,l);if(!s){var c=function e(){return t.off(o,u,l)};c.guid=l.guid;var f=function e(){return t.off("dispose",c)};f.guid=l.guid;je(this,"on","dispose",c);je(o,"on","dispose",f)}},one:function e(){var t=this;for(var i=arguments.length,r=new Array(i),n=0;n<i;n++){r[n]=arguments[n]}var a=Ne(this,r),s=a.isTargetingSelf,o=a.target,u=a.type,l=a.listener;if(s){je(o,"one",u,l)}else{var c=function e(){t.off(o,u,e);for(var i=arguments.length,r=new Array(i),n=0;n<i;n++){r[n]=arguments[n]}l.apply(null,r)};c.guid=l.guid;je(o,"one",u,c)}},off:function e(t,i,r){if(!t||xe(t)){ge(this.eventBusEl_,t,i)}else{var n=t;var a=i;Re(n);Me(a);Be(r);r=Ae(this,r);this.off("dispose",r);if(n.nodeName){ge(n,a,r);ge(n,"dispose",r)}else if(Ue(n)){n.off(a,r);n.off("dispose",r)}}},trigger:function e(t,i){return ye(this.eventBusEl_,t,i)}};function Ve(t,i){if(i===void 0){i={}}var r=i,n=r.eventBusKey;if(n){if(!t[n].nodeName){throw new Error('The eventBusKey "'+n+'" does not refer to an element.')}t.eventBusEl_=t[n]}else{t.eventBusEl_=U("span",{className:"vjs-event-bus"})}b(t,Fe);if(t.eventedCallbacks){t.eventedCallbacks.forEach(function(e){e()})}t.on("dispose",function(){t.off();e.setTimeout(function(){t.eventBusEl_=null},0)});return t}var He={state:{},setState:function e(t){var i=this;if(typeof t==="function"){t=t()}var r;y(t,function(e,t){if(i.state[t]!==e){r=r||{};r[t]={from:i.state[t],to:e}}i.state[t]=e});if(r&&Ue(this)){this.trigger({changes:r,type:"statechanged"})}return r}};function qe(e,t){b(e,He);e.state=b({},e.state,t);if(typeof e.handleStateChanged==="function"&&Ue(e)){e.on("statechanged",e.handleStateChanged)}return e}function ze(e){if(typeof e!=="string"){return e}return e.charAt(0).toUpperCase()+e.slice(1)}function We(e,t){return ze(e)===ze(t)}function Ge(){var e={};for(var t=arguments.length,i=new Array(t),r=0;r<t;r++){i[r]=arguments[r]}i.forEach(function(t){if(!t){return}y(t,function(t,i){if(!S(t)){e[i]=t;return}if(!S(e[i])){e[i]={}}e[i]=Ge(e[i],t)})});return e}var Xe=function(){function t(e,t,i){if(!e&&this.play){this.player_=e=this}else{this.player_=e}this.parentComponent_=null;this.options_=Ge({},this.options_);t=this.options_=Ge(this.options_,t);this.id_=t.id||t.el&&t.el.id;if(!this.id_){var r=e&&e.id&&e.id()||"no_player";this.id_=r+"_component_"+ae()}this.name_=t.name||null;if(t.el){this.el_=t.el}else if(t.createEl!==false){this.el_=this.createEl()}if(t.evented!==false){Ve(this,{eventBusKey:this.el_?"el_":null})}qe(this,this.constructor.defaultState);this.children_=[];this.childIndex_={};this.childNameIndex_={};if(t.initChildren!==false){this.initChildren()}this.ready(i);if(t.reportTouchActivity!==false){this.enableTouchActivity()}}var i=t.prototype;i.dispose=function e(){this.trigger({type:"dispose",bubbles:false});if(this.children_){for(var t=this.children_.length-1;t>=0;t--){if(this.children_[t].dispose){this.children_[t].dispose()}}}this.children_=null;this.childIndex_=null;this.childNameIndex_=null;this.parentComponent_=null;if(this.el_){if(this.el_.parentNode){this.el_.parentNode.removeChild(this.el_)}ce(this.el_);this.el_=null}this.player_=null};i.player=function e(){return this.player_};i.options=function e(t){d.warn("this.options() has been deprecated and will be moved to the constructor in 6.0");if(!t){return this.options_}this.options_=Ge(this.options_,t);return this.options_};i.el=function e(){return this.el_};i.createEl=function e(t,i,r){return U(t,i,r)};i.localize=function e(t,i,r){if(r===void 0){r=t}var n=this.player_.language&&this.player_.language();var a=this.player_.languages&&this.player_.languages();var s=a&&a[n];var o=n&&n.split("-")[0];var u=a&&a[o];var l=r;if(s&&s[t]){l=s[t]}else if(u&&u[t]){l=u[t]}if(i){l=l.replace(/\{(\d+)\}/g,function(e,t){var r=i[t-1];var n=r;if(typeof r==="undefined"){n=e}return n})}return l};i.contentEl=function e(){return this.contentEl_||this.el_};i.id=function e(){return this.id_};i.name=function e(){return this.name_};i.children=function e(){return this.children_};i.getChildById=function e(t){return this.childIndex_[t]};i.getChild=function e(t){if(!t){return}t=ze(t);return this.childNameIndex_[t]};i.addChild=function e(i,r,n){if(r===void 0){r={}}if(n===void 0){n=this.children_.length}var a;var s;if(typeof i==="string"){s=ze(i);var o=r.componentClass||s;r.name=s;var u=t.getComponent(o);if(!u){throw new Error("Component "+o+" does not exist")}if(typeof u!=="function"){return null}a=new u(this.player_||this,r)}else{a=i}if(a.parentComponent_){a.parentComponent_.removeChild(a)}this.children_.splice(n,0,a);a.parentComponent_=this;if(typeof a.id==="function"){this.childIndex_[a.id()]=a}s=s||a.name&&ze(a.name());if(s){this.childNameIndex_[s]=a}if(typeof a.el==="function"&&a.el()){var l=this.contentEl().children;var c=l[n]||null;this.contentEl().insertBefore(a.el(),c)}return a};i.removeChild=function e(t){if(typeof t==="string"){t=this.getChild(t)}if(!t||!this.children_){return}var i=false;for(var r=this.children_.length-1;r>=0;r--){if(this.children_[r]===t){i=true;this.children_.splice(r,1);break}}if(!i){return}t.parentComponent_=null;this.childIndex_[t.id()]=null;this.childNameIndex_[t.name()]=null;var n=t.el();if(n&&n.parentNode===this.contentEl()){this.contentEl().removeChild(t.el())}};i.initChildren=function e(){var i=this;var r=this.options_.children;if(r){var n=this.options_;var a=function e(t){var r=t.name;var a=t.opts;if(n[r]!==undefined){a=n[r]}if(a===false){return}if(a===true){a={}}a.playerOptions=i.options_.playerOptions;var s=i.addChild(r,a);if(s){i[r]=s}};var s;var o=t.getComponent("Tech");if(Array.isArray(r)){s=r}else{s=Object.keys(r)}s.concat(Object.keys(this.options_).filter(function(e){return!s.some(function(t){if(typeof t==="string"){return e===t}return e===t.name})})).map(function(e){var t;var n;if(typeof e==="string"){t=e;n=r[t]||i.options_[t]||{}}else{t=e.name;n=e}return{name:t,opts:n}}).filter(function(e){var i=t.getComponent(e.opts.componentClass||ze(e.name));return i&&!o.isTech(i)}).forEach(a)}};i.buildCSSClass=function e(){return""};i.ready=function e(t,i){if(i===void 0){i=false}if(!t){return}if(!this.isReady_){this.readyQueue_=this.readyQueue_||[];this.readyQueue_.push(t);return}if(i){t.call(this)}else{this.setTimeout(t,1)}};i.triggerReady=function e(){this.isReady_=true;this.setTimeout(function(){var e=this.readyQueue_;this.readyQueue_=[];if(e&&e.length>0){e.forEach(function(e){e.call(this)},this)}this.trigger("ready")},1)};i.$=function e(t,i){return te(t,i||this.contentEl())};i.$$=function e(t,i){return ie(t,i||this.contentEl())};i.hasClass=function e(t){return R(this.el_,t)};i.addClass=function e(t){M(this.el_,t)};i.removeClass=function e(t){B(this.el_,t)};i.toggleClass=function e(t,i){N(this.el_,t,i)};i.show=function e(){this.removeClass("vjs-hidden")};i.hide=function e(){this.addClass("vjs-hidden")};i.lockShowing=function e(){this.addClass("vjs-lock-showing")};i.unlockShowing=function e(){this.removeClass("vjs-lock-showing")};i.getAttribute=function e(t){return V(this.el_,t)};i.setAttribute=function e(t,i){H(this.el_,t,i)};i.removeAttribute=function e(t){q(this.el_,t)};i.width=function e(t,i){return this.dimension("width",t,i)};i.height=function e(t,i){return this.dimension("height",t,i)};i.dimensions=function e(t,i){this.width(t,true);this.height(i)};i.dimension=function e(t,i,r){if(i!==undefined){if(i===null||i!==i){i=0}if((""+i).indexOf("%")!==-1||(""+i).indexOf("px")!==-1){this.el_.style[t]=i}else if(i==="auto"){this.el_.style[t]=""}else{this.el_.style[t]=i+"px"}if(!r){this.trigger("componentresize")}return}if(!this.el_){return 0}var n=this.el_.style[t];var a=n.indexOf("px");if(a!==-1){return parseInt(n.slice(0,a),10)}return parseInt(this.el_["offset"+ze(t)],10)};i.currentDimension=function t(i){var r=0;if(i!=="width"&&i!=="height"){throw new Error("currentDimension only accepts width or height value")}if(typeof e.getComputedStyle==="function"){var n=e.getComputedStyle(this.el_);r=n.getPropertyValue(i)||n[i]}r=parseFloat(r);if(r===0){var a="offset"+ze(i);r=this.el_[a]}return r};i.currentDimensions=function e(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}};i.currentWidth=function e(){return this.currentDimension("width")};i.currentHeight=function e(){return this.currentDimension("height")};i.focus=function e(){this.el_.focus()};i.blur=function e(){this.el_.blur()};i.handleKeyPress=function e(t){if(this.player_){this.player_.handleKeyPress(t)}};i.emitTapEvents=function e(){var t=0;var i=null;var r=10;var n=200;var a;this.on("touchstart",function(e){if(e.touches.length===1){i={pageX:e.touches[0].pageX,pageY:e.touches[0].pageY};t=(new Date).getTime();a=true}});this.on("touchmove",function(e){if(e.touches.length>1){a=false}else if(i){var t=e.touches[0].pageX-i.pageX;var n=e.touches[0].pageY-i.pageY;var s=Math.sqrt(t*t+n*n);if(s>r){a=false}}});var s=function e(){a=false};this.on("touchleave",s);this.on("touchcancel",s);this.on("touchend",function(e){i=null;if(a===true){var r=(new Date).getTime()-t;if(r<n){e.preventDefault();this.trigger("tap")}}})};i.enableTouchActivity=function e(){if(!this.player()||!this.player().reportUserActivity){return}var t=Ae(this.player(),this.player().reportUserActivity);var i;this.on("touchstart",function(){t();this.clearInterval(i);i=this.setInterval(t,250)});var r=function e(r){t();this.clearInterval(i)};this.on("touchmove",t);this.on("touchend",r);this.on("touchcancel",r)};i.setTimeout=function t(i,r){var n=this;var a,s;i=Ae(this,i);a=e.setTimeout(function(){n.off("dispose",s);i()},r);s=function e(){return n.clearTimeout(a)};s.guid="vjs-timeout-"+a;this.on("dispose",s);return a};i.clearTimeout=function t(i){e.clearTimeout(i);var r=function e(){};r.guid="vjs-timeout-"+i;this.off("dispose",r);return i};i.setInterval=function t(i,r){var n=this;i=Ae(this,i);var a=e.setInterval(i,r);var s=function e(){return n.clearInterval(a)};s.guid="vjs-interval-"+a;this.on("dispose",s);return a};i.clearInterval=function t(i){e.clearInterval(i);var r=function e(){};r.guid="vjs-interval-"+i;this.off("dispose",r);return i};i.requestAnimationFrame=function t(i){var r=this;var n,a;if(this.supportsRaf_){i=Ae(this,i);n=e.requestAnimationFrame(function(){r.off("dispose",a);i()});a=function e(){return r.cancelAnimationFrame(n)};a.guid="vjs-raf-"+n;this.on("dispose",a);return n}return this.setTimeout(i,1e3/60)};i.cancelAnimationFrame=function t(i){if(this.supportsRaf_){e.cancelAnimationFrame(i);var r=function e(){};r.guid="vjs-raf-"+i;this.off("dispose",r);return i}return this.clearTimeout(i)};t.registerComponent=function e(i,r){if(typeof i!=="string"||!i){throw new Error('Illegal component name, "'+i+'"; must be a non-empty string.')}var n=t.getComponent("Tech");var a=n&&n.isTech(r);var s=t===r||t.prototype.isPrototypeOf(r.prototype);if(a||!s){var o;if(a){o="techs must be registered using Tech.registerTech()"}else{o="must be a Component subclass"}throw new Error('Illegal component, "'+i+'"; '+o+".")}i=ze(i);if(!t.components_){t.components_={}}var u=t.getComponent("Player");if(i==="Player"&&u&&u.players){var l=u.players;var c=Object.keys(l);if(l&&c.length>0&&c.map(function(e){return l[e]}).every(Boolean)){throw new Error("Can not register Player component after player has been created.")}}t.components_[i]=r;return r};t.getComponent=function e(i){if(!i){return}i=ze(i);if(t.components_&&t.components_[i]){return t.components_[i]}};return t}();Xe.prototype.supportsRaf_=typeof e.requestAnimationFrame==="function"&&typeof e.cancelAnimationFrame==="function";Xe.registerComponent("Component",Xe);var Ye=e.navigator&&e.navigator.userAgent||"";var Ke=/AppleWebKit\/([\d.]+)/i.exec(Ye);var $e=Ke?parseFloat(Ke.pop()):null;var Qe=/iPad/i.test(Ye);var Je=/iPhone/i.test(Ye)&&!Qe;var Ze=/iPod/i.test(Ye);var et=Je||Qe||Ze;var tt=function(){var e=Ye.match(/OS (\d+)_/i);if(e&&e[1]){return e[1]}return null}();var it=/Android/i.test(Ye);var rt=function(){var e=Ye.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e){return null}var t=e[1]&&parseFloat(e[1]);var i=e[2]&&parseFloat(e[2]);if(t&&i){return parseFloat(e[1]+"."+e[2])}else if(t){return t}return null}();var nt=it&&rt<5&&$e<537;var at=/Firefox/i.test(Ye);var st=/Edge/i.test(Ye);var ot=!st&&(/Chrome/i.test(Ye)||/CriOS/i.test(Ye));var ut=function(){var e=Ye.match(/(Chrome|CriOS)\/(\d+)/);if(e&&e[2]){return parseFloat(e[2])}return null}();var lt=function(){var e=/MSIE\s(\d+)\.\d/.exec(Ye);var t=e&&parseFloat(e[1]);if(!t&&/Trident\/7.0/i.test(Ye)&&/rv:11.0/.test(Ye)){t=11}return t}();var ct=/Safari/i.test(Ye)&&!ot&&!it&&!st;var ft=(ct||et)&&!ot;var dt=L()&&("ontouchstart"in e||e.navigator.maxTouchPoints||e.DocumentTouch&&e.document instanceof e.DocumentTouch);var ht=Object.freeze({IS_IPAD:Qe,IS_IPHONE:Je,IS_IPOD:Ze,IS_IOS:et,IOS_VERSION:tt,IS_ANDROID:it,ANDROID_VERSION:rt,IS_NATIVE_ANDROID:nt,IS_FIREFOX:at,IS_EDGE:st,IS_CHROME:ot,CHROME_VERSION:ut,IE_VERSION:lt,IS_SAFARI:ct,IS_ANY_SAFARI:ft,TOUCH_ENABLED:dt});function pt(e,t,i){if(typeof t!=="number"||t<0||t>i){throw new Error("Failed to execute '"+e+"' on 'TimeRanges': The index provided ("+t+") is non-numeric or out of bounds (0-"+i+").")}}function mt(e,t,i,r){pt(e,r,i.length-1);return i[r][t]}function vt(e){if(e===undefined||e.length===0){return{length:0,start:function e(){throw new Error("This TimeRanges object is empty")},end:function e(){throw new Error("This TimeRanges object is empty")}}}return{length:e.length,start:mt.bind(null,"start",0,e),end:mt.bind(null,"end",1,e)}}function gt(e,t){if(Array.isArray(e)){return vt(e)}else if(e===undefined||t===undefined){return vt()}return vt([[e,t]])}function yt(e,t){var i=0;var r;var n;if(!t){return 0}if(!e||!e.length){e=gt(0,0)}for(var a=0;a<e.length;a++){r=e.start(a);n=e.end(a);if(n>t){n=t}i+=n-r}return i/t}var _t={};var bt=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror","-moz-full-screen"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError","-ms-fullscreen"]];var Tt=bt[0];var St;var kt=false;for(var wt=0;wt<bt.length;wt++){if(bt[wt][1]in t){St=bt[wt];break}}if(St){for(var Ct=0;Ct<St.length;Ct++){_t[Tt[Ct]]=St[Ct]}kt=St[0]===Tt[0]}function Et(e){if(e instanceof Et){return e}if(typeof e==="number"){this.code=e}else if(typeof e==="string"){this.message=e}else if(T(e)){if(typeof e.code==="number"){this.code=e.code}b(this,e)}if(!this.message){this.message=Et.defaultMessages[this.code]||""}}Et.prototype.code=0;Et.prototype.message="";Et.prototype.status=null;Et.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"];Et.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 At=0;At<Et.errorTypes.length;At++){Et[Et.errorTypes[At]]=At;Et.prototype[Et.errorTypes[At]]=At}var Lt=It;function It(e,t){var i;var r=null;try{i=JSON.parse(e,t)}catch(e){r=e}return[r,i]}function Pt(e){return e!==undefined&&e!==null&&typeof e.then==="function"}function Ot(e){if(Pt(e)){e.then(null,function(e){})}}var Ut=function e(t){var i=["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce(function(e,i,r){if(t[i]){e[i]=t[i]}return e},{cues:t.cues&&Array.prototype.map.call(t.cues,function(e){return{startTime:e.startTime,endTime:e.endTime,text:e.text,id:e.id}})});return i};var Dt=function e(t){var i=t.$$("track");var r=Array.prototype.map.call(i,function(e){return e.track});var n=Array.prototype.map.call(i,function(e){var t=Ut(e.track);if(e.src){t.src=e.src}return t});return n.concat(Array.prototype.filter.call(t.textTracks(),function(e){return r.indexOf(e)===-1}).map(Ut))};var xt=function e(t,i){t.forEach(function(e){var t=i.addRemoteTextTrack(e).track;if(!e.src&&e.cues){e.cues.forEach(function(e){return t.addCue(e)})}});return i.textTracks()};var Rt={textTracksToJson:Dt,jsonToTextTracks:xt,trackToJson_:Ut};var Mt=typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};function Bt(e,t){return t={exports:{}},e(t,t.exports),t.exports}var Nt=Bt(function(e,t){function i(e){if(e&&"object"===typeof e){var t=e.which||e.keyCode||e.charCode;if(t)e=t}if("number"===typeof e)return s[e];var i=String(e);var a=r[i.toLowerCase()];if(a)return a;var a=n[i.toLowerCase()];if(a)return a;if(i.length===1)return i.charCodeAt(0);return undefined}i.isEventKey=function e(t,i){if(t&&"object"===typeof t){var a=t.which||t.keyCode||t.charCode;if(a===null||a===undefined){return false}if(typeof i==="string"){var s=r[i.toLowerCase()];if(s){return s===a}var s=n[i.toLowerCase()];if(s){return s===a}}else if(typeof i==="number"){return i===a}return false}};t=e.exports=i;var r=t.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};var n=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(a=97;a<123;a++){r[String.fromCharCode(a)]=a-32}for(var a=48;a<58;a++){r[a-48]=a}for(a=1;a<13;a++){r["f"+a]=a+111}for(a=0;a<10;a++){r["numpad "+a]=a+96}var s=t.names=t.title={};for(a in r){s[r[a]]=a}for(var o in n){r[o]=n[o]}});var jt=Nt.code;var Ft=Nt.codes;var Vt=Nt.aliases;var Ht=Nt.names;var qt=Nt.title;var zt="vjs-modal-dialog";var Wt=function(i){r(n,i);function n(e,t){var r;r=i.call(this,e,t)||this;r.opened_=r.hasBeenOpened_=r.hasBeenFilled_=false;r.closeable(!r.options_.uncloseable);r.content(r.options_.content);r.contentEl_=U("div",{className:zt+"-content"},{role:"document"});r.descEl_=U("p",{className:zt+"-description vjs-control-text",id:r.el().getAttribute("aria-describedby")});D(r.descEl_,r.description());r.el_.appendChild(r.descEl_);r.el_.appendChild(r.contentEl_);return r}var a=n.prototype;a.createEl=function e(){return i.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":this.id()+"_description","aria-hidden":"true","aria-label":this.label(),role:"dialog"})};a.dispose=function e(){this.contentEl_=null;this.descEl_=null;this.previouslyActiveEl_=null;i.prototype.dispose.call(this)};a.buildCSSClass=function e(){return zt+" vjs-hidden "+i.prototype.buildCSSClass.call(this)};a.handleKeyPress=function e(t){if(Nt.isEventKey(t,"Escape")&&this.closeable()){this.close()}};a.label=function e(){return this.localize(this.options_.label||"Modal Window")};a.description=function e(){var t=this.options_.description||this.localize("This is a modal window.");if(this.closeable()){t+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")}return t};a.open=function e(){if(!this.opened_){var t=this.player();this.trigger("beforemodalopen");this.opened_=true;if(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_){this.fill()}this.wasPlaying_=!t.paused();if(this.options_.pauseOnOpen&&this.wasPlaying_){t.pause()}if(this.closeable()){this.on(this.el_.ownerDocument,"keydown",Ae(this,this.handleKeyPress))}this.hadControls_=t.controls();t.controls(false);this.show();this.conditionalFocus_();this.el().setAttribute("aria-hidden","false");this.trigger("modalopen");this.hasBeenOpened_=true}};a.opened=function e(t){if(typeof t==="boolean"){this[t?"open":"close"]()}return this.opened_};a.close=function e(){if(!this.opened_){return}var t=this.player();this.trigger("beforemodalclose");this.opened_=false;if(this.wasPlaying_&&this.options_.pauseOnOpen){t.play()}if(this.closeable()){this.off(this.el_.ownerDocument,"keydown",Ae(this,this.handleKeyPress))}if(this.hadControls_){t.controls(true)}this.hide();this.el().setAttribute("aria-hidden","true");this.trigger("modalclose");this.conditionalBlur_();if(this.options_.temporary){this.dispose()}};a.closeable=function e(t){if(typeof t==="boolean"){var e=this.closeable_=!!t;var i=this.getChild("closeButton");if(e&&!i){var r=this.contentEl_;this.contentEl_=this.el_;i=this.addChild("closeButton",{controlText:"Close Modal Dialog"});this.contentEl_=r;this.on(i,"close",this.close)}if(!e&&i){this.off(i,"close",this.close);this.removeChild(i);i.dispose()}}return this.closeable_};a.fill=function e(){this.fillWith(this.content())};a.fillWith=function e(t){var i=this.contentEl();var r=i.parentNode;var n=i.nextSibling;this.trigger("beforemodalfill");this.hasBeenFilled_=true;r.removeChild(i);this.empty();Z(i,t);this.trigger("modalfill");if(n){r.insertBefore(i,n)}else{r.appendChild(i)}var a=this.getChild("closeButton");if(a){r.appendChild(a.el_)}};a.empty=function e(){this.trigger("beforemodalempty");$(this.contentEl());this.trigger("modalempty")};a.content=function e(t){if(typeof t!=="undefined"){this.content_=t}return this.content_};a.conditionalFocus_=function e(){var i=t.activeElement;var r=this.player_.el_;this.previouslyActiveEl_=null;if(r.contains(i)||r===i){this.previouslyActiveEl_=i;this.focus();this.on(t,"keydown",this.handleKeyDown)}};a.conditionalBlur_=function e(){if(this.previouslyActiveEl_){this.previouslyActiveEl_.focus();this.previouslyActiveEl_=null}this.off(t,"keydown",this.handleKeyDown)};a.handleKeyDown=function e(i){if(!Nt.isEventKey(i,"Tab")){return}var r=this.focusableEls_();var n=this.el_.querySelector(":focus");var a;for(var s=0;s<r.length;s++){if(n===r[s]){a=s;break}}if(t.activeElement===this.el_){a=0}if(i.shiftKey&&a===0){r[r.length-1].focus();i.preventDefault()}else if(!i.shiftKey&&a===r.length-1){r[0].focus();i.preventDefault()}};a.focusableEls_=function t(){var i=this.el_.querySelectorAll("*");return Array.prototype.filter.call(i,function(t){return(t instanceof e.HTMLAnchorElement||t instanceof e.HTMLAreaElement)&&t.hasAttribute("href")||(t instanceof e.HTMLInputElement||t instanceof e.HTMLSelectElement||t instanceof e.HTMLTextAreaElement||t instanceof e.HTMLButtonElement)&&!t.hasAttribute("disabled")||t instanceof e.HTMLIFrameElement||t instanceof e.HTMLObjectElement||t instanceof e.HTMLEmbedElement||t.hasAttribute("tabindex")&&t.getAttribute("tabindex")!==-1||t.hasAttribute("contenteditable")})};return n}(Xe);Wt.prototype.options_={pauseOnOpen:true,temporary:true};Xe.registerComponent("ModalDialog",Wt);var Gt=function(e){r(t,e);function t(t){var i;if(t===void 0){t=[]}i=e.call(this)||this;i.tracks_=[];Object.defineProperty(o(o(i)),"length",{get:function e(){return this.tracks_.length}});for(var r=0;r<t.length;r++){i.addTrack(t[r])}return i}var i=t.prototype;i.addTrack=function e(t){var i=this.tracks_.length;if(!(""+i in this)){Object.defineProperty(this,i,{get:function e(){return this.tracks_[i]}})}if(this.tracks_.indexOf(t)===-1){this.tracks_.push(t);this.trigger({track:t,type:"addtrack",target:this})}};i.removeTrack=function e(t){var i;for(var r=0,n=this.length;r<n;r++){if(this[r]===t){i=this[r];if(i.off){i.off()}this.tracks_.splice(r,1);break}}if(!i){return}this.trigger({track:i,type:"removetrack",target:this})};i.getTrackById=function e(t){var i=null;for(var r=0,n=this.length;r<n;r++){var a=this[r];if(a.id===t){i=a;break}}return i};return t}(Pe);Gt.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack"};for(var Xt in Gt.prototype.allowedEvents_){Gt.prototype["on"+Xt]=null}var Yt=function e(t,i){for(var r=0;r<t.length;r++){if(!Object.keys(t[r]).length||i.id===t[r].id){continue}t[r].enabled=false}};var Kt=function(e){r(t,e);function t(t){var i;if(t===void 0){t=[]}for(var r=t.length-1;r>=0;r--){if(t[r].enabled){Yt(t,t[r]);break}}i=e.call(this,t)||this;i.changing_=false;return i}var i=t.prototype;i.addTrack=function t(i){var r=this;if(i.enabled){Yt(this,i)}e.prototype.addTrack.call(this,i);if(!i.addEventListener){return}i.enabledChange_=function(){if(r.changing_){return}r.changing_=true;Yt(r,i);r.changing_=false;r.trigger("change")};i.addEventListener("enabledchange",i.enabledChange_)};i.removeTrack=function t(i){e.prototype.removeTrack.call(this,i);if(i.removeEventListener&&i.enabledChange_){i.removeEventListener("enabledchange",i.enabledChange_);i.enabledChange_=null}};return t}(Gt);var $t=function e(t,i){for(var r=0;r<t.length;r++){if(!Object.keys(t[r]).length||i.id===t[r].id){continue}t[r].selected=false}};var Qt=function(e){r(t,e);function t(t){var i;if(t===void 0){t=[]}for(var r=t.length-1;r>=0;r--){if(t[r].selected){$t(t,t[r]);break}}i=e.call(this,t)||this;i.changing_=false;Object.defineProperty(o(o(i)),"selectedIndex",{get:function e(){for(var t=0;t<this.length;t++){if(this[t].selected){return t}}return-1},set:function e(){}});return i}var i=t.prototype;i.addTrack=function t(i){var r=this;if(i.selected){$t(this,i)}e.prototype.addTrack.call(this,i);if(!i.addEventListener){return}i.selectedChange_=function(){if(r.changing_){return}r.changing_=true;$t(r,i);r.changing_=false;r.trigger("change")};i.addEventListener("selectedchange",i.selectedChange_)};i.removeTrack=function t(i){e.prototype.removeTrack.call(this,i);if(i.removeEventListener&&i.selectedChange_){i.removeEventListener("selectedchange",i.selectedChange_);i.selectedChange_=null}};return t}(Gt);var Jt=function(e){r(t,e);function t(){return e.apply(this,arguments)||this}var i=t.prototype;i.addTrack=function t(i){var r=this;e.prototype.addTrack.call(this,i);if(!this.queueChange_){this.queueChange_=function(){return r.queueTrigger("change")}}if(!this.triggerSelectedlanguagechange){this.triggerSelectedlanguagechange_=function(){return r.trigger("selectedlanguagechange")}}i.addEventListener("modechange",this.queueChange_);var n=["metadata","chapters"];if(n.indexOf(i.kind)===-1){i.addEventListener("modechange",this.triggerSelectedlanguagechange_)}};i.removeTrack=function t(i){e.prototype.removeTrack.call(this,i);if(i.removeEventListener){if(this.queueChange_){i.removeEventListener("modechange",this.queueChange_)}if(this.selectedlanguagechange_){i.removeEventListener("modechange",this.triggerSelectedlanguagechange_)}}};return t}(Gt);var Zt=function(){function e(e){if(e===void 0){e=[]}this.trackElements_=[];Object.defineProperty(this,"length",{get:function e(){return this.trackElements_.length}});for(var t=0,i=e.length;t<i;t++){this.addTrackElement_(e[t])}}var t=e.prototype;t.addTrackElement_=function e(t){var i=this.trackElements_.length;if(!(""+i in this)){Object.defineProperty(this,i,{get:function e(){return this.trackElements_[i]}})}if(this.trackElements_.indexOf(t)===-1){this.trackElements_.push(t)}};t.getTrackElementByTrack_=function e(t){var i;for(var r=0,n=this.trackElements_.length;r<n;r++){if(t===this.trackElements_[r].track){i=this.trackElements_[r];break}}return i};t.removeTrackElement_=function e(t){for(var i=0,r=this.trackElements_.length;i<r;i++){if(t===this.trackElements_[i]){if(this.trackElements_[i].track&&typeof this.trackElements_[i].track.off==="function"){this.trackElements_[i].track.off()}if(typeof this.trackElements_[i].off==="function"){this.trackElements_[i].off()}this.trackElements_.splice(i,1);break}}};return e}();var ei=function(){function e(t){e.prototype.setCues_.call(this,t);Object.defineProperty(this,"length",{get:function e(){return this.length_}})}var t=e.prototype;t.setCues_=function e(t){var i=this.length||0;var r=0;var n=t.length;this.cues_=t;this.length_=t.length;var a=function e(t){if(!(""+t in this)){Object.defineProperty(this,""+t,{get:function e(){return this.cues_[t]}})}};if(i<n){r=i;for(;r<n;r++){a.call(this,r)}}};t.getCueById=function e(t){var i=null;for(var r=0,n=this.length;r<n;r++){var a=this[r];if(a.id===t){i=a;break}}return i};return e}();var ti={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"};var ii={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"};var ri={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"};var ni={disabled:"disabled",hidden:"hidden",showing:"showing"};var ai=function(e){r(t,e);function t(t){var i;if(t===void 0){t={}}i=e.call(this)||this;var r={id:t.id||"vjs_track_"+ae(),kind:t.kind||"",label:t.label||"",language:t.language||""};var n=function e(t){Object.defineProperty(o(o(i)),t,{get:function e(){return r[t]},set:function e(){}})};for(var a in r){n(a)}return i}return t}(Pe);var si=function i(r){var n=["protocol","hostname","port","pathname","search","hash","host"];var a=t.createElement("a");a.href=r;var s=a.host===""&&a.protocol!=="file:";var o;if(s){o=t.createElement("div");o.innerHTML='<a href="'+r+'"></a>';a=o.firstChild;o.setAttribute("style","display:none; position:absolute;");t.body.appendChild(o)}var u={};for(var l=0;l<n.length;l++){u[n[l]]=a[n[l]]}if(u.protocol==="http:"){u.host=u.host.replace(/:80$/,"")}if(u.protocol==="https:"){u.host=u.host.replace(/:443$/,"")}if(!u.protocol){u.protocol=e.location.protocol}if(s){t.body.removeChild(o)}return u};var oi=function e(i){if(!i.match(/^https?:\/\//)){var r=t.createElement("div");r.innerHTML='<a href="'+i+'">x</a>';i=r.firstChild.href}return i};var ui=function e(t){if(typeof t==="string"){var i=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/i;var r=i.exec(t);if(r){return r.pop().toLowerCase()}}return""};var li=function t(i){var r=e.location;var n=si(i);var a=n.protocol===":"?r.protocol:n.protocol;var s=a+n.host!==r.protocol+r.host;return s};var ci=Object.freeze({parseUrl:si,getAbsoluteURL:oi,getFileExtension:ui,isCrossOrigin:li});var fi=hi;var di=Object.prototype.toString;function hi(e){var t=di.call(e);return t==="[object Function]"||typeof e==="function"&&t!=="[object RegExp]"||typeof window!=="undefined"&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)}var pi=Bt(function(e,t){t=e.exports=i;function i(e){return e.replace(/^\s*|\s*$/g,"")}t.left=function(e){return e.replace(/^\s*/,"")};t.right=function(e){return e.replace(/\s*$/,"")}});var mi=pi.left;var vi=pi.right;var gi=Function.prototype.toString;var yi=/^\s*class\b/;var _i=function e(t){try{var i=gi.call(t);return yi.test(i)}catch(e){return false}};var bi=function e(t){try{if(_i(t)){return false}gi.call(t);return true}catch(e){return false}};var Ti=Object.prototype.toString;var Si="[object Function]";var ki="[object GeneratorFunction]";var wi=typeof Symbol==="function"&&typeof Symbol.toStringTag==="symbol";var Ci=function e(t){if(!t){return false}if(typeof t!=="function"&&typeof t!=="object"){return false}if(typeof t==="function"&&!t.prototype){return true}if(wi){return bi(t)}if(_i(t)){return false}var i=Ti.call(t);return i===Si||i===ki};var Ei=Object.prototype.toString;var Ai=Object.prototype.hasOwnProperty;var Li=function e(t,i,r){for(var n=0,a=t.length;n<a;n++){if(Ai.call(t,n)){if(r==null){i(t[n],n,t)}else{i.call(r,t[n],n,t)}}}};var Ii=function e(t,i,r){for(var n=0,a=t.length;n<a;n++){if(r==null){i(t.charAt(n),n,t)}else{i.call(r,t.charAt(n),n,t)}}};var Pi=function e(t,i,r){for(var n in t){if(Ai.call(t,n)){if(r==null){i(t[n],n,t)}else{i.call(r,t[n],n,t)}}}};var Oi=function e(t,i,r){if(!Ci(i)){throw new TypeError("iterator must be a function")}var n;if(arguments.length>=3){n=r}if(Ei.call(t)==="[object Array]"){Li(t,i,n)}else if(typeof t==="string"){Ii(t,i,n)}else{Pi(t,i,n)}};var Ui=Oi;var Di=function e(t){return Object.prototype.toString.call(t)==="[object Array]"};var xi=function e(t){if(!t)return{};var i={};Ui(pi(t).split("\n"),function(e){var t=e.indexOf(":"),r=pi(e.slice(0,t)).toLowerCase(),n=pi(e.slice(t+1));if(typeof i[r]==="undefined"){i[r]=n}else if(Di(i[r])){i[r].push(n)}else{i[r]=[i[r],n]}});return i};var Ri=Bi;var Mi=Object.prototype.hasOwnProperty;function Bi(){var e={};for(var t=0;t<arguments.length;t++){var i=arguments[t];for(var r in i){if(Mi.call(i,r)){e[r]=i[r]}}}return e}var Ni=Hi;Hi.XMLHttpRequest=e.XMLHttpRequest||Wi;Hi.XDomainRequest="withCredentials"in new Hi.XMLHttpRequest?Hi.XMLHttpRequest:e.XDomainRequest;ji(["get","put","post","patch","head","delete"],function(e){Hi[e==="delete"?"del":e]=function(t,i,r){i=Vi(t,i,r);i.method=e.toUpperCase();return qi(i)}});function ji(e,t){for(var i=0;i<e.length;i++){t(e[i])}}function Fi(e){for(var t in e){if(e.hasOwnProperty(t))return false}return true}function Vi(e,t,i){var r=e;if(fi(t)){i=t;if(typeof e==="string"){r={uri:e}}}else{r=Ri(t,{uri:e})}r.callback=i;return r}function Hi(e,t,i){t=Vi(e,t,i);return qi(t)}function qi(e){if(typeof e.callback==="undefined"){throw new Error("callback argument missing")}var t=false;var i=function i(r,n,a){if(!t){t=true;e.callback(r,n,a)}};function r(){if(o.readyState===4){setTimeout(s,0)}}function n(){var e=undefined;if(o.response){e=o.response}else{e=o.responseText||zi(o)}if(m){try{e=JSON.parse(e)}catch(e){}}return e}function a(e){clearTimeout(v);if(!(e instanceof Error)){e=new Error(""+(e||"Unknown XMLHttpRequest Error"))}e.statusCode=0;return i(e,g)}function s(){if(l)return;var t;clearTimeout(v);if(e.useXDR&&o.status===undefined){t=200}else{t=o.status===1223?204:o.status}var r=g;var a=null;if(t!==0){r={body:n(),statusCode:t,method:f,headers:{},url:c,rawRequest:o};if(o.getAllResponseHeaders){r.headers=xi(o.getAllResponseHeaders())}}else{a=new Error("Internal XMLHttpRequest Error")}return i(a,r,r.body)}var o=e.xhr||null;if(!o){if(e.cors||e.useXDR){o=new Hi.XDomainRequest}else{o=new Hi.XMLHttpRequest}}var u;var l;var c=o.url=e.uri||e.url;var f=o.method=e.method||"GET";var d=e.body||e.data;var h=o.headers=e.headers||{};var p=!!e.sync;var m=false;var v;var g={body:undefined,headers:{},statusCode:0,method:f,url:c,rawRequest:o};if("json"in e&&e.json!==false){m=true;h["accept"]||h["Accept"]||(h["Accept"]="application/json");if(f!=="GET"&&f!=="HEAD"){h["content-type"]||h["Content-Type"]||(h["Content-Type"]="application/json");d=JSON.stringify(e.json===true?d:e.json)}}o.onreadystatechange=r;o.onload=s;o.onerror=a;o.onprogress=function(){};o.onabort=function(){l=true};o.ontimeout=a;o.open(f,c,!p,e.username,e.password);if(!p){o.withCredentials=!!e.withCredentials}if(!p&&e.timeout>0){v=setTimeout(function(){if(l)return;l=true;o.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT";a(e)},e.timeout)}if(o.setRequestHeader){for(u in h){if(h.hasOwnProperty(u)){o.setRequestHeader(u,h[u])}}}else if(e.headers&&!Fi(e.headers)){throw new Error("Headers cannot be set on an XDomainRequest object")}if("responseType"in e){o.responseType=e.responseType}if("beforeSend"in e&&typeof e.beforeSend==="function"){e.beforeSend(o)}o.send(d||null);return o}function zi(e){if(e.responseType==="document"){return e.responseXML}var t=e.responseXML&&e.responseXML.documentElement.nodeName==="parsererror";if(e.responseType===""&&!t){return e.responseXML}return null}function Wi(){}var Gi=function t(i,r){var n=new e.WebVTT.Parser(e,e.vttjs,e.WebVTT.StringDecoder());var a=[];n.oncue=function(e){r.addCue(e)};n.onparsingerror=function(e){a.push(e)};n.onflush=function(){r.trigger({type:"loadeddata",target:r})};n.parse(i);if(a.length>0){if(e.console&&e.console.groupCollapsed){e.console.groupCollapsed("Text Track parsing errors for "+r.src)}a.forEach(function(e){return d.error(e)});if(e.console&&e.console.groupEnd){e.console.groupEnd()}}n.flush()};var Xi=function t(i,r){var n={uri:i};var a=li(i);if(a){n.cors=a}Ni(n,Ae(this,function(t,i,n){if(t){return d.error(t,i)}r.loaded_=true;if(typeof e.WebVTT!=="function"){if(r.tech_){var a;var s=function e(){d.error("vttjs failed to load, stopping trying to process "+r.src);r.tech_.off("vttjsloaded",a)};a=function e(){r.tech_.off("vttjserror",s);return Gi(n,r)};r.tech_.one("vttjsloaded",a);r.tech_.one("vttjserror",s)}}else{Gi(n,r)}}))};var Yi=function(t){r(i,t);function i(e){var i;if(e===void 0){e={}}if(!e.tech){throw new Error("A tech was not provided.")}var r=Ge(e,{kind:ri[e.kind]||"subtitles",language:e.language||e.srclang||""});var n=ni[r.mode]||"disabled";var a=r.default;if(r.kind==="metadata"||r.kind==="chapters"){n="hidden"}i=t.call(this,r)||this;i.tech_=r.tech;i.cues_=[];i.activeCues_=[];var s=new ei(i.cues_);var u=new ei(i.activeCues_);var l=false;var c=Ae(o(o(i)),function(){this.activeCues=this.activeCues;if(l){this.trigger("cuechange");l=false}});if(n!=="disabled"){i.tech_.ready(function(){i.tech_.on("timeupdate",c)},true)}Object.defineProperties(o(o(i)),{default:{get:function e(){return a},set:function e(){}},mode:{get:function e(){return n},set:function e(t){var i=this;if(!ni[t]){return}n=t;if(n!=="disabled"){this.tech_.ready(function(){i.tech_.on("timeupdate",c)},true)}else{this.tech_.off("timeupdate",c)}this.trigger("modechange")}},cues:{get:function e(){if(!this.loaded_){return null}return s},set:function e(){}},activeCues:{get:function e(){if(!this.loaded_){return null}if(this.cues.length===0){return u}var t=this.tech_.currentTime();var i=[];for(var r=0,n=this.cues.length;r<n;r++){var a=this.cues[r];if(a.startTime<=t&&a.endTime>=t){i.push(a)}else if(a.startTime===a.endTime&&a.startTime<=t&&a.startTime+.5>=t){i.push(a)}}l=false;if(i.length!==this.activeCues_.length){l=true}else{for(var s=0;s<i.length;s++){if(this.activeCues_.indexOf(i[s])===-1){l=true}}}this.activeCues_=i;u.setCues_(this.activeCues_);return u},set:function e(){}}});if(r.src){i.src=r.src;Xi(r.src,o(o(i)))}else{i.loaded_=true}return i}var n=i.prototype;n.addCue=function t(i){var r=i;if(e.vttjs&&!(i instanceof e.vttjs.VTTCue)){r=new e.vttjs.VTTCue(i.startTime,i.endTime,i.text);for(var n in i){if(!(n in r)){r[n]=i[n]}}r.id=i.id;r.originalCue_=i}var a=this.tech_.textTracks();for(var s=0;s<a.length;s++){if(a[s]!==this){a[s].removeCue(r)}}this.cues_.push(r);this.cues.setCues_(this.cues_)};n.removeCue=function e(t){var i=this.cues_.length;while(i--){var r=this.cues_[i];if(r===t||r.originalCue_&&r.originalCue_===t){this.cues_.splice(i,1);this.cues.setCues_(this.cues_);break}}};return i}(ai);Yi.prototype.allowedEvents_={cuechange:"cuechange"};var Ki=function(e){r(t,e);function t(t){var i;if(t===void 0){t={}}var r=Ge(t,{kind:ii[t.kind]||""});i=e.call(this,r)||this;var n=false;Object.defineProperty(o(o(i)),"enabled",{get:function e(){return n},set:function e(t){if(typeof t!=="boolean"||t===n){return}n=t;this.trigger("enabledchange")}});if(r.enabled){i.enabled=r.enabled}i.loaded_=true;return i}return t}(ai);var $i=function(e){r(t,e);function t(t){var i;if(t===void 0){t={}}var r=Ge(t,{kind:ti[t.kind]||""});i=e.call(this,r)||this;var n=false;Object.defineProperty(o(o(i)),"selected",{get:function e(){return n},set:function e(t){if(typeof t!=="boolean"||t===n){return}n=t;this.trigger("selectedchange")}});if(r.selected){i.selected=r.selected}return i}return t}(ai);var Qi=0;var Ji=1;var Zi=2;var er=3;var tr=function(e){r(t,e);function t(t){var i;if(t===void 0){t={}}i=e.call(this)||this;var r;var n=new Yi(t);i.kind=n.kind;i.src=n.src;i.srclang=n.language;i.label=n.label;i.default=n.default;Object.defineProperties(o(o(i)),{readyState:{get:function e(){return r}},track:{get:function e(){return n}}});r=Qi;n.addEventListener("loadeddata",function(){r=Zi;i.trigger({type:"load",target:o(o(i))})});return i}return t}(Pe);tr.prototype.allowedEvents_={load:"load"};tr.NONE=Qi;tr.LOADING=Ji;tr.LOADED=Zi;tr.ERROR=er;var ir={audio:{ListClass:Kt,TrackClass:Ki,capitalName:"Audio"},video:{ListClass:Qt,TrackClass:$i,capitalName:"Video"},text:{ListClass:Jt,TrackClass:Yi,capitalName:"Text"}};Object.keys(ir).forEach(function(e){ir[e].getterName=e+"Tracks";ir[e].privateName=e+"Tracks_"});var rr={remoteText:{ListClass:Jt,TrackClass:Yi,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:Zt,TrackClass:tr,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}};var nr=Ge(ir,rr);rr.names=Object.keys(rr);ir.names=Object.keys(ir);nr.names=[].concat(rr.names).concat(ir.names);var ar=Object.create||function(){function e(){}return function(t){if(arguments.length!==1){throw new Error("Object.create shim only accepts one parameter.")}e.prototype=t;return new e}}();function sr(e,t){this.name="ParsingError";this.code=e.code;this.message=t||e.message}sr.prototype=ar(Error.prototype);sr.prototype.constructor=sr;sr.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}};function or(e){function t(e,t,i,r){return(e|0)*3600+(t|0)*60+(i|0)+(r|0)/1e3}var i=e.match(/^(\d+):(\d{2})(:\d{2})?\.(\d{3})/);if(!i){return null}if(i[3]){return t(i[1],i[2],i[3].replace(":",""),i[4])}else if(i[1]>59){return t(i[1],i[2],0,i[4])}else{return t(0,i[1],i[2],i[4])}}function ur(){this.values=ar(null)}ur.prototype={set:function e(t,i){if(!this.get(t)&&i!==""){this.values[t]=i}},get:function e(t,i,r){if(r){return this.has(t)?this.values[t]:i[r]}return this.has(t)?this.values[t]:i},has:function e(t){return t in this.values},alt:function e(t,i,r){for(var n=0;n<r.length;++n){if(i===r[n]){this.set(t,i);break}}},integer:function e(t,i){if(/^-?\d+$/.test(i)){this.set(t,parseInt(i,10))}},percent:function e(t,i){var r;if(r=i.match(/^([\d]{1,3})(\.[\d]*)?%$/)){i=parseFloat(i);if(i>=0&&i<=100){this.set(t,i);return true}}return false}};function lr(e,t,i,r){var n=r?e.split(r):[e];for(var a in n){if(typeof n[a]!=="string"){continue}var s=n[a].split(i);if(s.length!==2){continue}var o=s[0];var u=s[1];t(o,u)}}function cr(e,t,i){var r=e;function n(){var t=or(e);if(t===null){throw new sr(sr.Errors.BadTimeStamp,"Malformed timestamp: "+r)}e=e.replace(/^[^\sa-zA-Z-]+/,"");return t}function a(e,t){var r=new ur;lr(e,function(e,t){switch(e){case"region":for(var n=i.length-1;n>=0;n--){if(i[n].id===t){r.set(e,i[n].region);break}}break;case"vertical":r.alt(e,t,["rl","lr"]);break;case"line":var a=t.split(","),s=a[0];r.integer(e,s);r.percent(e,s)?r.set("snapToLines",false):null;r.alt(e,s,["auto"]);if(a.length===2){r.alt("lineAlign",a[1],["start","middle","end"])}break;case"position":a=t.split(",");r.percent(e,a[0]);if(a.length===2){r.alt("positionAlign",a[1],["start","middle","end"])}break;case"size":r.percent(e,t);break;case"align":r.alt(e,t,["start","middle","end","left","right"]);break}},/:/,/\s/);t.region=r.get("region",null);t.vertical=r.get("vertical","");t.line=r.get("line","auto");t.lineAlign=r.get("lineAlign","start");t.snapToLines=r.get("snapToLines",true);t.size=r.get("size",100);t.align=r.get("align","middle");t.position=r.get("position",{start:0,left:0,middle:50,end:100,right:100},t.align);t.positionAlign=r.get("positionAlign",{start:"start",left:"start",middle:"middle",end:"end",right:"end"},t.align)}function s(){e=e.replace(/^\s+/,"")}s();t.startTime=n();s();if(e.substr(0,3)!=="--\x3e"){throw new sr(sr.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+r)}e=e.substr(3);s();t.endTime=n();s();a(e,t)}var fr={"&amp;":"&","&lt;":"<","&gt;":">","&lrm;":"","&rlm;":"","&nbsp;":" "};var dr={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"};var hr={v:"title",lang:"lang"};var pr={rt:"ruby"};function mr(e,t){function i(){if(!t){return null}function e(e){t=t.substr(e.length);return e}var i=t.match(/^([^<]*)(<[^>]*>?)?/);return e(i[1]?i[1]:i[2])}function r(e){return fr[e]}function n(e){while(h=e.match(/&(amp|lt|gt|lrm|rlm|nbsp);/)){e=e.replace(h[0],r)}return e}function a(e,t){return!pr[t.localName]||pr[t.localName]===e.localName}function s(t,i){var r=dr[t];if(!r){return null}var n=e.document.createElement(r);n.localName=r;var a=hr[t];if(a&&i){n[a]=i.trim()}return n}var o=e.document.createElement("div"),u=o,l,c=[];while((l=i())!==null){if(l[0]==="<"){if(l[1]==="/"){if(c.length&&c[c.length-1]===l.substr(2).replace(">","")){c.pop();u=u.parentNode}continue}var f=or(l.substr(1,l.length-2));var d;if(f){d=e.document.createProcessingInstruction("timestamp",f);u.appendChild(d);continue}var h=l.match(/^<([^.\s\/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!h){continue}d=s(h[1],h[3]);if(!d){continue}if(!a(u,d)){continue}if(h[2]){d.className=h[2].substr(1).replace("."," ")}c.push(h[1]);u.appendChild(d);u=d;continue}u.appendChild(e.document.createTextNode(n(l)))}return o}var vr=[[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 gr(e){for(var t=0;t<vr.length;t++){var i=vr[t];if(e>=i[0]&&e<=i[1]){return true}}return false}function yr(e){var t=[],i="",r;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 a(e){if(!e||!e.length){return null}var t=e.pop(),i=t.textContent||t.innerText;if(i){var r=i.match(/^.*(\n|\r)/);if(r){e.length=0;return r[0]}return i}if(t.tagName==="ruby"){return a(e)}if(t.childNodes){n(e,t);return a(e)}}n(t,e);while(i=a(t)){for(var s=0;s<i.length;s++){r=i.charCodeAt(s);if(gr(r)){return"rtl"}}}return"ltr"}function _r(e){if(typeof e.line==="number"&&(e.snapToLines||e.line>=0&&e.line<=100)){return e.line}if(!e.track||!e.track.textTrackList||!e.track.textTrackList.mediaElement){return-1}var t=e.track,i=t.textTrackList,r=0;for(var n=0;n<i.length&&i[n]!==t;n++){if(i[n].mode==="showing"){r++}}return++r*-1}function br(){}br.prototype.applyStyles=function(e,t){t=t||this.div;for(var i in e){if(e.hasOwnProperty(i)){t.style[i]=e[i]}}};br.prototype.formatStyle=function(e,t){return e===0?0:e+t};function Tr(e,t,i){br.call(this);this.cue=t;this.cueDiv=mr(e,t.text);var r={color:"rgba(255, 255, 255, 1)",backgroundColor:"rgba(0, 0, 0, 0.8)",position:"relative",left:0,right:0,top:0,bottom:0,display:"inline",writingMode:t.vertical===""?"horizontal-tb":t.vertical==="lr"?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(r,this.cueDiv);this.div=e.document.createElement("div");r={direction:yr(this.cueDiv),writingMode:t.vertical===""?"horizontal-tb":t.vertical==="lr"?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext",textAlign:t.align==="middle"?"center":t.align,font:i.font,whiteSpace:"pre-line",position:"absolute"};this.applyStyles(r);this.div.appendChild(this.cueDiv);var n=0;switch(t.positionAlign){case"start":n=t.position;break;case"middle":n=t.position-t.size/2;break;case"end":n=t.position-t.size;break}if(t.vertical===""){this.applyStyles({left:this.formatStyle(n,"%"),width:this.formatStyle(t.size,"%")})}else{this.applyStyles({top:this.formatStyle(n,"%"),height:this.formatStyle(t.size,"%")})}this.move=function(e){this.applyStyles({top:this.formatStyle(e.top,"px"),bottom:this.formatStyle(e.bottom,"px"),left:this.formatStyle(e.left,"px"),right:this.formatStyle(e.right,"px"),height:this.formatStyle(e.height,"px"),width:this.formatStyle(e.width,"px")})}}Tr.prototype=ar(br.prototype);Tr.prototype.constructor=Tr;function Sr(e){var t,i,r,n;if(e.div){i=e.div.offsetHeight;r=e.div.offsetWidth;n=e.div.offsetTop;var a=(a=e.div.childNodes)&&(a=a[0])&&a.getClientRects&&a.getClientRects();e=e.div.getBoundingClientRect();t=a?Math.max(a[0]&&a[0].height||0,e.height/a.length):0}this.left=e.left;this.right=e.right;this.top=e.top||n;this.height=e.height||i;this.bottom=e.bottom||n+(e.height||i);this.width=e.width||r;this.lineHeight=t!==undefined?t:e.lineHeight}Sr.prototype.move=function(e,t){t=t!==undefined?t:this.lineHeight;switch(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;break}};Sr.prototype.overlaps=function(e){return this.left<e.right&&this.right>e.left&&this.top<e.bottom&&this.bottom>e.top};Sr.prototype.overlapsAny=function(e){for(var t=0;t<e.length;t++){if(this.overlaps(e[t])){return true}}return false};Sr.prototype.within=function(e){return this.top>=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right};Sr.prototype.overlapsOppositeAxis=function(e,t){switch(t){case"+x":return this.left<e.left;case"-x":return this.right>e.right;case"+y":return this.top<e.top;case"-y":return this.bottom>e.bottom}};Sr.prototype.intersectPercentage=function(e){var t=Math.max(0,Math.min(this.right,e.right)-Math.max(this.left,e.left)),i=Math.max(0,Math.min(this.bottom,e.bottom)-Math.max(this.top,e.top)),r=t*i;return r/(this.height*this.width)};Sr.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}};Sr.getSimpleBoxPosition=function(e){var t=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0;var i=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0;var r=e.div?e.div.offsetTop:e.tagName?e.offsetTop:0;e=e.div?e.div.getBoundingClientRect():e.tagName?e.getBoundingClientRect():e;var n={left:e.left,right:e.right,top:e.top||r,height:e.height||t,bottom:e.bottom||r+(e.height||t),width:e.width||i};return n};function kr(e,t,i,r){function n(e,t){var n,a=new Sr(e),s=1;for(var o=0;o<t.length;o++){while(e.overlapsOppositeAxis(i,t[o])||e.within(i)&&e.overlapsAny(r)){e.move(t[o])}if(e.within(i)){return e}var u=e.intersectPercentage(i);if(s>u){n=new Sr(e);s=u}e=new Sr(a)}return n||a}var a=new Sr(t),s=t.cue,o=_r(s),u=[];if(s.snapToLines){var l;switch(s.vertical){case"":u=["+y","-y"];l="height";break;case"rl":u=["+x","-x"];l="width";break;case"lr":u=["-x","+x"];l="width";break}var c=a.lineHeight,f=c*Math.round(o),d=i[l]+c,h=u[0];if(Math.abs(f)>d){f=f<0?-1:1;f*=Math.ceil(d/c)*c}if(o<0){f+=s.vertical===""?i.height:i.width;u=u.reverse()}a.move(h,f)}else{var p=a.lineHeight/i.height*100;switch(s.lineAlign){case"middle":o-=p/2;break;case"end":o-=p;break}switch(s.vertical){case"":t.applyStyles({top:t.formatStyle(o,"%")});break;case"rl":t.applyStyles({left:t.formatStyle(o,"%")});break;case"lr":t.applyStyles({right:t.formatStyle(o,"%")});break}u=["+y","-x","+x","-y"];a=new Sr(t)}var m=n(a,u);t.move(m.toCSSCompatValues(i))}function wr(){}wr.StringDecoder=function(){return{decode:function e(t){if(!t){return""}if(typeof t!=="string"){throw new Error("Error - expected string data.")}return decodeURIComponent(encodeURIComponent(t))}}};wr.convertCueToDOMTree=function(e,t){if(!e||!t){return null}return mr(e,t)};var Cr=.05;var Er="sans-serif";var Ar="1.5%";wr.processCues=function(e,t,i){if(!e||!t||!i){return null}while(i.firstChild){i.removeChild(i.firstChild)}var r=e.document.createElement("div");r.style.position="absolute";r.style.left="0";r.style.right="0";r.style.top="0";r.style.bottom="0";r.style.margin=Ar;i.appendChild(r);function n(e){for(var t=0;t<e.length;t++){if(e[t].hasBeenReset||!e[t].displayState){return true}}return false}if(!n(t)){for(var a=0;a<t.length;a++){r.appendChild(t[a].displayState)}return}var s=[],o=Sr.getSimpleBoxPosition(r),u=Math.round(o.height*Cr*100)/100;var l={font:u+"px "+Er};(function(){var i,n;for(var a=0;a<t.length;a++){n=t[a];i=new Tr(e,n,l);r.appendChild(i.div);kr(e,i,o,s);n.displayState=i.div;s.push(Sr.getSimpleBoxPosition(i))}})()};wr.Parser=function(e,t,i){if(!i){i=t;t={}}if(!t){t={}}this.window=e;this.vttjs=t;this.state="INITIAL";this.buffer="";this.decoder=i||new TextDecoder("utf8");this.regionList=[]};wr.Parser.prototype={reportOrThrowError:function e(t){if(t instanceof sr){this.onparsingerror&&this.onparsingerror(t)}else{throw t}},parse:function e(t){var i=this;if(t){i.buffer+=i.decoder.decode(t,{stream:true})}function r(){var e=i.buffer;var t=0;while(t<e.length&&e[t]!=="\r"&&e[t]!=="\n"){++t}var r=e.substr(0,t);if(e[t]==="\r"){++t}if(e[t]==="\n"){++t}i.buffer=e.substr(t);return r}function n(e){var t=new ur;lr(e,function(e,i){switch(e){case"id":t.set(e,i);break;case"width":t.percent(e,i);break;case"lines":t.integer(e,i);break;case"regionanchor":case"viewportanchor":var r=i.split(",");if(r.length!==2){break}var n=new ur;n.percent("x",r[0]);n.percent("y",r[1]);if(!n.has("x")||!n.has("y")){break}t.set(e+"X",n.get("x"));t.set(e+"Y",n.get("y"));break;case"scroll":t.alt(e,i,["up"]);break}},/=/,/\s/);if(t.has("id")){var r=new(i.vttjs.VTTRegion||i.window.VTTRegion);r.width=t.get("width",100);r.lines=t.get("lines",3);r.regionAnchorX=t.get("regionanchorX",0);r.regionAnchorY=t.get("regionanchorY",100);r.viewportAnchorX=t.get("viewportanchorX",0);r.viewportAnchorY=t.get("viewportanchorY",100);r.scroll=t.get("scroll","");i.onregion&&i.onregion(r);i.regionList.push({id:t.get("id"),region:r})}}function a(e){var t=new ur;lr(e,function(e,i){switch(e){case"MPEGT":t.integer(e+"S",i);break;case"LOCA":t.set(e+"L",or(i));break}},/[^\d]:/,/,/);i.ontimestampmap&&i.ontimestampmap({MPEGTS:t.get("MPEGTS"),LOCAL:t.get("LOCAL")})}function s(e){if(e.match(/X-TIMESTAMP-MAP/)){lr(e,function(e,t){switch(e){case"X-TIMESTAMP-MAP":a(t);break}},/=/)}else{lr(e,function(e,t){switch(e){case"Region":n(t);break}},/:/)}}try{var o;if(i.state==="INITIAL"){if(!/\r\n|\n/.test(i.buffer)){return this}o=r();var u=o.match(/^WEBVTT([ \t].*)?$/);if(!u||!u[0]){throw new sr(sr.Errors.BadSignature)}i.state="HEADER"}var l=false;while(i.buffer){if(!/\r\n|\n/.test(i.buffer)){return this}if(!l){o=r()}else{l=false}switch(i.state){case"HEADER":if(/:/.test(o)){s(o)}else if(!o){i.state="ID"}continue;case"NOTE":if(!o){i.state="ID"}continue;case"ID":if(/^NOTE($|[ \t])/.test(o)){i.state="NOTE";break}if(!o){continue}i.cue=new(i.vttjs.VTTCue||i.window.VTTCue)(0,0,"");i.state="CUE";if(o.indexOf("--\x3e")===-1){i.cue.id=o;continue}case"CUE":try{cr(o,i.cue,i.regionList)}catch(e){i.reportOrThrowError(e);i.cue=null;i.state="BADCUE";continue}i.state="CUETEXT";continue;case"CUETEXT":var c=o.indexOf("--\x3e")!==-1;if(!o||c&&(l=true)){i.oncue&&i.oncue(i.cue);i.cue=null;i.state="ID";continue}if(i.cue.text){i.cue.text+="\n"}i.cue.text+=o;continue;case"BADCUE":if(!o){i.state="ID"}continue}}}catch(e){i.reportOrThrowError(e);if(i.state==="CUETEXT"&&i.cue&&i.oncue){i.oncue(i.cue)}i.cue=null;i.state=i.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},flush:function e(){var t=this;try{t.buffer+=t.decoder.decode();if(t.cue||t.state==="HEADER"){t.buffer+="\n\n";t.parse()}if(t.state==="INITIAL"){throw new sr(sr.Errors.BadSignature)}}catch(e){t.reportOrThrowError(e)}t.onflush&&t.onflush();return this}};var Lr=wr;var Ir="auto";var Pr={"":1,lr:1,rl:1};var Or={start:1,middle:1,end:1,left:1,right:1};function Ur(e){if(typeof e!=="string"){return false}var t=Pr[e.toLowerCase()];return t?e.toLowerCase():false}function Dr(e){if(typeof e!=="string"){return false}var t=Or[e.toLowerCase()];return t?e.toLowerCase():false}function xr(e,t,i){this.hasBeenReset=false;var r="";var n=false;var a=e;var s=t;var o=i;var u=null;var l="";var c=true;var f="auto";var d="start";var h=50;var p="middle";var m=50;var v="middle";Object.defineProperties(this,{id:{enumerable:true,get:function e(){return r},set:function e(t){r=""+t}},pauseOnExit:{enumerable:true,get:function e(){return n},set:function e(t){n=!!t}},startTime:{enumerable:true,get:function e(){return a},set:function e(t){if(typeof t!=="number"){throw new TypeError("Start time must be set to a number.")}a=t;this.hasBeenReset=true}},endTime:{enumerable:true,get:function e(){return s},set:function e(t){if(typeof t!=="number"){throw new TypeError("End time must be set to a number.")}s=t;this.hasBeenReset=true}},text:{enumerable:true,get:function e(){return o},set:function e(t){o=""+t;this.hasBeenReset=true}},region:{enumerable:true,get:function e(){return u},set:function e(t){u=t;this.hasBeenReset=true}},vertical:{enumerable:true,get:function e(){return l},set:function e(t){var i=Ur(t);if(i===false){throw new SyntaxError("An invalid or illegal string was specified.")}l=i;this.hasBeenReset=true}},snapToLines:{enumerable:true,get:function e(){return c},set:function e(t){c=!!t;this.hasBeenReset=true}},line:{enumerable:true,get:function e(){return f},set:function e(t){if(typeof t!=="number"&&t!==Ir){throw new SyntaxError("An invalid number or illegal string was specified.")}f=t;this.hasBeenReset=true}},lineAlign:{enumerable:true,get:function e(){return d},set:function e(t){var i=Dr(t);if(!i){throw new SyntaxError("An invalid or illegal string was specified.")}d=i;this.hasBeenReset=true}},position:{enumerable:true,get:function e(){return h},set:function e(t){if(t<0||t>100){throw new Error("Position must be between 0 and 100.")}h=t;this.hasBeenReset=true}},positionAlign:{enumerable:true,get:function e(){return p},set:function e(t){var i=Dr(t);if(!i){throw new SyntaxError("An invalid or illegal string was specified.")}p=i;this.hasBeenReset=true}},size:{enumerable:true,get:function e(){return m},set:function e(t){if(t<0||t>100){throw new Error("Size must be between 0 and 100.")}m=t;this.hasBeenReset=true}},align:{enumerable:true,get:function e(){return v},set:function e(t){var i=Dr(t);if(!i){throw new SyntaxError("An invalid or illegal string was specified.")}v=i;this.hasBeenReset=true}}});this.displayState=undefined}xr.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)};var Rr=xr;var Mr={"":true,up:true};function Br(e){if(typeof e!=="string"){return false}var t=Mr[e.toLowerCase()];return t?e.toLowerCase():false}function Nr(e){return typeof e==="number"&&e>=0&&e<=100}function jr(){var e=100;var t=3;var i=0;var r=100;var n=0;var a=100;var s="";Object.defineProperties(this,{width:{enumerable:true,get:function t(){return e},set:function t(i){if(!Nr(i)){throw new Error("Width must be between 0 and 100.")}e=i}},lines:{enumerable:true,get:function e(){return t},set:function e(i){if(typeof i!=="number"){throw new TypeError("Lines must be set to a number.")}t=i}},regionAnchorY:{enumerable:true,get:function e(){return r},set:function e(t){if(!Nr(t)){throw new Error("RegionAnchorX must be between 0 and 100.")}r=t}},regionAnchorX:{enumerable:true,get:function e(){return i},set:function e(t){if(!Nr(t)){throw new Error("RegionAnchorY must be between 0 and 100.")}i=t}},viewportAnchorY:{enumerable:true,get:function e(){return a},set:function e(t){if(!Nr(t)){throw new Error("ViewportAnchorY must be between 0 and 100.")}a=t}},viewportAnchorX:{enumerable:true,get:function e(){return n},set:function e(t){if(!Nr(t)){throw new Error("ViewportAnchorX must be between 0 and 100.")}n=t}},scroll:{enumerable:true,get:function e(){return s},set:function e(t){var i=Br(t);if(i===false){throw new SyntaxError("An invalid or illegal string was specified.")}s=i}}})}var Fr=jr;var Vr=Bt(function(t){var i=t.exports={WebVTT:Lr,VTTCue:Rr,VTTRegion:Fr};e.vttjs=i;e.WebVTT=i.WebVTT;var r=i.VTTCue;var n=i.VTTRegion;var a=e.VTTCue;var s=e.VTTRegion;i.shim=function(){e.VTTCue=r;e.VTTRegion=n};i.restore=function(){e.VTTCue=a;e.VTTRegion=s};if(!e.VTTCue){i.shim()}});var Hr=Vr.WebVTT;var qr=Vr.VTTCue;var zr=Vr.VTTRegion;function Wr(e,t,i,r,n){if(n===void 0){n={}}var a=e.textTracks();n.kind=t;if(i){n.label=i}if(r){n.language=r}n.tech=e;var s=new nr.text.TrackClass(n);a.addTrack(s);return s}var Gr=function(i){r(n,i);function n(e,t){var r;if(e===void 0){e={}}if(t===void 0){t=function e(){}}e.reportTouchActivity=false;r=i.call(this,null,e,t)||this;r.hasStarted_=false;r.on("playing",function(){this.hasStarted_=true});r.on("loadstart",function(){this.hasStarted_=false});nr.names.forEach(function(t){var i=nr[t];if(e&&e[i.getterName]){r[i.privateName]=e[i.getterName]}});if(!r.featuresProgressEvents){r.manualProgressOn()}if(!r.featuresTimeupdateEvents){r.manualTimeUpdatesOn()}["Text","Audio","Video"].forEach(function(t){if(e["native"+t+"Tracks"]===false){r["featuresNative"+t+"Tracks"]=false}});if(e.nativeCaptions===false||e.nativeTextTracks===false){r.featuresNativeTextTracks=false}else if(e.nativeCaptions===true||e.nativeTextTracks===true){r.featuresNativeTextTracks=true}if(!r.featuresNativeTextTracks){r.emulateTextTracks()}r.autoRemoteTextTracks_=new nr.text.ListClass;r.initTrackListeners();if(!e.nativeControlsForTouch){r.emitTapEvents()}if(r.constructor){r.name_=r.constructor.name||"Unknown Tech"}return r}var a=n.prototype;a.triggerSourceset=function e(t){var i=this;if(!this.isReady_){this.one("ready",function(){return i.setTimeout(function(){return i.triggerSourceset(t)},1)})}this.trigger({src:t,type:"sourceset"})};a.manualProgressOn=function e(){this.on("durationchange",this.onDurationChange);this.manualProgress=true;this.one("ready",this.trackProgress)};a.manualProgressOff=function e(){this.manualProgress=false;this.stopTrackingProgress();this.off("durationchange",this.onDurationChange)};a.trackProgress=function e(t){this.stopTrackingProgress();this.progressInterval=this.setInterval(Ae(this,function(){var e=this.bufferedPercent();if(this.bufferedPercent_!==e){this.trigger("progress")}this.bufferedPercent_=e;if(e===1){this.stopTrackingProgress()}}),500)};a.onDurationChange=function e(t){this.duration_=this.duration()};a.buffered=function e(){return gt(0,0)};a.bufferedPercent=function e(){return yt(this.buffered(),this.duration_)};a.stopTrackingProgress=function e(){this.clearInterval(this.progressInterval)};a.manualTimeUpdatesOn=function e(){this.manualTimeUpdates=true;this.on("play",this.trackCurrentTime);this.on("pause",this.stopTrackingCurrentTime)};a.manualTimeUpdatesOff=function e(){this.manualTimeUpdates=false;this.stopTrackingCurrentTime();this.off("play",this.trackCurrentTime);this.off("pause",this.stopTrackingCurrentTime)};a.trackCurrentTime=function e(){if(this.currentTimeInterval){this.stopTrackingCurrentTime()}this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:true})},250)};a.stopTrackingCurrentTime=function e(){this.clearInterval(this.currentTimeInterval);this.trigger({type:"timeupdate",target:this,manuallyTriggered:true})};a.dispose=function e(){this.clearTracks(ir.names);if(this.manualProgress){this.manualProgressOff()}if(this.manualTimeUpdates){this.manualTimeUpdatesOff()}i.prototype.dispose.call(this)};a.clearTracks=function e(t){var i=this;t=[].concat(t);t.forEach(function(e){var t=i[e+"Tracks"]()||[];var r=t.length;while(r--){var n=t[r];if(e==="text"){i.removeRemoteTextTrack(n)}t.removeTrack(n)}})};a.cleanupAutoTextTracks=function e(){var t=this.autoRemoteTextTracks_||[];var i=t.length;while(i--){var r=t[i];this.removeRemoteTextTrack(r)}};a.reset=function e(){};a.error=function e(t){if(t!==undefined){this.error_=new Et(t);this.trigger("error")}return this.error_};a.played=function e(){if(this.hasStarted_){return gt(0,0)}return gt()};a.setCurrentTime=function e(){if(this.manualTimeUpdates){this.trigger({type:"timeupdate",target:this,manuallyTriggered:true})}};a.initTrackListeners=function e(){var t=this;ir.names.forEach(function(e){var i=ir[e];var r=function i(){t.trigger(e+"trackchange")};var n=t[i.getterName]();n.addEventListener("removetrack",r);n.addEventListener("addtrack",r);t.on("dispose",function(){n.removeEventListener("removetrack",r);n.removeEventListener("addtrack",r)})})};a.addWebVttScript_=function i(){var r=this;if(e.WebVTT){return}if(t.body.contains(this.el())){if(!this.options_["vtt.js"]&&S(Vr)&&Object.keys(Vr).length>0){this.trigger("vttjsloaded");return}var n=t.createElement("script");n.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js";n.onload=function(){r.trigger("vttjsloaded")};n.onerror=function(){r.trigger("vttjserror")};this.on("dispose",function(){n.onload=null;n.onerror=null});e.WebVTT=true;this.el().parentNode.appendChild(n)}else{this.ready(this.addWebVttScript_)}};a.emulateTextTracks=function e(){var t=this;var i=this.textTracks();var r=this.remoteTextTracks();var n=function e(t){return i.addTrack(t.track)};var a=function e(t){return i.removeTrack(t.track)};r.on("addtrack",n);r.on("removetrack",a);this.addWebVttScript_();var s=function e(){return t.trigger("texttrackchange")};var o=function e(){s();for(var t=0;t<i.length;t++){var r=i[t];r.removeEventListener("cuechange",s);if(r.mode==="showing"){r.addEventListener("cuechange",s)}}};o();i.addEventListener("change",o);i.addEventListener("addtrack",o);i.addEventListener("removetrack",o);this.on("dispose",function(){r.off("addtrack",n);r.off("removetrack",a);i.removeEventListener("change",o);i.removeEventListener("addtrack",o);i.removeEventListener("removetrack",o);for(var e=0;e<i.length;e++){var t=i[e];t.removeEventListener("cuechange",s)}})};a.addTextTrack=function e(t,i,r){if(!t){throw new Error("TextTrack kind is required but was not provided")}return Wr(this,t,i,r)};a.createRemoteTextTrack=function e(t){var i=Ge(t,{tech:this});return new rr.remoteTextEl.TrackClass(i)};a.addRemoteTextTrack=function e(t,i){var r=this;if(t===void 0){t={}}var n=this.createRemoteTextTrack(t);if(i!==true&&i!==false){d.warn('Calling addRemoteTextTrack without explicitly setting the "manualCleanup" parameter to `true` is deprecated and default to `false` in future version of video.js');i=true}this.remoteTextTrackEls().addTrackElement_(n);this.remoteTextTracks().addTrack(n.track);if(i!==true){this.ready(function(){return r.autoRemoteTextTracks_.addTrack(n.track)})}return n};a.removeRemoteTextTrack=function e(t){var i=this.remoteTextTrackEls().getTrackElementByTrack_(t);this.remoteTextTrackEls().removeTrackElement_(i);this.remoteTextTracks().removeTrack(t);this.autoRemoteTextTracks_.removeTrack(t)};a.getVideoPlaybackQuality=function e(){return{}};a.setPoster=function e(){};a.playsinline=function e(){};a.setPlaysinline=function e(){};a.overrideNativeAudioTracks=function e(){};a.overrideNativeVideoTracks=function e(){};a.canPlayType=function e(){return""};n.canPlayType=function e(){return""};n.canPlaySource=function e(t,i){return n.canPlayType(t.type)};n.isTech=function e(t){return t.prototype instanceof n||t instanceof n||t===n};n.registerTech=function e(t,i){if(!n.techs_){n.techs_={}}if(!n.isTech(i)){throw new Error("Tech "+t+" must be a Tech")}if(!n.canPlayType){throw new Error("Techs must have a static canPlayType method on them")}if(!n.canPlaySource){throw new Error("Techs must have a static canPlaySource method on them")}t=ze(t);n.techs_[t]=i;if(t!=="Tech"){n.defaultTechOrder_.push(t)}return i};n.getTech=function t(i){if(!i){return}i=ze(i);if(n.techs_&&n.techs_[i]){return n.techs_[i]}if(e&&e.videojs&&e.videojs[i]){d.warn("The "+i+" tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)");return e.videojs[i]}};return n}(Xe);nr.names.forEach(function(e){var t=nr[e];Gr.prototype[t.getterName]=function(){this[t.privateName]=this[t.privateName]||new t.ListClass;return this[t.privateName]}});Gr.prototype.featuresVolumeControl=true;Gr.prototype.featuresMuteControl=true;Gr.prototype.featuresFullscreenResize=false;Gr.prototype.featuresPlaybackRate=false;Gr.prototype.featuresProgressEvents=false;Gr.prototype.featuresSourceset=false;Gr.prototype.featuresTimeupdateEvents=false;Gr.prototype.featuresNativeTextTracks=false;Gr.withSourceHandlers=function(e){e.registerSourceHandler=function(t,i){var r=e.sourceHandlers;if(!r){r=e.sourceHandlers=[]}if(i===undefined){i=r.length}r.splice(i,0,t)};e.canPlayType=function(t){var i=e.sourceHandlers||[];var r;for(var n=0;n<i.length;n++){r=i[n].canPlayType(t);if(r){return r}}return""};e.selectSourceHandler=function(t,i){var r=e.sourceHandlers||[];var n;for(var a=0;a<r.length;a++){n=r[a].canHandleSource(t,i);if(n){return r[a]}}return null};e.canPlaySource=function(t,i){var r=e.selectSourceHandler(t,i);if(r){return r.canHandleSource(t,i)}return""};var t=["seekable","seeking","duration"];t.forEach(function(e){var t=this[e];if(typeof t!=="function"){return}this[e]=function(){if(this.sourceHandler_&&this.sourceHandler_[e]){return this.sourceHandler_[e].apply(this.sourceHandler_,arguments)}return t.apply(this,arguments)}},e.prototype);e.prototype.setSource=function(t){var i=e.selectSourceHandler(t,this.options_);if(!i){if(e.nativeSourceHandler){i=e.nativeSourceHandler}else{d.error("No source handler found for the current source.")}}this.disposeSourceHandler();this.off("dispose",this.disposeSourceHandler);if(i!==e.nativeSourceHandler){this.currentSource_=t}this.sourceHandler_=i.handleSource(t,this,this.options_);this.one("dispose",this.disposeSourceHandler)};e.prototype.disposeSourceHandler=function(){if(this.currentSource_){this.clearTracks(["audio","video"]);this.currentSource_=null}this.cleanupAutoTextTracks();if(this.sourceHandler_){if(this.sourceHandler_.dispose){this.sourceHandler_.dispose()}this.sourceHandler_=null}}};Xe.registerComponent("Tech",Gr);Gr.registerTech("Tech",Gr);Gr.defaultTechOrder_=[];var Xr={};var Yr={};var Kr={};function $r(e,t){Xr[e]=Xr[e]||[];Xr[e].push(t)}function Qr(e,t,i){e.setTimeout(function(){return cn(t,Xr[t.type],i,e)},1)}function Jr(e,t){e.forEach(function(e){return e.setTech&&e.setTech(t)})}function Zr(e,t,i){return e.reduceRight(sn(i),t[i]())}function en(e,t,i,r){return t[i](e.reduce(sn(i),r))}function tn(e,t,i,r){if(r===void 0){r=null}var n="call"+ze(i);var a=e.reduce(sn(n),r);var s=a===Kr;var o=s?null:t[i](a);on(e,i,o,s);return o}var rn={buffered:1,currentTime:1,duration:1,seekable:1,played:1,paused:1};var nn={setCurrentTime:1};var an={play:1,pause:1};function sn(e){return function(t,i){if(t===Kr){return Kr}if(i[e]){return i[e](t)}return t}}function on(e,t,i,r){for(var n=e.length-1;n>=0;n--){var a=e[n];if(a[t]){a[t](r,i)}}}function un(e){Yr[e.id()]=null}function ln(e,t){var i=Yr[e.id()];var r=null;if(i===undefined||i===null){r=t(e);Yr[e.id()]=[[t,r]];return r}for(var n=0;n<i.length;n++){var a=i[n],s=a[0],o=a[1];if(s!==t){continue}r=o}if(r===null){r=t(e);i.push([t,r])}return r}function cn(e,t,i,r,n,a){if(e===void 0){e={}}if(t===void 0){t=[]}if(n===void 0){n=[]}if(a===void 0){a=false}var s=t,o=s[0],u=s.slice(1);if(typeof o==="string"){cn(e,Xr[o],i,r,n,a)}else if(o){var l=ln(r,o);if(!l.setSource){n.push(l);return cn(e,u,i,r,n,a)}l.setSource(b({},e),function(t,s){if(t){return cn(e,u,i,r,n,a)}n.push(l);cn(s,e.type===s.type?u:Xr[s.type],i,r,n,a)})}else if(u.length){cn(e,u,i,r,n,a)}else if(a){i(e,n)}else{cn(e,Xr["*"],i,r,n,true)}}var fn={opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",mp3:"audio/mpeg",aac:"audio/aac",oga:"audio/ogg",m3u8:"application/x-mpegURL",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",png:"image/png",svg:"image/svg+xml",webp:"image/webp"};var dn=function e(t){if(t===void 0){t=""}var i=ui(t);var r=fn[i.toLowerCase()];return r||""};var hn=function e(t,i){if(!i){return""}if(t.cache_.source.src===i&&t.cache_.source.type){return t.cache_.source.type}var r=t.cache_.sources.filter(function(e){return e.src===i});if(r.length){return r[0].type}var n=t.$$("source");for(var a=0;a<n.length;a++){var s=n[a];if(s.type&&s.src&&s.src===i){return s.type}}return dn(i)};var pn=function e(t){if(Array.isArray(t)){var i=[];t.forEach(function(t){t=e(t);if(Array.isArray(t)){i=i.concat(t)}else if(T(t)){i.push(t)}});t=i}else if(typeof t==="string"&&t.trim()){t=[mn({src:t})]}else if(T(t)&&typeof t.src==="string"&&t.src&&t.src.trim()){t=[mn(t)]}else{t=[]}return t};function mn(e){var t=dn(e.src);if(!e.type&&t){e.type=t}return e}var vn=function(e){r(t,e);function t(t,i,r){var n;var a=Ge({createEl:false},i);n=e.call(this,t,a,r)||this;if(!i.playerOptions.sources||i.playerOptions.sources.length===0){for(var s=0,o=i.playerOptions.techOrder;s<o.length;s++){var u=ze(o[s]);var l=Gr.getTech(u);if(!u){l=Xe.getComponent(u)}if(l&&l.isSupported()){t.loadTech_(u);break}}}else{t.src(i.playerOptions.sources)}return n}return t}(Xe);Xe.registerComponent("MediaLoader",vn);var gn=function(e){r(i,e);function i(t,i){var r;r=e.call(this,t,i)||this;r.emitTapEvents();r.enable();return r}var n=i.prototype;n.createEl=function t(i,r,n){if(i===void 0){i="div"}if(r===void 0){r={}}if(n===void 0){n={}}r=b({innerHTML:'<span aria-hidden="true" class="vjs-icon-placeholder"></span>',className:this.buildCSSClass(),tabIndex:0},r);if(i==="button"){d.error("Creating a ClickableComponent with an HTML element of "+i+" is not supported; use a Button instead.")}n=b({role:"button"},n);this.tabIndex_=r.tabIndex;var a=e.prototype.createEl.call(this,i,r,n);this.createControlTextEl(a);return a};n.dispose=function t(){this.controlTextEl_=null;e.prototype.dispose.call(this)};n.createControlTextEl=function e(t){this.controlTextEl_=U("span",{className:"vjs-control-text"},{"aria-live":"polite"});if(t){t.appendChild(this.controlTextEl_)}this.controlText(this.controlText_,t);return this.controlTextEl_};n.controlText=function e(t,i){if(i===void 0){i=this.el()}if(t===undefined){return this.controlText_||"Need Text"}var r=this.localize(t);this.controlText_=t;D(this.controlTextEl_,r);if(!this.nonIconControl){i.setAttribute("title",r)}};n.buildCSSClass=function t(){return"vjs-control vjs-button "+e.prototype.buildCSSClass.call(this)};n.enable=function e(){if(!this.enabled_){this.enabled_=true;this.removeClass("vjs-disabled");this.el_.setAttribute("aria-disabled","false");if(typeof this.tabIndex_!=="undefined"){this.el_.setAttribute("tabIndex",this.tabIndex_)}this.on(["tap","click"],this.handleClick);this.on("focus",this.handleFocus);this.on("blur",this.handleBlur)}};n.disable=function e(){this.enabled_=false;this.addClass("vjs-disabled");this.el_.setAttribute("aria-disabled","true");if(typeof this.tabIndex_!=="undefined"){this.el_.removeAttribute("tabIndex")}this.off(["tap","click"],this.handleClick);this.off("focus",this.handleFocus);this.off("blur",this.handleBlur)};n.handleClick=function e(t){};n.handleFocus=function e(i){ve(t,"keydown",Ae(this,this.handleKeyPress))};n.handleKeyPress=function t(i){if(Nt.isEventKey(i,"Space")||Nt.isEventKey(i,"Enter")){i.preventDefault();this.trigger("click")}else{e.prototype.handleKeyPress.call(this,i)}};n.handleBlur=function e(i){ge(t,"keydown",Ae(this,this.handleKeyPress))};return i}(Xe);Xe.registerComponent("ClickableComponent",gn);var yn=function(e){r(t,e);function t(t,i){var r;r=e.call(this,t,i)||this;r.update();t.on("posterchange",Ae(o(o(r)),r.update));return r}var i=t.prototype;i.dispose=function t(){this.player().off("posterchange",this.update);e.prototype.dispose.call(this)};i.createEl=function e(){var t=U("div",{className:"vjs-poster",tabIndex:-1});return t};i.update=function e(t){var i=this.player().poster();this.setSrc(i);if(i){this.show()}else{this.hide()}};i.setSrc=function e(t){var i="";if(t){i='url("'+t+'")'}this.el_.style.backgroundImage=i};i.handleClick=function e(t){if(!this.player_.controls()){return}if(this.player_.paused()){Ot(this.player_.play())}else{this.player_.pause()}this.player_.handleFocus({})};return t}(gn);Xe.registerComponent("PosterImage",yn);var _n="#222";var bn="#ccc";var Tn={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 Sn(e,t){var i;if(e.length===4){i=e[1]+e[1]+e[2]+e[2]+e[3]+e[3]}else if(e.length===7){i=e.slice(1)}else{throw new Error("Invalid color code provided, "+e+"; must be formatted as e.g. #f0e or #f604e2.")}return"rgba("+parseInt(i.slice(0,2),16)+","+parseInt(i.slice(2,4),16)+","+parseInt(i.slice(4,6),16)+","+t+")"}function kn(e,t,i){try{e.style[t]=i}catch(e){return}}var wn=function(t){r(i,t);function i(i,r,n){var a;a=t.call(this,i,r,n)||this;var s=Ae(o(o(a)),a.updateDisplay);i.on("loadstart",Ae(o(o(a)),a.toggleDisplay));i.on("texttrackchange",s);i.on("loadedmetadata",Ae(o(o(a)),a.preselectTrack));i.ready(Ae(o(o(a)),function(){if(i.tech_&&i.tech_.featuresNativeTextTracks){this.hide();return}i.on("fullscreenchange",s);i.on("playerresize",s);e.addEventListener("orientationchange",s);i.on("dispose",function(){return e.removeEventListener("orientationchange",s)});var t=this.options_.playerOptions.tracks||[];for(var r=0;r<t.length;r++){this.player_.addRemoteTextTrack(t[r],true)}this.preselectTrack()}));return a}var n=i.prototype;n.preselectTrack=function e(){var t={captions:1,subtitles:1};var i=this.player_.textTracks();var r=this.player_.cache_.selectedLanguage;var n;var a;var s;for(var o=0;o<i.length;o++){var u=i[o];if(r&&r.enabled&&r.language&&r.language===u.language&&u.kind in t){if(u.kind===r.kind){s=u}else if(!s){s=u}}else if(r&&!r.enabled){s=null;n=null;a=null}else if(u.default){if(u.kind==="descriptions"&&!n){n=u}else if(u.kind in t&&!a){a=u}}}if(s){s.mode="showing"}else if(a){a.mode="showing"}else if(n){n.mode="showing"}};n.toggleDisplay=function e(){if(this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks){this.hide()}else{this.show()}};n.createEl=function e(){return t.prototype.createEl.call(this,"div",{className:"vjs-text-track-display"},{"aria-live":"off","aria-atomic":"true"})};n.clearDisplay=function t(){if(typeof e.WebVTT==="function"){e.WebVTT.processCues(e,[],this.el_)}};n.updateDisplay=function e(){var t=this.player_.textTracks();this.clearDisplay();var i=null;var r=null;var n=t.length;while(n--){var a=t[n];if(a.mode==="showing"){if(a.kind==="descriptions"){i=a}else{r=a}}}if(r){if(this.getAttribute("aria-live")!=="off"){this.setAttribute("aria-live","off")}this.updateForTrack(r)}else if(i){if(this.getAttribute("aria-live")!=="assertive"){this.setAttribute("aria-live","assertive")}this.updateForTrack(i)}};n.updateForTrack=function t(i){if(typeof e.WebVTT!=="function"||!i.activeCues){return}var r=[];for(var n=0;n<i.activeCues.length;n++){r.push(i.activeCues[n])}e.WebVTT.processCues(e,r,this.el_);if(!this.player_.textTrackSettings){return}var a=this.player_.textTrackSettings.getValues();var s=r.length;while(s--){var o=r[s];if(!o){continue}var u=o.displayState;if(a.color){u.firstChild.style.color=a.color}if(a.textOpacity){kn(u.firstChild,"color",Sn(a.color||"#fff",a.textOpacity))}if(a.backgroundColor){u.firstChild.style.backgroundColor=a.backgroundColor}if(a.backgroundOpacity){kn(u.firstChild,"backgroundColor",Sn(a.backgroundColor||"#000",a.backgroundOpacity))}if(a.windowColor){if(a.windowOpacity){kn(u,"backgroundColor",Sn(a.windowColor,a.windowOpacity))}else{u.style.backgroundColor=a.windowColor}}if(a.edgeStyle){if(a.edgeStyle==="dropshadow"){u.firstChild.style.textShadow="2px 2px 3px "+_n+", 2px 2px 4px "+_n+", 2px 2px 5px "+_n}else if(a.edgeStyle==="raised"){u.firstChild.style.textShadow="1px 1px "+_n+", 2px 2px "+_n+", 3px 3px "+_n}else if(a.edgeStyle==="depressed"){u.firstChild.style.textShadow="1px 1px "+bn+", 0 1px "+bn+", -1px -1px "+_n+", 0 -1px "+_n}else if(a.edgeStyle==="uniform"){u.firstChild.style.textShadow="0 0 4px "+_n+", 0 0 4px "+_n+", 0 0 4px "+_n+", 0 0 4px "+_n}}if(a.fontPercent&&a.fontPercent!==1){var l=e.parseFloat(u.style.fontSize);u.style.fontSize=l*a.fontPercent+"px";u.style.height="auto";u.style.top="auto";u.style.bottom="2px"}if(a.fontFamily&&a.fontFamily!=="default"){if(a.fontFamily==="small-caps"){u.firstChild.style.fontVariant="small-caps"}else{u.firstChild.style.fontFamily=Tn[a.fontFamily]}}}};return i}(Xe);Xe.registerComponent("TextTrackDisplay",wn);var Cn=function(e){r(t,e);function t(){return e.apply(this,arguments)||this}var i=t.prototype;i.createEl=function t(){var i=this.player_.isAudio();var r=this.localize(i?"Audio Player":"Video Player");var n=U("span",{className:"vjs-control-text",innerHTML:this.localize("{1} is loading.",[r])});var a=e.prototype.createEl.call(this,"div",{className:"vjs-loading-spinner",dir:"ltr"});a.appendChild(n);return a};return t}(Xe);Xe.registerComponent("LoadingSpinner",Cn);var En=function(e){r(t,e);function t(){return e.apply(this,arguments)||this}var i=t.prototype;i.createEl=function e(t,i,r){if(i===void 0){i={}}if(r===void 0){r={}}t="button";i=b({innerHTML:'<span aria-hidden="true" class="vjs-icon-placeholder"></span>',className:this.buildCSSClass()},i);r=b({type:"button"},r);var n=Xe.prototype.createEl.call(this,t,i,r);this.createControlTextEl(n);return n};i.addChild=function e(t,i){if(i===void 0){i={}}var r=this.constructor.name;d.warn("Adding an actionable (user controllable) child to a Button ("+r+") is not supported; use a ClickableComponent instead.");return Xe.prototype.addChild.call(this,t,i)};i.enable=function t(){e.prototype.enable.call(this);this.el_.removeAttribute("disabled")};i.disable=function t(){e.prototype.disable.call(this);this.el_.setAttribute("disabled","disabled")};i.handleKeyPress=function t(i){if(!(Nt.isEventKey(i,"Space")||Nt.isEventKey(i,"Enter"))){e.prototype.handleKeyPress.call(this,i)}};return t}(gn);Xe.registerComponent("Button",En);var An=function(e){r(t,e);function t(t,i){var r;r=e.call(this,t,i)||this;r.mouseused_=false;r.on("mousedown",r.handleMouseDown);return r}var i=t.prototype;i.buildCSSClass=function e(){return"vjs-big-play-button"};i.handleClick=function e(t){var i=this.player_.play();if(this.mouseused_&&t.clientX&&t.clientY){Ot(i);this.player_.handleFocus({});return}var r=this.player_.getChild("controlBar");var n=r&&r.getChild("playToggle");if(!n){this.player_.focus();return}var a=function e(){return n.focus()};if(Pt(i)){i.then(a,function(){})}else{this.setTimeout(a,1)}};i.handleKeyPress=function t(i){this.mouseused_=false;e.prototype.handleKeyPress.call(this,i)};i.handleMouseDown=function e(t){this.mouseused_=true};return t}(En);An.prototype.controlText_="Play Video";Xe.registerComponent("BigPlayButton",An);var Ln=function(e){r(t,e);function t(t,i){var r;r=e.call(this,t,i)||this;r.controlText(i&&i.controlText||r.localize("Close"));return r}var i=t.prototype;i.buildCSSClass=function t(){return"vjs-close-button "+e.prototype.buildCSSClass.call(this)};i.handleKeyPress=function e(t){};i.handleClick=function e(t){this.trigger({type:"close",bubbles:false})};return t}(En);Xe.registerComponent("CloseButton",Ln);var In=function(e){r(t,e);function t(t,i){var r;if(i===void 0){i={}}r=e.call(this,t,i)||this;i.replay=i.replay===undefined||i.replay;r.on(t,"play",r.handlePlay);r.on(t,"pause",r.handlePause);if(i.replay){r.on(t,"ended",r.handleEnded)}return r}var i=t.prototype;i.buildCSSClass=function t(){return"vjs-play-control "+e.prototype.buildCSSClass.call(this)};i.handleClick=function e(t){if(this.player_.paused()){this.player_.play()}else{this.player_.pause()}};i.handleSeeked=function e(t){this.removeClass("vjs-ended");if(this.player_.paused()){this.handlePause(t)}else{this.handlePlay(t)}};i.handlePlay=function e(t){this.removeClass("vjs-ended");this.removeClass("vjs-paused");this.addClass("vjs-playing");this.controlText("Pause")};i.handlePause=function e(t){this.removeClass("vjs-playing");this.addClass("vjs-paused");this.controlText("Play")};i.handleEnded=function e(t){this.removeClass("vjs-playing");this.addClass("vjs-ended");this.controlText("Replay");this.one(this.player_,"seeked",this.handleSeeked)};return t}(En);In.prototype.controlText_="Play";Xe.registerComponent("PlayToggle",In);var Pn=function e(t,i){t=t<0?0:t;var r=Math.floor(t%60);var n=Math.floor(t/60%60);var a=Math.floor(t/3600);var s=Math.floor(i/60%60);var o=Math.floor(i/3600);if(isNaN(t)||t===Infinity){a=n=r="-"}a=a>0||o>0?a+":":"";n=((a||s>=10)&&n<10?"0"+n:n)+":";r=r<10?"0"+r:r;return a+n+r};var On=Pn;function Un(e){On=e}function Dn(){On=Pn}function xn(e,t){if(t===void 0){t=e}return On(e,t)}var Rn=function(e){r(i,e);function i(t,i){var r;r=e.call(this,t,i)||this;r.throttledUpdateContent=Le(Ae(o(o(r)),r.updateContent),25);r.on(t,"timeupdate",r.throttledUpdateContent);return r}var n=i.prototype;n.createEl=function t(){var i=this.buildCSSClass();var r=e.prototype.createEl.call(this,"div",{className:i+" vjs-time-control vjs-control",innerHTML:'<span class="vjs-control-text" role="presentation">'+this.localize(this.labelText_)+" </span>"});this.contentEl_=U("span",{className:i+"-display"},{"aria-live":"off",role:"presentation"});this.updateTextNode_();r.appendChild(this.contentEl_);return r};n.dispose=function t(){this.contentEl_=null;this.textNode_=null;e.prototype.dispose.call(this)};n.updateTextNode_=function e(){if(!this.contentEl_){return}while(this.contentEl_.firstChild){this.contentEl_.removeChild(this.contentEl_.firstChild)}this.textNode_=t.createTextNode(this.formattedTime_||this.formatTime_(0));this.contentEl_.appendChild(this.textNode_)};n.formatTime_=function e(t){return xn(t)};n.updateFormattedTime_=function e(t){var i=this.formatTime_(t);if(i===this.formattedTime_){return}this.formattedTime_=i;this.requestAnimationFrame(this.updateTextNode_)};n.updateContent=function e(t){};return i}(Xe);Rn.prototype.labelText_="Time";Rn.prototype.controlText_="Time";Xe.registerComponent("TimeDisplay",Rn);var Mn=function(e){r(t,e);function t(t,i){var r;r=e.call(this,t,i)||this;r.on(t,"ended",r.handleEnded);return r}var i=t.prototype;i.buildCSSClass=function e(){return"vjs-current-time"};i.updateContent=function e(t){var i=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();this.updateFormattedTime_(i)};i.handleEnded=function e(t){if(!this.player_.duration()){return}this.updateFormattedTime_(this.player_.duration())};return t}(Rn);Mn.prototype.labelText_="Current Time";Mn.prototype.controlText_="Current Time";Xe.registerComponent("CurrentTimeDisplay",Mn);var Bn=function(e){r(t,e);function t(t,i){var r;r=e.call(this,t,i)||this;r.on(t,"durationchange",r.updateContent);r.on(t,"loadstart",r.updateContent);r.on(t,"loadedmetadata",r.throttledUpdateContent);return r}var i=t.prototype;i.buildCSSClass=function e(){return"vjs-duration"};i.updateContent=function e(t){var i=this.player_.duration();if(this.duration_!==i){this.duration_=i;this.updateFormattedTime_(i)}};return t}(Rn);Bn.prototype.labelText_="Duration";Bn.prototype.controlText_="Duration";Xe.registerComponent("DurationDisplay",Bn);var Nn=function(e){r(t,e);function t(){return e.apply(this,arguments)||this}var i=t.prototype;i.createEl=function t(){return e.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider",innerHTML:"<div><span>/</span></div>"},{"aria-hidden":true})};return t}(Xe);Xe.registerComponent("TimeDivider",Nn);var jn=function(e){r(t,e);function t(t,i){var r;r=e.call(this,t,i)||this;r.on(t,"durationchange",r.throttledUpdateContent);r.on(t,"ended",r.handleEnded);return r}var i=t.prototype;i.buildCSSClass=function e(){return"vjs-remaining-time"};i.createEl=function t(){var i=e.prototype.createEl.call(this);i.insertBefore(U("span",{},{"aria-hidden":true},"-"),this.contentEl_);return i};i.updateContent=function e(t){if(typeof this.player_.duration()!=="number"){return}if(this.player_.remainingTimeDisplay){this.updateFormattedTime_(this.player_.remainingTimeDisplay())}else{this.updateFormattedTime_(this.player_.remainingTime())}};i.handleEnded=function e(t){if(!this.player_.duration()){return}this.updateFormattedTime_(0)};return t}(Rn);jn.prototype.labelText_="Remaining Time";jn.prototype.controlText_="Remaining Time";Xe.registerComponent("RemainingTimeDisplay",jn);var Fn=function(e){r(t,e);function t(t,i){var r;r=e.call(this,t,i)||this;r.updateShowing();r.on(r.player(),"durationchange",r.updateShowing);return r}var i=t.prototype;i.createEl=function t(){var i=e.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});this.contentEl_=U("div",{className:"vjs-live-display",innerHTML:'<span class="vjs-control-text">'+this.localize("Stream Type")+" </span>"+this.localize("LIVE")},{"aria-live":"off"});i.appendChild(this.contentEl_);return i};i.dispose=function t(){this.contentEl_=null;e.prototype.dispose.call(this)};i.updateShowing=function e(t){if(this.player().duration()===Infinity){this.show()}else{this.hide()}};return t}(Xe);Xe.registerComponent("LiveDisplay",Fn);var Vn=function(e){r(t,e);function t(t,i){var r;r=e.call(this,t,i)||this;r.updateLiveEdgeStatus();if(r.player_.liveTracker){r.on(r.player_.liveTracker,"liveedgechange",r.updateLiveEdgeStatus)}return r}var i=t.prototype;i.createEl=function t(){var i=e.prototype.createEl.call(this,"button",{className:"vjs-seek-to-live-control vjs-control"});this.textEl_=U("span",{className:"vjs-seek-to-live-text",innerHTML:this.localize("LIVE")},{"aria-hidden":"true"});i.appendChild(this.textEl_);return i};i.updateLiveEdgeStatus=function e(t){if(!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()){this.setAttribute("aria-disabled",true);this.addClass("vjs-at-live-edge");this.controlText("Seek to live, currently playing live")}else{this.setAttribute("aria-disabled",false);this.removeClass("vjs-at-live-edge");this.controlText("Seek to live, currently behind live")}};i.handleClick=function e(){this.player_.liveTracker.seekToLiveEdge()};i.dispose=function t(){if(this.player_.liveTracker){this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatus)}this.textEl_=null;e.prototype.dispose.call(this)};return t}(En);Vn.prototype.controlText_="Seek to live, currently playing live";Xe.registerComponent("SeekToLive",Vn);var Hn=function(e){r(t,e);function t(t,i){var r;r=e.call(this,t,i)||this;r.bar=r.getChild(r.options_.barName);r.vertical(!!r.options_.vertical);r.enable();return r}var i=t.prototype;i.enabled=function e(){return this.enabled_};i.enable=function e(){if(this.enabled()){return}this.on("mousedown",this.handleMouseDown);this.on("touchstart",this.handleMouseDown);this.on("focus",this.handleFocus);this.on("blur",this.handleBlur);this.on("click",this.handleClick);this.on(this.player_,"controlsvisible",this.update);if(this.playerEvent){this.on(this.player_,this.playerEvent,this.update)}this.removeClass("disabled");this.setAttribute("tabindex",0);this.enabled_=true};i.disable=function e(){if(!this.enabled()){return}var t=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown);this.off("touchstart",this.handleMouseDown);this.off("focus",this.handleFocus);this.off("blur",this.handleBlur);this.off("click",this.handleClick);this.off(this.player_,"controlsvisible",this.update);this.off(t,"mousemove",this.handleMouseMove);this.off(t,"mouseup",this.handleMouseUp);this.off(t,"touchmove",this.handleMouseMove);this.off(t,"touchend",this.handleMouseUp);this.removeAttribute("tabindex");this.addClass("disabled");if(this.playerEvent){this.off(this.player_,this.playerEvent,this.update)}this.enabled_=false};i.createEl=function t(i,r,n){if(r===void 0){r={}}if(n===void 0){n={}}r.className=r.className+" vjs-slider";r=b({tabIndex:0},r);n=b({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},n);return e.prototype.createEl.call(this,i,r,n)};i.handleMouseDown=function e(t){var i=this.bar.el_.ownerDocument;if(t.type==="mousedown"){t.preventDefault()}if(t.type==="touchstart"&&!ot){t.preventDefault()}z();this.addClass("vjs-sliding");this.trigger("slideractive");this.on(i,"mousemove",this.handleMouseMove);this.on(i,"mouseup",this.handleMouseUp);this.on(i,"touchmove",this.handleMouseMove);this.on(i,"touchend",this.handleMouseUp);this.handleMouseMove(t)};i.handleMouseMove=function e(t){};i.handleMouseUp=function e(){var t=this.bar.el_.ownerDocument;W();this.removeClass("vjs-sliding");this.trigger("sliderinactive");this.off(t,"mousemove",this.handleMouseMove);this.off(t,"mouseup",this.handleMouseUp);this.off(t,"touchmove",this.handleMouseMove);this.off(t,"touchend",this.handleMouseUp);this.update()};i.update=function e(){if(!this.el_){return}var t=this.getPercent();var i=this.bar;if(!i){return}if(typeof t!=="number"||t!==t||t<0||t===Infinity){t=0}var r=(t*100).toFixed(2)+"%";var n=i.el().style;if(this.vertical()){n.height=r}else{n.width=r}return t};i.calculateDistance=function e(t){var i=Y(this.el_,t);if(this.vertical()){return i.y}return i.x};i.handleFocus=function e(){this.on(this.bar.el_.ownerDocument,"keydown",this.handleKeyPress)};i.handleKeyPress=function t(i){if(Nt.isEventKey(i,"Left")||Nt.isEventKey(i,"Down")){i.preventDefault();this.stepBack()}else if(Nt.isEventKey(i,"Right")||Nt.isEventKey(i,"Up")){i.preventDefault();this.stepForward()}else{e.prototype.handleKeyPress.call(this,i)}};i.handleBlur=function e(){this.off(this.bar.el_.ownerDocument,"keydown",this.handleKeyPress)};i.handleClick=function e(t){t.stopImmediatePropagation();t.preventDefault()};i.vertical=function e(t){if(t===undefined){return this.vertical_||false}this.vertical_=!!t;if(this.vertical_){this.addClass("vjs-slider-vertical")}else{this.addClass("vjs-slider-horizontal")}};return t}(Xe);Xe.registerComponent("Slider",Hn);var qn=function(e){r(t,e);function t(t,i){var r;r=e.call(this,t,i)||this;r.partEls_=[];r.on(t,"progress",r.update);return r}var i=t.prototype;i.createEl=function t(){return e.prototype.createEl.call(this,"div",{className:"vjs-load-progress",innerHTML:'<span class="vjs-control-text"><span>'+this.localize("Loaded")+'</span>: <span class="vjs-control-text-loaded-percentage">0%</span></span>'})};i.dispose=function t(){this.partEls_=null;e.prototype.dispose.call(this)};i.update=function e(t){var i=this.player_.liveTracker;var r=this.player_.buffered();var n=i&&i.isLive()?i.seekableEnd():this.player_.duration();var a=this.player_.bufferedEnd();var s=this.partEls_;var o=this.$(".vjs-control-text-loaded-percentage");var u=function e(t,i,r){var n=t/i||0;n=(n>=1?1:n)*100;if(r){n=n.toFixed(2)}return n+"%"};this.el_.style.width=u(a,n);D(o,u(a,n,true));for(var l=0;l<r.length;l++){var c=r.start(l);var f=r.end(l);var d=s[l];if(!d){d=this.el_.appendChild(U());s[l]=d}d.style.left=u(c,a);d.style.width=u(f-c,a)}for(var h=s.length;h>r.length;h--){this.el_.removeChild(s[h-1])}s.length=r.length};return t}(Xe);Xe.registerComponent("LoadProgressBar",qn);var zn=function(e){r(t,e);function t(){return e.apply(this,arguments)||this}var i=t.prototype;i.createEl=function t(){return e.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})};i.update=function e(t,i,r){var n=G(this.el_);var a=G(this.player_.el());var s=t.width*i;if(!a||!n){return}var o=t.left-a.left+s;var u=t.width-s+(a.right-t.right);var l=n.width/2;if(o<l){l+=l-o}else if(u<l){l=u}if(l<0){l=0}else if(l>n.width){l=n.width}this.el_.style.right="-"+l+"px";D(this.el_,r)};i.updateTime=function e(t,i,r,n){var a=this;if(this.rafId_){this.cancelAnimationFrame(this.rafId_)}this.rafId_=this.requestAnimationFrame(function(){var e;var s=a.player_.duration();if(a.player_.liveTracker&&a.player_.liveTracker.isLive()){var o=a.player_.liveTracker.liveWindow();var u=o-i*o;e=(u<1?"":"-")+xn(u,o)}else{e=xn(r,s)}a.update(t,i,e);if(n){n()}})};return t}(Xe);Xe.registerComponent("TimeTooltip",zn);var Wn=function(e){r(t,e);function t(){return e.apply(this,arguments)||this}var i=t.prototype;i.createEl=function t(){return e.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})};i.update=function e(t,i){var r=this.getChild("timeTooltip");if(!r){return}var n=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();r.updateTime(t,i,n)};return t}(Xe);Wn.prototype.options_={children:[]};if(!et&&!it){Wn.prototype.options_.children.push("timeTooltip")}Xe.registerComponent("PlayProgressBar",Wn);var Gn=function(e){r(t,e);function t(t,i){var r;r=e.call(this,t,i)||this;r.update=Le(Ae(o(o(r)),r.update),25);return r}var i=t.prototype;i.createEl=function t(){return e.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})};i.update=function e(t,i){var r=this;var n=i*this.player_.duration();this.getChild("timeTooltip").updateTime(t,i,n,function(){r.el_.style.left=t.width*i+"px"})};return t}(Xe);Gn.prototype.options_={children:["timeTooltip"]};Xe.registerComponent("MouseTimeDisplay",Gn);var Xn=5;var Yn=12;var Kn=30;var $n=function(e){r(i,e);function i(t,i){var r;r=e.call(this,t,i)||this;r.setEventHandlers_();return r}var n=i.prototype;n.setEventHandlers_=function e(){this.update=Le(Ae(this,this.update),Kn);this.on(this.player_,"timeupdate",this.update);this.on(this.player_,"ended",this.handleEnded);this.on(this.player_,"durationchange",this.update);if(this.player_.liveTracker){this.on(this.player_.liveTracker,"liveedgechange",this.update)}this.updateInterval=null;this.on(this.player_,["playing"],this.enableInterval_);this.on(this.player_,["ended","pause","waiting"],this.disableInterval_);if("hidden"in t&&"visibilityState"in t){this.on(t,"visibilitychange",this.toggleVisibility_)}};n.toggleVisibility_=function e(i){if(t.hidden){this.disableInterval_(i)}else{this.enableInterval_();this.requestAnimationFrame(this.update)}};n.enableInterval_=function e(){var t=this;this.clearInterval(this.updateInterval);this.updateInterval=this.setInterval(function(){t.requestAnimationFrame(t.update)},Kn)};n.disableInterval_=function e(t){if(this.player_.liveTracker&&this.player_.liveTracker.isLive()&&t.type!=="ended"){return}this.clearInterval(this.updateInterval)};n.createEl=function t(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})};n.update_=function e(t,i){var r=this.player_.liveTracker;var n=this.player_.duration();if(r&&r.isLive()){n=this.player_.liveTracker.liveCurrentTime()}this.el_.setAttribute("aria-valuenow",(i*100).toFixed(2));this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[xn(t,n),xn(n,n)],"{1} of {2}"));if(this.bar){this.bar.update(G(this.el_),i)}};n.update=function t(i){if(this.el().offsetParent===null){return}var r=e.prototype.update.call(this);this.update_(this.getCurrentTime_(),r);return r};n.getCurrentTime_=function e(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()};n.handleEnded=function e(t){this.update_(this.player_.duration(),1)};n.getPercent=function e(){var t=this.getCurrentTime_();var i;var r=this.player_.liveTracker;if(r&&r.isLive()){i=(t-r.seekableStart())/r.liveWindow();if(r.atLiveEdge()){i=1}}else{i=t/this.player_.duration()}return i>=1?1:i||0};n.handleMouseDown=function t(i){if(!ee(i)){return}i.stopPropagation();this.player_.scrubbing(true);this.videoWasPlaying=!this.player_.paused();this.player_.pause();e.prototype.handleMouseDown.call(this,i)};n.handleMouseMove=function e(t){if(!ee(t)){return}var i;var r=this.calculateDistance(t);var n=this.player_.liveTracker;if(!n||!n.isLive()){i=r*this.player_.duration();if(i===this.player_.duration()){i=i-.1}}else{var a=n.seekableStart();var s=n.liveCurrentTime();i=a+r*n.liveWindow();if(i>=s){i=s}if(i<=a){i=a+.1}if(i===Infinity){return}}this.player_.currentTime(i)};n.enable=function t(){e.prototype.enable.call(this);var i=this.getChild("mouseTimeDisplay");if(!i){return}i.show()};n.disable=function t(){e.prototype.disable.call(this);var i=this.getChild("mouseTimeDisplay");if(!i){return}i.hide()};n.handleMouseUp=function t(i){e.prototype.handleMouseUp.call(this,i);if(i){i.stopPropagation()}this.player_.scrubbing(false);this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:true});if(this.videoWasPlaying){Ot(this.player_.play())}};n.stepForward=function e(){this.player_.currentTime(this.player_.currentTime()+Xn)};n.stepBack=function e(){this.player_.currentTime(this.player_.currentTime()-Xn)};n.handleAction=function e(t){if(this.player_.paused()){this.player_.play()}else{this.player_.pause()}};n.handleKeyPress=function t(i){if(Nt.isEventKey(i,"Space")||Nt.isEventKey(i,"Enter")){i.preventDefault();this.handleAction(i)}else if(Nt.isEventKey(i,"Home")){i.preventDefault();this.player_.currentTime(0)}else if(Nt.isEventKey(i,"End")){i.preventDefault();this.player_.currentTime(this.player_.duration())}else if(/^[0-9]$/.test(Nt(i))){i.preventDefault();var r=(Nt.codes[Nt(i)]-Nt.codes["0"])*10/100;this.player_.currentTime(this.player_.duration()*r)}else if(Nt.isEventKey(i,"PgDn")){i.preventDefault();this.player_.currentTime(this.player_.currentTime()-Xn*Yn)}else if(Nt.isEventKey(i,"PgUp")){i.preventDefault();this.player_.currentTime(this.player_.currentTime()+Xn*Yn)}else{e.prototype.handleKeyPress.call(this,i)}};return i}(Hn);$n.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"};if(!et&&!it){$n.prototype.options_.children.splice(1,0,"mouseTimeDisplay")}Xe.registerComponent("SeekBar",$n);var Qn=function(e){r(t,e);function t(t,i){var r;r=e.call(this,t,i)||this;r.handleMouseMove=Le(Ae(o(o(r)),r.handleMouseMove),25);r.throttledHandleMouseSeek=Le(Ae(o(o(r)),r.handleMouseSeek),25);r.enable();return r}var i=t.prototype;i.createEl=function t(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})};i.handleMouseMove=function e(t){var i=this.getChild("seekBar");if(i){var r=i.getChild("mouseTimeDisplay");var n=i.el();var a=G(n);var s=Y(n,t).x;if(s>1){s=1}else if(s<0){s=0}if(r){r.update(a,s)}}};i.handleMouseSeek=function e(t){var i=this.getChild("seekBar");if(i){i.handleMouseMove(t)}};i.enabled=function e(){return this.enabled_};i.disable=function e(){this.children().forEach(function(e){return e.disable&&e.disable()});if(!this.enabled()){return}this.off(["mousedown","touchstart"],this.handleMouseDown);this.off(this.el_,"mousemove",this.handleMouseMove);this.handleMouseUp();this.addClass("disabled");this.enabled_=false};i.enable=function e(){this.children().forEach(function(e){return e.enable&&e.enable()});if(this.enabled()){return}this.on(["mousedown","touchstart"],this.handleMouseDown);this.on(this.el_,"mousemove",this.handleMouseMove);this.removeClass("disabled");this.enabled_=true};i.handleMouseDown=function e(t){var i=this.el_.ownerDocument;var r=this.getChild("seekBar");if(r){r.handleMouseDown(t)}this.on(i,"mousemove",this.throttledHandleMouseSeek);this.on(i,"touchmove",this.throttledHandleMouseSeek);this.on(i,"mouseup",this.handleMouseUp);this.on(i,"touchend",this.handleMouseUp)};i.handleMouseUp=function e(t){var i=this.el_.ownerDocument;var r=this.getChild("seekBar");if(r){r.handleMouseUp(t)}this.off(i,"mousemove",this.throttledHandleMouseSeek);this.off(i,"touchmove",this.throttledHandleMouseSeek);this.off(i,"mouseup",this.handleMouseUp);this.off(i,"touchend",this.handleMouseUp)};return t}(Xe);Qn.prototype.options_={children:["seekBar"]};Xe.registerComponent("ProgressControl",Qn);var Jn=function(e){r(i,e);function i(i,r){var n;n=e.call(this,i,r)||this;n.on(i,"fullscreenchange",n.handleFullscreenChange);if(t[_t.fullscreenEnabled]===false){n.disable()}return n}var n=i.prototype;n.buildCSSClass=function t(){return"vjs-fullscreen-control "+e.prototype.buildCSSClass.call(this)};n.handleFullscreenChange=function e(t){if(this.player_.isFullscreen()){this.controlText("Non-Fullscreen")}else{this.controlText("Fullscreen")}};n.handleClick=function e(t){if(!this.player_.isFullscreen()){this.player_.requestFullscreen()}else{this.player_.exitFullscreen()}};return i}(En);Jn.prototype.controlText_="Fullscreen";Xe.registerComponent("FullscreenToggle",Jn);var Zn=function e(t,i){if(i.tech_&&!i.tech_.featuresVolumeControl){t.addClass("vjs-hidden")}t.on(i,"loadstart",function(){if(!i.tech_.featuresVolumeControl){t.addClass("vjs-hidden")}else{t.removeClass("vjs-hidden")}})};var ea=function(e){r(t,e);function t(){return e.apply(this,arguments)||this}var i=t.prototype;i.createEl=function t(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-level",innerHTML:'<span class="vjs-control-text"></span>'})};return t}(Xe);Xe.registerComponent("VolumeLevel",ea);var ta=function(e){r(t,e);function t(t,i){var r;r=e.call(this,t,i)||this;r.on("slideractive",r.updateLastVolume_);r.on(t,"volumechange",r.updateARIAAttributes);t.ready(function(){return r.updateARIAAttributes()});return r}var i=t.prototype;i.createEl=function t(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})};i.handleMouseDown=function t(i){if(!ee(i)){return}e.prototype.handleMouseDown.call(this,i)};i.handleMouseMove=function e(t){if(!ee(t)){return}this.checkMuted();this.player_.volume(this.calculateDistance(t))};i.checkMuted=function e(){if(this.player_.muted()){this.player_.muted(false)}};i.getPercent=function e(){if(this.player_.muted()){return 0}return this.player_.volume()};i.stepForward=function e(){this.checkMuted();this.player_.volume(this.player_.volume()+.1)};i.stepBack=function e(){this.checkMuted();this.player_.volume(this.player_.volume()-.1)};i.updateARIAAttributes=function e(t){var i=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",i);this.el_.setAttribute("aria-valuetext",i+"%")};i.volumeAsPercentage_=function e(){return Math.round(this.player_.volume()*100)};i.updateLastVolume_=function e(){var t=this;var i=this.player_.volume();this.one("sliderinactive",function(){if(t.player_.volume()===0){t.player_.lastVolume_(i)}})};return t}(Hn);ta.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"};ta.prototype.playerEvent="volumechange";Xe.registerComponent("VolumeBar",ta);var ia=function(e){r(t,e);function t(t,i){var r;if(i===void 0){i={}}i.vertical=i.vertical||false;if(typeof i.volumeBar==="undefined"||S(i.volumeBar)){i.volumeBar=i.volumeBar||{};i.volumeBar.vertical=i.vertical}r=e.call(this,t,i)||this;Zn(o(o(r)),t);r.throttledHandleMouseMove=Le(Ae(o(o(r)),r.handleMouseMove),25);r.on("mousedown",r.handleMouseDown);r.on("touchstart",r.handleMouseDown);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")});return r}var i=t.prototype;i.createEl=function t(){var i="vjs-volume-horizontal";if(this.options_.vertical){i="vjs-volume-vertical"}return e.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control "+i})};i.handleMouseDown=function e(t){var i=this.el_.ownerDocument;this.on(i,"mousemove",this.throttledHandleMouseMove);this.on(i,"touchmove",this.throttledHandleMouseMove);this.on(i,"mouseup",this.handleMouseUp);this.on(i,"touchend",this.handleMouseUp)};i.handleMouseUp=function e(t){var i=this.el_.ownerDocument;this.off(i,"mousemove",this.throttledHandleMouseMove);this.off(i,"touchmove",this.throttledHandleMouseMove);this.off(i,"mouseup",this.handleMouseUp);this.off(i,"touchend",this.handleMouseUp)};i.handleMouseMove=function e(t){this.volumeBar.handleMouseMove(t)};return t}(Xe);ia.prototype.options_={children:["volumeBar"]};Xe.registerComponent("VolumeControl",ia);var ra=function e(t,i){if(i.tech_&&!i.tech_.featuresMuteControl){t.addClass("vjs-hidden")}t.on(i,"loadstart",function(){if(!i.tech_.featuresMuteControl){t.addClass("vjs-hidden")}else{t.removeClass("vjs-hidden")}})};var na=function(e){r(t,e);function t(t,i){var r;r=e.call(this,t,i)||this;ra(o(o(r)),t);r.on(t,["loadstart","volumechange"],r.update);return r}var i=t.prototype;i.buildCSSClass=function t(){return"vjs-mute-control "+e.prototype.buildCSSClass.call(this)};i.handleClick=function e(t){var i=this.player_.volume();var r=this.player_.lastVolume_();if(i===0){var n=r<.1?.1:r;this.player_.volume(n);this.player_.muted(false)}else{this.player_.muted(this.player_.muted()?false:true)}};i.update=function e(t){this.updateIcon_();this.updateControlText_()};i.updateIcon_=function e(){var t=this.player_.volume();var i=3;if(et&&this.player_.tech_&&this.player_.tech_.el_){this.player_.muted(this.player_.tech_.el_.muted)}if(t===0||this.player_.muted()){i=0}else if(t<.33){i=1}else if(t<.67){i=2}for(var r=0;r<4;r++){B(this.el_,"vjs-vol-"+r)}M(this.el_,"vjs-vol-"+i)};i.updateControlText_=function e(){var t=this.player_.muted()||this.player_.volume()===0;var i=t?"Unmute":"Mute";if(this.controlText()!==i){this.controlText(i)}};return t}(En);na.prototype.controlText_="Mute";Xe.registerComponent("MuteToggle",na);var aa=function(e){r(t,e);function t(t,i){var r;if(i===void 0){i={}}if(typeof i.inline!=="undefined"){i.inline=i.inline}else{i.inline=true}if(typeof i.volumeControl==="undefined"||S(i.volumeControl)){i.volumeControl=i.volumeControl||{};i.volumeControl.vertical=!i.inline}r=e.call(this,t,i)||this;r.on(t,["loadstart"],r.volumePanelState_);r.on(r.volumeControl,["slideractive"],r.sliderActive_);r.on(r.volumeControl,["sliderinactive"],r.sliderInactive_);return r}var i=t.prototype;i.sliderActive_=function e(){this.addClass("vjs-slider-active")};i.sliderInactive_=function e(){this.removeClass("vjs-slider-active")};i.volumePanelState_=function e(){if(this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")){this.addClass("vjs-hidden")}if(this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")){this.addClass("vjs-mute-toggle-only")}};i.createEl=function t(){var i="vjs-volume-panel-horizontal";if(!this.options_.inline){i="vjs-volume-panel-vertical"}return e.prototype.createEl.call(this,"div",{className:"vjs-volume-panel vjs-control "+i})};return t}(Xe);aa.prototype.options_={children:["muteToggle","volumeControl"]};Xe.registerComponent("VolumePanel",aa);var sa=function(e){r(i,e);function i(t,i){var r;r=e.call(this,t,i)||this;if(i){r.menuButton_=i.menuButton}r.focusedChild_=-1;r.on("keydown",r.handleKeyPress);r.boundHandleBlur_=Ae(o(o(r)),r.handleBlur);r.boundHandleTapClick_=Ae(o(o(r)),r.handleTapClick);return r}var n=i.prototype;n.addEventListenerForItem=function e(t){if(!(t instanceof Xe)){return}this.on(t,"blur",this.boundHandleBlur_);this.on(t,["tap","click"],this.boundHandleTapClick_)};n.removeEventListenerForItem=function e(t){if(!(t instanceof Xe)){return}this.off(t,"blur",this.boundHandleBlur_);this.off(t,["tap","click"],this.boundHandleTapClick_)};n.removeChild=function t(i){if(typeof i==="string"){i=this.getChild(i)}this.removeEventListenerForItem(i);e.prototype.removeChild.call(this,i)};n.addItem=function e(t){var i=this.addChild(t);if(i){this.addEventListenerForItem(i)}};n.createEl=function t(){var i=this.options_.contentElType||"ul";this.contentEl_=U(i,{className:"vjs-menu-content"});this.contentEl_.setAttribute("role","menu");var r=e.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});r.appendChild(this.contentEl_);ve(r,"click",function(e){e.preventDefault();e.stopImmediatePropagation()});return r};n.dispose=function t(){this.contentEl_=null;this.boundHandleBlur_=null;this.boundHandleTapClick_=null;e.prototype.dispose.call(this)};n.handleBlur=function e(i){var r=i.relatedTarget||t.activeElement;if(!this.children().some(function(e){return e.el()===r})){var n=this.menuButton_;if(n&&n.buttonPressed_&&r!==n.el().firstChild){n.unpressButton()}}};n.handleTapClick=function e(t){if(this.menuButton_){this.menuButton_.unpressButton();var i=this.children();if(!Array.isArray(i)){return}var r=i.filter(function(e){return e.el()===t.target})[0];if(!r){return}if(r.name()!=="CaptionSettingsMenuItem"){this.menuButton_.focus()}}};n.handleKeyPress=function e(t){if(Nt.isEventKey(t,"Left")||Nt.isEventKey(t,"Down")){t.preventDefault();this.stepForward()}else if(Nt.isEventKey(t,"Right")||Nt.isEventKey(t,"Up")){t.preventDefault();this.stepBack()}};n.stepForward=function e(){var t=0;if(this.focusedChild_!==undefined){t=this.focusedChild_+1}this.focus(t)};n.stepBack=function e(){var t=0;if(this.focusedChild_!==undefined){t=this.focusedChild_-1}this.focus(t)};n.focus=function e(t){if(t===void 0){t=0}var i=this.children().slice();var r=i.length&&i[0].className&&/vjs-menu-title/.test(i[0].className);if(r){i.shift()}if(i.length>0){if(t<0){t=0}else if(t>=i.length){t=i.length-1}this.focusedChild_=t;i[t].el_.focus()}};return i}(Xe);Xe.registerComponent("Menu",sa);var oa=function(e){r(i,e);function i(t,i){var r;if(i===void 0){i={}}r=e.call(this,t,i)||this;r.menuButton_=new En(t,i);r.menuButton_.controlText(r.controlText_);r.menuButton_.el_.setAttribute("aria-haspopup","true");var n=En.prototype.buildCSSClass();r.menuButton_.el_.className=r.buildCSSClass()+" "+n;r.menuButton_.removeClass("vjs-control");r.addChild(r.menuButton_);r.update();r.enabled_=true;r.on(r.menuButton_,"tap",r.handleClick);r.on(r.menuButton_,"click",r.handleClick);r.on(r.menuButton_,"focus",r.handleFocus);r.on(r.menuButton_,"blur",r.handleBlur);r.on(r.menuButton_,"mouseenter",function(){r.menu.show()});r.on("keydown",r.handleSubmenuKeyPress);return r}var n=i.prototype;n.update=function e(){var t=this.createMenu();if(this.menu){this.menu.dispose();this.removeChild(this.menu)}this.menu=t;this.addChild(t);this.buttonPressed_=false;this.menuButton_.el_.setAttribute("aria-expanded","false");if(this.items&&this.items.length<=this.hideThreshold_){this.hide()}else{this.show()}};n.createMenu=function e(){var t=new sa(this.player_,{menuButton:this});this.hideThreshold_=0;if(this.options_.title){var i=U("li",{className:"vjs-menu-title",innerHTML:ze(this.options_.title),tabIndex:-1});this.hideThreshold_+=1;var r=new Xe(this.player_,{el:i});t.addItem(r)}this.items=this.createItems();if(this.items){for(var n=0;n<this.items.length;n++){t.addItem(this.items[n])}}return t};n.createItems=function e(){};n.createEl=function t(){return e.prototype.createEl.call(this,"div",{className:this.buildWrapperCSSClass()},{})};n.buildWrapperCSSClass=function t(){var i="vjs-menu-button";if(this.options_.inline===true){i+="-inline"}else{i+="-popup"}var r=En.prototype.buildCSSClass();return"vjs-menu-button "+i+" "+r+" "+e.prototype.buildCSSClass.call(this)};n.buildCSSClass=function t(){var i="vjs-menu-button";if(this.options_.inline===true){i+="-inline"}else{i+="-popup"}return"vjs-menu-button "+i+" "+e.prototype.buildCSSClass.call(this)};n.controlText=function e(t,i){if(i===void 0){i=this.menuButton_.el()}return this.menuButton_.controlText(t,i)};n.handleClick=function e(t){if(this.buttonPressed_){this.unpressButton()}else{this.pressButton()}};n.focus=function e(){this.menuButton_.focus()};n.blur=function e(){this.menuButton_.blur()};n.handleFocus=function e(){ve(t,"keydown",Ae(this,this.handleKeyPress))};n.handleBlur=function e(){ge(t,"keydown",Ae(this,this.handleKeyPress))};n.handleKeyPress=function e(t){if(Nt.isEventKey(t,"Esc")||Nt.isEventKey(t,"Tab")){if(this.buttonPressed_){this.unpressButton()}if(!Nt.isEventKey(t,"Tab")){t.preventDefault();this.menuButton_.focus()}}else if(Nt.isEventKey(t,"Up")||Nt.isEventKey(t,"Down")){if(!this.buttonPressed_){t.preventDefault();this.pressButton()}}};n.handleSubmenuKeyPress=function e(t){if(Nt.isEventKey(t,"Esc")||Nt.isEventKey(t,"Tab")){if(this.buttonPressed_){this.unpressButton()}if(!Nt.isEventKey(t,"Tab")){t.preventDefault();this.menuButton_.focus()}}};n.pressButton=function e(){if(this.enabled_){this.buttonPressed_=true;this.menu.show();this.menu.lockShowing();this.menuButton_.el_.setAttribute("aria-expanded","true");if(et&&P()){return}this.menu.focus()}};n.unpressButton=function e(){if(this.enabled_){this.buttonPressed_=false;this.menu.unlockShowing();this.menu.hide();this.menuButton_.el_.setAttribute("aria-expanded","false")}};n.disable=function e(){this.unpressButton();this.enabled_=false;this.addClass("vjs-disabled");this.menuButton_.disable()};n.enable=function e(){this.enabled_=true;this.removeClass("vjs-disabled");this.menuButton_.enable()};return i}(Xe);Xe.registerComponent("MenuButton",oa);var ua=function(e){r(t,e);function t(t,i){var r;var n=i.tracks;r=e.call(this,t,i)||this;if(r.items.length<=1){r.hide()}if(!n){return o(r)}var a=Ae(o(o(r)),r.update);n.addEventListener("removetrack",a);n.addEventListener("addtrack",a);r.player_.on("ready",a);r.player_.on("dispose",function(){n.removeEventListener("removetrack",a);n.removeEventListener("addtrack",a)});return r}return t}(oa);Xe.registerComponent("TrackButton",ua);var la=["Tab","Esc","Up","Down","Right","Left"];var ca=function(e){r(t,e);function t(t,i){var r;r=e.call(this,t,i)||this;r.selectable=i.selectable;r.isSelected_=i.selected||false;r.multiSelectable=i.multiSelectable;r.selected(r.isSelected_);if(r.selectable){if(r.multiSelectable){r.el_.setAttribute("role","menuitemcheckbox")}else{r.el_.setAttribute("role","menuitemradio")}}else{r.el_.setAttribute("role","menuitem")}return r}var i=t.prototype;i.createEl=function t(i,r,n){this.nonIconControl=true;return e.prototype.createEl.call(this,"li",b({className:"vjs-menu-item",innerHTML:'<span class="vjs-menu-item-text">'+this.localize(this.options_.label)+"</span>",tabIndex:-1},r),n)};i.handleKeyPress=function t(i){if(!la.some(function(e){return Nt.isEventKey(i,e)})){e.prototype.handleKeyPress.call(this,i)}};i.handleClick=function e(t){this.selected(true)};i.selected=function e(t){if(this.selectable){if(t){this.addClass("vjs-selected");this.el_.setAttribute("aria-checked","true");this.controlText(", selected");this.isSelected_=true}else{this.removeClass("vjs-selected");this.el_.setAttribute("aria-checked","false");this.controlText("");this.isSelected_=false}}};return t}(gn);Xe.registerComponent("MenuItem",ca);var fa=function(i){r(n,i);function n(r,n){var a;var s=n.track;var u=r.textTracks();n.label=s.label||s.language||"Unknown";n.selected=s.mode==="showing";a=i.call(this,r,n)||this;a.track=s;var l=function e(){for(var t=arguments.length,i=new Array(t),r=0;r<t;r++){i[r]=arguments[r]}a.handleTracksChange.apply(o(o(a)),i)};var c=function e(){for(var t=arguments.length,i=new Array(t),r=0;r<t;r++){i[r]=arguments[r]}a.handleSelectedLanguageChange.apply(o(o(a)),i)};r.on(["loadstart","texttrackchange"],l);u.addEventListener("change",l);u.addEventListener("selectedlanguagechange",c);a.on("dispose",function(){r.off(["loadstart","texttrackchange"],l);u.removeEventListener("change",l);u.removeEventListener("selectedlanguagechange",c)});if(u.onchange===undefined){var f;a.on(["tap","click"],function(){if(typeof e.Event!=="object"){try{f=new e.Event("change")}catch(e){}}if(!f){f=t.createEvent("Event");f.initEvent("change",true,true)}u.dispatchEvent(f)})}a.handleTracksChange();return a}var a=n.prototype;a.handleClick=function e(t){var r=this.track;var n=this.player_.textTracks();i.prototype.handleClick.call(this,t);if(!n){return}var a=(r.kinds||[r.kind]).filter(Boolean);for(var s=0;s<n.length;s++){var o=n[s];if(a.indexOf(o.kind)===-1){continue}if(o===r){if(o.mode!=="showing"){o.mode="showing"}}else if(o.mode!=="disabled"){o.mode="disabled"}}};a.handleTracksChange=function e(t){var i=this.track.mode==="showing";if(i!==this.isSelected_){this.selected(i)}};a.handleSelectedLanguageChange=function e(t){if(this.track.mode==="showing"){var i=this.player_.cache_.selectedLanguage;if(i&&i.enabled&&i.language===this.track.language&&i.kind!==this.track.kind){return}this.player_.cache_.selectedLanguage={enabled:true,language:this.track.language,kind:this.track.kind}}};a.dispose=function e(){this.track=null;i.prototype.dispose.call(this)};return n}(ca);Xe.registerComponent("TextTrackMenuItem",fa);var da=function(e){r(t,e);function t(t,i){i.track={player:t,kind:i.kind,kinds:i.kinds,default:false,mode:"disabled"};if(!i.kinds){i.kinds=[i.kind]}if(i.label){i.track.label=i.label}else{i.track.label=i.kinds.join(" and ")+" off"}i.selectable=true;i.multiSelectable=false;return e.call(this,t,i)||this}var i=t.prototype;i.handleTracksChange=function e(t){var i=this.player().textTracks();var r=true;for(var n=0,a=i.length;n<a;n++){var s=i[n];if(this.options_.kinds.indexOf(s.kind)>-1&&s.mode==="showing"){r=false;break}}if(r!==this.isSelected_){this.selected(r)}};i.handleSelectedLanguageChange=function e(t){var i=this.player().textTracks();var r=true;for(var n=0,a=i.length;n<a;n++){var s=i[n];if(["captions","descriptions","subtitles"].indexOf(s.kind)>-1&&s.mode==="showing"){r=false;break}}if(r){this.player_.cache_.selectedLanguage={enabled:false}}};return t}(fa);Xe.registerComponent("OffTextTrackMenuItem",da);var ha=function(e){r(t,e);function t(t,i){if(i===void 0){i={}}i.tracks=t.textTracks();return e.call(this,t,i)||this}var i=t.prototype;i.createItems=function e(t,i){if(t===void 0){t=[]}if(i===void 0){i=fa}var r;if(this.label_){r=this.label_+" off"}t.push(new da(this.player_,{kinds:this.kinds_,kind:this.kind_,label:r}));this.hideThreshold_+=1;var n=this.player_.textTracks();if(!Array.isArray(this.kinds_)){this.kinds_=[this.kind_]}for(var a=0;a<n.length;a++){var s=n[a];if(this.kinds_.indexOf(s.kind)>-1){var o=new i(this.player_,{track:s,selectable:true,multiSelectable:false});o.addClass("vjs-"+s.kind+"-menu-item");t.push(o)}}return t};return t}(ua);Xe.registerComponent("TextTrackButton",ha);var pa=function(e){r(t,e);function t(t,i){var r;var n=i.track;var a=i.cue;var s=t.currentTime();i.selectable=true;i.multiSelectable=false;i.label=a.text;i.selected=a.startTime<=s&&s<a.endTime;r=e.call(this,t,i)||this;r.track=n;r.cue=a;n.addEventListener("cuechange",Ae(o(o(r)),r.update));return r}var i=t.prototype;i.handleClick=function t(i){e.prototype.handleClick.call(this);this.player_.currentTime(this.cue.startTime);this.update(this.cue.startTime)};i.update=function e(t){var i=this.cue;var r=this.player_.currentTime();this.selected(i.startTime<=r&&r<i.endTime)};return t}(ca);Xe.registerComponent("ChaptersTrackMenuItem",pa);var ma=function(e){r(t,e);function t(t,i,r){return e.call(this,t,i,r)||this}var i=t.prototype;i.buildCSSClass=function t(){return"vjs-chapters-button "+e.prototype.buildCSSClass.call(this)};i.buildWrapperCSSClass=function t(){return"vjs-chapters-button "+e.prototype.buildWrapperCSSClass.call(this)};i.update=function t(i){if(!this.track_||i&&(i.type==="addtrack"||i.type==="removetrack")){this.setTrack(this.findChaptersTrack())}e.prototype.update.call(this)};i.setTrack=function e(t){if(this.track_===t){return}if(!this.updateHandler_){this.updateHandler_=this.update.bind(this)}if(this.track_){var i=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);if(i){i.removeEventListener("load",this.updateHandler_)}this.track_=null}this.track_=t;if(this.track_){this.track_.mode="hidden";var r=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);if(r){r.addEventListener("load",this.updateHandler_)}}};i.findChaptersTrack=function e(){var t=this.player_.textTracks()||[];for(var i=t.length-1;i>=0;i--){var r=t[i];if(r.kind===this.kind_){return r}}};i.getMenuCaption=function e(){if(this.track_&&this.track_.label){return this.track_.label}return this.localize(ze(this.kind_))};i.createMenu=function t(){this.options_.title=this.getMenuCaption();return e.prototype.createMenu.call(this)};i.createItems=function e(){var t=[];if(!this.track_){return t}var i=this.track_.cues;if(!i){return t}for(var r=0,n=i.length;r<n;r++){var a=i[r];var s=new pa(this.player_,{track:this.track_,cue:a});t.push(s)}return t};return t}(ha);ma.prototype.kind_="chapters";ma.prototype.controlText_="Chapters";Xe.registerComponent("ChaptersButton",ma);var va=function(e){r(t,e);function t(t,i,r){var n;n=e.call(this,t,i,r)||this;var a=t.textTracks();var s=Ae(o(o(n)),n.handleTracksChange);a.addEventListener("change",s);n.on("dispose",function(){a.removeEventListener("change",s)});return n}var i=t.prototype;i.handleTracksChange=function e(t){var i=this.player().textTracks();var r=false;for(var n=0,a=i.length;n<a;n++){var s=i[n];if(s.kind!==this.kind_&&s.mode==="showing"){r=true;break}}if(r){this.disable()}else{this.enable()}};i.buildCSSClass=function t(){return"vjs-descriptions-button "+e.prototype.buildCSSClass.call(this)};i.buildWrapperCSSClass=function t(){return"vjs-descriptions-button "+e.prototype.buildWrapperCSSClass.call(this)};return t}(ha);va.prototype.kind_="descriptions";va.prototype.controlText_="Descriptions";Xe.registerComponent("DescriptionsButton",va);var ga=function(e){r(t,e);function t(t,i,r){return e.call(this,t,i,r)||this}var i=t.prototype;i.buildCSSClass=function t(){return"vjs-subtitles-button "+e.prototype.buildCSSClass.call(this)};i.buildWrapperCSSClass=function t(){return"vjs-subtitles-button "+e.prototype.buildWrapperCSSClass.call(this)};return t}(ha);ga.prototype.kind_="subtitles";ga.prototype.controlText_="Subtitles";Xe.registerComponent("SubtitlesButton",ga);var ya=function(e){r(t,e);function t(t,i){var r;i.track={player:t,kind:i.kind,label:i.kind+" settings",selectable:false,default:false,mode:"disabled"};i.selectable=false;i.name="CaptionSettingsMenuItem";r=e.call(this,t,i)||this;r.addClass("vjs-texttrack-settings");r.controlText(", opens "+i.kind+" settings dialog");return r}var i=t.prototype;i.handleClick=function e(t){this.player().getChild("textTrackSettings").open()};return t}(fa);Xe.registerComponent("CaptionSettingsMenuItem",ya);var _a=function(e){r(t,e);function t(t,i,r){return e.call(this,t,i,r)||this}var i=t.prototype;i.buildCSSClass=function t(){return"vjs-captions-button "+e.prototype.buildCSSClass.call(this)};i.buildWrapperCSSClass=function t(){return"vjs-captions-button "+e.prototype.buildWrapperCSSClass.call(this)};i.createItems=function t(){var i=[];if(!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")){i.push(new ya(this.player_,{kind:this.kind_}));this.hideThreshold_+=1}return e.prototype.createItems.call(this,i)};return t}(ha);_a.prototype.kind_="captions";_a.prototype.controlText_="Captions";Xe.registerComponent("CaptionsButton",_a);var ba=function(e){r(t,e);function t(){return e.apply(this,arguments)||this}var i=t.prototype;i.createEl=function t(i,r,n){var a='<span class="vjs-menu-item-text">'+this.localize(this.options_.label);if(this.options_.track.kind==="captions"){a+='\n <span aria-hidden="true" class="vjs-icon-placeholder"></span>\n <span class="vjs-control-text"> '+this.localize("Captions")+"</span>\n "}a+="</span>";var s=e.prototype.createEl.call(this,i,b({innerHTML:a},r),n);return s};return t}(fa);Xe.registerComponent("SubsCapsMenuItem",ba);var Ta=function(e){r(t,e);function t(t,i){var r;if(i===void 0){i={}}r=e.call(this,t,i)||this;r.label_="subtitles";if(["en","en-us","en-ca","fr-ca"].indexOf(r.player_.language_)>-1){r.label_="captions"}r.menuButton_.controlText(ze(r.label_));return r}var i=t.prototype;i.buildCSSClass=function t(){return"vjs-subs-caps-button "+e.prototype.buildCSSClass.call(this)};i.buildWrapperCSSClass=function t(){return"vjs-subs-caps-button "+e.prototype.buildWrapperCSSClass.call(this)};i.createItems=function t(){var i=[];if(!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")){i.push(new ya(this.player_,{kind:this.label_}));this.hideThreshold_+=1}i=e.prototype.createItems.call(this,i,ba);return i};return t}(ha);Ta.prototype.kinds_=["captions","subtitles"];Ta.prototype.controlText_="Subtitles";Xe.registerComponent("SubsCapsButton",Ta);var Sa=function(e){r(t,e);function t(t,i){var r;var n=i.track;var a=t.audioTracks();i.label=n.label||n.language||"Unknown";i.selected=n.enabled;r=e.call(this,t,i)||this;r.track=n;r.addClass("vjs-"+n.kind+"-menu-item");var s=function e(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++){i[n]=arguments[n]}r.handleTracksChange.apply(o(o(r)),i)};a.addEventListener("change",s);r.on("dispose",function(){a.removeEventListener("change",s)});return r}var i=t.prototype;i.createEl=function t(i,r,n){var a='<span class="vjs-menu-item-text">'+this.localize(this.options_.label);if(this.options_.track.kind==="main-desc"){a+='\n <span aria-hidden="true" class="vjs-icon-placeholder"></span>\n <span class="vjs-control-text"> '+this.localize("Descriptions")+"</span>\n "}a+="</span>";var s=e.prototype.createEl.call(this,i,b({innerHTML:a},r),n);return s};i.handleClick=function t(i){var r=this.player_.audioTracks();e.prototype.handleClick.call(this,i);for(var n=0;n<r.length;n++){var a=r[n];a.enabled=a===this.track}};i.handleTracksChange=function e(t){this.selected(this.track.enabled)};return t}(ca);Xe.registerComponent("AudioTrackMenuItem",Sa);var ka=function(e){r(t,e);function t(t,i){if(i===void 0){i={}}i.tracks=t.audioTracks();return e.call(this,t,i)||this}var i=t.prototype;i.buildCSSClass=function t(){return"vjs-audio-button "+e.prototype.buildCSSClass.call(this)};i.buildWrapperCSSClass=function t(){return"vjs-audio-button "+e.prototype.buildWrapperCSSClass.call(this)};i.createItems=function e(t){if(t===void 0){t=[]}this.hideThreshold_=1;var i=this.player_.audioTracks();for(var r=0;r<i.length;r++){var n=i[r];t.push(new Sa(this.player_,{track:n,selectable:true,multiSelectable:false}))}return t};return t}(ua);ka.prototype.controlText_="Audio Track";Xe.registerComponent("AudioTrackButton",ka);var wa=function(e){r(t,e);function t(t,i){var r;var n=i.rate;var a=parseFloat(n,10);i.label=n;i.selected=a===1;i.selectable=true;i.multiSelectable=false;r=e.call(this,t,i)||this;r.label=n;r.rate=a;r.on(t,"ratechange",r.update);return r}var i=t.prototype;i.handleClick=function t(i){e.prototype.handleClick.call(this);this.player().playbackRate(this.rate)};i.update=function e(t){this.selected(this.player().playbackRate()===this.rate)};return t}(ca);wa.prototype.contentElType="button";Xe.registerComponent("PlaybackRateMenuItem",wa);var Ca=function(e){r(t,e);function t(t,i){var r;r=e.call(this,t,i)||this;r.updateVisibility();r.updateLabel();r.on(t,"loadstart",r.updateVisibility);r.on(t,"ratechange",r.updateLabel);return r}var i=t.prototype;i.createEl=function t(){var i=e.prototype.createEl.call(this);this.labelEl_=U("div",{className:"vjs-playback-rate-value",innerHTML:"1x"});i.appendChild(this.labelEl_);return i};i.dispose=function t(){this.labelEl_=null;e.prototype.dispose.call(this)};i.buildCSSClass=function t(){return"vjs-playback-rate "+e.prototype.buildCSSClass.call(this)};i.buildWrapperCSSClass=function t(){return"vjs-playback-rate "+e.prototype.buildWrapperCSSClass.call(this)};i.createMenu=function e(){var t=new sa(this.player());var i=this.playbackRates();if(i){for(var r=i.length-1;r>=0;r--){t.addChild(new wa(this.player(),{rate:i[r]+"x"}))}}return t};i.updateARIAAttributes=function e(){this.el().setAttribute("aria-valuenow",this.player().playbackRate())};i.handleClick=function e(t){var i=this.player().playbackRate();var r=this.playbackRates();var n=r[0];for(var a=0;a<r.length;a++){if(r[a]>i){n=r[a];break}}this.player().playbackRate(n)};i.playbackRates=function e(){return this.options_.playbackRates||this.options_.playerOptions&&this.options_.playerOptions.playbackRates};i.playbackRateSupported=function e(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0};i.updateVisibility=function e(t){if(this.playbackRateSupported()){this.removeClass("vjs-hidden")}else{this.addClass("vjs-hidden")}};i.updateLabel=function e(t){if(this.playbackRateSupported()){this.labelEl_.innerHTML=this.player().playbackRate()+"x"}};return t}(oa);Ca.prototype.controlText_="Playback Rate";Xe.registerComponent("PlaybackRateMenuButton",Ca);var Ea=function(e){r(t,e);function t(){return e.apply(this,arguments)||this}var i=t.prototype;i.buildCSSClass=function t(){return"vjs-spacer "+e.prototype.buildCSSClass.call(this)};i.createEl=function t(){return e.prototype.createEl.call(this,"div",{className:this.buildCSSClass()})};return t}(Xe);Xe.registerComponent("Spacer",Ea);var Aa=function(e){r(t,e);function t(){return e.apply(this,arguments)||this}var i=t.prototype;i.buildCSSClass=function t(){return"vjs-custom-control-spacer "+e.prototype.buildCSSClass.call(this)};i.createEl=function t(){var i=e.prototype.createEl.call(this,{className:this.buildCSSClass()});i.innerHTML=" ";return i};return t}(Ea);Xe.registerComponent("CustomControlSpacer",Aa);var La=function(e){r(t,e);function t(){return e.apply(this,arguments)||this}var i=t.prototype;i.createEl=function t(){return e.prototype.createEl.call(this,"div",{className:"vjs-control-bar",dir:"ltr"})};return t}(Xe);La.prototype.options_={children:["playToggle","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","fullscreenToggle"]};Xe.registerComponent("ControlBar",La);var Ia=function(e){r(t,e);function t(t,i){var r;r=e.call(this,t,i)||this;r.on(t,"error",r.open);return r}var i=t.prototype;i.buildCSSClass=function t(){return"vjs-error-display "+e.prototype.buildCSSClass.call(this)};i.content=function e(){var t=this.player().error();return t?this.localize(t.message):""};return t}(Wt);Ia.prototype.options_=Ge(Wt.prototype.options_,{pauseOnOpen:false,fillAlways:true,temporary:false,uncloseable:true});Xe.registerComponent("ErrorDisplay",Ia);var Pa="vjs-text-track-settings";var Oa=["#000","Black"];var Ua=["#00F","Blue"];var Da=["#0FF","Cyan"];var xa=["#0F0","Green"];var Ra=["#F0F","Magenta"];var Ma=["#F00","Red"];var Ba=["#FFF","White"];var Na=["#FF0","Yellow"];var ja=["1","Opaque"];var Fa=["0.5","Semi-Transparent"];var Va=["0","Transparent"];var Ha={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[Oa,Ba,Ma,xa,Ua,Na,Ra,Da]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Transparency",options:[ja,Fa,Va]},color:{selector:".vjs-fg-color > select",id:"captions-foreground-color-%s",label:"Color",options:[Ba,Oa,Ma,xa,Ua,Na,Ra,Da]},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(t){return t==="1.00"?null:Number(t)}},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Transparency",options:[ja,Fa]},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:[Va,Fa,ja]}};Ha.windowColor.options=Ha.backgroundColor.options;function qa(e,t){if(t){e=t(e)}if(e&&e!=="none"){return e}}function za(e,t){var i=e.options[e.options.selectedIndex].value;return qa(i,t)}function Wa(e,t,i){if(!t){return}for(var r=0;r<e.options.length;r++){if(qa(e.options[r].value,i)===t){e.selectedIndex=r;break}}}var Ga=function(i){r(n,i);function n(e,t){var r;t.temporary=false;r=i.call(this,e,t)||this;r.updateDisplay=Ae(o(o(r)),r.updateDisplay);r.fill();r.hasBeenOpened_=r.hasBeenFilled_=true;r.endDialog=U("p",{className:"vjs-control-text",textContent:r.localize("End of dialog window.")});r.el().appendChild(r.endDialog);r.setDefaults();if(t.persistTextTrackSettings===undefined){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()});y(Ha,function(e){r.on(r.$(e.selector),"change",r.updateDisplay)});if(r.options_.persistTextTrackSettings){r.restoreSettings()}return r}var a=n.prototype;a.dispose=function e(){this.endDialog=null;i.prototype.dispose.call(this)};a.createElSelect_=function e(t,i,r){var n=this;if(i===void 0){i=""}if(r===void 0){r="label"}var a=Ha[t];var s=a.id.replace("%s",this.id_);var o=[i,s].join(" ").trim();return["<"+r+' id="'+s+'" class="'+(r==="label"?"vjs-label":"")+'">',this.localize(a.label),"</"+r+">",'<select aria-labelledby="'+o+'">'].concat(a.options.map(function(e){var t=s+"-"+e[1].replace(/\W+/g,"");return['<option id="'+t+'" value="'+e[0]+'" ','aria-labelledby="'+o+" "+t+'">',n.localize(e[1]),"</option>"].join("")})).concat("</select>").join("")};a.createElFgColor_=function e(){var t="captions-text-legend-"+this.id_;return['<fieldset class="vjs-fg-color vjs-track-setting">','<legend id="'+t+'">',this.localize("Text"),"</legend>",this.createElSelect_("color",t),'<span class="vjs-text-opacity vjs-opacity">',this.createElSelect_("textOpacity",t),"</span>","</fieldset>"].join("")};a.createElBgColor_=function e(){var t="captions-background-"+this.id_;return['<fieldset class="vjs-bg-color vjs-track-setting">','<legend id="'+t+'">',this.localize("Background"),"</legend>",this.createElSelect_("backgroundColor",t),'<span class="vjs-bg-opacity vjs-opacity">',this.createElSelect_("backgroundOpacity",t),"</span>","</fieldset>"].join("")};a.createElWinColor_=function e(){var t="captions-window-"+this.id_;return['<fieldset class="vjs-window-color vjs-track-setting">','<legend id="'+t+'">',this.localize("Window"),"</legend>",this.createElSelect_("windowColor",t),'<span class="vjs-window-opacity vjs-opacity">',this.createElSelect_("windowOpacity",t),"</span>","</fieldset>"].join("")};a.createElColors_=function e(){return U("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})};a.createElFont_=function e(){return U("div",{className:"vjs-track-settings-font",innerHTML:['<fieldset class="vjs-font-percent vjs-track-setting">',this.createElSelect_("fontPercent","","legend"),"</fieldset>",'<fieldset class="vjs-edge-style vjs-track-setting">',this.createElSelect_("edgeStyle","","legend"),"</fieldset>",'<fieldset class="vjs-font-family vjs-track-setting">',this.createElSelect_("fontFamily","","legend"),"</fieldset>"].join("")})};a.createElControls_=function e(){var t=this.localize("restore all settings to the default values");return U("div",{className:"vjs-track-settings-controls",innerHTML:['<button type="button" class="vjs-default-button" title="'+t+'">',this.localize("Reset"),'<span class="vjs-control-text"> '+t+"</span>","</button>",'<button type="button" class="vjs-done-button">'+this.localize("Done")+"</button>"].join("")})};a.content=function e(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]};a.label=function e(){return this.localize("Caption Settings Dialog")};a.description=function e(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")};a.buildCSSClass=function e(){return i.prototype.buildCSSClass.call(this)+" vjs-text-track-settings"};a.getValues=function e(){var t=this;return _(Ha,function(e,i,r){var n=za(t.$(i.selector),i.parser);if(n!==undefined){e[r]=n}return e},{})};a.setValues=function e(t){var i=this;y(Ha,function(e,r){Wa(i.$(e.selector),t[r],e.parser)})};a.setDefaults=function e(){var t=this;y(Ha,function(e){var i=e.hasOwnProperty("default")?e.default:0;t.$(e.selector).selectedIndex=i})};a.restoreSettings=function t(){var i;try{i=JSON.parse(e.localStorage.getItem(Pa))}catch(e){d.warn(e)}if(i){this.setValues(i)}};a.saveSettings=function t(){if(!this.options_.persistTextTrackSettings){return}var i=this.getValues();try{if(Object.keys(i).length){e.localStorage.setItem(Pa,JSON.stringify(i))}else{e.localStorage.removeItem(Pa)}}catch(e){d.warn(e)}};a.updateDisplay=function e(){var t=this.player_.getChild("textTrackDisplay");if(t){t.updateDisplay()}};a.conditionalBlur_=function e(){this.previouslyActiveEl_=null;this.off(t,"keydown",this.handleKeyDown);var i=this.player_.controlBar;var r=i&&i.subsCapsButton;var n=i&&i.captionsButton;if(r){r.focus()}else if(n){n.focus()}};return n}(Wt);Xe.registerComponent("TextTrackSettings",Ga);var Xa=function(t){r(i,t);function i(i,r){var n;var a=r.ResizeObserver||e.ResizeObserver;if(r.ResizeObserver===null){a=false}var s=Ge({createEl:!a,reportTouchActivity:false},r);n=t.call(this,i,s)||this;n.ResizeObserver=r.ResizeObserver||e.ResizeObserver;n.loadListener_=null;n.resizeObserver_=null;n.debouncedHandler_=Ie(function(){n.resizeHandler()},100,false,o(o(n)));if(a){n.resizeObserver_=new n.ResizeObserver(n.debouncedHandler_);n.resizeObserver_.observe(i.el())}else{n.loadListener_=function(){if(!n.el_||!n.el_.contentWindow){return}var e=n.debouncedHandler_;var t=n.unloadListener_=function(){ge(this,"resize",e);ge(this,"unload",t);t=null};ve(n.el_.contentWindow,"unload",t);ve(n.el_.contentWindow,"resize",e)};n.one("load",n.loadListener_)}return n}var n=i.prototype;n.createEl=function e(){return t.prototype.createEl.call(this,"iframe",{className:"vjs-resize-manager",tabIndex:-1},{"aria-hidden":"true"})};n.resizeHandler=function e(){if(!this.player_||!this.player_.trigger){return}this.player_.trigger("playerresize")};n.dispose=function e(){if(this.debouncedHandler_){this.debouncedHandler_.cancel()}if(this.resizeObserver_){if(this.player_.el()){this.resizeObserver_.unobserve(this.player_.el())}this.resizeObserver_.disconnect()}if(this.loadListener_){this.off("load",this.loadListener_)}if(this.el_&&this.el_.contentWindow&&this.unloadListener_){this.unloadListener_.call(this.el_.contentWindow)}this.ResizeObserver=null;this.resizeObserver=null;this.debouncedHandler_=null;this.loadListener_=null;t.prototype.dispose.call(this)};return i}(Xe);Xe.registerComponent("ResizeManager",Xa);var Ya=function(e){r(i,e);function i(i,r){var n;var a=Ge({createEl:false},r);n=e.call(this,i,a)||this;n.reset_();n.on(n.player_,"durationchange",n.handleDurationchange);if(lt&&"hidden"in t&&"visibilityState"in t){n.on(t,"visibilitychange",n.handleVisibilityChange)}return n}var n=i.prototype;n.handleVisibilityChange=function e(){if(this.player_.duration()!==Infinity){return}if(t.hidden){this.stopTracking()}else{this.startTracking()}};n.isBehind_=function e(){if(!this.timeupdateSeen_){return false}var t=this.liveCurrentTime();var i=this.player_.currentTime();var r=this.seekableIncrement_;var n=r*2+.07;return t!==Infinity&&t-n>=i};n.trackLive_=function e(){this.pastSeekEnd_=this.pastSeekEnd_;var t=this.player_.seekable();if(!t||!t.length){return}var i=this.seekableEnd();if(i!==this.lastSeekEnd_){if(this.lastSeekEnd_){this.seekableIncrement_=Math.abs(i-this.lastSeekEnd_)}this.pastSeekEnd_=0;this.lastSeekEnd_=i;this.trigger("seekableendchange")}this.pastSeekEnd_=this.pastSeekEnd()+.03;if(this.isBehind_()!==this.behindLiveEdge()){this.behindLiveEdge_=this.isBehind_();this.trigger("liveedgechange")}};n.handleDurationchange=function e(){if(this.player_.duration()===Infinity){this.startTracking()}else{this.stopTracking()}};n.startTracking=function e(){var t=this;if(this.isTracking()){return}this.trackingInterval_=this.setInterval(this.trackLive_,30);this.trackLive_();this.on(this.player_,"play",this.trackLive_);this.on(this.player_,"pause",this.trackLive_);this.one(this.player_,"play",this.handlePlay);if(!this.timeupdateSeen_){this.handleTimeupdate=function(){t.timeupdateSeen_=true;t.handleTimeupdate=null};this.one(this.player_,"timeupdate",this.handleTimeupdate)}};n.handlePlay=function e(){this.one(this.player_,"timeupdate",this.seekToLiveEdge)};n.reset_=function e(){this.pastSeekEnd_=0;this.lastSeekEnd_=null;this.behindLiveEdge_=null;this.timeupdateSeen_=false;this.clearInterval(this.trackingInterval_);this.trackingInterval_=null;this.seekableIncrement_=12;this.off(this.player_,"play",this.trackLive_);this.off(this.player_,"pause",this.trackLive_);this.off(this.player_,"play",this.handlePlay);this.off(this.player_,"timeupdate",this.seekToLiveEdge);if(this.handleTimeupdate){this.off(this.player_,"timeupdate",this.handleTimeupdate);this.handleTimeupdate=null}};n.stopTracking=function e(){if(!this.isTracking()){return}this.reset_()};n.seekableEnd=function e(){var t=this.player_.seekable();var i=[];var r=t?t.length:0;while(r--){i.push(t.end(r))}return i.length?i.sort()[i.length-1]:Infinity};n.seekableStart=function e(){var t=this.player_.seekable();var i=[];var r=t?t.length:0;while(r--){i.push(t.start(r))}return i.length?i.sort()[0]:0};n.liveWindow=function e(){var t=this.liveCurrentTime();if(t===Infinity){return Infinity}return t-this.seekableStart()};n.isLive=function e(){return this.isTracking()};n.atLiveEdge=function e(){return!this.behindLiveEdge()};n.liveCurrentTime=function e(){return this.pastSeekEnd()+this.seekableEnd()};n.pastSeekEnd=function e(){return this.pastSeekEnd_};n.behindLiveEdge=function e(){return this.behindLiveEdge_};n.isTracking=function e(){return typeof this.trackingInterval_==="number"};n.seekToLiveEdge=function e(){if(this.atLiveEdge()){return}this.player_.currentTime(this.liveCurrentTime());if(this.player_.paused()){this.player_.play()}};n.dispose=function t(){this.stopTracking();e.prototype.dispose.call(this)};return i}(Xe);Xe.registerComponent("LiveTracker",Ya);var Ka=function e(t){var i=t.el();if(i.hasAttribute("src")){t.triggerSourceset(i.src);return true}var r=t.$$("source");var n=[];var a="";if(!r.length){return false}for(var s=0;s<r.length;s++){var o=r[s].src;if(o&&n.indexOf(o)===-1){n.push(o)}}if(!n.length){return false}if(n.length===1){a=n[0]}t.triggerSourceset(a);return true};var $a=Object.defineProperty({},"innerHTML",{get:function e(){return this.cloneNode(true).innerHTML},set:function i(r){var n=t.createElement(this.nodeName.toLowerCase());n.innerHTML=r;var a=t.createDocumentFragment();while(n.childNodes.length){a.appendChild(n.childNodes[0])}this.innerText="";e.Element.prototype.appendChild.call(this,a);return this.innerHTML}});var Qa=function e(t,i){var r={};for(var n=0;n<t.length;n++){r=Object.getOwnPropertyDescriptor(t[n],i);if(r&&r.set&&r.get){break}}r.enumerable=true;r.configurable=true;return r};var Ja=function t(i){return Qa([i.el(),e.HTMLMediaElement.prototype,e.Element.prototype,$a],"innerHTML")};var Za=function e(t){var i=t.el();if(i.resetSourceWatch_){return}var r={};var n=Ja(t);var a=function e(r){return function(){for(var e=arguments.length,n=new Array(e),a=0;a<e;a++){n[a]=arguments[a]}var s=r.apply(i,n);Ka(t);return s}};["append","appendChild","insertAdjacentHTML"].forEach(function(e){if(!i[e]){return}r[e]=i[e];i[e]=a(r[e])});Object.defineProperty(i,"innerHTML",Ge(n,{set:a(n.set)}));i.resetSourceWatch_=function(){i.resetSourceWatch_=null;Object.keys(r).forEach(function(e){i[e]=r[e]});Object.defineProperty(i,"innerHTML",n)};t.one("sourceset",i.resetSourceWatch_)};var es=Object.defineProperty({},"src",{get:function t(){if(this.hasAttribute("src")){return oi(e.Element.prototype.getAttribute.call(this,"src"))}return""},set:function t(i){e.Element.prototype.setAttribute.call(this,"src",i);return i}});var ts=function t(i){return Qa([i.el(),e.HTMLMediaElement.prototype,es],"src")};var is=function e(t){if(!t.featuresSourceset){return}var i=t.el();if(i.resetSourceset_){return}var r=ts(t);var n=i.setAttribute;var a=i.load;Object.defineProperty(i,"src",Ge(r,{set:function e(n){var a=r.set.call(i,n);t.triggerSourceset(i.src);return a}}));i.setAttribute=function(e,r){var a=n.call(i,e,r);if(/src/i.test(e)){t.triggerSourceset(i.src)}return a};i.load=function(){var e=a.call(i);if(!Ka(t)){t.triggerSourceset("");Za(t)}return e};if(i.currentSrc){t.triggerSourceset(i.currentSrc)}else if(!Ka(t)){Za(t)}i.resetSourceset_=function(){i.resetSourceset_=null;i.load=a;i.setAttribute=n;Object.defineProperty(i,"src",r);if(i.resetSourceWatch_){i.resetSourceWatch_()}}};function rs(){var e=u(["Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\n This may prevent text tracks from loading."]);rs=function t(){return e};return e}var ns=function(i){r(n,i);function n(e,t){var r;r=i.call(this,e,t)||this;var n=e.source;var a=false;if(n&&(r.el_.currentSrc!==n.src||e.tag&&e.tag.initNetworkState_===3)){r.setSource(n)}else{r.handleLateInit_(r.el_)}if(e.enableSourceset){r.setupSourcesetHandling_()}if(r.el_.hasChildNodes()){var s=r.el_.childNodes;var o=s.length;var u=[];while(o--){var l=s[o];var c=l.nodeName.toLowerCase();if(c==="track"){if(!r.featuresNativeTextTracks){u.push(l)}else{r.remoteTextTrackEls().addTrackElement_(l);r.remoteTextTracks().addTrack(l.track);r.textTracks().addTrack(l.track);if(!a&&!r.el_.hasAttribute("crossorigin")&&li(l.src)){a=true}}}}for(var f=0;f<u.length;f++){r.el_.removeChild(u[f])}}r.proxyNativeTracks_();if(r.featuresNativeTextTracks&&a){d.warn(m(rs()))}r.restoreMetadataTracksInIOSNativePlayer_();if((dt||Je||nt)&&e.nativeControlsForTouch===true){r.setControls(true)}r.proxyWebkitFullscreen_();r.triggerReady();return r}var a=n.prototype;a.dispose=function e(){if(this.el_&&this.el_.resetSourceset_){this.el_.resetSourceset_()}n.disposeMediaElement(this.el_);this.options_=null;i.prototype.dispose.call(this)};a.setupSourcesetHandling_=function e(){is(this)};a.restoreMetadataTracksInIOSNativePlayer_=function e(){var t=this.textTracks();var i;var r=function e(){i=[];for(var r=0;r<t.length;r++){var n=t[r];if(n.kind==="metadata"){i.push({track:n,storedMode:n.mode})}}};r();t.addEventListener("change",r);this.on("dispose",function(){return t.removeEventListener("change",r)});var n=function e(){for(var r=0;r<i.length;r++){var n=i[r];if(n.track.mode==="disabled"&&n.track.mode!==n.storedMode){n.track.mode=n.storedMode}}t.removeEventListener("change",e)};this.on("webkitbeginfullscreen",function(){t.removeEventListener("change",r);t.removeEventListener("change",n);t.addEventListener("change",n)});this.on("webkitendfullscreen",function(){t.removeEventListener("change",r);t.addEventListener("change",r);t.removeEventListener("change",n)})};a.overrideNative_=function e(t,i){var r=this;if(i!==this["featuresNative"+t+"Tracks"]){return}var n=t.toLowerCase();if(this[n+"TracksListeners_"]){Object.keys(this[n+"TracksListeners_"]).forEach(function(e){var t=r.el()[n+"Tracks"];t.removeEventListener(e,r[n+"TracksListeners_"][e])})}this["featuresNative"+t+"Tracks"]=!i;this[n+"TracksListeners_"]=null;this.proxyNativeTracksForType_(n)};a.overrideNativeAudioTracks=function e(t){this.overrideNative_("Audio",t)};a.overrideNativeVideoTracks=function e(t){this.overrideNative_("Video",t)};a.proxyNativeTracksForType_=function e(t){var i=this;var r=ir[t];var n=this.el()[r.getterName];var a=this[r.getterName]();if(!this["featuresNative"+r.capitalName+"Tracks"]||!n||!n.addEventListener){return}var s={change:function e(t){a.trigger({type:"change",target:a,currentTarget:a,srcElement:a})},addtrack:function e(t){a.addTrack(t.track)},removetrack:function e(t){a.removeTrack(t.track)}};var o=function e(){var t=[];for(var i=0;i<a.length;i++){var r=false;for(var s=0;s<n.length;s++){if(n[s]===a[i]){r=true;break}}if(!r){t.push(a[i])}}while(t.length){a.removeTrack(t.shift())}};this[r.getterName+"Listeners_"]=s;Object.keys(s).forEach(function(e){var t=s[e];n.addEventListener(e,t);i.on("dispose",function(i){return n.removeEventListener(e,t)})});this.on("loadstart",o);this.on("dispose",function(e){return i.off("loadstart",o)})};a.proxyNativeTracks_=function e(){var t=this;ir.names.forEach(function(e){t.proxyNativeTracksForType_(e)})};a.createEl=function e(){var i=this.options_.tag;if(!i||!(this.options_.playerElIngest||this.movingMediaElementInDOM)){if(i){var r=i.cloneNode(true);if(i.parentNode){i.parentNode.insertBefore(r,i)}n.disposeMediaElement(i);i=r}else{i=t.createElement("video");var a=this.options_.tag&&F(this.options_.tag);var s=Ge({},a);if(!dt||this.options_.nativeControlsForTouch!==true){delete s.controls}j(i,b(s,{id:this.options_.techId,class:"vjs-tech"}))}i.playerId=this.options_.playerId}if(typeof this.options_.preload!=="undefined"){H(i,"preload",this.options_.preload)}var o=["loop","muted","playsinline","autoplay"];for(var u=0;u<o.length;u++){var l=o[u];var c=this.options_[l];if(typeof c!=="undefined"){if(c){H(i,l,l)}else{q(i,l)}i[l]=c}}return i};a.handleLateInit_=function e(t){if(t.networkState===0||t.networkState===3){return}if(t.readyState===0){var i=false;var r=function e(){i=true};this.on("loadstart",r);var n=function e(){if(!i){this.trigger("loadstart")}};this.on("loadedmetadata",n);this.ready(function(){this.off("loadstart",r);this.off("loadedmetadata",n);if(!i){this.trigger("loadstart")}});return}var a=["loadstart"];a.push("loadedmetadata");if(t.readyState>=2){a.push("loadeddata")}if(t.readyState>=3){a.push("canplay")}if(t.readyState>=4){a.push("canplaythrough")}this.ready(function(){a.forEach(function(e){this.trigger(e)},this)})};a.setCurrentTime=function e(t){try{this.el_.currentTime=t}catch(e){d(e,"Video is not ready. (Video.js)")}};a.duration=function e(){var t=this;if(this.el_.duration===Infinity&&it&&ot&&this.el_.currentTime===0){var i=function e(){if(t.el_.currentTime>0){if(t.el_.duration===Infinity){t.trigger("durationchange")}t.off("timeupdate",e)}};this.on("timeupdate",i);return NaN}return this.el_.duration||NaN};a.width=function e(){return this.el_.offsetWidth};a.height=function e(){return this.el_.offsetHeight};a.proxyWebkitFullscreen_=function e(){var t=this;if(!("webkitDisplayingFullscreen"in this.el_)){return}var i=function e(){this.trigger("fullscreenchange",{isFullscreen:false})};var r=function e(){if("webkitPresentationMode"in this.el_&&this.el_.webkitPresentationMode!=="picture-in-picture"){this.one("webkitendfullscreen",i);this.trigger("fullscreenchange",{isFullscreen:true})}};this.on("webkitbeginfullscreen",r);this.on("dispose",function(){t.off("webkitbeginfullscreen",r);t.off("webkitendfullscreen",i)})};a.supportsFullScreen=function t(){if(typeof this.el_.webkitEnterFullScreen==="function"){var i=e.navigator&&e.navigator.userAgent||"";if(/Android/.test(i)||!/Chrome|Mac OS X 10.5/.test(i)){return true}}return false};a.enterFullScreen=function e(){var t=this.el_;if(t.paused&&t.networkState<=t.HAVE_METADATA){this.el_.play();this.setTimeout(function(){t.pause();t.webkitEnterFullScreen()},0)}else{t.webkitEnterFullScreen()}};a.exitFullScreen=function e(){this.el_.webkitExitFullScreen()};a.src=function e(t){if(t===undefined){return this.el_.src}this.setSrc(t)};a.reset=function e(){n.resetMediaElement(this.el_)};a.currentSrc=function e(){if(this.currentSource_){return this.currentSource_.src}return this.el_.currentSrc};a.setControls=function e(t){this.el_.controls=!!t};a.addTextTrack=function e(t,r,n){if(!this.featuresNativeTextTracks){return i.prototype.addTextTrack.call(this,t,r,n)}return this.el_.addTextTrack(t,r,n)};a.createRemoteTextTrack=function e(r){if(!this.featuresNativeTextTracks){return i.prototype.createRemoteTextTrack.call(this,r)}var n=t.createElement("track");if(r.kind){n.kind=r.kind}if(r.label){n.label=r.label}if(r.language||r.srclang){n.srclang=r.language||r.srclang}if(r.default){n.default=r.default}if(r.id){n.id=r.id}if(r.src){n.src=r.src}return n};a.addRemoteTextTrack=function e(t,r){var n=i.prototype.addRemoteTextTrack.call(this,t,r);if(this.featuresNativeTextTracks){this.el().appendChild(n)}return n};a.removeRemoteTextTrack=function e(t){i.prototype.removeRemoteTextTrack.call(this,t);if(this.featuresNativeTextTracks){var r=this.$$("track");var n=r.length;while(n--){if(t===r[n]||t===r[n].track){this.el().removeChild(r[n])}}}};a.getVideoPlaybackQuality=function t(){if(typeof this.el().getVideoPlaybackQuality==="function"){return this.el().getVideoPlaybackQuality()}var i={};if(typeof this.el().webkitDroppedFrameCount!=="undefined"&&typeof this.el().webkitDecodedFrameCount!=="undefined"){i.droppedVideoFrames=this.el().webkitDroppedFrameCount;i.totalVideoFrames=this.el().webkitDecodedFrameCount}if(e.performance&&typeof e.performance.now==="function"){i.creationTime=e.performance.now()}else if(e.performance&&e.performance.timing&&typeof e.performance.timing.navigationStart==="number"){i.creationTime=e.Date.now()-e.performance.timing.navigationStart}return i};return n}(Gr);if(L()){ns.TEST_VID=t.createElement("video");var as=t.createElement("track");as.kind="captions";as.srclang="en";as.label="English";ns.TEST_VID.appendChild(as)}ns.isSupported=function(){try{ns.TEST_VID.volume=.5}catch(e){return false}return!!(ns.TEST_VID&&ns.TEST_VID.canPlayType)};ns.canPlayType=function(e){return ns.TEST_VID.canPlayType(e)};ns.canPlaySource=function(e,t){return ns.canPlayType(e.type)};ns.canControlVolume=function(){try{var e=ns.TEST_VID.volume;ns.TEST_VID.volume=e/2+.1;return e!==ns.TEST_VID.volume}catch(e){return false}};ns.canMuteVolume=function(){try{var e=ns.TEST_VID.muted;ns.TEST_VID.muted=!e;if(ns.TEST_VID.muted){H(ns.TEST_VID,"muted","muted")}else{q(ns.TEST_VID,"muted","muted")}return e!==ns.TEST_VID.muted}catch(e){return false}};ns.canControlPlaybackRate=function(){if(it&&ot&&ut<58){return false}try{var e=ns.TEST_VID.playbackRate;ns.TEST_VID.playbackRate=e/2+.1;return e!==ns.TEST_VID.playbackRate}catch(e){return false}};ns.canOverrideAttributes=function(){try{var e=function e(){};Object.defineProperty(t.createElement("video"),"src",{get:e,set:e});Object.defineProperty(t.createElement("audio"),"src",{get:e,set:e});Object.defineProperty(t.createElement("video"),"innerHTML",{get:e,set:e});Object.defineProperty(t.createElement("audio"),"innerHTML",{get:e,set:e})}catch(e){return false}return true};ns.supportsNativeTextTracks=function(){return ft||et&&ot};ns.supportsNativeVideoTracks=function(){return!!(ns.TEST_VID&&ns.TEST_VID.videoTracks)};ns.supportsNativeAudioTracks=function(){return!!(ns.TEST_VID&&ns.TEST_VID.audioTracks)};ns.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"];ns.prototype.featuresVolumeControl=ns.canControlVolume();ns.prototype.featuresMuteControl=ns.canMuteVolume();ns.prototype.featuresPlaybackRate=ns.canControlPlaybackRate();ns.prototype.featuresSourceset=ns.canOverrideAttributes();ns.prototype.movingMediaElementInDOM=!et;ns.prototype.featuresFullscreenResize=true;ns.prototype.featuresProgressEvents=true;ns.prototype.featuresTimeupdateEvents=true;ns.prototype.featuresNativeTextTracks=ns.supportsNativeTextTracks();ns.prototype.featuresNativeVideoTracks=ns.supportsNativeVideoTracks();ns.prototype.featuresNativeAudioTracks=ns.supportsNativeAudioTracks();var ss=ns.TEST_VID&&ns.TEST_VID.constructor.prototype.canPlayType;var os=/^application\/(?:x-|vnd\.apple\.)mpegurl/i;ns.patchCanPlayType=function(){if(rt>=4&&!at&&!ot){ns.TEST_VID.constructor.prototype.canPlayType=function(e){if(e&&os.test(e)){return"maybe"}return ss.call(this,e)}}};ns.unpatchCanPlayType=function(){var e=ns.TEST_VID.constructor.prototype.canPlayType;ns.TEST_VID.constructor.prototype.canPlayType=ss;return e};ns.patchCanPlayType();ns.disposeMediaElement=function(e){if(!e){return}if(e.parentNode){e.parentNode.removeChild(e)}while(e.hasChildNodes()){e.removeChild(e.firstChild)}e.removeAttribute("src");if(typeof e.load==="function"){(function(){try{e.load()}catch(e){}})()}};ns.resetMediaElement=function(e){if(!e){return}var t=e.querySelectorAll("source");var i=t.length;while(i--){e.removeChild(t[i])}e.removeAttribute("src");if(typeof e.load==="function"){(function(){try{e.load()}catch(e){}})()}};["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(e){ns.prototype[e]=function(){return this.el_[e]||this.el_.hasAttribute(e)}});["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(e){ns.prototype["set"+ze(e)]=function(t){this.el_[e]=t;if(t){this.el_.setAttribute(e,e)}else{this.el_.removeAttribute(e)}}});["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","played","networkState","readyState","videoWidth","videoHeight"].forEach(function(e){ns.prototype[e]=function(){return this.el_[e]}});["volume","src","poster","preload","playbackRate","defaultPlaybackRate"].forEach(function(e){ns.prototype["set"+ze(e)]=function(t){this.el_[e]=t}});["pause","load","play"].forEach(function(e){ns.prototype[e]=function(){return this.el_[e]()}});Gr.withSourceHandlers(ns);ns.nativeSourceHandler={};ns.nativeSourceHandler.canPlayType=function(e){try{return ns.TEST_VID.canPlayType(e)}catch(e){return""}};ns.nativeSourceHandler.canHandleSource=function(e,t){if(e.type){return ns.nativeSourceHandler.canPlayType(e.type)}else if(e.src){var i=ui(e.src);return ns.nativeSourceHandler.canPlayType("video/"+i)}return""};ns.nativeSourceHandler.handleSource=function(e,t,i){t.setSrc(e.src)};ns.nativeSourceHandler.dispose=function(){};ns.registerSourceHandler(ns.nativeSourceHandler);Gr.registerTech("Html5",ns);function us(){var e=u(["\n Using the tech directly can be dangerous. I hope you know what you're doing.\n See https://github.com/videojs/video.js/issues/2617 for more info.\n "]);us=function t(){return e};return e}var ls=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"];var cs={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"};var fs=["tiny","xsmall","small","medium","large","xlarge","huge"];var ds={};fs.forEach(function(e){var t=e.charAt(0)==="x"?"x-"+e.substring(1):e;ds[e]="vjs-layout-"+t});var hs={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:Infinity};var ps=function(n){r(a,n);function a(e,t,r){var s;e.id=e.id||t.id||"vjs_video_"+ae();t=b(a.getTagSettings(e),t);t.initChildren=false;t.createEl=false;t.evented=false;t.reportTouchActivity=false;if(!t.language){if(typeof e.closest==="function"){var u=e.closest("[lang]");if(u&&u.getAttribute){t.language=u.getAttribute("lang")}}else{var l=e;while(l&&l.nodeType===1){if(F(l).hasOwnProperty("lang")){t.language=l.getAttribute("lang");break}l=l.parentNode}}}s=n.call(this,null,t,r)||this;s.boundDocumentFullscreenChange_=Ae(o(o(s)),s.documentFullscreenChange_);s.boundFullWindowOnEscKey_=Ae(o(o(s)),s.fullWindowOnEscKey);s.boundHandleKeyPress_=Ae(o(o(s)),s.handleKeyPress);s.log=h(s.id_);s.isPosterFromTech_=false;s.queuedCallbacks_=[];s.isReady_=false;s.hasStarted_=false;s.userActive_=false;if(!s.options_||!s.options_.techOrder||!s.options_.techOrder.length){throw new Error("No techOrder specified. Did you overwrite "+"videojs.options instead of just changing the "+"properties you want to override?")}s.tag=e;s.tagAttributes=e&&F(e);s.language(s.options_.language);if(t.languages){var c={};Object.getOwnPropertyNames(t.languages).forEach(function(e){c[e.toLowerCase()]=t.languages[e]});s.languages_=c}else{s.languages_=a.prototype.options_.languages}s.resetCache_();s.poster_=t.poster||"";s.controls_=!!t.controls;e.controls=false;e.removeAttribute("controls");s.changingSrc_=false;s.playCallbacks_=[];s.playTerminatedQueue_=[];if(e.hasAttribute("autoplay")){s.autoplay(true)}else{s.autoplay(s.options_.autoplay)}if(t.plugins){Object.keys(t.plugins).forEach(function(e){if(typeof s[e]!=="function"){throw new Error('plugin "'+e+'" does not exist')}})}s.scrubbing_=false;s.el_=s.createEl();Ve(o(o(s)),{eventBusKey:"el_"});if(s.fluid_){s.on("playerreset",s.updateStyleEl_)}var f=Ge(s.options_);if(t.plugins){Object.keys(t.plugins).forEach(function(e){s[e](t.plugins[e])})}s.options_.playerOptions=f;s.middleware_=[];s.initChildren();s.isAudio(e.nodeName.toLowerCase()==="audio");if(s.controls()){s.addClass("vjs-controls-enabled")}else{s.addClass("vjs-controls-disabled")}s.el_.setAttribute("role","region");if(s.isAudio()){s.el_.setAttribute("aria-label",s.localize("Audio Player"))}else{s.el_.setAttribute("aria-label",s.localize("Video Player"))}if(s.isAudio()){s.addClass("vjs-audio")}if(s.flexNotSupported_()){s.addClass("vjs-no-flex")}if(dt){s.addClass("vjs-touch-enabled")}if(!et){s.addClass("vjs-workinghover")}a.players[s.id_]=o(o(s));var d=i.split(".")[0];s.addClass("vjs-v"+d);s.userActive(true);s.reportUserActivity();s.one("play",s.listenForUserActivity_);s.on("focus",s.handleFocus);s.on("blur",s.handleBlur);s.on("stageclick",s.handleStageClick_);s.breakpoints(s.options_.breakpoints);s.responsive(s.options_.responsive);return s}var s=a.prototype;s.dispose=function e(){var i=this;this.trigger("dispose");this.off("dispose");ge(t,_t.fullscreenchange,this.boundDocumentFullscreenChange_);ge(t,"keydown",this.boundFullWindowOnEscKey_);ge(t,"keydown",this.boundHandleKeyPress_);if(this.styleEl_&&this.styleEl_.parentNode){this.styleEl_.parentNode.removeChild(this.styleEl_);this.styleEl_=null}a.players[this.id_]=null;if(this.tag&&this.tag.player){this.tag.player=null}if(this.el_&&this.el_.player){this.el_.player=null}if(this.tech_){this.tech_.dispose();this.isPosterFromTech_=false;this.poster_=""}if(this.playerElIngest_){this.playerElIngest_=null}if(this.tag){this.tag=null}un(this);nr.names.forEach(function(e){var t=nr[e];var r=i[t.getterName]();if(r&&r.off){r.off()}});n.prototype.dispose.call(this)};s.createEl=function i(){var r=this.tag;var a;var s=this.playerElIngest_=r.parentNode&&r.parentNode.hasAttribute&&r.parentNode.hasAttribute("data-vjs-player");var o=this.tag.tagName.toLowerCase()==="video-js";if(s){a=this.el_=r.parentNode}else if(!o){a=this.el_=n.prototype.createEl.call(this,"div")}var u=F(r);if(o){a=this.el_=r;r=this.tag=t.createElement("video");while(a.children.length){r.appendChild(a.firstChild)}if(!R(a,"video-js")){M(a,"video-js")}a.appendChild(r);s=this.playerElIngest_=a;Object.keys(a).forEach(function(e){r[e]=a[e]})}r.setAttribute("tabindex","-1");u.tabindex="-1";if(lt){r.setAttribute("role","application");u.role="application"}r.removeAttribute("width");r.removeAttribute("height");if("width"in u){delete u.width}if("height"in u){delete u.height}Object.getOwnPropertyNames(u).forEach(function(e){if(!(o&&e==="class")){a.setAttribute(e,u[e])}if(o){r.setAttribute(e,u[e])}});r.playerId=r.id;r.id+="_html5_api";r.className="vjs-tech";r.player=a.player=this;this.addClass("vjs-paused");if(e.VIDEOJS_NO_DYNAMIC_STYLE!==true){this.styleEl_=Ce("vjs-styles-dimensions");var l=te(".vjs-styles-defaults");var c=te("head");c.insertBefore(this.styleEl_,l?l.nextSibling:c.firstChild)}this.fill_=false;this.fluid_=false;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);var f=r.getElementsByTagName("a");for(var d=0;d<f.length;d++){var h=f.item(d);M(h,"vjs-hidden");h.setAttribute("hidden","hidden")}r.initNetworkState_=r.networkState;if(r.parentNode&&!s){r.parentNode.insertBefore(a,r)}x(r,a);this.children_.unshift(r);this.el_.setAttribute("lang",this.language_);this.el_=a;return a};s.width=function e(t){return this.dimension("width",t)};s.height=function e(t){return this.dimension("height",t)};s.dimension=function e(t,i){var r=t+"_";if(i===undefined){return this[r]||0}if(i===""){this[r]=undefined;this.updateStyleEl_();return}var n=parseFloat(i);if(isNaN(n)){d.error('Improper value "'+i+'" supplied for for '+t);return}this[r]=n;this.updateStyleEl_()};s.fluid=function e(t){if(t===undefined){return!!this.fluid_}this.fluid_=!!t;if(Ue(this)){this.off("playerreset",this.updateStyleEl_)}if(t){this.addClass("vjs-fluid");this.fill(false);De(function(){this.on("playerreset",this.updateStyleEl_)})}else{this.removeClass("vjs-fluid")}this.updateStyleEl_()};s.fill=function e(t){if(t===undefined){return!!this.fill_}this.fill_=!!t;if(t){this.addClass("vjs-fill");this.fluid(false)}else{this.removeClass("vjs-fill")}};s.aspectRatio=function e(t){if(t===undefined){return this.aspectRatio_}if(!/^\d+\:\d+$/.test(t)){throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.")}this.aspectRatio_=t;this.fluid(true);this.updateStyleEl_()};s.updateStyleEl_=function t(){if(e.VIDEOJS_NO_DYNAMIC_STYLE===true){var i=typeof this.width_==="number"?this.width_:this.options_.width;var r=typeof this.height_==="number"?this.height_:this.options_.height;var n=this.tech_&&this.tech_.el();if(n){if(i>=0){n.width=i}if(r>=0){n.height=r}}return}var a;var s;var o;var u;if(this.aspectRatio_!==undefined&&this.aspectRatio_!=="auto"){o=this.aspectRatio_}else if(this.videoWidth()>0){o=this.videoWidth()+":"+this.videoHeight()}else{o="16:9"}var l=o.split(":");var c=l[1]/l[0];if(this.width_!==undefined){a=this.width_}else if(this.height_!==undefined){a=this.height_/c}else{a=this.videoWidth()||300}if(this.height_!==undefined){s=this.height_}else{s=a*c}if(/^[^a-zA-Z]/.test(this.id())){u="dimensions-"+this.id()}else{u=this.id()+"-dimensions"}this.addClass(u);Ee(this.styleEl_,"\n ."+u+" {\n width: "+a+"px;\n height: "+s+"px;\n }\n\n ."+u+".vjs-fluid {\n padding-top: "+c*100+"%;\n }\n ")};s.loadTech_=function e(t,i){var r=this;if(this.tech_){this.unloadTech_()}var n=ze(t);var a=t.charAt(0).toLowerCase()+t.slice(1);if(n!=="Html5"&&this.tag){Gr.getTech("Html5").disposeMediaElement(this.tag);this.tag.player=null;this.tag=null}this.techName_=n;this.isReady_=false;var s=typeof this.autoplay()==="string"?false:this.autoplay();var o={source:i,autoplay:s,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:this.id()+"_"+a+"_api",playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||false,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset};nr.names.forEach(function(e){var t=nr[e];o[t.getterName]=r[t.privateName]});b(o,this.options_[n]);b(o,this.options_[a]);b(o,this.options_[t.toLowerCase()]);if(this.tag){o.tag=this.tag}if(i&&i.src===this.cache_.src&&this.cache_.currentTime>0){o.startTime=this.cache_.currentTime}var u=Gr.getTech(t);if(!u){throw new Error("No Tech named '"+n+"' exists! '"+n+"' should be registered using videojs.registerTech()'")}this.tech_=new u(o);this.tech_.ready(Ae(this,this.handleTechReady_),true);Rt.jsonToTextTracks(this.textTracksJson_||[],this.tech_);ls.forEach(function(e){r.on(r.tech_,e,r["handleTech"+ze(e)+"_"])});Object.keys(cs).forEach(function(e){r.on(r.tech_,e,function(t){if(r.tech_.playbackRate()===0&&r.tech_.seeking()){r.queuedCallbacks_.push({callback:r["handleTech"+cs[e]+"_"].bind(r),event:t});return}r["handleTech"+cs[e]+"_"](t)})});this.on(this.tech_,"loadstart",this.handleTechLoadStart_);this.on(this.tech_,"sourceset",this.handleTechSourceset_);this.on(this.tech_,"waiting",this.handleTechWaiting_);this.on(this.tech_,"ended",this.handleTechEnded_);this.on(this.tech_,"seeking",this.handleTechSeeking_);this.on(this.tech_,"play",this.handleTechPlay_);this.on(this.tech_,"firstplay",this.handleTechFirstPlay_);this.on(this.tech_,"pause",this.handleTechPause_);this.on(this.tech_,"durationchange",this.handleTechDurationChange_);this.on(this.tech_,"fullscreenchange",this.handleTechFullscreenChange_);this.on(this.tech_,"error",this.handleTechError_);this.on(this.tech_,"loadedmetadata",this.updateStyleEl_);this.on(this.tech_,"posterchange",this.handleTechPosterChange_);this.on(this.tech_,"textdata",this.handleTechTextData_);this.on(this.tech_,"ratechange",this.handleTechRateChange_);this.usingNativeControls(this.techGet_("controls"));if(this.controls()&&!this.usingNativeControls()){this.addTechControlsListeners_()}if(this.tech_.el().parentNode!==this.el()&&(n!=="Html5"||!this.tag)){x(this.tech_.el(),this.el())}if(this.tag){this.tag.player=null;this.tag=null}};s.unloadTech_=function e(){var t=this;nr.names.forEach(function(e){var i=nr[e];t[i.privateName]=t[i.getterName]()});this.textTracksJson_=Rt.textTracksToJson(this.tech_);this.isReady_=false;this.tech_.dispose();this.tech_=false;if(this.isPosterFromTech_){this.poster_="";this.trigger("posterchange")}this.isPosterFromTech_=false};s.tech=function e(t){if(t===undefined){d.warn(m(us()))}return this.tech_};s.addTechControlsListeners_=function e(){this.removeTechControlsListeners_();this.on(this.tech_,"mousedown",this.handleTechClick_);this.on(this.tech_,"dblclick",this.handleTechDoubleClick_);this.on(this.tech_,"touchstart",this.handleTechTouchStart_);this.on(this.tech_,"touchmove",this.handleTechTouchMove_);this.on(this.tech_,"touchend",this.handleTechTouchEnd_);this.on(this.tech_,"tap",this.handleTechTap_)};s.removeTechControlsListeners_=function e(){this.off(this.tech_,"tap",this.handleTechTap_);this.off(this.tech_,"touchstart",this.handleTechTouchStart_);this.off(this.tech_,"touchmove",this.handleTechTouchMove_);this.off(this.tech_,"touchend",this.handleTechTouchEnd_);this.off(this.tech_,"mousedown",this.handleTechClick_);this.off(this.tech_,"dblclick",this.handleTechDoubleClick_)};s.handleTechReady_=function e(){this.triggerReady();if(this.cache_.volume){this.techCall_("setVolume",this.cache_.volume)}this.handleTechPosterChange_();this.handleTechDurationChange_()};s.handleTechLoadStart_=function e(){this.removeClass("vjs-ended");this.removeClass("vjs-seeking");this.error(null);this.handleTechDurationChange_();if(!this.paused()){this.trigger("loadstart");this.trigger("firstplay")}else{this.hasStarted(false);this.trigger("loadstart")}this.manualAutoplay_(this.autoplay())};s.manualAutoplay_=function e(t){var i=this;if(!this.tech_||typeof t!=="string"){return}var r=function e(){var t=i.muted();i.muted(true);var r=function e(){i.muted(t)};i.playTerminatedQueue_.push(r);var n=i.play();if(!Pt(n)){return}return n.catch(r)};var n;if(t==="any"&&this.muted()!==true){n=this.play();if(Pt(n)){n=n.catch(r)}}else if(t==="muted"&&this.muted()!==true){n=r()}else{n=this.play()}if(!Pt(n)){return}return n.then(function(){i.trigger({type:"autoplay-success",autoplay:t})}).catch(function(e){i.trigger({type:"autoplay-failure",autoplay:t})})};s.updateSourceCaches_=function e(t){if(t===void 0){t=""}var i=t;var r="";if(typeof i!=="string"){i=t.src;r=t.type}this.cache_.source=this.cache_.source||{};this.cache_.sources=this.cache_.sources||[];if(i&&!r){r=hn(this,i)}this.cache_.source=Ge({},t,{src:i,type:r});var n=this.cache_.sources.filter(function(e){return e.src&&e.src===i});var a=[];var s=this.$$("source");var o=[];for(var u=0;u<s.length;u++){var l=F(s[u]);a.push(l);if(l.src&&l.src===i){o.push(l.src)}}if(o.length&&!n.length){this.cache_.sources=a}else if(!n.length){this.cache_.sources=[this.cache_.source]}this.cache_.src=i};s.handleTechSourceset_=function e(t){var i=this;if(!this.changingSrc_){var r=function e(t){return i.updateSourceCaches_(t)};var n=this.currentSource().src;var a=t.src;if(n&&!/^blob:/.test(n)&&/^blob:/.test(a)){if(!this.lastSource_||this.lastSource_.tech!==a&&this.lastSource_.player!==n){r=function e(){}}}r(a);if(!t.src){var s=function e(t){if(t.type!=="sourceset"){var r=i.techGet("currentSrc");i.lastSource_.tech=r;i.updateSourceCaches_(r)}i.tech_.off(["sourceset","loadstart"],e)};this.tech_.one(["sourceset","loadstart"],s)}}this.lastSource_={player:this.currentSource().src,tech:t.src};this.trigger({src:t.src,type:"sourceset"})};s.hasStarted=function e(t){if(t===undefined){return this.hasStarted_}if(t===this.hasStarted_){return}this.hasStarted_=t;if(this.hasStarted_){this.addClass("vjs-has-started");this.trigger("firstplay")}else{this.removeClass("vjs-has-started")}};s.handleTechPlay_=function e(){this.removeClass("vjs-ended");this.removeClass("vjs-paused");this.addClass("vjs-playing");this.hasStarted(true);this.trigger("play")};s.handleTechRateChange_=function e(){if(this.tech_.playbackRate()>0&&this.cache_.lastPlaybackRate===0){this.queuedCallbacks_.forEach(function(e){return e.callback(e.event)});this.queuedCallbacks_=[]}this.cache_.lastPlaybackRate=this.tech_.playbackRate();this.trigger("ratechange")};s.handleTechWaiting_=function e(){var t=this;this.addClass("vjs-waiting");this.trigger("waiting");var i=this.currentTime();var r=function e(){if(i!==t.currentTime()){t.removeClass("vjs-waiting");t.off("timeupdate",e)}};this.on("timeupdate",r)};s.handleTechCanPlay_=function e(){this.removeClass("vjs-waiting");this.trigger("canplay")};s.handleTechCanPlayThrough_=function e(){this.removeClass("vjs-waiting");this.trigger("canplaythrough")};s.handleTechPlaying_=function e(){this.removeClass("vjs-waiting");this.trigger("playing")};s.handleTechSeeking_=function e(){this.addClass("vjs-seeking");this.trigger("seeking")};s.handleTechSeeked_=function e(){this.removeClass("vjs-seeking");this.removeClass("vjs-ended");this.trigger("seeked")};s.handleTechFirstPlay_=function e(){if(this.options_.starttime){d.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")};s.handleTechPause_=function e(){this.removeClass("vjs-playing");this.addClass("vjs-paused");this.trigger("pause")};s.handleTechEnded_=function e(){this.addClass("vjs-ended");if(this.options_.loop){this.currentTime(0);this.play()}else if(!this.paused()){this.pause()}this.trigger("ended")};s.handleTechDurationChange_=function e(){this.duration(this.techGet_("duration"))};s.handleTechClick_=function e(t){if(!ee(t)){return}if(!this.controls_){return}if(this.paused()){Ot(this.play())}else{this.pause()}};s.handleTechDoubleClick_=function e(t){if(!this.controls_){return}var i=Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),function(e){return e.contains(t.target)});if(!i){if(this.options_===undefined||this.options_.userActions===undefined||this.options_.userActions.doubleClick===undefined||this.options_.userActions.doubleClick!==false){if(this.options_!==undefined&&this.options_.userActions!==undefined&&typeof this.options_.userActions.doubleClick==="function"){this.options_.userActions.doubleClick.call(this,t)}else if(this.isFullscreen()){this.exitFullscreen()}else{this.requestFullscreen()}}}};s.handleTechTap_=function e(){this.userActive(!this.userActive())};s.handleTechTouchStart_=function e(){this.userWasActive=this.userActive()};s.handleTechTouchMove_=function e(){if(this.userWasActive){this.reportUserActivity()}};s.handleTechTouchEnd_=function e(t){t.preventDefault()};s.handleStageClick_=function e(){this.reportUserActivity()};s.toggleFullscreenClass_=function e(){if(this.isFullscreen()){this.addClass("vjs-fullscreen")}else{this.removeClass("vjs-fullscreen")}};s.documentFullscreenChange_=function e(i){var r=_t;this.isFullscreen(t[r.fullscreenElement]===this.el()||this.el().matches(":"+r.fullscreen));if(this.isFullscreen()===false){ge(t,r.fullscreenchange,this.boundDocumentFullscreenChange_)}if(!kt){this.trigger("fullscreenchange")}};s.handleTechFullscreenChange_=function e(t,i){if(i){this.isFullscreen(i.isFullscreen)}this.trigger("fullscreenchange")};s.handleTechError_=function e(){var t=this.tech_.error();this.error(t)};s.handleTechTextData_=function e(){var t=null;if(arguments.length>1){t=arguments[1]}this.trigger("textdata",t)};s.getCache=function e(){return this.cache_};s.resetCache_=function e(){this.cache_={currentTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],volume:1}};s.techCall_=function e(t,i){this.ready(function(){if(t in nn){return en(this.middleware_,this.tech_,t,i)}else if(t in an){return tn(this.middleware_,this.tech_,t,i)}try{if(this.tech_){this.tech_[t](i)}}catch(e){d(e);throw e}},true)};s.techGet_=function e(t){if(!this.tech_||!this.tech_.isReady_){return}if(t in rn){return Zr(this.middleware_,this.tech_,t)}else if(t in an){return tn(this.middleware_,this.tech_,t)}try{return this.tech_[t]()}catch(e){if(this.tech_[t]===undefined){d("Video.js: "+t+" method not defined for "+this.techName_+" playback technology.",e);throw e}if(e.name==="TypeError"){d("Video.js: "+t+" unavailable on "+this.techName_+" playback technology element.",e);this.tech_.isReady_=false;throw e}d(e);throw e}};s.play=function t(){var i=this;var r=this.options_.Promise||e.Promise;if(r){return new r(function(e){i.play_(e)})}return this.play_()};s.play_=function e(t){var i=this;if(t===void 0){t=Ot}this.playCallbacks_.push(t);var r=Boolean(!this.changingSrc_&&(this.src()||this.currentSrc()));if(this.waitToPlay_){this.off(["ready","loadstart"],this.waitToPlay_);this.waitToPlay_=null}if(!this.isReady_||!r){this.waitToPlay_=function(e){i.play_()};this.one(["ready","loadstart"],this.waitToPlay_);if(!r&&(ft||et)){this.load()}return}var n=this.techGet_("play");if(n===null){this.runPlayTerminatedQueue_()}else{this.runPlayCallbacks_(n)}};s.runPlayTerminatedQueue_=function e(){var t=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[];t.forEach(function(e){e()})};s.runPlayCallbacks_=function e(t){var i=this.playCallbacks_.slice(0);this.playCallbacks_=[];this.playTerminatedQueue_=[];i.forEach(function(e){e(t)})};s.pause=function e(){this.techCall_("pause")};s.paused=function e(){return this.techGet_("paused")===false?false:true};s.played=function e(){return this.techGet_("played")||gt(0,0)};s.scrubbing=function e(t){if(typeof t==="undefined"){return this.scrubbing_}this.scrubbing_=!!t;if(t){this.addClass("vjs-scrubbing")}else{this.removeClass("vjs-scrubbing")}};s.currentTime=function e(t){if(typeof t!=="undefined"){if(t<0){t=0}this.techCall_("setCurrentTime",t);return}this.cache_.currentTime=this.techGet_("currentTime")||0;return this.cache_.currentTime};s.duration=function e(t){if(t===undefined){return this.cache_.duration!==undefined?this.cache_.duration:NaN}t=parseFloat(t);if(t<0){t=Infinity}if(t!==this.cache_.duration){this.cache_.duration=t;if(t===Infinity){this.addClass("vjs-live");if(this.options_.liveui&&this.player_.liveTracker){this.addClass("vjs-liveui")}}else{this.removeClass("vjs-live");this.removeClass("vjs-liveui")}if(!isNaN(t)){this.trigger("durationchange")}}};s.remainingTime=function e(){return this.duration()-this.currentTime()};s.remainingTimeDisplay=function e(){return Math.floor(this.duration())-Math.floor(this.currentTime())};s.buffered=function e(){var e=this.techGet_("buffered");if(!e||!e.length){e=gt(0,0)}return e};s.bufferedPercent=function e(){return yt(this.buffered(),this.duration())};s.bufferedEnd=function e(){var t=this.buffered();var i=this.duration();var r=t.end(t.length-1);if(r>i){r=i}return r};s.volume=function e(t){var i;if(t!==undefined){i=Math.max(0,Math.min(1,parseFloat(t)));this.cache_.volume=i;this.techCall_("setVolume",i);if(i>0){this.lastVolume_(i)}return}i=parseFloat(this.techGet_("volume"));return isNaN(i)?1:i};s.muted=function e(t){if(t!==undefined){this.techCall_("setMuted",t);return}return this.techGet_("muted")||false};s.defaultMuted=function e(t){if(t!==undefined){return this.techCall_("setDefaultMuted",t)}return this.techGet_("defaultMuted")||false};s.lastVolume_=function e(t){if(t!==undefined&&t!==0){this.cache_.lastVolume=t;return}return this.cache_.lastVolume};s.supportsFullScreen=function e(){return this.techGet_("supportsFullScreen")||false};s.isFullscreen=function e(t){if(t!==undefined){this.isFullscreen_=!!t;this.toggleFullscreenClass_();return}return!!this.isFullscreen_};s.requestFullscreen=function e(){var i=_t;this.isFullscreen(true);if(i.requestFullscreen){ve(t,i.fullscreenchange,this.boundDocumentFullscreenChange_);this.el_[i.requestFullscreen]()}else if(this.tech_.supportsFullScreen()){this.techCall_("enterFullScreen")}else{this.enterFullWindow();this.trigger("fullscreenchange")}};s.exitFullscreen=function e(){var i=_t;this.isFullscreen(false);if(i.requestFullscreen){t[i.exitFullscreen]()}else if(this.tech_.supportsFullScreen()){this.techCall_("exitFullScreen")}else{this.exitFullWindow();this.trigger("fullscreenchange")}};s.enterFullWindow=function e(){this.isFullWindow=true;this.docOrigOverflow=t.documentElement.style.overflow;ve(t,"keydown",this.boundFullWindowOnEscKey_);t.documentElement.style.overflow="hidden";M(t.body,"vjs-full-window");this.trigger("enterFullWindow")};s.fullWindowOnEscKey=function e(t){if(Nt.isEventKey(t,"Esc")){if(this.isFullscreen()===true){this.exitFullscreen()}else{this.exitFullWindow()}}};s.exitFullWindow=function e(){this.isFullWindow=false;ge(t,"keydown",this.boundFullWindowOnEscKey_);t.documentElement.style.overflow=this.docOrigOverflow;B(t.body,"vjs-full-window");this.trigger("exitFullWindow")};s.handleFocus=function e(i){ge(t,"keydown",this.boundHandleKeyPress_);ve(t,"keydown",this.boundHandleKeyPress_)};s.handleBlur=function e(i){ge(t,"keydown",this.boundHandleKeyPress_)};s.handleKeyPress=function e(t){if(this.options_.userActions&&this.options_.userActions.hotkeys&&this.options_.userActions.hotkeys!==false){if(typeof this.options_.userActions.hotkeys==="function"){this.options_.userActions.hotkeys.call(this,t)}else{this.handleHotkeys(t)}}};s.handleHotkeys=function e(i){var r=this.options_.userActions?this.options_.userActions.hotkeys:{};var n=r.fullscreenKey,a=n===void 0?function(e){return Nt.isEventKey(e,"f")}:n,s=r.muteKey,o=s===void 0?function(e){return Nt.isEventKey(e,"m")}:s,u=r.playPauseKey,l=u===void 0?function(e){return Nt.isEventKey(e,"k")||Nt.isEventKey(e,"Space")}:u;if(a.call(this,i)){i.preventDefault();var c=Xe.getComponent("FullscreenToggle");if(t[_t.fullscreenEnabled]!==false){c.prototype.handleClick.call(this)}}else if(o.call(this,i)){i.preventDefault();var f=Xe.getComponent("MuteToggle");f.prototype.handleClick.call(this)}else if(l.call(this,i)){i.preventDefault();var d=Xe.getComponent("PlayToggle");d.prototype.handleClick.call(this)}};s.canPlayType=function e(t){var i;for(var r=0,n=this.options_.techOrder;r<n.length;r++){var a=n[r];var s=Gr.getTech(a);if(!s){s=Xe.getComponent(a)}if(!s){d.error('The "'+a+'" tech is undefined. Skipped browser support check for that tech.');continue}if(s.isSupported()){i=s.canPlayType(t);if(i){return i}}}return""};s.selectSource=function e(t){var i=this;var r=this.options_.techOrder.map(function(e){return[e,Gr.getTech(e)]}).filter(function(e){var t=e[0],i=e[1];if(i){return i.isSupported()}d.error('The "'+t+'" tech is undefined. Skipped browser support check for that tech.');return false});var n=function e(t,i,r){var n;t.some(function(e){return i.some(function(t){n=r(e,t);if(n){return true}})});return n};var a;var s=function e(t){return function(e,i){return t(i,e)}};var o=function e(t,r){var n=t[0],a=t[1];if(a.canPlaySource(r,i.options_[n.toLowerCase()])){return{source:r,tech:n}}};if(this.options_.sourceOrder){a=n(t,r,s(o))}else{a=n(r,t,o)}return a||false};s.src=function e(t){var i=this;if(typeof t==="undefined"){return this.cache_.src||""}var r=pn(t);if(!r.length){this.setTimeout(function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})},0);return}this.changingSrc_=true;this.cache_.sources=r;this.updateSourceCaches_(r[0]);Qr(this,r[0],function(e,t){i.middleware_=t;i.cache_.sources=r;i.updateSourceCaches_(e);var n=i.src_(e);if(n){if(r.length>1){return i.src(r.slice(1))}i.changingSrc_=false;i.setTimeout(function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})},0);i.triggerReady();return}Jr(t,i.tech_)})};s.src_=function e(t){var i=this;var r=this.selectSource([t]);if(!r){return true}if(!We(r.tech,this.techName_)){this.changingSrc_=true;this.loadTech_(r.tech,r.source);this.tech_.ready(function(){i.changingSrc_=false});return false}this.ready(function(){if(this.tech_.constructor.prototype.hasOwnProperty("setSource")){this.techCall_("setSource",t)}else{this.techCall_("src",t.src)}this.changingSrc_=false},true);return false};s.load=function e(){this.techCall_("load")};s.reset=function t(){var i=this;var r=this.options_.Promise||e.Promise;if(this.paused()||!r){this.doReset_()}else{var n=this.play();Ot(n.then(function(){return i.doReset_()}))}};s.doReset_=function e(){if(this.tech_){this.tech_.clearTracks("text")}this.resetCache_();this.poster("");this.loadTech_(this.options_.techOrder[0],null);this.techCall_("reset");this.resetControlBarUI_();if(Ue(this)){this.trigger("playerreset")}};s.resetControlBarUI_=function e(){this.resetProgressBar_();this.resetPlaybackRate_();this.resetVolumeBar_()};s.resetProgressBar_=function e(){this.currentTime(0);var t=this.controlBar,i=t.durationDisplay,r=t.remainingTimeDisplay;if(i){i.updateContent()}if(r){r.updateContent()}};s.resetPlaybackRate_=function e(){this.playbackRate(this.defaultPlaybackRate());this.handleTechRateChange_()};s.resetVolumeBar_=function e(){this.volume(1);this.trigger("volumechange")};s.currentSources=function e(){var t=this.currentSource();var i=[];if(Object.keys(t).length!==0){i.push(t)}return this.cache_.sources||i};s.currentSource=function e(){return this.cache_.source||{}};s.currentSrc=function e(){return this.currentSource()&&this.currentSource().src||""};s.currentType=function e(){return this.currentSource()&&this.currentSource().type||""};s.preload=function e(t){if(t!==undefined){this.techCall_("setPreload",t);this.options_.preload=t;return}return this.techGet_("preload")};s.autoplay=function e(t){if(t===undefined){return this.options_.autoplay||false}var i;if(typeof t==="string"&&/(any|play|muted)/.test(t)){this.options_.autoplay=t;this.manualAutoplay_(t);i=false}else if(!t){this.options_.autoplay=false}else{this.options_.autoplay=true}i=typeof i==="undefined"?this.options_.autoplay:i;if(this.tech_){this.techCall_("setAutoplay",i)}};s.playsinline=function e(t){if(t!==undefined){this.techCall_("setPlaysinline",t);this.options_.playsinline=t;return this}return this.techGet_("playsinline")};s.loop=function e(t){if(t!==undefined){this.techCall_("setLoop",t);this.options_.loop=t;return}return this.techGet_("loop")};s.poster=function e(t){if(t===undefined){return this.poster_}if(!t){t=""}if(t===this.poster_){return}this.poster_=t;this.techCall_("setPoster",t);this.isPosterFromTech_=false;this.trigger("posterchange")};s.handleTechPosterChange_=function e(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){var t=this.tech_.poster()||"";if(t!==this.poster_){this.poster_=t;this.isPosterFromTech_=true;this.trigger("posterchange")}}};s.controls=function e(t){if(t===undefined){return!!this.controls_}t=!!t;if(this.controls_===t){return}this.controls_=t;if(this.usingNativeControls()){this.techCall_("setControls",t)}if(this.controls_){this.removeClass("vjs-controls-disabled");this.addClass("vjs-controls-enabled");this.trigger("controlsenabled");if(!this.usingNativeControls()){this.addTechControlsListeners_()}}else{this.removeClass("vjs-controls-enabled");this.addClass("vjs-controls-disabled");this.trigger("controlsdisabled");if(!this.usingNativeControls()){this.removeTechControlsListeners_()}}};s.usingNativeControls=function e(t){if(t===undefined){return!!this.usingNativeControls_}t=!!t;if(this.usingNativeControls_===t){return}this.usingNativeControls_=t;if(this.usingNativeControls_){this.addClass("vjs-using-native-controls");this.trigger("usingnativecontrols")}else{this.removeClass("vjs-using-native-controls");this.trigger("usingcustomcontrols")}};s.error=function e(t){if(t===undefined){return this.error_||null}if(t===null){this.error_=t;this.removeClass("vjs-error");if(this.errorDisplay){this.errorDisplay.close()}return}this.error_=new Et(t);this.addClass("vjs-error");d.error("(CODE:"+this.error_.code+" "+Et.errorTypes[this.error_.code]+")",this.error_.message,this.error_);this.trigger("error");return};s.reportUserActivity=function e(t){this.userActivity_=true};s.userActive=function e(t){if(t===undefined){return this.userActive_}t=!!t;if(t===this.userActive_){return}this.userActive_=t;if(this.userActive_){this.userActivity_=true;this.removeClass("vjs-user-inactive");this.addClass("vjs-user-active");this.trigger("useractive");return}if(this.tech_){this.tech_.one("mousemove",function(e){e.stopPropagation();e.preventDefault()})}this.userActivity_=false;this.removeClass("vjs-user-active");this.addClass("vjs-user-inactive");this.trigger("userinactive")};s.listenForUserActivity_=function e(){var t;var i;var r;var n=Ae(this,this.reportUserActivity);var a=function e(t){if(t.screenX!==i||t.screenY!==r){i=t.screenX;r=t.screenY;n()}};var s=function e(){n();this.clearInterval(t);t=this.setInterval(n,250)};var o=function e(i){n();this.clearInterval(t)};this.on("mousedown",s);this.on("mousemove",a);this.on("mouseup",o);var u=this.getChild("controlBar");if(u&&!et&&!it){u.on("mouseenter",function(e){this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout;this.player().options_.inactivityTimeout=0});u.on("mouseleave",function(e){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})}this.on("keydown",n);this.on("keyup",n);var l;this.setInterval(function(){if(!this.userActivity_){return}this.userActivity_=false;this.userActive(true);this.clearTimeout(l);var e=this.options_.inactivityTimeout;if(e<=0){return}l=this.setTimeout(function(){if(!this.userActivity_){this.userActive(false)}},e)},250)};s.playbackRate=function e(t){if(t!==undefined){this.techCall_("setPlaybackRate",t);return}if(this.tech_&&this.tech_.featuresPlaybackRate){return this.cache_.lastPlaybackRate||this.techGet_("playbackRate")}return 1};s.defaultPlaybackRate=function e(t){if(t!==undefined){return this.techCall_("setDefaultPlaybackRate",t)}if(this.tech_&&this.tech_.featuresPlaybackRate){return this.techGet_("defaultPlaybackRate")}return 1};s.isAudio=function e(t){if(t!==undefined){this.isAudio_=!!t;return}return!!this.isAudio_};s.addTextTrack=function e(t,i,r){if(this.tech_){return this.tech_.addTextTrack(t,i,r)}};s.addRemoteTextTrack=function e(t,i){if(this.tech_){return this.tech_.addRemoteTextTrack(t,i)}};s.removeRemoteTextTrack=function e(t){if(t===void 0){t={}}var i=t,r=i.track;if(!r){r=t}if(this.tech_){return this.tech_.removeRemoteTextTrack(r)}};s.getVideoPlaybackQuality=function e(){return this.techGet_("getVideoPlaybackQuality")};s.videoWidth=function e(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0};s.videoHeight=function e(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0};s.language=function e(t){if(t===undefined){return this.language_}this.language_=String(t).toLowerCase()};s.languages=function e(){return Ge(a.prototype.options_.languages,this.languages_)};s.toJSON=function e(){var t=Ge(this.options_);var i=t.tracks;t.tracks=[];for(var r=0;r<i.length;r++){var n=i[r];n=Ge(n);n.player=undefined;t.tracks[r]=n}return t};s.createModal=function e(t,i){var r=this;i=i||{};i.content=t||"";var n=new Wt(this,i);this.addChild(n);n.on("dispose",function(){r.removeChild(n)});n.open();return n};s.updateCurrentBreakpoint_=function e(){if(!this.responsive()){return}var t=this.currentBreakpoint();var i=this.currentWidth();for(var r=0;r<fs.length;r++){var n=fs[r];var a=this.breakpoints_[n];if(i<=a){if(t===n){return}if(t){this.removeClass(ds[t])}this.addClass(ds[n]);this.breakpoint_=n;break}}};s.removeCurrentBreakpoint_=function e(){var t=this.currentBreakpointClass();this.breakpoint_="";if(t){this.removeClass(t)}};s.breakpoints=function e(t){if(t===undefined){return b(this.breakpoints_)}this.breakpoint_="";this.breakpoints_=b({},hs,t);this.updateCurrentBreakpoint_();return b(this.breakpoints_)};s.responsive=function e(t){if(t===undefined){return this.responsive_}t=Boolean(t);var i=this.responsive_;if(t===i){return}this.responsive_=t;if(t){this.on("playerresize",this.updateCurrentBreakpoint_);this.updateCurrentBreakpoint_()}else{this.off("playerresize",this.updateCurrentBreakpoint_);this.removeCurrentBreakpoint_()}return t};s.currentBreakpoint=function e(){return this.breakpoint_};s.currentBreakpointClass=function e(){return ds[this.breakpoint_]||""};s.loadMedia=function e(t,i){var r=this;if(!t||typeof t!=="object"){return}this.reset();this.cache_.media=Ge(t);var n=this.cache_.media,a=n.artwork,s=n.poster,o=n.src,u=n.textTracks;if(!a&&s){this.cache_.media.artwork=[{src:s,type:dn(s)}]}if(o){this.src(o)}if(s){this.poster(s)}if(Array.isArray(u)){u.forEach(function(e){return r.addRemoteTextTrack(e,false)})}this.ready(i)};s.getMedia=function e(){if(!this.cache_.media){var t=this.poster();var i=this.currentSources();var r=Array.prototype.map.call(this.remoteTextTracks(),function(e){return{kind:e.kind,label:e.label,language:e.language,src:e.src}});var n={src:i,textTracks:r};if(t){n.poster=t;n.artwork=[{src:n.poster,type:dn(n.poster)}]}return n}return Ge(this.cache_.media)};a.getTagSettings=function e(t){var i={sources:[],tracks:[]};var r=F(t);var n=r["data-setup"];if(R(t,"vjs-fill")){r.fill=true}if(R(t,"vjs-fluid")){r.fluid=true}if(n!==null){var a=Lt(n||"{}"),s=a[0],o=a[1];if(s){d.error(s)}b(r,o)}b(i,r);if(t.hasChildNodes()){var u=t.childNodes;for(var l=0,c=u.length;l<c;l++){var f=u[l];var h=f.nodeName.toLowerCase();if(h==="source"){i.sources.push(F(f))}else if(h==="track"){i.tracks.push(F(f))}}}return i};s.flexNotSupported_=function e(){var i=t.createElement("i");return!("flexBasis"in i.style||"webkitFlexBasis"in i.style||"mozFlexBasis"in i.style||"msFlexBasis"in i.style||"msFlexOrder"in i.style)};return a}(Xe);nr.names.forEach(function(e){var t=nr[e];ps.prototype[t.getterName]=function(){if(this.tech_){return this.tech_[t.getterName]()}this[t.privateName]=this[t.privateName]||new t.ListClass;return this[t.privateName]}});ps.players={};var ms=e.navigator;ps.prototype.options_={techOrder:Gr.defaultTechOrder_,html5:{},flash:{},inactivityTimeout:2e3,playbackRates:[],liveui:false,children:["mediaLoader","posterImage","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:ms&&(ms.languages&&ms.languages[0]||ms.userLanguage||ms.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",breakpoints:{},responsive:false};["ended","seeking","seekable","networkState","readyState"].forEach(function(e){ps.prototype[e]=function(){return this.techGet_(e)}});ls.forEach(function(e){ps.prototype["handleTech"+ze(e)+"_"]=function(){return this.trigger(e)}});Xe.registerComponent("Player",ps);var vs="plugin";var gs="activePlugins_";var ys={};var _s=function e(t){return ys.hasOwnProperty(t)};var bs=function e(t){return _s(t)?ys[t]:undefined};var Ts=function e(t,i){t[gs]=t[gs]||{};t[gs][i]=true};var Ss=function e(t,i,r){var n=(r?"before":"")+"pluginsetup";t.trigger(n,i);t.trigger(n+":"+i.name,i)};var ks=function e(t,i){var r=function e(){Ss(this,{name:t,plugin:i,instance:null},true);var r=i.apply(this,arguments);Ts(this,t);Ss(this,{name:t,plugin:i,instance:r});return r};Object.keys(i).forEach(function(e){r[e]=i[e]});return r};var ws=function e(t,i){i.prototype.name=t;return function(){Ss(this,{name:t,plugin:i,instance:null},true);for(var e=arguments.length,r=new Array(e),n=0;n<e;n++){r[n]=arguments[n]}var a=s(i,[this].concat(r));this[t]=function(){return a};Ss(this,a.getEventHash());return a}};var Cs=function(){function e(t){if(this.constructor===e){throw new Error("Plugin must be sub-classed; not directly instantiated.")}this.player=t;Ve(this);delete this.trigger;qe(this,this.constructor.defaultState);Ts(t,this.name);this.dispose=Ae(this,this.dispose);t.on("dispose",this.dispose)}var t=e.prototype;t.version=function e(){return this.constructor.VERSION};t.getEventHash=function e(t){if(t===void 0){t={}}t.name=this.name;t.plugin=this.constructor;t.instance=this;return t};t.trigger=function e(t,i){if(i===void 0){i={}}return ye(this.eventBusEl_,t,this.getEventHash(i))};t.handleStateChanged=function e(t){};t.dispose=function e(){var t=this.name,i=this.player;this.trigger("dispose");this.off();i.off("dispose",this.dispose);i[gs][t]=false;this.player=this.state=null;i[t]=ws(t,ys[t])};e.isBasic=function t(i){var r=typeof i==="string"?bs(i):i;return typeof r==="function"&&!e.prototype.isPrototypeOf(r.prototype)};e.registerPlugin=function t(i,r){if(typeof i!=="string"){throw new Error('Illegal plugin name, "'+i+'", must be a string, was '+typeof i+".")}if(_s(i)){d.warn('A plugin named "'+i+'" already exists. You may want to avoid re-registering plugins!')}else if(ps.prototype.hasOwnProperty(i)){throw new Error('Illegal plugin name, "'+i+'", cannot share a name with an existing player method!')}if(typeof r!=="function"){throw new Error('Illegal plugin for "'+i+'", must be a function, was '+typeof r+".")}ys[i]=r;if(i!==vs){if(e.isBasic(r)){ps.prototype[i]=ks(i,r)}else{ps.prototype[i]=ws(i,r)}}return r};e.deregisterPlugin=function e(t){if(t===vs){throw new Error("Cannot de-register base plugin.")}if(_s(t)){delete ys[t];delete ps.prototype[t]}};e.getPlugins=function e(t){if(t===void 0){t=Object.keys(ys)}var i;t.forEach(function(e){var t=bs(e);if(t){i=i||{};i[e]=t}});return i};e.getPluginVersion=function e(t){var i=bs(t);return i&&i.VERSION||""};return e}();Cs.getPlugin=bs;Cs.BASE_PLUGIN_NAME=vs;Cs.registerPlugin(vs,Cs);ps.prototype.usingPlugin=function(e){return!!this[gs]&&this[gs][e]===true};ps.prototype.hasPlugin=function(e){return!!_s(e)};var Es=function e(t,i){if(typeof i!=="function"&&i!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof i)}t.prototype=Object.create(i&&i.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}});if(i){t.super_=i}};var As=function e(t,i){if(i===void 0){i={}}var r=function e(){t.apply(this,arguments)};var n={};if(typeof i==="object"){if(i.constructor!==Object.prototype.constructor){r=i.constructor}n=i}else if(typeof i==="function"){r=i}Es(r,t);for(var a in n){if(n.hasOwnProperty(a)){r.prototype[a]=n[a]}}return r};var Ls=function e(t){return t.indexOf("#")===0?t.slice(1):t};function Is(e,t,i){var r=Is.getPlayer(e);if(r){if(t){d.warn('Player "'+e+'" is already initialised. Options will not be applied.')}if(i){r.ready(i)}return r}var n=typeof e==="string"?te("#"+Ls(e)):e;if(!I(n)){throw new TypeError("The element or ID supplied is not valid. (videojs)")}if(!n.ownerDocument.defaultView||!n.ownerDocument.body.contains(n)){d.warn("The element supplied is not included in the DOM")}t=t||{};Is.hooks("beforesetup").forEach(function(e){var i=e(n,Ge(t));if(!T(i)||Array.isArray(i)){d.error("please return an object in beforesetup hooks");return}t=Ge(t,i)});var a=Xe.getComponent("Player");r=new a(n,t,i);Is.hooks("setup").forEach(function(e){return e(r)});return r}Is.hooks_={};Is.hooks=function(e,t){Is.hooks_[e]=Is.hooks_[e]||[];if(t){Is.hooks_[e]=Is.hooks_[e].concat(t)}return Is.hooks_[e]};Is.hook=function(e,t){Is.hooks(e,t)};Is.hookOnce=function(e,t){Is.hooks(e,[].concat(t).map(function(t){var i=function i(){Is.removeHook(e,i);return t.apply(void 0,arguments)};return i}))};Is.removeHook=function(e,t){var i=Is.hooks(e).indexOf(t);if(i<=-1){return false}Is.hooks_[e]=Is.hooks_[e].slice();Is.hooks_[e].splice(i,1);return true};if(e.VIDEOJS_NO_DYNAMIC_STYLE!==true&&L()){var Ps=te(".vjs-styles-defaults");if(!Ps){Ps=Ce("vjs-styles-defaults");var Os=te("head");if(Os){Os.insertBefore(Ps,Os.firstChild)}Ee(Ps,"\n .video-js {\n width: 300px;\n height: 150px;\n }\n\n .vjs-fluid {\n padding-top: 56.25%\n }\n ")}}we(1,Is);Is.VERSION=i;Is.options=ps.prototype.options_;Is.getPlayers=function(){return ps.players};Is.getPlayer=function(e){var t=ps.players;var i;if(typeof e==="string"){var r=Ls(e);var n=t[r];if(n){return n}i=te("#"+r)}else{i=e}if(I(i)){var a=i,s=a.player,o=a.playerId;if(s||t[o]){return s||t[o]}}};Is.getAllPlayers=function(){return Object.keys(ps.players).map(function(e){return ps.players[e]}).filter(Boolean)};Is.players=ps.players;Is.getComponent=Xe.getComponent;Is.registerComponent=function(e,t){if(Gr.isTech(t)){d.warn("The "+e+" tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)")}Xe.registerComponent.call(Xe,e,t)};Is.getTech=Gr.getTech;Is.registerTech=Gr.registerTech;Is.use=$r;Object.defineProperty(Is,"middleware",{value:{},writeable:false,enumerable:true});Object.defineProperty(Is.middleware,"TERMINATOR",{value:Kr,writeable:false,enumerable:true});Is.browser=ht;Is.TOUCH_ENABLED=dt;Is.extend=As;Is.mergeOptions=Ge;Is.bind=Ae;Is.registerPlugin=Cs.registerPlugin;Is.deregisterPlugin=Cs.deregisterPlugin;Is.plugin=function(e,t){d.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead");return Cs.registerPlugin(e,t)};Is.getPlugins=Cs.getPlugins;Is.getPlugin=Cs.getPlugin;Is.getPluginVersion=Cs.getPluginVersion;Is.addLanguage=function(e,t){var i;e=(""+e).toLowerCase();Is.options.languages=Ge(Is.options.languages,(i={},i[e]=t,i));return Is.options.languages[e]};Is.log=d;Is.createLogger=h;Is.createTimeRange=Is.createTimeRanges=gt;Is.formatTime=xn;Is.setFormatTime=Un;Is.resetFormatTime=Dn;Is.parseUrl=si;Is.isCrossOrigin=li;Is.EventTarget=Pe;Is.on=ve;Is.one=_e;Is.off=ge;Is.trigger=ye;Is.xhr=Ni;Is.TextTrack=Yi;Is.AudioTrack=Ki;Is.VideoTrack=$i;["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(function(e){Is[e]=function(){d.warn("videojs."+e+"() is deprecated; use videojs.dom."+e+"() instead");return re[e].apply(null,arguments)}});Is.computedStyle=k;Is.dom=re;Is.url=ci;var Us=Bt(function(e,t){(function(t){var i=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/\?#]*\/)*.*?)??(;.*?)?(\?.*?)?(#.*?)?$/;var r=/^([^\/?#]*)(.*)$/;var n=/(?:\/|^)\.(?=\/)/g;var a=/(?:\/|^)\.\.\/(?!\.\.\/).*?(?=\/)/g;var s={buildAbsoluteURL:function e(t,i,n){n=n||{};t=t.trim();i=i.trim();if(!i){if(!n.alwaysNormalize){return t}var a=s.parseURL(t);if(!a){throw new Error("Error trying to parse base URL.")}a.path=s.normalizePath(a.path);return s.buildURLFromParts(a)}var o=s.parseURL(i);if(!o){throw new Error("Error trying to parse relative URL.")}if(o.scheme){if(!n.alwaysNormalize){return i}o.path=s.normalizePath(o.path);return s.buildURLFromParts(o)}var u=s.parseURL(t);if(!u){throw new Error("Error trying to parse base URL.")}if(!u.netLoc&&u.path&&u.path[0]!=="/"){var l=r.exec(u.path);u.netLoc=l[1];u.path=l[2]}if(u.netLoc&&!u.path){u.path="/"}var c={scheme:u.scheme,netLoc:o.netLoc,path:null,params:o.params,query:o.query,fragment:o.fragment};if(!o.netLoc){c.netLoc=u.netLoc;if(o.path[0]!=="/"){if(!o.path){c.path=u.path;if(!o.params){c.params=u.params;if(!o.query){c.query=u.query}}}else{var f=u.path;var d=f.substring(0,f.lastIndexOf("/")+1)+o.path;c.path=s.normalizePath(d)}}}if(c.path===null){c.path=n.alwaysNormalize?s.normalizePath(o.path):o.path}return s.buildURLFromParts(c)},parseURL:function e(t){var r=i.exec(t);if(!r){return null}return{scheme:r[1]||"",netLoc:r[2]||"",path:r[3]||"",params:r[4]||"",query:r[5]||"",fragment:r[6]||""}},normalizePath:function e(t){t=t.split("").reverse().join("").replace(n,"");while(t.length!==(t=t.replace(a,"")).length){}return t.split("").reverse().join("")},buildURLFromParts:function e(t){return t.scheme+t.netLoc+t.path+t.params+t.query+t.fragment}};e.exports=s})(Mt)});function Ds(){Ds=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var r in i){if(Object.prototype.hasOwnProperty.call(i,r)){e[r]=i[r]}}}return e};return Ds.apply(this,arguments)}function xs(e,t){e.prototype=Object.create(t.prototype);e.prototype.constructor=e;e.__proto__=t}function Rs(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}var Ms=function(){function e(){this.listeners={}}var t=e.prototype;t.on=function e(t,i){if(!this.listeners[t]){this.listeners[t]=[]}this.listeners[t].push(i)};t.off=function e(t,i){if(!this.listeners[t]){return false}var r=this.listeners[t].indexOf(i);this.listeners[t].splice(r,1);return r>-1};t.trigger=function e(t){var i=this.listeners[t];var r;var n;var a;if(!i){return}if(arguments.length===2){n=i.length;for(r=0;r<n;++r){i[r].call(this,arguments[1])}}else{a=Array.prototype.slice.call(arguments,1);n=i.length;for(r=0;r<n;++r){i[r].apply(this,a)}}};t.dispose=function e(){this.listeners={}};t.pipe=function e(t){this.on("data",function(e){t.push(e)})};return e}();var Bs=function(e){xs(t,e);function t(){var t;t=e.call(this)||this;t.buffer="";return t}var i=t.prototype;i.push=function e(t){var i;this.buffer+=t;i=this.buffer.indexOf("\n");for(;i>-1;i=this.buffer.indexOf("\n")){this.trigger("data",this.buffer.substring(0,i));this.buffer=this.buffer.substring(i+1)}};return t}(Ms);var Ns=function e(){var t="[^=]*";var i='"[^"]*"|[^,]*';var r="(?:"+t+")=(?:"+i+")";return new RegExp("(?:^|,)("+r+")")};var js=function e(t){var i=t.split(Ns());var r={};var n=i.length;var a;while(n--){if(i[n]===""){continue}a=/([^=]*)=(.*)/.exec(i[n]).slice(1);a[0]=a[0].replace(/^\s+|\s+$/g,"");a[1]=a[1].replace(/^\s+|\s+$/g,"");a[1]=a[1].replace(/^['"](.*)['"]$/g,"$1");r[a[0]]=a[1]}return r};var Fs=function(e){xs(t,e);function t(){var t;t=e.call(this)||this;t.customParsers=[];t.tagMappers=[];return t}var i=t.prototype;i.push=function e(t){var i=this;var r;var n;t=t.trim();if(t.length===0){return}if(t[0]!=="#"){this.trigger("data",{type:"uri",uri:t});return}var a=this.tagMappers.reduce(function(e,i){var r=i(t);if(r===t){return e}return e.concat([r])},[t]);a.forEach(function(e){for(var t=0;t<i.customParsers.length;t++){if(i.customParsers[t].call(i,e)){return}}if(e.indexOf("#EXT")!==0){i.trigger("data",{type:"comment",text:e.slice(1)});return}e=e.replace("\r","");r=/^#EXTM3U/.exec(e);if(r){i.trigger("data",{type:"tag",tagType:"m3u"});return}r=/^#EXTINF:?([0-9\.]*)?,?(.*)?$/.exec(e);if(r){n={type:"tag",tagType:"inf"};if(r[1]){n.duration=parseFloat(r[1])}if(r[2]){n.title=r[2]}i.trigger("data",n);return}r=/^#EXT-X-TARGETDURATION:?([0-9.]*)?/.exec(e);if(r){n={type:"tag",tagType:"targetduration"};if(r[1]){n.duration=parseInt(r[1],10)}i.trigger("data",n);return}r=/^#ZEN-TOTAL-DURATION:?([0-9.]*)?/.exec(e);if(r){n={type:"tag",tagType:"totalduration"};if(r[1]){n.duration=parseInt(r[1],10)}i.trigger("data",n);return}r=/^#EXT-X-VERSION:?([0-9.]*)?/.exec(e);if(r){n={type:"tag",tagType:"version"};if(r[1]){n.version=parseInt(r[1],10)}i.trigger("data",n);return}r=/^#EXT-X-MEDIA-SEQUENCE:?(\-?[0-9.]*)?/.exec(e);if(r){n={type:"tag",tagType:"media-sequence"};if(r[1]){n.number=parseInt(r[1],10)}i.trigger("data",n);return}r=/^#EXT-X-DISCONTINUITY-SEQUENCE:?(\-?[0-9.]*)?/.exec(e);if(r){n={type:"tag",tagType:"discontinuity-sequence"};if(r[1]){n.number=parseInt(r[1],10)}i.trigger("data",n);return}r=/^#EXT-X-PLAYLIST-TYPE:?(.*)?$/.exec(e);if(r){n={type:"tag",tagType:"playlist-type"};if(r[1]){n.playlistType=r[1]}i.trigger("data",n);return}r=/^#EXT-X-BYTERANGE:?([0-9.]*)?@?([0-9.]*)?/.exec(e);if(r){n={type:"tag",tagType:"byterange"};if(r[1]){n.length=parseInt(r[1],10)}if(r[2]){n.offset=parseInt(r[2],10)}i.trigger("data",n);return}r=/^#EXT-X-ALLOW-CACHE:?(YES|NO)?/.exec(e);if(r){n={type:"tag",tagType:"allow-cache"};if(r[1]){n.allowed=!/NO/.test(r[1])}i.trigger("data",n);return}r=/^#EXT-X-MAP:?(.*)$/.exec(e);if(r){n={type:"tag",tagType:"map"};if(r[1]){var a=js(r[1]);if(a.URI){n.uri=a.URI}if(a.BYTERANGE){var s=a.BYTERANGE.split("@"),o=s[0],u=s[1];n.byterange={};if(o){n.byterange.length=parseInt(o,10)}if(u){n.byterange.offset=parseInt(u,10)}}}i.trigger("data",n);return}r=/^#EXT-X-STREAM-INF:?(.*)$/.exec(e);if(r){n={type:"tag",tagType:"stream-inf"};if(r[1]){n.attributes=js(r[1]);if(n.attributes.RESOLUTION){var l=n.attributes.RESOLUTION.split("x");var c={};if(l[0]){c.width=parseInt(l[0],10)}if(l[1]){c.height=parseInt(l[1],10)}n.attributes.RESOLUTION=c}if(n.attributes.BANDWIDTH){n.attributes.BANDWIDTH=parseInt(n.attributes.BANDWIDTH,10)}if(n.attributes["PROGRAM-ID"]){n.attributes["PROGRAM-ID"]=parseInt(n.attributes["PROGRAM-ID"],10)}}i.trigger("data",n);return}r=/^#EXT-X-MEDIA:?(.*)$/.exec(e);if(r){n={type:"tag",tagType:"media"};if(r[1]){n.attributes=js(r[1])}i.trigger("data",n);return}r=/^#EXT-X-ENDLIST/.exec(e);if(r){i.trigger("data",{type:"tag",tagType:"endlist"});return}r=/^#EXT-X-DISCONTINUITY/.exec(e);if(r){i.trigger("data",{type:"tag",tagType:"discontinuity"});return}r=/^#EXT-X-PROGRAM-DATE-TIME:?(.*)$/.exec(e);if(r){n={type:"tag",tagType:"program-date-time"};if(r[1]){n.dateTimeString=r[1];n.dateTimeObject=new Date(r[1])}i.trigger("data",n);return}r=/^#EXT-X-KEY:?(.*)$/.exec(e);if(r){n={type:"tag",tagType:"key"};if(r[1]){n.attributes=js(r[1]);if(n.attributes.IV){if(n.attributes.IV.substring(0,2).toLowerCase()==="0x"){n.attributes.IV=n.attributes.IV.substring(2)}n.attributes.IV=n.attributes.IV.match(/.{8}/g);n.attributes.IV[0]=parseInt(n.attributes.IV[0],16);n.attributes.IV[1]=parseInt(n.attributes.IV[1],16);n.attributes.IV[2]=parseInt(n.attributes.IV[2],16);n.attributes.IV[3]=parseInt(n.attributes.IV[3],16);n.attributes.IV=new Uint32Array(n.attributes.IV)}}i.trigger("data",n);return}r=/^#EXT-X-START:?(.*)$/.exec(e);if(r){n={type:"tag",tagType:"start"};if(r[1]){n.attributes=js(r[1]);n.attributes["TIME-OFFSET"]=parseFloat(n.attributes["TIME-OFFSET"]);n.attributes.PRECISE=/YES/.test(n.attributes.PRECISE)}i.trigger("data",n);return}r=/^#EXT-X-CUE-OUT-CONT:?(.*)?$/.exec(e);if(r){n={type:"tag",tagType:"cue-out-cont"};if(r[1]){n.data=r[1]}else{n.data=""}i.trigger("data",n);return}r=/^#EXT-X-CUE-OUT:?(.*)?$/.exec(e);if(r){n={type:"tag",tagType:"cue-out"};if(r[1]){n.data=r[1]}else{n.data=""}i.trigger("data",n);return}r=/^#EXT-X-CUE-IN:?(.*)?$/.exec(e);if(r){n={type:"tag",tagType:"cue-in"};if(r[1]){n.data=r[1]}else{n.data=""}i.trigger("data",n);return}i.trigger("data",{type:"tag",data:e.slice(4)})})};i.addParser=function e(t){var i=this;var r=t.expression,n=t.customType,a=t.dataParser,s=t.segment;if(typeof a!=="function"){a=function e(t){return t}}this.customParsers.push(function(e){var t=r.exec(e);if(t){i.trigger("data",{type:"custom",data:a(e),customType:n,segment:s});return true}})};i.addTagMapper=function e(t){var i=t.expression,r=t.map;var n=function e(t){if(i.test(t)){return r(t)}return t};this.tagMappers.push(n)};return t}(Ms);var Vs=function(e){xs(t,e);function t(){var t;t=e.call(this)||this;t.lineStream=new Bs;t.parseStream=new Fs;t.lineStream.pipe(t.parseStream);var i=Rs(Rs(t));var r=[];var n={};var a;var s;var o=function e(){};var u={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}};var l=0;t.manifest={allowCache:true,discontinuityStarts:[],segments:[]};t.parseStream.on("data",function(e){var t;var c;({tag:function f(){({"allow-cache":function t(){this.manifest.allowCache=e.allowed;if(!("allowed"in e)){this.trigger("info",{message:"defaulting allowCache to YES"});this.manifest.allowCache=true}},byterange:function t(){var t={};if("length"in e){n.byterange=t;t.length=e.length;if(!("offset"in e)){this.trigger("info",{message:"defaulting offset to zero"});e.offset=0}}if("offset"in e){n.byterange=t;t.offset=e.offset}},endlist:function e(){this.manifest.endList=true},inf:function t(){if(!("mediaSequence"in this.manifest)){this.manifest.mediaSequence=0;this.trigger("info",{message:"defaulting media sequence to zero"})}if(!("discontinuitySequence"in this.manifest)){this.manifest.discontinuitySequence=0;this.trigger("info",{message:"defaulting discontinuity sequence to zero"})}if(e.duration>0){n.duration=e.duration}if(e.duration===0){n.duration=.01;this.trigger("info",{message:"updating zero segment duration to a small value"})}this.manifest.segments=r},key:function t(){if(!e.attributes){this.trigger("warn",{message:"ignoring key declaration without attribute list"});return}if(e.attributes.METHOD==="NONE"){s=null;return}if(!e.attributes.URI){this.trigger("warn",{message:"ignoring key declaration without URI"});return}if(!e.attributes.METHOD){this.trigger("warn",{message:"defaulting key method to AES-128"})}s={method:e.attributes.METHOD||"AES-128",uri:e.attributes.URI};if(typeof e.attributes.IV!=="undefined"){s.iv=e.attributes.IV}},"media-sequence":function t(){if(!isFinite(e.number)){this.trigger("warn",{message:"ignoring invalid media sequence: "+e.number});return}this.manifest.mediaSequence=e.number},"discontinuity-sequence":function t(){if(!isFinite(e.number)){this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+e.number});return}this.manifest.discontinuitySequence=e.number;l=e.number},"playlist-type":function t(){if(!/VOD|EVENT/.test(e.playlistType)){this.trigger("warn",{message:"ignoring unknown playlist type: "+e.playlist});return}this.manifest.playlistType=e.playlistType},map:function t(){a={};if(e.uri){a.uri=e.uri}if(e.byterange){a.byterange=e.byterange}},"stream-inf":function t(){this.manifest.playlists=r;this.manifest.mediaGroups=this.manifest.mediaGroups||u;if(!e.attributes){this.trigger("warn",{message:"ignoring empty stream-inf attributes"});return}if(!n.attributes){n.attributes={}}Ds(n.attributes,e.attributes)},media:function i(){this.manifest.mediaGroups=this.manifest.mediaGroups||u;if(!(e.attributes&&e.attributes.TYPE&&e.attributes["GROUP-ID"]&&e.attributes.NAME)){this.trigger("warn",{message:"ignoring incomplete or missing media group"});return}var r=this.manifest.mediaGroups[e.attributes.TYPE];r[e.attributes["GROUP-ID"]]=r[e.attributes["GROUP-ID"]]||{};t=r[e.attributes["GROUP-ID"]];c={default:/yes/i.test(e.attributes.DEFAULT)};if(c.default){c.autoselect=true}else{c.autoselect=/yes/i.test(e.attributes.AUTOSELECT)}if(e.attributes.LANGUAGE){c.language=e.attributes.LANGUAGE}if(e.attributes.URI){c.uri=e.attributes.URI}if(e.attributes["INSTREAM-ID"]){c.instreamId=e.attributes["INSTREAM-ID"]}if(e.attributes.CHARACTERISTICS){c.characteristics=e.attributes.CHARACTERISTICS}if(e.attributes.FORCED){c.forced=/yes/i.test(e.attributes.FORCED)}t[e.attributes.NAME]=c},discontinuity:function e(){l+=1;n.discontinuity=true;this.manifest.discontinuityStarts.push(r.length)},"program-date-time":function t(){if(typeof this.manifest.dateTimeString==="undefined"){this.manifest.dateTimeString=e.dateTimeString;this.manifest.dateTimeObject=e.dateTimeObject}n.dateTimeString=e.dateTimeString;n.dateTimeObject=e.dateTimeObject},targetduration:function t(){if(!isFinite(e.duration)||e.duration<0){this.trigger("warn",{message:"ignoring invalid target duration: "+e.duration});return}this.manifest.targetDuration=e.duration},totalduration:function t(){if(!isFinite(e.duration)||e.duration<0){this.trigger("warn",{message:"ignoring invalid total duration: "+e.duration});return}this.manifest.totalDuration=e.duration},start:function t(){if(!e.attributes||isNaN(e.attributes["TIME-OFFSET"])){this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"});return}this.manifest.start={timeOffset:e.attributes["TIME-OFFSET"],precise:e.attributes.PRECISE}},"cue-out":function t(){n.cueOut=e.data},"cue-out-cont":function t(){n.cueOutCont=e.data},"cue-in":function t(){n.cueIn=e.data}}[e.tagType]||o).call(i)},uri:function t(){n.uri=e.uri;r.push(n);if(this.manifest.targetDuration&&!("duration"in n)){this.trigger("warn",{message:"defaulting segment duration to the target duration"});n.duration=this.manifest.targetDuration}if(s){n.key=s}n.timeline=l;if(a){n.map=a}n={}},comment:function e(){},custom:function t(){if(e.segment){n.custom=n.custom||{};n.custom[e.customType]=e.data}else{this.manifest.custom=this.manifest.custom||{};this.manifest.custom[e.customType]=e.data}}})[e.type].call(i)});return t}var i=t.prototype;i.push=function e(t){this.lineStream.push(t)};i.end=function e(){this.lineStream.push("\n")};i.addParser=function e(t){this.parseStream.addParser(t)};i.addTagMapper=function e(t){this.parseStream.addTagMapper(t)};return t}(Ms);var Hs=function e(t){return!!t&&typeof t==="object"};var qs=function e(){for(var t=arguments.length,i=new Array(t),r=0;r<t;r++){i[r]=arguments[r]}return i.reduce(function(t,i){Object.keys(i).forEach(function(r){if(Array.isArray(t[r])&&Array.isArray(i[r])){t[r]=t[r].concat(i[r])}else if(Hs(t[r])&&Hs(i[r])){t[r]=e(t[r],i[r])}else{t[r]=i[r]}});return t},{})};var zs=function e(t){return Object.keys(t).map(function(e){return t[e]})};var Ws=function e(t,i){var r=[];for(var n=t;n<i;n++){r.push(n)}return r};var Gs=function e(t){return t.reduce(function(e,t){return e.concat(t)},[])};var Xs=function e(t){if(!t.length){return[]}var i=[];for(var r=0;r<t.length;r++){i.push(t[r])}return i};var Ys=function e(t,i){return t.reduce(function(e,t,r){if(t[i]){e.push(r)}return e},[])};var Ks=function e(t){var i=zs(t.reduce(function(e,t){var i=t.attributes.id+(t.attributes.lang||"");if(e[i]){var r;t.segments[0].discontinuity=true;(r=e[i].segments).push.apply(r,t.segments);if(t.attributes.contentProtection){e[i].attributes.contentProtection=t.attributes.contentProtection}}else{e[i]=t}return e},{}));return i.map(function(e){e.discontinuityStarts=Ys(e.segments,"discontinuity");return e})};var $s=function e(t){var i;var r=t.attributes,n=t.segments;var a={attributes:(i={NAME:r.id,BANDWIDTH:r.bandwidth,CODECS:r.codecs},i["PROGRAM-ID"]=1,i),uri:"",endList:(r.type||"static")==="static",timeline:r.periodIndex,resolvedUri:"",targetDuration:r.duration,segments:n,mediaSequence:n.length?n[0].number:1};if(r.contentProtection){a.contentProtection=r.contentProtection}return a};var Qs=function e(t){var i;var r=t.attributes,n=t.segments;if(typeof n==="undefined"){n=[{uri:r.baseUrl,timeline:r.periodIndex,resolvedUri:r.baseUrl||"",duration:r.sourceDuration,number:0}];r.duration=r.sourceDuration}return{attributes:(i={NAME:r.id,BANDWIDTH:r.bandwidth},i["PROGRAM-ID"]=1,i),uri:"",endList:(r.type||"static")==="static",timeline:r.periodIndex,resolvedUri:r.baseUrl||"",targetDuration:r.duration,segments:n,mediaSequence:n.length?n[0].number:1}};var Js=function e(t){return t.reduce(function(e,t){var i=t.attributes.role&&t.attributes.role.value||"main";var r=t.attributes.lang||"";var n="main";if(r){n=t.attributes.lang+" ("+i+")"}if(e[n]&&e[n].playlists[0].attributes.BANDWIDTH>t.attributes.bandwidth){return e}e[n]={language:r,autoselect:true,default:i==="main",playlists:[$s(t)],uri:""};return e},{})};var Zs=function e(t){return t.reduce(function(e,t){var i=t.attributes.lang||"text";if(e[i]){return e}e[i]={language:i,default:false,autoselect:false,playlists:[Qs(t)],uri:""};return e},{})};var eo=function e(t){var i;var r=t.attributes,n=t.segments;var a={attributes:(i={NAME:r.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:r.width,height:r.height},CODECS:r.codecs,BANDWIDTH:r.bandwidth},i["PROGRAM-ID"]=1,i),uri:"",endList:(r.type||"static")==="static",timeline:r.periodIndex,resolvedUri:"",targetDuration:r.duration,segments:n,mediaSequence:n.length?n[0].number:1};if(r.contentProtection){a.contentProtection=r.contentProtection}return a};var to=function e(t){var i;if(!t.length){return{}}var r=t[0].attributes,n=r.sourceDuration,a=r.minimumUpdatePeriod,s=a===void 0?0:a;var o=function e(t){var i=t.attributes;return i.mimeType==="video/mp4"||i.contentType==="video"};var u=function e(t){var i=t.attributes;return i.mimeType==="audio/mp4"||i.contentType==="audio"};var l=function e(t){var i=t.attributes;return i.mimeType==="text/vtt"||i.contentType==="text"};var c=Ks(t.filter(o)).map(eo);var f=Ks(t.filter(u));var d=t.filter(l);var h={allowCache:true,discontinuityStarts:[],segments:[],endList:true,mediaGroups:(i={AUDIO:{},VIDEO:{}},i["CLOSED-CAPTIONS"]={},i.SUBTITLES={},i),uri:"",duration:n,playlists:c,minimumUpdatePeriod:s*1e3};if(f.length){h.mediaGroups.AUDIO.audio=Js(f)}if(d.length){h.mediaGroups.SUBTITLES.subs=Zs(d)}return h};var io=typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};function ro(e,t){return t={exports:{}},e(t,t.exports),t.exports}var no=ro(function(e,t){(function(t){var i=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/\?#]*\/)*.*?)??(;.*?)?(\?.*?)?(#.*?)?$/;var r=/^([^\/?#]*)(.*)$/;var n=/(?:\/|^)\.(?=\/)/g;var a=/(?:\/|^)\.\.\/(?!\.\.\/).*?(?=\/)/g;var s={buildAbsoluteURL:function e(t,i,n){n=n||{};t=t.trim();i=i.trim();if(!i){if(!n.alwaysNormalize){return t}var a=s.parseURL(t);if(!a){throw new Error("Error trying to parse base URL.")}a.path=s.normalizePath(a.path);return s.buildURLFromParts(a)}var o=s.parseURL(i);if(!o){throw new Error("Error trying to parse relative URL.")}if(o.scheme){if(!n.alwaysNormalize){return i}o.path=s.normalizePath(o.path);return s.buildURLFromParts(o)}var u=s.parseURL(t);if(!u){throw new Error("Error trying to parse base URL.")}if(!u.netLoc&&u.path&&u.path[0]!=="/"){var l=r.exec(u.path);u.netLoc=l[1];u.path=l[2]}if(u.netLoc&&!u.path){u.path="/"}var c={scheme:u.scheme,netLoc:o.netLoc,path:null,params:o.params,query:o.query,fragment:o.fragment};if(!o.netLoc){c.netLoc=u.netLoc;if(o.path[0]!=="/"){if(!o.path){c.path=u.path;if(!o.params){c.params=u.params;if(!o.query){c.query=u.query}}}else{var f=u.path;var d=f.substring(0,f.lastIndexOf("/")+1)+o.path;c.path=s.normalizePath(d)}}}if(c.path===null){c.path=n.alwaysNormalize?s.normalizePath(o.path):o.path}return s.buildURLFromParts(c)},parseURL:function e(t){var r=i.exec(t);if(!r){return null}return{scheme:r[1]||"",netLoc:r[2]||"",path:r[3]||"",params:r[4]||"",query:r[5]||"",fragment:r[6]||""}},normalizePath:function e(t){t=t.split("").reverse().join("").replace(n,"");while(t.length!==(t=t.replace(a,"")).length){}return t.split("").reverse().join("")},buildURLFromParts:function e(t){return t.scheme+t.netLoc+t.path+t.params+t.query+t.fragment}};e.exports=s})(io)});var ao=function t(i,r){if(/^[a-z]+:/i.test(r)){return r}if(!/\/\//i.test(i)){i=no.buildAbsoluteURL(e.location.href,i)}return no.buildAbsoluteURL(i,r)};var so=function e(t){var i=t.baseUrl,r=i===void 0?"":i,n=t.source,a=n===void 0?"":n,s=t.range,o=s===void 0?"":s;var u={uri:a,resolvedUri:ao(r||"",a)};if(o){var l=o.split("-");var c=parseInt(l[0],10);var f=parseInt(l[1],10);u.byterange={length:f-c,offset:c}}return u};var oo=function e(t,i,r){var n=t.NOW,a=t.clientOffset,s=t.availabilityStartTime,o=t.timescale,u=o===void 0?1:o,l=t.start,c=l===void 0?0:l,f=t.minimumUpdatePeriod,d=f===void 0?0:f;var h=(n+a)/1e3;var p=s+c;var m=h+d;var v=m-p;return Math.ceil((v*u-i)/r)};var uo=function e(t,i){var r=t.type,n=r===void 0?"static":r,a=t.minimumUpdatePeriod,s=a===void 0?0:a,o=t.media,u=o===void 0?"":o,l=t.sourceDuration,c=t.timescale,f=c===void 0?1:c,d=t.startNumber,h=d===void 0?1:d,p=t.periodIndex;var m=[];var v=-1;for(var g=0;g<i.length;g++){var y=i[g];var _=y.d;var b=y.r||0;var T=y.t||0;if(v<0){v=T}if(T&&T>v){v=T}var S=void 0;if(b<0){var k=g+1;if(k===i.length){if(n==="dynamic"&&s>0&&u.indexOf("$Number$")>0){S=oo(t,v,_)}else{S=(l*f-v)/_}}else{S=(i[k].t-v)/_}}else{S=b+1}var w=h+m.length+S;var C=h+m.length;while(C<w){m.push({number:C,duration:_/f,time:v,timeline:p});v+=_;C++}}return m};var lo={static:function e(t){var i=t.duration,r=t.timescale,n=r===void 0?1:r,a=t.sourceDuration;return{start:0,end:Math.ceil(a/(i/n))}},dynamic:function e(t){var i=t.NOW,r=t.clientOffset,n=t.availabilityStartTime,a=t.timescale,s=a===void 0?1:a,o=t.duration,u=t.start,l=u===void 0?0:u,c=t.minimumUpdatePeriod,f=c===void 0?0:c,d=t.timeShiftBufferDepth,h=d===void 0?Infinity:d;var p=(i+r)/1e3;var m=n+l;var v=p+f;var g=v-m;var y=Math.ceil(g*s/o);var _=Math.floor((p-m-h)*s/o);var b=Math.floor((p-m)*s/o);return{start:Math.max(0,_),end:Math.min(y,b)}}};var co=function e(t){return function(e,i){var r=t.duration,n=t.timescale,a=n===void 0?1:n,s=t.periodIndex,o=t.startNumber,u=o===void 0?1:o;return{number:u+e,duration:r/a,timeline:s,time:i*r}}};var fo=function e(t){var i=t.type,r=i===void 0?"static":i,n=t.duration,a=t.timescale,s=a===void 0?1:a,o=t.sourceDuration;var u=lo[r](t),l=u.start,c=u.end;var f=Ws(l,c).map(co(t));if(r==="static"){var d=f.length-1;f[d].duration=o-n/s*d}return f};var ho=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g;var po=function e(t){return function(e,i,r,n){if(e==="$$"){return"$"}if(typeof t[i]==="undefined"){return e}var a=""+t[i];if(i==="RepresentationID"){return a}if(!r){n=1}else{n=parseInt(n,10)}if(a.length>=n){return a}return""+new Array(n-a.length+1).join("0")+a}};var mo=function e(t,i){return t.replace(ho,po(i))};var vo=function e(t,i){if(!t.duration&&!i){return[{number:t.startNumber||1,duration:t.sourceDuration,time:0,timeline:t.periodIndex}]}if(t.duration){return fo(t)}return uo(t,i)};var go=function e(t,i){var r={RepresentationID:t.id,Bandwidth:t.bandwidth||0};var n=t.initialization,a=n===void 0?{sourceURL:"",range:""}:n;var s=so({baseUrl:t.baseUrl,source:mo(a.sourceURL,r),range:a.range});var o=vo(t,i);return o.map(function(e){r.Number=e.number;r.Time=e.time;var i=mo(t.media||"",r);return{uri:i,timeline:e.timeline,duration:e.duration,resolvedUri:ao(t.baseUrl||"",i),map:s,number:e.number}})};var yo={INVALID_NUMBER_OF_PERIOD:"INVALID_NUMBER_OF_PERIOD",DASH_EMPTY_MANIFEST:"DASH_EMPTY_MANIFEST",DASH_INVALID_XML:"DASH_INVALID_XML",NO_BASE_URL:"NO_BASE_URL",MISSING_SEGMENT_INFORMATION:"MISSING_SEGMENT_INFORMATION",SEGMENT_TIME_UNSPECIFIED:"SEGMENT_TIME_UNSPECIFIED",UNSUPPORTED_UTC_TIMING_SCHEME:"UNSUPPORTED_UTC_TIMING_SCHEME"};var _o=function e(t,i){var r=t.baseUrl,n=t.initialization,a=n===void 0?{}:n;var s=so({baseUrl:r,source:a.sourceURL,range:a.range});var o=so({baseUrl:r,source:i.media,range:i.mediaRange});o.map=s;return o};var bo=function e(t,i){var r=t.duration,n=t.segmentUrls,a=n===void 0?[]:n;if(!r&&!i||r&&i){throw new Error(yo.SEGMENT_TIME_UNSPECIFIED)}var s=a.map(function(e){return _o(t,e)});var o;if(r){o=fo(t)}if(i){o=uo(t,i)}var u=o.map(function(e,t){if(s[t]){var i=s[t];i.timeline=e.timeline;i.duration=e.duration;i.number=e.number;return i}}).filter(function(e){return e});return u};var To=function e(t){var i=t.baseUrl,r=t.initialization,n=r===void 0?{}:r,a=t.sourceDuration,s=t.timescale,o=s===void 0?1:s,u=t.indexRange,l=u===void 0?"":u,c=t.duration;if(!i){throw new Error(yo.NO_BASE_URL)}var f=so({baseUrl:i,source:n.sourceURL,range:n.range});var d=so({baseUrl:i,source:i,range:l});d.map=f;if(c){var h=fo(t);if(h.length){d.duration=h[0].duration;d.timeline=h[0].timeline}}else if(a){d.duration=a/o;d.timeline=0}d.number=0;return[d]};var So=function e(t){var i=t.attributes,r=t.segmentInfo;var n;var a;if(r.template){a=go;n=qs(i,r.template)}else if(r.base){a=To;n=qs(i,r.base)}else if(r.list){a=bo;n=qs(i,r.list)}if(!a){return{attributes:i}}var s=a(n,r.timeline);if(n.duration){var o=n,u=o.duration,l=o.timescale,c=l===void 0?1:l;n.duration=u/c}else if(s.length){n.duration=s.reduce(function(e,t){return Math.max(e,Math.ceil(t.duration))},0)}else{n.duration=0}return{attributes:n,segments:s}};var ko=function e(t){return t.map(So)};var wo=function e(t,i){return Xs(t.childNodes).filter(function(e){var t=e.tagName;return t===i})};var Co=function e(t){return t.textContent.trim()};var Eo=function e(t){var i=365*24*60*60;var r=30*24*60*60;var n=24*60*60;var a=60*60;var s=60;var o=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/;var u=o.exec(t);if(!u){return 0}var l=u.slice(1),c=l[0],f=l[1],d=l[2],h=l[3],p=l[4],m=l[5];return parseFloat(c||0)*i+parseFloat(f||0)*r+parseFloat(d||0)*n+parseFloat(h||0)*a+parseFloat(p||0)*s+parseFloat(m||0)};var Ao=function e(t){var i=/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/;if(i.test(t)){t+="Z"}return Date.parse(t)};var Lo={mediaPresentationDuration:function e(t){return Eo(t)},availabilityStartTime:function e(t){return Ao(t)/1e3},minimumUpdatePeriod:function e(t){return Eo(t)},timeShiftBufferDepth:function e(t){return Eo(t)},start:function e(t){return Eo(t)},width:function e(t){return parseInt(t,10)},height:function e(t){return parseInt(t,10)},bandwidth:function e(t){return parseInt(t,10)},startNumber:function e(t){return parseInt(t,10)},timescale:function e(t){return parseInt(t,10)},duration:function e(t){var i=parseInt(t,10);if(isNaN(i)){return Eo(t)}return i},d:function e(t){return parseInt(t,10)},t:function e(t){return parseInt(t,10)},r:function e(t){return parseInt(t,10)},DEFAULT:function e(t){return t}};var Io=function e(t){if(!(t&&t.attributes)){return{}}return Xs(t.attributes).reduce(function(e,t){var i=Lo[t.name]||Lo.DEFAULT;e[t.name]=i(t.value);return e},{})};function Po(t){var i=e.atob(t);var r=new Uint8Array(i.length);for(var n=0;n<i.length;n++){r[n]=i.charCodeAt(n)}return r}var Oo={"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"};var Uo=function e(t,i){if(!i.length){return t}return Gs(t.map(function(e){return i.map(function(t){return ao(e,Co(t))})}))};var Do=function e(t){var i=wo(t,"SegmentTemplate")[0];var r=wo(t,"SegmentList")[0];var n=r&&wo(r,"SegmentURL").map(function(e){return qs({tag:"SegmentURL"},Io(e))});var a=wo(t,"SegmentBase")[0];var s=r||i;var o=s&&wo(s,"SegmentTimeline")[0];var u=r||a||i;var l=u&&wo(u,"Initialization")[0];var c=i&&Io(i);if(c&&l){c.initialization=l&&Io(l)}else if(c&&c.initialization){c.initialization={sourceURL:c.initialization}}var f={template:c,timeline:o&&wo(o,"S").map(function(e){return Io(e)}),list:r&&qs(Io(r),{segmentUrls:n,initialization:Io(l)}),base:a&&qs(Io(a),{initialization:Io(l)})};Object.keys(f).forEach(function(e){if(!f[e]){delete f[e]}});return f};var xo=function e(t,i,r){return function(e){var n=wo(e,"BaseURL");var a=Uo(i,n);var s=qs(t,Io(e));var o=Do(e);return a.map(function(e){return{segmentInfo:qs(r,o),attributes:qs(s,{baseUrl:e})}})}};var Ro=function e(t){return t.reduce(function(e,t){var i=Io(t);var r=Oo[i.schemeIdUri];if(r){e[r]={attributes:i};var n=wo(t,"cenc:pssh")[0];if(n){var a=Co(n);var s=a&&Po(a);e[r].pssh=s}}return e},{})};var Mo=function e(t,i,r){return function(e){var n=Io(e);var a=Uo(i,wo(e,"BaseURL"));var s=wo(e,"Role")[0];var o={role:Io(s)};var u=qs(t,n,o);var l=Ro(wo(e,"ContentProtection"));if(Object.keys(l).length){u=qs(u,{contentProtection:l})}var c=Do(e);var f=wo(e,"Representation");var d=qs(r,c);return Gs(f.map(xo(u,a,d)))}};var Bo=function t(i,r){return function(t,n){var a=Uo(r,wo(t,"BaseURL"));var s=Io(t);var o=parseInt(s.id,10);var u=e.isNaN(o)?n:o;var l=qs(i,{periodIndex:u});var c=wo(t,"AdaptationSet");var f=Do(t);return Gs(c.map(Mo(l,a,f)))}};var No=function e(t,i){if(i===void 0){i={}}var r=i,n=r.manifestUri,a=n===void 0?"":n,s=r.NOW,o=s===void 0?Date.now():s,u=r.clientOffset,l=u===void 0?0:u;var c=wo(t,"Period");if(!c.length){throw new Error(yo.INVALID_NUMBER_OF_PERIOD)}var f=Io(t);var d=Uo([a],wo(t,"BaseURL"));f.sourceDuration=f.mediaPresentationDuration||0;f.NOW=o;f.clientOffset=l;return Gs(c.map(Bo(f,d)))};var jo=function t(i){if(i===""){throw new Error(yo.DASH_EMPTY_MANIFEST)}var r=new e.DOMParser;var n=r.parseFromString(i,"application/xml");var a=n&&n.documentElement.tagName==="MPD"?n.documentElement:null;if(!a||a&&a.getElementsByTagName("parsererror").length>0){throw new Error(yo.DASH_INVALID_XML)}return a};var Fo=function e(t){var i=wo(t,"UTCTiming")[0];if(!i){return null}var r=Io(i);switch(r.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":r.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":r.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":r.method="DIRECT";r.value=Date.parse(r.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(yo.UNSUPPORTED_UTC_TIMING_SCHEME)}return r};var Vo=function e(t,i){return to(ko(No(jo(t),i)))};var Ho=function e(t){return Fo(jo(t))};var qo=function e(t){return t>>>0};var zo={toUnsigned:qo};var Wo=zo.toUnsigned;var Go,Xo,Yo,Ko,$o;Go=function e(t,i){var r=[],n,a,s,o,u;if(!i.length){return null}for(n=0;n<t.byteLength;){a=Wo(t[n]<<24|t[n+1]<<16|t[n+2]<<8|t[n+3]);s=Xo(t.subarray(n+4,n+8));o=a>1?n+a:t.byteLength;if(s===i[0]){if(i.length===1){r.push(t.subarray(n+8,o))}else{u=Go(t.subarray(n+8,o),i.slice(1));if(u.length){r=r.concat(u)}}}n=o}return r};Xo=function e(t){var i="";i+=String.fromCharCode(t[0]);i+=String.fromCharCode(t[1]);i+=String.fromCharCode(t[2]);i+=String.fromCharCode(t[3]);return i};Yo=function e(t){var i={},r=Go(t,["moov","trak"]);return r.reduce(function(e,t){var i,r,n,a,s;i=Go(t,["tkhd"])[0];if(!i){return null}r=i[0];n=r===0?12:20;a=Wo(i[n]<<24|i[n+1]<<16|i[n+2]<<8|i[n+3]);s=Go(t,["mdia","mdhd"])[0];if(!s){return null}r=s[0];n=r===0?12:20;e[a]=Wo(s[n]<<24|s[n+1]<<16|s[n+2]<<8|s[n+3]);return e},i)};Ko=function e(t,i){var r,n,a;r=Go(i,["moof","traf"]);n=[].concat.apply([],r.map(function(e){return Go(e,["tfhd"]).map(function(i){var r,n,a;r=Wo(i[4]<<24|i[5]<<16|i[6]<<8|i[7]);n=t[r]||9e4;a=Go(e,["tfdt"]).map(function(e){var t,i;t=e[0];i=Wo(e[4]<<24|e[5]<<16|e[6]<<8|e[7]);if(t===1){i*=Math.pow(2,32);i+=Wo(e[8]<<24|e[9]<<16|e[10]<<8|e[11])}return i})[0];a=a||Infinity;return a/n})}));a=Math.min.apply(null,n);return isFinite(a)?a:0};$o=function e(t){var i=Go(t,["moov","trak"]);var r=[];i.forEach(function(e){var t=Go(e,["mdia","hdlr"]);var i=Go(e,["tkhd"]);t.forEach(function(e,t){var n=Xo(e.subarray(8,12));var a=i[t];var s;var o;var u;if(n==="vide"){s=new DataView(a.buffer,a.byteOffset,a.byteLength);o=s.getUint8(0);u=o===0?s.getUint32(12):s.getUint32(20);r.push(u)}})});return r};var Qo={findBox:Go,parseType:Xo,timescale:Yo,startTime:Ko,videoTrackIds:$o};var Jo=Math.pow(2,32)-1;var Zo,eu,tu,iu,ru,nu,au,su,ou,uu,lu,cu,fu,du,hu,pu,mu,vu,gu,yu,_u,bu,Tu,Su,ku,wu,Cu,Eu,Au,Lu,Iu,Pu,Ou,Uu,Du,xu;(function(){var e;Tu={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]};if(typeof Uint8Array==="undefined"){return}for(e in Tu){if(Tu.hasOwnProperty(e)){Tu[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]}}Su=new Uint8Array(["i".charCodeAt(0),"s".charCodeAt(0),"o".charCodeAt(0),"m".charCodeAt(0)]);wu=new Uint8Array(["a".charCodeAt(0),"v".charCodeAt(0),"c".charCodeAt(0),"1".charCodeAt(0)]);ku=new Uint8Array([0,0,0,1]);Cu=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]);Eu=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);Au={video:Cu,audio:Eu};Pu=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]);Iu=new Uint8Array([0,0,0,0,0,0,0,0]);Ou=new Uint8Array([0,0,0,0,0,0,0,0]);Uu=Ou;Du=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]);xu=Ou;Lu=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])})();Zo=function e(t){var i=[],r=0,n,a,s;for(n=1;n<arguments.length;n++){i.push(arguments[n])}n=i.length;while(n--){r+=i[n].byteLength}a=new Uint8Array(r+8);s=new DataView(a.buffer,a.byteOffset,a.byteLength);s.setUint32(0,a.byteLength);a.set(t,4);for(n=0,r=8;n<i.length;n++){a.set(i[n],r);r+=i[n].byteLength}return a};eu=function e(){return Zo(Tu.dinf,Zo(Tu.dref,Pu))};tu=function e(t){return Zo(Tu.esds,new Uint8Array([0,0,0,0,3,25,0,0,0,4,17,64,21,0,6,0,0,0,218,192,0,0,218,192,5,2,t.audioobjecttype<<3|t.samplingfrequencyindex>>>1,t.samplingfrequencyindex<<7|t.channelcount<<3,6,1,2]))};iu=function e(){return Zo(Tu.ftyp,Su,ku,Su,wu)};pu=function e(t){return Zo(Tu.hdlr,Au[t])};ru=function e(t){return Zo(Tu.mdat,t)};hu=function e(t){var i=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,t.duration>>>24&255,t.duration>>>16&255,t.duration>>>8&255,t.duration&255,85,196,0,0]);if(t.samplerate){i[12]=t.samplerate>>>24&255;i[13]=t.samplerate>>>16&255;i[14]=t.samplerate>>>8&255;i[15]=t.samplerate&255}return Zo(Tu.mdhd,i)};du=function e(t){return Zo(Tu.mdia,hu(t),pu(t.type),au(t))};nu=function e(t){return Zo(Tu.mfhd,new Uint8Array([0,0,0,0,(t&4278190080)>>24,(t&16711680)>>16,(t&65280)>>8,t&255]))};au=function e(t){return Zo(Tu.minf,t.type==="video"?Zo(Tu.vmhd,Lu):Zo(Tu.smhd,Iu),eu(),vu(t))};su=function e(t,i){var r=[],n=i.length;while(n--){r[n]=yu(i[n])}return Zo.apply(null,[Tu.moof,nu(t)].concat(r))};ou=function e(t){var i=t.length,r=[];while(i--){r[i]=cu(t[i])}return Zo.apply(null,[Tu.moov,lu(4294967295)].concat(r).concat(uu(t)))};uu=function e(t){var i=t.length,r=[];while(i--){r[i]=_u(t[i])}return Zo.apply(null,[Tu.mvex].concat(r))};lu=function e(t){var i=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(t&4278190080)>>24,(t&16711680)>>16,(t&65280)>>8,t&255,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 Zo(Tu.mvhd,i)};mu=function e(t){var i=t.samples||[],r=new Uint8Array(4+i.length),n,a;for(a=0;a<i.length;a++){n=i[a].flags;r[a+4]=n.dependsOn<<4|n.isDependedOn<<2|n.hasRedundancy}return Zo(Tu.sdtp,r)};vu=function e(t){return Zo(Tu.stbl,gu(t),Zo(Tu.stts,xu),Zo(Tu.stsc,Uu),Zo(Tu.stsz,Du),Zo(Tu.stco,Ou))};(function(){var e,t;gu=function i(r){return Zo(Tu.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),r.type==="video"?e(r):t(r))};e=function e(t){var i=t.sps||[],r=t.pps||[],n=[],a=[],s;for(s=0;s<i.length;s++){n.push((i[s].byteLength&65280)>>>8);n.push(i[s].byteLength&255);n=n.concat(Array.prototype.slice.call(i[s]))}for(s=0;s<r.length;s++){a.push((r[s].byteLength&65280)>>>8);a.push(r[s].byteLength&255);a=a.concat(Array.prototype.slice.call(r[s]))}return Zo(Tu.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,(t.width&65280)>>8,t.width&255,(t.height&65280)>>8,t.height&255,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]),Zo(Tu.avcC,new Uint8Array([1,t.profileIdc,t.profileCompatibility,t.levelIdc,255].concat([i.length]).concat(n).concat([r.length]).concat(a))),Zo(Tu.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])))};t=function e(t){return Zo(Tu.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(t.channelcount&65280)>>8,t.channelcount&255,(t.samplesize&65280)>>8,t.samplesize&255,0,0,0,0,(t.samplerate&65280)>>8,t.samplerate&255,0,0]),tu(t))}})();fu=function e(t){var i=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(t.id&4278190080)>>24,(t.id&16711680)>>16,(t.id&65280)>>8,t.id&255,0,0,0,0,(t.duration&4278190080)>>24,(t.duration&16711680)>>16,(t.duration&65280)>>8,t.duration&255,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,(t.width&65280)>>8,t.width&255,0,0,(t.height&65280)>>8,t.height&255,0,0]);return Zo(Tu.tkhd,i)};yu=function e(t){var i,r,n,a,s,o,u;i=Zo(Tu.tfhd,new Uint8Array([0,0,0,58,(t.id&4278190080)>>24,(t.id&16711680)>>16,(t.id&65280)>>8,t.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0]));o=Math.floor(t.baseMediaDecodeTime/(Jo+1));u=Math.floor(t.baseMediaDecodeTime%(Jo+1));r=Zo(Tu.tfdt,new Uint8Array([1,0,0,0,o>>>24&255,o>>>16&255,o>>>8&255,o&255,u>>>24&255,u>>>16&255,u>>>8&255,u&255]));s=32+20+8+16+8+8;if(t.type==="audio"){n=bu(t,s);return Zo(Tu.traf,i,r,n)}a=mu(t);n=bu(t,a.length+s);return Zo(Tu.traf,i,r,n,a)};cu=function e(t){t.duration=t.duration||4294967295;return Zo(Tu.trak,fu(t),du(t))};_u=function e(t){var i=new Uint8Array([0,0,0,0,(t.id&4278190080)>>24,(t.id&16711680)>>16,(t.id&65280)>>8,t.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);if(t.type!=="video"){i[i.length-1]=0}return Zo(Tu.trex,i)};(function(){var e,t,i;i=function e(t,i){var r=0,n=0,a=0,s=0;if(t.length){if(t[0].duration!==undefined){r=1}if(t[0].size!==undefined){n=2}if(t[0].flags!==undefined){a=4}if(t[0].compositionTimeOffset!==undefined){s=8}}return[0,0,r|n|a|s,1,(t.length&4278190080)>>>24,(t.length&16711680)>>>16,(t.length&65280)>>>8,t.length&255,(i&4278190080)>>>24,(i&16711680)>>>16,(i&65280)>>>8,i&255]};t=function e(t,r){var n,a,s,o;a=t.samples||[];r+=8+12+16*a.length;n=i(a,r);for(o=0;o<a.length;o++){s=a[o];n=n.concat([(s.duration&4278190080)>>>24,(s.duration&16711680)>>>16,(s.duration&65280)>>>8,s.duration&255,(s.size&4278190080)>>>24,(s.size&16711680)>>>16,(s.size&65280)>>>8,s.size&255,s.flags.isLeading<<2|s.flags.dependsOn,s.flags.isDependedOn<<6|s.flags.hasRedundancy<<4|s.flags.paddingValue<<1|s.flags.isNonSyncSample,s.flags.degradationPriority&240<<8,s.flags.degradationPriority&15,(s.compositionTimeOffset&4278190080)>>>24,(s.compositionTimeOffset&16711680)>>>16,(s.compositionTimeOffset&65280)>>>8,s.compositionTimeOffset&255])}return Zo(Tu.trun,new Uint8Array(n))};e=function e(t,r){var n,a,s,o;a=t.samples||[];r+=8+12+8*a.length;n=i(a,r);for(o=0;o<a.length;o++){s=a[o];n=n.concat([(s.duration&4278190080)>>>24,(s.duration&16711680)>>>16,(s.duration&65280)>>>8,s.duration&255,(s.size&4278190080)>>>24,(s.size&16711680)>>>16,(s.size&65280)>>>8,s.size&255])}return Zo(Tu.trun,new Uint8Array(n))};bu=function i(r,n){if(r.type==="audio"){return e(r,n)}return t(r,n)}})();var Ru={ftyp:iu,mdat:ru,moof:su,moov:ou,initSegment:function e(t){var i=iu(),r=ou(t),n;n=new Uint8Array(i.byteLength+r.byteLength);n.set(i);n.set(r,i.byteLength);return n}};var Mu=function e(){this.init=function(){var e={};this.on=function(t,i){if(!e[t]){e[t]=[]}e[t]=e[t].concat(i)};this.off=function(t,i){var r;if(!e[t]){return false}r=e[t].indexOf(i);e[t]=e[t].slice();e[t].splice(r,1);return r>-1};this.trigger=function(t){var i,r,n,a;i=e[t];if(!i){return}if(arguments.length===2){n=i.length;for(r=0;r<n;++r){i[r].call(this,arguments[1])}}else{a=[];r=arguments.length;for(r=1;r<arguments.length;++r){a.push(arguments[r])}n=i.length;for(r=0;r<n;++r){i[r].apply(this,a)}}};this.dispose=function(){e={}}}};Mu.prototype.pipe=function(e){this.on("data",function(t){e.push(t)});this.on("done",function(t){e.flush(t)});return e};Mu.prototype.push=function(e){this.trigger("data",e)};Mu.prototype.flush=function(e){this.trigger("done",e)};var Bu=Mu;var Nu=function e(t){var i,r,n=[],a=[];n.byteLength=0;for(i=0;i<t.length;i++){r=t[i];if(r.nalUnitType==="access_unit_delimiter_rbsp"){if(n.length){n.duration=r.dts-n.dts;a.push(n)}n=[r];n.byteLength=r.data.byteLength;n.pts=r.pts;n.dts=r.dts}else{if(r.nalUnitType==="slice_layer_without_partitioning_rbsp_idr"){n.keyFrame=true}n.duration=r.dts-n.dts;n.byteLength+=r.data.byteLength;n.push(r)}}if(a.length&&(!n.duration||n.duration<=0)){n.duration=a[a.length-1].duration}a.push(n);return a};var ju=function e(t){var i,r,n=[],a=[];n.byteLength=0;n.nalCount=0;n.duration=0;n.pts=t[0].pts;n.dts=t[0].dts;a.byteLength=0;a.nalCount=0;a.duration=0;a.pts=t[0].pts;a.dts=t[0].dts;for(i=0;i<t.length;i++){r=t[i];if(r.keyFrame){if(n.length){a.push(n);a.byteLength+=n.byteLength;a.nalCount+=n.nalCount;a.duration+=n.duration}n=[r];n.nalCount=r.length;n.byteLength=r.byteLength;n.pts=r.pts;n.dts=r.dts;n.duration=r.duration}else{n.duration+=r.duration;n.nalCount+=r.length;n.byteLength+=r.byteLength;n.push(r)}}if(a.length&&n.duration<=0){n.duration=a[a.length-1].duration}a.byteLength+=n.byteLength;a.nalCount+=n.nalCount;a.duration+=n.duration;a.push(n);return a};var Fu=function e(t){var i;if(!t[0][0].keyFrame&&t.length>1){i=t.shift();t.byteLength-=i.byteLength;t.nalCount-=i.nalCount;t[0][0].dts=i.dts;t[0][0].pts=i.pts;t[0][0].duration+=i.duration}return t};var Vu=function e(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}};var Hu=function e(t,i){var r=Vu();r.dataOffset=i;r.compositionTimeOffset=t.pts-t.dts;r.duration=t.duration;r.size=4*t.length;r.size+=t.byteLength;if(t.keyFrame){r.flags.dependsOn=2;r.flags.isNonSyncSample=0}return r};var qu=function e(t,i){var r,n,a,s,o,u=i||0,l=[];for(r=0;r<t.length;r++){s=t[r];for(n=0;n<s.length;n++){o=s[n];a=Hu(o,u);u+=a.size;l.push(a)}}return l};var zu=function e(t){var i,r,n,a,s,o,u=0,l=t.byteLength,c=t.nalCount,f=l+4*c,d=new Uint8Array(f),h=new DataView(d.buffer);for(i=0;i<t.length;i++){a=t[i];for(r=0;r<a.length;r++){s=a[r];for(n=0;n<s.length;n++){o=s[n];h.setUint32(u,o.data.byteLength);u+=4;d.set(o.data,u);u+=o.data.byteLength}}}return d};var Wu={groupNalsIntoFrames:Nu,groupFramesIntoGops:ju,extendFirstKeyFrame:Fu,generateSampleTable:qu,concatenateNalData:zu};var Gu=[33,16,5,32,164,27];var Xu=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252];var Yu=function e(t){var i=[];while(t--){i.push(0)}return i};var Ku=function e(t){return Object.keys(t).reduce(function(e,i){e[i]=new Uint8Array(t[i].reduce(function(e,t){return e.concat(t)},[]));return e},{})};var $u={96000:[Gu,[227,64],Yu(154),[56]],88200:[Gu,[231],Yu(170),[56]],64000:[Gu,[248,192],Yu(240),[56]],48000:[Gu,[255,192],Yu(268),[55,148,128],Yu(54),[112]],44100:[Gu,[255,192],Yu(268),[55,163,128],Yu(84),[112]],32000:[Gu,[255,192],Yu(268),[55,234],Yu(226),[112]],24000:[Gu,[255,192],Yu(268),[55,255,128],Yu(268),[111,112],Yu(126),[224]],16000:[Gu,[255,192],Yu(268),[55,255,128],Yu(268),[111,255],Yu(269),[223,108],Yu(195),[1,192]],12000:[Xu,Yu(268),[3,127,248],Yu(268),[6,255,240],Yu(268),[13,255,224],Yu(268),[27,253,128],Yu(259),[56]],11025:[Xu,Yu(268),[3,127,248],Yu(268),[6,255,240],Yu(268),[13,255,224],Yu(268),[27,255,192],Yu(268),[55,175,128],Yu(108),[112]],8000:[Xu,Yu(268),[3,121,16],Yu(47),[7]]};var Qu=Ku($u);var Ju=9e4,Zu,el,tl,il,rl,nl;Zu=function e(t){return t*Ju};el=function e(t,i){return t*i};tl=function e(t){return t/Ju};il=function e(t,i){return t/i};rl=function e(t,i){return Zu(il(t,i))};nl=function e(t,i){return el(tl(t),i)};var al={secondsToVideoTs:Zu,secondsToAudioTs:el,videoTsToSeconds:tl,audioTsToSeconds:il,audioTsToVideoTs:rl,videoTsToAudioTs:nl};var sl=9e4;var ol=function e(t){var i,r,n=0;for(i=0;i<t.length;i++){r=t[i];n+=r.data.byteLength}return n};var ul=function e(t,i,r,n){var a,s=0,o=0,u=0,l=0,c,f;if(!i.length){return}a=al.audioTsToVideoTs(t.baseMediaDecodeTime,t.samplerate);s=Math.ceil(sl/(t.samplerate/1024));if(r&&n){o=a-Math.max(r,n);u=Math.floor(o/s);l=u*s}if(u<1||l>sl/2){return}c=Qu[t.samplerate];if(!c){c=i[0].data}for(f=0;f<u;f++){i.splice(f,0,{data:c})}t.baseMediaDecodeTime-=Math.floor(al.videoTsToAudioTs(l,t.samplerate))};var ll=function e(t,i,r){if(i.minSegmentDts>=r){return t}i.minSegmentDts=Infinity;return t.filter(function(e){if(e.dts>=r){i.minSegmentDts=Math.min(i.minSegmentDts,e.dts);i.minSegmentPts=i.minSegmentDts;return true}return false})};var cl=function e(t){var i,r,n=[];for(i=0;i<t.length;i++){r=t[i];n.push({size:r.data.byteLength,duration:1024})}return n};var fl=function e(t){var i,r,n=0,a=new Uint8Array(ol(t));for(i=0;i<t.length;i++){r=t[i];a.set(r.data,n);n+=r.data.byteLength}return a};var dl={prefixWithSilence:ul,trimAdtsFramesByEarliestDts:ll,generateSampleTable:cl,concatenateFrameData:fl};var hl=9e4;var pl=function e(t,i){if(typeof i.pts==="number"){if(t.timelineStartInfo.pts===undefined){t.timelineStartInfo.pts=i.pts}if(t.minSegmentPts===undefined){t.minSegmentPts=i.pts}else{t.minSegmentPts=Math.min(t.minSegmentPts,i.pts)}if(t.maxSegmentPts===undefined){t.maxSegmentPts=i.pts}else{t.maxSegmentPts=Math.max(t.maxSegmentPts,i.pts)}}if(typeof i.dts==="number"){if(t.timelineStartInfo.dts===undefined){t.timelineStartInfo.dts=i.dts}if(t.minSegmentDts===undefined){t.minSegmentDts=i.dts}else{t.minSegmentDts=Math.min(t.minSegmentDts,i.dts)}if(t.maxSegmentDts===undefined){t.maxSegmentDts=i.dts}else{t.maxSegmentDts=Math.max(t.maxSegmentDts,i.dts)}}};var ml=function e(t){delete t.minSegmentDts;delete t.maxSegmentDts;delete t.minSegmentPts;delete t.maxSegmentPts};var vl=function e(t,i){var r,n,a=t.minSegmentDts;if(!i){a-=t.timelineStartInfo.dts}r=t.timelineStartInfo.baseMediaDecodeTime;r+=a;r=Math.max(0,r);if(t.type==="audio"){n=t.samplerate/hl;r*=n;r=Math.floor(r)}return r};var gl={clearDtsInfo:ml,calculateTrackBaseMediaDecodeTime:vl,collectDtsInfo:pl};var yl=4,_l=128;var bl=function e(t){var i=0,r={payloadType:-1,payloadSize:0},n=0,a=0;while(i<t.byteLength){if(t[i]===_l){break}while(t[i]===255){n+=255;i++}n+=t[i++];while(t[i]===255){a+=255;i++}a+=t[i++];if(!r.payload&&n===yl){r.payloadType=n;r.payloadSize=a;r.payload=t.subarray(i,i+a);break}i+=a;n=0;a=0}return r};var Tl=function e(t){if(t.payload[0]!==181){return null}if((t.payload[1]<<8|t.payload[2])!==49){return null}if(String.fromCharCode(t.payload[3],t.payload[4],t.payload[5],t.payload[6])!=="GA94"){return null}if(t.payload[7]!==3){return null}return t.payload.subarray(8,t.payload.length-1)};var Sl=function e(t,i){var r=[],n,a,s,o;if(!(i[0]&64)){return r}a=i[0]&31;for(n=0;n<a;n++){s=n*3;o={type:i[s+2]&3,pts:t};if(i[s+2]&4){o.ccData=i[s+3]<<8|i[s+4];r.push(o)}}return r};var kl=function e(t){var i=t.byteLength,r=[],n=1,a,s;while(n<i-2){if(t[n]===0&&t[n+1]===0&&t[n+2]===3){r.push(n+2);n+=2}else{n++}}if(r.length===0){return t}a=i-r.length;s=new Uint8Array(a);var o=0;for(n=0;n<a;o++,n++){if(o===r[0]){o++;r.shift()}s[n]=t[o]}return s};var wl={parseSei:bl,parseUserData:Tl,parseCaptionPackets:Sl,discardEmulationPreventionBytes:kl,USER_DATA_REGISTERED_ITU_T_T35:yl};var Cl=function e(){e.prototype.init.call(this);this.captionPackets_=[];this.ccStreams_=[new Ol(0,0),new Ol(0,1),new Ol(1,0),new Ol(1,1)];this.reset();this.ccStreams_.forEach(function(e){e.on("data",this.trigger.bind(this,"data"));e.on("done",this.trigger.bind(this,"done"))},this)};Cl.prototype=new Bu;Cl.prototype.push=function(e){var t,i,r;if(e.nalUnitType!=="sei_rbsp"){return}t=wl.parseSei(e.escapedRBSP);if(t.payloadType!==wl.USER_DATA_REGISTERED_ITU_T_T35){return}i=wl.parseUserData(t);if(!i){return}if(e.dts<this.latestDts_){this.ignoreNextEqualDts_=true;return}else if(e.dts===this.latestDts_&&this.ignoreNextEqualDts_){this.numSameDts_--;if(!this.numSameDts_){this.ignoreNextEqualDts_=false}return}r=wl.parseCaptionPackets(e.pts,i);this.captionPackets_=this.captionPackets_.concat(r);if(this.latestDts_!==e.dts){this.numSameDts_=0}this.numSameDts_++;this.latestDts_=e.dts};Cl.prototype.flush=function(){if(!this.captionPackets_.length){this.ccStreams_.forEach(function(e){e.flush()},this);return}this.captionPackets_.forEach(function(e,t){e.presortIndex=t});this.captionPackets_.sort(function(e,t){if(e.pts===t.pts){return e.presortIndex-t.presortIndex}return e.pts-t.pts});this.captionPackets_.forEach(function(e){if(e.type<2){this.dispatchCea608Packet(e)}},this);this.captionPackets_.length=0;this.ccStreams_.forEach(function(e){e.flush()},this);return};Cl.prototype.reset=function(){this.latestDts_=null;this.ignoreNextEqualDts_=false;this.numSameDts_=0;this.activeCea608Channel_=[null,null];this.ccStreams_.forEach(function(e){e.reset()})};Cl.prototype.dispatchCea608Packet=function(e){if(this.setsChannel1Active(e)){this.activeCea608Channel_[e.type]=0}else if(this.setsChannel2Active(e)){this.activeCea608Channel_[e.type]=1}if(this.activeCea608Channel_[e.type]===null){return}this.ccStreams_[(e.type<<1)+this.activeCea608Channel_[e.type]].push(e)};Cl.prototype.setsChannel1Active=function(e){return(e.ccData&30720)===4096};Cl.prototype.setsChannel2Active=function(e){return(e.ccData&30720)===6144};var El={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};var Al=function e(t){if(t===null){return""}t=El[t]||t;return String.fromCharCode(t)};var Ll=14;var Il=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152];var Pl=function e(){var t=[],i=Ll+1;while(i--){t.push("")}return t};var Ol=function e(t,i){e.prototype.init.call(this);this.field_=t||0;this.dataChannel_=i||0;this.name_="CC"+((this.field_<<1|this.dataChannel_)+1);this.setConstants();this.reset();this.push=function(e){var t,i,r,n,a;t=e.ccData&32639;if(t===this.lastControlCode_){this.lastControlCode_=null;return}if((t&61440)===4096){this.lastControlCode_=t}else if(t!==this.PADDING_){this.lastControlCode_=null}r=t>>>8;n=t&255;if(t===this.PADDING_){return}else if(t===this.RESUME_CAPTION_LOADING_){this.mode_="popOn"}else if(t===this.END_OF_CAPTION_){this.mode_="popOn";this.clearFormatting(e.pts);this.flushDisplayed(e.pts);i=this.displayed_;this.displayed_=this.nonDisplayed_;this.nonDisplayed_=i;this.startPts_=e.pts}else if(t===this.ROLL_UP_2_ROWS_){this.rollUpRows_=2;this.setRollUp(e.pts)}else if(t===this.ROLL_UP_3_ROWS_){this.rollUpRows_=3;this.setRollUp(e.pts)}else if(t===this.ROLL_UP_4_ROWS_){this.rollUpRows_=4;this.setRollUp(e.pts)}else if(t===this.CARRIAGE_RETURN_){this.clearFormatting(e.pts);this.flushDisplayed(e.pts);this.shiftRowsUp_();this.startPts_=e.pts}else if(t===this.BACKSPACE_){if(this.mode_==="popOn"){this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1)}else{this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1)}}else if(t===this.ERASE_DISPLAYED_MEMORY_){this.flushDisplayed(e.pts);this.displayed_=Pl()}else if(t===this.ERASE_NON_DISPLAYED_MEMORY_){this.nonDisplayed_=Pl()}else if(t===this.RESUME_DIRECT_CAPTIONING_){if(this.mode_!=="paintOn"){this.flushDisplayed(e.pts);this.displayed_=Pl()}this.mode_="paintOn";this.startPts_=e.pts}else if(this.isSpecialCharacter(r,n)){r=(r&3)<<8;a=Al(r|n);this[this.mode_](e.pts,a);this.column_++}else if(this.isExtCharacter(r,n)){if(this.mode_==="popOn"){this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1)}else{this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1)}r=(r&3)<<8;a=Al(r|n);this[this.mode_](e.pts,a);this.column_++}else if(this.isMidRowCode(r,n)){this.clearFormatting(e.pts);this[this.mode_](e.pts," ");this.column_++;if((n&14)===14){this.addFormatting(e.pts,["i"])}if((n&1)===1){this.addFormatting(e.pts,["u"])}}else if(this.isOffsetControlCode(r,n)){this.column_+=n&3}else if(this.isPAC(r,n)){var s=Il.indexOf(t&7968);if(this.mode_==="rollUp"){if(s-this.rollUpRows_+1<0){s=this.rollUpRows_-1}this.setRollUp(e.pts,s)}if(s!==this.row_){this.clearFormatting(e.pts);this.row_=s}if(n&1&&this.formatting_.indexOf("u")===-1){this.addFormatting(e.pts,["u"])}if((t&16)===16){this.column_=((t&14)>>1)*4}if(this.isColorPAC(n)){if((n&14)===14){this.addFormatting(e.pts,["i"])}}}else if(this.isNormalChar(r)){if(n===0){n=null}a=Al(r);a+=Al(n);this[this.mode_](e.pts,a);this.column_+=a.length}}};Ol.prototype=new Bu;Ol.prototype.flushDisplayed=function(e){var t=this.displayed_.map(function(e){try{return e.trim()}catch(e){console.error("Skipping malformed caption.");return""}}).join("\n").replace(/^\n+|\n+$/g,"");if(t.length){this.trigger("data",{startPts:this.startPts_,endPts:e,text:t,stream:this.name_})}};Ol.prototype.reset=function(){this.mode_="popOn";this.topRow_=0;this.startPts_=0;this.displayed_=Pl();this.nonDisplayed_=Pl();this.lastControlCode_=null;this.column_=0;this.row_=Ll;this.rollUpRows_=2;this.formatting_=[]};Ol.prototype.setConstants=function(){if(this.dataChannel_===0){this.BASE_=16;this.EXT_=17;this.CONTROL_=(20|this.field_)<<8;this.OFFSET_=23}else if(this.dataChannel_===1){this.BASE_=24;this.EXT_=25;this.CONTROL_=(28|this.field_)<<8;this.OFFSET_=31}this.PADDING_=0;this.RESUME_CAPTION_LOADING_=this.CONTROL_|32;this.END_OF_CAPTION_=this.CONTROL_|47;this.ROLL_UP_2_ROWS_=this.CONTROL_|37;this.ROLL_UP_3_ROWS_=this.CONTROL_|38;this.ROLL_UP_4_ROWS_=this.CONTROL_|39;this.CARRIAGE_RETURN_=this.CONTROL_|45;this.RESUME_DIRECT_CAPTIONING_=this.CONTROL_|41;this.BACKSPACE_=this.CONTROL_|33;this.ERASE_DISPLAYED_MEMORY_=this.CONTROL_|44;this.ERASE_NON_DISPLAYED_MEMORY_=this.CONTROL_|46};Ol.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&t>=48&&t<=63};Ol.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&t>=32&&t<=63};Ol.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&t>=32&&t<=47};Ol.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&t>=33&&t<=35};Ol.prototype.isPAC=function(e,t){return e>=this.BASE_&&e<this.BASE_+8&&t>=64&&t<=127};Ol.prototype.isColorPAC=function(e){return e>=64&&e<=79||e>=96&&e<=127};Ol.prototype.isNormalChar=function(e){return e>=32&&e<=127};Ol.prototype.setRollUp=function(e,t){if(this.mode_!=="rollUp"){this.row_=Ll;this.mode_="rollUp";this.flushDisplayed(e);this.nonDisplayed_=Pl();this.displayed_=Pl()}if(t!==undefined&&t!==this.row_){for(var i=0;i<this.rollUpRows_;i++){this.displayed_[t-i]=this.displayed_[this.row_-i];this.displayed_[this.row_-i]=""}}if(t===undefined){t=this.row_}this.topRow_=t-this.rollUpRows_+1};Ol.prototype.addFormatting=function(e,t){this.formatting_=this.formatting_.concat(t);var i=t.reduce(function(e,t){return e+"<"+t+">"},"");this[this.mode_](e,i)};Ol.prototype.clearFormatting=function(e){if(!this.formatting_.length){return}var t=this.formatting_.reverse().reduce(function(e,t){return e+"</"+t+">"},"");this.formatting_=[];this[this.mode_](e,t)};Ol.prototype.popOn=function(e,t){var i=this.nonDisplayed_[this.row_];i+=t;this.nonDisplayed_[this.row_]=i};Ol.prototype.rollUp=function(e,t){var i=this.displayed_[this.row_];i+=t;this.displayed_[this.row_]=i};Ol.prototype.shiftRowsUp_=function(){var e;for(e=0;e<this.topRow_;e++){this.displayed_[e]=""}for(e=this.row_+1;e<Ll+1;e++){this.displayed_[e]=""}for(e=this.topRow_;e<this.row_;e++){this.displayed_[e]=this.displayed_[e+1]}this.displayed_[this.row_]=""};Ol.prototype.paintOn=function(e,t){var i=this.displayed_[this.row_];i+=t;this.displayed_[this.row_]=i};var Ul={CaptionStream:Cl,Cea608Stream:Ol};var Dl={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21};var xl=8589934592;var Rl=4294967296;var Ml=function e(t,i){var r=1;if(t>i){r=-1}while(Math.abs(i-t)>Rl){t+=r*xl}return t};var Bl=function e(t){var i,r;e.prototype.init.call(this);this.type_=t;this.push=function(e){if(e.type!==this.type_){return}if(r===undefined){r=e.dts}e.dts=Ml(e.dts,r);e.pts=Ml(e.pts,r);i=e.dts;this.trigger("data",e)};this.flush=function(){r=i;this.trigger("done")};this.discontinuity=function(){r=void 0;i=void 0}};Bl.prototype=new Bu;var Nl={TimestampRolloverStream:Bl,handleRollover:Ml};var jl=function e(t,i,r){var n,a="";for(n=i;n<r;n++){a+="%"+("00"+t[n].toString(16)).slice(-2)}return a},Fl=function e(t,i,r){return decodeURIComponent(jl(t,i,r))},Vl=function e(t,i,r){return unescape(jl(t,i,r))},Hl=function e(t){return t[0]<<21|t[1]<<14|t[2]<<7|t[3]},ql={TXXX:function e(t){var i;if(t.data[0]!==3){return}for(i=1;i<t.data.length;i++){if(t.data[i]===0){t.description=Fl(t.data,1,i);t.value=Fl(t.data,i+1,t.data.length).replace(/\0*$/,"");break}}t.data=t.value},WXXX:function e(t){var i;if(t.data[0]!==3){return}for(i=1;i<t.data.length;i++){if(t.data[i]===0){t.description=Fl(t.data,1,i);t.url=Fl(t.data,i+1,t.data.length);break}}},PRIV:function e(t){var i;for(i=0;i<t.data.length;i++){if(t.data[i]===0){t.owner=Vl(t.data,0,i);break}}t.privateData=t.data.subarray(i+1);t.data=t.privateData}},zl;zl=function e(t){var i={debug:!!(t&&t.debug),descriptor:t&&t.descriptor},r=0,n=[],a=0,s;zl.prototype.init.call(this);this.dispatchType=Dl.METADATA_STREAM_TYPE.toString(16);if(i.descriptor){for(s=0;s<i.descriptor.length;s++){this.dispatchType+=("00"+i.descriptor[s].toString(16)).slice(-2)}}this.push=function(e){var t,s,o,u,l,c;if(e.type!=="timed-metadata"){return}if(e.dataAlignmentIndicator){a=0;n.length=0}if(n.length===0&&(e.data.length<10||e.data[0]!=="I".charCodeAt(0)||e.data[1]!=="D".charCodeAt(0)||e.data[2]!=="3".charCodeAt(0))){if(i.debug){console.log("Skipping unrecognized metadata packet")}return}n.push(e);a+=e.data.byteLength;if(n.length===1){r=Hl(e.data.subarray(6,10));r+=10}if(a<r){return}t={data:new Uint8Array(r),frames:[],pts:n[0].pts,dts:n[0].dts};for(l=0;l<r;){t.data.set(n[0].data.subarray(0,r-l),l);l+=n[0].data.byteLength;a-=n[0].data.byteLength;n.shift()}s=10;if(t.data[5]&64){s+=4;s+=Hl(t.data.subarray(10,14));r-=Hl(t.data.subarray(16,20))}do{o=Hl(t.data.subarray(s+4,s+8));if(o<1){return console.log("Malformed ID3 frame encountered. Skipping metadata parsing.")}c=String.fromCharCode(t.data[s],t.data[s+1],t.data[s+2],t.data[s+3]);u={id:c,data:t.data.subarray(s+10,s+o+10)};u.key=u.id;if(ql[u.id]){ql[u.id](u);if(u.owner==="com.apple.streaming.transportStreamTimestamp"){var f=u.data,d=(f[3]&1)<<30|f[4]<<22|f[5]<<14|f[6]<<6|f[7]>>>2;d*=4;d+=f[7]&3;u.timeStamp=d;if(t.pts===undefined&&t.dts===undefined){t.pts=u.timeStamp;t.dts=u.timeStamp}this.trigger("timestamp",u)}}t.frames.push(u);s+=10;s+=o}while(s<r);this.trigger("data",t)}};zl.prototype=new Bu;var Wl=zl;var Gl=Nl.TimestampRolloverStream;var Xl,Yl,Kl;var $l=188,Ql=71;Xl=function e(){var t=new Uint8Array($l),i=0;Xl.prototype.init.call(this);this.push=function(e){var r=0,n=$l,a;if(i){a=new Uint8Array(e.byteLength+i);a.set(t.subarray(0,i));a.set(e,i);i=0}else{a=e}while(n<a.byteLength){if(a[r]===Ql&&a[n]===Ql){this.trigger("data",a.subarray(r,n));r+=$l;n+=$l;continue}r++;n++}if(r<a.byteLength){t.set(a.subarray(r),0);i=a.byteLength-r}};this.flush=function(){if(i===$l&&t[0]===Ql){this.trigger("data",t);i=0}this.trigger("done")}};Xl.prototype=new Bu;Yl=function e(){var t,i,r,n;Yl.prototype.init.call(this);n=this;this.packetsWaitingForPmt=[];this.programMapTable=undefined;t=function e(t,n){var a=0;if(n.payloadUnitStartIndicator){a+=t[a]+1}if(n.type==="pat"){i(t.subarray(a),n)}else{r(t.subarray(a),n)}};i=function e(t,i){i.section_number=t[7];i.last_section_number=t[8];n.pmtPid=(t[10]&31)<<8|t[11];i.pmtPid=n.pmtPid};r=function e(t,i){var r,a,s,o;if(!(t[5]&1)){return}n.programMapTable={video:null,audio:null,"timed-metadata":{}};r=(t[1]&15)<<8|t[2];a=3+r-4;s=(t[10]&15)<<8|t[11];o=12+s;while(o<a){var u=t[o];var l=(t[o+1]&31)<<8|t[o+2];if(u===Dl.H264_STREAM_TYPE&&n.programMapTable.video===null){n.programMapTable.video=l}else if(u===Dl.ADTS_STREAM_TYPE&&n.programMapTable.audio===null){n.programMapTable.audio=l}else if(u===Dl.METADATA_STREAM_TYPE){n.programMapTable["timed-metadata"][l]=u}o+=((t[o+3]&15)<<8|t[o+4])+5}i.programMapTable=n.programMapTable};this.push=function(e){var i={},r=4;i.payloadUnitStartIndicator=!!(e[1]&64);i.pid=e[1]&31;i.pid<<=8;i.pid|=e[2];if((e[3]&48)>>>4>1){r+=e[r]+1}if(i.pid===0){i.type="pat";t(e.subarray(r),i);this.trigger("data",i)}else if(i.pid===this.pmtPid){i.type="pmt";t(e.subarray(r),i);this.trigger("data",i);while(this.packetsWaitingForPmt.length){this.processPes_.apply(this,this.packetsWaitingForPmt.shift())}}else if(this.programMapTable===undefined){this.packetsWaitingForPmt.push([e,r,i])}else{this.processPes_(e,r,i)}};this.processPes_=function(e,t,i){if(i.pid===this.programMapTable.video){i.streamType=Dl.H264_STREAM_TYPE}else if(i.pid===this.programMapTable.audio){i.streamType=Dl.ADTS_STREAM_TYPE}else{i.streamType=this.programMapTable["timed-metadata"][i.pid]}i.type="pes";i.data=e.subarray(t);this.trigger("data",i)}};Yl.prototype=new Bu;Yl.STREAM_TYPES={h264:27,adts:15};Kl=function e(){var t=this,i={data:[],size:0},r={data:[],size:0},n={data:[],size:0},a=function e(t,i){var r;i.packetLength=6+(t[4]<<8|t[5]);i.dataAlignmentIndicator=(t[6]&4)!==0;r=t[7];if(r&192){i.pts=(t[9]&14)<<27|(t[10]&255)<<20|(t[11]&254)<<12|(t[12]&255)<<5|(t[13]&254)>>>3;i.pts*=4;i.pts+=(t[13]&6)>>>1;i.dts=i.pts;if(r&64){i.dts=(t[14]&14)<<27|(t[15]&255)<<20|(t[16]&254)<<12|(t[17]&255)<<5|(t[18]&254)>>>3;i.dts*=4;i.dts+=(t[18]&6)>>>1}}i.data=t.subarray(9+t[8])},s=function e(i,r,n){var s=new Uint8Array(i.size),o={type:r},u=0,l=0,c=false,f;if(!i.data.length||i.size<9){return}o.trackId=i.data[0].pid;for(u=0;u<i.data.length;u++){f=i.data[u];s.set(f.data,l);l+=f.data.byteLength}a(s,o);c=r==="video"||o.packetLength<=i.size;if(n||c){i.size=0;i.data.length=0}if(c){t.trigger("data",o)}};Kl.prototype.init.call(this);this.push=function(e){({pat:function e(){},pes:function t(){var a,o;switch(e.streamType){case Dl.H264_STREAM_TYPE:case Dl.H264_STREAM_TYPE:a=i;o="video";break;case Dl.ADTS_STREAM_TYPE:a=r;o="audio";break;case Dl.METADATA_STREAM_TYPE:a=n;o="timed-metadata";break;default:return}if(e.payloadUnitStartIndicator){s(a,o,true)}a.data.push(e);a.size+=e.data.byteLength},pmt:function i(){var r={type:"metadata",tracks:[]},n=e.programMapTable;if(n.video!==null){r.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+n.video,codec:"avc",type:"video"})}if(n.audio!==null){r.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+n.audio,codec:"adts",type:"audio"})}t.trigger("data",r)}})[e.type]()};this.flush=function(){s(i,"video");s(r,"audio");s(n,"timed-metadata");this.trigger("done")}};Kl.prototype=new Bu;var Jl={PAT_PID:0,MP2T_PACKET_LENGTH:$l,TransportPacketStream:Xl,TransportParseStream:Yl,ElementaryStream:Kl,TimestampRolloverStream:Gl,CaptionStream:Ul.CaptionStream,Cea608Stream:Ul.Cea608Stream,MetadataStream:Wl};for(var Zl in Dl){if(Dl.hasOwnProperty(Zl)){Jl[Zl]=Dl[Zl]}}var ec=Jl;var tc;var ic=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];tc=function e(){var t;tc.prototype.init.call(this);this.push=function(e){var i=0,r=0,n,a,s,o,u,l;if(e.type!=="audio"){return}if(t){o=t;t=new Uint8Array(o.byteLength+e.data.byteLength);t.set(o);t.set(e.data,o.byteLength)}else{t=e.data}while(i+5<t.length){if(t[i]!==255||(t[i+1]&246)!==240){i++;continue}a=(~t[i+1]&1)*2;n=(t[i+3]&3)<<11|t[i+4]<<3|(t[i+5]&224)>>5;u=((t[i+6]&3)+1)*1024;l=u*9e4/ic[(t[i+2]&60)>>>2];s=i+n;if(t.byteLength<s){return}this.trigger("data",{pts:e.pts+r*l,dts:e.dts+r*l,sampleCount:u,audioobjecttype:(t[i+2]>>>6&3)+1,channelcount:(t[i+2]&1)<<2|(t[i+3]&192)>>>6,samplerate:ic[(t[i+2]&60)>>>2],samplingfrequencyindex:(t[i+2]&60)>>>2,samplesize:16,data:t.subarray(i+7+a,s)});if(t.byteLength===s){t=undefined;return}r++;t=t.subarray(s)}};this.flush=function(){this.trigger("done")}};tc.prototype=new Bu;var rc=tc;var nc;nc=function e(t){var i=t.byteLength,r=0,n=0;this.length=function(){return 8*i};this.bitsAvailable=function(){return 8*i+n};this.loadWord=function(){var e=t.byteLength-i,a=new Uint8Array(4),s=Math.min(4,i);if(s===0){throw new Error("no bytes available")}a.set(t.subarray(e,e+s));r=new DataView(a.buffer).getUint32(0);n=s*8;i-=s};this.skipBits=function(e){var t;if(n>e){r<<=e;n-=e}else{e-=n;t=Math.floor(e/8);e-=t*8;i-=t;this.loadWord();r<<=e;n-=e}};this.readBits=function(e){var t=Math.min(n,e),a=r>>>32-t;n-=t;if(n>0){r<<=t}else if(i>0){this.loadWord()}t=e-t;if(t>0){return a<<t|this.readBits(t)}return a};this.skipLeadingZeros=function(){var e;for(e=0;e<n;++e){if((r&2147483648>>>e)!==0){r<<=e;n-=e;return e}}this.loadWord();return 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();if(1&e){return 1+e>>>1}return-1*(e>>>1)};this.readBoolean=function(){return this.readBits(1)===1};this.readUnsignedByte=function(){return this.readBits(8)};this.loadWord()};var ac=nc;var sc,oc;var uc;oc=function e(){var t=0,i,r;oc.prototype.init.call(this);this.push=function(e){var n;if(!r){r=e.data}else{n=new Uint8Array(r.byteLength+e.data.byteLength);n.set(r);n.set(e.data,r.byteLength);r=n}for(;t<r.byteLength-3;t++){if(r[t+2]===1){i=t+5;break}}while(i<r.byteLength){switch(r[i]){case 0:if(r[i-1]!==0){i+=2;break}else if(r[i-2]!==0){i++;break}if(t+3!==i-2){this.trigger("data",r.subarray(t+3,i-2))}do{i++}while(r[i]!==1&&i<r.length);t=i-2;i+=3;break;case 1:if(r[i-1]!==0||r[i-2]!==0){i+=3;break}this.trigger("data",r.subarray(t+3,i-2));t=i-2;i+=3;break;default:i+=3;break}}r=r.subarray(t);i-=t;t=0};this.flush=function(){if(r&&r.byteLength>3){this.trigger("data",r.subarray(t+3))}r=null;t=0;this.trigger("done")}};oc.prototype=new Bu;uc={100:true,110:true,122:true,244:true,44:true,83:true,86:true,118:true,128:true,138:true,139:true,134:true};sc=function e(){var t=new oc,i,r,n,a,s,o,u;sc.prototype.init.call(this);i=this;this.push=function(e){if(e.type!=="video"){return}r=e.trackId;n=e.pts;a=e.dts;t.push(e)};t.on("data",function(e){var t={trackId:r,pts:n,dts:a,data:e};switch(e[0]&31){case 5:t.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:t.nalUnitType="sei_rbsp";t.escapedRBSP=s(e.subarray(1));break;case 7:t.nalUnitType="seq_parameter_set_rbsp";t.escapedRBSP=s(e.subarray(1));t.config=o(t.escapedRBSP);break;case 8:t.nalUnitType="pic_parameter_set_rbsp";break;case 9:t.nalUnitType="access_unit_delimiter_rbsp";break;default:break}i.trigger("data",t)});t.on("done",function(){i.trigger("done")});this.flush=function(){t.flush()};u=function e(t,i){var r=8,n=8,a,s;for(a=0;a<t;a++){if(n!==0){s=i.readExpGolomb();n=(r+s+256)%256}r=n===0?r:n}};s=function e(t){var i=t.byteLength,r=[],n=1,a,s;while(n<i-2){if(t[n]===0&&t[n+1]===0&&t[n+2]===3){r.push(n+2);n+=2}else{n++}}if(r.length===0){return t}a=i-r.length;s=new Uint8Array(a);var o=0;for(n=0;n<a;o++,n++){if(o===r[0]){o++;r.shift()}s[n]=t[o]}return s};o=function e(t){var i=0,r=0,n=0,a=0,s=1,o,l,c,f,d,h,p,m,v,g,y,_,b,T;o=new ac(t);l=o.readUnsignedByte();f=o.readUnsignedByte();c=o.readUnsignedByte();o.skipUnsignedExpGolomb();if(uc[l]){d=o.readUnsignedExpGolomb();if(d===3){o.skipBits(1)}o.skipUnsignedExpGolomb();o.skipUnsignedExpGolomb();o.skipBits(1);if(o.readBoolean()){y=d!==3?8:12;for(T=0;T<y;T++){if(o.readBoolean()){if(T<6){u(16,o)}else{u(64,o)}}}}}o.skipUnsignedExpGolomb();h=o.readUnsignedExpGolomb();if(h===0){o.readUnsignedExpGolomb()}else if(h===1){o.skipBits(1);o.skipExpGolomb();o.skipExpGolomb();p=o.readUnsignedExpGolomb();for(T=0;T<p;T++){o.skipExpGolomb()}}o.skipUnsignedExpGolomb();o.skipBits(1);m=o.readUnsignedExpGolomb();v=o.readUnsignedExpGolomb();g=o.readBits(1);if(g===0){o.skipBits(1)}o.skipBits(1);if(o.readBoolean()){i=o.readUnsignedExpGolomb();r=o.readUnsignedExpGolomb();n=o.readUnsignedExpGolomb();a=o.readUnsignedExpGolomb()}if(o.readBoolean()){if(o.readBoolean()){b=o.readUnsignedByte();switch(b){case 1:_=[1,1];break;case 2:_=[12,11];break;case 3:_=[10,11];break;case 4:_=[16,11];break;case 5:_=[40,33];break;case 6:_=[24,11];break;case 7:_=[20,11];break;case 8:_=[32,11];break;case 9:_=[80,33];break;case 10:_=[18,11];break;case 11:_=[15,11];break;case 12:_=[64,33];break;case 13:_=[160,99];break;case 14:_=[4,3];break;case 15:_=[3,2];break;case 16:_=[2,1];break;case 255:{_=[o.readUnsignedByte()<<8|o.readUnsignedByte(),o.readUnsignedByte()<<8|o.readUnsignedByte()];break}}if(_){s=_[0]/_[1]}}}return{profileIdc:l,levelIdc:c,profileCompatibility:f,width:Math.ceil(((m+1)*16-i*2-r*2)*s),height:(2-g)*(v+1)*16-n*2-a*2}}};sc.prototype=new Bu;var lc={H264Stream:sc,NalByteStream:oc};var cc=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];var fc=function e(t){if(t[0]==="I".charCodeAt(0)&&t[1]==="D".charCodeAt(0)&&t[2]==="3".charCodeAt(0)){return true}return false};var dc=function e(t){return t[0]<<21|t[1]<<14|t[2]<<7|t[3]};var hc=function e(t,i,r){var n,a="";for(n=i;n<r;n++){a+="%"+("00"+t[n].toString(16)).slice(-2)}return a};var pc=function e(t,i,r){return unescape(hc(t,i,r))};var mc=function e(t,i){var r=t[i+6]<<21|t[i+7]<<14|t[i+8]<<7|t[i+9],n=t[i+5],a=(n&16)>>4;if(a){return r+20}return r+10};var vc=function e(t,i){var r=(t[i+5]&224)>>5,n=t[i+4]<<3,a=t[i+3]&3<<11;return a|n|r};var gc=function e(t,i){if(t[i]==="I".charCodeAt(0)&&t[i+1]==="D".charCodeAt(0)&&t[i+2]==="3".charCodeAt(0)){return"timed-metadata"}else if(t[i]&255===255&&(t[i+1]&240)===240){return"audio"}return null};var yc=function e(t){var i=0;while(i+5<t.length){if(t[i]!==255||(t[i+1]&246)!==240){i++;continue}return cc[(t[i+2]&60)>>>2]}return null};var _c=function e(t){var i,r,n,a;i=10;if(t[5]&64){i+=4;i+=dc(t.subarray(10,14))}do{r=dc(t.subarray(i+4,i+8));if(r<1){return null}a=String.fromCharCode(t[i],t[i+1],t[i+2],t[i+3]);if(a==="PRIV"){n=t.subarray(i+10,i+r+10);for(var s=0;s<n.byteLength;s++){if(n[s]===0){var o=pc(n,0,s);if(o==="com.apple.streaming.transportStreamTimestamp"){var u=n.subarray(s+1);var l=(u[3]&1)<<30|u[4]<<22|u[5]<<14|u[6]<<6|u[7]>>>2;l*=4;l+=u[7]&3;return l}break}}}i+=10;i+=r}while(i<t.byteLength);return null};var bc={isLikelyAacData:fc,parseId3TagSize:mc,parseAdtsSize:vc,parseType:gc,parseSampleRate:yc,parseAacTimestamp:_c};var Tc;Tc=function e(){var t=new Uint8Array,i=0;Tc.prototype.init.call(this);this.setTimestamp=function(e){i=e};this.push=function(e){var r=0,n=0,a,s,o,u;if(t.length){u=t.length;t=new Uint8Array(e.byteLength+u);t.set(t.subarray(0,u));t.set(e,u)}else{t=e}while(t.length-n>=3){if(t[n]==="I".charCodeAt(0)&&t[n+1]==="D".charCodeAt(0)&&t[n+2]==="3".charCodeAt(0)){if(t.length-n<10){break}r=bc.parseId3TagSize(t,n);if(n+r>t.length){break}s={type:"timed-metadata",data:t.subarray(n,n+r)};this.trigger("data",s);n+=r;continue}else if((t[n]&255)===255&&(t[n+1]&240)===240){if(t.length-n<7){break}r=bc.parseAdtsSize(t,n);if(n+r>t.length){break}o={type:"audio",data:t.subarray(n,n+r),pts:i,dts:i};this.trigger("data",o);n+=r;continue}n++}a=t.length-n;if(a>0){t=t.subarray(n)}else{t=new Uint8Array}}};Tc.prototype=new Bu;var Sc=Tc;var kc=lc.H264Stream;var wc=bc.isLikelyAacData;var Cc=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"];var Ec=["width","height","profileIdc","levelIdc","profileCompatibility"];var Ac,Lc,Ic,Pc;var Oc=function e(t,i){var r;if(t.length!==i.length){return false}for(r=0;r<t.length;r++){if(t[r]!==i[r]){return false}}return true};var Uc=function e(t,i,r,n,a,s){var o=r-i,u=n-i,l=a-r;return{start:{dts:t,pts:t+o},end:{dts:t+u,pts:t+l},prependedContentDuration:s,baseMediaDecodeTime:t}};Lc=function e(t,i){var r=[],n=0,a=0,s=0,o=Infinity;i=i||{};Lc.prototype.init.call(this);this.push=function(e){gl.collectDtsInfo(t,e);if(t){Cc.forEach(function(i){t[i]=e[i]})}r.push(e)};this.setEarliestDts=function(e){a=e-t.timelineStartInfo.baseMediaDecodeTime};this.setVideoBaseMediaDecodeTime=function(e){o=e};this.setAudioAppendStart=function(e){s=e};this.flush=function(){var e,u,l,c;if(r.length===0){this.trigger("done","AudioSegmentStream");return}e=dl.trimAdtsFramesByEarliestDts(r,t,a);t.baseMediaDecodeTime=gl.calculateTrackBaseMediaDecodeTime(t,i.keepOriginalTimestamps);dl.prefixWithSilence(t,e,s,o);t.samples=dl.generateSampleTable(e);l=Ru.mdat(dl.concatenateFrameData(e));r=[];u=Ru.moof(n,[t]);c=new Uint8Array(u.byteLength+l.byteLength);n++;c.set(u);c.set(l,u.byteLength);gl.clearDtsInfo(t);this.trigger("data",{track:t,boxes:c});this.trigger("done","AudioSegmentStream")}};Lc.prototype=new Bu;Ac=function e(t,i){var r=0,n=[],a=[],s,o;i=i||{};Ac.prototype.init.call(this);delete t.minPTS;this.gopCache_=[];this.push=function(e){gl.collectDtsInfo(t,e);if(e.nalUnitType==="seq_parameter_set_rbsp"&&!s){s=e.config;t.sps=[e.data];Ec.forEach(function(e){t[e]=s[e]},this)}if(e.nalUnitType==="pic_parameter_set_rbsp"&&!o){o=e.data;t.pps=[e.data]}n.push(e)};this.flush=function(){var e,s,o,u,l,c,f=0,d,h;while(n.length){if(n[0].nalUnitType==="access_unit_delimiter_rbsp"){break}n.shift()}if(n.length===0){this.resetStream_();this.trigger("done","VideoSegmentStream");return}e=Wu.groupNalsIntoFrames(n);o=Wu.groupFramesIntoGops(e);if(!o[0][0].keyFrame){s=this.getGopForFusion_(n[0],t);if(s){f=s.duration;o.unshift(s);o.byteLength+=s.byteLength;o.nalCount+=s.nalCount;o.pts=s.pts;o.dts=s.dts;o.duration+=s.duration}else{o=Wu.extendFirstKeyFrame(o)}}if(a.length){var p;if(i.alignGopsAtEnd){p=this.alignGopsAtEnd_(o)}else{p=this.alignGopsAtStart_(o)}if(!p){this.gopCache_.unshift({gop:o.pop(),pps:t.pps,sps:t.sps});this.gopCache_.length=Math.min(6,this.gopCache_.length);n=[];this.resetStream_();this.trigger("done","VideoSegmentStream");return}gl.clearDtsInfo(t);o=p}gl.collectDtsInfo(t,o);t.samples=Wu.generateSampleTable(o);l=Ru.mdat(Wu.concatenateNalData(o));t.baseMediaDecodeTime=gl.calculateTrackBaseMediaDecodeTime(t,i.keepOriginalTimestamps);this.trigger("processedGopsInfo",o.map(function(e){return{pts:e.pts,dts:e.dts,byteLength:e.byteLength}}));d=o[0];h=o[o.length-1];this.trigger("segmentTimingInfo",Uc(t.baseMediaDecodeTime,d.dts,d.pts,h.dts+h.duration,h.pts+h.duration,f));this.gopCache_.unshift({gop:o.pop(),pps:t.pps,sps:t.sps});this.gopCache_.length=Math.min(6,this.gopCache_.length);n=[];this.trigger("baseMediaDecodeTime",t.baseMediaDecodeTime);this.trigger("timelineStartInfo",t.timelineStartInfo);u=Ru.moof(r,[t]);c=new Uint8Array(u.byteLength+l.byteLength);r++;c.set(u);c.set(l,u.byteLength);this.trigger("data",{track:t,boxes:c});this.resetStream_();this.trigger("done","VideoSegmentStream")};this.resetStream_=function(){gl.clearDtsInfo(t);s=undefined;o=undefined};this.getGopForFusion_=function(e){var i=45e3,r=1e4,n=Infinity,a,s,o,u,l;for(l=0;l<this.gopCache_.length;l++){u=this.gopCache_[l];o=u.gop;if(!(t.pps&&Oc(t.pps[0],u.pps[0]))||!(t.sps&&Oc(t.sps[0],u.sps[0]))){continue}if(o.dts<t.timelineStartInfo.dts){continue}a=e.dts-o.dts-o.duration;if(a>=-r&&a<=i){if(!s||n>a){s=u;n=a}}}if(s){return s.gop}return null};this.alignGopsAtStart_=function(e){var t,i,r,n,s,o,u,l;s=e.byteLength;o=e.nalCount;u=e.duration;t=i=0;while(t<a.length&&i<e.length){r=a[t];n=e[i];if(r.pts===n.pts){break}if(n.pts>r.pts){t++;continue}i++;s-=n.byteLength;o-=n.nalCount;u-=n.duration}if(i===0){return e}if(i===e.length){return null}l=e.slice(i);l.byteLength=s;l.duration=u;l.nalCount=o;l.pts=l[0].pts;l.dts=l[0].dts;return l};this.alignGopsAtEnd_=function(e){var t,i,r,n,s,o;t=a.length-1;i=e.length-1;s=null;o=false;while(t>=0&&i>=0){r=a[t];n=e[i];if(r.pts===n.pts){o=true;break}if(r.pts>n.pts){t--;continue}if(t===a.length-1){s=i}i--}if(!o&&s===null){return null}var u;if(o){u=i}else{u=s}if(u===0){return e}var l=e.slice(u);var c=l.reduce(function(e,t){e.byteLength+=t.byteLength;e.duration+=t.duration;e.nalCount+=t.nalCount;return e},{byteLength:0,duration:0,nalCount:0});l.byteLength=c.byteLength;l.duration=c.duration;l.nalCount=c.nalCount;l.pts=l[0].pts;l.dts=l[0].dts;return l};this.alignGopsWith=function(e){a=e}};Ac.prototype=new Bu;Pc=function e(t,i){this.numberOfTracks=0;this.metadataStream=i;t=t||{};if(typeof t.remux!=="undefined"){this.remuxTracks=!!t.remux}else{this.remuxTracks=true}if(typeof t.keepOriginalTimestamps==="boolean"){this.keepOriginalTimestamps=t.keepOriginalTimestamps}this.pendingTracks=[];this.videoTrack=null;this.pendingBoxes=[];this.pendingCaptions=[];this.pendingMetadata=[];this.pendingBytes=0;this.emittedTracks=0;Pc.prototype.init.call(this);this.push=function(e){if(e.text){return this.pendingCaptions.push(e)}if(e.frames){return this.pendingMetadata.push(e)}this.pendingTracks.push(e.track);this.pendingBoxes.push(e.boxes);this.pendingBytes+=e.boxes.byteLength;if(e.track.type==="video"){this.videoTrack=e.track}if(e.track.type==="audio"){this.audioTrack=e.track}}};Pc.prototype=new Bu;Pc.prototype.flush=function(e){var t=0,i={captions:[],captionStreams:{},metadata:[],info:{}},r,n,a,s=0,o;if(this.pendingTracks.length<this.numberOfTracks){if(e!=="VideoSegmentStream"&&e!=="AudioSegmentStream"){return}else if(this.remuxTracks){return}else if(this.pendingTracks.length===0){this.emittedTracks++;if(this.emittedTracks>=this.numberOfTracks){this.trigger("done");this.emittedTracks=0}return}}if(this.videoTrack){s=this.videoTrack.timelineStartInfo.pts;Ec.forEach(function(e){i.info[e]=this.videoTrack[e]},this)}else if(this.audioTrack){s=this.audioTrack.timelineStartInfo.pts;Cc.forEach(function(e){i.info[e]=this.audioTrack[e]},this)}if(this.pendingTracks.length===1){i.type=this.pendingTracks[0].type}else{i.type="combined"}this.emittedTracks+=this.pendingTracks.length;a=Ru.initSegment(this.pendingTracks);i.initSegment=new Uint8Array(a.byteLength);i.initSegment.set(a);i.data=new Uint8Array(this.pendingBytes);for(o=0;o<this.pendingBoxes.length;o++){i.data.set(this.pendingBoxes[o],t);t+=this.pendingBoxes[o].byteLength}for(o=0;o<this.pendingCaptions.length;o++){r=this.pendingCaptions[o];r.startTime=r.startPts;if(!this.keepOriginalTimestamps){r.startTime-=s}r.startTime/=9e4;r.endTime=r.endPts;if(!this.keepOriginalTimestamps){r.endTime-=s}r.endTime/=9e4;i.captionStreams[r.stream]=true;i.captions.push(r)}for(o=0;o<this.pendingMetadata.length;o++){n=this.pendingMetadata[o];n.cueTime=n.pts;if(!this.keepOriginalTimestamps){n.cueTime-=s}n.cueTime/=9e4;i.metadata.push(n)}i.metadata.dispatchType=this.metadataStream.dispatchType;this.pendingTracks.length=0;this.videoTrack=null;this.pendingBoxes.length=0;this.pendingCaptions.length=0;this.pendingBytes=0;this.pendingMetadata.length=0;this.trigger("data",i);if(this.emittedTracks>=this.numberOfTracks){this.trigger("done");this.emittedTracks=0}};Ic=function e(t){var i=this,r=true,n,a;Ic.prototype.init.call(this);t=t||{};this.baseMediaDecodeTime=t.baseMediaDecodeTime||0;this.transmuxPipeline_={};this.setupAacPipeline=function(){var e={};this.transmuxPipeline_=e;e.type="aac";e.metadataStream=new ec.MetadataStream;e.aacStream=new Sc;e.audioTimestampRolloverStream=new ec.TimestampRolloverStream("audio");e.timedMetadataTimestampRolloverStream=new ec.TimestampRolloverStream("timed-metadata");e.adtsStream=new rc;e.coalesceStream=new Pc(t,e.metadataStream);e.headOfPipeline=e.aacStream;e.aacStream.pipe(e.audioTimestampRolloverStream).pipe(e.adtsStream);e.aacStream.pipe(e.timedMetadataTimestampRolloverStream).pipe(e.metadataStream).pipe(e.coalesceStream);e.metadataStream.on("timestamp",function(t){e.aacStream.setTimestamp(t.timeStamp)});e.aacStream.on("data",function(r){if(r.type==="timed-metadata"&&!e.audioSegmentStream){a=a||{timelineStartInfo:{baseMediaDecodeTime:i.baseMediaDecodeTime},codec:"adts",type:"audio"};e.coalesceStream.numberOfTracks++;e.audioSegmentStream=new Lc(a,t);e.adtsStream.pipe(e.audioSegmentStream).pipe(e.coalesceStream)}});e.coalesceStream.on("data",this.trigger.bind(this,"data"));e.coalesceStream.on("done",this.trigger.bind(this,"done"))};this.setupTsPipeline=function(){var e={};this.transmuxPipeline_=e;e.type="ts";e.metadataStream=new ec.MetadataStream;e.packetStream=new ec.TransportPacketStream;e.parseStream=new ec.TransportParseStream;e.elementaryStream=new ec.ElementaryStream;e.videoTimestampRolloverStream=new ec.TimestampRolloverStream("video");e.audioTimestampRolloverStream=new ec.TimestampRolloverStream("audio");e.timedMetadataTimestampRolloverStream=new ec.TimestampRolloverStream("timed-metadata");e.adtsStream=new rc;e.h264Stream=new kc;e.captionStream=new ec.CaptionStream;e.coalesceStream=new Pc(t,e.metadataStream);e.headOfPipeline=e.packetStream;e.packetStream.pipe(e.parseStream).pipe(e.elementaryStream);e.elementaryStream.pipe(e.videoTimestampRolloverStream).pipe(e.h264Stream);e.elementaryStream.pipe(e.audioTimestampRolloverStream).pipe(e.adtsStream);e.elementaryStream.pipe(e.timedMetadataTimestampRolloverStream).pipe(e.metadataStream).pipe(e.coalesceStream);e.h264Stream.pipe(e.captionStream).pipe(e.coalesceStream);e.elementaryStream.on("data",function(r){var s;if(r.type==="metadata"){s=r.tracks.length;while(s--){if(!n&&r.tracks[s].type==="video"){n=r.tracks[s];n.timelineStartInfo.baseMediaDecodeTime=i.baseMediaDecodeTime}else if(!a&&r.tracks[s].type==="audio"){a=r.tracks[s];a.timelineStartInfo.baseMediaDecodeTime=i.baseMediaDecodeTime}}if(n&&!e.videoSegmentStream){e.coalesceStream.numberOfTracks++;e.videoSegmentStream=new Ac(n,t);e.videoSegmentStream.on("timelineStartInfo",function(t){if(a){a.timelineStartInfo=t;e.audioSegmentStream.setEarliestDts(t.dts)}});e.videoSegmentStream.on("processedGopsInfo",i.trigger.bind(i,"gopInfo"));e.videoSegmentStream.on("segmentTimingInfo",i.trigger.bind(i,"videoSegmentTimingInfo"));e.videoSegmentStream.on("baseMediaDecodeTime",function(t){if(a){e.audioSegmentStream.setVideoBaseMediaDecodeTime(t)}});e.h264Stream.pipe(e.videoSegmentStream).pipe(e.coalesceStream)}if(a&&!e.audioSegmentStream){e.coalesceStream.numberOfTracks++;e.audioSegmentStream=new Lc(a,t);e.adtsStream.pipe(e.audioSegmentStream).pipe(e.coalesceStream)}}});e.coalesceStream.on("data",this.trigger.bind(this,"data"));e.coalesceStream.on("done",this.trigger.bind(this,"done"))};this.setBaseMediaDecodeTime=function(e){var i=this.transmuxPipeline_;if(!t.keepOriginalTimestamps){this.baseMediaDecodeTime=e}if(a){a.timelineStartInfo.dts=undefined;a.timelineStartInfo.pts=undefined;gl.clearDtsInfo(a);if(!t.keepOriginalTimestamps){a.timelineStartInfo.baseMediaDecodeTime=e}if(i.audioTimestampRolloverStream){i.audioTimestampRolloverStream.discontinuity()}}if(n){if(i.videoSegmentStream){i.videoSegmentStream.gopCache_=[];i.videoTimestampRolloverStream.discontinuity()}n.timelineStartInfo.dts=undefined;n.timelineStartInfo.pts=undefined;gl.clearDtsInfo(n);i.captionStream.reset();if(!t.keepOriginalTimestamps){n.timelineStartInfo.baseMediaDecodeTime=e}}if(i.timedMetadataTimestampRolloverStream){i.timedMetadataTimestampRolloverStream.discontinuity()}};this.setAudioAppendStart=function(e){if(a){this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(e)}};this.alignGopsWith=function(e){if(n&&this.transmuxPipeline_.videoSegmentStream){this.transmuxPipeline_.videoSegmentStream.alignGopsWith(e)}};this.push=function(e){if(r){var t=wc(e);if(t&&this.transmuxPipeline_.type!=="aac"){this.setupAacPipeline()}else if(!t&&this.transmuxPipeline_.type!=="ts"){this.setupTsPipeline()}r=false}this.transmuxPipeline_.headOfPipeline.push(e)};this.flush=function(){r=true;this.transmuxPipeline_.headOfPipeline.flush()};this.resetCaptions=function(){if(this.transmuxPipeline_.captionStream){this.transmuxPipeline_.captionStream.reset()}}};Ic.prototype=new Bu;var Dc={Transmuxer:Ic,VideoSegmentStream:Ac,AudioSegmentStream:Lc,AUDIO_PROPERTIES:Cc,VIDEO_PROPERTIES:Ec,generateVideoSegmentTimingInfo:Uc};var xc,Rc,Mc=Qo.parseType,Bc=function e(t){return new Date(t*1e3-20828448e5)},Nc=function e(t){return{isLeading:(t[0]&12)>>>2,dependsOn:t[0]&3,isDependedOn:(t[1]&192)>>>6,hasRedundancy:(t[1]&48)>>>4,paddingValue:(t[1]&14)>>>1,isNonSyncSample:t[1]&1,degradationPriority:t[2]<<8|t[3]}},jc=function e(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength),r=[],n,a;for(n=0;n+4<t.length;n+=a){a=i.getUint32(n);n+=4;if(a<=0){r.push("<span style='color:red;'>MALFORMED DATA</span>");continue}switch(t[n]&31){case 1:r.push("slice_layer_without_partitioning_rbsp");break;case 5:r.push("slice_layer_without_partitioning_rbsp_idr");break;case 6:r.push("sei_rbsp");break;case 7:r.push("seq_parameter_set_rbsp");break;case 8:r.push("pic_parameter_set_rbsp");break;case 9:r.push("access_unit_delimiter_rbsp");break;default:r.push("UNKNOWN NAL - "+t[n]&31);break}}return r},Fc={avc1:function e(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength);return{dataReferenceIndex:i.getUint16(6),width:i.getUint16(24),height:i.getUint16(26),horizresolution:i.getUint16(28)+i.getUint16(30)/16,vertresolution:i.getUint16(32)+i.getUint16(34)/16,frameCount:i.getUint16(40),depth:i.getUint16(74),config:xc(t.subarray(78,t.byteLength))}},avcC:function e(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength),r={configurationVersion:t[0],avcProfileIndication:t[1],profileCompatibility:t[2],avcLevelIndication:t[3],lengthSizeMinusOne:t[4]&3,sps:[],pps:[]},n=t[5]&31,a,s,o,u;o=6;for(u=0;u<n;u++){s=i.getUint16(o);o+=2;r.sps.push(new Uint8Array(t.subarray(o,o+s)));o+=s}a=t[o];o++;for(u=0;u<a;u++){s=i.getUint16(o);o+=2;r.pps.push(new Uint8Array(t.subarray(o,o+s)));o+=s}return r},btrt:function e(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength);return{bufferSizeDB:i.getUint32(0),maxBitrate:i.getUint32(4),avgBitrate:i.getUint32(8)}},esds:function e(t){return{version:t[0],flags:new Uint8Array(t.subarray(1,4)),esId:t[6]<<8|t[7],streamPriority:t[8]&31,decoderConfig:{objectProfileIndication:t[11],streamType:t[12]>>>2&63,bufferSize:t[13]<<16|t[14]<<8|t[15],maxBitrate:t[16]<<24|t[17]<<16|t[18]<<8|t[19],avgBitrate:t[20]<<24|t[21]<<16|t[22]<<8|t[23],decoderConfigDescriptor:{tag:t[24],length:t[25],audioObjectType:t[26]>>>3&31,samplingFrequencyIndex:(t[26]&7)<<1|t[27]>>>7&1,channelConfiguration:t[27]>>>3&15}}}},ftyp:function e(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength),r={majorBrand:Mc(t.subarray(0,4)),minorVersion:i.getUint32(4),compatibleBrands:[]},n=8;while(n<t.byteLength){r.compatibleBrands.push(Mc(t.subarray(n,n+4)));n+=4}return r},dinf:function e(t){return{boxes:xc(t)}},dref:function e(t){return{version:t[0],flags:new Uint8Array(t.subarray(1,4)),dataReferences:xc(t.subarray(8))}},hdlr:function e(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength),r={version:i.getUint8(0),flags:new Uint8Array(t.subarray(1,4)),handlerType:Mc(t.subarray(8,12)),name:""},n=8;for(n=24;n<t.byteLength;n++){if(t[n]===0){n++;break}r.name+=String.fromCharCode(t[n])}r.name=decodeURIComponent(escape(r.name));return r},mdat:function e(t){return{byteLength:t.byteLength,nals:jc(t)}},mdhd:function e(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength),r=4,n,a={version:i.getUint8(0),flags:new Uint8Array(t.subarray(1,4)),language:""};if(a.version===1){r+=4;a.creationTime=Bc(i.getUint32(r));r+=8;a.modificationTime=Bc(i.getUint32(r));r+=4;a.timescale=i.getUint32(r);r+=8;a.duration=i.getUint32(r)}else{a.creationTime=Bc(i.getUint32(r));r+=4;a.modificationTime=Bc(i.getUint32(r));r+=4;a.timescale=i.getUint32(r);r+=4;a.duration=i.getUint32(r)}r+=4;n=i.getUint16(r);a.language+=String.fromCharCode((n>>10)+96);a.language+=String.fromCharCode(((n&992)>>5)+96);a.language+=String.fromCharCode((n&31)+96);return a},mdia:function e(t){return{boxes:xc(t)}},mfhd:function e(t){return{version:t[0],flags:new Uint8Array(t.subarray(1,4)),sequenceNumber:t[4]<<24|t[5]<<16|t[6]<<8|t[7]}},minf:function e(t){return{boxes:xc(t)}},mp4a:function e(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength),r={dataReferenceIndex:i.getUint16(6),channelcount:i.getUint16(16),samplesize:i.getUint16(18),samplerate:i.getUint16(24)+i.getUint16(26)/65536};if(t.byteLength>28){r.streamDescriptor=xc(t.subarray(28))[0]}return r},moof:function e(t){return{boxes:xc(t)}},moov:function e(t){return{boxes:xc(t)}},mvex:function e(t){return{boxes:xc(t)}},mvhd:function e(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength),r=4,n={version:i.getUint8(0),flags:new Uint8Array(t.subarray(1,4))};if(n.version===1){r+=4;n.creationTime=Bc(i.getUint32(r));r+=8;n.modificationTime=Bc(i.getUint32(r));r+=4;n.timescale=i.getUint32(r);r+=8;n.duration=i.getUint32(r)}else{n.creationTime=Bc(i.getUint32(r));r+=4;n.modificationTime=Bc(i.getUint32(r));r+=4;n.timescale=i.getUint32(r);r+=4;n.duration=i.getUint32(r)}r+=4;n.rate=i.getUint16(r)+i.getUint16(r+2)/16;r+=4;n.volume=i.getUint8(r)+i.getUint8(r+1)/8;r+=2;r+=2;r+=2*4;n.matrix=new Uint32Array(t.subarray(r,r+9*4));r+=9*4;r+=6*4;n.nextTrackId=i.getUint32(r);return n},pdin:function e(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength);return{version:i.getUint8(0),flags:new Uint8Array(t.subarray(1,4)),rate:i.getUint32(4),initialDelay:i.getUint32(8)}},sdtp:function e(t){var i={version:t[0],flags:new Uint8Array(t.subarray(1,4)),samples:[]},r;for(r=4;r<t.byteLength;r++){i.samples.push({dependsOn:(t[r]&48)>>4,isDependedOn:(t[r]&12)>>2,hasRedundancy:t[r]&3})}return i},sidx:function e(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength),r={version:t[0],flags:new Uint8Array(t.subarray(1,4)),references:[],referenceId:i.getUint32(4),timescale:i.getUint32(8),earliestPresentationTime:i.getUint32(12),firstOffset:i.getUint32(16)},n=i.getUint16(22),a;for(a=24;n;a+=12,n--){r.references.push({referenceType:(t[a]&128)>>>7,referencedSize:i.getUint32(a)&2147483647,subsegmentDuration:i.getUint32(a+4),startsWithSap:!!(t[a+8]&128),sapType:(t[a+8]&112)>>>4,sapDeltaTime:i.getUint32(a+8)&268435455})}return r},smhd:function e(t){return{version:t[0],flags:new Uint8Array(t.subarray(1,4)),balance:t[4]+t[5]/256}},stbl:function e(t){return{boxes:xc(t)}},stco:function e(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength),r={version:t[0],flags:new Uint8Array(t.subarray(1,4)),chunkOffsets:[]},n=i.getUint32(4),a;for(a=8;n;a+=4,n--){r.chunkOffsets.push(i.getUint32(a))}return r},stsc:function e(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength),r=i.getUint32(4),n={version:t[0],flags:new Uint8Array(t.subarray(1,4)),sampleToChunks:[]},a;for(a=8;r;a+=12,r--){n.sampleToChunks.push({firstChunk:i.getUint32(a),samplesPerChunk:i.getUint32(a+4),sampleDescriptionIndex:i.getUint32(a+8)})}return n},stsd:function e(t){return{version:t[0],flags:new Uint8Array(t.subarray(1,4)),sampleDescriptions:xc(t.subarray(8))}},stsz:function e(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength),r={version:t[0],flags:new Uint8Array(t.subarray(1,4)),sampleSize:i.getUint32(4),entries:[]},n;for(n=12;n<t.byteLength;n+=4){r.entries.push(i.getUint32(n))}return r},stts:function e(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength),r={version:t[0],flags:new Uint8Array(t.subarray(1,4)),timeToSamples:[]},n=i.getUint32(4),a;for(a=8;n;a+=8,n--){r.timeToSamples.push({sampleCount:i.getUint32(a),sampleDelta:i.getUint32(a+4)})}return r},styp:function e(t){return Fc.ftyp(t)},tfdt:function e(t){var i={version:t[0],flags:new Uint8Array(t.subarray(1,4)),baseMediaDecodeTime:t[4]<<24|t[5]<<16|t[6]<<8|t[7]};if(i.version===1){i.baseMediaDecodeTime*=Math.pow(2,32);i.baseMediaDecodeTime+=t[8]<<24|t[9]<<16|t[10]<<8|t[11]}return i},tfhd:function e(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength),r={version:t[0],flags:new Uint8Array(t.subarray(1,4)),trackId:i.getUint32(4)},n=r.flags[2]&1,a=r.flags[2]&2,s=r.flags[2]&8,o=r.flags[2]&16,u=r.flags[2]&32,l=r.flags[0]&65536,c=r.flags[0]&131072,f;f=8;if(n){f+=4;r.baseDataOffset=i.getUint32(12);f+=4}if(a){r.sampleDescriptionIndex=i.getUint32(f);f+=4}if(s){r.defaultSampleDuration=i.getUint32(f);f+=4}if(o){r.defaultSampleSize=i.getUint32(f);f+=4}if(u){r.defaultSampleFlags=i.getUint32(f)}if(l){r.durationIsEmpty=true}if(!n&&c){r.baseDataOffsetIsMoof=true}return r},tkhd:function e(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength),r=4,n={version:i.getUint8(0),flags:new Uint8Array(t.subarray(1,4))};if(n.version===1){r+=4;n.creationTime=Bc(i.getUint32(r));r+=8;n.modificationTime=Bc(i.getUint32(r));r+=4;n.trackId=i.getUint32(r);r+=4;r+=8;n.duration=i.getUint32(r)}else{n.creationTime=Bc(i.getUint32(r));r+=4;n.modificationTime=Bc(i.getUint32(r));r+=4;n.trackId=i.getUint32(r);r+=4;r+=4;n.duration=i.getUint32(r)}r+=4;r+=2*4;n.layer=i.getUint16(r);r+=2;n.alternateGroup=i.getUint16(r);r+=2;n.volume=i.getUint8(r)+i.getUint8(r+1)/8;r+=2;r+=2;n.matrix=new Uint32Array(t.subarray(r,r+9*4));r+=9*4;n.width=i.getUint16(r)+i.getUint16(r+2)/16;r+=4;n.height=i.getUint16(r)+i.getUint16(r+2)/16;return n},traf:function e(t){return{boxes:xc(t)}},trak:function e(t){return{boxes:xc(t)}},trex:function e(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength);return{version:t[0],flags:new Uint8Array(t.subarray(1,4)),trackId:i.getUint32(4),defaultSampleDescriptionIndex:i.getUint32(8),defaultSampleDuration:i.getUint32(12),defaultSampleSize:i.getUint32(16),sampleDependsOn:t[20]&3,sampleIsDependedOn:(t[21]&192)>>6,sampleHasRedundancy:(t[21]&48)>>4,samplePaddingValue:(t[21]&14)>>1,sampleIsDifferenceSample:!!(t[21]&1),sampleDegradationPriority:i.getUint16(22)}},trun:function e(t){var i={version:t[0],flags:new Uint8Array(t.subarray(1,4)),samples:[]},r=new DataView(t.buffer,t.byteOffset,t.byteLength),n=i.flags[2]&1,a=i.flags[2]&4,s=i.flags[1]&1,o=i.flags[1]&2,u=i.flags[1]&4,l=i.flags[1]&8,c=r.getUint32(4),f=8,d;if(n){i.dataOffset=r.getInt32(f);f+=4}if(a&&c){d={flags:Nc(t.subarray(f,f+4))};f+=4;if(s){d.duration=r.getUint32(f);f+=4}if(o){d.size=r.getUint32(f);f+=4}if(l){d.compositionTimeOffset=r.getUint32(f);f+=4}i.samples.push(d);c--}while(c--){d={};if(s){d.duration=r.getUint32(f);f+=4}if(o){d.size=r.getUint32(f);f+=4}if(u){d.flags=Nc(t.subarray(f,f+4));f+=4}if(l){d.compositionTimeOffset=r.getUint32(f);f+=4}i.samples.push(d)}return i},"url ":function e(t){return{version:t[0],flags:new Uint8Array(t.subarray(1,4))}},vmhd:function e(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength);return{version:t[0],flags:new Uint8Array(t.subarray(1,4)),graphicsmode:i.getUint16(4),opcolor:new Uint16Array([i.getUint16(6),i.getUint16(8),i.getUint16(10)])}}};xc=function e(t){var i=0,r=[],n,a,s,o,u;var l=new ArrayBuffer(t.length);var c=new Uint8Array(l);for(var f=0;f<t.length;++f){c[f]=t[f]}n=new DataView(l);while(i<t.byteLength){a=n.getUint32(i);s=Mc(t.subarray(i+4,i+8));o=a>1?i+a:t.byteLength;u=(Fc[s]||function(e){return{data:e}})(t.subarray(i+8,o));u.size=a;u.type=s;r.push(u);i=o}return r};Rc=function e(t,i){var r;i=i||0;r=new Array(i*2+1).join(" ");return t.map(function(e,t){return r+e.type+"\n"+Object.keys(e).filter(function(e){return e!=="type"&&e!=="boxes"}).map(function(t){var i=r+" "+t+": ",n=e[t];if(n instanceof Uint8Array||n instanceof Uint32Array){var a=Array.prototype.slice.call(new Uint8Array(n.buffer,n.byteOffset,n.byteLength)).map(function(e){return" "+("00"+e.toString(16)).slice(-2)}).join("").match(/.{1,24}/g);if(!a){return i+"<>"}if(a.length===1){return i+"<"+a.join("").slice(1)+">"}return i+"<\n"+a.map(function(e){return r+" "+e}).join("\n")+"\n"+r+" >"}return i+JSON.stringify(n,null,2).split("\n").map(function(e,t){if(t===0){return e}return r+" "+e}).join("\n")}).join("\n")+(e.boxes?"\n"+Rc(e.boxes,i+1):"")}).join("\n")};var Vc={inspect:xc,textify:Rc,parseTfdt:Fc.tfdt,parseHdlr:Fc.hdlr,parseTfhd:Fc.tfhd,parseTrun:Fc.trun,parseSidx:Fc.sidx};var Hc=wl.discardEmulationPreventionBytes;var qc=Ul.CaptionStream;var zc=function e(t,i){var r=t;for(var n=0;n<i.length;n++){var a=i[n];if(r<a.size){return a}r-=a.size}return null};var Wc=function e(t,i,r){var n=new DataView(t.buffer,t.byteOffset,t.byteLength),a=[],s,o,u,l;for(o=0;o+4<t.length;o+=u){u=n.getUint32(o);o+=4;if(u<=0){continue}switch(t[o]&31){case 6:var c=t.subarray(o+1,o+1+u);var f=zc(o,i);s={nalUnitType:"sei_rbsp",size:u,data:c,escapedRBSP:Hc(c),trackId:r};if(f){s.pts=f.pts;s.dts=f.dts;l=f}else{s.pts=l.pts;s.dts=l.dts}a.push(s);break;default:break}}return a};var Gc=function e(t,i,r){var n=i;var a=r.defaultSampleDuration||0;var s=r.defaultSampleSize||0;var o=r.trackId;var u=[];t.forEach(function(e){var t=Vc.parseTrun(e);var i=t.samples;i.forEach(function(e){if(e.duration===undefined){e.duration=a}if(e.size===undefined){e.size=s}e.trackId=o;e.dts=n;if(e.compositionTimeOffset===undefined){e.compositionTimeOffset=0}e.pts=n+e.compositionTimeOffset;n+=e.duration});u=u.concat(i)});return u};var Xc=function e(t,i){var r=Qo.findBox(t,["moof","traf"]);var n=Qo.findBox(t,["mdat"]);var a={};var s=[];n.forEach(function(e,t){var i=r[t];s.push({mdat:e,traf:i})});s.forEach(function(e){var t=e.mdat;var r=e.traf;var n=Qo.findBox(r,["tfhd"]);var s=Vc.parseTfhd(n[0]);var o=s.trackId;var u=Qo.findBox(r,["tfdt"]);var l=u.length>0?Vc.parseTfdt(u[0]).baseMediaDecodeTime:0;var c=Qo.findBox(r,["trun"]);var f;var d;if(i===o&&c.length>0){f=Gc(c,l,s);d=Wc(t,f,o);if(!a[o]){a[o]=[]}a[o]=a[o].concat(d)}});return a};var Yc=function e(t,i,r){var n;if(!i){return null}n=Xc(t,i);return{seiNals:n[i],timescale:r}};var Kc=function e(){var t=false;var i;var r;var n;var a;var s;this.isInitialized=function(){return t};this.init=function(){i=new qc;t=true;i.on("data",function(e){e.startTime=e.startPts/a;e.endTime=e.endPts/a;s.captions.push(e);s.captionStreams[e.stream]=true})};this.isNewInit=function(e,t){if(e&&e.length===0||t&&typeof t==="object"&&Object.keys(t).length===0){return false}return n!==e[0]||a!==t[n]};this.parse=function(e,t,i){var o;if(!this.isInitialized()){return null}else if(!t||!i){return null}else if(this.isNewInit(t,i)){n=t[0];a=i[n]}else if(!n||!a){r.push(e);return null}while(r.length>0){var u=r.shift();this.parse(u,t,i)}o=Yc(e,n,a);if(o===null||!o.seiNals){return null}this.pushNals(o.seiNals);this.flushStream();return s};this.pushNals=function(e){if(!this.isInitialized()||!e||e.length===0){return null}e.forEach(function(e){i.push(e)})};this.flushStream=function(){if(!this.isInitialized()){return null}i.flush()};this.clearParsedCaptions=function(){s.captions=[];s.captionStreams={}};this.resetCaptionStream=function(){if(!this.isInitialized()){return null}i.reset()};this.clearAllCaptions=function(){this.clearParsedCaptions();this.resetCaptionStream()};this.reset=function(){r=[];n=null;a=null;if(!s){s={captions:[],captionStreams:{}}}else{this.clearParsedCaptions()}this.resetCaptionStream()};this.reset()};var $c=Kc;var Qc={generator:Ru,probe:Qo,Transmuxer:Dc.Transmuxer,AudioSegmentStream:Dc.AudioSegmentStream,VideoSegmentStream:Dc.VideoSegmentStream,CaptionParser:$c};var Jc=Qc.CaptionParser;var Zc=function e(t){var i=t[1]&31;i<<=8;i|=t[2];return i};var ef=function e(t){return!!(t[1]&64)};var tf=function e(t){var i=0;if((t[3]&48)>>>4>1){i+=t[4]+1}return i};var rf=function e(t,i){var r=Zc(t);if(r===0){return"pat"}else if(r===i){return"pmt"}else if(i){return"pes"}return null};var nf=function e(t){var i=ef(t);var r=4+tf(t);if(i){r+=t[r]+1}return(t[r+10]&31)<<8|t[r+11]};var af=function e(t){var i={};var r=ef(t);var n=4+tf(t);if(r){n+=t[n]+1}if(!(t[n+5]&1)){return}var a,s,o;a=(t[n+1]&15)<<8|t[n+2];s=3+a-4;o=(t[n+10]&15)<<8|t[n+11];var u=12+o;while(u<s){var l=n+u;i[(t[l+1]&31)<<8|t[l+2]]=t[l];u+=((t[l+3]&15)<<8|t[l+4])+5}return i};var sf=function e(t,i){var r=Zc(t);var n=i[r];switch(n){case Dl.H264_STREAM_TYPE:return"video";case Dl.ADTS_STREAM_TYPE:return"audio";case Dl.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}};var of=function e(t){var i=ef(t);if(!i){return null}var r=4+tf(t);if(r>=t.byteLength){return null}var n=null;var a;a=t[r+7];if(a&192){n={};n.pts=(t[r+9]&14)<<27|(t[r+10]&255)<<20|(t[r+11]&254)<<12|(t[r+12]&255)<<5|(t[r+13]&254)>>>3;n.pts*=4;n.pts+=(t[r+13]&6)>>>1;n.dts=n.pts;if(a&64){n.dts=(t[r+14]&14)<<27|(t[r+15]&255)<<20|(t[r+16]&254)<<12|(t[r+17]&255)<<5|(t[r+18]&254)>>>3;n.dts*=4;n.dts+=(t[r+18]&6)>>>1}}return n};var uf=function e(t){switch(t){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}};var lf=function e(t){var i=4+tf(t);var r=t.subarray(i);var n=0;var a=0;var s=false;var o;for(;a<r.byteLength-3;a++){if(r[a+2]===1){n=a+5;break}}while(n<r.byteLength){switch(r[n]){case 0:if(r[n-1]!==0){n+=2;break}else if(r[n-2]!==0){n++;break}if(a+3!==n-2){o=uf(r[a+3]&31);if(o==="slice_layer_without_partitioning_rbsp_idr"){s=true}}do{n++}while(r[n]!==1&&n<r.length);a=n-2;n+=3;break;case 1:if(r[n-1]!==0||r[n-2]!==0){n+=3;break}o=uf(r[a+3]&31);if(o==="slice_layer_without_partitioning_rbsp_idr"){s=true}a=n-2;n+=3;break;default:n+=3;break}}r=r.subarray(a);n-=a;a=0;if(r&&r.byteLength>3){o=uf(r[a+3]&31);if(o==="slice_layer_without_partitioning_rbsp_idr"){s=true}}return s};var cf={parseType:rf,parsePat:nf,parsePmt:af,parsePayloadUnitStartIndicator:ef,parsePesType:sf,parsePesTime:of,videoPacketContainsKeyFrame:lf};var ff=Nl.handleRollover;var df={};df.ts=cf;df.aac=bc;var hf=9e4,pf=188,mf=71;var vf=function e(t,i){var r=0,n=pf,a,s;while(n<t.byteLength){if(t[r]===mf&&t[n]===mf){a=t.subarray(r,n);s=df.ts.parseType(a,i.pid);switch(s){case"pat":if(!i.pid){i.pid=df.ts.parsePat(a)}break;case"pmt":if(!i.table){i.table=df.ts.parsePmt(a)}break;default:break}if(i.pid&&i.table){return}r+=pf;n+=pf;continue}r++;n++}};var gf=function e(t,i,r){var n=0,a=pf,s,o,u,l,c;var f=false;while(a<=t.byteLength){if(t[n]===mf&&(t[a]===mf||a===t.byteLength)){s=t.subarray(n,a);o=df.ts.parseType(s,i.pid);switch(o){case"pes":u=df.ts.parsePesType(s,i.table);l=df.ts.parsePayloadUnitStartIndicator(s);if(u==="audio"&&l){c=df.ts.parsePesTime(s);if(c){c.type="audio";r.audio.push(c);f=true}}break;default:break}if(f){break}n+=pf;a+=pf;continue}n++;a++}a=t.byteLength;n=a-pf;f=false;while(n>=0){if(t[n]===mf&&(t[a]===mf||a===t.byteLength)){s=t.subarray(n,a);o=df.ts.parseType(s,i.pid);switch(o){case"pes":u=df.ts.parsePesType(s,i.table);l=df.ts.parsePayloadUnitStartIndicator(s);if(u==="audio"&&l){c=df.ts.parsePesTime(s);if(c){c.type="audio";r.audio.push(c);f=true}}break;default:break}if(f){break}n-=pf;a-=pf;continue}n--;a--}};var yf=function e(t,i,r){var n=0,a=pf,s,o,u,l,c,f,d,h;var p=false;var m={data:[],size:0};while(a<t.byteLength){if(t[n]===mf&&t[a]===mf){s=t.subarray(n,a);o=df.ts.parseType(s,i.pid);switch(o){case"pes":u=df.ts.parsePesType(s,i.table);l=df.ts.parsePayloadUnitStartIndicator(s);if(u==="video"){if(l&&!p){c=df.ts.parsePesTime(s);if(c){c.type="video";r.video.push(c);p=true}}if(!r.firstKeyFrame){if(l){if(m.size!==0){f=new Uint8Array(m.size);d=0;while(m.data.length){h=m.data.shift();f.set(h,d);d+=h.byteLength}if(df.ts.videoPacketContainsKeyFrame(f)){r.firstKeyFrame=df.ts.parsePesTime(f);r.firstKeyFrame.type="video"}m.size=0}}m.data.push(s);m.size+=s.byteLength}}break;default:break}if(p&&r.firstKeyFrame){break}n+=pf;a+=pf;continue}n++;a++}a=t.byteLength;n=a-pf;p=false;while(n>=0){if(t[n]===mf&&t[a]===mf){s=t.subarray(n,a);o=df.ts.parseType(s,i.pid);switch(o){case"pes":u=df.ts.parsePesType(s,i.table);l=df.ts.parsePayloadUnitStartIndicator(s);if(u==="video"&&l){c=df.ts.parsePesTime(s);if(c){c.type="video";r.video.push(c);p=true}}break;default:break}if(p){break}n-=pf;a-=pf;continue}n--;a--}};var _f=function e(t,i){if(t.audio&&t.audio.length){var r=i;if(typeof r==="undefined"){r=t.audio[0].dts}t.audio.forEach(function(e){e.dts=ff(e.dts,r);e.pts=ff(e.pts,r);e.dtsTime=e.dts/hf;e.ptsTime=e.pts/hf})}if(t.video&&t.video.length){var n=i;if(typeof n==="undefined"){n=t.video[0].dts}t.video.forEach(function(e){e.dts=ff(e.dts,n);e.pts=ff(e.pts,n);e.dtsTime=e.dts/hf;e.ptsTime=e.pts/hf});if(t.firstKeyFrame){var a=t.firstKeyFrame;a.dts=ff(a.dts,n);a.pts=ff(a.pts,n);a.dtsTime=a.dts/hf;a.ptsTime=a.dts/hf}}};var bf=function e(t){var i=false,r=0,n=null,a=null,s=0,o=0,u;while(t.length-o>=3){var l=df.aac.parseType(t,o);switch(l){case"timed-metadata":if(t.length-o<10){i=true;break}s=df.aac.parseId3TagSize(t,o);if(s>t.length){i=true;break}if(a===null){u=t.subarray(o,o+s);a=df.aac.parseAacTimestamp(u)}o+=s;break;case"audio":if(t.length-o<7){i=true;break}s=df.aac.parseAdtsSize(t,o);if(s>t.length){i=true;break}if(n===null){u=t.subarray(o,o+s);n=df.aac.parseSampleRate(u)}r++;o+=s;break;default:o++;break}if(i){return null}}if(n===null||a===null){return null}var c=hf/n;var f={audio:[{type:"audio",dts:a,pts:a},{type:"audio",dts:a+r*1024*c,pts:a+r*1024*c}]};return f};var Tf=function e(t){var i={pid:null,table:null};var r={};vf(t,i);for(var n in i.table){if(i.table.hasOwnProperty(n)){var a=i.table[n];switch(a){case Dl.H264_STREAM_TYPE:r.video=[];yf(t,i,r);if(r.video.length===0){delete r.video}break;case Dl.ADTS_STREAM_TYPE:r.audio=[];gf(t,i,r);if(r.audio.length===0){delete r.audio}break;default:break}}}return r};var Sf=function e(t,i){var r=df.aac.isLikelyAacData(t);var n;if(r){n=bf(t)}else{n=Tf(t)}if(!n||!n.audio&&!n.video){return null}_f(n,i);return n};var kf={inspect:Sf,parseAudioPes_:gf};function wf(e){return e.subarray(0,e.byteLength-e[e.byteLength-1])}var Cf=function e(t,i){if(!(t instanceof i)){throw new TypeError("Cannot call a class as a function")}};var Ef=function(){function e(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||false;r.configurable=true;if("value"in r)r.writable=true;Object.defineProperty(e,r.key,r)}}return function(t,i,r){if(i)e(t.prototype,i);if(r)e(t,r);return t}}();var Af=function e(t,i){if(typeof i!=="function"&&i!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof i)}t.prototype=Object.create(i&&i.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}});if(i)Object.setPrototypeOf?Object.setPrototypeOf(t,i):t.__proto__=i};var Lf=function e(t,i){if(!t){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return i&&(typeof i==="object"||typeof i==="function")?i:t};var If=function e(){var t=[[[],[],[],[],[]],[[],[],[],[],[]]];var i=t[0];var r=t[1];var n=i[4];var a=r[4];var s=void 0;var o=void 0;var u=void 0;var l=[];var c=[];var f=void 0;var d=void 0;var h=void 0;var p=void 0;var m=void 0;var v=void 0;for(s=0;s<256;s++){c[(l[s]=s<<1^(s>>7)*283)^s]=s}for(o=u=0;!n[o];o^=f||1,u=c[u]||1){p=u^u<<1^u<<2^u<<3^u<<4;p=p>>8^p&255^99;n[o]=p;a[p]=o;h=l[d=l[f=l[o]]];v=h*16843009^d*65537^f*257^o*16843008;m=l[p]*257^p*16843008;for(s=0;s<4;s++){i[s][o]=m=m<<24^m>>>8;r[s][p]=v=v<<24^v>>>8}}for(s=0;s<5;s++){i[s]=i[s].slice(0);r[s]=r[s].slice(0)}return t};var Pf=null;var Of=function(){function e(t){Cf(this,e);if(!Pf){Pf=If()}this._tables=[[Pf[0][0].slice(),Pf[0][1].slice(),Pf[0][2].slice(),Pf[0][3].slice(),Pf[0][4].slice()],[Pf[1][0].slice(),Pf[1][1].slice(),Pf[1][2].slice(),Pf[1][3].slice(),Pf[1][4].slice()]];var i=void 0;var r=void 0;var n=void 0;var a=void 0;var s=void 0;var o=this._tables[0][4];var u=this._tables[1];var l=t.length;var c=1;if(l!==4&&l!==6&&l!==8){throw new Error("Invalid aes key size")}a=t.slice(0);s=[];this._key=[a,s];for(i=l;i<4*l+28;i++){n=a[i-1];if(i%l===0||l===8&&i%l===4){n=o[n>>>24]<<24^o[n>>16&255]<<16^o[n>>8&255]<<8^o[n&255];if(i%l===0){n=n<<8^n>>>24^c<<24;c=c<<1^(c>>7)*283}}a[i]=a[i-l]^n}for(r=0;i;r++,i--){n=a[r&3?i:i-4];if(i<=4||r<4){s[r]=n}else{s[r]=u[0][o[n>>>24]]^u[1][o[n>>16&255]]^u[2][o[n>>8&255]]^u[3][o[n&255]]}}}e.prototype.decrypt=function e(t,i,r,n,a,s){var o=this._key[1];var u=t^o[0];var l=n^o[1];var c=r^o[2];var f=i^o[3];var d=void 0;var h=void 0;var p=void 0;var m=o.length/4-2;var v=void 0;var g=4;var y=this._tables[1];var _=y[0];var b=y[1];var T=y[2];var S=y[3];var k=y[4];for(v=0;v<m;v++){d=_[u>>>24]^b[l>>16&255]^T[c>>8&255]^S[f&255]^o[g];h=_[l>>>24]^b[c>>16&255]^T[f>>8&255]^S[u&255]^o[g+1];p=_[c>>>24]^b[f>>16&255]^T[u>>8&255]^S[l&255]^o[g+2];f=_[f>>>24]^b[u>>16&255]^T[l>>8&255]^S[c&255]^o[g+3];g+=4;u=d;l=h;c=p}for(v=0;v<4;v++){a[(3&-v)+s]=k[u>>>24]<<24^k[l>>16&255]<<16^k[c>>8&255]<<8^k[f&255]^o[g++];d=u;u=l;l=c;c=f;f=d}};return e}();var Uf=function(){function e(){Cf(this,e);this.listeners={}}e.prototype.on=function e(t,i){if(!this.listeners[t]){this.listeners[t]=[]}this.listeners[t].push(i)};e.prototype.off=function e(t,i){if(!this.listeners[t]){return false}var r=this.listeners[t].indexOf(i);this.listeners[t].splice(r,1);return r>-1};e.prototype.trigger=function e(t){var i=this.listeners[t];if(!i){return}if(arguments.length===2){var r=i.length;for(var n=0;n<r;++n){i[n].call(this,arguments[1])}}else{var a=Array.prototype.slice.call(arguments,1);var s=i.length;for(var o=0;o<s;++o){i[o].apply(this,a)}}};e.prototype.dispose=function e(){this.listeners={}};e.prototype.pipe=function e(t){this.on("data",function(e){t.push(e)})};return e}();var Df=function(e){Af(t,e);function t(){Cf(this,t);var i=Lf(this,e.call(this,Uf));i.jobs=[];i.delay=1;i.timeout_=null;return i}t.prototype.processJob_=function e(){this.jobs.shift()();if(this.jobs.length){this.timeout_=setTimeout(this.processJob_.bind(this),this.delay)}else{this.timeout_=null}};t.prototype.push=function e(t){this.jobs.push(t);if(!this.timeout_){this.timeout_=setTimeout(this.processJob_.bind(this),this.delay)}};return t}(Uf);var xf=function e(t){return t<<24|(t&65280)<<8|(t&16711680)>>8|t>>>24};var Rf=function e(t,i,r){var n=new Int32Array(t.buffer,t.byteOffset,t.byteLength>>2);var a=new Of(Array.prototype.slice.call(i));var s=new Uint8Array(t.byteLength);var o=new Int32Array(s.buffer);var u=void 0;var l=void 0;var c=void 0;var f=void 0;var d=void 0;var h=void 0;var p=void 0;var m=void 0;var v=void 0;u=r[0];l=r[1];c=r[2];f=r[3];for(v=0;v<n.length;v+=4){d=xf(n[v]);h=xf(n[v+1]);p=xf(n[v+2]);m=xf(n[v+3]);a.decrypt(d,h,p,m,o,v);o[v]=xf(o[v]^u);o[v+1]=xf(o[v+1]^l);o[v+2]=xf(o[v+2]^c);o[v+3]=xf(o[v+3]^f);u=d;l=h;c=p;f=m}return s};var Mf=function(){function e(t,i,r,n){Cf(this,e);var a=e.STEP;var s=new Int32Array(t.buffer);var o=new Uint8Array(t.byteLength);var u=0;this.asyncStream_=new Df;this.asyncStream_.push(this.decryptChunk_(s.subarray(u,u+a),i,r,o));for(u=a;u<s.length;u+=a){r=new Uint32Array([xf(s[u-4]),xf(s[u-3]),xf(s[u-2]),xf(s[u-1])]);this.asyncStream_.push(this.decryptChunk_(s.subarray(u,u+a),i,r,o))}this.asyncStream_.push(function(){n(null,wf(o))})}e.prototype.decryptChunk_=function e(t,i,r,n){return function(){var e=Rf(t,i,r);n.set(e,t.byteOffset)}};Ef(e,null,[{key:"STEP",get:function e(){return 32e3}}]);return e}();var Bf=function t(i,r){if(/^[a-z]+:/i.test(r)){return r}if(!/\/\//i.test(i)){i=Us.buildAbsoluteURL(e.location.href,i)}return Us.buildAbsoluteURL(i,r)};var Nf=function e(t,i,r){if(t&&r.responseURL&&i!==r.responseURL){return r.responseURL}return i};var jf=function e(t,i){if(!(t instanceof i)){throw new TypeError("Cannot call a class as a function")}};var Ff=function(){function e(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||false;r.configurable=true;if("value"in r)r.writable=true;Object.defineProperty(e,r.key,r)}}return function(t,i,r){if(i)e(t.prototype,i);if(r)e(t,r);return t}}();var Vf=function e(t,i,r){if(t===null)t=Function.prototype;var n=Object.getOwnPropertyDescriptor(t,i);if(n===undefined){var a=Object.getPrototypeOf(t);if(a===null){return undefined}else{return e(a,i,r)}}else if("value"in n){return n.value}else{var s=n.get;if(s===undefined){return undefined}return s.call(r)}};var Hf=function e(t,i){if(typeof i!=="function"&&i!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof i)}t.prototype=Object.create(i&&i.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}});if(i)Object.setPrototypeOf?Object.setPrototypeOf(t,i):t.__proto__=i};var qf=function e(t,i){if(!t){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return i&&(typeof i==="object"||typeof i==="function")?i:t};var zf=function(){function e(e,t){var i=[];var r=true;var n=false;var a=undefined;try{for(var s=e[Symbol.iterator](),o;!(r=(o=s.next()).done);r=true){i.push(o.value);if(t&&i.length===t)break}}catch(e){n=true;a=e}finally{try{if(!r&&s["return"])s["return"]()}finally{if(n)throw a}}return i}return function(t,i){if(Array.isArray(t)){return t}else if(Symbol.iterator in Object(t)){return e(t,i)}else{throw new TypeError("Invalid attempt to destructure non-iterable instance")}}}();var Wf=Is.mergeOptions,Gf=Is.EventTarget,Xf=Is.log;var Yf=function e(t,i){["AUDIO","SUBTITLES"].forEach(function(e){for(var r in t.mediaGroups[e]){for(var n in t.mediaGroups[e][r]){var a=t.mediaGroups[e][r][n];i(a,e,r,n)}}})};var Kf=function e(t,i,r){var n=i.slice();r=r||0;var a=Math.min(t.length,i.length+r);for(var s=r;s<a;s++){n[s-r]=Wf(t[s],n[s-r])}return n};var $f=function e(t,i){if(!t.resolvedUri){t.resolvedUri=Bf(i,t.uri)}if(t.key&&!t.key.resolvedUri){t.key.resolvedUri=Bf(i,t.key.uri)}if(t.map&&!t.map.resolvedUri){t.map.resolvedUri=Bf(i,t.map.uri)}};var Qf=function e(t,i){var r=Wf(t,{});var n=r.playlists[i.uri];if(!n){return null}if(n.segments&&i.segments&&n.segments.length===i.segments.length&&n.endList===i.endList&&n.mediaSequence===i.mediaSequence){return null}var a=Wf(n,i);if(n.segments){a.segments=Kf(n.segments,i.segments,i.mediaSequence-n.mediaSequence)}a.segments.forEach(function(e){$f(e,a.resolvedUri)});for(var s=0;s<r.playlists.length;s++){if(r.playlists[s].uri===i.uri){r.playlists[s]=a}}r.playlists[i.uri]=a;return r};var Jf=function e(t){var i=t.playlists.length;while(i--){var r=t.playlists[i];t.playlists[r.uri]=r;r.resolvedUri=Bf(t.uri,r.uri);r.id=i;if(!r.attributes){r.attributes={};Xf.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}}};var Zf=function e(t){Yf(t,function(e){if(e.uri){e.resolvedUri=Bf(t.uri,e.uri)}})};var ed=function e(t,i){var r=t.segments[t.segments.length-1];var n=void 0;if(i&&r&&r.duration){n=r.duration*1e3}else{n=(t.targetDuration||10)*500}return n};var td=function(t){Hf(i,t);function i(e,t){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};jf(this,i);var n=qf(this,(i.__proto__||Object.getPrototypeOf(i)).call(this));var a=r.withCredentials,s=a===undefined?false:a,o=r.handleManifestRedirects,u=o===undefined?false:o;n.srcUrl=e;n.hls_=t;n.withCredentials=s;n.handleManifestRedirects=u;var l=t.options_;n.customTagParsers=l&&l.customTagParsers||[];n.customTagMappers=l&&l.customTagMappers||[];if(!n.srcUrl){throw new Error("A non-empty playlist URL is required")}n.state="HAVE_NOTHING";n.on("mediaupdatetimeout",function(){if(n.state!=="HAVE_METADATA"){return}n.state="HAVE_CURRENT_METADATA";n.request=n.hls_.xhr({uri:Bf(n.master.uri,n.media().uri),withCredentials:n.withCredentials},function(e,t){if(!n.request){return}if(e){return n.playlistRequestError(n.request,n.media().uri,"HAVE_METADATA")}n.haveMetadata(n.request,n.media().uri)})});return n}Ff(i,[{key:"playlistRequestError",value:function e(t,i,r){this.request=null;if(r){this.state=r}this.error={playlist:this.master.playlists[i],status:t.status,message:"HLS playlist request error at URL: "+i,responseText:t.responseText,code:t.status>=500?4:2};this.trigger("error")}},{key:"haveMetadata",value:function t(i,r){var n=this;this.request=null;this.state="HAVE_METADATA";var a=new Vs;this.customTagParsers.forEach(function(e){return a.addParser(e)});this.customTagMappers.forEach(function(e){return a.addTagMapper(e)});a.push(i.responseText);a.end();a.manifest.uri=r;a.manifest.attributes=a.manifest.attributes||{};var s=Qf(this.master,a.manifest);this.targetDuration=a.manifest.targetDuration;if(s){this.master=s;this.media_=this.master.playlists[a.manifest.uri]}else{this.trigger("playlistunchanged")}if(!this.media().endList){e.clearTimeout(this.mediaUpdateTimeout);this.mediaUpdateTimeout=e.setTimeout(function(){n.trigger("mediaupdatetimeout")},ed(this.media(),!!s))}this.trigger("loadedplaylist")}},{key:"dispose",value:function t(){this.stopRequest();e.clearTimeout(this.mediaUpdateTimeout)}},{key:"stopRequest",value:function e(){if(this.request){var t=this.request;this.request=null;t.onreadystatechange=null;t.abort()}}},{key:"media",value:function e(t){var i=this;if(!t){return this.media_}if(this.state==="HAVE_NOTHING"){throw new Error("Cannot switch media playlist from "+this.state)}var r=this.state;if(typeof t==="string"){if(!this.master.playlists[t]){throw new Error("Unknown playlist URI: "+t)}t=this.master.playlists[t]}var n=!this.media_||t.uri!==this.media_.uri;if(this.master.playlists[t.uri].endList){if(this.request){this.request.onreadystatechange=null;this.request.abort();this.request=null}this.state="HAVE_METADATA";this.media_=t;if(n){this.trigger("mediachanging");this.trigger("mediachange")}return}if(!n){return}this.state="SWITCHING_MEDIA";if(this.request){if(t.resolvedUri===this.request.url){return}this.request.onreadystatechange=null;this.request.abort();this.request=null}if(this.media_){this.trigger("mediachanging")}this.request=this.hls_.xhr({uri:t.resolvedUri,withCredentials:this.withCredentials},function(e,n){if(!i.request){return}t.resolvedUri=Nf(i.handleManifestRedirects,t.resolvedUri,n);if(e){return i.playlistRequestError(i.request,t.uri,r)}i.haveMetadata(n,t.uri);if(r==="HAVE_MASTER"){i.trigger("loadedmetadata")}else{i.trigger("mediachange")}})}},{key:"pause",value:function t(){this.stopRequest();e.clearTimeout(this.mediaUpdateTimeout);if(this.state==="HAVE_NOTHING"){this.started=false}if(this.state==="SWITCHING_MEDIA"){if(this.media_){this.state="HAVE_METADATA"}else{this.state="HAVE_MASTER"}}else if(this.state==="HAVE_CURRENT_METADATA"){this.state="HAVE_METADATA"}}},{key:"load",value:function t(i){var r=this;e.clearTimeout(this.mediaUpdateTimeout);var n=this.media();if(i){var a=n?n.targetDuration/2*1e3:5*1e3;this.mediaUpdateTimeout=e.setTimeout(function(){return r.load()},a);return}if(!this.started){this.start();return}if(n&&!n.endList){this.trigger("mediaupdatetimeout")}else{this.trigger("loadedplaylist")}}},{key:"start",value:function t(){var i=this;this.started=true;this.request=this.hls_.xhr({uri:this.srcUrl,withCredentials:this.withCredentials},function(t,r){if(!i.request){return}i.request=null;if(t){i.error={status:r.status,message:"HLS playlist request error at URL: "+i.srcUrl,responseText:r.responseText,code:2};if(i.state==="HAVE_NOTHING"){i.started=false}return i.trigger("error")}var n=new Vs;i.customTagParsers.forEach(function(e){return n.addParser(e)});i.customTagMappers.forEach(function(e){return n.addTagMapper(e)});n.push(r.responseText);n.end();i.state="HAVE_MASTER";i.srcUrl=Nf(i.handleManifestRedirects,i.srcUrl,r);n.manifest.uri=i.srcUrl;if(n.manifest.playlists){i.master=n.manifest;Jf(i.master);Zf(i.master);i.trigger("loadedplaylist");if(!i.request){i.media(n.manifest.playlists[0])}return}i.master={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:e.location.href,playlists:[{uri:i.srcUrl,id:0,resolvedUri:i.srcUrl,attributes:{}}]};i.master.playlists[i.srcUrl]=i.master.playlists[0];i.haveMetadata(r,i.srcUrl);return i.trigger("loadedmetadata")})}}]);return i}(Gf);var id=Is.createTimeRange;var rd=function e(t,i){var r=0;var n=i-t.mediaSequence;var a=t.segments[n];if(a){if(typeof a.start!=="undefined"){return{result:a.start,precise:true}}if(typeof a.end!=="undefined"){return{result:a.end-a.duration,precise:true}}}while(n--){a=t.segments[n];if(typeof a.end!=="undefined"){return{result:r+a.end,precise:true}}r+=a.duration;if(typeof a.start!=="undefined"){return{result:r+a.start,precise:true}}}return{result:r,precise:false}};var nd=function e(t,i){var r=0;var n=void 0;var a=i-t.mediaSequence;for(;a<t.segments.length;a++){n=t.segments[a];if(typeof n.start!=="undefined"){return{result:n.start-r,precise:true}}r+=n.duration;if(typeof n.end!=="undefined"){return{result:n.end-r,precise:true}}}return{result:-1,precise:false}};var ad=function e(t,i,r){var n=void 0;var a=void 0;if(typeof i==="undefined"){i=t.mediaSequence+t.segments.length}if(i<t.mediaSequence){return 0}n=rd(t,i);if(n.precise){return n.result}a=nd(t,i);if(a.precise){return a.result}return n.result+r};var sd=function t(i,r,n){if(!i){return 0}if(typeof n!=="number"){n=0}if(typeof r==="undefined"){if(i.totalDuration){return i.totalDuration}if(!i.endList){return e.Infinity}}return ad(i,r,n)};var od=function e(t,i,r){var n=0;if(i>r){var a=[r,i];i=a[0];r=a[1]}if(i<0){for(var s=i;s<Math.min(0,r);s++){n+=t.targetDuration}i=0}for(var o=i;o<r;o++){n+=t.segments[o].duration}return n};var ud=function e(t){if(!t.segments.length){return 0}var i=t.segments.length-1;var r=t.segments[i].duration||t.targetDuration;var n=r+t.targetDuration*2;while(i--){r+=t.segments[i].duration;if(r>=n){break}}return Math.max(0,i)};var ld=function e(t,i,r){if(!t||!t.segments){return null}if(t.endList){return sd(t)}if(i===null){return null}i=i||0;var n=r?ud(t):t.segments.length;return ad(t,t.mediaSequence+n,i)};var cd=function e(t,i){var r=true;var n=i||0;var a=ld(t,i,r);if(a===null){return id()}return id(n,a)};var fd=function e(t){return t-Math.floor(t)===0};var dd=function e(t,i){if(fd(i)){return i+t*.1}var r=i.toString().split(".")[1].length;for(var n=1;n<=r;n++){var a=Math.pow(10,n);var s=i*a;if(fd(s)||n===r){return(s+t)/a}}};var hd=dd.bind(null,1);var pd=dd.bind(null,-1);var md=function e(t,i,r,n){var a=void 0;var s=void 0;var o=t.segments.length;var u=i-n;if(u<0){if(r>0){for(a=r-1;a>=0;a--){s=t.segments[a];u+=pd(s.duration);if(u>0){return{mediaIndex:a,startTime:n-od(t,r,a)}}}}return{mediaIndex:0,startTime:i}}if(r<0){for(a=r;a<0;a++){u-=t.targetDuration;if(u<0){return{mediaIndex:0,startTime:i}}}r=0}for(a=r;a<o;a++){s=t.segments[a];u-=hd(s.duration);if(u<0){return{mediaIndex:a,startTime:n+od(t,r,a)}}}return{mediaIndex:o-1,startTime:i}};var vd=function e(t){return t.excludeUntil&&t.excludeUntil>Date.now()};var gd=function e(t){return t.excludeUntil&&t.excludeUntil===Infinity};var yd=function e(t){var i=vd(t);return!t.disabled&&!i};var _d=function e(t){return t.disabled};var bd=function e(t){for(var i=0;i<t.segments.length;i++){if(t.segments[i].key){return true}}return false};var Td=function e(t){for(var i=0;i<t.segments.length;i++){if(t.segments[i].map){return true}}return false};var Sd=function e(t,i){return i.attributes&&i.attributes[t]};var kd=function e(t,i,r){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:0;if(!Sd("BANDWIDTH",r)){return NaN}var a=t*r.attributes.BANDWIDTH;return(a-n*8)/i};var wd=function e(t,i){if(t.playlists.length===1){return true}var r=i.attributes.BANDWIDTH||Number.MAX_VALUE;return t.playlists.filter(function(e){if(!yd(e)){return false}return(e.attributes.BANDWIDTH||0)<r}).length===0};var Cd={duration:sd,seekable:cd,safeLiveIndex:ud,getMediaInfoForTime:md,isEnabled:yd,isDisabled:_d,isBlacklisted:vd,isIncompatible:gd,playlistEnd:ld,isAes:bd,isFmp4:Td,hasAttribute:Sd,estimateSegmentRequestTime:kd,isLowestEnabledRendition:wd};var Ed=Is.xhr,Ad=Is.mergeOptions;var Ld=function e(){var t=function e(t,i){t=Ad({timeout:45e3},t);var r=e.beforeRequest||Is.Hls.xhr.beforeRequest;if(r&&typeof r==="function"){var n=r(t);if(n){t=n}}var a=Ed(t,function(e,t){var r=a.response;if(!e&&r){a.responseTime=Date.now();a.roundTripTime=a.responseTime-a.requestTime;a.bytesReceived=r.byteLength||r.length;if(!a.bandwidth){a.bandwidth=Math.floor(a.bytesReceived/a.roundTripTime*8*1e3)}}if(t.headers){a.responseHeaders=t.headers}if(e&&e.code==="ETIMEDOUT"){a.timedout=true}if(!e&&!a.aborted&&t.statusCode!==200&&t.statusCode!==206&&t.statusCode!==0){e=new Error("XHR Failed with a response of: "+(a&&(r||a.responseText)))}i(e,a)});var s=a.abort;a.abort=function(){a.aborted=true;return s.apply(a,arguments)};a.uri=t.uri;a.requestTime=Date.now();return a};return t};var Id=function e(t,i){return t.start(i)+"-"+t.end(i)};var Pd=function e(t,i){var r=t.toString(16);return"00".substring(0,2-r.length)+r+(i%2?" ":"")};var Od=function e(t){if(t>=32&&t<126){return String.fromCharCode(t)}return"."};var Ud=function e(t){var i={};Object.keys(t).forEach(function(e){var r=t[e];if(ArrayBuffer.isView(r)){i[e]={bytes:r.buffer,byteOffset:r.byteOffset,byteLength:r.byteLength}}else{i[e]=r}});return i};var Dd=function e(t){var i=t.byterange||{length:Infinity,offset:0};return[i.length,i.offset,t.resolvedUri].join(",")};var xd=function e(t){var i=Array.prototype.slice.call(t);var r=16;var n="";var a=void 0;var s=void 0;for(var o=0;o<i.length/r;o++){a=i.slice(o*r,o*r+r).map(Pd).join("");s=i.slice(o*r,o*r+r).map(Od).join("");n+=a+" "+s+"\n"}return n};var Rd=function e(t){var i=t.bytes;return xd(i)};var Md=function e(t){var i="";var r=void 0;for(r=0;r<t.length;r++){i+=Id(t,r)+" "}return i};var Bd=Object.freeze({createTransferableMessage:Ud,initSegmentId:Dd,hexDump:xd,tagDump:Rd,textRanges:Md});var Nd=.25;var jd=function e(t,i){if(!i.dateTimeObject){return null}var r=i.videoTimingInfo.transmuxerPrependedSeconds;var n=i.videoTimingInfo.transmuxedPresentationStart;var a=n+r;var s=t-a;return new Date(i.dateTimeObject.getTime()+s*1e3)};var Fd=function e(t){return t.transmuxedPresentationEnd-t.transmuxedPresentationStart-t.transmuxerPrependedSeconds};var Vd=function e(t,i){var r=void 0;try{r=new Date(t)}catch(e){return null}if(!i||!i.segments||i.segments.length===0){return null}var n=i.segments[0];if(r<n.dateTimeObject){return null}for(var a=0;a<i.segments.length-1;a++){n=i.segments[a];var s=i.segments[a+1].dateTimeObject;if(r<s){break}}var o=i.segments[i.segments.length-1];var u=o.dateTimeObject;var l=o.videoTimingInfo?Fd(o.videoTimingInfo):o.duration+o.duration*Nd;var c=new Date(u.getTime()+l*1e3);if(r>c){return null}if(r>u){n=o}return{segment:n,estimatedStart:n.videoTimingInfo?n.videoTimingInfo.transmuxedPresentationStart:Cd.duration(i,i.mediaSequence+i.segments.indexOf(n)),type:n.videoTimingInfo?"accurate":"estimate"}};var Hd=function e(t,i){if(!i||!i.segments||i.segments.length===0){return null}var r=0;var n=void 0;for(var a=0;a<i.segments.length;a++){n=i.segments[a];r=n.videoTimingInfo?n.videoTimingInfo.transmuxedPresentationEnd:r+n.duration;if(t<=r){break}}var s=i.segments[i.segments.length-1];if(s.videoTimingInfo&&s.videoTimingInfo.transmuxedPresentationEnd<t){return null}if(t>r){if(t>r+s.duration*Nd){return null}n=s}return{segment:n,estimatedStart:n.videoTimingInfo?n.videoTimingInfo.transmuxedPresentationStart:r-n.duration,type:n.videoTimingInfo?"accurate":"estimate"}};var qd=function e(t,i){var r=void 0;var n=void 0;try{r=new Date(t);n=new Date(i)}catch(e){}var a=r.getTime();var s=n.getTime();return(s-a)/1e3};var zd=function e(t){if(!t.segments||t.segments.length===0){return false}for(var i=0;i<t.segments.length;i++){var r=t.segments[i];if(!r.dateTimeObject){return false}}return true};var Wd=function e(t){var i=t.playlist,r=t.time,n=r===undefined?undefined:r,a=t.callback;if(!a){throw new Error("getProgramTime: callback must be provided")}if(!i||n===undefined){return a({message:"getProgramTime: playlist and time must be provided"})}var s=Hd(n,i);if(!s){return a({message:"valid programTime was not found"})}if(s.type==="estimate"){return a({message:"Accurate programTime could not be determined."+" Please seek to e.seekTime and try again",seekTime:s.estimatedStart})}var o={mediaSeconds:n};var u=jd(n,s.segment);if(u){o.programDateTime=u.toISOString()}return a(null,o)};var Gd=function e(t){var i=t.programTime,r=t.playlist,n=t.retryCount,a=n===undefined?2:n,s=t.seekTo,o=t.pauseAfterSeek,u=o===undefined?true:o,l=t.tech,c=t.callback;if(!c){throw new Error("seekToProgramTime: callback must be provided")}if(typeof i==="undefined"||!r||!s){return c({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"})}if(!r.endList&&!l.hasStarted_){return c({message:"player must be playing a live stream to start buffering"})}if(!zd(r)){return c({message:"programDateTime tags must be provided in the manifest "+r.resolvedUri})}var f=Vd(i,r);if(!f){return c({message:i+" was not found in the stream"})}var d=f.segment;var h=qd(d.dateTimeObject,i);if(f.type==="estimate"){if(a===0){return c({message:i+" is not buffered yet. Try again"})}s(f.estimatedStart+h);l.one("seeked",function(){e({programTime:i,playlist:r,retryCount:a-1,seekTo:s,pauseAfterSeek:u,tech:l,callback:c})});return}var p=d.start+h;var m=function e(){return c(null,l.currentTime())};l.one("seeked",m);if(u){l.pause()}s(p)};var Xd=1/30;var Yd=Xd*3;var Kd=function e(t,i){var r=[];var n=void 0;if(t&&t.length){for(n=0;n<t.length;n++){if(i(t.start(n),t.end(n))){r.push([t.start(n),t.end(n)])}}}return Is.createTimeRanges(r)};var $d=function e(t,i){return Kd(t,function(e,t){return e-Xd<=i&&t+Xd>=i})};var Qd=function e(t,i){return Kd(t,function(e){return e-Xd>=i})};var Jd=function e(t){if(t.length<2){return Is.createTimeRanges()}var i=[];for(var r=1;r<t.length;r++){var n=t.end(r-1);var a=t.start(r);i.push([n,a])}return Is.createTimeRanges(i)};var Zd=function e(t){var i=[];if(!t||!t.length){return""}for(var r=0;r<t.length;r++){i.push(t.start(r)+" => "+t.end(r))}return i.join(", ")};var eh=function e(t,i){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1;var n=t.length?t.end(t.length-1):0;return(n-i)/r};var th=function e(t){var i=[];for(var r=0;r<t.length;r++){i.push({start:t.start(r),end:t.end(r)})}return i};var ih=function e(t,i,r){var n=i.player_;if(r.captions&&r.captions.length){if(!t.inbandTextTracks_){t.inbandTextTracks_={}}for(var a in r.captionStreams){if(!t.inbandTextTracks_[a]){n.tech_.trigger({type:"usage",name:"hls-608"});var s=n.textTracks().getTrackById(a);if(s){t.inbandTextTracks_[a]=s}else{t.inbandTextTracks_[a]=n.addRemoteTextTrack({kind:"captions",id:a,label:a},false).track}}}}if(r.metadata&&r.metadata.length&&!t.metadataTrack_){t.metadataTrack_=n.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},false).track;t.metadataTrack_.inBandMetadataTrackDispatchType=r.metadata.dispatchType}};var rh=function e(t,i,r){var n=void 0;var a=void 0;if(!r){return}if(!r.cues){return}n=r.cues.length;while(n--){a=r.cues[n];if(a.startTime<=i&&a.endTime>=t){r.removeCue(a)}}};var nh=function e(t){Object.defineProperties(t.frame,{id:{get:function e(){Is.log.warn("cue.frame.id is deprecated. Use cue.value.key instead.");return t.value.key}},value:{get:function e(){Is.log.warn("cue.frame.value is deprecated. Use cue.value.data instead.");return t.value.data}},privateData:{get:function e(){Is.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead.");return t.value.data}}})};var ah=function e(t){var i=void 0;if(isNaN(t)||Math.abs(t)===Infinity){i=Number.MAX_VALUE}else{i=t}return i};var sh=function t(i,r,n){var a=e.WebKitDataCue||e.VTTCue;if(r){r.forEach(function(e){var t=e.stream;this.inbandTextTracks_[t].addCue(new a(e.startTime+this.timestampOffset,e.endTime+this.timestampOffset,e.text))},i)}if(n){var s=ah(i.mediaSource_.duration);n.forEach(function(t){var i=t.cueTime+this.timestampOffset;if(typeof i!=="number"||e.isNaN(i)||i<0||!(i<Infinity)){return}t.frames.forEach(function(e){var t=new a(i,i,e.value||e.url||e.data||"");t.frame=e;t.value=e;nh(t);this.metadataTrack_.addCue(t)},this)},i);if(i.metadataTrack_&&i.metadataTrack_.cues&&i.metadataTrack_.cues.length){var o=i.metadataTrack_.cues;var u=[];for(var l=0;l<o.length;l++){if(o[l]){u.push(o[l])}}var c=u.reduce(function(e,t){var i=e[t.startTime]||[];i.push(t);e[t.startTime]=i;return e},{});var f=Object.keys(c).sort(function(e,t){return Number(e)-Number(t)});f.forEach(function(e,t){var i=c[e];var r=Number(f[t+1])||s;i.forEach(function(e){e.endTime=r})})}}};var oh=typeof window!=="undefined"?window:{},uh=typeof Symbol==="undefined"?"__target":Symbol(),lh="application/javascript",ch=oh.BlobBuilder||oh.WebKitBlobBuilder||oh.MozBlobBuilder||oh.MSBlobBuilder,fh=oh.URL||oh.webkitURL||fh&&fh.msURL,dh=oh.Worker;function hh(e,t){return function i(r){var n=this;if(!t){return new dh(e)}else if(dh&&!r){var a=t.toString().replace(/^function.+?{/,"").slice(0,-1),s=gh(a);this[uh]=new dh(s);yh(this[uh],s);return this[uh]}else{var o={postMessage:function e(t){if(n.onmessage){setTimeout(function(){n.onmessage({data:t,target:o})})}}};t.call(o);this.postMessage=function(e){setTimeout(function(){o.onmessage({data:e,target:n})})};this.isThisThread=true}}}if(dh){var ph,mh=gh("self.onmessage = function () {}"),vh=new Uint8Array(1);try{ph=new dh(mh);ph.postMessage(vh,[vh.buffer])}catch(e){dh=null}finally{fh.revokeObjectURL(mh);if(ph){ph.terminate()}}}function gh(e){try{return fh.createObjectURL(new Blob([e],{type:lh}))}catch(i){var t=new ch;t.append(e);return fh.createObjectURL(t.getBlob(type))}}function yh(e,t){if(!e||!t)return;var i=e.terminate;e.objURL=t;e.terminate=function(){if(e.objURL)fh.revokeObjectURL(e.objURL);i.call(e)}}var _h=new hh("./transmuxer-worker.worker.js",function(e,t){var i=this;var r=function(){var e=Math.pow(2,32)-1;var t,r,n,a,s,o,u,l,c,f,d,h,p,m,v,g,y,_,b,T,S,k,w,C,E,A,L,I,P,O,U,D,x,R,M,B;(function(){var e;w={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]};if(typeof Uint8Array==="undefined"){return}for(e in w){if(w.hasOwnProperty(e)){w[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]}}C=new Uint8Array(["i".charCodeAt(0),"s".charCodeAt(0),"o".charCodeAt(0),"m".charCodeAt(0)]);A=new Uint8Array(["a".charCodeAt(0),"v".charCodeAt(0),"c".charCodeAt(0),"1".charCodeAt(0)]);E=new Uint8Array([0,0,0,1]);L=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]);I=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);P={video:L,audio:I};D=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]);U=new Uint8Array([0,0,0,0,0,0,0,0]);x=new Uint8Array([0,0,0,0,0,0,0,0]);R=x;M=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]);B=x;O=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])})();t=function e(t){var i=[],r=0,n,a,s;for(n=1;n<arguments.length;n++){i.push(arguments[n])}n=i.length;while(n--){r+=i[n].byteLength}a=new Uint8Array(r+8);s=new DataView(a.buffer,a.byteOffset,a.byteLength);s.setUint32(0,a.byteLength);a.set(t,4);for(n=0,r=8;n<i.length;n++){a.set(i[n],r);r+=i[n].byteLength}return a};r=function e(){return t(w.dinf,t(w.dref,D))};n=function e(i){return t(w.esds,new Uint8Array([0,0,0,0,3,25,0,0,0,4,17,64,21,0,6,0,0,0,218,192,0,0,218,192,5,2,i.audioobjecttype<<3|i.samplingfrequencyindex>>>1,i.samplingfrequencyindex<<7|i.channelcount<<3,6,1,2]))};a=function e(){return t(w.ftyp,C,E,C,A)};g=function e(i){return t(w.hdlr,P[i])};s=function e(i){return t(w.mdat,i)};v=function e(i){var r=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,i.duration>>>24&255,i.duration>>>16&255,i.duration>>>8&255,i.duration&255,85,196,0,0]);if(i.samplerate){r[12]=i.samplerate>>>24&255;r[13]=i.samplerate>>>16&255;r[14]=i.samplerate>>>8&255;r[15]=i.samplerate&255}return t(w.mdhd,r)};m=function e(i){return t(w.mdia,v(i),g(i.type),u(i))};o=function e(i){return t(w.mfhd,new Uint8Array([0,0,0,0,(i&4278190080)>>24,(i&16711680)>>16,(i&65280)>>8,i&255]))};u=function e(i){return t(w.minf,i.type==="video"?t(w.vmhd,O):t(w.smhd,U),r(),_(i))};l=function e(i,r){var n=[],a=r.length;while(a--){n[a]=T(r[a])}return t.apply(null,[w.moof,o(i)].concat(n))};c=function e(i){var r=i.length,n=[];while(r--){n[r]=h(i[r])}return t.apply(null,[w.moov,d(4294967295)].concat(n).concat(f(i)))};f=function e(i){var r=i.length,n=[];while(r--){n[r]=S(i[r])}return t.apply(null,[w.mvex].concat(n))};d=function e(i){var r=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(i&4278190080)>>24,(i&16711680)>>16,(i&65280)>>8,i&255,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 t(w.mvhd,r)};y=function e(i){var r=i.samples||[],n=new Uint8Array(4+r.length),a,s;for(s=0;s<r.length;s++){a=r[s].flags;n[s+4]=a.dependsOn<<4|a.isDependedOn<<2|a.hasRedundancy}return t(w.sdtp,n)};_=function e(i){return t(w.stbl,b(i),t(w.stts,B),t(w.stsc,R),t(w.stsz,M),t(w.stco,x))};(function(){var e,i;b=function r(n){return t(w.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),n.type==="video"?e(n):i(n))};e=function e(i){var r=i.sps||[],n=i.pps||[],a=[],s=[],o;for(o=0;o<r.length;o++){a.push((r[o].byteLength&65280)>>>8);a.push(r[o].byteLength&255);a=a.concat(Array.prototype.slice.call(r[o]))}for(o=0;o<n.length;o++){s.push((n[o].byteLength&65280)>>>8);s.push(n[o].byteLength&255);s=s.concat(Array.prototype.slice.call(n[o]))}return t(w.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,(i.width&65280)>>8,i.width&255,(i.height&65280)>>8,i.height&255,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]),t(w.avcC,new Uint8Array([1,i.profileIdc,i.profileCompatibility,i.levelIdc,255].concat([r.length]).concat(a).concat([n.length]).concat(s))),t(w.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])))};i=function e(i){return t(w.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(i.channelcount&65280)>>8,i.channelcount&255,(i.samplesize&65280)>>8,i.samplesize&255,0,0,0,0,(i.samplerate&65280)>>8,i.samplerate&255,0,0]),n(i))}})();p=function e(i){var r=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(i.id&4278190080)>>24,(i.id&16711680)>>16,(i.id&65280)>>8,i.id&255,0,0,0,0,(i.duration&4278190080)>>24,(i.duration&16711680)>>16,(i.duration&65280)>>8,i.duration&255,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,(i.width&65280)>>8,i.width&255,0,0,(i.height&65280)>>8,i.height&255,0,0]);return t(w.tkhd,r)};T=function i(r){var n,a,s,o,u,l,c;n=t(w.tfhd,new Uint8Array([0,0,0,58,(r.id&4278190080)>>24,(r.id&16711680)>>16,(r.id&65280)>>8,r.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0]));l=Math.floor(r.baseMediaDecodeTime/(e+1));c=Math.floor(r.baseMediaDecodeTime%(e+1));a=t(w.tfdt,new Uint8Array([1,0,0,0,l>>>24&255,l>>>16&255,l>>>8&255,l&255,c>>>24&255,c>>>16&255,c>>>8&255,c&255]));u=32+20+8+16+8+8;if(r.type==="audio"){s=k(r,u);return t(w.traf,n,a,s)}o=y(r);s=k(r,o.length+u);return t(w.traf,n,a,s,o)};h=function e(i){i.duration=i.duration||4294967295;return t(w.trak,p(i),m(i))};S=function e(i){var r=new Uint8Array([0,0,0,0,(i.id&4278190080)>>24,(i.id&16711680)>>16,(i.id&65280)>>8,i.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);if(i.type!=="video"){r[r.length-1]=0}return t(w.trex,r)};(function(){var e,i,r;r=function e(t,i){var r=0,n=0,a=0,s=0;if(t.length){if(t[0].duration!==undefined){r=1}if(t[0].size!==undefined){n=2}if(t[0].flags!==undefined){a=4}if(t[0].compositionTimeOffset!==undefined){s=8}}return[0,0,r|n|a|s,1,(t.length&4278190080)>>>24,(t.length&16711680)>>>16,(t.length&65280)>>>8,t.length&255,(i&4278190080)>>>24,(i&16711680)>>>16,(i&65280)>>>8,i&255]};i=function e(i,n){var a,s,o,u;s=i.samples||[];n+=8+12+16*s.length;a=r(s,n);for(u=0;u<s.length;u++){o=s[u];a=a.concat([(o.duration&4278190080)>>>24,(o.duration&16711680)>>>16,(o.duration&65280)>>>8,o.duration&255,(o.size&4278190080)>>>24,(o.size&16711680)>>>16,(o.size&65280)>>>8,o.size&255,o.flags.isLeading<<2|o.flags.dependsOn,o.flags.isDependedOn<<6|o.flags.hasRedundancy<<4|o.flags.paddingValue<<1|o.flags.isNonSyncSample,o.flags.degradationPriority&240<<8,o.flags.degradationPriority&15,(o.compositionTimeOffset&4278190080)>>>24,(o.compositionTimeOffset&16711680)>>>16,(o.compositionTimeOffset&65280)>>>8,o.compositionTimeOffset&255])}return t(w.trun,new Uint8Array(a))};e=function e(i,n){var a,s,o,u;s=i.samples||[];n+=8+12+8*s.length;a=r(s,n);for(u=0;u<s.length;u++){o=s[u];a=a.concat([(o.duration&4278190080)>>>24,(o.duration&16711680)>>>16,(o.duration&65280)>>>8,o.duration&255,(o.size&4278190080)>>>24,(o.size&16711680)>>>16,(o.size&65280)>>>8,o.size&255])}return t(w.trun,new Uint8Array(a))};k=function t(r,n){if(r.type==="audio"){return e(r,n)}return i(r,n)}})();var N={ftyp:a,mdat:s,moof:l,moov:c,initSegment:function e(t){var i=a(),r=c(t),n;n=new Uint8Array(i.byteLength+r.byteLength);n.set(i);n.set(r,i.byteLength);return n}};var j=function e(t){return t>>>0};var F={toUnsigned:j};var V=F.toUnsigned;var H,q,z,W,G;H=function e(t,i){var r=[],n,a,s,o,u;if(!i.length){return null}for(n=0;n<t.byteLength;){a=V(t[n]<<24|t[n+1]<<16|t[n+2]<<8|t[n+3]);s=q(t.subarray(n+4,n+8));o=a>1?n+a:t.byteLength;if(s===i[0]){if(i.length===1){r.push(t.subarray(n+8,o))}else{u=H(t.subarray(n+8,o),i.slice(1));if(u.length){r=r.concat(u)}}}n=o}return r};q=function e(t){var i="";i+=String.fromCharCode(t[0]);i+=String.fromCharCode(t[1]);i+=String.fromCharCode(t[2]);i+=String.fromCharCode(t[3]);return i};z=function e(t){var i={},r=H(t,["moov","trak"]);return r.reduce(function(e,t){var i,r,n,a,s;i=H(t,["tkhd"])[0];if(!i){return null}r=i[0];n=r===0?12:20;a=V(i[n]<<24|i[n+1]<<16|i[n+2]<<8|i[n+3]);s=H(t,["mdia","mdhd"])[0];if(!s){return null}r=s[0];n=r===0?12:20;e[a]=V(s[n]<<24|s[n+1]<<16|s[n+2]<<8|s[n+3]);return e},i)};W=function e(t,i){var r,n,a;r=H(i,["moof","traf"]);n=[].concat.apply([],r.map(function(e){return H(e,["tfhd"]).map(function(i){var r,n,a;r=V(i[4]<<24|i[5]<<16|i[6]<<8|i[7]);n=t[r]||9e4;a=H(e,["tfdt"]).map(function(e){var t,i;t=e[0];i=V(e[4]<<24|e[5]<<16|e[6]<<8|e[7]);if(t===1){i*=Math.pow(2,32);i+=V(e[8]<<24|e[9]<<16|e[10]<<8|e[11])}return i})[0];a=a||Infinity;return a/n})}));a=Math.min.apply(null,n);return isFinite(a)?a:0};G=function e(t){var i=H(t,["moov","trak"]);var r=[];i.forEach(function(e){var t=H(e,["mdia","hdlr"]);var i=H(e,["tkhd"]);t.forEach(function(e,t){var n=q(e.subarray(8,12));var a=i[t];var s;var o;var u;if(n==="vide"){s=new DataView(a.buffer,a.byteOffset,a.byteLength);o=s.getUint8(0);u=o===0?s.getUint32(12):s.getUint32(20);r.push(u)}})});return r};var X={findBox:H,parseType:q,timescale:z,startTime:W,videoTrackIds:G};var Y=function e(){this.init=function(){var e={};this.on=function(t,i){if(!e[t]){e[t]=[]}e[t]=e[t].concat(i)};this.off=function(t,i){var r;if(!e[t]){return false}r=e[t].indexOf(i);e[t]=e[t].slice();e[t].splice(r,1);return r>-1};this.trigger=function(t){var i,r,n,a;i=e[t];if(!i){return}if(arguments.length===2){n=i.length;for(r=0;r<n;++r){i[r].call(this,arguments[1])}}else{a=[];r=arguments.length;for(r=1;r<arguments.length;++r){a.push(arguments[r])}n=i.length;for(r=0;r<n;++r){i[r].apply(this,a)}}};this.dispose=function(){e={}}}};Y.prototype.pipe=function(e){this.on("data",function(t){e.push(t)});this.on("done",function(t){e.flush(t)});return e};Y.prototype.push=function(e){this.trigger("data",e)};Y.prototype.flush=function(e){this.trigger("done",e)};var K=Y;var $=function e(t){var i,r,n=[],a=[];n.byteLength=0;for(i=0;i<t.length;i++){r=t[i];if(r.nalUnitType==="access_unit_delimiter_rbsp"){if(n.length){n.duration=r.dts-n.dts;a.push(n)}n=[r];n.byteLength=r.data.byteLength;n.pts=r.pts;n.dts=r.dts}else{if(r.nalUnitType==="slice_layer_without_partitioning_rbsp_idr"){n.keyFrame=true}n.duration=r.dts-n.dts;n.byteLength+=r.data.byteLength;n.push(r)}}if(a.length&&(!n.duration||n.duration<=0)){n.duration=a[a.length-1].duration}a.push(n);return a};var Q=function e(t){var i,r,n=[],a=[];n.byteLength=0;n.nalCount=0;n.duration=0;n.pts=t[0].pts;n.dts=t[0].dts;a.byteLength=0;a.nalCount=0;a.duration=0;a.pts=t[0].pts;a.dts=t[0].dts;for(i=0;i<t.length;i++){r=t[i];if(r.keyFrame){if(n.length){a.push(n);a.byteLength+=n.byteLength;a.nalCount+=n.nalCount;a.duration+=n.duration}n=[r];n.nalCount=r.length;n.byteLength=r.byteLength;n.pts=r.pts;n.dts=r.dts;n.duration=r.duration}else{n.duration+=r.duration;n.nalCount+=r.length;n.byteLength+=r.byteLength;n.push(r)}}if(a.length&&n.duration<=0){n.duration=a[a.length-1].duration}a.byteLength+=n.byteLength;a.nalCount+=n.nalCount;a.duration+=n.duration;a.push(n);return a};var J=function e(t){var i;if(!t[0][0].keyFrame&&t.length>1){i=t.shift();t.byteLength-=i.byteLength;t.nalCount-=i.nalCount;t[0][0].dts=i.dts;t[0][0].pts=i.pts;t[0][0].duration+=i.duration}return t};var Z=function e(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}};var ee=function e(t,i){var r=Z();r.dataOffset=i;r.compositionTimeOffset=t.pts-t.dts;r.duration=t.duration;r.size=4*t.length;r.size+=t.byteLength;if(t.keyFrame){r.flags.dependsOn=2;r.flags.isNonSyncSample=0}return r};var te=function e(t,i){var r,n,a,s,o,u=i||0,l=[];for(r=0;r<t.length;r++){s=t[r];for(n=0;n<s.length;n++){o=s[n];a=ee(o,u);u+=a.size;l.push(a)}}return l};var ie=function e(t){var i,r,n,a,s,o,u=0,l=t.byteLength,c=t.nalCount,f=l+4*c,d=new Uint8Array(f),h=new DataView(d.buffer);for(i=0;i<t.length;i++){a=t[i];for(r=0;r<a.length;r++){s=a[r];for(n=0;n<s.length;n++){o=s[n];h.setUint32(u,o.data.byteLength);u+=4;d.set(o.data,u);u+=o.data.byteLength}}}return d};var re={groupNalsIntoFrames:$,groupFramesIntoGops:Q,extendFirstKeyFrame:J,generateSampleTable:te,concatenateNalData:ie};var ne=[33,16,5,32,164,27];var ae=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252];var se=function e(t){var i=[];while(t--){i.push(0)}return i};var oe=function e(t){return Object.keys(t).reduce(function(e,i){e[i]=new Uint8Array(t[i].reduce(function(e,t){return e.concat(t)},[]));return e},{})};var ue={96000:[ne,[227,64],se(154),[56]],88200:[ne,[231],se(170),[56]],64000:[ne,[248,192],se(240),[56]],48000:[ne,[255,192],se(268),[55,148,128],se(54),[112]],44100:[ne,[255,192],se(268),[55,163,128],se(84),[112]],32000:[ne,[255,192],se(268),[55,234],se(226),[112]],24000:[ne,[255,192],se(268),[55,255,128],se(268),[111,112],se(126),[224]],16000:[ne,[255,192],se(268),[55,255,128],se(268),[111,255],se(269),[223,108],se(195),[1,192]],12000:[ae,se(268),[3,127,248],se(268),[6,255,240],se(268),[13,255,224],se(268),[27,253,128],se(259),[56]],11025:[ae,se(268),[3,127,248],se(268),[6,255,240],se(268),[13,255,224],se(268),[27,255,192],se(268),[55,175,128],se(108),[112]],8000:[ae,se(268),[3,121,16],se(47),[7]]};var le=oe(ue);var ce=9e4,fe,de,he,pe,me,ve;fe=function e(t){return t*ce};de=function e(t,i){return t*i};he=function e(t){return t/ce};pe=function e(t,i){return t/i};me=function e(t,i){return fe(pe(t,i))};ve=function e(t,i){return de(he(t),i)};var ge={secondsToVideoTs:fe,secondsToAudioTs:de,videoTsToSeconds:he,audioTsToSeconds:pe,audioTsToVideoTs:me,videoTsToAudioTs:ve};var ye=9e4;var _e=function e(t){var i,r,n=0;for(i=0;i<t.length;i++){r=t[i];n+=r.data.byteLength}return n};var be=function e(t,i,r,n){var a,s=0,o=0,u=0,l=0,c,f;if(!i.length){return}a=ge.audioTsToVideoTs(t.baseMediaDecodeTime,t.samplerate);s=Math.ceil(ye/(t.samplerate/1024));if(r&&n){o=a-Math.max(r,n);u=Math.floor(o/s);l=u*s}if(u<1||l>ye/2){return}c=le[t.samplerate];if(!c){c=i[0].data}for(f=0;f<u;f++){i.splice(f,0,{data:c})}t.baseMediaDecodeTime-=Math.floor(ge.videoTsToAudioTs(l,t.samplerate))};var Te=function e(t,i,r){if(i.minSegmentDts>=r){return t}i.minSegmentDts=Infinity;return t.filter(function(e){if(e.dts>=r){i.minSegmentDts=Math.min(i.minSegmentDts,e.dts);i.minSegmentPts=i.minSegmentDts;return true}return false})};var Se=function e(t){var i,r,n=[];for(i=0;i<t.length;i++){r=t[i];n.push({size:r.data.byteLength,duration:1024})}return n};var ke=function e(t){var i,r,n=0,a=new Uint8Array(_e(t));for(i=0;i<t.length;i++){r=t[i];a.set(r.data,n);n+=r.data.byteLength}return a};var we={prefixWithSilence:be,trimAdtsFramesByEarliestDts:Te,generateSampleTable:Se,concatenateFrameData:ke};var Ce=9e4;var Ee=function e(t,i){if(typeof i.pts==="number"){if(t.timelineStartInfo.pts===undefined){t.timelineStartInfo.pts=i.pts}if(t.minSegmentPts===undefined){t.minSegmentPts=i.pts}else{t.minSegmentPts=Math.min(t.minSegmentPts,i.pts)}if(t.maxSegmentPts===undefined){t.maxSegmentPts=i.pts}else{t.maxSegmentPts=Math.max(t.maxSegmentPts,i.pts)}}if(typeof i.dts==="number"){if(t.timelineStartInfo.dts===undefined){t.timelineStartInfo.dts=i.dts}if(t.minSegmentDts===undefined){t.minSegmentDts=i.dts}else{t.minSegmentDts=Math.min(t.minSegmentDts,i.dts)}if(t.maxSegmentDts===undefined){t.maxSegmentDts=i.dts}else{t.maxSegmentDts=Math.max(t.maxSegmentDts,i.dts)}}};var Ae=function e(t){delete t.minSegmentDts;delete t.maxSegmentDts;delete t.minSegmentPts;delete t.maxSegmentPts};var Le=function e(t,i){var r,n,a=t.minSegmentDts;if(!i){a-=t.timelineStartInfo.dts}r=t.timelineStartInfo.baseMediaDecodeTime;r+=a;r=Math.max(0,r);if(t.type==="audio"){n=t.samplerate/Ce;r*=n;r=Math.floor(r)}return r};var Ie={clearDtsInfo:Ae,calculateTrackBaseMediaDecodeTime:Le,collectDtsInfo:Ee};var Pe=4,Oe=128;var Ue=function e(t){var i=0,r={payloadType:-1,payloadSize:0},n=0,a=0;while(i<t.byteLength){if(t[i]===Oe){break}while(t[i]===255){n+=255;i++}n+=t[i++];while(t[i]===255){a+=255;i++}a+=t[i++];if(!r.payload&&n===Pe){r.payloadType=n;r.payloadSize=a;r.payload=t.subarray(i,i+a);break}i+=a;n=0;a=0}return r};var De=function e(t){if(t.payload[0]!==181){return null}if((t.payload[1]<<8|t.payload[2])!==49){return null}if(String.fromCharCode(t.payload[3],t.payload[4],t.payload[5],t.payload[6])!=="GA94"){return null}if(t.payload[7]!==3){return null}return t.payload.subarray(8,t.payload.length-1)};var xe=function e(t,i){var r=[],n,a,s,o;if(!(i[0]&64)){return r}a=i[0]&31;for(n=0;n<a;n++){s=n*3;o={type:i[s+2]&3,pts:t};if(i[s+2]&4){o.ccData=i[s+3]<<8|i[s+4];r.push(o)}}return r};var Re=function e(t){var i=t.byteLength,r=[],n=1,a,s;while(n<i-2){if(t[n]===0&&t[n+1]===0&&t[n+2]===3){r.push(n+2);n+=2}else{n++}}if(r.length===0){return t}a=i-r.length;s=new Uint8Array(a);var o=0;for(n=0;n<a;o++,n++){if(o===r[0]){o++;r.shift()}s[n]=t[o]}return s};var Me={parseSei:Ue,parseUserData:De,parseCaptionPackets:xe,discardEmulationPreventionBytes:Re,USER_DATA_REGISTERED_ITU_T_T35:Pe};var Be=function e(){e.prototype.init.call(this);this.captionPackets_=[];this.ccStreams_=[new qe(0,0),new qe(0,1),new qe(1,0),new qe(1,1)];this.reset();this.ccStreams_.forEach(function(e){e.on("data",this.trigger.bind(this,"data"));e.on("done",this.trigger.bind(this,"done"))},this)};Be.prototype=new K;Be.prototype.push=function(e){var t,i,r;if(e.nalUnitType!=="sei_rbsp"){return}t=Me.parseSei(e.escapedRBSP);if(t.payloadType!==Me.USER_DATA_REGISTERED_ITU_T_T35){return}i=Me.parseUserData(t);if(!i){return}if(e.dts<this.latestDts_){this.ignoreNextEqualDts_=true;return}else if(e.dts===this.latestDts_&&this.ignoreNextEqualDts_){this.numSameDts_--;if(!this.numSameDts_){this.ignoreNextEqualDts_=false}return}r=Me.parseCaptionPackets(e.pts,i);this.captionPackets_=this.captionPackets_.concat(r);if(this.latestDts_!==e.dts){this.numSameDts_=0}this.numSameDts_++;this.latestDts_=e.dts};Be.prototype.flush=function(){if(!this.captionPackets_.length){this.ccStreams_.forEach(function(e){e.flush()},this);return}this.captionPackets_.forEach(function(e,t){e.presortIndex=t});this.captionPackets_.sort(function(e,t){if(e.pts===t.pts){return e.presortIndex-t.presortIndex}return e.pts-t.pts});this.captionPackets_.forEach(function(e){if(e.type<2){this.dispatchCea608Packet(e)}},this);this.captionPackets_.length=0;this.ccStreams_.forEach(function(e){e.flush()},this);return};Be.prototype.reset=function(){this.latestDts_=null;this.ignoreNextEqualDts_=false;this.numSameDts_=0;this.activeCea608Channel_=[null,null];this.ccStreams_.forEach(function(e){e.reset()})};Be.prototype.dispatchCea608Packet=function(e){if(this.setsChannel1Active(e)){this.activeCea608Channel_[e.type]=0}else if(this.setsChannel2Active(e)){this.activeCea608Channel_[e.type]=1}if(this.activeCea608Channel_[e.type]===null){return}this.ccStreams_[(e.type<<1)+this.activeCea608Channel_[e.type]].push(e)};Be.prototype.setsChannel1Active=function(e){return(e.ccData&30720)===4096};Be.prototype.setsChannel2Active=function(e){return(e.ccData&30720)===6144};var Ne={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};var je=function e(t){if(t===null){return""}t=Ne[t]||t;return String.fromCharCode(t)};var Fe=14;var Ve=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152];var He=function e(){var t=[],i=Fe+1;while(i--){t.push("")}return t};var qe=function e(t,i){e.prototype.init.call(this);this.field_=t||0;this.dataChannel_=i||0;this.name_="CC"+((this.field_<<1|this.dataChannel_)+1);this.setConstants();this.reset();this.push=function(e){var t,i,r,n,a;t=e.ccData&32639;if(t===this.lastControlCode_){this.lastControlCode_=null;return}if((t&61440)===4096){this.lastControlCode_=t}else if(t!==this.PADDING_){this.lastControlCode_=null}r=t>>>8;n=t&255;if(t===this.PADDING_){return}else if(t===this.RESUME_CAPTION_LOADING_){this.mode_="popOn"}else if(t===this.END_OF_CAPTION_){this.mode_="popOn";this.clearFormatting(e.pts);this.flushDisplayed(e.pts);i=this.displayed_;this.displayed_=this.nonDisplayed_;this.nonDisplayed_=i;this.startPts_=e.pts}else if(t===this.ROLL_UP_2_ROWS_){this.rollUpRows_=2;this.setRollUp(e.pts)}else if(t===this.ROLL_UP_3_ROWS_){this.rollUpRows_=3;this.setRollUp(e.pts)}else if(t===this.ROLL_UP_4_ROWS_){this.rollUpRows_=4;this.setRollUp(e.pts)}else if(t===this.CARRIAGE_RETURN_){this.clearFormatting(e.pts);this.flushDisplayed(e.pts);this.shiftRowsUp_();this.startPts_=e.pts}else if(t===this.BACKSPACE_){if(this.mode_==="popOn"){this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1)}else{this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1)}}else if(t===this.ERASE_DISPLAYED_MEMORY_){this.flushDisplayed(e.pts);this.displayed_=He()}else if(t===this.ERASE_NON_DISPLAYED_MEMORY_){this.nonDisplayed_=He()}else if(t===this.RESUME_DIRECT_CAPTIONING_){if(this.mode_!=="paintOn"){this.flushDisplayed(e.pts);this.displayed_=He()}this.mode_="paintOn";this.startPts_=e.pts}else if(this.isSpecialCharacter(r,n)){r=(r&3)<<8;a=je(r|n);this[this.mode_](e.pts,a);this.column_++}else if(this.isExtCharacter(r,n)){if(this.mode_==="popOn"){this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1)}else{this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1)}r=(r&3)<<8;a=je(r|n);this[this.mode_](e.pts,a);this.column_++}else if(this.isMidRowCode(r,n)){this.clearFormatting(e.pts);this[this.mode_](e.pts," ");this.column_++;if((n&14)===14){this.addFormatting(e.pts,["i"])}if((n&1)===1){this.addFormatting(e.pts,["u"])}}else if(this.isOffsetControlCode(r,n)){this.column_+=n&3}else if(this.isPAC(r,n)){var s=Ve.indexOf(t&7968);if(this.mode_==="rollUp"){if(s-this.rollUpRows_+1<0){s=this.rollUpRows_-1}this.setRollUp(e.pts,s)}if(s!==this.row_){this.clearFormatting(e.pts);this.row_=s}if(n&1&&this.formatting_.indexOf("u")===-1){this.addFormatting(e.pts,["u"])}if((t&16)===16){this.column_=((t&14)>>1)*4}if(this.isColorPAC(n)){if((n&14)===14){this.addFormatting(e.pts,["i"])}}}else if(this.isNormalChar(r)){if(n===0){n=null}a=je(r);a+=je(n);this[this.mode_](e.pts,a);this.column_+=a.length}}};qe.prototype=new K;qe.prototype.flushDisplayed=function(e){var t=this.displayed_.map(function(e){try{return e.trim()}catch(e){console.error("Skipping malformed caption.");return""}}).join("\n").replace(/^\n+|\n+$/g,"");if(t.length){this.trigger("data",{startPts:this.startPts_,endPts:e,text:t,stream:this.name_})}};qe.prototype.reset=function(){this.mode_="popOn";this.topRow_=0;this.startPts_=0;this.displayed_=He();this.nonDisplayed_=He();this.lastControlCode_=null;this.column_=0;this.row_=Fe;this.rollUpRows_=2;this.formatting_=[]};qe.prototype.setConstants=function(){if(this.dataChannel_===0){this.BASE_=16;this.EXT_=17;this.CONTROL_=(20|this.field_)<<8;this.OFFSET_=23}else if(this.dataChannel_===1){this.BASE_=24;this.EXT_=25;this.CONTROL_=(28|this.field_)<<8;this.OFFSET_=31}this.PADDING_=0;this.RESUME_CAPTION_LOADING_=this.CONTROL_|32;this.END_OF_CAPTION_=this.CONTROL_|47;this.ROLL_UP_2_ROWS_=this.CONTROL_|37;this.ROLL_UP_3_ROWS_=this.CONTROL_|38;this.ROLL_UP_4_ROWS_=this.CONTROL_|39;this.CARRIAGE_RETURN_=this.CONTROL_|45;this.RESUME_DIRECT_CAPTIONING_=this.CONTROL_|41;this.BACKSPACE_=this.CONTROL_|33;this.ERASE_DISPLAYED_MEMORY_=this.CONTROL_|44;this.ERASE_NON_DISPLAYED_MEMORY_=this.CONTROL_|46};qe.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&t>=48&&t<=63};qe.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&t>=32&&t<=63};qe.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&t>=32&&t<=47};qe.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&t>=33&&t<=35};qe.prototype.isPAC=function(e,t){return e>=this.BASE_&&e<this.BASE_+8&&t>=64&&t<=127};qe.prototype.isColorPAC=function(e){return e>=64&&e<=79||e>=96&&e<=127};qe.prototype.isNormalChar=function(e){return e>=32&&e<=127};qe.prototype.setRollUp=function(e,t){if(this.mode_!=="rollUp"){this.row_=Fe;this.mode_="rollUp";this.flushDisplayed(e);this.nonDisplayed_=He();this.displayed_=He()}if(t!==undefined&&t!==this.row_){for(var i=0;i<this.rollUpRows_;i++){this.displayed_[t-i]=this.displayed_[this.row_-i];this.displayed_[this.row_-i]=""}}if(t===undefined){t=this.row_}this.topRow_=t-this.rollUpRows_+1};qe.prototype.addFormatting=function(e,t){this.formatting_=this.formatting_.concat(t);var i=t.reduce(function(e,t){return e+"<"+t+">"},"");this[this.mode_](e,i)};qe.prototype.clearFormatting=function(e){if(!this.formatting_.length){return}var t=this.formatting_.reverse().reduce(function(e,t){return e+"</"+t+">"},"");this.formatting_=[];this[this.mode_](e,t)};qe.prototype.popOn=function(e,t){var i=this.nonDisplayed_[this.row_];i+=t;this.nonDisplayed_[this.row_]=i};qe.prototype.rollUp=function(e,t){var i=this.displayed_[this.row_];i+=t;this.displayed_[this.row_]=i};qe.prototype.shiftRowsUp_=function(){var e;for(e=0;e<this.topRow_;e++){this.displayed_[e]=""}for(e=this.row_+1;e<Fe+1;e++){this.displayed_[e]=""}for(e=this.topRow_;e<this.row_;e++){this.displayed_[e]=this.displayed_[e+1]}this.displayed_[this.row_]=""};qe.prototype.paintOn=function(e,t){var i=this.displayed_[this.row_];i+=t;this.displayed_[this.row_]=i};var ze={CaptionStream:Be,Cea608Stream:qe};var We={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21};var Ge=8589934592;var Xe=4294967296;var Ye=function e(t,i){var r=1;if(t>i){r=-1}while(Math.abs(i-t)>Xe){t+=r*Ge}return t};var Ke=function e(t){var i,r;e.prototype.init.call(this);this.type_=t;this.push=function(e){if(e.type!==this.type_){return}if(r===undefined){r=e.dts}e.dts=Ye(e.dts,r);e.pts=Ye(e.pts,r);i=e.dts;this.trigger("data",e)};this.flush=function(){r=i;this.trigger("done")};this.discontinuity=function(){r=void 0;i=void 0}};Ke.prototype=new K;var $e={TimestampRolloverStream:Ke,handleRollover:Ye};var Qe=function e(t,i,r){var n,a="";for(n=i;n<r;n++){a+="%"+("00"+t[n].toString(16)).slice(-2)}return a},Je=function e(t,i,r){return decodeURIComponent(Qe(t,i,r))},Ze=function e(t,i,r){return unescape(Qe(t,i,r))},et=function e(t){return t[0]<<21|t[1]<<14|t[2]<<7|t[3]},tt={TXXX:function e(t){var i;if(t.data[0]!==3){return}for(i=1;i<t.data.length;i++){if(t.data[i]===0){t.description=Je(t.data,1,i);t.value=Je(t.data,i+1,t.data.length).replace(/\0*$/,"");break}}t.data=t.value},WXXX:function e(t){var i;if(t.data[0]!==3){return}for(i=1;i<t.data.length;i++){if(t.data[i]===0){t.description=Je(t.data,1,i);t.url=Je(t.data,i+1,t.data.length);break}}},PRIV:function e(t){var i;for(i=0;i<t.data.length;i++){if(t.data[i]===0){t.owner=Ze(t.data,0,i);break}}t.privateData=t.data.subarray(i+1);t.data=t.privateData}},it;it=function e(t){var i={debug:!!(t&&t.debug),descriptor:t&&t.descriptor},r=0,n=[],a=0,s;it.prototype.init.call(this);this.dispatchType=We.METADATA_STREAM_TYPE.toString(16);if(i.descriptor){for(s=0;s<i.descriptor.length;s++){this.dispatchType+=("00"+i.descriptor[s].toString(16)).slice(-2)}}this.push=function(e){var t,s,o,u,l,c;if(e.type!=="timed-metadata"){return}if(e.dataAlignmentIndicator){a=0;n.length=0}if(n.length===0&&(e.data.length<10||e.data[0]!=="I".charCodeAt(0)||e.data[1]!=="D".charCodeAt(0)||e.data[2]!=="3".charCodeAt(0))){if(i.debug){console.log("Skipping unrecognized metadata packet")}return}n.push(e);a+=e.data.byteLength;if(n.length===1){r=et(e.data.subarray(6,10));r+=10}if(a<r){return}t={data:new Uint8Array(r),frames:[],pts:n[0].pts,dts:n[0].dts};for(l=0;l<r;){t.data.set(n[0].data.subarray(0,r-l),l);l+=n[0].data.byteLength;a-=n[0].data.byteLength;n.shift()}s=10;if(t.data[5]&64){s+=4;s+=et(t.data.subarray(10,14));r-=et(t.data.subarray(16,20))}do{o=et(t.data.subarray(s+4,s+8));if(o<1){return console.log("Malformed ID3 frame encountered. Skipping metadata parsing.")}c=String.fromCharCode(t.data[s],t.data[s+1],t.data[s+2],t.data[s+3]);u={id:c,data:t.data.subarray(s+10,s+o+10)};u.key=u.id;if(tt[u.id]){tt[u.id](u);if(u.owner==="com.apple.streaming.transportStreamTimestamp"){var f=u.data,d=(f[3]&1)<<30|f[4]<<22|f[5]<<14|f[6]<<6|f[7]>>>2;d*=4;d+=f[7]&3;u.timeStamp=d;if(t.pts===undefined&&t.dts===undefined){t.pts=u.timeStamp;t.dts=u.timeStamp}this.trigger("timestamp",u)}}t.frames.push(u);s+=10;s+=o}while(s<r);this.trigger("data",t)}};it.prototype=new K;var rt=it;var nt=$e.TimestampRolloverStream;var at,st,ot;var ut=188,lt=71;at=function e(){var t=new Uint8Array(ut),i=0;at.prototype.init.call(this);this.push=function(e){var r=0,n=ut,a;if(i){a=new Uint8Array(e.byteLength+i);a.set(t.subarray(0,i));a.set(e,i);i=0}else{a=e}while(n<a.byteLength){if(a[r]===lt&&a[n]===lt){this.trigger("data",a.subarray(r,n));r+=ut;n+=ut;continue}r++;n++}if(r<a.byteLength){t.set(a.subarray(r),0);i=a.byteLength-r}};this.flush=function(){if(i===ut&&t[0]===lt){this.trigger("data",t);i=0}this.trigger("done")}};at.prototype=new K;st=function e(){var t,i,r,n;st.prototype.init.call(this);n=this;this.packetsWaitingForPmt=[];this.programMapTable=undefined;t=function e(t,n){var a=0;if(n.payloadUnitStartIndicator){a+=t[a]+1}if(n.type==="pat"){i(t.subarray(a),n)}else{r(t.subarray(a),n)}};i=function e(t,i){i.section_number=t[7];i.last_section_number=t[8];n.pmtPid=(t[10]&31)<<8|t[11];i.pmtPid=n.pmtPid};r=function e(t,i){var r,a,s,o;if(!(t[5]&1)){return}n.programMapTable={video:null,audio:null,"timed-metadata":{}};r=(t[1]&15)<<8|t[2];a=3+r-4;s=(t[10]&15)<<8|t[11];o=12+s;while(o<a){var u=t[o];var l=(t[o+1]&31)<<8|t[o+2];if(u===We.H264_STREAM_TYPE&&n.programMapTable.video===null){n.programMapTable.video=l}else if(u===We.ADTS_STREAM_TYPE&&n.programMapTable.audio===null){n.programMapTable.audio=l}else if(u===We.METADATA_STREAM_TYPE){n.programMapTable["timed-metadata"][l]=u}o+=((t[o+3]&15)<<8|t[o+4])+5}i.programMapTable=n.programMapTable};this.push=function(e){var i={},r=4;i.payloadUnitStartIndicator=!!(e[1]&64);i.pid=e[1]&31;i.pid<<=8;i.pid|=e[2];if((e[3]&48)>>>4>1){r+=e[r]+1}if(i.pid===0){i.type="pat";t(e.subarray(r),i);this.trigger("data",i)}else if(i.pid===this.pmtPid){i.type="pmt";t(e.subarray(r),i);this.trigger("data",i);while(this.packetsWaitingForPmt.length){this.processPes_.apply(this,this.packetsWaitingForPmt.shift())}}else if(this.programMapTable===undefined){this.packetsWaitingForPmt.push([e,r,i])}else{this.processPes_(e,r,i)}};this.processPes_=function(e,t,i){if(i.pid===this.programMapTable.video){i.streamType=We.H264_STREAM_TYPE}else if(i.pid===this.programMapTable.audio){i.streamType=We.ADTS_STREAM_TYPE}else{i.streamType=this.programMapTable["timed-metadata"][i.pid]}i.type="pes";i.data=e.subarray(t);this.trigger("data",i)}};st.prototype=new K;st.STREAM_TYPES={h264:27,adts:15};ot=function e(){var t=this,i={data:[],size:0},r={data:[],size:0},n={data:[],size:0},a=function e(t,i){var r;i.packetLength=6+(t[4]<<8|t[5]);i.dataAlignmentIndicator=(t[6]&4)!==0;r=t[7];if(r&192){i.pts=(t[9]&14)<<27|(t[10]&255)<<20|(t[11]&254)<<12|(t[12]&255)<<5|(t[13]&254)>>>3;i.pts*=4;i.pts+=(t[13]&6)>>>1;i.dts=i.pts;if(r&64){i.dts=(t[14]&14)<<27|(t[15]&255)<<20|(t[16]&254)<<12|(t[17]&255)<<5|(t[18]&254)>>>3;i.dts*=4;i.dts+=(t[18]&6)>>>1}}i.data=t.subarray(9+t[8])},s=function e(i,r,n){var s=new Uint8Array(i.size),o={type:r},u=0,l=0,c=false,f;if(!i.data.length||i.size<9){return}o.trackId=i.data[0].pid;for(u=0;u<i.data.length;u++){f=i.data[u];s.set(f.data,l);l+=f.data.byteLength}a(s,o);c=r==="video"||o.packetLength<=i.size;if(n||c){i.size=0;i.data.length=0}if(c){t.trigger("data",o)}};ot.prototype.init.call(this);this.push=function(e){({pat:function e(){},pes:function t(){var a,o;switch(e.streamType){case We.H264_STREAM_TYPE:case We.H264_STREAM_TYPE:a=i;o="video";break;case We.ADTS_STREAM_TYPE:a=r;o="audio";break;case We.METADATA_STREAM_TYPE:a=n;o="timed-metadata";break;default:return}if(e.payloadUnitStartIndicator){s(a,o,true)}a.data.push(e);a.size+=e.data.byteLength},pmt:function i(){var r={type:"metadata",tracks:[]},n=e.programMapTable;if(n.video!==null){r.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+n.video,codec:"avc",type:"video"})}if(n.audio!==null){r.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+n.audio,codec:"adts",type:"audio"})}t.trigger("data",r)}})[e.type]()};this.flush=function(){s(i,"video");s(r,"audio");s(n,"timed-metadata");this.trigger("done")}};ot.prototype=new K;var ct={PAT_PID:0,MP2T_PACKET_LENGTH:ut,TransportPacketStream:at,TransportParseStream:st,ElementaryStream:ot,TimestampRolloverStream:nt,CaptionStream:ze.CaptionStream,Cea608Stream:ze.Cea608Stream,MetadataStream:rt};for(var ft in We){if(We.hasOwnProperty(ft)){ct[ft]=We[ft]}}var dt=ct;var ht;var pt=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];ht=function e(){var t;ht.prototype.init.call(this);this.push=function(e){var i=0,r=0,n,a,s,o,u,l;if(e.type!=="audio"){return}if(t){o=t;t=new Uint8Array(o.byteLength+e.data.byteLength);t.set(o);t.set(e.data,o.byteLength)}else{t=e.data}while(i+5<t.length){if(t[i]!==255||(t[i+1]&246)!==240){i++;continue}a=(~t[i+1]&1)*2;n=(t[i+3]&3)<<11|t[i+4]<<3|(t[i+5]&224)>>5;u=((t[i+6]&3)+1)*1024;l=u*9e4/pt[(t[i+2]&60)>>>2];s=i+n;if(t.byteLength<s){return}this.trigger("data",{pts:e.pts+r*l,dts:e.dts+r*l,sampleCount:u,audioobjecttype:(t[i+2]>>>6&3)+1,channelcount:(t[i+2]&1)<<2|(t[i+3]&192)>>>6,samplerate:pt[(t[i+2]&60)>>>2],samplingfrequencyindex:(t[i+2]&60)>>>2,samplesize:16,data:t.subarray(i+7+a,s)});if(t.byteLength===s){t=undefined;return}r++;t=t.subarray(s)}};this.flush=function(){this.trigger("done")}};ht.prototype=new K;var mt=ht;var vt;vt=function e(t){var i=t.byteLength,r=0,n=0;this.length=function(){return 8*i};this.bitsAvailable=function(){return 8*i+n};this.loadWord=function(){var e=t.byteLength-i,a=new Uint8Array(4),s=Math.min(4,i);if(s===0){throw new Error("no bytes available")}a.set(t.subarray(e,e+s));r=new DataView(a.buffer).getUint32(0);n=s*8;i-=s};this.skipBits=function(e){var t;if(n>e){r<<=e;n-=e}else{e-=n;t=Math.floor(e/8);e-=t*8;i-=t;this.loadWord();r<<=e;n-=e}};this.readBits=function(e){var t=Math.min(n,e),a=r>>>32-t;n-=t;if(n>0){r<<=t}else if(i>0){this.loadWord()}t=e-t;if(t>0){return a<<t|this.readBits(t)}return a};this.skipLeadingZeros=function(){var e;for(e=0;e<n;++e){if((r&2147483648>>>e)!==0){r<<=e;n-=e;return e}}this.loadWord();return 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();if(1&e){return 1+e>>>1}return-1*(e>>>1)};this.readBoolean=function(){return this.readBits(1)===1};this.readUnsignedByte=function(){return this.readBits(8)};this.loadWord()};var gt=vt;var yt,_t;var bt;_t=function e(){var t=0,i,r;_t.prototype.init.call(this);this.push=function(e){var n;if(!r){r=e.data}else{n=new Uint8Array(r.byteLength+e.data.byteLength);n.set(r);n.set(e.data,r.byteLength);r=n}for(;t<r.byteLength-3;t++){if(r[t+2]===1){i=t+5;break}}while(i<r.byteLength){switch(r[i]){case 0:if(r[i-1]!==0){i+=2;break}else if(r[i-2]!==0){i++;break}if(t+3!==i-2){this.trigger("data",r.subarray(t+3,i-2))}do{i++}while(r[i]!==1&&i<r.length);t=i-2;i+=3;break;case 1:if(r[i-1]!==0||r[i-2]!==0){i+=3;break}this.trigger("data",r.subarray(t+3,i-2));t=i-2;i+=3;break;default:i+=3;break}}r=r.subarray(t);i-=t;t=0};this.flush=function(){if(r&&r.byteLength>3){this.trigger("data",r.subarray(t+3))}r=null;t=0;this.trigger("done")}};_t.prototype=new K;bt={100:true,110:true,122:true,244:true,44:true,83:true,86:true,118:true,128:true,138:true,139:true,134:true};yt=function e(){var t=new _t,i,r,n,a,s,o,u;yt.prototype.init.call(this);i=this;this.push=function(e){if(e.type!=="video"){return}r=e.trackId;n=e.pts;a=e.dts;t.push(e)};t.on("data",function(e){var t={trackId:r,pts:n,dts:a,data:e};switch(e[0]&31){case 5:t.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:t.nalUnitType="sei_rbsp";t.escapedRBSP=s(e.subarray(1));break;case 7:t.nalUnitType="seq_parameter_set_rbsp";t.escapedRBSP=s(e.subarray(1));t.config=o(t.escapedRBSP);break;case 8:t.nalUnitType="pic_parameter_set_rbsp";break;case 9:t.nalUnitType="access_unit_delimiter_rbsp";break;default:break}i.trigger("data",t)});t.on("done",function(){i.trigger("done")});this.flush=function(){t.flush()};u=function e(t,i){var r=8,n=8,a,s;for(a=0;a<t;a++){if(n!==0){s=i.readExpGolomb();n=(r+s+256)%256}r=n===0?r:n}};s=function e(t){var i=t.byteLength,r=[],n=1,a,s;while(n<i-2){if(t[n]===0&&t[n+1]===0&&t[n+2]===3){r.push(n+2);n+=2}else{n++}}if(r.length===0){return t}a=i-r.length;s=new Uint8Array(a);var o=0;for(n=0;n<a;o++,n++){if(o===r[0]){o++;r.shift()}s[n]=t[o]}return s};o=function e(t){var i=0,r=0,n=0,a=0,s=1,o,l,c,f,d,h,p,m,v,g,y,_,b,T;o=new gt(t);l=o.readUnsignedByte();f=o.readUnsignedByte();c=o.readUnsignedByte();o.skipUnsignedExpGolomb();if(bt[l]){d=o.readUnsignedExpGolomb();if(d===3){o.skipBits(1)}o.skipUnsignedExpGolomb();o.skipUnsignedExpGolomb();o.skipBits(1);if(o.readBoolean()){y=d!==3?8:12;for(T=0;T<y;T++){if(o.readBoolean()){if(T<6){u(16,o)}else{u(64,o)}}}}}o.skipUnsignedExpGolomb();h=o.readUnsignedExpGolomb();if(h===0){o.readUnsignedExpGolomb()}else if(h===1){o.skipBits(1);o.skipExpGolomb();o.skipExpGolomb();p=o.readUnsignedExpGolomb();for(T=0;T<p;T++){o.skipExpGolomb()}}o.skipUnsignedExpGolomb();o.skipBits(1);m=o.readUnsignedExpGolomb();v=o.readUnsignedExpGolomb();g=o.readBits(1);if(g===0){o.skipBits(1)}o.skipBits(1);if(o.readBoolean()){i=o.readUnsignedExpGolomb();r=o.readUnsignedExpGolomb();n=o.readUnsignedExpGolomb();a=o.readUnsignedExpGolomb()}if(o.readBoolean()){if(o.readBoolean()){b=o.readUnsignedByte();switch(b){case 1:_=[1,1];break;case 2:_=[12,11];break;case 3:_=[10,11];break;case 4:_=[16,11];break;case 5:_=[40,33];break;case 6:_=[24,11];break;case 7:_=[20,11];break;case 8:_=[32,11];break;case 9:_=[80,33];break;case 10:_=[18,11];break;case 11:_=[15,11];break;case 12:_=[64,33];break;case 13:_=[160,99];break;case 14:_=[4,3];break;case 15:_=[3,2];break;case 16:_=[2,1];break;case 255:{_=[o.readUnsignedByte()<<8|o.readUnsignedByte(),o.readUnsignedByte()<<8|o.readUnsignedByte()];break}}if(_){s=_[0]/_[1]}}}return{profileIdc:l,levelIdc:c,profileCompatibility:f,width:Math.ceil(((m+1)*16-i*2-r*2)*s),height:(2-g)*(v+1)*16-n*2-a*2}}};yt.prototype=new K;var Tt={H264Stream:yt,NalByteStream:_t};var St=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];var kt=function e(t){if(t[0]==="I".charCodeAt(0)&&t[1]==="D".charCodeAt(0)&&t[2]==="3".charCodeAt(0)){return true}return false};var wt=function e(t){return t[0]<<21|t[1]<<14|t[2]<<7|t[3]};var Ct=function e(t,i,r){var n,a="";for(n=i;n<r;n++){a+="%"+("00"+t[n].toString(16)).slice(-2)}return a};var Et=function e(t,i,r){return unescape(Ct(t,i,r))};var At=function e(t,i){var r=t[i+6]<<21|t[i+7]<<14|t[i+8]<<7|t[i+9],n=t[i+5],a=(n&16)>>4;if(a){return r+20}return r+10};var Lt=function e(t,i){var r=(t[i+5]&224)>>5,n=t[i+4]<<3,a=t[i+3]&3<<11;return a|n|r};var It=function e(t,i){if(t[i]==="I".charCodeAt(0)&&t[i+1]==="D".charCodeAt(0)&&t[i+2]==="3".charCodeAt(0)){return"timed-metadata"}else if(t[i]&255===255&&(t[i+1]&240)===240){return"audio"}return null};var Pt=function e(t){var i=0;while(i+5<t.length){if(t[i]!==255||(t[i+1]&246)!==240){i++;continue}return St[(t[i+2]&60)>>>2]}return null};var Ot=function e(t){var i,r,n,a;i=10;if(t[5]&64){i+=4;i+=wt(t.subarray(10,14))}do{r=wt(t.subarray(i+4,i+8));if(r<1){return null}a=String.fromCharCode(t[i],t[i+1],t[i+2],t[i+3]);if(a==="PRIV"){n=t.subarray(i+10,i+r+10);for(var s=0;s<n.byteLength;s++){if(n[s]===0){var o=Et(n,0,s);if(o==="com.apple.streaming.transportStreamTimestamp"){var u=n.subarray(s+1);var l=(u[3]&1)<<30|u[4]<<22|u[5]<<14|u[6]<<6|u[7]>>>2;l*=4;l+=u[7]&3;return l}break}}}i+=10;i+=r}while(i<t.byteLength);return null};var Ut={isLikelyAacData:kt,parseId3TagSize:At,parseAdtsSize:Lt,parseType:It,parseSampleRate:Pt,parseAacTimestamp:Ot};var Dt;Dt=function e(){var t=new Uint8Array,i=0;Dt.prototype.init.call(this);this.setTimestamp=function(e){i=e};this.push=function(e){var r=0,n=0,a,s,o,u;if(t.length){u=t.length;t=new Uint8Array(e.byteLength+u);t.set(t.subarray(0,u));t.set(e,u)}else{t=e}while(t.length-n>=3){if(t[n]==="I".charCodeAt(0)&&t[n+1]==="D".charCodeAt(0)&&t[n+2]==="3".charCodeAt(0)){if(t.length-n<10){break}r=Ut.parseId3TagSize(t,n);if(n+r>t.length){break}s={type:"timed-metadata",data:t.subarray(n,n+r)};this.trigger("data",s);n+=r;continue}else if((t[n]&255)===255&&(t[n+1]&240)===240){if(t.length-n<7){break}r=Ut.parseAdtsSize(t,n);if(n+r>t.length){break}o={type:"audio",data:t.subarray(n,n+r),pts:i,dts:i};this.trigger("data",o);n+=r;continue}n++}a=t.length-n;if(a>0){t=t.subarray(n)}else{t=new Uint8Array}}};Dt.prototype=new K;var xt=Dt;var Rt=Tt.H264Stream;var Mt=Ut.isLikelyAacData;var Bt=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"];var Nt=["width","height","profileIdc","levelIdc","profileCompatibility"];var jt,Ft,Vt,Ht;var qt=function e(t,i){var r;if(t.length!==i.length){return false}for(r=0;r<t.length;r++){if(t[r]!==i[r]){return false}}return true};var zt=function e(t,i,r,n,a,s){var o=r-i,u=n-i,l=a-r;return{start:{dts:t,pts:t+o},end:{dts:t+u,pts:t+l},prependedContentDuration:s,baseMediaDecodeTime:t}};Ft=function e(t,i){var r=[],n=0,a=0,s=0,o=Infinity;i=i||{};Ft.prototype.init.call(this);this.push=function(e){Ie.collectDtsInfo(t,e);if(t){Bt.forEach(function(i){t[i]=e[i]})}r.push(e)};this.setEarliestDts=function(e){a=e-t.timelineStartInfo.baseMediaDecodeTime};this.setVideoBaseMediaDecodeTime=function(e){o=e};this.setAudioAppendStart=function(e){s=e};this.flush=function(){var e,u,l,c;if(r.length===0){this.trigger("done","AudioSegmentStream");return}e=we.trimAdtsFramesByEarliestDts(r,t,a);t.baseMediaDecodeTime=Ie.calculateTrackBaseMediaDecodeTime(t,i.keepOriginalTimestamps);we.prefixWithSilence(t,e,s,o);t.samples=we.generateSampleTable(e);l=N.mdat(we.concatenateFrameData(e));r=[];u=N.moof(n,[t]);c=new Uint8Array(u.byteLength+l.byteLength);n++;c.set(u);c.set(l,u.byteLength);Ie.clearDtsInfo(t);this.trigger("data",{track:t,boxes:c});this.trigger("done","AudioSegmentStream")}};Ft.prototype=new K;jt=function e(t,i){var r=0,n=[],a=[],s,o;i=i||{};jt.prototype.init.call(this);delete t.minPTS;this.gopCache_=[];this.push=function(e){Ie.collectDtsInfo(t,e);if(e.nalUnitType==="seq_parameter_set_rbsp"&&!s){s=e.config;t.sps=[e.data];Nt.forEach(function(e){t[e]=s[e]},this)}if(e.nalUnitType==="pic_parameter_set_rbsp"&&!o){o=e.data;t.pps=[e.data]}n.push(e)};this.flush=function(){var e,s,o,u,l,c,f=0,d,h;while(n.length){if(n[0].nalUnitType==="access_unit_delimiter_rbsp"){break}n.shift()}if(n.length===0){this.resetStream_();this.trigger("done","VideoSegmentStream");return}e=re.groupNalsIntoFrames(n);o=re.groupFramesIntoGops(e);if(!o[0][0].keyFrame){s=this.getGopForFusion_(n[0],t);if(s){f=s.duration;o.unshift(s);o.byteLength+=s.byteLength;o.nalCount+=s.nalCount;o.pts=s.pts;o.dts=s.dts;o.duration+=s.duration}else{o=re.extendFirstKeyFrame(o)}}if(a.length){var p;if(i.alignGopsAtEnd){p=this.alignGopsAtEnd_(o)}else{p=this.alignGopsAtStart_(o)}if(!p){this.gopCache_.unshift({gop:o.pop(),pps:t.pps,sps:t.sps});this.gopCache_.length=Math.min(6,this.gopCache_.length);n=[];this.resetStream_();this.trigger("done","VideoSegmentStream");return}Ie.clearDtsInfo(t);o=p}Ie.collectDtsInfo(t,o);t.samples=re.generateSampleTable(o);l=N.mdat(re.concatenateNalData(o));t.baseMediaDecodeTime=Ie.calculateTrackBaseMediaDecodeTime(t,i.keepOriginalTimestamps);this.trigger("processedGopsInfo",o.map(function(e){return{pts:e.pts,dts:e.dts,byteLength:e.byteLength}}));d=o[0];h=o[o.length-1];this.trigger("segmentTimingInfo",zt(t.baseMediaDecodeTime,d.dts,d.pts,h.dts+h.duration,h.pts+h.duration,f));this.gopCache_.unshift({gop:o.pop(),pps:t.pps,sps:t.sps});this.gopCache_.length=Math.min(6,this.gopCache_.length);n=[];this.trigger("baseMediaDecodeTime",t.baseMediaDecodeTime);this.trigger("timelineStartInfo",t.timelineStartInfo);u=N.moof(r,[t]);c=new Uint8Array(u.byteLength+l.byteLength);r++;c.set(u);c.set(l,u.byteLength);this.trigger("data",{track:t,boxes:c});this.resetStream_();this.trigger("done","VideoSegmentStream")};this.resetStream_=function(){Ie.clearDtsInfo(t);s=undefined;o=undefined};this.getGopForFusion_=function(e){var i=45e3,r=1e4,n=Infinity,a,s,o,u,l;for(l=0;l<this.gopCache_.length;l++){u=this.gopCache_[l];o=u.gop;if(!(t.pps&&qt(t.pps[0],u.pps[0]))||!(t.sps&&qt(t.sps[0],u.sps[0]))){continue}if(o.dts<t.timelineStartInfo.dts){continue}a=e.dts-o.dts-o.duration;if(a>=-r&&a<=i){if(!s||n>a){s=u;n=a}}}if(s){return s.gop}return null};this.alignGopsAtStart_=function(e){var t,i,r,n,s,o,u,l;s=e.byteLength;o=e.nalCount;u=e.duration;t=i=0;while(t<a.length&&i<e.length){r=a[t];n=e[i];if(r.pts===n.pts){break}if(n.pts>r.pts){t++;continue}i++;s-=n.byteLength;o-=n.nalCount;u-=n.duration}if(i===0){return e}if(i===e.length){return null}l=e.slice(i);l.byteLength=s;l.duration=u;l.nalCount=o;l.pts=l[0].pts;l.dts=l[0].dts;return l};this.alignGopsAtEnd_=function(e){var t,i,r,n,s,o;t=a.length-1;i=e.length-1;s=null;o=false;while(t>=0&&i>=0){r=a[t];n=e[i];if(r.pts===n.pts){o=true;break}if(r.pts>n.pts){t--;continue}if(t===a.length-1){s=i}i--}if(!o&&s===null){return null}var u;if(o){u=i}else{u=s}if(u===0){return e}var l=e.slice(u);var c=l.reduce(function(e,t){e.byteLength+=t.byteLength;e.duration+=t.duration;e.nalCount+=t.nalCount;return e},{byteLength:0,duration:0,nalCount:0});l.byteLength=c.byteLength;l.duration=c.duration;l.nalCount=c.nalCount;l.pts=l[0].pts;l.dts=l[0].dts;return l};this.alignGopsWith=function(e){a=e}};jt.prototype=new K;Ht=function e(t,i){this.numberOfTracks=0;this.metadataStream=i;t=t||{};if(typeof t.remux!=="undefined"){this.remuxTracks=!!t.remux}else{this.remuxTracks=true}if(typeof t.keepOriginalTimestamps==="boolean"){this.keepOriginalTimestamps=t.keepOriginalTimestamps}this.pendingTracks=[];this.videoTrack=null;this.pendingBoxes=[];this.pendingCaptions=[];this.pendingMetadata=[];this.pendingBytes=0;this.emittedTracks=0;Ht.prototype.init.call(this);this.push=function(e){if(e.text){return this.pendingCaptions.push(e)}if(e.frames){return this.pendingMetadata.push(e)}this.pendingTracks.push(e.track);this.pendingBoxes.push(e.boxes);this.pendingBytes+=e.boxes.byteLength;if(e.track.type==="video"){this.videoTrack=e.track}if(e.track.type==="audio"){this.audioTrack=e.track}}};Ht.prototype=new K;Ht.prototype.flush=function(e){var t=0,i={captions:[],captionStreams:{},metadata:[],info:{}},r,n,a,s=0,o;if(this.pendingTracks.length<this.numberOfTracks){if(e!=="VideoSegmentStream"&&e!=="AudioSegmentStream"){return}else if(this.remuxTracks){return}else if(this.pendingTracks.length===0){this.emittedTracks++;if(this.emittedTracks>=this.numberOfTracks){this.trigger("done");this.emittedTracks=0}return}}if(this.videoTrack){s=this.videoTrack.timelineStartInfo.pts;Nt.forEach(function(e){i.info[e]=this.videoTrack[e]},this)}else if(this.audioTrack){s=this.audioTrack.timelineStartInfo.pts;Bt.forEach(function(e){i.info[e]=this.audioTrack[e]},this)}if(this.pendingTracks.length===1){i.type=this.pendingTracks[0].type}else{i.type="combined"}this.emittedTracks+=this.pendingTracks.length;a=N.initSegment(this.pendingTracks);i.initSegment=new Uint8Array(a.byteLength);i.initSegment.set(a);i.data=new Uint8Array(this.pendingBytes);for(o=0;o<this.pendingBoxes.length;o++){i.data.set(this.pendingBoxes[o],t);t+=this.pendingBoxes[o].byteLength}for(o=0;o<this.pendingCaptions.length;o++){r=this.pendingCaptions[o];r.startTime=r.startPts;if(!this.keepOriginalTimestamps){r.startTime-=s}r.startTime/=9e4;r.endTime=r.endPts;if(!this.keepOriginalTimestamps){r.endTime-=s}r.endTime/=9e4;i.captionStreams[r.stream]=true;i.captions.push(r)}for(o=0;o<this.pendingMetadata.length;o++){n=this.pendingMetadata[o];n.cueTime=n.pts;if(!this.keepOriginalTimestamps){n.cueTime-=s}n.cueTime/=9e4;i.metadata.push(n)}i.metadata.dispatchType=this.metadataStream.dispatchType;this.pendingTracks.length=0;this.videoTrack=null;this.pendingBoxes.length=0;this.pendingCaptions.length=0;this.pendingBytes=0;this.pendingMetadata.length=0;this.trigger("data",i);if(this.emittedTracks>=this.numberOfTracks){this.trigger("done");this.emittedTracks=0}};Vt=function e(t){var i=this,r=true,n,a;Vt.prototype.init.call(this);t=t||{};this.baseMediaDecodeTime=t.baseMediaDecodeTime||0;this.transmuxPipeline_={};this.setupAacPipeline=function(){var e={};this.transmuxPipeline_=e;e.type="aac";e.metadataStream=new dt.MetadataStream;e.aacStream=new xt;e.audioTimestampRolloverStream=new dt.TimestampRolloverStream("audio");e.timedMetadataTimestampRolloverStream=new dt.TimestampRolloverStream("timed-metadata");e.adtsStream=new mt;e.coalesceStream=new Ht(t,e.metadataStream);e.headOfPipeline=e.aacStream;e.aacStream.pipe(e.audioTimestampRolloverStream).pipe(e.adtsStream);e.aacStream.pipe(e.timedMetadataTimestampRolloverStream).pipe(e.metadataStream).pipe(e.coalesceStream);e.metadataStream.on("timestamp",function(t){e.aacStream.setTimestamp(t.timeStamp)});e.aacStream.on("data",function(r){if(r.type==="timed-metadata"&&!e.audioSegmentStream){a=a||{timelineStartInfo:{baseMediaDecodeTime:i.baseMediaDecodeTime},codec:"adts",type:"audio"};e.coalesceStream.numberOfTracks++;e.audioSegmentStream=new Ft(a,t);e.adtsStream.pipe(e.audioSegmentStream).pipe(e.coalesceStream)}});e.coalesceStream.on("data",this.trigger.bind(this,"data"));e.coalesceStream.on("done",this.trigger.bind(this,"done"))};this.setupTsPipeline=function(){var e={};this.transmuxPipeline_=e;e.type="ts";e.metadataStream=new dt.MetadataStream;e.packetStream=new dt.TransportPacketStream;e.parseStream=new dt.TransportParseStream;e.elementaryStream=new dt.ElementaryStream;e.videoTimestampRolloverStream=new dt.TimestampRolloverStream("video");e.audioTimestampRolloverStream=new dt.TimestampRolloverStream("audio");e.timedMetadataTimestampRolloverStream=new dt.TimestampRolloverStream("timed-metadata");e.adtsStream=new mt;e.h264Stream=new Rt;e.captionStream=new dt.CaptionStream;e.coalesceStream=new Ht(t,e.metadataStream);e.headOfPipeline=e.packetStream;e.packetStream.pipe(e.parseStream).pipe(e.elementaryStream);e.elementaryStream.pipe(e.videoTimestampRolloverStream).pipe(e.h264Stream);e.elementaryStream.pipe(e.audioTimestampRolloverStream).pipe(e.adtsStream);e.elementaryStream.pipe(e.timedMetadataTimestampRolloverStream).pipe(e.metadataStream).pipe(e.coalesceStream);e.h264Stream.pipe(e.captionStream).pipe(e.coalesceStream);e.elementaryStream.on("data",function(r){var s;if(r.type==="metadata"){s=r.tracks.length;while(s--){if(!n&&r.tracks[s].type==="video"){n=r.tracks[s];n.timelineStartInfo.baseMediaDecodeTime=i.baseMediaDecodeTime}else if(!a&&r.tracks[s].type==="audio"){a=r.tracks[s];a.timelineStartInfo.baseMediaDecodeTime=i.baseMediaDecodeTime}}if(n&&!e.videoSegmentStream){e.coalesceStream.numberOfTracks++;e.videoSegmentStream=new jt(n,t);e.videoSegmentStream.on("timelineStartInfo",function(t){if(a){a.timelineStartInfo=t;e.audioSegmentStream.setEarliestDts(t.dts)}});e.videoSegmentStream.on("processedGopsInfo",i.trigger.bind(i,"gopInfo"));e.videoSegmentStream.on("segmentTimingInfo",i.trigger.bind(i,"videoSegmentTimingInfo"));e.videoSegmentStream.on("baseMediaDecodeTime",function(t){if(a){e.audioSegmentStream.setVideoBaseMediaDecodeTime(t)}});e.h264Stream.pipe(e.videoSegmentStream).pipe(e.coalesceStream)}if(a&&!e.audioSegmentStream){e.coalesceStream.numberOfTracks++;e.audioSegmentStream=new Ft(a,t);e.adtsStream.pipe(e.audioSegmentStream).pipe(e.coalesceStream)}}});e.coalesceStream.on("data",this.trigger.bind(this,"data"));e.coalesceStream.on("done",this.trigger.bind(this,"done"))};this.setBaseMediaDecodeTime=function(e){var i=this.transmuxPipeline_;if(!t.keepOriginalTimestamps){this.baseMediaDecodeTime=e}if(a){a.timelineStartInfo.dts=undefined;a.timelineStartInfo.pts=undefined;Ie.clearDtsInfo(a);if(!t.keepOriginalTimestamps){a.timelineStartInfo.baseMediaDecodeTime=e}if(i.audioTimestampRolloverStream){i.audioTimestampRolloverStream.discontinuity()}}if(n){if(i.videoSegmentStream){i.videoSegmentStream.gopCache_=[];i.videoTimestampRolloverStream.discontinuity()}n.timelineStartInfo.dts=undefined;n.timelineStartInfo.pts=undefined;Ie.clearDtsInfo(n);i.captionStream.reset();if(!t.keepOriginalTimestamps){n.timelineStartInfo.baseMediaDecodeTime=e}}if(i.timedMetadataTimestampRolloverStream){i.timedMetadataTimestampRolloverStream.discontinuity()}};this.setAudioAppendStart=function(e){if(a){this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(e)}};this.alignGopsWith=function(e){if(n&&this.transmuxPipeline_.videoSegmentStream){this.transmuxPipeline_.videoSegmentStream.alignGopsWith(e)}};this.push=function(e){if(r){var t=Mt(e);if(t&&this.transmuxPipeline_.type!=="aac"){this.setupAacPipeline()}else if(!t&&this.transmuxPipeline_.type!=="ts"){this.setupTsPipeline()}r=false}this.transmuxPipeline_.headOfPipeline.push(e)};this.flush=function(){r=true;this.transmuxPipeline_.headOfPipeline.flush()};this.resetCaptions=function(){if(this.transmuxPipeline_.captionStream){this.transmuxPipeline_.captionStream.reset()}}};Vt.prototype=new K;var Wt={Transmuxer:Vt,VideoSegmentStream:jt,AudioSegmentStream:Ft,AUDIO_PROPERTIES:Bt,VIDEO_PROPERTIES:Nt,generateVideoSegmentTimingInfo:zt};var Gt,Xt,Yt=X.parseType,Kt=function e(t){return new Date(t*1e3-20828448e5)},$t=function e(t){return{isLeading:(t[0]&12)>>>2,dependsOn:t[0]&3,isDependedOn:(t[1]&192)>>>6,hasRedundancy:(t[1]&48)>>>4,paddingValue:(t[1]&14)>>>1,isNonSyncSample:t[1]&1,degradationPriority:t[2]<<8|t[3]}},Qt=function e(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength),r=[],n,a;for(n=0;n+4<t.length;n+=a){a=i.getUint32(n);n+=4;if(a<=0){r.push("<span style='color:red;'>MALFORMED DATA</span>");continue}switch(t[n]&31){case 1:r.push("slice_layer_without_partitioning_rbsp");break;case 5:r.push("slice_layer_without_partitioning_rbsp_idr");break;case 6:r.push("sei_rbsp");break;case 7:r.push("seq_parameter_set_rbsp");break;case 8:r.push("pic_parameter_set_rbsp");break;case 9:r.push("access_unit_delimiter_rbsp");break;default:r.push("UNKNOWN NAL - "+t[n]&31);break}}return r},Jt={avc1:function e(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength);return{dataReferenceIndex:i.getUint16(6),width:i.getUint16(24),height:i.getUint16(26),horizresolution:i.getUint16(28)+i.getUint16(30)/16,vertresolution:i.getUint16(32)+i.getUint16(34)/16,frameCount:i.getUint16(40),depth:i.getUint16(74),config:Gt(t.subarray(78,t.byteLength))}},avcC:function e(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength),r={configurationVersion:t[0],avcProfileIndication:t[1],profileCompatibility:t[2],avcLevelIndication:t[3],lengthSizeMinusOne:t[4]&3,sps:[],pps:[]},n=t[5]&31,a,s,o,u;o=6;for(u=0;u<n;u++){s=i.getUint16(o);o+=2;r.sps.push(new Uint8Array(t.subarray(o,o+s)));o+=s}a=t[o];o++;for(u=0;u<a;u++){s=i.getUint16(o);o+=2;r.pps.push(new Uint8Array(t.subarray(o,o+s)));o+=s}return r},btrt:function e(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength);return{bufferSizeDB:i.getUint32(0),maxBitrate:i.getUint32(4),avgBitrate:i.getUint32(8)}},esds:function e(t){return{version:t[0],flags:new Uint8Array(t.subarray(1,4)),esId:t[6]<<8|t[7],streamPriority:t[8]&31,decoderConfig:{objectProfileIndication:t[11],streamType:t[12]>>>2&63,bufferSize:t[13]<<16|t[14]<<8|t[15],maxBitrate:t[16]<<24|t[17]<<16|t[18]<<8|t[19],avgBitrate:t[20]<<24|t[21]<<16|t[22]<<8|t[23],decoderConfigDescriptor:{tag:t[24],length:t[25],audioObjectType:t[26]>>>3&31,samplingFrequencyIndex:(t[26]&7)<<1|t[27]>>>7&1,channelConfiguration:t[27]>>>3&15}}}},ftyp:function e(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength),r={majorBrand:Yt(t.subarray(0,4)),minorVersion:i.getUint32(4),compatibleBrands:[]},n=8;while(n<t.byteLength){r.compatibleBrands.push(Yt(t.subarray(n,n+4)));n+=4}return r},dinf:function e(t){return{boxes:Gt(t)}},dref:function e(t){return{version:t[0],flags:new Uint8Array(t.subarray(1,4)),dataReferences:Gt(t.subarray(8))}},hdlr:function e(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength),r={version:i.getUint8(0),flags:new Uint8Array(t.subarray(1,4)),handlerType:Yt(t.subarray(8,12)),name:""},n=8;for(n=24;n<t.byteLength;n++){if(t[n]===0){n++;break}r.name+=String.fromCharCode(t[n])}r.name=decodeURIComponent(escape(r.name));return r},mdat:function e(t){return{byteLength:t.byteLength,nals:Qt(t)}},mdhd:function e(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength),r=4,n,a={version:i.getUint8(0),flags:new Uint8Array(t.subarray(1,4)),language:""};if(a.version===1){r+=4;a.creationTime=Kt(i.getUint32(r));r+=8;a.modificationTime=Kt(i.getUint32(r));r+=4;a.timescale=i.getUint32(r);r+=8;a.duration=i.getUint32(r)}else{a.creationTime=Kt(i.getUint32(r));r+=4;a.modificationTime=Kt(i.getUint32(r));r+=4;a.timescale=i.getUint32(r);r+=4;a.duration=i.getUint32(r)}r+=4;n=i.getUint16(r);a.language+=String.fromCharCode((n>>10)+96);a.language+=String.fromCharCode(((n&992)>>5)+96);a.language+=String.fromCharCode((n&31)+96);return a},mdia:function e(t){return{boxes:Gt(t)}},mfhd:function e(t){return{version:t[0],flags:new Uint8Array(t.subarray(1,4)),sequenceNumber:t[4]<<24|t[5]<<16|t[6]<<8|t[7]}},minf:function e(t){return{boxes:Gt(t)}},mp4a:function e(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength),r={dataReferenceIndex:i.getUint16(6),channelcount:i.getUint16(16),samplesize:i.getUint16(18),samplerate:i.getUint16(24)+i.getUint16(26)/65536};if(t.byteLength>28){r.streamDescriptor=Gt(t.subarray(28))[0]}return r},moof:function e(t){return{boxes:Gt(t)}},moov:function e(t){return{boxes:Gt(t)}},mvex:function e(t){return{boxes:Gt(t)}},mvhd:function e(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength),r=4,n={version:i.getUint8(0),flags:new Uint8Array(t.subarray(1,4))};if(n.version===1){r+=4;n.creationTime=Kt(i.getUint32(r));r+=8;n.modificationTime=Kt(i.getUint32(r));r+=4;n.timescale=i.getUint32(r);r+=8;n.duration=i.getUint32(r)}else{n.creationTime=Kt(i.getUint32(r));r+=4;n.modificationTime=Kt(i.getUint32(r));r+=4;n.timescale=i.getUint32(r);r+=4;n.duration=i.getUint32(r)}r+=4;n.rate=i.getUint16(r)+i.getUint16(r+2)/16;r+=4;n.volume=i.getUint8(r)+i.getUint8(r+1)/8;r+=2;r+=2;r+=2*4;n.matrix=new Uint32Array(t.subarray(r,r+9*4));r+=9*4;r+=6*4;n.nextTrackId=i.getUint32(r);return n},pdin:function e(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength);return{version:i.getUint8(0),flags:new Uint8Array(t.subarray(1,4)),rate:i.getUint32(4),initialDelay:i.getUint32(8)}},sdtp:function e(t){var i={version:t[0],flags:new Uint8Array(t.subarray(1,4)),samples:[]},r;for(r=4;r<t.byteLength;r++){i.samples.push({dependsOn:(t[r]&48)>>4,isDependedOn:(t[r]&12)>>2,hasRedundancy:t[r]&3})}return i},sidx:function e(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength),r={version:t[0],flags:new Uint8Array(t.subarray(1,4)),references:[],referenceId:i.getUint32(4),timescale:i.getUint32(8),earliestPresentationTime:i.getUint32(12),firstOffset:i.getUint32(16)},n=i.getUint16(22),a;for(a=24;n;a+=12,n--){r.references.push({referenceType:(t[a]&128)>>>7,referencedSize:i.getUint32(a)&2147483647,subsegmentDuration:i.getUint32(a+4),startsWithSap:!!(t[a+8]&128),sapType:(t[a+8]&112)>>>4,sapDeltaTime:i.getUint32(a+8)&268435455})}return r},smhd:function e(t){return{version:t[0],flags:new Uint8Array(t.subarray(1,4)),balance:t[4]+t[5]/256}},stbl:function e(t){return{boxes:Gt(t)}},stco:function e(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength),r={version:t[0],flags:new Uint8Array(t.subarray(1,4)),chunkOffsets:[]},n=i.getUint32(4),a;for(a=8;n;a+=4,n--){r.chunkOffsets.push(i.getUint32(a))}return r},stsc:function e(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength),r=i.getUint32(4),n={version:t[0],flags:new Uint8Array(t.subarray(1,4)),sampleToChunks:[]},a;for(a=8;r;a+=12,r--){n.sampleToChunks.push({firstChunk:i.getUint32(a),samplesPerChunk:i.getUint32(a+4),sampleDescriptionIndex:i.getUint32(a+8)})}return n},stsd:function e(t){return{version:t[0],flags:new Uint8Array(t.subarray(1,4)),sampleDescriptions:Gt(t.subarray(8))}},stsz:function e(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength),r={version:t[0],flags:new Uint8Array(t.subarray(1,4)),sampleSize:i.getUint32(4),entries:[]},n;for(n=12;n<t.byteLength;n+=4){r.entries.push(i.getUint32(n))}return r},stts:function e(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength),r={version:t[0],flags:new Uint8Array(t.subarray(1,4)),timeToSamples:[]},n=i.getUint32(4),a;for(a=8;n;a+=8,n--){r.timeToSamples.push({sampleCount:i.getUint32(a),sampleDelta:i.getUint32(a+4)})}return r},styp:function e(t){return Jt.ftyp(t)},tfdt:function e(t){var i={version:t[0],flags:new Uint8Array(t.subarray(1,4)),baseMediaDecodeTime:t[4]<<24|t[5]<<16|t[6]<<8|t[7]};if(i.version===1){i.baseMediaDecodeTime*=Math.pow(2,32);i.baseMediaDecodeTime+=t[8]<<24|t[9]<<16|t[10]<<8|t[11]}return i},tfhd:function e(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength),r={version:t[0],flags:new Uint8Array(t.subarray(1,4)),trackId:i.getUint32(4)},n=r.flags[2]&1,a=r.flags[2]&2,s=r.flags[2]&8,o=r.flags[2]&16,u=r.flags[2]&32,l=r.flags[0]&65536,c=r.flags[0]&131072,f;f=8;if(n){f+=4;r.baseDataOffset=i.getUint32(12);f+=4}if(a){r.sampleDescriptionIndex=i.getUint32(f);f+=4}if(s){r.defaultSampleDuration=i.getUint32(f);f+=4}if(o){r.defaultSampleSize=i.getUint32(f);f+=4}if(u){r.defaultSampleFlags=i.getUint32(f)}if(l){r.durationIsEmpty=true}if(!n&&c){r.baseDataOffsetIsMoof=true}return r},tkhd:function e(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength),r=4,n={version:i.getUint8(0),flags:new Uint8Array(t.subarray(1,4))};if(n.version===1){r+=4;n.creationTime=Kt(i.getUint32(r));r+=8;n.modificationTime=Kt(i.getUint32(r));r+=4;n.trackId=i.getUint32(r);r+=4;r+=8;n.duration=i.getUint32(r)}else{n.creationTime=Kt(i.getUint32(r));r+=4;n.modificationTime=Kt(i.getUint32(r));r+=4;n.trackId=i.getUint32(r);r+=4;r+=4;n.duration=i.getUint32(r)}r+=4;r+=2*4;n.layer=i.getUint16(r);r+=2;n.alternateGroup=i.getUint16(r);r+=2;n.volume=i.getUint8(r)+i.getUint8(r+1)/8;r+=2;r+=2;n.matrix=new Uint32Array(t.subarray(r,r+9*4));r+=9*4;n.width=i.getUint16(r)+i.getUint16(r+2)/16;r+=4;n.height=i.getUint16(r)+i.getUint16(r+2)/16;return n},traf:function e(t){return{boxes:Gt(t)}},trak:function e(t){return{boxes:Gt(t)}},trex:function e(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength);return{version:t[0],flags:new Uint8Array(t.subarray(1,4)),trackId:i.getUint32(4),defaultSampleDescriptionIndex:i.getUint32(8),defaultSampleDuration:i.getUint32(12),defaultSampleSize:i.getUint32(16),sampleDependsOn:t[20]&3,sampleIsDependedOn:(t[21]&192)>>6,sampleHasRedundancy:(t[21]&48)>>4,samplePaddingValue:(t[21]&14)>>1,sampleIsDifferenceSample:!!(t[21]&1),sampleDegradationPriority:i.getUint16(22)}},trun:function e(t){var i={version:t[0],flags:new Uint8Array(t.subarray(1,4)),samples:[]},r=new DataView(t.buffer,t.byteOffset,t.byteLength),n=i.flags[2]&1,a=i.flags[2]&4,s=i.flags[1]&1,o=i.flags[1]&2,u=i.flags[1]&4,l=i.flags[1]&8,c=r.getUint32(4),f=8,d;if(n){i.dataOffset=r.getInt32(f);f+=4}if(a&&c){d={flags:$t(t.subarray(f,f+4))};f+=4;if(s){d.duration=r.getUint32(f);f+=4}if(o){d.size=r.getUint32(f);f+=4}if(l){d.compositionTimeOffset=r.getUint32(f);f+=4}i.samples.push(d);c--}while(c--){d={};if(s){d.duration=r.getUint32(f);f+=4}if(o){d.size=r.getUint32(f);f+=4}if(u){d.flags=$t(t.subarray(f,f+4));f+=4}if(l){d.compositionTimeOffset=r.getUint32(f);f+=4}i.samples.push(d)}return i},"url ":function e(t){return{version:t[0],flags:new Uint8Array(t.subarray(1,4))}},vmhd:function e(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength);return{version:t[0],flags:new Uint8Array(t.subarray(1,4)),graphicsmode:i.getUint16(4),opcolor:new Uint16Array([i.getUint16(6),i.getUint16(8),i.getUint16(10)])}}};Gt=function e(t){var i=0,r=[],n,a,s,o,u;var l=new ArrayBuffer(t.length);var c=new Uint8Array(l);for(var f=0;f<t.length;++f){c[f]=t[f]}n=new DataView(l);while(i<t.byteLength){a=n.getUint32(i);s=Yt(t.subarray(i+4,i+8));o=a>1?i+a:t.byteLength;u=(Jt[s]||function(e){return{data:e}})(t.subarray(i+8,o));u.size=a;u.type=s;r.push(u);i=o}return r};Xt=function e(t,i){var r;i=i||0;r=new Array(i*2+1).join(" ");return t.map(function(e,t){return r+e.type+"\n"+Object.keys(e).filter(function(e){return e!=="type"&&e!=="boxes"}).map(function(t){var i=r+" "+t+": ",n=e[t];if(n instanceof Uint8Array||n instanceof Uint32Array){var a=Array.prototype.slice.call(new Uint8Array(n.buffer,n.byteOffset,n.byteLength)).map(function(e){return" "+("00"+e.toString(16)).slice(-2)}).join("").match(/.{1,24}/g);if(!a){return i+"<>"}if(a.length===1){return i+"<"+a.join("").slice(1)+">"}return i+"<\n"+a.map(function(e){return r+" "+e}).join("\n")+"\n"+r+" >"}return i+JSON.stringify(n,null,2).split("\n").map(function(e,t){if(t===0){return e}return r+" "+e}).join("\n")}).join("\n")+(e.boxes?"\n"+Xt(e.boxes,i+1):"")}).join("\n")};var Zt={inspect:Gt,textify:Xt,parseTfdt:Jt.tfdt,parseHdlr:Jt.hdlr,parseTfhd:Jt.tfhd,parseTrun:Jt.trun,parseSidx:Jt.sidx};var ei=Me.discardEmulationPreventionBytes;var ti=ze.CaptionStream;var ii=function e(t,i){var r=t;for(var n=0;n<i.length;n++){var a=i[n];if(r<a.size){return a}r-=a.size}return null};var ri=function e(t,i,r){var n=new DataView(t.buffer,t.byteOffset,t.byteLength),a=[],s,o,u,l;for(o=0;o+4<t.length;o+=u){u=n.getUint32(o);o+=4;if(u<=0){continue}switch(t[o]&31){case 6:var c=t.subarray(o+1,o+1+u);var f=ii(o,i);s={nalUnitType:"sei_rbsp",size:u,data:c,escapedRBSP:ei(c),trackId:r};if(f){s.pts=f.pts;s.dts=f.dts;l=f}else{s.pts=l.pts;s.dts=l.dts}a.push(s);break;default:break}}return a};var ni=function e(t,i,r){var n=i;var a=r.defaultSampleDuration||0;var s=r.defaultSampleSize||0;var o=r.trackId;var u=[];t.forEach(function(e){var t=Zt.parseTrun(e);var i=t.samples;i.forEach(function(e){if(e.duration===undefined){e.duration=a}if(e.size===undefined){e.size=s}e.trackId=o;e.dts=n;if(e.compositionTimeOffset===undefined){e.compositionTimeOffset=0}e.pts=n+e.compositionTimeOffset;n+=e.duration});u=u.concat(i)});return u};var ai=function e(t,i){var r=X.findBox(t,["moof","traf"]);var n=X.findBox(t,["mdat"]);var a={};var s=[];n.forEach(function(e,t){var i=r[t];s.push({mdat:e,traf:i})});s.forEach(function(e){var t=e.mdat;var r=e.traf;var n=X.findBox(r,["tfhd"]);var s=Zt.parseTfhd(n[0]);var o=s.trackId;var u=X.findBox(r,["tfdt"]);var l=u.length>0?Zt.parseTfdt(u[0]).baseMediaDecodeTime:0;var c=X.findBox(r,["trun"]);var f;var d;if(i===o&&c.length>0){f=ni(c,l,s);d=ri(t,f,o);if(!a[o]){a[o]=[]}a[o]=a[o].concat(d)}});return a};var si=function e(t,i,r){var n;if(!i){return null}n=ai(t,i);return{seiNals:n[i],timescale:r}};var oi=function e(){var t=false;var i;var r;var n;var a;var s;this.isInitialized=function(){return t};this.init=function(){i=new ti;t=true;i.on("data",function(e){e.startTime=e.startPts/a;e.endTime=e.endPts/a;s.captions.push(e);s.captionStreams[e.stream]=true})};this.isNewInit=function(e,t){if(e&&e.length===0||t&&typeof t==="object"&&Object.keys(t).length===0){return false}return n!==e[0]||a!==t[n]};this.parse=function(e,t,i){var o;if(!this.isInitialized()){return null}else if(!t||!i){return null}else if(this.isNewInit(t,i)){n=t[0];a=i[n]}else if(!n||!a){r.push(e);return null}while(r.length>0){var u=r.shift();this.parse(u,t,i)}o=si(e,n,a);if(o===null||!o.seiNals){return null}this.pushNals(o.seiNals);this.flushStream();return s};this.pushNals=function(e){if(!this.isInitialized()||!e||e.length===0){return null}e.forEach(function(e){i.push(e)})};this.flushStream=function(){if(!this.isInitialized()){return null}i.flush()};this.clearParsedCaptions=function(){s.captions=[];s.captionStreams={}};this.resetCaptionStream=function(){if(!this.isInitialized()){return null}i.reset()};this.clearAllCaptions=function(){this.clearParsedCaptions();this.resetCaptionStream()};this.reset=function(){r=[];n=null;a=null;if(!s){s={captions:[],captionStreams:{}}}else{this.clearParsedCaptions()}this.resetCaptionStream()};this.reset()};var ui=oi;var li={generator:N,probe:X,Transmuxer:Wt.Transmuxer,AudioSegmentStream:Wt.AudioSegmentStream,VideoSegmentStream:Wt.VideoSegmentStream,CaptionParser:ui};var ci=function e(t,i){if(!(t instanceof i)){throw new TypeError("Cannot call a class as a function")}};var fi=function(){function e(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||false;r.configurable=true;if("value"in r)r.writable=true;Object.defineProperty(e,r.key,r)}}return function(t,i,r){if(i)e(t.prototype,i);if(r)e(t,r);return t}}();var di=function e(t,i){i.on("data",function(e){var i=e.initSegment;e.initSegment={data:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength};var r=e.data;e.data=r.buffer;t.postMessage({action:"data",segment:e,byteOffset:r.byteOffset,byteLength:r.byteLength},[e.data])});if(i.captionStream){i.captionStream.on("data",function(e){t.postMessage({action:"caption",data:e})})}i.on("done",function(e){t.postMessage({action:"done"})});i.on("gopInfo",function(e){t.postMessage({action:"gopInfo",gopInfo:e})});i.on("videoSegmentTimingInfo",function(e){t.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:e})})};var hi=function(){function e(t,i){ci(this,e);this.options=i||{};this.self=t;this.init()}fi(e,[{key:"init",value:function e(){if(this.transmuxer){this.transmuxer.dispose()}this.transmuxer=new li.Transmuxer(this.options);di(this.self,this.transmuxer)}},{key:"push",value:function e(t){var i=new Uint8Array(t.data,t.byteOffset,t.byteLength);this.transmuxer.push(i)}},{key:"reset",value:function e(){this.init()}},{key:"setTimestampOffset",value:function e(t){var i=t.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(i*9e4))}},{key:"setAudioAppendStart",value:function e(t){this.transmuxer.setAudioAppendStart(Math.ceil(t.appendStart*9e4))}},{key:"flush",value:function e(t){this.transmuxer.flush()}},{key:"resetCaptions",value:function e(){this.transmuxer.resetCaptions()}},{key:"alignGopsWith",value:function e(t){this.transmuxer.alignGopsWith(t.gopsToAlignWith.slice())}}]);return e}();var pi=function e(t){t.onmessage=function(e){if(e.data.action==="init"&&e.data.options){this.messageHandlers=new hi(t,e.data.options);return}if(!this.messageHandlers){this.messageHandlers=new hi(t)}if(e.data&&e.data.action&&e.data.action!=="init"){if(this.messageHandlers[e.data.action]){this.messageHandlers[e.data.action](e.data)}}}};var mi=new pi(i);return mi}()});var bh={videoCodec:"avc1",videoObjectTypeIndicator:".4d400d",audioProfile:"2"};var Th=function e(t){return t.map(function(e){return e.replace(/avc1\.(\d+)\.(\d+)/i,function(e,t,i){var r=("00"+Number(t).toString(16)).slice(-2);var n=("00"+Number(i).toString(16)).slice(-2);return"avc1."+r+"00"+n})})};var Sh=function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"";var i={codecCount:0};var r=void 0;i.codecCount=t.split(",").length;i.codecCount=i.codecCount||2;r=/(^|\s|,)+(avc[13])([^ ,]*)/i.exec(t);if(r){i.videoCodec=r[2];i.videoObjectTypeIndicator=r[3]}i.audioProfile=/(^|\s|,)+mp4a.[0-9A-Fa-f]+\.([0-9A-Fa-f]+)/i.exec(t);i.audioProfile=i.audioProfile&&i.audioProfile[2];return i};var kh=function e(t){return t.replace(/avc1\.(\d+)\.(\d+)/i,function(e){return Th([e])[0]})};var wh=function e(t,i,r){return t+"/"+i+'; codecs="'+r.filter(function(e){return!!e}).join(", ")+'"'};var Ch=function e(t){if(t.segments&&t.segments.length&&t.segments[0].map){return"mp4"}return"mp2t"};var Eh=function e(t){var i=t.attributes||{};if(i.CODECS){return Sh(i.CODECS)}return bh};var Ah=function e(t,i){if(!t.mediaGroups.AUDIO||!i){return null}var r=t.mediaGroups.AUDIO[i];if(!r){return null}for(var n in r){var a=r[n];if(a.default&&a.playlists){return Sh(a.playlists[0].attributes.CODECS).audioProfile}}return null};var Lh=function e(t,i){var r=Ch(i);var n=Eh(i);var a=i.attributes||{};var s=true;var o=false;if(!i){return[]}if(t.mediaGroups.AUDIO&&a.AUDIO){var u=t.mediaGroups.AUDIO[a.AUDIO];if(u){o=true;s=false;for(var l in u){if(!u[l].uri&&!u[l].playlists){s=true;break}}}}if(o&&!n.audioProfile){if(!s){n.audioProfile=Ah(t,a.AUDIO)}if(!n.audioProfile){Is.log.warn("Multiple audio tracks present but no audio codec string is specified. "+"Attempting to use the default audio codec (mp4a.40.2)");n.audioProfile=bh.audioProfile}}var c={};if(n.videoCodec){c.video=""+n.videoCodec+n.videoObjectTypeIndicator}if(n.audioProfile){c.audio="mp4a.40."+n.audioProfile}var f=wh("audio",r,[c.audio]);var d=wh("video",r,[c.video]);var h=wh("video",r,[c.video,c.audio]);if(o){if(!s&&c.video){return[d,f]}if(!s&&!c.video){return[f,f]}return[h,f]}if(!c.video){return[f]}return[h]};var Ih=function e(t){var i={type:"",parameters:{}};var r=t.trim().split(";");i.type=r.shift().trim();r.forEach(function(e){var t=e.trim().split("=");if(t.length>1){var r=t[0].replace(/"/g,"").trim();var n=t[1].replace(/"/g,"").trim();i.parameters[r]=n}});return i};var Ph=function e(t){return/mp4a\.\d+.\d+/i.test(t)};var Oh=function e(t){return/avc1\.[\da-f]+/i.test(t)};var Uh=function e(t,i,r){if(typeof i==="undefined"||i===null||!t.length){return[]}var n=Math.ceil((i-r+3)*9e4);var a=void 0;for(a=0;a<t.length;a++){if(t[a].pts>n){break}}return t.slice(a)};var Dh=function e(t,i,r){if(!i.length){return t}if(r){return i.slice()}var n=i[0].pts;var a=0;for(a;a<t.length;a++){if(t[a].pts>=n){break}}return t.slice(0,a).concat(i)};var xh=function e(t,i,r,n){var a=Math.ceil((i-n)*9e4);var s=Math.ceil((r-n)*9e4);var o=t.slice();var u=t.length;while(u--){if(t[u].pts<=s){break}}if(u===-1){return o}var l=u+1;while(l--){if(t[l].pts<=a){break}}l=Math.max(l,0);o.splice(l,u-l+1);return o};var Rh=function e(t,i,r){var n=null;var a=null;var s=0;var o=[];var u=[];if(!t&&!i){return Is.createTimeRange()}if(!t){return i.buffered}if(!i){return t.buffered}if(r){return t.buffered}if(t.buffered.length===0&&i.buffered.length===0){return Is.createTimeRange()}var l=t.buffered;var c=i.buffered;var f=l.length;while(f--){o.push({time:l.start(f),type:"start"});o.push({time:l.end(f),type:"end"})}f=c.length;while(f--){o.push({time:c.start(f),type:"start"});o.push({time:c.end(f),type:"end"})}o.sort(function(e,t){return e.time-t.time});for(f=0;f<o.length;f++){if(o[f].type==="start"){s++;if(s===2){n=o[f].time}}else if(o[f].type==="end"){s--;if(s===1){a=o[f].time}}if(n!==null&&a!==null){u.push([n,a]);n=null;a=null}}return Is.createTimeRanges(u)};var Mh=9e4;var Bh=function e(t,i){var r=t.addSourceBuffer(i);var n=Object.create(null);n.updating=false;n.realBuffer_=r;var a=function e(t){if(typeof r[t]==="function"){n[t]=function(){return r[t].apply(r,arguments)}}else if(typeof n[t]==="undefined"){Object.defineProperty(n,t,{get:function e(){return r[t]},set:function e(i){return r[t]=i}})}};for(var s in r){a(s)}return n};var Nh=function(e){Hf(t,e);function t(e,i){jf(this,t);var r=qf(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,Is.EventTarget));r.timestampOffset_=0;r.pendingBuffers_=[];r.bufferUpdating_=false;r.mediaSource_=e;r.codecs_=i;r.audioCodec_=null;r.videoCodec_=null;r.audioDisabled_=false;r.appendAudioInitSegment_=true;r.gopBuffer_=[];r.timeMapping_=0;r.safeAppend_=Is.browser.IE_VERSION>=11;var n={remux:false,alignGopsAtEnd:r.safeAppend_};r.codecs_.forEach(function(e){if(Ph(e)){r.audioCodec_=e}else if(Oh(e)){r.videoCodec_=e}});r.transmuxer_=new _h;r.transmuxer_.postMessage({action:"init",options:n});r.transmuxer_.onmessage=function(e){if(e.data.action==="data"){return r.data_(e)}if(e.data.action==="done"){return r.done_(e)}if(e.data.action==="gopInfo"){return r.appendGopInfo_(e)}if(e.data.action==="videoSegmentTimingInfo"){return r.videoSegmentTimingInfo_(e.data.videoSegmentTimingInfo)}};Object.defineProperty(r,"timestampOffset",{get:function e(){return this.timestampOffset_},set:function e(t){if(typeof t==="number"&&t>=0){this.timestampOffset_=t;this.appendAudioInitSegment_=true;this.gopBuffer_.length=0;this.timeMapping_=0;this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:t})}}});Object.defineProperty(r,"appendWindowStart",{get:function e(){return(this.videoBuffer_||this.audioBuffer_).appendWindowStart},set:function e(t){if(this.videoBuffer_){this.videoBuffer_.appendWindowStart=t}if(this.audioBuffer_){this.audioBuffer_.appendWindowStart=t}}});Object.defineProperty(r,"updating",{get:function e(){return!!(this.bufferUpdating_||!this.audioDisabled_&&this.audioBuffer_&&this.audioBuffer_.updating||this.videoBuffer_&&this.videoBuffer_.updating)}});Object.defineProperty(r,"buffered",{get:function e(){return Rh(this.videoBuffer_,this.audioBuffer_,this.audioDisabled_)}});return r}Ff(t,[{key:"data_",value:function e(t){var i=t.data.segment;i.data=new Uint8Array(i.data,t.data.byteOffset,t.data.byteLength);i.initSegment=new Uint8Array(i.initSegment.data,i.initSegment.byteOffset,i.initSegment.byteLength);ih(this,this.mediaSource_,i);this.pendingBuffers_.push(i);return}},{key:"done_",value:function e(t){if(this.mediaSource_.readyState==="closed"){this.pendingBuffers_.length=0;return}this.processPendingSegments_();return}},{key:"videoSegmentTimingInfo_",value:function e(t){var i={start:{decode:t.start.dts/Mh,presentation:t.start.pts/Mh},end:{decode:t.end.dts/Mh,presentation:t.end.pts/Mh},baseMediaDecodeTime:t.baseMediaDecodeTime/Mh};if(t.prependedContentDuration){i.prependedContentDuration=t.prependedContentDuration/Mh}this.trigger({type:"videoSegmentTimingInfo",videoSegmentTimingInfo:i})}},{key:"createRealSourceBuffers_",value:function e(){var t=this;var i=["audio","video"];i.forEach(function(e){if(!t[e+"Codec_"]){return}if(t[e+"Buffer_"]){return}var r=null;if(t.mediaSource_[e+"Buffer_"]){r=t.mediaSource_[e+"Buffer_"];r.updating=false}else{var n=e+"Codec_";var a=e+'/mp4;codecs="'+t[n]+'"';r=Bh(t.mediaSource_.nativeMediaSource_,a);t.mediaSource_[e+"Buffer_"]=r}t[e+"Buffer_"]=r;["update","updatestart","updateend"].forEach(function(n){r.addEventListener(n,function(){if(e==="audio"&&t.audioDisabled_){return}if(n==="updateend"){t[e+"Buffer_"].updating=false}var r=i.every(function(i){if(i==="audio"&&t.audioDisabled_){return true}if(e!==i&&t[i+"Buffer_"]&&t[i+"Buffer_"].updating){return false}return true});if(r){return t.trigger(n)}})})})}},{key:"appendBuffer",value:function e(t){this.bufferUpdating_=true;if(this.audioBuffer_&&this.audioBuffer_.buffered.length){var i=this.audioBuffer_.buffered;this.transmuxer_.postMessage({action:"setAudioAppendStart",appendStart:i.end(i.length-1)})}if(this.videoBuffer_){this.transmuxer_.postMessage({action:"alignGopsWith",gopsToAlignWith:Uh(this.gopBuffer_,this.mediaSource_.player_?this.mediaSource_.player_.currentTime():null,this.timeMapping_)})}this.transmuxer_.postMessage({action:"push",data:t.buffer,byteOffset:t.byteOffset,byteLength:t.byteLength},[t.buffer]);this.transmuxer_.postMessage({action:"flush"})}},{key:"appendGopInfo_",value:function e(t){this.gopBuffer_=Dh(this.gopBuffer_,t.data.gopInfo,this.safeAppend_)}},{key:"remove",value:function e(t,i){if(this.videoBuffer_){this.videoBuffer_.updating=true;this.videoBuffer_.remove(t,i);this.gopBuffer_=xh(this.gopBuffer_,t,i,this.timeMapping_)}if(!this.audioDisabled_&&this.audioBuffer_){this.audioBuffer_.updating=true;this.audioBuffer_.remove(t,i)}rh(t,i,this.metadataTrack_);if(this.inbandTextTracks_){for(var r in this.inbandTextTracks_){rh(t,i,this.inbandTextTracks_[r])}}}},{key:"processPendingSegments_",value:function e(){var t={video:{segments:[],bytes:0},audio:{segments:[],bytes:0},captions:[],metadata:[]};t=this.pendingBuffers_.reduce(function(e,t){var i=t.type;var r=t.data;var n=t.initSegment;e[i].segments.push(r);e[i].bytes+=r.byteLength;e[i].initSegment=n;if(t.captions){e.captions=e.captions.concat(t.captions)}if(t.info){e[i].info=t.info}if(t.metadata){e.metadata=e.metadata.concat(t.metadata)}return e},t);if(!this.videoBuffer_&&!this.audioBuffer_){if(t.video.bytes===0){this.videoCodec_=null}if(t.audio.bytes===0){this.audioCodec_=null}this.createRealSourceBuffers_()}if(t.audio.info){this.mediaSource_.trigger({type:"audioinfo",info:t.audio.info})}if(t.video.info){this.mediaSource_.trigger({type:"videoinfo",info:t.video.info})}if(this.appendAudioInitSegment_){if(!this.audioDisabled_&&this.audioBuffer_){t.audio.segments.unshift(t.audio.initSegment);t.audio.bytes+=t.audio.initSegment.byteLength}this.appendAudioInitSegment_=false}var i=false;if(this.videoBuffer_&&t.video.bytes){t.video.segments.unshift(t.video.initSegment);t.video.bytes+=t.video.initSegment.byteLength;this.concatAndAppendSegments_(t.video,this.videoBuffer_)}else if(this.videoBuffer_&&(this.audioDisabled_||!this.audioBuffer_)){i=true}sh(this,t.captions,t.metadata);if(!this.audioDisabled_&&this.audioBuffer_){this.concatAndAppendSegments_(t.audio,this.audioBuffer_)}this.pendingBuffers_.length=0;if(i){this.trigger("updateend")}this.bufferUpdating_=false}},{key:"concatAndAppendSegments_",value:function e(t,i){var r=0;var n=void 0;if(t.bytes){n=new Uint8Array(t.bytes);t.segments.forEach(function(e){n.set(e,r);r+=e.byteLength});try{i.updating=true;i.appendBuffer(n)}catch(e){if(this.mediaSource_.player_){this.mediaSource_.player_.error({code:-3,type:"APPEND_BUFFER_ERR",message:e.message,originalError:e})}}}}},{key:"abort",value:function e(){if(this.videoBuffer_){this.videoBuffer_.abort()}if(!this.audioDisabled_&&this.audioBuffer_){this.audioBuffer_.abort()}if(this.transmuxer_){this.transmuxer_.postMessage({action:"reset"})}this.pendingBuffers_.length=0;this.bufferUpdating_=false}}]);return t}(Is.EventTarget);var jh=function(i){Hf(r,i);function r(){jf(this,r);var i=qf(this,(r.__proto__||Object.getPrototypeOf(r)).call(this));var n=void 0;i.nativeMediaSource_=new e.MediaSource;for(n in i.nativeMediaSource_){if(!(n in r.prototype)&&typeof i.nativeMediaSource_[n]==="function"){i[n]=i.nativeMediaSource_[n].bind(i.nativeMediaSource_)}}i.duration_=NaN;Object.defineProperty(i,"duration",{get:function e(){if(this.duration_===Infinity){return this.duration_}return this.nativeMediaSource_.duration},set:function e(t){this.duration_=t;if(t!==Infinity){this.nativeMediaSource_.duration=t;return}}});Object.defineProperty(i,"seekable",{get:function e(){if(this.duration_===Infinity){return Is.createTimeRanges([[0,this.nativeMediaSource_.duration]])}return this.nativeMediaSource_.seekable}});Object.defineProperty(i,"readyState",{get:function e(){return this.nativeMediaSource_.readyState}});Object.defineProperty(i,"activeSourceBuffers",{get:function e(){return this.activeSourceBuffers_}});i.sourceBuffers=[];i.activeSourceBuffers_=[];i.updateActiveSourceBuffers_=function(){i.activeSourceBuffers_.length=0;if(i.sourceBuffers.length===1){var e=i.sourceBuffers[0];e.appendAudioInitSegment_=true;e.audioDisabled_=!e.audioCodec_;i.activeSourceBuffers_.push(e);return}var t=false;var r=true;for(var n=0;n<i.player_.audioTracks().length;n++){var a=i.player_.audioTracks()[n];if(a.enabled&&a.kind!=="main"){t=true;r=false;break}}i.sourceBuffers.forEach(function(e,n){e.appendAudioInitSegment_=true;if(e.videoCodec_&&e.audioCodec_){e.audioDisabled_=t}else if(e.videoCodec_&&!e.audioCodec_){e.audioDisabled_=true;r=false}else if(!e.videoCodec_&&e.audioCodec_){e.audioDisabled_=n?r:!r;if(e.audioDisabled_){return}}i.activeSourceBuffers_.push(e)})};i.onPlayerMediachange_=function(){i.sourceBuffers.forEach(function(e){e.appendAudioInitSegment_=true})};i.onHlsReset_=function(){i.sourceBuffers.forEach(function(e){if(e.transmuxer_){e.transmuxer_.postMessage({action:"resetCaptions"})}})};i.onHlsSegmentTimeMapping_=function(e){i.sourceBuffers.forEach(function(t){return t.timeMapping_=e.mapping})};["sourceopen","sourceclose","sourceended"].forEach(function(e){this.nativeMediaSource_.addEventListener(e,this.trigger.bind(this))},i);i.on("sourceopen",function(e){var r=t.querySelector('[src="'+i.url_+'"]');if(!r){return}i.player_=Is(r.parentNode);if(!i.player_){return}i.player_.tech_.on("hls-reset",i.onHlsReset_);i.player_.tech_.on("hls-segment-time-mapping",i.onHlsSegmentTimeMapping_);if(i.player_.audioTracks&&i.player_.audioTracks()){i.player_.audioTracks().on("change",i.updateActiveSourceBuffers_);i.player_.audioTracks().on("addtrack",i.updateActiveSourceBuffers_);i.player_.audioTracks().on("removetrack",i.updateActiveSourceBuffers_)}i.player_.on("mediachange",i.onPlayerMediachange_)});i.on("sourceended",function(e){var t=ah(i.duration);for(var r=0;r<i.sourceBuffers.length;r++){var n=i.sourceBuffers[r];var a=n.metadataTrack_&&n.metadataTrack_.cues;if(a&&a.length){a[a.length-1].endTime=t}}});i.on("sourceclose",function(e){this.sourceBuffers.forEach(function(e){if(e.transmuxer_){e.transmuxer_.terminate()}});this.sourceBuffers.length=0;if(!this.player_){return}if(this.player_.audioTracks&&this.player_.audioTracks()){this.player_.audioTracks().off("change",this.updateActiveSourceBuffers_);this.player_.audioTracks().off("addtrack",this.updateActiveSourceBuffers_);this.player_.audioTracks().off("removetrack",this.updateActiveSourceBuffers_)}if(this.player_.el_){this.player_.off("mediachange",this.onPlayerMediachange_)}if(this.player_.tech_&&this.player_.tech_.el_){this.player_.tech_.off("hls-reset",this.onHlsReset_);this.player_.tech_.off("hls-segment-time-mapping",this.onHlsSegmentTimeMapping_)}});return i}Ff(r,[{key:"addSeekableRange_",value:function e(t,i){var r=void 0;if(this.duration!==Infinity){r=new Error("MediaSource.addSeekableRange() can only be invoked "+"when the duration is Infinity");r.name="InvalidStateError";r.code=11;throw r}if(i>this.nativeMediaSource_.duration||isNaN(this.nativeMediaSource_.duration)){this.nativeMediaSource_.duration=i}}},{key:"addSourceBuffer",value:function e(t){var i=void 0;var r=Ih(t);if(/^(video|audio)\/mp2t$/i.test(r.type)){var n=[];if(r.parameters&&r.parameters.codecs){n=r.parameters.codecs.split(",");n=Th(n);n=n.filter(function(e){return Ph(e)||Oh(e)})}if(n.length===0){n=["avc1.4d400d","mp4a.40.2"]}i=new Nh(this,n);if(this.sourceBuffers.length!==0){this.sourceBuffers[0].createRealSourceBuffers_();i.createRealSourceBuffers_();this.sourceBuffers[0].audioDisabled_=true}}else{i=this.nativeMediaSource_.addSourceBuffer(t)}this.sourceBuffers.push(i);return i}}]);return r}(Is.EventTarget);var Fh=0;Is.mediaSources={};var Vh=function e(t,i){var r=Is.mediaSources[t];if(r){r.trigger({type:"sourceopen",swfId:i})}else{throw new Error("Media Source not found (Video.js)")}};var Hh=function t(){return!!e.MediaSource&&!!e.MediaSource.isTypeSupported&&e.MediaSource.isTypeSupported('video/mp4;codecs="avc1.4d400d,mp4a.40.2"')};var qh=function e(){this.MediaSource={open:Vh,supportsNativeMediaSources:Hh};if(Hh()){return new jh}throw new Error("Cannot use create a virtual MediaSource for this video")};qh.open=Vh;qh.supportsNativeMediaSources=Hh;var zh={createObjectURL:function t(i){var r="blob:vjs-media-source/";var n=void 0;if(i instanceof jh){n=e.URL.createObjectURL(i.nativeMediaSource_);i.url_=n;return n}if(!(i instanceof jh)){n=e.URL.createObjectURL(i);i.url_=n;return n}n=r+Fh;Fh++;Is.mediaSources[n]=i;return n}};Is.MediaSource=qh;Is.URL=zh;var Wh=Is.EventTarget,Gh=Is.mergeOptions;var Xh=function e(t,i){var r=void 0;var n=Gh(t,{duration:i.duration,minimumUpdatePeriod:i.minimumUpdatePeriod});for(var a=0;a<i.playlists.length;a++){var s=Qf(n,i.playlists[a]);if(s){n=s}else{r=true}}Yf(i,function(e,t,i,a){if(e.playlists&&e.playlists.length){var s=e.playlists[0].uri;var o=Qf(n,e.playlists[0]);if(o){n=o;n.mediaGroups[t][i][a].playlists[0]=n.playlists[s];r=false}}});if(r){return null}return n};var Yh=function(t){Hf(i,t);function i(e,t){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var n=arguments[3];jf(this,i);var a=qf(this,(i.__proto__||Object.getPrototypeOf(i)).call(this));var s=r.withCredentials,o=s===undefined?false:s,u=r.handleManifestRedirects,l=u===undefined?false:u;a.hls_=t;a.withCredentials=o;a.handleManifestRedirects=l;if(!e){throw new Error("A non-empty playlist URL or playlist is required")}a.on("minimumUpdatePeriod",function(){a.refreshXml_()});a.on("mediaupdatetimeout",function(){a.refreshMedia_()});a.state="HAVE_NOTHING";a.loadedPlaylists_={};if(typeof e==="string"){a.srcUrl=e;return qf(a)}a.setupChildLoader(n,e);return a}Ff(i,[{key:"setupChildLoader",value:function e(t,i){this.masterPlaylistLoader_=t;this.childPlaylist_=i}},{key:"dispose",value:function t(){this.stopRequest();this.loadedPlaylists_={};e.clearTimeout(this.mediaUpdateTimeout)}},{key:"hasPendingRequest",value:function e(){return this.request||this.mediaRequest_}},{key:"stopRequest",value:function e(){if(this.request){var t=this.request;this.request=null;t.onreadystatechange=null;t.abort()}}},{key:"media",value:function t(i){if(!i){return this.media_}if(this.state==="HAVE_NOTHING"){throw new Error("Cannot switch media playlist from "+this.state)}var r=this.state;if(typeof i==="string"){if(!this.master.playlists[i]){throw new Error("Unknown playlist URI: "+i)}i=this.master.playlists[i]}var n=!this.media_||i.uri!==this.media_.uri;if(n&&this.loadedPlaylists_[i.uri]&&this.loadedPlaylists_[i.uri].endList){this.state="HAVE_METADATA";this.media_=i;if(n){this.trigger("mediachanging");this.trigger("mediachange")}return}if(!n){return}if(this.media_){this.trigger("mediachanging")}this.mediaRequest_=e.setTimeout(this.haveMetadata.bind(this,{startingState:r,playlist:i}),0)}},{key:"haveMetadata",value:function e(t){var i=t.startingState,r=t.playlist;this.state="HAVE_METADATA";this.media_=r;this.loadedPlaylists_[r.uri]=r;this.mediaRequest_=null;this.refreshMedia_();if(i==="HAVE_MASTER"){this.trigger("loadedmetadata")}else{this.trigger("mediachange")}}},{key:"pause",value:function t(){this.stopRequest();e.clearTimeout(this.mediaUpdateTimeout);if(this.state==="HAVE_NOTHING"){this.started=false}}},{key:"load",value:function t(i){var r=this;e.clearTimeout(this.mediaUpdateTimeout);var n=this.media();if(i){var a=n?n.targetDuration/2*1e3:5*1e3;this.mediaUpdateTimeout=e.setTimeout(function(){return r.load()},a);return}if(!this.started){this.start();return}this.trigger("loadedplaylist")}},{key:"parseMasterXml",value:function e(){var t=Vo(this.masterXml_,{manifestUri:this.srcUrl,clientOffset:this.clientOffset_});t.uri=this.srcUrl;for(var i=0;i<t.playlists.length;i++){var r="placeholder-uri-"+i;t.playlists[i].uri=r;t.playlists[r]=t.playlists[i]}Yf(t,function(e,i,r,n){if(e.playlists&&e.playlists.length){var a="placeholder-uri-"+i+"-"+r+"-"+n;e.playlists[0].uri=a;t.playlists[a]=e.playlists[0]}});Jf(t);Zf(t);return t}},{key:"start",value:function t(){var i=this;this.started=true;if(this.masterPlaylistLoader_){this.mediaRequest_=e.setTimeout(this.haveMaster_.bind(this),0);return}this.request=this.hls_.xhr({uri:this.srcUrl,withCredentials:this.withCredentials},function(e,t){if(!i.request){return}i.request=null;if(e){i.error={status:t.status,message:"DASH playlist request error at URL: "+i.srcUrl,responseText:t.responseText,code:2};if(i.state==="HAVE_NOTHING"){i.started=false}return i.trigger("error")}i.masterXml_=t.responseText;if(t.responseHeaders&&t.responseHeaders.date){i.masterLoaded_=Date.parse(t.responseHeaders.date)}else{i.masterLoaded_=Date.now()}i.srcUrl=Nf(i.handleManifestRedirects,i.srcUrl,t);i.syncClientServerClock_(i.onClientServerClockSync_.bind(i))})}},{key:"syncClientServerClock_",value:function e(t){var i=this;var r=Ho(this.masterXml_);if(r===null){this.clientOffset_=this.masterLoaded_-Date.now();return t()}if(r.method==="DIRECT"){this.clientOffset_=r.value-Date.now();return t()}this.request=this.hls_.xhr({uri:Bf(this.srcUrl,r.value),method:r.method,withCredentials:this.withCredentials},function(e,n){if(!i.request){return}if(e){i.clientOffset_=i.masterLoaded_-Date.now();return t()}var a=void 0;if(r.method==="HEAD"){if(!n.responseHeaders||!n.responseHeaders.date){a=i.masterLoaded_}else{a=Date.parse(n.responseHeaders.date)}}else{a=Date.parse(n.responseText)}i.clientOffset_=a-Date.now();t()})}},{key:"haveMaster_",value:function e(){this.state="HAVE_MASTER";this.mediaRequest_=null;if(!this.masterPlaylistLoader_){this.master=this.parseMasterXml();this.trigger("loadedplaylist")}else if(!this.media_){this.media(this.childPlaylist_)}}},{key:"onClientServerClockSync_",value:function t(){var i=this;this.haveMaster_();if(!this.hasPendingRequest()&&!this.media_){this.media(this.master.playlists[0])}if(this.master&&this.master.minimumUpdatePeriod){e.setTimeout(function(){i.trigger("minimumUpdatePeriod")},this.master.minimumUpdatePeriod)}}},{key:"refreshXml_",value:function t(){var i=this;this.request=this.hls_.xhr({uri:this.srcUrl,withCredentials:this.withCredentials},function(t,r){if(!i.request){return}i.request=null;if(t){i.error={status:r.status,message:"DASH playlist request error at URL: "+i.srcUrl,responseText:r.responseText,code:2};if(i.state==="HAVE_NOTHING"){i.started=false}return i.trigger("error")}i.masterXml_=r.responseText;var n=i.parseMasterXml();var a=Xh(i.master,n);if(a){i.master=a}e.setTimeout(function(){i.trigger("minimumUpdatePeriod")},i.master.minimumUpdatePeriod)})}},{key:"refreshMedia_",value:function t(){var i=this;var r=void 0;var n=void 0;if(this.masterPlaylistLoader_){r=this.masterPlaylistLoader_.master;n=this.masterPlaylistLoader_.parseMasterXml()}else{r=this.master;n=this.parseMasterXml()}var a=Xh(r,n);if(a){if(this.masterPlaylistLoader_){this.masterPlaylistLoader_.master=a}else{this.master=a}this.media_=a.playlists[this.media_.uri]}else{this.trigger("playlistunchanged")}if(!this.media().endList){this.mediaUpdateTimeout=e.setTimeout(function(){i.trigger("mediaupdatetimeout")},ed(this.media(),!!a))}this.trigger("loadedplaylist")}}]);return i}(Wh);var Kh=function e(t){if(Is.log.debug){return Is.log.debug.bind(Is,"VHS:",t+" >")}return function(){}};function $h(){}var Qh=function(){function e(t,i,r,n){jf(this,e);this.callbacks_=[];this.pendingCallback_=null;this.timestampOffset_=0;this.mediaSource=t;this.processedAppend_=false;this.type_=r;this.mimeType_=i;this.logger_=Kh("SourceUpdater["+r+"]["+i+"]");if(t.readyState==="closed"){t.addEventListener("sourceopen",this.createSourceBuffer_.bind(this,i,n))}else{this.createSourceBuffer_(i,n)}}Ff(e,[{key:"createSourceBuffer_",value:function e(t,i){var r=this;this.sourceBuffer_=this.mediaSource.addSourceBuffer(t);this.logger_("created SourceBuffer");if(i){i.trigger("sourcebufferadded");if(this.mediaSource.sourceBuffers.length<2){i.on("sourcebufferadded",function(){r.start_()});return}}this.start_()}},{key:"start_",value:function e(){var t=this;this.started_=true;this.onUpdateendCallback_=function(){var e=t.pendingCallback_;t.pendingCallback_=null;t.logger_("buffered ["+Zd(t.buffered())+"]");if(e){e()}t.runCallback_()};this.sourceBuffer_.addEventListener("updateend",this.onUpdateendCallback_);this.runCallback_()}},{key:"abort",value:function e(t){var i=this;if(this.processedAppend_){this.queueCallback_(function(){i.sourceBuffer_.abort()},t)}}},{key:"appendBuffer",value:function e(t,i){var r=this;this.processedAppend_=true;this.queueCallback_(function(){if(t.videoSegmentTimingInfoCallback){r.sourceBuffer_.addEventListener("videoSegmentTimingInfo",t.videoSegmentTimingInfoCallback)}r.sourceBuffer_.appendBuffer(t.bytes)},function(){if(t.videoSegmentTimingInfoCallback){r.sourceBuffer_.removeEventListener("videoSegmentTimingInfo",t.videoSegmentTimingInfoCallback)}i()})}},{key:"buffered",value:function e(){if(!this.sourceBuffer_){return Is.createTimeRanges()}return this.sourceBuffer_.buffered}},{key:"remove",value:function e(t,i){var r=this;var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:$h;if(this.processedAppend_){this.queueCallback_(function(){r.logger_("remove ["+t+" => "+i+"]");r.sourceBuffer_.remove(t,i)},n)}}},{key:"updating",value:function e(){return!this.sourceBuffer_||this.sourceBuffer_.updating||!!this.pendingCallback_&&this.pendingCallback_!==$h}},{key:"timestampOffset",value:function e(t){var i=this;if(typeof t!=="undefined"){this.queueCallback_(function(){i.sourceBuffer_.timestampOffset=t});this.timestampOffset_=t}return this.timestampOffset_}},{key:"queueCallback_",value:function e(t,i){this.callbacks_.push([t.bind(this),i]);this.runCallback_()}},{key:"runCallback_",value:function e(){var t=void 0;if(!this.updating()&&this.callbacks_.length&&this.started_){t=this.callbacks_.shift();this.pendingCallback_=t[1];t[0]()}}},{key:"dispose",value:function e(){this.sourceBuffer_.removeEventListener("updateend",this.onUpdateendCallback_);if(this.sourceBuffer_&&this.mediaSource.readyState==="open"){this.sourceBuffer_.abort()}}}]);return e}();var Jh={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,BUFFER_LOW_WATER_LINE_RATE:1};var Zh={FAILURE:2,TIMEOUT:-101,ABORTED:-102};var ep=function e(t){var i=void 0;var r=void 0;r=t.offset+t.length-1;i=t.offset;return"bytes="+i+"-"+r};var tp=function e(t){var i={};if(t.byterange){i.Range=ep(t.byterange)}return i};var ip=function e(t){t.forEach(function(e){e.abort()})};var rp=function e(t){return{bandwidth:t.bandwidth,bytesReceived:t.bytesReceived||0,roundTripTime:t.roundTripTime||0}};var np=function e(t){var i=t.target;var r=Date.now()-i.requestTime;var n={bandwidth:Infinity,bytesReceived:0,roundTripTime:r||0};n.bytesReceived=t.loaded;n.bandwidth=Math.floor(n.bytesReceived/n.roundTripTime*8*1e3);return n};var ap=function e(t,i){if(i.timedout){return{status:i.status,message:"HLS request timed-out at URL: "+i.uri,code:Zh.TIMEOUT,xhr:i}}if(i.aborted){return{status:i.status,message:"HLS request aborted at URL: "+i.uri,code:Zh.ABORTED,xhr:i}}if(t){return{status:i.status,message:"HLS request errored at URL: "+i.uri,code:Zh.FAILURE,xhr:i}}return null};var sp=function e(t,i){return function(e,r){var n=r.response;var a=ap(e,r);if(a){return i(a,t)}if(n.byteLength!==16){return i({status:r.status,message:"Invalid HLS key at URL: "+r.uri,code:Zh.FAILURE,xhr:r},t)}var s=new DataView(n);t.key.bytes=new Uint32Array([s.getUint32(0),s.getUint32(4),s.getUint32(8),s.getUint32(12)]);return i(null,t)}};var op=function e(t,i,r){return function(e,n){var a=n.response;var s=ap(e,n);if(s){return r(s,t)}if(a.byteLength===0){return r({status:n.status,message:"Empty HLS segment content at URL: "+n.uri,code:Zh.FAILURE,xhr:n},t)}t.map.bytes=new Uint8Array(n.response);if(!i.isInitialized()){i.init()}t.map.timescales=Qo.timescale(t.map.bytes);t.map.videoTrackIds=Qo.videoTrackIds(t.map.bytes);return r(null,t)}};var up=function e(t,i,r){return function(e,n){var a=n.response;var s=ap(e,n);var o=void 0;if(s){return r(s,t)}if(a.byteLength===0){return r({status:n.status,message:"Empty HLS segment content at URL: "+n.uri,code:Zh.FAILURE,xhr:n},t)}t.stats=rp(n);if(t.key){t.encryptedBytes=new Uint8Array(n.response)}else{t.bytes=new Uint8Array(n.response)}if(t.map&&t.map.bytes){if(!i.isInitialized()){i.init()}o=i.parse(t.bytes,t.map.videoTrackIds,t.map.timescales);if(o&&o.captions){t.captionStreams=o.captionStreams;t.fmp4Captions=o.captions}}return r(null,t)}};var lp=function e(t,i,r){var n=function e(n){if(n.data.source===i.requestId){t.removeEventListener("message",e);var a=n.data.decrypted;i.bytes=new Uint8Array(a.bytes,a.byteOffset,a.byteLength);return r(null,i)}};t.addEventListener("message",n);t.postMessage(Ud({source:i.requestId,encrypted:i.encryptedBytes,key:i.key.bytes,iv:i.key.iv}),[i.encryptedBytes.buffer,i.key.bytes.buffer])};var cp=function e(t,i,r){var n=0;var a=false;return function(e,s){if(a){return}if(e){a=true;ip(t);return r(e,s)}n+=1;if(n===t.length){s.endOfAllRequests=Date.now();if(s.encryptedBytes){return lp(i,s,r)}return r(null,s)}}};var fp=function e(t,i){return function(e){t.stats=Is.mergeOptions(t.stats,np(e));if(!t.stats.firstBytesReceivedAt&&t.stats.bytesReceived){t.stats.firstBytesReceivedAt=Date.now()}return i(e,t)}};var dp=function e(t,i,r,n,a,s,o){var u=[];var l=cp(u,r,o);if(a.key){var c=Is.mergeOptions(i,{uri:a.key.resolvedUri,responseType:"arraybuffer"});var f=sp(a,l);var d=t(c,f);u.push(d)}if(a.map&&!a.map.bytes){var h=Is.mergeOptions(i,{uri:a.map.resolvedUri,responseType:"arraybuffer",headers:tp(a.map)});var p=op(a,n,l);var m=t(h,p);u.push(m)}var v=Is.mergeOptions(i,{uri:a.resolvedUri,responseType:"arraybuffer",headers:tp(a)});var g=up(a,n,l);var y=t(v,g);y.addEventListener("progress",fp(a,s));u.push(y);return function(){return ip(u)}};var hp=function t(i,r){var n=void 0;if(!i){return""}n=e.getComputedStyle(i);if(!n){return""}return n[r]};var pp=function e(t,i){var r=t.slice();t.sort(function(e,t){var n=i(e,t);if(n===0){return r.indexOf(e)-r.indexOf(t)}return n})};var mp=function t(i,r){var n=void 0;var a=void 0;if(i.attributes.BANDWIDTH){n=i.attributes.BANDWIDTH}n=n||e.Number.MAX_VALUE;if(r.attributes.BANDWIDTH){a=r.attributes.BANDWIDTH}a=a||e.Number.MAX_VALUE;return n-a};var vp=function t(i,r){var n=void 0;var a=void 0;if(i.attributes.RESOLUTION&&i.attributes.RESOLUTION.width){n=i.attributes.RESOLUTION.width}n=n||e.Number.MAX_VALUE;if(r.attributes.RESOLUTION&&r.attributes.RESOLUTION.width){a=r.attributes.RESOLUTION.width}a=a||e.Number.MAX_VALUE;if(n===a&&i.attributes.BANDWIDTH&&r.attributes.BANDWIDTH){return i.attributes.BANDWIDTH-r.attributes.BANDWIDTH}return n-a};var gp=function t(i,r,n,a,s){var o=i.playlists.map(function(t){var i=void 0;var r=void 0;var n=void 0;i=t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width;r=t.attributes.RESOLUTION&&t.attributes.RESOLUTION.height;n=t.attributes.BANDWIDTH;n=n||e.Number.MAX_VALUE;return{bandwidth:n,width:i,height:r,playlist:t}});pp(o,function(e,t){return e.bandwidth-t.bandwidth});o=o.filter(function(e){return!Cd.isIncompatible(e.playlist)});var u=o.filter(function(e){return Cd.isEnabled(e.playlist)});if(!u.length){u=o.filter(function(e){return!Cd.isDisabled(e.playlist)})}var l=u.filter(function(e){return e.bandwidth*Jh.BANDWIDTH_VARIANCE<r});var c=l[l.length-1];var f=l.filter(function(e){return e.bandwidth===c.bandwidth})[0];if(s===false){var d=f||u[0]||o[0];return d?d.playlist:null}var h=l.filter(function(e){return e.width&&e.height});pp(h,function(e,t){return e.width-t.width});var p=h.filter(function(e){return e.width===n&&e.height===a});c=p[p.length-1];var m=p.filter(function(e){return e.bandwidth===c.bandwidth})[0];var v=void 0;var g=void 0;var y=void 0;if(!m){v=h.filter(function(e){return e.width>n||e.height>a});g=v.filter(function(e){return e.width===v[0].width&&e.height===v[0].height});c=g[g.length-1];y=g.filter(function(e){return e.bandwidth===c.bandwidth})[0]}var _=y||m||f||u[0]||o[0];return _?_.playlist:null};var yp=function e(){return gp(this.playlists.master,this.systemBandwidth,parseInt(hp(this.tech_.el(),"width"),10),parseInt(hp(this.tech_.el(),"height"),10),this.limitRenditionByPlayerDimensions)};var _p=function e(t){var i=t.master,r=t.currentTime,n=t.bandwidth,a=t.duration,s=t.segmentDuration,o=t.timeUntilRebuffer,u=t.currentTimeline,l=t.syncController;var c=i.playlists.filter(function(e){return!Cd.isIncompatible(e)});var f=c.filter(Cd.isEnabled);if(!f.length){f=c.filter(function(e){return!Cd.isDisabled(e)})}var d=f.filter(Cd.hasAttribute.bind(null,"BANDWIDTH"));var h=d.map(function(e){var t=l.getSyncPoint(e,a,u,r);var i=t?1:2;var c=Cd.estimateSegmentRequestTime(s,n,e);var f=c*i-o;return{playlist:e,rebufferingImpact:f}});var p=h.filter(function(e){return e.rebufferingImpact<=0});pp(p,function(e,t){return mp(t.playlist,e.playlist)});if(p.length){return p[0]}pp(h,function(e,t){return e.rebufferingImpact-t.rebufferingImpact});return h[0]||null};var bp=function e(){var t=this.playlists.master.playlists.filter(Cd.isEnabled);pp(t,function(e,t){return mp(e,t)});var i=t.filter(function(e){return Sh(e.attributes.CODECS).videoCodec});return i[0]||null};var Tp=function e(t,i,r){for(var n in r){if(!t[n]){i.trigger({type:"usage",name:"hls-608"});var a=i.textTracks().getTrackById(n);if(a){t[n]=a}else{t[n]=i.addRemoteTextTrack({kind:"captions",id:n,label:n},false).track}}}};var Sp=function e(t){var i=t.inbandTextTracks,r=t.captionArray,n=t.timestampOffset;if(!r){return}var a=window.WebKitDataCue||window.VTTCue;r.forEach(function(e){var t=e.stream;var r=e.startTime;var s=e.endTime;if(!i[t]){return}r+=n;s+=n;i[t].addCue(new a(r,s,e.text))})};var kp=500;var wp=function e(t,i,r){if(!t||!i){return false}var n=t.segments;if(n.length||r!==null){var a=r===n.length}else{a=true}return t.endList&&i.readyState==="open"&&a};var Cp=function e(t){return typeof t==="number"&&isFinite(t)};var Ep=function e(t,i,r){if(t!=="main"||!i||!r){return null}if(!r.containsAudio&&!r.containsVideo){return"Neither audio nor video found in segment."}if(i.containsVideo&&!r.containsVideo){return"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."}if(!i.containsVideo&&r.containsVideo){return"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."}return null};var Ap=function e(t,i,r){var n=void 0;if(t.length&&t.start(0)>0&&t.start(0)<i){n=t.start(0)}else{n=i-30}return Math.min(n,i-r)};var Lp=function e(t){var i=t.segment,r=i.start,n=i.end,a=t.playlist,s=a.mediaSequence,o=a.id,u=a.segments,l=u===undefined?[]:u,c=t.mediaIndex,f=t.timeline;return["appending ["+c+"] of ["+s+", "+(s+l.length)+"] from playlist ["+o+"]","["+r+" => "+n+"] in timeline ["+f+"]"].join(" ")};var Ip=function(t){Hf(i,t);function i(e){jf(this,i);var t=qf(this,(i.__proto__||Object.getPrototypeOf(i)).call(this));if(!e){throw new TypeError("Initialization settings are required")}if(typeof e.currentTime!=="function"){throw new TypeError("No currentTime getter specified")}if(!e.mediaSource){throw new TypeError("No MediaSource specified")}t.bandwidth=e.bandwidth;t.throughput={rate:0,count:0};t.roundTrip=NaN;t.resetStats_();t.mediaIndex=null;t.hasPlayed_=e.hasPlayed;t.currentTime_=e.currentTime;t.seekable_=e.seekable;t.seeking_=e.seeking;t.duration_=e.duration;t.mediaSource_=e.mediaSource;t.hls_=e.hls;t.loaderType_=e.loaderType;t.startingMedia_=void 0;t.segmentMetadataTrack_=e.segmentMetadataTrack;t.goalBufferLength_=e.goalBufferLength;t.sourceType_=e.sourceType;t.inbandTextTracks_=e.inbandTextTracks;t.state_="INIT";t.checkBufferTimeout_=null;t.error_=void 0;t.currentTimeline_=-1;t.pendingSegment_=null;t.mimeType_=null;t.sourceUpdater_=null;t.xhrOptions_=null;t.activeInitSegmentId_=null;t.initSegments_={};t.captionParser_=new Jc;t.decrypter_=e.decrypter;t.syncController_=e.syncController;t.syncPoint_={segmentIndex:0,time:0};t.syncController_.on("syncinfoupdate",function(){return t.trigger("syncinfoupdate")});t.mediaSource_.addEventListener("sourceopen",function(){return t.ended_=false});t.fetchAtBuffer_=false;t.logger_=Kh("SegmentLoader["+t.loaderType_+"]");Object.defineProperty(t,"state",{get:function e(){return this.state_},set:function e(t){if(t!==this.state_){this.logger_(this.state_+" -> "+t);this.state_=t}}});return t}Ff(i,[{key:"resetStats_",value:function e(){this.mediaBytesTransferred=0;this.mediaRequests=0;this.mediaRequestsAborted=0;this.mediaRequestsTimedout=0;this.mediaRequestsErrored=0;this.mediaTransferDuration=0;this.mediaSecondsLoaded=0}},{key:"dispose",value:function e(){this.state="DISPOSED";this.pause();this.abort_();if(this.sourceUpdater_){this.sourceUpdater_.dispose()}this.resetStats_();this.captionParser_.reset()}},{key:"abort",value:function e(){if(this.state!=="WAITING"){if(this.pendingSegment_){this.pendingSegment_=null}return}this.abort_();this.state="READY";if(!this.paused()){this.monitorBuffer_()}}},{key:"abort_",value:function e(){if(this.pendingSegment_){this.pendingSegment_.abortRequests()}this.pendingSegment_=null}},{key:"error",value:function e(t){if(typeof t!=="undefined"){this.error_=t}this.pendingSegment_=null;return this.error_}},{key:"endOfStream",value:function e(){this.ended_=true;this.pause();this.trigger("ended")}},{key:"buffered_",value:function e(){if(!this.sourceUpdater_){return Is.createTimeRanges()}return this.sourceUpdater_.buffered()}},{key:"initSegment",value:function e(t){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;if(!t){return null}var r=Dd(t);var n=this.initSegments_[r];if(i&&!n&&t.bytes){this.initSegments_[r]=n={resolvedUri:t.resolvedUri,byterange:t.byterange,bytes:t.bytes,timescales:t.timescales,videoTrackIds:t.videoTrackIds}}return n||t}},{key:"couldBeginLoading_",value:function e(){return this.playlist_&&(this.sourceUpdater_||this.mimeType_&&this.state==="INIT")&&!this.paused()}},{key:"load",value:function e(){this.monitorBuffer_();if(!this.playlist_){return}this.syncController_.setDateTimeMapping(this.playlist_);if(this.state==="INIT"&&this.couldBeginLoading_()){return this.init_()}if(!this.couldBeginLoading_()||this.state!=="READY"&&this.state!=="INIT"){return}this.state="READY"}},{key:"init_",value:function e(){this.state="READY";this.sourceUpdater_=new Qh(this.mediaSource_,this.mimeType_,this.loaderType_,this.sourceBufferEmitter_);this.resetEverything();return this.monitorBuffer_()}},{key:"playlist",value:function e(t){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(!t){return}var r=this.playlist_;var n=this.pendingSegment_;this.playlist_=t;this.xhrOptions_=i;if(!this.hasPlayed_()){t.syncInfo={mediaSequence:t.mediaSequence,time:0}}var a=null;if(r){if(r.id){a=r.id}else if(r.uri){a=r.uri}}this.logger_("playlist update ["+a+" => "+(t.id||t.uri)+"]");this.trigger("syncinfoupdate");if(this.state==="INIT"&&this.couldBeginLoading_()){return this.init_()}if(!r||r.uri!==t.uri){if(this.mediaIndex!==null){this.resyncLoader()}return}var s=t.mediaSequence-r.mediaSequence;this.logger_("live window shift ["+s+"]");if(this.mediaIndex!==null){this.mediaIndex-=s}if(n){n.mediaIndex-=s;if(n.mediaIndex>=0){n.segment=t.segments[n.mediaIndex]}}this.syncController_.saveExpiredSegmentInfo(r,t)}},{key:"pause",value:function t(){if(this.checkBufferTimeout_){e.clearTimeout(this.checkBufferTimeout_);this.checkBufferTimeout_=null}}},{key:"paused",value:function e(){return this.checkBufferTimeout_===null}},{key:"mimeType",value:function e(t,i){if(this.mimeType_){return}this.mimeType_=t;this.sourceBufferEmitter_=i;if(this.state==="INIT"&&this.couldBeginLoading_()){this.init_()}}},{key:"resetEverything",value:function e(t){this.ended_=false;this.resetLoader();this.remove(0,this.duration_(),t);this.captionParser_.clearAllCaptions();this.trigger("reseteverything")}},{key:"resetLoader",value:function e(){this.fetchAtBuffer_=false;this.resyncLoader()}},{key:"resyncLoader",value:function e(){this.mediaIndex=null;this.syncPoint_=null;this.abort()}},{key:"remove",value:function e(t,i,r){if(this.sourceUpdater_){this.sourceUpdater_.remove(t,i,r)}rh(t,i,this.segmentMetadataTrack_);if(this.inbandTextTracks_){for(var n in this.inbandTextTracks_){rh(t,i,this.inbandTextTracks_[n])}}}},{key:"monitorBuffer_",value:function t(){if(this.checkBufferTimeout_){e.clearTimeout(this.checkBufferTimeout_)}this.checkBufferTimeout_=e.setTimeout(this.monitorBufferTick_.bind(this),1)}},{key:"monitorBufferTick_",value:function t(){if(this.state==="READY"){this.fillBuffer_()}if(this.checkBufferTimeout_){e.clearTimeout(this.checkBufferTimeout_)}this.checkBufferTimeout_=e.setTimeout(this.monitorBufferTick_.bind(this),kp)}},{key:"fillBuffer_",value:function e(){if(this.sourceUpdater_.updating()){return}if(!this.syncPoint_){this.syncPoint_=this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_())}var t=this.checkBuffer_(this.buffered_(),this.playlist_,this.mediaIndex,this.hasPlayed_(),this.currentTime_(),this.syncPoint_);if(this.isEndOfStream_(t?t.mediaIndex:null)){this.endOfStream();return}if(!t){return}if(t.mediaIndex===this.playlist_.segments.length-1&&this.mediaSource_.readyState==="ended"&&!this.seeking_()){return}if(t.timeline!==this.currentTimeline_||t.startOfSegment!==null&&t.startOfSegment<this.sourceUpdater_.timestampOffset()){this.syncController_.reset();t.timestampOffset=t.startOfSegment;this.captionParser_.clearAllCaptions()}this.loadSegment_(t)}},{key:"isEndOfStream_",value:function e(t){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.playlist_;return wp(i,this.mediaSource_,t)&&!this.sourceUpdater_.updating()}},{key:"checkBuffer_",value:function e(t,i,r,n,a,s){var o=0;var u=void 0;if(t.length){o=t.end(t.length-1)}var l=Math.max(0,o-a);if(!i.segments.length){return null}if(l>=this.goalBufferLength_()){return null}if(!n&&l>=1){return null}if(s===null){r=this.getSyncSegmentCandidate_(i);return this.generateSegmentInfo_(i,r,null,true)}if(r!==null){var c=i.segments[r];if(c&&c.end){u=c.end}else{u=o}return this.generateSegmentInfo_(i,r+1,u,false)}if(this.fetchAtBuffer_){var f=Cd.getMediaInfoForTime(i,o,s.segmentIndex,s.time);r=f.mediaIndex;u=f.startTime}else{var d=Cd.getMediaInfoForTime(i,a,s.segmentIndex,s.time);r=d.mediaIndex;u=d.startTime}return this.generateSegmentInfo_(i,r,u,false)}},{key:"getSyncSegmentCandidate_",value:function e(t){var i=this;if(this.currentTimeline_===-1){return 0}var r=t.segments.map(function(e,t){return{timeline:e.timeline,segmentIndex:t}}).filter(function(e){return e.timeline===i.currentTimeline_});if(r.length){return r[Math.min(r.length-1,1)].segmentIndex}return Math.max(t.segments.length-1,0)}},{key:"generateSegmentInfo_",value:function e(t,i,r,n){if(i<0||i>=t.segments.length){return null}var a=t.segments[i];return{requestId:"segment-loader-"+Math.random(),uri:a.resolvedUri,mediaIndex:i,isSyncRequest:n,startOfSegment:r,playlist:t,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:a.timeline,duration:a.duration,segment:a}}},{key:"abortRequestEarly_",value:function e(t){if(this.hls_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH){return false}if(Date.now()-(t.firstBytesReceivedAt||Date.now())<1e3){return false}var i=this.currentTime_();var r=t.bandwidth;var n=this.pendingSegment_.duration;var a=Cd.estimateSegmentRequestTime(n,r,this.playlist_,t.bytesReceived);var s=eh(this.buffered_(),i,this.hls_.tech_.playbackRate())-1;if(a<=s){return false}var o=_p({master:this.hls_.playlists.master,currentTime:i,bandwidth:r,duration:this.duration_(),segmentDuration:n,timeUntilRebuffer:s,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!o){return}var u=a-s;var l=u-o.rebufferingImpact;var c=.5;if(s<=Xd){c=1}if(!o.playlist||o.playlist.uri===this.playlist_.uri||l<c){return false}this.bandwidth=o.playlist.attributes.BANDWIDTH*Jh.BANDWIDTH_VARIANCE+1;this.abort();this.trigger("earlyabort");return true}},{key:"handleProgress_",value:function e(t,i){if(!this.pendingSegment_||i.requestId!==this.pendingSegment_.requestId||this.abortRequestEarly_(i.stats)){return}this.trigger("progress")}},{key:"loadSegment_",value:function e(t){this.state="WAITING";this.pendingSegment_=t;this.trimBackBuffer_(t);t.abortRequests=dp(this.hls_.xhr,this.xhrOptions_,this.decrypter_,this.captionParser_,this.createSimplifiedSegmentObj_(t),this.handleProgress_.bind(this),this.segmentRequestFinished_.bind(this))}},{key:"trimBackBuffer_",value:function e(t){var i=Ap(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);if(i>0){this.remove(0,i)}}},{key:"createSimplifiedSegmentObj_",value:function e(t){var i=t.segment;var r={resolvedUri:i.resolvedUri,byterange:i.byterange,requestId:t.requestId};if(i.key){var n=i.key.iv||new Uint32Array([0,0,0,t.mediaIndex+t.playlist.mediaSequence]);r.key={resolvedUri:i.key.resolvedUri,iv:n}}if(i.map){r.map=this.initSegment(i.map)}return r}},{key:"segmentRequestFinished_",value:function e(t,i){this.mediaRequests+=1;if(i.stats){this.mediaBytesTransferred+=i.stats.bytesReceived;this.mediaTransferDuration+=i.stats.roundTripTime}if(!this.pendingSegment_){this.mediaRequestsAborted+=1;return}if(i.requestId!==this.pendingSegment_.requestId){return}if(t){this.pendingSegment_=null;this.state="READY";if(t.code===Zh.ABORTED){this.mediaRequestsAborted+=1;return}this.pause();if(t.code===Zh.TIMEOUT){this.mediaRequestsTimedout+=1;this.bandwidth=1;this.roundTrip=NaN;this.trigger("bandwidthupdate");return}this.mediaRequestsErrored+=1;this.error(t);this.trigger("error");return}this.bandwidth=i.stats.bandwidth;this.roundTrip=i.stats.roundTripTime;if(i.map){i.map=this.initSegment(i.map,true)}this.processSegmentResponse_(i)}},{key:"processSegmentResponse_",value:function e(t){var i=this.pendingSegment_;i.bytes=t.bytes;if(t.map){i.segment.map.bytes=t.map.bytes}i.endOfAllRequests=t.endOfAllRequests;if(t.fmp4Captions){Tp(this.inbandTextTracks_,this.hls_.tech_,t.captionStreams);Sp({inbandTextTracks:this.inbandTextTracks_,captionArray:t.fmp4Captions,timestampOffset:0});this.captionParser_.clearParsedCaptions()}this.handleSegment_()}},{key:"handleSegment_",value:function e(){var t=this;if(!this.pendingSegment_){this.state="READY";return}var i=this.pendingSegment_;var r=i.segment;var n=this.syncController_.probeSegmentInfo(i);if(typeof this.startingMedia_==="undefined"&&n&&(n.containsAudio||n.containsVideo)){this.startingMedia_={containsAudio:n.containsAudio,containsVideo:n.containsVideo}}var a=Ep(this.loaderType_,this.startingMedia_,n);if(a){this.error({message:a,blacklistDuration:Infinity});this.trigger("error");return}if(i.isSyncRequest){this.trigger("syncinfoupdate");this.pendingSegment_=null;this.state="READY";return}if(i.timestampOffset!==null&&i.timestampOffset!==this.sourceUpdater_.timestampOffset()){this.sourceUpdater_.timestampOffset(i.timestampOffset);this.trigger("timestampoffset")}var s=this.syncController_.mappingForTimeline(i.timeline);if(s!==null){this.trigger({type:"segmenttimemapping",mapping:s})}this.state="APPENDING";if(r.map){var o=Dd(r.map);if(!this.activeInitSegmentId_||this.activeInitSegmentId_!==o){var u=this.initSegment(r.map);this.sourceUpdater_.appendBuffer({bytes:u.bytes},function(){t.activeInitSegmentId_=o})}}i.byteLength=i.bytes.byteLength;if(typeof r.start==="number"&&typeof r.end==="number"){this.mediaSecondsLoaded+=r.end-r.start}else{this.mediaSecondsLoaded+=r.duration}this.logger_(Lp(i));this.sourceUpdater_.appendBuffer({bytes:i.bytes,videoSegmentTimingInfoCallback:this.handleVideoSegmentTimingInfo_.bind(this,i.requestId)},this.handleUpdateEnd_.bind(this))}},{key:"handleVideoSegmentTimingInfo_",value:function e(t,i){if(!this.pendingSegment_||t!==this.pendingSegment_.requestId){return}var r=this.pendingSegment_.segment;if(!r.videoTimingInfo){r.videoTimingInfo={}}r.videoTimingInfo.transmuxerPrependedSeconds=i.videoSegmentTimingInfo.prependedContentDuration||0;r.videoTimingInfo.transmuxedPresentationStart=i.videoSegmentTimingInfo.start.presentation;r.videoTimingInfo.transmuxedPresentationEnd=i.videoSegmentTimingInfo.end.presentation;r.videoTimingInfo.baseMediaDecodeTime=i.videoSegmentTimingInfo.baseMediaDecodeTime}},{key:"handleUpdateEnd_",value:function e(){if(!this.pendingSegment_){this.state="READY";if(!this.paused()){this.monitorBuffer_()}return}var t=this.pendingSegment_;var i=t.segment;var r=this.mediaIndex!==null;this.pendingSegment_=null;this.recordThroughput_(t);this.addSegmentMetadataCue_(t);this.state="READY";this.mediaIndex=t.mediaIndex;this.fetchAtBuffer_=true;this.currentTimeline_=t.timeline;this.trigger("syncinfoupdate");if(i.end&&this.currentTime_()-i.end>t.playlist.targetDuration*3){this.resetEverything();return}if(r){this.trigger("bandwidthupdate")}this.trigger("progress");if(this.isEndOfStream_(t.mediaIndex+1,t.playlist)){this.endOfStream()}if(!this.paused()){this.monitorBuffer_()}}},{key:"recordThroughput_",value:function e(t){var i=this.throughput.rate;var r=Date.now()-t.endOfAllRequests+1;var n=Math.floor(t.byteLength/r*8*1e3);this.throughput.rate+=(n-i)/++this.throughput.count}},{key:"addSegmentMetadataCue_",value:function t(i){if(!this.segmentMetadataTrack_){return}var r=i.segment;var n=r.start;var a=r.end;if(!Cp(n)||!Cp(a)){return}rh(n,a,this.segmentMetadataTrack_);var s=e.WebKitDataCue||e.VTTCue;var o={custom:r.custom,dateTimeObject:r.dateTimeObject,dateTimeString:r.dateTimeString,bandwidth:i.playlist.attributes.BANDWIDTH,resolution:i.playlist.attributes.RESOLUTION,codecs:i.playlist.attributes.CODECS,byteLength:i.byteLength,uri:i.uri,timeline:i.timeline,playlist:i.playlist.uri,start:n,end:a};var u=JSON.stringify(o);var l=new s(n,a,u);l.value=o;this.segmentMetadataTrack_.addCue(l)}}]);return i}(Is.EventTarget);var Pp=function e(t){return decodeURIComponent(escape(String.fromCharCode.apply(null,t)))};var Op=new Uint8Array("\n\n".split("").map(function(e){return e.charCodeAt(0)}));var Up=function(t){Hf(i,t);function i(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};jf(this,i);var r=qf(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,e,t));r.mediaSource_=null;r.subtitlesTrack_=null;return r}Ff(i,[{key:"buffered_",value:function e(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues.length){return Is.createTimeRanges()}var t=this.subtitlesTrack_.cues;var i=t[0].startTime;var r=t[t.length-1].startTime;return Is.createTimeRanges([[i,r]])}},{key:"initSegment",value:function e(t){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;if(!t){return null}var r=Dd(t);var n=this.initSegments_[r];if(i&&!n&&t.bytes){var a=Op.byteLength+t.bytes.byteLength;var s=new Uint8Array(a);s.set(t.bytes);s.set(Op,t.bytes.byteLength);this.initSegments_[r]=n={resolvedUri:t.resolvedUri,byterange:t.byterange,bytes:s}}return n||t}},{key:"couldBeginLoading_",value:function e(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}},{key:"init_",value:function e(){this.state="READY";this.resetEverything();return this.monitorBuffer_()}},{key:"track",value:function e(t){if(typeof t==="undefined"){return this.subtitlesTrack_}this.subtitlesTrack_=t;if(this.state==="INIT"&&this.couldBeginLoading_()){this.init_()}return this.subtitlesTrack_}},{key:"remove",value:function e(t,i){rh(t,i,this.subtitlesTrack_)}},{key:"fillBuffer_",value:function e(){var t=this;if(!this.syncPoint_){this.syncPoint_=this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_())}var i=this.checkBuffer_(this.buffered_(),this.playlist_,this.mediaIndex,this.hasPlayed_(),this.currentTime_(),this.syncPoint_);i=this.skipEmptySegments_(i);if(!i){return}if(this.syncController_.timestampOffsetForTimeline(i.timeline)===null){var r=function e(){t.state="READY";if(!t.paused()){t.monitorBuffer_()}};this.syncController_.one("timestampoffset",r);this.state="WAITING_ON_TIMELINE";return}this.loadSegment_(i)}},{key:"skipEmptySegments_",value:function e(t){while(t&&t.segment.empty){t=this.generateSegmentInfo_(t.playlist,t.mediaIndex+1,t.startOfSegment+t.duration,t.isSyncRequest)}return t}},{key:"handleSegment_",value:function t(){var i=this;if(!this.pendingSegment_||!this.subtitlesTrack_){this.state="READY";return}this.state="APPENDING";var r=this.pendingSegment_;var n=r.segment;if(typeof e.WebVTT!=="function"&&this.subtitlesTrack_&&this.subtitlesTrack_.tech_){var a=function e(){i.handleSegment_()};this.state="WAITING_ON_VTTJS";this.subtitlesTrack_.tech_.one("vttjsloaded",a);this.subtitlesTrack_.tech_.one("vttjserror",function(){i.subtitlesTrack_.tech_.off("vttjsloaded",a);i.error({message:"Error loading vtt.js"});i.state="READY";i.pause();i.trigger("error")});return}n.requested=true;try{this.parseVTTCues_(r)}catch(e){this.error({message:e.message});this.state="READY";this.pause();return this.trigger("error")}this.updateTimeMapping_(r,this.syncController_.timelines[r.timeline],this.playlist_);if(r.isSyncRequest){this.trigger("syncinfoupdate");this.pendingSegment_=null;this.state="READY";return}r.byteLength=r.bytes.byteLength;this.mediaSecondsLoaded+=n.duration;if(r.cues.length){this.remove(r.cues[0].endTime,r.cues[r.cues.length-1].endTime)}r.cues.forEach(function(e){i.subtitlesTrack_.addCue(e)});this.handleUpdateEnd_()}},{key:"parseVTTCues_",value:function t(i){var r=void 0;var n=false;if(typeof e.TextDecoder==="function"){r=new e.TextDecoder("utf8")}else{r=e.WebVTT.StringDecoder();n=true}var a=new e.WebVTT.Parser(e,e.vttjs,r);i.cues=[];i.timestampmap={MPEGTS:0,LOCAL:0};a.oncue=i.cues.push.bind(i.cues);a.ontimestampmap=function(e){return i.timestampmap=e};a.onparsingerror=function(e){Is.log.warn("Error encountered when parsing cues: "+e.message)};if(i.segment.map){var s=i.segment.map.bytes;if(n){s=Pp(s)}a.parse(s)}var o=i.bytes;if(n){o=Pp(o)}a.parse(o);a.flush()}},{key:"updateTimeMapping_",value:function e(t,i,r){var n=t.segment;if(!i){return}if(!t.cues.length){n.empty=true;return}var a=t.timestampmap;var s=a.MPEGTS/9e4-a.LOCAL+i.mapping;t.cues.forEach(function(e){e.startTime+=s;e.endTime+=s});if(!r.syncInfo){var o=t.cues[0].startTime;var u=t.cues[t.cues.length-1].startTime;r.syncInfo={mediaSequence:r.mediaSequence+t.mediaIndex,time:Math.min(o,u-n.duration)}}}}]);return i}(Ip);var Dp=function e(t,i){var r=t.cues;for(var n=0;n<r.length;n++){var a=r[n];if(i>=a.adStartTime&&i<=a.adEndTime){return a}}return null};var xp=function t(i,r){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;if(!i.segments){return}var a=n;var s=void 0;for(var o=0;o<i.segments.length;o++){var u=i.segments[o];if(!s){s=Dp(r,a+u.duration/2)}if(s){if("cueIn"in u){s.endTime=a;s.adEndTime=a;a+=u.duration;s=null;continue}if(a<s.endTime){a+=u.duration;continue}s.endTime+=u.duration}else{if("cueOut"in u){s=new e.VTTCue(a,a+u.duration,u.cueOut);s.adStartTime=a;s.adEndTime=a+parseFloat(u.cueOut);r.addCue(s)}if("cueOutCont"in u){var l=void 0;var c=void 0;var f=u.cueOutCont.split("/").map(parseFloat);var d=zf(f,2);l=d[0];c=d[1];s=new e.VTTCue(a,a+u.duration,"");s.adStartTime=a-l;s.adEndTime=s.adStartTime+c;r.addCue(s)}}a+=u.duration}};var Rp=kf.inspect;var Mp=[{name:"VOD",run:function e(t,i,r,n,a){if(r!==Infinity){var s={time:0,segmentIndex:0};return s}return null}},{name:"ProgramDateTime",run:function e(t,i,r,n,a){if(!t.datetimeToDisplayTime){return null}var s=i.segments||[];var o=null;var u=null;a=a||0;for(var l=0;l<s.length;l++){var c=s[l];if(c.dateTimeObject){var f=c.dateTimeObject.getTime()/1e3;var d=f+t.datetimeToDisplayTime;var h=Math.abs(a-d);if(u!==null&&u<h){break}u=h;o={time:d,segmentIndex:l}}}return o}},{name:"Segment",run:function e(t,i,r,n,a){var s=i.segments||[];var o=null;var u=null;a=a||0;for(var l=0;l<s.length;l++){var c=s[l];if(c.timeline===n&&typeof c.start!=="undefined"){var f=Math.abs(a-c.start);if(u!==null&&u<f){break}if(!o||u===null||u>=f){u=f;o={time:c.start,segmentIndex:l}}}}return o}},{name:"Discontinuity",run:function e(t,i,r,n,a){var s=null;a=a||0;if(i.discontinuityStarts&&i.discontinuityStarts.length){var o=null;for(var u=0;u<i.discontinuityStarts.length;u++){var l=i.discontinuityStarts[u];var c=i.discontinuitySequence+u+1;var f=t.discontinuities[c];if(f){var d=Math.abs(a-f.time);if(o!==null&&o<d){break}if(!s||o===null||o>=d){o=d;s={time:f.time,segmentIndex:l}}}}}return s}},{name:"Playlist",run:function e(t,i,r,n,a){if(i.syncInfo){var s={time:i.syncInfo.time,segmentIndex:i.syncInfo.mediaSequence-i.mediaSequence};return s}return null}}];var Bp=function(e){Hf(t,e);function t(){jf(this,t);var e=qf(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));e.inspectCache_=undefined;e.timelines=[];e.discontinuities=[];e.datetimeToDisplayTime=null;e.logger_=Kh("SyncController");return e}Ff(t,[{key:"getSyncPoint",value:function e(t,i,r,n){var a=this.runStrategies_(t,i,r,n);if(!a.length){return null}return this.selectSyncPoint_(a,{key:"time",value:n})}},{key:"getExpiredTime",value:function e(t,i){if(!t||!t.segments){return null}var r=this.runStrategies_(t,i,t.discontinuitySequence,0);if(!r.length){return null}var n=this.selectSyncPoint_(r,{key:"segmentIndex",value:0});if(n.segmentIndex>0){n.time*=-1}return Math.abs(n.time+od(t,n.segmentIndex,0))}},{key:"runStrategies_",value:function e(t,i,r,n){var a=[];for(var s=0;s<Mp.length;s++){var o=Mp[s];var u=o.run(this,t,i,r,n);if(u){u.strategy=o.name;a.push({strategy:o.name,syncPoint:u})}}return a}},{key:"selectSyncPoint_",value:function e(t,i){var r=t[0].syncPoint;var n=Math.abs(t[0].syncPoint[i.key]-i.value);var a=t[0].strategy;for(var s=1;s<t.length;s++){var o=Math.abs(t[s].syncPoint[i.key]-i.value);if(o<n){n=o;r=t[s].syncPoint;a=t[s].strategy}}this.logger_("syncPoint for ["+i.key+": "+i.value+"] chosen with strategy"+(" ["+a+"]: [time:"+r.time+",")+(" segmentIndex:"+r.segmentIndex+"]"));return r}},{key:"saveExpiredSegmentInfo",value:function e(t,i){var r=i.mediaSequence-t.mediaSequence;for(var n=r-1;n>=0;n--){var a=t.segments[n];if(a&&typeof a.start!=="undefined"){i.syncInfo={mediaSequence:t.mediaSequence+n,time:a.start};this.logger_("playlist refresh sync: [time:"+i.syncInfo.time+","+(" mediaSequence: "+i.syncInfo.mediaSequence+"]"));this.trigger("syncinfoupdate");break}}}},{key:"setDateTimeMapping",value:function e(t){if(!this.datetimeToDisplayTime&&t.segments&&t.segments.length&&t.segments[0].dateTimeObject){var i=t.segments[0].dateTimeObject.getTime()/1e3;this.datetimeToDisplayTime=-i}}},{key:"reset",value:function e(){this.inspectCache_=undefined}},{key:"probeSegmentInfo",value:function e(t){var i=t.segment;var r=t.playlist;var n=void 0;if(i.map){n=this.probeMp4Segment_(t)}else{n=this.probeTsSegment_(t)}if(n){if(this.calculateSegmentTimeMapping_(t,n)){this.saveDiscontinuitySyncInfo_(t);if(!r.syncInfo){r.syncInfo={mediaSequence:r.mediaSequence+t.mediaIndex,time:i.start}}}}return n}},{key:"probeMp4Segment_",value:function e(t){var i=t.segment;var r=Qo.timescale(i.map.bytes);var n=Qo.startTime(r,t.bytes);if(t.timestampOffset!==null){t.timestampOffset-=n}return{start:n,end:n+i.duration}}},{key:"probeTsSegment_",value:function e(t){var i=Rp(t.bytes,this.inspectCache_);var r=void 0;var n=void 0;if(!i){return null}if(i.video&&i.video.length===2){this.inspectCache_=i.video[1].dts;r=i.video[0].dtsTime;n=i.video[1].dtsTime}else if(i.audio&&i.audio.length===2){this.inspectCache_=i.audio[1].dts;r=i.audio[0].dtsTime;n=i.audio[1].dtsTime}var a={start:r,end:n,containsVideo:i.video&&i.video.length===2,containsAudio:i.audio&&i.audio.length===2};return a}},{key:"timestampOffsetForTimeline",value:function e(t){if(typeof this.timelines[t]==="undefined"){return null}return this.timelines[t].time}},{key:"mappingForTimeline",value:function e(t){if(typeof this.timelines[t]==="undefined"){return null}return this.timelines[t].mapping}},{key:"calculateSegmentTimeMapping_",value:function e(t,i){var r=t.segment;var n=this.timelines[t.timeline];if(t.timestampOffset!==null){n={time:t.startOfSegment,mapping:t.startOfSegment-i.start};this.timelines[t.timeline]=n;this.trigger("timestampoffset");this.logger_("time mapping for timeline "+t.timeline+": "+("[time: "+n.time+"] [mapping: "+n.mapping+"]"));r.start=t.startOfSegment;r.end=i.end+n.mapping}else if(n){r.start=i.start+n.mapping;r.end=i.end+n.mapping}else{return false}return true}},{key:"saveDiscontinuitySyncInfo_",value:function e(t){var i=t.playlist;var r=t.segment;if(r.discontinuity){this.discontinuities[r.timeline]={time:r.start,accuracy:0}}else if(i.discontinuityStarts&&i.discontinuityStarts.length){for(var n=0;n<i.discontinuityStarts.length;n++){var a=i.discontinuityStarts[n];var s=i.discontinuitySequence+n+1;var o=a-t.mediaIndex;var u=Math.abs(o);if(!this.discontinuities[s]||this.discontinuities[s].accuracy>u){var l=void 0;if(o<0){l=r.start-od(i,t.mediaIndex,a)}else{l=r.end+od(i,t.mediaIndex+1,a)}this.discontinuities[s]={time:l,accuracy:u}}}}}}]);return t}(Is.EventTarget);var Np=new hh("./decrypter-worker.worker.js",function(e,t){var i=this;var r=function(){function e(e){return e.subarray(0,e.byteLength-e[e.byteLength-1])}var t=function e(t,i){if(!(t instanceof i)){throw new TypeError("Cannot call a class as a function")}};var r=function(){function e(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||false;r.configurable=true;if("value"in r)r.writable=true;Object.defineProperty(e,r.key,r)}}return function(t,i,r){if(i)e(t.prototype,i);if(r)e(t,r);return t}}();var n=function e(t,i){if(typeof i!=="function"&&i!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof i)}t.prototype=Object.create(i&&i.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}});if(i)Object.setPrototypeOf?Object.setPrototypeOf(t,i):t.__proto__=i};var a=function e(t,i){if(!t){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return i&&(typeof i==="object"||typeof i==="function")?i:t};var s=function e(){var t=[[[],[],[],[],[]],[[],[],[],[],[]]];var i=t[0];var r=t[1];var n=i[4];var a=r[4];var s=void 0;var o=void 0;var u=void 0;var l=[];var c=[];var f=void 0;var d=void 0;var h=void 0;var p=void 0;var m=void 0;var v=void 0;for(s=0;s<256;s++){c[(l[s]=s<<1^(s>>7)*283)^s]=s}for(o=u=0;!n[o];o^=f||1,u=c[u]||1){p=u^u<<1^u<<2^u<<3^u<<4;p=p>>8^p&255^99;n[o]=p;a[p]=o;h=l[d=l[f=l[o]]];v=h*16843009^d*65537^f*257^o*16843008;m=l[p]*257^p*16843008;for(s=0;s<4;s++){i[s][o]=m=m<<24^m>>>8;r[s][p]=v=v<<24^v>>>8}}for(s=0;s<5;s++){i[s]=i[s].slice(0);r[s]=r[s].slice(0)}return t};var o=null;var u=function(){function e(i){t(this,e);if(!o){o=s()}this._tables=[[o[0][0].slice(),o[0][1].slice(),o[0][2].slice(),o[0][3].slice(),o[0][4].slice()],[o[1][0].slice(),o[1][1].slice(),o[1][2].slice(),o[1][3].slice(),o[1][4].slice()]];var r=void 0;var n=void 0;var a=void 0;var u=void 0;var l=void 0;var c=this._tables[0][4];var f=this._tables[1];var d=i.length;var h=1;if(d!==4&&d!==6&&d!==8){throw new Error("Invalid aes key size")}u=i.slice(0);l=[];this._key=[u,l];for(r=d;r<4*d+28;r++){a=u[r-1];if(r%d===0||d===8&&r%d===4){a=c[a>>>24]<<24^c[a>>16&255]<<16^c[a>>8&255]<<8^c[a&255];if(r%d===0){a=a<<8^a>>>24^h<<24;h=h<<1^(h>>7)*283}}u[r]=u[r-d]^a}for(n=0;r;n++,r--){a=u[n&3?r:r-4];if(r<=4||n<4){l[n]=a}else{l[n]=f[0][c[a>>>24]]^f[1][c[a>>16&255]]^f[2][c[a>>8&255]]^f[3][c[a&255]]}}}e.prototype.decrypt=function e(t,i,r,n,a,s){var o=this._key[1];var u=t^o[0];var l=n^o[1];var c=r^o[2];var f=i^o[3];var d=void 0;var h=void 0;var p=void 0;var m=o.length/4-2;var v=void 0;var g=4;var y=this._tables[1];var _=y[0];var b=y[1];var T=y[2];var S=y[3];var k=y[4];for(v=0;v<m;v++){d=_[u>>>24]^b[l>>16&255]^T[c>>8&255]^S[f&255]^o[g];h=_[l>>>24]^b[c>>16&255]^T[f>>8&255]^S[u&255]^o[g+1];p=_[c>>>24]^b[f>>16&255]^T[u>>8&255]^S[l&255]^o[g+2];f=_[f>>>24]^b[u>>16&255]^T[l>>8&255]^S[c&255]^o[g+3];g+=4;u=d;l=h;c=p}for(v=0;v<4;v++){a[(3&-v)+s]=k[u>>>24]<<24^k[l>>16&255]<<16^k[c>>8&255]<<8^k[f&255]^o[g++];d=u;u=l;l=c;c=f;f=d}};return e}();var l=function(){function e(){t(this,e);this.listeners={}}e.prototype.on=function e(t,i){if(!this.listeners[t]){this.listeners[t]=[]}this.listeners[t].push(i)};e.prototype.off=function e(t,i){if(!this.listeners[t]){return false}var r=this.listeners[t].indexOf(i);this.listeners[t].splice(r,1);return r>-1};e.prototype.trigger=function e(t){var i=this.listeners[t];if(!i){return}if(arguments.length===2){var r=i.length;for(var n=0;n<r;++n){i[n].call(this,arguments[1])}}else{var a=Array.prototype.slice.call(arguments,1);var s=i.length;for(var o=0;o<s;++o){i[o].apply(this,a)}}};e.prototype.dispose=function e(){this.listeners={}};e.prototype.pipe=function e(t){this.on("data",function(e){t.push(e)})};return e}();var c=function(e){n(i,e);function i(){t(this,i);var r=a(this,e.call(this,l));r.jobs=[];r.delay=1;r.timeout_=null;return r}i.prototype.processJob_=function e(){this.jobs.shift()();if(this.jobs.length){this.timeout_=setTimeout(this.processJob_.bind(this),this.delay)}else{this.timeout_=null}};i.prototype.push=function e(t){this.jobs.push(t);if(!this.timeout_){this.timeout_=setTimeout(this.processJob_.bind(this),this.delay)}};return i}(l);var f=function e(t){return t<<24|(t&65280)<<8|(t&16711680)>>8|t>>>24};var d=function e(t,i,r){var n=new Int32Array(t.buffer,t.byteOffset,t.byteLength>>2);var a=new u(Array.prototype.slice.call(i));var s=new Uint8Array(t.byteLength);var o=new Int32Array(s.buffer);var l=void 0;var c=void 0;var d=void 0;var h=void 0;var p=void 0;var m=void 0;var v=void 0;var g=void 0;var y=void 0;l=r[0];c=r[1];d=r[2];h=r[3];for(y=0;y<n.length;y+=4){p=f(n[y]);m=f(n[y+1]);v=f(n[y+2]);g=f(n[y+3]);a.decrypt(p,m,v,g,o,y);o[y]=f(o[y]^l);o[y+1]=f(o[y+1]^c);o[y+2]=f(o[y+2]^d);o[y+3]=f(o[y+3]^h);l=p;c=m;d=v;h=g}return s};var h=function(){function i(r,n,a,s){t(this,i);var o=i.STEP;var u=new Int32Array(r.buffer);var l=new Uint8Array(r.byteLength);var d=0;this.asyncStream_=new c;this.asyncStream_.push(this.decryptChunk_(u.subarray(d,d+o),n,a,l));for(d=o;d<u.length;d+=o){a=new Uint32Array([f(u[d-4]),f(u[d-3]),f(u[d-2]),f(u[d-1])]);this.asyncStream_.push(this.decryptChunk_(u.subarray(d,d+o),n,a,l))}this.asyncStream_.push(function(){s(null,e(l))})}i.prototype.decryptChunk_=function e(t,i,r,n){return function(){var e=d(t,i,r);n.set(e,t.byteOffset)}};r(i,null,[{key:"STEP",get:function e(){return 32e3}}]);return i}();var p=function e(t){var i={};Object.keys(t).forEach(function(e){var r=t[e];if(ArrayBuffer.isView(r)){i[e]={bytes:r.buffer,byteOffset:r.byteOffset,byteLength:r.byteLength}}else{i[e]=r}});return i};var m=function e(t){t.onmessage=function(e){var i=e.data;var r=new Uint8Array(i.encrypted.bytes,i.encrypted.byteOffset,i.encrypted.byteLength);var n=new Uint32Array(i.key.bytes,i.key.byteOffset,i.key.byteLength/4);var a=new Uint32Array(i.iv.bytes,i.iv.byteOffset,i.iv.byteLength/4);new h(r,n,a,function(e,r){t.postMessage(p({source:i.source,decrypted:r}),[r.buffer])})}};var v=new m(i);return v}()});var jp=function e(t){var i=t.default?"main":"alternative";if(t.characteristics&&t.characteristics.indexOf("public.accessibility.describes-video")>=0){i="main-desc"}return i};var Fp=function e(t,i){t.abort();t.pause();if(i&&i.activePlaylistLoader){i.activePlaylistLoader.pause();i.activePlaylistLoader=null}};var Vp=function e(t,i){i.activePlaylistLoader=t;t.load()};var Hp=function e(t,i){return function(){var e=i.segmentLoaders,r=e[t],n=e.main,a=i.mediaTypes[t];var s=a.activeTrack();var o=a.activeGroup(s);var u=a.activePlaylistLoader;Fp(r,a);if(!o){return}if(!o.playlistLoader){if(u){n.resetEverything()}return}r.resyncLoader();Vp(o.playlistLoader,a)}};var qp=function e(t,i){return function(){var e=i.segmentLoaders,r=e[t],n=e.main,a=i.mediaTypes[t];var s=a.activeTrack();var o=a.activeGroup(s);var u=a.activePlaylistLoader;Fp(r,a);if(!o){return}if(!o.playlistLoader){n.resetEverything();return}if(u===o.playlistLoader){Vp(o.playlistLoader,a);return}if(r.track){r.track(s)}r.resetEverything();Vp(o.playlistLoader,a)}};var zp={AUDIO:function e(t,i){return function(){var e=i.segmentLoaders[t],r=i.mediaTypes[t],n=i.blacklistCurrentPlaylist;Fp(e,r);var a=r.activeTrack();var s=r.activeGroup();var o=(s.filter(function(e){return e.default})[0]||s[0]).id;var u=r.tracks[o];if(a===u){n({message:"Problem encountered loading the default audio track."});return}Is.log.warn("Problem encountered loading the alternate audio track."+"Switching back to default.");for(var l in r.tracks){r.tracks[l].enabled=r.tracks[l]===u}r.onTrackChanged()}},SUBTITLES:function e(t,i){return function(){var e=i.segmentLoaders[t],r=i.mediaTypes[t];Is.log.warn("Problem encountered loading the subtitle track."+"Disabling subtitle track.");Fp(e,r);var n=r.activeTrack();if(n){n.mode="disabled"}r.onTrackChanged()}}};var Wp={AUDIO:function e(t,i,r){if(!i){return}var n=r.tech,a=r.requestOptions,s=r.segmentLoaders[t];i.on("loadedmetadata",function(){var e=i.media();s.playlist(e,a);if(!n.paused()||e.endList&&n.preload()!=="none"){s.load()}});i.on("loadedplaylist",function(){s.playlist(i.media(),a);if(!n.paused()){s.load()}});i.on("error",zp[t](t,r))},SUBTITLES:function e(t,i,r){var n=r.tech,a=r.requestOptions,s=r.segmentLoaders[t],o=r.mediaTypes[t];i.on("loadedmetadata",function(){var e=i.media();s.playlist(e,a);s.track(o.activeTrack());if(!n.paused()||e.endList&&n.preload()!=="none"){s.load()}});i.on("loadedplaylist",function(){s.playlist(i.media(),a);if(!n.paused()){s.load()}});i.on("error",zp[t](t,r))}};var Gp=function e(t,i){return function(e){return e.attributes[t]===i}};var Xp=function e(t){return function(e){return e.resolvedUri===t}};var Yp={AUDIO:function e(t,i){var r=i.hls,n=i.sourceType,a=i.segmentLoaders[t],s=i.requestOptions,o=i.master,u=o.mediaGroups,l=o.playlists,c=i.mediaTypes[t],f=c.groups,d=c.tracks,h=i.masterPlaylistLoader;if(!u[t]||Object.keys(u[t]).length===0){u[t]={main:{default:{default:true}}}}for(var p in u[t]){if(!f[p]){f[p]=[]}var m=l.filter(Gp(t,p));for(var v in u[t][p]){var g=u[t][p][v];var y=m.filter(Xp(g.resolvedUri));if(y.length){delete g.resolvedUri}var _=void 0;if(g.resolvedUri){_=new td(g.resolvedUri,r,s)}else if(g.playlists&&n==="dash"){_=new Yh(g.playlists[0],r,s,h)}else{_=null}g=Is.mergeOptions({id:v,playlistLoader:_},g);Wp[t](t,g.playlistLoader,i);f[p].push(g);if(typeof d[v]==="undefined"){var b=new Is.AudioTrack({id:v,kind:jp(g),enabled:false,language:g.language,default:g.default,label:v});d[v]=b}}}a.on("error",zp[t](t,i))},SUBTITLES:function e(t,i){var r=i.tech,n=i.hls,a=i.sourceType,s=i.segmentLoaders[t],o=i.requestOptions,u=i.master.mediaGroups,l=i.mediaTypes[t],c=l.groups,f=l.tracks,d=i.masterPlaylistLoader;for(var h in u[t]){if(!c[h]){c[h]=[]}for(var p in u[t][h]){if(u[t][h][p].forced){continue}var m=u[t][h][p];var v=void 0;if(a==="hls"){v=new td(m.resolvedUri,n,o)}else if(a==="dash"){v=new Yh(m.playlists[0],n,o,d)}m=Is.mergeOptions({id:p,playlistLoader:v},m);Wp[t](t,m.playlistLoader,i);c[h].push(m);if(typeof f[p]==="undefined"){var g=r.addRemoteTextTrack({id:p,kind:"subtitles",default:m.default&&m.autoselect,language:m.language,label:p},false).track;f[p]=g}}}s.on("error",zp[t](t,i))},"CLOSED-CAPTIONS":function e(t,i){var r=i.tech,n=i.master.mediaGroups,a=i.mediaTypes[t],s=a.groups,o=a.tracks;for(var u in n[t]){if(!s[u]){s[u]=[]}for(var l in n[t][u]){var c=n[t][u][l];if(!c.instreamId.match(/CC\d/)){continue}s[u].push(Is.mergeOptions({id:l},c));if(typeof o[l]==="undefined"){var f=r.addRemoteTextTrack({id:c.instreamId,kind:"captions",default:c.default&&c.autoselect,language:c.language,label:l},false).track;o[l]=f}}}}};var Kp=function e(t,i){return function(e){var r=i.masterPlaylistLoader,n=i.mediaTypes[t].groups;var a=r.media();if(!a){return null}var s=null;if(a.attributes[t]){s=n[a.attributes[t]]}s=s||n.main;if(typeof e==="undefined"){return s}if(e===null){return null}return s.filter(function(t){return t.id===e.id})[0]||null}};var $p={AUDIO:function e(t,i){return function(){var e=i.mediaTypes[t].tracks;for(var r in e){if(e[r].enabled){return e[r]}}return null}},SUBTITLES:function e(t,i){return function(){var e=i.mediaTypes[t].tracks;for(var r in e){if(e[r].mode==="showing"){return e[r]}}return null}}};var Qp=function e(t){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(function(e){Yp[e](e,t)});var i=t.mediaTypes,r=t.masterPlaylistLoader,n=t.tech,a=t.hls;["AUDIO","SUBTITLES"].forEach(function(e){i[e].activeGroup=Kp(e,t);i[e].activeTrack=$p[e](e,t);i[e].onGroupChanged=Hp(e,t);i[e].onTrackChanged=qp(e,t)});var s=i.AUDIO.activeGroup();var o=(s.filter(function(e){return e.default})[0]||s[0]).id;i.AUDIO.tracks[o].enabled=true;i.AUDIO.onTrackChanged();r.on("mediachange",function(){["AUDIO","SUBTITLES"].forEach(function(e){return i[e].onGroupChanged()})});var u=function e(){i.AUDIO.onTrackChanged();n.trigger({type:"usage",name:"hls-audio-change"})};n.audioTracks().addEventListener("change",u);n.remoteTextTracks().addEventListener("change",i.SUBTITLES.onTrackChanged);a.on("dispose",function(){n.audioTracks().removeEventListener("change",u);n.remoteTextTracks().removeEventListener("change",i.SUBTITLES.onTrackChanged)});n.clearTracks("audio");for(var l in i.AUDIO.tracks){n.audioTracks().addTrack(i.AUDIO.tracks[l])}};var Jp=function e(){var t={};["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(function(e){t[e]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:$h,activeTrack:$h,onGroupChanged:$h,onTrackChanged:$h}});return t};var Zp=60*2;var em=void 0;var tm=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred"];var im=function e(t){return this.audioSegmentLoader_[t]+this.mainSegmentLoader_[t]};var rm=function(t){Hf(i,t);function i(e){jf(this,i);var t=qf(this,(i.__proto__||Object.getPrototypeOf(i)).call(this));var r=e.url,n=e.handleManifestRedirects,a=e.withCredentials,s=e.tech,o=e.bandwidth,u=e.externHls,l=e.useCueTags,c=e.blacklistDuration,f=e.enableLowInitialPlaylist,d=e.sourceType,h=e.seekTo;if(!r){throw new Error("A non-empty playlist URL is required")}em=u;t.withCredentials=a;t.tech_=s;t.hls_=s.hls;t.seekTo_=h;t.sourceType_=d;t.useCueTags_=l;t.blacklistDuration=c;t.enableLowInitialPlaylist=f;if(t.useCueTags_){t.cueTagsTrack_=t.tech_.addTextTrack("metadata","ad-cues");t.cueTagsTrack_.inBandMetadataTrackDispatchType=""}t.requestOptions_={withCredentials:a,handleManifestRedirects:n,timeout:null};t.mediaTypes_=Jp();t.mediaSource=new Is.MediaSource;t.mediaSource.addEventListener("sourceopen",t.handleSourceOpen_.bind(t));t.seekable_=Is.createTimeRanges();t.hasPlayed_=function(){return false};t.syncController_=new Bp(e);t.segmentMetadataTrack_=s.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},false).track;t.decrypter_=new Np;t.inbandTextTracks_={};var p={hls:t.hls_,mediaSource:t.mediaSource,currentTime:t.tech_.currentTime.bind(t.tech_),seekable:function e(){return t.seekable()},seeking:function e(){return t.tech_.seeking()},duration:function e(){return t.mediaSource.duration},hasPlayed:function e(){return t.hasPlayed_()},goalBufferLength:function e(){return t.goalBufferLength()},bandwidth:o,syncController:t.syncController_,decrypter:t.decrypter_,sourceType:t.sourceType_,inbandTextTracks:t.inbandTextTracks_};t.masterPlaylistLoader_=t.sourceType_==="dash"?new Yh(r,t.hls_,t.requestOptions_):new td(r,t.hls_,t.requestOptions_);t.setupMasterPlaylistLoaderListeners_();t.mainSegmentLoader_=new Ip(Is.mergeOptions(p,{segmentMetadataTrack:t.segmentMetadataTrack_,loaderType:"main"}),e);t.audioSegmentLoader_=new Ip(Is.mergeOptions(p,{loaderType:"audio"}),e);t.subtitleSegmentLoader_=new Up(Is.mergeOptions(p,{loaderType:"vtt"}),e);t.setupSegmentLoaderListeners_();tm.forEach(function(e){t[e+"_"]=im.bind(t,e)});t.logger_=Kh("MPC");t.masterPlaylistLoader_.load();return t}Ff(i,[{key:"setupMasterPlaylistLoaderListeners_",value:function e(){var t=this;this.masterPlaylistLoader_.on("loadedmetadata",function(){var e=t.masterPlaylistLoader_.media();var i=e.targetDuration*1.5*1e3;if(wd(t.masterPlaylistLoader_.master,t.masterPlaylistLoader_.media())){t.requestOptions_.timeout=0}else{t.requestOptions_.timeout=i}if(e.endList&&t.tech_.preload()!=="none"){t.mainSegmentLoader_.playlist(e,t.requestOptions_);t.mainSegmentLoader_.load()}Qp({sourceType:t.sourceType_,segmentLoaders:{AUDIO:t.audioSegmentLoader_,SUBTITLES:t.subtitleSegmentLoader_,main:t.mainSegmentLoader_},tech:t.tech_,requestOptions:t.requestOptions_,masterPlaylistLoader:t.masterPlaylistLoader_,hls:t.hls_,master:t.master(),mediaTypes:t.mediaTypes_,blacklistCurrentPlaylist:t.blacklistCurrentPlaylist.bind(t)});t.triggerPresenceUsage_(t.master(),e);try{t.setupSourceBuffers_()}catch(e){Is.log.warn("Failed to create SourceBuffers",e);return t.mediaSource.endOfStream("decode")}t.setupFirstPlay();if(!t.mediaTypes_.AUDIO.activePlaylistLoader||t.mediaTypes_.AUDIO.activePlaylistLoader.media()){t.trigger("selectedinitialmedia")}else{t.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",function(){t.trigger("selectedinitialmedia")})}});this.masterPlaylistLoader_.on("loadedplaylist",function(){var e=t.masterPlaylistLoader_.media();if(!e){t.excludeUnsupportedVariants_();var i=void 0;if(t.enableLowInitialPlaylist){i=t.selectInitialPlaylist()}if(!i){i=t.selectPlaylist()}t.initialMedia_=i;t.masterPlaylistLoader_.media(t.initialMedia_);return}if(t.useCueTags_){t.updateAdCues_(e)}t.mainSegmentLoader_.playlist(e,t.requestOptions_);t.updateDuration();if(!t.tech_.paused()){t.mainSegmentLoader_.load();if(t.audioSegmentLoader_){t.audioSegmentLoader_.load()}}if(!e.endList){var r=function e(){var i=t.seekable();if(i.length!==0){t.mediaSource.addSeekableRange_(i.start(0),i.end(0))}};if(t.duration()!==Infinity){var n=function e(){if(t.duration()===Infinity){r()}else{t.tech_.one("durationchange",e)}};t.tech_.one("durationchange",n)}else{r()}}});this.masterPlaylistLoader_.on("error",function(){t.blacklistCurrentPlaylist(t.masterPlaylistLoader_.error)});this.masterPlaylistLoader_.on("mediachanging",function(){t.mainSegmentLoader_.abort();t.mainSegmentLoader_.pause()});this.masterPlaylistLoader_.on("mediachange",function(){var e=t.masterPlaylistLoader_.media();var i=e.targetDuration*1.5*1e3;if(wd(t.masterPlaylistLoader_.master,t.masterPlaylistLoader_.media())){t.requestOptions_.timeout=0}else{t.requestOptions_.timeout=i}t.mainSegmentLoader_.playlist(e,t.requestOptions_);t.mainSegmentLoader_.load();t.tech_.trigger({type:"mediachange",bubbles:true})});this.masterPlaylistLoader_.on("playlistunchanged",function(){var e=t.masterPlaylistLoader_.media();var i=t.stuckAtPlaylistEnd_(e);if(i){t.blacklistCurrentPlaylist({message:"Playlist no longer updating."});t.tech_.trigger("playliststuck")}});this.masterPlaylistLoader_.on("renditiondisabled",function(){t.tech_.trigger({type:"usage",name:"hls-rendition-disabled"})});this.masterPlaylistLoader_.on("renditionenabled",function(){t.tech_.trigger({type:"usage",name:"hls-rendition-enabled"})})}},{key:"triggerPresenceUsage_",value:function e(t,i){var r=t.mediaGroups||{};var n=true;var a=Object.keys(r.AUDIO);for(var s in r.AUDIO){for(var o in r.AUDIO[s]){var u=r.AUDIO[s][o];if(!u.uri){n=false}}}if(n){this.tech_.trigger({type:"usage",name:"hls-demuxed"})}if(Object.keys(r.SUBTITLES).length){this.tech_.trigger({type:"usage",name:"hls-webvtt"})}if(em.Playlist.isAes(i)){this.tech_.trigger({type:"usage",name:"hls-aes"})}if(em.Playlist.isFmp4(i)){this.tech_.trigger({type:"usage",name:"hls-fmp4"})}if(a.length&&Object.keys(r.AUDIO[a[0]]).length>1){this.tech_.trigger({type:"usage",name:"hls-alternate-audio"})}if(this.useCueTags_){this.tech_.trigger({type:"usage",name:"hls-playlist-cue-tags"})}}},{key:"setupSegmentLoaderListeners_",value:function e(){var t=this;this.mainSegmentLoader_.on("bandwidthupdate",function(){var e=t.selectPlaylist();var i=t.masterPlaylistLoader_.media();var r=t.tech_.buffered();var n=r.length?r.end(r.length-1)-t.tech_.currentTime():0;var a=t.bufferLowWaterLine();if(!i.endList||t.duration()<Jh.MAX_BUFFER_LOW_WATER_LINE||e.attributes.BANDWIDTH<i.attributes.BANDWIDTH||n>=a){t.masterPlaylistLoader_.media(e)}t.tech_.trigger("bandwidthupdate")});this.mainSegmentLoader_.on("progress",function(){t.trigger("progress")});this.mainSegmentLoader_.on("error",function(){t.blacklistCurrentPlaylist(t.mainSegmentLoader_.error())});this.mainSegmentLoader_.on("syncinfoupdate",function(){t.onSyncInfoUpdate_()});this.mainSegmentLoader_.on("timestampoffset",function(){t.tech_.trigger({type:"usage",name:"hls-timestamp-offset"})});this.audioSegmentLoader_.on("syncinfoupdate",function(){t.onSyncInfoUpdate_()});this.mainSegmentLoader_.on("ended",function(){t.onEndOfStream()});this.mainSegmentLoader_.on("earlyabort",function(){t.blacklistCurrentPlaylist({message:"Aborted early because there isn't enough bandwidth to complete the "+"request without rebuffering."},Zp)});this.mainSegmentLoader_.on("reseteverything",function(){t.tech_.trigger("hls-reset")});this.mainSegmentLoader_.on("segmenttimemapping",function(e){t.tech_.trigger({type:"hls-segment-time-mapping",mapping:e.mapping})});this.audioSegmentLoader_.on("ended",function(){t.onEndOfStream()})}},{key:"mediaSecondsLoaded_",value:function e(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}},{key:"load",value:function e(){this.mainSegmentLoader_.load();if(this.mediaTypes_.AUDIO.activePlaylistLoader){this.audioSegmentLoader_.load()}if(this.mediaTypes_.SUBTITLES.activePlaylistLoader){this.subtitleSegmentLoader_.load()}}},{key:"smoothQualityChange_",value:function e(){var t=this.selectPlaylist();if(t!==this.masterPlaylistLoader_.media()){this.masterPlaylistLoader_.media(t);this.mainSegmentLoader_.resetLoader()}}},{key:"fastQualityChange_",value:function e(){var t=this;var i=this.selectPlaylist();if(i===this.masterPlaylistLoader_.media()){return}this.masterPlaylistLoader_.media(i);this.mainSegmentLoader_.resetEverything(function(){if(Is.browser.IE_VERSION||Is.browser.IS_EDGE){t.tech_.setCurrentTime(t.tech_.currentTime()+.04)}else{t.tech_.setCurrentTime(t.tech_.currentTime())}})}},{key:"play",value:function e(){if(this.setupFirstPlay()){return}if(this.tech_.ended()){this.seekTo_(0)}if(this.hasPlayed_()){this.load()}var t=this.tech_.seekable();if(this.tech_.duration()===Infinity){if(this.tech_.currentTime()<t.start(0)){return this.seekTo_(t.end(t.length-1))}}}},{key:"setupFirstPlay",value:function e(){var t=this;var i=this.masterPlaylistLoader_.media();if(!i||this.tech_.paused()||this.hasPlayed_()){return false}if(!i.endList){var r=this.seekable();if(!r.length){return false}if(Is.browser.IE_VERSION&&this.tech_.readyState()===0){this.tech_.one("loadedmetadata",function(){t.trigger("firstplay");t.seekTo_(r.end(0));t.hasPlayed_=function(){return true}});return false}this.trigger("firstplay");this.seekTo_(r.end(0))}this.hasPlayed_=function(){return true};this.load();return true}},{key:"handleSourceOpen_",value:function e(){try{this.setupSourceBuffers_()}catch(e){Is.log.warn("Failed to create Source Buffers",e);return this.mediaSource.endOfStream("decode")}if(this.tech_.autoplay()){var t=this.tech_.play();if(typeof t!=="undefined"&&typeof t.then==="function"){t.then(null,function(e){})}}this.trigger("sourceopen")}},{key:"onEndOfStream",value:function e(){var t=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){if(!this.mainSegmentLoader_.startingMedia_||this.mainSegmentLoader_.startingMedia_.containsVideo){t=t&&this.audioSegmentLoader_.ended_}else{t=this.audioSegmentLoader_.ended_}}if(!t){return}this.logger_("calling mediaSource.endOfStream()");try{this.mediaSource.endOfStream()}catch(e){Is.log.warn("Failed to call media source endOfStream",e)}}},{key:"stuckAtPlaylistEnd_",value:function e(t){var i=this.seekable();if(!i.length){return false}var r=this.syncController_.getExpiredTime(t,this.mediaSource.duration);if(r===null){return false}var n=em.Playlist.playlistEnd(t,r);var a=this.tech_.currentTime();var s=this.tech_.buffered();if(!s.length){return n-a<=Yd}var o=s.end(s.length-1);return o-a<=Yd&&n-o<=Yd}},{key:"blacklistCurrentPlaylist",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var i=arguments[1];var r=void 0;var n=void 0;r=t.playlist||this.masterPlaylistLoader_.media();i=i||t.blacklistDuration||this.blacklistDuration;if(!r){this.error=t;try{return this.mediaSource.endOfStream("network")}catch(e){return this.trigger("error")}}var a=this.masterPlaylistLoader_.master.playlists.filter(yd).length===1;if(a){Is.log.warn("Problem encountered with the current "+"HLS playlist. Trying again since it is the final playlist.");this.tech_.trigger("retryplaylist");return this.masterPlaylistLoader_.load(a)}r.excludeUntil=Date.now()+i*1e3;this.tech_.trigger("blacklistplaylist");this.tech_.trigger({type:"usage",name:"hls-rendition-blacklisted"});n=this.selectPlaylist();Is.log.warn("Problem encountered with the current HLS playlist."+(t.message?" "+t.message:"")+" Switching to another playlist.");return this.masterPlaylistLoader_.media(n)}},{key:"pauseLoading",value:function e(){this.mainSegmentLoader_.pause();if(this.mediaTypes_.AUDIO.activePlaylistLoader){this.audioSegmentLoader_.pause()}if(this.mediaTypes_.SUBTITLES.activePlaylistLoader){this.subtitleSegmentLoader_.pause()}}},{key:"setCurrentTime",value:function e(t){var i=$d(this.tech_.buffered(),t);if(!(this.masterPlaylistLoader_&&this.masterPlaylistLoader_.media())){return 0}if(!this.masterPlaylistLoader_.media().segments){return 0}if(i&&i.length){return t}this.mainSegmentLoader_.resetEverything();this.mainSegmentLoader_.abort();if(this.mediaTypes_.AUDIO.activePlaylistLoader){this.audioSegmentLoader_.resetEverything();this.audioSegmentLoader_.abort()}if(this.mediaTypes_.SUBTITLES.activePlaylistLoader){this.subtitleSegmentLoader_.resetEverything();this.subtitleSegmentLoader_.abort()}this.load()}},{key:"duration",value:function e(){if(!this.masterPlaylistLoader_){return 0}if(this.mediaSource){return this.mediaSource.duration}return em.Playlist.duration(this.masterPlaylistLoader_.media())}},{key:"seekable",value:function e(){return this.seekable_}},{key:"onSyncInfoUpdate_",value:function e(){var t=void 0;var i=void 0;if(!this.masterPlaylistLoader_){return}var r=this.masterPlaylistLoader_.media();if(!r){return}var n=this.syncController_.getExpiredTime(r,this.mediaSource.duration);if(n===null){return}t=em.Playlist.seekable(r,n);if(t.length===0){return}if(this.mediaTypes_.AUDIO.activePlaylistLoader){r=this.mediaTypes_.AUDIO.activePlaylistLoader.media();n=this.syncController_.getExpiredTime(r,this.mediaSource.duration);if(n===null){return}i=em.Playlist.seekable(r,n);if(i.length===0){return}}var a=void 0;var s=void 0;if(this.seekable_&&this.seekable_.length){a=this.seekable_.end(0);s=this.seekable_.start(0)}if(!i){this.seekable_=t}else if(i.start(0)>t.end(0)||t.start(0)>i.end(0)){this.seekable_=t}else{this.seekable_=Is.createTimeRanges([[i.start(0)>t.start(0)?i.start(0):t.start(0),i.end(0)<t.end(0)?i.end(0):t.end(0)]])}if(this.seekable_&&this.seekable_.length){if(this.seekable_.end(0)===a&&this.seekable_.start(0)===s){return}}this.logger_("seekable updated ["+Zd(this.seekable_)+"]");this.tech_.trigger("seekablechanged")}},{key:"updateDuration",value:function e(){var t=this;var i=this.mediaSource.duration;var r=em.Playlist.duration(this.masterPlaylistLoader_.media());var n=this.tech_.buffered();var a=function e(){t.logger_("Setting duration from "+t.mediaSource.duration+" => "+r);try{t.mediaSource.duration=r}catch(e){Is.log.warn("Failed to set media source duration",e)}t.tech_.trigger("durationchange");t.mediaSource.removeEventListener("sourceopen",e)};if(n.length>0){r=Math.max(r,n.end(n.length-1))}if(i!==r){if(this.mediaSource.readyState!=="open"){this.mediaSource.addEventListener("sourceopen",a)}else{a()}}}},{key:"dispose",value:function e(){var t=this;this.decrypter_.terminate();this.masterPlaylistLoader_.dispose();this.mainSegmentLoader_.dispose();["AUDIO","SUBTITLES"].forEach(function(e){var i=t.mediaTypes_[e].groups;for(var r in i){i[r].forEach(function(e){if(e.playlistLoader){e.playlistLoader.dispose()}})}});this.audioSegmentLoader_.dispose();this.subtitleSegmentLoader_.dispose()}},{key:"master",value:function e(){return this.masterPlaylistLoader_.master}},{key:"media",value:function e(){return this.masterPlaylistLoader_.media()||this.initialMedia_}},{key:"setupSourceBuffers_",value:function e(){var t=this.masterPlaylistLoader_.media();var i=void 0;if(!t||this.mediaSource.readyState!=="open"){return}i=Lh(this.masterPlaylistLoader_.master,t);if(i.length<1){this.error="No compatible SourceBuffer configuration for the variant stream:"+t.resolvedUri;return this.mediaSource.endOfStream("decode")}this.configureLoaderMimeTypes_(i);this.excludeIncompatibleVariants_(t)}},{key:"configureLoaderMimeTypes_",value:function e(t){var i=t.length>1&&t[0].indexOf(",")===-1&&t[0]!==t[1]?new Is.EventTarget:null;this.mainSegmentLoader_.mimeType(t[0],i);if(t[1]){this.audioSegmentLoader_.mimeType(t[1],i)}}},{key:"excludeUnsupportedVariants_",value:function t(){this.master().playlists.forEach(function(t){if(t.attributes.CODECS&&e.MediaSource&&e.MediaSource.isTypeSupported&&!e.MediaSource.isTypeSupported('video/mp4; codecs="'+kh(t.attributes.CODECS)+'"')){t.excludeUntil=Infinity}})}},{key:"excludeIncompatibleVariants_",value:function e(t){var i=2;var r=null;var n=void 0;if(t.attributes.CODECS){n=Sh(t.attributes.CODECS);r=n.videoCodec;i=n.codecCount}this.master().playlists.forEach(function(e){var t={codecCount:2,videoCodec:null};if(e.attributes.CODECS){t=Sh(e.attributes.CODECS)}if(t.codecCount!==i){e.excludeUntil=Infinity}if(t.videoCodec!==r){e.excludeUntil=Infinity}})}},{key:"updateAdCues_",value:function e(t){var i=0;var r=this.seekable();if(r.length){i=r.start(0)}xp(t,this.cueTagsTrack_,i)}},{key:"goalBufferLength",value:function e(){var t=this.tech_.currentTime();var i=Jh.GOAL_BUFFER_LENGTH;var r=Jh.GOAL_BUFFER_LENGTH_RATE;var n=Math.max(i,Jh.MAX_GOAL_BUFFER_LENGTH);return Math.min(i+t*r,n)}},{key:"bufferLowWaterLine",value:function e(){var t=this.tech_.currentTime();var i=Jh.BUFFER_LOW_WATER_LINE;var r=Jh.BUFFER_LOW_WATER_LINE_RATE;var n=Math.max(i,Jh.MAX_BUFFER_LOW_WATER_LINE);return Math.min(i+t*r,n)}}]);return i}(Is.EventTarget);var nm=function e(t,i,r){return function(e){var n=t.master.playlists[i];var a=gd(n);var s=yd(n);if(typeof e==="undefined"){return s}if(e){delete n.disabled}else{n.disabled=true}if(e!==s&&!a){r();if(e){t.trigger("renditionenabled")}else{t.trigger("renditiondisabled")}}return e}};var am=function e(t,i,r){jf(this,e);var n=t.masterPlaylistController_,a=t.options_.smoothQualityChange;var s=a?"smooth":"fast";var o=n[s+"QualityChange_"].bind(n);if(i.attributes.RESOLUTION){var u=i.attributes.RESOLUTION;this.width=u.width;this.height=u.height}this.bandwidth=i.attributes.BANDWIDTH;this.id=r;this.enabled=nm(t.playlists,i.uri,o)};var sm=function e(t){var i=t.playlists;t.representations=function(){return i.master.playlists.filter(function(e){return!gd(e)}).map(function(e,i){return new am(t,e,e.uri)})}};var om=["seeking","seeked","pause","playing","error"];var um=function(){function t(i){var r=this;jf(this,t);this.tech_=i.tech;this.seekable=i.seekable;this.seekTo=i.seekTo;this.allowSeeksWithinUnsafeLiveWindow=i.allowSeeksWithinUnsafeLiveWindow;this.media=i.media;this.consecutiveUpdates=0;this.lastRecordedTime=null;this.timer_=null;this.checkCurrentTimeTimeout_=null;this.logger_=Kh("PlaybackWatcher");this.logger_("initialize");var n=function e(){return r.monitorCurrentTime_()};var a=function e(){return r.techWaiting_()};var s=function e(){return r.cancelTimer_()};var o=function e(){return r.fixesBadSeeks_()};this.tech_.on("seekablechanged",o);this.tech_.on("waiting",a);this.tech_.on(om,s);this.tech_.on("canplay",n);this.dispose=function(){r.logger_("dispose");r.tech_.off("seekablechanged",o);r.tech_.off("waiting",a);r.tech_.off(om,s);r.tech_.off("canplay",n);if(r.checkCurrentTimeTimeout_){e.clearTimeout(r.checkCurrentTimeTimeout_)}r.cancelTimer_()}}Ff(t,[{key:"monitorCurrentTime_",value:function t(){this.checkCurrentTime_();if(this.checkCurrentTimeTimeout_){e.clearTimeout(this.checkCurrentTimeTimeout_)}this.checkCurrentTimeTimeout_=e.setTimeout(this.monitorCurrentTime_.bind(this),250)}},{key:"checkCurrentTime_",value:function e(){if(this.tech_.seeking()&&this.fixesBadSeeks_()){this.consecutiveUpdates=0;this.lastRecordedTime=this.tech_.currentTime();return}if(this.tech_.paused()||this.tech_.seeking()){return}var t=this.tech_.currentTime();var i=this.tech_.buffered();if(this.lastRecordedTime===t&&(!i.length||t+Yd>=i.end(i.length-1))){return this.techWaiting_()}if(this.consecutiveUpdates>=5&&t===this.lastRecordedTime){this.consecutiveUpdates++;this.waiting_()}else if(t===this.lastRecordedTime){this.consecutiveUpdates++}else{this.consecutiveUpdates=0;this.lastRecordedTime=t}}},{key:"cancelTimer_",value:function e(){this.consecutiveUpdates=0;if(this.timer_){this.logger_("cancelTimer_");clearTimeout(this.timer_)}this.timer_=null}},{key:"fixesBadSeeks_",value:function e(){var t=this.tech_.seeking();if(!t){return false}var i=this.seekable();var r=this.tech_.currentTime();var n=this.afterSeekableWindow_(i,r,this.media(),this.allowSeeksWithinUnsafeLiveWindow);var a=void 0;if(n){var s=i.end(i.length-1);a=s}if(this.beforeSeekableWindow_(i,r)){var o=i.start(0);a=o+Yd}if(typeof a!=="undefined"){this.logger_("Trying to seek outside of seekable at time "+r+" with "+("seekable range "+Zd(i)+". Seeking to ")+(a+"."));this.seekTo(a);return true}return false}},{key:"waiting_",value:function e(){if(this.techWaiting_()){return}var t=this.tech_.currentTime();var i=this.tech_.buffered();var r=$d(i,t);if(r.length&&t+3<=r.end(0)){this.cancelTimer_();this.seekTo(t);this.logger_("Stopped at "+t+" while inside a buffered region "+("["+r.start(0)+" -> "+r.end(0)+"]. Attempting to resume ")+"playback by seeking to the current time.");this.tech_.trigger({type:"usage",name:"hls-unknown-waiting"});return}}},{key:"techWaiting_",value:function e(){var t=this.seekable();var i=this.tech_.currentTime();if(this.tech_.seeking()&&this.fixesBadSeeks_()){return true}if(this.tech_.seeking()||this.timer_!==null){return true}if(this.beforeSeekableWindow_(t,i)){var r=t.end(t.length-1);this.logger_("Fell out of live window at time "+i+". Seeking to "+("live point (seekable end) "+r));this.cancelTimer_();this.seekTo(r);this.tech_.trigger({type:"usage",name:"hls-live-resync"});return true}var n=this.tech_.buffered();var a=Qd(n,i);if(this.videoUnderflow_(a,n,i)){this.cancelTimer_();this.seekTo(i);this.tech_.trigger({type:"usage",name:"hls-video-underflow"});return true}if(a.length>0){var s=a.start(0)-i;this.logger_("Stopped at "+i+", setting timer for "+s+", seeking "+("to "+a.start(0)));this.timer_=setTimeout(this.skipTheGap_.bind(this),s*1e3,i);return true}return false}},{key:"afterSeekableWindow_",value:function e(t,i,r){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;if(!t.length){return false}var a=t.end(t.length-1)+Yd;var s=!r.endList;if(s&&n){a=t.end(t.length-1)+r.targetDuration*3}if(i>a){return true}return false}},{key:"beforeSeekableWindow_",value:function e(t,i){if(t.length&&t.start(0)>0&&i<t.start(0)-Yd){return true}return false}},{key:"videoUnderflow_",value:function e(t,i,r){if(t.length===0){var n=this.gapFromVideoUnderflow_(i,r);if(n){this.logger_("Encountered a gap in video from "+n.start+" to "+n.end+". "+("Seeking to current time "+r));return true}}return false}},{key:"skipTheGap_",value:function e(t){var i=this.tech_.buffered();var r=this.tech_.currentTime();var n=Qd(i,r);this.cancelTimer_();if(n.length===0||r!==t){return}this.logger_("skipTheGap_:","currentTime:",r,"scheduled currentTime:",t,"nextRange start:",n.start(0));this.seekTo(n.start(0)+Xd);this.tech_.trigger({type:"usage",name:"hls-gap-skip"})}},{key:"gapFromVideoUnderflow_",value:function e(t,i){var r=Jd(t);for(var n=0;n<r.length;n++){var a=r.start(n);var s=r.end(n);if(i-a<4&&i-a>2){return{start:a,end:s}}}return null}}]);return t}();var lm={errorInterval:30,getSource:function e(t){var i=this.tech({IWillNotUseThisInPlugins:true});var r=i.currentSource_;return t(r)}};var cm=function e(t,i){var r=0;var n=0;var a=Is.mergeOptions(lm,i);t.ready(function(){t.trigger({type:"usage",name:"hls-error-reload-initialized"})});var s=function e(){if(n){t.currentTime(n)}};var o=function e(i){if(i===null||i===undefined){return}n=t.duration()!==Infinity&&t.currentTime()||0;t.one("loadedmetadata",s);t.src(i);t.trigger({type:"usage",name:"hls-error-reload"});t.play()};var u=function e(){if(Date.now()-r<a.errorInterval*1e3){t.trigger({type:"usage",name:"hls-error-reload-canceled"});return}if(!a.getSource||typeof a.getSource!=="function"){Is.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!");return}r=Date.now();return a.getSource.call(t,o)};var l=function e(){t.off("loadedmetadata",s);t.off("error",u);t.off("dispose",e)};var c=function i(r){l();e(t,r)};t.on("error",u);t.on("dispose",l);t.reloadSourceOnError=c};var fm=function e(t){cm(this,t)};var dm="1.9.3";Is.use("*",function(e){return{setSource:function e(t,i){i(null,t)},setCurrentTime:function t(i){if(e.vhs&&e.currentSource().src===e.vhs.source_.src){e.vhs.setCurrentTime(i)}return i},play:function t(){if(e.vhs&&e.currentSource().src===e.vhs.source_.src){e.vhs.setCurrentTime(e.tech_.currentTime())}}}});var hm={PlaylistLoader:td,Playlist:Cd,Decrypter:Mf,AsyncStream:Df,decrypt:Rf,utils:Bd,STANDARD_PLAYLIST_SELECTOR:yp,INITIAL_PLAYLIST_SELECTOR:bp,comparePlaylistBandwidth:mp,comparePlaylistResolution:vp,xhr:Ld()};["GOAL_BUFFER_LENGTH","MAX_GOAL_BUFFER_LENGTH","GOAL_BUFFER_LENGTH_RATE","BUFFER_LOW_WATER_LINE","MAX_BUFFER_LOW_WATER_LINE","BUFFER_LOW_WATER_LINE_RATE","BANDWIDTH_VARIANCE"].forEach(function(e){Object.defineProperty(hm,e,{get:function t(){Is.log.warn("using Hls."+e+" is UNSAFE be sure you know what you are doing");return Jh[e]},set:function t(i){Is.log.warn("using Hls."+e+" is UNSAFE be sure you know what you are doing");if(typeof i!=="number"||i<0){Is.log.warn("value of Hls."+e+" must be greater than or equal to 0");return}Jh[e]=i}})});var pm="videojs-vhs";var mm=function e(t){var i=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i;if(i.test(t)){return"hls"}var r=/^application\/dash\+xml/i;if(r.test(t)){return"dash"}return null};var vm=function e(t,i){var r=i.media();var n=-1;for(var a=0;a<t.length;a++){if(t[a].id===r.uri){n=a;break}}t.selectedIndex_=n;t.trigger({selectedIndex:n,type:"change"})};var gm=function e(t,i){i.representations().forEach(function(e){t.addQualityLevel(e)});vm(t,i.playlists)};hm.canPlaySource=function(){return Is.log.warn("HLS is no longer a tech. Please remove it from "+"your player's techOrder.")};var ym=function e(t,i,r){if(!t){return t}var n={};for(var a in t){n[a]={audioContentType:'audio/mp4; codecs="'+r.attributes.CODECS+'"',videoContentType:'video/mp4; codecs="'+i.attributes.CODECS+'"'};if(i.contentProtection&&i.contentProtection[a]&&i.contentProtection[a].pssh){n[a].pssh=i.contentProtection[a].pssh}if(typeof t[a]==="string"){n[a].url=t[a]}}return Is.mergeOptions(t,n)};var _m=function e(t){if(t.options_.sourceType!=="dash"){return}var i=Is.players[t.tech_.options_.playerId];if(i.eme){var r=ym(t.source_.keySystems,t.playlists.media(),t.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader.media());if(r){i.currentSource().keySystems=r;if(i.eme.initializeMediaKeys){i.eme.initializeMediaKeys()}}}};var bm=function e(){if(!window.localStorage){return null}var t=window.localStorage.getItem(pm);if(!t){return null}try{return JSON.parse(t)}catch(e){return null}};var Tm=function e(t){if(!window.localStorage){return false}var i=bm();i=i?Is.mergeOptions(i,t):t;try{window.localStorage.setItem(pm,JSON.stringify(i))}catch(e){return false}return i};hm.supportsNativeHls=function(){var e=t.createElement("video");if(!Is.getTech("Html5").isSupported()){return false}var i=["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"];return i.some(function(t){return/maybe|probably/i.test(e.canPlayType(t))})}();hm.supportsNativeDash=function(){if(!Is.getTech("Html5").isSupported()){return false}return/maybe|probably/i.test(t.createElement("video").canPlayType("application/dash+xml"))}();hm.supportsTypeNatively=function(e){if(e==="hls"){return hm.supportsNativeHls}if(e==="dash"){return hm.supportsNativeDash}return false};hm.isSupported=function(){return Is.log.warn("HLS is no longer a tech. Please remove it from "+"your player's techOrder.")};var Sm=Is.getComponent("Component");var km=function(e){Hf(i,e);function i(e,r,n){jf(this,i);var a=qf(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,r,n.hls));if(r.options_&&r.options_.playerId){var s=Is(r.options_.playerId);if(!s.hasOwnProperty("hls")){Object.defineProperty(s,"hls",{get:function e(){Is.log.warn("player.hls is deprecated. Use player.tech().hls instead.");r.trigger({type:"usage",name:"hls-player-access"});return a},configurable:true})}s.vhs=a;s.dash=a;a.player_=s}a.tech_=r;a.source_=e;a.stats={};a.setOptions_();if(a.options_.overrideNative&&r.overrideNativeAudioTracks&&r.overrideNativeVideoTracks){r.overrideNativeAudioTracks(true);r.overrideNativeVideoTracks(true)}else if(a.options_.overrideNative&&(r.featuresNativeVideoTracks||r.featuresNativeAudioTracks)){throw new Error("Overriding native HLS requires emulated tracks. "+"See https://git.io/vMpjB")}a.on(t,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],function(e){var i=t.fullscreenElement||t.webkitFullscreenElement||t.mozFullScreenElement||t.msFullscreenElement;if(i&&i.contains(a.tech_.el())){a.masterPlaylistController_.smoothQualityChange_()}});a.on(a.tech_,"seeking",function(){if(this.tech_.currentTime()===0&&this.tech_.player_.loop()){this.setCurrentTime(0)}});a.on(a.tech_,"error",function(){if(this.masterPlaylistController_){this.masterPlaylistController_.pauseLoading()}});a.on(a.tech_,"play",a.play);return a}Ff(i,[{key:"setOptions_",value:function e(){var t=this;this.options_.withCredentials=this.options_.withCredentials||false;this.options_.handleManifestRedirects=this.options_.handleManifestRedirects||false;this.options_.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions===false?false:true;this.options_.smoothQualityChange=this.options_.smoothQualityChange||false;this.options_.useBandwidthFromLocalStorage=typeof this.source_.useBandwidthFromLocalStorage!=="undefined"?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||false;this.options_.customTagParsers=this.options_.customTagParsers||[];this.options_.customTagMappers=this.options_.customTagMappers||[];if(typeof this.options_.blacklistDuration!=="number"){this.options_.blacklistDuration=5*60}if(typeof this.options_.bandwidth!=="number"){if(this.options_.useBandwidthFromLocalStorage){var i=bm();if(i&&i.bandwidth){this.options_.bandwidth=i.bandwidth;this.tech_.trigger({type:"usage",name:"hls-bandwidth-from-local-storage"})}if(i&&i.throughput){this.options_.throughput=i.throughput;this.tech_.trigger({type:"usage",name:"hls-throughput-from-local-storage"})}}}if(typeof this.options_.bandwidth!=="number"){this.options_.bandwidth=Jh.INITIAL_BANDWIDTH}this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===Jh.INITIAL_BANDWIDTH;["withCredentials","limitRenditionByPlayerDimensions","bandwidth","smoothQualityChange","customTagParsers","customTagMappers","handleManifestRedirects"].forEach(function(e){if(typeof t.source_[e]!=="undefined"){t.options_[e]=t.source_[e]}});this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions}},{key:"src",value:function e(t,i){var r=this;if(!t){return}this.setOptions_();this.options_.url=this.source_.src;this.options_.tech=this.tech_;this.options_.externHls=hm;this.options_.sourceType=mm(i);this.options_.seekTo=function(e){r.tech_.setCurrentTime(e);r.setCurrentTime(e)};this.masterPlaylistController_=new rm(this.options_);this.playbackWatcher_=new um(Is.mergeOptions(this.options_,{seekable:function e(){return r.seekable()},media:function e(){return r.masterPlaylistController_.media()}}));this.masterPlaylistController_.on("error",function(){var e=Is.players[r.tech_.options_.playerId];e.error(r.masterPlaylistController_.error)});this.masterPlaylistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):hm.STANDARD_PLAYLIST_SELECTOR.bind(this);this.masterPlaylistController_.selectInitialPlaylist=hm.INITIAL_PLAYLIST_SELECTOR.bind(this);this.playlists=this.masterPlaylistController_.masterPlaylistLoader_;this.mediaSource=this.masterPlaylistController_.mediaSource;Object.defineProperties(this,{selectPlaylist:{get:function e(){return this.masterPlaylistController_.selectPlaylist},set:function e(t){this.masterPlaylistController_.selectPlaylist=t.bind(this)}},throughput:{get:function e(){return this.masterPlaylistController_.mainSegmentLoader_.throughput.rate},set:function e(t){this.masterPlaylistController_.mainSegmentLoader_.throughput.rate=t;this.masterPlaylistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get:function e(){return this.masterPlaylistController_.mainSegmentLoader_.bandwidth},set:function e(t){this.masterPlaylistController_.mainSegmentLoader_.bandwidth=t;this.masterPlaylistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get:function e(){var t=1/(this.bandwidth||1);var i=void 0;if(this.throughput>0){i=1/this.throughput}else{i=0}var r=Math.floor(1/(t+i));return r},set:function e(){Is.log.error('The "systemBandwidth" property is read-only')}}});if(this.options_.bandwidth){this.bandwidth=this.options_.bandwidth}if(this.options_.throughput){this.throughput=this.options_.throughput}Object.defineProperties(this.stats,{bandwidth:{get:function e(){return r.bandwidth||0},enumerable:true},mediaRequests:{get:function e(){return r.masterPlaylistController_.mediaRequests_()||0},enumerable:true},mediaRequestsAborted:{get:function e(){return r.masterPlaylistController_.mediaRequestsAborted_()||0},enumerable:true},mediaRequestsTimedout:{get:function e(){return r.masterPlaylistController_.mediaRequestsTimedout_()||0},enumerable:true},mediaRequestsErrored:{get:function e(){return r.masterPlaylistController_.mediaRequestsErrored_()||0},enumerable:true},mediaTransferDuration:{get:function e(){return r.masterPlaylistController_.mediaTransferDuration_()||0},enumerable:true},mediaBytesTransferred:{get:function e(){return r.masterPlaylistController_.mediaBytesTransferred_()||0},enumerable:true},mediaSecondsLoaded:{get:function e(){return r.masterPlaylistController_.mediaSecondsLoaded_()||0},enumerable:true},buffered:{get:function e(){return th(r.tech_.buffered())},enumerable:true},currentTime:{get:function e(){return r.tech_.currentTime()},enumerable:true},currentSource:{get:function e(){return r.tech_.currentSource_},enumerable:true},currentTech:{get:function e(){return r.tech_.name_},enumerable:true},duration:{get:function e(){return r.tech_.duration()},enumerable:true},master:{get:function e(){return r.playlists.master},enumerable:true},playerDimensions:{get:function e(){return r.tech_.currentDimensions()},enumerable:true},seekable:{get:function e(){return th(r.tech_.seekable())},enumerable:true},timestamp:{get:function e(){return Date.now()},enumerable:true},videoPlaybackQuality:{get:function e(){return r.tech_.getVideoPlaybackQuality()},enumerable:true}});this.tech_.one("canplay",this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_));this.tech_.on("bandwidthupdate",function(){if(r.options_.useBandwidthFromLocalStorage){Tm({bandwidth:r.bandwidth,throughput:Math.round(r.throughput)})}});this.masterPlaylistController_.on("selectedinitialmedia",function(){sm(r);_m(r)});this.on(this.masterPlaylistController_,"progress",function(){this.tech_.trigger("progress")});this.tech_.ready(function(){return r.setupQualityLevels_()});if(!this.tech_.el()){return}this.tech_.src(Is.URL.createObjectURL(this.masterPlaylistController_.mediaSource))}},{key:"setupQualityLevels_",value:function e(){var t=this;var i=Is.players[this.tech_.options_.playerId];if(i&&i.qualityLevels){this.qualityLevels_=i.qualityLevels();this.masterPlaylistController_.on("selectedinitialmedia",function(){gm(t.qualityLevels_,t)});this.playlists.on("mediachange",function(){vm(t.qualityLevels_,t.playlists)})}}},{key:"play",value:function e(){this.masterPlaylistController_.play()}},{key:"setCurrentTime",value:function e(t){this.masterPlaylistController_.setCurrentTime(t)}},{key:"duration",value:function e(){return this.masterPlaylistController_.duration()}},{key:"seekable",value:function e(){return this.masterPlaylistController_.seekable()}},{key:"dispose",value:function e(){if(this.playbackWatcher_){this.playbackWatcher_.dispose()}if(this.masterPlaylistController_){this.masterPlaylistController_.dispose()}if(this.qualityLevels_){this.qualityLevels_.dispose()}if(this.player_){delete this.player_.vhs;delete this.player_.dash;delete this.player_.hls}if(this.tech_&&this.tech_.hls){delete this.tech_.hls}Vf(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"dispose",this).call(this)}},{key:"convertToProgramTime",value:function e(t,i){return Wd({playlist:this.masterPlaylistController_.media(),time:t,callback:i})}},{key:"seekToProgramTime",value:function e(t,i){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:true;var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:2;return Gd({programTime:t,playlist:this.masterPlaylistController_.media(),retryCount:n,pauseAfterSeek:r,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:i})}}]);return i}(Sm);var wm={name:"videojs-http-streaming",VERSION:dm,canHandleSource:function e(t){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var r=Is.mergeOptions(Is.options,i);return wm.canPlayType(t.type,r)},handleSource:function e(t,i){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var n=Is.mergeOptions(Is.options,r);i.hls=new km(t,i,n);i.hls.xhr=Ld();i.hls.src(t.src,t.type);return i.hls},canPlayType:function e(t){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var r=Is.mergeOptions(Is.options,i),n=r.hls.overrideNative;var a=mm(t);var s=a&&(!hm.supportsTypeNatively(a)||n);return s?"maybe":""}};if(typeof Is.MediaSource==="undefined"||typeof Is.URL==="undefined"){Is.MediaSource=qh;Is.URL=zh}if(qh.supportsNativeMediaSources()){Is.getTech("Html5").registerSourceHandler(wm,0)}Is.HlsHandler=km;Is.HlsSourceHandler=wm;Is.Hls=hm;if(!Is.use){Is.registerComponent("Hls",hm)}Is.options.hls=Is.options.hls||{};if(Is.registerPlugin){Is.registerPlugin("reloadSourceOnError",fm)}else{Is.plugin("reloadSourceOnError",fm)}return Is});!function(){!function(e){var t=e&&e.videojs;t&&(t.CDN_VERSION="7.5.4")}(window)}();