vendor: 5,601 bytes, lines 1-2
1/*! For license information please see LICENSES */ 2(window.webpackJsonp=window.webpackJsonp||[]).push([[33],{1313:function(e,t,n){"use strict";(function(e){var r=n(1314),o=n(1315),l=n(1316);function c(){return h.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function d(e,t){if(c()<t)throw new RangeError("Invalid typed array length");return h.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=h.prototype:(null===e&&(e=new h(t)),e.length=t),e}function h(e,t,n){if(!(h.TYPED_ARRAY_SUPPORT||this instanceof h))return new h(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return y(this,e)}return f(this,e,t,n)}function f(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r);h.TYPED_ARRAY_SUPPORT?(e=t).__proto__=h.prototype:e=v(e,t);return e}(e,t,n,r):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!h.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|T(t,n);e=d(e,r);var o=e.write(t,n);o!==r&&(e=e.slice(0,o));return e}(e,t,n):function(e,t){if(h.isBuffer(t)){var n=0|_(t.length);return 0===(e=d(e,n)).length||t.copy(e,0,0,n),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(r=t.length)!=r?d(e,0):v(e,t);if("Buffer"===t.type&&l(t.data))return v(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function m(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function y(e,t){if(m(t),e=d(e,t<0?0:0|_(t)),!h.TYPED_ARRAY_SUPPORT)for(var i=0;i<t;++i)e[i]=0;return e}function v(e,t){var n=t.length<0?0:0|_(t.length);e=d(e,n);for(var i=0;i<n;i+=1)e[i]=255&t[i];return e}function _(e){if(e>=c())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+c().toString(16)+" bytes");return 0|e}function T(e,t){if(h.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return Y(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return Q(e).length;default:if(r)return Y(e).length;t=(""+t).toLowerCase(),r=!0}}function S(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return U(this,t,n);case"utf8":case"utf-8":return O(this,t,n);case"ascii":return M(this,t,n);case"latin1":case"binary":return N(this,t,n);case"base64":return D(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function E(b,e,t){var i=b[e];b[e]=b[t],b[t]=i}function k(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=h.from(t,r)),h.isBuffer(t))return 0===t.length?-1:C(e,t,n,r,o);if("number"==typeof t)return t&=255,h.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):C(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function C(e,t,n,r,o){var i,l=1,c=e.length,d=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;l=2,c/=2,d/=2,n/=2}function h(e,i){return 1===l?e[i]:e.readUInt16BE(i*l)}if(o){var f=-1;for(i=n;i<c;i++)if(h(e,i)===h(t,-1===f?0:i-f)){if(-1===f&&(f=i),i-f+1===d)return f*l}else-1!==f&&(i-=i-f),f=-1}else for(n+d>c&&(n=c-d),i=n;i>=0;i--){for(var m=!0,y=0;y<d;y++)if(h(e,i+y)!==h(t,y)){m=!1;break}if(m)return i}return-1}function w(e,t,n,r){n=Number(n)||0;var o=e.length-n;r?(r=Number(r))>o&&(r=o):r=o;var l=t.length;if(l%2!=0)throw new TypeError("Invalid hex string");r>l/2&&(r=l/2);for(var i=0;i<r;++i){var c=parseInt(t.substr(2*i,2),16);if(isNaN(c))return i;e[n+i]=c}return i}function I(e,t,n,r){return $(Y(t,e.length-n),e,n,r)}function A(e,t,n,r){return $(function(e){for(var t=[],i=0;i<e.length;++i)t.push(255&e.charCodeAt(i));return t}(t),e,n,r)}function x(e,t,n,r){return A(e,t,n,r)}function P(e,t,n,r){return $(Q(t),e,n,r)}function L(e,t,n,r){return $(function(e,t){for(var n,r,o,l=[],i=0;i<e.length&&!((t-=2)<0);++i)r=(n=e.charCodeAt(i))>>8,o=n%256,l.push(o),l.push(r);return l}(t,e.length-n),e,n,r)}function D(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function O(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var o,l,c,d,h=e[i],f=null,m=h>239?4:h>223?3:h>191?2:1;if(i+m<=n)switch(m){case 1:h<128&&(f=h);break;
vendor: 5,231 bytes, line 2
2case 2:128==(192&(o=e[i+1]))&&(d=(31&h)<<6|63&o)>127&&(f=d);break;case 3:o=e[i+1],l=e[i+2],128==(192&o)&&128==(192&l)&&(d=(15&h)<<12|(63&o)<<6|63&l)>2047&&(d<55296||d>57343)&&(f=d);break;case 4:o=e[i+1],l=e[i+2],c=e[i+3],128==(192&o)&&128==(192&l)&&128==(192&c)&&(d=(15&h)<<18|(63&o)<<12|(63&l)<<6|63&c)>65535&&d<1114112&&(f=d)}null===f?(f=65533,m=1):f>65535&&(f-=65536,r.push(f>>>10&1023|55296),f=56320|1023&f),r.push(f),i+=m}return function(e){var t=e.length;if(t<=R)return String.fromCharCode.apply(String,e);var n="",i=0;for(;i<t;)n+=String.fromCharCode.apply(String,e.slice(i,i+=R));return n}(r)}t.Buffer=h,t.SlowBuffer=function(e){+e!=e&&(e=0);return h.alloc(+e)},t.INSPECT_MAX_BYTES=50,h.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=c(),h.poolSize=8192,h._augment=function(e){return e.__proto__=h.prototype,e},h.from=function(e,t,n){return f(null,e,t,n)},h.TYPED_ARRAY_SUPPORT&&(h.prototype.__proto__=Uint8Array.prototype,h.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&h[Symbol.species]===h&&Object.defineProperty(h,Symbol.species,{value:null,configurable:!0})),h.alloc=function(e,t,n){return function(e,t,n,r){return m(t),t<=0?d(e,t):void 0!==n?"string"==typeof r?d(e,t).fill(n,r):d(e,t).fill(n):d(e,t)}(null,e,t,n)},h.allocUnsafe=function(e){return y(null,e)},h.allocUnsafeSlow=function(e){return y(null,e)},h.isBuffer=function(b){return!(null==b||!b._isBuffer)},h.compare=function(a,b){if(!h.isBuffer(a)||!h.isBuffer(b))throw new TypeError("Arguments must be Buffers");if(a===b)return 0;for(var e=a.length,t=b.length,i=0,n=Math.min(e,t);i<n;++i)if(a[i]!==b[i]){e=a[i],t=b[i];break}return e<t?-1:t<e?1:0},h.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},h.concat=function(e,t){if(!l(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return h.alloc(0);var i;if(void 0===t)for(t=0,i=0;i<e.length;++i)t+=e[i].length;var n=h.allocUnsafe(t),r=0;for(i=0;i<e.length;++i){var o=e[i];if(!h.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,r),r+=o.length}return n},h.byteLength=T,h.prototype._isBuffer=!0,h.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var i=0;i<e;i+=2)E(this,i,i+1);return this},h.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var i=0;i<e;i+=4)E(this,i,i+3),E(this,i+1,i+2);return this},h.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var i=0;i<e;i+=8)E(this,i,i+7),E(this,i+1,i+6),E(this,i+2,i+5),E(this,i+3,i+4);return this},h.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?O(this,0,e):S.apply(this,arguments)},h.prototype.equals=function(b){if(!h.isBuffer(b))throw new TypeError("Argument must be a Buffer");return this===b||0===h.compare(this,b)},h.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),"<Buffer "+e+">"},h.prototype.compare=function(e,t,n,r,o){if(!h.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(this===e)return 0;for(var l=(o>>>=0)-(r>>>=0),c=(n>>>=0)-(t>>>=0),d=Math.min(l,c),f=this.slice(r,o),m=e.slice(t,n),i=0;i<d;++i)if(f[i]!==m[i]){l=f[i],c=m[i];break}return l<c?-1:c<l?1:0},h.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},h.prototype.indexOf=function(e,t,n){return k(this,e,t,n,!0)},h.prototype.lastIndexOf=function(e,t,n){return k(this,e,t,n,!1)},h.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var o=this.length-t;if((void 0===n||n>o)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var l=!1;;)switch(r){case"hex":return w(this,e,t,n);case"utf8":case"utf-8":return I(this,e,t,n);case"ascii":return A(this,e,t,n);case"latin1":case"binary":return x(this,e,t,n);case"base64":return P(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,e,t,n);default:if(l)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),l=!0}},h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};
vendor: 8,167 bytes, line 2
2var R=4096;function M(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function N(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function U(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var o="",i=t;i<n;++i)o+=K(e[i]);return o}function B(e,t,n){for(var r=e.slice(t,n),o="",i=0;i<r.length;i+=2)o+=String.fromCharCode(r[i]+256*r[i+1]);return o}function F(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function j(e,t,n,r,o,l){if(!h.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<l)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function H(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i<o;++i)e[n+i]=(t&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function V(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i<o;++i)e[n+i]=t>>>8*(r?i:3-i)&255}function W(e,t,n,r,o,l){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function z(e,t,n,r,l){return l||W(e,0,n,4),o.write(e,t,n,r,23,4),n+4}function G(e,t,n,r,l){return l||W(e,0,n,8),o.write(e,t,n,r,52,8),n+8}h.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),h.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=h.prototype;else{var o=t-e;n=new h(o,void 0);for(var i=0;i<o;++i)n[i]=this[i+e]}return n},h.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||F(e,t,this.length);for(var r=this[e],o=1,i=0;++i<t&&(o*=256);)r+=this[e+i]*o;return r},h.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||F(e,t,this.length);for(var r=this[e+--t],o=1;t>0&&(o*=256);)r+=this[e+--t]*o;return r},h.prototype.readUInt8=function(e,t){return t||F(e,1,this.length),this[e]},h.prototype.readUInt16LE=function(e,t){return t||F(e,2,this.length),this[e]|this[e+1]<<8},h.prototype.readUInt16BE=function(e,t){return t||F(e,2,this.length),this[e]<<8|this[e+1]},h.prototype.readUInt32LE=function(e,t){return t||F(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},h.prototype.readUInt32BE=function(e,t){return t||F(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},h.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||F(e,t,this.length);for(var r=this[e],o=1,i=0;++i<t&&(o*=256);)r+=this[e+i]*o;return r>=(o*=128)&&(r-=Math.pow(2,8*t)),r},h.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||F(e,t,this.length);for(var i=t,r=1,o=this[e+--i];i>0&&(r*=256);)o+=this[e+--i]*r;return o>=(r*=128)&&(o-=Math.pow(2,8*t)),o},h.prototype.readInt8=function(e,t){return t||F(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},h.prototype.readInt16LE=function(e,t){t||F(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},h.prototype.readInt16BE=function(e,t){t||F(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},h.prototype.readInt32LE=function(e,t){return t||F(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},h.prototype.readInt32BE=function(e,t){return t||F(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},h.prototype.readFloatLE=function(e,t){return t||F(e,4,this.length),o.read(this,e,!0,23,4)},h.prototype.readFloatBE=function(e,t){return t||F(e,4,this.length),o.read(this,e,!1,23,4)},h.prototype.readDoubleLE=function(e,t){return t||F(e,8,this.length),o.read(this,e,!0,52,8)},h.prototype.readDoubleBE=function(e,t){return t||F(e,8,this.length),o.read(this,e,!1,52,8)},h.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||j(this,e,t,n,Math.pow(2,8*n)-1,0);var o=1,i=0;for(this[t]=255&e;++i<n&&(o*=256);)this[t+i]=e/o&255;return t+n},h.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||j(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},h.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,1,255,0),h.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},h.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):H(this,e,t,!0),t+2},h.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):H(this,e,t,!1),t+2},h.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):V(this,e,t,!0),t+4},h.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):V(this,e,t,!1),t+4},h.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);j(this,e,t,n,o-1,-o)}var i=0,l=1,sub=0;for(this[t]=255&e;++i<n&&(l*=256);)e<0&&0===sub&&0!==this[t+i-1]&&(sub=1),this[t+i]=(e/l|0)-sub&255;return t+n},h.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);j(this,e,t,n,o-1,-o)}var i=n-1,l=1,sub=0;for(this[t+i]=255&e;--i>=0&&(l*=256);)e<0&&0===sub&&0!==this[t+i+1]&&(sub=1),this[t+i]=(e/l|0)-sub&255;return t+n},h.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,1,127,-128),h.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},h.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):H(this,e,t,!0),t+2},h.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):H(this,e,t,!1),t+2},h.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,4,2147483647,-2147483648),h.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):V(this,e,t,!0),t+4},h.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),h.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):V(this,e,t,!1),t+4},h.prototype.writeFloatLE=function(e,t,n){return z(this,e,t,!0,n)},h.prototype.writeFloatBE=function(e,t,n){return z(this,e,t,!1,n)},h.prototype.writeDoubleLE=function(e,t,n){return G(this,e,t,!0,n)},h.prototype.writeDoubleBE=function(e,t,n){return G(this,e,t,!1,n)},h.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i,o=r-n;if(this===e&&n<t&&t<r)for(i=o-1;i>=0;--i)e[i+t]=this[i+n];else if(o<1e3||!h.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)e[i+t]=this[i+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+o),t);return o},h.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var code=e.charCodeAt(0);code<256&&(e=code)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!h.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var i;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i<n;++i)this[i]=e;else{var o=h.isBuffer(e)?e:Y(new h(e,r).toString()),l=o.length;for(i=0;i<n-t;++i)this[i+t]=o[i%l]}return this};var X=/[^+\/0-9A-Za-z-_]/g;function K(e){return e<16?"0"+e.toString(16):e.toString(16)}function Y(e,t){var n;t=t||1/0;for(var r=e.length,o=null,l=[],i=0;i<r;++i){if((n=e.charCodeAt(i))>55295&&n<57344){if(!o){if(n>56319){(t-=3)>
2-1&&l.push(239,191,189);continue}if(i+1===r){(t-=3)>-1&&l.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&l.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&l.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;l.push(n)}else if(n<2048){if((t-=2)<0)break;l.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;l.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;l.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return l}function Q(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(X,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function $(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}}).call(this,n(52))},1314:function(e,t,n){"use strict";t.byteLength=function(e){var t=c(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,i,n=c(e),r=n[0],d=n[1],h=new l(function(e,t,n){return 3*(t+n)/4-n}(0,r,d)),f=0,m=d>0?r-4:r;for(i=0;i<m;i+=4)t=o[e.charCodeAt(i)]<<18|o[e.charCodeAt(i+1)]<<12|o[e.charCodeAt(i+2)]<<6|o[e.charCodeAt(i+3)],h[f++]=t>>16&255,h[f++]=t>>8&255,h[f++]=255&t;2===d&&(t=o[e.charCodeAt(i)]<<2|o[e.charCodeAt(i+1)]>>4,h[f++]=255&t);1===d&&(t=o[e.charCodeAt(i)]<<10|o[e.charCodeAt(i+1)]<<4|o[e.charCodeAt(i+2)]>>2,h[f++]=t>>8&255,h[f++]=255&t);return h},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,l=[],c=16383,i=0,h=n-o;i<h;i+=c)l.push(d(e,i,i+c>h?h:i+c));1===o?(t=e[n-1],l.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],l.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return l.join("")};for(var r=[],o=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0;i<64;++i)r[i]=code[i],o[code.charCodeAt(i)]=i;function c(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function d(e,t,n){for(var o,l,output=[],i=t;i<n;i+=3)o=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(255&e[i+2]),output.push(r[(l=o)>>18&63]+r[l>>12&63]+r[l>>6&63]+r[63&l]);return output.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},1315:function(e,t){t.read=function(e,t,n,r,o){var l,c,d=8*o-r-1,h=(1<<d)-1,f=h>>1,m=-7,i=n?o-1:0,y=n?-1:1,s=e[t+i];for(i+=y,l=s&(1<<-m)-1,s>>=-m,m+=d;m>0;l=256*l+e[t+i],i+=y,m-=8);for(c=l&(1<<-m)-1,l>>=-m,m+=r;m>0;c=256*c+e[t+i],i+=y,m-=8);if(0===l)l=1-f;else{if(l===h)return c?NaN:1/0*(s?-1:1);c+=Math.pow(2,r),l-=f}return(s?-1:1)*c*Math.pow(2,l-r)},t.write=function(e,t,n,r,o,l){var c,d,h,f=8*l-o-1,m=(1<<f)-1,y=m>>1,rt=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,i=r?0:l-1,v=r?1:-1,s=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(d=isNaN(t)?1:0,c=m):(c=Math.floor(Math.log(t)/Math.LN2),t*(h=Math.pow(2,-c))<1&&(c--,h*=2),(t+=c+y>=1?rt/h:rt*Math.pow(2,1-y))*h>=2&&(c++,h/=2),c+y>=m?(d=0,c=m):c+y>=1?(d=(t*h-1)*Math.pow(2,o),c+=y):(d=t*Math.pow(2,y-1)*Math.pow(2,o),c=0));o>=8;e[n+i]=255&d,i+=v,d/=256,o-=8);for(c=c<<o|d,f+=o;f>0;e[n+i]=255&c,i+=v,c/=256,f-=8);e[n+i-v]|=128*s}},1316:function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},863:function(e,t,n){(function(t,n){e.exports=function(){"use strict";var u="7.15.4",e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{};function r(e,t){return e(t={exports:{}},t.exports),t.exports}for(var i,o="undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{},l={},a=function(e,t){return l[e]=l[e]||[],t&&(l[e]=l[e].concat(t)),l[e]},c=function(e,t){return!((t=a(e).indexOf(t))<=-1||(l[e]=l[e].slice(),l[e].splice(t,1),0))},s=void 0!==e?e:"undefined"!=typeof window?window:{},d=Vt="undefined"!=typeof document?document:(Vt=s["__GLOBAL_DOCUMENT_CACHE@4"])||(s["__GLOBAL_DOCUMENT_CACHE@4"]={}),h={prefixed:!0},f=[["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"]],m=f[0],p=0;p<f.length;
2p++)if(f[p][1]in d){i=f[p];break}if(i){for(var y=0;y<i.length;y++)h[m[y]]=i[y];h.prefixed=i[0]!==m[0]}var v=[],g=function(a,s){return function(e,t,i){var n,r=s.levels[t];t=new RegExp("^("+r+")$"),"log"!==e&&i.unshift(e.toUpperCase()+":"),i.unshift(a+":"),v&&(v.push([].concat(i)),n=v.length-1e3,v.splice(0,0<n?n:0)),!o.console||(n=(n=o.console[e])||"debug"!==e?n:o.console.info||o.console.log)&&r&&t.test(e)&&n[Array.isArray(i)?"apply":"call"](o.console,i)}},_=function e(i){function t(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];a("log",n,t)}var n="info",a=g(i,t);return t.createLogger=function(t){return e(i+": "+t)},t.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:n},t.level=function(e){if("string"==typeof e){if(!t.levels.hasOwnProperty(e))throw new Error('"'+e+'" in not a valid log level');n=e}return n},(t.history=function(){return v?[].concat(v):[]}).filter=function(e){return(v||[]).filter((function(t){return new RegExp(".*"+e+".*").test(t[0])}))},t.history.clear=function(){v&&(v.length=0)},t.history.disable=function(){null!==v&&(v.length=0,v=null)},t.history.enable=function(){null===v&&(v=[])},t.error=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return a("error",n,t)},t.warn=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return a("warn",n,t)},t.debug=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return a("debug",n,t)},t}("VIDEOJS"),T=_.createLogger,b=r((function(e){function t(){return e.exports=t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i,n=arguments[t];for(i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},t.apply(this,arguments)}e.exports=t})),S=Object.prototype.toString,E=function(e){return w(e)?Object.keys(e):[]};function k(e,i){E(e).forEach((function(t){return i(e[t],t)}))}function C(i){for(var e=arguments.length,t=new Array(1<e?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return Object.assign?b.apply(void 0,[i].concat(t)):(t.forEach((function(e){e&&k(e,(function(e,t){i[t]=e}))})),i)}function w(e){return!!e&&"object"==typeof e}function I(e){return w(e)&&"[object Object]"===S.call(e)&&e.constructor===Object}function A(e,t){if(!e||!t)return"";if("function"!=typeof o.getComputedStyle)return"";var i;try{i=o.getComputedStyle(e)}catch(e){return""}return i?i.getPropertyValue(t)||i[t]:""}var x=o.navigator&&o.navigator.userAgent||"",P=(Yt=/AppleWebKit\/([\d.]+)/i.exec(x))?parseFloat(Yt.pop()):null,L=/iPod/i.test(x),D=(Qt=x.match(/OS (\d+)_/i))&&Qt[1]?Qt[1]:null,O=/Android/i.test(x),R=function(){var e=x.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;var t=e[1]&&parseFloat(e[1]),i=e[2]&&parseFloat(e[2]);return t&&i?parseFloat(e[1]+"."+e[2]):t||null}(),M=O&&R<5&&P<537,N=/Firefox/i.test(x),U=/Edg/i.test(x),B=!U&&(/Chrome/i.test(x)||/CriOS/i.test(x)),F=(oi=x.match(/(Chrome|CriOS)\/(\d+)/))&&oi[2]?parseFloat(oi[2]):null,j=ui=!(ui=(ui=/MSIE\s(\d+)\.\d/.exec(x))&&parseFloat(ui[1]))&&/Trident\/7.0/i.test(x)&&/rv:11.0/.test(x)?11:ui,H=/Safari/i.test(x)&&!B&&!O&&!U,q=/Windows/i.test(x),V=Boolean($()&&("ontouchstart"in o||o.navigator.maxTouchPoints||o.DocumentTouch&&o.document instanceof o.DocumentTouch)),W=/iPad/i.test(x)||H&&V&&!/iPhone/i.test(x),z=/iPhone/i.test(x)&&!W,G=z||W||L,X=(H||G)&&!B,K=Object.freeze({__proto__:null,IS_IPOD:L,IOS_VERSION:D,IS_ANDROID:O,ANDROID_VERSION:R,IS_NATIVE_ANDROID:M,IS_FIREFOX:N,IS_EDGE:U,IS_CHROME:B,CHROME_VERSION:F,IE_VERSION:j,IS_SAFARI:H,IS_WINDOWS:q,TOUCH_ENABLED:V,IS_IPAD:W,IS_IPHONE:z,IS_IOS:G,IS_ANY_SAFARI:X});function Y(e){return"string"==typeof e&&Boolean(e.trim())}function Q(e){if(0<=e.indexOf(" "))throw new Error("class has illegal whitespace characters")}function $(){return d===o.document}function J(e){return w(e)&&1===e.nodeType}function Z(){try{return o.parent!==o.self}catch(e){return!0}}function ee(i){return function(e,t){return Y(e)?(t=J(t=Y(t)?d.querySelector(t):t)?t:d)[i]&&t[i](e):d[i](null)}}function te(e,i,t,n){void 0===i&&(i={}),void 0===t&&(t={});var r=d.createElement(e=void 0===e?"div":e);
2return Object.getOwnPropertyNames(i).forEach((function(e){var t=i[e];-1!==e.indexOf("aria-")||"role"===e||"type"===e?(_.warn("Setting attributes in the second argument of createEl()\nhas been deprecated. Use the third argument instead.\ncreateEl(type, properties, attributes). Attempting to set "+e+" to "+t+"."),r.setAttribute(e,t)):"textContent"===e?ie(r,t):r[e]===t&&"tabIndex"!==e||(r[e]=t)})),Object.getOwnPropertyNames(t).forEach((function(e){r.setAttribute(e,t[e])})),n&&Te(r,n),r}function ie(e,t){return void 0===e.textContent?e.innerText=t:e.textContent=t,e}function ne(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}function re(e,t){return Q(t),e.classList?e.classList.contains(t):new RegExp("(^|\\s)"+t+"($|\\s)").test(e.className)}function ae(e,t){return e.classList?e.classList.add(t):re(e,t)||(e.className=(e.className+" "+t).trim()),e}function se(e,t){return e?(e.classList?e.classList.remove(t):(Q(t),e.className=e.className.split(/\s+/).filter((function(e){return e!==t})).join(" ")),e):(_.warn("removeClass was called with an element that doesn't exist"),null)}function oe(e,t,i){var n=re(e,t);if((i="boolean"!=typeof(i="function"==typeof i?i(e,t):i)?!n:i)!==n)return(i?ae:se)(e,t),e}function ue(i,e){Object.getOwnPropertyNames(e).forEach((function(t){var n=e[t];null==n||!1===n?i.removeAttribute(t):i.setAttribute(t,!0===n?"":n)}))}function le(e){var t={},i=",autoplay,controls,playsinline,loop,muted,default,defaultMuted,";if(e&&e.attributes&&0<e.attributes.length)for(var n=e.attributes,r=n.length-1;0<=r;r--){var a=n[r].name,s=n[r].value;"boolean"!=typeof e[a]&&-1===i.indexOf(","+a+",")||(s=null!==s),t[a]=s}return t}function ce(e,t){return e.getAttribute(t)}function de(e,t,i){e.setAttribute(t,i)}function he(e,t){e.removeAttribute(t)}function pe(){d.body.focus(),d.onselectstart=function(){return!1}}function fe(){d.onselectstart=function(){return!0}}function me(e){if(e&&e.getBoundingClientRect&&e.parentNode){var t=e.getBoundingClientRect(),i={};return["bottom","height","left","right","top","width"].forEach((function(e){void 0!==t[e]&&(i[e]=t[e])})),i.height||(i.height=parseFloat(A(e,"height"))),i.width||(i.width=parseFloat(A(e,"width"))),i}}function ge(e){if(!e||e&&!e.offsetParent)return{left:0,top:0,width:0,height:0};for(var t=e.offsetWidth,i=e.offsetHeight,n=0,r=0;e.offsetParent&&e!==d[h.fullscreenElement];)n+=e.offsetLeft,r+=e.offsetTop,e=e.offsetParent;return{left:n,top:r,width:t,height:i}}function ye(e,t){var i={x:0,y:0};if(G)for(var n=e;n&&"html"!==n.nodeName.toLowerCase();){var r,a=A(n,"transform");
2/^matrix/.test(a)?(r=a.slice(7,-1).split(/,\s/).map(Number),i.x+=r[4],i.y+=r[5]):/^matrix3d/.test(a)&&(a=a.slice(9,-1).split(/,\s/).map(Number),i.x+=a[12],i.y+=a[13]),n=n.parentNode}var s={},o=ge(t.target),u=ge(e),l=u.width,c=u.height;return e=t.offsetY-(u.top-o.top),o=t.offsetX-(u.left-o.left),t.changedTouches&&(o=t.changedTouches[0].pageX-u.left,e=t.changedTouches[0].pageY+u.top,G&&(o-=i.x,e-=i.y)),s.y=1-Math.max(0,Math.min(1,e/c)),s.x=Math.max(0,Math.min(1,o/l)),s}function ve(e){return w(e)&&3===e.nodeType}function _e(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function be(e){return"function"==typeof e&&(e=e()),(Array.isArray(e)?e:[e]).map((function(e){return J(e="function"==typeof e?e():e)||ve(e)?e:"string"==typeof e&&/\S/.test(e)?d.createTextNode(e):void 0})).filter((function(e){return e}))}function Te(e,t){return be(t).forEach((function(t){return e.appendChild(t)})),e}function Se(e,t){return Te(_e(e),t)}function Ee(e){return void 0===e.button&&void 0===e.buttons||0===e.button&&void 0===e.buttons||"mouseup"===e.type&&0===e.button&&0===e.buttons||0===e.button&&1===e.buttons}var ke,Ce=ee("querySelector"),we=ee("querySelectorAll"),Ie=Object.freeze({__proto__:null,isReal:$,isEl:J,isInFrame:Z,createEl:te,textContent:ie,prependTo:ne,hasClass:re,addClass:ae,removeClass:se,toggleClass:oe,setAttributes:ue,getAttributes:le,getAttribute:ce,setAttribute:de,removeAttribute:he,blockTextSelection:pe,unblockTextSelection:fe,getBoundingClientRect:me,findPosition:ge,getPointerPosition:ye,isTextNode:ve,emptyEl:_e,normalizeContent:be,appendContent:Te,insertContent:Se,isSingleLeftClick:Ee,$:Ce,$$:we}),Ae=!1,xe=function(){if(!1!==ke.options.autoSetup){var e=Array.prototype.slice.call(d.getElementsByTagName("video")),t=Array.prototype.slice.call(d.getElementsByTagName("audio")),i=Array.prototype.slice.call(d.getElementsByTagName("video-js")),n=e.concat(t,i);if(n&&0<n.length)for(var r=0,a=n.length;r<a;r++){var s=n[r];if(!s||!s.getAttribute){Pe(1);break}void 0===s.player&&null!==s.getAttribute("data-setup")&&ke(s)}else Ae||Pe(1)}};function Pe(e,t){$()&&(t&&(ke=t),o.setTimeout(xe,e))}function Le(){Ae=!0,o.removeEventListener("load",Le)}function De(e){var t=d.createElement("style");return t.className=e,t}function Oe(e,t){e.styleSheet?e.styleSheet.cssText=t:e.textContent=t}$()&&("complete"===d.readyState?Le():o.addEventListener("load",Le));var Re=3;o.WeakMap||(Oi=function(){function e(){this.vdata="vdata"+Math.floor(o.performance&&o.performance.now()||Date.now()),this.data={}}var t=e.prototype;return t.set=function(e,t){var i=e[this.vdata]||Re++;return e[this.vdata]||(e[this.vdata]=i),this.data[i]=t,this},t.get=function(e){var t=e[this.vdata];if(t)return this.data[t];_("We have no data for this element",e)},t.has=function(e){return e[this.vdata]in this.data},t.delete=function(e){var t=e[this.vdata];t&&(delete this.data[t],delete e[this.vdata])},e}());var Me,Ne=new(o.WeakMap?WeakMap:Oi);function Ue(e,t){var i;Ne.has(e)&&(0===(i=Ne.get(e)).handlers[t].length&&(delete i.handlers[t],e.removeEventListener?e.removeEventListener(t,i.dispatcher,!1):e.detachEvent&&e.detachEvent("on"+t,i.dispatcher)),Object.getOwnPropertyNames(i.handlers).length<=0&&(delete i.handlers,delete i.dispatcher,delete i.disabled),0===Object.getOwnPropertyNames(i).length&&Ne.delete(e))}function Be(e,i,t,n){t.forEach((function(t){e(i,t,n)}))}function Fe(e){if(e.fixed_)return e;function t(){return!0}function i(){return!1}if(!e||!e.isPropagationStopped||!e.isImmediatePropagationStopped){var n,r,a,s=e||o.event;for(n in e={},s)"layerX"!==n&&"layerY"!==n&&"keyLocation"!==n&&"webkitMovementX"!==n&&"webkitMovementY"!==n&&("returnValue"===n&&s.preventDefault||(e[n]=s[n]));e.target||(e.target=e.srcElement||d),e.relatedTarget||(e.relatedTarget=e.fromElement===e.target?e.toElement:e.fromElement),e.preventDefault=function(){s.preventDefault&&s.preventDefault(),e.returnValue=!1,s.returnValue=!1,e.defaultPrevented=!0},e.defaultPrevented=!1,e.stopPropagation=function(){s.stopPropagation&&s.stopPropagation(),e.cancelBubble=!0,s.cancelBubble=!0,e.isPropagationStopped=t},e.isPropagationStopped=i,e.stopImmediatePropagation=function(){s.stopImmediatePropagation&&s.stopImmediatePropagation(),e.isImmediatePropagationStopped=t,e.stopPropagation()},e.isImmediatePropagationStopped=i,null!==e.clientX&&void 0!==e.clientX&&(r=d.documentElement,a=d.body,e.pageX=e.clientX+(r&&r.scrollLeft||a&&a.scrollLeft||0)-(r&&r.clientLeft||a&&a.clientLeft||0),e.pageY=e.clientY+(r&&r.scrollTop||a&&a.scrollTop||0)-(r&&r.clientTop||a&&a.clientTop||0)),e.which=e.charCode||e.keyCode,null!==e.button&&void 0!==e.button&&(e.button=1&e.button?0:4&e.button?1:2&e.button?2:0)}return e.fixed_=!0,e}var je=function(){if("boolean"!=typeof Me){Me=!1;try{var e=Object.defineProperty({},"passive",{get:function(){Me=!0}});o.addEventListener("test",null,e),o.removeEventListener("test",null,e)}catch(e){}}return Me},He=["touchstart","touchmove"];function qe(s,e,t){if(Array.isArray(e))return Be(qe,s,e,t);Ne.has(s)||Ne.set(s,{});var n=Ne.get(s);n.handlers||(n.handlers={}),n.handlers[e]||(n.handlers[e]=[]),t.guid||(t.guid=Re++),n.handlers[e].push(t),n.dispatcher||(n.disabled=!1,n.dispatcher=function(e,t){if(!n.disabled){e=Fe(e);var i=n.handlers[e.type];if(i)for(var r=i.slice(0),o=0,a=r.length;o<a&&!e.isImmediatePropagationStopped();o++)try{r[o].call(s,e,t)}catch(e){_.error(e)}}}),1===n.handlers[e].length&&(s.addEventListener?(t=!1,je()&&-1<He.indexOf(e)&&(t={passive:!0}),s.addEventListener(e,n.dispatcher,t)):s.attachEvent&&s.attachEvent("on"+e,n.dispatcher))}function Ve(e,t,i){if(Ne.has(e)){var n=Ne.get(e);if(n.handlers){if(Array.isArray(t))return Be(Ve,e,t,i);var r=function(e,t){n.handlers[t]=[],Ue(e,t)};if(void 0!==t){var a=n.handlers[t];if(a)if(i){if(i.guid)for(var s=0;s<a.length;s++)a[s].guid===i.guid&&a.splice(s--,1);Ue(e,t)}else r(e,t)}else for(var o in n.handlers)Object.prototype.hasOwnProperty.call(n.handlers||{},o)&&r(e,o)}}}function We(e,t,i){var n=Ne.has(e)?Ne.get(e):{},r=e.parentNode||e.ownerDocument;return"string"==typeof t?t={type:t,target:e}:t.target||(t.target=e),t=Fe(t),n.dispatcher&&n.dispatcher.call(e,t,i),r&&!t.isPropagationStopped()&&!0===t.bubbles?We.call(null,r,t,i):!r&&!t.defaultPrevented&&t.target&&t.target[t.type]&&(Ne.has(t.target)||Ne.set(t.target,{}),r=Ne.get(t.target),t.target[t.type]&&(r.disabled=!0,"function"==typeof t.target[t.type]&&t.target[t.type](),r.disabled=!1)),!t.defaultPrevented}function ze(e,t,i){if(Array.isArray(t))return Be(ze,e,t,i);function n(){Ve(e,t,n),i.apply(this,arguments)}n.guid=i.guid=i.guid||Re++,qe(e,t,n)}function Ge(e,t,i){function n(){Ve(e,t,n),i.apply(this,arguments)}n.guid=i.guid=i.guid||Re++,qe(e,t,n)}function Xe(e,t,i){return t.guid||(t.guid=Re++),(e=t.bind(e)).guid=i?i+"_"+t.guid:t.guid,e}function Ke(e,i){var t=o.performance.now();return function(){var n=o.performance.now();i<=n-t&&(e.apply(void 0,arguments),t=n)}}function Ye(e,t,a,s){var n;function r(){var r=this,o=arguments,i=function(){i=n=null,a||e.apply(r,o)};!n&&a&&e.apply(r,o),s.clearTimeout(n),n=s.setTimeout(i,t)}return void 0===s&&(s=o),r.cancel=function(){s.clearTimeout(n),n=null},r}function Qe(){}var $e,Je=Object.freeze({__proto__:null,fixEvent:Fe,on:qe,off:Ve,trigger:We,one:ze,any:Ge});function Ze(e){return"function"==typeof e.name?e.name():"string"==typeof e.name?e.name:e.name_||(e.constructor&&e.constructor.name?e.constructor.name:typeof e)}function et(e){return"string"==typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length}function tt(e,t,i){if(!e||!e.nodeName&&!st(e))throw new Error("Invalid target for "+Ze(t)+"#"+i+"; must be a DOM node or evented object.")}function it(e,t,i){if(!et(e))throw new Error("Invalid event type for "+Ze(t)+"#"+i+"; must be a non-empty string or array.")}function nt(e,t,i){if("function"!=typeof e)throw new Error("Invalid listener for "+Ze(t)+"#"+i+"; must be a function.")}function rt(e,t,i){var n,r,a=t.length<3||t[0]===e||t[0]===e.eventBusEl_;return t=a?(n=e.eventBusEl_,3<=t.length&&t.shift(),r=t[0],t[1]):(n=t[0],r=t[1],t[2]),tt(n,e,i),it(r,e,i),nt(t,e,i),{isTargetingSelf:a,target:n,type:r,listener:t=Xe(e,t)}}function at(e,t,i,n){tt(e,e,t),e.nodeName?Je[t](e,i,n):e[t](i,n)}Qe.prototype.allowedEvents_={},Qe.prototype.addEventListener=Qe.prototype.on=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},qe(this,e,t),this.addEventListener=i},Qe.prototype.removeEventListener=Qe.prototype.off=function(e,t){Ve(this,e,t)},Qe.prototype.one=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},ze(this,e,t),this.addEventListener=i},Qe.prototype.any=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},Ge(this,e,t),this.addEventListener=i},Qe.prototype.dispatchEvent=Qe.prototype.trigger=function(e){var t=e.type||e;e=Fe(e="string"==typeof e?{type:t}:e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),We(this,e)},Qe.prototype.queueTrigger=function(e){var t=this;$e=$e||new Map;var i=e.type||e,n=$e.get(this);n||(n=new Map,$e.set(this,n));var r=n.get(i);n.delete(i),o.clearTimeout(r),r=o.setTimeout((function(){0===n.size&&(n=null,$e.delete(t)),t.trigger(e)}),0),n.set(i,r)};var st=function(e){return e instanceof Qe||!!e.eventBusEl_&&["on","one","off","trigger"].every((function(t){return"function"==typeof e[t]}))},ot={on:function(){for(var e=this,t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];var r,a=rt(this,i,"on"),s=a.isTargetingSelf,o=a.target,u=a.type,l=a.listener;at(o,"on",u,l),s||((r=function(){return e.off(o,u,l)}).guid=l.guid,(s=function(){return e.off("dispose",r)}).guid=l.guid,at(this,"on","dispose",r),at(o,"on","dispose",s))},one:function(){for(var e=this,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];var r=rt(this,n,"one"),a=r.isTargetingSelf,s=r.target,o=r.type,u=r.listener;a?at(s,"one",o,u):((a=function t(){e.off(s,o,t);for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];u.apply(null,i)}).guid=u.guid,at(s,"one",o,a))},any:function(){for(var e=this,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];var r=rt(this,n,"any"),a=r.isTargetingSelf,s=r.target,o=r.type,u=r.listener;a?at(s,"any",o,u):((a=function t(){e.off(s,o,t);for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];u.apply(null,i)}).guid=u.guid,at(s,"any",o,a))},off:function(e,t,i){!e||et(e)?Ve(this.eventBusEl_,e,t):(tt(e,this,"off"),it(t,this,"off"),nt(i,this,"off"),i=Xe(this,i),this.off("dispose",i),e.nodeName?(Ve(e,t,i),Ve(e,"dispose",i)):st(e)&&(e.off(t,i),e.off("dispose",i)))},trigger:function(e,t){tt(this.eventBusEl_,this,"trigger");var i=e&&"string"!=typeof e?e.type:e;if(!et(i)){if(i="Invalid event type for "+Ze(this)+"#trigger; must be a non-empty string or object with a type key that has a non-empty value.",!e)throw new Error(i);(this.log||_).error(i)}return We(this.eventBusEl_,e,t)}};function ut(e,t){if(t=(t=void 0===t?{}:t).eventBusKey){if(!e[t].nodeName)throw new Error('The eventBusKey "'+t+'" does not refer to an element.');e.eventBusEl_=e[t]}else e.eventBusEl_=te("span",{className:"vjs-event-bus"});return C(e,ot),e.eventedCallbacks&&e.eventedCallbacks.forEach((function(e){e()}
2)),e.on("dispose",(function(){e.off(),[e,e.el_,e.eventBusEl_].forEach((function(e){e&&Ne.has(e)&&Ne.delete(e)})),o.setTimeout((function(){e.eventBusEl_=null}),0)})),e}var lt={state:{},setState:function(e){var i,t=this;return k(e="function"==typeof e?e():e,(function(e,n){t.state[n]!==e&&((i=i||{})[n]={from:t.state[n],to:e}),t.state[n]=e})),i&&st(this)&&this.trigger({changes:i,type:"statechanged"}),i}};function ct(e,t){return C(e,lt),e.state=C({},e.state,t),"function"==typeof e.handleStateChanged&&st(e)&&e.on("statechanged",e.handleStateChanged),e}function dt(e){return"string"!=typeof e?e:e.replace(/./,(function(e){return e.toLowerCase()}))}function ht(e){return"string"!=typeof e?e:e.replace(/./,(function(e){return e.toUpperCase()}))}function pt(){for(var i={},e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.forEach((function(e){e&&k(e,(function(e,t){I(e)?(I(i[t])||(i[t]={}),i[t]=pt(i[t],e)):i[t]=e}))})),i}var ft=o.Map||function(){function e(){this.map_={}}var t=e.prototype;return t.has=function(e){return e in this.map_},t.delete=function(e){var t=this.has(e);return delete this.map_[e],t},t.set=function(e,t){return this.map_[e]=t,this},t.forEach=function(e,t){for(var i in this.map_)e.call(t,this.map_[i],i,this)},e}(),mt=o.Set||function(){function e(){this.set_={}}var t=e.prototype;return t.has=function(e){return e in this.set_},t.delete=function(e){var t=this.has(e);return delete this.set_[e],t},t.add=function(e){return this.set_[e]=1,this},t.forEach=function(e,t){for(var i in this.set_)e.call(t,i,i,this)},e}(),gt=function(){function s(e,t,i){!e&&this.play?this.player_=e=this:this.player_=e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=pt({},this.options_),t=this.options_=pt(this.options_,t),this.id_=t.id||t.el&&t.el.id,this.id_||(e=e&&e.id&&e.id()||"no_player",this.id_=e+"_component_"+Re++),this.name_=t.name||null,t.el?this.el_=t.el:!1!==t.createEl&&(this.el_=this.createEl()),!1!==t.evented&&(ut(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),ct(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new mt,this.setIntervalIds_=new mt,this.rafIds_=new mt,this.namedRafs_=new ft,(this.clearingTimersOnDispose_=!1)!==t.initChildren&&this.initChildren(),this.ready(i),!1!==t.reportTouchActivity&&this.enableTouchActivity()}var e=s.prototype;return e.dispose=function(){if(!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(var e=this.children_.length-1;0<=e;e--)this.children_[e].dispose&&this.children_[e].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&this.el_.parentNode.removeChild(this.el_),this.el_=null),this.player_=null}},e.isDisposed=function(){return Boolean(this.isDisposed_)},e.player=function(){return this.player_},e.options=function(e){return e&&(this.options_=pt(this.options_,e)),this.options_},e.el=function(){return this.el_},e.createEl=function(e,t,i){return te(e,t,i)},e.localize=function(e,i,t){void 0===t&&(t=e);var n=this.player_.language&&this.player_.language(),r=this.player_.languages&&this.player_.languages(),a=r&&r[n];return n=n&&n.split("-")[0],n=r&&r[n],a&&a[e]?t=a[e]:n&&n[e]&&(t=n[e]),i?t.replace(/\{(\d+)\}/g,(function(e,t){return void 0===(t=i[t-1])?e:t})):t},e.handleLanguagechange=function(){},e.contentEl=function(){return this.contentEl_||this.el_},e.id=function(){return this.id_},e.name=function(){return this.name_},e.children=function(){return this.children_},e.getChildById=function(e){return this.childIndex_[e]},e.getChild=function(e){if(e)return this.childNameIndex_[e]},e.getDescendant=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];t=t.reduce((function(e,t){return e.concat(t)}),[]);for(var n=this,r=0;r<t.length;r++)if(!(n=n.getChild(t[r]))||!n.getChild)return;return n},e.addChild=function(e,t,i){if(void 0===t&&(t={}),void 0===i&&(i=this.children_.length),"string"==typeof e){var n=ht(e),r=t.componentClass||n;t.name=n;var a=s.getComponent(r);if(!a)throw new Error("Component "+r+" does not exist");if("function"!=typeof a)return null;a=new a(this.player_||this,t)}else a=e;return a.parentComponent_&&a.parentComponent_.removeChild(a),this.children_.splice(i,0,a),a.parentComponent_=this,"function"==typeof a.id&&(this.childIndex_[a.id()]=a),(n=n||a.name&&ht(a.name()))&&(this.childNameIndex_[n]=a,this.childNameIndex_[dt(n)]=a),"function"==typeof a.el&&a.el()&&(n=null,this.children_[i+1]&&(this.children_[i+1].el_?n=this.children_[i+1].el_:J(this.children_[i+1])&&(n=this.children_[i+1])),this.contentEl().insertBefore(a.el(),n)),a},e.removeChild=function(e){if((e="string"==typeof e?this.getChild(e):e)&&this.children_){for(var t,i=!1,n=this.children_.length-1;0<=n;n--)if(this.children_[n]===e){i=!0,this.children_.splice(n,1);break}i&&(e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[ht(e.name())]=null,this.childNameIndex_[dt(e.name())]=null,(t=e.el())&&t.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el()))}},e.initChildren=function(){var i,e,t,n=this,r=this.options_.children;r&&(i=this.options_,e=s.getComponent("Tech"),(t=Array.isArray(r)?r:Object.keys(r)).concat(Object.keys(this.options_).filter((function(e){return!t.some((function(t){return"string"==typeof t?e===t:e===t.name}))}))).map((function(e){var t;return e="string"==typeof e?r[t=e]||n.options_[t]||{}:(t=e.name,e),{name:t,opts:e}})).filter((function(t){return(t=s.getComponent(t.opts.componentClass||ht(t.name)))&&!e.isTech(t)}
2)).forEach((function(e){var t=e.name;e=e.opts,!1!==(e=void 0!==i[t]?i[t]:e)&&((e=!0===e?{}:e).playerOptions=n.options_.playerOptions,(e=n.addChild(t,e))&&(n[t]=e))})))},e.buildCSSClass=function(){return""},e.ready=function(e,t){if(void 0===t&&(t=!1),e)return this.isReady_?void(t?e.call(this):this.setTimeout(e,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(e))},e.triggerReady=function(){this.isReady_=!0,this.setTimeout((function(){var e=this.readyQueue_;this.readyQueue_=[],e&&0<e.length&&e.forEach((function(e){e.call(this)}),this),this.trigger("ready")}),1)},e.$=function(e,t){return Ce(e,t||this.contentEl())},e.$$=function(e,t){return we(e,t||this.contentEl())},e.hasClass=function(e){return re(this.el_,e)},e.addClass=function(e){ae(this.el_,e)},e.removeClass=function(e){se(this.el_,e)},e.toggleClass=function(e,t){oe(this.el_,e,t)},e.show=function(){this.removeClass("vjs-hidden")},e.hide=function(){this.addClass("vjs-hidden")},e.lockShowing=function(){this.addClass("vjs-lock-showing")},e.unlockShowing=function(){this.removeClass("vjs-lock-showing")},e.getAttribute=function(e){return ce(this.el_,e)},e.setAttribute=function(e,t){de(this.el_,e,t)},e.removeAttribute=function(e){he(this.el_,e)},e.width=function(e,t){return this.dimension("width",e,t)},e.height=function(e,t){return this.dimension("height",e,t)},e.dimensions=function(e,t){this.width(e,!0),this.height(t)},e.dimension=function(e,t,i){return void 0!==t?(-1!==(""+(t=null===t||t!=t?0:t)).indexOf("%")||-1!==(""+t).indexOf("px")?this.el_.style[e]=t:this.el_.style[e]="auto"===t?"":t+"px",void(i||this.trigger("componentresize"))):this.el_?-1!==(i=(t=this.el_.style[e]).indexOf("px"))?parseInt(t.slice(0,i),10):parseInt(this.el_["offset"+ht(e)],10):0},e.currentDimension=function(e){var t=0;if("width"!==e&&"height"!==e)throw new Error("currentDimension only accepts width or height value");return t=A(this.el_,e),0!==(t=parseFloat(t))&&!isNaN(t)||(e="offset"+ht(e),t=this.el_[e]),t},e.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}},e.currentWidth=function(){return this.currentDimension("width")},e.currentHeight=function(){return this.currentDimension("height")},e.focus=function(){this.el_.focus()},e.blur=function(){this.el_.blur()},e.handleKeyDown=function(e){this.player_&&(e.stopPropagation(),this.player_.handleKeyDown(e))},e.handleKeyPress=function(e){this.handleKeyDown(e)},e.emitTapEvents=function(){var i,e=0,t=null;function n(){i=!1}this.on("touchstart",(function(n){1===n.touches.length&&(t={pageX:n.touches[0].pageX,pageY:n.touches[0].pageY},e=o.performance.now(),i=!0)})),this.on("touchmove",(function(e){var n;1<e.touches.length?i=!1:t&&(n=e.touches[0].pageX-t.pageX,e=e.touches[0].pageY-t.pageY,10<Math.sqrt(n*n+e*e)&&(i=!1))})),this.on("touchleave",n),this.on("touchcancel",n),this.on("touchend",(function(n){!(t=null)===i&&o.performance.now()-e<200&&(n.preventDefault(),this.trigger("tap"))}))},e.enableTouchActivity=function(){var e,i,t;this.player()&&this.player().reportUserActivity&&(e=Xe(this.player(),this.player().reportUserActivity),this.on("touchstart",(function(){e(),this.clearInterval(i),i=this.setInterval(e,250)})),t=function(t){e(),this.clearInterval(i)},this.on("touchmove",e),this.on("touchend",t),this.on("touchcancel",t))},e.setTimeout=function(e,t){var i,n=this;return e=Xe(this,e),this.clearTimersOnDispose_(),i=o.setTimeout((function(){n.setTimeoutIds_.has(i)&&n.setTimeoutIds_.delete(i),e()}),t),this.setTimeoutIds_.add(i),i},e.clearTimeout=function(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),o.clearTimeout(e)),e},e.setInterval=function(e,t){return e=Xe(this,e),this.clearTimersOnDispose_(),t=o.setInterval(e,t),this.setIntervalIds_.add(t),t},e.clearInterval=function(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),o.clearInterval(e)),e},e.requestAnimationFrame=function(e){var t,i=this;return this.supportsRaf_?(this.clearTimersOnDispose_(),e=Xe(this,e),t=o.requestAnimationFrame((function(){i.rafIds_.has(t)&&i.rafIds_.delete(t),e()})),this.rafIds_.add(t),t):this.setTimeout(e,1e3/60)},e.requestNamedAnimationFrame=function(e,t){var i=this;if(!this.namedRafs_.has(e)){this.clearTimersOnDispose_(),t=Xe(this,t);var n=this.requestAnimationFrame((function(){t(),i.namedRafs_.has(e)&&i.namedRafs_.delete(e)}));return this.namedRafs_.set(e,n),e}},e.cancelNamedAnimationFrame=function(e){this.namedRafs_.has(e)&&(this.cancelAnimationFrame(this.namedRafs_.get(e)),this.namedRafs_.delete(e))},e.cancelAnimationFrame=function(e){return this.supportsRaf_?(this.rafIds_.has(e)&&(this.rafIds_.delete(e),o.cancelAnimationFrame(e)),e):this.clearTimeout(e)},e.clearTimersOnDispose_=function(){var e=this;this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",(function(){[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEac
2h((function(t){var n=t[0],i=t[1];e[n].forEach((function(t,n){return e[i](n)}))})),e.clearingTimersOnDispose_=!1})))},s.registerComponent=function(e,t){if("string"!=typeof e||!e)throw new Error('Illegal component name, "'+e+'"; must be a non-empty string.');var n=(i=s.getComponent("Tech"))&&i.isTech(t),i=s===t||s.prototype.isPrototypeOf(t.prototype);if(n||!i){var r=n?"techs must be registered using Tech.registerTech()":"must be a Component subclass";throw new Error('Illegal component, "'+e+'"; '+r+".")}if(e=ht(e),s.components_||(s.components_={}),r=s.getComponent("Player"),"Player"===e&&r&&r.players){var a=r.players;if(r=Object.keys(a),a&&0<r.length&&r.map((function(e){return a[e]})).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return s.components_[e]=t,s.components_[dt(e)]=t},s.getComponent=function(e){if(e&&s.components_)return s.components_[e]},s}();gt.prototype.supportsRaf_="function"==typeof o.requestAnimationFrame&&"function"==typeof o.cancelAnimationFrame,gt.registerComponent("Component",gt);var yt=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},vt=function(e,t){e.prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t};function _t(e,t,i,n){return function(e,t,i){if("number"!=typeof t||t<0||i<t)throw new Error("Failed to execute '"+e+"' on 'TimeRanges': The index provided ("+t+") is non-numeric or out of bounds (0-"+i+").")}(e,n,i.length-1),i[n][t]}function bt(e){var t=void 0===e||0===e.length?{length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}:{length:e.length,start:_t.bind(null,"start",0,e),end:_t.bind(null,"end",1,e)};return o.Symbol&&o.Symbol.iterator&&(t[o.Symbol.iterator]=function(){return(e||[]).values()}),t}function Tt(e,t){return Array.isArray(e)?bt(e):void 0===e||void 0===t?bt():bt([[e,t]])}function St(e,t){var i,n,r=0;if(!t)return 0;e&&e.length||(e=Tt(0,0));for(var a=0;a<e.length;a++)i=e.start(a),r+=(n=t<(n=e.end(a))?t:n)-i;return r/t}function Et(e){if(e instanceof Et)return e;"number"==typeof e?this.code=e:"string"==typeof e?this.message=e:w(e)&&("number"==typeof e.code&&(this.code=e.code),C(this,e)),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 kt=0;kt<Et.errorTypes.length;kt++)Et[Et.errorTypes[kt]]=kt,Et.prototype[Et.errorTypes[kt]]=kt;var Ct=function(e,t){var i,n=null;try{i=JSON.parse(e,t)}catch(e){n=e}return[n,i]};function wt(e){return null!=e&&"function"==typeof e.then}function It(e){wt(e)&&e.then(null,(function(e){}))}function At(e){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce((function(t,n,i){return e[n]&&(t[n]=e[n]),t}),{cues:e.cues&&Array.prototype.map.call(e.cues,(function(e){return{startTime:e.startTime,endTime:e.endTime,text:e.text,id:e.id}}))})}var xt=function(e){var t=e.$$("track"),i=Array.prototype.map.call(t,(function(e){return e.track}));return Array.prototype.map.call(t,(function(e){var t=At(e.track);return e.src&&(t.src=e.src),t})).concat(Array.prototype.filter.call(e.textTracks(),(function(e){return-1===i.indexOf(e)})).map(At))},Pt=function(e,i){return e.forEach((function(e){var t=i.addRemoteTextTrack(e).track;!e.src&&e.cues&&e.cues.forEach((function(e){return t.addCue(e)}))})),i.textTracks()},Lt=r((function(e,t){function i(e){if(!e||"object"!=typeof e||(t=e.which||e.keyCode||e.charCode)&&(e=t),"number"==typeof e)return o[e];var t=String(e);
2return(e=n[t.toLowerCase()])||((e=r[t.toLowerCase()])?e:1===t.length?t.charCodeAt(0):void 0)}i.isEventKey=function(e,t){if(e&&"object"==typeof e){var i=e.which||e.keyCode||e.charCode;if(null==i)return!1;if("string"==typeof t){if(e=n[t.toLowerCase()])return e===i;if(e=r[t.toLowerCase()])return e===i}else if("number"==typeof t)return t===i;return!1}};for(var n=(t=e.exports=i).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},r=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},a=97;a<123;a++)n[String.fromCharCode(a)]=a-32;for(a=48;a<58;a++)n[a-48]=a;for(a=1;a<13;a++)n["f"+a]=a+111;for(a=0;a<10;a++)n["numpad "+a]=a+96;var s,o=t.names=t.title={};for(a in n)o[n[a]]=a;for(s in r)n[s]=r[s]}));Lt.code,Lt.codes,Lt.aliases,Lt.names,Lt.title;var Dt="vjs-modal-dialog",Ot=function(e){function t(t,n){var i=e.call(this,t,n)||this;return i.handleKeyDown_=function(e){return i.handleKeyDown(e)},i.close_=function(e){return i.close(e)},i.opened_=i.hasBeenOpened_=i.hasBeenFilled_=!1,i.closeable(!i.options_.uncloseable),i.content(i.options_.content),i.contentEl_=te("div",{className:Dt+"-content"},{role:"document"}),i.descEl_=te("p",{className:Dt+"-description vjs-control-text",id:i.el().getAttribute("aria-describedby")}),ie(i.descEl_,i.description()),i.el_.appendChild(i.descEl_),i.el_.appendChild(i.contentEl_),i}vt(t,e);var n=t.prototype;return n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":this.id()+"_description","aria-hidden":"true","aria-label":this.label(),role:"dialog"})},n.dispose=function(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,e.prototype.dispose.call(this)},n.buildCSSClass=function(){return Dt+" vjs-hidden "+e.prototype.buildCSSClass.call(this)},n.label=function(){return this.localize(this.options_.label||"Modal Window")},n.description=function(){var e=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),e},n.open=function(){var e;this.opened_||(e=this.player(),this.trigger("beforemodalopen"),this.opened_=!0,!this.options_.fillAlways&&(this.hasBeenOpened_||this.hasBeenFilled_)||this.fill(),this.wasPlaying_=!e.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&e.pause(),this.on("keydown",this.handleKeyDown_),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0)},n.opened=function(e){return"boolean"==typeof e&&this[e?"open":"close"](),this.opened_},n.close=function(){var e;this.opened_&&(e=this.player(),this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.off("keydown",this.handleKeyDown_),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger("modalclose"),this.conditionalBlur_(),this.options_.temporary&&this.dispose())},n.closeable=function(e){var t,i;return"boolean"==typeof e&&(t=this.closeable_=!!e,i=this.getChild("closeButton"),t&&!i&&(e=this.contentEl_,this.contentEl_=this.el_,i=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=e,this.on(i,"close",this.close_)),!t&&i&&(this.off(i,"close",this.close_),this.removeChild(i),i.dispose())),this.closeable_},n.fill=function(){this.fillWith(this.content())},n.fillWith=function(e){var t=this.contentEl(),i=t.parentNode,n=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,i.removeChild(t),this.empty(),Se(t,e),this.trigger("modalfill"),n?i.insertBefore(t,n):i.appendChild(t),(t=this.getChild("closeButton"))&&i.appendChild(t.el_)},n.empty=function(){this.trigger("beforemodalempty"),_e(this.contentEl()),this.trigger("modalempty")},n.content=function(e){return void 0!==e&&(this.content_=e),this.content_},n.conditionalFocus_=function(){var e=d.activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,!t.contains(e)&&t!==e||(this.previouslyActiveEl_=e,this.focus())},n.conditionalBlur_=function(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)},n.handleKeyDown=function(e){if(e.stopPropagation(),Lt.isEventKey(e,"Escape")&&this.closeable())return e.preventDefault(),void this.close();
2if(Lt.isEventKey(e,"Tab")){for(var t,i=this.focusableEls_(),n=this.el_.querySelector(":focus"),r=0;r<i.length;r++)if(n===i[r]){t=r;break}d.activeElement===this.el_&&(t=0),e.shiftKey&&0===t?(i[i.length-1].focus(),e.preventDefault()):e.shiftKey||t!==i.length-1||(i[0].focus(),e.preventDefault())}},n.focusableEls_=function(){var e=this.el_.querySelectorAll("*");return Array.prototype.filter.call(e,(function(e){return(e instanceof o.HTMLAnchorElement||e instanceof o.HTMLAreaElement)&&e.hasAttribute("href")||(e instanceof o.HTMLInputElement||e instanceof o.HTMLSelectElement||e instanceof o.HTMLTextAreaElement||e instanceof o.HTMLButtonElement)&&!e.hasAttribute("disabled")||e instanceof o.HTMLIFrameElement||e instanceof o.HTMLObjectElement||e instanceof o.HTMLEmbedElement||e.hasAttribute("tabindex")&&-1!==e.getAttribute("tabindex")||e.hasAttribute("contenteditable")}))},t}(gt);Ot.prototype.options_={pauseOnOpen:!0,temporary:!0},gt.registerComponent("ModalDialog",Ot);var Rt,Mt=function(e){function t(t){var n;void 0===t&&(t=[]),(n=e.call(this)||this).tracks_=[],Object.defineProperty(yt(n),"length",{get:function(){return this.tracks_.length}});for(var i=0;i<t.length;i++)n.addTrack(t[i]);return n}vt(t,e);var n=t.prototype;return n.addTrack=function(e){var t=this,i=this.tracks_.length;""+i in this||Object.defineProperty(this,i,{get:function(){return this.tracks_[i]}}),-1===this.tracks_.indexOf(e)&&(this.tracks_.push(e),this.trigger({track:e,type:"addtrack",target:this})),e.labelchange_=function(){t.trigger({track:e,type:"labelchange",target:t})},st(e)&&e.addEventListener("labelchange",e.labelchange_)},n.removeTrack=function(e){for(var t,i=0,n=this.length;i<n;i++)if(this[i]===e){(t=this[i]).off&&t.off(),this.tracks_.splice(i,1);break}t&&this.trigger({track:t,type:"removetrack",target:this})},n.getTrackById=function(e){for(var t=null,i=0,n=this.length;i<n;i++){var r=this[i];if(r.id===e){t=r;break}}return t},t}(Qe);for(Rt in Mt.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"},Mt.prototype.allowedEvents_)Mt.prototype["on"+Rt]=null;function Nt(e,t){for(var i=0;i<e.length;i++)Object.keys(e[i]).length&&t.id!==e[i].id&&(e[i].enabled=!1)}function Ut(e,t){for(var i=0;i<e.length;i++)Object.keys(e[i]).length&&t.id!==e[i].id&&(e[i].selected=!1)}function Bt(e){var t=["protocol","hostname","port","pathname","search","hash","host"],i=d.createElement("a");i.href=e;for(var n={},r=0;r<t.length;r++)n[t[r]]=i[t[r]];return"http:"===n.protocol&&(n.host=n.host.replace(/:80$/,"")),"https:"===n.protocol&&(n.host=n.host.replace(/:443$/,"")),n.protocol||(n.protocol=o.location.protocol),n.host||(n.host=o.location.host),n}function Ft(e){var t;return e.match(/^https?:\/\//)||((t=d.createElement("a")).href=e,e=t.href),e}function jt(e){return"string"==typeof e&&(e=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/.exec(e))?e.pop().toLowerCase():""}function Ht(e,t){return void 0===t&&(t=o.location),(":"===(e=Bt(e)).protocol?t:e).protocol+e.host!==t.protocol+t.host}var qt=function(e){function t(t){for(var n,i=(t=void 0===t?[]:t).length-1;0<=i;i--)if(t[i].enabled){Nt(t,t[i]);break}return(n=e.call(this,t)||this).changing_=!1,n}vt(t,e);var n=t.prototype;return n.addTrack=function(t){var n=this;t.enabled&&Nt(this,t),e.prototype.addTrack.call(this,t),t.addEventListener&&(t.enabledChange_=function(){n.changing_||(n.changing_=!0,Nt(n,t),n.changing_=!1,n.trigger("change"))},t.addEventListener("enabledchange",t.enabledChange_))},n.removeTrack=function(t){e.prototype.removeTrack.call(this,t),t.removeEventListener&&t.enabledChange_&&(t.removeEventListener("enabledchange",t.enabledChange_),t.enabledChange_=null)},t}(Mt),Vt=(e=function(e){function t(t){for(var n,i=(t=void 0===t?[]:t).length-1;0<=i;i--)if(t[i].selected){Ut(t,t[i]);break}return(n=e.call(this,t)||this).changing_=!1,Object.defineProperty(yt(n),"selectedIndex",{get:function(){for(var e=0;e<this.length;e++)if(this[e].selected)return e;return-1},set:function(){}}),n}vt(t,e);var n=t.prototype;return n.addTrack=function(t){var n=this;t.selected&&Ut(this,t),e.prototype.addTrack.call(this,t),t.addEventListener&&(t.selectedChange_=function(){n.changing_||(n.changing_=!0,Ut(n,t),n.changing_=!1,n.trigger("change"))},t.addEventListener("selectedchange",t.selectedChange_))},n.removeTrack=function(t){e.prototype.removeTrack.call(this,t),t.removeEventListener&&t.selectedChange_&&(t.removeEventListener("selectedchange",t.selectedChange_),t.selectedChange_=null)},t}(Mt),s=function(i){function e(){return i.apply(this,arguments)||this}vt(e,i);var t=e.prototype;return t.addTrack=function(e){var t=this;i.prototype.addTrack.call(this,e),this.queueChange_||(this.queueChange_=function(){return t.queueTrigger("change")}),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=function(){return t.trigger("selectedlanguagechange")}),e.addEventListener("modechange",this.queueChange_),-1===["metadata","chapters"].indexOf(e.kind)&&e.addEventListener("modechange",this.triggerSelectedlanguagechange_)},t.removeTrack=function(e){i.prototype.removeTrack.call(this,e),e.removeEventListener&&(this.queueChange_&&e.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&e.removeEventListener("modechange",this.triggerSelectedlanguagechange_))},e}(Mt),function(){function e(e){void 0===e&&(e=[]),this.trackElements_=[],Object.defineProperty(this,"length",{get:function(){return this.trackElements_.length}});for(var t=0,i=e.length;t<i;t++)this.addTrackElement_(e[t])}var t=e.prototype;return t.addTrackElement_=function(e){var t=this.trackElements_.length;""+t in this||Object.defineProperty(this,t,{get:function(){return this.trackElements_[t]}}
2),-1===this.trackElements_.indexOf(e)&&this.trackElements_.push(e)},t.getTrackElementByTrack_=function(e){for(var t,i=0,n=this.trackElements_.length;i<n;i++)if(e===this.trackElements_[i].track){t=this.trackElements_[i];break}return t},t.removeTrackElement_=function(e){for(var t=0,i=this.trackElements_.length;t<i;t++)if(e===this.trackElements_[t]){this.trackElements_[t].track&&"function"==typeof this.trackElements_[t].track.off&&this.trackElements_[t].track.off(),"function"==typeof this.trackElements_[t].off&&this.trackElements_[t].off(),this.trackElements_.splice(t,1);break}},e}()),Wt=function(){function e(t){e.prototype.setCues_.call(this,t),Object.defineProperty(this,"length",{get:function(){return this.length_}})}var t=e.prototype;return t.setCues_=function(e){var t=this.length||0,i=0,n=e.length;function r(e){""+e in this||Object.defineProperty(this,""+e,{get:function(){return this.cues_[e]}})}if(this.cues_=e,this.length_=e.length,t<n)for(i=t;i<n;i++)r.call(this,i)},t.getCueById=function(e){for(var t=null,i=0,n=this.length;i<n;i++){var r=this[i];if(r.id===e){t=r;break}}return t},e}(),zt={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},Gt={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},Xt={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},Kt={disabled:"disabled",hidden:"hidden",showing:"showing"},Yt=function(a){function e(e){void 0===e&&(e={});var t,i=a.call(this)||this,n={id:e.id||"vjs_track_"+Re++,kind:e.kind||"",language:e.language||""},r=e.label||"";for(t in n)!function(e){Object.defineProperty(yt(i),e,{get:function(){return n[e]},set:function(){}})}(t);return Object.defineProperty(yt(i),"label",{get:function(){return r},set:function(e){e!==r&&(r=e,this.trigger("labelchange"))}}),i}return vt(e,a),e}(Qe),Qt=Object.freeze({__proto__:null,parseUrl:Bt,getAbsoluteURL:Ft,getFileExtension:jt,isCrossOrigin:Ht}),$t=function(e){if(!e)return!1;var t=Jt.call(e);return"[object Function]"===t||"function"==typeof e&&"[object RegExp]"!==t||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)},Jt=Object.prototype.toString;ii.httpHandler=function(e,t){return void 0===t&&(t=!1),function(n,r,i){if(n)e(n);else if(400<=r.statusCode&&r.statusCode<=599){if(n=i,t)if(o.TextDecoder){r=function(e){return void 0===e&&(e=""),e.toLowerCase().split(";").reduce((function(e,t){t=(i=t.split("="))[0];var i=i[1];return"charset"===t.trim()?i.trim():e}),"utf-8")}(r.headers&&r.headers["content-type"]);try{n=new TextDecoder(r).decode(i)}catch(n){}}else n=String.fromCharCode.apply(null,new Uint8Array(i));e({cause:n})}else e(null,i)}};var Zt=function(e){var t={};return e&&e.trim().split("\n").forEach((function(e){var n=e.indexOf(":"),i=e.slice(0,n).trim().toLowerCase();n=e.slice(n+1).trim(),void 0===t[i]?t[i]=n:Array.isArray(t[i])?t[i].push(n):t[i]=[t[i],n]})),t},ei=ii;function ti(e,t,i){var n=e;return $t(t)?(i=t,"string"==typeof e&&(n={uri:e})):n=b({},t,{uri:e}),n.callback=i,n}function ii(e,t,i){return ni(t=ti(e,t,i))}function ni(e){if(void 0===e.callback)throw new Error("callback argument missing");var t=!1,a=function(n,r,i){t||(t=!0,e.callback(n,r,i))};function s(){var e=void 0;if(e=l.response||l.responseText||function(e){try{if("document"===e.responseType)return e.responseXML;var t=e.responseXML&&"parsererror"===e.responseXML.documentElement.nodeName;if(""===e.responseType&&!t)return e.responseXML}catch(e){}return null}(l),m)try{e=JSON.parse(e)}catch(e){}return e}function n(e){return clearTimeout(u),(e=e instanceof Error?e:new Error(""+(e||"Unknown XMLHttpRequest Error"))).statusCode=0,a(e,g)}function r(){if(!o){clearTimeout(u);var t=e.useXDR&&void 0===l.status?200:1223===l.status?204:l.status,n=g,i=null;return 0!==t?(n={body:s(),statusCode:t,method:d,headers:{},url:c,rawRequest:l},l.getAllResponseHeaders&&(n.headers=Zt(l.getAllResponseHeaders()))):i=new Error("Internal XMLHttpRequest Error"),a(i,n,n.body)}}var i,o,u,l=e.xhr||null,c=(l=l||new(e.cors||e.useXDR?ii.XDomainRequest:ii.XMLHttpRequest)).url=e.uri||e.url,d=l.method=e.method||"GET",h=e.body||e.data,p=l.headers=e.headers||{},f=!!e.sync,m=!1,g={body:void 0,headers:{},statusCode:0,method:d,url:c,rawRequest:l};if("json"in e&&!1!==e.json&&(m=!0,p.accept||p.Accept||(p.Accept="application/json"),"GET"!==d&&"HEAD"!==d&&(p["content-type"]||p["Content-Type"]||(p["Content-Type"]="application/json"),h=JSON.stringify(!0===e.json?h:e.json))),l.onreadystatechange=function(){4===l.readyState&&setTimeout(r,0)},l.onload=r,l.onerror=n,l.onprogress=function(){},l.onabort=function(){o=!0},l.ontimeout=n,l.open(d,c,!f,e.username,e.password),f||(l.withCredentials=!!e.withCredentials),!f&&0<e.timeout&&(u=setTimeout((function(){var e;o||(o=!0,l.abort("timeout"),(e=new Error("XMLHttpRequest timeout")).code="ETIMEDOUT",n(e))}),e.timeout)),l.setRequestHeader)for(i in p)p.hasOwnProperty(i)&&l.setRequestHeader(i,p[i]);else if(e.headers&&!function(e){for(var t in e)if(e.hasOwnProperty(t))return;return 1}(e.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(l.responseType=e.responseType),"beforeSend"in e&&"function"==typeof e.beforeSend&&e.beforeSend(l),l.send(h||null),l}function ri(e,t){var i=new o.WebVTT.Parser(o,o.vttjs,o.WebVTT.StringDecoder()),n=[];i.oncue=function(e){t.addCue(e)},i.onparsingerror=function(e){n.push(e)},i.onflush=function(){t.trigger({type:"loadeddata",target:t})},i.parse(e),0<n.length&&(o.console&&o.console.groupCollapsed&&o.console.groupCollapsed("Text Track parsing errors for "+t.src),n.forEac
2h((function(e){return _.error(e)})),o.console&&o.console.groupEnd&&o.console.groupEnd()),i.flush()}function ai(e,t){var n={uri:e};(e=Ht(e))&&(n.cors=e),(e="use-credentials"===t.tech_.crossOrigin())&&(n.withCredentials=e),ei(n,Xe(this,(function(e,n,i){return e?_.error(e,n):(t.loaded_=!0,void("function"!=typeof o.WebVTT?t.tech_&&t.tech_.any(["vttjsloaded","vttjserror"],(function(e){return"vttjserror"!==e.type?ri(i,t):void _.error("vttjs failed to load, stopping trying to process "+t.src)})):ri(i,t)))})))}P=ii,ii.XMLHttpRequest=o.XMLHttpRequest||function(){},ii.XDomainRequest="withCredentials"in new ii.XMLHttpRequest?ii.XMLHttpRequest:o.XDomainRequest,function(e,t){for(var i=0;i<e.length;i++)t(e[i])}(["get","put","post","patch","head","delete"],(function(e){ii["delete"===e?"del":e]=function(t,n,i){return(n=ti(t,n,i)).method=e.toUpperCase(),ni(n)}})),ei.default=P;var si=function(u){function e(e){var t;if(!(e=void 0===e?{}:e).tech)throw new Error("A tech was not provided.");e=pt(e,{kind:Xt[e.kind]||"subtitles",language:e.language||e.srclang||""});var i=Kt[e.mode]||"disabled",n=e.default;"metadata"!==e.kind&&"chapters"!==e.kind||(i="hidden"),(t=u.call(this,e)||this).tech_=e.tech,t.cues_=[],t.activeCues_=[],t.preload_=!1!==t.tech_.preloadTextTracks;var r=new Wt(t.cues_),s=new Wt(t.activeCues_),o=!1,a=Xe(yt(t),(function(){this.tech_.isReady_&&!this.tech_.isDisposed()&&(this.activeCues=this.activeCues,o&&(this.trigger("cuechange"),o=!1))}));return t.tech_.one("dispose",(function(){t.tech_.off("timeupdate",a)})),"disabled"!==i&&t.tech_.on("timeupdate",a),Object.defineProperties(yt(t),{default:{get:function(){return n},set:function(){}},mode:{get:function(){return i},set:function(e){Kt[e]&&i!==e&&(i=e,this.preload_||"disabled"===i||0!==this.cues.length||ai(this.src,this),this.tech_.off("timeupdate",a),"disabled"!==i&&this.tech_.on("timeupdate",a),this.trigger("modechange"))}},cues:{get:function(){return this.loaded_?r:null},set:function(){}},activeCues:{get:function(){if(!this.loaded_)return null;if(0===this.cues.length)return s;for(var e=this.tech_.currentTime(),t=[],i=0,n=this.cues.length;i<n;i++){var r=this.cues[i];(r.startTime<=e&&r.endTime>=e||r.startTime===r.endTime&&r.startTime<=e&&r.startTime+.5>=e)&&t.push(r)}if(o=!1,t.length!==this.activeCues_.length)o=!0;else for(var a=0;a<t.length;a++)-1===this.activeCues_.indexOf(t[a])&&(o=!0);return this.activeCues_=t,s.setCues_(this.activeCues_),s},set:function(){}}}),e.src?(t.src=e.src,t.preload_||(t.loaded_=!0),(t.preload_||"subtitles"!==e.kind&&"captions"!==e.kind)&&ai(t.src,yt(t))):t.loaded_=!0,t}vt(e,u);var t=e.prototype;return t.addCue=function(e){var t=e;if(o.vttjs&&!(e instanceof o.vttjs.VTTCue)){for(var i in t=new o.vttjs.VTTCue(e.startTime,e.endTime,e.text),e)i in t||(t[i]=e[i]);t.id=e.id,t.originalCue_=e}for(var n=this.tech_.textTracks(),r=0;r<n.length;r++)n[r]!==this&&n[r].removeCue(t);this.cues_.push(t),this.cues.setCues_(this.cues_)},t.removeCue=function(e){for(var t=this.cues_.length;t--;){var i=this.cues_[t];if(i===e||i.originalCue_&&i.originalCue_===e){this.cues_.splice(t,1),this.cues.setCues_(this.cues_);break}}},e}(Yt);si.prototype.allowedEvents_={cuechange:"cuechange"};var oi=function(e){function t(t){var n=pt(t=void 0===t?{}:t,{kind:Gt[t.kind]||""}),i=(t=e.call(this,n)||this,!1);return Object.defineProperty(yt(t),"enabled",{get:function(){return i},set:function(e){"boolean"==typeof e&&e!==i&&(i=e,this.trigger("enabledchange"))}}),n.enabled&&(t.enabled=n.enabled),t.loaded_=!0,t}return vt(t,e),t}(Yt),ui=function(e){function t(t){var n=pt(t=void 0===t?{}:t,{kind:zt[t.kind]||""}),i=(t=e.call(this,n)||this,!1);return Object.defineProperty(yt(t),"selected",{get:function(){return i},set:function(e){"boolean"==typeof e&&e!==i&&(i=e,this.trigger("selectedchange"))}}),n.selected&&(t.selected=n.selected),t}return vt(t,e),t}(Yt);L=function(e){function t(t){var n;void 0===t&&(t={});var i=e.call(this)||this,r=new si(t);return i.kind=r.kind,i.src=r.src,i.srclang=r.language,i.label=r.label,i.default=r.default,Object.defineProperties(yt(i),{readyState:{get:function(){return n}},track:{get:function(){return r}}}),n=0,r.addEventListener("loadeddata",(function(){n=2,i.trigger({type:"load",target:yt(i)})})),i}return vt(t,e),t}(Qe),L.prototype.allowedEvents_={load:"load"},L.NONE=0,L.LOADING=1,L.LOADED=2,L.ERROR=3;
2var ci={audio:{ListClass:qt,TrackClass:oi,capitalName:"Audio"},video:{ListClass:e,TrackClass:ui,capitalName:"Video"},text:{ListClass:s,TrackClass:si,capitalName:"Text"}};Object.keys(ci).forEach((function(e){ci[e].getterName=e+"Tracks",ci[e].privateName=e+"Tracks_"}));var di={remoteText:{ListClass:s,TrackClass:si,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:Vt,TrackClass:L,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},li=b({},ci,di);di.names=Object.keys(di),ci.names=Object.keys(ci),li.names=[].concat(di.names).concat(ci.names);var hi={},pi=function(e){function i(t,n){var i;return void 0===n&&(n=function(){}),(t=void 0===t?{}:t).reportTouchActivity=!1,(i=e.call(this,null,t,n)||this).onDurationChange_=function(e){return i.onDurationChange(e)},i.trackProgress_=function(e){return i.trackProgress(e)},i.trackCurrentTime_=function(e){return i.trackCurrentTime(e)},i.stopTrackingCurrentTime_=function(e){return i.stopTrackingCurrentTime(e)},i.disposeSourceHandler_=function(e){return i.disposeSourceHandler(e)},i.hasStarted_=!1,i.on("playing",(function(){this.hasStarted_=!0})),i.on("loadstart",(function(){this.hasStarted_=!1})),li.names.forEach((function(e){e=li[e],t&&t[e.getterName]&&(i[e.privateName]=t[e.getterName])})),i.featuresProgressEvents||i.manualProgressOn(),i.featuresTimeupdateEvents||i.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach((function(e){!1===t["native"+e+"Tracks"]&&(i["featuresNative"+e+"Tracks"]=!1)})),!1===t.nativeCaptions||!1===t.nativeTextTracks?i.featuresNativeTextTracks=!1:!0!==t.nativeCaptions&&!0!==t.nativeTextTracks||(i.featuresNativeTextTracks=!0),i.featuresNativeTextTracks||i.emulateTextTracks(),i.preloadTextTracks=!1!==t.preloadTextTracks,i.autoRemoteTextTracks_=new li.text.ListClass,i.initTrackListeners(),t.nativeControlsForTouch||i.emitTapEvents(),i.constructor&&(i.name_=i.constructor.name||"Unknown Tech"),i}vt(i,e);var t=i.prototype;return t.triggerSourceset=function(e){var t=this;this.isReady_||this.one("ready",(function(){return t.setTimeout((function(){return t.triggerSourceset(e)}),1)})),this.trigger({src:e,type:"sourceset"})},t.manualProgressOn=function(){this.on("durationchange",this.onDurationChange_),this.manualProgress=!0,this.one("ready",this.trackProgress_)},t.manualProgressOff=function(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange_)},t.trackProgress=function(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(Xe(this,(function(){var e=this.bufferedPercent();this.bufferedPercent_!==e&&this.trigger("progress"),1===(this.bufferedPercent_=e)&&this.stopTrackingProgress()})),500)},t.onDurationChange=function(e){this.duration_=this.duration()},t.buffered=function(){return Tt(0,0)},t.bufferedPercent=function(){return St(this.buffered(),this.duration_)},t.stopTrackingProgress=function(){this.clearInterval(this.progressInterval)},t.manualTimeUpdatesOn=function(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime_),this.on("pause",this.stopTrackingCurrentTime_)},t.manualTimeUpdatesOff=function(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime_),this.off("pause",this.stopTrackingCurrentTime_)},t.trackCurrentTime=function(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval((function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}),250)},t.stopTrackingCurrentTime=function(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},t.dispose=function(){this.clearTracks(ci.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),e.prototype.dispose.call(this)},t.clearTracks=function(e){var t=this;
2(e=[].concat(e)).forEach((function(e){for(var n=t[e+"Tracks"]()||[],i=n.length;i--;){var r=n[i];"text"===e&&t.removeRemoteTextTrack(r),n.removeTrack(r)}}))},t.cleanupAutoTextTracks=function(){for(var e=this.autoRemoteTextTracks_||[],t=e.length;t--;){var i=e[t];this.removeRemoteTextTrack(i)}},t.reset=function(){},t.crossOrigin=function(){},t.setCrossOrigin=function(){},t.error=function(e){return void 0!==e&&(this.error_=new Et(e),this.trigger("error")),this.error_},t.played=function(){return this.hasStarted_?Tt(0,0):Tt()},t.play=function(){},t.setScrubbing=function(){},t.scrubbing=function(){},t.setCurrentTime=function(){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},t.initTrackListeners=function(){var e=this;ci.names.forEach((function(t){function n(){e.trigger(t+"trackchange")}var i=ci[t],r=e[i.getterName]();r.addEventListener("removetrack",n),r.addEventListener("addtrack",n),e.on("dispose",(function(){r.removeEventListener("removetrack",n),r.removeEventListener("addtrack",n)}))}))},t.addWebVttScript_=function(){var e,t=this;o.WebVTT||(d.body.contains(this.el())?!this.options_["vtt.js"]&&I(hi)&&0<Object.keys(hi).length?this.trigger("vttjsloaded"):((e=d.createElement("script")).src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",e.onload=function(){t.trigger("vttjsloaded")},e.onerror=function(){t.trigger("vttjserror")},this.on("dispose",(function(){e.onload=null,e.onerror=null})),o.WebVTT=!0,this.el().parentNode.appendChild(e)):this.ready(this.addWebVttScript_))},t.emulateTextTracks=function(){function e(e){return n.addTrack(e.track)}function i(e){return n.removeTrack(e.track)}var t=this,n=this.textTracks(),r=this.remoteTextTracks();function a(){return t.trigger("texttrackchange")}function s(){a();for(var e=0;e<n.length;e++){var t=n[e];t.removeEventListener("cuechange",a),"showing"===t.mode&&t.addEventListener("cuechange",a)}}r.on("addtrack",e),r.on("removetrack",i),this.addWebVttScript_(),s(),n.addEventListener("change",s),n.addEventListener("addtrack",s),n.addEventListener("removetrack",s),this.on("dispose",(function(){r.off("addtrack",e),r.off("removetrack",i),n.removeEventListener("change",s),n.removeEventListener("addtrack",s),n.removeEventListener("removetrack",s);for(var t=0;t<n.length;t++)n[t].removeEventListener("cuechange",a)}))},t.addTextTrack=function(e,t,i){if(!e)throw new Error("TextTrack kind is required but was not provided");return function(e,t,i,n,r){void 0===r&&(r={});var a=e.textTracks();return r.kind=t,i&&(r.label=i),n&&(r.language=n),r.tech=e,r=new li.text.TrackClass(r),a.addTrack(r),r}(this,e,t,i)},t.createRemoteTextTrack=function(e){return e=pt(e,{tech:this}),new di.remoteTextEl.TrackClass(e)},t.addRemoteTextTrack=function(e,t){var i=this,n=this.createRemoteTextTrack(e=void 0===e?{}:e);return!0!==t&&!1!==t&&(_.warn('Calling addRemoteTextTrack without explicitly setting the "manualCleanup" parameter to `true` is deprecated and default to `false` in future version of video.js'),t=!0),this.remoteTextTrackEls().addTrackElement_(n),this.remoteTextTracks().addTrack(n.track),!0!==t&&this.ready((function(){return i.autoRemoteTextTracks_.addTrack(n.track)})),n},t.removeRemoteTextTrack=function(e){var t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)},t.getVideoPlaybackQuality=function(){return{}},t.requestPictureInPicture=function(){var e=this.options_.Promise||o.Promise;if(e)return e.reject()},t.disablePictureInPicture=function(){return!0},t.setDisablePictureInPicture=function(){},t.setPoster=function(){},t.playsinline=function(){},t.setPlaysinline=function(){},t.overrideNativeAudioTracks=function(){},t.overrideNativeVideoTracks=function(){},t.canPlayType=function(){return""},i.canPlayType=function(){return""},i.canPlaySource=function(e,t){return i.canPlayType(e.type)},i.isTech=function(e){return e.prototype instanceof i||e instanceof i||e===i},i.registerTech=function(e,t){if(i.techs_||(i.techs_={}),!i.isTech(t))throw new Error("Tech "+e+" must be a Tech");if(!i.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!i.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=ht(e),i.techs_[e]=t,i.techs_[dt(e)]=t,"Tech"!==e&&i.defaultTechOrder_.push(e),t},i.getTech=function(e){if(e)return i.techs_&&i.techs_[e]?i.techs_[e]:(e=ht(e),o&&o.videojs&&o.videojs[e]?(_.warn("The "+e+" tech w
2as added to the videojs object when it should be registered using videojs.registerTech(name, tech)"),o.videojs[e]):void 0)},i}(gt);li.names.forEach((function(e){var t=li[e];pi.prototype[t.getterName]=function(){return this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName]}})),pi.prototype.featuresVolumeControl=!0,pi.prototype.featuresMuteControl=!0,pi.prototype.featuresFullscreenResize=!1,pi.prototype.featuresPlaybackRate=!1,pi.prototype.featuresProgressEvents=!1,pi.prototype.featuresSourceset=!1,pi.prototype.featuresTimeupdateEvents=!1,pi.prototype.featuresNativeTextTracks=!1,pi.withSourceHandlers=function(e){e.registerSourceHandler=function(t,n){var i=(i=e.sourceHandlers)||(e.sourceHandlers=[]);void 0===n&&(n=i.length),i.splice(n,0,t)},e.canPlayType=function(t){for(var n,i=e.sourceHandlers||[],r=0;r<i.length;r++)if(n=i[r].canPlayType(t))return n;return""},e.selectSourceHandler=function(t,n){for(var i=e.sourceHandlers||[],r=0;r<i.length;r++)if(i[r].canHandleSource(t,n))return i[r];return null},e.canPlaySource=function(t,n){var i=e.selectSourceHandler(t,n);return i?i.canHandleSource(t,n):""},["seekable","seeking","duration"].forEach((function(e){var t=this[e];"function"==typeof t&&(this[e]=function(){return this.sourceHandler_&&this.sourceHandler_[e]?this.sourceHandler_[e].apply(this.sourceHandler_,arguments):t.apply(this,arguments)})}),e.prototype),e.prototype.setSource=function(t){var n=e.selectSourceHandler(t,this.options_);n||(e.nativeSourceHandler?n=e.nativeSourceHandler:_.error("No source handler found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler_),n!==e.nativeSourceHandler&&(this.currentSource_=t),this.sourceHandler_=n.handleSource(t,this,this.options_),this.one("dispose",this.disposeSourceHandler_)},e.prototype.disposeSourceHandler=function(){this.currentSource_&&(this.clearTracks(["audio","video"]),this.currentSource_=null),this.cleanupAutoTextTracks(),this.sourceHandler_&&(this.sourceHandler_.dispose&&this.sourceHandler_.dispose(),this.sourceHandler_=null)}},gt.registerComponent("Tech",pi),pi.registerTech("Tech",pi),pi.defaultTechOrder_=[];var fi={},mi={},gi={};function yi(e,t,i){e.setTimeout((function(){return function i(e,t,n,a,s,r){void 0===e&&(e={}),void 0===t&&(t=[]),void 0===s&&(s=[]),void 0===r&&(r=!1);var o=t,u=(t=o[0],o.slice(1));if("string"==typeof t)i(e,fi[t],n,a,s,r);else if(t){var l=Ei(a,t);if(!l.setSource)return s.push(l),i(e,u,n,a,s,r);l.setSource(C({},e),(function(t,o){return t?i(e,u,n,a,s,r):(s.push(l),void i(o,e.type===o.type?u:fi[o.type],n,a,s,r))}))}else u.length?i(e,u,n,a,s,r):r?n(e,s):i(e,fi["*"],n,a,s,!0)}(t,fi[t.type],i,e)}),1)}function vi(e,t,i,n){void 0===n&&(n=null);var r="call"+ht(i);return r=e.reduce(Si(r),n),function(e,t,i,n){for(var r=e.length-1;0<=r;r--){var a=e[r];a[t]&&a[t](n,i)}}(e,i,r=(n=r===gi)?null:t[i](r),n),r}var _i={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},bi={setCurrentTime:1,setMuted:1,setVolume:1},Ti={play:1,pause:1};function Si(i){return function(e,t){return e===gi?gi:t[i]?t[i](e):e}}function Ei(e,t){var i=mi[e.id()],n=null;if(null==i)return n=t(e),mi[e.id()]=[[t,n]],n;for(var r=0;r<i.length;r++){var s=(a=i[r])[0],a=a[1];s===t&&(n=a)}return null===n&&(n=t(e),i.push([t,n])),n}function ki(e){return e=jt(e=void 0===e?"":e),wi[e.toLowerCase()]||""}function Ci(e){var t;return Array.isArray(e)?(t=[],e.forEach((function(e){e=Ci(e),Array.isArray(e)?t=t.concat(e):w(e)&&t.push(e)})),t):"string"==typeof e&&e.trim()?[Ii({src:e})]:w(e)&&"string"==typeof e.src&&e.src&&e.src.trim()?[Ii(e)]:[]}var wi={opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",m4a:"audio/mp4",mp3:"audio/mpeg",aac:"audio/aac",caf:"audio/x-caf",flac:"audio/flac",oga:"audio/ogg",wav:"audio/wav",m3u8:"application/x-mpegURL",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",png:"image/png",svg:"image/svg+xml",webp:"image/webp"};function Ii(e){var t;return e.type||(t=ki(e.src))&&(e.type=t),e}D=function(u){function e(e,t,i){var n=pt({createEl:!1},t);if(i=u.call(this,e,n,i)||this,t.playerOptions.sources&&0!==t.playerOptions.sources.length)e.src(t.playerOptions.sources);else for(var r=0,a=t.playerOptions.techOrder;r<a.length;r++){var s=ht(a[r]),o=pi.getTech(s);if((o=s?o:gt.getComponent(s))&&o.isSupported()){e.loadTech_(s);break}}return i}return vt(e,u),e}(gt),gt.registerComponent("MediaLoader",D),H=function(e){function t(t,n){var i=e.call(this,t,n)||this;return i.handleMouseOver_=function(e){return i.handleMouseOver(e)},i.handleMouseOut_=function(e){return i.handleMouseOut(e)},i.handleClick_=function(e){return i.handleClick(e)},i.handleKeyDown_=function(e){return i.handleKeyDown(e)},i.emitTapEvents(),i.enable(),i}vt(t,e);var n=t.prototype;return n.createEl=function(e,t,i){return void 0===e&&(e="div"),void 0===t&&(t={}),void 0===i&&(i={}),t=C({className:this.buildCSSClass(),tabIndex:0},t),"button"===e&&_.error("Creating a ClickableComponent with an HTML element of "+e+" is not supported; use a Button instead."),i=C({role:"button"},i),this.tabIndex_=t.tabIndex,(i=te(e,t,i)).appendChild(te("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(i),i},n.dispose=function(){this.controlTextEl_=null,e.prototype.dispose.call(this)},n.createControlTextEl=function(e){return this.controlTextEl_=te("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_},n.controlText=function(e,t){if(void 0===t&&(t=this.el()),void 0===e)return this.controlText_||"Need Text";var i=this.localize(e);this.controlText_=e,ie(this.controlTextEl_,i),this.nonIconControl||this.player_.options_.noUITitleAttributes||t.setAttribute("title",i)},n.buildCSSClass=function(){return"vjs-control vjs-button "+e.prototype.buildCSSClass.call(this)},n.enable=function(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),void 0!==this.tabIndex_&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick_),this.on("keydown",this.handleKeyDown_))},n.disable=function(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),void 0!==this.tabIndex_&&this.el_.removeAttribute("tabIndex"),this.off("mouseover",this.handleMouseOver_),this.off("mouseout",this.handleMouseOut_),this.off(["tap","click"],this.handleClick_),this.off("keydown",this.handleKeyDown_)},n.handleLanguagechange=function(){this.controlText(this.controlText_)},n.handleClick=function(e){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)},n.handleKeyDown=function(t){Lt.isEventKey(t,"Space")||Lt.isEventKey(t,"Enter")?(t.preventDefault(),t.stopPropagation(),this.trigger("click")):e.prototype.handleKeyDown.call(this,t)},t}(gt),gt.registerComponent("ClickableComponent",H),gt.registerComponent("PosterImage",function(e){function t(t,n){var i=e.call(this,t,n)||this;return i.update(),i.update_=function(e){return i.update(e)},t.on("posterchange",i.update_),i}vt(t,e);var n=t.prototype;return n.dispose=function(){this.player().off("posterchange",this.update_),e.prototype.dispose.call(this)},n.createEl=function(){return te("div",{className:"vjs-poster",tabIndex:-1})},n.update=function(e){var t=this.player().poster();this.setSrc(t),t?this.show():this.hide()},n.setSrc=function(e){this.el_.style.backgroundImage=e?'url("'+e+'")':""},n.handleClick=function(e){var t;this.player_.controls()&&(t=this.player_.usingPlugin("eme")&&this.player_.eme.sessions&&0<this.player_.eme.sessions.length,!this.player_.tech(!0)||(j||U)&&t||this.player_.tech(!0).focus(),this.player_.paused()?It(this.player_.play()):this.player_.pause())},t}(H));var Ai="#222",xi={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',
2script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function Pi(e,t){var i;if(4===e.length)i=e[1]+e[1]+e[2]+e[2]+e[3]+e[3];else{if(7!==e.length)throw new Error("Invalid color code provided, "+e+"; must be formatted as e.g. #f0e or #f604e2.");i=e.slice(1)}return"rgba("+parseInt(i.slice(0,2),16)+","+parseInt(i.slice(2,4),16)+","+parseInt(i.slice(4,6),16)+","+t+")"}function Li(e,t,i){try{e.style[t]=i}catch(e){return}}gt.registerComponent("TextTrackDisplay",function(a){function e(i,e,t){function n(e){return r.updateDisplay(e)}var r=a.call(this,i,e,t)||this;return i.on("loadstart",(function(e){return r.toggleDisplay(e)})),i.on("texttrackchange",n),i.on("loadedmetadata",(function(e){return r.preselectTrack(e)})),i.ready(Xe(yt(r),(function(){if(i.tech_&&i.tech_.featuresNativeTextTracks)this.hide();else{i.on("fullscreenchange",n),i.on("playerresize",n),o.addEventListener("orientationchange",n),i.on("dispose",(function(){return o.removeEventListener("orientationchange",n)}));for(var e=this.options_.playerOptions.tracks||[],t=0;t<e.length;t++)this.player_.addRemoteTextTrack(e[t],!0);this.preselectTrack()}}))),r}vt(e,a);var t=e.prototype;return t.preselectTrack=function(){for(var e,t,i,n={captions:1,subtitles:1},r=this.player_.textTracks(),a=this.player_.cache_.selectedLanguage,s=0;s<r.length;s++){var o=r[s];a&&a.enabled&&a.language&&a.language===o.language&&o.kind in n?i=o.kind!==a.kind&&i||o:a&&!a.enabled?t=e=i=null:o.default&&("descriptions"!==o.kind||e?o.kind in n&&!t&&(t=o):e=o)}i?i.mode="showing":t?t.mode="showing":e&&(e.mode="showing")},t.toggleDisplay=function(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show()},t.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-text-track-display"},{"aria-live":"off","aria-atomic":"true"})},t.clearDisplay=function(){"function"==typeof o.WebVTT&&o.WebVTT.processCues(o,[],this.el_)},t.updateDisplay=function(){var e=this.player_.textTracks(),t=this.options_.allowMultipleShowingTracks;if(this.clearDisplay(),t){for(var i=[],n=0;n<e.length;++n){var r=e[n];"showing"===r.mode&&i.push(r)}this.updateForTrack(i)}else{for(var a=null,s=null,o=e.length;o--;){var u=e[o];"showing"===u.mode&&("descriptions"===u.kind?a=u:s=u)}s?("off"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","off"),this.updateForTrack(s)):a&&("assertive"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","assertive"),this.updateForTrack(a))}},t.updateDisplayState=function(e){for(var t=this.player_.textTrackSettings.getValues(),i=e.activeCues,n=i.length;n--;){var r,a=i[n];a&&(r=a.displayState,t.color&&(r.firstChild.style.color=t.color),t.textOpacity&&Li(r.firstChild,"color",Pi(t.color||"#fff",t.textOpacity)),t.backgroundColor&&(r.firstChild.style.backgroundColor=t.backgroundColor),t.backgroundOpacity&&Li(r.firstChild,"backgroundColor",Pi(t.backgroundColor||"#000",t.backgroundOpacity)),t.windowColor&&(t.windowOpacity?Li(r,"backgroundColor",Pi(t.windowColor,t.windowOpacity)):r.style.backgroundColor=t.windowColor),t.edgeStyle&&("dropshadow"===t.edgeStyle?r.firstChild.style.textShadow="2px 2px 3px #222, 2px 2px 4px #222, 2px 2px 5px "+Ai:"raised"===t.edgeStyle?r.firstChild.style.textShadow="1px 1px #222, 2px 2px #222, 3px 3px "+Ai:"depressed"===t.edgeStyle?r.firstChild.style.textShadow="1px 1px #ccc, 0 1px #ccc, -1px -1px #222, 0 -1px "+Ai:"uniform"===t.edgeStyle&&(r.firstChild.style.textShadow="0 0 4px #222, 0 0 4px #222, 0 0 4px #222, 0 0 4px "+Ai)),t.fontPercent&&1!==t.fontPercent&&(a=o.parseFloat(r.style.fontSize),r.style.fontSize=a*t.fontPercent+"px",r.style.height="auto",r.style.top="auto"),t.fontFamily&&"default"!==t.fontFamily&&("small-caps"===t.fontFamily?r.firstChild.style.fontVariant="small-caps":r.firstChild.style.fontFamily=xi[t.fontFamily]))}},t.updateForTrack=function(e){if(Array.isArray(e)||(e=[e]),"function"==typeof o.WebVTT&&!e.every((function(e){return!e.activeCues}))){for(var t=[],i=0;i<e.length;++i)for(var n=e[i],r=0;r<n.activeCues.length;++r)t.push(n.activeCues[r]);o.WebVTT.processCues(o,t,this.el_);for(var a=0;a<e.length;++a){for(var s=e[a],l=0;l<s.activeCues.length;++l){var u=s.activeCues[l].displayState;ae(u,"vjs-text-track-cue"),ae(u,"vjs-text-track-cue-"+(s.language||a))}this.player_.textTrackSettings&&this.updateDisplayState(s)}}},e}(gt)),gt.registerComponent("LoadingSpinner",function(i){function e(){return i.apply(this,arguments)||this}return vt(e,i),e.prototype.createEl=function(){var e=this.player_.isAudio(),t=this.localize(e?"Audio Player":"
2Video Player");return e=te("span",{className:"vjs-control-text",textContent:this.localize("{1} is loading.",[t])}),(t=i.prototype.createEl.call(this,"div",{className:"vjs-loading-spinner",dir:"ltr"})).appendChild(e),t},e}(gt));var Di=function(e){function t(){return e.apply(this,arguments)||this}vt(t,e);var i=t.prototype;return i.createEl=function(e,t,i){return void 0===t&&(t={}),void 0===i&&(i={}),(i=te("button",t=C({className:this.buildCSSClass()},t),i=C({type:"button"},i))).appendChild(te("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(i),i},i.addChild=function(e,t){void 0===t&&(t={});var i=this.constructor.name;return _.warn("Adding an actionable (user controllable) child to a Button ("+i+") is not supported; use a ClickableComponent instead."),gt.prototype.addChild.call(this,e,t)},i.enable=function(){e.prototype.enable.call(this),this.el_.removeAttribute("disabled")},i.disable=function(){e.prototype.disable.call(this),this.el_.setAttribute("disabled","disabled")},i.handleKeyDown=function(t){Lt.isEventKey(t,"Space")||Lt.isEventKey(t,"Enter")?t.stopPropagation():e.prototype.handleKeyDown.call(this,t)},t}(H);gt.registerComponent("Button",Di),W=function(e){function t(t,n){var i=e.call(this,t,n)||this;return i.mouseused_=!1,i.on("mousedown",(function(e){return i.handleMouseDown(e)})),i}vt(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-big-play-button"},n.handleClick=function(e){var t=this.player_.play();if(this.mouseused_&&e.clientX&&e.clientY){var i=this.player_.usingPlugin("eme")&&this.player_.eme.sessions&&0<this.player_.eme.sessions.length;return It(t),void(!this.player_.tech(!0)||(j||U)&&i||this.player_.tech(!0).focus())}var n=(i=this.player_.getChild("controlBar"))&&i.getChild("playToggle");n?(i=function(){return n.focus()},wt(t)?t.then(i,(function(){})):this.setTimeout(i,1)):this.player_.tech(!0).focus()},n.handleKeyDown=function(t){this.mouseused_=!1,e.prototype.handleKeyDown.call(this,t)},n.handleMouseDown=function(e){this.mouseused_=!0},t}(Di),W.prototype.controlText_="Play Video",gt.registerComponent("BigPlayButton",W),gt.registerComponent("CloseButton",function(i){function e(e,t){return(e=i.call(this,e,t)||this).controlText(t&&t.controlText||e.localize("Close")),e}vt(e,i);var t=e.prototype;return t.buildCSSClass=function(){return"vjs-close-button "+i.prototype.buildCSSClass.call(this)},t.handleClick=function(e){this.trigger({type:"close",bubbles:!1})},t.handleKeyDown=function(e){Lt.isEventKey(e,"Esc")?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):i.prototype.handleKeyDown.call(this,e)},e}(Di));var Oi=function(e){function t(t,n){var i=e.call(this,t,n=void 0===n?{}:n)||this;return n.replay=void 0===n.replay||n.replay,i.on(t,"play",(function(e){return i.handlePlay(e)})),i.on(t,"pause",(function(e){return i.handlePause(e)})),n.replay&&i.on(t,"ended",(function(e){return i.handleEnded(e)})),i}vt(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-play-control "+e.prototype.buildCSSClass.call(this)},n.handleClick=function(e){this.player_.paused()?It(this.player_.play()):this.player_.pause()},n.handleSeeked=function(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)},n.handlePlay=function(e){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.controlText("Pause")},n.handlePause=function(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("Play")},n.handleEnded=function(e){var t=this;this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.controlText("Replay"),this.one(this.player_,"seeked",(function(e){return t.handleSeeked(e)}))},t}(Di);function Ri(e,t){e=e<0?0:e;var i=Math.floor(e%60),n=Math.floor(e/60%60),r=Math.floor(e/3600),a=Math.floor(t/60%60);return t=Math.floor(t/3600),(r=0<(r=isNaN(e)||e===1/0?n=i="-":r)||0<t?r+":":"")+(n=((r||10<=a)&&n<10?"0"+n:n)+":")+(i<10?"0"+i:i)}Oi.prototype.controlText_="Play",gt.registerComponent("PlayToggle",Oi);var Mi=Ri;function Ni(e,t){return Mi(e,t=void 0===t?e:t)}function Ui(e,t,i){return e=Number(e),Math.min(i,Math.max(t,isNaN(e)?t:e))}
2function Bi(e,t){return Ui(e/t*100,0,100).toFixed(2)+"%"}P=function(e){function t(t,n){var i=e.call(this,t,n)||this;return i.on(t,["timeupdate","ended"],(function(e){return i.updateContent(e)})),i.updateTextNode_(),i}vt(t,e);var n=t.prototype;return n.createEl=function(){var t=this.buildCSSClass(),n=e.prototype.createEl.call(this,"div",{className:t+" vjs-time-control vjs-control"}),i=te("span",{className:"vjs-control-text",textContent:this.localize(this.labelText_)+"Â "},{role:"presentation"});return n.appendChild(i),this.contentEl_=te("span",{className:t+"-display"},{"aria-live":"off",role:"presentation"}),n.appendChild(this.contentEl_),n},n.dispose=function(){this.contentEl_=null,this.textNode_=null,e.prototype.dispose.call(this)},n.updateTextNode_=function(e){var t=this;e=Ni(e=void 0===e?0:e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",(function(){var e;t.contentEl_&&((e=t.textNode_)&&t.contentEl_.firstChild!==e&&(e=null,_.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),t.textNode_=d.createTextNode(t.formattedTime_),t.textNode_&&(e?t.contentEl_.replaceChild(t.textNode_,e):t.contentEl_.appendChild(t.textNode_)))})))},n.updateContent=function(e){},t}(gt),P.prototype.labelText_="Time",P.prototype.controlText_="Time",gt.registerComponent("TimeDisplay",P),Yt=function(e){function t(){return e.apply(this,arguments)||this}vt(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-current-time"},i.updateContent=function(e){var t=this.player_.ended()?this.player_.duration():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();this.updateTextNode_(t)},t}(P),Yt.prototype.labelText_="Current Time",Yt.prototype.controlText_="Current Time",gt.registerComponent("CurrentTimeDisplay",Yt),qt=function(e){function t(t,n){var i=e.call(this,t,n)||this;return n=function(e){return i.updateContent(e)},i.on(t,"durationchange",n),i.on(t,"loadstart",n),i.on(t,"loadedmetadata",n),i}vt(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-duration"},n.updateContent=function(e){var t=this.player_.duration();this.updateTextNode_(t)},t}(P),qt.prototype.labelText_="Duration",qt.prototype.controlText_="Duration",gt.registerComponent("DurationDisplay",qt),gt.registerComponent("TimeDivider",function(e){function t(){return e.apply(this,arguments)||this}return vt(t,e),t.prototype.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),n=e.prototype.createEl.call(this,"div"),i=e.prototype.createEl.call(this,"span",{textContent:"/"});return n.appendChild(i),t.appendChild(n),t},t}(gt)),e=function(e){function t(t,n){var i=e.call(this,t,n)||this;return i.on(t,"durationchange",(function(e){return i.updateContent(e)})),i}vt(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-remaining-time"},n.createEl=function(){var t=e.prototype.createEl.call(this);return t.insertBefore(te("span",{},{"aria-hidden":!0},"-"),this.contentEl_),t},n.updateContent=function(e){var t;"number"==typeof this.player_.duration()&&(t=this.player_.ended()?0:this.player_.remainingTimeDisplay?this.player_.remainingTimeDisplay():this.player_.remainingTime(),this.updateTextNode_(t))},t}(P),e.prototype.labelText_="Remaining Time",e.prototype.controlText_="Remaining Time",gt.registerComponent("RemainingTimeDisplay",e),gt.registerComponent("LiveDisplay",function(e){function t(t,n){var i=e.call(this,t,n)||this;return i.updateShowing(),i.on(i.player(),"durationchange",(function(e){return i.updateShowing(e)})),i}vt(t,e);var n=t.prototype;return n.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});return this.contentEl_=te("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(te("span",{className:"vjs-control-text",textContent:this.localize("Stream Type")+"Â "})),this.contentEl_.appendChild(d.createTextNode(this.localize("LIVE"))),t.appendChild(this.contentEl_),t},n.dispose=function(){this.contentEl_=null,e.prototype.dispose.call(this)},n.updateShowing=function(e){this.player().duration()===1/0?this.show():this.hide()},t}(gt)),s=function(e){function t(t,n){var i=e.call(this,t,n)||this;return i.updateLiveEdgeStatus(),i.player_.liveTracker&&(i.updateLiveEdgeStatusHandler_=function(e){return i.updateLiveEdgeStatus(e)},i.on(i.player_.liveTracker,"liveedgechange",i.updateLiveEdgeStatusHandler_)),i}vt(t,e);var n=t.prototype;return n.createEl=function(){var t=e.prototype.createEl.call(this,"button",{className:"vjs-seek-to-live-control vjs-control"});return this.textEl_=te("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),t.appendChild(this.textEl_),t},n.updateLiveEdgeStatus=function(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))},n.handleClick=function(){this.player_.liveTracker.seekToLiveEdge()},n.dispose=function(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,e.prototype.dispose.call(this)},t}(Di),s.prototype.controlText_="Seek to live, currently playing live",gt.registerComponent("SeekToLive",s),Vt=function(e){function t(t,n){var i=e.call(this,t,n)||this;return i.handleMouseDown_=function(e){return i.handleMouseDown(e)},i.handleMouseUp_=function(e){return i.handleMouseUp(e)},i.handleKeyDown_=function(e){return i.handleKeyDown(e)},i.handleClick_=function(e){return i.handleClick(e)},i.handleMouseMove_=function(e){return i.handleMouseMove(e)},i.update_=function(e){return i.update(e)},i.bar=i.getChild(i.options_.barName),i.vertical(!!i.options_.vertical),i.enable(),i}vt(t,e);var n=t.prototype;return n.enabled=function(){return this.enabled_},n.enable=function(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)},n.disable=function(){var e;this.enabled()&&(e=this.bar.el_.ownerDocument,this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1)},n.createEl=function(t,n,i){return void 0===i&&(i={}),(n=void 0===n?{}:n).className=n.className+" vjs-slider",n=C({tabIndex:0},n),i=C({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},i),e.prototype.createEl.call(this,t,n,i)},n.handleMouseDown=function(e){var t=this.bar.el_.ownerDocument;"mousedown"===e.type&&e.preventDefault(),"touchstart"!==e.type||B||e.preventDefault(),pe(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(t,"mousemove",this.handleMouseMove_),this.on(t,"mouseup",this.handleMouseUp_),this.on(t,"touchmove",this.handleMouseMove_),this.on(t,"touchend",this.handleMouseUp_),this.handleMouseMove(e)},n.handleMouseMove=function(e){},n.handleMouseUp=function(){var e=this.bar.el_.ownerDocument;fe(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.update()},n.update=function(){var e=this;if(this.el_&&this.bar){var i=this.getProgress();return i===this.progress_||(this.progress_=i,this.requestNamedAnimationFrame("Slider#update",(function(){var t=e.vertical()?"height":"width";e.bar.el().style[t]=(100*i).toFixed(2)+"%"}))),i}},n.getProgress=function(){return Number(Ui(this.getPercent(),0,1).toFixed(4))},n.calculateDistance=function(e){return e=ye(this.el_,e),this.vertical()?e.y:e.x},n.handleKeyDown=function(t){Lt.isEventKey(t,"Left")||Lt.isEventKey(t,"Down")?(t.preventDefault(),t.stopPropagation(),this.stepBack()):Lt.isEventKey(t,"Right")||Lt.isEventKey(t,"Up")?(t.preventDefault(),t.stopPropagation(),this.stepForward()):e.prototype.handleKeyDown.call(this,t)},n.handleClick=function(e){e.stopPropagation(),e.preventDefault()},n.vertical=function(e){if(void 0===e)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")},t}(gt),gt.registerComponent("Slider",Vt),gt.registerComponent("LoadProgressBar",function(e){function t(t,n){var i=e.call(this,t,n)||this;return i.partEls_=[],i.on(t,"progress",(function(e){return i.update(e)})),i}vt(t,e);var n=t.prototype;return n.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-load-progress"}),n=te("span",{className:"vjs-control-text"}),i=te("span",{textContent:this.localize("Loaded")}),r=d.createTextNode(": ");return this.percentageEl_=te("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),t.appendChild(n),n.appendChild(i),n.appendChild(r),n.appendChild(this.percentageEl_),t},n.dispose=function(){this.partEls_=null,this.percentageEl_=null,e.prototype.dispose.call(this)},n.update=function(e){var t=this;this.requestNamedAnimationFrame("LoadProgressBar#update",(function(){var e=t.player_.liveTracker,n=t.player_.buffered(),i=(e=e&&e.isLive()?e.seekableEnd():t.player_.duration(),t.player_.bufferedEnd()),r=t.partEls_;e=Bi(i,e),t.percent_!==e&&(t.el_.style.width=e,ie(t.percentageEl_,e),t.percent_=e);for(var o=0;o<n.length;o++){var a=n.start(o),s=n.end(o),l=r[o];l||(l=t.el_.appendChild(te()),r[o]=l),l.dataset.start===a&&l.dataset.end===s||(l.dataset.start=a,l.dataset.end=s,l.style.left=Bi(a,i),l.style.width=Bi(s-a,i))}for(var u=r.length;u>n.length;u--)t.el_.removeChild(r[u-1]);r.length=n.length}))},t}(gt)),gt.registerComponent("TimeTooltip",function(i){function e(e,t){return(t=i.call(this,e,t)||this).update=Ke(Xe(yt(t),t.update),30),t}vt(e,i);var t=e.prototype;return t.createEl=function(){return i.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})},t.update=function(e,t,i){var n=ge(this.el_),r=me(this.player_.el()),a=e.width*t;r&&n&&(t=e.left-r.left+a,r=e.width-a+(r.right-e.right),t<(e=n.width/2)?e+=e-t:r<e&&(e=r),e<0?e=0:e>n.width&&(e=n.width),e=Math.round(e),this.el_.style.right="-"+e+"px",this.write(i))},t.write=function(e){ie(this.el_,e)},t.updateTime=function(e,t,a,s){var n=this;this.requestNamedAnimationFrame("TimeTooltip#updateTime",(function(){var r,o,i=n.player_.duration();i=n.player_.liveTracker&&n.player_.liveTracker.isLive()?((o=(r=n.player_.liveTracker.liveWindow())-t*r)<1?"":"-")+Ni(o,r):Ni(a,i),n.update(e,t,i),s&&s()}))},e}(gt)),L=function(i){function e(e,t){return(t=i.call(this,e,t)||this).update=Ke(Xe(yt(t),t.update),30),t}vt(e,i);var t=e.prototype;return t.createEl=function(){return i.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})},t.update=function(e,t){var i,n=this.getChild("timeTooltip");n&&(i=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),n.updateTime(e,t,i))},e}(gt),L.prototype.options_={children:[]},G||O||L.prototype.options_.children.push("timeTooltip"),gt.registerComponent("PlayProgressBar",L),D=function(i){function e(e,t){return(t=i.call(this,e,t)||this).update=Ke(Xe(yt(t),t.update),30),t}vt(e,i);var t=e.prototype;return t.createEl=function(){return i.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},t.update=function(e,t){var i=this,n=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,n,(function(){i.el_.style.left=e.width*t+"px"}))},e}(gt),D.prototype.options_={children:["timeTooltip"]},gt.registerComponent("MouseTimeDisplay",D),W=function(a){function e(e,t){return(t=a.call(this,e,t)||this).setEventHandlers_(),t}vt(e,a);var t=e.prototype;return t.setEventHandlers_=function(){var e=this;this.update_=Xe(this,this.update),this.update=Ke(this.update_,30),this.on(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=function(t){return e.enableInterval_(t)},this.disableIntervalHandler_=function(t){return e.disableInterval_(t)},this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in d&&"visibilityState"in d&&this.on(d,"visibilitychange",this.toggleVisibility_)},t.toggleVisibility_=function(e){"hidden"===d.visibilityState?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(this.player_.ended()||this.player_.paused()||this.enableInterval_(),this.update())},t.enableInterval_=function(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,30))},t.disableInterval_=function(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&"ended"!==e.type||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)},t.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},t.update=function(e){var t=this;if("hidden"!==d.visibilityState){var n=a.prototype.update.call(this);return this.requestNamedAnimationFrame("SeekBar#update",(function(){var e=t.player_.ended()?t.player_.duration():t.getCurrentTime_(),r=t.player_.liveTracker,i=t.player_.duration();
2r&&r.isLive()&&(i=t.player_.liveTracker.liveCurrentTime()),t.percent_!==n&&(t.el_.setAttribute("aria-valuenow",(100*n).toFixed(2)),t.percent_=n),t.currentTime_===e&&t.duration_===i||(t.el_.setAttribute("aria-valuetext",t.localize("progress bar timing: currentTime={1} duration={2}",[Ni(e,i),Ni(i,i)],"{1} of {2}")),t.currentTime_=e,t.duration_=i),t.bar&&t.bar.update(me(t.el()),t.getProgress())})),n}},t.userSeek_=function(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)},t.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()},t.getPercent=function(){var e,t=this.getCurrentTime_(),i=this.player_.liveTracker;return i&&i.isLive()?(e=(t-i.seekableStart())/i.liveWindow(),i.atLiveEdge()&&(e=1)):e=t/this.player_.duration(),e},t.handleMouseDown=function(e){Ee(e)&&(e.stopPropagation(),this.player_.scrubbing(!0),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),a.prototype.handleMouseDown.call(this,e))},t.handleMouseMove=function(e){if(Ee(e)){var t=this.calculateDistance(e),i=this.player_.liveTracker;if(i&&i.isLive()){if(.99<=t)return void i.seekToLiveEdge();var n,r=i.seekableStart();if((n=(n=(e=i.liveCurrentTime())<=(n=r+t*i.liveWindow())?e:n)<=r?r+.1:n)===1/0)return}else(n=t*this.player_.duration())===this.player_.duration()&&(n-=.1);this.userSeek_(n)}},t.enable=function(){a.prototype.enable.call(this);var e=this.getChild("mouseTimeDisplay");e&&e.show()},t.disable=function(){a.prototype.disable.call(this);var e=this.getChild("mouseTimeDisplay");e&&e.hide()},t.handleMouseUp=function(e){a.prototype.handleMouseUp.call(this,e),e&&e.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?It(this.player_.play()):this.update_()},t.stepForward=function(){this.userSeek_(this.player_.currentTime()+5)},t.stepBack=function(){this.userSeek_(this.player_.currentTime()-5)},t.handleAction=function(e){this.player_.paused()?this.player_.play():this.player_.pause()},t.handleKeyDown=function(e){var t,i=this.player_.liveTracker;Lt.isEventKey(e,"Space")||Lt.isEventKey(e,"Enter")?(e.preventDefault(),e.stopPropagation(),this.handleAction(e)):Lt.isEventKey(e,"Home")?(e.preventDefault(),e.stopPropagation(),this.userSeek_(0)):Lt.isEventKey(e,"End")?(e.preventDefault(),e.stopPropagation(),i&&i.isLive()?this.userSeek_(i.liveCurrentTime()):this.userSeek_(this.player_.duration())):/^[0-9]$/.test(Lt(e))?(e.preventDefault(),e.stopPropagation(),t=10*(Lt.codes[Lt(e)]-Lt.codes[0])/100,i&&i.isLive()?this.userSeek_(i.seekableStart()+i.liveWindow()*t):this.userSeek_(this.player_.duration()*t)):Lt.isEventKey(e,"PgDn")?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()-60)):Lt.isEventKey(e,"PgUp")?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()+60)):a.prototype.handleKeyDown.call(this,e)}
2,t.dispose=function(){this.disableInterval_(),this.off(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in d&&"visibilityState"in d&&this.off(d,"visibilitychange",this.toggleVisibility_),a.prototype.dispose.call(this)},e}(Vt),W.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},G||O||W.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),gt.registerComponent("SeekBar",W),Oi=function(e){function t(t,n){var i=e.call(this,t,n)||this;return i.handleMouseMove=Ke(Xe(yt(i),i.handleMouseMove),30),i.throttledHandleMouseSeek=Ke(Xe(yt(i),i.handleMouseSeek),30),i.handleMouseUpHandler_=function(e){return i.handleMouseUp(e)},i.handleMouseDownHandler_=function(e){return i.handleMouseDown(e)},i.enable(),i}vt(t,e);var n=t.prototype;return n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},n.handleMouseMove=function(e){var t,i,n,r,a=this.getChild("seekBar");a&&(t=a.getChild("playProgressBar"),i=a.getChild("mouseTimeDisplay"),(t||i)&&(r=ge(n=a.el()),e=Ui(e=ye(n,e).x,0,1),i&&i.update(r,e),t&&t.update(r,a.getProgress())))},n.handleMouseSeek=function(e){var t=this.getChild("seekBar");t&&t.handleMouseMove(e)},n.enabled=function(){return this.enabled_},n.disable=function(){var e;
2this.children().forEach((function(e){return e.disable&&e.disable()})),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,"mousemove",this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing()&&(e=this.getChild("seekBar"),this.player_.scrubbing(!1),e.videoWasPlaying&&It(this.player_.play())))},n.enable=function(){this.children().forEach((function(e){return e.enable&&e.enable()})),this.enabled()||(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)},n.removeListenersAddedOnMousedownAndTouchstart=function(){var e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUpHandler_),this.off(e,"touchend",this.handleMouseUpHandler_)},n.handleMouseDown=function(e){var t=this.el_.ownerDocument,i=this.getChild("seekBar");i&&i.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)},n.handleMouseUp=function(e){var t=this.getChild("seekBar");t&&t.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()},t}(gt),Oi.prototype.options_={children:["seekBar"]},gt.registerComponent("ProgressControl",Oi),Yt=function(e){function t(t,n){var i=e.call(this,t,n)||this;return i.on(t,["enterpictureinpicture","leavepictureinpicture"],(function(e){return i.handlePictureInPictureChange(e)})),i.on(t,["disablepictureinpicturechanged","loadedmetadata"],(function(e){return i.handlePictureInPictureEnabledChange(e)})),i.disable(),i}vt(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-picture-in-picture-control "+e.prototype.buildCSSClass.call(this)},n.handlePictureInPictureEnabledChange=function(){d.pictureInPictureEnabled&&!1===this.player_.disablePictureInPicture()?this.enable():this.disable()},n.handlePictureInPictureChange=function(e){this.player_.isInPictureInPicture()?this.controlText("Exit Picture-in-Picture"):this.controlText("Picture-in-Picture"),this.handlePictureInPictureEnabledChange()},n.handleClick=function(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()},t}(Di),Yt.prototype.controlText_="Picture-in-Picture",gt.registerComponent("PictureInPictureToggle",Yt),qt=function(e){function t(t,n){var i=e.call(this,t,n)||this;return i.on(t,"fullscreenchange",(function(e){return i.handleFullscreenChange(e)})),!1===d[t.fsApi_.fullscreenEnabled]&&i.disable(),i}vt(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-fullscreen-control "+e.prototype.buildCSSClass.call(this)},n.handleFullscreenChange=function(e){this.player_.isFullscreen()?this.controlText("Non-Fullscreen"):this.controlText("Fullscreen")},n.handleClick=function(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()},t}(Di),qt.prototype.controlText_="Fullscreen",gt.registerComponent("FullscreenToggle",qt),gt.registerComponent("VolumeLevel",function(e){function t(){return e.apply(this,arguments)||this}return vt(t,e),t.prototype.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-volume-level"});return t.appendChild(e.prototype.createEl.call(this,"span",{className:"vjs-control-text"})),t},t}(gt)),gt.registerComponent("VolumeLevelTooltip",function(i){function e(e,t){return(t=i.call(this,e,t)||this).update=Ke(Xe(yt(t),t.update),30),t}vt(e,i);var t=e.prototype;return t.createEl=function(){return i.prototype.createEl.call(this,"div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})},t.update=function(e,t,i,n){if(!i){var r=me(this.el_),a=me(this.player_.el());if(i=e.width*t,!a||!r)return;t=e.left-a.left+i,a=e.width-i+(a.right-e.right),t<(e=r.width/2)?e+=e-t:a<e&&(e=a),e<0?e=0:e>r.width&&(e=r.width),this.el_.style.right="-"+e+"px"}this.write(n+"%")},t.write=function(e){ie(this.el_,e)},t.updateVolume=function(e,t,i,n,r){var a=this;this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",(function(){a.update(e,t,i,n.toFixed(0)),r&&r()}))},e}(gt)),P=function(i){function e(e,t){return(t=i.call(this,e,t)||this).update=Ke(Xe(yt(t),t.update),30),t}vt(e,i);var t=e.prototype;return t.createEl=function(){return i.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},t.update=function(e,t,i){var n=this,r=100*t;this.getChild("volumeLevelTooltip").updateVolume(e,t,i,r,(function(){i?n.el_.style.bottom=e.height*t+"px":n.el_.style.left=e.width*t+"px"}))},e}(gt),P.prototype.options_={children:["volumeLevelTooltip"]},gt.registerComponent("MouseVolumeLevelDisplay",P),e=function(e){function t(t,n){var i=e.call(this,t,n)||this;return i.on("slideractive",(function(e){return i.updateLastVolume_(e)})),i.on(t,"volumechange",(function(e){return i.updateARIAAttributes(e)})),t.ready((function(){return i.updateARIAAttributes()})),i}vt(t,e);var n=t.prototype;return n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})},n.handleMouseDown=function(t){Ee(t)&&e.prototype.handleMouseDown.call(this,t)},n.handleMouseMove=function(e){var t,i,n,r=this.getChild("mouseVolumeLevelDisplay");r&&(t=me(n=this.el()),i=this.vertical(),n=ye(n,e),n=Ui(n=i?n.y:n.x,0,1),r.update(t,n,i)),Ee(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))},n.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1)},n.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},n.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)},n.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)},n.updateARIAAttributes=function(e){var t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")},n.volumeAsPercentage_=function(){return Math.round(100*this.player_.volume())},n.updateLastVolume_=function(){var e=this,t=this.player_.volume();this.one("sliderinactive",(function(){0===e.player_.volume()&&e.player_.lastVolume_(t)}))},t}(Vt),e.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},G||O||e.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay"),e.prototype.playerEvent="volumechange",gt.registerComponent("
2VolumeBar",e),s=function(a){function e(e,t){var i,n,r;return(t=void 0===t?{}:t).vertical=t.vertical||!1,void 0!==t.volumeBar&&!I(t.volumeBar)||(t.volumeBar=t.volumeBar||{},t.volumeBar.vertical=t.vertical),i=a.call(this,e,t)||this,n=yt(i),(r=e).tech_&&!r.tech_.featuresVolumeControl&&n.addClass("vjs-hidden"),n.on(r,"loadstart",(function(){r.tech_.featuresVolumeControl?n.removeClass("vjs-hidden"):n.addClass("vjs-hidden")})),i.throttledHandleMouseMove=Ke(Xe(yt(i),i.handleMouseMove),30),i.handleMouseUpHandler_=function(e){return i.handleMouseUp(e)},i.on("mousedown",(function(e){return i.handleMouseDown(e)})),i.on("touchstart",(function(e){return i.handleMouseDown(e)})),i.on("mousemove",(function(e){return i.handleMouseMove(e)})),i.on(i.volumeBar,["focus","slideractive"],(function(){i.volumeBar.addClass("vjs-slider-active"),i.addClass("vjs-slider-active"),i.trigger("slideractive")})),i.on(i.volumeBar,["blur","sliderinactive"],(function(){i.volumeBar.removeClass("vjs-slider-active"),i.removeClass("vjs-slider-active"),i.trigger("sliderinactive")})),i}vt(e,a);var t=e.prototype;return t.createEl=function(){var e="vjs-volume-horizontal";return this.options_.vertical&&(e="vjs-volume-vertical"),a.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control "+e})},t.handleMouseDown=function(e){var t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove),this.on(t,"touchmove",this.throttledHandleMouseMove),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)},t.handleMouseUp=function(e){var t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove),this.off(t,"touchmove",this.throttledHandleMouseMove),this.off(t,"mouseup",this.handleMouseUpHandler_),this.off(t,"touchend",this.handleMouseUpHandler_)},t.handleMouseMove=function(e){this.volumeBar.handleMouseMove(e)},e}(gt),s.prototype.options_={children:["volumeBar"]},gt.registerComponent("VolumeControl",s),L=function(a){function e(e,t){var i,n,r=a.call(this,e,t)||this;return i=yt(r),(n=e).tech_&&!n.tech_.featuresMuteControl&&i.addClass("vjs-hidden"),i.on(n,"loadstart",(function(){n.tech_.featuresMuteControl?i.removeClass("vjs-hidden"):i.addClass("vjs-hidden")})),r.on(e,["loadstart","volumechange"],(function(e){return r.update(e)})),r}vt(e,a);var t=e.prototype;return t.buildCSSClass=function(){return"vjs-mute-control "+a.prototype.buildCSSClass.call(this)},t.handleClick=function(e){var t=this.player_.volume(),i=this.player_.lastVolume_();0===t?(this.player_.volume(i<.1?.1:i),this.player_.muted(!1)):this.player_.muted(!this.player_.muted())},t.update=function(e){this.updateIcon_(),this.updateControlText_()},t.updateIcon_=function(){var e=this.player_.volume(),t=3;G&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),0===e||this.player_.muted()?t=0:e<.33?t=1:e<.67&&(t=2);for(var i=0;i<4;i++)se(this.el_,"vjs-vol-"+i);ae(this.el_,"vjs-vol-"+t)},t.updateControlText_=function(){var e=this.player_.muted()||0===this.player_.volume()?"Unmute":"Mute";this.controlText()!==e&&this.controlText(e)},e}(Di),L.prototype.controlText_="Mute",gt.registerComponent("MuteToggle",L),D=function(e){function t(t,n){var i;return void 0!==(n=void 0===n?{}:n).inline?n.inline=n.inline:n.inline=!0,void 0!==n.volumeControl&&!I(n.volumeControl)||(n.volumeControl=n.volumeControl||{},n.volumeControl.vertical=!n.inline),(i=e.call(this,t,n)||this).handleKeyPressHandler_=function(e){return i.handleKeyPress(e)},i.on(t,["loadstart"],(function(e){return i.volumePanelState_(e)})),i.on(i.muteToggle,"keyup",(function(e){return i.handleKeyPress(e)})),i.on(i.volumeControl,"keyup",(function(e){return i.handleVolumeControlKeyUp(e)})),i.on("keydown",(function(e){return i.handleKeyPress(e)})),i.on("mouseover",(function(e){return i.handleMouseOver(e)})),i.on("mouseout",(function(e){return i.handleMouseOut(e)})),i.on(i.volumeControl,["slideractive"],i.sliderActive_),i.on(i.volumeControl,["sliderinactive"],i.sliderInactive_),i}vt(t,e);var n=t.prototype;return n.sliderActive_=function(){this.addClass("vjs-slider-active")},n.sliderInactive_=function(){this.removeClass("vjs-slider-active")},n.volumePanelState_=function(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")},n.createEl=function(){var t="vjs-volume-panel-horizontal";return this.options_.inline||(t="vjs-volume-panel-vertical"),e.prototype.createEl.call(this,"div",{className:"vjs-volume-panel vjs-control "+t})},n.dispose=function(){this.handleMouseOut(),e.prototype.dispose.call(this)},n.handleVolumeControlKeyUp=function(e){Lt.isEventKey(e,"Esc")&&this.muteToggle.focus()},n.handleMouseOver=function(e){this.addClass("vjs-hover"),qe(d,"keyup",this.handleKeyPressHandler_)},n.handleMouseOut=function(e){this.removeClass("vjs-hover"),Ve(d,"keyup",this.handleKeyPressHandler_)},n.handleKeyPress=function(e){Lt.isEventKey(e,"Esc")&&this.handleMouseOut()},t}(gt),D.prototype.options_={children:["muteToggle","volumeControl"]}
2,gt.registerComponent("VolumePanel",D);var Fi=function(e){function t(t,n){var i=e.call(this,t,n)||this;return n&&(i.menuButton_=n.menuButton),i.focusedChild_=-1,i.on("keydown",(function(e){return i.handleKeyDown(e)})),i.boundHandleBlur_=function(e){return i.handleBlur(e)},i.boundHandleTapClick_=function(e){return i.handleTapClick(e)},i}vt(t,e);var n=t.prototype;return n.addEventListenerForItem=function(e){e instanceof gt&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))},n.removeEventListenerForItem=function(e){e instanceof gt&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))},n.removeChild=function(t){"string"==typeof t&&(t=this.getChild(t)),this.removeEventListenerForItem(t),e.prototype.removeChild.call(this,t)},n.addItem=function(e){(e=this.addChild(e))&&this.addEventListenerForItem(e)},n.createEl=function(){var t=this.options_.contentElType||"ul";return this.contentEl_=te(t,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu"),(t=e.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"})).appendChild(this.contentEl_),qe(t,"click",(function(e){e.preventDefault(),e.stopImmediatePropagation()})),t},n.dispose=function(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,e.prototype.dispose.call(this)},n.handleBlur=function(e){var t=e.relatedTarget||d.activeElement;this.children().some((function(e){return e.el()===t}))||(e=this.menuButton_)&&e.buttonPressed_&&t!==e.el().firstChild&&e.unpressButton()},n.handleTapClick=function(e){var t;this.menuButton_&&(this.menuButton_.unpressButton(),t=this.children(),!Array.isArray(t)||(t=t.filter((function(t){return t.el()===e.target}))[0])&&"CaptionSettingsMenuItem"!==t.name()&&this.menuButton_.focus())},n.handleKeyDown=function(e){Lt.isEventKey(e,"Left")||Lt.isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(Lt.isEventKey(e,"Right")||Lt.isEventKey(e,"Up"))&&(e.preventDefault(),e.stopPropagation(),this.stepBack())},n.stepForward=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_+1),this.focus(e)},n.stepBack=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_-1),this.focus(e)},n.focus=function(e){void 0===e&&(e=0);var t=this.children().slice();t.length&&t[0].hasClass("vjs-menu-title")&&t.shift(),0<t.length&&(e<0?e=0:e>=t.length&&(e=t.length-1),t[this.focusedChild_=e].el_.focus())},t}(gt);gt.registerComponent("Menu",Fi),W=function(e){function t(t,n){var i;return(i=e.call(this,t,n=void 0===n?{}:n)||this).menuButton_=new Di(t,n),i.menuButton_.controlText(i.controlText_),i.menuButton_.el_.setAttribute("aria-haspopup","true"),n=Di.prototype.buildCSSClass(),i.menuButton_.el_.className=i.buildCSSClass()+" "+n,i.menuButton_.removeClass("vjs-control"),i.addChild(i.menuButton_),i.update(),i.enabled_=!0,n=function(e){return i.handleClick(e)},i.handleMenuKeyUp_=function(e){return i.handleMenuKeyUp(e)},i.on(i.menuButton_,"tap",n),i.on(i.menuButton_,"click",n),i.on(i.menuButton_,"keydown",(function(e){return i.handleKeyDown(e)})),i.on(i.menuButton_,"mouseenter",(function(){i.addClass("vjs-hover"),i.menu.show(),qe(d,"keyup",i.handleMenuKeyUp_)})),i.on("mouseleave",(function(e){return i.handleMouseLeave(e)})),i.on("keydown",(function(e){return i.handleSubmenuKeyDown(e)})),i}vt(t,e);var n=t.prototype;return n.update=function(){var e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?this.hide():this.show()},n.createMenu=function(){var e,t=new Fi(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title&&(e=te("li",{className:"vjs-menu-title",textContent:ht(this.options_.title),tabIndex:-1}),e=new gt(this.player_,{el:e}),t.addItem(e)),this.items=this.createItems(),this.items)for(var i=0;i<this.items.length;i++)t.addItem(this.items[i]);return t},n.createItems=function(){},n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildWrapperCSSClass()},{})},n.buildWrapperCSSClass=function(){var t="vjs-menu-button";return!0===this.options_.inline?t+="-inline":t+="-popup","vjs-menu-button "+t+" "+Di.prototype.buildCSSClass()+" "+e.prototype.buildCSSClass.call(this)},n.buildCSSClass=function(){var t="vjs-menu-button";return!0===this.options_.inline?t+="-inline":t+="-popup","vjs-menu-button "+t+" "+e.prototype.buildCSSClass.call(this)},n.controlText=function(e,t){return void 0===t&&(t=this.menuButton_.el()),this.menuButton_.controlText(e,t)},n.dispose=function(){this.handleMouseLeave(),e.prototype.dispose.call(this)},n.handleClick=function(e){this.buttonPressed_?this.unpressButton():this.pressButton()},n.handleMouseLeave=function(e){this.removeClass("vjs-hover"),Ve(d,"keyup",this.handleMenuKeyUp_)},n.focus=function(){this.menuButton_.focus()},n.blur=function(){this.menuButton_.blur()},n.handleKeyDown=function(e){Lt.isEventKey(e,"Esc")||Lt.isEventKey(e,"Tab")?(this.buttonPressed_&&this.unpressButton(),Lt.isEventKey(e,"Tab")||(e.preventDefault(),this.menuButton_.focus())):(Lt.isEventKey(e,"Up")||Lt.isEventKey(e,"Down"))&&(this.buttonPressed_||(e.preventDefault(),this.pressButton()))},n.handleMenuKeyUp=function(e){(Lt.isEventKey(e,"Esc")||Lt.isEventKey(e,"Tab"))&&this.removeClass("vjs-hover")},n.handleSubmenuKeyPress=function(e){this.handleSubmenuKeyDown(e)},n.handleSubmenuKeyDown=function(e){(Lt.isEventKey(e,"Esc")||Lt.isEventKey(e,"Tab"))&&(this.buttonPressed_&&this.unpressButton(),Lt.isEventKey(e,"Tab")||(e.preventDefault(),this.menuButton_.focus()))},n.pressButton=function(){this.enabled_&&(this.buttonPressed_=!0,this.menu.show(),this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),G&&Z()||this.menu.focus())},n.unpressButton=function(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menu.hide(),this.menuButton_.el_.setAttribute("aria-expanded","fal
2se"))},n.disable=function(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()},n.enable=function(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()},t}(gt),gt.registerComponent("MenuButton",W),Oi=function(e){function t(t,n){var i=n.tracks;if((n=e.call(this,t,n)||this).items.length<=1&&n.hide(),!i)return yt(n);var r=Xe(yt(n),n.update);return i.addEventListener("removetrack",r),i.addEventListener("addtrack",r),i.addEventListener("labelchange",r),n.player_.on("ready",r),n.player_.on("dispose",(function(){i.removeEventListener("removetrack",r),i.removeEventListener("addtrack",r),i.removeEventListener("labelchange",r)})),n}return vt(t,e),t}(W),gt.registerComponent("TrackButton",Oi);var ji=["Tab","Esc","Up","Down","Right","Left"];Yt=function(e){function t(t,n){return(t=e.call(this,t,n)||this).selectable=n.selectable,t.isSelected_=n.selected||!1,t.multiSelectable=n.multiSelectable,t.selected(t.isSelected_),t.selectable?t.multiSelectable?t.el_.setAttribute("role","menuitemcheckbox"):t.el_.setAttribute("role","menuitemradio"):t.el_.setAttribute("role","menuitem"),t}vt(t,e);var n=t.prototype;return n.createEl=function(t,n,i){return this.nonIconControl=!0,(i=e.prototype.createEl.call(this,"li",C({className:"vjs-menu-item",tabIndex:-1},n),i)).replaceChild(te("span",{className:"vjs-menu-item-text",textContent:this.localize(this.options_.label)}),i.querySelector(".vjs-icon-placeholder")),i},n.handleKeyDown=function(t){ji.some((function(e){return Lt.isEventKey(t,e)}))||e.prototype.handleKeyDown.call(this,t)},n.handleClick=function(e){this.selected(!0)},n.selected=function(e){this.selectable&&(e?(this.addClass("vjs-selected"),this.el_.setAttribute("aria-checked","true"),this.controlText(", selected"),this.isSelected_=!0):(this.removeClass("vjs-selected"),this.el_.setAttribute("aria-checked","false"),this.controlText(""),this.isSelected_=!1))},t}(H),gt.registerComponent("MenuItem",Yt);var Hi=function(u){function e(e,t){var n,r,i=t.track,l=e.textTracks();function a(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];n.handleTracksChange.apply(yt(n),t)}function s(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];n.handleSelectedLanguageChange.apply(yt(n),t)}return t.label=i.label||i.language||"Unknown",t.selected="showing"===i.mode,(n=u.call(this,e,t)||this).track=i,n.kinds=(t.kinds||[t.kind||n.track.kind]).filter(Boolean),e.on(["loadstart","texttrackchange"],a),l.addEventListener("change",a),l.addEventListener("selectedlanguagechange",s),n.on("dispose",(function(){e.off(["loadstart","texttrackchange"],a),l.removeEventListener("change",a),l.removeEventListener("selectedlanguagechange",s)})),void 0===l.onchange&&n.on(["tap","click"],(function(){if("object"!=typeof o.Event)try{r=new o.Event("change")}catch(e){}r||(r=d.createEvent("Event")).initEvent("change",!0,!0),l.dispatchEvent(r)})),n.handleTracksChange(),n}vt(e,u);var t=e.prototype;return t.handleClick=function(e){var t=this.track,i=this.player_.textTracks();if(u.prototype.handleClick.call(this,e),i)for(var n=0;n<i.length;n++){var r=i[n];-1!==this.kinds.indexOf(r.kind)&&(r===t?"showing"!==r.mode&&(r.mode="showing"):"disabled"!==r.mode&&(r.mode="disabled"))}},t.handleTracksChange=function(e){var t="showing"===this.track.mode;t!==this.isSelected_&&this.selected(t)},t.handleSelectedLanguageChange=function(e){var t;"showing"===this.track.mode&&((t=this.player_.cache_.selectedLanguage)&&t.enabled&&t.language===this.track.language&&t.kind!==this.track.kind||(this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind}))},t.dispose=function(){this.track=null,u.prototype.dispose.call(this)},e}(Yt);gt.registerComponent("TextTrackMenuItem",Hi);var qi=function(i){function e(e,t){return t.track={player:e,kind:t.kind,kinds:t.kinds,default:!1,mode:"disabled"},t.kinds||(t.kinds=[t.kind]),t.label?t.track.label=t.label:t.track.label=t.kinds.join(" and ")+" off",t.selectable=!0,t.multiSelectable=!1,i.call(this,e,t)||this}vt(e,i);var t=e.prototype;return t.handleTracksChange=function(e){for(var t=this.player().textTracks(),i=!0,n=0,r=t.length;n<r;n++){var a=t[n];if(-1<this.options_.kinds.indexOf(a.kind)&&"showing"===a.mode){i=!1;break}}i!==this.isSelected_&&this.selected(i)},t.handleSelectedLanguageChange=function(e){for(var t=this.player().textTracks(),i=!0,n=0,r=t.length;n<r;n++){var a=t[n];if(-1<["captions","descriptions","subtitles"].indexOf(a.kind)&&"showing"===a.mode){i=!1;break}}i&&(this.player_.cache_.selectedLanguage={enabled:!1})},e}(Hi);gt.registerComponent("OffTextTrackMenuItem",qi),qt=function(i){function e(e,t){return(t=void 0===t?{}:t).tracks=e.textTracks(),i.call(this,e,t)||this}return vt(e,i),e.prototype.createItems=function(e,t){var i;void 0===t&&(t=Hi),this.label_&&(i=this.label_+" off"),(e=void 0===e?[]:e).push(new qi(this.player_,{kinds:this.kinds_,kind:this.kind_,label:i})),this.hideThreshold_+=1;var n=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(var r=0;r<n.length;r++){var a,s=n[r];-1<this.kinds_.indexOf(s.kind)&&((a=new t(this.player_,{track:s,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1})).addClass("vjs-"+s.kind+"-menu-item"),e.push(a))}return e},e}(Oi),gt.registerComponent("TextTrackButton",qt);var Vi=function(a){function e(e,t){var i=t.track,n=t.cue,r=e.currentTime();return t.selectable=!0,t.multiSelectable=!1,t.label=n.text,t.selected=n.startTime<=r&&r<n.endTime,(t=a.call(this,e,t)||this).track=i,t.cue=n,i.addEventListener("cuechange",Xe(yt(t),t.update)),t}vt(e,a);var t=e.prototype;return t.handleClick=function(e){a.prototype.handleClick.call(this),this.player_.currentTime(this.cue.startTime),this.update(this.cue.startTime)},t.update=function(e){var t=this.cue,i=this.player_.currentTime();this.selected(t.startTime<=i&&i<t.endTime)},e}(Yt);gt.registerComponent("ChaptersTrackMenuItem",Vi),P=function(e){function t(t,n,i){return e.call(this,t,n,i)||this}vt(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-chapters-button "+e.prototype.buildCSSClass.call(this)},n.buildWrapperCSSClass=function(){return"vjs-chapters-button "+e.prototype.buildWrapperCSSClass.call(this)},n.update=function(t){this.track_&&(!t||"addtrack"!==t.type&&"removetrack"!==t.type)||this.setTrack(this.findChapter
2sTrack()),e.prototype.update.call(this)},n.setTrack=function(e){var t;this.track_!==e&&(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_&&((t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_))&&t.removeEventListener("load",this.updateHandler_),this.track_=null),this.track_=e,this.track_&&(this.track_.mode="hidden",(e=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_))&&e.addEventListener("load",this.updateHandler_)))},n.findChaptersTrack=function(){for(var e=this.player_.textTracks()||[],t=e.length-1;0<=t;t--){var i=e[t];if(i.kind===this.kind_)return i}},n.getMenuCaption=function(){return this.track_&&this.track_.label?this.track_.label:this.localize(ht(this.kind_))},n.createMenu=function(){return this.options_.title=this.getMenuCaption(),e.prototype.createMenu.call(this)},n.createItems=function(){var e=[];if(!this.track_)return e;var t=this.track_.cues;if(!t)return e;for(var i=0,n=t.length;i<n;i++){var r=t[i];r=new Vi(this.player_,{track:this.track_,cue:r}),e.push(r)}return e},t}(qt),P.prototype.kind_="chapters",P.prototype.controlText_="Chapters",gt.registerComponent("ChaptersButton",P),Vt=function(a){function e(e,t,i){i=a.call(this,e,t,i)||this;var n=e.textTracks(),r=Xe(yt(i),i.handleTracksChange);return n.addEventListener("change",r),i.on("dispose",(function(){n.removeEventListener("change",r)})),i}vt(e,a);var t=e.prototype;return t.handleTracksChange=function(e){for(var t=this.player().textTracks(),i=!1,n=0,r=t.length;n<r;n++){var a=t[n];if(a.kind!==this.kind_&&"showing"===a.mode){i=!0;break}}i?this.disable():this.enable()},t.buildCSSClass=function(){return"vjs-descriptions-button "+a.prototype.buildCSSClass.call(this)},t.buildWrapperCSSClass=function(){return"vjs-descriptions-button "+a.prototype.buildWrapperCSSClass.call(this)},e}(qt),Vt.prototype.kind_="descriptions",Vt.prototype.controlText_="Descriptions",gt.registerComponent("DescriptionsButton",Vt),e=function(e){function t(t,n,i){return e.call(this,t,n,i)||this}vt(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-subtitles-button "+e.prototype.buildCSSClass.call(this)},n.buildWrapperCSSClass=function(){return"vjs-subtitles-button "+e.prototype.buildWrapperCSSClass.call(this)},t}(qt),e.prototype.kind_="subtitles",e.prototype.controlText_="Subtitles",gt.registerComponent("SubtitlesButton",e);var Wi=function(i){function e(e,t){return t.track={player:e,kind:t.kind,label:t.kind+" settings",selectable:!1,default:!1,mode:"disabled"},t.selectable=!1,t.name="CaptionSettingsMenuItem",(e=i.call(this,e,t)||this).addClass("vjs-texttrack-settings"),e.controlText(", opens "+t.kind+" settings dialog"),e}return vt(e,i),e.prototype.handleClick=function(e){this.player().getChild("textTrackSettings").open()},e}(Hi);gt.registerComponent("CaptionSettingsMenuItem",Wi),s=function(e){function t(t,n,i){return e.call(this,t,n,i)||this}vt(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-captions-button "+e.prototype.buildCSSClass.call(this)},n.buildWrapperCSSClass=function(){return"vjs-captions-button "+e.prototype.buildWrapperCSSClass.call(this)},n.createItems=function(){var t=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(t.push(new Wi(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),e.prototype.createItems.call(this,t)},t}(qt),s.prototype.kind_="captions",s.prototype.controlText_="Captions",gt.registerComponent("CaptionsButton",s);var zi=function(e){function t(){return e.apply(this,arguments)||this}return vt(t,e),t.prototype.createEl=function(t,n,i){return i=(n=e.prototype.createEl.call(this,t,n,i)).querySelector(".vjs-menu-item-text"),"captions"===this.options_.track.kind&&(i.appendChild(te("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),i.appendChild(te("span",{className:"vjs-control-text",textContent:" "+this.localize("Captions")}))),n},t}(Hi);gt.registerComponent("SubsCapsMenuItem",zi),L=function(i){function e(e,t){return(t=i.call(this,e,t=void 0===t?{}:t)||this).label_="subtitles",-1<["en","en-us","en-ca","fr-ca"].indexOf(t.player_.language_)&&(t.label_="captions"),t.menuButton_.controlText(ht(t.label_)),t}vt(e,i);var t=e.prototype;return t.buildCSSClass=function(){return"vjs-subs-caps-button "+i.prototype.buildCSSClass.call(this)},t.buildWrapperCSSClass=function(){return"vjs-subs-caps-button "+i.prototype.buildWrapperCSSClass.call(this)},t.createItems=function(){var e=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(e.push(new Wi(this.player_,{kind:this.label_})),this.hideThreshold_+=1),i.prototype.createItems.call(this,e,zi)},e}(qt),L.prototype.kinds_=["captions","subtitles"],L.prototype.controlText_="Subtitles",gt.registerComponent("SubsCapsButton",L);var Gi=function(s){function e(e,t){var n,i=t.track,r=e.audioTracks();function a(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];n.handleTracksChange.apply(yt(n),t)}return t.label=i.label||i.language||"Unknown",t.selected=i.enabled,(n=s.call(this,e,t)||this).track=i,n.addClass("vjs-"+i.kind+"-menu-item"),r.addEventListener("change",a),n.on("dispose",(function(){r.removeEventListener("change",a)})),n}vt(e,s);var t=e.prototype;return t.createEl=function(e,t,i){return i=(t=s.prototype.createEl.call(this,e,t,i)).querySelector(".vjs-menu-item-text"),"main-desc"===this.options_.track.kind&&(i.appendChild(s.prototype.createEl.call(this,"span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),i.appendChild(s.prototype.createEl.call(this,"span",{className:"vjs-control-text",textContent:this.localize("Descriptions")}))),t},t.handleClick=function(e){s.prototype.handleClick.call(this,e),this.track.enabled=!0},t.handleTracksChange=function(e){this.selected(this.track.enabled)},e}(Yt);gt.registerComponent("AudioTrackMenuItem",Gi),D=function(i){function e(e,t){return(t=void 0===t?{}:t).tracks=e.audioTracks(),i.call(this,e,t)||this}vt(e,i);var t=e.prototype;return t.buildCSSClass=function(){return"vjs-audio-button "+i.prototype.buildCSSClass.call(this)},t.buildWrapperCSSClass=function(){return"vjs-audio-button "+i.prototype.buildWrapperCSSClass.call(this)},t.createItems=function(e){void 0===e&&(e=[]),this.hideThreshold_=1;for(var t=this.player_.audioTracks(),i=0;i<t.length;i++){var n=t[i];e.push(new Gi(this.player_,{track:n,selectable:!0,multiSelectable:!1}))}return e},e}(Oi),D.prototype.controlText_="Audio Track",gt.registerComponent("AudioTrackButton",D);var Xi=function(a){function e(e,t){var i,n=t.rate,r=parseFloat(n,10);return t.label=n,t.selected=r===e.playbackRate(),t.selectable=!0,t.multiSelectable=!1,(i=a.call(this,e,t)||this).label=n,i.rate=r,i.on(e,"ratechange",(function(e){return i.update(e)})),i}vt(e,a);var t=e.prototype;return t.handleClick=function(e){a.prototype.handleClick.call(this),this.player().playbackRate(this.rate)},t.update=function(e){this.selected(this.player().playbackRate()===this.rate)},e}(Yt);Xi.prototype.contentElType="button",gt.registerComponent("PlaybackRateMenuItem",Xi),H=function(e){function t(t,n){var i=e.call(this,t,n)||this;return i.menuButton_.el_.setAttribute("aria-describedby",i.labelElId_),i.updateVisibility(),i.updateLabel(),i.on(t,"loadstart",(function(e){return i.updateVisibility(e)})),i.on(t,"ratechange",(function(e){return i.updateLabel(e)}
2)),i.on(t,"playbackrateschange",(function(e){return i.handlePlaybackRateschange(e)})),i}vt(t,e);var n=t.prototype;return n.createEl=function(){var t=e.prototype.createEl.call(this);return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=te("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"}),t.appendChild(this.labelEl_),t},n.dispose=function(){this.labelEl_=null,e.prototype.dispose.call(this)},n.buildCSSClass=function(){return"vjs-playback-rate "+e.prototype.buildCSSClass.call(this)},n.buildWrapperCSSClass=function(){return"vjs-playback-rate "+e.prototype.buildWrapperCSSClass.call(this)},n.createItems=function(){for(var e=this.playbackRates(),t=[],i=e.length-1;0<=i;i--)t.push(new Xi(this.player(),{rate:e[i]+"x"}));return t},n.updateARIAAttributes=function(){this.el().setAttribute("aria-valuenow",this.player().playbackRate())},n.handleClick=function(e){for(var t=this.player().playbackRate(),i=this.playbackRates(),n=i[0],r=0;r<i.length;r++)if(i[r]>t){n=i[r];break}this.player().playbackRate(n)},n.handlePlaybackRateschange=function(e){this.update()},n.playbackRates=function(){var e=this.player();return e.playbackRates&&e.playbackRates()||[]},n.playbackRateSupported=function(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&0<this.playbackRates().length},n.updateVisibility=function(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")},n.updateLabel=function(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")},t}(W),H.prototype.controlText_="Playback Rate",gt.registerComponent("PlaybackRateMenuButton",H),P=function(e){function t(){return e.apply(this,arguments)||this}vt(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-spacer "+e.prototype.buildCSSClass.call(this)},n.createEl=function(t,n,i){return void 0===t&&(t="div"),void 0===i&&(i={}),(n=void 0===n?{}:n).className||(n.className=this.buildCSSClass()),e.prototype.createEl.call(this,t,n,i)},t}(gt),gt.registerComponent("Spacer",P),gt.registerComponent("CustomControlSpacer",function(e){function t(){return e.apply(this,arguments)||this}vt(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-custom-control-spacer "+e.prototype.buildCSSClass.call(this)},i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),textContent:"Â "})},t}(P)),Vt=function(e){function t(){return e.apply(this,arguments)||this}return vt(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-control-bar",dir:"ltr"})},t}(gt),Vt.prototype.options_={children:["playToggle","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","fullscreenToggle"]},"exitPictureInPicture"in d&&Vt.prototype.options_.children.splice(Vt.prototype.options_.children.length-1,0,"pictureInPictureToggle"),gt.registerComponent("ControlBar",Vt),e=function(e){function t(t,n){var i=e.call(this,t,n)||this;return i.on(t,"error",(function(e){return i.open(e)})),i}vt(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-error-display "+e.prototype.buildCSSClass.call(this)},n.content=function(){var e=this.player().error();return e?this.localize(e.message):""},t}(Ot),e.prototype.options_=b({},Ot.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),gt.registerComponent("ErrorDisplay",e);var Ki="vjs-text-track-settings",Yi={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[s=["#000","Black"],W=["#FFF","White"],Yt=["#F00","Red"],Oi=["#0F0","Green"],qt=["#00F","Blue"],H=["#FF0","Yellow"],D=["#F0F","Magenta"],L=["#0FF","Cyan"]]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Transparency",options:[P=["1","Opaque"],Vt=["0.5","Semi-Transparent"],e=["0","Transparent"]]},color:{selector:".vjs-fg-color > select",id:"captions-foreground-color-%s",label:"Color",options:[W,s,Yt,Oi,qt,H,D,L]},edgeStyle:{selector:".vjs-edge-style > select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Dropshadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"captions-font-family-%s",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"captions-font-size-%s",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:function(e){return"1.00"===e?null:Number(e)}},textOpacity:{selector:".vjs-text-opacity >
2 select",id:"captions-foreground-opacity-%s",label:"Transparency",options:[P,Vt]},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:[e,Vt,P]}};function Qi(e,t){if((e=t?t(e):e)&&"none"!==e)return e}Yi.windowColor.options=Yi.backgroundColor.options,gt.registerComponent("TextTrackSettings",function(e){function t(t,n){var i;return n.temporary=!1,(i=e.call(this,t,n)||this).updateDisplay=i.updateDisplay.bind(yt(i)),i.fill(),i.hasBeenOpened_=i.hasBeenFilled_=!0,i.endDialog=te("p",{className:"vjs-control-text",textContent:i.localize("End of dialog window.")}),i.el().appendChild(i.endDialog),i.setDefaults(),void 0===n.persistTextTrackSettings&&(i.options_.persistTextTrackSettings=i.options_.playerOptions.persistTextTrackSettings),i.on(i.$(".vjs-done-button"),"click",(function(){i.saveSettings(),i.close()})),i.on(i.$(".vjs-default-button"),"click",(function(){i.setDefaults(),i.updateDisplay()})),k(Yi,(function(e){i.on(i.$(e.selector),"change",i.updateDisplay)})),i.options_.persistTextTrackSettings&&i.restoreSettings(),i}vt(t,e);var n=t.prototype;return n.dispose=function(){this.endDialog=null,e.prototype.dispose.call(this)},n.createElSelect_=function(e,t,i){var n=this;void 0===t&&(t=""),void 0===i&&(i="label");var r=(e=Yi[e]).id.replace("%s",this.id_),a=[t,r].join(" ").trim();return["<"+i+' id="'+r+'" class="'+("label"===i?"vjs-label":"")+'">',this.localize(e.label),"</"+i+">",'<select aria-labelledby="'+a+'">'].concat(e.options.map((function(e){var t=r+"-"+e[1].replace(/\W+/g,"");return['<option id="'+t+'" value="'+e[0]+'" ','aria-labelledby="'+a+" "+t+'">',n.localize(e[1]),"</option>"].join("")}))).concat("</select>").join("")},n.createElFgColor_=function(){var e="captions-text-legend-"+this.id_;return['<fieldset class="vjs-fg-color vjs-track-setting">','<legend id="'+e+'">',this.localize("Text"),"</legend>",this.createElSelect_("color",e),'<span class="vjs-text-opacity vjs-opacity">',this.createElSelect_("textOpacity",e),"</span>","</fieldset>"].join("")},n.createElBgColor_=function(){var e="captions-background-"+this.id_;return['<fieldset class="vjs-bg-color vjs-track-setting">','<legend id="'+e+'">',this.localize("Background"),"</legend>",this.createElSelect_("backgroundColor",e),'<span class="vjs-bg-opacity vjs-opacity">',this.createElSelect_("backgroundOpacity",e),"</span>","</fieldset>"].join("")},n.createElWinColor_=function(){var e="captions-window-"+this.id_;return['<fieldset class="vjs-window-color vjs-track-setting">','<legend id="'+e+'">',this.localize("Window"),"</legend>",this.createElSelect_("windowColor",e),'<span class="vjs-window-opacity vjs-opacity">',this.createElSelect_("windowOpacity",e),"</span>","</fieldset>"].join("")},n.createElColors_=function(){return te("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})},n.createElFont_=function(){return te("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("")})},n.createElControls_=function(){var e=this.localize("restore all settings to the default values");return te("div",{className:"vjs-track-settings-controls",innerHTML:['<button type="button" class="vjs-default-button" title="'+e+'">',this.localize("Reset"),'<span class="vjs-control-text"> '+e+"</span>","</button>",'<button type="button" class="vjs-done-button">'+this.localize("Done")+"</button>"].join("")})},n.content=function(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]},n.label=function(){return this.localize("Caption Settings Dialog")},n.description=function(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")},n.buildCSSClass=function(){return e.prototype.buildCSSClass.call(this)+" vjs-text-track-settings"},n.getValues=function(){var i,e,t,n=this;return e=function(e,t,i){var r;
2return void 0!==(r=n.$(t.selector),t=t.parser,t=Qi(r.options[r.options.selectedIndex].value,t))&&(e[i]=t),e},void 0===(t={})&&(t=0),E(i=Yi).reduce((function(t,n){return e(t,i[n],n)}),t)},n.setValues=function(i){var e=this;k(Yi,(function(t,n){!function(e,t,i){if(t)for(var n=0;n<e.options.length;n++)if(Qi(e.options[n].value,i)===t){e.selectedIndex=n;break}}(e.$(t.selector),i[n],t.parser)}))},n.setDefaults=function(){var i=this;k(Yi,(function(e){var t=e.hasOwnProperty("default")?e.default:0;i.$(e.selector).selectedIndex=t}))},n.restoreSettings=function(){var e;try{e=JSON.parse(o.localStorage.getItem(Ki))}catch(e){_.warn(e)}e&&this.setValues(e)},n.saveSettings=function(){if(this.options_.persistTextTrackSettings){var e=this.getValues();try{Object.keys(e).length?o.localStorage.setItem(Ki,JSON.stringify(e)):o.localStorage.removeItem(Ki)}catch(e){_.warn(e)}}},n.updateDisplay=function(){var e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()},n.conditionalBlur_=function(){this.previouslyActiveEl_=null;var e=(t=this.player_.controlBar)&&t.subsCapsButton,t=t&&t.captionsButton;e?e.focus():t&&t.focus()},t}(Ot)),gt.registerComponent("ResizeManager",function(a){function e(e,t){var i,n=t.ResizeObserver||o.ResizeObserver,r=pt({createEl:!(n=null!==t.ResizeObserver&&n),reportTouchActivity:!1},t);return(i=a.call(this,e,r)||this).ResizeObserver=t.ResizeObserver||o.ResizeObserver,i.loadListener_=null,i.resizeObserver_=null,i.debouncedHandler_=Ye((function(){i.resizeHandler()}),100,!1,yt(i)),n?(i.resizeObserver_=new i.ResizeObserver(i.debouncedHandler_),i.resizeObserver_.observe(e.el())):(i.loadListener_=function(){var e,t;i.el_&&i.el_.contentWindow&&(e=i.debouncedHandler_,t=i.unloadListener_=function(){Ve(this,"resize",e),Ve(this,"unload",t),t=null},qe(i.el_.contentWindow,"unload",t),qe(i.el_.contentWindow,"resize",e))},i.one("load",i.loadListener_)),i}vt(e,a);var t=e.prototype;return t.createEl=function(){return a.prototype.createEl.call(this,"iframe",{className:"vjs-resize-manager",tabIndex:-1},{"aria-hidden":"true"})},t.resizeHandler=function(){this.player_&&this.player_.trigger&&this.player_.trigger("playerresize")},t.dispose=function(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.loadListener_&&this.off("load",this.loadListener_),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,a.prototype.dispose.call(this)},e}(gt));var $i={trackingThreshold:30,liveTolerance:15};function Ji(e){if((n=e.el()).hasAttribute("src"))return e.triggerSourceset(n.src),1;var t=e.$$("source"),i=[],n="";if(t.length){for(var r=0;r<t.length;r++){var a=t[r].src;a&&-1===i.indexOf(a)&&i.push(a)}return!!i.length&&(1===i.length&&(n=i[0]),e.triggerSourceset(n),!0)}}function Zi(e,t){for(var i={},n=0;n<e.length&&!((i=Object.getOwnPropertyDescriptor(e[n],t))&&i.set&&i.get);n++);return i.enumerable=!0,i.configurable=!0,i}function en(a){var e,t,i,s=a.el();s.resetSourceWatch_||(e={},t=Zi([a.el(),o.HTMLMediaElement.prototype,o.Element.prototype,an],"innerHTML"),i=function(e){return function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];var r=e.apply(s,n);return Ji(a),r}},["append","appendChild","insertAdjacentHTML"].forEach((function(t){s[t]&&(e[t]=s[t],s[t]=i(e[t]))})),Object.defineProperty(s,"innerHTML",pt(t,{set:i(t.set)})),s.resetSourceWatch_=function(){s.resetSourceWatch_=null,Object.keys(e).forEach((function(t){s[t]=e[t]})),Object.defineProperty(s,"innerHTML",t)},a.one("sourceset",s.resetSourceWatch_))}function tn(i){var e,t,n,a;i.featuresSourceset&&((e=i.el()).resetSourceset_||(t=Zi([i.el(),o.HTMLMediaElement.prototype,sn],"src"),n=e.setAttribute,a=e.load,Object.defineProperty(e,"src",pt(t,{set:function(n){return n=t.set.call(e,n),i.triggerSourceset(e.src),n}})),e.setAttribute=function(t,r){return r=n.call(e,t,r),/src/i.test(t)&&i.triggerSourceset(e.src),r},e.load=function(){var t=a.call(e);return Ji(i)||(i.triggerSourceset(""),en(i)),t},e.currentSrc?i.triggerSourceset(e.currentSrc):Ji(i)||en(i),e.resetSourceset_=function(){e.resetSourceset_=null,e.load=a,e.setAttribute=n,Object.defineProperty(e,"src",t),e.resetSourceWatch_&&e.resetSourceWatch_()}))}function nn(e,i,t,n){function r(t){return Object.defineProperty(e,i,{value:t,enumerable:!0,writable:!0})}var a={configurable:!0,enumerable:!0,get:function(){var e=t();return r(e),e}};return(n=void 0===n||n)&&(a.set=r),Object.defineProperty(e,i,a)}gt.registerComponent("LiveTracker",function(e){function t(t,n){n=pt($i,n,{createEl:!1});var i=e.call(this,t,n)||this;return i.handleVisibilityChange_=function(e){return i.handleVisibilityChange(e)},i.trackLiveHandler_=function(){return i.trackLive_()},i.handlePlay_=function(e){return i.handlePlay(e)},i.handleFirstTimeupdate_=function(e){return i.handleFirstTimeupdate(e)},i.handleSeeked_=function(e){return i.handleSeeked(e)},i.seekToLiveEdge_=function(e){return i.seekToLiveEdge(e)},i.reset_(),i.on(i.player_,"durationchange",(function(e){return i.handleDurationchange(e)}
2)),i.one(i.player_,"canplay",(function(){return i.toggleTracking()})),j&&"hidden"in d&&"visibilityState"in d&&i.on(d,"visibilitychange",i.handleVisibilityChange_),i}vt(t,e);var n=t.prototype;return n.handleVisibilityChange=function(){this.player_.duration()===1/0&&(d.hidden?this.stopTracking():this.startTracking())},n.trackLive_=function(){var e,t=this.player_.seekable();t&&t.length&&(e=Number(o.performance.now().toFixed(4)),t=-1===this.lastTime_?0:(e-this.lastTime_)/1e3,this.lastTime_=e,this.pastSeekEnd_=this.pastSeekEnd()+t,e=this.liveCurrentTime(),t=this.player_.currentTime(),t=this.player_.paused()||this.seekedBehindLive_||Math.abs(e-t)>this.options_.liveTolerance,(t=!(!this.timeupdateSeen_||e===1/0)&&t)!==this.behindLiveEdge_&&(this.behindLiveEdge_=t,this.trigger("liveedgechange")))},n.handleDurationchange=function(){this.toggleTracking()},n.toggleTracking=function(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())},n.startTracking=function(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,30),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)))},n.handleFirstTimeupdate=function(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)},n.handleSeeked=function(){var e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&2<e,this.nextSeekedFromUser_=!1,this.trackLive_()},n.handlePlay=function(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)},n.reset_=function(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)},n.nextSeekedFromUser=function(){this.nextSeekedFromUser_=!0},n.stopTracking=function(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))},n.seekableEnd=function(){for(var e=this.player_.seekable(),t=[],i=e?e.length:0;i--;)t.push(e.end(i));return t.length?t.sort()[t.length-1]:1/0},n.seekableStart=function(){for(var e=this.player_.seekable(),t=[],i=e?e.length:0;i--;)t.push(e.start(i));return t.length?t.sort()[0]:0},n.liveWindow=function(){var e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()},n.isLive=function(){return this.isTracking()},n.atLiveEdge=function(){return!this.behindLiveEdge()},n.liveCurrentTime=function(){return this.pastSeekEnd()+this.seekableEnd()},n.pastSeekEnd=function(){var e=this.seekableEnd();return-1!==this.lastSeekEnd_&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_},n.behindLiveEdge=function(){return this.behindLiveEdge_},n.isTracking=function(){return"number"==typeof this.trackingInterval_},n.seekToLiveEdge=function(){this.seekedBehindLive_=!1,this.atLiveEdge()||(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))},n.dispose=function(){this.off(d,"visibilitychange",this.handleVisibilityChange_),this.stopTracking(),e.prototype.dispose.call(this)},t}(gt));var rn,an=Object.defineProperty({},"innerHTML",{get:function(){return this.cloneNode(!0).innerHTML},set:function(e){var t=d.createElement(this.nodeName.toLowerCase());t.innerHTML=e;for(var i=d.createDocumentFragment();t.childNodes.length;)i.appendChild(t.childNodes[0]);return this.innerText="",o.Element.prototype.appendChild.call(this,i),this.innerHTML}}),sn=Object.defineProperty({},"src",{get:function(){return this.hasAttribute("src")?Ft(o.Element.prototype.getAttribute.call(this,"src")):""},set:function(e){return o.Element.prototype.setAttribute.call(this,"src",e),e}}),on=function(e){function s(t,n){var i=e.call(this,t,n)||this,r=!1;if((n=t.source)&&(i.el_.currentSrc!==n.src||t.tag&&3===t.tag.initNetworkState_)?i.setSource(n):i.handleLateInit_(i.el_),t.enableSourceset&&i.setupSourcesetHandling_(),i.isScrubbing_=!1,i.el_.hasChildNodes()){for(var o=i.el_.childNodes,a=o.length,s=[];a--;){var l=o[a];"track"===l.nodeName.toLowerCase()&&(i.featuresNativeTextTracks?(i.remoteTextTrackEls().addTrackElement_(l),i.remoteTextTracks().addTrack(l.track),i.textTracks().addTrack(l.track),r||i.el_.hasAttribute("crossorigin")||!Ht(l.src)||(r=!0)):s.push(l))}for(var u=0;u<s.length;u++)i.el_.removeChild(s[u])}return i.proxyNativeTracks_(),i.featuresNativeTextTracks&&r&&_.warn("Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\nThis may prevent text tracks from loading."),i.restoreMetadataTracksInIOSNativePlayer_(),(V||z||M)&&!0===t.nativeControlsForTouch&&i.setControls(!0),i.proxyWebkitFullscreen_(),i.triggerReady(),i}vt(s,e);var t=s.prototype;return t.dispose=function(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),s.disposeMediaElement(this.el_),this.options_=null,e.prototype.dispose.call(this)},t.setupSourcesetHandling_=function(){tn(this)},t.restoreMetadataTracksInIOSNativePlayer_=function(){function e(){i=[];for(var e=0;e<t.length;e++){var n=t[e];"metadata"===n.kind&&i.push({track:n,storedMode:n.mode})}}var i,t=this.textTracks();function n(){for(var e=0;e<i.length;e++){var r=i[e];"disabled"===r.track.mode&&r.track.mode!==r.storedMode&&(r.track.mode=r.storedMode)}t.removeEventListener("change",n)}e(),t.addEventListener("change",e),this.on("dispose",(function(){return t.removeEventListener("change",e)})),this.on("webkitbeginfullscreen",(function(){t.removeEventListener("change",e),t.removeEventListener("change",n),t.addEventListener("change",n)})),this.on("webkitendfullscreen",(function(){t.removeEventListener("change",e),t.addEventListener("change",e),t.removeEventListener("change",n)}))},t.overrideNative_=function(e,t){var i,n=this;t===this["featuresNative"+e+"Tracks"]&&(this[(i=e.toLowerCase())+"TracksListeners_"]&&Object.keys(this[i+"TracksListeners_"]).forEac
2h((function(e){n.el()[i+"Tracks"].removeEventListener(e,n[i+"TracksListeners_"][e])})),this["featuresNative"+e+"Tracks"]=!t,this[i+"TracksListeners_"]=null,this.proxyNativeTracksForType_(i))},t.overrideNativeAudioTracks=function(e){this.overrideNative_("Audio",e)},t.overrideNativeVideoTracks=function(e){this.overrideNative_("Video",e)},t.proxyNativeTracksForType_=function(i){var e,t,n=this,r=ci[i],a=this.el()[r.getterName],s=this[r.getterName]();this["featuresNative"+r.capitalName+"Tracks"]&&a&&a.addEventListener&&(t=function(){for(var e=[],t=0;t<s.length;t++){for(var i=!1,n=0;n<a.length;n++)if(a[n]===s[t]){i=!0;break}i||e.push(s[t])}for(;e.length;)s.removeTrack(e.shift())},this[r.getterName+"Listeners_"]=e={change:function(e){var t={type:"change",target:s,currentTarget:s,srcElement:s};s.trigger(t),"text"===i&&n[di.remoteText.getterName]().trigger(t)},addtrack:function(e){s.addTrack(e.track)},removetrack:function(e){s.removeTrack(e.track)}},Object.keys(e).forEach((function(t){var i=e[t];a.addEventListener(t,i),n.on("dispose",(function(e){return a.removeEventListener(t,i)}))})),this.on("loadstart",t),this.on("dispose",(function(e){return n.off("loadstart",t)})))},t.proxyNativeTracks_=function(){var e=this;ci.names.forEach((function(t){e.proxyNativeTracksForType_(t)}))},t.createEl=function(){var e,t=this.options_.tag;t&&(this.options_.playerElIngest||this.movingMediaElementInDOM)||(t?(e=t.cloneNode(!0),t.parentNode&&t.parentNode.insertBefore(e,t),s.disposeMediaElement(t),t=e):(t=d.createElement("video"),e=pt({},this.options_.tag&&le(this.options_.tag)),V&&!0===this.options_.nativeControlsForTouch||delete e.controls,ue(t,C(e,{id:this.options_.techId,class:"vjs-tech"}))),t.playerId=this.options_.playerId),void 0!==this.options_.preload&&de(t,"preload",this.options_.preload),void 0!==this.options_.disablePictureInPicture&&(t.disablePictureInPicture=this.options_.disablePictureInPicture);for(var i=["loop","muted","playsinline","autoplay"],n=0;n<i.length;n++){var r=i[n],a=this.options_[r];void 0!==a&&(a?de(t,r,r):he(t,r),t[r]=a)}return t},t.handleLateInit_=function(e){if(0!==e.networkState&&3!==e.networkState){if(0===e.readyState){var t=!1,i=function(){t=!0};this.on("loadstart",i);var n=function(){t||this.trigger("loadstart")};return this.on("loadedmetadata",n),void this.ready((function(){this.off("loadstart",i),this.off("loadedmetadata",n),t||this.trigger("loadstart")}))}var r=["loadstart"];r.push("loadedmetadata"),2<=e.readyState&&r.push("loadeddata"),3<=e.readyState&&r.push("canplay"),4<=e.readyState&&r.push("canplaythrough"),this.ready((function(){r.forEach((function(e){this.trigger(e)}),this)}))}},t.setScrubbing=function(e){this.isScrubbing_=e},t.scrubbing=function(){return this.isScrubbing_},t.setCurrentTime=function(e){try{this.isScrubbing_&&this.el_.fastSeek&&X?this.el_.fastSeek(e):this.el_.currentTime=e}catch(e){_(e,"Video is not ready. (Video.js)")}},t.duration=function(){var e=this;return this.el_.duration===1/0&&O&&B&&0===this.el_.currentTime?(this.on("timeupdate",(function t(){0<e.el_.currentTime&&(e.el_.duration===1/0&&e.trigger("durationchange"),e.off("timeupdate",t))})),NaN):this.el_.duration||NaN},t.width=function(){return this.el_.offsetWidth},t.height=function(){return this.el_.offsetHeight},t.proxyWebkitFullscreen_=function(){var e,t,i=this;"webkitDisplayingFullscreen"in this.el_&&(e=function(){this.trigger("fullscreenchange",{isFullscreen:!1})},t=function(){"webkitPresentationMode"in this.el_&&"picture-in-picture"!==this.el_.webkitPresentationMode&&(this.one("webkitendfullscreen",e),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))},this.on("webkitbeginfullscreen",t),this.on("dispose",(function(){i.off("webkitbeginfullscreen",t),i.off("webkitendfullscreen",e)})))},t.supportsFullScreen=function(){if("function"==typeof this.el_.webkitEnterFullScreen){var e=o.navigator&&o.navigator.userAgent||"";if(/Android/.test(e)||!/Chrome|Mac OS X 10.5/.test(e))return!0}return!1},t.enterFullScreen=function(){var e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)It(this.el_.play()),this.setTimeout((function(){e.pause();try{e.webkitEnterFullScreen()}catch(e){this.trigger("fullscreenerror",e)}}),0);else try{e.webkitEnterFullScreen()}catch(e){this.trigger("fullscreenerror",e)}},t.exitFullScreen=function(){this.el_.webkitDisplayingFullscreen?this.el_.webkitExitFullScreen():this.trigger("fullscreenerror",new Error("The video is not fullscreen"))},t.requestPictureInPicture=function(){return this.el_.requestPictureInPicture()},t.src=function(e){if(void 0===e)return this.el_.src;this.setSrc(e)},t.reset=function(){s.resetMediaElement(this.el_)},t.currentSrc=function(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc},t.setControls=function(e){this.el_.controls=!!e},t.addTextTrack=function(t,n,i){return this.featuresNativeTextTracks?this.el_.addTextTrack(t,n,i):e.prototype.addTextTrack.call(this,t,n,i)},t.createRemoteTextTrack=function(t){if(!this.featuresNativeTextTracks)return e.prototype.createRemoteTextTrack.call(this,t);var n=d.createElement("track");return t.kind&&(n.kind=t.kind),t.label&&(n.label=t.label),(t.language||t.srclang)&&(n.srclang=t.language||t.srclang),t.default&&(n.default=t.default),t.id&&(n.id=t.id),t.src&&(n.src=t.src),n},t.addRemoteTextTrack=function(t,n){return n=e.prototype.addRemoteTextTrack.call(this,t,n),this.featuresNativeTextTracks&&this.el().appendChild(n),n},t.removeRemoteTextTrack=function(t){if(e.prototype.removeRemoteTextTrack.call(this,t),this.featuresNativeTextTracks)for(var n=this.$$("track"),i=n.length;i--;)t!==n[i]&&t!==n[i].track||this.el().removeChild(n[i])},t.getVideoPlaybackQuality=function(){if("function"==typeof this.el().getVideoPlaybackQuality)return this.el().getVideoPlaybackQuality();var e={};return void 0!==this.el().webkitDroppedFrameCount&&void 0!==this.el().webkitDecodedFrameCount&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),o.performance&&"function"==typeof o.performance.now?e.creationTime=o.performance.now():o.performance&&o.performance.timing&&"number"==typeof o.performance.timing.navigationStart&&(e.creationTime=o.Date.now()-o.performance.timing.navigationStart),e},s}(pi);nn(on,"TEST_VID",(function(){if($()){var e=d.createElement("video"),t=d.createElement("track");return t.kind="captions",t.srclang="en",t.label="English",e.appendChild(t),e}}
vendor: 4,178 bytes, line 2
2)),on.isSupported=function(){try{on.TEST_VID.volume=.5}catch(e){return!1}return!(!on.TEST_VID||!on.TEST_VID.canPlayType)},on.canPlayType=function(e){return on.TEST_VID.canPlayType(e)},on.canPlaySource=function(e,t){return on.canPlayType(e.type)},on.canControlVolume=function(){try{var e=on.TEST_VID.volume;return on.TEST_VID.volume=e/2+.1,e!==on.TEST_VID.volume}catch(e){return!1}},on.canMuteVolume=function(){try{var e=on.TEST_VID.muted;return on.TEST_VID.muted=!e,on.TEST_VID.muted?de(on.TEST_VID,"muted","muted"):he(on.TEST_VID,"muted"),e!==on.TEST_VID.muted}catch(e){return!1}},on.canControlPlaybackRate=function(){if(O&&B&&F<58)return!1;try{var e=on.TEST_VID.playbackRate;return on.TEST_VID.playbackRate=e/2+.1,e!==on.TEST_VID.playbackRate}catch(e){return!1}},on.canOverrideAttributes=function(){try{var e=function(){};Object.defineProperty(d.createElement("video"),"src",{get:e,set:e}),Object.defineProperty(d.createElement("audio"),"src",{get:e,set:e}),Object.defineProperty(d.createElement("video"),"innerHTML",{get:e,set:e}),Object.defineProperty(d.createElement("audio"),"innerHTML",{get:e,set:e})}catch(e){return!1}return!0},on.supportsNativeTextTracks=function(){return X||G&&B},on.supportsNativeVideoTracks=function(){return!(!on.TEST_VID||!on.TEST_VID.videoTracks)},on.supportsNativeAudioTracks=function(){return!(!on.TEST_VID||!on.TEST_VID.audioTracks)},on.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],[["featuresVolumeControl","canControlVolume"],["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach((function(e){var t=e[0],i=e[1];nn(on.prototype,t,(function(){return on[i]()}),!0)})),on.prototype.movingMediaElementInDOM=!G,on.prototype.featuresFullscreenResize=!0,on.prototype.featuresProgressEvents=!0,on.prototype.featuresTimeupdateEvents=!0,on.patchCanPlayType=function(){4<=R&&!N&&!B&&(rn=on.TEST_VID&&on.TEST_VID.constructor.prototype.canPlayType,on.TEST_VID.constructor.prototype.canPlayType=function(e){return e&&/^application\/(?:x-|vnd\.apple\.)mpegurl/i.test(e)?"maybe":rn.call(this,e)})},on.unpatchCanPlayType=function(){var e=on.TEST_VID.constructor.prototype.canPlayType;return rn&&(on.TEST_VID.constructor.prototype.canPlayType=rn),e},on.patchCanPlayType(),on.disposeMediaElement=function(e){if(e){for(e.parentNode&&e.parentNode.removeChild(e);e.hasChildNodes();)e.removeChild(e.firstChild);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch(e){}}()}},on.resetMediaElement=function(e){if(e){for(var t=e.querySelectorAll("source"),i=t.length;i--;)e.removeChild(t[i]);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch(e){}}()}},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach((function(e){on.prototype[e]=function(){return this.el_[e]||this.el_.hasAttribute(e)}})),["muted","defaultMuted","autoplay","loop","playsinline"].forEach((function(e){on.prototype["set"+ht(e)]=function(t){(this.el_[e]=t)?this.el_.setAttribute(e,e):this.el_.removeAttribute(e)}})),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach((function(e){on.prototype[e]=function(){return this.el_[e]}})),["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach((function(e){on.prototype["set"+ht(e)]=function(t){this.el_[e]=t}})),["pause","load","play"].forEach((function(e){on.prototype[e]=function(){return this.el_[e]()}})),pi.withSourceHandlers(on),on.nativeSourceHandler={},on.nativeSourceHandler.canPlayType=function(e){try{return on.TEST_
2VID.canPlayType(e)}catch(e){return""}},on.nativeSourceHandler.canHandleSource=function(e,t){return e.type?on.nativeSourceHandler.canPlayType(e.type):e.src?(e=jt(e.src),on.nativeSourceHandler.canPlayType("video/"+e)):""},on.nativeSourceHandler.handleSource=function(e,t,i){t.setSrc(e.src)},on.nativeSourceHandler.dispose=function(){},on.registerSourceHandler(on.nativeSourceHandler),pi.registerTech("Html5",on);var un=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],ln={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},cn=["tiny","xsmall","small","medium","large","xlarge","huge"],dn={};cn.forEach((function(e){var t="x"===e.charAt(0)?"x-"+e.substring(1):e;dn[e]="vjs-layout-"+t}));var hn={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0},pn=function(e){function t(n,r,i){var o,l;if(n.id=n.id||r.id||"vjs_video_"+Re++,(r=C(t.getTagSettings(n),r)).initChildren=!1,r.createEl=!1,r.evented=!1,r.reportTouchActivity=!1,!r.language)if("function"==typeof n.closest){var a=n.closest("[lang]");a&&a.getAttribute&&(r.language=a.getAttribute("lang"))}else for(var s=n;s&&1===s.nodeType;){if(le(s).hasOwnProperty("lang")){r.language=s.getAttribute("lang");break}s=s.parentNode}if((o=e.call(this,null,r,i)||this).boundDocumentFullscreenChange_=function(e){return o.documentFullscreenChange_(e)},o.boundFullWindowOnEscKey_=function(e){return o.fullWindowOnEscKey(e)},o.boundUpdateStyleEl_=function(e){return o.updateStyleEl_(e)},o.boundApplyInitTime_=function(e){return o.applyInitTime_(e)},o.boundUpdateCurrentBreakpoint_=function(e){return o.updateCurrentBreakpoint_(e)},o.boundHandleTechClick_=function(e){return o.handleTechClick_(e)},o.boundHandleTechDoubleClick_=function(e){return o.handleTechDoubleClick_(e)},o.boundHandleTechTouchStart_=function(e){return o.handleTechTouchStart_(e)},o.boundHandleTechTouchMove_=function(e){return o.handleTechTouchMove_(e)},o.boundHandleTechTouchEnd_=function(e){return o.handleTechTouchEnd_(e)},o.boundHandleTechTap_=function(e){return o.handleTechTap_(e)},o.isFullscreen_=!1,o.log=T(o.id_),o.fsApi_=h,o.isPosterFromTech_=!1,o.queuedCallbacks_=[],o.isReady_=!1,o.hasStarted_=!1,o.userActive_=!1,o.debugEnabled_=!1,!o.options_||!o.options_.techOrder||!o.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");return o.tag=n,o.tagAttributes=n&&le(n),o.language(o.options_.language),r.languages?(l={},Object.getOwnPropertyNames(r.languages).forEach((function(e){l[e.toLowerCase()]=r.languages[e]})),o.languages_=l):o.languages_=t.prototype.options_.languages,o.resetCache_(),o.poster_=r.poster||"",o.controls_=!!r.controls,n.controls=!1,n.removeAttribute("controls"),o.changingSrc_=!1,o.playCallbacks_=[],o.playTerminatedQueue_=[],n.hasAttribute("autoplay")?o.autoplay(!0):o.autoplay(o.options_.autoplay),r.plugins&&Object.keys(r.plugins).forEach((function(e){if("function"!=typeof o[e])throw new Error('plugin "'+e+'" does not exist')})),o.scrubbing_=!1,o.el_=o.createEl(),ut(yt(o),{eventBusKey:"el_"}),o.fsApi_.requestFullscreen&&(qe(d,o.fsApi_.fullscreenchange,o.boundDocumentFullscreenChange_),o.on(o.fsApi_.fullscreenchange,o.boundDocumentFullscreenChange_)),o.fluid_&&o.on(["playerreset","resize"],o.boundUpdateStyleEl_),i=pt(o.options_),r.plugins&&Object.keys(r.plugins).forEach((function(e){o[e](r.plugins[e])})),r.debug&&o.debug(!0),o.options_.playerOptions=i,o.middleware_=[],o.playbackRates(r.playbackRates),o.initChildren(),o.isAudio("audio"===n.nodeName.toLowerCase()),o.controls()?o.addClass("vjs-controls-enabled"):o.addClass("vjs-controls-disabled"),o.el_.setAttribute("role","region"),o.isAudio()?o.el_.setAttribute("aria-label",o.localize("Audio Player")):o.el_.setAttribute("aria-label",o.localize("Video Player")),o.isAudio()&&o.addClass("vjs-audio"),o.flexNotSupported_()&&o.addClass("vjs-no-flex"),V&&o.addClass("vjs-touch-enabled"),G||o.addClass("vjs-workinghover"),t.players[o.id_]=yt(o),n=u.split(".")[0],o.addClass("vjs-v"+n),o.userActive(!0),o.reportUserActivity(),o.one("play",(function(e){return o.listenForUserActivity_(e)})),o.on("stageclick",(function(e){return o.handleStageClick_(e)})),o.on("keydown",(function(e){return o.handleKeyDown(e)})),o.on("languagechange",(function(e){return o.handleLanguagechange(e)}
2)),o.breakpoints(o.options_.breakpoints),o.responsive(o.options_.responsive),o}vt(t,e);var n=t.prototype;return n.dispose=function(){var n=this;this.trigger("dispose"),this.off("dispose"),Ve(d,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),Ve(d,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),t.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),mi[this.id()]=null,li.names.forEach((function(e){e=li[e],(e=n[e.getterName]())&&e.off&&e.off()})),e.prototype.dispose.call(this)},n.createEl=function(){var t,i=this.tag,n=this.playerElIngest_=i.parentNode&&i.parentNode.hasAttribute&&i.parentNode.hasAttribute("data-vjs-player"),r="video-js"===this.tag.tagName.toLowerCase();n?t=this.el_=i.parentNode:r||(t=this.el_=e.prototype.createEl.call(this,"div"));var l,a,s=le(i);if(r){for(t=this.el_=i,i=this.tag=d.createElement("video");t.children.length;)i.appendChild(t.firstChild);re(t,"video-js")||ae(t,"video-js"),t.appendChild(i),n=this.playerElIngest_=t,Object.keys(t).forEach((function(e){try{i[e]=t[e]}catch(e){}}))}i.setAttribute("tabindex","-1"),s.tabindex="-1",(j||B&&q)&&(i.setAttribute("role","application"),s.role="application"),i.removeAttribute("width"),i.removeAttribute("height"),"width"in s&&delete s.width,"height"in s&&delete s.height,Object.getOwnPropertyNames(s).forEach((function(e){r&&"class"===e||t.setAttribute(e,s[e]),r&&i.setAttribute(e,s[e])})),i.playerId=i.id,i.id+="_html5_api",i.className="vjs-tech",(i.player=t.player=this).addClass("vjs-paused"),!0!==o.VIDEOJS_NO_DYNAMIC_STYLE&&(this.styleEl_=De("vjs-styles-dimensions"),l=Ce(".vjs-styles-defaults"),(a=Ce("head")).insertBefore(this.styleEl_,l?l.nextSibling:a.firstChild)),this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);for(var c=i.getElementsByTagName("a"),u=0;u<c.length;u++){var h=c.item(u);ae(h,"vjs-hidden"),h.setAttribute("hidden","hidden")}return i.initNetworkState_=i.networkState,i.parentNode&&!n&&i.parentNode.insertBefore(t,i),ne(i,t),this.children_.unshift(i),this.el_.setAttribute("lang",this.language_),this.el_=t},n.crossOrigin=function(e){if(!e)return this.techGet_("crossOrigin");"anonymous"===e||"use-credentials"===e?this.techCall_("setCrossOrigin",e):_.warn('crossOrigin must be "anonymous" or "use-credentials", given "'+e+'"')},n.width=function(e){return this.dimension("width",e)},n.height=function(e){return this.dimension("height",e)},n.dimension=function(e,t){var i=e+"_";if(void 0===t)return this[i]||0;if(""===t||"auto"===t)return this[i]=void 0,void this.updateStyleEl_();var n=parseFloat(t);isNaN(n)?_.error('Improper value "'+t+'" supplied for for '+e):(this[i]=n,this.updateStyleEl_())},n.fluid=function(e){var t,i=this;if(void 0===e)return!!this.fluid_;this.fluid_=!!e,st(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),t=function(){i.on(["playerreset","resize"],i.boundUpdateStyleEl_)},st(e=this)?t():(e.eventedCallbacks||(e.eventedCallbacks=[]),e.eventedCallbacks.push(t))):this.removeClass("vjs-fluid"),this.updateStyleEl_()},n.fill=function(e){if(void 0===e)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")},n.aspectRatio=function(e){if(void 0===e)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(e))throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=e,this.fluid(!0),this.updateStyleEl_()},n.updateStyleEl_=function(){var e,t,i,n;!0!==o.VIDEOJS_NO_DYNAMIC_STYLE?(n=(i=(void 0!==this.aspectRatio_&&"auto"!==this.aspectRatio_?this.aspectRatio_:0<this.videoWidth()?this.videoWidth()+":"+this.videoHeight():"16:9").split(":"))[1]/i[0],e=void 0!==this.width_?this.width_:void 0!==this.height_?this.height_/n:this.videoWidth()||300,t=void 0!==this.height_?this.height_:e*n,i=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(i),Oe
2(this.styleEl_,"\n ."+i+" {\n width: "+e+"px;\n height: "+t+"px;\n }\n\n ."+i+".vjs-fluid {\n padding-top: "+100*n+"%;\n }\n ")):(t="number"==typeof this.width_?this.width_:this.options_.width,i="number"==typeof this.height_?this.height_:this.options_.height,(n=this.tech_&&this.tech_.el())&&(0<=t&&(n.width=t),0<=i&&(n.height=i)))},n.loadTech_=function(e,t){var i=this;this.tech_&&this.unloadTech_();var n=ht(e),r=e.charAt(0).toLowerCase()+e.slice(1);"Html5"!==n&&this.tag&&(pi.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=n,this.isReady_=!1;var a=this.autoplay(),s={source:t,autoplay:a=!("string"==typeof this.autoplay()||!0===this.autoplay()&&this.options_.normalizeAutoplay)&&a,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:this.id()+"_"+r+"_api",playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset,Promise:this.options_.Promise};if(li.names.forEach((function(e){e=li[e],s[e.getterName]=i[e.privateName]})),C(s,this.options_[n]),C(s,this.options_[r]),C(s,this.options_[e.toLowerCase()]),this.tag&&(s.tag=this.tag),t&&t.src===this.cache_.src&&0<this.cache_.currentTime&&(s.startTime=this.cache_.currentTime),!(e=pi.getTech(e)))throw new Error("No Tech named '"+n+"' exists! '"+n+"' should be registered using videojs.registerTech()'");this.tech_=new e(s),this.tech_.ready(Xe(this,this.handleTechReady_),!0),Pt(this.textTracksJson_||[],this.tech_),un.forEac
2h((function(e){i.on(i.tech_,e,(function(t){return i["handleTech"+ht(e)+"_"](t)}))})),Object.keys(ln).forEach((function(e){i.on(i.tech_,e,(function(t){0===i.tech_.playbackRate()&&i.tech_.seeking()?i.queuedCallbacks_.push({callback:i["handleTech"+ln[e]+"_"].bind(i),event:t}):i["handleTech"+ln[e]+"_"](t)}))})),this.on(this.tech_,"loadstart",(function(e){return i.handleTechLoadStart_(e)})),this.on(this.tech_,"sourceset",(function(e){return i.handleTechSourceset_(e)})),this.on(this.tech_,"waiting",(function(e){return i.handleTechWaiting_(e)})),this.on(this.tech_,"ended",(function(e){return i.handleTechEnded_(e)})),this.on(this.tech_,"seeking",(function(e){return i.handleTechSeeking_(e)})),this.on(this.tech_,"play",(function(e){return i.handleTechPlay_(e)})),this.on(this.tech_,"firstplay",(function(e){return i.handleTechFirstPlay_(e)})),this.on(this.tech_,"pause",(function(e){return i.handleTechPause_(e)})),this.on(this.tech_,"durationchange",(function(e){return i.handleTechDurationChange_(e)})),this.on(this.tech_,"fullscreenchange",(function(e,t){return i.handleTechFullscreenChange_(e,t)})),this.on(this.tech_,"fullscreenerror",(function(e,t){return i.handleTechFullscreenError_(e,t)})),this.on(this.tech_,"enterpictureinpicture",(function(e){return i.handleTechEnterPictureInPicture_(e)})),this.on(this.tech_,"leavepictureinpicture",(function(e){return i.handleTechLeavePictureInPicture_(e)})),this.on(this.tech_,"error",(function(e){return i.handleTechError_(e)})),this.on(this.tech_,"posterchange",(function(e){return i.handleTechPosterChange_(e)})),this.on(this.tech_,"textdata",(function(e){return i.handleTechTextData_(e)})),this.on(this.tech_,"ratechange",(function(e){return i.handleTechRateChange_(e)})),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode===this.el()||"Html5"===n&&this.tag||ne(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)},n.unloadTech_=function(){var e=this;li.names.forEach((function(t){t=li[t],e[t.privateName]=e[t.getterName]()})),this.textTracksJson_=xt(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1},n.tech=function(e){return void 0===e&&_.warn("Using the tech directly can be dangerous. I hope you know
2what you're doing.\nSee https://github.com/videojs/video.js/issues/2617 for more info.\n"),this.tech_},n.addTechControlsListeners_=function(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)},n.removeTechControlsListeners_=function(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)},n.handleTechReady_=function(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()},n.handleTechLoadStart_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):(this.trigger("loadstart"),this.trigger("firstplay")),this.manualAutoplay_(!0===this.autoplay()&&this.options_.normalizeAutoplay?"play":this.autoplay())},n.manualAutoplay_=function(e){var t=this;if(this.tech_&&"string"==typeof e){var n,i=function(){var e=t.muted();function n(){t.muted(e)}t.muted(!0),t.playTerminatedQueue_.push(n);var i=t.play();if(wt(i))return i.catch((function(e){throw n(),new Error("Rejection at manualAutoplay. Restoring muted value. "+(e||""))}))};if("any"!==e||this.muted()?n="muted"!==e||this.muted()?this.play():i():wt(n=this.play())&&(n=n.catch(i)),wt(n))return n.then((function(){t.trigger({type:"autoplay-success",autoplay:e})})).catch((function(){t.trigger({type:"autoplay-failure",autoplay:e})}))}},n.updateSourceCaches_=function(e){var t=e=void 0===e?"":e,i="";"string"!=typeof t&&(t=e.src,i=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!i&&(i=function(e,t){if(!t)return"";if(e.cache_.source.src===t&&e.cache_.source.type)return e.cache_.source.type;var i=e.cache_.sources.filter((function(e){return e.src===t}));if(i.length)return i[0].type;for(var n=e.$$("source"),r=0;r<n.length;r++){var a=n[r];if(a.type&&a.src&&a.src===t)return a.type}return ki(t)}(this,t)),this.cache_.source=pt({},e,{src:t,type:i}),i=this.cache_.sources.filter((function(e){return e.src&&e.src===t}));for(var n=[],r=this.$$("source"),a=[],s=0;s<r.length;s++){var o=le(r[s]);n.push(o),o.src&&o.src===t&&a.push(o.src)}a.length&&!i.length?this.cache_.sources=n:i.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=t},n.handleTechSourceset_=function(e){var t,i,n,r=this;this.changingSrc_||(t=function(e){return r.updateSourceCaches_(e)},i=this.currentSource().src,n=e.src,i&&!/^blob:/.test(i)&&/^blob:/.test(n)&&(this.lastSource_&&(this.lastSource_.tech===n||this.lastSource_.player===i)||(t=function(){})),t(n),e.src||this.tech_.any(["sourceset","loadstart"],(function(e){"sourceset"!==e.type&&(e=r.techGet("currentSrc"),r.lastSource_.tech=e,r.updateSourceCaches_(e))}))),this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})},n.hasStarted=function(e){if(void 0===e)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?(this.addClass("vjs-has-started"),this.trigger("firstplay")):this.removeClass("vjs-has-started"))},n.handleTechPlay_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")},n.handleTechRateChange_=function(){0<this.tech_.playbackRate()&&0===this.cache_.lastPlaybackRate&&(this.queuedCallbacks_.forEach((function(e){return e.callback(e.event)})),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")},n.handleTechWaiting_=function(){var e=this;this.addClass("vjs-waiting"),this.trigger("waiting");var i=this.currentTime();this.on("timeupdate",(function t(){i!==e.currentTime()&&(e.removeClass("vjs-waiting"),e.off("timeupdate",t))}))},n.handleTechCanPlay_=function(){this.removeClass("vjs-waiting"),this.trigger("canplay")},n.handleTechCanPlayThrough_=function(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")},n.handleTechPlaying_=function(){this.removeClass("vjs-waiting"),this.trigger("playing")},n.handleTechSeeking_=function(){this.addClass("vjs-seeking"),this.trigger("seeking")},n.handleTechSeeked_=function(){this.removeClass("vjs-seeking"),this.removeClass("vjs-ended"),this.trigger("seeked")},n.handleTechFirstPlay_=function(){this.options_.starttime&&(_.warn("Passing the `starttime` option to the player will be deprecated
2in 6.0"),this.currentTime(this.options_.starttime)),this.addClass("vjs-has-started"),this.trigger("firstplay")},n.handleTechPause_=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")},n.handleTechEnded_=function(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")},n.handleTechDurationChange_=function(){this.duration(this.techGet_("duration"))},n.handleTechClick_=function(e){this.controls_&&(this.paused()?It(this.play()):this.pause())},n.handleTechDoubleClick_=function(e){this.controls_&&(Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),(function(t){return t.contains(e.target)}))||void 0!==this.options_&&void 0!==this.options_.userActions&&void 0!==this.options_.userActions.doubleClick&&!1===this.options_.userActions.doubleClick||(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.doubleClick?this.options_.userActions.doubleClick.call(this,e):this.isFullscreen()?this.exitFullscreen():this.requestFullscreen()))},n.handleTechTap_=function(){this.userActive(!this.userActive())},n.handleTechTouchStart_=function(){this.userWasActive=this.userActive()},n.handleTechTouchMove_=function(){this.userWasActive&&this.reportUserActivity()},n.handleTechTouchEnd_=function(e){e.cancelable&&e.preventDefault()},n.handleStageClick_=function(){this.reportUserActivity()},n.toggleFullscreenClass_=function(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")},n.documentFullscreenChange_=function(e){var t=e.target.player;t&&t!==this||(e=this.el(),!(t=d[this.fsApi_.fullscreenElement]===e)&&e.matches?t=e.matches(":"+this.fsApi_.fullscreen):!t&&e.msMatchesSelector&&(t=e.msMatchesSelector(":"+this.fsApi_.fullscreen)),this.isFullscreen(t))},n.handleTechFullscreenChange_=function(e,t){t&&(t.nativeIOSFullscreen&&this.toggleClass("vjs-ios-native-fs"),this.isFullscreen(t.isFullscreen))},n.handleTechFullscreenError_=function(e,t){this.trigger("fullscreenerror",t)},n.togglePictureInPictureClass_=function(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")},n.handleTechEnterPictureInPicture_=function(e){this.isInPictureInPicture(!0)},n.handleTechLeavePictureInPicture_=function(e){this.isInPictureInPicture(!1)},n.handleTechError_=function(){var e=this.tech_.error();this.error(e)},n.handleTechTextData_=function(){this.trigger("textdata",1<arguments.length?arguments[1]:null)},n.getCache=function(){return this.cache_},n.resetCache_=function(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}},n.techCall_=function(e,t){this.ready((function(){if(e in bi)return n=this.middleware_,r=this.tech_,i=t,r[r=e](n.reduce(Si(r),i));if(e in Ti)return vi(this.middleware_,this.tech_,e,t);var n,r,i;try{this.tech_&&this.tech_[e](t)}catch(n){throw _(n),n}}),!0)},n.techGet_=function(e){if(this.tech_&&this.tech_.isReady_){if(e in _i)return t=this.middleware_,i=this.tech_,n=e,t.reduceRight(Si(n),i[n]());if(e in Ti)return vi(this.middleware_,this.tech_,e);var t,i,n;try{return this.tech_[e]()}catch(t){if(void 0===this.tech_[e])throw _("Video.js: "+e+" method not defined for "+this.techName_+" playback technology.",t),t;if("TypeError"===t.name)throw _("Video.js: "+e+" unavailable on "+this.techName_+" playback technology element.",t),this.tech_.isReady_=!1,t;throw _(t),t}}},n.play=function(){var e=this,t=this.options_.Promise||o.Promise;return t?new t((function(t){e.play_(t)})):this.play_()},n.play_=function(e){var t=this;if(this.playCallbacks_.push(e=void 0===e?It:e),e=Boolean(!this.changingSrc_&&(this.src()||this.currentSrc())),this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!e)return this.waitToPlay_=function(e){t.play_()},this.one(["ready","loadstart"],this.waitToPlay_),void(e||!X&&!G||this.load());null===(e=this.techGet_("play"))?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(e)},n.runPlayTerminatedQueue_=function(){var e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach((function(e){e()}
2))},n.runPlayCallbacks_=function(e){var t=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],t.forEach((function(t){t(e)}))},n.pause=function(){this.techCall_("pause")},n.paused=function(){return!1!==this.techGet_("paused")},n.played=function(){return this.techGet_("played")||Tt(0,0)},n.scrubbing=function(e){if(void 0===e)return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")},n.currentTime=function(e){return void 0!==e?(e<0&&(e=0),this.isReady_&&!this.changingSrc_&&this.tech_&&this.tech_.isReady_?(this.techCall_("setCurrentTime",e),void(this.cache_.initTime=0)):(this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),void this.one("canplay",this.boundApplyInitTime_))):(this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime)},n.applyInitTime_=function(){this.currentTime(this.cache_.initTime)},n.duration=function(e){if(void 0===e)return void 0!==this.cache_.duration?this.cache_.duration:NaN;(e=(e=parseFloat(e))<0?1/0:e)!==this.cache_.duration&&((this.cache_.duration=e)===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(e)||this.trigger("durationchange"))},n.remainingTime=function(){return this.duration()-this.currentTime()},n.remainingTimeDisplay=function(){return Math.floor(this.duration())-Math.floor(this.currentTime())},n.buffered=function(){var e;return(e=this.techGet_("buffered"))&&e.length?e:Tt(0,0)},n.bufferedPercent=function(){return St(this.buffered(),this.duration())},n.bufferedEnd=function(){var e=this.buffered(),t=this.duration();return t<(e=e.end(e.length-1))?t:e},n.volume=function(e){var t;return void 0!==e?(t=Math.max(0,Math.min(1,parseFloat(e))),this.cache_.volume=t,this.techCall_("setVolume",t),void(0<t&&this.lastVolume_(t))):(t=parseFloat(this.techGet_("volume")),isNaN(t)?1:t)},n.muted=function(e){if(void 0===e)return this.techGet_("muted")||!1;this.techCall_("setMuted",e)},n.defaultMuted=function(e){return void 0!==e?this.techCall_("setDefaultMuted",e):this.techGet_("defaultMuted")||!1},n.lastVolume_=function(e){if(void 0===e||0===e)return this.cache_.lastVolume;this.cache_.lastVolume=e},n.supportsFullScreen=function(){return this.techGet_("supportsFullScreen")||!1},n.isFullscreen=function(e){if(void 0===e)return this.isFullscreen_;var t=this.isFullscreen_;this.isFullscreen_=Boolean(e),this.isFullscreen_!==t&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),this.toggleFullscreenClass_()},n.requestFullscreen=function(s){var e=this.options_.Promise||o.Promise;if(e){var t=this;return new e((function(e,i){function n(){t.off("fullscreenerror",o),t.off("fullscreenchange",r)}function r(){n(),e()}function o(e,t){n(),i(t)}t.one("fullscreenchange",r),t.one("fullscreenerror",o);var a=t.requestFullscreenHelper_(s);a&&(a.then(n,n),a.then(e,i))}))}return this.requestFullscreenHelper_()},n.requestFullscreenHelper_=function(e){var t=this;if(this.fsApi_.prefixed||(i=this.options_.fullscreen&&this.options_.fullscreen.options||{},void 0!==e&&(i=e)),this.fsApi_.requestFullscreen){var i=this.el_[this.fsApi_.requestFullscreen](i);return i&&i.then((function(){return t.isFullscreen(!0)}),(function(){return t.isFullscreen(!1)})),i}this.tech_.supportsFullScreen()&&1==!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()},n.exitFullscreen=function(){var e=this.options_.Promise||o.Promise;if(e){var s=this;return new e((function(e,i){function t(){s.off("fullscreenerror",r),s.off("fullscreenchange",n)}function n(){t(),e()}function r(e,n){t(),i(n)}s.one("fullscreenchange",n),s.one("fullscreenerror",r);var a=s.exitFullscreenHelper_();a&&(a.then(t,t),a.then(e,i))}))}return this.exitFullscreenHelper_()},n.exitFullscreenHelper_=function(){var e=this;if(this.fsApi_.requestFullscreen){var t=d[this.fsApi_.exitFullscreen]();return t&&It(t.then((function(){return e.isFullscreen(!1)}))),t}this.tech_.supportsFullScreen()&&1==!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()},n.enterFullWindow=function(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=d.documentElement.style.overflow,qe(d,"keydown",this.boundFullWindowOnEscKey_),d.documentElement.style.overflow="hidden",ae(d.body,"vjs-full-window"),this.trigger("enterFullWindow")},n.fullWindowOnEscKey=function(e){Lt.isEventKey(e,"Esc")&&!0===this.isFullscreen()&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())},n.exitFullWindow=function(){this.isFullscreen(!1),this.isFullWindow=!1,Ve(d,"keydown",this.boundFullWindowOnEscKey_),d.documentElement.style.overflow=this.docOrigOverflow,se(d.body,"vjs-full-window"),this.trigger("exitFullWindow")},n.disablePictureInPicture=function(e){if(void 0===e)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")},n.isInPictureInPicture=function(e){return void 0!==e?(this.isInPictureInPicture_=!!e,void this.togglePictureInPictureClass_()):!!this.isInPictureInPicture_},n.requestPictureInPicture=function(){if("pictureInPictureEnabled"in d&&!1===this.disablePictureInPicture())return this.techGet_("requestPictureInPicture")},n.exitPictureInPicture=function(){if("pictureInPictureEnabled"in d)return d.exitPictureInPicture()},n.handleKeyDown=function(e){var t=this.options_.userActions;t&&t.hotkeys&&(function(e){var t=e.tagName.toLowerCase();return!!e.isContentEditable||("input"===t?-1===["button","checkbox","hidden","radio","reset","submit"].indexOf(e.type):-1!==["textarea"].indexOf(t))}(this.el_.ownerDocument.activeElement)||("function"==typeof t.hotkeys?t.hotkeys.call(this,e):this.handleHotkeys(e)))},n.handleHotkeys=function(e){var i=(n=this.options_.userActions?this.options_.userActions.hotkeys:{}).fullscreenKey,t=void 0===(t=n.muteKey)?function(e){return Lt.isEventKey(e,"m")}:t,n=void 0===(n=n.playPauseKey)?function(e){return Lt.isEventKey(e,"k")||Lt.isEventKey(e,"Space")}:n;(void 0===i?function(e){return Lt.isEventKey(e,"f")}:i).call(this,e)?(e.preventDefault(),e.stopPropagation(),i=gt.getComponent("FullscreenToggle"),!1!==d[this.fsApi_.fullscreenEnabled]&&i.prototype.handleClick.call(this,e)):t.call(this,e)?(e.preventDefault(),e.stopPropagation(),gt.getComponent("MuteToggle").prototype.handleClick.call(this,e)):n.call(this,e)&&(e.preventDefault(),e.stopPropagation(),gt.getComponent("PlayToggle").prototype.handleClick.call(this,e))},n.canPlayType=function(e){for(var t,i=0,n=this.options_.techOrder;i<n.length;i++){var r=n[i],a=pi.getTech(r);if(a=a||gt.getComponent(r)){if(a.isSupported()&&(t=a.canPlayType(e)))return t}else _.error('The "'+r+'" tech is undefined. Skipped browser support check for that tech.')}return""},n.selectSource=function(e){function t(e,i,t){var n;return e.some((function(e){return i.some((function(r){if(n=t(e,r))return!0}))})),n}var i,n=this,r=this.options_.techOrder.map((function(e){return[e,pi.getTech(e)]})).filter((function(e){var t=e[0];return(e=e[1])?e.isSupported():(_.error('The "'+t+'" tech is undefined. Skipped browser support check for that tech.'),!1)})),a=function(e,t){var i=e[0];if(e[1].canPlaySource(t,n.options_[i.toLowerCase()]))return{source:t,tech:i}};return(a=this.options_.sourceOrder?t(e,r,(i=a,function(e,t){return i(t,e)})):t(r,e,a))||!1},n.handleSrc_=function(e,t){var n=this;if(void 0===e)return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();var r,i,a=Ci(e);a.length?(this.changingSrc_=!0,t||(this.cache_.sources=a),this.updateSourceCaches_(a[0]),yi(this,a[0],(function(e,r){var i;return n.middleware_=r,t||(n.cache_.sources=a),n.updateSourceCaches_(e),n.src_(e)?1<a.length?n.handleSrc_(a.slice(1)):(n.changingSrc_=!1,n.setTimeout((function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})}),0),void n.triggerReady()):(i=n.tech_,void r.forEach((function(e){return e.setTech&&e.setTech(i)})))})),this.options_.retryOnError&&1<a.length&&(i=function(){n.off("error",r)},this.one("error",r=function(){n.error(null),n.handleSrc_(a.slice(1),!0)}),this.one("playing",i),this.resetRetryOnError_=function(){n.off("error",r),n.off("playing",i)})):this.setTimeout((function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})}),0)},n.src=function(e){return this.handleSrc_(e,!1)},n.src_=function(e){var t,i,n=this,r=this.selectSource([e]);return!r||(t=r.tech,i=this.techName_,ht(t)!==ht(i)?(this.changingSrc_=!0,this.loadTech_(r.tech,r.source),this.tech_.ready((function(){n.changingSrc_=!1}))):this.ready((function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1}),!0),!1)},n.load=function(){this.techCall_("load")},n.reset=function(){var e=this,t=this.options_.Promise||o.Promise;this.paused()||!t?this.doReset_():It(this.play().then((function(){return e.doReset_()})))},n.doReset_=function(){this.tech_&&this.tech_.clearTracks("text"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),st(this)&&this.trigger("playerreset")},n.resetControlBarUI_=function(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()},n.resetProgressBar_=function(){this.currentTime(0);var e=(t=this.controlBar).durationDisplay,t=t.remainingTimeDisplay;e&&e.updateContent(),t&&t.updateContent()},n.resetPlaybackRate_=function(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()},n.resetVolumeBar_=function(){this.volume(1),this.trigger("volumechange")},n.currentSources=function(){var e=this.currentSource(),t=[];return 0!==Object.keys(e).length&&t.push(e),this.cache_.sources||t},n.currentSource=function(){return this.cache_.source||{}},n.currentSrc=function(){return this.currentSource()&&this.currentSource().src||""},n.currentType=function(){return this.currentSource()&&this.currentSource().type||""},n.preload=function(e){return void 0!==e?(this.techCall_("setPreload",e),void(this.options_.preload=e)):this.techGet_("preload")},n.autoplay=function(e){if(void 0===e)return this.options_.autoplay||!1;var t;"string"==typeof e&&/(any|play|muted)/.test(e)||!0===e&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_("string"==typeof e?e:"play"),t=!1):this.options_.autoplay=!!e,t=void 0===t?this.options_.autoplay:t,this.tech_&&this.techCall_("setAutoplay",t)},n.playsinline=function(e){return void 0!==e?(this.techCall_("setPlaysinline",e),this.options_.playsinline=e,this):this.techGet_("playsinline")},n.loop=function(e){return void 0!==e?(this.techCall_("setLoop",e),void(this.options_.loop=e)):this.techGet_("loop")},n.poster=function(e){if(void 0===e)return this.poster_;(e=e||"")!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))},n.handleTechPosterChange_=function(){var e;this.poster_&&!this.options_.techCanOverridePoster||!this.tech_||!this.tech_.poster||(e=this.tech_.poster()||"")!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))},n.controls=function(e){if(void 0===e)return!!this.controls_;this.controls_!==(e=!!e)&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControl
2sListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))},n.usingNativeControls=function(e){if(void 0===e)return!!this.usingNativeControls_;this.usingNativeControls_!==(e=!!e)&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))},n.error=function(e){var i=this;if(void 0===e)return this.error_||null;if(a("beforeerror").forEach((function(t){w(t=t(i,e))&&!Array.isArray(t)||"string"==typeof t||"number"==typeof t||null===t?e=t:i.log.error("please return a value that MediaError expects in beforeerror hooks")})),this.options_.suppressNotSupportedError&&e&&4===e.code){var t=function(){this.error(e)};return this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],t),void this.one("loadstart",(function(){this.off(["click","touchstart"],t)}))}if(null===e)return this.error_=e,this.removeClass("vjs-error"),void(this.errorDisplay&&this.errorDisplay.close());this.error_=new Et(e),this.addClass("vjs-error"),_.error("(CODE:"+this.error_.code+" "+Et.errorTypes[this.error_.code]+")",this.error_.message,this.error_),this.trigger("error"),a("error").forEach((function(e){return e(i,i.error_)}))},n.reportUserActivity=function(e){this.userActivity_=!0},n.userActive=function(e){if(void 0===e)return this.userActive_;if((e=!!e)!==this.userActive_){if(this.userActive_=e,this.userActive_)return this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),void this.trigger("useractive");this.tech_&&this.tech_.one("mousemove",(function(e){e.stopPropagation(),e.preventDefault()})),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}},n.listenForUserActivity_=function(){var e,i,t,a,n=Xe(this,this.reportUserActivity),r=function(t){n(),this.clearInterval(e)};this.on("mousedown",(function(){n(),this.clearInterval(e),e=this.setInterval(n,250)})),this.on("mousemove",(function(e){e.screenX===i&&e.screenY===t||(i=e.screenX,t=e.screenY,n())})),this.on("mouseup",r),this.on("mouseleave",r),!(r=this.getChild("controlBar"))||G||O||(r.on("mouseenter",(function(e){0!==this.player().options_.inactivityTimeout&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0})),r.on("mouseleave",(function(e){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout}))),this.on("keydown",n),this.on("keyup",n),this.setInterval((function(){var e;this.userActivity_&&(this.userActivity_=!1,this.userActive(!0),this.clearTimeout(a),(e=this.options_.inactivityTimeout)<=0||(a=this.setTimeout((function(){this.userActivity_||this.userActive(!1)}),e)))}),250)},n.playbackRate=function(e){if(void 0===e)return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1;this.techCall_("setPlaybackRate",e)},n.defaultPlaybackRate=function(e){return void 0!==e?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1},n.isAudio=function(e){if(void 0===e)return!!this.isAudio_;this.isAudio_=!!e},n.addTextTrack=function(e,t,i){if(this.tech_)return this.tech_.addTextTrack(e,t,i)},n.addRemoteTextTrack=function(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)},n.removeRemoteTextTrack=function(e){var t=(t=(e=void 0===e?{}:e).track)||e;if(this.tech_)return this.tech_.removeRemoteTextTrack(t)},n.getVideoPlaybackQuality=function(){return this.techGet_("getVideoPlaybackQuality")},n.videoWidth=function(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0},n.videoHeight=function(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0},n.language=function(e){if(void 0===e)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),st(this)&&this.trigger("languagechange"))},n.languages=function(){return pt(t.prototype.options_.languages,this.languages_)},n.toJSON=function(){var e=pt(this.options_),t=e.tracks;e.tracks=[];for(var i=0;i<t.length;i++){var n=t[i];(n=pt(n)).player=void 0,e.tracks[i]=n}return e},n.createModal=function(e,t){var i=this;(t=t||{}).content=e||"";var n=new Ot(this,t);return this.addChild(n),n.on("dispose",(function(){i.removeChild(n)})),n.open(),n},n.updateCurrentBreakpoint_=function(){if(this.responsive())for(var e=this.currentBreakpoint(),t=this.currentWidth(),i=0;i<cn.length;i++){var n=cn[i];
2if(t<=this.breakpoints_[n]){if(e===n)return;e&&this.removeClass(dn[e]),this.addClass(dn[n]),this.breakpoint_=n;break}}},n.removeCurrentBreakpoint_=function(){var e=this.currentBreakpointClass();this.breakpoint_="",e&&this.removeClass(e)},n.breakpoints=function(e){return void 0===e||(this.breakpoint_="",this.breakpoints_=C({},hn,e),this.updateCurrentBreakpoint_()),C(this.breakpoints_)},n.responsive=function(e){return void 0===e?this.responsive_:(e=Boolean(e))!==this.responsive_?((this.responsive_=e)?(this.on("playerresize",this.boundUpdateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off("playerresize",this.boundUpdateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),e):void 0},n.currentBreakpoint=function(){return this.breakpoint_},n.currentBreakpointClass=function(){return dn[this.breakpoint_]||""},n.loadMedia=function(e,t){var i,n,r,a=this;e&&"object"==typeof e&&(this.reset(),this.cache_.media=pt(e),i=(r=this.cache_.media).artwork,n=r.poster,e=r.src,r=r.textTracks,!i&&n&&(this.cache_.media.artwork=[{src:n,type:ki(n)}]),e&&this.src(e),n&&this.poster(n),Array.isArray(r)&&r.forEach((function(e){return a.addRemoteTextTrack(e,!1)})),this.ready(t))},n.getMedia=function(){if(this.cache_.media)return pt(this.cache_.media);var e=this.poster(),t={src:this.currentSources(),textTracks:Array.prototype.map.call(this.remoteTextTracks(),(function(e){return{kind:e.kind,label:e.label,language:e.language,src:e.src}}))};return e&&(t.poster=e,t.artwork=[{src:t.poster,type:ki(t.poster)}]),t},t.getTagSettings=function(e){var t,i={sources:[],tracks:[]},n=le(e),r=n["data-setup"];if(re(e,"vjs-fill")&&(n.fill=!0),re(e,"vjs-fluid")&&(n.fluid=!0),null!==r&&(r=(t=Ct(r||"{}"))[0],t=t[1],r&&_.error(r),C(n,t)),C(i,n),e.hasChildNodes())for(var a=e.childNodes,s=0,o=a.length;s<o;s++){var u=a[s],l=u.nodeName.toLowerCase();"source"===l?i.sources.push(le(u)):"track"===l&&i.tracks.push(le(u))}return i},n.flexNotSupported_=function(){var e=d.createElement("i");return!("flexBasis"in e.style||"webkitFlexBasis"in e.style||"mozFlexBasis"in e.style||"msFlexBasis"in e.style||"msFlexOrder"in e.style)},n.debug=function(e){if(void 0===e)return this.debugEnabled_;e?(this.trigger("debugon"),this.previousLogLevel_=this.log.level,this.log.level("debug"),this.debugEnabled_=!0):(this.trigger("debugoff"),this.log.level(this.previousLogLevel_),this.previousLogLevel_=void 0,this.debugEnabled_=!1)},n.playbackRates=function(e){if(void 0===e)return this.cache_.playbackRates;Array.isArray(e)&&e.every((function(e){return"number"==typeof e}))&&(this.cache_.playbackRates=e,this.trigger("playbackrateschange"))},t}(gt);li.names.forEach((function(e){var t=li[e];pn.prototype[t.getterName]=function(){return this.tech_?this.tech_[t.getterName]():(this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName])}})),pn.prototype.crossorigin=pn.prototype.crossOrigin,pn.players={},P=o.navigator,pn.prototype.options_={techOrder:pi.defaultTechOrder_,html5:{},inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:P&&(P.languages&&P.languages[0]||P.userLanguage||P.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",normalizeAutoplay:!1,fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:!1},["ended","seeking","seekable","networkState","readyState"].forEach((function(e){pn.prototype[e]=function(){return this.techGet_(e)}})),un.forEach((function(e){pn.prototype["handleTech"+ht(e)+"_"]=function(){return this.trigger(e)}})),gt.registerComponent("Player",pn);var fn=r((function(i){function e(t,n){return i.exports=e=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e(t,n)}i.exports=e}));function mn(e){return kn.hasOwnProperty(e)}function gn(e){return mn(e)?kn[e]:void 0}function yn(e,t,i){i=(i?"before":"")+"pluginsetup",e.trigger(i,t),e.trigger(i+":"+t.name,t)}function vn(e,i){function t(){yn(this,{name:e,plugin:i,instance:null},!0);var t=i.apply(this,arguments);return Cn(this,e),yn(this,{name:e,plugin:i,instance:t}),t}
2return Object.keys(i).forEach((function(e){t[e]=i[e]})),t}function _n(e,a){return a.prototype.name=e,function(){yn(this,{name:e,plugin:a,instance:null},!0);for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];var r=Tn(a,[this].concat(n));return this[e]=function(){return r},yn(this,r.getEventHash()),r}}var bn=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}},Tn=r((function(e){function t(n,r,i){return bn()?e.exports=t=Reflect.construct:e.exports=t=function(e,t,i){var n=[null];return n.push.apply(n,t),n=new(Function.bind.apply(e,n)),i&&fn(n,i.prototype),n},t.apply(null,arguments)}e.exports=t})),Sn="plugin",En="activePlugins_",kn={},Cn=function(e,t){e[En]=e[En]||{},e[En][t]=!0},wn=function(){function i(e){if(this.constructor===i)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=e,this.log||(this.log=this.player.log.createLogger(this.name)),ut(this),delete this.trigger,ct(this,this.constructor.defaultState),Cn(e,this.name),this.dispose=this.dispose.bind(this),e.on("dispose",this.dispose)}var e=i.prototype;return e.version=function(){return this.constructor.VERSION},e.getEventHash=function(e){return(e=void 0===e?{}:e).name=this.name,e.plugin=this.constructor,e.instance=this,e},e.trigger=function(e,t){return We(this.eventBusEl_,e,this.getEventHash(t=void 0===t?{}:t))},e.handleStateChanged=function(e){},e.dispose=function(){var e=this.name,t=this.player;this.trigger("dispose"),this.off(),t.off("dispose",this.dispose),t[En][e]=!1,this.player=this.state=null,t[e]=_n(e,kn[e])},i.isBasic=function(e){return"function"==typeof(e="string"==typeof e?gn(e):e)&&!i.prototype.isPrototypeOf(e.prototype)},i.registerPlugin=function(e,t){if("string"!=typeof e)throw new Error('Illegal plugin name, "'+e+'", must be a string, was '+typeof e+".");if(mn(e))_.warn('A plugin named "'+e+'" already exists. You may want to avoid re-registering plugins!');else if(pn.prototype.hasOwnProperty(e))throw new Error('Illegal plugin name, "'+e+'", cannot share a name with an existing player method!');if("function"!=typeof t)throw new Error('Illegal plugin for "'+e+'", must be a function, was '+typeof t+".");return kn[e]=t,e!==Sn&&(i.isBasic(t)?pn.prototype[e]=vn(e,t):pn.prototype[e]=_n(e,t)),t},i.deregisterPlugin=function(e){if(e===Sn)throw new Error("Cannot de-register base plugin.");mn(e)&&(delete kn[e],delete pn.prototype[e])},i.getPlugins=function(e){var i;return(e=void 0===e?Object.keys(kn):e).forEach((function(e){var t=gn(e);t&&((i=i||{})[e]=t)})),i},i.getPluginVersion=function(e){return(e=gn(e))&&e.VERSION||""},i}();wn.getPlugin=gn,wn.BASE_PLUGIN_NAME=Sn,wn.registerPlugin(Sn,wn),pn.prototype.usingPlugin=function(e){return!!this[En]&&!0===this[En][e]},pn.prototype.hasPlugin=function(e){return!!mn(e)};var In=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&fn(e,t)},An=function(e){return 0===e.indexOf("#")?e.slice(1):e};function xn(e,t,i){if(r=xn.getPlayer(e))return t&&_.warn('Player "'+e+'" is already initialised. Options will not be applied.'),i&&r.ready(i),r;var n="string"==typeof e?Ce("#"+An(e)):e;if(!J(n))throw new TypeError("The element or ID supplied is not valid. (videojs)");n.ownerDocument.defaultView&&n.ownerDocument.body.contains(n)||_.warn("The element supplied is not included in the DOM"),t=t||{},a("beforesetup").forEach((function(e){w(e=e(n,pt(t)))&&!Array.isArray(e)?t=pt(t,e):_.error("please return an object in beforesetup hooks")}));var r=new(gt.getComponent("Player"))(n,t,i);return a("setup").forEach((function(e){return e(r)})),r}function Pn(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=o.location&&o.location.href||"");var i="function"==typeof o.URL,n=/^\/\//.test(e),r=!o.location&&!/\/\//i.test(e);return i?e=new o.URL(e,o.location||Dn):/\/\//i.test(e)||(e=Ln.buildAbsoluteURL(o.location&&o.location.href||"",e)),i?(i=new URL(t,e),r?i.href.slice(Dn.length):n?i.href.slice(i.protocol.length):i.href):Ln.buildAbsoluteURL(e,t)}xn.hooks_=l,xn.hooks=a,xn.hook=function(e,t){a(e,t)},xn.hookOnce=function(i,e){a(i,[].concat(e).map((function(e){return function t(){return c(i,t),e.apply(void 0,arguments)}})))},xn.removeHook=c,!0!==o.VIDEOJS_NO_DYNAMIC_STYLE&&$()&&((On=Ce(".vjs-styles-defaults"))||(On=De("vjs-styles-defaults"),(P=Ce("head"))&&P.insertBefore(On,P.firstChild),Oe(On,"\n .video-js {\n width: 300px;\n height: 150px;\n }\n\n .vjs-fluid {\n padding-top: 56.25%\n }\n "))),Pe(1,xn),xn.VERSION=u,xn.options=pn.prototype.options_,xn.getPlayers=function(){return pn.players},xn.getPlayer=function(e){var t=pn.players;if("string"==typeof e){var i=An(e),n=t[i];if(n)return n;i=Ce("#"+i)}else i=e;if(J(i)&&(e=i.player,i=i.playerId,e||t[i]))return e||t[i]},xn.getAllPlayers=function(){return Object.keys(pn.players).map((function(e){return pn.players[e]}
2)).filter(Boolean)},xn.players=pn.players,xn.getComponent=gt.getComponent,xn.registerComponent=function(e,t){pi.isTech(t)&&_.warn("The "+e+" tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)"),gt.registerComponent.call(gt,e,t)},xn.getTech=pi.getTech,xn.registerTech=pi.registerTech,xn.use=function(e,t){fi[e]=fi[e]||[],fi[e].push(t)},Object.defineProperty(xn,"middleware",{value:{},writeable:!1,enumerable:!0}),Object.defineProperty(xn.middleware,"TERMINATOR",{value:gi,writeable:!1,enumerable:!0}),xn.browser=K,xn.TOUCH_ENABLED=V,xn.extend=function(e,t){var i,n=function(){e.apply(this,arguments)},r={};for(i in"object"==typeof(t=void 0===t?{}:t)?(t.constructor!==Object.prototype.constructor&&(n=t.constructor),r=t):"function"==typeof t&&(n=t),In(n,e),e&&(n.super_=e),r)r.hasOwnProperty(i)&&(n.prototype[i]=r[i]);return n},xn.mergeOptions=pt,xn.bind=Xe,xn.registerPlugin=wn.registerPlugin,xn.deregisterPlugin=wn.deregisterPlugin,xn.plugin=function(e,t){return _.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),wn.registerPlugin(e,t)},xn.getPlugins=wn.getPlugins,xn.getPlugin=wn.getPlugin,xn.getPluginVersion=wn.getPluginVersion,xn.addLanguage=function(e,t){var i;return e=(""+e).toLowerCase(),xn.options.languages=pt(xn.options.languages,((i={})[e]=t,i)),xn.options.languages[e]},xn.log=_,xn.createLogger=T,xn.createTimeRange=xn.createTimeRanges=Tt,xn.formatTime=Ni,xn.setFormatTime=function(e){Mi=e},xn.resetFormatTime=function(){Mi=Ri},xn.parseUrl=Bt,xn.isCrossOrigin=Ht,xn.EventTarget=Qe,xn.on=qe,xn.one=ze,xn.off=Ve,xn.trigger=We,xn.xhr=ei,xn.TextTrack=si,xn.AudioTrack=oi,xn.VideoTrack=ui,["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach((function(e){xn[e]=function(){return _.warn("videojs."+e+"() is deprecated; use videojs.dom."+e+"() instead"),Ie[e].apply(null,arguments)}})),xn.computedStyle=A,xn.dom=Ie,xn.url=Qt,xn.defineLazyProperty=nn,xn.addLanguage("en",{"Non-Fullscreen":"Exit Fullscreen"});var Ln=r((function(e,t){var i,a,n,r,s;i=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,a=/^([^\/?#]*)([^]*)$/,n=/(?:\/|^)\.(?=\/)/g,r=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,s={buildAbsoluteURL:function(e,t,i){if(i=i||{},e=e.trim(),!(t=t.trim())){if(!i.alwaysNormalize)return e;var n=s.parseURL(e);if(!n)throw new Error("Error trying to parse base URL.");return n.path=s.normalizePath(n.path),s.buildURLFromParts(n)}if(!(n=s.parseURL(t)))throw new Error("Error trying to parse relative URL.");if(n.scheme)return i.alwaysNormalize?(n.path=s.normalizePath(n.path),s.buildURLFromParts(n)):t;if(!(t=s.parseURL(e)))throw new Error("Error trying to parse base URL.");var r;return!t.netLoc&&t.path&&"/"!==t.path[0]&&(r=a.exec(t.path),t.netLoc=r[1],t.path=r[2]),t.netLoc&&!t.path&&(t.path="/"),e={scheme:t.scheme,netLoc:n.netLoc,path:null,params:n.params,query:n.query,fragment:n.fragment},n.netLoc||(e.netLoc=t.netLoc,"/"!==n.path[0]&&(n.path?(r=(r=t.path).substring(0,r.lastIndexOf("/")+1)+n.path,e.path=s.normalizePath(r)):(e.path=t.path,n.params||(e.params=t.params,n.query||(e.query=t.query))))),null===e.path&&(e.path=i.alwaysNormalize?s.normalizePath(n.path):n.path),s.buildURLFromParts(e)},parseURL:function(e){return(e=i.exec(e))?{scheme:e[1]||"",netLoc:e[2]||"",path:e[3]||"",params:e[4]||"",query:e[5]||"",fragment:e[6]||""}:null},normalizePath:function(e){for(e=e.split("").reverse().join("").replace(n,"");e.length!==(e=e.replace(r,"")).length;);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}},e.exports=s})),Dn="http://example.com",On=function(){function e(){this.listeners={}}var t=e.prototype;return t.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.off=function(e,t){return!!this.listeners[e]&&(t=this.listeners[e].indexOf(t),this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(t,1),-1<t)},t.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var i=t.length,n=0;n<i;++n)t[n].call(this,arguments[1]);
2else for(var r=Array.prototype.slice.call(arguments,1),a=t.length,s=0;s<a;++s)t[s].apply(this,r)},t.dispose=function(){this.listeners={}},t.pipe=function(e){this.on("data",(function(t){e.push(t)}))},e}(),Rn=function(e){return o.atob?o.atob(e):n.from(e,"base64").toString("binary")};function Mn(e){for(var t=Rn(e),i=new Uint8Array(t.length),n=0;n<t.length;n++)i[n]=t.charCodeAt(n);return i}function Nn(e){var t=/([0-9.]*)?@?([0-9.]*)?/.exec(e||"");return e={},t[1]&&(e.length=parseInt(t[1],10)),t[2]&&(e.offset=parseInt(t[2],10)),e}function Un(e){for(var t,i=e.split(new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))')),n={},r=i.length;r--;)""!==i[r]&&((t=/([^=]*)=(.*)/.exec(i[r]).slice(1))[0]=t[0].replace(/^\s+|\s+$/g,""),t[1]=t[1].replace(/^\s+|\s+$/g,""),t[1]=t[1].replace(/^['"](.*)['"]$/g,"$1"),n[t[0]]=t[1]);return n}function Bn(e){var i={};return Object.keys(e).forEach((function(t){i[t.toLowerCase().replace(/-(\w)/g,(function(e){return e[1].toUpperCase()}))]=e[t]})),i}function Fn(e){var t,i,n,r,a=e.serverControl,s=e.targetDuration,o=e.partTargetDuration;a&&(t="#EXT-X-SERVER-CONTROL",i="holdBack",n="partHoldBack",r=s&&3*s,e=o&&2*o,s&&!a.hasOwnProperty(i)&&(a[i]=r,this.trigger("info",{message:t+" defaulting HOLD-BACK to targetDuration * 3 ("+r+")."})),r&&a[i]<r&&(this.trigger("warn",{message:t+" clamping HOLD-BACK ("+a[i]+") to targetDuration * 3 ("+r+")"}),a[i]=r),o&&!a.hasOwnProperty(n)&&(a[n]=3*o,this.trigger("info",{message:t+" defaulting PART-HOLD-BACK to partTargetDuration * 3 ("+a[n]+")."})),o&&a[n]<e&&(this.trigger("warn",{message:t+" clamping PART-HOLD-BACK ("+a[n]+") to partTargetDuration * 2 ("+e+")."}),a[n]=e))}function jn(e){return e&&e.replace(/avc1\.(\d+)\.(\d+)/i,(function(e,t,i){return"avc1."+("00"+Number(t).toString(16)).slice(-2)+"00"+("00"+Number(i).toString(16)).slice(-2)}))}function Hn(e){e=(e=void 0===e?"":e).split(",");var a=[];return e.forEach((function(e){var t;e=e.trim(),Jn.forEach((function(n){var r,i=$n[n].exec(e.toLowerCase());!i||i.length<=1||(t=n,r=e.substring(0,i[1].length),i=e.replace(r,""),a.push({type:r,details:i,mediaType:n}))})),t||a.push({type:e,details:"",mediaType:"unknown"})})),a}function qn(e){return $n.audio.test((e=void 0===e?"":e).trim().toLowerCase())}function Vn(e){if(e&&"string"==typeof e){var t=e.toLowerCase().split(",").map((function(e){return jn(e.trim())})),i="video";1===t.length&&qn(t[0])?i="audio":1===t.length&&(n=t[0],$n.text.test((n=void 0===n?"":n).trim().toLowerCase()))&&(i="application");var n="mp4";return t.every((function(e){return $n.mp4.test(e)}))?n="mp4":t.every((function(e){return $n.webm.test(e)}))?n="webm":t.every((function(e){return $n.ogg.test(e)}))&&(n="ogg"),i+"/"+n+';codecs="'+e+'"'}}function Wn(e){return void 0===e&&(e=""),o.MediaSource&&o.MediaSource.isTypeSupported&&o.MediaSource.isTypeSupported(Vn(e))||!1}function zn(e){return(e=void 0===e?"":e).toLowerCase().split(",").every((function(e){e=e.trim();for(var t=0;t<Zn.length;t++)if($n["muxer"+Zn[t]].test(e))return!0;return!1}))}function Gn(e){return ir.test(e)?"hls":nr.test(e)?"dash":"application/vnd.videojs.vhs+json"===e?"vhs-json":null}var Xn=function(e){function t(){var t=e.call(this)||this;return t.buffer="",t}return vt(t,e),t.prototype.push=function(e){var t;for(this.buffer+=e,t=this.buffer.indexOf("\n");-1<t;t=this.buffer.indexOf("\n"))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)},t}(On),Kn=String.fromCharCode(9),Yn=function(e){function t(){var t=e.call(this)||this;return t.customParsers=[],t.tagMappers=[],t}vt(t,e);var i=t.prototype;return i.push=function(i){var e,a,s=this;0!==(i=i.trim()).length&&("#"===i[0]?this.tagMappers.reduce((function(e,t){return(t=t(i))===i?e:e.concat([t])}),[i]).forEach((function(t){for(var n,i,r=0;r<s.customParsers.length;r++)if(s.customParsers[r].call(s,t))return;if(0===t.indexOf("#EXT"))if(t=t.replace("\r",""),e=/^#EXTM3U/.exec(t))s.trigger("data",{type:"tag",tagType:"m3u"});else{if(e=/^#EXTINF:?([0-9\.]*)?,?(.*)?$/.exec(t))return a={type:"tag",tagType:"inf"},e[1]&&(a.duration=parseFloat(e[1])),e[2]&&(a.title=e[2]),void s.trigger("data",a);if(e=/^#EXT-X-TARGETDURATION:?([0-9.]*)?/.exec(t))return a={type:"tag",tagType:"targetduration"},e[1]&&(a.duration=parseInt(e[1],10)),void s.trigger("data",a);if(e=/^#EXT-X-VERSION:?([0-9.]*)?/.exec(t))return a={type:"tag",tagType:"version"},e[1]&&(a.version=parseInt(e[1],10)),void s.trigger("data",a);if(e=/^#EXT-X-MEDIA-SEQUENCE:?(\-?[0-9.]*)?/.exec(t))return a={type:"tag",tagType:"media-sequence"},e[1]&&(a.number=parseInt(e[1],10)),void s.trigger("data",a);if(e=/^#EXT-X-DISCONTINUITY-SEQUENCE:?(\-?[0-9.]*)?/.exec(t))return a={type:"tag",tagType:"discontinuity-sequence"},e[1]&&(a.number=parseInt(e[1],10)),void s.trigger("data",a);if(e=/^#EXT-X-PLAYLIST-TYPE:?(.*)?$/.exec(t))return a={type:"tag",tagType:"playlist-type"},e[1]&&(a.playlistType=e[1]),void s.trigger("data",a);if(e=/^#EXT-X-BYTERANGE:?(.*)?$/.exec(t))return a=b(Nn(e[1]),{type:"tag",tagType:"byterange"}),void s.trigger("data",a);if(e=/^#EXT-X-ALLOW-CACHE:?(YES|NO)?/.exec(t))return a={type:"tag",tagType:"allow-cache"},e[1]&&(a.allowed=!/NO/.test(e[1])),void s.trigger("data",a);if(e=/^#EXT-X-MAP:?(.*)$/.exec(t))return a={type:"tag",tagType:"map"},e[1]&&((n=Un(e[1])).URI&&(a.uri=n.URI),n.BYTERANGE&&(a.byterange=Nn(n.BYTERANGE))),void s.trigger("data",a);if(e=/^#EXT-X-STREAM-INF:?(.*)$/.exec(t))return a={type:"tag",tagType:"stream-inf"},e[1]&&(a.attributes=Un(e[1]),a.attributes.RESOLUTION&&(i={},(n=a.attributes.RESOLUTION.split("x"))[0]&&(i.width=parseInt(n[0],10)),n[1]&&(i.height=parseInt(n[1],10)),a.attributes.RESOLUTION=i),a.attributes.BANDWIDTH&&(a.attributes.BANDWIDTH=parseInt(a.attributes.BANDWIDTH,10)),a.attributes["PROGRAM-ID"]&&(a.attributes["PROGRAM-ID"]=parseInt(a.attributes["PROGRAM-ID"],10))),void s.trigger("data",a);if(e=/^#EXT-X-MEDIA:?(.*)$/.exec(t))return a={type:"tag",tagType:"media"},e[1]&&(a.attributes=Un(e[1])),void s.trigger("data",a);if(e=/^#EXT-X-ENDLIST/.exec(t))s.trigger("data",{type:"tag",tagType:"endlist"});else{if(!(e=/^#EXT-X-DISCONTINUITY/.exec(t)))return(e=/^#EXT-X-PROGRAM-DATE-TIME:?(.*)$/.exec(t))?(a={type:"tag",tagType:"program-date-time"}
2,e[1]&&(a.dateTimeString=e[1],a.dateTimeObject=new Date(e[1])),void s.trigger("data",a)):(e=/^#EXT-X-KEY:?(.*)$/.exec(t))?(a={type:"tag",tagType:"key"},e[1]&&(a.attributes=Un(e[1]),a.attributes.IV&&("0x"===a.attributes.IV.substring(0,2).toLowerCase()&&(a.attributes.IV=a.attributes.IV.substring(2)),a.attributes.IV=a.attributes.IV.match(/.{8}/g),a.attributes.IV[0]=parseInt(a.attributes.IV[0],16),a.attributes.IV[1]=parseInt(a.attributes.IV[1],16),a.attributes.IV[2]=parseInt(a.attributes.IV[2],16),a.attributes.IV[3]=parseInt(a.attributes.IV[3],16),a.attributes.IV=new Uint32Array(a.attributes.IV))),void s.trigger("data",a)):(e=/^#EXT-X-START:?(.*)$/.exec(t))?(a={type:"tag",tagType:"start"},e[1]&&(a.attributes=Un(e[1]),a.attributes["TIME-OFFSET"]=parseFloat(a.attributes["TIME-OFFSET"]),a.attributes.PRECISE=/YES/.test(a.attributes.PRECISE)),void s.trigger("data",a)):(e=/^#EXT-X-CUE-OUT-CONT:?(.*)?$/.exec(t))?(a={type:"tag",tagType:"cue-out-cont"},e[1]?a.data=e[1]:a.data="",void s.trigger("data",a)):(e=/^#EXT-X-CUE-OUT:?(.*)?$/.exec(t))?(a={type:"tag",tagType:"cue-out"},e[1]?a.data=e[1]:a.data="",void s.trigger("data",a)):(e=/^#EXT-X-CUE-IN:?(.*)?$/.exec(t))?(a={type:"tag",tagType:"cue-in"},e[1]?a.data=e[1]:a.data="",void s.trigger("data",a)):(e=/^#EXT-X-SKIP:(.*)$/.exec(t))&&e[1]?((a={type:"tag",tagType:"skip"}).attributes=Un(e[1]),a.attributes.hasOwnProperty("SKIPPED-SEGMENTS")&&(a.attributes["SKIPPED-SEGMENTS"]=parseInt(a.attributes["SKIPPED-SEGMENTS"],10)),a.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")&&(a.attributes["RECENTLY-REMOVED-DATERANGES"]=a.attributes["RECENTLY-REMOVED-DATERANGES"].split(Kn)),void s.trigger("data",a)):(e=/^#EXT-X-PART:(.*)$/.exec(t))&&e[1]?((a={type:"tag",tagType:"part"}).attributes=Un(e[1]),["DURATION"].forEach((function(e){a.attributes.hasOwnProperty(e)&&(a.attributes[e]=parseFloat(a.attributes[e]))})),["INDEPENDENT","GAP"].forEach((function(e){a.attributes.hasOwnProperty(e)&&(a.attributes[e]=/YES/.test(a.attributes[e]))})),a.attributes.hasOwnProperty("BYTERANGE")&&(a.attributes.byterange=Nn(a.attributes.BYTERANGE)),void s.trigger("data",a)):(e=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(t))&&e[1]?((a={type:"tag",tagType:"server-control"}).attributes=Un(e[1]),["CAN-SKIP-UNTIL","PART-HOLD-BACK","HOLD-BACK"].forEach((function(e){a.attributes.hasOwnProperty(e)&&(a.attributes[e]=parseFloat(a.attributes[e]))})),["CAN-SKIP-DATERANGES","CAN-BLOCK-RELOAD"].forEach((function(e){a.attributes.hasOwnProperty(e)&&(a.attributes[e]=/YES/.test(a.attributes[e]))})),void s.trigger("data",a)):(e=/^#EXT-X-PART-INF:(.*)$/.exec(t))&&e[1]?((a={type:"tag",tagType:"part-inf"}).attributes=Un(e[1]),["PART-TARGET"].forEach((function(e){a.attributes.hasOwnProperty(e)&&(a.attributes[e]=parseFloat(a.attributes[e]))})),void s.trigger("data",a)):(e=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(t))&&e[1]?((a={type:"tag",tagType:"preload-hint"}).attributes=Un(e[1]),["BYTERANGE-START","BYTERANGE-LENGTH"].forEach((function(e){var t;a.attributes.hasOwnProperty(e)&&(a.attributes[e]=parseInt(a.attributes[e],10),t="BYTERANGE-LENGTH"===e?"length":"offset",a.attributes.byterange=a.attributes.byterange||{},a.attributes.byterange[t]=a.attributes[e],delete a.attributes[e])})),void s.trigger("data",a)):(e=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(t))&&e[1]?((a={type:"tag",tagType:"rendition-report"}).attributes=Un(e[1]),["LAST-MSN","LAST-PART"].forEach((function(e){a.attributes.hasOwnProperty(e)&&(a.attributes[e]=parseInt(a.attributes[e],10))})),void s.trigger("data",a)):void s.trigger("data",{type:"tag",data:t.slice(4)});s.trigger("data",{type:"tag",tagType:"discontinuity"})}}else s.trigger("data",{type:"comment",text:t.slice(1)})})):this.trigger("data",{type:"uri",uri:i}))},i.addParser=function(e){var t=this,i=e.expression,n=e.customType,r=e.dataParser,a=e.segment;"function"!=typeof r&&(r=function(e){return e}),this.customParsers.push((function(e){if(i.exec(e))return t.trigger("data",{type:"custom",data:r(e),customType:n,segment:a}),!0}))},i.addTagMapper=function(e){var t=e.expression,i=e.map;this.tagMappers.push((function(e){return t.test(e)?i(e):e}))},t}(On),Qn=function(e){function t(){var t=e.call(this)||this;t.lineStream=new Xn,t.parseStream=new Yn,t.lineStream.pipe(t.parseStream);var n,r,a=yt(t),o=[],u={},l=!1,c={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},d=0;t.manifest={allowCache:!0,discontinuityStarts:[],segments:[]};var h=0,p=0;return t.on("end",(function(){u.uri||!u.parts&&!u.preloadHints||(!u.map&&n&&(u.map=n),!u.key&&r&&(u.key=r),u.t
2imeline||"number"!=typeof d||(u.timeline=d),t.manifest.preloadSegment=u)})),t.parseStream.on("data",(function(s){var e,i;({tag:function(){({version:function(){s.version&&(this.manifest.version=s.version)},"allow-cache":function(){this.manifest.allowCache=s.allowed,"allowed"in s||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange:function(){var e={};"length"in s&&((u.byterange=e).length=s.length,"offset"in s||(s.offset=h)),"offset"in s&&((u.byterange=e).offset=s.offset),h=e.offset+e.length},endlist:function(){this.manifest.endList=!0},inf:function(){"mediaSequence"in this.manifest||(this.manifest.mediaSequence=0,this.trigger("info",{message:"defaulting media sequence to zero"})),"discontinuitySequence"in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger("info",{message:"defaulting discontinuity sequence to zero"})),0<s.duration&&(u.duration=s.duration),0===s.duration&&(u.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=o},key:function(){if(s.attributes)if("NONE"!==s.attributes.METHOD)if(s.attributes.URI){if("com.apple.streamingkeydelivery"===s.attributes.KEYFORMAT)return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:s.attributes});if("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"===s.attributes.KEYFORMAT)return-1===["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(s.attributes.METHOD)?void this.trigger("warn",{message:"invalid key method provided for Widevine"}):("SAMPLE-AES-CENC"===s.attributes.METHOD&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),"data:text/plain;base64,"!==s.attributes.URI.substring(0,23)?void this.trigger("warn",{message:"invalid key URI provided for Widevine"}):s.attributes.KEYID&&"0x"===s.attributes.KEYID.substring(0,2)?(this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:s.attributes.KEYFORMAT,keyId:s.attributes.KEYID.substring(2)},pssh:Mn(s.attributes.URI.split(",")[1])})):void this.trigger("warn",{message:"invalid key ID provided for Widevine"}));s.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),r={method:s.attributes.METHOD||"AES-128",uri:s.attributes.URI},void 0!==s.attributes.IV&&(r.iv=s.attributes.IV)}else this.trigger("warn",{message:"ignoring key declaration without URI"});else r=null;else this.trigger("warn",{message:"ignoring key declaration without attribute list"})},"media-sequence":function(){isFinite(s.number)?this.manifest.mediaSequence=s.number:this.trigger("warn",{message:"ignoring invalid media sequence: "+s.number})},"discontinuity-sequence":function(){isFinite(s.number)?(this.manifest.discontinuitySequence=s.number,d=s.number):this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+s.number})},"playlist-type":function(){/VOD|EVENT/.test(s.playlistType)?this.manifest.playlistType=s.playlistType:this.trigger("warn",{message:"ignoring unknown playlist type: "+s.playlist})},map:function(){n={},s.uri&&(n.uri=s.uri),s.byterange&&(n.byterange=s.byterange),r&&(n.key=r)},"stream-inf":function(){this.manifest.playlists=o,this.manifest.mediaGroups=this.manifest.mediaGroups||c,s.attributes?(u.attributes||(u.attributes={}),b(u.attributes,s.attributes)):this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},media:function(){var t;this.manifest.mediaGroups=this.manifest.mediaGroups||c,s.attributes&&s.attributes.TYPE&&s.attributes["GROUP-ID"]&&s.attributes.NAME?((t=this.manifest.mediaGroups[s.attributes.TYPE])[s.attributes["GROUP-ID"]]=t[s.attributes["GROUP-ID"]]||{},e=t[s.attributes["GROUP-ID"]],(i={default:/yes/i.test(s.attributes.DEFAULT)}).default?i.autoselect=!0:i.autoselect=/yes/i.test(s.attributes.AUTOSELECT),s.attributes.LANGUAGE&&(i.language=s.attributes.LANGUAGE),s.attributes.URI&&(i.uri=s.attributes.URI),s.attributes["INSTREAM-ID"]&&(i.instreamId=s.attributes["INSTREAM-ID"]),s.attributes.CHARACTERISTICS&&(i.characteristics=s.attributes.CHARACTERISTICS),s.attributes.FORCED&&(i.forced=/yes/i.test(s.attributes.FORCED)),e[s.attributes.NAME]=i):this.trigger("warn",{message:"ignoring incomplete or missing media group"})},discontinuity:function(){d+=1,u.discontinuity=!0,this.manifest.discontinuityStarts.push(o.length)},"program-date-time":function(){void 0===this.manifest.dateTimeString&&(this.manifest.dateTimeString=s.dateTimeString,this.manifest.dateTimeObject=s.dateTimeObject),u.dateTimeString=s.dateTimeString,u.dateTimeObject=s.dateTimeObject},targetduration:function(){!isFinite(s.duration)||s.duration<0?this.trigger("warn",{message:"ignoring invalid target duration: "+s.duration}):(this.manifest.targetDuration=s.duration,Fn.call(this,this.manifest))},start:function(){s.attributes&&!isNaN(s.attributes["TIME-OFFSET"])?this.manifest.start={timeOffset:s.attributes["TIME-OFFSET"],precise:s.attributes.PRECISE}:this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"})},"cue-out":function(){u.cueOut=s.data},"cue-out-cont":function(){u.cueOutCont=s.data},"cue-in":function(){u.cueIn=s.data},skip:function(){this.manifest.skip=Bn(s.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",s.attributes,["SKIPPED-SEGMENTS"])},part:function(){var i=this;l=!0;var e=this.manifest.segments.length,t=Bn(s.attributes);u.parts=u.parts||[],u.parts.push(t),t.byterange&&(t.byterange.hasOwnProperty("offset")||(t.byterange.offset=p),p=t.byterange.offset+t.byterange.length);var n=u.parts.length-1;this.warnOnMissingAttributes_("#EXT-X-PART #"+n+" for segment #"+e,s.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEac
2h((function(e,t){e.hasOwnProperty("lastPart")||i.trigger("warn",{message:"#EXT-X-RENDITION-REPORT #"+t+" lacks required attribute(s): LAST-PART"})}))},"server-control":function(){var e=this.manifest.serverControl=Bn(s.attributes);e.hasOwnProperty("canBlockReload")||(e.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),Fn.call(this,this.manifest),e.canSkipDateranges&&!e.hasOwnProperty("canSkipUntil")&&this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})},"preload-hint":function(){var e=this.manifest.segments.length,t=Bn(s.attributes),i=t.type&&"PART"===t.type;u.preloadHints=u.preloadHints||[],u.preloadHints.push(t),t.byterange&&(t.byterange.hasOwnProperty("offset")||(t.byterange.offset=i?p:0,i&&(p=t.byterange.offset+t.byterange.length)));var n=u.preloadHints.length-1;if(this.warnOnMissingAttributes_("#EXT-X-PRELOAD-HINT #"+n+" for segment #"+e,s.attributes,["TYPE","URI"]),t.type)for(var r=0;r<u.preloadHints.length-1;r++){var a=u.preloadHints[r];a.type&&a.type===t.type&&this.trigger("warn",{message:"#EXT-X-PRELOAD-HINT #"+n+" for segment #"+e+" has the same TYPE "+t.type+" as preload hint #"+r})}},"rendition-report":function(){var e=Bn(s.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(e);var t=this.manifest.renditionReports.length-1;e=["LAST-MSN","URI"],l&&e.push("LAST-PART"),this.warnOnMissingAttributes_("#EXT-X-RENDITION-REPORT #"+t,s.attributes,e)},"part-inf":function(){this.manifest.partInf=Bn(s.attributes),this.warnOnMissingAttributes_("#EXT-X-PART-INF",s.attributes,["PART-TARGET"]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),Fn.call(this,this.manifest)}}[s.tagType]||function(){}).call(a)},uri:function(){u.uri=s.uri,o.push(u),!this.manifest.targetDuration||"duration"in u||(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),u.duration=this.manifest.targetDuration),r&&(u.key=r),u.timeline=d,n&&(u.map=n),p=0,u={}},comment:function(){},custom:function(){s.segment?(u.custom=u.custom||{},u.custom[s.customType]=s.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[s.customType]=s.data)}})[s.type].call(a)})),t}vt(t,e);var i=t.prototype;return i.warnOnMissingAttributes_=function(e,t,i){var n=[];i.forEach((function(e){t.hasOwnProperty(e)||n.push(e)})),n.length&&this.trigger("warn",{message:e+" lacks required attribute(s): "+n.join(", ")})},i.push=function(e){this.lineStream.push(e)},i.end=function(){this.lineStream.push("\n"),this.trigger("end")},i.addParser=function(e){this.parseStream.addParser(e)},i.addTagMapper=function(e){this.parseStream.addTagMapper(e)},t}(On),$n={mp4:/^(av0?1|avc0?[1234]|vp0?9|flac|opus|mp3|mp4a|mp4v|stpp.ttml.im1t)/,webm:/^(vp0?[89]|av0?1|opus|vorbis)/,ogg:/^(vp0?[89]|theora|flac|opus|vorbis)/,video:/^(av0?1|avc0?[1234]|vp0?[89]|hvc1|hev1|theora|mp4v)/,audio:/^(mp4a|flac|vorbis|opus|ac-[34]|ec-3|alac|mp3|speex|aac)/,text:/^(stpp.ttml.im1t)/,muxerVideo:/^(avc0?1)/,muxerAudio:/^(mp4a)/,muxerText:/a^/},Jn=["video","audio","text"],Zn=["Video","Audio","Text"],er="mp4a.40.2",ir=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,nr=/^application\/dash\+xml/i;function tr(e,t){return(t=void 0===t?Object:t)&&"function"==typeof t.freeze?t.freeze(e):e}var rr=tr({HTML:"text/html",isHTML:function(e){return e===rr.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),ar=tr({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(e){return e===ar.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"}),sr={freeze:tr,MIME_TYPE:rr,NAMESPACE:ar},or=r((function(e,t){var i=sr.freeze;t.XML_ENTITIES=i({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),t.HTML_ENTITIES=i({lt:"<",gt:">",amp:"&",quot:'"',apos:"'",Agrave:"Ã",Aacute:"Ã",Acirc:"Ã",Atilde:"Ã",Auml:"Ã",Aring:"Ã
",AElig:"Ã",Ccedil
2:"Ã",Egrave:"Ã",Eacute:"Ã",Ecirc:"Ã",Euml:"Ã",Igrave:"Ã",Iacute:"Ã",Icirc:"Ã",Iuml:"Ã",ETH:"Ã",Ntilde:"Ã",Ograve:"Ã",Oacute:"Ã",Ocirc:"Ã",Otilde:"Ã",Ouml:"Ã",Oslash:"Ã",Ugrave:"Ã",Uacute:"Ã",Ucirc:"Ã",Uuml:"Ã",Yacute:"Ã",THORN:"Ã",szlig:"Ã",agrave:"à ",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"Ã¥",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"Ã",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"Â¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"ÂÂ",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",times:"Ã",divide:"÷",forall:"â",part:"â",exist:"â",empty:"â
",nabla:"â",isin:"â",notin:"â",ni:"â",prod:"â",sum:"â",minus:"â",lowast:"â",radic:"â",prop:"â",infin:"â",ang:"â ",and:"â§",or:"â¨",cap:"â©",cup:"âª",int:"â«",there4:"â´",sim:"â¼",cong:"â
",asymp:"â",ne:"â ",equiv:"â¡",le:"â¤",ge:"â¥",sub:"â",sup:"â",nsub
2:"â",sube:"â",supe:"â",oplus:"â",otimes:"â",perp:"â¥",sdot:"â
",Alpha:"Î",Beta:"Î",Gamma:"Î",Delta:"Î",Epsilon:"Î",Zeta:"Î",Eta:"Î",Theta:"Î",Iota:"Î",Kappa:"Î",Lambda:"Î",Mu:"Î",Nu:"Î",Xi:"Î",Omicron:"Î",Pi:"Î ",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Î¥",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"Ï",rho:"Ï",sigmaf:"Ï",sigma:"Ï",tau:"Ï",upsilon:"Ï
",phi:"Ï",chi:"Ï",psi:"Ï",omega:"Ï",thetasym:"Ï",upsih:"Ï",piv:"Ï",OElig:"Å",oelig:"Å",Scaron:"Å ",scaron:"Å¡",Yuml:"Ÿ",fnof:"Æ",circ:"Ë",tilde:"Ë",ensp:"â",emsp:"â",thinsp:"â",zwnj:"â",zwj:"â",lrm:"â",rlm:"â",ndash:"â",mdash:"â",lsquo:"â",rsquo:"â",sbquo:"â",ldquo:"â",rdquo:"â",bdquo:"â",dagger:"â ",Dagger:"â¡",bull:"â¢",hellip:"â¦",permil:"â°",prime:"â²",Prime:"â³",lsaquo:"â¹",rsaquo:"âº",oline:"â¾",euro:"â¬",trade:"â¢",larr:"â",uarr:"â",rarr:"â",darr:"â",harr:"â",crarr:"âµ",lceil:"â",rceil:"â",lfloor:"â",rfloor:"â",loz:"â",spades:"â ",clubs:"â£",hearts:"â¥",diams:"â¦"}),t.entityMap=t.HTML_ENTITIES}));or.XML_ENTITIES,or.HTML_ENTITIES,or.entityMap;var ur=sr.NAMESPACE,lr=(K=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,oi=new RegExp("[\\-\\.0-9"+K.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),new RegExp("^"+K.source+oi.source+"*(?::"+K.source+oi.source+"*)?$")),cr=0,dr=1,pr=2,fr=3,hr=4,mr=5,gr=6,yr=7;function vr(e,t){this.message=e,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,vr)}function _r(){}function Tr(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function Sr(e,t,i){for(var n=e.tagName,r=null,a=e.length;a--;){var s=e[a],o=s.qName,u=s.value;o=0<(c=o.indexOf(":"))?(l=s.prefix=o.slice(0,c),d=o.slice(c+1),"xmlns"===l&&d):(l=null,"xmlns"===(d=o)&&""),s.localName=d,!1!==o&&(null==r&&(r={},br(i,i={})),i[o]=r[o]=u,s.uri=ur.XMLNS,t.startPrefixMapping(o,u))}var l;for(a=e.length;a--;)(l=(s=e[a]).prefix)&&("xml"===l&&(s.uri=ur.XML),"xmlns"!==l&&(s.uri=i[l||""]));var c,d=0<(c=n.indexOf(":"))?(l=e.prefix=n.slice(0,c),e.localName=n.slice(c+1)):(l=null,e.localName=n),h=e.uri=i[l||""];if(t.startElement(h,d,n,e),!e.closed)return e.currentNSMap=i,e.localNSMap=r,1;if(t.endElement(h,d,n),r)for(l in r)t.endPrefixMapping(l)}function br(e,t){for(var i in e)t[i]=e[i]}function Er(){this.attributeNames={}}(vr.prototype=new Error).name=vr.name,_r.prototype={parse:function(e,t,i){var n=this.domBuilder;n.startDocument(),br(t,t={}),function(i,e,t,n,a){function s(e){var n=e.slice(1,-1);return n in t?t[n]:"#"===n.charAt(0)?65535<(n=parseInt(n.substr(1).replace("x","0x")))?(n-=65536,String.fromCharCode(55296+(n>>10),56320+(1023&n))):String.fromCharCode(n):(a.error("entity not found:"+e),e)}function r(e){var t;f<e&&(t=i.substring(f,e).replace(/&#?\w+;/g,s),d&&o(f),n.characters(t,0,e-f),f=e)}function o(e,t){for(;l<=e&&(t=c.exec(i));)u=t.index,l=u+t[0].length,d.lineNumber++;d.columnNumber=e-u+1}for(var u=0,l=0,c=/.*(?:\r\n?|\n)|.*$/g,d=n.locator,h=[{currentNSMap:e}],p={},f=0;;){try{var m,g,y=i.indexOf("<",f);if(y<0)return i.substr(f).match(/^\s*$/)||(g=(m=n.doc).createTextNode(i.substr(f)),m.appendChild(g),n.currentElement=g);switch(f<y&&r(y),i.charAt(y+1)){case"/":var v=i.indexOf(">",y+3),_=i.substring(y+2,v).replace(/[ \t\n\r]+$/g,""),b=h.pop();v<0?(_=i.substring(y+2).replace(/[\s<].*/,""),a.error("end tag name: "+_+" is not complete:"+b.tagName),v=y+1+_.length):_.match(/\s</)&&(_=_.replace(/[\s<].*/,""),a.error("end tag name: "+_+" maybe not complete"),v=y+1+_.length);var T=b.localNSMap,S=b.tagName==_;if(S||b.tagName&&b.tagName.toLowerCase()==_.toLowerCase()){if(n.endElement(b.uri,b.localName,_),T)for(var E in T)n.endPrefixMapping(E);S||a.fatalError("end tag name: "+_+" is not match the current start tagName:"+b.tagName)}else h.push(b);v++;break;case"?":d&&o(y),v=function(e,t,i){var n=e.indexOf("?>",t);return n&&(t=e.substring(t,n).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/))?(t[0].length,i.processingInstruction(t[1],t[2]),n+2):-1}(i,y,n);break;case"!":d&&o(y),v=function(e,t,i,n){if("-"===e.charAt(t+2)){if("-"!==e.charAt(t+3))return-1;var r=e.indexOf("--\x3e",t+4);return t<r?(i.comment(e,t+4,r-t-4),r+3):(n.error("Unclosed comment"),-1)}if("CDATA["==e.substr(t+3,6))return r=e.indexOf("]]>",t+9),i.startCDATA(),i.characters(e,t+9,r-t-9),i.endCDATA(),r+3;var a=function(e,t){var i,n=[],r=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(r.lastIndex=t,r.exec(e);i=r.exec(e);)if(n.push(i),i[1])return n}(e,t);return 1<(n=a.length)&&/!doctype/i.test(a[0][0])?(r=a[1][0],e=!1,t=!1,3<n&&(/^public$/i.test(a[2][0])?(e=a[3][0],t=4<n&&a[4][0]):/^system$/i.test(a[2][0])&&(t=a[3][0])),n=a[n-1],i.startDTD(r,e,t),i.endDTD(),n.index+n[0].length):-1}(i,y,n,a);break;default:d&&o(y);var k=new Er,C=h[h.length-1].currentNSMap,w=(v=function(e,t,n,i,r,a){function s(e,t,i){e in n.attributeNames&&a.fatalError("Attribute "+e+" redefined"),n.addValue(e,t,i)}for(var o,u=++t,l=cr;;){var c=e.charAt(u);switch(c){case"=":if(l===dr)o=e.slice(t,u),l=fr;else{if(l!==pr)throw new Error("attribute equal must after attrName");l=fr}break;case"'":case'"':if(l===fr||l===dr){if(l===dr&&(a.warning('attribute value must after "="'),o=e.slice(t,u)),t=u+1,!(0<(u=e.indexOf(c,t))))throw new Error("attribute value no end '"+c+"' match");s(o,d=e.slice(t,u).replace(/&#?\w+;/g,r),t-1),l=mr}else{if(l!=hr)throw new Error('attribute value must after "="');s(o,d=e.slice(t,u).replace(/&#?\w+;/g,r),t),a.warning('attribute "'+o+'" missed start quot('+c+")!!"),t=u+1,l=mr}break;case"/":switch(l){case cr:n.setTagName(e.slice(t,u));case mr:case gr:case yr:l=yr,n.closed=!0;case hr:case dr:case pr:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return a.error("unexpected end of input"),l==cr&&n.setTagName(e.slice(t,u)),u;case">":switch(l){case cr:n.setTagName(e.slice(t,u));case mr:case gr:case yr:break;case hr:case dr:"/"===(d=e.slice(t,u)).slice(-1)&&(n.closed=!0,d=d.slice(0,-1));case pr:l===pr&&(d=o),l==hr?(a.warning('attribute "'+d+'" missed quot(")!'),s(o,d.replace(/&#?\w+;/g,r),t)):(ur.isHTML(i[""])&&d.match(/^(?:disabled|checked|selected)$/i)||a.warning('attribute "'+d+'" missed value!! "'+d+'" instead!!'),s(d,d,t));break;case fr:throw new Error("attribute value missed!!")}return u;case"Â":c=" ";default:if(c<=" ")switch(l){case cr:n.setTagName(e.slice(t,u)),l=gr;break;case dr:o=e.slice(t,u),l=pr;break;case hr:var d=e.slice(t,u).replace(/&#?\w+;/g,r);a.warning('attribute "'+d+'" missed quot(")!!'),s(o,d,t);case mr:l=gr}else switch(l){case pr:n.tagName,ur.isHTML(i[""])&&o.match(/^(?:disabled|checked|selected)$/i)||a.warning('attribute "'+o+'" missed value!! "'+o+'" instead2!!'),s(o,o,t),t=u,l=dr;break;case mr:a.warning('attribute space is required"'+o+'"!!');case gr:l=dr,t=u;break;case fr:l=hr,t=u;break;case yr:throw new Error("elements closed character '/' and '>' must be connected to")}}u++}}(i,y,k,C,s,a),k.length);if(!k.closed&&function(e,t,i,n){var r=n[i];return null==r&&((r=e.lastIndexOf("</"+i+">"))<t&&(r=e.lastIndexOf("</"+i)),n[i]=r),r<t}(i,v,k.tagName,p)&&(k.closed=!0,t.nbsp||a.warning("unclosed xml attribute")),d&&w){for(var I=Tr(d,{}),A=0;A<w;A++){var x=k[A];o(x.offset),x.locator=Tr(d,{})}n.locator=I,Sr(k,n,C)&&h.push(k),n.locator=d}else Sr(k,n,C)&&h.push(k);ur.isHTML(k.uri)&&!k.closed?v=function(e,t,i,n,r){if(/^(?:script|textarea)$/i.test(i)){var a=e.indexOf("</"+i+">",t);if(e=e.substring(t+1,a),/[&<]/.test(e))return/^script$/i.test(i)||(e=e.replace(/&#?\w+;/g,n)),r.characters(e,0,e.length),a}return t+1}(i,v,k.tagName,s,n):v++}}catch(e){if(e instanceof vr)throw e;a.error("element parse error: "+e),v=-1}f<v?f=v:r(Math.max(y,f)+1)}}(e,t,i,n,this.errorHandler),n.endDocument()}},Er.prototype={setTagName:function(e){if(!lr.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},addValue:function(e,t,i){if(!lr.test(e))throw new Error("invalid attribute:"+e);this.attributeNames[e]=this.length,this[this.length++]={qName:e,value:t,offset:i}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}};var kr={XMLReader:_r,ParseError:vr},Cr=sr.NAMESPACE;function wr(e){return""!==e}function Ir(e,t){return e.hasOwnProperty(t)||(e[t]=!0),e}function Ar(e){return e?(e=e?e.split(/[\t\n\f\r ]+/).filter(wr):[],Object.keys(e.reduce(Ir,{}))):[]}function xr(e,t){for(var i in e)t[i]=e[i]}function Pr(e,t){var i,n=e.prototype;n instanceof t||((i=function(){}).prototype=t.prototype,xr(n,i=new i),e.prototype=n=i),n.constructor!=e&&(n.constructor=e)}var Lr,Dr=(ui={}).ELEMENT_NODE=1,Or=ui.ATTRIBUTE_NODE=2,Rr=ui.TEXT_NODE=3,Mr=ui.CDATA_SECTION_NODE=4,Nr=ui.ENTITY_REFERENCE_NODE=5,Ur=(ui.ENTITY_NODE=6,ui.PROCESSING_INSTRUCTION_NODE=7),Br=ui.COMMENT_NODE=8,Fr=ui.DOCUMENT_NODE=9,jr=ui.DOCUMENT_TYPE_NODE=10,Hr=ui.DOCUMENT_FRAGMENT_NODE=11,qr=(ui.NOTATION_NODE=12,Qt={},{});function Vr(e,t){var i;return t instanceof Error?i=t:(i=this,Error.call(this,qr[e]),this.message=qr[e],Error.captureStackTrace&&Error.captureStackTrace(this,Vr)),i.code=e,t&&(this.message=this.message+": "+t),i}function Wr(){}function zr(e,t){this._node=e,this._refresh=t,Gr(this)}function Gr(e){var t,i=e._node._inc||e._node.ownerDocument._inc;e._inc!=i&&(t=e._refresh(e._node),Ea(e,"length",t.length),xr(t,e),e._inc=i)}function Xr(){}function Kr(e,t){for(var i=e.length;i--;)if(e[i]===t)return i}function Yr(e,t,i,n){n?t[Kr(t,n)]=i:t[t.length++]=i,!e||(t=(i.ownerElement=e).ownerDocument)&&(n&&ia(t,e,n),t&&t._inc++,i.namespaceURI===Cr.XMLNS&&(e._nsMap[i.prefix?i.localName:""]=i.value))}function Qr(e,t,i){var n=Kr(t,i);if(!(0<=n))throw Vr(8,new Error(e.tagName+"@"+i));for(var r,a=t.length-1;n<a;)t[n]=t[++n];t.length=a,!e||(r=e.ownerDocument)&&(ia(r,e,i),i.ownerElement=null)}function $r(){}function Jr(){}function Zr(e){return("<"==e?"<":">"==e&&">")||"&"==e&&"&"||'"'==e&&"""||"&#"+e.charCodeAt()+";"}function ea(e,t){if(t(e))return 1;if(e=e.firstChild)do{if(ea(e,t))return 1}while(e=e.nextSibling)}function ta(){}function ia(e,t,i){e&&e._inc++,i.namespaceURI===Cr.XMLNS&&delete t._nsMap[i.prefix?i.localName:""]}function na(e,t,i){if(e&&e._inc){e._inc++;var n=t.childNodes;if(i)n[n.length++]=i;else{for(var r=t.firstChild,a=0;r;)r=(n[a++]=r).nextSibling;n.length=a}}}function ra(e,t){var i=t.previousSibling,n=t.nextSibling;return i?i.nextSibling=n:e.firstChild=n,n?n.previousSibling=i:e.last
2Child=i,na(e.ownerDocument,e),t}function aa(e,t,i){var n=t.parentNode;if(n&&n.removeChild(t),t.nodeType===Hr){var r=t.firstChild;if(null==r)return t;var a=t.lastChild}else r=a=t;for(n=i?i.previousSibling:e.lastChild,r.previousSibling=n,a.nextSibling=i,n?n.nextSibling=r:e.firstChild=r,null==i?e.lastChild=a:i.previousSibling=a;r.parentNode=e,r!==a&&(r=r.nextSibling););return na(e.ownerDocument||e,e),t.nodeType==Hr&&(t.firstChild=t.lastChild=null),t}function sa(){this._nsMap={}}function oa(){}function ua(){}function la(){}function ca(){}function da(){}function ha(){}function pa(){}function fa(){}function ma(){}function ga(){}function ya(){}function va(){}function _a(e,t){var i,n=[],r=9==this.nodeType&&this.documentElement||this,a=r.prefix,s=r.namespaceURI;return Sa(this,n,e,t,i=s&&null==a&&null==(a=r.lookupPrefix(s))?[{namespace:s,prefix:null}]:i),n.join("")}function ba(e,t,i){var n=e.prefix||"",r=e.namespaceURI;if(r&&("xml"!==n||r!==Cr.XML)&&r!==Cr.XMLNS){for(var a=i.length;a--;){var s=i[a];if(s.prefix===n)return s.namespace!==r}return 1}}function Ta(e,t,i){e.push(" ",t,'="',i.replace(/[<&"]/g,Zr),'"')}function Sa(e,t,i,n,r){if(r=r||[],n){if(!(e=n(e)))return;if("string"==typeof e)return void t.push(e)}switch(e.nodeType){case Dr:var o,g,l,a=e.attributes,s=a.length,c=e.firstChild,u=e.tagName,d=u;if(!(i=Cr.isHTML(e.namespaceURI)||i)&&!e.prefix&&e.namespaceURI){for(var h,f=0;f<a.length;f++)if("xmlns"===a.item(f).name){h=a.item(f).value;break}if(h!==e.namespaceURI)for(var m=r.length-1;0<=m;m--){var p=r[m];if(p.namespace===e.namespaceURI){p.prefix&&(d=p.prefix+":"+u);break}}}t.push("<",d);for(var y=0;y<s;y++)"xmlns"==(o=a.item(y)).prefix?r.push({prefix:o.localName,namespace:o.value}):"xmlns"==o.nodeName&&r.push({prefix:"",namespace:o.value});for(y=0;y<s;y++)ba(o=a.item(y),0,r)&&(Ta(t,(g=o.prefix||"")?"xmlns:"+g:"xmlns",l=o.namespaceURI),r.push({prefix:g,namespace:l})),Sa(o,t,i,n,r);if(u===d&&ba(e,0,r)&&(Ta(t,(g=e.prefix||"")?"xmlns:"+g:"xmlns",l=e.namespaceURI),r.push({prefix:g,namespace:l})),c||i&&!/^(?:meta|link|img|br|hr|input)$/i.test(u)){if(t.push(">"),i&&/^script$/i.test(u))for(;c;)c.data?t.push(c.data):Sa(c,t,i,n,r.slice()),c=c.nextSibling;else for(;c;)Sa(c,t,i,n,r.slice()),c=c.nextSibling;t.push("</",d,">")}else t.push("/>");return;case Fr:case Hr:for(c=e.firstChild;c;)Sa(c,t,i,n,r.slice()),c=c.nextSibling;return;case Or:return Ta(t,e.name,e.value),0;case Rr:return t.push(e.data.replace(/[<&]/g,Zr).replace(/]]>/g,"]]>"));case Mr:return t.push("<![CDATA[",e.data,"]]>");case Br:return t.push("\x3c!--",e.data,"--\x3e");case jr:var v=e.publicId,_=e.systemId;return t.push("<!DOCTYPE ",e.name),void(v?(t.push(" PUBLIC ",v),_&&"."!=_&&t.push(" ",_),t.push(">")):_&&"."!=_?t.push(" SYSTEM ",_,">"):((_=e.internalSubset)&&t.push(" [",_,"]"),t.push(">")));case Ur:return t.push("<?",e.target," ",e.data,"?>");case Nr:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function Ea(e,t,i){e[t]=i}Qt.INDEX_SIZE_ERR=(qr[1]="Index size error",1),Qt.DOMSTRING_SIZE_ERR=(qr[2]="DOMString size error",2),Qt.HIERARCHY_REQUEST_ERR=(qr[3]="Hierarchy request error",3),Qt.WRONG_DOCUMENT_ERR=(qr[4]="Wrong document",4),Qt.INVALID_CHARACTER_ERR=(qr[5]="Invalid character",5),Qt.NO_DATA_ALLOWED_ERR=(qr[6]="No data allowed",6),Qt.NO_MODIFICATION_ALLOWED_ERR=(qr[7]="No modification allowed",7),Qt.NOT_FOUND_ERR=(qr[8]="Not found",8),Qt.NOT_SUPPORTED_ERR=(qr[9]="Not supported",9),Qt.INUSE_ATTRIBUTE_ERR=(qr[10]="Attribute in use",10),Qt.INVALID_STATE_ERR=(qr[11]="Invalid state",11),Qt.SYNTAX_ERR=(qr[12]="Syntax error",12),Qt.INVALID_MODIFICATION_ERR=(qr[13]="Invalid modification",13),Qt.NAMESPACE_ERR=(qr[14]="Invalid namespace",14),Qt.INVALID_ACCESS_ERR=(qr[15]="Invalid access",15),Vr.prototype=Error.prototype,xr(Qt,Vr),Wr.prototype={length:0,item:function(e){return this[e]||null},toString:function(e,t){for(var i=[],n=0;n<this.length;n++)Sa(this[n],i,e,t);return i.join("")}},zr.prototype.item=function(e){return Gr(this),this[e]},Pr(zr,Wr),Xr.prototype={length:0,item:Wr.prototype.item,getNamedItem:function(e){for(var t=this.length;t--;){var i=this[t];if(i.nodeName==e)return i}},setNamedItem:function(e){var t=e.ownerElement;if(t&&t!=this._ownerElement)throw new Vr(10);return t=this.getNamedItem(e.nodeName),Yr(this._ownerElement,this,e,t),t},setNamedItemNS:function(e){var t=e.ownerElement;if(t&&t!=this._ownerElement)throw new Vr(10);return t=this.getNamedItemNS(e.namespaceURI,e.localName),Yr(this._ownerElement,this,e,t),t},removeNamedItem:function(e){return e=this.getNamedItem(e),Qr(this._ownerElement,this,e),e},removeNamedItemNS:function(e,t){return t=this.getNamedItemNS(e,t),Qr(this._ownerElement,this,t),t},getNamedItemNS:function(e,t){for(var i=this.length;i--;){var n=this[i];if(n.localName==t&&n.namespaceURI==e)return n}return null}},$r.prototype={hasFeature:function(e,t){return!0},createDocument:function(e,t,i){var n=new ta;return n.implementation=this,n.childNodes=new Wr,n.doctype=i||null,i&&n.appendChild(i),t&&(t=n.createElementNS(e,t),n.appendChild(t)),n},createDocumentType:function(e,t,i){var n=new ha;return n.name=e,n.nodeName=e,n.publicId=t||"",n.systemId=i||"",n}},Jr.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(e,t){return aa(this,e,t)},replaceChild:function(e,t){this.insertBefore(e,t),t&&this.removeChild(t)},removeChild:function(e){return ra(this,e)},appendChild:function(e){return this.insertBefore(e,null)},hasChildNodes:function(){return null!=this.firstChild},cloneNode:function(e){return function e(t,i,n){var r=new i.constructor;for(var a in i){var s=i[a];"object"!=typeof s&&s!=r[a]&&(r[a]=s)}switch(i.childNodes&&(r.childNodes=new Wr),r.ownerDocument=t,r.nodeType){case Dr:var o=i.attributes,u=r.attributes=new Xr,l=o.length;u._ownerElement=r;for(var c=0;c<l;c++)r.setAttributeNode(e(t,o.item(c),!0));break;case Or:n=!0}if(n)for(var d=i.firstChild;d;)r.appendChild(e(t,d,n)),d=d.nextSibling;return r}(this.ownerDocument||this,this,e)},normalize:function(){for(var e=this.firstChild;e;){var t=e.nextSibling;t&&t.nodeType==Rr&&e.nodeType==Rr?(this.removeChild(t),e.appendData(t.data)):(e.normalize(),e=t)}},isSupported:function(e,t){return this.ownerDocument.implementation.hasFeature(e,t)},hasAttributes:function(){return 0<this.attributes.length},lookupPrefix:function(e){for(var t=this;t;){var i=t._nsMap;if(i)for(var n in i)if(i[n]==e)return n;
2t=t.nodeType==Or?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var i=t._nsMap;if(i&&e in i)return i[e];t=t.nodeType==Or?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return null==this.lookupPrefix(e)}},xr(ui,Jr),xr(ui,Jr.prototype),ta.prototype={nodeName:"#document",nodeType:Fr,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType!=Hr)return null==this.documentElement&&e.nodeType==Dr&&(this.documentElement=e),aa(this,e,t),e.ownerDocument=this,e;for(var i=e.firstChild;i;){var n=i.nextSibling;this.insertBefore(i,t),i=n}return e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),ra(this,e)},importNode:function(e,t){return function e(t,i,n){var r;switch(i.nodeType){case Dr:(r=i.cloneNode(!1)).ownerDocument=t;case Hr:break;case Or:n=!0}if((r=r||i.cloneNode(!1)).ownerDocument=t,r.parentNode=null,n)for(var a=i.firstChild;a;)r.appendChild(e(t,a,n)),a=a.nextSibling;return r}(this,e,t)},getElementById:function(e){var i=null;return ea(this.documentElement,(function(t){if(t.nodeType==Dr&&t.getAttribute("id")==e)return i=t,!0})),i},getElementsByClassName:function(s){var e=Ar(s);return new zr(this,(function(t){var a=[];return 0<e.length&&ea(t.documentElement,(function(n){var r,i,o;n===t||n.nodeType!==Dr||(r=n.getAttribute("class"))&&((i=s===r)||(r=Ar(r),i=e.every((o=r,function(e){return o&&-1!==o.indexOf(e)}))),i&&a.push(n))})),a}))},createElement:function(e){var t=new sa;return t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.localName=e,t.childNodes=new Wr,(t.attributes=new Xr)._ownerElement=t},createDocumentFragment:function(){var e=new ga;return e.ownerDocument=this,e.childNodes=new Wr,e},createTextNode:function(e){var t=new la;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new ca;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){var t=new da;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var i=new ya;return i.ownerDocument=this,i.tagName=i.target=e,i.nodeValue=i.data=t,i},createAttribute:function(e){var t=new oa;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new ma;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var i=new sa,n=t.split(":"),r=i.attributes=new Xr;return i.childNodes=new Wr,i.ownerDocument=this,i.nodeName=t,i.tagName=t,i.namespaceURI=e,2==n.length?(i.prefix=n[0],i.localName=n[1]):i.localName=t,r._ownerElement=i},createAttributeNS:function(e,t){var i=new oa,n=t.split(":");return i.ownerDocument=this,i.nodeName=t,i.name=t,i.namespaceURI=e,i.specified=!0,2==n.length?(i.prefix=n[0],i.localName=n[1]):i.localName=t,i}},Pr(ta,Jr),ta.prototype.getElementsByTagName=(sa.prototype={nodeType:Dr,hasAttribute:function(e){return null!=this.getAttributeNode(e)},getAttribute:function(e){return(e=this.getAttributeNode(e))&&e.value||""},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){(e=this.ownerDocument.createAttribute(e)).value=e.nodeValue=""+t,this.setAttributeNode(e)},removeAttribute:function(e){(e=this.getAttributeNode(e))&&this.removeAttributeNode(e)},appendChild:function(e){return e.nodeType===Hr?this.insertBefore(e,null):function(e,t){var i=t.parentNode;i&&(n=e.lastChild,i.removeChild(t),n=e.lastChild);var n=e.lastChild;return t.parentNode=e,t.previousSibling=n,t.nextSibling=null,n?n.nextSibling=t:e.firstChild=t,e.lastChild=t,na(e.ownerDocument,e,t),t}(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){(t=this.getAttributeNodeNS(e,t))&&this.removeAttributeNode(t)},hasAttributeNS:function(e,t){return null!=this.getAttributeNodeNS(e,t)},getAttributeNS:function(e,t){return(t=this.getAttributeNodeNS(e,t))&&t.value||""},setAttributeNS:function(e,t,i){(t=this.ownerDocument.createAttributeNS(e,t)).value=t.nodeValue=""+i,this.setAttributeNode(t)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new zr(this,(function(t){var i=[];return ea(t,(function(n){n===t||n.nodeType!=Dr||"*"!==e&&n.tagName!=e||i.push(n)})),i}))},getElementsByTagNameNS:function(e,t){return new zr(this,(function(n){var i=[];return ea(n,(function(r){r===n||r.nodeType!==Dr||"*"!==e&&r.namespaceURI!==e||"*"!==t&&r.localName!=t||i.push(r)})),i}))}}).getElementsByTagName,ta.prototype.getElementsByTagNameNS=sa.prototype.getElementsByTagNameNS,Pr(sa,Jr),oa.prototype.nodeType=Or,Pr(oa,Jr),ua.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw new Error(qr[3])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,i){var n=this.data.substring(0,e);t=this.data.substring(e+t),this.nodeValue=this.data=i=n+i+t,this.length=i.length}},Pr(ua,Jr),la.prototype={nodeName:"#text",nodeType:Rr,splitText:function(e){var t=(i=this.data).substring(e),i=i.substring(0,e);return this.data=this.nodeValue=i,this.length=i.length,t=this.ownerDocument.createTextNode(t),this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling),t}},Pr(la,ua),ca.prototype={nodeName:"#comment",nodeType:Br},Pr(ca,ua),da.prototype={nodeName:"#cdata-section",nodeType:Mr},Pr(da,ua),ha.prototype.nodeType=jr,Pr(ha,Jr),pa.prototype.nodeType=12,Pr(pa,Jr),fa.prototype.nodeType=6,Pr(fa,Jr),ma.prototype.nodeType=Nr,Pr(ma,Jr),ga.prototype.nodeName="#document-fragment",ga.prototype.nodeType=Hr,Pr(ga,Jr),ya.prototype.nodeType=Ur,Pr(ya,Jr),va.prototype.serializeToString=function(e,t,i){return _a.call(e,t,i)},Jr.prototype.toString=_a;try{Object.defineProperty&&(Lr=function e(t){switch(t.nodeType){case Dr:case Hr:var i=[];for(t=t.firstChild;t;)7!==t.nodeType&&8!==t.nodeType&&i.push(e(t)),t=t.nextSibling;return i.join("");default:return t.nodeValue}},Object.defineProperty(zr.prototype,"length",{get:function(){return Gr(this),this.$$length}}),Object.defineProperty(Jr.prototype,"textContent",{get:function(){return Lr(this)},set:function(e){switch(this.nodeType){case Dr:case Hr:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),Ea=function(e,t,i){e["$$"+t]=i})}catch(e){}var ka={DocumentType:ha,DOMException:Vr,DOMImplementation:$r,Element:sa,Node:Jr,NodeList:Wr,XMLSerializer:va};On=r((function(e,t){var n=sr.NAMESPACE;function i(e){this.options=e||{locator:{}}}function r(){this.cdata=!1}function o(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}function l(e){if(e)return"\n@"+(e.systemId||"")+"#[line:"+e.lineNumber+",col:"+e.columnNumber+"]"}
2function c(e,t,i){return"string"==typeof e?e.substr(t,i):e.length>=t+i||t?new java.lang.String(e,t,i)+"":e}function p(e,t){(e.currentElement||e.doc).appendChild(t)}i.prototype.parseFromString=function(e,t){var i=this.options,o=new d,c=i.domBuilder||new r,a=i.errorHandler,s=i.locator,h=i.xmlns||{},u=/\/x?html?$/.test(t);return t=u?or.HTML_ENTITIES:or.XML_ENTITIES,s&&c.setDocumentLocator(s),o.errorHandler=function(e,t,n){if(!e){if(t instanceof r)return t;e=t}var a={},s=e instanceof Function;function o(t){var i=e[t];!i&&s&&(i=2==e.length?function(n){e(t,n)}:e),a[t]=i?function(e){i("[xmldom "+t+"]\t"+e+l(n))}:function(){}}return n=n||{},o("warning"),o("error"),o("fatalError"),a}(a,c,s),o.domBuilder=i.domBuilder||c,u&&(h[""]=n.HTML),h.xml=h.xml||n.XML,e&&"string"==typeof e?o.parse(e,h,t):o.errorHandler.error("invalid doc source"),c.doc},r.prototype={startDocument:function(){this.doc=(new a).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,i,n){var r=this.doc,a=r.createElementNS(e,i||t),s=n.length;p(this,a),this.currentElement=a,this.locator&&o(this.locator,a);for(var l=0;l<s;l++){e=n.getURI(l);var u=n.getValue(l),c=(i=n.getQName(l),r.createAttributeNS(e,i));this.locator&&o(n.getLocator(l),c),c.value=c.nodeValue=u,a.setAttributeNode(c)}},endElement:function(e,t,i){var n=this.currentElement;n.tagName,this.currentElement=n.parentNode},startPrefixMapping:function(e,t){},endPrefixMapping:function(e){},processingInstruction:function(e,t){t=this.doc.createProcessingInstruction(e,t),this.locator&&o(this.locator,t),p(this,t)},ignorableWhitespace:function(e,t,i){},characters:function(e,t,i){var n;(e=c.apply(this,arguments))&&(n=this.cdata?this.doc.createCDATASection(e):this.doc.createTextNode(e),this.currentElement?this.currentElement.appendChild(n):/^\s*$/.test(e)&&this.doc.appendChild(n),this.locator&&o(this.locator,n))},skippedEntity:function(e){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(e){(this.locator=e)&&(e.lineNumber=0)},comment:function(e,t,i){e=c.apply(this,arguments),e=this.doc.createComment(e),this.locator&&o(this.locator,e),p(this,e)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(e,t,i){var n=this.doc.implementation;n&&n.createDocumentType&&(i=n.createDocumentType(e,t,i),this.locator&&o(this.locator,i),p(this,i))},warning:function(e){},error:function(e){},fatalError:function(e){throw new h(e,this.locator)}},"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,(function(e){r.prototype[e]=function(){return null}}));var d=kr.XMLReader,h=kr.ParseError,a=t.DOMImplementation=ka.DOMImplementation;t.XMLSerializer=ka.XMLSerializer,t.DOMParser=i,t.__DOMHandler=r})),On.DOMImplementation,On.XMLSerializer;var Ca=On.DOMParser;function wa(e){return!!e&&"object"==typeof e}function Ia(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return t.reduce((function(e,i){return"object"!=typeof i||Object.keys(i).forEac
2h((function(t){Array.isArray(e[t])&&Array.isArray(i[t])?e[t]=e[t].concat(i[t]):wa(e[t])&&wa(i[t])?e[t]=Ia(e[t],i[t]):e[t]=i[t]})),e}),{})}function Aa(e){return e.reduce((function(e,t){return e.concat(t)}),[])}function xa(e){if(!e.length)return[];for(var t=[],i=0;i<e.length;i++)t.push(e[i]);return t}function Pa(e){var t=e.baseUrl,i=void 0===(n=e.source)?"":n,n=void 0===(n=e.range)?"":n;return e=void 0===(e=e.indexRange)?"":e,i={uri:i,resolvedUri:Pn((void 0===t?"":t)||"",i)},(n||e)&&(n=(n||e).split("-"),e=parseInt(n[0],10),n=parseInt(n[1],10),i.byterange={length:n-e+1,offset:e}),i}function La(e){return e&&"number"!=typeof e&&(e=parseInt(e,10)),isNaN(e)?null:e}function Da(e){var s,t=e.type,i=e.duration,n=e.timescale,r=void 0===n?1:n,a=e.periodDuration,o=e.sourceDuration;return e=function(e,t){for(var i=[],n=e;n<t;n++)i.push(n);return i}((n=ks[t](e)).start,n.end).map((s=e,function(e,t){var i=s.duration,n=s.timescale,r=s.periodIndex,a=s.startNumber;return{number:(void 0===a?1:a)+e,duration:i/(void 0===n?1:n),timeline:r,time:t*i}})),"static"===t&&(e[t=e.length-1].duration=("number"==typeof a?a:o)-i/r*t),e}function Oa(e){var t=e.baseUrl,i=void 0===(r=e.initialization)?{}:r,n=e.sourceDuration,r=void 0===(a=e.indexRange)?"":a,a=e.duration;if(!t)throw new Error(Ts);return i=Pa({baseUrl:t,source:i.sourceURL,range:i.range}),(r=Pa({baseUrl:t,source:t,indexRange:r})).map=i,a?(e=Da(e)).length&&(r.duration=e[0].duration,r.timeline=e[0].timeline):n&&(r.duration=n,r.timeline=0),r.number=0,[r]}function Ra(e,t,i){for(var n=e.sidx.map||null,r=e.sidx.duration,a=e.timeline||0,s=(s=e.sidx.byterange).offset+s.length,o=t.timescale,u=t.references.filter((function(e){return 1!==e.referenceType})),l=[],c=e.endList?"static":"dynamic",d=s+t.firstOffset,h=0;h<u.length;h++){var f=(p=t.references[h]).referencedSize,p=Oa({baseUrl:i,timescale:o,timeline:a,periodIndex:a,duration:p=p.subsegmentDuration,sourceDuration:r,indexRange:d+"-"+(d+f-1),type:c})[0];n&&(p.map=n),l.push(p),d+=f}return e.segments=l,e}function Ma(e){return e&&e.uri+"-"+(e=(t=e.byterange).offset+t.length-1,t.offset+"-"+e);var t}function Na(e){var t;return(t=e.reduce((function(e,t){var i,n=t.attributes.id+(t.attributes.lang||"");return e[n]?(t.segments[0]&&(t.segments[0].discontinuity=!0),(i=e[n].segments).push.apply(i,t.segments),t.attributes.contentProtection&&(e[n].attributes.contentProtection=t.attributes.contentProtection)):e[n]=t,e}),{}),Object.keys(t).map((function(e){return t[e]}))).map((function(e){var t,n;return e.discontinuityStarts=(t=e.segments,n="discontinuity",t.reduce((function(e,t,i){return t[n]&&e.push(i),e}),[])),e}))}function Ua(e,t){var i=Ma(e.sidx);return(i=i&&t[i]&&t[i].sidx)&&Ra(e,i,e.sidx.resolvedUri),e}function Ba(e,t,n){var r;return void 0===t&&(t={}),void 0===n&&(n=!1),e=e.reduce((function(e,o){var i=o.attributes.role&&o.attributes.role.value||"",l=o.attributes.lang||"",c=o.attributes.label||"main";e[c=l&&!o.attributes.label?o.attributes.lang+(i?" ("+i+")":""):c]||(e[c]={language:l,autoselect:!0,default:"main"===i,playlists:[],uri:""});var a,s,d,u=Ua((s=n,d=(a=o).attributes,u=a.segments,l=a.sidx,u={attributes:((a={NAME:d.id,BANDWIDTH:d.bandwidth,CODECS:d.codecs})["PROGRAM-ID"]=1,a),uri:"",endList:"static"===d.type,timeline:d.periodIndex,resolvedUri:"",targetDuration:d.duration,segments:u,mediaSequence:u.length?u[0].number:1},d.contentProtection&&(u.contentProtection=d.contentProtection),l&&(u.sidx=l),s&&(u.attributes.AUDIO="audio",u.attributes.SUBTITLES="subs"),u),t);return e[c].playlists.push(u),void 0===r&&"main"===i&&((r=o).default=!0),e}),{}),r||(e[Object.keys(e)[0]].default=!0),e}function Fa(e){var t=e.attributes,i=e.segments,n=e.sidx;return i={attributes:((e={NAME:t.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:t.width,height:t.height},CODECS:t.codecs,BANDWIDTH:t.bandwidth})["PROGRAM-ID"]=1,e),uri:"",endList:"static"===t.type,timeline:t.periodIndex,resolvedUri:"",targetDuration:t.duration,segments:i,mediaSequence:i.length?i[0].number:1},t.contentProtection&&(i.contentProtection=t.contentProtection),n&&(i.sidx=n),i}function ja(e){return"video/mp4"===(e=e.attributes).mimeType||"video/webm"===e.mimeType||"video"===e.contentType}function Ha(e){return"audio/mp4"===(e=e.attributes).mimeType||"audio/webm"===e.mimeType||"audio"===e.contentType}function qa(e){return"text/vtt"===(e=e.attributes).mimeType||"text"===e.contentType}function Va(e,t,i){if(void 0===i&&(i={}),!e.length)return{};var n,r=(d=e[0].attributes).sourceDuration,o=d.type,a=d.suggestedPresentationDelay,s=d.minimumUpdatePeriod,l=Na(e.filter(ja)).map(Fa),u=Na(e.filter(Ha)),c=e.filter(qa),d=e.map((function(e){return e.attributes.captionServices}
2)).filter(Boolean);return l={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:((e={AUDIO:{},VIDEO:{}})["CLOSED-CAPTIONS"]={},e.SUBTITLES={},e),uri:"",duration:r,playlists:function(e,t){if(void 0===t&&(t={}),!Object.keys(t).length)return e;for(var i in e)e[i]=Ua(e[i],t);return e}(l,i)},0<=s&&(l.minimumUpdatePeriod=1e3*s),t&&(l.locations=t),"dynamic"===o&&(l.suggestedPresentationDelay=a),a=0===l.playlists.length,u.length&&(l.mediaGroups.AUDIO.audio=Ba(u,i,a)),c.length&&(l.mediaGroups.SUBTITLES.subs=(void 0===(n=i)&&(n={}),c.reduce((function(e,t){var i=t.attributes.lang||"text";return e[i]||(e[i]={language:i,default:!1,autoselect:!1,playlists:[],uri:""}),e[i].playlists.push(Ua(function(e){var t=e.attributes,i=e.segments;return void 0===i&&(i=[{uri:t.baseUrl,timeline:t.periodIndex,resolvedUri:t.baseUrl||"",duration:t.sourceDuration,number:0}],t.duration=t.sourceDuration),(e={NAME:t.id,BANDWIDTH:t.bandwidth})["PROGRAM-ID"]=1,t.codecs&&(e.CODECS=t.codecs),{attributes:e,uri:"",endList:"static"===t.type,timeline:t.periodIndex,resolvedUri:t.baseUrl||"",targetDuration:t.duration,segments:i,mediaSequence:i.length?i[0].number:1}}(t),n)),e}),{}))),d.length&&(l.mediaGroups["CLOSED-CAPTIONS"].cc=d.reduce((function(e,t){return t&&t.forEach((function(t){var n=t.channel,i=t.language;e[i]={autoselect:!1,default:!1,instreamId:n,language:i},t.hasOwnProperty("aspectRatio")&&(e[i].aspectRatio=t.aspectRatio),t.hasOwnProperty("easyReader")&&(e[i].easyReader=t.easyReader),t.hasOwnProperty("3D")&&(e[i]["3D"]=t["3D"])})),e}),{})),l}function Wa(e,t){for(var i,n,r,a,s,o,u=e.type,l=e.minimumUpdatePeriod,c=void 0===l?0:l,d=void 0===(l=e.media)?"":l,h=e.sourceDuration,p=void 0===(l=e.timescale)?1:l,f=void 0===(l=e.startNumber)?1:l,m=e.periodIndex,g=[],y=-1,v=0;v<t.length;v++){var _=t[v],b=_.d,T=_.r||0,S=_.t||0;y<0&&(y=S),S&&y<S&&(y=S);var E,k=void 0;k=T<0?(E=v+1)===t.length?"dynamic"===u&&0<c&&0<d.indexOf("$Number$")?(i=y,n=b,_=o=s=a=r=void 0,r=(S=e).NOW,a=S.clientOffset,s=S.availabilityStartTime,o=S.timescale,_=S.start,S=S.minimumUpdatePeriod,Math.ceil((((r+a)/1e3+(void 0===S?0:S)-(s+(void 0===_?0:_)))*(void 0===o?1:o)-i)/n)):(h*p-y)/b:(t[E].t-y)/b:T+1;for(var C=f+g.length+k,w=f+g.length;w<C;)g.push({number:w,duration:b/p,time:y,timeline:m}),y+=b,w++}return g}function za(e,t){return e.replace(Cs,(n=t,function(e,t,i,r){return"$$"===e?"$":void 0===n[t]?e:(e=""+n[t],"RepresentationID"===t||(r=i?parseInt(r,10):1)<=e.length?e:new Array(r-e.length+1).join("0")+e)}));var n}function Ga(e,t){var a={RepresentationID:e.id,Bandwidth:e.bandwidth||0},n=void 0===(n=e.initialization)?{sourceURL:"",range:""}:n,s=Pa({baseUrl:e.baseUrl,source:za(n.sourceURL,a),range:n.range});return(n=t,(t=e).duration||n?t.duration?Da(t):Wa(t,n):[{number:t.startNumber||1,duration:t.sourceDuration,time:0,timeline:t.periodIndex}]).map((function(t){a.Number=t.number,a.Time=t.time;var n=za(e.media||"",a),i=e.timescale||1,r=e.presentationTimeOffset||0;return i=e.periodStart+(t.time-r)/i,{uri:n,timeline:t.timeline,duration:t.duration,resolvedUri:Pn(e.baseUrl||"",n),map:s,number:t.number,presentationTime:i}}))}function Xa(e,t){var n=e.duration,i=void 0===(i=e.segmentUrls)?[]:i,a=e.periodStart;if(!n&&!t||n&&t)throw new Error(Ss);var r,s=i.map((function(t){return i=t,t=(n=e).baseUrl,n=Pa({baseUrl:t,source:(n=void 0===(n=n.initialization)?{}:n).sourceURL,range:n.range}),(i=Pa({baseUrl:t,source:i.media,range:i.mediaRange})).map=n,i;var n,i}));return n&&(r=Da(e)),(r=t?Wa(e,t):r).map((function(t,n){if(s[n]){var i=s[n],r=e.timescale||1;return n=e.presentationTimeOffset||0,i.timeline=t.timeline,i.duration=t.duration,i.number=t.number,i.presentationTime=a+(t.time-n)/r,i}})).filter((function(e){return e}))}function Ka(e){var t,i=e.attributes,n=e.segmentInfo;n.template?(a=Ga,t=Ia(i,n.template)):n.base?(a=Oa,t=Ia(i,n.base)):n.list&&(a=Xa,t=Ia(i,n.list));var a,r={attributes:i};return a?(e=a(t,n.segmentTimeline),t.duration?(i=t.duration,a=t.timescale,t.duration=i/(void 0===a?1:a)):e.length?t.duration=e.reduce((function(e,t){return Math.max(e,Math.ceil(t.duration))}),0):t.duration=0,r.attributes=t,r.segments=e,n.base&&t.indexRange&&(r.sidx=e[0],r.segments=[]),r):r}function Ya(e,t){return xa(e.childNodes).filter((function(e){return e.tagName===t}))}function Qa(e){return e.textContent.trim()}function $a(e){if(!(r=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(e)))return 0;var t=(a=r.slice(1))[0],i=a[1],n=a[2],r=(e=a[3],a[4]),a=a[5];
2return 31536e3*parseFloat(t||0)+2592e3*parseFloat(i||0)+86400*parseFloat(n||0)+3600*parseFloat(e||0)+60*parseFloat(r||0)+parseFloat(a||0)}function Ja(e){return e&&e.attributes?xa(e.attributes).reduce((function(e,t){var i=ws[t.name]||ws.DEFAULT;return e[t.name]=i(t.value),e}),{}):{}}function Za(e,i){return i.length?Aa(e.map((function(e){return i.map((function(t){return Pn(e,Qa(t))}))}))):e}function es(e){var t=Ya(e,"SegmentTemplate")[0],i=Ya(e,"SegmentList")[0],n=i&&Ya(i,"SegmentURL").map((function(e){return Ia({tag:"SegmentURL"},Ja(e))})),r=Ya(e,"SegmentBase")[0],a=(e=(a=i||t)&&Ya(a,"SegmentTimeline")[0],(a=i||r||t)&&Ya(a,"Initialization")[0]);(t=t&&Ja(t))&&a?t.initialization=a&&Ja(a):t&&t.initialization&&(t.initialization={sourceURL:t.initialization});var s={template:t,segmentTimeline:e&&Ya(e,"S").map(Ja),list:i&&Ia(Ja(i),{segmentUrls:n,initialization:Ja(a)}),base:r&&Ia(Ja(r),{initialization:Ja(a)})};return Object.keys(s).forEach((function(e){s[e]||delete s[e]})),s}function ts(u,e,t){return function(n){var r=Ja(n),i=Za(e,Ya(n,"BaseURL")),o={role:Ja(o=Ya(n,"Role")[0])};r=Ia(u,r,o),o="urn:scte:dash:cc:cea-608:2015"===(o=Ja(o=Ya(n,"Accessibility")[0])).schemeIdUri?o.value.split(";").map((function(e){var t,i,n;return/^CC\d=/.test(n=e)?(i=(t=e.split("="))[0],n=t[1]):/^CC\d$/.test(e)&&(i=e),{channel:i,language:n}})):"urn:scte:dash:cc:cea-708:2015"===o.schemeIdUri?o.value.split(";").map((function(e){var t,i,n={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};return/=/.test(e)?(t=(i=e.split("="))[0],i=void 0===(i=i[1])?"":i,n.channel=t,n.language=e,i.split(",").forEach((function(e){e=(t=e.split(":"))[0];var t=t[1];"lang"===e?n.language=t:"er"===e?n.easyReader=Number(t):"war"===e?n.aspectRatio=Number(t):"3D"===e&&(n["3D"]=Number(t))}))):n.language=e,n.channel&&(n.channel="SERVICE"+n.channel),n})):void 0,o&&(r=Ia(r,{captionServices:o})),(o=Ya(n,"Label")[0])&&o.childNodes.length&&(r=Ia(r,{label:c=o.childNodes[0].nodeValue.trim()}));var a,s,l,c=Ya(n,"ContentProtection").reduce((function(e,t){var i=Ja(t),n=Is[i.schemeIdUri];return n&&(e[n]={attributes:i},(t=Ya(t,"cenc:pssh")[0])&&(t=(t=Qa(t))&&Mn(t),e[n].pssh=t)),e}),{});return Object.keys(c).length&&(r=Ia(r,{contentProtection:c})),c=es(n),n=Ya(n,"Representation"),c=Ia(t,c),Aa(n.map((a=r,s=i,l=c,function(e){var t=Ya(e,"BaseURL"),i=(t=Za(s,t),Ia(a,Ja(e))),n=es(e);return t.map((function(e){return{segmentInfo:Ia(l,n),attributes:Ia(i,{baseUrl:e})}}))})))}}function is(e,t){var i=t=void 0===t?{}:t,n=void 0===(a=i.manifestUri)?"":a,r=(t=void 0===(r=i.NOW)?Date.now():r,void 0===(a=i.clientOffset)?0:a);if(!(i=Ya(e,"Period")).length)throw new Error(vs);var a=Ya(e,"Location"),s=Ja(e);e=Za([n],Ya(e,"BaseURL")),s.type=s.type||"static",s.sourceDuration=s.mediaPresentationDuration||0,s.NOW=t,s.clientOffset=r,a.length&&(s.locations=a.map(Qa));var l,u,c=[];return i.forEach((function(e,t){var i,n=Ja(e),r=c[t-1];n.start=(t=(i={attributes:n,priorPeriodAttributes:r?r.attributes:null,mpdType:s.type}).attributes,r=i.priorPeriodAttributes,i=i.mpdType,"number"==typeof t.start?t.start:r&&"number"==typeof r.start&&"number"==typeof r.duration?r.start+r.duration:r||"static"!==i?null:0),c.push({node:e,attributes:n})})),{locations:s.locations,representationInfo:Aa(c.map((l=s,u=e,function(e,t){var i=Za(u,Ya(e.node,"BaseURL")),n=parseInt(e.attributes.id,10);return t=o.isNaN(n)?t:n,n=Ia(l,{periodIndex:t,periodStart:e.attributes.start}),"number"==typeof e.attributes.duration&&(n.periodDuration=e.attributes.duration),t=Ya(e.node,"AdaptationSet"),e=es(e.node),Aa(t.map(ts(n,i,e)))})))}}function ns(e){if(""===e)throw new Error(_s);var t,i,n=new Ca;try{i=(t=n.parseFromString(e,"application/xml"))&&"MPD"===t.documentElement.tagName?t.documentElement:null}catch(e){}if(!i||i&&0<i.getElementsByTagName("parsererror").length)throw new Error(bs);return i}function rs(e,t){void 0===t&&(t={});var i=is(ns(e),t);return Va(e=i.representationInfo.map(Ka),i.locations,t.sidxMapping)}function as(e){return function(e){if(!(e=Ya(e,"UTCTiming")[0]))return null;var t=Ja(e);switch(t.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":t.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":t.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":t.method="DIRECT",t.value=Date.parse(t.value);break;default:throw new Error(Es)}return t}(ns(e))}function ss(e){return e instanceof Uint8Array?e:(Array.isArray(e)||(t=e,ArrayBuffer.isView(t))||e instanceof ArrayBuffer||(e="number"!=typeof e||"number"==typeof e&&e!=e?0:[e]),new Uint8Array(e&&e.buffer||e,e&&e.byteOffset||0,e&&e.byteLength||0));var t}function os(e,t){for(var i=void 0!==(t=(void 0===t?{}:t).le)&&t,n=(t=e=Ps(e="bigint"!=typeof e&&"number"!=typeof e||"number"==typeof e&&e!=e?0:e),Math.ceil(t.toString(2).length/8)),r=new
2Uint8Array(new ArrayBuffer(n)),a=0;a<n;a++){var s=i?a:Math.abs(a+1-r.length);r[s]=Number(e/Ls[a]&Ps(255)),e<0&&(r[s]=Math.abs(~r[s]),r[s]-=0===a?1:2)}return r}function us(e,t){if("string"!=typeof(e="string"!=typeof e&&e&&"function"==typeof e.toString?e.toString():e))return new Uint8Array;t||(e=unescape(encodeURIComponent(e)));for(var i=new Uint8Array(e.length),n=0;n<e.length;n++)i[n]=e.charCodeAt(n);return i}function ls(i,e,t){var n=void 0===t?{}:t,r=void 0===(t=n.offset)?0:t,a=void 0===(n=n.mask)?[]:n;return i=ss(i),n=(e=ss(e)).every||Array.prototype.every,e.length&&i.length-r>=e.length&&n.call(e,(function(e,t){return e===(a[t]?a[t]&i[r+t]:i[r+t])}))}function cs(e,t){return void 0===t&&(t=0),(e=ss(e)).length-t<10||!ls(e,Ds,{offset:t})?t:cs(e,t+=function(e,t){void 0===t&&(t=0);var i=(e=ss(e))[t+5];return t=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9],(16&i)>>4?20+t:10+t}(e,t))}function ds(e){return"string"==typeof e?us(e):e}function hs(e,t,i){var n;void 0===i&&(i=!1),n=t,t=Array.isArray(n)?n.map(ds):[ds(n)],e=ss(e);var r=[];if(!t.length)return r;for(var a=0;a<e.length;){var s=(e[a]<<24|e[a+1]<<16|e[a+2]<<8|e[a+3])>>>0,o=e.subarray(a+4,a+8);if(0==s)break;var u=a+s;if(u>e.length){if(i)break;u=e.length}s=e.subarray(a+8,u),ls(o,t[0])&&(1===t.length?r.push(s):r.push.apply(r,hs(s,t.slice(1),i))),a=u}return r}function ps(e,t,i,n){void 0===i&&(i=!0),void 0===n&&(n=!1);var r=function(e){for(var t=1,i=0;i<Rs.length&&!(e&Rs[i]);i++)t++;return t}(e[t]),a=e.subarray(t,t+r);return i&&((a=Array.prototype.slice.call(e,t,t+r))[0]^=Rs[r-1]),{length:r,value:function(e,t){t=void 0!==(t=(n=void 0===t?{}:t).signed)&&t;var n,r=void 0!==(n=n.le)&&n;return n=((e=ss(e))[n=r?"reduce":"reduceRight"]||Array.prototype[n]).call(e,(function(t,n,i){return i=r?i:Math.abs(i+1-e.length),t+Ps(n)*Ls[i]}),Ps(0)),!t||(t=Ls[e.length]/Ps(2)-Ps(1))<(n=Ps(n))&&(n-=t,n-=t,n-=Ps(2)),Number(n)}(a,{signed:n}),bytes:a}}function fs(e){return"string"==typeof e?e.match(/.{1,2}/g).map(fs):"number"==typeof e?os(e):e}function ms(e,t,i){if(i>=t.length)return t.length;var n=ps(t,i,!1);if(ls(e.bytes,n.bytes))return i;var r=ps(t,i+n.length);return ms(e,t,i+r.length+r.value+n.length)}function gs(e,t){var i;i=t,t=Array.isArray(i)?i.map(fs):[fs(i)],e=ss(e);var n=[];if(!t.length)return n;for(var r=0;r<e.length;){var a=ps(e,r,!1),s=ps(e,r+a.length),o=r+a.length+s.length;127===s.value&&(s.value=ms(a,e,o),s.value!==e.length&&(s.value-=o));var u=o+s.value>e.length?e.length:o+s.value;u=e.subarray(o,u),ls(t[0],a.bytes)&&(1===t.length?n.push(u):n=n.concat(gs(u,t.slice(1)))),r+=a.length+s.length+u.length}return n}function ys(e,t,i,n){void 0===n&&(n=1/0),e=ss(e),i=[].concat(i);for(var r,a=0,s=0;a<e.length&&(s<n||r);){var o=void 0;if(ls(e.subarray(a),Ms)?o=4:ls(e.subarray(a),Ns)&&(o=3),o){if(s++,r)return function(e){for(var t=[],i=1;i<e.length-2;)ls(e.subarray(i,i+3),Us)&&(t.push(i+2),i++),i++;if(0===t.length)return e;var n=e.length-t.length,r=new Uint8Array(n),a=0;for(i=0;i<n;a++,i++)a===t[0]&&(a++,t.shift()),r[i]=e[a];return r}(e.subarray(r,a));var u=void 0;"h264"===t?u=31&e[a+o]:"h265"===t&&(u=e[a+o]>>1&63),-1!==i.indexOf(u)&&(r=a+o),a+=o+("h264"===t?1:2)}else a++}return e.subarray(0,0)}On.__DOMHandler;var vs="INVALID_NUMBER_OF_PERIOD",_s="DASH_EMPTY_MANIFEST",bs="DASH_INVALID_XML",Ts="NO_BASE_URL",Ss="SEGMENT_TIME_UNSPECIFIED",Es="UNSUPPORTED_UTC_TIMING_SCHEME",ks={static:function(e){var t=e.duration,n=void 0===(i=e.timescale)?1:i,r=e.sourceDuration,i=e.periodDuration;return n=t/n,"number"==typeof(e=La(e.endNumber))?{start:0,end:e}:"number"==typeof i?{start:0,end:i/n}:{start:0,end:r/n}},dynamic:function(e){var t=e.NOW,i=e.clientOffset,n=e.availabilityStartTime,a=void 0===(o=e.timescale)?1:o,s=e.duration,u=void 0===(r=e.start)?0:r,r=void 0===(o=e.minimumUpdatePeriod)?0:o,o=void 0===(o=e.timeShiftBufferDepth)?1/0:o;return e=La(e.endNumber),i=(t+i)/1e3,u=n+u,r=Math.ceil((i+r-u)*a/s),o=Math.floor((i-u-o)*a/s),s=Math.floor((i-u)*a/s),{start:Math.max(0,o),end:"number"==typeof e?e:Math.min(r,s)}}},Cs=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,ws={mediaPresentationDuration:$a,availabilityStartTime:function(e){return/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(e)&&(e+="Z"),Date.parse(e)/1e3},minimumUpdatePeriod:$a,suggestedPresentationDelay:$a,type:function(e){return e},timeShiftBufferDepth:$a,start:$a,width:function(e){return parseInt(e,10)},height:function(e){return parseInt(e,10)},bandwidth:function(e){return parseInt(e,10)},startNumber:function(e){return parseInt(e,10)},timescale:function(e){return parseInt(e,10)},presentationTimeOffset:function(e){return parseInt(e,10)},duration:function(e){var t=parseInt(e,10);return isNaN(t)?$a(e):t},d:function(e){return parseInt(e,10)},t:function(e){return parseInt(e,10)},r:function(e){return parseInt(e,10)},DEFAULT:function(e){return e}},Is={"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"},As=Math.pow(2,32),xs=function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),references:[],referenceId:t.getUint32(4),timescale:t.getUint32(8)},n=12;0===i.version?(i.earliestPresentationTime=t.getUint32(n),i.firstOffset=t.getUint32(n+4),n+=8):(i.earliestPresentationTime=t.getUint32(n)*As+t.getUint32(n+4),i.firstOffset=t.getUint32(n+8)*As+t.getUint32(n+12),n+=16);var r=t.getUint16(n+=2);for(n+=2;0<r;n+=12,r--)i.references.push({referenceType:(128&e[n])>>>7,referencedSize:2147483647&t.getUint32(n),subsegmentDuration:t.getUint32(n+4),startsWithSap:!!(128&e[n+8]),sapType:(112&e[n+8])>>>4,sapDeltaTime:268435455&t.getUint32(n+8)});return i},Ps=o.BigInt||Number,Ls=[Ps("0x1"),Ps("0x100"),Ps("0x10000"),Ps("0x1000000"),Ps("0x100000000"),Ps("0x10000000000"),Ps("0x1000000000000"),Ps("0x100000000000000"),Ps("0x10000000000000000")],Ds=ss([73,68,51]),Os={EBML:ss([26,69,223,163]),DocType:ss([66,130]),Segment:ss([24,83,128,103]),SegmentInfo:ss([21,73,169,102]),Tracks:ss([22,84,174,107]),Track:ss([174]),TrackNumber:ss([215]),DefaultDuration:ss([35,227,131]),TrackEntry:ss([174]),TrackType:ss([131]),FlagDefault:ss([136]),CodecID:ss([134]),CodecPr
2ivate:ss([99,162]),VideoTrack:ss([224]),AudioTrack:ss([225]),Cluster:ss([31,67,182,117]),Timestamp:ss([231]),TimestampScale:ss([42,215,177]),BlockGroup:ss([160]),BlockDuration:ss([155]),Block:ss([161]),SimpleBlock:ss([163])},Rs=[128,64,32,16,8,4,2,1],Ms=ss([0,0,0,1]),Ns=ss([0,0,1]),Us=ss([0,0,3]),Bs={webm:ss([119,101,98,109]),matroska:ss([109,97,116,114,111,115,107,97]),flac:ss([102,76,97,67]),ogg:ss([79,103,103,83]),ac3:ss([11,119]),riff:ss([82,73,70,70]),avi:ss([65,86,73]),wav:ss([87,65,86,69]),"3gp":ss([102,116,121,112,51,103]),mp4:ss([102,116,121,112]),fmp4:ss([115,116,121,112]),mov:ss([102,116,121,112,113,116]),moov:ss([109,111,111,118]),moof:ss([109,111,111,102])},Fs={aac:function(e){return ls(e,[255,16],{offset:cs(e),mask:[255,22]})},mp3:function(e){return ls(e,[255,2],{offset:cs(e),mask:[255,6]})},webm:function(e){return ls(e=gs(e,[Os.EBML,Os.DocType])[0],Bs.webm)},mkv:function(e){return ls(e=gs(e,[Os.EBML,Os.DocType])[0],Bs.matroska)},mp4:function(e){return!Fs["3gp"](e)&&!Fs.mov(e)&&(!(!ls(e,Bs.mp4,{offset:4})&&!ls(e,Bs.fmp4,{offset:4}))||!(!ls(e,Bs.moof,{offset:4})&&!ls(e,Bs.moov,{offset:4}))||void 0)},mov:function(e){return ls(e,Bs.mov,{offset:4})},"3gp":function(e){return ls(e,Bs["3gp"],{offset:4})},ac3:function(e){var t=cs(e);return ls(e,Bs.ac3,{offset:t})},ts:function(e){if(e.length<189&&1<=e.length)return 71===e[0];for(var t=0;t+188<e.length&&t<188;){if(71===e[t]&&71===e[t+188])return!0;t+=1}return!1},flac:function(e){var t=cs(e);return ls(e,Bs.flac,{offset:t})},ogg:function(e){return ls(e,Bs.ogg)},avi:function(e){return ls(e,Bs.riff)&&ls(e,Bs.avi,{offset:8})},wav:function(e){return ls(e,Bs.riff)&&ls(e,Bs.wav,{offset:8})},h264:function(e){return ys(e,"h264",7,3).length},h265:function(e){return ys(e,"h265",[32,33],3).length}},js=Object.keys(Fs).filter((function(e){return"ts"!==e&&"h264"!==e&&"h265"!==e})).concat(["ts","h264","h265"]);function Hs(e){e=ss(e);for(var t=0;t<js.length;t++){var i=js[t];if(vu[i](e))return i}return""}function qs(e,t,i){return e&&i&&i.responseURL&&t!==i.responseURL?i.responseURL:t}function Vs(e){return xn.log.debug?xn.log.debug.bind(xn,"VHS:",e+" >"):function(){}}function Ws(e,t){var i,n=[];if(e&&e.length)for(i=0;i<e.length;i++)t(e.start(i),e.end(i))&&n.push([e.start(i),e.end(i)]);return xn.createTimeRanges(n)}function zs(e,i){return Ws(e,(function(e,t){return e-.1<=i&&i<=t+.1}))}function Gs(e,t){return Ws(e,(function(e){return t<=e-Tu}))}function Xs(e){var t=[];if(!e||!e.length)return"";for(var i=0;i<e.length;i++)t.push(e.start(i)+" => "+e.end(i));return t.join(", ")}function Ks(e){for(var t=[],i=0;i<e.length;i++)t.push({start:e.start(i),end:e.end(i)});return t}function Ys(e){if(e&&e.length&&e.end)return e.end(e.length-1)}function Qs(e){return(e.segments||[]).reduce((function(i,e,t){return e.parts?e.parts.forEach((function(n,r){i.push({duration:n.duration,segmentIndex:t,partIndex:r,part:n,segment:e})})):i.push({duration:e.duration,segmentIndex:t,partIndex:null,segment:e,part:null}),i}),[])}function $s(e){return(e=e.segments&&e.segments.length&&e.segments[e.segments.length-1])&&e.parts||[]}function Js(e){var t=e.preloadSegment;if(t)return e=t.parts,t=(t.preloadHints||[]).reduce((function(e,t){return e+("PART"===t.type?1:0)}),0),t+(e&&e.length?e.length:0)}function Zs(e,t){return t.endList?0:e&&e.suggestedPresentationDelay?e.suggestedPresentationDelay:(e=0<$s(t).length)&&t.serverControl&&t.serverControl.partHoldBack?t.serverControl.partHoldBack:e&&t.partTargetDuration?3*t.partTargetDuration:t.serverControl&&t.serverControl.holdBack?t.serverControl.holdBack:t.targetDuration?3*t.targetDuration:0}function eo(e,t,i){if((t=void 0===t?e.mediaSequence+e.segments.length:t)<e.mediaSequence)return 0;var n=function(e,t){var i=0,n=t-e.mediaSequence,r=e.segments[n];if(r){if(void 0!==r.start)return{result:r.start,precise:!0};if(void 0!==r.end)return{result:r.end-r.duration,precise:!0}}for(;n--;){if(void 0!==(r=e.segments[n]).end)return{result:i+r.end,precise:!0};if(i+=r.duration,void 0!==r.start)return{result:i+r.start,precise:!0}}return{result:i,precise:!1}}(e,t);return n.precise?n.result:(t=function(e,t){for(var i,n=0,r=t-e.mediaSequence;r<e.segments.length;r++){if(void 0!==(i=e.segments[r]).start)return{result:i.start-n,precise:!0};if(n+=i.duration,void 0!==i.end)return{result:i.end-n,precise:!0}}return{result:-1,precise:!1}}(e,t)).precise?t.result:n.result+i}function to(e,t,i){if(!e)return 0;if(void 0===t){if(e.totalDuration)return e.totalDuration;if(!e.endList)return o.Infinity}return eo(e,t,i="number"!=typeof i?0:i)}function io(e){var t=e.defaultDuration,i=e.durationList,n=e.startIndex,r=e.endIndex,a=0;if(r<n&&(n=(e=[r,n])[0],r=e[1]),n<0){for(var s=n;s<Math.min(0,r);s++)a+=t;n=0}for(var o=n;o<r;o++)a+=i[o].duration;return a}function no(e,t,i,n){return e&&e.segments?e.endList?to(e):null===t?null:(t=eo(e,e.mediaSequence+e.segments.length,t=t||0),i&&(t-=n="number"==typeof n?n:Zs(null,e)),Math.max(0,t)):null}function ro(e){return e.excludeUntil&&e.excludeUntil>Date.now()}function ao(e){return e.excludeUntil&&e.excludeUntil===1/0}function so(e){var t=ro(e);return!e.disabled&&!t}function oo(e,t){return t.attributes&&t.attributes[e]}function uo(e,t){if(1===e.playlists.length)return!0;var i=t.attributes.BANDWIDTH||Number.MAX_VALUE;return 0===e.playlists.filter((function(e){return!!so(e)&&(e.attributes.BANDWIDTH||0)<i})).length}function lo(e,t){return!(!e&&!t||!e&&t||e&&!t||e!==t&&(!e.id||!t.id||e.id!==t.id)&&(!e.resolvedUri||!t.resolvedUri||e.resolvedUri!==t.resolvedUri)&&(!e.uri||!t.uri||e.uri!==t.uri))}function co(e,t){var i,n=e&&e.mediaGroups&&e.mediaGroups.AUDIO||{},r=!1;for(i in n){for(var a in n[i])if(r=t(n[i][a]))break;if(r)break}return!!r}function ho(i){if(!i||!i.playlists||!i.playlists.length)return co(i,(function(e){return e.playlists&&e.playlists.length||e.uri}));for(var e=0;e<i.playlists.length;e++){var t=function(e){var t=i.playlists[e];return(e=t.attributes&&t.attributes.CODECS)&&e.split(",").every(qn)||co(i,(function(e){return lo(t,e)}))?"continue":{v:!1}}(e);if("continue"!==t&&"object"==typeof t)return t.v}return!0}function po(e,t){return e+"-"+t}function fo(e,a){e.mediaGroups&&["AUDIO","SUBTITLES"].forEach((function(t){if(e.mediaGroups[t])for(var n in e.mediaGroups[t])for(var i in e.mediaGroups[t][n]){var r=e.mediaGroups[t][n][i];a(r,t,n,i)}}))}
2function mo(e){var t=e.playlist,i=e.uri;e=e.id,t.id=e,t.playlistErrors_=0,i&&(t.uri=i),t.attributes=t.attributes||{}}function go(e,t){e.uri=t;for(var n=0;n<e.playlists.length;n++)e.playlists[n].uri||(e.playlists[n].uri="placeholder-uri-"+n);var i,u=ho(e);fo(e,(function(t,n,i,r){var o="placeholder-uri-"+n+"-"+i+"-"+r;if(!t.playlists||!t.playlists.length){if(u&&"AUDIO"===n&&!t.uri)for(var a=0;a<e.playlists.length;a++){var s=e.playlists[a];if(s.attributes&&s.attributes.AUDIO&&s.attributes.AUDIO===i)return}t.playlists=[b({},t)]}t.playlists.forEach((function(t,n){var i=po(n,o);t.uri?t.resolvedUri=t.resolvedUri||bu(e.uri,t.uri):(t.uri=0===n?o:i,t.resolvedUri=t.uri),t.id=t.id||i,t.attributes=t.attributes||{},e.playlists[t.id]=t,e.playlists[t.uri]=t}))})),function(e){for(var t=e.playlists.length;t--;){var i=e.playlists[t];mo({playlist:i,id:po(t,i.uri)}),i.resolvedUri=bu(e.uri,i.uri),e.playlists[i.id]=i,(e.playlists[i.uri]=i).attributes.BANDWIDTH||ku.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}}(e),fo(i=e,(function(e){e.uri&&(e.resolvedUri=bu(i.uri,e.uri))}))}function yo(e,t,i){var n=e.slice(),r=t.slice();i=i||0;for(var a,s=[],o=0;o<r.length;o++){var u=n[o+i],l=r[o];u?(a=u.map||a,s.push(function(e,t){if(!e)return t;var i=Cu(e,t);if(e.preloadHints&&!t.preloadHints&&delete i.preloadHints,e.parts&&!t.parts)delete i.parts;else if(e.parts&&t.parts)for(var n=0;n<t.parts.length;n++)e.parts&&e.parts[n]&&(i.parts[n]=Cu(e.parts[n],t.parts[n]));return!e.skipped&&t.skipped&&(i.skipped=!1),e.preload&&!t.preload&&(i.preload=!1),i}
2(u,l))):(a&&!l.map&&(l.map=a),s.push(l))}return s}function vo(e,t){!e.resolvedUri&&e.uri&&(e.resolvedUri=bu(t,e.uri)),e.key&&!e.key.resolvedUri&&(e.key.resolvedUri=bu(t,e.key.uri)),e.map&&!e.map.resolvedUri&&(e.map.resolvedUri=bu(t,e.map.uri)),e.map&&e.map.key&&!e.map.key.resolvedUri&&(e.map.key.resolvedUri=bu(t,e.map.key.uri)),e.parts&&e.parts.length&&e.parts.forEach((function(e){e.resolvedUri||(e.resolvedUri=bu(t,e.uri))})),e.preloadHints&&e.preloadHints.length&&e.preloadHints.forEach((function(e){e.resolvedUri||(e.resolvedUri=bu(t,e.uri))}))}function _o(e){var t=e.segments||[],i=e.preloadSegment;if(i&&i.parts&&i.parts.length){if(i.preloadHints)for(var n=0;n<i.preloadHints.length;n++)if("MAP"===i.preloadHints[n].type)return t;i.duration=e.targetDuration,i.preload=!0,t.push(i)}return t}function bo(e,t){return e===t||e.segments&&t.segments&&e.segments.length===t.segments.length&&e.endList===t.endList&&e.mediaSequence===t.mediaSequence}function To(e,a,t){void 0===t&&(t=bo);var i=Cu(e,{}),n=i.playlists[a.id];if(!n)return null;if(t(n,a))return null;a.segments=_o(a);var r=Cu(n,a);if(r.preloadSegment&&!a.preloadSegment&&delete r.preloadSegment,n.segments){if(a.skip){a.segments=a.segments||[];for(var s=0;s<a.skip.skippedSegments;s++)a.segments.unshift({skipped:!0})}r.segments=yo(n.segments,a.segments,a.mediaSequence-n.mediaSequence)}r.segments.forEach((function(e){vo(e,r.resolvedUri)}));for(var o=0;o<i.playlists.length;o++)i.playlists[o].id===a.id&&(i.playlists[o]=r);return i.playlists[a.id]=r,i.playlists[a.uri]=r,fo(e,(function(e,t,i,n){if(e.playlists)for(var r=0;r<e.playlists.length;r++)a.id===e.playlists[r].id&&(e.playlists[r]=a)})),i}function So(e,t){var i=(n=e.segments[e.segments.length-1])&&n.parts&&n.parts[n.parts.length-1],n=i&&i.duration||n&&n.duration;return t&&n?1e3*n:500*(e.partTargetDuration||e.targetDuration||10)}function Eo(e,t,i,n){var r="arraybuffer"===e.responseType?e.response:e.responseText;!t&&r&&(e.responseTime=Date.now(),e.roundTripTime=e.responseTime-e.requestTime,e.bytesReceived=r.byteLength||r.length,e.bandwidth||(e.bandwidth=Math.floor(e.bytesReceived/e.roundTripTime*8*1e3))),i.headers&&(e.responseHeaders=i.headers),t&&"ETIMEDOUT"===t.code&&(e.timedout=!0),n(t=t||e.aborted||200===i.statusCode||206===i.statusCode||0===i.statusCode?t:new Error("XHR Failed with a response of: "+(e&&(r||e.responseText))),e)}function ko(){function a(e,i){e=Au({timeout:45e3},e);var t=a.beforeRequest||xn.Vhs.xhr.beforeRequest;!t||"function"!=typeof t||(t=t(e))&&(e=t);var n=(!0===xn.Vhs.xhr.original?Iu:xn.Vhs.xhr)(e,(function(e,t){return Eo(n,e,t,i)})),r=n.abort;return n.abort=function(){return n.aborted=!0,r.apply(n,arguments)},n.uri=e.uri,n.requestTime=Date.now(),n}return a.original=!0,a}function Co(e){var t,i={};return e.byterange&&(i.Range=(e=(t=e.byterange).offset+t.length-1,"bytes="+t.offset+"-"+e)),i}function wo(e,t){return e=e.toString(16),"00".substring(0,2-e.length)+e+(t%2?" ":"")}function Io(e){return 32<=e&&e<126?String.fromCharCode(e):"."}function Ao(i){var e={};
2return Object.keys(i).forEach((function(t){var n=i[t];ArrayBuffer.isView(n)?e[t]={bytes:n.buffer,byteOffset:n.byteOffset,byteLength:n.byteLength}:e[t]=n})),e}function xo(e){var t=e.byterange||{length:1/0,offset:0};return[t.length,t.offset,e.resolvedUri].join(",")}function Po(e){return e.resolvedUri}function Lo(e){for(var t=Array.prototype.slice.call(e),i="",n=0;n<t.length/16;n++)i+=t.slice(16*n,16*n+16).map(wo).join("")+" "+t.slice(16*n,16*n+16).map(Io).join("")+"\n";return i}function Do(e){var t=e.playlist,i=e.time,n=void 0===i?void 0:i;if(!(i=e.callback))throw new Error("getProgramTime: callback must be provided");return t&&void 0!==n?(e=function(e,t){if(!t||!t.segments||0===t.segments.length)return null;for(var i,n=0,r=0;r<t.segments.length&&!(e<=(n=(i=t.segments[r]).videoTimingInfo?i.videoTimingInfo.transmuxedPresentationEnd:n+i.duration));r++);var a=t.segments[t.segments.length-1];if(a.videoTimingInfo&&a.videoTimingInfo.transmuxedPresentationEnd<e)return null;if(n<e){if(e>n+.25*a.duration)return null;i=a}return{segment:i,estimatedStart:i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationStart:n-i.duration,type:i.videoTimingInfo?"accurate":"estimate"}}(n,t))?"estimate"===e.type?i({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:e.estimatedStart}):(t={mediaSeconds:n},(e=function(e,t){if(!t.dateTimeObject)return null;var i=t.videoTimingInfo.transmuxerPrependedSeconds;return i=e-(t.videoTimingInfo.transmuxedPresentationStart+i),new Date(t.dateTimeObject.getTime()+1e3*i)}(n,e.segment))&&(t.programDateTime=e.toISOString()),i(null,t)):i({message:"valid programTime was not found"}):i({message:"getProgramTime: playlist and time must be provided"})}function Oo(e){var t=e.programTime,i=e.playlist,n=e.retryCount,r=void 0===n?2:n,a=e.seekTo,s=e.pauseAfterSeek,o=void 0===s||s,u=e.tech,l=e.callback;if(!l)throw new Error("seekToProgramTime: callback must be provided");return void 0!==t&&i&&a?i.endList||u.hasStarted_?function(e){if(!e.segments||0===e.segments.length)return!1;for(var t=0;t<e.segments.length;t++)if(!e.segments[t].dateTimeObject)return!1;return!0}(i)?(n=function(e,t){var i;try{i=new Date(e)}catch(e){return null}if(!t||!t.segments||0===t.segments.length)return null;if(i<(r=t.segments[0]).dateTimeObject)return null;for(var n=0;n<t.segments.length-1;n++){var r=t.segments[n];if(i<t.segments[n+1].dateTimeObject)break}var s=t.segments[t.segments.length-1],a=(e=s.dateTimeObject,s.videoTimingInfo?(a=s.videoTimingInfo).transmuxedPresentationEnd-a.transmuxedPresentationStart-a.transmuxerPrependedSeconds:s.duration+.25*s.duration);return new Date(e.getTime()+1e3*a)<i?null:{segment:r=e<i?s:r,estimatedStart:r.videoTimingInfo?r.videoTimingInfo.transmuxedPresentationStart:Eu.duration(t,t.mediaSequence+t.segments.indexOf(r)),type:r.videoTimingInfo?"accurate":"estimate"}}(t,i))?(e=function(e,t){var i;try{n=new Date(e),i=new Date(t)}catch(e){}var n=n.getTime();return(i.getTime()-n)/1e3}((s=n.segment).dateTimeObject,t),"estimate"===n.type?0===r?l({message:t+" is not buffered yet. Try again"}):(a(n.estimatedStart+e),void u.one("seeked",(function(){Oo({programTime:t,playlist:i,retryCount:r-1,seekTo:a,pauseAfterSeek:o,tech:u,callback:l})}))):(e=s.start+e,u.one("seeked",(function(){return l(null,u.currentTime())})),o&&u.pause(),void a(e))):l({message:t+" was not found in the stream"}):l({message:"programDateTime tags must be provided in the manifest "+i.resolvedUri}):l({message:"player must be playing a live stream to start buffering"}):l({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"})}function Ro(e,t){if(4===e.readyState)return t()}function Mo(e,t,n){function r(e,t,i,r){return t.abort(),o=!0,n(e,t,i,r)}function i(e,t){if(!o){if(e)return r(e,t,"",s);var i=t.responseText.substring(s&&s.byteLength||0,t.responseText.length);return s=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];if((t=t.filter((function(e){return e&&(e.byteLength||e.length)&&"string"!=typeof e}))).length<=1)return ss(t[0]);var n=t.reduce((function(e,t,i){return e+(t.byteLength||t.length)}
2),0),r=new Uint8Array(n),a=0;return t.forEach((function(e){e=ss(e),r.set(e,a),a+=e.byteLength})),r}(s,us(i,!0)),a=a||cs(s),s.length<10||a&&s.length<a+2||"ts"===(i=Hs(s))&&s.length<188||!i&&s.length<376?Ro(t,(function(){return r(e,t,"",s)})):r(null,t,i,s)}}var a,s=[],o=!1,u=t({uri:e,beforeSend:function(e){e.overrideMimeType("text/plain; charset=x-user-defined"),e.addEventListener("progress",(function(t){return t.total,t.loaded,Eo(e,null,{statusCode:e.status},i)}))}},(function(e,t){return Eo(u,e,t,i)}));return u}function No(e,t){if(!bo(e,t))return!1;if(e.sidx&&t.sidx&&(e.sidx.offset!==t.sidx.offset||e.sidx.length!==t.sidx.length))return!1;if(!e.sidx&&t.sidx||e.sidx&&!t.sidx)return!1;if(e.segments&&!t.segments||!e.segments&&t.segments)return!1;if(!e.segments&&!t.segments)return!0;for(var i=0;i<e.segments.length;i++){var n=e.segments[i],r=t.segments[i];if(n.uri!==r.uri)return!1;if(n.byterange||r.byterange){if(n=n.byterange,r=r.byterange,n&&!r||!n&&r)return!1;if(n.offset!==r.offset||n.length!==r.length)return!1}}return!0}function Uo(e,t){var i,n={};for(i in e){var r=e[i].sidx;if(r){var a=Ma(r);if(!t[a])break;var s=t[a].sidxInfo;(Boolean(!s.map&&!r.map)||Boolean(s.map&&r.map&&s.map.byterange.offset===r.map.byterange.offset&&s.map.byterange.length===r.map.byterange.length))&&s.uri===r.uri&&s.byterange.offset===r.byterange.offset&&s.byterange.length===r.byterange.length&&(n[a]=t[a])}}return n}function Bo(e){return e.on=e.addEventListener,e.off=e.removeEventListener,e}function Fo(i){var e=i.transmuxer,t=i.bytes,n=i.audioAppendStart,r=i.gopsToAlignWith,a=i.remux,s=i.onData,o=i.onTrackInfo,u=i.onAudioTimingInfo,l=i.onVideoTimingInfo,c=i.onVideoSegmentTimingInfo,d=i.onAudioSegmentTimingInfo,h=i.onId3,p=i.onCaptions,f=i.onDone,m=i.onEndedTimeline,g=i.onTransmuxerLog,y=i.isEndOfTimeline,v={buffer:[]},_=y;e.onmessage=function(t){var n;e.currentTransmux===i&&("data"===t.data.action&&function(e,t,i){var n=(l=e.data.segment).type,a=l.initSegment,s=l.captions,r=l.captionStreams,u=l.metadata,o=l.videoFrameDtsTime,l=l.videoFramePtsTime;t.buffer.push({captions:s,captionStreams:r,metadata:u}),e=e.data.segment.boxes||{data:e.data.segment.data},a={type:n,data:new Uint8Array(e.data,e.data.byteOffset,e.data.byteLength),initSegment:new Uint8Array(a.data,a.byteOffset,a.byteLength)},void 0!==o&&(a.videoFrameDtsTime=o),void 0!==l&&(a.videoFramePtsTime=l),i(a)}(t,v,s),"trackinfo"===t.data.action&&o(t.data.trackInfo),"gopInfo"===t.data.action&&(v.gopInfo=t.data.gopInfo),"audioTimingInfo"===t.data.action&&u(t.data.audioTimingInfo),"videoTimingInfo"===t.data.action&&l(t.data.videoTimingInfo),"videoSegmentTimingInfo"===t.data.action&&c(t.data.videoSegmentTimingInfo),"audioSegmentTimingInfo"===t.data.action&&d(t.data.audioSegmentTimingInfo),"id3Frame"===t.data.action&&h([t.data.id3Frame],t.data.id3Frame.dispatchType),"caption"===t.data.action&&p(t.data.caption),"endedtimeline"===t.data.action&&(_=!1,m()),"log"===t.data.action&&g(t.data.log),"transmuxed"===t.data.type&&(_||(e.onmessage=null,t=(n={transmuxedData:v,callback:f}).transmuxedData,n=n.callback,t.buffer=[],n(t),Ou(e))))},n&&e.postMessage({action:"setAudioAppendStart",appendStart:n}),Array.isArray(r)&&e.postMessage({action:"alignGopsWith",gopsToAlignWith:r}),void 0!==a&&e.postMessage({action:"setRemux",remux:a}),t.byteLength&&(r=t instanceof ArrayBuffer?t:t.buffer,a=t instanceof ArrayBuffer?0:t.byteOffset,e.postMessage({action:"push",data:r,byteOffset:a,byteLength:t.byteLength},[r])),y&&e.postMessage({action:"endTimeline"}),e.postMessage({action:"flush"})}function jo(e,t){e.postMessage({action:t}),Ou(e)}function Ho(e,t){if(!t.currentTransmux)return t.currentTransmux=e,jo(t,e),0;t.transmuxQueue.push(jo.bind(null,t,e))}function qo(e){if(!e.transmuxer.currentTransmux)return e.transmuxer.currentTransmux=e,void Fo(e);e.transmuxer.transmuxQueue.push(e)}function Vo(i){var e=i.transmuxer,t=i.endAction||i.action,a=i.callback,n=b({},i,{endAction:null,transmuxer:null,callback:null}),r=function n(r){r.data.action===t&&(e.removeEventListener("message",n),r.data.data&&(r.data.data=new Uint8Array(r.data.data,i.byteOffset||0,i.byteLength||r.data.data.byteLength),i.data&&(i.data=r.data.data)),a(r.data))};e.addEventListener("message",r),i.data?(r=i.data instanceof ArrayBuffer,n.byteOffset=r?0:i.data.byteOffset,n.byteLength=i.data.byteLength,r=[r?i.data:i.data.buffer],e.postMessage(n,r)):e.postMessage(n)}function Wo(e){e.forEach((function(e){e.abort()}))}function zo(e,t){return t.timedout?{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:Uu,xhr:t}:t.aborted?{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:Bu,xhr:t}:e?{status:t.status,message:"HLS request errored at URL: "+t.uri,code:Nu,xhr:t}:"arraybuffer"===t.responseType&&0===t.response.byteLength?{status:t.status,message:"Empty HLS response at URL: "+t.uri,code:Nu,xhr:t}:null}function Go(a,s,e){return function(t,n){var i=n.response;if(t=zo(t,n))return e(t,a);if(16!==i.byteLength)return e({status:n.status,message:"Invalid HLS key at URL: "+n.uri,code:Nu,xhr:n},a);i=new DataView(i);
2for(var r=new Uint32Array([i.getUint32(0),i.getUint32(4),i.getUint32(8),i.getUint32(12)]),o=0;o<s.length;o++)s[o].bytes=r;return e(null,a)}}function Xo(i,e){var t=Hs(i.map.bytes);if("mp4"!==t){var n=i.map.resolvedUri||i.map.uri;return e({internal:!0,message:"Found unsupported "+(t||"unknown")+" container for initialization segment at URL: "+n,code:Nu})}Vo({action:"probeMp4Tracks",data:i.map.bytes,transmuxer:i.transmuxer,callback:function(t){var n=t.tracks;return t=t.data,i.map.bytes=t,n.forEach((function(e){i.map.tracks=i.map.tracks||{},i.map.tracks[e.type]||"number"==typeof(i.map.tracks[e.type]=e).id&&e.timescale&&(i.map.timescales=i.map.timescales||{},i.map.timescales[e.id]=e.timescale)})),e(null)}})}function Ko(e){var i=e.segment,t=e.finishProcessingFn,n=e.responseType;return function(e,r){return(e=zo(e,r))?t(e,i):(e="arraybuffer"!==n&&r.responseText?function(e){for(var t=new Uint8Array(new ArrayBuffer(e.length)),i=0;i<e.length;i++)t[i]=e.charCodeAt(i);return t.buffer}(r.responseText.substring(i.lastReachedChar||0)):r.response,i.stats={bandwidth:r.bandwidth,bytesReceived:r.bytesReceived||0,roundTripTime:r.roundTripTime||0},i.key?i.encryptedBytes=new Uint8Array(e):i.bytes=new Uint8Array(e),t(null,i))}}function Yo(e){var i=e.segment,t=e.bytes,n=e.trackInfoFn,r=e.timingInfoFn,a=e.videoSegmentTimingInfoFn,s=e.audioSegmentTimingInfoFn,o=e.id3Fn,u=e.captionsFn,l=e.isEndOfTimeline,c=e.endedTimelineFn,d=e.dataFn,h=e.doneFn,p=e.onTransmuxerLog,f=(e=i.map&&i.map.tracks||{},Boolean(e.audio&&e.video)),m=r.bind(null,i,"audio","start"),g=r.bind(null,i,"audio","end"),y=r.bind(null,i,"video","start"),v=r.bind(null,i,"video","end");Vo({action:"probeTs",transmuxer:i.transmuxer,data:t,baseStartTime:i.baseStartTime,callback:function(e){i.bytes=t=e.data,(e=e.result)&&(n(i,{hasAudio:e.hasAudio,hasVideo:e.hasVideo,isMuxed:f}),n=null,e.hasAudio&&!f&&m(e.audioStart),e.hasVideo&&y(e.videoStart),y=m=null),qo({bytes:t,transmuxer:i.transmuxer,audioAppendStart:i.audioAppendStart,gopsToAlignWith:i.gopsToAlignWith,remux:f,onData:function(e){e.type="combined"===e.type?"video":e.type,d(i,e)},onTrackInfo:function(e){n&&(f&&(e.isMuxed=!0),n(i,e))},onAudioTimingInfo:function(e){m&&void 0!==e.start&&(m(e.start),m=null),g&&void 0!==e.end&&g(e.end)},onVideoTimingInfo:function(e){y&&void 0!==e.start&&(y(e.start),y=null),v&&void 0!==e.end&&v(e.end)},onVideoSegmentTimingInfo:function(e){a(e)},onAudioSegmentTimingInfo:function(e){s(e)},onId3:function(e,t){o(i,e,t)},onCaptions:function(e){u(i,[e])},isEndOfTimeline:l,onEndedTimeline:function(){c()},onTransmuxerLog:p,onDone:function(e){h&&(e.type="combined"===e.type?"video":e.type,h(null,i,e))}})}})}function Qo(e){var i=e.segment,t=e.bytes,n=e.trackInfoFn,r=e.timingInfoFn,a=e.videoSegmentTimingInfoFn,s=e.audioSegmentTimingInfoFn,o=e.id3Fn,u=e.captionsFn,l=e.isEndOfTimeline,c=e.endedTimelineFn,d=e.dataFn,h=e.doneFn,p=e.onTransmuxerLog,f=new Uint8Array(t);if(0<hs(f,["moof"]).length){i.isFmp4=!0;var m=i.map.tracks,g={isFmp4:!0,hasVideo:!!m.video,hasAudio:!!m.audio};m.audio&&m.audio.codec&&"enca"!==m.audio.codec&&(g.audioCodec=m.audio.codec),m.video&&m.video.codec&&"encv"!==m.video.codec&&(g.videoCodec=m.video.codec),m.video&&m.audio&&(g.isMuxed=!0),n(i,g);var y=function(e){d(i,{data:f,type:g.hasAudio&&!g.isMuxed?"audio":"video"}),e&&e.length&&u(i,e),h(null,i,{})};Vo({action:"probeMp4StartTime",timescales:i.map.timescales,data:f,transmuxer:i.transmuxer,callback:function(e){var n=e.data;e=e.startTime,t=n.buffer,i.bytes=f=n,g.hasAudio&&!g.isMuxed&&r(i,"audio","start",e),g.hasVideo&&r(i,"video","start",e),m.video&&n.byteLength&&i.transmuxer?Vo({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:i.transmuxer,data:f,timescales:i.map.timescales,trackIds:[m.video.id],callback:function(e){t=e.data.buffer,i.bytes=f=e.data,e.logs.forEach((function(e){p(xn.mergeOptions(e,{stream:"mp4CaptionParser"}))})),y(e.captions)}}):y()}})}else if(i.transmuxer){if(void 0===i.container&&(i.container=Hs(f)),"ts"!==i.container&&"aac"!==i.container)return n(i,{hasAudio:!1,hasVideo:!1}),h(null,i,{}),0;Yo({segment:i,bytes:t,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:u,isEndOfTimeline:l,endedTimelineFn:c,dataFn:d,doneFn:h,onTransmuxerLog:p})}else h(null,i,{})}function $o(e,i){var t=e.id,n=e.key,r=e.encryptedBytes,a=e.decryptionWorker;e=function e(n){n.data.source===t&&(a.removeEventListener("message",e),n=n.data.decrypted,i(new Uint8Array(n.bytes,n.byteOffset,n.byteLength)))},a.addEventListener("message",e),e=n.bytes.slice?n.bytes.slice():new Uint32Array(Array.prototype.slice.call(n.bytes)),a.postMessage(Ao({source:t,encrypted:r,key:e,iv:n.iv}),[r.buffer,e.buffer])}function Jo(e){var i=e.activeXhrs,t=e.decryptionWorker,g=e.trackInfoFn,n=e.timingInfoFn,r=e.videoSegmentTimingInfoFn,o=e.audioSegmentTimingInfoFn,b=e.id3Fn,l=e.captionsFn,c=e.isEndOfTimeline,d=e.endedTimelineFn,h=e.dataFn,f=e.doneFn,m=e.onTransmuxerLog,y=0,v=!1;return function(e,_){if(!v){if(e)return v=!0,Wo(i),f(e,_);if((y+=1)===i.length){var T=function(){if(_.encryptedBytes)return y=(e={decryptionWorker:t,segment:_,trackInfoFn:g,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:o,id3Fn:b,captionsFn:l,isEndOfTimeline:c,endedTimelineFn:d,dataFn:h,doneFn:f,onTransmuxerLog:m}).decryptionWorker,i=e.segment,v=e.trackInfoFn,T=e.timingInfoFn,a=e.videoSegmentTimingInfoFn,s=e.audioSegmentTimingInfoFn,S=e.id3Fn,u=e.captionsFn,E=e.isEndOfTimeline,k=e.endedTimelineFn,C=e.dataFn,w=e.doneFn,p=e.onTransmuxerLog,void $o({id:i.requestId,key:i.key,encryptedBytes:i.encryptedBytes,decryptionWorker:y},(function(e){i.bytes=e,Qo({segment:i,bytes:i.bytes,trackInfoFn:v,timingInfoFn:T,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:s,id3Fn:S,captionsFn:u,isEndOfTimeline:E,endedTimelineFn:k,dataFn:C,doneFn:w,onTransmuxerLog:p})}));
2var e,y,i,v,T,a,s,S,u,E,k,C,w,p;Qo({segment:_,bytes:_.bytes,trackInfoFn:g,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:o,id3Fn:b,captionsFn:l,isEndOfTimeline:c,endedTimelineFn:d,dataFn:h,doneFn:f,onTransmuxerLog:m})};if(_.endOfAllRequests=Date.now(),_.map&&_.map.encryptedBytes&&!_.map.bytes)return $o({decryptionWorker:t,id:_.requestId+"-init",encryptedBytes:_.map.encryptedBytes,key:_.map.key},(function(e){_.map.bytes=e,Xo(_,(function(e){return e?(Wo(i),f(e,_)):void T()}))}));T()}}}}function Zo(e){var t=e.segment,n=e.progressFn;return e.trackInfoFn,e.timingInfoFn,e.videoSegmentTimingInfoFn,e.audioSegmentTimingInfoFn,e.id3Fn,e.captionsFn,e.isEndOfTimeline,e.endedTimelineFn,e.dataFn,function(e){var r,i=e.target;if(!i.aborted)return t.stats=xn.mergeOptions(t.stats,(i=(r=e).target,(i={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-i.requestTime||0}).bytesReceived=r.loaded,i.bandwidth=Math.floor(i.bytesReceived/i.roundTripTime*8*1e3),i)),!t.stats.firstBytesReceivedAt&&t.stats.bytesReceived&&(t.stats.firstBytesReceivedAt=Date.now()),n(e,t)}}function eu(e){var t,i,n,r=e.xhr,a=e.xhrOptions,s=e.decryptionWorker,o=e.segment,u=e.abortFn,l=e.progressFn,c=e.trackInfoFn,d=e.timingInfoFn,h=e.videoSegmentTimingInfoFn,p=e.audioSegmentTimingInfoFn,f=e.id3Fn,m=e.captionsFn,g=e.isEndOfTimeline,y=e.endedTimelineFn,v=e.dataFn,_=e.doneFn,b=(e=e.onTransmuxerLog,[]);_=Jo({activeXhrs:b,decryptionWorker:s,trackInfoFn:c,timingInfoFn:d,videoSegmentTimingInfoFn:h,audioSegmentTimingInfoFn:p,id3Fn:f,captionsFn:m,isEndOfTimeline:g,endedTimelineFn:y,dataFn:v,doneFn:_,onTransmuxerLog:e}),o.key&&!o.key.bytes&&(e=[o.key],o.map&&!o.map.bytes&&o.map.key&&o.map.key.resolvedUri===o.key.resolvedUri&&e.push(o.map.key),e=r(xn.mergeOptions(a,{uri:o.key.resolvedUri,responseType:"arraybuffer"}),Go(o,e,_)),b.push(e)),o.map&&!o.map.bytes&&(!o.map.key||o.key&&o.key.resolvedUri===o.map.key.resolvedUri||(t=r(xn.mergeOptions(a,{uri:o.map.key.resolvedUri,responseType:"arraybuffer"}),Go(o,[o.map.key],_)),b.push(t)),t=r(xn.mergeOptions(a,{uri:o.map.resolvedUri,responseType:"arraybuffer",headers:Co(o.map)}),(i=(t={segment:o,finishProcessingFn:_}).segment,n=t.finishProcessingFn,function(e,t){return(e=zo(e,t))?n(e,i):(e=new Uint8Array(t.response),i.map.key?(i.map.encryptedBytes=e,n(null,i)):(i.map.bytes=e,void Xo(i,(function(e){return e?(e.xhr=t,e.status=t.status,n(e,i)):void n(null,i)}))))})),b.push(t)),(a=r(a=xn.mergeOptions(a,{uri:o.part&&o.part.resolvedUri||o.resolvedUri,responseType:"arraybuffer",headers:Co(o)}),Ko({segment:o,finishProcessingFn:_,responseType:a.responseType}))).addEventListener("progress",Zo({segment:o,progressFn:l,trackInfoFn:c,timingInfoFn:d,videoSegmentTimingInfoFn:h,audioSegmentTimingInfoFn:p,id3Fn:f,captionsFn:m,isEndOfTimeline:g,endedTimelineFn:y,dataFn:v})),b.push(a);var T={};return b.forEach((function(e){var t,i;e.addEventListener("loadend",(t=(e={loadendState:T,abortFn:u}).loadendState,i=e.abortFn,function(e){e.target.aborted&&i&&!t.calledAbortFn&&(i(),t.calledAbortFn=!0)}))})),function(){return Wo(b)}}function tu(e,t){return t=t.attributes||{},e&&e.mediaGroups&&e.mediaGroups.AUDIO&&t.AUDIO&&e.mediaGroups.AUDIO[t.AUDIO]}function iu(e){var t={};return e.forEach((function(e){var n=e.mediaType,i=e.type;e=e.details,t[n]=t[n]||[],t[n].push(jn(""+i+e))})),Object.keys(t).forEach((function(e){return 1<t[e].length?(Fu("multiple "+e+" codecs found as attributes: "+t[e].join(", ")+". Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs."),void(t[e]=null)):void(t[e]=t[e][0])})),t}function nu(e){var t=0;return e.audio&&t++,e.video&&t++,t}function ru(e,t){var i,n=t.attributes||{},r=iu(function(e){if((e=e.attributes||{}).CODECS)return Hn(e.CODECS)}(t)||[]);return tu(e,t)&&!r.audio&&!function(e,t){if(!tu(e,t))return!0;t=t.attributes||{};var i,n=e.mediaGroups.AUDIO[t.AUDIO];for(i in n)if(!n[i].uri&&!n[i].playlists)return!0;return!1}(e,t)&&(i=iu(function(e,t){if(!e.mediaGroups.AUDIO||!t)return null;var i,n=e.mediaGroups.AUDIO[t];if(!n)return null;for(i in n){var r=n[i];if(r.default&&r.playlists)return Hn(r.playlists[0].attributes.CODECS)}return null}(e,n.AUDIO)||[])).audio&&(r.audio=i.audio),r}function au(e){if(e&&e.playlist){var t=e.playlist;return JSON.stringify({id:t.id,bandwidth:e.bandwidth,width:e.width,height:e.height,codecs:t.attributes&&t.attributes.CODECS||""})}}function su(e,t){return(e=e&&o.getComputedStyle(e))?e[t]:""}function ou(e,t){var n=e.slice();e.sort((function(e,r){var i=t(e,r);return 0===i?n.indexOf(e)-n.indexOf(r):i}))}function uu(e,t){var i,n;return(i=(i=e.attributes.BANDWIDTH?e.attributes.BANDWIDTH:i)||o.Number.MAX_VALUE)-((n=t.attributes.BANDWIDTH?t.attributes.BANDWIDTH:n)||o.Number.MAX_VALUE)}function lu(e,t,i,n,r,a){if(e){var s={bandwidth:t,width:i,height:n,limitRenditionByPlayerDimensions:r},l=e.playlists;Eu.isAudioOnly(e)&&(l=a.getAudioTrackPlaylists_(),s.audioOnly=!0);var u=l.map((function(e){var t=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width,i=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height;return{bandwidth:e.attributes&&e.attributes.BANDWIDTH||o.Number.MAX_VALUE,width:t,height:i,playlist:e}}));ou(u,(function(e,t){return e.bandwidth-t.bandwidth}));var c,p,d,h=(u=u.filter((function(e){return!Eu.isIncompatible(e.playlist)}))).filter((function(e){return Eu.isEnabled(e.playlist)})),f=(e=(h=h.length?h:u.filter((function(e){return!Eu.isDisabled(e.playlist)}))).filter((function(e){return e.bandwidth*Lu.BANDWIDTH_VARIANCE<t})))[e.length-1];if(l=e.filter((function(e){return e.bandwidth===f.bandwidth}))[0],!1===r){var m=l||h[0]||u[0];return m&&m.playlist?(r=l?"bandwidthBestRep":"sortedPlaylistReps",h[0]&&(r="enabledPlaylistReps"),ju("choosing "+au(m)+" using "+r+" with options",s),m.playlist):(ju("could not choose a playlist with options",s),null)}ou(m=e.filter((function(e){return e.width&&e.height})),(function(e,t){return e.width-t.width})),f=(e=m.filter((function(e){return e.width===i&&e.height===n})))[e.length-1],(e=e.filter((function(e){return e.bandwidth===f.bandwidth}))[0])||(p=(c=m.filter((function(e){return e.width>i||e.height>n}))).filter((function(e){return e.width===c[0].width&&e.height===c[0].height})),f=p[p.length-1],p=p.filter((function(e){return e.bandwidth===f.bandwidth}))[0]),a.experimentalLeastPixelDiffSelector&&(y=m.map((function(e){return e.pixelDiff=Math.abs(e.width-i)+Math.abs(e.height-n),e})),ou(y,(function(e,t){return e.pixelDiff===t.pixelDiff?t.bandwidth-e.bandwidth:e.pixelDiff-t.pixelDiff})),d=y[0]);var y=d||p||e||l||h[0]||u[0];return y&&y.playlist?(u="sortedPlaylistReps",d?u="leastPixelDiffRep":p?u="resolutionPlusOneRep":e?u="resolutionBestRep":l?u="bandwidthBestRep":h[0]&&(u="enabledPlaylistReps"),ju("choosing "+au(y)+" using "+u+" with options",s),y.playlist):(ju("could not choose a playlist with options",s),null)}}function cu(e){var t=e.inbandTextTracks,i=e.metadataArray,n=e.timestampOffset,r=e.videoDuration;if(i){var a=o.WebKitDataCue||o.VTTCue,s=t.metadataTrack_;if(s&&(i.forEach((function(e){var t=e.cueTime+n;
2!("number"!=typeof t||o.isNaN(t)||t<0)&&t<1/0&&e.frames.forEach((function(e){var n,i=new a(t,t,e.value||e.url||e.data||"");i.frame=e,i.value=e,n=i,Object.defineProperties(n.frame,{id:{get:function(){return xn.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),n.value.key}},value:{get:function(){return xn.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),n.value.data}},privateData:{get:function(){return xn.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),n.value.data}}}),s.addCue(i)}))})),s.cues&&s.cues.length)){for(var l=s.cues,u=[],c=0;c<l.length;c++)l[c]&&u.push(l[c]);var d=u.reduce((function(e,t){var i=e[t.startTime]||[];return i.push(t),e[t.startTime]=i,e}),{}),h=Object.keys(d).sort((function(e,t){return Number(e)-Number(t)}));h.forEach((function(e,t){e=d[e];var i=Number(h[t+1])||r;e.forEach((function(e){e.endTime=i}))}))}}}function du(e,t,i){var n,r;if(i&&i.cues)for(n=i.cues.length;n--;)(r=i.cues[n]).startTime>=e&&r.endTime<=t&&i.removeCue(r)}function hu(e){return"number"==typeof e&&isFinite(e)}function pu(e){var t=e.startOfSegment,i=e.duration,n=e.segment,r=e.part,a=e.playlist,s=a.mediaSequence,o=a.id,u=a.segments,l=e.mediaIndex,c=e.partIndex,d=e.timeline,h=(void 0===u?[]:u).length-1,p="mediaIndex/partIndex increment";return e.getMediaInfoForTime?p="getMediaInfoForTime ("+e.getMediaInfoForTime+")":e.isSyncRequest&&(p="getSyncSegmentCandidate (isSyncRequest)"),a="number"==typeof c,u=e.segment.uri?"segment":"pre-segment",e=a?Js({preloadSegment:n})-1:0,u+" ["+(s+l)+"/"+(s+h)+"]"+(a?" part ["+c+"/"+e+"]":"")+" segment start/end ["+n.start+" => "+n.end+"]"+(a?" part start/end ["+r.start+" => "+r.end+"]":"")+" startOfSegment ["+t+"] duration ["+i+"] timeline ["+d+"] selected by ["+p+"] playlist ["+o+"]"}function fu(e){return e+"TimingInfo"}function mu(e){var t=e.timelineChangeController,i=e.currentTimeline,n=e.segmentTimeline,r=e.loaderType;if(e=e.audioDisabled,i!==n){if("audio"===r)return!(i=t.lastTimelineChange({type:"main"}))||i.to!==n;if("main"===r&&e)return!(t=t.pendingTimelineChange({type:"audio"}))||t.to!==n}}function gu(e){var t=e.segmentDuration;return e=e.maxDuration,!!t&&Math.round(t)>e+Tu}function yu(e,t){if("hls"!==t)return null;var i=function(e,t){return e=e&&"number"==typeof e.start&&"number"==typeof e.end?e.end-e.start:0,t=t&&"number"==typeof t.start&&"number"==typeof t.end?t.end-t.start:0,Math.max(e,t)}(e.audioTimingInfo,e.videoTimingInfo);if(!i)return null;var n=gu({segmentDuration:i,maxDuration:2*(r=e.playlist.targetDuration)}),r=(t=gu({segmentDuration:i,maxDuration:r}),"Segment with index "+e.mediaIndex+" from playlist "+e.playlist.id+" has a duration of "+i+" when the reported duration is "+e.duration+" and the target duration is "+r+". For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1");return n||t?{severity:n?"warn":"info",message:r}:null}js.forEach((function(e){var t=Fs[e];Fs[e]=function(e){return t(ss(e))}}));var vu=Fs,_u=9e4,bu=Pn,Tu=1/30,Su=xn.createTimeRange,Eu={liveEdgeDelay:Zs,duration:to,seekable:function(e,t,i){var n=t||0;return null===(i=no(e,t,!0,i))?Su():Su(n,i)},getMediaInfoForTime:function(e){for(var t=e.playlist,i=e.currentTime,n=e.startingSegmentIndex,r=e.startingPartIndex,a=e.startTime,s=e.experimentalExactManifestTimings,o=i-a,u=Qs(t),l=0,c=0;c<u.length;c++){var d=u[c];if(n===d.segmentIndex&&("number"!=typeof r||"number"!=typeof d.partIndex||r===d.partIndex)){l=c;break}}if(o<0){if(0<l)for(var h=l-1;0<=h;h--){var p=u[h];if(o+=p.duration,s){if(o<0)continue}else if(o+Tu<=0)continue;return{partIndex:p.partIndex,segmentIndex:p.segmentIndex,startTime:a-io({defaultDuration:t.targetDuration,durationList:u,startIndex:l,endIndex:h})}}return{partIndex:u[0]&&u[0].partIndex||null,segmentIndex:u[0]&&u[0].segmentIndex||0,startTime:i}}if(l<0){for(var f=l;f<0;f++)if((o-=t.targetDuration)<0)return{partIndex:u[0]&&u[0].partIndex||null,segmentIndex:u[0]&&u[0].segmentIndex||0,startTime:i};l=0}for(var m=l;m<u.length;m++){var g=u[m];
2if(o-=g.duration,s){if(0<o)continue}else if(0<=o-Tu)continue;return{partIndex:g.partIndex,segmentIndex:g.segmentIndex,startTime:a+io({defaultDuration:t.targetDuration,durationList:u,startIndex:l,endIndex:m})}}return{segmentIndex:u[u.length-1].segmentIndex,partIndex:u[u.length-1].partIndex,startTime:i}},isEnabled:so,isDisabled:function(e){return e.disabled},isBlacklisted:ro,isIncompatible:ao,playlistEnd:no,isAes:function(e){for(var t=0;t<e.segments.length;t++)if(e.segments[t].key)return!0;return!1},hasAttribute:oo,estimateSegmentRequestTime:function(e,t,i,n){return oo("BANDWIDTH",i)?(e*i.attributes.BANDWIDTH-8*(n=void 0===n?0:n))/t:NaN},isLowestEnabledRendition:uo,isAudioOnly:ho,playlistMatch:lo},ku=xn.log,Cu=xn.mergeOptions,wu=function(a){function e(e,t,i){var n;if(void 0===i&&(i={}),n=a.call(this)||this,!e)throw new Error("A non-empty playlist URL or object is required");n.logger_=Vs("PlaylistLoader");var r=void 0!==(r=i.withCredentials)&&r;return i=void 0!==(i=i.handleManifestRedirects)&&i,n.src=e,n.vhs_=t,n.withCredentials=r,n.handleManifestRedirects=i,t=t.options_,n.customTagParsers=t&&t.customTagParsers||[],n.customTagMappers=t&&t.customTagMappers||[],n.experimentalLLHLS=t&&t.experimentalLLHLS||!1,n.state="HAVE_NOTHING",n.handleMediaupdatetimeout_=n.handleMediaupdatetimeout_.bind(yt(n)),n.on("mediaupdatetimeout",n.handleMediaupdatetimeout_),n}vt(e,a);var t=e.prototype;return t.handleMediaupdatetimeout_=function(){var e,t,i=this;"HAVE_METADATA"===this.state&&(e=this.media(),t=bu(this.master.uri,e.uri),this.experimentalLLHLS&&(t=function(i,e){if(e.endList)return i;var t,n,r,a=[];return e.serverControl&&e.serverControl.canBlockReload&&(r=e.preloadSegment,t=e.mediaSequence+e.segments.length,r&&(n=r.parts||[],-1<(r=Js(e)-1)&&r!=n.length-1&&a.push("_HLS_part="+r),(-1<r||n.length)&&t--),a.unshift("_HLS_msn="+t)),e.serverControl&&e.serverControl.canSkipUntil&&a.unshift("_HLS_skip="+(e.serverControl.canSkipDateranges?"v2":"YES")),a.forEach((function(e,t){i+=(0===t?"?":"&")+e})),i}(t,e)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:t,withCredentials:this.withCredentials},(function(e,t){if(i.request)return e?i.playlistRequestError(i.request,i.media(),"HAVE_METADATA"):void i.haveMetadata({playlistString:i.request.responseText,url:i.media().uri,id:i.media().id})})))},t.playlistRequestError=function(e,t,i){var n=t.uri;t=t.id,this.request=null,i&&(this.state=i),this.error={playlist:this.master.playlists[t],status:e.status,message:"HLS playlist request error at URL: "+n+".",responseText:e.responseText,code:500<=e.status?4:2},this.trigger("error")},t.parseManifest_=function(e){var t=this,i=e.url;return function(e){var t=e.onwarn,i=e.oninfo,n=e.manifestString,a=void 0===(r=e.customTagParsers)?[]:r,r=void 0===(r=e.customTagMappers)?[]:r,s=(e=e.experimentalLLHLS,new Qn);t&&s.on("warn",t),i&&s.on("info",i),a.forEach((function(e){return s.addParser(e)})),r.forEach((function(e){return s.addTagMapper(e)})),s.push(n),s.end();var o=s.manifest;e||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach((function(e){o.hasOwnProperty(e)&&delete o[e]})),o.segments&&o.segments.forEach((function(e){["parts","preloadHints"].forEach((function(t){e.hasOwnProperty(t)&&delete e[t]}))}))),o.targetDuration||(u=10,o.segments&&o.segments.length&&(u=o.segments.reduce((function(e,t){return Math.max(e,t.duration)}),0)),t&&t("manifest has no targetDuration defaulting to "+u),o.targetDuration=u);var u=$s(o);return u.length&&!o.partTargetDuration&&(u=u.reduce((function(e,t){return Math.max(e,t.duration)}),0),t&&(t("manifest has no partTargetDuration defaulting to "+u),ku.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.")),o.partTargetDuration=u),o}({onwarn:function(e){return e=e.message,t.logger_("m3u8-parser warn for "+i+": "+e)},oninfo:function(e){return e=e.message,t.logger_("m3u8-parser info for "+i+": "+e)},manifestString:e.manifestString,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,experimentalLLHLS:this.experimentalLLHLS})},t.haveMetadata=function(e){var t=e.playlistString,i=e.playlistOb
2ject,n=e.url;e=e.id,this.request=null,this.state="HAVE_METADATA",(t=i||this.parseManifest_({url:n,manifestString:t})).lastRequest=Date.now(),mo({playlist:t,uri:n,id:e}),n=To(this.master,t),this.targetDuration=t.partTargetDuration||t.targetDuration,n?(this.master=n,this.media_=this.master.playlists[e]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(So(this.media(),!!n)),this.trigger("loadedplaylist")},t.dispose=function(){this.trigger("dispose"),this.stopRequest(),o.clearTimeout(this.mediaUpdateTimeout),o.clearTimeout(this.finalRenditionTimeout),this.off()},t.stopRequest=function(){var e;this.request&&(e=this.request,this.request=null,e.onreadystatechange=null,e.abort())},t.media=function(i,e){var t=this;if(!i)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);if("string"==typeof i){if(!this.master.playlists[i])throw new Error("Unknown playlist URI: "+i);i=this.master.playlists[i]}if(o.clearTimeout(this.finalRenditionTimeout),e){var n=(i.partTargetDuration||i.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=o.setTimeout(this.media.bind(this,i,!1),n)}else{var r=this.state;if(e=!this.media_||i.id!==this.media_.id,(n=this.master.playlists[i.id])&&n.endList||i.endList&&i.segments.length)return this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=i,void(e&&(this.trigger("mediachanging"),"HAVE_MASTER"===r?this.trigger("loadedmetadata"):this.trigger("mediachange")));if(this.updateMediaUpdateTimeout_(So(i,!0)),e){if(this.state="SWITCHING_MEDIA",this.request){if(i.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.request=this.vhs_.xhr({uri:i.resolvedUri,withCredentials:this.withCredentials},(function(e,n){if(t.request){if(i.lastRequest=Date.now(),i.resolvedUri=qs(t.handleManifestRedirects,i.resolvedUri,n),e)return t.playlistRequestError(t.request,i,r);t.haveMetadata({playlistString:n.responseText,url:i.uri,id:i.id}),"HAVE_MASTER"===r?t.trigger("loadedmetadata"):t.trigger("mediachange")}}))}}},t.pause=function(){this.mediaUpdateTimeout&&(o.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),"HAVE_NOTHING"===this.state&&(this.started=!1),"SWITCHING_MEDIA"===this.state?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MASTER":"HAVE_CURRENT_METADATA"===this.state&&(this.state="HAVE_METADATA")},t.load=function(e){var t=this;this.mediaUpdateTimeout&&(o.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);var i=this.media();e?(e=i?(i.partTargetDuration||i.targetDuration)/2*1e3:5e3,this.mediaUpdateTimeout=o.setTimeout((function(){t.mediaUpdateTimeout=null,t.load()}),e)):this.started?i&&!i.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist"):this.start()},t.updateMediaUpdateTimeout_=function(e){var t=this;this.mediaUpdateTimeout&&(o.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.media()&&!this.media().endList&&(this.mediaUpdateTimeout=o.setTimeout((function(){t.mediaUpdateTimeout=null,t.trigger("mediaupdatetimeout"),t.updateMediaUpdateTimeout_(e)}),e))},t.start=function(){var i=this;
2if(this.started=!0,"object"==typeof this.src)return this.src.uri||(this.src.uri=o.location.href),this.src.resolvedUri=this.src.uri,void setTimeout((function(){i.setupInitialPlaylist(i.src)}),0);this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials},(function(e,t){if(i.request){if(i.request=null,e)return i.error={status:t.status,message:"HLS playlist request error at URL: "+i.src+".",responseText:t.responseText,code:2},"HAVE_NOTHING"===i.state&&(i.started=!1),i.trigger("error");i.src=qs(i.handleManifestRedirects,i.src,t),t=i.parseManifest_({manifestString:t.responseText,url:i.src}),i.setupInitialPlaylist(t)}}))},t.srcUri=function(){return"string"==typeof this.src?this.src:this.src.uri},t.setupInitialPlaylist=function(e){if(this.state="HAVE_MASTER",e.playlists)return this.master=e,go(this.master,this.srcUri()),e.playlists.forEach((function(e){e.segments=_o(e),e.segments.forEach((function(t){vo(t,e.resolvedUri)}))})),this.trigger("loadedplaylist"),void(this.request||this.media(this.master.playlists[0]));var t,i,n,r=this.srcUri()||o.location.href;this.master=(i=po(0,t=r),(n={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:o.location.href,resolvedUri:o.location.href,playlists:[{uri:t,id:i,resolvedUri:t,attributes:{}}]}).playlists[i]=n.playlists[0],n.playlists[t]=n.playlists[0],n),this.haveMetadata({playlistObject:e,url:r,id:this.master.playlists[0].id}),this.trigger("loadedmetadata")},e}(K=xn.EventTarget),Iu=xn.xhr,Au=xn.mergeOptions,xu=(oi=Object.freeze({__proto__:null,createTransferableMessage:Ao,initSegmentId:xo,segmentKeyId:Po,hexDump:Lo,tagDump:function(e){return Lo(e=e.bytes)},textRanges:function(e){for(var t,i,n="",r=0;r<e.length;r++)n+=(i=r,(t=e).start(i)+"-"+t.end(i)+" ");return n}}),Qt=xn.EventTarget,xn.mergeOptions),Pu=function(a){function e(e,t,i,n){var r;if(void 0===i&&(i={}),(r=a.call(this)||this).masterPlaylistLoader_=n||yt(r),n||(r.isMaster_=!0),n=void 0!==(n=i.withCredentials)&&n,i=void 0!==(i=i.handleManifestRedirects)&&i,r.vhs_=t,r.withCredentials=n,r.handleManifestRedirects=i,!e)throw new Error("A non-empty playlist URL or object is required");return r.on("minimumUpdatePeriod",(function(){r.refreshXml_()})),r.on("mediaupdatetimeout",(function(){r.refreshMedia_(r.media().id)})),r.state="HAVE_NOTHING",r.loadedPlaylists_={},r.logger_=Vs("DashPlaylistLoader"),r.isMaster_?(r.masterPlaylistLoader_.srcUrl=e,r.masterPlaylistLoader_.sidxMapping_={}):r.childPlaylist_=e,r}vt(e,a);var t=e.prototype;return t.requestErrored_=function(e,t,i){return!this.request||(this.request=null,e?(this.error="object"!=typeof e||e instanceof Error?{status:t.status,message:"DASH request error at URL: "+t.uri,response:t.response,code:2}:e,i&&(this.state=i),this.trigger("error"),!0):void 0)},t.addSidxSegments_=function(a,e,t){var s,n,u=this,r=a.sidx&&Ma(a.sidx);a.sidx&&r&&!this.masterPlaylistLoader_.sidxMapping_[r]?(s=qs(this.handleManifestRedirects,a.sidx.resolvedUri),n=function(n,o){if(!u.requestErrored_(n,o,e)){var i;n=u.masterPlaylistLoader_.sidxMapping_;try{i=xs(ss(o.response).subarray(8))}catch(n){return void u.requestErrored_(n,o,e)}return n[r]={sidxInfo:a.sidx,sidx:i},Ra(a,i,a.sidx.resolvedUri),t(!0)}},this.request=Mo(s,this.vhs_.xhr,(function(e,t,i,r){if(e)return n(e,t);if(!i||"mp4"!==i)return n({status:t.status,message:"Unsupported "+(i||"unknown")+" container type for sidx segment at URL: "+s,response:"",playlist:a,internal:!0,blacklistDuration:1/0,code:2},t);i=(o=a.sidx.byterange).offset;var o=o.length;if(r.length>=o+i)return n(e,{response:r.subarray(i,i+o),status:t.status,uri:t.uri});u.request=u.vhs_.xhr({uri:s,responseType:"arraybuffer",headers:Co({byterange:a.sidx.byterange})},n)}))):this.mediaRequest_=o.setTimeout((function(){return t(!1)}),0)},t.dispose=function(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},o.clearTimeout(this.minimumUpdatePeriodTimeout_),o.clearTimeout(this.mediaRequest_),o.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.off()},t.hasPendingRequest=function(){return this.request||this.mediaRequest_},t.stopRequest=function(){var e;this.request&&(e=this.request,this.request=null,e.onreadystatechange=null,e.abort())},t.media=function(e){var i=this;if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);var t=this.state;if("string"==typeof e){if(!this.masterPlaylistLoader_.master.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.masterPlaylistLoader_.master.playlists[e]}var n=!this.media_||e.id!==this.media_.id;if(n&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList)return this.state="HAVE_METADATA",this.media_=e,void(n&&(this.trigger("mediachanging"),this.trigger("mediachange")));n&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,t,(function(n){i.haveMetadata({startingState:t,playlist:e})})))},t.haveMetadata=function(e){var t=e.startingState;e=e.playlist,this.state="HAVE_METADATA",this.loadedPlaylists_[e.id]=e,this.mediaRequest_=null,this.refreshMedia_(e.id),"HAVE_MASTER"===t?this.trigger("loadedmetadata"):this.trigger("mediachange")},t.pause=function(){this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),o.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMaster_&&(o.clearTimeout(this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_),this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_=null),"HAVE_NOTHING"===this.state&&(this.started=!1)},t.load=function(e){var t=this;o.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;var i=this.media();e?(e=i?i.targetDuration/2*1e3:5e3,this.mediaUpdateTimeout=o.setTimeout((function(){return t.load()}),e)):this.started?i&&!i.endList?(this.isMaster_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist"):this.start()},t.start=function(){var i=this;this.started=!0,this.isMaster_?this.requestMaster_((function(e,t){i.haveMaster_(),i.hasPendingRequest()||i.media_||i.media(i.masterPlaylistLoader_.master.playlists[0])})):this.mediaRequest_=o.setTimeout((function(){return i.haveMaster_()}),0)},t.requestMaster_=function(e){var t=this;this.request=this.vhs_.xhr({uri:this.masterPlaylistLoader_.srcUrl,withCredentials:this.withCredentials},(function(n,r){if(!t.requestErrored_(n,r)){var i=r.responseText!==t.masterPlaylistLoader_.masterXml_;return t.masterPlaylistLoader_.masterXml_=r.responseText,r.responseHeaders&&r.responseHeaders.date?t.masterLoaded_=Date.parse(r.responseHeaders.date):t.masterLoaded_=Date.now(),t.masterPlaylistLoader_.srcUrl=qs(t.handleManifestRedirects,t.masterPlaylistLoader_.srcUrl,r),i?(t.handleMaster_(),void t.syncClientServerClock_((function(){return e(r,i)}))):e(r,i)}"HAVE_NOTHING"===t.state&&(t.started=!1)}))},t.syncClientServerClock_=function(i){var e=this,t=as(this.masterPlaylistLoader_.masterXml_);return null===t?(this.masterPlaylistLoader_.clientOffset_=this.masterLoaded_-Date.now(),i()):"DIRECT"===t.method?(this.masterPlaylistLoader_.clientOffset_=t.value-Date.now(),i()):void(this.request=this.vhs_.xhr({uri:bu(this.masterPlaylistLoader_.srcUrl,t.value),method:t.method,withCredentials:this.withCredentials},(function(n,r){if(e.request){if(n)return e.masterPlaylistLoader_.clientOffset_=e.masterLoaded_-Date.now(),i();r="HEAD"===t.method?r.responseHeaders&&r.responseHeaders.date?Date.parse(r.responseHeaders.date):e.masterLoaded_:Date.parse(r.responseText),e.masterPlaylistLoader_.clientOffset_=r-Date.now(),i()}})))},t.haveMaster_=function(){this.state="HAVE_MASTER",this.isMaster_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)},t.handleMaster_=function(){this.mediaRequest_=null;var e=(go(t=rs((t={masterXml:this.masterPlaylistLoader_.masterXml_,srcUrl:this.masterPlaylistLoader_.srcUrl,clientOffset:this.masterPlaylistLoader_.clientOffset_,sidxMapping:this.masterPlaylistLoader_.sidxMapping_}).masterXml,{manifestUri:i=t.srcUrl,clientOffset:e=t.clientOffset,sidxMapping:t=t.sidxMapping}),i),t),i=this.masterPlaylistLoader_.master;i&&(e=function(e,t,i){for(var a=!0,s=xu(e,{duration:t.duration,minimumUpdatePeriod:t.minimumUpdatePeriod}),n=0;n<t.playlists.length;n++){var r,o=t.playlists[n];
2o.sidx&&(r=Ma(o.sidx),i&&i[r]&&i[r].sidx&&Ra(o,i[r].sidx,o.sidx.resolvedUri)),(o=To(s,o,No))&&(s=o,a=!1)}return fo(t,(function(e,t,i,n){var r;e.playlists&&e.playlists.length&&(r=e.playlists[0].id,(e=To(s,e.playlists[0],No))&&((s=e).mediaGroups[t][i][n].playlists[0]=s.playlists[r],a=!1))})),(a=t.minimumUpdatePeriod===e.minimumUpdatePeriod&&a)?null:s}(i,e,this.masterPlaylistLoader_.sidxMapping_)),this.masterPlaylistLoader_.master=e||i;var t=this.masterPlaylistLoader_.master.locations&&this.masterPlaylistLoader_.master.locations[0];return t&&t!==this.masterPlaylistLoader_.srcUrl&&(this.masterPlaylistLoader_.srcUrl=t),(!i||e&&e.minimumUpdatePeriod!==i.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),Boolean(e)},t.updateMinimumUpdatePeriodTimeout_=function(){var e=this.masterPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(o.clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);var t=e.master&&e.master.minimumUpdatePeriod;0===t&&(e.media()?t=1e3*e.media().targetDuration:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),"number"!=typeof t||t<=0?t<0&&this.logger_("found invalid minimumUpdatePeriod of "+t+", not setting a timeout"):this.createMUPTimeout_(t)},t.createMUPTimeout_=function(e){var t=this.masterPlaylistLoader_;t.minimumUpdatePeriodTimeout_=o.setTimeout((function(){t.minimumUpdatePeriodTimeout_=null,t.trigger("minimumUpdatePeriod"),t.createMUPTimeout_(e)}),e)},t.refreshXml_=function(){var i=this;this.requestMaster_((function(e,t){var n,a;t&&(i.media_&&(i.media_=i.masterPlaylistLoader_.master.playlists[i.media_.id]),i.masterPlaylistLoader_.sidxMapping_=(t=i.masterPlaylistLoader_.master,n=i.masterPlaylistLoader_.sidxMapping_,a=Uo(t.playlists,n),fo(t,(function(e,t,i,r){e.playlists&&e.playlists.length&&(e=e.playlists,a=xu(a,Uo(e,n)))})),a),i.addSidxSegments_(i.media(),i.state,(function(e){i.refreshMedia_(i.media().id)})))}))},t.refreshMedia_=function(e){var t=this;if(!e)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMaster_&&this.handleMaster_();var i=this.masterPlaylistLoader_.master.playlists,n=!this.media_||this.media_!==i[e];n?this.media_=i[e]:this.trigger("playlistunchanged"),this.mediaUpdateTimeout||function e(){t.media().endList||(t.mediaUpdateTimeout=o.setTimeout((function(){t.trigger("mediaupdatetimeout"),e()}),So(t.media(),Boolean(n))))}(),this.trigger("loadedplaylist")},e}(Qt),Lu={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,BACK_BUFFER_LENGTH:30,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:16,BUFFER_LOW_WATER_LINE_RATE:1,BUFFER_HIGH_WATER_LINE:30},Du=(ui=function(e){return function(){var t=function(e){try{return URL.createObjectURL(new Blob([e],{type:"application/javascript"}))}catch(t){var i=new BlobBuilder;return i.append(e),URL.createObjectURL(i.getBlob())}}(e),n=Bo(new Worker(t));n.objURL=t;var i=n.terminate;return n.on=n.addEventListener,n.off=n.removeEventListener,n.terminate=function(){return URL.revokeObjectURL(t),i.call(this)},n}},On=function(e){return"var browserWorkerPolyFill = "+Bo.toString()+";\nbrowserWorkerPolyFill(self);\n"+e},K=function(e){return e.toString().replace(/^function.+?{/,"").slice(0,-1)},ui(On(K((function(){var e=function(){this.init=function(){var a={};this.on=function(e,t){a[e]||(a[e]=[]),a[e]=a[e].concat(t)},this.off=function(e,t){return!!a[e]&&(t=a[e].indexOf(t),a[e]=a[e].slice(),a[e].splice(t,1),-1<t)},this.trigger=function(e){var t,i,n,r=a[e];if(r)if(2===arguments.length)for(i=r.length,t=0;t<i;++t)r[t].call(this,arguments[1]);else{for(n=[],t=arguments.length,t=1;t<arguments.length;++t)n.push(arguments[t]);for(i=r.length,t=0;t<i;++t)r[t].apply(this,n)}},this.dispose=function(){a={}}}};e.prototype.pipe=function(e){return this.on("data",(function(t){e.push(t)})),this.on("done",(function(t){e.flush(t)})),this.on("partialdone",(function(t){e.partialFlush(t)})),this.on("endedtimeline",(function(t){e.endTimeline(t)})),this.on("reset",(function(t){e.reset(t)})),e},e.prototype.push=function(e){this.trigger("data",e)},e.prototype.flush=function(e){this.trigger("done",e)},e.prototype.partialFlush=function(e){this.trigger("partialdone",e)},e.prototype.endTimeline=function(e){this.trigger("endedtimeline",e)},e.prototype.reset=function(e){this.trigger("reset",e)};var u,t,i,n,r,a,s,o,l,c,d,h,p,f,m,g,y,v,_,b,T,S,E,k,C,w,I,A,x,P,L,D,O,R,M,N,U,B,F,j=e,H=Math.pow(2,32)-1;function q(e,t){var i={size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}};return i.dataOffset=t,i.compositionTimeOffset=e.pts-e.dts,i.duration=e.duration,i.size=4*e.length,i.size+=e.byteLength,e.keyFrame&&(i.flags.dependsOn=2,i.flags.isNonSyncSample=0),i}function V(e){for(var t=[];e--;)t.push(0);return t}function W(){var e,i;return z||(e={96e3:[ee,[227,64],V(154),[56]],88200:[ee,[231],V(170),[56]],64e3:[ee,[248,192],V(240),[56]],48e3:[ee,[255,192],V(268),[55,148,128],V(54),[112]],44100:[ee,[255,192],V(268),[55,163,128],V(84),[112]],32e3:[ee,[255,192],V(268),[55,234],V(226),[112]],24e3:[ee,[255,192],V(268),[55,255,128],V(268),[111,112],V(126),[224]],16e3:[ee,[255,192],V(268),[55,255,128],V(268),[111,255],V(269),[223,108],V(195),[1,192]],12e3:[te,V(268),[3,127,248],V(268),[6,255,240],V(268),[13,255,224],V(268),[27,253,128],V(259),[56]],11025:[te,V(268),[3,127,248],V(268),[6,255,240],V(268),[13,255,224],V(268),[27,255,192],V(268),[55,175,128],V(108),[112]],8e3:[te,V(268),[3,121,16],V(47),[7]]},i=e,z=Object.keys(i).reduce((function(e,t){return e[t]=new Uint8Array(i[t].reduce((function(e,t){return e.concat(t)}),[])),e}),{})),z}!function(){if(T={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],pasp:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]},"undefined"!=typeof Uint8Array){for(var e in T)T.hasOwnProperty(e)&&(T[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);S=new Uint8Array(["i".charCodeAt(0),"s".charCodeAt(0),"o".charCodeAt(0),"m".charCodeAt(0)]),k=new Uint8Array(["a".charCodeAt(0),"v".charCodeAt(0),"c".charCodeAt(0),"1".charCodeAt(0)]),E=new Uint8Array([0,0,0,1]),C=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]),w=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]),I={video:C,audio:w},P=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),x=new Uint8Array([0,0,0,0,0,0,0,0]),L=new Uint8Array([0,0,0,0,0,0,0,0]),D=L,O=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),R=L,A=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}}(),u=function(e){for(var t,i=[],n=0,r=1;r<arguments.length;r++)i.push(arguments[r]);for(r=i.length;r--;)n+=i[r].byteLength;for(t=new Uint8Array(n+8),new DataView(t.buffer,t.byteOffset,t.byteLength).setUint32(0,t.byteLength),t.set(e,4),r=0,n=8;r<i.length;r++)t.set(i[r],n),n+=i[r].byteLength;return t},t=function(){return u(T.dinf,u(T.dref,P))},i=function(e){return u(T.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,e.audioobjecttype<<3|e.samplingfrequencyindex>>>1,e.samplingfrequencyindex<<7|e.channelcount<<3,6,1,2]))},f=function(e){return u(T.hdlr,I[e])},p=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,e.duration>>>24&255,e.duration>>>16&255,e.duration>>>8&255,255&e.duration,85,196,0,0]);return e.samplerate&&(t[12]=e.samplerate>>>24&255,t[13]=e.samplerate>>>16&255,t[14]=e.samplerate>>>8&255,t[15]=255&e.samplerate),u(T.mdhd,t)},h=function(e){return u(T.mdia,p(e),f(e.type),a(e))},r=function(e){return u(T.mfhd,new Uint8Array([0,0,0,0,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e]))},a=function(e){return u(T.minf,"video"===e.type?u(T.vmhd,A):u(T.smhd,x),t(),g(e))},qe=function(e,t){for(var i=[],n=t.length;n--;)i[n]=v(t[n]);return u.apply(null,[T.moof,r(e)].concat(i))},s=function(e){for(var t=e.length,i=[];t--;)i[t]=c(e[t]);
vendor: 4,934 bytes, line 2
2return u.apply(null,[T.moov,l(4294967295)].concat(i).concat(o(e)))},o=function(e){for(var t=e.length,i=[];t--;)i[t]=_(e[t]);return u.apply(null,[T.mvex].concat(i))},l=function(e){return e=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]),u(T.mvhd,e)},m=function(e){for(var t,i=e.samples||[],n=new Uint8Array(4+i.length),r=0;r<i.length;r++)t=i[r].flags,n[r+4]=t.dependsOn<<4|t.isDependedOn<<2|t.hasRedundancy;return u(T.sdtp,n)},g=function(e){return u(T.stbl,y(e),u(T.stts,R),u(T.stsc,D),u(T.stsz,O),u(T.stco,L))},y=function(e){return u(T.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),("video"===e.type?M:N)(e))},M=function(e){for(var t,i,n=e.sps||[],r=e.pps||[],a=[],s=[],o=0;o<n.length;o++)a.push((65280&n[o].byteLength)>>>8),a.push(255&n[o].byteLength),a=a.concat(Array.prototype.slice.call(n[o]));for(o=0;o<r.length;o++)s.push((65280&r[o].byteLength)>>>8),s.push(255&r[o].byteLength),s=s.concat(Array.prototype.slice.call(r[o]));return t=[T.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(65280&e.width)>>8,255&e.width,(65280&e.height)>>8,255&e.height,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),u(T.avcC,new Uint8Array([1,e.profileIdc,e.profileCompatibility,e.levelIdc,255].concat([n.length],a,[r.length],s))),u(T.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],e.sarRatio&&(i=e.sarRatio[0],e=e.sarRatio[1],t.push(u(T.pasp,new Uint8Array([(4278190080&i)>>24,(16711680&i)>>16,(65280&i)>>8,255&i,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e])))),u.apply(null,t)},N=function(e){return u(T.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&e.channelcount)>>8,255&e.channelcount,(65280&e.samplesize)>>8,255&e.samplesize,0,0,0,0,(65280&e.samplerate)>>8,255&e.samplerate,0,0]),i(e))},d=function(e){return e=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,0,(4278190080&e.duration)>>24,(16711680&e.duration)>>16,(65280&e.duration)>>8,255&e.duration,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(65280&e.width)>>8,255&e.width,0,0,(65280&e.height)>>8,255&e.height,0,0]),u(T.tkhd,e)},v=function(e){var t,i=u(T.tfhd,new Uint8Array([0,0,0,58,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),n=Math.floor(e.baseMediaDecodeTime/(1+H)),r=Math.floor(e.baseMediaDecodeTime%(1+H));return n=u(T.tfdt,new Uint8Array([1,0,0,0,n>>>24&255,n>>>16&255,n>>>8&255,255&n,r>>>24&255,r>>>16&255,r>>>8&255,255&r])),"audio"===e.type?(t=b(e,92),u(T.traf,i,n,t)):(r=m(e),t=b(e,r.length+92),u(T.traf,i,n,t,r))},c=function(e){return e.duration=e.duration||4294967295,u(T.trak,d(e),h(e))},_=function(e){var t=new Uint8Array([0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return"video"!==e.type&&(t[t.length-1]=0),u(T.trex,t)},U=function(e,t){var i=0,n=0,r=0,a=0;return e.length&&(void 0!==e[0].duration&&(i=1),void 0!==e[0].size&&(n=2),void 0!==e[0].flags&&(r=4),void 0!==e[0].compositionTimeOffset&&(a=8)),[0,0,i|n|r|a,1,(4278190080&e.length)>>>24,(16711680&e.length)>>>16,(65280&e.length)>>>8,255&e.length,(4278190080&t)>>>24,(16711680&t)>>>16,(65280&t)>>>8,255&t]},B=function(e,t){var i,n,r,a,s=e.samples||[];for(t+=20+16*s.length,t=U(s,t),(n=new Uint8Array(t.length+16*s.length)).set(t),i=t.length,a=0;a<s.length;a++)r=s[a],n[i++]=(4278190080&r.duration)>>>24,n[i++]=(16711680&r.duration)>>>16,n[i++]=(65280&r.duration)>>>8,n[i++]=255&r.duration,n[i++]=(4278190080&r.size)>>>24,n[i++]=(16711680&r.size)>>>16,n[i++]=(65280&r.size)>>>8,n[i++]=255&r.size,n[i++]=r.flags.isLeading<<2|r.flags.dependsOn,n[i++]=r.flags.isDependedOn<<6|r.flags.hasRedundancy<<4|r.flags.paddingValue<<1|r.flags.isNonSyncSample,n[i++]=61440&r.flags.degradationPriority,n[i++]=15&r.flags.degradationPriority,n[i++]=(4278190080&r.compositionTimeOffset)>>>24,n[i++]=(16711680&r.compositionTimeOffset)>>>16,n[i++]=(65280&r.compositionTimeOffset)>>>8,n[i++]=255&r.compositionTimeOffset;return u(T.trun,n)},F=function(e,t){var i,n,r,a,s=e.samples||[];for(t+=20+8*s.length,t=U(s,t),(i=new Uint8Array(t.length+8*s.length)).set(t),n=t.length,a=0;a<s.length;a++)r=s[a],i[n++]=(4278190080&r.duration)>>>24,i[n++]=(16711680&r.duration)>>>16,i[n++]=(65280&r.duration)>>>8,i[n++]=255&r.duration,i[n++]=(4278190080&r.size)>>>24,i[n++]=(16711680&r.size)>>>16,i[n++]=(65280&r.size)>>>8,i[n++]=255&r.size;return u(T.trun,i)},b=function(e,t){return("audio"===e.type?F:B)(e,t)},n=function(){return u(T.ftyp,S,E,S,k)};var z,G=function(e){return u(T.mdat,e)},X=qe,K=function(e){var t=n(),i=s(e);
vendor: 5,929 bytes, line 2
2return(e=new Uint8Array(t.byteLength+i.byteLength)).set(t),e.set(i,t.byteLength),e},Y=function(e){var t,i,n=[],r=[];for(r.byteLength=0,r.nalCount=0,r.duration=0,t=n.byteLength=0;t<e.length;t++)"access_unit_delimiter_rbsp"===(i=e[t]).nalUnitType?(n.length&&(n.duration=i.dts-n.dts,r.byteLength+=n.byteLength,r.nalCount+=n.length,r.duration+=n.duration,r.push(n)),(n=[i]).byteLength=i.data.byteLength,n.pts=i.pts,n.dts=i.dts):("slice_layer_without_partitioning_rbsp_idr"===i.nalUnitType&&(n.keyFrame=!0),n.duration=i.dts-n.dts,n.byteLength+=i.data.byteLength,n.push(i));return r.length&&(!n.duration||n.duration<=0)&&(n.duration=r[r.length-1].duration),r.byteLength+=n.byteLength,r.nalCount+=n.length,r.duration+=n.duration,r.push(n),r},Q=function(e){var t,i,n=[],r=[];for(n.byteLength=0,n.nalCount=0,n.duration=0,n.pts=e[0].pts,n.dts=e[0].dts,r.byteLength=0,r.nalCount=0,r.duration=0,r.pts=e[0].pts,r.dts=e[0].dts,t=0;t<e.length;t++)(i=e[t]).keyFrame?(n.length&&(r.push(n),r.byteLength+=n.byteLength,r.nalCount+=n.nalCount,r.duration+=n.duration),(n=[i]).nalCount=i.length,n.byteLength=i.byteLength,n.pts=i.pts,n.dts=i.dts,n.duration=i.duration):(n.duration+=i.duration,n.nalCount+=i.length,n.byteLength+=i.byteLength,n.push(i));return r.length&&n.duration<=0&&(n.duration=r[r.length-1].duration),r.byteLength+=n.byteLength,r.nalCount+=n.nalCount,r.duration+=n.duration,r.push(n),r},$=function(e){var t;return!e[0][0].keyFrame&&1<e.length&&(t=e.shift(),e.byteLength-=t.byteLength,e.nalCount-=t.nalCount,e[0][0].dts=t.dts,e[0][0].pts=t.pts,e[0][0].duration+=t.duration),e},J=function(e,t){for(var i,n,r,a=t||0,s=[],o=0;o<e.length;o++)for(n=e[o],i=0;i<n.length;i++)a+=(r=q(r=n[i],a)).size,s.push(r);return s},Z=function(e){for(var t,i,n,r,a,s=0,o=e.byteLength,u=e.nalCount,l=new Uint8Array(o+4*u),c=new DataView(l.buffer),d=0;d<e.length;d++)for(n=e[d],t=0;t<n.length;t++)for(r=n[t],i=0;i<r.length;i++)a=r[i],c.setUint32(s,a.data.byteLength),l.set(a.data,s+=4),s+=a.data.byteLength;return l},ee=[33,16,5,32,164,27],te=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],ie=function(e){return 9e4*e},ne=function(e,t){return e*t},re=function(e){return e/9e4},ae=function(e,t){return e/t},se=9e4,oe=ie,ue=re,le=function(e,t){return ie(ae(e,t))},ce=function(e,t){return ne(re(e),t)},de=function(e,t,i){return re(i?e:e-t)},he=function(e,t,i,n){var r,a,s,o,u,l,c=0,d=0;if(t.length&&(r=le(e.baseMediaDecodeTime,e.samplerate),a=Math.ceil(se/(e.samplerate/1024)),i&&n&&(s=r-Math.max(i,n),d=(c=Math.floor(s/a))*a),!(c<1||se/2<d))){for(o=(o=W()[e.samplerate])||t[0].data,u=0;u<c;u++)l=t[0],t.splice(0,0,{data:o,dts:l.dts-a,pts:l.pts-a});return e.baseMediaDecodeTime-=Math.floor(ce(d,e.samplerate)),d}},pe=function(e,t,i){return t.minSegmentDts>=i?e:(t.minSegmentDts=1/0,e.filter((function(e){return e.dts>=i&&(t.minSegmentDts=Math.min(t.minSegmentDts,e.dts),t.minSegmentPts=t.minSegmentDts,!0)})))},fe=function(e){for(var t,i=[],n=0;n<e.length;n++)t=e[n],i.push({size:t.data.byteLength,duration:1024});return i},me=function(e){for(var t,i=0,n=new Uint8Array(function(e){for(var t=0,i=0;i<e.length;i++)t+=e[i].data.byteLength;return t}(e)),r=0;r<e.length;r++)t=e[r],n.set(t.data,i),i+=t.data.byteLength;return n},ge=se,ye=function(e){delete e.minSegmentDts,delete e.maxSegmentDts,delete e.minSegmentPts,delete e.maxSegmentPts},ve=function(e,t){var i=e.minSegmentDts;return t||(i-=e.timelineStartInfo.dts),t=e.timelineStartInfo.baseMediaDecodeTime,t+=i,t=Math.max(0,t),"audio"===e.type&&(t*=e.samplerate/ge,t=Math.floor(t)),t},_e=function(e,t){"number"==typeof t.pts&&(void 0===e.timelineStartInfo.pts&&(e.timelineStartInfo.pts=t.pts),void 0===e.minSegmentPts?e.minSegmentPts=t.pts:e.minSegmentPts=Math.min(e.minSegmentPts,t.pts),void 0===e.maxSegmentPts?e.maxSegmentPts=t.pts:e.maxSegmentPts=Math.max(e.maxSegmentPts,t.pts)),"number"==typeof t.dts&&(void 0===e.timelineStartInfo.dts&&(e.timelineStartInfo.dts=t.dts),void 0===e.minSegmentDts?e.minSegmentDts=t.dts:e.minSegmentDts=Math.min(e.minSegmentDts,t.dts),void 0===e.maxSegmentDts?e.maxSegmentDts=t.dts:e.maxSegmentDts=Math.max(e.maxSegmentDts,t.dts))},be=function(e){for(var t=0,i={payloadType:-1,payloadSize:0},n=0,r=0;t<e.byteLength&&128!==e[t];){for(;255===e[t];)n+=255,t++;for(n+=e[t++];255===e[t];)r+=255,t++;if(r+=e[t++],!i.payload&&4===n){if("GA94"===String.fromCharCode(e[t+3],e[t+4],e[t+5],e[t+6])){i.payloadType=n,i.payloadSize=r,i.payload=e.subarray(t,t+r);break}i.payload=void 0}t+=r,r=n=0}return i},Te=function(e){return 181!==e.payload[0]||49!=(e.payload[1]<<8|e.payload[2])||"GA94"!==String.fromCharCode(e.payload[3],e.payload[4],e.payload[5],e.payload[6])||3!==e.payload[7]?null:e.payload.subarray(8,e.payload.length-1)},Se=function(e,t){var i,n,r,a,s=[];if(!(64&t[0]))return s;for(n=31&t[0],i=0;i<n;i++)a={type:3&t[2+(r=3*i)],pts:e},4&t[2+r]&&(a.ccData=t[3+r]<<8|t[4+r],s.push(a));return s},Ee=function(e){for(var t=e.byteLength,i=[],n=1;n<t-2;)0===e[n]&&0===e[n+1]&&3===e[n+2]?(i.push(n+2),n+=2):n++;if(0===i.length)return e;var r=t-i.length,a=new Uint8Array(r),s=0;for(n=0;n<r;s++,n++)s===i[0]&&(s++,i.shift()),a[n]=e[s];return a},ke=4,Ce=function e(t){t=t||{},e.prototype.init.call(this),this.parse708captions_="boolean"!=typeof t.parse708captions||t.parse708captions,this.captionPackets_=[],this.ccStreams_=[new Me(0,0),new Me(0,1),new Me(1,0),new Me(1,1)],this.parse708captions_&&(this.cc708Stream_=new Pe),this.reset(),this.ccStreams_.forEach((function(e){e.on("data",this.trigger.bind(this,"data")),e.on("partialdone",this.trigger.bind(this,"partialdone")),e.on("done",this.trigger.bind(this,"done"))}),this),this.parse708captions_&&(this.cc708Stream_.on("data",this.trigger.bind(this,"data")),this.cc708Stream_.on("partialdone",this.trigger.bind(this,"partialdone")),this.cc708Stream_.on("done",this.trigger.bind(this,"done")))};function we(e){return 32<=e&&e<=127||160<=e&&e<=255}function Ie(e){this.windowNum=e,this.reset()}(Ce.prototype=new j).push=function(e){var t,i;
2if("sei_rbsp"===e.nalUnitType&&(t=be(e.escapedRBSP)).payload&&t.payloadType===ke&&(i=Te(t)))if(e.dts<this.latestDts_)this.ignoreNextEqualDts_=!0;else{if(e.dts===this.latestDts_&&this.ignoreNextEqualDts_)return this.numSameDts_--,void(this.numSameDts_||(this.ignoreNextEqualDts_=!1));i=Se(e.pts,i),this.captionPackets_=this.captionPackets_.concat(i),this.latestDts_!==e.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=e.dts}},Ce.prototype.flushCCStreams=function(e){this.ccStreams_.forEach((function(t){return"flush"===e?t.flush():t.partialFlush()}),this)},Ce.prototype.flushStream=function(e){this.captionPackets_.length&&(this.captionPackets_.forEach((function(e,t){e.presortIndex=t})),this.captionPackets_.sort((function(e,t){return e.pts===t.pts?e.presortIndex-t.presortIndex:e.pts-t.pts})),this.captionPackets_.forEach((function(e){e.type<2?this.dispatchCea608Packet(e):this.dispatchCea708Packet(e)}),this),this.captionPackets_.length=0),this.flushCCStreams(e)},Ce.prototype.flush=function(){return this.flushStream("flush")},Ce.prototype.partialFlush=function(){return this.flushStream("partialFlush")},Ce.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach((function(e){e.reset()}))},Ce.prototype.dispatchCea608Packet=function(e){this.setsTextOrXDSActive(e)?this.activeCea608Channel_[e.type]=null:this.setsChannel1Active(e)?this.activeCea608Channel_[e.type]=0:this.setsChannel2Active(e)&&(this.activeCea608Channel_[e.type]=1),null!==this.activeCea608Channel_[e.type]&&this.ccStreams_[(e.type<<1)+this.activeCea608Channel_[e.type]].push(e)},Ce.prototype.setsChannel1Active=function(e){return 4096==(30720&e.ccData)},Ce.prototype.setsChannel2Active=function(e){return 6144==(30720&e.ccData)},Ce.prototype.setsTextOrXDSActive=function(e){return 256==(28928&e.ccData)||4138==(30974&e.ccData)||6186==(30974&e.ccData)},Ce.prototype.dispatchCea708Packet=function(e){this.parse708captions_&&this.cc708Stream_.push(e)};var Ae={127:9834,4128:32,4129:160,4133:8230,4138:352,4140:338,4144:9608,4145:8216,4146:8217,4147:8220,4148:8221,4149:8226,4153:8482,4154:353,4156:339,4157:8480,4159:376,4214:8539,4215:8540,4216:8541,4217:8542,4218:9168,4219:9124,4220:9123,4221:9135,4222:9126,4223:9121,4256:12600};function xe(e){this.serviceNum=e,this.text="",this.currentWindow=new Ie(-1),this.windows=[]}Ie.prototype.reset=function(){this.clearText(),this.pendingNewLine=!1,this.winAttr={},this.penAttr={},this.penLoc={},this.penColor={},this.visible=0,this.rowLock=0,this.columnLock=0,this.priority=0,this.relativePositioning=0,this.anchorVertical=0,this.anchorHorizontal=0,this.anchorPoint=0,this.rowCount=1,this.virtualRowCount=this.rowCount+1,this.columnCount=41,this.windowStyle=0,this.penStyle=0},Ie.prototype.getText=function(){return this.rows.join("\n")},Ie.prototype.clearText=function(){this.rows=[""],this.rowIdx=0},Ie.prototype.newLine=function(e){for(this.rows.length>=this.virtualRowCount&&"function"==typeof this.beforeRowOverflow&&this.beforeRowOverflow(e),0<this.rows.length&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},Ie.prototype.isEmpty=function(){return 0===this.rows.length||1===this.rows.length&&""===this.rows[0]},Ie.prototype.addText=function(e){this.rows[this.rowIdx]+=e},Ie.prototype.backspace=function(){var e;this.isEmpty()||(e=this.rows[this.rowIdx],this.rows[this.rowIdx]=e.substr(0,e.length-1))},xe.prototype.init=function(e,t){this.startPts=e;for(var i=0;i<8;i++)this.windows[i]=new Ie(i),"function"==typeof t&&(this.windows[i].beforeRowOverflow=t)},xe.prototype.setCurrentWindow=function(e){this.currentWindow=this.windows[e]};var Pe=function e(){e.prototype.init.call(this);var t=this;this.current708Packet=null,this.services={},this.push=function(e){(3===e.type||null===t.current708Packet)&&t.new708Packet(),t.add708Bytes(e)}};function Le(e){return null===e?"":(e=Oe[e]||e,String.fromCharCode(e))}function De(){for(var e=[],t=15;t--;)e.push("");return e}Pe.prototype=new j,Pe.prototype.new708Packet=function(){null!==this.current708Packet&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},Pe.prototype.add708Bytes=function(e){var i=(t=e.ccData)>>>8,t=255&t;this.current708Packet.ptsVals.push(e.pts),this.current708Packet.data.push(i),this.current708Packet.data.push(t)},Pe.prototype.push708Packet=function(){var e,t=this.current708Packet,i=t.data,n=null,r=0,a=i[r++];for(t.seq=a>>6,t.sizeCode=63&a;r<i.length;r++)e=31&(a=i[r++]),7==(n=a>>5)&&0<e&&(n=i[r++]),this.pushServiceBlock(n,r,e),0<e&&(r+=e-1)},Pe.prototype.pushServiceBlock=function(e,t,i){for(var n,r=t,a=this.current708Packet.data,s=(s=this.services[e])||this.initService(e,r);r<t+i&&r<a.length;r++)we(n=a[r])?r=this.handleText(r,s):16===n?r=this.extendedCommands(r,s):128<=n&&n<=135?r=this.setCurrentWindow(r,s):152<=n&&n<=159?r=this.defineWindow(r,s):136===n?r=this.clearWindows(r,s):140===n?r=this.deleteWindows(r,s):137===n?r=this.displayWindows(r,s):138===n?r=this.hideWindows(r,s):139===n?r=this.toggleWindows(r,s):151===n?r=this.setWindowAttributes(r,s):144===n?r=this.setPenAttributes(r,s):145===n?r=this.setPenColor(r,s):146===n?r=this.setPenLocation(r,s):143===n?s=this.reset(r,s):8===n?s.currentWindow.backspace():12===n?s.currentWindow.clearText():13===n?s.currentWindow.pendingNewLine=!0:14===n?s.currentWindow.clearText():141===n&&r++},Pe.prototype.extendedCommands=function(e,t){return we(this.current708Packet.data[++e])?this.handleText(e,t,!0):e},Pe.prototype.getPts=function(e){return this.current708Packet.ptsVals[Math.floor(e/2)]},Pe.prototype.initService=function(e,t){var i=this;return this.services[e]=new xe(e),this.services[e].init(this.getPts(t),(function(t){i.flushDisplayed(t,i.services[e])})),this.services[e]},Pe.prototype.handleText=function(e,t,i){var n=this.current708Packet.data[e];return n=Ae[i=(i?4096:0)|n]||i,n=4096&i&&i===n?"":String.fromCharCode(n),(t=t.currentWindow).pendingNewLine&&!t.isEmpty()&&t.newLine(this.getPts(e)),t.pendingNewLine=!1,t.addText(n),e},Pe.prototype.setCurrentWindow=function(e,t){var i=this.current708Packet.data[e];return t.setCurrentWindow(7&i),e},Pe.prototype.defineWindow=function(e,t){var i=this.current708Packet.data,n=i[e];return t.setCurrentWindow(7&n),t=t.currentWindow,n=i[++e],t.visible=(32&n)>>5,t.rowLock=(16&n)>>4,t.columnLock=(8&n)>>3,t.priority=7&n,n=i[++e],t.relativePositioning=(128&n)>>7,t.anchorVertical=127&n,n=i[++e],t.anchorHorizontal=n,n=i[++e],t.anchorPoint=(240&n)>>4,t.rowCount=15&n,n=i[++e],t.columnCount=63&n,n=i[++e],t.windowStyle=(56&n)>>3,t.penStyle=7&n,t.virtualRowCount=t.rowCount+1,e},Pe.prototype.setWindowAttributes=function(e,t){var i=this.current708Packet.data,n=i[e];return t=t.currentWindow.winAttr,n=i[++e],t.fillOpacity=(192&n)>>6,t.fillRed=(48&n)>>4,t.fillGreen=(12&n)>>2,t.fillBlue=3&n,n=i[++e],t.borderType=(192&n)>>6,t.borderRed=(48&n)>>4,t.borderGreen=(12&n)>>2,t.borderBlue=3&n,n=i[++e],t.borderType+=(128&n)>>5,t.wordWrap=(64&n)>>6,t.printDirection=(48&n)>>4,t.scrollDirection=(12&n)>>2,t.justify=3&n,n=i[++e],t.effectSpeed=(240&n)>>4,t.effectDirection=(12&n)>>2,t.displayEffect=3&n,e},Pe.prototype.flushDisplayed=function(e,t){for(var i=[],n=0;n<8;n++)t.windows[n].visible&&!t.windows[n].isEmpty()&&i.push(t.windows[n].getText());t.endPts=e,t.text=i.join("\n\n"),this.pushCaption(t),t.startPts=e},Pe.prototype.pushCaption=function(e){""!==e.text&&(this.trigger("data",{startPts:e.startPts,endPts:e.endPts,text:e.text,stream
2:"cc708_"+e.serviceNum}),e.text="",e.startPts=e.endPts)},Pe.prototype.displayWindows=function(e,t){var i=this.current708Packet.data[++e],n=this.getPts(e);this.flushDisplayed(n,t);for(var r=0;r<8;r++)i&1<<r&&(t.windows[r].visible=1);return e},Pe.prototype.hideWindows=function(e,t){var i=this.current708Packet.data[++e],n=this.getPts(e);this.flushDisplayed(n,t);for(var r=0;r<8;r++)i&1<<r&&(t.windows[r].visible=0);return e},Pe.prototype.toggleWindows=function(e,t){var i=this.current708Packet.data[++e],n=this.getPts(e);this.flushDisplayed(n,t);for(var r=0;r<8;r++)i&1<<r&&(t.windows[r].visible^=1);return e},Pe.prototype.clearWindows=function(e,t){var i=this.current708Packet.data[++e],n=this.getPts(e);this.flushDisplayed(n,t);for(var r=0;r<8;r++)i&1<<r&&t.windows[r].clearText();return e},Pe.prototype.deleteWindows=function(e,t){var i=this.current708Packet.data[++e],n=this.getPts(e);this.flushDisplayed(n,t);for(var r=0;r<8;r++)i&1<<r&&t.windows[r].reset();return e},Pe.prototype.setPenAttributes=function(e,t){var i=this.current708Packet.data,n=i[e];return t=t.currentWindow.penAttr,n=i[++e],t.textTag=(240&n)>>4,t.offset=(12&n)>>2,t.penSize=3&n,n=i[++e],t.italics=(128&n)>>7,t.underline=(64&n)>>6,t.edgeType=(56&n)>>3,t.fontStyle=7&n,e},Pe.prototype.setPenColor=function(e,t){var i=this.current708Packet.data,n=i[e];return t=t.currentWindow.penColor,n=i[++e],t.fgOpacity=(192&n)>>6,t.fgRed=(48&n)>>4,t.fgGreen=(12&n)>>2,t.fgBlue=3&n,n=i[++e],t.bgOpacity=(192&n)>>6,t.bgRed=(48&n)>>4,t.bgGreen=(12&n)>>2,t.bgBlue=3&n,n=i[++e],t.edgeRed=(48&n)>>4,t.edgeGreen=(12&n)>>2,t.edgeBlue=3&n,e},Pe.prototype.setPenLocation=function(e,t){var i=this.current708Packet.data,n=i[e],r=t.currentWindow.penLoc;return t.currentWindow.pendingNewLine=!0,n=i[++e],r.row=15&n,n=i[++e],r.column=63&n,e},Pe.prototype.reset=function(e,t){var i=this.getPts(e);return this.flushDisplayed(i,t),this.initService(t.serviceNum,e)};var Oe={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},Re=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],Me=function e(t,i){e.prototype.init.call(this),this.field_=t||0,this.dataChannel_=i||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(e){var t,i,n,r,a=32639&e.ccData;a!==this.lastControlCode_?(4096==(61440&a)?this.lastControlCode_=a:a!==this.PADDING_&&(this.lastControlCode_=null),t=a>>>8,i=255&a,a===this.PADDING_||(a===this.RESUME_CAPTION_LOADING_?this.mode_="popOn":a===this.END_OF_CAPTION_?(this.mode_="popOn",this.clearFormatting(e.pts),this.flushDisplayed(e.pts),r=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=r,this.startPts_=e.pts):a===this.ROLL_UP_2_ROWS_?(this.rollUpRows_=2,this.setRollUp(e.pts)):a===this.ROLL_UP_3_ROWS_?(this.rollUpRows_=3,this.setRollUp(e.pts)):a===this.ROLL_UP_4_ROWS_?(this.rollUpRows_=4,this.setRollUp(e.pts)):a===this.CARRIAGE_RETURN_?(this.clearFormatting(e.pts),this.flushDisplayed(e.pts),this.shiftRowsUp_(),this.startPts_=e.pts):a===this.BACKSPACE_?"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1):a===this.ERASE_DISPLAYED_MEMORY_?(this.flushDisplayed(e.pts),this.displayed_=De()):a===this.ERASE_NON_DISPLAYED_MEMORY_?this.nonDisplayed_=De():a===this.RESUME_DIRECT_CAPTIONING_?("paintOn"!==this.mode_&&(this.flushDisplayed(e.pts),this.displayed_=De()),this.mode_="paintOn",this.startPts_=e.pts):this.isSpecialCharacter(t,i)?(n=Le((t=(3&t)<<8)|i),this[this.mode_](e.pts,n),this.column_++):this.isExtCharacter(t,i)?("popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1),n=Le((t=(3&t)<<8)|i),this[this.mode_](e.pts,n),this.column_++):this.isMidRowCode(t,i)?(this.clearFormatting(e.pts),this[this.mode_](e.pts," "),this.column_++,!(14&~i)&&this.addFormatting(e.pts,["i"]),!(1&~i)&&this.addFormatting(e.pts,["u"])):this.isOffsetControlCode(t,i)?this.column_+=3&i:this.isPAC(t,i)?(r=Re.indexOf(7968&a),"rollUp"===this.mode_&&(r-this.rollUpRows_+1<0&&(r=this.rollUpRows_-1),this.setRollUp(e.pts,r)),r!==this.row_&&(this.clearFormatting(e.pts),this.row_=r),1&i&&-1===this.formatting_.indexOf("u")&&this.addFormatting(e.pts,["u"]),!(16&~a)&&(this.column_=4*((14&a)>>1)),this.isColorPAC(i)&&!(14&~i)&&this.addFormatting(e.pts,["i"])):this.isNormalChar(t)&&(0===i&&(i=null),n=Le(t),n+=Le(i),this[this.mode_](e.pts,n),this.column_+=n.length))):this.lastControlCode_=null}};function Ne(e,t){var i=1;for(t<e&&(i=-1);4294967296<Math.abs(t-e);)e+=8589934592*i;return e}Me.prototype=new j,Me.prototype.flushDisplayed=function(e){var t=this.displayed_.map((function(e,t){try{return e.trim()}catch(e){return this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+t+"."}),""}}),this).join("\n").replace(/^\n+|\n+$/g,"");t.length&&this.trigger("data",{startPts:this.startPts_,endPts:e,text:t,stream
vendor: 7,500 bytes, line 2
2:this.name_})},Me.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=De(),this.nonDisplayed_=De(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,this.formatting_=[]},Me.prototype.setConstants=function(){0===this.dataChannel_?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):1===this.dataChannel_&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_},Me.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&48<=t&&t<=63},Me.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&32<=t&&t<=63},Me.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&32<=t&&t<=47},Me.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&33<=t&&t<=35},Me.prototype.isPAC=function(e,t){return e>=this.BASE_&&e<this.BASE_+8&&64<=t&&t<=127},Me.prototype.isColorPAC=function(e){return 64<=e&&e<=79||96<=e&&e<=127},Me.prototype.isNormalChar=function(e){return 32<=e&&e<=127},Me.prototype.setRollUp=function(e,t){if("rollUp"!==this.mode_&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(e),this.nonDisplayed_=De(),this.displayed_=De()),void 0!==t&&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]="";void 0===t&&(t=this.row_),this.topRow_=t-this.rollUpRows_+1},Me.prototype.addFormatting=function(e,t){this.formatting_=this.formatting_.concat(t),t=t.reduce((function(e,t){return e+"<"+t+">"}),""),this[this.mode_](e,t)},Me.prototype.clearFormatting=function(e){var t;this.formatting_.length&&(t=this.formatting_.reverse().reduce((function(e,t){return e+"</"+t+">"}),""),this.formatting_=[],this[this.mode_](e,t))},Me.prototype.popOn=function(e,t){var i=this.nonDisplayed_[this.row_];this.nonDisplayed_[this.row_]=i+=t},Me.prototype.rollUp=function(e,t){var i=this.displayed_[this.row_];this.displayed_[this.row_]=i+=t},Me.prototype.shiftRowsUp_=function(){for(var e=0;e<this.topRow_;e++)this.displayed_[e]="";for(e=this.row_+1;e<15;e++)this.displayed_[e]="";for(e=this.topRow_;e<this.row_;e++)this.displayed_[e]=this.displayed_[e+1];this.displayed_[this.row_]=""},Me.prototype.paintOn=function(e,t){var i=this.displayed_[this.row_];this.displayed_[this.row_]=i+=t};var Ue={CaptionStream:Ce,Cea608Stream:Me,Cea708Stream:Pe},Be={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21};function Fe(e,t,i){for(var n="",r=t;r<i;r++)n+="%"+("00"+e[r].toString(16)).slice(-2);return n}function je(e,t,i){return decodeURIComponent(Fe(e,t,i))}function He(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]}e=function e(t){var i,n;e.prototype.init.call(this),this.type_=t||"shared",this.push=function(e){"shared"!==this.type_&&e.type!==this.type_||(void 0===n&&(n=e.dts),e.dts=Ne(e.dts,n),e.pts=Ne(e.pts,n),i=e.dts,this.trigger("data",e))},this.flush=function(){n=i,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){i=n=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}},e.prototype=new j;var qe=e,Ve=(Ce=Ne,{TXXX:function(e){var t;if(3===e.data[0]){for(t=1;t<e.data.length;t++)if(0===e.data[t]){e.description=je(e.data,1,t),e.value=je(e.data,t+1,e.data.length).replace(/\0*$/,"");break}e.data=e.value}},WXXX:function(e){var t;if(3===e.data[0])for(t=1;t<e.data.length;t++)if(0===e.data[t]){e.description=je(e.data,1,t),e.url=je(e.data,t+1,e.data.length);break}},PRIV:function(e){for(var t,i=0;i<e.data.length;i++)if(0===e.data[i]){e.owner=(t=e.data,unescape(Fe(t,0,i)));break}e.privateData=e.data.subarray(i+1),e.data=e.privateData}}),We=function(e){var t,i={descriptor:e&&e.descriptor},u=0,n=[],r=0;if(We.prototype.init.call(this),this.dispatchType=Be.METADATA_STREAM_TYPE.toString(16),i.descriptor)for(t=0;t<i.descriptor.length;t++)this.dispatchType+=("00"+i.descriptor[t].toString(16)).slice(-2);this.push=function(e){var t,i,o,l,a,s,c;if("timed-metadata"===e.type)if(e.dataAlignmentIndicator&&(r=0,n.length=0),0===n.length&&(e.data.length<10||e.data[0]!=="I".charCodeAt(0)||e.data[1]!=="D".charCodeAt(0)||e.data[2]!=="3".charCodeAt(0)))this.trigger("log",{level:"warn",message:"Skipping unrecognized metadata packet"});else if(n.push(e),r+=e.data.byteLength,1===n.length&&(u=He(e.data.subarray(6,10)),u+=10),!(r<u)){for(t={data:new Uint8Array(u),frames:[],pts:n[0].pts,dts:n[0].dts},l=0;l<u;)t.data.set(n[0].data.subarray(0,u-l),l),l+=n[0].data.byteLength,r-=n[0].data.byteLength,n.shift();i=10,64&t.data[5]&&(i+=4,i+=He(t.data.subarray(10,14)),u-=He(t.data.subarray(16,20)));do{if((o=He(t.data.subarray(i+4,i+8)))<1)return void this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping metadata parsing."})}while((c={id:String.fromCharCode(t.data[i],t.data[i+1],t.data[i+2],t.data[i+3]),data:t.data.subarray(i+10,i+o+10)}).key=c.id,Ve[c.id]&&(Ve[c.id](c),"com.apple.streaming.transportStreamTimestamp"===c.owner&&(s=(1&(a=c.data)[3])<<30|a[4]<<22|a[5]<<14|a[6]<<6|a[7]>>>2,s*=4,s+=3&a[7],c.timeStamp=s,void 0===t.pts&&void 0===t.dts&&(t.pts=c.timeStamp,t.dts=c.timeStamp),this.trigger("timestamp",c))),t.frames.push(c),i+=10,(i+=o)<u);this.trigger("data",t)}}};We.prototype=new j,e=We;var ze,Ge,Xe=function(){var e=new Uint8Array(188),a=0;Xe.prototype.init.call(this),this.push=function(t){var n,i=0,r=188;for(a?((n=new Uint8Array(t.byteLength+a)).set(e.subarray(0,a)),n.set(t,a),a=0):n=t;r<n.byteLength;)71!==n[i]||71!==n[r]?(i++,r++):(this.trigger("data",n.subarray(i,r)),i+=188,r+=188);i<n.byteLength&&(e.set(n.subarray(i),0),a=n.byteLength-i)},this.flush=function(){188===a&&71===e[0]&&(this.trigger("data",e),a=0),this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.reset=function(){a=0,this.trigger("reset")}};Xe.prototype=new j,(ze=function(){var e,t,a,s;ze.prototype.init.call(this),(s=this).packetsWaitingForPmt=[],this.programMapTable=void 0,e=function(e,n){var i=0;n.payloadUnitStartIndicator&&(i+=e[i]+1),("pat"===n.type?t:a)(e.subarray(i),n)},t=function(e,t){t.section_number=e[7],t.last_section_number=e[8],s.pmtPid=(31&e[10])<<8|e[11],t.pmtPid=s.pmtPid},a=function(e,t){var i,n;if(1&e[5]){for(s.programMapTable={video:null,audio:null,"timed-metadata":{}},i=3+((15&e[1])<<8|e[2])-4,n=12+((15&e[10])<<8|e[11]);n<i;){var r=e[n],a=(31&e[n+1])<<8|e[n+2];r===Be.H264_STREAM_TYPE&&null===s.programMapTable.video?s.programMapTable.video=a:r===Be.ADTS_STREAM_TYPE&&null===s.programMapTable.audio?s.programMapTable.audio=a:r===Be.METADATA_STREAM_TYPE&&(s.programMapTable["timed-metadata"][a]=r),n+=5+((15&e[n+3])<<8|e[n+4])}t.programMapTable=s.programMapTable}},this.push=function(t){var n={},i=4;if(n.payloadUnitStartIndicator=!!(64&t[1]),n.pid=31&t[1],n.pid<<=8,n.pid|=t[2],1<(48&t[3])>>>4&&(i+=t[i]+1),0===n.pid)n.type="pat",e(t.subarray(i),n),this.trigger("data",n);else if(n.pid===this.pmtPid)for(n.type="pmt",e(t.subarray(i),n),this.trigger("data",n);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());
vendor: 9,513 bytes, line 2
2else void 0===this.programMapTable?this.packetsWaitingForPmt.push([t,i,n]):this.processPes_(t,i,n)},this.processPes_=function(e,t,i){i.pid===this.programMapTable.video?i.streamType=Be.H264_STREAM_TYPE:i.pid===this.programMapTable.audio?i.streamType=Be.ADTS_STREAM_TYPE:i.streamType=this.programMapTable["timed-metadata"][i.pid],i.type="pes",i.data=e.subarray(t),this.trigger("data",i)}}).prototype=new j,ze.STREAM_TYPES={h264:27,adts:15},(Ge=function(){function e(e,t,i){var r,o,a,s,l=new Uint8Array(e.size),u={type:t},c=0,d=0;if(e.data.length&&!(e.size<9)){for(u.trackId=e.data[0].pid,c=0;c<e.data.length;c++)r=e.data[c],l.set(r.data,d),d+=r.data.byteLength;a=u,s=(o=l)[0]<<16|o[1]<<8|o[2],a.data=new Uint8Array,1==s&&(a.packetLength=6+(o[4]<<8|o[5]),a.dataAlignmentIndicator=!!(4&o[6]),192&(s=o[7])&&(a.pts=(14&o[9])<<27|(255&o[10])<<20|(254&o[11])<<12|(255&o[12])<<5|(254&o[13])>>>3,a.pts*=4,a.pts+=(6&o[13])>>>1,a.dts=a.pts,64&s&&(a.dts=(14&o[14])<<27|(255&o[15])<<20|(254&o[16])<<12|(255&o[17])<<5|(254&o[18])>>>3,a.dts*=4,a.dts+=(6&o[18])>>>1)),a.data=o.subarray(9+o[8])),t="video"===t||u.packetLength<=e.size,(i||t)&&(e.size=0,e.data.length=0),t&&n.trigger("data",u)}}var t,n=this,r=!1,a={data:[],size:0},s={data:[],size:0},o={data:[],size:0};Ge.prototype.init.call(this),this.push=function(i){({pat:function(){},pes:function(){var t,n;switch(i.streamType){case Be.H264_STREAM_TYPE:t=a,n="video";break;case Be.ADTS_STREAM_TYPE:t=s,n="audio";break;case Be.METADATA_STREAM_TYPE:t=o,n="timed-metadata";break;default:return}i.payloadUnitStartIndicator&&e(t,n,!0),t.data.push(i),t.size+=i.data.byteLength},pmt:function(){var e={type:"metadata",tracks:[]};null!==(t=i.programMapTable).video&&e.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+t.video,codec:"avc",type:"video"}),null!==t.audio&&e.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+t.audio,codec:"adts",type:"audio"}),r=!0,n.trigger("data",e)}})[i.type]()},this.reset=function(){a.size=0,a.data.length=0,s.size=0,s.data.length=0,this.trigger("reset")},this.flushStreams_=function(){e(a,"video"),e(s,"audio"),e(o,"timed-metadata")},this.flush=function(){var e;!r&&t&&(e={type:"metadata",tracks:[]},null!==t.video&&e.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+t.video,codec:"avc",type:"video"}),null!==t.audio&&e.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+t.audio,codec:"adts",type:"audio"}),n.trigger("data",e)),r=!1,this.flushStreams_(),this.trigger("done")}}).prototype=new j;var Ke,Ye={PAT_PID:0,MP2T_PACKET_LENGTH:188,TransportPacketStream:Xe,TransportParseStream:ze,ElementaryStream:Ge,TimestampRolloverStream:qe,CaptionStream:Ue.CaptionStream,Cea608Stream:Ue.Cea608Stream,Cea708Stream:Ue.Cea708Stream,MetadataStream:e};for(Ke in Be)Be.hasOwnProperty(Ke)&&(Ye[Ke]=Be[Ke]);var Qe=Ye,$e=se,Je=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],Ze=function(u){var e,t=0;Ze.prototype.init.call(this),this.skipWarn_=function(e,n){this.trigger("log",{level:"warn",message:"adts skiping bytes "+e+" to "+n+" in frame "+t+" outside syncword"})},this.push=function(n){var r,i,o,l,a,s,c=0;if(u||(t=0),"audio"===n.type){for(e&&e.length?(o=e,(e=new Uint8Array(o.byteLength+n.data.byteLength)).set(o),e.set(n.data,o.byteLength)):e=n.data;c+7<e.length;)if(255===e[c]&&240==(246&e[c+1])){if("number"==typeof s&&(this.skipWarn_(s,c),s=null),i=2*(1&~e[c+1]),r=(3&e[c+3])<<11|e[c+4]<<3|(224&e[c+5])>>5,a=(l=1024*(1+(3&e[c+6])))*$e/Je[(60&e[c+2])>>>2],e.byteLength-c<r)break;this.trigger("data",{pts:n.pts+t*a,dts:n.dts+t*a,sampleCount:l,audioobjecttype:1+(e[c+2]>>>6&3),channelcount:(1&e[c+2])<<2|(192&e[c+3])>>>6,samplerate:Je[(60&e[c+2])>>>2],samplingfrequencyindex:(60&e[c+2])>>>2,samplesize:16,data:e.subarray(c+7+i,c+r)}),t++,c+=r}else"number"!=typeof s&&(s=c),c++;"number"==typeof s&&(this.skipWarn_(s,c),s=null),e=e.subarray(c)}},this.flush=function(){t=0,this.trigger("done")},this.reset=function(){e=void 0,this.trigger("reset")},this.endTimeline=function(){e=void 0,this.trigger("endedtimeline")}};Ze.prototype=new j;var et,tt,it=Ze,nt=function(e){var t=e.byteLength,a=0,s=0;this.length=function(){return 8*t},this.bitsAvailable=function(){return 8*t+s},this.loadWord=function(){var n=e.byteLength-t,r=new Uint8Array(4),i=Math.min(4,t);if(0===i)throw new Error("no bytes available");r.set(e.subarray(n,n+i)),a=new DataView(r.buffer).getUint32(0),s=8*i,t-=i},this.skipBits=function(e){var n;e<s||(e-=s,e-=8*(n=Math.floor(e/8)),t-=n,this.loadWord()),a<<=e,s-=e},this.readBits=function(e){var n=Math.min(s,e),i=a>>>32-n;return 0<(s-=n)?a<<=n:0<t&&this.loadWord(),0<(n=e-n)?i<<n|this.readBits(n):i},this.skipLeadingZeros=function(){for(var e=0;e<s;++e)if(a&2147483648>>>e)return a<<=e,s-=e,e;return this.loadWord(),e+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var e=this.skipLeadingZeros();return this.readBits(e+1)-1},this.readExpGolomb=function(){var e=this.readUnsignedExpGolomb();return 1&e?1+e>>>1:-1*(e>>>1)},this.readBoolean=function(){return 1===this.readBits(1)},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()},rt=function(){var e,t,a=0;rt.prototype.init.call(this),this.push=function(n){for(var r,i=(t=t?((r=new Uint8Array(t.byteLength+n.data.byteLength)).set(t),r.set(n.data,t.byteLength),r):n.data).byteLength;a<i-3;a++)if(1===t[a+2]){e=a+5;break}for(;e<i;)switch(t[e]){case 0:if(0!==t[e-1]){e+=2;break}if(0!==t[e-2]){e++;break}for(a+3!==e-2&&this.trigger("data",t.subarray(a+3,e-2));1!==t[++e]&&e<i;);a=e-2,e+=3;break;case 1:if(0!==t[e-1]||0!==t[e-2]){e+=3;break}this.trigger("data",t.subarray(a+3,e-2)),a=e-2,e+=3;break;default:e+=3}t=t.subarray(a),e-=a,a=0},this.reset=function(){t=null,a=0,this.trigger("reset")},this.flush=function(){t&&3<t.byteLength&&this.trigger("data",t.subarray(a+3)),t=null,a=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}};function at(e,t){var i=0<=(i=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9])?i:0;return(16&e[t+5])>>4?i+20:i+10}function st(e,t){return e.length-t<10||e[t]!=="I".charCodeAt(0)||e[t+1]!=="D".charCodeAt(0)||e[t+2]!=="3".charCodeAt(0)?t:st(e,t+=at(e,t))}function ot(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]}rt.prototype=new j,tt={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},(et=function(){var i,e,t,a,s,n,r,o=new rt;et.prototype.init.call(this),(i=this).push=function(n){"video"===n.type&&(e=n.trackId,t=n.pts,a=n.dts,o.push(n))},o.on("data",(function(r){var o={trackId:e,pts:t,dts:a,data:r,nalUnitTypeCode:31&r[0]};switch(o.nalUnitTypeCode){case 5:o.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:o.nalUnitType="sei_rbsp",o.escapedRBSP=s(r.subarray(1));break;case 7:o.nalUnitType="seq_parameter_set_rbsp",o.escapedRBSP=s(r.subarray(1)),o.config=n(o.escapedRBSP);break;case 8:o.nalUnitType="pic_parameter_set_rbsp";break;case 9:o.nalUnitType="access_unit_delimiter_rbsp"}i.trigger("data",o)})),o.on("done",(function(){i.trigger("done")})),o.on("partialdone",(function(){i.trigger("partialdone")})),o.on("reset",(function(){i.trigger("reset")})),o.on("endedtimeline",(function(){i.trigger("endedtimeline")})),this.flush=function(){o.flush()},this.partialFlush=function(){o.partialFlush()},this.reset=function(){o.reset()},this.endTimeline=function(){o.endTimeline()},r=function(e,t){for(var i=8,n=8,r=0;r<e;r++)i=0===(n=0!==n?(i+t.readExpGolomb()+256)%256:n)?i:n},s=function(e){for(var t=e.byteLength,i=[],n=1;n<t-2;)0===e[n]&&0===e[n+1]&&3===e[n+2]?(i.push(n+2),n+=2):n++;if(0===i.length)return e;var r=t-i.length,a=new Uint8Array(r),s=0;for(n=0;n<r;s++,n++)s===i[0]&&(s++,i.shift()),a[n]=e[s];return a},n=function(e){var t,i,n,o,a,s=0,l=0,u=0,c=0,d=[1,1],h=new nt(e),f=h.readUnsignedByte(),p=h.readUnsignedByte(),m=h.readUnsignedByte();if(h.skipUnsignedExpGolomb(),tt[f]&&(3===(i=h.readUnsignedExpGolomb())&&h.skipBits(1),h.skipUnsignedExpGolomb(),h.skipUnsignedExpGolomb(),h.skipBits(1),h.readBoolean()))for(o=3!==i?8:12,a=0;a<o;a++)h.readBoolean()&&r(a<6?16:64,h);if(h.skipUnsignedExpGolomb(),0===(n=h.readUnsignedExpGolomb()))h.readUnsignedExpGolomb();else if(1===n)for(h.skipBits(1),h.skipExpGolomb(),h.skipExpGolomb(),t=h.readUnsignedExpGolomb(),a=0;a<t;a++)h.skipExpGolomb();if(h.skipUnsignedExpGolomb(),h.skipBits(1),e=h.readUnsignedExpGolomb(),i=h.readUnsignedExpGolomb(),0===(n=h.readBits(1))&&h.skipBits(1),h.skipBits(1),h.readBoolean()&&(s=h.readUnsignedExpGolomb(),l=h.readUnsignedExpGolomb(),u=h.readUnsignedExpGolomb(),c=h.readUnsignedExpGolomb()),h.readBoolean()&&h.readBoolean()){switch(h.readUnsignedByte()){case 1:d=[1,1];break;case 2:d=[12,11];break;case 3:d=[10,11];break;case 4:d=[16,11];break;case 5:d=[40,33];break;case 6:d=[24,11];break;case 7:d=[20,11];break;case 8:d=[32,11];break;case 9:d=[80,33];break;case 10:d=[18,11];break;case 11:d=[15,11];break;case 12:d=[64,33];break;case 13:d=[160,99];break;case 14:d=[4,3];break;case 15:d=[3,2];break;case 16:d=[2,1];break;case 255:d=[h.readUnsignedByte()<<8|h.readUnsignedByte(),h.readUnsignedByte()<<8|h.readUnsignedByte()]}d&&(d[0],d[1])}return{profileIdc:f,levelIdc:m,profileCompatibility:p,width:16*(e+1)-2*s-2*l,height:(2-n)*(i+1)*16-2*u-2*c,sarRatio:d}}}).prototype=new j,qe={H264Stream:et,NalByteStream:rt};var ut=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],lt={isLikelyAacData:function(e){var t=st(e,0);return e.length>
2=t+2&&!(255&~e[t])&&!(240&~e[t+1])&&16==(22&e[t+1])},parseId3TagSize:at,parseAdtsSize:function(e,t){var i=(224&e[t+5])>>5,n=e[t+4]<<3;return 6144&e[t+3]|n|i},parseType:function(e,t){return e[t]==="I".charCodeAt(0)&&e[t+1]==="D".charCodeAt(0)&&e[t+2]==="3".charCodeAt(0)?"timed-metadata":!0&e[t]&&!(240&~e[t+1])?"audio":null},parseSampleRate:function(e){for(var t=0;t+5<e.length;){if(255===e[t]&&240==(246&e[t+1]))return ut[(60&e[t+2])>>>2];t++}return null},parseAacTimestamp:function(e){var t,i=10;64&e[5]&&(i+=4,i+=ot(e.subarray(10,14)));do{if((t=ot(e.subarray(i+4,i+8)))<1)return null;if("PRIV"===String.fromCharCode(e[i],e[i+1],e[i+2],e[i+3]))for(var n=e.subarray(i+10,i+t+10),r=0;r<n.byteLength;r++)if(0===n[r]){if("com.apple.streaming.transportStreamTimestamp"!==unescape(function(e,t,i){for(var n="",r=0;r<i;r++)n+="%"+("00"+e[r].toString(16)).slice(-2);return n}(n,0,r)))break;var a=n.subarray(r+1),s=(1&a[3])<<30|a[4]<<22|a[5]<<14|a[6]<<6|a[7]>>>2;return(s*=4)+(3&a[7])}}while(i+=10,(i+=t)<e.byteLength);return null}},ct=function(){var a=new Uint8Array,s=0;ct.prototype.init.call(this),this.setTimestamp=function(e){s=e},this.push=function(e){var t,i,n=0,r=0;for(a.length?(i=a.length,(a=new Uint8Array(e.byteLength+i)).set(a.subarray(0,i)),a.set(e,i)):a=e;3<=a.length-r;)if(a[r]!=="I".charCodeAt(0)||a[r+1]!=="D".charCodeAt(0)||a[r+2]!=="3".charCodeAt(0))if(255&~a[r]||240&~a[r+1])r++;else{if(a.length-r<7)break;if(r+(n=lt.parseAdtsSize(a,r))>a.length)break;t={type:"audio",data:a.subarray(r,r+n),pts:s,dts:s},this.trigger("data",t),r+=n}else{if(a.length-r<10)break;if(r+(n=lt.parseId3TagSize(a,r))>a.length)break;t={type:"timed-metadata",data:a.subarray(r,r+n)},this.trigger("data",t),r+=n}e=a.length-r,a=0<e?a.subarray(r):new Uint8Array},this.reset=function(){a=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){a=new Uint8Array,this.trigger("endedtimeline")}};function dt(e,t){var i;if(e.length===t.length){for(i=0;i<e.length;i++)if(e[i]!==t[i])return;return 1}}function ht(e,t,i,n,r,a){return{start:{dts:e,pts:e+(i-t)},end:{dts:e+(n-t),pts:e+(r-i)},prependedContentDuration:a,baseMediaDecodeTime:e}}ct.prototype=new j;var pt,ft,mt,gt=ct,yt=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],vt=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],_t=qe.H264Stream,bt=lt.isLikelyAacData,Tt=se,St=function(a,s){var e=[],u=0,t=0,n=1/0,r=(s=s||{}).firstSequenceNumber||0;
2St.prototype.init.call(this),this.push=function(t){_e(a,t),a&&yt.forEach((function(e){a[e]=t[e]})),e.push(t)},this.setEarliestDts=function(e){u=e},this.setVideoBaseMediaDecodeTime=function(e){n=e},this.setAudioAppendStart=function(e){t=e},this.flush=function(){var o,l,i,c,d;0!==e.length&&(o=pe(e,a,u),a.baseMediaDecodeTime=ve(a,s.keepOriginalTimestamps),d=he(a,o,t,n),a.samples=fe(o),l=G(me(o)),e=[],c=X(r,[a]),i=new Uint8Array(c.byteLength+l.byteLength),r++,i.set(c),i.set(l,c.byteLength),ye(a),c=Math.ceil(1024*Tt/a.samplerate),o.length&&(c=o.length*c,this.trigger("segmentTimingInfo",ht(le(a.baseMediaDecodeTime,a.samplerate),o[0].dts,o[0].pts,o[0].dts+c,o[0].pts+c,d||0)),this.trigger("timingInfo",{start:o[0].pts,end:o[0].pts+c})),this.trigger("data",{track:a,boxes:i})),this.trigger("done","AudioSegmentStream")},this.reset=function(){ye(a),e=[],this.trigger("reset")}};function Et(e,t){var i=Lt(e,["moof","traf"]),n=(e=Lt(e,["mdat"]),{}),r=[];return e.forEach((function(e,t){t=i[t],r.push({mdat:e,traf:t})})),r.forEach((function(e){var r,i,o,l,a,s=e.mdat,c=e.traf,u=Lt(c,["tfhd"]),d=Nt(u[0]);e=d.trackId,u=0<(u=Lt(c,["tfdt"])).length?Ot(u[0]).baseMediaDecodeTime:0,c=Lt(c,["trun"]),t===e&&0<c.length&&(r=u,i=d.defaultSampleDuration||0,o=d.defaultSampleSize||0,l=d.trackId,a=[],c.forEach((function(e){(e=Mt(e).samples).forEach((function(e){void 0===e.duration&&(e.duration=i),void 0===e.size&&(e.size=o),e.trackId=l,e.dts=r,void 0===e.compositionTimeOffset&&(e.compositionTimeOffset=0),e.pts=r+e.compositionTimeOffset,r+=e.duration})),a=a.concat(e)})),s=function(e,t,i){for(var n,r,a=new DataView(e.buffer,e.byteOffset,e.byteLength),s={logs:[],seiNals:[]},o=0;o+4<e.length;o+=n)if(n=a.getUint32(o),o+=4,!(n<=0))switch(31&e[o]){case 6:var u=e.subarray(o+1,o+1+n),l=function(e,t){for(var i=e,n=0;n<t.length;n++){var r=t[n];if(i<r.size)return r;i-=r.size}return null}(o,t);if(u={nalUnitType:"sei_rbsp",size:n,data:u,escapedRBSP:Ut(u),trackId:i},l)u.pts=l.pts,u.dts=l.dts,r=l;else{if(!r){s.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+o+" for trackId "+i+". See mux.js#223."});break}u.pts=r.pts,u.dts=r.dts}s.seiNals.push(u)}return s}(s,a,e),n[e]||(n[e]={seiNals:[],logs:[]}),n[e].seiNals=n[e].seiNals.concat(s.seiNals),n[e].logs=n[e].logs.concat(s.logs))})),n}function kt(e){var t=31&e[1];return(t<<=8)|e[2]}function Ct(e){return!!(64&e[1])}function wt(e){var t=0;return 1<(48&e[3])>>>4&&(t+=e[4]+1),t}function It(e){switch(e){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}}St.prototype=new j,(pt=function(s,a){var e,i,t=[],n=[],u=(a=a||{}).firstSequenceNumber||0;pt.prototype.init.call(this),delete s.minPTS,this.gopCache_=[],this.push=function(n){_e(s,n),"seq_parameter_set_rbsp"!==n.nalUnitType||e||(e=n.config,s.sps=[n.data],vt.forEach((function(t){s[t]=e[t]}),this)),"pic_parameter_set_rbsp"!==n.nalUnitType||i||(i=n.data,s.pps=[n.data]),t.push(n)},this.flush=function(){for(var e,r,i,o=0;t.length&&"access_unit_delimiter_rbsp"!==t[0].nalUnitType;)t.shift();if(0===t.length)return this.resetStream_(),void this.trigger("done","VideoSegmentStream");if(e=Y(t),(r=Q(e))[0][0].keyFrame||((i=this.getGopForFusion_(t[0],s))?(o=i.duration,r.unshift(i),r.byteLength+=i.byteLength,r.nalCount+=i.nalCount,r.pts=i.pts,r.dts=i.dts,r.duration+=i.duration):r=$(r)),n.length){var l=a.alignGopsAtEnd?this.alignGopsAtEnd_(r):this.alignGopsAtStart_(r);if(!l)return this.gopCache_.unshift({gop:r.pop(),pps:s.pps,sps:s.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),t=[],this.resetStream_(),void this.trigger("done","VideoSegmentStream");ye(s),r=l}_e(s,r),s.samples=J(r),e=G(Z(r)),s.baseMediaDecodeTime=ve(s,a.keepOriginalTimestamps),this.trigger("processedGopsInfo",r.map((function(e){return{pts:e.pts,dts:e.dts,byteLength:e.byteLength}}))),i=r[0],l=r[r.length-1],this.trigger("segmentTimingInfo",ht(s.baseMediaDecodeTime,i.dts,i.pts,l.dts+l.duration,l.pts+l.duration,o)),this.trigger("timingInfo",{start:r[0].pts,end:r[r.length-1].pts+r[r.length-1].duration}),this.gopCache_.unshift({gop:r.pop(),pps:s.pps,sps:s.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),t=[],this.trigger("baseMediaDecodeTime",s.baseMediaDecodeTime),this.trigger("timelineStartInfo",s.timelineStartInfo),o=X(u,[s]),r
vendor: 4,545 bytes, line 2
2=new Uint8Array(o.byteLength+e.byteLength),u++,r.set(o),r.set(e,o.byteLength),this.trigger("data",{track:s,boxes:r}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.reset=function(){this.resetStream_(),t=[],this.gopCache_.length=0,n.length=0,this.trigger("reset")},this.resetStream_=function(){ye(s),i=e=void 0},this.getGopForFusion_=function(e){for(var t,i,n,r=1/0,a=0;a<this.gopCache_.length;a++)i=(n=this.gopCache_[a]).gop,s.pps&&dt(s.pps[0],n.pps[0])&&s.sps&&dt(s.sps[0],n.sps[0])&&(i.dts<s.timelineStartInfo.dts||-1e4<=(i=e.dts-i.dts-i.duration)&&i<=45e3&&(!t||i<r)&&(t=n,r=i));return t?t.gop:null},this.alignGopsAtStart_=function(e){for(var t,i,r,o,a=e.byteLength,s=e.nalCount,l=e.duration,u=t=0;u<n.length&&t<e.length&&(i=n[u],r=e[t],i.pts!==r.pts);)r.pts>i.pts?u++:(t++,a-=r.byteLength,s-=r.nalCount,l-=r.duration);return 0===t?e:t===e.length?null:((o=e.slice(t)).byteLength=a,o.duration=l,o.nalCount=s,o.pts=o[0].pts,o.dts=o[0].dts,o)},this.alignGopsAtEnd_=function(e){for(var t,i,r=n.length-1,o=e.length-1,a=null,s=!1;0<=r&&0<=o;){if(t=n[r],i=e[o],t.pts===i.pts){s=!0;break}t.pts>i.pts?r--:(r===n.length-1&&(a=o),o--)}if(!s&&null===a)return null;if(0===(u=s?o:a))return e;var l=e.slice(u),u=l.reduce((function(e,t){return e.byteLength+=t.byteLength,e.duration+=t.duration,e.nalCount+=t.nalCount,e}),{byteLength:0,duration:0,nalCount:0});return l.byteLength=u.byteLength,l.duration=u.duration,l.nalCount=u.nalCount,l.pts=l[0].pts,l.dts=l[0].dts,l},this.alignGopsWith=function(e){n=e}}).prototype=new j,(mt=function(e,t){this.numberOfTracks=0,this.metadataStream=t,void 0!==(e=e||{}).remux?this.remuxTracks=!!e.remux:this.remuxTracks=!0,"boolean"==typeof e.keepOriginalTimestamps?this.keepOriginalTimestamps=e.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,mt.prototype.init.call(this),this.push=function(e){return e.text?this.pendingCaptions.push(e):e.frames?this.pendingMetadata.push(e):(this.pendingTracks.push(e.track),this.pendingBytes+=e.boxes.byteLength,"video"===e.track.type&&(this.videoTrack=e.track,this.pendingBoxes.push(e.boxes)),void("audio"===e.track.type&&(this.audioTrack=e.track,this.pendingBoxes.unshift(e.boxes))))}}).prototype=new j,mt.prototype.flush=function(e){var t,i,n,r=0,a={captions:[],captionStreams:{},metadata:[],info:{}},s=0;if(this.pendingTracks.length<this.numberOfTracks){if("VideoSegmentStream"!==e&&"AudioSegmentStream"!==e)return;if(this.remuxTracks)return;if(0===this.pendingTracks.length)return this.emittedTracks++,void(this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0))}if(this.videoTrack?(s=this.videoTrack.timelineStartInfo.pts,vt.forEach((function(e){a.info[e]=this.videoTrack[e]}),this)):this.audioTrack&&(s=this.audioTrack.timelineStartInfo.pts,yt.forEach((function(e){a.info[e]=this.audioTrack[e]}),this)),this.videoTrack||this.audioTrack){for(1===this.pendingTracks.length?a.type=this.pendingTracks[0].type:a.type="combined",this.emittedTracks+=this.pendingTracks.length,e=K(this.pendingTracks),a.initSegment=new Uint8Array(e.byteLength),a.initSegment.set(e),a.data=new Uint8Array(this.pendingBytes),n=0;n<this.pendingBoxes.length;n++)a.data.set(this.pendingBoxes[n],r),r+=this.pendingBoxes[n].byteLength;for(n=0;n<this.pendingCaptions.length;n++)(t=this.pendingCaptions[n]).startTime=de(t.startPts,s,this.keepOriginalTimestamps),t.endTime=de(t.endPts,s,this.keepOriginalTimestamps),a.captionStreams[t.stream]=!0,a.captions.push(t);for(n=0;n<this.pendingMetadata.length;n++)(i=this.pendingMetadata[n]).cueTime=de(i.pts,s,this.keepOriginalTimestamps),a.metadata.push(i);for(a.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",a),n=0;n<a.captions.length;n++)t=a.captions[n],this.trigger("caption",t);for(n=0;n<a.metadata.length;n++)i=a.metadata[n],this.trigger("id3Frame",i)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},mt.prototype.setRemux=function(e){this.remuxTracks=e},(ft=function(e){var t,a,s=this,n=!0;ft.prototype.init.call(this),this.baseMediaDecodeTime=(e=e||{}).baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var n={};(this.transmuxPipeline_=n).type="aac",n.metadataStream=new Qe.MetadataStream,n.aacStream
vendor: 8,215 bytes, line 2
2=new gt,n.audioTimestampRolloverStream=new Qe.TimestampRolloverStream("audio"),n.timedMetadataTimestampRolloverStream=new Qe.TimestampRolloverStream("timed-metadata"),n.adtsStream=new it,n.coalesceStream=new mt(e,n.metadataStream),n.headOfPipeline=n.aacStream,n.aacStream.pipe(n.audioTimestampRolloverStream).pipe(n.adtsStream),n.aacStream.pipe(n.timedMetadataTimestampRolloverStream).pipe(n.metadataStream).pipe(n.coalesceStream),n.metadataStream.on("timestamp",(function(e){n.aacStream.setTimestamp(e.timeStamp)})),n.aacStream.on("data",(function(r){"timed-metadata"!==r.type&&"audio"!==r.type||n.audioSegmentStream||(a=a||{timelineStartInfo:{baseMediaDecodeTime:s.baseMediaDecodeTime},codec:"adts",type:"audio"},n.coalesceStream.numberOfTracks++,n.audioSegmentStream=new St(a,e),n.audioSegmentStream.on("log",s.getLogTrigger_("audioSegmentStream")),n.audioSegmentStream.on("timingInfo",s.trigger.bind(s,"audioTimingInfo")),n.adtsStream.pipe(n.audioSegmentStream).pipe(n.coalesceStream),s.trigger("trackinfo",{hasAudio:!!a,hasVideo:!!t}))})),n.coalesceStream.on("data",this.trigger.bind(this,"data")),n.coalesceStream.on("done",this.trigger.bind(this,"done"))},this.setupTsPipeline=function(){var i={};(this.transmuxPipeline_=i).type="ts",i.metadataStream=new Qe.MetadataStream,i.packetStream=new Qe.TransportPacketStream,i.parseStream=new Qe.TransportParseStream,i.elementaryStream=new Qe.ElementaryStream,i.timestampRolloverStream=new Qe.TimestampRolloverStream,i.adtsStream=new it,i.h264Stream=new _t,i.captionStream=new Qe.CaptionStream(e),i.coalesceStream=new mt(e,i.metadataStream),i.headOfPipeline=i.packetStream,i.packetStream.pipe(i.parseStream).pipe(i.elementaryStream).pipe(i.timestampRolloverStream),i.timestampRolloverStream.pipe(i.h264Stream),i.timestampRolloverStream.pipe(i.adtsStream),i.timestampRolloverStream.pipe(i.metadataStream).pipe(i.coalesceStream),i.h264Stream.pipe(i.captionStream).pipe(i.coalesceStream),i.elementaryStream.on("data",(function(n){var r;if("metadata"===n.type){for(r=n.tracks.length;r--;)t||"video"!==n.tracks[r].type?a||"audio"!==n.tracks[r].type||((a=n.tracks[r]).timelineStartInfo.baseMediaDecodeTime=s.baseMediaDecodeTime):(t=n.tracks[r]).timelineStartInfo.baseMediaDecodeTime=s.baseMediaDecodeTime;t&&!i.videoSegmentStream&&(i.coalesceStream.numberOfTracks++,i.videoSegmentStream=new pt(t,e),i.videoSegmentStream.on("log",s.getLogTrigger_("videoSegmentStream")),i.videoSegmentStream.on("timelineStartInfo",(function(t){a&&!e.keepOriginalTimestamps&&(a.timelineStartInfo=t,i.audioSegmentStream.setEarliestDts(t.dts-s.baseMediaDecodeTime))})),i.videoSegmentStream.on("processedGopsInfo",s.trigger.bind(s,"gopInfo")),i.videoSegmentStream.on("segmentTimingInfo",s.trigger.bind(s,"videoSegmentTimingInfo")),i.videoSegmentStream.on("baseMediaDecodeTime",(function(e){a&&i.audioSegmentStream.setVideoBaseMediaDecodeTime(e)})),i.videoSegmentStream.on("timingInfo",s.trigger.bind(s,"videoTimingInfo")),i.h264Stream.pipe(i.videoSegmentStream).pipe(i.coalesceStream)),a&&!i.audioSegmentStream&&(i.coalesceStream.numberOfTracks++,i.audioSegmentStream=new St(a,e),i.audioSegmentStream.on("log",s.getLogTrigger_("audioSegmentStream")),i.audioSegmentStream.on("timingInfo",s.trigger.bind(s,"audioTimingInfo")),i.audioSegmentStream.on("segmentTimingInfo",s.trigger.bind(s,"audioSegmentTimingInfo")),i.adtsStream.pipe(i.audioSegmentStream).pipe(i.coalesceStream)),s.trigger("trackinfo",{hasAudio:!!a,hasVideo:!!t})}})),i.coalesceStream.on("data",this.trigger.bind(this,"data")),i.coalesceStream.on("id3Frame",(function(e){e.dispatchType=i.metadataStream.dispatchType,s.trigger("id3Frame",e)})),i.coalesceStream.on("caption",this.trigger.bind(this,"caption")),i.coalesceStream.on("done",this.trigger.bind(this,"done"))},this.setBaseMediaDecodeTime=function(n){var r=this.transmuxPipeline_;e.keepOriginalTimestamps||(this.baseMediaDecodeTime=n),a&&(a.timelineStartInfo.dts=void 0,a.timelineStartInfo.pts=void 0,ye(a),r.audioTimestampRolloverStream&&r.audioTimestampRolloverStream.discontinuity()),t&&(r.videoSegmentStream&&(r.videoSegmentStream.gopCache_=[]),t.timelineStartInfo.dts=void 0,t.timelineStartInfo.pts=void 0,ye(t),r.captionStream.reset()),r.timestampRolloverStream&&r.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(e){a&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(e)},this.setRemux=function(t){var n=this.transmuxPipeline_;e.remux=t,n&&n.coalesceStream&&n.coalesceStream.setRemux(t)},this.alignGopsWith=function(e){t&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(e)},this.getLogTrigger_=function(e){var i=this;return function(t){t.stream=e,i.trigger("log",t)}},this.push=function(e){if(n){var t=bt(e);if(t&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():t||"ts"===this.transmuxPipeline_.type||this.setupTsPipeline(),this.transmuxPipeline_)for(var i=Object.keys(this.transmuxPipeline_),r=0;r<i.length;r++){var o=i[r];"headOfPipeline"!==o&&this.transmuxPipeline_[o].on&&this.transmuxPipeline_[o].on("log",this.getLogTrigger_(o))}n=!1}this.transmuxPipeline_.headOfPipeline.push(e)},this.flush=function(){n=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}}).prototype=new j;var At={Transmuxer:ft,VideoSegmentStream:pt,AudioSegmentStream:St,AUDIO_PROPERTIES:yt,VIDEO_PROPERTIES:vt,generateSegmentTimingInfo:ht},xt=function(e){var t="";return t+=String.fromCharCode(e[0]),t+=String.fromCharCode(e[1]),(t+=String.fromCharCode(e[2]))+String.fromCharCode(e[3])},Pt=e=function(e){return e>>>0},Lt=function e(t,i){var n,r,a,s=[];if(!i.length)return null;for(n=0;n<t.byteLength;)r=Pt(t[n]<<24|t[n+1]<<16|t[n+2]<<8|t[n+3]),a=xt(t.subarray(n+4,n+8)),r=1<r?n+r:t.byteLength,a===i[0]&&(1===i.length?s.push(t.subarray(n+8,r)):(a=e(t.subarray(n+8,r),i.slice(1))).length&&(s=s.concat(a))),n=r;return s},Dt=e,Ot=function(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4)),baseMediaDecodeTime:Dt(e[4]<<24|e[5]<<16|e[6]<<8|e[7])};return 1===t.version&&(t.baseMediaDecodeTime*=Math.pow(2,32),t.baseMediaDecodeTime+=Dt(e[8]<<24|e[9]<<16|e[10]<<8|e[11])),t},Rt=function(e){return{isLeading:(12&e[0])>>>2,dependsOn:3&e[0],isDependedOn:(192&e[1])>>>6,hasRedundancy:(48&e[1])>>>4,paddingValue:(14&e[1])>>>1,isNonSyncSample:1&e[1],degradationPriority:e[2]<<8|e[3]}},Mt=function(e){var t,i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]},n=new DataView(e.buffer,e.byteOffset,e.byteLength),r=1&i.flags[2],a=4&i.flags[2],s=1&i.flags[1],o=2&i.flags[1],u=4&i.flags[1],l=8&i.flags[1],c=n.getUint32(4),d=8;for(r&&(i.dataOffset=n.getInt32(d),d+=4),a&&c&&(t={flags:Rt(e.subarray(d,d+4))},d+=4,s&&(t.duration=n.getUint32(d),d+=4),o&&(t.size=n.getUint32(d),d+=4),l&&(1===i.version?t.compositionTimeOffset=n.getInt32(d):t.compositionTimeOffset=n.getUint32(d),d+=4),i.samples.push(t),c--);c--;)t={},s&&(t.duration=n.getUint32(d),d+=4),o&&(t.size=n.getUint32(d),d+=4),u&&(t.flags=Rt(e.subarray(d,d+4)),d+=4),l&&(1===i.version?t.compositionTimeOffset=n.getInt32(d):t.compositionTimeOffset=n.getUint32(d),d+=4),i.samples.push(t);return i},Nt=function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:t.getUint32(4)},n=1&i.flags[2],r=2&i.flags[2],a=8&i.flags[2],s=16&i.flags[2],o=32&i.flags[2],u=65536&i.flags[0],l=131072&i.flags[0];return e=8,n&&(e+=4,i.baseDataOffset=t.getUint32(12),e+=4),r&&(i.sampleDescriptionIndex=t.getUint32(e),e+=4),a&&(i.defaultSampleDuration=t.getUint32(e),e+=4),s&&(i.defaultSampleSize=t.getUint32(e),e+=4),o&&(i.defaultSampleFlags=t.getUint32(e)),u&&(i.durationIsEmpty=!0),!n&&l&&(i.baseDataOffsetIsMoof=!0),i},Ut=Ee,Bt=Ue.CaptionStream,Ft=function(){var e,t,a,s,n,i,r=!1;this.isInitialized=function(){return r},this.init=function(t){e=new Bt,r=!0,i=!!t&&t.isPartial,e.on("data",(function(e){e.startTime=e.startPts/s,e.endTime=e.endPts/s,n.captions.push(e),n.captionStream
2s[e.stream]=!0})),e.on("log",(function(e){n.logs.push(e)}))},this.isNewInit=function(e,t){return!(e&&0===e.length||t&&"object"==typeof t&&0===Object.keys(t).length||a===e[0]&&s===t[a])},this.parse=function(e,r,i){if(!this.isInitialized())return null;if(!r||!i)return null;if(this.isNewInit(r,i))a=r[0],s=i[a];else if(null===a||!s)return t.push(e),null;for(;0<t.length;){var o=t.shift();this.parse(o,r,i)}return(e=function(e,t,i){return null===t?null:{seiNals:(t=Et(e,t)[t]||{}).seiNals,logs:t.logs,timescale:i}}(e,a,s))&&e.logs&&(n.logs=n.logs.concat(e.logs)),null!==e&&e.seiNals?(this.pushNals(e.seiNals),this.flushStream(),n):n.logs.length?{logs:n.logs,captions:[],captionStreams:[]}:null},this.pushNals=function(t){if(!this.isInitialized()||!t||0===t.length)return null;t.forEach((function(t){e.push(t)}))},this.flushStream=function(){if(!this.isInitialized())return null;i?e.partialFlush():e.flush()},this.clearParsedCaptions=function(){n.captions=[],n.captionStreams={},n.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;e.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){t=[],s=a=null,n?this.clearParsedCaptions():n={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},jt=e,Ht=function(e){return("00"+e.toString(16)).slice(-2)},qt=(qe=function(e){return Lt(e,["moov","trak"]).reduce((function(e,t){var i,n,r=Lt(t,["tkhd"])[0];return r?(i=r[0],r=jt(r[n=0===i?12:20]<<24|r[1+n]<<16|r[2+n]<<8|r[3+n]),(t=Lt(t,["mdia","mdhd"])[0])?(i=t[0],e[r]=jt(t[n=0===i?12:20]<<24|t[1+n]<<16|t[2+n]<<8|t[3+n]),e):null):null}),{})},j=function(e,t){return t=Lt(t,["moof","traf"]),t=[].concat.apply([],t.map((function(i){return Lt(i,["tfhd"]).map((function(t){var n=jt(t[4]<<24|t[5]<<16|t[6]<<8|t[7]);return t=e[n]||9e4,n=Lt(i,["tfdt"]).map((function(e){var t=e[0],i=jt(e[4]<<24|e[5]<<16|e[6]<<8|e[7]);return 1===t&&(i*=Math.pow(2,32),i+=jt(e[8]<<24|e[9]<<16|e[10]<<8|e[11])),i}))[0],(n="number"!=typeof n||isNaN(n)?1/0:n)/t}))}))),t=Math.min.apply(null,t),isFinite(t)?t:0},Ee=function(e,t){var i,n,r=Lt(t,["moof","traf"]),a=0,s=0;return r&&r.length&&(i=Lt(r[0],["tfhd"])[0],t=Lt(r[0],["trun"])[0],r=Lt(r[0],["tfdt"])[0],i&&(n=Nt(i).trackId),r&&(a=Ot(r).baseMediaDecodeTime),!t||(t=Mt(t)).samples&&t.samples.length&&(s=t.samples[0].compositionTimeOffset||0)),(a+s)/(e[n]||9e4)},function(e){var t=0===e[0]?12:20;return jt(e[t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t])}),Vt=(e=function(e){e=Lt(e,["moov","trak"]);var s=[];return e.forEach((function(e){var t={},i=Lt(e,["tkhd"])[0];i&&(i=(n=new DataView(i.buffer,i.byteOffset,i.byteLength)).getUint8(0),t.id=0===i?n.getUint32(12):n.getUint32(20));var n=Lt(e,["mdia","hdlr"])[0];n&&(a=xt(n.subarray(8,12)),t.type="vide"===a?"video":"soun"===a?"audio":a);var r,a=Lt(e,["mdia","minf","stbl","stsd"])[0];a&&(a=a.subarray(8),t.codec=xt(a.subarray(4,8)),(a=Lt(a,[t.codec])[0])&&(/^[a-z]vc[1-9]$/i.test(t.codec)?(r=a.subarray(78),"avcC"===xt(r.subarray(4,8))&&11<r.length?(t.codec+=".",t.codec+=Ht(r[9]),t.codec+=Ht(r[10]),t.codec+=Ht(r[11])):t.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(t.codec)?(r=a.subarray(28),"esds"===xt(r.subarray(4,8))&&20<r.length&&0!==r[19]?(t.codec+="."+Ht(r[19]),t.codec+="."+Ht(r[20]>>>2&63).replace(/^0/,"")):t.codec="mp4a.40.2"):t.codec=t.codec.toLowerCase())),(e=Lt(e,["mdia","mdhd"])[0])&&(t.timescale=qt(e)),s.push(t)})),s},j),Wt=e,zt=Ce,Gt={};function Xt(e,t,i){for(var n,r,a,s,o=0,u=188,l=!1;u<=e.byteLength;)if(71!==e[o]||71!==e[u]&&u!==e.byteLength)o++,u++;else{if(n=e.subarray(o,u),"pes"===Gt.ts.parseType(n,t.pid)&&(r=Gt.ts.parsePesType(n,t.table),a=Gt.ts.parsePayloadUnitStartIndicator(n),"audio"===r&&a&&(s=Gt.ts.parsePesTime(n))&&(s.type="audio",i.audio.push(s),l=!0)),l)break;o+=188,u+=188}for(o=(u=e.byteLength)-188,l=!1;0<=o;)if(71!==e[o]||71!==e[u]&&u!==e.byteLength)o--,u--;else{if(n=e.subarray(o,u),"pes"===Gt.ts.parseType(n,t.pid)&&(r=Gt.ts.parsePesType(n,t.table),a=Gt.ts.parsePayloadUnitStartIndicator(n),"audio"===r&&a&&(s=Gt.ts.parsePesTime(n))&&(s.type="audio",i.audio.push(s),l=!0)),l)break;o-=188,u-=188}}function Kt(e){var t,i={pid:null,table:null},n={};for(t in function(e,t){for(var i,n=0,r=188;r<e.byteLength;)if(71!==e[n]||71!==e[r])n++,r++;else{switch(i=e.subarray(n,r),Gt.ts.parseType(i,t.pid)){case"pat":t.pid=Gt.ts.parsePat(i);break;case"pmt":var a=Gt.ts.parsePmt(i);t.table=t.table||{}
2,Object.keys(a).forEach((function(e){t.table[e]=a[e]}))}n+=188,r+=188}}(e,i),i.table)if(i.table.hasOwnProperty(t))switch(i.table[t]){case Be.H264_STREAM_TYPE:n.video=[],function(e,t,i){for(var n,r,a,s,o,u,l,c,d=0,h=188,p=!1,f={data:[],size:0};h<e.byteLength;)if(71!==e[d]||71!==e[h])d++,h++;else{if(n=e.subarray(d,h),"pes"===Gt.ts.parseType(n,t.pid)&&(r=Gt.ts.parsePesType(n,t.table),a=Gt.ts.parsePayloadUnitStartIndicator(n),"video"===r&&(a&&!p&&(s=Gt.ts.parsePesTime(n))&&(s.type="video",i.video.push(s),p=!0),!i.firstKeyFrame))){if(a&&0!==f.size){for(o=new Uint8Array(f.size),u=0;f.data.length;)l=f.data.shift(),o.set(l,u),u+=l.byteLength;!Gt.ts.videoPacketContainsKeyFrame(o)||(c=Gt.ts.parsePesTime(o))&&(i.firstKeyFrame=c,i.firstKeyFrame.type="video"),f.size=0}f.data.push(n),f.size+=n.byteLength}if(p&&i.firstKeyFrame)break;d+=188,h+=188}for(d=(h=e.byteLength)-188,p=!1;0<=d;)if(71!==e[d]||71!==e[h])d--,h--;else{if(n=e.subarray(d,h),"pes"===Gt.ts.parseType(n,t.pid)&&(r=Gt.ts.parsePesType(n,t.table),a=Gt.ts.parsePayloadUnitStartIndicator(n),"video"===r&&a&&(s=Gt.ts.parsePesTime(n))&&(s.type="video",i.video.push(s),p=!0)),p)break;d-=188,h-=188}}(e,i,n),0===n.video.length&&delete n.video;break;case Be.ADTS_STREAM_TYPE:n.audio=[],Xt(e,i,n),0===n.audio.length&&delete n.audio}return n}Gt.ts={parseType:function(e,t){return 0===(e=kt(e))?"pat":e===t?"pmt":t?"pes":null},parsePat:function(e){var t=Ct(e),i=4+wt(e);return t&&(i+=e[i]+1),(31&e[i+10])<<8|e[i+11]},parsePmt:function(e){var t={},i=Ct(e),n=4+wt(e);if(i&&(n+=e[n]+1),1&e[n+5]){for(var r=3+((15&e[n+1])<<8|e[n+2])-4,a=12+((15&e[n+10])<<8|e[n+11]);a<r;){var s=n+a;t[(31&e[s+1])<<8|e[s+2]]=e[s],a+=5+((15&e[s+3])<<8|e[s+4])}return t}},parsePayloadUnitStartIndicator:Ct,parsePesType:function(e,t){switch(t[kt(e)]){case Be.H264_STREAM_TYPE:return"video";case Be.ADTS_STREAM_TYPE:return"audio";case Be.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},parsePesTime:function(e){if(!Ct(e))return null;var t=4+wt(e);if(t>=e.byteLength)return null;var i=null,n=e[t+7];return 192&n&&((i={}).pts=(14&e[t+9])<<27|(255&e[t+10])<<20|(254&e[t+11])<<12|(255&e[t+12])<<5|(254&e[t+13])>>>3,i.pts*=4,i.pts+=(6&e[t+13])>>>1,i.dts=i.pts,64&n&&(i.dts=(14&e[t+14])<<27|(255&e[t+15])<<20|(254&e[t+16])<<12|(255&e[t+17])<<5|(254&e[t+18])>>>3,i.dts*=4,i.dts+=(6&e[t+18])>>>1)),i},videoPacketContainsKeyFrame:function(e){for(var t=4+wt(e),i=e.subarray(t),n=0,r=0,a=!1;r<i.byteLength-3;r++)if(1===i[r+2]){n=r+5;break}for(;n<i.byteLength;)switch(i[n]){case 0:if(0!==i[n-1]){n+=2;break}if(0!==i[n-2]){n++;break}for(r+3!==n-2&&"slice_layer_without_partitioning_rbsp_idr"===It(31&i[r+3])&&(a=!0);1!==i[++n]&&n<i.length;);r=n-2,n+=3;break;case 1:if(0!==i[n-1]||0!==i[n-2]){n+=3;break}"slice_layer_without_partitioning_rbsp_idr"===It(31&i[r+3])&&(a=!0),r=n-2,n+=3;break;default:n+=3}return i=i.subarray(r),n-=r,r=0,!!(i&&3<i.byteLength&&"slice_layer_without_partitioning_rbsp_idr"===It(31&i[r+3]))||a}},Gt.aac=lt;var Yt=se,Qt=function(e,t){var i,n,r=(Gt.aac.isLikelyAacData(e)?function(e){for(var t,i=!1,n=0,r=null,a=null,s=0,o=0;3<=e.length-o;){switch(Gt.aac.parseType(e,o)){case"timed-metadata":if(e.length-o<10){i=!0;break}if((s=Gt.aac.parseId3TagSize(e,o))>e.length){i=!0;break}null===a&&(t=e.subarray(o,o+s),a=Gt.aac.parseAacTimestamp(t)),o+=s;break;case"audio":if(e.length-o<7){i=!0;break}if((s=Gt.aac.parseAdtsSize(e,o))>e.length){i=!0;break}null===r&&(t=e.subarray(o,o+s),r=Gt.aac.parseSampleRate(t)),n++,o+=s;break;default:o++}if(i)return null}if(null===r||null===a)return null;var u=Yt/r;return{audio:[{type:"audio",dts:a,pts:a},{type:"audio",dts:a+1024*n*u,pts:a+1024*n*u}]}}:Kt)(e);return r&&(r.audio||r.video)?(e=t,(t=r).audio&&t.audio.length&&(void 0!==(i=e)&&!isNaN(i)||(i=t.audio[0].dts),t.audio.forEach((function(e){e.dts=zt(e.dts,i),e.pts=zt(e.pts,i),e.dtsTime=e.dts/Yt,e.ptsTime=e.pts/Yt}))),t.video&&t.video.length&&(void 0!==(n=e)&&!isNaN(n)||(n=t.video[0].dts),t.video.forEach((function(e){e.dts=zt(e.dts,n),e.pts=zt(e.pts,n),e.dtsTime=e.dts/Yt,e.ptsTime=e.pts/Yt})),t.firstKeyFrame&&((t=t.firstKeyFrame).dts=zt(t.dts,n),t.pts=zt(t.pts,n),t.dtsTime=t.dts/Yt,t.ptsTime=t.pts/Yt)),r):null},$t=function(){function e(e,t){this.options=t||{},this.self=e,this.init()}var t=e.prototype;return t.init=function(){var i,e;this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new At.Transmuxer(this.options),i=this.self,(e=this.transmuxer).on("data",(function(e){var t=e.initSegment;e.initSegment={data:t.buffer,byteOffset:t.byteOffset,byteLength:t.byteLength},t=e.data,e.data=t.buffer,i.postMessage({action:"data",segment:e,byteOffset:t.byteOffset,byteLength:t.byteLength},[e.data])})),e.on("done",(function(e){i.postMessage({action:"done"})})),e.on("gopInfo",(function(e){i.postMessage({action:"gopInfo",gopInfo:e})})),e.on("videoSegmentTimingInfo",(function(e){var t={start:{decode:ue(e.start.dts),presentation:ue(e.start.pts)},end:{decode:ue(e.end.dts),presentation:ue(e.end.pts)},baseMediaDecodeTime:ue(e.baseMediaDecodeTime)};
2e.prependedContentDuration&&(t.prependedContentDuration=ue(e.prependedContentDuration)),i.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:t})})),e.on("audioSegmentTimingInfo",(function(e){var t={start:{decode:ue(e.start.dts),presentation:ue(e.start.pts)},end:{decode:ue(e.end.dts),presentation:ue(e.end.pts)},baseMediaDecodeTime:ue(e.baseMediaDecodeTime)};e.prependedContentDuration&&(t.prependedContentDuration=ue(e.prependedContentDuration)),i.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:t})})),e.on("id3Frame",(function(e){i.postMessage({action:"id3Frame",id3Frame:e})})),e.on("caption",(function(e){i.postMessage({action:"caption",caption:e})})),e.on("trackinfo",(function(e){i.postMessage({action:"trackinfo",trackInfo:e})})),e.on("audioTimingInfo",(function(e){i.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:ue(e.start),end:ue(e.end)}})})),e.on("videoTimingInfo",(function(e){i.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:ue(e.start),end:ue(e.end)}})})),e.on("log",(function(e){i.postMessage({action:"log",log:e})}))},t.pushMp4Captions=function(e){this.captionParser||(this.captionParser=new Ft,this.captionParser.init());var t=new Uint8Array(e.data,e.byteOffset,e.byteLength);e=this.captionParser.parse(t,e.trackIds,e.timescales),this.self.postMessage({action:"mp4Captions",captions:e&&e.captions||[],logs:e&&e.logs||[],data:t.buffer},[t.buffer])},t.probeMp4StartTime=function(e){var t=e.timescales;e=e.data,t=Vt(t,e),this.self.postMessage({action:"probeMp4StartTime",startTime:t,data:e},[e.buffer])},t.probeMp4Tracks=function(e){var t=e.data;e=Wt(t),this.self.postMessage({action:"probeMp4Tracks",tracks:e,data:t},[t.buffer])},t.probeTs=function(e){var t=e.data,i=(e="number"!=typeof(i=e.baseStartTime)||isNaN(i)?void 0:i*se,Qt(t,e));e=null,i&&((e={hasVideo:i.video&&2===i.video.length||!1,hasAudio:i.audio&&2===i.audio.length||!1}).hasVideo&&(e.videoStart=i.video[0].ptsTime),e.hasAudio&&(e.audioStart=i.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:e,data:t},[t.buffer])},t.clearAllMp4Captions=function(){this.captionParser&&this.captionParser.clearAllCaptions()},t.clearParsedMp4Captions=function(){this.captionParser&&this.captionParser.clearParsedCaptions()},t.push=function(e){e=new Uint8Array(e.data,e.byteOffset,e.byteLength),this.transmuxer.push(e)},t.reset=function(){this.transmuxer.reset()},t.setTimestampOffset=function(e){e=e.timestampOffset||0,this.transmuxer.setBaseMediaDecodeTime(Math.round(oe(e)))},t.setAudioAppendStart=function(e){this.transmuxer.setAudioAppendStart(Math.ceil(oe(e.appendStart)))},t.setRemux=function(e){this.transmuxer.setRemux(e.remux)},t.flush=function(e){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})},t.endTimeline=function(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})},t.alignGopsWith=function(e){this.transmuxer.alignGopsWith(e.gopsToAlignWith.slice())},e}();self.onmessage=function(e){"init"===e.data.action&&e.data.options?this.messageHandlers=new $t(self,e.data.options):(this.messageHandlers||(this.messageHandlers=new $t(self)),e.data&&e.data.action&&"init"!==e.data.action&&this.messageHandlers[e.data.action]&&this.messageHandlers[e.data.action](e.data))}}))))),Ou=function(e){e.currentTransmux=null,e.transmuxQueue.length&&(e.currentTransmux=e.transmuxQueue.shift(),"function"==typeof e.currentTransmux?e.currentTransmux():Fo(e.currentTransmux))},Ru=function(e){Ho("reset",e)},Mu=function(e){var t=new Du;t.currentTransmux=null,t.transmuxQueue=[];var i=t.terminate;return t.terminate=function(){return t.currentTransmux=null,t.transmuxQueue.length=0,i.call(t)},t.postMessage({action:"init",options:e}),t},Nu=2,Uu=-101,Bu=-102,Fu=Vs("CodecUtils"),ju=Vs("PlaylistSelector"),Hu=(Qt=function(){var e=this.useDevicePixelRatio&&o.devicePixelRatio||1;return lu(this.playlists.master,this.systemBandwidth,parseInt(su(this.tech_.el(),"width"),10)*e,parseInt(su(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)},function(e){function t(t,n){var i=e.call(this)||this;if(!t)throw new TypeError("Initialization settings are required");if("function"!=typeof t.currentTime)throw new TypeError("No currentTime getter specified");if(!t.mediaSource)throw new TypeError("No MediaSource specified");return i.bandwidth=t.bandwidth,i.throughput={rate:0,count:0},i.roundTrip=NaN,i.resetStats_(),i.mediaIndex=null,i.partIndex=null,i.hasPlayed_=t.hasPlayed,i.currentTime_=t.currentTime,i.seekable_=t.seekable,i.seeking_=t.seeking,i.duration_=t.duration,i.mediaSource_=t.mediaSource,i.vhs_=t.vhs,i.loaderType_=t.loaderType,i.currentMediaInfo_=void 0,i.startingMediaInfo_=void 0,i.segmentMetadataTrack_=t.segmentMetadataTrack,i.goalBufferLength_=t.goalBufferLength,i.sourceType_=t.sourceType,i.sourceUpdater_=t.sourceUpdater,i.inbandTextTracks_=t.inbandTextTracks,i.state_="INIT",i.timelineChangeController_=t.timelineChangeController,i.shouldSaveSegmentTimingInfo_=!0,i.parse708captions_=t.parse708captions,i.experimentalExactManifestTimings=t.experimentalExactManifestTimings,i.checkBufferTimeout_=null,i.error_=void 0,i.currentTimeline_=-1,i.pendingSegment_=null,i.xhrOptions_=null,i.pendingSegments_=[],i.audioDisabled_=!1,i.isPendingTimestampOffset_=!1,i.gopBuffer_=[],i.timeMapping_=0,i.safeAppend_=11<=xn.browser.IE_VERSION,i.appendInitSegment_={audio:!0,video:!0},i.playlistOfLastInitSegment_={audio:null,video:null},i.callQueue_=[],i.loadQueue_=[],i.metadataQueue_={id3:[],caption:[]},i.waitingOnRemove_=!1,i.quotaExceededErrorRetryTimeout_=null,i.activeInitSegmentId_=null,i.initSegments_={},i.cacheEncryptionKeys_=t.cacheEncryptionKeys,i.keyCache_={},i.decrypter_=t.decrypter,i.syncController_=t.syncController,i.syncPoint_={segmentIndex:0,time:0},i.transmuxer_=i.createTransmuxer_(),i.triggerSyncInfoUpdate_=function(){return i.trigger("syncinfoupdate")},i.syncController_.on("syncinfoupdate",i.triggerSyncInfoUpdate_),i.mediaSource_.addEventListener("sourceopen",(function(){i.isEndOfStream_
2()||(i.ended_=!1)})),i.fetchAtBuffer_=!1,i.logger_=Vs("SegmentLoader["+i.loaderType_+"]"),Object.defineProperty(yt(i),"state",{get:function(){return this.state_},set:function(e){e!==this.state_&&(this.logger_(this.state_+" -> "+e),this.state_=e,this.trigger("statechange"))}}),i.sourceUpdater_.on("ready",(function(){i.hasEnoughInfoToAppend_()&&i.processCallQueue_()})),"main"===i.loaderType_&&i.timelineChangeController_.on("pendingtimelinechange",(function(){i.hasEnoughInfoToAppend_()&&i.processCallQueue_()})),"audio"===i.loaderType_&&i.timelineChangeController_.on("timelinechange",(function(){i.hasEnoughInfoToLoad_()&&i.processLoadQueue_(),i.hasEnoughInfoToAppend_()&&i.processCallQueue_()})),i}vt(t,e);var n=t.prototype;return n.createTransmuxer_=function(){return Mu({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_})},n.resetStats_=function(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0},n.dispose=function(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&o.clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()},n.setAudio=function(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())},n.abort=function(){"WAITING"===this.state?(this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()):this.pendingSegment_&&(this.pendingSegment_=null)},n.abort_=function(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,o.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null},n.checkForAbort_=function(e){return"APPENDING"!==this.state||this.pendingSegment_?!this.pendingSegment_||this.pendingSegment_.requestId!==e:(this.state="READY",!0)},n.error=function(e){return void 0!==e&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_},n.endOfStream=function(){this.ended_=!0,this.transmuxer_&&Ru(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")},n.buffered_=function(){var e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return xn.createTimeRanges();if("main"===this.loaderType_){var t=e.hasAudio,i=e.hasVideo;if(e=e.isMuxed,i&&t&&!this.audioDisabled_&&!e)return this.sourceUpdater_.buffered();if(i)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()},n.initSegmentForMap=function(e,t){if(void 0===t&&(t=!1),!e)return null;var i=xo(e),n=this.initSegments_[i];return t&&!n&&e.bytes&&(this.initSegments_[i]=n={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),n||e},n.segmentKey=function(e,t){if(void 0===t&&(t=!1),!e)return null;var i=Po(e),n=this.keyCache_[i];return this.cacheEncryptionKeys_&&t&&!n&&e.bytes&&(this.keyCache_[i]=n={resolvedUri:e.resolvedUri,bytes:e.bytes}),e={resolvedUri:(n||e).resolvedUri},n&&(e.bytes=n.bytes),e},n.couldBeginLoading_=function(){return this.playlist_&&!this.paused()},n.load=function(){if(this.monitorBuffer_(),this.playlist_)return"INIT"===this.state&&this.couldBeginLoading_()?this.init_():void(!this.couldBeginLoading_()||"READY"!==this.state&&"INIT"!==this.state||(this.state="READY"))},n.init_=function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()},n.playlist=function(e,t){if(void 0===t&&(t={}),e){var i=this.playlist_,n=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,"INIT"===this.state&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},"main"===this.loaderType_&&this.syncController_.setDateTimeMappingForStart(e));var r=null;if(i&&(i.id?r=i.id:i.uri&&(r=i.uri)),this.logger_("playlist update ["+r
2+" => "+(e.id||e.uri)+"]"),this.trigger("syncinfoupdate"),"INIT"===this.state&&this.couldBeginLoading_())return this.init_();if(!i||i.uri!==e.uri)return null!==this.mediaIndex&&this.resyncLoader(),this.currentMediaInfo_=void 0,void this.trigger("playlistupdate");t=e.mediaSequence-i.mediaSequence,this.logger_("live window shift ["+t+"]"),null!==this.mediaIndex&&(this.mediaIndex-=t,this.mediaIndex<0?(this.mediaIndex=null,this.partIndex=null):(r=this.playlist_.segments[this.mediaIndex],!this.partIndex||r.parts&&r.parts.length&&r.parts[this.partIndex]||(r=this.mediaIndex,this.logger_("currently processing part (index "+this.partIndex+") no longer exists."),this.resetLoader(),this.mediaIndex=r))),n&&(n.mediaIndex-=t,n.mediaIndex<0?(n.mediaIndex=null,n.partIndex=null):(0<=n.mediaIndex&&(n.segment=e.segments[n.mediaIndex]),0<=n.partIndex&&n.segment.parts&&(n.part=n.segment.parts[n.partIndex]))),this.syncController_.saveExpiredSegmentInfo(i,e)}},n.pause=function(){this.checkBufferTimeout_&&(o.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)},n.paused=function(){return null===this.checkBufferTimeout_},n.resetEverything=function(e){this.ended_=!1,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"})},n.resetLoader=function(){this.fetchAtBuffer_=!1,this.resyncLoader()},n.resyncLoader=function(){this.transmuxer_&&Ru(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})},n.remove=function(e,t,i,n){if(void 0===i&&(i=function(){}),void 0===n&&(n=!1),(t=t===1/0?this.duration_():t)<=e)this.logger_("skipping remove because end ${end} is <= start ${start}");else if(this.sourceUpdater_&&this.getMediaInfo_()){var r,a=1,s=function(){0===--a&&i()};for(r in!n&&this.audioDisabled_||(a++,this.sourceUpdater_.removeAudio(e,t,s)),!n&&"main"!==this.loaderType_||(this.gopBuffer_=function(e,t,i,n){for(var r=Math.ceil((t-n)*_u),a=Math.ceil((i-n)*_u),s=(n=e.slice(),e.length);s--&&!(e[s].pts<=a););if(-1===s)return n;for(var o=s+1;o--&&!(e[o].pts<=r););return o=Math.max(o,0),n.splice(o,s-o+1),n}(this.gopBuffer_,e,t,this.timeMapping_),a++,this.sourceUpdater_.removeVideo(e,t,s)),this.inbandTextTracks_)du(e,t,this.inbandTextTracks_[r]);du(e,t,this.segmentMetadataTrack_),s()}else this.logger_("skipping remove because no source updater or starting media info")},n.monitorBuffer_=function(){this.checkBufferTimeout_&&o.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=o.setTimeout(this.monitorBufferTick_.bind(this),1)},n.monitorBufferTick_=function(){"READY"===this.state&&this.fillBuffer_(),this.checkBufferTimeout_&&o.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=o.setTimeout(this.monitorBufferTick_.bind(this),500)},n.fillBuffer_=function(){var e;
2this.sourceUpdater_.updating()||(e=this.chooseNextRequest_())&&("number"==typeof e.timestampOffset&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e))},n.isEndOfStream_=function(e,t,i){if(void 0===e&&(e=this.mediaIndex),void 0===t&&(t=this.playlist_),void 0===i&&(i=this.partIndex),!t||!this.mediaSource_)return!1;var n="number"==typeof e&&t.segments[e];return e=e+1===t.segments.length,n=!n||!n.parts||i+1===n.parts.length,t.endList&&"open"===this.mediaSource_.readyState&&e&&n},n.chooseNextRequest_=function(){var e=Ys(this.buffered_())||0,t=Math.max(0,e-this.currentTime_()),i=!this.hasPlayed_()&&1<=t,n=t>=this.goalBufferLength_(),r=this.playlist_.segments;if(!r.length||i||n)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_()),(t={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:Boolean(!this.syncPoint_)}).isSyncRequest?t.mediaIndex=function(e,t,i){t=t||[];for(var n=[],r=0,a=0;a<t.length;a++){var s=t[a];if(e===s.timeline&&(n.push(a),i<(r+=s.duration)))return a}return 0===n.length?0:n[n.length-1]}(this.currentTimeline_,r,e):null!==this.mediaIndex?(i=r[this.mediaIndex],n="number"==typeof this.partIndex?this.partIndex:-1,t.startOfSegment=i.end||e,i.parts&&i.parts[n+1]?(t.mediaIndex=this.mediaIndex,t.partIndex=n+1):t.mediaIndex=this.mediaIndex+1):(e=(s=Eu.getMediaInfoForTime({experimentalExactManifestTimings:this.experimentalExactManifestTimings,playlist:this.playlist_,currentTime:this.fetchAtBuffer_?e:this.currentTime_(),startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time})).segmentIndex,a=s.startTime,s=s.partIndex,t.getMediaInfoForTime=this.fetchAtBuffer_?"bufferedEnd":"currentTime",t.mediaIndex=e,t.startOfSegment=a,t.partIndex=s);var a=r[t.mediaIndex],s=a&&"number"==typeof t.partIndex&&a.parts&&a.parts[t.partIndex];return!a||"number"==typeof t.partIndex&&!s?null:("number"!=typeof t.partIndex&&a.parts&&(t.partIndex=0),a=this.mediaSource_&&"ended"===this.mediaSource_.readyState,t.mediaIndex>=r.length-1&&a&&!this.seeking_()?null:this.generateSegmentInfo_(t))},n.generateSegmentInfo_=function(e){var t=e.playlist,i=e.mediaIndex,n=e.startOfSegment,r=e.isSyncRequest,a=e.partIndex,s=e.forceTimestampOffset,o=e.getMediaInfoForTime,u=t.segments[i];return e="number"==typeof a&&u.parts[a],o={requestId:"segment-loader-"+Math.random(),uri:e&&e.resolvedUri||u.resolvedUri,mediaIndex:i,partIndex:e?a:null,isSyncRequest:r,startOfSegment:n,playlist:t,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:u.timeline,duration:e&&e.duration||u.duration,segment:u,part:e,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:o},s=void 0!==s?s:this.isPendingTimestampOffset_,o.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:u.timeline,currentTimeline:this.currentTimeline_,startOfSegment:n,buffered:this.buffered_(),overrideCheck:s}),"number"==typeof(s=Ys(this.sourceUpdater_.audioBuffered()))&&(o.audioAppendStart=s-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(o.gopsToAlignWith=function(e,t,i){if(null==t||!e.length)return[];for(var n=Math.ceil((t-i+3)*_u),r=0;r<e.length&&!(e[r].pts>n);r++);return e.slice(r)}(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),o},n.timestampOffsetForSegment_=function(e){return i=(t=e).segmentTimeline,n=t.currentTimeline,r=t.startOfSegment,e=t.buffered,t.overrideCheck||i!==n?i<n||!e.length?r:e.end(e.length-1):null;var t,i,n,r},n.earlyAbortWhenNeeded_=function(e){var t,i,n,r,a,s,o,u,l,c,d,h,p;!this.vhs_.tech_.paused()&&this.xhrOptions_.timeout&&this.playlist_.attributes.BANDWIDTH&&(Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3||(t=this.currentTime_(),r=e.bandwidth,a=this.pendingSegment_.duration,p=Eu.estimateSegmentRequestTime(a,r,this.playlist_,e.bytesReceived),i=this.buffered_(),n=t,void 0===(e=this.vhs_.tech_.playbackRate())&&
2(e=1),p<=(e=((i.length?i.end(i.length-1):0)-n)/e-1)||(a=(r={master:this.vhs_.playlists.master,currentTime:t,bandwidth:r,duration:this.duration_(),segmentDuration:a,timeUntilRebuffer:e,currentTimeline:this.currentTimeline_,syncController:this.syncController_}).master,s=r.currentTime,o=r.bandwidth,u=r.duration,l=r.segmentDuration,c=r.timeUntilRebuffer,d=r.currentTimeline,h=r.syncController,a=(r=(a=(a=(r=a.playlists.filter((function(e){return!Eu.isIncompatible(e)}))).filter(Eu.isEnabled)).length?a:r.filter((function(e){return!Eu.isDisabled(e)}))).filter(Eu.hasAttribute.bind(null,"BANDWIDTH")).map((function(e){var t=h.getSyncPoint(e,u,d,s)?1:2;return{playlist:e,rebufferingImpact:Eu.estimateSegmentRequestTime(l,o,e)*t-c}}))).filter((function(e){return e.rebufferingImpact<=0})),ou(a,(function(e,t){return uu(t.playlist,e.playlist)})),(r=a.length?a[0]:(ou(r,(function(e,t){return e.rebufferingImpact-t.rebufferingImpact})),r[0]||null))&&(p=p-e-r.rebufferingImpact,!r.playlist||r.playlist.uri===this.playlist_.uri||p<(e<=Tu?1:.5)||(this.bandwidth=r.playlist.attributes.BANDWIDTH*Lu.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))))))},n.handleAbort_=function(e){this.logger_("Aborting "+pu(e)),this.mediaRequestsAborted+=1},n.handleProgress_=function(e,t){this.earlyAbortWhenNeeded_(t.stats),this.checkForAbort_(t.requestId)||this.trigger("progress")},n.handleTrackInfo_=function(e,t){this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId)||this.checkForIllegalMediaSwitch(t)||(function(e,t){if(!e&&!t||!e&&t||e&&!t)return!1;if(e===t)return!0;var i=Object.keys(e).sort(),n=Object.keys(t).sort();if(i.length!==n.length)return!1;for(var r=0;r<i.length;r++){var a=i[r];if(a!==n[r])return!1;if(e[a]!==t[a])return!1}return!0}(this.currentMediaInfo_,t=t||{})||(this.appendInitSegment_={audio:!0,video:!0},this.startingMediaInfo_=t,this.currentMediaInfo_=t,this.logger_("trackinfo update",t),this.trigger("trackinfo")),this.checkForAbort_(e.requestId)||(this.pendingSegment_.trackInfo=t,this.hasEnoughInfoToAppend_()&&this.processCallQueue_()))},n.handleTimingInfo_=function(e,t,i,n){var r;this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId)||((r=this.pendingSegment_)[e=fu(t)]=r[e]||{},r[e][i]=n,this.logger_("timinginfo: "+t+" - "+i+" - "+n),this.hasEnoughInfoToAppend_()&&this.processCallQueue_())},n.handleCaptions_=function(e,t){var g,n,r=this;this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId)||(0!==t.length?this.pendingSegment_.hasAppendedData_?(g=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),n={},t.forEach((function(e){n[e.stream]=n[e.stream]||{startTime:1/0,captions:[],endTime:0};var t=n[e.stream];t.startTime=Math.min(t.startTime,e.startTime+g),t.endTime=Math.max(t.endTime,e.endTime+g),t.captions.push(e)})),Object.keys(n).forEach((function(e){var t,i,l,c,a,s,d,u,h,f,m=n[e],y=m.startTime,p=m.endTime,v=m.captions,_=r.inbandTextTracks_;r.logger_("adding cues from "+y+" -> "+p+" for "+e),t=_,i=r.vhs_.tech_,t[l=e]||(i.trigger({type:"usage",name:"vhs-608"}),i.trigger({type:"usage",name:"hls-608"}),/^cc708_/.test(c=l)&&(c="SERVICE"+l.split("_")[1]),(d=i.textTracks().getTrackById(c))?t[l]=d:(s=a=l,m=!1,(d=(i.options_.vhs&&i.options_.vhs.captionServices||{})[c])&&(a=d.label,s=d.language,m=d.default),t[l]=i.addRemoteTextTrack({kind:"captions",id:c,default:m,label:a,language:s},!1).track)),du(y,p,_[e]),h=(v={captionArray:v,inbandTextTracks:_,timestampOffset:g}).inbandTextTracks,_=v.captionArray,f=v.timestampOffset,_&&(u=o.WebKitDataCue||o.VTTCue,_.forEach((function(e){var t=e.stream;h[t].addCue(new u(e.startTime+f,e.endTime+f,e.text))})))})),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})):this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,e,t)):this.logger_("SegmentLoader received no captions from a caption event"))},n.handleId3_=function(e,t,i){var n,r,a,s;this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId)||(this.pendingSegment_.hasAppendedData_?(n=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),r=this.inbandTextTracks_,a=i,s=this.vhs_.tech_,r.metadataTrack_||(r.metadataTrack_=s.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,r.metadataTrack_.inBandMetadataTrackDispatchType=a),cu({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:n,videoDuration:this.duration_()})):this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,i)))},n.processMetadataQueue_=function(){this.metadataQueue_.id3.forEach((function(e){return e()})),this.metadataQueue_.caption.forEach((function(e){return e()})),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]},n.processCallQueue_=function(){var e=this.callQueue_;this.callQueue_=[],e.forEach((function(e){return e()}))},n.processLoadQueue_=function(){var e=this.loadQueue_;this.loadQueue_=[],e.forEach((function(e){return e()}))},n.hasEnoughInfoToLoad_=function(){if("audio"!==this.loaderType_)return!0;var e=this.pendingSegment_;return!(!e||this.getCurrentMediaInfo_()&&mu({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))},n.getCurrentMediaInfo_=function(e){return(e=void 0===e?this.pendingSegment_:e)&&e.trackInfo||this.currentMediaInfo_},n.getMediaInfo_=function(e){return void 0===e&&(e=this.pendingSegment_),this.getCurrentMediaInfo_(e)||this.startingMediaInfo_},n.hasEnoughInfoToAppend_=function(){if(!this.sourceUpdater_.ready())return!1;if(this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;var e=this.pendingSegment_,t=this.getCurrentMediaInfo_();if(!e||!t)return!1;var i=t.hasAudio,n=t.hasVideo;return t=t.isMuxed,!(n&&!e.videoTimingInfo||i&&!this.audioDisabled_&&!t&&!e.audioTimingInfo||mu({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))},n.handleData_=function(e,t){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId))if(!this.callQueue_.length&&this.hasEnoughInfoToAppend_()){var i,n=this.pendingSegment_;if(this.setTimeMapping_(n.timeline),this.updateMediaSecondsLoaded_(n.segment),"closed"!==this.mediaSource_.readyState){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),n.segment.map=e.map),e.key&&this.segmentKey(e.ke
2y,!0),n.isFmp4=e.isFmp4,n.timingInfo=n.timingInfo||{},n.isFmp4?(this.trigger("fmp4"),n.timingInfo.start=n[fu(t.type)].start):(i=this.getCurrentMediaInfo_(),(i="main"===this.loaderType_&&i&&i.hasVideo)&&(r=n.videoTimingInfo.start),n.timingInfo.start=this.trueSegmentStart_({currentStart:n.timingInfo.start,playlist:n.playlist,mediaIndex:n.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:i,firstVideoFrameTimeForData:r,videoTimingInfo:n.videoTimingInfo,audioTimingInfo:n.audioTimingInfo})),this.updateAppendInitSegmentStatus(n,t.type),this.updateSourceBufferTimestampOffset_(n),n.isSyncRequest){this.updateTimingInfoEnd_(n),this.syncController_.saveSegmentTimingInfo({segmentInfo:n,shouldSaveTimelineMapping:"main"===this.loaderType_});var r=this.chooseNextRequest_();if(r.mediaIndex!==n.mediaIndex||r.partIndex!==n.partIndex)return void this.logger_("sync segment was incorrect, not appending");this.logger_("sync segment was correct, appending")}n.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(n,t)}}else this.callQueue_.push(this.handleData_.bind(this,e,t))},n.updateAppendInitSegmentStatus=function(e,t){"main"!==this.loaderType_||"number"!=typeof e.timestampOffset||e.changedTimestampOffset||(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[t]!==e.playlist&&(this.appendInitSegment_[t]=!0)},n.getInitSegmentAndUpdateState_=function(e){var t=e.type,i=e.initSegment,n=e.map,r=e.playlist;if(n){if(e=xo(n),this.activeInitSegmentId_===e)return null;i=this.initSegmentForMap(n,!0).bytes,this.activeInitSegmentId_=e}return i&&this.appendInitSegment_[t]?(this.playlistOfLastInitSegment_[t]=r,this.appendInitSegment_[t]=!1,this.activeInitSegmentId_=null,i):null},n.handleQuotaExceededError_=function(e,t){var i=this,n=e.segmentInfo,r=e.type,a=e.bytes,s=this.sourceUpdater_.audioBuffered(),l=this.sourceUpdater_.videoBuffered();1<s.length&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+Ks(s).join(", ")),1<l.length&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+Ks(l).join(", "));var u=s.length?s.start(0):0,c=s.length?s.end(s.length-1):0,d=l.length?l.start(0):0;if(e=l.length?l.end(l.length-1):0,c-u<=1&&e-d<=1)return this.logger_("On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: "+a.byteLength+", audio buffer: "+Ks(s).join(", ")+", video buffer: "+Ks(l).join(", ")+", "),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),void this.trigger("error");this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:n,type:r,bytes:a})),a=this.currentTime_()-1,this.logger_("On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to "+a),this.remove(0,a,(function(){i.logger_("On QUOTA_EXCEEDED_ERR, retrying append in 1s"),i.waitingOnRemove_=!1,i.quotaExceededErrorRetryTimeout_=o.setTimeout((function(){i.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),i.quotaExceededErrorRetryTimeout_=null,i.processCallQueue_()}),1e3)}),!0)},n.handleAppendError_=function(e,t){var i=e.segmentInfo,n=e.type;e=e.bytes,t&&(22!==t.code?(this.logger_("Received non QUOTA_EXCEEDED_ERR on append",t),this.error(n+" append of "+e.length+"b failed for segment #"+i.mediaIndex+" in playlist "+i.playlist.id),this.trigger("appenderror")):this.handleQuotaExceededError_({segmentInfo:i,type:n,bytes:e}))},n.appendToSourceBuffer_=function(e){var t,i,n=e.segmentInfo,r=e.type,a=e.initSegment,s=e.data,o=e.bytes;o||(e=[s],s=s.byteLength,a&&(e.unshift(a),s+=a.byteLength),i=0,(e={bytes:s,segments:e}).bytes&&(t=new Uint8Array(e.bytes),e.segments.forEach((function(e){t.set(e,i),i+=e.byteLength}))),o=t),this.sourceUpdater_.appendBuffer({segmentInfo:n,type:r,bytes:o},this.handleAppendError_.bind(this,{segmentInfo:n,type:r,bytes:o}))},n.handleSegmentTimingInfo_=function(e,t,i){this.pendingSegment_&&t===this.pendingSegment_.requestId&&((t=this.pendingSegment_.segment)[e+="TimingInfo"]||(t[e]={}),t[e].transmuxerPrependedSeconds=i.prependedContentDuration||0,t[e].transmuxedPresentationStart=i.start.presentation,t[e].transmuxedDecodeStart=i.start.decode,t[e].transmuxedPresentationEnd=i.end.presentation,t[e].transmuxedDecodeEnd=i.end.decode,t[e].baseMediaDecodeTime=i.baseMediaDecodeTime)},n.appendData_=function(e,t){var i=t.type,n=t.data;n&&n.byteLength&&("audio"===i&&this.audioDisabled_||(t=this.getInitSegmentAndUpdateState_({type:i,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null}),this.appendToSourceBuffer_({segmentInfo:e,type:i,initSegment:t,data:n})))},n.loadSegment_=function(e){var i=this;this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),"number"==typeof e.timestampOffset&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.hasEnoughInfoToLoad_()?this.updateTransmuxerAndRequestSegment_(e):this.loadQueue_.push((function(){var t=b({},e,{forceTimestampOffset:!0});b(e,i.generateSegmentInfo_(t)),i.isPendingTimestampOffset_=!1,i.updateTransmuxerAndRequestSegment_(e)}))},n.updateTransmuxerAndRequestSegment_=function(e){var t=this;this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));
2var n=this.createSimplifiedSegmentObj_(e),r=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),i=null!==this.mediaIndex,a=e.timeline!==this.currentTimeline_&&0<e.timeline;a=r||i&&a,this.logger_("Requesting "+pu(e)),n.map&&!n.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=eu({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:n,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:a,endedTimelineFn:function(){t.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:function(n){var r=n.message,i=n.level;n=n.stream,t.logger_(pu(e)+" logged from transmuxer stream "+n+" as a "+i+": "+r)}})},n.trimBackBuffer_=function(e){var t,i,n,r;0<(t=this.seekable_(),i=this.currentTime_(),n=this.playlist_.targetDuration||10,r=i-Lu.BACK_BUFFER_LENGTH,t.length&&(r=Math.max(r,t.start(0))),r=Math.min(i-n,r))&&this.remove(0,r)},n.createSimplifiedSegmentObj_=function(e){var i,t=e.segment,n={resolvedUri:((i=e.part)||t).resolvedUri,byterange:(i||t).byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part};return(i=e.playlist.segments[e.mediaIndex-1])&&i.timeline===t.timeline&&(i.videoTimingInfo?n.baseStartTime=i.videoTimingInfo.transmuxedDecodeEnd:i.audioTimingInfo&&(n.baseStartTime=i.audioTimingInfo.transmuxedDecodeEnd)),t.key&&(e=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]),n.key=this.segmentKey(t.key),n.key.iv=e),t.map&&(n.map=this.initSegmentForMap(t.map)),n},n.saveTransferStats_=function(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)},n.saveBandwidthRelatedStats_=function(e,t){this.pendingSegment_.byteLength=t.bytesReceived,e<1/60?this.logger_("Ignoring segment's bandwidth because its duration of "+e+" is less than the min to record "+1/60):(this.bandwidth=t.bandwidth,this.roundTrip=t.roundTripTime)},n.handleTimeout_=function(){this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,this.trigger("bandwidthupdate")},n.segmentRequestFinished_=function(e,t,i){if(this.callQueue_.length)this.callQueue_.push(this.segmentRequestFinished_.bind(this,e,t,i));else if(this.saveTransferStats_(t.stats),this.pendingSegment_&&t.requestId===this.pendingSegment_.requestId){if(e)return this.pendingSegment_=null,this.state="READY",e.code===Bu?void 0:(this.pause(),e.code===Uu?void this.handleTimeout_():(this.mediaRequestsErrored+=1,this.error(e),void this.trigger("error")));e=this.pendingSegment_,this.saveBandwidthRelatedStats_(e.duration,t.stats),e.endOfAllRequests=t.endOfAllRequests,i.gopInfo&&(this.gopBuffer_=function(e,t,i){if(!t.length)return e;if(i)return t.slice();for(var n=t[0].pts,r=0;r<e.length&&!(e[r].pts>=n);r++);return e.slice(0,r).concat(t)}(this.gopBuffer_,i.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(e)}},n.setTimeMapping_=function(e){null!==(e=this.syncController_.mappingForTimeline(e))&&(this.timeMapping_=e)},n.updateMediaSecondsLoaded_=function(e){"number"==typeof e.start&&"number"==typeof e.end?this.mediaSecondsLoaded+=e.end-e.start:this.mediaSecondsLoaded+=e.duration},n.shouldUpdateTransmuxerTimestampOffset_=function(e){return null!==e&&("main"===this.loaderType_&&e!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&e!==this.sourceUpdater_.audioTimestampOffset())},n.trueSegmentStart_=function(e){var t=e.currentStart,i=e.playlist,n=e.mediaIndex,r=e.firstVideoFrameTimeForData,a=e.currentVideoTimestampOffset,s=e.useVideoTimingInfo,o=e.videoTimingInfo;return e=e.audioTimingInfo,void 0!==t?t:s?(i=i.segments[n-1],0!==n&&i&&void 0!==i.start&&i.end===r+a?o.start:r):e.start},n.waitForAppendsToComplete_=function(e){if(!(n=this.getCurrentMediaInfo_(e)))return this.error({message:"No starting media returned, likely due to an unsupported media format.",blacklistDuration:1/0}),void this.trigger("error");var i=n.hasAudio,t=n.hasVideo,n=n.isMuxed;if(t="main"===this.loaderType_&&t,n=!this.audioDisabled_&&i&&!n,e.waitingOnAppends=0,!e.hasAppendedData_)return e.timingInfo||"number"!=typeof e.timestampOffset||(this.isPendingTimestampOffset_=!0),e.timingInfo={start:0},e.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(e),this.processMetadataQueue_()),void this.checkAppendsDone_(e);t&&e.waitingOnAppends++,n&&e.waitingOnAppends++,t&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),n&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))},n.checkAppendsDone_=function(e){this.checkForAbort_(e.requestId)||
2(e.waitingOnAppends--,0===e.waitingOnAppends&&this.handleAppendsDone_())},n.checkForIllegalMediaSwitch=function(e){var t,i;return!(t=this.loaderType_,i=this.getCurrentMediaInfo_(),!(e="main"===t&&i&&e?e.hasAudio||e.hasVideo?i.hasVideo&&!e.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!i.hasVideo&&e.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null:"Neither audio nor video found in segment.":null)||(this.error({message:e,blacklistDuration:1/0}),this.trigger("error"),0))},n.updateSourceBufferTimestampOffset_=function(e){var t;null===e.timestampOffset||"number"!=typeof e.timingInfo.start||e.changedTimestampOffset||"main"!==this.loaderType_||(t=!1,e.timestampOffset-=e.timingInfo.start,e.changedTimestampOffset=!0,e.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(e.timestampOffset),t=!0),e.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(e.timestampOffset),t=!0),t&&this.trigger("timestampoffset"))},n.updateTimingInfoEnd_=function(e){e.timingInfo=e.timingInfo||{};var t=this.getMediaInfo_();(t="main"===this.loaderType_&&t&&t.hasVideo&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo)&&(e.timingInfo.end="number"==typeof t.end?t.end:t.start+e.duration)},n.handleAppendsDone_=function(){if(this.pendingSegment_&&this.trigger("appendsdone"),!this.pendingSegment_)return this.state="READY",void(this.paused()||this.monitorBuffer_());var e=this.pendingSegment_;this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:"main"===this.loaderType_});var t=yu(e,this.sourceType_);t&&("warn"===t.severity?xn.log.warn(t.message):this.logger_(t.message)),this.recordThroughput_(e),this.pendingSegment_=null,this.state="READY",!e.isSyncRequest||(this.trigger("syncinfoupdate"),e.hasAppendedData_)?(this.logger_("Appended "+pu(e)),this.addSegmentMetadataCue_(e),this.fetchAtBuffer_=!0,this.currentTimeline_!==e.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline}),"main"!==this.loaderType_||this.audioDisabled_||this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:e.timeline})),this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate"),(t=e.segment).end&&this.currentTime_()-t.end>3*e.playlist.targetDuration?this.resetEverything():(null!==this.mediaIndex&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_())):this.logger_("Throwing away un-appended sync request "+pu(e))},n.recordThroughput_=function(e){var t,i;e.duration<1/60?this.logger_("Ignoring segment's throughput because its duration of "+e.duration+" is less than the min to record "+1/60):(t=this.throughput.rate,i=Date.now()-e.endOfAllRequests+1,i=Math.floor(e.byteLength/i*8*1e3),this.throughput.rate+=(i-t)/++this.throughput.count)},n.addSegmentMetadataCue_=function(e){var t,i,n,r;this.segmentMetadataTrack_&&(i=(t=e.segment).start,r=t.end,hu(i)&&hu(r)&&(du(i,r,this.segmentMetadataTrack_),n=o.WebKitDataCue||o.VTTCue,e={custom:t.custom,dateTimeObject:t.dateTimeObject,dateTimeString:t.dateTimeString,bandwidth:e.playlist.attributes.BANDWIDTH,resolution:e.playlist.attributes.RESOLUTION,codecs:e.playlist.attributes.CODECS,byteLength:e.byteLength,uri:e.uri,timeline:e.timeline,playlist:e.playlist.id,start:i,end:r},(r=new n(i,r,JSON.stringify(e))).value=e,this.segmentMetadataTrack_.addCue(r)))},t}(xn.EventTarget));function qu(){}function Vu(e){return"string"!=typeof e?e:e.replace(/./,(function(e){return e.toUpperCase()}))}function Wu(e,t){var i=t[e+"Buffer"];return i&&i.updating||t.queuePending[e]}function zu(e,t){if(0!==t.queue.length){var i=0,n=t.queue[i];if("mediaSource"!==n.type){if("mediaSource"!==e&&t.ready()&&"closed"!==t.mediaSource.readyState&&!Wu(e,t)){if(n.type!==e){if(null===(i=function(e,t){for(var i=0;i<t.length;i++){var n=t[i];if("mediaSource"===n.type)return null;if(n.type===e)return i}return null}(e,t.queue)))return;n=t.queue[i]}t.queue.splice(i,1),(t.queuePending[e]=n).action(e,t),n.doneFn||(t.queuePending[e]=null,zu(e,t))}}else t.updating()||"closed"===t.mediaSource.readyState||(t.queue.shift(),n.action(t),n.doneFn&&n.doneFn(),zu("audio",t),zu("video",t))}}function Gu(e,t){var i=t[e+"Buffer"],n=Vu(e);i&&(i.removeEventListener("updateend",t["on"+n+"UpdateEnd_"]),i.removeEventListener("error",t["on"+n+"Error_"]),t.codecs[e]=null,t[e+"Buffer"]=null)}function Xu(e,t){return e&&t&&-1!==Array.prototype.indexOf.call(e.sourceBuffers,t)}function Ku(e){var t=e.type,i=e.sourceUpdater,n=e.action,r=e.doneFn;e=e.name,i.queue.push({type:t,action:n,doneFn:r,name:e}),zu(t,i)}function Yu(i,e){return function(t){var n;e.queuePending[i]&&(n=e.queuePending[i].doneFn,e.queuePending[i]=null,n&&n(e[i+"Error_"])),zu(i,e)}}function Qu(e){return decodeURIComponent(escape(String.fromCharCode.apply(null,e)))}function $u(e,t){e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)}function Ju(e,t){(t.activePlaylistLoader=e).load()}function Zu(e,t){for(var i=0;i<e.length;i++){if(lo(t,e[i]))return!0;
2if(e[i].playlists&&Zu(e[i].playlists,t))return!0}return!1}function el(a){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((function(e){kl[e](e,a)}));var e,s=a.mediaTypes,t=a.masterPlaylistLoader,i=a.tech,n=a.vhs,r=a.segmentLoaders,o=r.AUDIO,u=r.main;function l(){s.AUDIO.onTrackChanged(),i.trigger({type:"usage",name:"vhs-audio-change"}),i.trigger({type:"usage",name:"hls-audio-change"})}for(e in["AUDIO","SUBTITLES"].forEach((function(e){var u,t,n,r,o,i,l,c,d,h;s[e].activeGroup=(u=e,t=a,function(e){var n=t.masterPlaylistLoader,i=t.mediaTypes[u].groups,r=n.media();if(!r)return null;var o=null;r.attributes[u]&&(o=i[r.attributes[u]]);var a=Object.keys(i);if(!o)if("AUDIO"===u&&1<a.length&&ho(t.master))for(var s=0;s<a.length;s++){var l=i[a[s]];if(Zu(l,r)){o=l;break}}else i.main?o=i.main:1===a.length&&(o=i[a[0]]);return void 0===e?o:null!==e&&o&&o.filter((function(t){return t.id===e.id}))[0]||null}),s[e].activeTrack=Cl[e](e,a),s[e].onGroupChanged=(n=e,r=a,function(){var e=(l=r.segmentLoaders)[n],i=l.main,t=r.mediaTypes[n],o=t.activeTrack(),a=t.getActiveGroup(),s=t.activePlaylistLoader,l=t.lastGroup_;a&&l&&a.id===l.id||(t.lastGroup_=a,t.lastTrack_=o,$u(e,t),a&&!a.isMasterPlaylist&&(a.playlistLoader?(e.resyncLoader(),Ju(a.playlistLoader,t)):s&&i.resetEverything()))}),s[e].onGroupChanging=(o=e,i=a,function(){var e=i.segmentLoaders[o];i.mediaTypes[o].lastGroup_=null,e.abort(),e.pause()}),s[e].onTrackChanged=(l=e,c=a,function(){var e=c.masterPlaylistLoader,i=(d=c.segmentLoaders)[l],t=d.main,n=c.mediaTypes[l],a=n.activeTrack(),s=n.getActiveGroup(),r=n.activePlaylistLoader,u=n.lastTrack_;if((!u||!a||u.id!==a.id)&&(n.lastGroup_=s,n.lastTrack_=a,$u(i,n),s)){if(s.isMasterPlaylist){if(!a||!u||a.id===u.id)return;var o=c.vhs.masterPlaylistController_,d=o.selectPlaylist();return o.media()===d?void 0:(n.logger_("track change. Switching master audio from "+u.id+" to "+a.id),e.pause(),t.resetEverything(),void o.fastQualityChange_(d))}if("AUDIO"===l){if(!s.playlistLoader)return t.setAudio(!0),void t.resetEverything();i.setAudio(!0),t.setAudio(!1)}r!==s.playlistLoader&&(i.track&&i.track(a),i.resetEverything()),Ju(s.playlistLoader,n)}}),s[e].getActiveGroup=(d=e,h=a.mediaTypes,function(){var e=h[d].activeTrack();return e?h[d].activeGroup(e):null})})),(r=s.AUDIO.activeGroup())&&(r=(r.filter((function(e){return e.default}))[0]||r[0]).id,s.AUDIO.tracks[r].enabled=!0,s.AUDIO.onGroupChanged(),s.AUDIO.onTrackChanged(),s.AUDIO.getActiveGroup().playlistLoader?(u.setAudio(!1),o.setAudio(!0)):u.setAudio(!0)),t.on("mediachange",(function(){["AUDIO","SUBTITLES"].forEach((function(e){return s[e].onGroupChanged()}))})),t.on("mediachanging",(function(){["AUDIO","SUBTITLES"].forEach((function(e){return s[e].onGroupChanging()}))})),i.audioTracks().addEventListener("change",l),i.remoteTextTracks().addEventListener("change",s.SUBTITLES.onTrackChanged),n.on("dispose",(function(){i.audioTracks().removeEventListener("change",l),i.remoteTextTracks().removeEventListener("change",s.SUBTITLES.onTrackChanged)})),i.clearTracks("audio"),s.AUDIO.tracks)i.audioTracks().addTrack(s.AUDIO.tracks[e])}function tl(e,t,i){var n,r,a,s,o=e.masterPlaylistController_,u=o[(e.options_.smoothQualityChange?"smooth":"fast")+"QualityChange_"].bind(o);t.attributes&&(n=t.attributes.RESOLUTION,this.width=n&&n.width,this.height=n&&n.height,this.bandwidth=t.attributes.BANDWIDTH),this.codecs=ru(o.master(),t),this.playlist=t,this.id=i,this.enabled=(r=e.playlists,a=t.id,s=u,function(e){var t=r.master.playlists[a],i=ao(t),n=so(t);return void 0===e?n:(e?delete t.disabled:t.disabled=!0,e===n||i||(s(),e?r.trigger("renditionenabled"):r.trigger("renditiondisabled")),e)})}function il(e,t){var i=0,n=0,r=xn.mergeOptions(Pl,t);function a(){n&&e.currentTime(n)}function s(t){null!=t&&(n=e.duration()!==1/0&&e.currentTime()||0,e.one("loadedmetadata",a),e.src(t),e.trigger({type:"usage",name:"vhs-error-reload"}),e.trigger({type:"usage",name:"hls-error-reload"}),e.play())}function o(){return Date.now()-i<1e3*r.errorInterval?(e.trigger({type:"usage",name:"vhs-error-reload-canceled"}),void e.trigger({type:"usage",name:"hls-error-reload-canceled"})):r.getSource&&"function"==typeof r.getSource?(i=Date.now(),r.getSource.call(e,s)):void xn.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")}function u(){e.off("loadedmetadata",a),e.off("error",o),e.off("dispose",u)}e.ready((function(){e.trigger({type:"usage",name:"vhs-error-reload-initialized"}),e.trigger({type:"usage",name:"hls-error-reload-initialized"})})),e.on("error",o),e.on("dispose",u),e.reloadSourceOnError=function(t){u(),il(e,t)}}var nl,rl=["video","audio"],al=function(e,t,a){return function(n,i){var r=i[n+"Buffer"];if(Xu(i.mediaSource,r)){i.logger_("Appending segment "+t.mediaIndex+"'s "+e.length+" b
2ytes to "+n+"Buffer");try{r.appendBuffer(e)}catch(r){i.logger_("Error with code "+r.code+" "+(22===r.code?"(QUOTA_EXCEEDED_ERR) ":"")+"when appending segment "+t.mediaIndex+" to "+n+"Buffer"),i.queuePending[n]=null,a(r)}}}},sl=function(e,t){return function(n,i){var r=i[n+"Buffer"];if(Xu(i.mediaSource,r)){i.logger_("Removing "+e+" to "+t+" from "+n+"Buffer");try{r.remove(e,t)}catch(r){i.logger_("Remove "+e+" to "+t+" from "+n+"Buffer failed")}}}},ll=function(e){return function(t,n){var i=n[t+"Buffer"];Xu(n.mediaSource,i)&&(n.logger_("Setting "+t+"timestampOffset to "+e),i.timestampOffset=e)}},cl=function(i){return function(e,t){i()}},ol=function(e){return function(t){if("open"===t.mediaSource.readyState){t.logger_("Calling mediaSource endOfStream("+(e||"")+")");try{t.mediaSource.endOfStream(e)}catch(t){xn.log.warn("Failed to call media source endOfStream",t)}}}},ul=function(e){return function(t){t.logger_("Setting mediaSource duration to "+e);try{t.mediaSource.duration=e}catch(t){xn.log.warn("Failed to set media source duration",t)}}},hl=function(){return function(e,t){if("open"===t.mediaSource.readyState){var i=t[e+"Buffer"];if(Xu(t.mediaSource,i)){t.logger_("calling abort on "+e+"Buffer");try{i.abort()}catch(t){xn.log.warn("Failed to abort on "+e+"Buffer",t)}}}}},pl=function(e,t){return function(n){var r=Vu(e),i=Vn(t);n.logger_("Adding "+e+"Buffer with codec "+t+" to mediaSource"),(i=n.mediaSource.addSourceBuffer(i)).addEventListener("updateend",n["on"+r+"UpdateEnd_"]),i.addEventListener("error",n["on"+r+"Error_"]),n.codecs[e]=t,n[e+"Buffer"]=i}},dl=function(i){return function(e){var t=e[i+"Buffer"];if(Gu(i,e),Xu(e.mediaSource,t)){e.logger_("Removing "+i+"Buffer with codec "+e.codecs[i]+" from mediaSource");try{e.mediaSource.removeSourceBuffer(t)}catch(e){xn.log.warn("Failed to removeSourceBuffer "+i+"Buffer",e)}}}},fl=function(e){return function(t,n){var i=n[t+"Buffer"],r=Vn(e);Xu(n.mediaSource,i)&&n.codecs[t]!==e&&(n.logger_("changing "+t+"Buffer codec from "+n.codecs[t]+" to "+e),i.changeType(r),n.codecs[t]=e)}},ml=function(i){function e(e){var t=i.call(this)||this;return t.mediaSource=e,t.sourceopenListener_=function(){return zu("mediaSource",yt(t))},t.mediaSource.addEventListener("sourceopen",t.sourceopenListener_),t.logger_=Vs("SourceUpdater"),t.audioTimestampOffset_=0,t.videoTimestampOffset_=0,t.queue=[],t.queuePending={audio:null,video:null},t.delayedAudioAppendQueue_=[],t.videoAppendQueued_=!1,t.codecs={},t.onVideoUpdateEnd_=Yu("video",yt(t)),t.onAudioUpdateEnd_=Yu("audio",yt(t)),t.onVideoError_=function(e){t.videoError_=e},t.onAudioError_=function(e){t.audioError_=e},t.createdSourceBuffers_=!1,t.initializedEme_=!1,t.triggeredReady_=!1,t}vt(e,i);var t=e.prototype;return t.initializedEme=function(){this.initializedEme_=!0,this.triggerReady()},t.hasCreatedSourceBuffers=function(){return this.createdSourceBuffers_},t.hasInitializedAnyEme=function(){return this.initializedEme_},t.ready=function(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()},t.createSourceBuffers=function(e){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(e),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())}
2,t.triggerReady=function(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))},t.addSourceBuffer=function(e,t){Ku({type:"mediaSource",sourceUpdater:this,action:pl(e,t),name:"addSourceBuffer"})},t.abort=function(e){Ku({type:e,sourceUpdater:this,action:hl(e),name:"abort"})},t.removeSourceBuffer=function(e){this.canRemoveSourceBuffer()?Ku({type:"mediaSource",sourceUpdater:this,action:dl(e),name:"removeSourceBuffer"}):xn.log.error("removeSourceBuffer is not supported!")},t.canRemoveSourceBuffer=function(){return!xn.browser.IE_VERSION&&!xn.browser.IS_FIREFOX&&o.MediaSource&&o.MediaSource.prototype&&"function"==typeof o.MediaSource.prototype.removeSourceBuffer},e.canChangeType=function(){return o.SourceBuffer&&o.SourceBuffer.prototype&&"function"==typeof o.SourceBuffer.prototype.changeType},t.canChangeType=function(){return this.constructor.canChangeType()},t.changeType=function(e,t){this.canChangeType()?Ku({type:e,sourceUpdater:this,action:fl(t),name:"changeType"}):xn.log.error("changeType is not supported!")},t.addOrChangeSourceBuffers=function(i){var e=this;if(!i||"object"!=typeof i||0===Object.keys(i).length)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");
2Object.keys(i).forEach((function(t){var n=i[t];if(!e.hasCreatedSourceBuffers())return e.addSourceBuffer(t,n);e.canChangeType()&&e.changeType(t,n)}))},t.appendBuffer=function(e,t){var i=this,n=e.segmentInfo,r=e.type,a=e.bytes;if(this.processedAppend_=!0,"audio"===r&&this.videoBuffer&&!this.videoAppendQueued_)return this.delayedAudioAppendQueue_.push([e,t]),void this.logger_("delayed audio append of "+a.length+" until video append");Ku({type:r,sourceUpdater:this,action:al(a,n||{mediaIndex:-1},t),doneFn:t,name:"appendBuffer"}),"video"===r&&(this.videoAppendQueued_=!0,this.delayedAudioAppendQueue_.length&&(r=this.delayedAudioAppendQueue_.slice(),this.logger_("queuing delayed audio "+r.length+" appendBuffers"),this.delayedAudioAppendQueue_.length=0,r.forEach((function(e){i.appendBuffer.apply(i,e)}))))},t.audioBuffered=function(){return Xu(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered||xn.createTimeRange()},t.videoBuffered=function(){return Xu(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered||xn.createTimeRange()},t.buffered=function(){var e=Xu(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=Xu(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return t&&!e?this.audioBuffered():e&&!t?this.videoBuffered():function(e,t){var i=null,n=null,r=0,a=[],s=[];if(!(e&&e.length&&t&&t.length))return xn.createTimeRange();for(var o=e.length;o--;)a.push({time:e.start(o),type:"start"}),a.push({time:e.end(o),type:"end"});for(o=t.length;o--;)a.push({time:t.start(o),type:"start"}),a.push({time:t.end(o),type:"end"});for(a.sort((function(e,t){return e.time-t.time})),o=0;o<a.length;o++)"start"===a[o].type?2===++r&&(i=a[o].time):"end"===a[o].type&&1===--r&&(n=a[o].time),null!==i&&null!==n&&(s.push([i,n]),n=i=null);return xn.createTimeRanges(s)}(this.audioBuffered(),this.videoBuffered())},t.setDuration=function(e,t){void 0===t&&(t=qu),Ku({type:"mediaSource",sourceUpdater:this,action:ul(e),name:"duration",doneFn:t})},t.endOfStream=function(e,t){void 0===t&&(t=qu),Ku({type:"mediaSource",sourceUpdater:this,action:ol(e="string"!=typeof(e=void 0===e?null:e)?void 0:e),name:"endOfStream",doneFn:t})},t.removeAudio=function(e,t,i){void 0===i&&(i=qu),this.audioBuffered().length&&0!==this.audioBuffered().end(0)?Ku({type:"audio",sourceUpdater:this,action:sl(e,t),doneFn:i,name:"remove"}):i()},t.removeVideo=function(e,t,i){void 0===i&&(i=qu),this.videoBuffered().length&&0!==this.videoBuffered().end(0)?Ku({type:"video",sourceUpdater:this,action:sl(e,t),doneFn:i,name:"remove"}):i()},t.updating=function(){return!(!Wu("audio",this)&&!Wu("video",this))},t.audioTimestampOffset=function(e){return void 0!==e&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(Ku({type:"audio",sourceUpdater:this,action:ll(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_},t.videoTimestampOffset=function(e){return void 0!==e&&this.videoBuffer&&this.videoTimestampOffset!==e&&(Ku({type:"video",sourceUpdater:this,action:ll(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_},t.audioQueueCallback=function(e){this.audioBuffer&&Ku({type:"audio",sourceUpdater:this,action:cl(e),name:"callback"})},t.videoQueueCallback=function(e){this.videoBuffer&&Ku({type:"video",sourceUpdater:this,action:cl(e),name:"callback"})},t.dispose=function(){var e=this;this.trigger("dispose"),rl.forEach((function(t){e.abort(t),e.canRemoveSourceBuffer()?e.removeSourceBuffer(t):e[t+"QueueCallback"]((function(){return Gu(t,e)}))})),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()},e}(xn.EventTarget),gl=new Uint8Array("\n\n".split("").map((function(e){return e.charCodeAt(0)}))),yl=function(i){function e(e,t){return(t=i.call(this,e,t=void 0===t?{}:t)||this).mediaSource_=null,t.subtitlesTrack_=null,t.loaderType_="subtitle",t.featuresNativeTextTracks_=e.featuresNativeTextTracks,t.shouldSaveSegmentTimingInfo_=!1,t}vt(e,i);var t=e.prototype;return t.createTransmuxer_=function(){return null},t.buffered_=function(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return xn.createTimeRanges();var e=(t=this.subtitlesTrack_.cues)[0].startTime,t=t[t.length-1].startTime;return xn.createTimeRanges([[e,t]])},t.initSegmentForMap=function(e,t){if(void 0===t&&(t=!1),!e)return null;var i=xo(e),n=this.initSegments_[i];return t&&!n&&e.bytes&&(t=gl.byteLength+e.bytes.byteLength,(t=new Uint8Array(t)).set(e.bytes),t.set(gl,e.bytes.byteLength),this.initSegments_[i]=n={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:t}),n||e},t.couldBeginLoading_=function(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()},t.init_=function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()},t.track=function(e){return void 0===e||(this.subtitlesTrack_=e,"INIT"===this.state&&this.couldBeginLoading_()&&this.init_()),this.subtitlesTrack_},t.remove=function(e,t){du(e,t,this.subtitlesTrack_)},t.fillBuffer_=function(){var e=this,t=this.chooseNextRequest_();if(t){if(null===this.syncController_.timestampOffsetForTimeline(t.timeline))return this.syncController_.one("timestampoffset",(function(){e.state="READY",e.paused()||e.monitorBuffer_()})),void(this.state="WAITING_ON_TIMELINE");this.loadSegment_(t)}},t.timestampOffsetForSegment_=function(){return null},t.chooseNextRequest_=function(){return this.skipEmptySegments_(i.prototype.chooseNextRequest_.call(this))},t.skipEmptySegments_=function(e){for(;e&&e.segment.empty;){if(e.mediaIndex+1>=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e},t.stopForError=function(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")},t.segmentRequestFinished_=function(e,t,i){var n=this;if(this.subtitlesTrack_){if(this.saveTransferStats_(t.stats),!this.pendingSegment_)return this.state="READY",void(this.mediaRequestsAborted+=1);if(e)return e.code===Uu&&this.handleTimeout_(),e.code===Bu?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,void this.stopForError(e);var r=this.pendingSegment_;this.saveBandwidthRelatedStats_(r.duration,t.stats),this.state="APPENDING",this.trigger("appending");var a=r.segment;if(a.map&&(a.map.bytes=t.map.bytes),r.bytes=t.bytes,"function"!=typeof o.WebVTT&&this.subtitlesTrack_&&this.subtitlesTrack_.tech_){var s=function(){n.subtitlesTrack_.tech_.off("vttjsloaded",l),n.stopForError({message:"Error loading vtt.js"})},l=function(){n.subtitlesTrack_.tech_.off("vttjserror",s),n.segmentRequestFinished_(e,t,i)};return this.state="WAITING_ON_VTTJS",this.subtitlesTrack_.tech_.one("vttjsloaded",l),void this.subtitlesTrack_.tech_.one("vttjserror",s)}a.requested=!0;try{this.parseVTTCues_(r)}catch(e){return void this.stopForError({message:e.message})}if(this.updateTimeMapping_(r,this.syncController_.timelines[r.timeline],this.playlist_),r.cues.length?r.timingInfo={start:r.cues[0].startTime,end:r.cues[r.cues.length-1].endTime}:r.timingInfo={start:r.startOfSegment,end:r.startOfSegment+r.duration},r.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");r.byteLength=r.bytes.byteLength,this.mediaSecondsLoaded+=a.duration,r.cues.forEac
2h((function(e){n.subtitlesTrack_.addCue(n.featuresNativeTextTracks_?new o.VTTCue(e.startTime,e.endTime,e.text):e)})),function(e){var t=e.cues;if(t)for(var i=0;i<t.length;i++){for(var n=[],r=0,a=0;a<t.length;a++)t[i].startTime===t[a].startTime&&t[i].endTime===t[a].endTime&&t[i].text===t[a].text&&1<++r&&n.push(t[a]);n.length&&n.forEach((function(t){return e.removeCue(t)}))}}(this.subtitlesTrack_),this.handleAppendsDone_()}else this.state="READY"},t.handleData_=function(){},t.updateTimingInfoEnd_=function(){},t.parseVTTCues_=function(e){var t=!1;"function"==typeof o.TextDecoder?i=new o.TextDecoder("utf8"):(i=o.WebVTT.StringDecoder(),t=!0);var i=new o.WebVTT.Parser(o,o.vttjs,i);e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},i.oncue=e.cues.push.bind(e.cues),i.ontimestampmap=function(t){e.timestampmap=t},i.onparsingerror=function(e){xn.log.warn("Error encountered when parsing cues: "+e.message)},e.segment.map&&(n=e.segment.map.bytes,t&&(n=Qu(n)),i.parse(n));var n=e.bytes;t&&(n=Qu(n)),i.parse(n),i.flush()},t.updateTimeMapping_=function(e,t,i){var n,r,a=e.segment;t&&(e.cues.length?(r=e.timestampmap,n=r.MPEGTS/_u-r.LOCAL+t.mapping,e.cues.forEach((function(e){e.startTime+=n,e.endTime+=n})),i.syncInfo||(r=e.cues[0].startTime,t=e.cues[e.cues.length-1].startTime,i.syncInfo={mediaSequence:i.mediaSequence+e.mediaIndex,time:Math.min(r,t-a.duration)})):a.empty=!0)},e}(Hu),vl=[{name:"VOD",run:function(e,t,i,n,r){return i===1/0?null:{time:0,segmentIndex:0,partIndex:null}}},{name:"ProgramDateTime",run:function(e,t,i,n,r){if(!Object.keys(e.timelineToDatetimeMappings).length)return null;var a=null,s=null,o=Qs(t);r=r||0;for(var u=0;u<o.length;u++){var l=o[t.endList||0===r?u:o.length-(u+1)],c=l.segment,d=e.timelineToDatetimeMappings[c.timeline];if(d&&c.dateTimeObject){var h=c.dateTimeObject.getTime()/1e3+d;if(c.parts&&"number"==typeof l.partIndex)for(var p=0;p<l.partIndex;p++)h+=c.parts[p].duration;if(d=Math.abs(r-h),null!==s&&(0===d||s<d))break;s=d,a={time:h,segmentIndex:l.segmentIndex,partIndex:l.partIndex}}}return a}},{name:"Segment",run:function(e,t,i,n,r){var a=null,s=null;r=r||0;for(var o=Qs(t),u=0;u<o.length;u++){var l=o[t.endList||0===r?u:o.length-(u+1)],c=l.segment,d=l.part&&l.part.start||c&&c.start;if(c.timeline===n&&void 0!==d){if(c=Math.abs(r-d),null!==s&&s<c)break;(!a||null===s||c<=s)&&(s=c,a={time:d,segmentIndex:l.segmentIndex,partIndex:l.partIndex})}}return a}},{name:"Discontinuity",run:function(e,t,i,n,r){var a=null;if(r=r||0,t.discontinuityStarts&&t.discontinuityStarts.length)for(var s=null,o=0;o<t.discontinuityStarts.length;o++){var u=t.discontinuityStarts[o],l=t.discontinuitySequence+o+1,c=e.discontinuities[l];if(c){if(l=Math.abs(r-c.time),null!==s&&s<l)break;(!a||null===s||l<=s)&&(s=l,a={time:c.time,segmentIndex:u,partIndex:null})}}return a}},{name:"Playlist",run:function(e,t,i,n,r){return t.syncInfo?{time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence,partIndex:null}:null}}],_l=function(i){function e(e){var t=i.call(this)||this;return t.timelines=[],t.discontinuities=[],t.timelineToDatetimeMappings={},t.logger_=Vs("SyncController"),t}vt(e,i);var t=e.prototype;return t.getSyncPoint=function(e,t,i,n){return(i=this.runStrategies_(e,t,i,n)).length?this.selectSyncPoint_(i,{key:"time",value:n}):null},t.getExpiredTime=function(e,t){return e&&e.segments&&(t=this.runStrategies_(e,t,e.discontinuitySequence,0)).length?(0<(t=this.selectSyncPoint_(t,{key:"segmentIndex",value:0})).segmentIndex&&(t.time*=-1),Math.abs(t.time+io({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:t.segmentIndex,endIndex:0}))):null},t.runStrategies_=function(e,t,i,n){for(var r=[],a=0;a<vl.length;a++){var s=vl[a],o=s.run(this,e,t,i,n);o&&(o.strategy=s.name,r.push({strategy:s.name,syncPoint:o}))}return r},t.selectSyncPoint_=function(e,t){for(var i=e[0].syncPoint,n=Math.abs(e[0].syncPoint[t.key]-t.value),r=e[0].strategy,a=1;a<e.length;a++){var s=Math.abs(e[a].syncPoint[t.key]-t.value);s<n&&(n=s,i=e[a].syncPoint,r=e[a].strategy)}return this.logger_("syncPoint for ["+t.key+": "+t.value+"] chosen with strategy ["+r+"]: [time:"+i.time+", segmentIndex:"+i.segmentIndex+("number"==typeof i.partIndex?",partIndex:"+i.partIndex:"")+"]"),i},t.saveExpiredSegmentInfo=function(e,t){for(var i=t.mediaSequence-e.mediaSequence-1;0<=i;i--){var n=e.segments[i];if(n&&void 0!==n.start){t.syncInfo={mediaSequence:e.mediaSequence+i,time:n.start}
2,this.logger_("playlist refresh sync: [time:"+t.syncInfo.time+", mediaSequence: "+t.syncInfo.mediaSequence+"]"),this.trigger("syncinfoupdate");break}}},t.setDateTimeMappingForStart=function(e){var t;this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject&&(e=(t=e.segments[0]).dateTimeObject.getTime()/1e3,this.timelineToDatetimeMappings[t.timeline]=-e)},t.saveSegmentTimingInfo=function(e){var t=e.segmentInfo,i=e.shouldSaveTimelineMapping,n=this.calculateSegmentTimeMapping_(t,t.timingInfo,i);e=t.segment,n&&(this.saveDiscontinuitySyncInfo_(t),t.playlist.syncInfo||(t.playlist.syncInfo={mediaSequence:t.playlist.mediaSequence+t.mediaIndex,time:e.start})),t=e.dateTimeObject,e.discontinuity&&i&&t&&(this.timelineToDatetimeMappings[e.timeline]=-t.getTime()/1e3)},t.timestampOffsetForTimeline=function(e){return void 0===this.timelines[e]?null:this.timelines[e].time},t.mappingForTimeline=function(e){return void 0===this.timelines[e]?null:this.timelines[e].mapping},t.calculateSegmentTimeMapping_=function(e,t,i){var n,r,a=e.segment,s=e.part,o=this.timelines[e.timeline];if("number"==typeof e.timestampOffset)o={time:e.startOfSegment,mapping:e.startOfSegment-t.start},i&&(this.timelines[e.timeline]=o,this.trigger("timestampoffset"),this.logger_("time mapping for timeline "+e.timeline+": [time: "+o.time+"] [mapping: "+o.mapping+"]")),n=e.startOfSegment,r=t.end+o.mapping;else{if(!o)return!1;n=t.start+o.mapping,r=t.end+o.mapping}return s&&(s.start=n,s.end=r),(!a.start||n<a.start)&&(a.start=n),a.end=r,!0},t.saveDiscontinuitySyncInfo_=function(e){var t=e.playlist,i=e.segment;if(i.discontinuity)this.discontinuities[i.timeline]={time:i.start,accuracy:0};else if(t.discontinuityStarts&&t.discontinuityStarts.length)for(var n=0;n<t.discontinuityStarts.length;n++){var r,a=t.discontinuityStarts[n],s=t.discontinuitySequence+n+1,o=a-e.mediaIndex,u=Math.abs(o);(!this.discontinuities[s]||this.discontinuities[s].accuracy>u)&&(r=void 0,r=o<0?i.start-io({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:a}):i.end+io({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:a}),this.discontinuities[s]={time:r,accuracy:u})}},t.dispose=function(){this.trigger("dispose"),this.off()},e}(xn.EventTarget),bl=function(e){function t(){var t=e.call(this)||this;return t.pendingTimelineChanges_={},t.lastTimelineChanges_={},t}vt(t,e);var i=t.prototype;return i.clearPendingTimelineChange=function(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")},i.pendingTimelineChange=function(e){var t=e.type,i=e.from;return e=e.to,"number"==typeof i&&"number"==typeof e&&(this.pendingTimelineChanges_[t]={type:t,from:i,to:e},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[t]},i.lastTimelineChange=function(e){var t=e.type,i=e.from;return e=e.to,"number"==typeof i&&"number"==typeof e&&(this.lastTimelineChanges_[t]={type:t,from:i,to:e},delete this.pendingTimelineChanges_[t],this.trigger("timelinechange")),this.lastTimelineChanges_[t]},i.dispose=function(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()},t}(xn.EventTarget),Tl=ui(On(K((function(){function e(e,t,i){return e(i={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&i.path)}},i.exports),i.exports}var t=e((function(e){function t(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e},e.exports.default=e.exports,e.exports.__esModule=!0})),i=e((function(i){function e(t,n){return i.exports=e=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},i.exports.default=i.exports,i.exports.__esModule=!0,e(t,n)}i.exports=e,i.exports.default=i.exports,i.exports.__esModule=!0})),n=e((function(e){e.exports=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,i(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0})),r=function(){function e(){this.listeners={}}var t=e.prototype;return t.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.off=function(e,t){return!!this.listeners[e]&&(t=this.listeners[e].indexOf(t),this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(t,1),-1<t)},t.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var i=t.length,n=0;n<i;++n)t[n].call(this,arguments[1]);
2else for(var r=Array.prototype.slice.call(arguments,1),a=t.length,s=0;s<a;++s)t[s].apply(this,r)},t.dispose=function(){this.listeners={}},t.pipe=function(e){this.on("data",(function(t){e.push(t)}))},e}(),o=null,l=function(){function e(e){var t,i,n;o=o||function(){for(var e,t,i,n,r,a,s,o=[[[],[],[],[],[]],[[],[],[],[],[]]],u=o[0],l=o[1],c=u[4],d=l[4],h=[],p=[],f=0;f<256;f++)p[(h[f]=f<<1^283*(f>>7))^f]=f;for(e=t=0;!c[e];e^=i||1,t=p[t]||1)for(s=16843009*h[n=h[i=h[d[c[e]=r=(r=t^t<<1^t<<2^t<<3^t<<4)>>8^255&r^99]=e]]]^65537*n^257*i^16843008*e,a=257*h[r]^16843008*r,f=0;f<4;f++)u[f][e]=a=a<<24^a>>>8,l[f][r]=s=s<<24^s>>>8;for(f=0;f<5;f++)u[f]=u[f].slice(0),l[f]=l[f].slice(0);return o}(),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=this._tables[0][4],a=this._tables[1],s=e.length,l=1;if(4!==s&&6!==s&&8!==s)throw new Error("Invalid aes key size");var u=e.slice(0),c=[];for(this._key=[u,c],t=s;t<4*s+28;t++)n=u[t-1],(t%s==0||8===s&&t%s==4)&&(n=r[n>>>24]<<24^r[n>>16&255]<<16^r[n>>8&255]<<8^r[255&n],t%s==0&&(n=n<<8^n>>>24^l<<24,l=l<<1^283*(l>>7))),u[t]=u[t-s]^n;for(i=0;t;i++,t--)n=u[3&i?t:t-4],c[i]=t<=4||i<4?n:a[0][r[n>>>24]]^a[1][r[n>>16&255]]^a[2][r[n>>8&255]]^a[3][r[255&n]]}return e.prototype.decrypt=function(e,t,i,n,r,a){for(var s,o,u,l=this._key[1],c=e^l[0],d=n^l[1],h=i^l[2],p=t^l[3],f=l.length/4-2,m=4,g=(t=this._tables[1])[0],y=t[1],v=t[2],_=t[3],b=t[4],T=0;T<f;T++)s=g[c>>>24]^y[d>>16&255]^v[h>>8&255]^_[255&p]^l[m],o=g[d>>>24]^y[h>>16&255]^v[p>>8&255]^_[255&c]^l[m+1],u=g[h>>>24]^y[p>>16&255]^v[c>>8&255]^_[255&d]^l[m+2],p=g[p>>>24]^y[c>>16&255]^v[d>>8&255]^_[255&h]^l[m+3],m+=4,c=s,d=o,h=u;for(T=0;T<4;T++)r[(3&-T)+a]=b[c>>>24]<<24^b[d>>16&255]<<16^b[h>>8&255]<<8^b[255&p]^l[m++],s=c,c=d,d=h,h=p,p=s},e}(),c=function(e){function t(){var t=e.call(this,r)||this;return t.jobs=[],t.delay=1,t.timeout_=null,t}n(t,e);var i=t.prototype;return i.processJob_=function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null},i.push=function(e){this.jobs.push(e),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},t}(r),g=function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24},a=function(){function u(e,t,i,n){var r=u.STEP,a=new Int32Array(e.buffer),s=new Uint8Array(e.byteLength),o=0;for(this.asyncStream_=new c,this.asyncStream_.push(this.decryptChunk_(a.subarray(o,o+r),t,i,s)),o=r;o<a.length;o+=r)i=new Uint32Array([g(a[o-4]),g(a[o-3]),g(a[o-2]),g(a[o-1])]),this.asyncStream_.push(this.decryptChunk_(a.subarray(o,o+r),t,i,s));this.asyncStream_.push((function(){var e;n(null,(e=s).subarray(0,e.byteLength-e[e.byteLength-1]))}))}return u.prototype.decryptChunk_=function(e,i,t,n){return function(){var r=function(e,t,i){for(var n,r,a,s,o=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),u=new l(Array.prototype.slice.call(t)),c=(e=new Uint8Array(e.byteLength),new Int32Array(e.buffer)),d=i[0],h=i[1],f=i[2],p=i[3],m=0;m<o.length;m+=4)n=g(o[m]),r=g(o[m+1]),a=g(o[m+2]),s=g(o[m+3]),u.decrypt(n,r,a,s,c,m),c[m]=g(c[m]^d),c[m+1]=g(c[m+1]^h),c[m+2]=g(c[m+2]^f),c[m+3]=g(c[m+3]^p),d=n,h=r,f=a,p=s;return e}(e,i,t);n.set(r,e.byteOffset)}},t(u,null,[{key:"STEP",get:function(){return 32e3}}]),u}();self.onmessage=function(e){var t=e.data,n=new Uint8Array(t.encrypted.bytes,t.encrypted.byteOffset,t.encrypted.byteLength),i=new Uint32Array(t.key.bytes,t.key.byteOffset,t.key.byteLength/4);e=new Uint32Array(t.iv.bytes,t.iv.byteOffset,t.iv.byteLength/4),new a(n,i,e,(function(e,n){var i,r;self.postMessage((i={source:t.source,decrypted:n},r={}
2,Object.keys(i).forEach((function(e){var t=i[e];ArrayBuffer.isView(t)?r[e]={bytes:t.buffer,byteOffset:t.byteOffset,byteLength:t.byteLength}:r[e]=t})),r),[n.buffer])}))}})))),Sl={AUDIO:function(s,e){return function(){var t=e.segmentLoaders[s],n=e.mediaTypes[s],i=e.blacklistCurrentPlaylist;$u(t,n);var r=n.activeTrack(),o=(t=((t=n.activeGroup()).filter((function(e){return e.default}))[0]||t[0]).id,n.tracks[t]);if(r!==o){for(var a in xn.log.warn("Problem encountered loading the alternate audio track.Switching back to default."),n.tracks)n.tracks[a].enabled=n.tracks[a]===o;n.onTrackChanged()}else i({message:"Problem encountered loading the default audio track."})}},SUBTITLES:function(i,e){return function(){var t=e.segmentLoaders[i],n=e.mediaTypes[i];xn.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),$u(t,n),(t=n.activeTrack())&&(t.mode="disabled"),n.onTrackChanged()}}},El={AUDIO:function(e,t,i){var n,r,a;t&&(n=i.tech,r=i.requestOptions,a=i.segmentLoaders[e],t.on("loadedmetadata",(function(){var e=t.media();a.playlist(e,r),(!n.paused()||e.endList&&"none"!==n.preload())&&a.load()})),t.on("loadedplaylist",(function(){a.playlist(t.media(),r),n.paused()||a.load()})),t.on("error",Sl[e](e,i)))},SUBTITLES:function(e,t,i){var n=i.tech,r=i.requestOptions,a=i.segmentLoaders[e],s=i.mediaTypes[e];t.on("loadedmetadata",(function(){var e=t.media();a.playlist(e,r),a.track(s.activeTrack()),(!n.paused()||e.endList&&"none"!==n.preload())&&a.load()})),t.on("loadedplaylist",(function(){a.playlist(t.media(),r),n.paused()||a.load()})),t.on("error",Sl[e](e,i))}},kl={AUDIO:function(e,t){var i,n,r=t.vhs,a=t.sourceType,s=t.segmentLoaders[e],o=t.requestOptions,u=t.master.mediaGroups,l=t.mediaTypes[e],c=l.groups,d=l.tracks,h=l.logger_,p=t.masterPlaylistLoader,f=ho(p.master);for(i in u[e]&&0!==Object.keys(u[e]).length||(u[e]={main:{default:{default:!0}}},f&&(u[e].main.default.playlists=p.master.playlists)),u[e])for(var m in c[i]||(c[i]=[]),u[e][i]){var g=u[e][i][m],y=void 0;y=f?(h("AUDIO group '"+i+"' label '"+m+"' is a master playlist"),g.isMasterPlaylist=!0,null):"vhs-json"===a&&g.playlists?new wu(g.playlists[0],r,o):g.resolvedUri?new wu(g.resolvedUri,r,o):g.playlists&&"dash"===a?new Pu(g.playlists[0],r,o,p):null,g=xn.mergeOptions({id:m,playlistLoader:y},g),El[e](e,g.playlistLoader,t),c[i].push(g),void 0===d[m]&&(g=new xn.AudioTrack({id:m,kind:(n=void 0,n=(y=g).default?"main":"alternative",n=y.characteristics&&0<=y.characteristics.indexOf("public.accessibility.describes-video")?"main-desc":n),enabled:!1,language:g.language,default:g.default,label:m}),d[m]=g)}s.on("error",Sl[e](e,t))},SUBTITLES:function(e,t){var i,n=t.tech,r=t.vhs,a=t.sourceType,s=t.segmentLoaders[e],o=t.requestOptions,u=t.master.mediaGroups,l=t.mediaTypes[e],c=l.groups,d=l.tracks,h=t.masterPlaylistLoader;for(i in u[e])for(var p in c[i]||(c[i]=[]),u[e][i])if(!u[e][i][p].forced){var f=u[e][i][p],m=void 0;if("hls"===a)m=new wu(f.resolvedUri,r,o);else if("dash"===a){if(!f.playlists.filter((function(e){return e.excludeUntil!==1/0})).length)return;m=new Pu(f.playlists[0],r,o,h)}else"vhs-json"===a&&(m=new wu(f.playlists?f.playlists[0]:f.resolvedUri,r,o));f=xn.mergeOptions({id:p,playlistLoader:m},f),El[e](e,f.playlistLoader,t),c[i].push(f),void 0===d[p]&&(f=n.addRemoteTextTrack({id:p,kind:"subtitles",default:f.default&&f.autoselect,language:f.language,label:p},!1).track,d[p]=f)}s.on("error",Sl[e](e,t))},"CLOSED-CAPTIONS":function(e,t){var i,n=t.tech,r=t.master.mediaGroups,a=(t=t.mediaTypes[e]).groups,s=t.tracks;for(i in r[e])for(var o in a[i]||(a[i]=[]),r[e][i]){var u,l,c=r[e][i][o];/^(?:CC|SERVICE)/.test(c.instreamId)&&(void 0===(l=(u=n.options_.vhs&&n.options_.vhs.captionServices||{})[(l={label:o,language:c.language,instreamId:c.instreamId,default:c.default&&c.autoselect}).instreamId]?xn.mergeOptions(l,u[l.instreamId]):l).default&&delete l.default,a[i].push(xn.mergeOptions({id:o},c)),void 0===s[o]&&(l=n.addRemoteTextTrack({id:l.instreamId,kind:"captions",default:l.default,language:l.language,label:l.label},!1).track,s[o]=l))}}},Cl={AUDIO:function(i,e){return function(){var t,n=e.mediaTypes[i].tracks;for(t in n)if(n[t].enabled)return n[t];return null}},SUBTITLES:function(i,e){return function(){var t,n=e.mediaTypes[i].tracks;for(t in n)if("showing"===n[t].mode||"hidden"===n[t].mode)return n[t];return null}}},wl=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],Il=function(e){function t(t){var n=e.call(this)||this,i=t.src,r
2=t.handleManifestRedirects,l=t.withCredentials,a=t.tech,s=t.bandwidth,c=t.externVhs,u=t.useCueTags,d=t.blacklistDuration,h=t.enableLowInitialPlaylist,f=t.sourceType,m=t.cacheEncryptionKeys,p=t.experimentalBufferBasedABR,y=t.experimentalLeastPixelDiffSelector;if(!i)throw new Error("A non-empty playlist URL or JSON manifest string is required");var v,g=t.maxPlaylistRetries;return null!=g||(g=1/0),nl=c,n.experimentalBufferBasedABR=Boolean(p),n.experimentalLeastPixelDiffSelector=Boolean(y),n.withCredentials=l,n.tech_=a,n.vhs_=a.vhs,n.sourceType_=f,n.useCueTags_=u,n.blacklistDuration=d,n.maxPlaylistRetries=g,n.enableLowInitialPlaylist=h,n.useCueTags_&&(n.cueTagsTrack_=n.tech_.addTextTrack("metadata","ad-cues"),n.cueTagsTrack_.inBandMetadataTrackDispatchType=""),n.requestOptions_={withCredentials:l,handleManifestRedirects:r,maxPlaylistRetries:g,timeout:null},n.on("error",n.pauseLoading),n.mediaTypes_=(v={},["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((function(e){v[e]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:qu,activeTrack:qu,getActiveGroup:qu,onGroupChanged:qu,onTrackChanged:qu,lastTrack_:null,logger_:Vs("MediaGroups["+e+"]")}})),v),n.mediaSource=new o.MediaSource,n.handleDurationChange_=n.handleDurationChange_.bind(yt(n)),n.handleSourceOpen_=n.handleSourceOpen_.bind(yt(n)),n.handleSourceEnded_=n.handleSourceEnded_.bind(yt(n)),n.mediaSource.addEventListener("durationchange",n.handleDurationChange_),n.mediaSource.addEventListener("sourceopen",n.handleSourceOpen_),n.mediaSource.addEventListener("sourceended",n.handleSourceEnded_),n.seekable_=xn.createTimeRanges(),n.hasPlayed_=!1,n.syncController_=new _l(t),n.segmentMetadataTrack_=a.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,n.decrypter_=new Tl,n.sourceUpdater_=new ml(n.mediaSource),n.inbandTextTracks_={},n.timelineChangeController_=new bl,m={vhs:n.vhs_,parse708captions:t.parse708captions,mediaSource:n.mediaSource,currentTime:n.tech_.currentTime.bind(n.tech_),seekable:function(){return n.seekable()},seeking:function(){return n.tech_.seeking()},duration:function(){return n.duration()},hasPlayed:function(){return n.hasPlayed_},goalBufferLength:function(){return n.goalBufferLength()},bandwidth:s,syncController:n.syncController_,decrypter:n.decrypter_,sourceType:n.sourceType_,inbandTextTracks:n.inbandTextTracks_,cacheEncryptionKeys:m,sourceUpdater:n.sourceUpdater_,timelineChangeController:n.timelineChangeController_,experimentalExactManifestTimings:t.experimentalExactManifestTimings},n.masterPlaylistLoader_=new("dash"===n.sourceType_?Pu:wu)(i,n.vhs_,n.requestOptions_),n.setupMasterPlaylistLoaderListeners_(),n.mainSegmentLoader_=new Hu(xn.mergeOptions(m,{segmentMetadataTrack:n.segmentMetadataTrack_,loaderType:"main"}),t),n.audioSegmentLoader_=new Hu(xn.mergeOptions(m,{loaderType:"audio"}),t),n.subtitleSegmentLoader_=new yl(xn.mergeOptions(m,{loaderType:"vtt",featuresNativeTextTracks:n.tech_.featuresNativeTextTracks}),t),n.setupSegmentLoaderListeners_(),n.experimentalBufferBasedABR&&(n.masterPlaylistLoader_.one("loadedplaylist",(function(){return n.startABRTimer_()})),n.tech_.on("pause",(function(){return n.stopABRTimer_()})),n.tech_.on("play",(function(){return n.startABRTimer_()}))),wl.forEach((function(e){n[e+"_"]=function(e){return this.audioSegmentLoader_[e]+this.mainSegmentLoader_[e]}.bind(yt(n),e)})),n.logger_=Vs("MPC"),n.triggeredFmp4Usage=!1,"none"===n.tech_.preload()?(n.loadOnPlay_=function(){n.loadOnPlay_=null,n.masterPlaylistLoader_.load()},n.tech_.one("play",n.loadOnPlay_)):n.masterPlaylistLoader_.load(),n.timeToLoadedData__=-1,n.mainAppendsToLoadedData__=-1,n.audioAppendsToLoadedData__=-1,t="none"===n.tech_.preload()?"play":"loadstart",n.tech_.one(t,(function(){var e=Date.now();n.tech_.one("loadeddata",(function(){n.timeToLoadedData__=Date.now()-e,n.mainAppendsToLoadedData__=n.mainSegmentLoader_.mediaAppends,n.audioAppendsToLoadedData__=n.audioSegmentLoader_.mediaAppends}))})),n}vt(t,e);var n=t.prototype;return n.mainAppendsToLoadedData_=function(){return this.mainAppendsToLoadedData__},n.audioAppendsToLoadedData_=function(){return this.audioAppendsToLoadedData__},n.appendsToLoadedData_=function(){var e=this.mainAppendsToLoadedData_(),t=this.audioAppendsToLoadedData_();return-1===e||-1===t?-1:e+t},n.timeToLoadedData_=function(){return this.timeToLoadedData__},n.checkABR_=function(){var e=this.selectPlaylist();e&&this.shouldSwitchToMedia_(e)&&this.switchMedia_(e,"abr")},n.switchMedia_=function(e,t,i){var n=(r=this.media())&&(r.id||r.uri),r=e.id||e.uri;n&&n!==r&&(this.logger_("switch media "+n+" -> "+r+" from "+t),this.tech_.trigger({type:"usage",name:"vhs-rendition-change-"+t})),this.masterPlaylistLoader_.media(e,i)},n.startABRTimer_=function(){var e=this;this.stopABRTimer_(),this.abrTimer_=o.setInterval((function(){return e.checkABR_()}),250)},n.stopABRTimer_=function(){this.tech_.scrubbing&&this.tech_.scrubbing()||(o.clearInterval(this.abrTimer_),this.abrTimer_=null)},n.getAudioTrackPlaylists_=function(){var e=this.master(),t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return t;var i,n=e.mediaGroups.AUDIO,r=Object.keys(n);if(Object.keys(this.mediaTypes_.AUDIO.groups).length)i=this.mediaTypes_.AUDIO.activeTrack();else{var a,s=n.main||r.length&&n[r[0]];for(a in s)if(s[a].default){i={label:a};break}}if(!i)return t;var o,u=[];for(o in n)if(n[o][i.label]){var l=n[o][i.label];if(l.playlists&&l.playlists.length)u.push.apply(u,l.playlists);
2else if(l.uri)u.push(l);else if(e.playlists.length)for(var c=0;c<e.playlists.length;c++){var d=e.playlists[c];d.attributes&&d.attributes.AUDIO&&d.attributes.AUDIO===o&&u.push(d)}}return u.length?u:t},n.setupMasterPlaylistLoaderListeners_=function(){var i=this;this.masterPlaylistLoader_.on("loadedmetadata",(function(){var e=i.masterPlaylistLoader_.media(),t=1.5*e.targetDuration*1e3;uo(i.masterPlaylistLoader_.master,i.masterPlaylistLoader_.media())?i.requestOptions_.timeout=0:i.requestOptions_.timeout=t,e.endList&&"none"!==i.tech_.preload()&&(i.mainSegmentLoader_.playlist(e,i.requestOptions_),i.mainSegmentLoader_.load()),el({sourceType:i.sourceType_,segmentLoaders:{AUDIO:i.audioSegmentLoader_,SUBTITLES:i.subtitleSegmentLoader_,main:i.mainSegmentLoader_},tech:i.tech_,requestOptions:i.requestOptions_,masterPlaylistLoader:i.masterPlaylistLoader_,vhs:i.vhs_,master:i.master(),mediaTypes:i.mediaTypes_,blacklistCurrentPlaylist:i.blacklistCurrentPlaylist.bind(i)}),i.triggerPresenceUsage_(i.master(),e),i.setupFirstPlay(),!i.mediaTypes_.AUDIO.activePlaylistLoader||i.mediaTypes_.AUDIO.activePlaylistLoader.media()?i.trigger("selectedinitialmedia"):i.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",(function(){i.trigger("selectedinitialmedia")}))})),this.masterPlaylistLoader_.on("loadedplaylist",(function(){i.loadOnPlay_&&i.tech_.off("play",i.loadOnPlay_);var e,t=i.masterPlaylistLoader_.media();if(!t){if(i.excludeUnsupportedVariants_(),!(e=(e=i.enableLowInitialPlaylist?i.selectInitialPlaylist():e)||i.selectPlaylist())||!i.shouldSwitchToMedia_(e))return;if(i.initialMedia_=e,i.switchMedia_(i.initialMedia_,"initial"),"vhs-json"!==i.sourceType_||!i.initialMedia_.segments)return;t=i.initialMedia_}i.handleUpdatedMediaPlaylist(t)})),this.masterPlaylistLoader_.on("error",(function(){i.blacklistCurrentPlaylist(i.masterPlaylistLoader_.error)})),this.masterPlaylistLoader_.on("mediachanging",(function(){i.mainSegmentLoader_.abort(),i.mainSegmentLoader_.pause()})),this.masterPlaylistLoader_.on("mediachange",(function(){var e=i.masterPlaylistLoader_.media(),t=1.5*e.targetDuration*1e3;uo(i.masterPlaylistLoader_.master,i.masterPlaylistLoader_.media())?i.requestOptions_.timeout=0:i.requestOptions_.timeout=t,i.mainSegmentLoader_.playlist(e,i.requestOptions_),i.mainSegmentLoader_.load(),i.tech_.trigger({type:"mediachange",bubbles:!0})})),this.masterPlaylistLoader_.on("playlistunchanged",(function(){var e=i.masterPlaylistLoader_.media();"playlist-unchanged"!==e.lastExcludeReason_&&i.stuckAtPlaylistEnd_(e)&&(i.blacklistCurrentPlaylist({message:"Playlist no longer updating.",reason:"playlist-unchanged"}),i.tech_.trigger("playliststuck"))})),this.masterPlaylistLoader_.on("renditiondisabled",(function(){i.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"}),i.tech_.trigger({type:"usage",name:"hls-rendition-disabled"})})),this.masterPlaylistLoader_.on("renditionenabled",(function(){i.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"}),i.tech_.trigger({type:"usage",name:"hls-rendition-enabled"})}))},n.handleUpdatedMediaPlaylist=function(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())},n.triggerPresenceUsage_=function(e,t){var i,n=e.mediaGroups||{},r=!0;for(i in e=Object.keys(n.AUDIO),n.AUDIO)for(var a in n.AUDIO[i])n.AUDIO[i][a].uri||(r=!1);r&&(this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),this.tech_.trigger({type:"usage",name:"hls-demuxed"})),Object.keys(n.SUBTITLES).length&&(this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),this.tech_.trigger({type:"usage",name:"hls-webvtt"})),nl.Playlist.isAes(t)&&(this.tech_.trigger({type:"usage",name:"vhs-aes"}),this.tech_.trigger({type:"usage",name:"hls-aes"})),e.length&&1<Object.keys(n.AUDIO[e[0]]).length&&(this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.tech_.trigger({type:"usage",name:"hls-alternate-audio"})),this.useCueTags_&&(this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"}),this.tech_.trigger({type:"usage",name:"hls-playlist-cue-tags"}))},n.shouldSwitchToMedia_=function(e){var t=this.masterPlaylistLoader_.media(),i=this.tech_.buffered();return function(e){var t=e.currentPlaylist,i=e.nextPlaylist,n=e.forwardBuffer,r=e.bufferLowWaterLine,a=e.bufferHighWaterLine,s=e.duration,o=e.experimentalBufferBasedABR,u=e.log;if(!i)return xn.log.warn("We received no playlist to switch to. Please check your stream."),!1;var l="allowing switch "+(t&&t.id||"null")+" -> "+i.id;return t?!(i.id===t.id||(t.endList?s<(e=o?Lu.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:Lu.MAX_BUFFER_LOW_WATER_LINE)?(u(l+" as duration < max low water line ("+s+" < "+e+")"),0):(e=i.attributes.BANDWIDTH)<(i=t.attributes.BANDWIDTH)&&(!o||n<a)?(t=l+" as next bandwidth < current bandwidth ("+e+" < "+i+")",o&&(t+=" and forwardBuffer < bufferHighWaterLine ("+n+" < "+a+")"),u(t),0):(!o||i<e)&&r<=n?(r=l+" as forwardBuffer >= bufferLowWaterLine ("+n+" >= "+r+")",o&&(r+=" and next bandwidth > current bandwidth ("+e+" > "+i+")"),u(r),0):(u("not "+l+" as no switching criteria met"),1):(u(l+" as current playlist is live"),0))):(u(l+" as current playlist is not set"),!0)}({currentPlaylist:t,nextPlaylist:e,forwardBuffer:i.length?i.end(i.length-1)-this.tech_.currentTime():0,bufferLowWaterLine:this.bufferLowWaterLine(),bufferHighWaterLine:this.bufferHighWaterLine(),duration:this.duration(),experimentalBufferBasedABR:this.experimentalBufferBasedABR,log:this.logger_})},n.setupSegmentLoaderListeners_=function(){var e=this;function t(){if(!e.sourceUpdater_.hasCreatedSourceBuffers())return e.tryToCreateSourceBuffers_();var t=e.getCodecsOrExclude_();t&&e.sourceUpdater_.addOrChangeSourceBuffers(t)}this.experimentalBufferBasedABR||(this.mainSegmentLoader_.on("bandwidthupdate",(function(){var t=e.selectPlaylist();e.shouldSwitchToMedia_(t)&&e.switchMedia_(t,"bandwidthupdate"),e.tech_.trigger("bandwidthupdate")})),this.mainSegmentLoader_.on("progress",(function(){e.trigger("progress")}))),this.mainSegmentLoader_.on("error",(function(){e.blacklistCurrentPlaylist(e.mainSegmentLoader_.error())}
2)),this.mainSegmentLoader_.on("appenderror",(function(){e.error=e.mainSegmentLoader_.error_,e.trigger("error")})),this.mainSegmentLoader_.on("syncinfoupdate",(function(){e.onSyncInfoUpdate_()})),this.mainSegmentLoader_.on("timestampoffset",(function(){e.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"}),e.tech_.trigger({type:"usage",name:"hls-timestamp-offset"})})),this.audioSegmentLoader_.on("syncinfoupdate",(function(){e.onSyncInfoUpdate_()})),this.audioSegmentLoader_.on("appenderror",(function(){e.error=e.audioSegmentLoader_.error_,e.trigger("error")})),this.mainSegmentLoader_.on("ended",(function(){e.logger_("main segment loader ended"),e.onEndOfStream()})),this.mainSegmentLoader_.on("earlyabort",(function(t){e.experimentalBufferBasedABR||(e.delegateLoaders_("all",["abort"]),e.blacklistCurrentPlaylist({message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},120))})),this.mainSegmentLoader_.on("trackinfo",t),this.audioSegmentLoader_.on("trackinfo",t),this.mainSegmentLoader_.on("fmp4",(function(){e.triggeredFmp4Usage||(e.tech_.trigger({type:"usage",name:"vhs-fmp4"}),e.tech_.trigger({type:"usage",name:"hls-fmp4"}),e.triggeredFmp4Usage=!0)})),this.audioSegmentLoader_.on("fmp4",(function(){e.triggeredFmp4Usage||(e.tech_.trigger({type:"usage",name:"vhs-fmp4"}),e.tech_.trigger({type:"usage",name:"hls-fmp4"}),e.triggeredFmp4Usage=!0)})),this.audioSegmentLoader_.on("ended",(function(){e.logger_("audioSegmentLoader ended"),e.onEndOfStream()}))},n.mediaSecondsLoaded_=function(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)},n.load=function(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()},n.smoothQualityChange_=function(e){void 0===e&&(e=this.selectPlaylist()),this.fastQualityChange_(e)},n.fastQualityChange_=function(e){var t=this;(e=void 0===e?this.selectPlaylist():e)!==this.masterPlaylistLoader_.media()?(this.switchMedia_(e,"fast-quality"),this.mainSegmentLoader_.resetEverything((function(){xn.browser.IE_VERSION||xn.browser.IS_EDGE?t.tech_.setCurrentTime(t.tech_.currentTime()+.04):t.tech_.setCurrentTime(t.tech_.currentTime())}))):this.logger_("skipping fastQualityChange because new media is same as old")},n.play=function(){if(!this.setupFirstPlay()){this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();var e=this.tech_.seekable();return this.tech_.duration()===1/0&&this.tech_.currentTime()<e.start(0)?this.tech_.setCurrentTime(e.end(e.length-1)):void 0}},n.setupFirstPlay=function(){var e=this,t=this.masterPlaylistLoader_.media();if(!t||this.tech_.paused()||this.hasPlayed_)return!1;if(!t.endList){var i=this.seekable();if(!i.length)return!1;if(xn.browser.IE_VERSION&&0===this.tech_.readyState())return this.tech_.one("loadedmetadata",(function(){e.trigger("firstplay"),e.tech_.setCurrentTime(i.end(0)),e.hasPlayed_=!0})),!1;this.trigger("firstplay"),this.tech_.setCurrentTime(i.end(0))}return this.hasPlayed_=!0,this.load(),!0},n.handleSourceOpen_=function(){var e;this.tryToCreateSourceBuffers_(),!this.tech_.autoplay()||void 0!==(e=this.tech_.play())&&"function"==typeof e.then&&e.then(null,(function(e){})),this.trigger("sourceopen")},n.handleSourceEnded_=function(){var e,t;!this.inbandTextTracks_.metadataTrack_||(e=this.inbandTextTracks_.metadataTrack_.cues)&&e.length&&(t=this.duration(),e[e.length-1].endTime=isNaN(t)||Math.abs(t)===1/0?Number.MAX_VALUE:t)},n.handleDurationChange_=function(){this.tech_.trigger("durationchange")},n.onEndOfStream=function(){var e,t=this.mainSegmentLoader_.ended_;(t=this.mediaTypes_.AUDIO.activePlaylistLoader?((e=this.mainSegmentLoader_.getCurrentMediaInfo_())&&!e.hasVideo||t)&&this.audioSegmentLoader_.ended_:t)&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())},n.stuckAtPlaylistEnd_=function(e){if(!this.seekable().length)return!1;if(null===(t=this.syncController_.getExpiredTime(e,this.duration())))return!1;var t,i=nl.Playlist.playlistEnd(e,t);return e=this.tech_.currentTime(),(t=this.tech_.buffered()).length?(t=t.end(t.length-1))-e<=.1&&i-t<=.1:i-e<=.1},n.blacklistCurrentPlaylist=function(e,t){var i=(e=void 0===e?{}:e).playlist||this.masterPlaylistLoader_.media();
2if(t=t||e.blacklistDuration||this.blacklistDuration,!i)return this.error=e,void("open"!==this.mediaSource.readyState?this.trigger("error"):this.sourceUpdater_.endOfStream("network"));i.playlistErrors_++;var n,r=this.masterPlaylistLoader_.master.playlists,a=r.filter(so),s=1===a.length&&a[0]===i;return 1===r.length&&t!==1/0?(xn.log.warn("Problem encountered with playlist "+i.id+". Trying again since it is the only playlist."),this.tech_.trigger("retryplaylist"),this.masterPlaylistLoader_.load(s)):(s&&(n=!1,r.forEach((function(e){var t;e===i||void 0!==(t=e.excludeUntil)&&t!==1/0&&(n=!0,delete e.excludeUntil)})),n&&(xn.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))),a=i.playlistErrors_>this.maxPlaylistRetries?1/0:Date.now()+1e3*t,i.excludeUntil=a,e.reason&&(i.lastExcludeReason_=e.reason),this.tech_.trigger("blacklistplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-blacklisted"}),this.tech_.trigger({type:"usage",name:"hls-rendition-blacklisted"}),(r=this.selectPlaylist())?(t=e.internal?this.logger_:xn.log.warn,a=e.message?" "+e.message:"",t((e.internal?"Internal problem":"Problem")+" encountered with playlist "+i.id+"."+a+" Switching to playlist "+r.id+"."),r.attributes.AUDIO!==i.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),r.attributes.SUBTITLES!==i.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]),a=r.targetDuration/2*1e3||5e3,a="number"==typeof r.lastRequest&&Date.now()-r.lastRequest<=a,this.switchMedia_(r,"exclude",s||a)):(this.error="Playback cannot continue. No available working or supported playlists.",void this.trigger("error")))},n.pauseLoading=function(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()},n.delegateLoaders_=function(i,e){var t=this,n=[],r="all"===i;!r&&"main"!==i||n.push(this.masterPlaylistLoader_);var a=[];!r&&"audio"!==i||a.push("AUDIO"),!r&&"subtitle"!==i||(a.push("CLOSED-CAPTIONS"),a.push("SUBTITLES")),a.forEach((function(e){(e=t.mediaTypes_[e]&&t.mediaTypes_[e].activePlaylistLoader)&&n.push(e)})),["main","audio","subtitle"].forEach((function(e){var r=t[e+"SegmentLoader_"];!r||i!==e&&"all"!==i||n.push(r)})),n.forEach((function(t){return e.forEach((function(e){"function"==typeof t[e]&&t[e]()}))}))},n.setCurrentTime=function(e){var t=zs(this.tech_.buffered(),e);return this.masterPlaylistLoader_&&this.masterPlaylistLoader_.media()&&this.masterPlaylistLoader_.media().segments?t&&t.length?e:(this.mainSegmentLoader_.resetEverything(),this.mainSegmentLoader_.abort(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.resetEverything(),this.audioSegmentLoader_.abort()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.resetEverything(),this.subtitleSegmentLoader_.abort()),void this.load()):0},n.duration=function(){if(!this.masterPlaylistLoader_)return 0;var e=this.masterPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:nl.Playlist.duration(e):1/0:0},n.seekable=function(){return this.seekable_},n.onSyncInfoUpdate_=function(){var e;if(this.masterPlaylistLoader_){var t=this.masterPlaylistLoader_.media();if(t){var i=this.syncController_.getExpiredTime(t,this.duration());if(null!==i){var n,r,a=this.masterPlaylistLoader_.master,s=nl.Playlist.seekable(t,i,nl.Playlist.liveEdgeDelay(a,t));if(0!==s.length){if(this.mediaTypes_.AUDIO.activePlaylistLoader){if(t=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),null===(i=this.syncController_.getExpiredTime(t,this.duration())))return;if(0===(e=nl.Playlist.seekable(t,i,nl.Playlist.liveEdgeDelay(a,t))).length)return}this.seekable_&&this.seekable_.length&&(n=this.seekable_.end(0),r=this.seekable_.start(0)),!e||e.start(0)>s.end(0)||s.start(0)>e.end(0)?this.seekable_=s:this.seekable_=xn.createTimeRanges([[(e.start(0)>s.start(0)?e:s).start(0),(e.end(0)<s.end(0)?e:s).end(0)]]),this.seekable_&&this.seekable_.length&&this.seekable_.end(0)===n&&this.seekable_.start(0)===r||(this.logger_("seekable updated ["+Xs(this.seekable_)+"]"),this.tech_.trigger("seekablechanged"))}}}}},n.updateDuration=function(e){if(this.updateDuration_&&(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null),"open"!==this.mediaSource.readyState)return this.updateDuration_=this.updateDuration.bind(this,e),void this.mediaSource.addEventListener("sourceopen",this.updateDuration_);if(e){var t=this.seekable();return t.length?void((isNaN(this.mediaSource.duration)||this.mediaSource.duration<t.end(t.length-1))&&this.sourceUpdater_.setDuration(t.end(t.length-1))):void 0}e=this.tech_.buffered(),t=nl.Playlist.duration(this.masterPlaylistLoader_.media()),0<e.length&&(t=Math.max(t,e.end(e.length-1))),this.mediaSource.duration!==t&&this.sourceUpdater_.setDuration(t)},n.dispose=function(){var e=this;this.trigger("dispose"),this.decrypter_.terminate(),this.masterPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach((function(t){var n,i=e.mediaTypes_[t].groups;
2for(n in i)i[n].forEach((function(e){e.playlistLoader&&e.playlistLoader.dispose()}))})),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()},n.master=function(){return this.masterPlaylistLoader_.master},n.media=function(){return this.masterPlaylistLoader_.media()||this.initialMedia_},n.areMediaTypesKnown_=function(){var e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_();return e=!e||!!this.audioSegmentLoader_.getCurrentMediaInfo_(),t&&e},n.getCodecsOrExclude_=function(){var e=this,t={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}};t.video=t.main;var n=ru(this.master(),this.media()),a={},r=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(t.main.hasVideo&&(a.video=n.video||t.main.videoCodec||"avc1.4d400d"),t.main.isMuxed&&(a.video+=","+(n.audio||t.main.audioCodec||er)),(t.main.hasAudio&&!t.main.isMuxed||t.audio.hasAudio||r)&&(a.audio=n.audio||t.main.audioCodec||t.audio.audioCodec||er,t.audio.isFmp4=(t.main.hasAudio&&!t.main.isMuxed?t.main:t.audio).isFmp4),a.audio||a.video){var s,i,o={};if(["video","audio"].forEach((function(e){var i;a.hasOwnProperty(e)&&!(t[e].isFmp4?Wn:zn)(i=a[e])&&(i=t[e].isFmp4?"browser":"muxer",o[i]=o[i]||[],o[i].push(a[e]),"audio"===e&&(s=i))})),r&&s&&this.media().attributes.AUDIO&&(i=this.media().attributes.AUDIO,this.master().playlists.forEac
2h((function(t){(t.attributes&&t.attributes.AUDIO)===i&&t!==e.media()&&(t.excludeUntil=1/0)})),this.logger_("excluding audio group "+i+" as "+s+' does not support codec(s): "'+a.audio+'"')),!Object.keys(o).length){if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){var u=[];if(["video","audio"].forEach((function(t){var n=(Hn(e.sourceUpdater_.codecs[t]||"")[0]||{}).type,i=(Hn(a[t]||"")[0]||{}).type;n&&i&&n.toLowerCase()!==i.toLowerCase()&&u.push('"'+e.sourceUpdater_.codecs[t]+'" -> "'+a[t]+'"')})),u.length)return void this.blacklistCurrentPlaylist({playlist:this.media(),message:"Codec switching not supported: "+u.join(", ")+".",blacklistDuration:1/0,internal:!0})}return a}r=Object.keys(o).reduce((function(e,t){return e&&(e+=", "),e+(t+' does not support codec(s): "')+o[t].join(",")+'"'}),"")+".",this.blacklistCurrentPlaylist({playlist:this.media(),internal:!0,message:r,blacklistDuration:1/0})}else this.blacklistCurrentPlaylist({playlist:this.media(),message:"Could not determine codecs for playlist.",blacklistDuration:1/0})},n.tryToCreateSourceBuffers_=function(){var e;"open"!==this.mediaSource.readyState||this.sourceUpdater_.hasCreatedSourceBuffers()||!this.areMediaTypesKnown_()||(e=this.getCodecsOrExclude_())&&(this.sourceUpdater_.createSourceBuffers(e),e=[e.video,e.audio].filter(Boolean).join(","),this.excludeIncompatibleVariants_(e))},n.excludeUnsupportedVariants_=function(){var e=this,t=this.master().playlists,a=[];Object.keys(t).forEach((function(n){var r,i=t[n];-1===a.indexOf(i.id)&&(a.push(i.id),r=[],!(n=ru(e.master,i)).audio||zn(n.audio)||Wn(n.audio)||r.push("audio codec "+n.audio),!n.video||zn(n.video)||Wn(n.video)||r.push("video codec "+n.video),n.text&&"stpp.ttml.im1t"===n.text&&r.push("text codec "+n.text),r.length&&(i.excludeUntil=1/0,e.logger_("excluding "+i.id+" for unsupported: "+r.join(", "))))}))},n.excludeIncompatibleVariants_=function(e){var t=this,a=[],s=this.master().playlists,n=nu(e=iu(Hn(e))),u=e.video&&Hn(e.video)[0]||null,r=e.audio&&Hn(e.audio)[0]||null;Object.keys(s).forEach((function(e){var o,i,l=s[e];-1===a.indexOf(l.id)&&l.excludeUntil!==1/0&&(a.push(l.id),o=[],e=nu(i=ru(t.masterPlaylistLoader_.master,l)),(i.audio||i.video)&&(e!==n&&o.push('codec count "'+e+'" !== "'+n+'"'),t.sourceUpdater_.canChangeType()||(e=i.video&&Hn(i.video)[0]||null,i=i.audio&&Hn(i.audio)[0]||null,e&&u&&e.type.toLowerCase()!==u.type.toLowerCase()&&o.push('video codec "'+e.type+'" !== "'+u.type+'"'),i&&r&&i.type.toLowerCase()!==r.type.toLowerCase()&&o.push('audio codec "'+i.type+'" !== "'+r.type+'"')),o.length&&(l.excludeUntil=1/0,t.logger_("blacklisting "+l.id+": "+o.join(" && ")))))}))},n.updateAdCues_=function(e){var t=0,i=this.seekable();i.length&&(t=i.start(0)),function(e,t,i){if(void 0===i&&(i=0),e.segments)for(var n=i,r=0;r<e.segments.length;r++){var a,s,l,u=e.segments[r];if(l=l||function(e,t){for(var i=e.cues,n=0;n<i.length;n++){var r=i[n];if(t>=r.adStartTime&&t<=r.adEndTime)return r}return null}(t,n+u.duration/2)){if("cueIn"in u){l.endTime=n,l.adEndTime=n,n+=u.duration,l=null;continue}if(n<l.endTime){n+=u.duration;continue}l.endTime+=u.duration}else"cueOut"in u&&((l=new o.VTTCue(n,n+u.duration,u.cueOut)).adStartTime=n,l.adEndTime=n+parseFloat(u.cueOut),t.addCue(l)),"cueOutCont"in u&&(a=(s=u.cueOutCont.split("/").map(parseFloat))[0],s=s[1],(l=new o.VTTCue(n,n+u.duration,"")).adStartTime=n-a,l.adEndTime=l.adStartTime+s,t.addCue(l));n+=u.duration}}(e,this.cueTagsTrack_,t)},n.goalBufferLength=function(){var e=this.tech_.currentTime(),t=Lu.GOAL_BUFFER_LENGTH,i=Lu.GOAL_BUFFER_LENGTH_RATE,n=Math.max(t,Lu.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*i,n)},n.bufferLowWaterLine=function(){var e=this.tech_.currentTime(),t=Lu.BUFFER_LOW_WATER_LINE,i=Lu.BUFFER_LOW_WATER_LINE_RATE,n=Math.max(t,Lu.MAX_BUFFER_LOW_WATER_LINE),r=Math.max(t,Lu.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*i,this.experimentalBufferBasedABR?r:n)},n.bufferHighWaterLine=function(){return Lu.BUFFER_HIGH_WATER_LINE},t}(xn.EventTarget),Al=["seeking","seeked","pause","playing","error"],xl=function(){function e(e){var t=this;function i(){return t.monitorCurrentTime_()}function n(){return t.monitorCurrentTime_()}function r(){return t.techWaiting_()}function a(){return t.cancelTimer_()}function s(){return t.fixesBadSeeks_()}this.masterPlaylistController_=e.masterPlaylistController,this.tech_=e.tech,this.seekable=e.seekable,this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta,this.media=e.media,this.consecutiveUpdates=0,this.lastRecordedTime=null,this.timer_=null,this.checkCurrentTimeTimeout_=null,this.logger_=Vs("PlaybackWatcher"),this.logger_("initialize");var l=this.masterPlaylistController_,u=["main","subtitle","audio"],c={};u.forEach((function(e){c[e]={reset:function(){return t.resetSegmentDownloads_(e)},updateend:function(){return t.checkSegmentDownloads_(e)}},l[e+"SegmentLoader_"].on("appendsdone",c[e].updateend),l[e+"SegmentLoader_"].on("playlistupdate",c[e].reset),t.tech_.on(["seeked","seeking"],c[e].reset)})),this.tech_.on("seekablechanged",s),this.tech_.on("waiting",r),this.tech_.on(Al,a),this.tech_.on("canplay",n),this.tech_.one("play",i),this.dispose=function(){t.logger_("dispose"),t.tech_.off("seekablechanged",s),t.tech_.off("waiting",r),t.tech_.off(Al,a),t.tech_.off("canplay",n),t.tech_.off("play",i),u.forEach((function(e){l[e+"SegmentLoader_"].off("appendsdone",c[e].updateend),l[e+"SegmentLoader_"].off("playlistupdate",c[e].reset),t.tech_.off(["seeked","seeking"],c[e].reset)})),t.checkCurrentTimeTimeout_&&o.clearTimeout(t.checkCurrentTimeTimeout_),t.cancelTimer_()}}var t=e.prototype;return t.monitorCurrentTime_=function(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&o.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=o.setTimeout(this.monitorCurrentTime_.bind(this),250)},t.resetSegmentDownloads_=function(e){var t=this.masterPlaylistController_[e+"SegmentLoader_"];0<this[e+"StalledDownloads_"]&&this.logger_("resetting possible stalled download count for "+e+" loader"),this[e+"StalledDownloads_"]=0,this[e+"Buffered_"]=t.buffered_()},t.checkSegmentDownloads_=function(e){var t=this.masterPlaylistController_,i=t[e+"SegmentLoader_"],n=i.buffered_(),r=function(e,t){if(e===t)return!1;if(!e&&t||!t&&e)return!0;
2if(e.length!==t.length)return!0;for(var i=0;i<e.length;i++)if(e.start(i)!==t.start(i)||e.end(i)!==t.end(i))return!0;return!1}(this[e+"Buffered_"],n);this[e+"Buffered_"]=n,r?this.resetSegmentDownloads_(e):(this[e+"StalledDownloads_"]++,this.logger_("found #"+this[e+"StalledDownloads_"]+" "+e+" appends that did not increase buffer (possible stalled download)",{playlistId:i.playlist_&&i.playlist_.id,buffered:Ks(n)}),this[e+"StalledDownloads_"]<10||(this.logger_(e+" loader stalled download exclusion"),this.resetSegmentDownloads_(e),this.tech_.trigger({type:"usage",name:"vhs-"+e+"-download-exclusion"}),"subtitle"!==e&&t.blacklistCurrentPlaylist({message:"Excessive "+e+" segment downloading detected."},1/0)))},t.checkCurrentTime_=function(){if(this.tech_.seeking()&&this.fixesBadSeeks_())return this.consecutiveUpdates=0,void(this.lastRecordedTime=this.tech_.currentTime());if(!this.tech_.paused()&&!this.tech_.seeking()){var e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+.1>=t.end(t.length-1)))return this.techWaiting_();5<=this.consecutiveUpdates&&e===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):e===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=e)}},t.cancelTimer_=function(){this.consecutiveUpdates=0,this.timer_&&(this.logger_("cancelTimer_"),clearTimeout(this.timer_)),this.timer_=null},t.fixesBadSeeks_=function(){if(!this.tech_.seeking())return!1;var e,t=this.seekable(),i=this.tech_.currentTime();if(this.afterSeekableWindow_(t,i,this.media(),this.allowSeeksWithinUnsafeLiveWindow)&&(e=t.end(t.length-1)),void 0!==(e=this.beforeSeekableWindow_(t,i)?(r=t.start(0))+(r===t.end(0)?0:.1):e))return this.logger_("Trying to seek outside of seekable at time "+i+" with seekable range "+Xs(t)+". Seeking to "+e+"."),this.tech_.setCurrentTime(e),!0;var n,r,a=this.tech_.buffered();return r=(n={buffered:a,targetDuration:this.media().targetDuration,currentTime:i}).buffered,t=n.targetDuration,n=n.currentTime,!(!r.length||r.end(0)-r.start(0)<2*t||n>r.start(0))&&r.start(0)-n<t&&(e=a.start(0)+.1,this.logger_("Buffered region starts ("+a.start(0)+") just beyond seek point ("+i+"). Seeking to "+e+"."),this.tech_.setCurrentTime(e),!0)},t.waiting_=function(){var e,t;this.techWaiting_()||(e=this.tech_.currentTime(),(t=zs(t=this.tech_.buffered(),e)).length&&e+3<=t.end(0)&&(this.cancelTimer_(),this.tech_.setCurrentTime(e),this.logger_("Stopped at "+e+" while inside a buffered region ["+t.start(0)+" -> "+t.end(0)+"]. Attempting to resume playback by seeking to the current time."),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"}),this.tech_.trigger({type:"usage",name:"hls-unknown-waiting"})))},t.techWaiting_=function(){var e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking()&&this.fixesBadSeeks_())return!0;if(this.tech_.seeking()||null!==this.timer_)return!0;if(this.beforeSeekableWindow_(e,t)){var i=e.end(e.length-1);return this.logger_("Fell out of live window at time "+t+". Seeking to live point (seekable end) "+i),this.cancelTimer_(),this.tech_.setCurrentTime(i),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),this.tech_.trigger({type:"usage",name:"hls-live-resync"}),!0}return e=this.tech_.vhs.masterPlaylistController_.sourceUpdater_,i=this.tech_.buffered(),this.videoUnderflow_({audioBuffered:e.audioBuffered(),videoBuffered:e.videoBuffered(),currentTime:t})?(this.cancelTimer_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),this.tech_.trigger({type:"usage",name:"hls-video-underflow"}),!0):0<(e=Gs(i,t)).length&&(i=e.start(0)-t,this.logger_("Stopped at "+t+", setting timer for "+i+", seeking to "+e.start(0)),this.cancelTimer_(),this.timer_=setTimeout(this.skipTheGap_.bind(this),1e3*i,t),!0)},t.afterSeekableWindow_=function(e,t,i,n){if(void 0===n&&(n=!1),!e.length)return!1;var r=e.end(e.length-1)+.1;return(r=!i.endList&&n?e.end(e.length-1)+3*i.targetDuration:r)<t},t.beforeSeekableWindow_=function(e,t){return!!(e.length&&0<e.start(0)&&t<e.start(0)-this.liveRangeSafeTimeDelta)},t.videoUnderflow_=function(e){var t,i,n=e.videoBuffered,r=e.audioBuffered,a=e.currentTime;if(n)return n.length&&r.length?(i=zs(n,a-3),e=zs(n,a),(r=zs(r,a)).length&&!e.length&&i.length&&(t={start:i.end(0),end:r.end(0)})):Gs(n,a).length||(t=this.gapFromVideoUnderflow_(n,a)),!!t&&(this.logger_("Encountered a gap in video from "+t.start+" to "+t.end+". Seeking to current time "+a),!0)},t.skipTheGap_=function(e){var t=this.tech_.buffered(),i=this.tech_.currentTime();t=Gs(t,i),this.cancelTimer_(),0!==t.length&&i===e&&(this.logger_("skipTheGap_:","currentTime:",i,"scheduled currentTime:",e,"nextRange start:",t.start(0)),this.tech_.setCurrentTime(t.start(0)+Tu),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"}),this.tech_.trigger({type:"usage",name:"hls-gap-skip"}))}
2,t.gapFromVideoUnderflow_=function(e,t){for(var i=function(e){if(e.length<2)return xn.createTimeRanges();for(var t=[],i=1;i<e.length;i++){var n=e.end(i-1),r=e.start(i);t.push([n,r])}return xn.createTimeRanges(t)}(e),n=0;n<i.length;n++){var r=i.start(n),a=i.end(n);if(t-r<4&&2<t-r)return{start:r,end:a}}return null},e}(),Pl={errorInterval:30,getSource:function(e){return e(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource())}},Ll=(K=function(e){il(this,e)},{PlaylistLoader:wu,Playlist:Eu,utils:oi,STANDARD_PLAYLIST_SELECTOR:Qt,INITIAL_PLAYLIST_SELECTOR:function(){var e=this,t=this.playlists.master.playlists.filter(Eu.isEnabled);return ou(t,uu),t.filter((function(t){return!!ru(e.playlists.master,t).video}))[0]||null},lastBandwidthSelector:Qt,movingAverageBandwidthSelector:function(e){var i=-1,t=-1;if(e<0||1<e)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){var n=this.useDevicePixelRatio&&o.devicePixelRatio||1;return i<0&&(i=this.systemBandwidth,t=this.systemBandwidth),0<this.systemBandwidth&&this.systemBandwidth!==t&&(i=e*this.systemBandwidth+(1-e)*i,t=this.systemBandwidth),lu(this.playlists.master,i,parseInt(su(this.tech_.el(),"width"),10)*n,parseInt(su(this.tech_.el(),"height"),10)*n,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)}},comparePlaylistBandwidth:uu,comparePlaylistResolution:function(e,t){var i,n;return(i=(i=e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width?e.attributes.RESOLUTION.width:i)||o.Number.MAX_VALUE)===(n=(n=t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width?t.attributes.RESOLUTION.width:n)||o.Number.MAX_VALUE)&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH?e.attributes.BANDWIDTH-t.attributes.BANDWIDTH:i-n},xhr:ko()});function Dl(e,t){for(var i=t.media(),n=-1,r=0;r<e.length;r++)if(e[r].id===i.id){n=r;break}e.selectedIndex_=n,e.trigger({selectedIndex:n,type:"change"})}Object.keys(Lu).forEach((function(e){Object.defineProperty(Ll,e,{get:function(){return xn.log.warn("using Vhs."+e+" is UNSAFE be sure you know what you are doing"),Lu[e]},set:function(t){xn.log.warn("using Vhs."+e+" is UNSAFE be sure you know what you are doing"),"number"!=typeof t||t<0?xn.log.warn("value of Vhs."+e+" must be greater than or equal to 0"):Lu[e]=t}})}));var Ol="videojs-vhs";function Rl(e){var t=e.player,n=e.sourceKeySystems,i=e.audioMedia;if(e=e.mainPlaylists,!t.eme.initializeMediaKeys)return Promise.resolve();e=e=i?e.concat([i]):e,r=Object.keys(n),e=e.reduce((function(e,t){if(!t.contentProtection)return e;var n=r.reduce((function(e,n){var i=t.contentProtection[n];return i&&i.pssh&&(e[n]={pssh:i.pssh}),e}),{});return Object.keys(n).length&&e.push(n),e}),[]);var r,a=[],s=[];return e.forEach((function(e){s.push(new Promise((function(e,n){t.tech_.one("keysessioncreated",e)}))),a.push(new Promise((function(n,i){t.eme.initializeMediaKeys({keySystems:e},(function(e){e?i(e):n()}))})))})),Promise.race([Promise.all(a),Promise.race(s)])}function Ml(e){var t=e.player;return!(!(e=function(e,t,i){if(!e)return e;var n={};t&&t.attributes&&t.attributes.CODECS&&(n=iu(Hn(t.attributes.CODECS))),i&&i.attributes&&i.attributes.CODECS&&(n.audio=i.attributes.CODECS);var r,a=Vn(n.video),s=Vn(n.audio),o={};for(r in e)o[r]={},s&&(o[r].audioContentType=s),a&&(o[r].videoContentType=a),t.contentProtection&&t.contentProtection[r]&&t.contentProtection[r].pssh&&(o[r].pssh=t.contentProtection[r].pssh),"string"==typeof e[r]&&(o[r].url=e[r]);return xn.mergeOptions(e,o)}(e.sourceKeySystems,e.media,e.audioMedia))||(t.currentSource().keySystems=e)&&!t.eme&&(xn.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),1))}function Nl(){if(!o.localStorage)return null;var e=o.localStorage.getItem(Ol);if(!e)return null;try{return JSON.parse(e)}catch(e){return null}}Ll.canPlaySource=function(){return xn.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")},Ll.supportsNativeHls=function(){if(!d||!d.createElement)return!1;var e=d.createElement("video");return!!xn.getTech("Html5").isSupported()&&["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some((function(t){return/maybe|probably/i.test(e.canPlayType(t))}))}(),Ll.supportsNativeDash=!!(d&&d.createElement&&xn.getTech("Html5").isSupported())&&/maybe|probably/i.test(d.createElement("video").canPlayType("application/d
2ash+xml")),Ll.supportsTypeNatively=function(e){return"hls"===e?Ll.supportsNativeHls:"dash"===e&&Ll.supportsNativeDash},Ll.isSupported=function(){return xn.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var Ul=function(e){function t(t,n,i){var r=e.call(this,n,xn.mergeOptions(i.hls,i.vhs))||this;if(i.hls&&Object.keys(i.hls).length&&xn.log.warn("Using hls options is deprecated. Use vhs instead."),"number"==typeof i.initialBandwidth&&(r.options_.bandwidth=i.initialBandwidth),r.logger_=Vs("VhsHandler"),n.options_&&n.options_.playerId&&((i=xn(n.options_.playerId)).hasOwnProperty("hls")||Object.defineProperty(i,"hls",{get:function(){return xn.log.warn("player.hls is deprecated. Use player.tech().vhs instead."),n.trigger({type:"usage",name:"hls-player-access"}),yt(r)},configurable:!0}),i.hasOwnProperty("vhs")||Object.defineProperty(i,"vhs",{get:function(){return xn.log.warn("player.vhs is deprecated. Use player.tech().vhs instead."),n.trigger({type:"usage",name:"vhs-player-access"}),yt(r)},configurable:!0}),i.hasOwnProperty("dash")||Object.defineProperty(i,"dash",{get:function(){return xn.log.warn("player.dash is deprecated. Use player.tech().vhs instead."),yt(r)},configurable:!0}),r.player_=i),r.tech_=n,r.source_=t,r.stats={},r.ignoreNextSeekingEvent_=!1,r.setOptions_(),r.options_.overrideNative&&n.overrideNativeAudioTracks&&n.overrideNativeVideoTracks)n.overrideNativeAudioTracks(!0),n.overrideNativeVideoTracks(!0);else if(r.options_.overrideNative&&(n.featuresNativeVideoTracks||n.featuresNativeAudioTracks))throw new Error("Overriding native HLS requires emulated tracks. See https://git.io/vMpjB");return r.on(d,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],(function(e){var t=d.fullscreenElement||d.webkitFullscreenElement||d.mozFullScreenElement||d.msFullscreenElement;t&&t.contains(r.tech_.el())?r.masterPlaylistController_.fastQualityChange_():r.masterPlaylistController_.checkABR_()})),r.on(r.tech_,"seeking",(function(){this.ignoreNextSeekingEvent_?this.ignoreNextSeekingEvent_=!1:this.setCurrentTime(this.tech_.currentTime())})),r.on(r.tech_,"error",(function(){this.tech_.error()&&this.masterPlaylistController_&&this.masterPlaylistController_.pauseLoading()})),r.on(r.tech_,"play",r.play),r}vt(t,e);var n=t.prototype;return n.setOptions_=function(){var e,t=this;this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.handleManifestRedirects=!1!==this.options_.handleManifestRedirects,this.options_.limitRenditionByPlayerDimensions=!1!==this.options_.limitRenditionByPlayerDimensions,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.smoothQualityChange=this.options_.smoothQualityChange||!1,this.options_.useBandwidthFromLocalStorage=void 0!==this.source_.useBandwidthFromLocalStorage?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,"number"!=typeof this.options_.blacklistDuration&&(this.options_.blacklistDuration=300),"number"!=typeof this.options_.bandwidth&&this.options_.useBandwidthFromLocalStorage&&((e=Nl())&&e.bandwidth&&(this.options_.bandwidth=e.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"}),this.tech_.trigger({type:"usage",name:"hls-bandwidth-from-local-storage"})),e&&e.throughput&&(this.options_.throughput=e.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}),this.tech_.trigger({type:"usage",name:"hls-throughput-from-local-storage"}))),"number"!=typeof this.options_.bandwidth&&(this.options_.bandwidth=Lu.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===Lu.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","limitRenditionByPlayerDimensions","bandwidth","smoothQualityChange","customTagParsers","customTagMappers","handleManifestRedirects","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","experimentalBufferBasedABR","liveRangeSafeTimeDelta","experimentalLLHLS","experimentalExactManifestTimings","experimentalLeastPixelDiffSelector"].forEach((function(e){void 0!==t.source_[e]&&(t.options_[e]=t.source_[e])})),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio},n.src=function(e,t){var n=this;e&&(this.setOptions_(),this.options_.src=0===(e=this.source_.src).toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")?JSON.parse(e.substring(e.indexOf(",")+1)):e,this.options_.tech=this.tech_,this.options_.externVhs=Ll,this.options_.sourceType=Gn(t),this.options_.seekTo=function(e){n.tech_.setCurrentTime(e)},this.options_.smoothQualityChange&&xn.log.warn("smoothQualityChange is deprecated and will be removed in the next major version"),this.masterPlaylistController_=new Il(this.options_),t=xn.mergeOptions({liveRangeSafeTimeDelta:.1},this.options_,{seekable:function(){return n.seekable()},media:function(){return n.masterPlaylistController_.media()},masterPlaylistController:this.masterPlaylistController_}),this.playbackWatcher_=new xl(t),this.masterPlaylistController_.on("error",(function(){var e=xn.players[n.tech_.options_.playerId],t=n.masterPlaylistController_.error;"object"!=typeof t||t.code?"string"==typeof t&&(t={message:t,code:3}):t.code=3,e.error(t)})),t=this.options_.experimentalBufferBasedABR?Ll.movingAverageBandwidthSelector(.55):Ll.STANDARD_PLAYLIST_SELECTOR,this.masterPlaylistController_.selectPlaylist=(this.selectPlaylist||t).bind(this),this.masterPlaylistController_.selectInitialPlaylist=Ll.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.masterPlaylistController_.masterPlaylistLoader_,this.mediaSource=this.masterPlaylistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get:function(){return this.masterPlaylistController_.selectPlaylist},set:function(e){this.masterPlaylistController_.selectPlaylist=e.bind(this)}},throughput:{get:function(){return this.masterPlaylistController_.mainSegmentLoader_.throughput.rate},set:function(e){this.masterPlaylistController_.mainSegmentLoader_.throughput.rate=e,this.masterPlaylistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get:function(){return this.masterPlaylistController_.mainSegmentLoader_.bandwidth}
2,set:function(e){this.masterPlaylistController_.mainSegmentLoader_.bandwidth=e,this.masterPlaylistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get:function(){var e=1/(this.bandwidth||1),t=0<this.throughput?1/this.throughput:0;return Math.floor(1/(e+t))},set:function(){xn.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:function(){return n.bandwidth||0},enumerable:!0},mediaRequests:{get:function(){return n.masterPlaylistController_.mediaRequests_()||0},enumerable:!0},mediaRequestsAborted:{get:function(){return n.masterPlaylistController_.mediaRequestsAborted_()||0},enumerable:!0},mediaRequestsTimedout:{get:function(){return n.masterPlaylistController_.mediaRequestsTimedout_()||0},enumerable:!0},mediaRequestsErrored:{get:function(){return n.masterPlaylistController_.mediaRequestsErrored_()||0},enumerable:!0},mediaTransferDuration:{get:function(){return n.masterPlaylistController_.mediaTransferDuration_()||0},enumerable:!0},mediaBytesTransferred:{get:function(){return n.masterPlaylistController_.mediaBytesTransferred_()||0},enumerable:!0},mediaSecondsLoaded:{get:function(){return n.masterPlaylistController_.mediaSecondsLoaded_()||0},enumerable:!0},mediaAppends:{get:function(){return n.masterPlaylistController_.mediaAppends_()||0},enumerable:!0},mainAppendsToLoadedData:{get:function(){return n.masterPlaylistController_.mainAppendsToLoadedData_()||0},enumerable:!0},audioAppendsToLoadedData:{get:function(){return n.masterPlaylistController_.audioAppendsToLoadedData_()||0},enumerable:!0},appendsToLoadedData:{get:function(){return n.masterPlaylistController_.appendsToLoadedData_()||0},enumerable:!0},timeToLoadedData:{get:function(){return n.masterPlaylistController_.timeToLoadedData_()||0},enumerable:!0},buffered:{get:function(){return Ks(n.tech_.buffered())},enumerable:!0},currentTime:{get:function(){return n.tech_.currentTime()},enumerable:!0},currentSource:{get:function(){return n.tech_.currentSource_},enumerable:!0},currentTech:{get:function(){return n.tech_.name_},enumerable:!0},duration:{get:function(){return n.tech_.duration()},enumerable:!0},master:{get:function(){return n.playlists.master},enumerable:!0},playerDimensions:{get:function(){return n.tech_.currentDimensions()},enumerable:!0},seekable:{get:function(){return Ks(n.tech_.seekable())},enumerable:!0},timestamp:{get:function(){return Date.now()},enumerable:!0},videoPlaybackQuality:{get:function(){return n.tech_.getVideoPlaybackQuality()},enumerable:!0}}),this.tech_.one("canplay",this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_)),this.tech_.on("bandwidthupdate",(function(){n.options_.useBandwidthFromLocalStorage&&function(e){if(o.localStorage){var t=(t=Nl())?xn.mergeOptions(t,e):e;try{o.localStorage.setItem(Ol,JSON.stringify(t))}catch(e){return}}}({bandwidth:n.bandwidth,throughput:Math.round(n.throughput)})})),this.masterPlaylistController_.on("selectedinitialmedia",(function(){var i;(i=n).representations=function(){var e;return(e=ho(e=i.masterPlaylistController_.master())?i.masterPlaylistController_.getAudioTrackPlaylists_():e.playlists)?e.filter((function(e){return!ao(e)})).map((function(e,t){return new tl(i,e,e.id)})):[]}})),this.masterPlaylistController_.sourceUpdater_.on("createdsourcebuffers",(function(){n.setupEme_()})),this.on(this.masterPlaylistController_,"progress",(function(){this.tech_.trigger("progress")})),this.on(this.masterPlaylistController_,"firstplay",(function(){this.ignoreNextSeekingEvent_=!0})),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=o.URL.createObjectURL(this.masterPlaylistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_)))},n.setupEme_=function(){var e=this,t=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader,i=Ml({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:t&&t.media()});this.player_.tech_.on("keystatuschange",(function(t){"output-restricted"===t.status&&e.masterPlaylistController_.blacklistCurrentPlaylist({playlist:e.masterPlaylistController_.media(),message:"DRM keystatus changed to "+t.status+". Playlist will fail to play. Check for HDCP content.",blacklistDuration:1/0})})),11!==xn.browser.IE_VERSION&&i?(this.logger_("waiting for EME key session creation"),Rl({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:t&&t.media(),mainPlaylists:this.playlists.master.playlists}).then((function(){e.logger_("created EME key session"),e.masterPlaylistController_.sourceUpdater_.initializedEme()})).catch((function(t){e.logger_("error while creating EME key session",t),e.player_.error({message:"Failed to initialize media ke
2ys for EME",code:3})}))):this.masterPlaylistController_.sourceUpdater_.initializedEme()},n.setupQualityLevels_=function(){var i=this,e=xn.players[this.tech_.options_.playerId];e&&e.qualityLevels&&!this.qualityLevels_&&(this.qualityLevels_=e.qualityLevels(),this.masterPlaylistController_.on("selectedinitialmedia",(function(){var e,t;e=i.qualityLevels_,(t=i).representations().forEach((function(t){e.addQualityLevel(t)})),Dl(e,t.playlists)})),this.playlists.on("mediachange",(function(){Dl(i.qualityLevels_,i.playlists)})))},t.version=function(){return{"@videojs/http-streaming":"2.10.2","mux.js":"5.13.0","mpd-parser":"0.19.0","m3u8-parser":"4.7.0","aes-decrypter":"3.1.2"}},n.version=function(){return this.constructor.version()},n.canChangeType=function(){return ml.canChangeType()},n.play=function(){this.masterPlaylistController_.play()},n.setCurrentTime=function(e){this.masterPlaylistController_.setCurrentTime(e)},n.duration=function(){return this.masterPlaylistController_.duration()},n.seekable=function(){return this.masterPlaylistController_.seekable()},n.dispose=function(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.masterPlaylistController_&&this.masterPlaylistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.player_&&(delete this.player_.vhs,delete this.player_.dash,delete this.player_.hls),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.tech_&&delete this.tech_.hls,this.mediaSourceUrl_&&o.URL.revokeObjectURL&&(o.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),e.prototype.dispose.call(this)},n.convertToProgramTime=function(e,t){return Do({playlist:this.masterPlaylistController_.media(),time:e,callback:t})},n.seekToProgramTime=function(e,t,i,n){return void 0===i&&(i=!0),void 0===n&&(n=2),Oo({programTime:e,playlist:this.masterPlaylistController_.media(),retryCount:n,pauseAfterSeek:i,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})},t}(xn.getComponent("Component")),Bl={name:"videojs-http-streaming",VERSION:"2.10.2",canHandleSource:function(e,t){return t=xn.mergeOptions(xn.options,t=void 0===t?{}:t),Bl.canPlayType(e.type,t)},handleSource:function(e,t,i){return i=xn.mergeOptions(xn.options,i=void 0===i?{}:i),t.vhs=new Ul(e,t,i),xn.hasOwnProperty("hls")||Object.defineProperty(t,"hls",{get:function(){return xn.log.warn("player.tech().hls is deprecated. Use player.tech().vhs instead."),t.vhs},configurable:!0}),t.vhs.xhr=ko(),t.vhs.src(e.src,e.type),t.vhs},canPlayType:function(e,t){return t=void 0===(t=xn.mergeOptions(xn.options,t=void 0===t?{}:t).vhs.overrideNative)?!xn.browser.IS_ANY_SAFARI:t,!(e=Gn(e))||Ll.supportsTypeNatively(e)&&!t?"":"maybe"}};return Wn("avc1.4d400d,mp4a.40.2")&&xn.getTech("Html5").registerSourceHandler(Bl,0),xn.VhsHandler=Ul,Object.defineProperty(xn,"HlsHandler",{get:function(){return xn.log.warn("videojs.HlsHandler is deprecated. Use videojs.VhsHandler instead."),Ul},configurable:!0}),xn.VhsSourceHandler=Bl,Object.defineProperty(xn,"HlsSourceHandler",{get:function(){return xn.log.warn("videojs.HlsSourceHandler is deprecated. Use videojs.VhsSourceHandler instead."),Bl},configurable:!0}),xn.Vhs=Ll,Object.defineProperty(xn,"Hls",{get:function(){return xn.log.warn("videojs.Hls is deprecated. Use videojs.Vhs instead."),Ll},configurable:!0}),xn.use||(xn.registerComponent("Hls",Ll),xn.registerComponent("Vhs",Ll)),xn.options.vhs=xn.options.vhs||{},xn.options.hls=xn.options.hls||{},xn.registerPlugin?xn.registerPlugin("reloadSourceOnError",K):xn.plugin("reloadSourceOnError",K),xn}()}).call(this,n(52),n(1313).Buffer)}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.