/*! For license information please see dash.all.min.js.LICENSE.txt */ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.dashjs=e():t.dashjs=e()}(self,(function(){return function(){var t={7267:function(t,e){"use strict";e.byteLength=function(t){var e=l(t),n=e[0],a=e[1];return 3*(n+a)/4-a},e.toByteArray=function(t){var e,n,i=l(t),o=i[0],s=i[1],u=new r(function(t,e,n){return 3*(e+n)/4-n}(0,o,s)),c=0,d=s>0?o-4:o;for(n=0;n>16&255,u[c++]=e>>8&255,u[c++]=255&e;return 2===s&&(e=a[t.charCodeAt(n)]<<2|a[t.charCodeAt(n+1)]>>4,u[c++]=255&e),1===s&&(e=a[t.charCodeAt(n)]<<10|a[t.charCodeAt(n+1)]<<4|a[t.charCodeAt(n+2)]>>2,u[c++]=e>>8&255,u[c++]=255&e),u},e.fromByteArray=function(t){for(var e,a=t.length,r=a%3,i=[],o=16383,l=0,u=a-r;lu?u:l+o));return 1===r?(e=t[a-1],i.push(n[e>>2]+n[e<<4&63]+"==")):2===r&&(e=(t[a-2]<<8)+t[a-1],i.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"=")),i.join("")};for(var n=[],a=[],r="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)n[o]=i[o],a[i.charCodeAt(o)]=o;function l(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function s(t,e,a){for(var r,i,o=[],l=e;l>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return o.join("")}a["-".charCodeAt(0)]=62,a["_".charCodeAt(0)]=63},44:function(t,e,n){"use strict";var a=n(7267),r=n(7986),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=s,e.SlowBuffer=function(t){return+t!=t&&(t=0),s.alloc(+t)},e.INSPECT_MAX_BYTES=50;var o=2147483647;function l(t){if(t>o)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,s.prototype),e}function s(t,e,n){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return d(t)}return u(t,e,n)}function u(t,e,n){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!s.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var n=0|h(t,e),a=l(n),r=a.write(t,e);return r!==n&&(a=a.slice(0,r)),a}(t,e);if(ArrayBuffer.isView(t))return function(t){if(B(t,Uint8Array)){var e=new Uint8Array(t);return g(e.buffer,e.byteOffset,e.byteLength)}return f(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(B(t,ArrayBuffer)||t&&B(t.buffer,ArrayBuffer))return g(t,e,n);if("undefined"!=typeof SharedArrayBuffer&&(B(t,SharedArrayBuffer)||t&&B(t.buffer,SharedArrayBuffer)))return g(t,e,n);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var a=t.valueOf&&t.valueOf();if(null!=a&&a!==t)return s.from(a,e,n);var r=function(t){if(s.isBuffer(t)){var e=0|m(t.length),n=l(e);return 0===n.length||t.copy(n,0,0,e),n}return void 0!==t.length?"number"!=typeof t.length||q(t.length)?l(0):f(t):"Buffer"===t.type&&Array.isArray(t.data)?f(t.data):void 0}(t);if(r)return r;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return s.from(t[Symbol.toPrimitive]("string"),e,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function c(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function d(t){return c(t),l(t<0?0:0|m(t))}function f(t){for(var e=t.length<0?0:0|m(t.length),n=l(e),a=0;a=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|t}function h(t,e){if(s.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||B(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var n=t.length,a=arguments.length>2&&!0===arguments[2];if(!a&&0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return F(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return U(t).length;default:if(r)return a?-1:F(t).length;e=(""+e).toLowerCase(),r=!0}}function p(t,e,n){var a=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return C(this,e,n);case"utf8":case"utf-8":return I(this,e,n);case"ascii":return R(this,e,n);case"latin1":case"binary":return N(this,e,n);case"base64":return S(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return D(this,e,n);default:if(a)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),a=!0}}function b(t,e,n){var a=t[e];t[e]=t[n],t[n]=a}function y(t,e,n,a,r){if(0===t.length)return-1;if("string"==typeof n?(a=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),q(n=+n)&&(n=r?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(r)return-1;n=t.length-1}else if(n<0){if(!r)return-1;n=0}if("string"==typeof e&&(e=s.from(e,a)),s.isBuffer(e))return 0===e.length?-1:E(t,e,n,a,r);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):E(t,[e],n,a,r);throw new TypeError("val must be string, number or Buffer")}function E(t,e,n,a,r){var i,o=1,l=t.length,s=e.length;if(void 0!==a&&("ucs2"===(a=String(a).toLowerCase())||"ucs-2"===a||"utf16le"===a||"utf-16le"===a)){if(t.length<2||e.length<2)return-1;o=2,l/=2,s/=2,n/=2}function u(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(r){var c=-1;for(i=n;il&&(n=l-s),i=n;i>=0;i--){for(var d=!0,f=0;fr&&(a=r):a=r;var i=e.length;a>i/2&&(a=i/2);for(var o=0;o>8,r=n%256,i.push(r),i.push(a);return i}(e,t.length-n),t,n,a)}function S(t,e,n){return 0===e&&n===t.length?a.fromByteArray(t):a.fromByteArray(t.slice(e,n))}function I(t,e,n){n=Math.min(t.length,n);for(var a=[],r=e;r239?4:u>223?3:u>191?2:1;if(r+d<=n)switch(d){case 1:u<128&&(c=u);break;case 2:128==(192&(i=t[r+1]))&&(s=(31&u)<<6|63&i)>127&&(c=s);break;case 3:i=t[r+1],o=t[r+2],128==(192&i)&&128==(192&o)&&(s=(15&u)<<12|(63&i)<<6|63&o)>2047&&(s<55296||s>57343)&&(c=s);break;case 4:i=t[r+1],o=t[r+2],l=t[r+3],128==(192&i)&&128==(192&o)&&128==(192&l)&&(s=(15&u)<<18|(63&i)<<12|(63&o)<<6|63&l)>65535&&s<1114112&&(c=s)}null===c?(c=65533,d=1):c>65535&&(c-=65536,a.push(c>>>10&1023|55296),c=56320|1023&c),a.push(c),r+=d}return function(t){var e=t.length;if(e<=k)return String.fromCharCode.apply(String,t);for(var n="",a=0;aa.length?s.from(i).copy(a,r):Uint8Array.prototype.set.call(a,i,r);else{if(!s.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(a,r)}r+=i.length}return a},s.byteLength=h,s.prototype._isBuffer=!0,s.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;en&&(t+=" ... "),""},i&&(s.prototype[i]=s.prototype.inspect),s.prototype.compare=function(t,e,n,a,r){if(B(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===a&&(a=0),void 0===r&&(r=this.length),e<0||n>t.length||a<0||r>this.length)throw new RangeError("out of range index");if(a>=r&&e>=n)return 0;if(a>=r)return-1;if(e>=n)return 1;if(this===t)return 0;for(var i=(r>>>=0)-(a>>>=0),o=(n>>>=0)-(e>>>=0),l=Math.min(i,o),u=this.slice(a,r),c=t.slice(e,n),d=0;d>>=0,isFinite(n)?(n>>>=0,void 0===a&&(a="utf8")):(a=n,n=void 0)}var r=this.length-e;if((void 0===n||n>r)&&(n=r),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");a||(a="utf8");for(var i=!1;;)switch(a){case"hex":return _(this,t,e,n);case"utf8":case"utf-8":return A(this,t,e,n);case"ascii":case"latin1":case"binary":return T(this,t,e,n);case"base64":return v(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,t,e,n);default:if(i)throw new TypeError("Unknown encoding: "+a);a=(""+a).toLowerCase(),i=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var k=4096;function R(t,e,n){var a="";n=Math.min(t.length,n);for(var r=e;ra)&&(n=a);for(var r="",i=e;in)throw new RangeError("Trying to access beyond buffer length")}function M(t,e,n,a,r,i){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>r||et.length)throw new RangeError("Index out of range")}function z(t,e,n,a,r,i){if(n+a>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function O(t,e,n,a,i){return e=+e,n>>>=0,i||z(t,0,n,4),r.write(t,e,n,a,23,4),n+4}function L(t,e,n,a,i){return e=+e,n>>>=0,i||z(t,0,n,8),r.write(t,e,n,a,52,8),n+8}s.prototype.slice=function(t,e){var n=this.length;(t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e>>=0,e>>>=0,n||x(t,e,this.length);for(var a=this[t],r=1,i=0;++i>>=0,e>>>=0,n||x(t,e,this.length);for(var a=this[t+--e],r=1;e>0&&(r*=256);)a+=this[t+--e]*r;return a},s.prototype.readUint8=s.prototype.readUInt8=function(t,e){return t>>>=0,e||x(t,1,this.length),this[t]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(t,e){return t>>>=0,e||x(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(t,e){return t>>>=0,e||x(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(t,e){return t>>>=0,e||x(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(t,e){return t>>>=0,e||x(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readIntLE=function(t,e,n){t>>>=0,e>>>=0,n||x(t,e,this.length);for(var a=this[t],r=1,i=0;++i=(r*=128)&&(a-=Math.pow(2,8*e)),a},s.prototype.readIntBE=function(t,e,n){t>>>=0,e>>>=0,n||x(t,e,this.length);for(var a=e,r=1,i=this[t+--a];a>0&&(r*=256);)i+=this[t+--a]*r;return i>=(r*=128)&&(i-=Math.pow(2,8*e)),i},s.prototype.readInt8=function(t,e){return t>>>=0,e||x(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},s.prototype.readInt16LE=function(t,e){t>>>=0,e||x(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt16BE=function(t,e){t>>>=0,e||x(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt32LE=function(t,e){return t>>>=0,e||x(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return t>>>=0,e||x(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readFloatLE=function(t,e){return t>>>=0,e||x(t,4,this.length),r.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return t>>>=0,e||x(t,4,this.length),r.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return t>>>=0,e||x(t,8,this.length),r.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return t>>>=0,e||x(t,8,this.length),r.read(this,t,!1,52,8)},s.prototype.writeUintLE=s.prototype.writeUIntLE=function(t,e,n,a){t=+t,e>>>=0,n>>>=0,a||M(this,t,e,n,Math.pow(2,8*n)-1,0);var r=1,i=0;for(this[e]=255&t;++i>>=0,n>>>=0,a||M(this,t,e,n,Math.pow(2,8*n)-1,0);var r=n-1,i=1;for(this[e+r]=255&t;--r>=0&&(i*=256);)this[e+r]=t/i&255;return e+n},s.prototype.writeUint8=s.prototype.writeUInt8=function(t,e,n){return t=+t,e>>>=0,n||M(this,t,e,1,255,0),this[e]=255&t,e+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(t,e,n){return t=+t,e>>>=0,n||M(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(t,e,n){return t=+t,e>>>=0,n||M(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(t,e,n){return t=+t,e>>>=0,n||M(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(t,e,n){return t=+t,e>>>=0,n||M(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeIntLE=function(t,e,n,a){if(t=+t,e>>>=0,!a){var r=Math.pow(2,8*n-1);M(this,t,e,n,r-1,-r)}var i=0,o=1,l=0;for(this[e]=255&t;++i>>=0,!a){var r=Math.pow(2,8*n-1);M(this,t,e,n,r-1,-r)}var i=n-1,o=1,l=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===l&&0!==this[e+i+1]&&(l=1),this[e+i]=(t/o|0)-l&255;return e+n},s.prototype.writeInt8=function(t,e,n){return t=+t,e>>>=0,n||M(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,n){return t=+t,e>>>=0,n||M(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeInt16BE=function(t,e,n){return t=+t,e>>>=0,n||M(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeInt32LE=function(t,e,n){return t=+t,e>>>=0,n||M(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},s.prototype.writeInt32BE=function(t,e,n){return t=+t,e>>>=0,n||M(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeFloatLE=function(t,e,n){return O(this,t,e,!0,n)},s.prototype.writeFloatBE=function(t,e,n){return O(this,t,e,!1,n)},s.prototype.writeDoubleLE=function(t,e,n){return L(this,t,e,!0,n)},s.prototype.writeDoubleBE=function(t,e,n){return L(this,t,e,!1,n)},s.prototype.copy=function(t,e,n,a){if(!s.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),a||0===a||(a=this.length),e>=t.length&&(e=t.length),e||(e=0),a>0&&a=this.length)throw new RangeError("Index out of range");if(a<0)throw new RangeError("sourceEnd out of bounds");a>this.length&&(a=this.length),t.length-e>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(i=e;i55295&&n<57344){if(!r){if(n>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(o+1===a){(e-=3)>-1&&i.push(239,191,189);continue}r=n;continue}if(n<56320){(e-=3)>-1&&i.push(239,191,189),r=n;continue}n=65536+(r-55296<<10|n-56320)}else r&&(e-=3)>-1&&i.push(239,191,189);if(r=null,n<128){if((e-=1)<0)break;i.push(n)}else if(n<2048){if((e-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function U(t){return a.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(P,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function j(t,e,n,a){for(var r=0;r=e.length||r>=t.length);++r)e[r+n]=t[r];return r}function B(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function q(t){return t!=t}var G=function(){for(var t="0123456789abcdef",e=new Array(256),n=0;n<16;++n)for(var a=16*n,r=0;r<16;++r)e[a+r]=t[n]+t[r];return e}()},6877:function(t,e){var n={parseBuffer:function(t){return new a(t).parse()},addBoxProcessor:function(t,e){"string"==typeof t&&"function"==typeof e&&(r.prototype._boxProcessors[t]=e)},createFile:function(){return new a},createBox:function(t,e,n){var a=r.create(t);return e&&e.append(a,n),a},createFullBox:function(t,e,a){var r=n.createBox(t,e,a);return r.version=0,r.flags=0,r},Utils:{}};n.Utils.dataViewToString=function(t,e){var n=e||"utf-8";if("undefined"!=typeof TextDecoder)return new TextDecoder(n).decode(t);var a=[],r=0;if("utf-8"===n)for(;r>6),e.push(128|63&a)):a<65536?(e.push(224|a>>12),e.push(128|63&a>>6),e.push(128|63&a)):(e.push(240|a>>18),e.push(128|63&a>>12),e.push(128|63&a>>6),e.push(128|63&a))}return e},n.Utils.appendBox=function(t,e,n){if(e._offset=t._cursor.offset,e._root=t._root?t._root:t,e._raw=t._raw,e._parent=t,-1!==n)if(null!=n){var a,r=-1;if("number"==typeof n)r=n;else{if("string"==typeof n)a=n;else{if("object"!=typeof n||!n.type)return void t.boxes.push(e);a=n.type}for(var i=0;i>3,e},r.prototype._readUint=function(t){var e,n,a=null,r=this._cursor.offset-this._raw.byteOffset;switch(t){case 8:a=this._raw.getUint8(r);break;case 16:a=this._raw.getUint16(r);break;case 24:a=((e=this._raw.getUint16(r))<<8)+(n=this._raw.getUint8(r+2));break;case 32:a=this._raw.getUint32(r);break;case 64:e=this._raw.getUint32(r),n=this._raw.getUint32(r+4),a=e*Math.pow(2,32)+n}return this._cursor.offset+=t>>3,a},r.prototype._readString=function(t){for(var e="",n=0;n0?t:this._raw.byteLength-(this._cursor.offset-this._offset);if(e>0){var n=new Uint8Array(this._raw.buffer,this._cursor.offset,e);return this._cursor.offset+=e,n}return null},r.prototype._readUTF8String=function(){var t=this._raw.byteLength-(this._cursor.offset-this._offset),e=null;return t>0&&(e=new DataView(this._raw.buffer,this._cursor.offset,t),this._cursor.offset+=t),e?n.Utils.dataViewToString(e):e},r.prototype._readUTF8TerminatedString=function(){var t=this._raw.byteLength-(this._cursor.offset-this._offset),e=null;if(t>0){var a;for(e=new DataView(this._raw.buffer,this._cursor.offset,t),a=0;athis._raw.buffer.byteLength)this._root._incomplete=!0;else{switch(this._procField("size","uint",32),this._procField("type","string",4),1===this.size&&this._procField("largesize","uint",64),"uuid"===this.type&&this._procFieldArray("usertype",16,"uint",8),this.size){case 0:this._raw=new DataView(this._raw.buffer,this._offset);break;case 1:this._offset+this.size>this._raw.buffer.byteLength?(this._incomplete=!0,this._root._incomplete=!0):this._raw=new DataView(this._raw.buffer,this._offset,this.largesize);break;default:this._offset+this.size>this._raw.buffer.byteLength?(this._incomplete=!0,this._root._incomplete=!0):this._raw=new DataView(this._raw.buffer,this._offset,this.size)}this._incomplete||(this._boxProcessors[this.type]&&this._boxProcessors[this.type].call(this),-1!==this._boxContainers.indexOf(this.type)?this._parseContainerBox():this._data=this._readData())}},r.prototype._parseFullBox=function(){this.version=this._readUint(8),this.flags=this._readUint(24)},r.prototype._parseContainerBox=function(){for(this.boxes=[];this._cursor.offset-this._raw.byteOffset>3}else this.size+=t>>3},r.prototype._writeUint=function(t,e){if(this._rawo){var n,a,r=this._cursor.offset-this._rawo.byteOffset;switch(t){case 8:this._rawo.setUint8(r,e);break;case 16:this._rawo.setUint16(r,e);break;case 24:n=(16776960&e)>>8,a=255&e,this._rawo.setUint16(r,n),this._rawo.setUint8(r+2,a);break;case 32:this._rawo.setUint32(r,e);break;case 64:a=e-(n=Math.floor(e/Math.pow(2,32)))*Math.pow(2,32),this._rawo.setUint32(r,n),this._rawo.setUint32(r+4,a)}this._cursor.offset+=t>>3}else this.size+=t>>3},r.prototype._writeString=function(t,e){for(var n=0;n>10&31),96+(this.language>>5&31),96+(31&this.language))),this._procField("pre_defined","uint",16)},r.prototype._boxProcessors.mehd=function(){this._procFullBox(),this._procField("fragment_duration","uint",1==this.version?64:32)},r.prototype._boxProcessors.meta=function(){this._procFullBox()},r.prototype._boxProcessors.mfhd=function(){this._procFullBox(),this._procField("sequence_number","uint",32)},r.prototype._boxProcessors.mfro=function(){this._procFullBox(),this._procField("mfra_size","uint",32)},r.prototype._boxProcessors.mp4a=r.prototype._boxProcessors.enca=function(){this._procFieldArray("reserved1",6,"uint",8),this._procField("data_reference_index","uint",16),this._procFieldArray("reserved2",2,"uint",32),this._procField("channelcount","uint",16),this._procField("samplesize","uint",16),this._procField("pre_defined","uint",16),this._procField("reserved3","uint",16),this._procField("samplerate","template",32),this._procField("esds","data",-1)},r.prototype._boxProcessors.mvhd=function(){this._procFullBox(),this._procField("creation_time","uint",1==this.version?64:32),this._procField("modification_time","uint",1==this.version?64:32),this._procField("timescale","uint",32),this._procField("duration","uint",1==this.version?64:32),this._procField("rate","template",32),this._procField("volume","template",16),this._procField("reserved1","uint",16),this._procFieldArray("reserved2",2,"uint",32),this._procFieldArray("matrix",9,"template",32),this._procFieldArray("pre_defined",6,"uint",32),this._procField("next_track_ID","uint",32)},r.prototype._boxProcessors.payl=function(){this._procField("cue_text","utf8")},r.prototype._boxProcessors.prft=function(){this._procFullBox(),this._procField("reference_track_ID","uint",32),this._procField("ntp_timestamp_sec","uint",32),this._procField("ntp_timestamp_frac","uint",32),this._procField("media_time","uint",1==this.version?64:32)},r.prototype._boxProcessors.prsl=function(){this._procFullBox(),this._procField("group_id","uint",32),this._procField("num_entities_in_group","uint",32),this._procEntries("entities",this.num_entities_in_group,(function(t){this._procEntryField(t,"entity_id","uint",32)})),4096&this.flags&&this._procField("preselection_tag","utf8string"),8192&this.flags&&this._procField("selection_priority","uint",8),16384&this.flags&&this._procField("interleaving_tag","utf8string")},r.prototype._boxProcessors.pssh=function(){this._procFullBox(),this._procFieldArray("SystemID",16,"uint",8),this._procField("DataSize","uint",32),this._procFieldArray("Data",this.DataSize,"uint",8)},r.prototype._boxProcessors.schm=function(){this._procFullBox(),this._procField("scheme_type","uint",32),this._procField("scheme_version","uint",32),1&this.flags&&this._procField("scheme_uri","string",-1)},r.prototype._boxProcessors.sdtp=function(){this._procFullBox();var t=-1;this._parsing&&(t=this._raw.byteLength-(this._cursor.offset-this._raw.byteOffset)),this._procFieldArray("sample_dependency_table",t,"uint",8)},r.prototype._boxProcessors.sidx=function(){this._procFullBox(),this._procField("reference_ID","uint",32),this._procField("timescale","uint",32),this._procField("earliest_presentation_time","uint",1==this.version?64:32),this._procField("first_offset","uint",1==this.version?64:32),this._procField("reserved","uint",16),this._procField("reference_count","uint",16),this._procEntries("references",this.reference_count,(function(t){this._parsing||(t.reference=(1&t.reference_type)<<31,t.reference|=2147483647&t.referenced_size,t.sap=(1&t.starts_with_SAP)<<31,t.sap|=(3&t.SAP_type)<<28,t.sap|=268435455&t.SAP_delta_time),this._procEntryField(t,"reference","uint",32),this._procEntryField(t,"subsegment_duration","uint",32),this._procEntryField(t,"sap","uint",32),this._parsing&&(t.reference_type=t.reference>>31&1,t.referenced_size=2147483647&t.reference,t.starts_with_SAP=t.sap>>31&1,t.SAP_type=t.sap>>28&7,t.SAP_delta_time=268435455&t.sap)}))},r.prototype._boxProcessors.smhd=function(){this._procFullBox(),this._procField("balance","uint",16),this._procField("reserved","uint",16)},r.prototype._boxProcessors.ssix=function(){this._procFullBox(),this._procField("subsegment_count","uint",32),this._procEntries("subsegments",this.subsegment_count,(function(t){this._procEntryField(t,"ranges_count","uint",32),this._procSubEntries(t,"ranges",t.ranges_count,(function(t){this._procEntryField(t,"level","uint",8),this._procEntryField(t,"range_size","uint",24)}))}))},r.prototype._boxProcessors.stsd=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procSubBoxes("entries",this.entry_count)},r.prototype._boxProcessors.sttg=function(){this._procField("settings","utf8")},r.prototype._boxProcessors.stts=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procEntries("entries",this.entry_count,(function(t){this._procEntryField(t,"sample_count","uint",32),this._procEntryField(t,"sample_delta","uint",32)}))},r.prototype._boxProcessors.subs=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procEntries("entries",this.entry_count,(function(t){this._procEntryField(t,"sample_delta","uint",32),this._procEntryField(t,"subsample_count","uint",16),this._procSubEntries(t,"subsamples",t.subsample_count,(function(t){this._procEntryField(t,"subsample_size","uint",1===this.version?32:16),this._procEntryField(t,"subsample_priority","uint",8),this._procEntryField(t,"discardable","uint",8),this._procEntryField(t,"codec_specific_parameters","uint",32)}))}))},r.prototype._boxProcessors.tenc=function(){this._procFullBox(),this._procField("default_IsEncrypted","uint",24),this._procField("default_IV_size","uint",8),this._procFieldArray("default_KID",16,"uint",8)},r.prototype._boxProcessors.tfdt=function(){this._procFullBox(),this._procField("baseMediaDecodeTime","uint",1==this.version?64:32)},r.prototype._boxProcessors.tfhd=function(){this._procFullBox(),this._procField("track_ID","uint",32),1&this.flags&&this._procField("base_data_offset","uint",64),2&this.flags&&this._procField("sample_description_offset","uint",32),8&this.flags&&this._procField("default_sample_duration","uint",32),16&this.flags&&this._procField("default_sample_size","uint",32),32&this.flags&&this._procField("default_sample_flags","uint",32)},r.prototype._boxProcessors.tfra=function(){this._procFullBox(),this._procField("track_ID","uint",32),this._parsing||(this.reserved=0,this.reserved|=(48&this.length_size_of_traf_num)<<4,this.reserved|=(12&this.length_size_of_trun_num)<<2,this.reserved|=3&this.length_size_of_sample_num),this._procField("reserved","uint",32),this._parsing&&(this.length_size_of_traf_num=(48&this.reserved)>>4,this.length_size_of_trun_num=(12&this.reserved)>>2,this.length_size_of_sample_num=3&this.reserved),this._procField("number_of_entry","uint",32),this._procEntries("entries",this.number_of_entry,(function(t){this._procEntryField(t,"time","uint",1===this.version?64:32),this._procEntryField(t,"moof_offset","uint",1===this.version?64:32),this._procEntryField(t,"traf_number","uint",8*(this.length_size_of_traf_num+1)),this._procEntryField(t,"trun_number","uint",8*(this.length_size_of_trun_num+1)),this._procEntryField(t,"sample_number","uint",8*(this.length_size_of_sample_num+1))}))},r.prototype._boxProcessors.tkhd=function(){this._procFullBox(),this._procField("creation_time","uint",1==this.version?64:32),this._procField("modification_time","uint",1==this.version?64:32),this._procField("track_ID","uint",32),this._procField("reserved1","uint",32),this._procField("duration","uint",1==this.version?64:32),this._procFieldArray("reserved2",2,"uint",32),this._procField("layer","uint",16),this._procField("alternate_group","uint",16),this._procField("volume","template",16),this._procField("reserved3","uint",16),this._procFieldArray("matrix",9,"template",32),this._procField("width","template",32),this._procField("height","template",32)},r.prototype._boxProcessors.trex=function(){this._procFullBox(),this._procField("track_ID","uint",32),this._procField("default_sample_description_index","uint",32),this._procField("default_sample_duration","uint",32),this._procField("default_sample_size","uint",32),this._procField("default_sample_flags","uint",32)},r.prototype._boxProcessors.trun=function(){this._procFullBox(),this._procField("sample_count","uint",32),1&this.flags&&this._procField("data_offset","int",32),4&this.flags&&this._procField("first_sample_flags","uint",32),this._procEntries("samples",this.sample_count,(function(t){256&this.flags&&this._procEntryField(t,"sample_duration","uint",32),512&this.flags&&this._procEntryField(t,"sample_size","uint",32),1024&this.flags&&this._procEntryField(t,"sample_flags","uint",32),2048&this.flags&&this._procEntryField(t,"sample_composition_time_offset",1===this.version?"int":"uint",32)}))},r.prototype._boxProcessors["url "]=r.prototype._boxProcessors["urn "]=function(){this._procFullBox(),"urn "===this.type&&this._procField("name","string",-1),this._procField("location","string",-1)},r.prototype._boxProcessors.vlab=function(){this._procField("source_label","utf8")},r.prototype._boxProcessors.vmhd=function(){this._procFullBox(),this._procField("graphicsmode","uint",16),this._procFieldArray("opcolor",3,"uint",16)},r.prototype._boxProcessors.vttC=function(){this._procField("config","utf8")},r.prototype._boxProcessors.vtte=function(){}},9826:function(t){"use strict";var e,n="object"==typeof Reflect?Reflect:null,a=n&&"function"==typeof n.apply?n.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)};e=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var r=Number.isNaN||function(t){return t!=t};function i(){i.init.call(this)}t.exports=i,t.exports.once=function(t,e){return new Promise((function(n,a){function r(n){t.removeListener(e,i),a(n)}function i(){"function"==typeof t.removeListener&&t.removeListener("error",r),n([].slice.call(arguments))}h(t,e,i,{once:!0}),"error"!==e&&function(t,e){"function"==typeof t.on&&h(t,"error",e,{once:!0})}(t,r)}))},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var o=10;function l(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function s(t){return void 0===t._maxListeners?i.defaultMaxListeners:t._maxListeners}function u(t,e,n,a){var r,i,o,u;if(l(n),void 0===(i=t._events)?(i=t._events=Object.create(null),t._eventsCount=0):(void 0!==i.newListener&&(t.emit("newListener",e,n.listener?n.listener:n),i=t._events),o=i[e]),void 0===o)o=i[e]=n,++t._eventsCount;else if("function"==typeof o?o=i[e]=a?[n,o]:[o,n]:a?o.unshift(n):o.push(n),(r=s(t))>0&&o.length>r&&!o.warned){o.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=t,c.type=e,c.count=o.length,u=c,console&&console.warn&&console.warn(u)}return t}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(t,e,n){var a={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},r=c.bind(a);return r.listener=n,a.wrapFn=r,r}function f(t,e,n){var a=t._events;if(void 0===a)return[];var r=a[e];return void 0===r?[]:"function"==typeof r?n?[r.listener||r]:[r]:n?function(t){for(var e=new Array(t.length),n=0;n0&&(o=e[0]),o instanceof Error)throw o;var l=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw l.context=o,l}var s=i[t];if(void 0===s)return!1;if("function"==typeof s)a(s,this,e);else{var u=s.length,c=m(s,u);for(n=0;n=0;i--)if(n[i]===e||n[i].listener===e){o=n[i].listener,r=i;break}if(r<0)return this;0===r?n.shift():function(t,e){for(;e+1=0;a--)this.removeListener(t,e[a]);return this},i.prototype.listeners=function(t){return f(this,t,!0)},i.prototype.rawListeners=function(t){return f(this,t,!1)},i.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):g.call(t,e)},i.prototype.listenerCount=g,i.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},7316:function(t){"use strict";t.exports=function t(e,n){if(e===n)return!0;if(e&&n&&"object"==typeof e&&"object"==typeof n){if(e.constructor!==n.constructor)return!1;var a,r,i;if(Array.isArray(e)){if((a=e.length)!=n.length)return!1;for(r=a;0!=r--;)if(!t(e[r],n[r]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if((a=(i=Object.keys(e)).length)!==Object.keys(n).length)return!1;for(r=a;0!=r--;)if(!Object.prototype.hasOwnProperty.call(n,i[r]))return!1;for(r=a;0!=r--;){var o=i[r];if(!t(e[o],n[o]))return!1}return!0}return e!=e&&n!=n}},7986:function(t,e){e.read=function(t,e,n,a,r){var i,o,l=8*r-a-1,s=(1<>1,c=-7,d=n?r-1:0,f=n?-1:1,g=t[e+d];for(d+=f,i=g&(1<<-c)-1,g>>=-c,c+=l;c>0;i=256*i+t[e+d],d+=f,c-=8);for(o=i&(1<<-c)-1,i>>=-c,c+=a;c>0;o=256*o+t[e+d],d+=f,c-=8);if(0===i)i=1-u;else{if(i===s)return o?NaN:1/0*(g?-1:1);o+=Math.pow(2,a),i-=u}return(g?-1:1)*o*Math.pow(2,i-a)},e.write=function(t,e,n,a,r,i){var o,l,s,u=8*i-r-1,c=(1<>1,f=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,g=a?0:i-1,m=a?1:-1,h=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(l=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(s=Math.pow(2,-o))<1&&(o--,s*=2),(e+=o+d>=1?f/s:f*Math.pow(2,1-d))*s>=2&&(o++,s/=2),o+d>=c?(l=0,o=c):o+d>=1?(l=(e*s-1)*Math.pow(2,r),o+=d):(l=e*Math.pow(2,d-1)*Math.pow(2,r),o=0));r>=8;t[n+g]=255&l,g+=m,l/=256,r-=8);for(o=o<0;t[n+g]=255&o,g+=m,o/=256,u-=8);t[n+g-m]|=128*h}},5474:function(t,e,n){!function(t){t.parser=function(t,e){return new r(t,e)},t.SAXParser=r,t.SAXStream=o,t.createStream=function(t,e){return new o(t,e)},t.MAX_BUFFER_LENGTH=65536;var e,a=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];function r(e,n){if(!(this instanceof r))return new r(e,n);var i=this;!function(t){for(var e=0,n=a.length;e"===i?(C(n,"onsgmldeclaration",n.sgmlDecl),n.sgmlDecl="",n.state=k.TEXT):T(c,i)?(n.state=k.SGML_DECL_QUOTED,n.sgmlDecl+=i):n.sgmlDecl+=i;continue;case k.SGML_DECL_QUOTED:i===n.q&&(n.state=k.SGML_DECL,n.q=""),n.sgmlDecl+=i;continue;case k.DOCTYPE:">"===i?(n.state=k.TEXT,C(n,"ondoctype",n.doctype),n.doctype=!0):(n.doctype+=i,"["===i?n.state=k.DOCTYPE_DTD:T(c,i)&&(n.state=k.DOCTYPE_QUOTED,n.q=i));continue;case k.DOCTYPE_QUOTED:n.doctype+=i,i===n.q&&(n.q="",n.state=k.DOCTYPE);continue;case k.DOCTYPE_DTD:n.doctype+=i,"]"===i?n.state=k.DOCTYPE:T(c,i)&&(n.state=k.DOCTYPE_DTD_QUOTED,n.q=i);continue;case k.DOCTYPE_DTD_QUOTED:n.doctype+=i,i===n.q&&(n.state=k.DOCTYPE_DTD,n.q="");continue;case k.COMMENT:"-"===i?n.state=k.COMMENT_ENDING:n.comment+=i;continue;case k.COMMENT_ENDING:"-"===i?(n.state=k.COMMENT_ENDED,n.comment=x(n.opt,n.comment),n.comment&&C(n,"oncomment",n.comment),n.comment=""):(n.comment+="-"+i,n.state=k.COMMENT);continue;case k.COMMENT_ENDED:">"!==i?(O(n,"Malformed comment"),n.comment+="--"+i,n.state=k.COMMENT):n.state=k.TEXT;continue;case k.CDATA:"]"===i?n.state=k.CDATA_ENDING:n.cdata+=i;continue;case k.CDATA_ENDING:"]"===i?n.state=k.CDATA_ENDING_2:(n.cdata+="]"+i,n.state=k.CDATA);continue;case k.CDATA_ENDING_2:">"===i?(n.cdata&&C(n,"oncdata",n.cdata),C(n,"onclosecdata"),n.cdata="",n.state=k.TEXT):"]"===i?n.cdata+="]":(n.cdata+="]]"+i,n.state=k.CDATA);continue;case k.PROC_INST:"?"===i?n.state=k.PROC_INST_ENDING:T(l,i)?n.state=k.PROC_INST_BODY:n.procInstName+=i;continue;case k.PROC_INST_BODY:if(!n.procInstBody&&T(l,i))continue;"?"===i?n.state=k.PROC_INST_ENDING:n.procInstBody+=i;continue;case k.PROC_INST_ENDING:">"===i?(C(n,"onprocessinginstruction",{name:n.procInstName,body:n.procInstBody}),n.procInstName=n.procInstBody="",n.state=k.TEXT):(n.procInstBody+="?"+i,n.state=k.PROC_INST_BODY);continue;case k.OPEN_TAG:T(y,i)?n.tagName+=i:(L(n),">"===i?U(n):"/"===i?n.state=k.OPEN_TAG_SLASH:(v(l,i)&&O(n,"Invalid character in tag name"),n.state=k.ATTRIB));continue;case k.OPEN_TAG_SLASH:">"===i?(U(n,!0),j(n)):(O(n,"Forward-slash in opening tag not followed by >"),n.state=k.ATTRIB);continue;case k.ATTRIB:if(T(l,i))continue;">"===i?U(n):"/"===i?n.state=k.OPEN_TAG_SLASH:T(b,i)?(n.attribName=i,n.attribValue="",n.state=k.ATTRIB_NAME):O(n,"Invalid attribute name");continue;case k.ATTRIB_NAME:"="===i?n.state=k.ATTRIB_VALUE:">"===i?(O(n,"Attribute without value"),n.attribValue=n.attribName,F(n),U(n)):T(l,i)?n.state=k.ATTRIB_NAME_SAW_WHITE:T(y,i)?n.attribName+=i:O(n,"Invalid attribute name");continue;case k.ATTRIB_NAME_SAW_WHITE:if("="===i)n.state=k.ATTRIB_VALUE;else{if(T(l,i))continue;O(n,"Attribute without value"),n.tag.attributes[n.attribName]="",n.attribValue="",C(n,"onattribute",{name:n.attribName,value:""}),n.attribName="",">"===i?U(n):T(b,i)?(n.attribName=i,n.state=k.ATTRIB_NAME):(O(n,"Invalid attribute name"),n.state=k.ATTRIB)}continue;case k.ATTRIB_VALUE:if(T(l,i))continue;T(c,i)?(n.q=i,n.state=k.ATTRIB_VALUE_QUOTED):(O(n,"Unquoted attribute value"),n.state=k.ATTRIB_VALUE_UNQUOTED,n.attribValue=i);continue;case k.ATTRIB_VALUE_QUOTED:if(i!==n.q){"&"===i?n.state=k.ATTRIB_VALUE_ENTITY_Q:n.attribValue+=i;continue}F(n),n.q="",n.state=k.ATTRIB_VALUE_CLOSED;continue;case k.ATTRIB_VALUE_CLOSED:T(l,i)?n.state=k.ATTRIB:">"===i?U(n):"/"===i?n.state=k.OPEN_TAG_SLASH:T(b,i)?(O(n,"No whitespace between attributes"),n.attribName=i,n.attribValue="",n.state=k.ATTRIB_NAME):O(n,"Invalid attribute name");continue;case k.ATTRIB_VALUE_UNQUOTED:if(v(d,i)){"&"===i?n.state=k.ATTRIB_VALUE_ENTITY_U:n.attribValue+=i;continue}F(n),">"===i?U(n):n.state=k.ATTRIB;continue;case k.CLOSE_TAG:if(n.tagName)">"===i?j(n):T(y,i)?n.tagName+=i:n.script?(n.script+=""===i?j(n):O(n,"Invalid characters in closing tag");continue;case k.TEXT_ENTITY:case k.ATTRIB_VALUE_ENTITY_Q:case k.ATTRIB_VALUE_ENTITY_U:var u,m;switch(n.state){case k.TEXT_ENTITY:u=k.TEXT,m="textNode";break;case k.ATTRIB_VALUE_ENTITY_Q:u=k.ATTRIB_VALUE_QUOTED,m="attribValue";break;case k.ATTRIB_VALUE_ENTITY_U:u=k.ATTRIB_VALUE_UNQUOTED,m="attribValue"}";"===i?(n[m]+=B(n),n.entity="",n.state=u):T(n.entity.length?_:E,i)?n.entity+=i:(O(n,"Invalid character in entity name"),n[m]+="&"+n.entity+i,n.entity="",n.state=u);continue;default:throw new Error(n,"Unknown state: "+n.state)}return n.position>=n.bufferCheckPosition&&function(e){for(var n=Math.max(t.MAX_BUFFER_LENGTH,10),r=0,i=0,o=a.length;in)switch(a[i]){case"textNode":D(e);break;case"cdata":C(e,"oncdata",e.cdata),e.cdata="";break;case"script":C(e,"onscript",e.script),e.script="";break;default:M(e,"Max buffer length exceeded: "+a[i])}r=Math.max(r,l)}var s=t.MAX_BUFFER_LENGTH-r;e.bufferCheckPosition=s+e.position}(n),n},resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){var t;D(t=this),""!==t.cdata&&(C(t,"oncdata",t.cdata),t.cdata=""),""!==t.script&&(C(t,"onscript",t.script),t.script="")}};try{e=n(3515).Stream}catch(t){e=function(){}}var i=t.EVENTS.filter((function(t){return"error"!==t&&"end"!==t}));function o(t,n){if(!(this instanceof o))return new o(t,n);e.apply(this),this._parser=new r(t,n),this.writable=!0,this.readable=!0;var a=this;this._parser.onend=function(){a.emit("end")},this._parser.onerror=function(t){a.emit("error",t),a._parser.error=null},this._decoder=null,i.forEach((function(t){Object.defineProperty(a,"on"+t,{get:function(){return a._parser["on"+t]},set:function(e){if(!e)return a.removeAllListeners(t),a._parser["on"+t]=e,e;a.on(t,e)},enumerable:!0,configurable:!1})}))}o.prototype=Object.create(e.prototype,{constructor:{value:o}}),o.prototype.write=function(t){if("function"==typeof Buffer&&"function"==typeof Buffer.isBuffer&&Buffer.isBuffer(t)){if(!this._decoder){var e=n(748).I;this._decoder=new e("utf8")}t=this._decoder.write(t)}return this._parser.write(t.toString()),this.emit("data",t),!0},o.prototype.end=function(t){return t&&t.length&&this.write(t),this._parser.end(),!0},o.prototype.on=function(t,n){var a=this;return a._parser["on"+t]||-1===i.indexOf(t)||(a._parser["on"+t]=function(){var e=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);e.splice(0,0,t),a.emit.apply(a,e)}),e.prototype.on.call(a,t,n)};var l="\r\n\t ",s="0124356789",u="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",c="'\"",d=l+">",f="[CDATA[",g="DOCTYPE",m="http://www.w3.org/XML/1998/namespace",h="http://www.w3.org/2000/xmlns/",p={xml:m,xmlns:h};l=A(l),s=A(s),u=A(u);var b=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,y=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/,E=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,_=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/;function A(t){return t.split("").reduce((function(t,e){return t[e]=!0,t}),{})}function T(t,e){return function(t){return"[object RegExp]"===Object.prototype.toString.call(t)}(t)?!!e.match(t):t[e]}function v(t,e){return!T(t,e)}c=A(c),d=A(d);var w,S,I,k=0;for(var R in t.STATE={BEGIN:k++,BEGIN_WHITESPACE:k++,TEXT:k++,TEXT_ENTITY:k++,OPEN_WAKA:k++,SGML_DECL:k++,SGML_DECL_QUOTED:k++,DOCTYPE:k++,DOCTYPE_QUOTED:k++,DOCTYPE_DTD:k++,DOCTYPE_DTD_QUOTED:k++,COMMENT_STARTING:k++,COMMENT:k++,COMMENT_ENDING:k++,COMMENT_ENDED:k++,CDATA:k++,CDATA_ENDING:k++,CDATA_ENDING_2:k++,PROC_INST:k++,PROC_INST_BODY:k++,PROC_INST_ENDING:k++,OPEN_TAG:k++,OPEN_TAG_SLASH:k++,ATTRIB:k++,ATTRIB_NAME:k++,ATTRIB_NAME_SAW_WHITE:k++,ATTRIB_VALUE:k++,ATTRIB_VALUE_QUOTED:k++,ATTRIB_VALUE_CLOSED:k++,ATTRIB_VALUE_UNQUOTED:k++,ATTRIB_VALUE_ENTITY_Q:k++,ATTRIB_VALUE_ENTITY_U:k++,CLOSE_TAG:k++,CLOSE_TAG_SAW_WHITE:k++,SCRIPT:k++,SCRIPT_ENDING:k++},t.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},t.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(t.ENTITIES).forEach((function(e){var n=t.ENTITIES[e],a="number"==typeof n?String.fromCharCode(n):n;t.ENTITIES[e]=a})),t.STATE)t.STATE[t.STATE[R]]=R;function N(t,e,n){t[e]&&t[e](n)}function C(t,e,n){t.textNode&&D(t),N(t,e,n)}function D(t){t.textNode=x(t.opt,t.textNode),t.textNode&&N(t,"ontext",t.textNode),t.textNode=""}function x(t,e){return t.trim&&(e=e.trim()),t.normalize&&(e=e.replace(/\s+/g," ")),e}function M(t,e){return D(t),t.trackPosition&&(e+="\nLine: "+t.line+"\nColumn: "+t.column+"\nChar: "+t.c),e=new Error(e),t.error=e,N(t,"onerror",e),t}function z(t){return t.sawRoot&&!t.closedRoot&&O(t,"Unclosed root tag"),t.state!==k.BEGIN&&t.state!==k.BEGIN_WHITESPACE&&t.state!==k.TEXT&&M(t,"Unexpected end"),D(t),t.c="",t.closed=!0,N(t,"onend"),r.call(t,t.strict,t.opt),t}function O(t,e){if("object"!=typeof t||!(t instanceof r))throw new Error("bad call to strictFail");t.strict&&M(t,e)}function L(t){t.strict||(t.tagName=t.tagName[t.looseCase]());var e=t.tags[t.tags.length-1]||t,n=t.tag={name:t.tagName,attributes:{}};t.opt.xmlns&&(n.ns=e.ns),t.attribList.length=0,C(t,"onopentagstart",n)}function P(t,e){var n=t.indexOf(":")<0?["",t]:t.split(":"),a=n[0],r=n[1];return e&&"xmlns"===t&&(a="xmlns",r=""),{prefix:a,local:r}}function F(t){if(t.strict||(t.attribName=t.attribName[t.looseCase]()),-1!==t.attribList.indexOf(t.attribName)||t.tag.attributes.hasOwnProperty(t.attribName))t.attribName=t.attribValue="";else{if(t.opt.xmlns){var e=P(t.attribName,!0),n=e.prefix,a=e.local;if("xmlns"===n)if("xml"===a&&t.attribValue!==m)O(t,"xml: prefix must be bound to "+m+"\nActual: "+t.attribValue);else if("xmlns"===a&&t.attribValue!==h)O(t,"xmlns: prefix must be bound to "+h+"\nActual: "+t.attribValue);else{var r=t.tag,i=t.tags[t.tags.length-1]||t;r.ns===i.ns&&(r.ns=Object.create(i.ns)),r.ns[a]=t.attribValue}t.attribList.push([t.attribName,t.attribValue])}else t.tag.attributes[t.attribName]=t.attribValue,C(t,"onattribute",{name:t.attribName,value:t.attribValue});t.attribName=t.attribValue=""}}function U(t,e){if(t.opt.xmlns){var n=t.tag,a=P(t.tagName);n.prefix=a.prefix,n.local=a.local,n.uri=n.ns[a.prefix]||"",n.prefix&&!n.uri&&(O(t,"Unbound namespace prefix: "+JSON.stringify(t.tagName)),n.uri=a.prefix);var r=t.tags[t.tags.length-1]||t;n.ns&&r.ns!==n.ns&&Object.keys(n.ns).forEach((function(e){C(t,"onopennamespace",{prefix:e,uri:n.ns[e]})}));for(var i=0,o=t.attribList.length;i",t.tagName="",void(t.state=k.SCRIPT);C(t,"onscript",t.script),t.script=""}var e=t.tags.length,n=t.tagName;t.strict||(n=n[t.looseCase]());for(var a=n;e--&&t.tags[e].name!==a;)O(t,"Unexpected close tag");if(e<0)return O(t,"Unmatched closing tag: "+t.tagName),t.textNode+="",void(t.state=k.TEXT);t.tagName=n;for(var r=t.tags.length;r-- >e;){var i=t.tag=t.tags.pop();t.tagName=t.tag.name,C(t,"onclosetag",t.tagName);var o={};for(var l in i.ns)o[l]=i.ns[l];var s=t.tags[t.tags.length-1]||t;t.opt.xmlns&&i.ns!==s.ns&&Object.keys(i.ns).forEach((function(e){var n=i.ns[e];C(t,"onclosenamespace",{prefix:e,uri:n})}))}0===e&&(t.closedRoot=!0),t.tagName=t.attribValue=t.attribName="",t.attribList.length=0,t.state=k.TEXT}function B(t){var e,n=t.entity,a=n.toLowerCase(),r="";return t.ENTITIES[n]?t.ENTITIES[n]:t.ENTITIES[a]?t.ENTITIES[a]:("#"===(n=a).charAt(0)&&("x"===n.charAt(1)?(n=n.slice(2),r=(e=parseInt(n,16)).toString(16)):(n=n.slice(1),r=(e=parseInt(n,10)).toString(10))),n=n.replace(/^0+/,""),r.toLowerCase()!==n?(O(t,"Invalid character entity"),"&"+t.entity+";"):String.fromCodePoint(e))}function q(t,e){"<"===e?(t.state=k.OPEN_WAKA,t.startTagPosition=t.position):v(l,e)&&(O(t,"Non-whitespace before first tag."),t.textNode=e,t.state=k.TEXT)}function G(t,e){var n="";return e1114111||S(o)!==o)throw RangeError("Invalid code point: "+o);o<=65535?n.push(o):(t=55296+((o-=65536)>>10),e=o%1024+56320,n.push(t,e)),(a+1===r||n.length>16384)&&(i+=w.apply(null,n),n.length=0)}return i},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:I,configurable:!0,writable:!0}):String.fromCodePoint=I)}(e)},6739:function(t,e,n){!function(t,e,n,a,r){function i(t){if("contents"in t)for(var e=("styleAttrs"in t?t.styleAttrs[a.byName.ruby.qname]:null),n="span"===t.kind&&("container"===e||"textContainer"===e||"baseContainer"===e),r=t.contents.length-1;r>=0;r--)!n||"styleAttrs"in t.contents[r]&&a.byName.ruby.qname in t.contents[r].styleAttrs?i(t.contents[r]):delete t.contents[r]}function o(t,e,n,a){var r=a&&"seq"===a.timeContainer,i=0;a&&(i=r&&n?n.end:a.begin),e.begin=e.explicit_begin?e.explicit_begin+i:i;var l=e.begin,s=null;if("sets"in e)for(var u=0;u0;){var a=e.styleRefs.pop();a in t.styles?(O(t,t.styles[a],n),P(t.styles[a].styleAttrs,e.styleAttrs)):U(n,"Non-existant style id referenced")}}function L(t,e,n,a){for(var r=e.length-1;r>=0;r--){var i=e[r];i in t.styles?P(t.styles[i].styleAttrs,n):U(a,"Non-existant style id referenced")}}function P(t,e){for(var n in t)t.hasOwnProperty(n)&&(n in e||(e[n]=t[n]))}function F(t,e){if(t&&t.warn&&t.warn(e))throw e}function U(t,e){if(t&&t.error&&t.error(e))throw e}function j(t,e){throw t&&t.fatal&&t.fatal(e),e}function B(t,e){for(var n,a=0,r=t.length-1;a<=r;){var i=t[n=Math.floor((a+r)/2)];if(ie))return{found:!0,index:n};r=n-1}}return{found:!1,index:a}}t.fromXML=function(t,r,h){var p=e.parser(!0,{xmlns:!0}),b=[],y=[],E=[],_=0,A=null;p.onclosetag=function(t){if(b[0]instanceof R)null!==A.head&&null!==A.head.styling&&L(A.head.styling,b[0].styleRefs,b[0].styleAttrs,r),delete b[0].styleRefs;else if(b[0]instanceof c)for(var e in b[0].styles)b[0].styles.hasOwnProperty(e)&&O(b[0],b[0].styles[e],r);else if(b[0]instanceof w||b[0]instanceof S){if(b[0].contents.length>1){var a,i=[b[0].contents[0]];for(a=1;a0&&h&&"onCloseTag"in h&&h.onCloseTag());E.shift(),y.shift(),b.shift()},p.ontext=function(t){if(void 0===b[0]);else if(b[0]instanceof S||b[0]instanceof w){if(b[0]instanceof S){var e=b[0].styleAttrs[a.byName.ruby.qname];if("container"===e||"textContainer"===e||"baseContainer"===e)return}var n=new I;n.initFromText(A,b[0],t,y[0],E[0],r),b[0].contents.push(n)}else b[0]instanceof l&&_>0&&h&&"onText"in h&&h.onText(t)},p.onopentag=function(t){var e=t.attributes["xml:space"];e?E.unshift(e.value):0===E.length?E.unshift("default"):E.unshift(E[0]);var i=t.attributes["xml:lang"];if(i?y.unshift(i.value):0===y.length?y.unshift(""):y.unshift(y[0]),t.uri===n.ns_tt)if("tt"===t.local)null!==A&&j(r,"Two elements at ("+this.line+","+this.column+")"),(A=new s).initFromNode(t,y[0],r),b.unshift(A);else if("head"===t.local)b[0]instanceof s||j(r,"Parent of element is not at ("+this.line+","+this.column+")"),b.unshift(A.head);else if("styling"===t.local)b[0]instanceof u||j(r,"Parent of element is not at ("+this.line+","+this.column+")"),b.unshift(A.head.styling);else if("style"===t.local){var o;b[0]instanceof c?((o=new d).initFromNode(t,r),o.id?A.head.styling.styles[o.id]=o:U(r,"",n),a=[t.slice(p,n)],n+=8):-1===T.indexOf(e)?(n++,a=y(e,r)):n++;else n++;return r.__children=a,r}var w,S=null;if(void 0!==e.attrValue)for(e.attrName=e.attrName||"id",S=[];-1!==(void 0,w=new RegExp("\\s"+e.attrName+"\\s*=['\"]"+e.attrValue+"['\"]").exec(t),n=w?w.index:-1);)-1!==(n=t.lastIndexOf("<",n))&&S.push(v()),t=t.substr(n),n=0;else S=e.parseNode?v():y("");return e.filter&&(S=ti(S,e.filter)),e.simplify?Jr(Array.isArray(S)?S:[S]):(e.setPos&&(S.pos=n),S)}function Jr(t){var e={};if(!t.length)return"";if(1===t.length&&"string"==typeof t[0])return t[0];for(var n in t.forEach((function(t){if("object"==typeof t){e[t.tagName]||(e[t.tagName]=[]);var n=Jr(t.children);e[t.tagName].push(n),Object.keys(t.attributes).length&&"string"!=typeof n&&(n._attributes=t.attributes)}})),e)1==e[n].length&&(e[n]=e[n][0]);return e}function ti(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";var r=[];return t.forEach((function(t,i){if("object"==typeof t&&e(t,i,n,a)&&r.push(t),t.children){var o=ti(t.children,e,n+1,(a?a+".":"")+i+"."+t.tagName);r=r.concat(o)}})),r}const ei=[S.A.PERIOD,S.A.BASE_URL,S.A.ADAPTATION_SET,S.A.REPRESENTATION,S.A.CONTENT_PROTECTION,S.A.ROLE,S.A.ACCESSIBILITY,S.A.AUDIO_CHANNEL_CONFIGURATION,S.A.CONTENT_COMPONENT,S.A.ESSENTIAL_PROPERTY,S.A.LABEL,S.A.S,S.A.SEGMENT_URL,S.A.EVENT,S.A.EVENT_STREAM,S.A.LOCATION,S.A.SERVICE_DESCRIPTION,S.A.SUPPLEMENTAL_PROPERTY,S.A.METRICS,S.A.REPORTING,S.A.PATCH_LOCATION,S.A.REPLACE,S.A.ADD,S.A.REMOVE,S.A.UTC_TIMING,S.A.INBAND_EVENT_STREAM,S.A.PRODUCER_REFERENCE_TIME,S.A.CONTENT_STEERING];function ni(t){t=t||{};const e=this.context,n=t.debug;let a,r,i,o;function l(t){try{let e=Zr(t,{parseNode:!0,attrMatchers:i,nodesAsArray:ei}),n={};if(-1!==e.tagName.toLowerCase().indexOf("xml"))for(let t in e){if(Array.isArray(e[t])){n[t]=e[t][0];break}if("object"==typeof e[t]){n[t]=e[t];break}}else n[e.tagName]=e,delete e.tagName;return n}catch(t){return null}}return a={getIron:function(){return o},parseXml:l,parse:function(t){let e;const n=window.performance.now();if(e=l(t),!e)throw new Error("failed to parse the manifest");e.Patch?(e=e.Patch,e.add&&e.add.forEach((t=>o.run(t))),e.replace&&e.replace.forEach((t=>o.run(t)))):(e=e.MPD,o.run(e));const a=window.performance.now();return r.info("Parsing complete: "+(a-n).toPrecision(3)+"ms"),e.protocol="DASH",e}},r=n.getLogger(a),i=[new Ur,new Br,new Hr,new Yr],o=Lr(e).create({adaptationset:new Wr,period:new $r}),a}ni.__dashjs_factory_name="DashParser";var ai=N.A.getClassFactory(ni);function ri(t){t=t||{};const e=this.context,n=t.debug,a=t.settings,r=(0,k.A)(e).getInstance(),i=wt(e).getInstance();let o,l,s,u,c,d=t.mssHandler,f=t.errHandler;function g(t){r.trigger(R.A.INTERNAL_MANIFEST_LOADED,{manifest:t.manifest})}return o={load:function(t){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,f=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const g=new Date,m=new Nr(t,z.G.MPD_TYPE);o&&(m.serviceLocation=o),f&&(m.queryParams=f),m.startDate||(m.startDate=g),r.trigger(R.A.MANIFEST_LOADING_STARTED,{request:m}),s.load({request:m,success:function(o,s,f){if(!u)return;let g,m,h;if(f&&f!==t?(m=i.parseBaseUrl(f),g=f):(i.isRelative(t)&&(t=i.resolve(t,window.location.href)),m=i.parseBaseUrl(t)),"No Content"!=s)if(null===c&&(c=function(t){let a=null;return t.indexOf("SmoothStreamingMedia")>-1?(d&&(a=d.createMssParser(),d.createMssFragmentProcessor(),d.registerEvents()),a):t.indexOf("MPD")>-1||t.indexOf("Patch")>-1?ai(e).create({debug:n}):a}(o)),null!==c){u.setParser(c);try{h=c.parse(o)}catch(e){return void r.trigger(R.A.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new G.A(V.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,V.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+`${t}`)})}if(h){if(h.url=g||t,h.originalUrl||(h.originalUrl=h.url),a&&a.get().streaming.enableManifestDurationMismatchFix&&h.mediaPresentationDuration&&h.Period.length>1){const t=h.Period.reduce(((t,e)=>t+e.duration),0);!isNaN(t)&&h.mediaPresentationDuration>t&&(l.warn("Media presentation duration greater than duration of all periods. Setting duration to total period duration"),h.mediaPresentationDuration=t)}h.baseUri=m,h.loadedTime=new Date,u.resolveManifestOnLoad(h),r.trigger(R.A.ORIGINAL_MANIFEST_LOADED,{originalManifest:o})}else r.trigger(R.A.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new G.A(V.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,V.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+`${t}`)})}else r.trigger(R.A.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new G.A(V.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,V.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+`${t}`)});else r.trigger(R.A.INTERNAL_MANIFEST_LOADED,{manifest:null})},error:function(e,n,a){r.trigger(R.A.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new G.A(V.MANIFEST_LOADER_LOADING_FAILURE_ERROR_CODE,V.MANIFEST_LOADER_LOADING_FAILURE_ERROR_MESSAGE+`${t}, ${a}`)})}})},reset:function(){r.off(R.A.XLINK_READY,g,o),d&&d.reset(),u&&(u.reset(),u=null),s&&(s.abort(),s=null)}},l=n.getLogger(o),r.on(R.A.XLINK_READY,g,o),s=Bn(e).create({errHandler:t.errHandler,dashMetrics:t.dashMetrics,mediaPlayerModel:t.mediaPlayerModel,urlUtils:i,constants:w.A,dashConstants:S.A,errors:V,requestTimeout:t.settings.get().streaming.manifestRequestTimeout}),u=zr(e).create({errHandler:f,dashMetrics:t.dashMetrics,mediaPlayerModel:t.mediaPlayerModel,settings:t.settings}),c=null,o}ri.__dashjs_factory_name="ManifestLoader";var ii=N.A.getClassFactory(ri);function oi(){let t;const e=this.context,n=(0,k.A)(e).getInstance();return t={error:function(t){n.trigger(R.A.ERROR,{error:t})}},t}oi.__dashjs_factory_name="ErrorHandler";var li=N.A.getSingletonFactory(oi),si=n(559);function ui(){const t=this.context,e=(0,k.A)(t).getInstance();let n,a,r,i,o,l,s;function u(t,e,n){const a=d(t,e,n);return r.isCodecSupportedBasedOnTestedConfigurations(a,t)}function c(t,e,n,a,r){const i=d(t,e,n),o=JSON.stringify(i);a.has(o)||(a.add(o),r.push(i))}function d(t,e,n){let r=null;switch(t){case w.A.VIDEO:r=function(t,e){let n={codec:e,width:t.width||null,height:t.height||null,framerate:a.getFramerate(t)||null,bitrate:t.bandwidth||null,isSupported:!0};i.get().streaming.capabilities.filterVideoColorimetryEssentialProperties&&Object.assign(n,function(t){let e={colorGamut:null,transferFunction:null,isSupported:!0};for(const n of t.EssentialProperty||[])n.schemeIdUri===w.A.COLOUR_PRIMARIES_SCHEME_ID_URI&&["1","5","6","7"].includes(n.value.toString())?e.colorGamut=w.A.MEDIA_CAPABILITIES_API.COLORGAMUT.SRGB:n.schemeIdUri===w.A.COLOUR_PRIMARIES_SCHEME_ID_URI&&["11","12"].includes(n.value.toString())?e.colorGamut=w.A.MEDIA_CAPABILITIES_API.COLORGAMUT.P3:n.schemeIdUri===w.A.COLOUR_PRIMARIES_SCHEME_ID_URI&&["9"].includes(n.value.toString())?e.colorGamut=w.A.MEDIA_CAPABILITIES_API.COLORGAMUT.REC2020:n.schemeIdUri===w.A.COLOUR_PRIMARIES_SCHEME_ID_URI&&["2"].includes(n.value.toString())?e.colorGamut=null:n.schemeIdUri===w.A.COLOUR_PRIMARIES_SCHEME_ID_URI&&(e.isSupported=!1),n.schemeIdUri===w.A.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI&&["1","6","13","14","15"].includes(n.value.toString())?e.transferFunction=w.A.MEDIA_CAPABILITIES_API.TRANSFERFUNCTION.SRGB:n.schemeIdUri===w.A.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI&&["16"].includes(n.value.toString())?e.transferFunction=w.A.MEDIA_CAPABILITIES_API.TRANSFERFUNCTION.PQ:n.schemeIdUri===w.A.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI&&["18"].includes(n.value.toString())?e.transferFunction=w.A.MEDIA_CAPABILITIES_API.TRANSFERFUNCTION.HLG:n.schemeIdUri===w.A.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI&&["2"].includes(n.value.toString())?e.transferFunction=null:n.schemeIdUri===w.A.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI&&(e.isSupported=!1);return e}(t));let r=n.isSupported;i.get().streaming.capabilities.filterHDRMetadataFormatEssentialProperties&&Object.assign(n,function(t){let e={isSupported:!0,hdrMetadataType:null};for(const n of t.EssentialProperty||[])n.schemeIdUri===w.A.HDR_METADATA_FORMAT_SCHEME_ID_URI&&n.value===w.A.HDR_METADATA_FORMAT_VALUES.ST2094_10?e.hdrMetadataType=w.A.MEDIA_CAPABILITIES_API.HDR_METADATATYPE.SMPTE_ST_2094_10:n.schemeIdUri===w.A.HDR_METADATA_FORMAT_SCHEME_ID_URI&&n.value===w.A.HDR_METADATA_FORMAT_VALUES.SL_HDR2?e.hdrMetadataType=w.A.MEDIA_CAPABILITIES_API.HDR_METADATATYPE.SLHDR2:n.schemeIdUri===w.A.HDR_METADATA_FORMAT_SCHEME_ID_URI&&n.value===w.A.HDR_METADATA_FORMAT_VALUES.ST2094_40?e.hdrMetadataType=w.A.MEDIA_CAPABILITIES_API.HDR_METADATATYPE.SMPTE_ST_2094_40:n.schemeIdUri===w.A.HDR_METADATA_FORMAT_SCHEME_ID_URI&&(e.isSupported=!1);return e}(t));let o=n.isSupported;return r&&o||(n.isSupported=!1),n}(e,n);break;case w.A.AUDIO:r=function(t,e){const n=t.audioSamplingRate||null;return{codec:e,bitrate:t.bandwidth||null,samplerate:n,isSupported:!0}}(e,n);break;default:return r}return function(t,e){return t&&t[S.A.CONTENT_PROTECTION]&&t[S.A.CONTENT_PROTECTION].length>0&&(e.keySystemsMetadata=l.getSupportedKeySystemMetadataFromContentProtection(t[S.A.CONTENT_PROTECTION])),e}(e,r)}function f(t){if(!t||0===t.length)return!0;let e=0;for(;e{const l=[w.A.VIDEO,w.A.AUDIO],d=[];l.forEach((e=>{const n=function(t,e){if(!t||!t.Period||0===t.Period.length)return[];const n=new Set,r=[];return t.Period.forEach((t=>{t.AdaptationSet.forEach((t=>{a.getIsTypeOf(t,e)&&t.Representation.forEach(((i,o)=>{const l=a.getCodec(t,o,!1);c(e,i,l,n,r);const s=a.getSupplementalCodecs(i);s.length>0&&c(e,i,s[0],n,r)}))}))})),r}(t,e);n.forEach((t=>{d.push(r.runCodecSupportCheck(t,e))}))})),Promise.allSettled(d).then((()=>(l.forEach((n=>{!function(t,n){n&&n.Period&&0!==n.Period.length&&n.Period.forEach((n=>{!function(t,n){t&&t.AdaptationSet&&0!==t.AdaptationSet.length&&(t.AdaptationSet=t.AdaptationSet.filter((t=>{a.getIsTypeOf(t,n)&&function(t,e){t.Representation&&0!==t.Representation.length&&(t.Representation=t.Representation.filter(((n,r)=>{const i=a.getCodec(t,r,!1),o=u(e,n,i);let l=function(t,e){let n=!1;const r=a.getSupplementalCodecs(t);return r.length>0&&(r.length>1&&s.warn("[CapabilitiesFilter] Multiple supplemental codecs not supported; using the first in list"),n=u(e,t,r[0])),n}(n,e);return l&&(s.debug(`[CapabilitiesFilter] Codec supported. Upgrading codecs string of Representation with ID ${n.id}`),n.codecs=n[S.A.SUPPLEMENTAL_CODECS]),o||l||s.warn(`[CapabilitiesFilter] Codec ${i} not supported. Removing Representation with ID ${n.id}`),o||l})))}(t,n);const r=t.Representation&&t.Representation.length>0;return r||(e.trigger(R.A.ADAPTATION_SET_REMOVED_NO_CAPABILITIES,{adaptationSet:t}),s.warn(`[CapabilitiesFilter] AdaptationSet with ID ${t.id?t.id:"undefined"} and codec ${t.codecs?t.codecs:"undefined"} has been removed because of no supported Representation`)),r})))}(n,t)}))}(n,t)})),i.get().streaming.capabilities.filterUnsupportedEssentialProperties&&function(t){t&&t.Period&&0!==t.Period.length&&t.Period.forEach((t=>{t.AdaptationSet=t.AdaptationSet.filter((t=>!t.Representation||0===t.Representation.length||!!f(a.getEssentialPropertiesForAdaptationSet(t))&&(t.Representation=t.Representation.filter((t=>f(a.getEssentialPropertiesForRepresentation(t)))),t.Representation&&t.Representation.length>0)))}))}(t),function(t){if(!t||!t.Period||0===t.Period.length)return Promise.resolve();const e=[];return t.Period.forEach((t=>{e.push(function(t){return new Promise((e=>{if(!t||!t.AdaptationSet||0===t.AdaptationSet.length)return void e();const n=[];t.AdaptationSet.forEach((t=>{n.push(function(t){return new Promise((e=>{if(!t.Representation||0===t.Representation.length)return void e();const n=[];t.Representation.forEach((t=>{n.push(function(t){const e=[],n=o.getCustomCapabilitiesFilters();return n&&0!==n.length?n.forEach((n=>{e.push(new Promise((e=>e(n(t)))))})):e.push(Promise.resolve(!0)),Promise.all(e)}(t))})),Promise.all(n).then((n=>{t.Representation=t.Representation.filter(((t,e)=>{let a=n[e].every((t=>t));return a||s.debug("[Stream] Representation "+t.id+" has been removed because of unsupported CustomFilter"),a})),e()})).catch((t=>{s.warn("[Stream] at least one promise rejected in CustomFilter with error: ",t),e()}))}))}(t))})),Promise.all(n).then((()=>{t.AdaptationSet=t.AdaptationSet.filter((t=>t.Representation&&t.Representation.length>0)),e()})).catch((()=>{e()}))}))}(t))})),Promise.all(e)}(t)))).then((()=>{n()})).catch((t=>{s.error(t),n()}))}))}},s=(0,C.A)(t).getInstance().getLogger(n),n}ui.__dashjs_factory_name="CapabilitiesFilter";var ci=N.A.getSingletonFactory(ui),di=class{constructor(){this.t=null,this.xywh=null,this.track=null,this.id=null,this.s=null,this.r=null}};function fi(){let t,e;return t={initialize:function(t){if(e=new di,!t)return null;const n=t.indexOf("#");if(-1!==n){const a=t.substr(n+1).split("&");for(let t=0,n=a.length;t0?(n&&e.warn("Supplied minimum playback rate is a positive value when it should be negative or 0. The supplied rate will not be applied and set to 0: 100% playback speed."),0):t<-.5?(n&&e.warn("Supplied minimum playback rate is out of range and will be limited to -0.5: -50% playback speed."),-.5):t}function l(t,n){return isNaN(t)?0:t<0?(n&&e.warn("Supplied maximum playback rate is a negative value when it should be negative or 0. The supplied rate will not be applied and set to 0: 100% playback speed."),0):t>1?(n&&e.warn("Supplied maximum playback rate is out of range and will be limited to 1: 200% playback speed."),1):t}function s(){const t=u(),e=n.getLiveDelay();return!isNaN(e)&&e>0?Math.min(t,e):t}function u(){return i.get().streaming.buffer.bufferTimeDefault>0?i.get().streaming.buffer.bufferTimeDefault:c()?20:12}function c(){return null!==i.get().streaming.buffer.fastSwitchEnabled?i.get().streaming.buffer.fastSwitchEnabled:!n.getLowLatencyModeEnabled()}return t={getCatchupMaxDrift:function(){if(!isNaN(i.get().streaming.liveCatchup.maxDrift)&&i.get().streaming.liveCatchup.maxDrift>=0)return i.get().streaming.liveCatchup.maxDrift;const t=a.getServiceDescriptionSettings();return t&&t.liveCatchup&&!isNaN(t.liveCatchup.maxDrift)&&t.liveCatchup.maxDrift>=0?t.liveCatchup.maxDrift:12},getCatchupModeEnabled:function(){return null!==i.get().streaming.liveCatchup.enabled?i.get().streaming.liveCatchup.enabled:n.getInitialCatchupModeActivated()},getBufferTimeDefault:s,getBufferTimeDefaultUnadjusted:u,getFastSwitchEnabled:c,getInitialBufferLevel:function(){const t=i.get().streaming.buffer.initialBufferLevel;return isNaN(t)||t<0?0:Math.min(s(),t)},getRetryAttemptsForType:function(t){const e=isNaN(i.get().streaming.retryAttempts.lowLatencyMultiplyFactor)?5:i.get().streaming.retryAttempts.lowLatencyMultiplyFactor;return n.getLowLatencyModeEnabled()?i.get().streaming.retryAttempts[t]*e:i.get().streaming.retryAttempts[t]},getRetryIntervalsForType:function(t){const e=isNaN(i.get().streaming.retryIntervals.lowLatencyReductionFactor)?10:i.get().streaming.retryIntervals.lowLatencyReductionFactor;return n.getLowLatencyModeEnabled()?i.get().streaming.retryIntervals[t]/e:i.get().streaming.retryIntervals[t]},getCatchupPlaybackRates:function(t){const e=i.get().streaming.liveCatchup.playbackRate;if(!isNaN(e.min)||!isNaN(e.max))return{min:o(e.min,t),max:l(e.max,t)};const n=a.getServiceDescriptionSettings();if(n&&n.liveCatchup&&(!isNaN(n.liveCatchup.playbackRate.min)||!isNaN(n.liveCatchup.playbackRate.max))){const e=n.liveCatchup.playbackRate;return{min:o(e.min,t),max:l(e.max,t)}}return{min:-.5,max:.5}},getAbrBitrateParameter:function(t,e){try{const n=i.get().streaming.abr[t][e];if(!isNaN(n)&&-1!==n)return n;const r=a.getServiceDescriptionSettings();return r&&r[t]&&!isNaN(r[t][e])?r[t][e]:-1}catch(t){return-1}},setConfig:function(t){t.playbackController&&(n=t.playbackController),t.serviceDescriptionController&&(a=t.serviceDescriptionController)},reset:function(){}},e=(0,C.A)(r).getInstance().getLogger(t),t}pi.__dashjs_factory_name="MediaPlayerModel";var bi=N.A.getSingletonFactory(pi);const yi={DEFAULT:.5,STRONG:1,WEAK:0};function Ei(t,e,n,a){let r,i,o,l,s;return i=void 0===t?null:t,o=function(t){let e=yi.DEFAULT;return t!==yi.DEFAULT&&t!==yi.STRONG&&t!==yi.WEAK||(e=t),e}(n),l=void 0===e?null:e,s=void 0===a?null:a,r={representation:i,reason:l,rule:s,priority:o},r}Ei.__dashjs_factory_name="SwitchRequest";const _i=N.A.getClassFactory(Ei);_i.NO_CHANGE=null,_i.PRIORITY=yi,N.A.updateClassFactory(Ei.__dashjs_factory_name,_i);var Ai=_i;function Ti(t){t=t||{};const e=this.context,n=t.dashMetrics;let a,r;return a={getSwitchRequest:function(t){try{const a=Ai(e).create();a.rule=this.getClassName();const r=t.getMediaInfo(),i=t.getMediaType(),o=n.getCurrentBufferState(i),l=t.getScheduleController(),s=t.getAbrController(),u=t.getStreamInfo(),c=u?u.id:null,d=u&&u.manifestInfo?u.manifestInfo.isDynamic:null,f=t.getThroughputController(),g=f.getSafeAverageThroughput(i),m=f.getAverageLatency(i);return isNaN(g)||!o||s.getAbandonmentStateFor(c,i)===I.ALLOW_LOAD&&(o.state===I.BUFFER_LOADED||d)&&(a.representation=s.getOptimalRepresentationForBitrate(r,g,!0),a.reason={throughput:g,latency:m,message:`[ThroughputRule]: Switching to Representation with bitrate ${a.representation?a.representation.bitrateInKbit:"n/a"} kbit/s. Throughput: ${g}`},l.setTimeToLoadDelay(0)),a}catch(t){return r.error(t),Ai(e).create()}},reset:function(){}},r=(0,C.A)(e).getInstance().getLogger(a),a}Ti.__dashjs_factory_name="ThroughputRule";var vi=N.A.getClassFactory(Ti);function wi(t){t=t||{};const e=this.context,n=(0,k.A)(e).getInstance(),a=t.dashMetrics,r=(0,K.A)(e).getInstance();let i,o,l;function s(){const t=r.get().streaming.abr.rules.insufficientBufferRule.parameters.segmentIgnoreCount;l={},l[w.A.VIDEO]={ignoreCount:t},l[w.A.AUDIO]={ignoreCount:t}}function u(){s()}function c(t){isNaN(t.startTime)||t.mediaType!==w.A.AUDIO&&t.mediaType!==w.A.VIDEO||l[t.mediaType].ignoreCount>0&&l[t.mediaType].ignoreCount--}return i={getSwitchRequest:function(t){const n=Ai(e).create();if(n.rule=this.getClassName(),!t||!t.hasOwnProperty("getMediaType"))return n;const i=t.getMediaType(),s=a.getCurrentBufferState(i),u=t.getRepresentation().fragmentDuration;if(!function(t,e,n){return!t.getLowLatencyModeEnabled()&&l[e].ignoreCount<=0&&n}(t.getScheduleController().getPlaybackController(),i,u))return n;const c=t.getMediaInfo(),d=t.getAbrController();if(s&&s.state===I.BUFFER_EMPTY)o.debug("["+i+"] Switch to index 0; buffer is empty."),n.representation=d.getOptimalRepresentationForBitrate(c,0,!0),n.reason={message:"[InsufficientBufferRule]: Switching to lowest Representation because buffer is empty"};else{const e=t.getThroughputController(),o=a.getCurrentBufferLevel(i),l=e.getAverageThroughput(i,null,NaN)*r.get().streaming.abr.rules.insufficientBufferRule.parameters.throughputSafetyFactor*o/u;if(isNaN(l)||l<=0)return n;n.representation=d.getOptimalRepresentationForBitrate(c,l,!0),n.reason={message:"[InsufficientBufferRule]: Limiting maximum bitrate to avoid a buffer underrun.",bitrate:l}}return n},reset:function(){s(),n.off(D.A.PLAYBACK_SEEKING,u,i),n.off(R.A.BYTES_APPENDED_END_FRAGMENT,c,i)}},o=(0,C.A)(e).getInstance().getLogger(i),s(),n.on(D.A.PLAYBACK_SEEKING,u,i),n.on(R.A.BYTES_APPENDED_END_FRAGMENT,c,i),i}wi.__dashjs_factory_name="InsufficientBufferRule";var Si=N.A.getClassFactory(wi);function Ii(t){const e=(t=t||{}).mediaPlayerModel,n=t.dashMetrics,a=this.context,r=(0,K.A)(a).getInstance();let i,o,l;function s(){l={}}return i={shouldAbandon:function(t){const i=Ai(a).create();i.rule=this.getClassName();try{if(!t)return i;const a=t.getCurrentRequest();if(!isNaN(a.index)){if(null===a.firstByteDate||l.hasOwnProperty(a.index))return i;const o=e.getBufferTimeDefault(),s=t.getMediaType();if(n.getCurrentBufferLevel(s)>o)return i;const u=Date.now()-a.firstByteDate.getTime();if(a.traces.length>=r.get().streaming.abr.rules.abandonRequestsRule.parameters.minThroughputSamplesThreshold&&u>r.get().streaming.abr.rules.abandonRequestsRule.parameters.minSegmentDownloadTimeThresholdInMs&&a.bytesLoadedt+e.b[0]),0)-e.traces[0].b[0],s=Math.max(e.traces.reduce(((t,e)=>t+e.d),0)-e.traces[0].d,1),u=Math.round(8*o/s),c=Number(8*e.bytesTotal/u/1e3).toFixed(2),d=t.getRepresentation(),f=t.getAbrController();if(ce.bytesTotal*s.bitrateInKbit/c.bitrateInKbit&&(n.representation=s,n.reason={throughputInKbit:u,message:`[AbandonRequestRule][${i} is asking to abandon and switch to quality to ${s.absoluteIndex}. The measured bandwidth was ${u} kbit/s`},l[e.index]=!0)}return n}(t,a,i)}return i}catch(t){return o.error(t),i}},reset:s},o=(0,C.A)(a).getInstance().getLogger(i),s(),i}Ii.__dashjs_factory_name="AbandonRequestsRule";var ki=N.A.getClassFactory(Ii);function Ri(){const t=this.context,e=(0,K.A)(t).getInstance();let n;return n={getSwitchRequest:function(n){const a=Ai(t).create();if(a.rule=this.getClassName(),!n||!n.hasOwnProperty("getDroppedFramesHistory"))return a;const r=n.getDroppedFramesHistory();if(!r)return a;const i=n.getStreamInfo().id,o=n.getMediaInfo(),l=n.getAbrController(),s=r.getFrameHistory(i);if(!s||0===Object.keys(s).length)return a;let u=0,c=0;const d=l.getPossibleVoRepresentationsFilteredBySettings(o,!0);let f=null;for(let t=1;te.get().streaming.abr.rules.droppedFramesRule.parameters.minimumSampleSize&&u/c>e.get().streaming.abr.rules.droppedFramesRule.parameters.droppedFramesPercentageThreshold)){f=d[t-1];break}}return f&&(a.representation=f,a.reason={droppedFrames:u,message:`[DroppedFramesRule]: Switching to index ${f.absoluteIndex}. Dropped Frames: ${u}, Total Frames: ${c}`}),a}},n}Ri.__dashjs_factory_name="DroppedFramesRule";var Ni=N.A.getClassFactory(Ri);function Ci(){const t=this.context,e=(0,K.A)(t).getInstance();let n;return n={getSwitchRequest:function(n){const a=Ai(t).create();if(a.rule=this.getClassName(),!n)return a;const r=n.getStreamInfo().id,i=n.getMediaType(),o=n?n.getSwitchRequestHistory():null,l=o?o.getSwitchRequests(r,i):{},s=n.getAbrController(),u=n.getMediaInfo(),c=s.getPossibleVoRepresentationsFilteredBySettings(u,!0);let d=0,f=0;for(let t=0;t=e.get().streaming.abr.rules.switchHistoryRule.parameters.sampleSize&&d/f>e.get().streaming.abr.rules.switchHistoryRule.parameters.switchPercentageThreshold)){a.representation=t>0&&l[n.id].drops>0?c[t-1]:n,a.reason={drops:d,noDrops:f,message:`[SwitchHistoryRule]: Switch to index: ${a.representation.absoluteIndex} samples: ${d+f} drops: ${d}`};break}}return a}},n}Ci.__dashjs_factory_name="SwitchHistoryRule";var Di=N.A.getClassFactory(Ci);const xi="BOLA_STATE_ONE_BITRATE",Mi="BOLA_STATE_STARTUP",zi="BOLA_STATE_STEADY",Oi=10;function Li(t){t=t||{};const e=this.context,n=t.dashMetrics,a=t.mediaPlayerModel,r=(0,k.A)(e).getInstance(),i=co(e).getInstance();let o,l,s;function u(t){const e=t.mediaType,n=t.streamId,a=e===w.A.AUDIO?[w.A.AUDIO]:s[n];for(const t in a)s[n]&&s[n].hasOwnProperty(t)&&s[n][t].state===zi&&(s[n][t].placeholderBuffer=0)}function c(t){const e=t.streamId;for(const t in s[e])if(s[e].hasOwnProperty(t)){const n=s[e][t];n.state!==xi&&(n.state=Mi,d(n))}}function d(t){t.placeholderBuffer=0,t.mostAdvancedSegmentStart=NaN,t.lastSegmentWasReplacement=!1,t.lastSegmentStart=NaN,t.lastSegmentDurationS=NaN,t.lastSegmentRequestTimeMs=NaN,t.lastSegmentFinishTimeMs=NaN}function f(t){try{if(t&&t.metric===I.HTTP_REQUEST&&t.value&&t.value.type===z.G.MEDIA_SEGMENT_TYPE&&t.value.trace&&t.value.trace.length){const e=s[t.value._streamId]&&s[t.value._streamId][t.mediaType]?s[t.value._streamId][t.mediaType]:null;e&&e.state!==xi&&(e.lastSegmentRequestTimeMs=t.value.trequest.getTime(),e.lastSegmentFinishTimeMs=t.value._tfinish.getTime(),g(e,t.mediaType))}}catch(t){l.error(t)}}function g(t,e){if(!isNaN(t.lastSegmentStart)&&!isNaN(t.lastSegmentRequestTimeMs)&&!isNaN(t.placeholderBuffer)){if(t.placeholderBuffer*=.99,!isNaN(t.lastSegmentFinishTimeMs)){const a=n.getCurrentBufferLevel(e)+.001*(t.lastSegmentFinishTimeMs-t.lastSegmentRequestTimeMs),r=b(t,t.currentRepresentation),i=Math.max(0,r-a);t.placeholderBuffer=Math.min(i,t.placeholderBuffer)}t.lastSegmentWasReplacement&&!isNaN(t.lastSegmentDurationS)&&(t.placeholderBuffer+=t.lastSegmentDurationS),t.lastSegmentStart=NaN,t.lastSegmentRequestTimeMs=NaN}}function m(t){if(t&&s[t.streamId]&&s[t.streamId][t.mediaType]){const e=s[t.streamId][t.mediaType];e&&e.state!==xi&&(e.currentRepresentation=t.newRepresentation)}}function h(t,e,n){const a=n.reduce(((t,e,a)=>e>n[t]?a:t),0);if(0===a)return null;const r=Math.max(t,Oi+2*e.length),i=(n[a]-1)/(r/Oi-1);return{gp:i,Vp:Oi/i}}function p(t,e){const r=a.getBufferTimeDefault();if(t.bufferTimeDefault!==r){const a=h(r,t.representations,t.utilities);if(a.Vp!==t.Vp||a.gp!==t.gp){const i=n.getCurrentBufferLevel(e);let o=i+t.placeholderBuffer;o-=Oi,o*=a.Vp/t.Vp,o+=Oi,t.bufferTimeDefault=r,t.Vp=a.Vp,t.gp=a.gp,t.placeholderBuffer=Math.max(0,o-i)}}}function b(t,e){return t.Vp*(t.utilities[e.absoluteIndex]+t.gp)}function y(t){if(t&&t.chunk&&t.chunk.representation.mediaInfo&&s[t.streamId]){const e=s[t.streamId][t.chunk.representation.mediaInfo.type];if(e&&e.state!==xi){const n=t.chunk.start;isNaN(e.mostAdvancedSegmentStart)||n>e.mostAdvancedSegmentStart?(e.mostAdvancedSegmentStart=n,e.lastSegmentWasReplacement=!1):e.lastSegmentWasReplacement=!0,e.lastSegmentStart=n,e.lastSegmentDurationS=t.chunk.duration,e.currentRepresentation=t.chunk.representation,g(e,t.chunk.representation.mediaInfo.type)}}}function E(){T()}function _(t,e){const n=e.absoluteIndex,a=e.bandwidth,r=t.utilities[n];let i=0;for(let e=n-1;e>=0;--e)if(t.utilities[e]0?_(e,e.currentRepresentation):Oi;const i=Math.max(0,r-a);e.placeholderBuffer=Math.min(e.placeholderBuffer,i)}}}function T(){s={}}return o={getSwitchRequest:function(t){try{const r=Ai(e).create();t.getScheduleController().setTimeToLoadDelay(0),r.rule=this.getClassName(),r.reason=r.reason||{};const o=function(t){const e=t.getMediaType(),n=t.getStreamInfo().id;s[n]||(s={},s[n]={});let r=s[n][e];return r?r.state!==xi&&p(r,e):(r=function(t){const e={},n=t.getMediaInfo(),r=i.getPossibleVoRepresentationsFilteredBySettings(n,!0);let o=r.map((t=>t.bandwidth)).map((t=>Math.log(t)));o=o.map((t=>t-o[0]+1));const l=a.getBufferTimeDefault(),s=h(l,r,o);return s?(e.state=Mi,e.representations=r,e.utilities=o,e.bufferTimeDefault=l,e.Vp=s.Vp,e.gp=s.gp,e.currentRepresentation=null,d(e)):e.state=xi,e}(t),s[n][e]=r),r}(t);switch(r.reason.state=o.state,o.state){case xi:break;case Mi:!function(t,e,a){const r=e.getMediaType(),o=e.getThroughputController().getSafeAverageThroughput(r);if(isNaN(o))return;const l=e.getMediaInfo(),s=i.getOptimalRepresentationForBitrate(l,o,!0),u=n.getCurrentBufferLevel(r);t.representation=s,t.reason.throughput=o,a.placeholderBuffer=Math.max(0,_(a,s)-u),a.currentRepresentation=s,!isNaN(a.lastSegmentDurationS)&&u>=a.lastSegmentDurationS&&(a.state=zi)}(r,t,o);break;case zi:!function(t,e,a){const r=e.getMediaType(),o=e.getThroughputController(),l=e.getMediaInfo(),s=o.getSafeAverageThroughput(r),u=e.getScheduleController();!function(t,e){const n=Date.now();if(isNaN(t.lastSegmentFinishTimeMs)){if(!isNaN(t.lastCallTimeMs)){const e=.001*(n-t.lastCallTimeMs);t.placeholderBuffer+=Math.max(0,e)}}else{const e=.001*(n-t.lastSegmentFinishTimeMs);t.placeholderBuffer+=Math.max(0,e)}t.lastCallTimeMs=n,t.lastSegmentStart=NaN,t.lastSegmentRequestTimeMs=NaN,t.lastSegmentFinishTimeMs=NaN,p(t,e)}(a,r);const c=n.getCurrentBufferLevel(r);let d=function(t,e){const n=t.representations.length;let a=NaN,r=NaN;for(let i=0;i=r)&&(r=n,a=i)}return t.representations[a]}(a,c+a.placeholderBuffer);const f=i.getOptimalRepresentationForBitrate(l,s,!0);d.absoluteIndex>a.currentRepresentation.absoluteIndex&&d.absoluteIndex>f.absoluteIndex&&(d=f.absoluteIndex>a.currentRepresentation.absoluteIndex?f:a.currentRepresentation);let g=Math.max(0,c+a.placeholderBuffer-b(a,d));g<=a.placeholderBuffer?(a.placeholderBuffer-=g,g=0):(g-=a.placeholderBuffer,a.placeholderBuffer=0,i.isPlayingAtTopQuality(d)?g=0:u.setTimeToLoadDelay(1e3*g)),t.representation=d,t.reason.throughput=s,t.reason.bufferLevel=c,t.reason.placeholderBuffer=a.placeholderBuffer,t.reason.delay=g,a.currentRepresentation=d}(r,t,o);break;default:!function(t,e,n){l.debug("BOLA ABR rule invoked in bad state.");const a=e.getMediaInfo(),r=e.getMediaType(),o=e.getThroughputController().getSafeAverageThroughput(r);t.representation=i.getOptimalRepresentationForBitrate(a,o,!0),t.reason.state=n.state,t.reason.throughput=o,n.state=Mi,d(n)}(r,t,o)}return r}catch(t){return l.error(t),Ai(e).create()}},handleNewMediaInfo:function(t){t&&t.streamInfo&&t.type&&s[t.streamInfo.id]&&s[t.streamInfo.id][t.type]&&delete s[t.streamInfo.id][t.type]},reset:function(){T(),r.off(D.A.BUFFER_EMPTY,u,o),r.off(D.A.PLAYBACK_SEEKING,c,o),r.off(D.A.METRIC_ADDED,f,o),r.off(D.A.QUALITY_CHANGE_REQUESTED,m,o),r.off(D.A.FRAGMENT_LOADING_ABANDONED,A,o),r.off(R.A.MEDIA_FRAGMENT_LOADED,y,o),r.off(R.A.SETTING_UPDATED_MAX_BITRATE,E,o),r.off(R.A.SETTING_UPDATED_MIN_BITRATE,E,o)}},l=(0,C.A)(e).getInstance().getLogger(o),T(),r.on(D.A.BUFFER_EMPTY,u,o),r.on(D.A.PLAYBACK_SEEKING,c,o),r.on(D.A.METRIC_ADDED,f,o),r.on(D.A.QUALITY_CHANGE_REQUESTED,m,o),r.on(D.A.FRAGMENT_LOADING_ABANDONED,A,o),r.on(R.A.MEDIA_FRAGMENT_LOADED,y,o),r.on(R.A.SETTING_UPDATED_MAX_BITRATE,E,o),r.on(R.A.SETTING_UPDATED_MIN_BITRATE,E,o),o}Li.__dashjs_factory_name="BolaRule";var Pi=N.A.getClassFactory(Li);const Fi="L2A_STATE_ONE_BITRATE",Ui="L2A_STATE_STARTUP",ji="L2A_STATE_STEADY",Bi=Math.pow(4,.99);function qi(t){t=t||{};const e=this.context,n=t.dashMetrics,a=(0,k.A)(e).getInstance();let r,i,o,l;function s(t){t.placeholderBuffer=0,t.mostAdvancedSegmentStart=NaN,t.lastSegmentWasReplacement=!1,t.lastSegmentStart=NaN,t.lastSegmentDurationS=NaN,t.lastSegmentRequestTimeMs=NaN,t.lastSegmentFinishTimeMs=NaN,t.lastSegmentUrl=""}function u(){for(const t in i)if(i.hasOwnProperty(t)){const e=i[t];e.state!==Fi&&(e.state=Ui,s(e))}}function c(t){if(t&&t.chunk&&t.chunk.representation&&t.chunk.representation.mediaInfo){const e=i[t.chunk.representation.mediaInfo.type],n=o[t.chunk.representation.mediaInfo.type];if(e&&e.state!==Fi){const a=t.chunk.start;isNaN(e.mostAdvancedSegmentStart)||a>e.mostAdvancedSegmentStart?(e.mostAdvancedSegmentStart=a,e.lastSegmentWasReplacement=!1):e.lastSegmentWasReplacement=!0,e.lastSegmentStart=a,e.lastSegmentDurationS=t.chunk.duration,e.currentRepresentation=t.chunk.representation,f(e,n)}}}function d(t){if(t&&t.metric===I.HTTP_REQUEST&&t.value&&t.value.type===z.G.MEDIA_SEGMENT_TYPE&&t.value.trace&&t.value.trace.length){const e=i[t.mediaType],n=o[t.mediaType];e&&e.state!==Fi&&(e.lastSegmentRequestTimeMs=t.value.trequest.getTime(),e.lastSegmentFinishTimeMs=t.value._tfinish.getTime(),f(e,n))}}function f(t,e){isNaN(t.lastSegmentStart)||isNaN(t.lastSegmentRequestTimeMs)||(e.segment_request_start_s=.001*t.lastSegmentRequestTimeMs,e.segment_download_finish_s=.001*t.lastSegmentFinishTimeMs,t.lastSegmentStart=NaN,t.lastSegmentRequestTimeMs=NaN)}function g(t,e){if(t.length!==e.length)return-1;let n=0;for(let a=0;a=d.B_target){a.state=ji,d.Q=Bi;for(let t=0;ts&&(n=-1),d.w[t]=d.prev_w[t]+n*(e/(2*m))*((d.Q+Bi)*(f*a.bitrateInKbit/s))}d.w=function(t){const e=t.length;let n=!1,a=[];for(let n=0;n=r[t+1]){n=!0;break}n||(o=(i+r[e-1]-1)/e);for(let t=0;tt.bandwidth));d.Q=Math.max(0,d.Q-e+e*f*((g(h,d.prev_w)+g(h,r))/s));let p=[];for(let t=0;ta.currentRepresentation.absoluteIndex&&h[a.currentRepresentation.absoluteIndex+1]<=s&&(c=i.getRepresentationByAbsoluteIndex(a.currentRepresentation.absoluteIndex+1,o,!0)),c.bitrateInKbit>=s&&(d.Q=2*Math.max(Bi,d.Q)),a.lastSegmentUrl=u.url}e.representation=c,a.currentRepresentation=e.representation}(t,a,u);break;default:!function(t,e,n){const a=t.getAbrController(),r=t.getMediaInfo(),i=t.getMediaType(),o=t.getThroughputController().getSafeAverageThroughput(i);e.representation=a.getOptimalRepresentationForBitrate(r,o,!0),e.reason.throughput=o,n.state=Ui,s(n)}(t,a,u)}return a}catch(t){return l.error(t),Ai(e).create()}},reset:function(){m(),a.off(R.A.PLAYBACK_SEEKING,u,r),a.off(R.A.MEDIA_FRAGMENT_LOADED,c,r),a.off(R.A.METRIC_ADDED,d,r)}},l=(0,C.A)(e).getInstance().getLogger(r),m(),a.on(R.A.PLAYBACK_SEEKING,u,r),a.on(R.A.MEDIA_FRAGMENT_LOADED,c,r),a.on(R.A.METRIC_ADDED,d,r),r}qi.__dashjs_factory_name="L2ARule";var Gi=N.A.getClassFactory(qi);function Hi(){const t=this.context;let e,n,a,r,i,o,l,s,u;function c(){a=null,r=1,i=100,o=0,l=null,s=null,u="dynamic_weight_selection"}function d(){let t=0;if(a)for(let e=0;et&&(t=n.state.throughput)}return t}function f(t,e,n){let a=t.map(((t,a)=>n[a]*Math.pow(t-e[a],2))).reduce(((t,e)=>t+e));return(a<0?-1:1)*Math.sqrt(Math.abs(a))}function g(t,e){return f([t.state.throughput,t.state.latency,t.state.rebuffer,t.state.switch],[e.state.throughput,e.state.latency,e.state.rebuffer,e.state.switch],[1,1,1,1])}function m(t,e){for(let n=0;nt.bandwidth));o=Math.min(...i),r=function(t){const e=t.map((t=>Math.pow(t,2))).reduce(((t,e)=>t+e));return Math.sqrt(e)}(i),n.forEach((t=>{let e={representation:t,state:{throughput:t.bandwidth/r,latency:0,rebuffer:0,switch:0}};a.push(e)})),s=function(t){let e=[],n=function(t){let e=[];for(let n=0;nr)&&(t=o,r=l)}e.push(t)}let r=null,i=null;for(let t=0;tr)&&(r=n,i=t)}let o=[];for(o.push(e[i]),e.splice(i,1);e.length>0;){let t=null,n=null;for(let r=0;r1&&(A=d()),g/=i;let T=a.find((t=>t.representation.id===b.id)),v=T.representation.bandwidth*y.getSegmentDuration()/_,w=Math.max(0,v-h);if(h-vn&&e>o.representation.bandwidth&&(n=o.representation.bandwidth,r=o)}return r}(T,_).representation;switch(u){case"manual_weight_selection":l=[.4,.4,.4,.4];break;case"random_weight_selection":l=function(t){let e=[],n=Math.sqrt(2/t);for(let t=0;t<4;t++)e.push(Math.random()*n);return l=e,l}(a.length);break;default:!function(t,e,n,r,i,o){l||(l=s[s.length-1]);let u=t.findWeightVector(a,e,n,r,i,o);null!==u&&-1!==u&&(l=u)}(y,E,h,w,_,p)}let S=null,I=null,k=null;for(let t=0;tc-1e4||d)&&e.representation.bandwidth!==o&&(s[0]=100);let g=f(i,[A,0,0,0],s);(null===S||gn?t-n:t+n-e,a}return e={getMinBuffer:function(){return l},getSegmentDuration:c,getNextBufferWithBitrate:function(t,e,n){return d(e,t*s/n)},getNextBuffer:d,findWeightVector:function(t,e,n,a,c,f){let g=null,m=null,h=null,p=Math.abs(e-i);return t.forEach((t=>{r.forEach((a=>{a[0];let r,i=a[1],b=a[2],y=(a[3],t.representation.bandwidth*s/c),E=d(n,y);r=0===b?10:1/b;let _=r*Math.max(1e-5,y-E);r=0===i?10:1/i;let A=r*t.state.latency,T=u.calculateSingleUseQoe(t.representation.bandwidth,_,A,f);(null===g||T>g)&&function(t,e,n){return!(t>o+n)&&e>=l}(e,E,p)&&(g=T,m=a,h=t.representation.bandwidth)}))})),null===m&&null===h&&(m=-1),i=e,m}},n=[.2,.4,.6,.8,1],a=4,r=function(t){let e=t.map((function(t){return[t]})),n=function(e,a,r){if(r===a)return e;let i=e.length;for(let n=0;nt.bandwidth)),_=t.getRepresentation().fragmentDuration,A=Math.min(...E)/1e3,T=Math.max(...E)/1e3,v=c.bandwidth/1e3,S=i.getCurrentHttpRequest(l,!0),k=(S.tresponse.getTime()-S.trequest.getTime())/1e3,R=k>_?k-_:0;r.setupPerSegmentQoe(_,T,A),r.logSegmentMetrics(v,R,p,b);let N=Xi(o).create({targetLatency:1.5,bufferMin:.3,segmentDuration:_,qoeEvaluator:r});return n.representation=a.getNextQuality(s,d,1e3*y,p,m,b,c,N),n.reason={throughput:y,latency:p},n.priority=Ai.PRIORITY.STRONG,g.setTimeToLoadDelay(0),n}catch(t){throw t}},reset:function(){a.reset(),r.reset()}},e=(0,C.A)(o).getInstance().getLogger(n),a=Yi(o).create(),r=Wi(o).create(),n}Qi.__dashjs_factory_name="LoLPRule";var Zi=N.A.getClassFactory(Qi);function Ji(t){t=t||{};const e=this.context,n=t.mediaPlayerModel,a=t.customParametersModel,r=t.dashMetrics,i=t.settings,o=(0,k.A)(e).getInstance();let l,s,u,c;function d(){Object.values(w.A.QUALITY_SWITCH_RULES).forEach((t=>{s=f(t,s)})),Object.values(w.A.ABANDON_FRAGMENT_RULES).forEach((t=>{u=f(t,u)})),a.getAbrCustomRules().forEach((function(t){t.type===w.A.RULES_TYPES.QUALITY_SWITCH_RULES&&s.push(t.rule(e).create()),t.type===w.A.RULES_TYPES.ABANDON_FRAGMENT_RULES&&u.push(t.rule(e).create())})),0===s.length&&(s.push(Pi(e).create({dashMetrics:r,mediaPlayerModel:n,settings:i})),s.push(vi(e).create({dashMetrics:r})))}function f(t,a){const o=t.charAt(0).toLowerCase()+t.slice(1);return i.get().streaming.abr.rules[o].active&&!function(t,e){return t.filter((t=>t.getClassName()===e)).length>0}(a,t)?(a.push(function(t){switch(t){case w.A.QUALITY_SWITCH_RULES.BOLA_RULE:return Pi(e).create({dashMetrics:r,mediaPlayerModel:n,settings:i});case w.A.QUALITY_SWITCH_RULES.THROUGHPUT_RULE:return vi(e).create({dashMetrics:r});case w.A.QUALITY_SWITCH_RULES.INSUFFICIENT_BUFFER_RULE:return Si(e).create({dashMetrics:r,settings:i});case w.A.QUALITY_SWITCH_RULES.SWITCH_HISTORY_RULE:return Di(e).create();case w.A.QUALITY_SWITCH_RULES.DROPPED_FRAMES_RULE:return Ni(e).create();case w.A.QUALITY_SWITCH_RULES.LEARN_TO_ADAPT_RULE:return Gi(e).create({dashMetrics:r,settings:i});case w.A.QUALITY_SWITCH_RULES.LOL_PLUS_RULE:return Zi(e).create({dashMetrics:r});case w.A.ABANDON_FRAGMENT_RULES.ABANDON_REQUEST_RULE:return ki(e).create({dashMetrics:r,mediaPlayerModel:n,settings:i})}}(t)),a):i.get().streaming.abr.rules[o].active?a:function(t,e){return t.filter((t=>t.getClassName()!==e))}(a,t)}function g(t){return t.filter((t=>t.representation!==Ai.NO_CHANGE))}function m(t){const e={};let n,a,r,i=null;if(0!==t.length){for(e[Ai.PRIORITY.STRONG]=null,e[Ai.PRIORITY.WEAK]=null,e[Ai.PRIORITY.DEFAULT]=null,n=0,a=t.length;n{e&&e.length&&e.forEach((e=>e.clearDataForStream&&"function"==typeof e.clearDataForStream&&e.clearDataForStream(t)))}))},getAbandonFragmentRules:function(){return u},getBestPossibleSwitchRequest:function(t){return t&&m(g(s.filter((e=>{const n=e.getClassName();if(n!==w.A.QUALITY_SWITCH_RULES.BOLA_RULE&&n!==w.A.QUALITY_SWITCH_RULES.THROUGHPUT_RULE)return!0;const a=t.getMediaType();return c[a]&&n===w.A.QUALITY_SWITCH_RULES.BOLA_RULE||!c[a]&&n===w.A.QUALITY_SWITCH_RULES.THROUGHPUT_RULE})).map((e=>e.getSwitchRequest(t)))))||Ai(e).create()},getBolaState:function(t){return c[t]},getMinSwitchRequest:m,getQualitySwitchRules:function(){return s},handleNewMediaInfo:function(t){s.forEach((e=>e.handleNewMediaInfo&&e.handleNewMediaInfo(t))),u.forEach((e=>e.handleNewMediaInfo&&e.handleNewMediaInfo(t)))},initialize:function(){s=[],u=[],c={},d(),o.on(R.A.SETTING_UPDATED_ABR_ACTIVE_RULES,h,l)},reset:function(){[s,u].forEach((t=>{t&&t.length&&t.forEach((t=>t.reset&&t.reset()))})),s=[],u=[],c={},o.off(R.A.SETTING_UPDATED_ABR_ACTIVE_RULES,h,l)},setBolaState:function(t,e){c[t]=e},shouldAbandonFragment:function(t){if(!t)return Ai(e).create();const n=m(g(u.map((e=>e.shouldAbandon(t)))));return n&&(n.reason.forceAbandon=!0),n||Ai(e).create()}},l}Ji.__dashjs_factory_name="ABRRulesCollection";const to=N.A.getClassFactory(Ji);N.A.updateSingletonFactory(Ji.__dashjs_factory_name,to);var eo=to;function no(t){let e;const n=(t=t||{}).abrController,a=t.throughputController,r=t.switchRequestHistory,i=t.droppedFramesHistory,o=t.currentRequest,l=t.streamProcessor?t.streamProcessor.getScheduleController():null,s=t.streamProcessor?t.streamProcessor.getRepresentation():null,u=t.videoModel?t.videoModel:null;function c(){return s?s.mediaInfo:null}return e={getAbrController:function(){return n},getCurrentRequest:function(){return o},getDroppedFramesHistory:function(){return i},getMediaInfo:c,getMediaType:function(){const t=c();return t?t.type:null},getRepresentation:function(){return s},getScheduleController:function(){return l},getStreamInfo:function(){const t=c();return t?t.streamInfo:null},getSwitchRequestHistory:function(){return r},getThroughputController:function(){return a},getVideoModel:function(){return u}},e}no.__dashjs_factory_name="RulesContext";var ao=N.A.getClassFactory(no);function ro(){let t={},e={};const n=this.context,a=(0,K.A)(n).getInstance();return{clearForStream:function(n){delete t[n],delete e[n]},getSwitchRequests:function(e,n){return null!=e&&null!=n&&t[e]&&t[e][n]?t[e][n]:{}},push:function(n){const r=n.currentRepresentation,i=n.newRepresentation;if(r.mediaInfo.streamInfo.id!==i.mediaInfo.streamInfo.id||i.mediaInfo.id!==r.mediaInfo.id)return;const o=r.mediaInfo.streamInfo.id;t[o]||function(n){t[n]={},e[n]={}}(o);const l=r.mediaInfo.type;t[o][l]||function(n,a){t[n][a]={},e[n][a]=[]}(o,l);const s=n.currentRepresentation.id;t[o][l][s]||function(e,n,a){t[e][n][a]={noDrops:0,drops:0,dropSize:0}}(o,l,s);let u=n.newRepresentation.absoluteIndex-n.currentRepresentation.absoluteIndex,c=u<0?1:0,d=c?-u:0,f=c?0:1;t[o][l][n.currentRepresentation.id].drops+=c,t[o][l][n.currentRepresentation.id].dropSize+=d,t[o][l][n.currentRepresentation.id].noDrops+=f,e[o][l].push({id:n.currentRepresentation.id,noDrop:f,drop:c,dropSize:d});const g=function(t,n){return e[t][n].length>a.get().streaming.abr.rules.switchHistoryRule.parameters.sampleSize?e[t][n].shift():null}(o,l);g&&function(e,n,a){t[e][n][a.id].drops-=a.drop,t[e][n][a.id].dropSize-=a.dropSize,t[e][n][a.id].noDrops-=a.noDrop}(o,l,g)},reset:function(){t={},e={}}}}ro.__dashjs_factory_name="SwitchRequestHistory";var io=N.A.getClassFactory(ro);function oo(){let t={},e={},n={};return{clearForStream:function(a){delete t[a],delete e[a],delete n[a]},getFrameHistory:function(e){return t[e]},push:function(a,r,i){if(!r)return;t[a]||function(a){t[a]=[],e[a]=0,n[a]=0}(a);let o=i&&i.droppedVideoFrames?i.droppedVideoFrames:0,l=i&&i.totalVideoFrames?i.totalVideoFrames:0,s=o-e[a];e[a]=o;let u=l-n[a];n[a]=l;const c=t[a];c[r]?(c[r].droppedVideoFrames+=s,c[r].totalVideoFrames+=u):c[r]={droppedVideoFrames:s,totalVideoFrames:u}},reset:function(){t={},e={},n={}}}}oo.__dashjs_factory_name="DroppedFramesHistory";var lo=N.A.getClassFactory(oo);function so(){const t=this.context,e=(0,C.A)(t).getInstance(),n=(0,k.A)(t).getInstance();let a,r,i,o,l,s,u,c,d,f,g,m,h,p,b,y,E,_,A,T,v;function S(){u={},s={},void 0===d&&(d=!1),_&&_.reset(),E&&E.reset(),y=void 0,_=void 0,E=void 0,clearTimeout(c),c=null}function N(t){let e=x(t,!(arguments.length>1&&void 0!==arguments[1])||arguments[1]);return e=function(t){try{return function(t){try{if(!v.get().streaming.cmsd.enabled||!v.get().streaming.cmsd.abr.applyMb)return t;const e=t.filter((t=>{const e=t.mediaInfo.type;let n=p.getMaxBitrate(e);if(e!==w.A.VIDEO||n<0)return!0;const a=t.mediaInfo.streamInfo.id;return n-=s[a][w.A.AUDIO].getRepresentation().bitrateInKbit||0,t.bitrateInKbit<=n}));return e.length>0?e:t}catch(e){return r.error(e),t}}(t=function(t){try{if(!v.get().streaming.abr.limitBitrateByPortal)return t;const{elementWidth:e}=g.getVideoElementSize(),n=t.filter((t=>t.mediaInfo.type!==w.A.VIDEO||t.width<=e));return n.length>0?n:t}catch(e){return r.error(e),t}}(t=function(t){try{const e=t.filter((t=>{const e=t.mediaInfo.type,n=t.bitrateInKbit,a=m.getAbrBitrateParameter("maxBitrate",e),r=m.getAbrBitrateParameter("minBitrate",e);return!(a>-1&&n>a||r>-1&&n0?e:t}catch(e){return r.error(e),t}}(t)))}catch(e){return r.error(e),t}}(e),e}function x(t,e){let n=[];if(!t)return n;const a=function(t){try{const e=[];if(t&&e.push(t),!v.get().streaming.abr.enableSupplementalPropertyAdaptationSetSwitching||!t.adaptationSetSwitchingCompatibleIds||0===t.adaptationSetSwitchingCompatibleIds.length)return e;const n=s[t.streamInfo.id][t.type].getAllMediaInfos().filter((e=>t.adaptationSetSwitchingCompatibleIds.includes(e.id)));return e.concat(n)}catch(e){return[t]}}(t);return a.forEach((t=>{let e=f.getVoRepresentations(t);e&&e.length>0&&(n=n.concat(e))})),n=function(t){return t=function(t){let e=null;return t.filter((t=>(e||(e=t.mediaInfo),!isNaN(t.qualityRanking)&&f.areMediaInfosEqual(e,t.mediaInfo)))).length===t.length}(t)?function(t){return t.sort(((t,e)=>e.qualityRanking-t.qualityRanking)),t}(t):function(t){return t.sort(((t,e)=>f.areMediaInfosEqual(t.mediaInfo,e.mediaInfo)?isNaN(t.pixelsPerSecond)||isNaN(e.pixelsPerSecond)||t.pixelsPerSecond===e.pixelsPerSecond?t.bandwidth-e.bandwidth:t.pixelsPerSecond-e.pixelsPerSecond:isNaN(t.pixelsPerSecond)||isNaN(e.pixelsPerSecond)||t.pixelsPerSecond===e.pixelsPerSecond?isNaN(t.bitsPerPixel)||isNaN(e.bitsPerPixel)?t.bandwidth-e.bandwidth:e.bitsPerPixel-t.bitsPerPixel:t.pixelsPerSecond-e.pixelsPerSecond)),t}(t)}(n),n.forEach(((t,e)=>{t.absoluteIndex=e})),n=n.filter((n=>{const a=!!e||f.areMediaInfosEqual(n.mediaInfo,t),r=!n||!n.mediaInfo||l.areKeyIdsUsable(n.mediaInfo);return a&&r})),n}function M(e){const n=e.request.mediaType,r=e.streamId;if(!(n&&r&&s[r]&&v.get().streaming.abr.autoSwitchBitrate[n]))return;const l=s[r][n];if(!l)return;const d=ao(t).create({abrController:a,streamProcessor:l,currentRequest:e.request,throughputController:A,adapter:f,videoModel:g}),m=i.shouldAbandonFragment(d);m&&m.representation!==Ai.NO_CHANGE&&function(t,e,n,a,r){if(a.getFragmentModel().getRequests({state:q.FRAGMENT_MODEL_LOADING,index:t.request.index})[0]){const t=function(t,e){return u[t]&&u[t][e]?u[t][e]:null}(e,n);t&&(t.state=I.ABANDON_LOAD),E.reset(),L(n,o.getActiveStreamInfo(),r.representation,r.reason),clearTimeout(c),c=setTimeout((()=>{t&&(u[e][n].state=I.ALLOW_LOAD),c=null}),v.get().streaming.abandonLoadTimeout)}}(e,r,n,l,m)}function z(t){t.mediaType===w.A.VIDEO&&(void 0!==y&&_.push(t.streamId,y,g.getPlaybackQuality()),y=t.newRepresentation.id)}function O(t){!F()||t.metric!==I.BUFFER_LEVEL||t.mediaType!==w.A.AUDIO&&t.mediaType!==w.A.VIDEO||function(t,e){try{const n=m.getBufferTimeDefault(),a=n,o=.5*n,l=i.getBolaState(t),s=e>=(l?o:a);i.setBolaState(t,s),s!==l&&(s?r.info("["+t+"] switching from throughput to buffer occupancy ABR rule (buffer: "+e.toFixed(3)+")."):r.info("["+t+"] switching from buffer occupancy to throughput ABR rule (buffer: "+e.toFixed(3)+")."))}catch(t){r.error(t)}}(t.mediaType,.001*t.value.level)}function L(t,e,n){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(!(e&&e.id&&t&&s&&s[e.id]&&s[e.id][t]&&n))return;const r=s[e.id][t].getRepresentation();r&&n.id===r.id||P(r,n,a)}function P(t,e,a){const i=e.mediaInfo.streamInfo.id,o=e.mediaInfo.type;if(o&&s[i]&&s[i][o]){const l=s[i][o].getStreamInfo(),u=T.getCurrentBufferLevel(o),c=null!==t&&!f.areMediaInfosEqual(t.mediaInfo,e.mediaInfo),d=t?t.bitrateInKbit:0;r.info(`[AbrController]: Switching quality in period ${i} for media type ${o}. Switch from bitrate ${d} to bitrate ${e.bitrateInKbit}. Current buffer level: ${u}. Reason:`+(a?JSON.stringify(a):"/")),n.trigger(R.A.QUALITY_CHANGE_REQUESTED,{oldRepresentation:t,newRepresentation:e,reason:a,streamInfo:l,mediaType:o,isAdaptationSetSwitch:c},{streamId:l.id,mediaType:o});const g=A.getAverageThroughput(o);isNaN(g)||b.setSavedBitrateSettings(o,g)}}function F(){return v.get().streaming.abr.rules.bolaRule.active&&v.get().streaming.abr.rules.throughputRule.active}return a={checkPlaybackQuality:function(e,n){try{if(!(e&&s&&s[n]&&s[n][e]))return!1;if(_){const t=g.getPlaybackQuality();t&&_.push(n,y,t)}if(!v.get().streaming.abr.autoSwitchBitrate[e])return!1;const r=s[n][e],o=r.getRepresentation(),l=ao(t).create({abrController:a,throughputController:A,switchRequestHistory:E,droppedFramesHistory:_,streamProcessor:r,adapter:f,videoModel:g}),c=i.getBestPossibleSwitchRequest(l);if(!c||!c.representation)return!1;let d=c.representation;return E.push({currentRepresentation:o,newRepresentation:d}),d.id!==o.id&&(u[n][e].state===I.ALLOW_LOAD||d.absoluteIndex0)return e;let n=NaN;if(b&&b.hasOwnProperty("getSavedBitrateSettings")&&(n=b.getSavedBitrateSettings(t)),!isNaN(n))return n;const a=A.getAverageThroughput(t);return!isNaN(a)&&a>0?a:t===w.A.VIDEO?1e3:100},getOptimalRepresentationForBitrate:function(t,e){const n=N(t,!(arguments.length>2&&void 0!==arguments[2])||arguments[2]);if(!n||0===n.length)return null;const a=n.reduce(((t,e)=>t.bandwidtht.bitrateInKbit<=e));return r&&0!==r.length?r.reduce(((t,e)=>e.absoluteIndex>t.absoluteIndex?e:t)):a},getPossibleVoRepresentations:function(t){return x(t,!(arguments.length>1&&void 0!==arguments[1])||arguments[1])},getPossibleVoRepresentationsFilteredBySettings:N,getRepresentationByAbsoluteIndex:function(t,e){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return isNaN(t)||t<0?null:N(e,n).find((e=>e.absoluteIndex===t))},handleNewMediaInfo:function(t){i.handleNewMediaInfo(t)},initialize:function(){_=lo(t).create(),E=io(t).create(),i=eo(t).create({dashMetrics:T,customParametersModel:h,mediaPlayerModel:m,settings:v}),i.initialize(),n.on(D.A.QUALITY_CHANGE_RENDERED,z,a),n.on(D.A.METRIC_ADDED,O,a),n.on(R.A.LOADING_PROGRESS,M,a)},isPlayingAtLowestQuality:function(t){return N(t.mediaInfo,!0)[0].id===t.id},isPlayingAtTopQuality:function(t){if(!t)return!0;const e=N(t.mediaInfo,!0);return e[e.length-1].id===t.id},registerStreamType:function(t,e){const n=e.getStreamInfo().id;s[n]||(s[n]={}),s[n][t]=e,u[n]||(u[n]={}),u[n][t]={},u[n][t].state=I.ALLOW_LOAD,void 0===i.getBolaState(t)&&i.setBolaState(t,v.get().streaming.abr.rules.bolaRule.active&&!F())},reset:function(){S(),n.off(D.A.QUALITY_CHANGE_RENDERED,z,a),n.off(D.A.METRIC_ADDED,O,a),n.off(R.A.LOADING_PROGRESS,M,a),i&&i.reset()},setConfig:function(t){t&&(t.streamController&&(o=t.streamController),t.throughputController&&(A=t.throughputController),t.domStorage&&(b=t.domStorage),t.mediaPlayerModel&&(m=t.mediaPlayerModel),t.customParametersModel&&(h=t.customParametersModel),t.cmsdModel&&(p=t.cmsdModel),t.dashMetrics&&(T=t.dashMetrics),t.adapter&&(f=t.adapter),t.videoModel&&(g=t.videoModel),t.settings&&(v=t.settings),t.capabilities&&(l=t.capabilities))},setPlaybackQuality:L,setWindowResizeEventCalled:function(t){d=t},unRegisterStreamType:function(t,e){try{s[t]&&s[t][e]&&delete s[t][e],u[t]&&u[t][e]&&delete u[t][e]}catch(t){}}},r=e.getLogger(a),S(),a}so.__dashjs_factory_name="AbrController";const uo=N.A.getSingletonFactory(so);N.A.updateSingletonFactory(so.__dashjs_factory_name,uo);var co=uo;const fo=new Map([[w.A.VIDEO_ELEMENT_READY_STATES.HAVE_METADATA,"loadedmetadata"],[w.A.VIDEO_ELEMENT_READY_STATES.HAVE_CURRENT_DATA,"loadeddata"],[w.A.VIDEO_ELEMENT_READY_STATES.HAVE_FUTURE_DATA,"canplay"],[w.A.VIDEO_ELEMENT_READY_STATES.HAVE_ENOUGH_DATA,"canplaythrough"]]);function go(){let t,e,n,a,r,i,o,l,s,u,c;const d=this.context,f=(0,k.A)(d).getInstance(),g=[];function m(t){a&&(arguments.length>1&&void 0!==arguments[1]&&arguments[1]?a.playbackRate=t:I(w.A.VIDEO_ELEMENT_READY_STATES.HAVE_FUTURE_DATA,(()=>{a.playbackRate=t})))}function h(){return g.length>0}function p(t){let e=g.indexOf(t);if(null!==t&&(-1!==e&&g.splice(e,1),n.get().streaming.buffer.syntheticStallEvents.enabled&&a&&!h())){const t=()=>{if(m(u||1,n.get().streaming.buffer.syntheticStallEvents.ignoreReadyState),!a.paused){const t=document.createEvent("Event");t.initEvent("playing",!0,!1),a.dispatchEvent(t)}};n.get().streaming.buffer.syntheticStallEvents.ignoreReadyState?t():(o&&o.func&&o.event&&E(o.event,o.func),o=I(w.A.VIDEO_ELEMENT_READY_STATES.HAVE_FUTURE_DATA,t))}}function b(){if(a&&h()&&0===a.playbackRate){const t=document.createEvent("Event");t.initEvent("waiting",!0,!1),a.dispatchEvent(t)}}function y(t,e){a&&a.addEventListener(t,e)}function E(t,e){a&&a.removeEventListener(t,e)}function _(){return a?a.readyState:NaN}function A(){return a?a.buffered:null}function T(){return a?a.clientWidth:NaN}function v(){return a?a.clientHeight:NaN}function S(t,e,n,r,i){if(a)for(let o=0;o=t?(e(),null):function(t,e){const n=()=>{E(t,n),e(t)};return y(t,n),{func:n,event:t}}(fo.get(t),e)}return t={addEventListener:y,addTextTrack:function(t,e,n,r,i){if(!a)return null;let o=S(t,e,n,r,i);return o||(o=a.addTextTrack(t,e,n),o.isEmbedded=i,o.isTTML=r),o},appendChild:function(t){a&&(a.appendChild(t),void 0!==t.isTTML&&(a.textTracks[a.textTracks.length-1].isTTML=t.isTTML,a.textTracks[a.textTracks.length-1].isEmbedded=t.isEmbedded))},getBufferRange:A,getClientHeight:v,getClientWidth:T,getElement:function(){return a},getEnded:function(){return a?a.ended:null},getPlaybackQuality:function(){if(!a)return null;let t="webkitDroppedFrameCount"in a&&"webkitDecodedFrameCount"in a,e=null;return"getVideoPlaybackQuality"in a?e=a.getVideoPlaybackQuality():t&&(e={droppedVideoFrames:a.webkitDroppedFrameCount,totalVideoFrames:a.webkitDroppedFrameCount+a.webkitDecodedFrameCount,creationTime:new Date}),e},getPlaybackRate:function(){return a?a.playbackRate:null},getPlayedRanges:function(){return a?a.played:null},getReadyState:_,getSource:function(){return a?a.src:null},getTTMLRenderingDiv:function(){return l},getTextTrack:S,getTextTracks:function(){return a?a.textTracks:[]},getTime:function(){return a?isNaN(r)?a.currentTime:r:null},getVideoElementSize:function(){const t=n.get().streaming.abr.usePixelRatioInLimitBitrateByPortal&&window.hasOwnProperty("devicePixelRatio")?window.devicePixelRatio:1;return{elementWidth:T()*t,elementHeight:v()*t}},getVideoHeight:function(){return a?a.videoHeight:NaN},getVideoRelativeOffsetLeft:function(){if(a){const t=a.parentNode.host||a.parentNode;return t?a.getBoundingClientRect().left-t.getBoundingClientRect().left:NaN}return NaN},getVideoRelativeOffsetTop:function(){if(a){const t=a.parentNode.host||a.parentNode;return t?a.getBoundingClientRect().top-t.getBoundingClientRect().top:NaN}return NaN},getVideoWidth:function(){return a?a.videoWidth:NaN},getVttRenderingDiv:function(){return s},initialize:function(){f.on(R.A.PLAYBACK_PLAYING,b,this)},isPaused:function(){return a?a.paused:null},isSeeking:function(){return a?a.seeking||!isNaN(r):null},isStalled:h,pause:function(){a&&(a.pause(),a.autoplay=!1)},play:function(){if(a){a.autoplay=!0;const t=a.play();t&&t.catch&&"undefined"!=typeof Promise&&t.catch((t=>{"NotAllowedError"===t.name&&f.trigger(R.A.PLAYBACK_NOT_ALLOWED),e.warn(`Caught pending play exception - continuing (${t})`)}))}},removeChild:function(t){a&&a.removeChild(t)},removeEventListener:E,reset:function(){clearTimeout(c),f.off(R.A.PLAYBACK_PLAYING,b,this),g.length=0},setConfig:function(t){t&&t.settings&&(n=t.settings)},setCurrentTime:function(t,e){a&&(i&&i.func&&i.event&&E(i.event,i.func),r=t,i=I(w.A.VIDEO_ELEMENT_READY_STATES.HAVE_METADATA,(()=>{if(a)if(a.currentTime!==r)try{r=e?function(t){const e=A();let n=t,a=9999999999;if(e)for(let r=0;r=i&&t<=o)return t;l=w.A.VIDEO_ELEMENT_READY_STATES.HAVE_FUTURE_DATA))){u=a.playbackRate,m(0,!0);const t=document.createEvent("Event");t.initEvent("waiting",!0,!1),a.dispatchEvent(t)}}(t):p(t)}(t,e)},setTTMLRenderingDiv:function(t){l=t,l.style.position="absolute",l.style.display="flex",l.style.overflow="hidden",l.style.pointerEvents="none",l.style.top=0,l.style.left=0},setVttRenderingDiv:function(t){s=t},waitForReadyState:I},e=(0,C.A)(d).getInstance().getLogger(t),n=(0,K.A)(d).getInstance(),r=NaN,t}go.__dashjs_factory_name="VideoModel";var mo=N.A.getSingletonFactory(go);const ho=[{oldKey:"dashjs_vbitrate",newKey:"dashjs_video_bitrate"},{oldKey:"dashjs_abitrate",newKey:"dashjs_audio_bitrate"},{oldKey:"dashjs_vsettings",newKey:"dashjs_video_settings"},{oldKey:"dashjs_asettings",newKey:"dashjs_audio_settings"}],po="dashjs_?_bitrate",bo="dashjs_?_settings",yo="localStorage",Eo="lastBitrate",_o="lastMediaSettings";function Ao(t){t=t||{};const e=this.context,n=t.settings;let a,r,i;function o(t){if(void 0!==i)return i;let e;i=!1;try{"undefined"!=typeof window&&(e=window[t])}catch(t){return r.warn("DOMStorage access denied: "+t.message),i}if(!e||t!==yo&&"sessionStorage"!==t)return i;try{e.setItem("1","1"),e.removeItem("1"),i=!0}catch(t){r.warn("DOMStorage is supported, but cannot be used: "+t.message)}return i}function l(){const t=6e5;return Math.round((new Date).getTime()/t)*t}function s(t,e){return o(t)&&n.get().streaming[e+"CachingInfo"].enabled}function u(){if(!n)throw new Error(w.A.MISSING_CONFIG_ERROR)}return a={getSavedBitrateSettings:function(t){if(u(),!n.get().streaming.lastBitrateCachingInfo.enabled)return NaN;let e=NaN;if(s(yo,Eo)){const a=po.replace(/\?/,t);try{const i=JSON.parse(localStorage.getItem(a))||{},o=(new Date).getTime()-parseInt(i.timestamp,10)>=n.get().streaming.lastBitrateCachingInfo.ttl||!1,l=parseFloat(i.bitrate);isNaN(l)||o?o&&localStorage.removeItem(a):(e=l,r.debug("Last saved bitrate for "+t+" was "+l))}catch(t){return null}}return e},setSavedBitrateSettings:function(t,e){if(s(yo,Eo)&&e){const n=po.replace(/\?/,t);try{localStorage.setItem(n,JSON.stringify({bitrate:e.toFixed(3),timestamp:l()}))}catch(t){r.error(t.message)}}},getSavedMediaSettings:function(t){if(u(),!n.get().streaming.lastMediaSettingsCachingInfo.enabled)return null;let e=null;if(s(yo,_o)){const a=bo.replace(/\?/,t);try{const t=JSON.parse(localStorage.getItem(a))||{},r=(new Date).getTime()-parseInt(t.timestamp,10)>=n.get().streaming.lastMediaSettingsCachingInfo.ttl||!1;e=t.settings,r&&(localStorage.removeItem(a),e=null)}catch(t){return null}}return e},setSavedMediaSettings:function(t,e){if(s(yo,_o)){const n=bo.replace(/\?/,t);try{localStorage.setItem(n,JSON.stringify({settings:e,timestamp:l()}))}catch(t){r.error(t.message)}}}},r=(0,C.A)(e).getInstance().getLogger(a),o(yo)&&ho.forEach((t=>{const e=localStorage.getItem(t.oldKey);if(e){localStorage.removeItem(t.oldKey);try{localStorage.setItem(t.newKey,e)}catch(t){r.error(t.message)}}})),a}Ao.__dashjs_factory_name="DOMStorage";var To=N.A.getSingletonFactory(Ao),vo=n(8986);function wo(){const t=this.context;let e,n,a,r,i,o,l,s,u,c,d,f;function g(t,e,a,i){let o=null;const s=t?f.resolve(t.path):null,u=i||{init:!0,url:s?s.url:void 0,range:{start:0,end:1500},searching:!1,bytesLoaded:0,bytesToLoad:1500,mediaType:e,representation:t};n.debug("Start searching for initialization.");const c=p(u);l.load({request:c,success:function(n){if(u.bytesLoaded=u.range.end,o=r.findInitRange(n),!o)return u.range.end=u.bytesLoaded+u.bytesToLoad,g(t,e,a,u);t.range=o,a(t)},error:function(){a(t)}}),n.debug("Perform init search: "+u.url)}function m(t,e,a,i,o,s){if(a&&(void 0===a.start||void 0===a.end)){const t=a?a.toString().split("-"):null;a=t?{start:parseFloat(t[0]),end:parseFloat(t[1])}:null}o=o||h;let u=null,c=null;const d=!!a,g=t?f.resolve(t.path):null,b={init:!1,url:g?g.url:void 0,range:d?a:{start:0,end:1500},searching:!d,bytesLoaded:s?s.bytesLoaded:0,bytesToLoad:1500,mediaType:e,representation:t},y=p(b);l.load({request:y,success:function(a){const l=b.bytesToLoad,s=a.byteLength;if(b.bytesLoaded=b.range.end-b.range.start,u=r.parse(a),c=u.getBox("sidx"),c&&c.isComplete){const a=c.references;let r,l;if(null!=a&&a.length>0&&(r=1===a[0].reference_type),r){let r,l,s,u,d;n.debug("Initiate multiple SIDX load."),b.range.end=b.range.start+c.size;let f=[],g=0,h=(c.offset||b.range.start)+c.size;const p=function(e){e?(f=f.concat(e),g++,g>=l&&(f.sort((function(t,e){return t.startTime-e.startTime<0?-1:0})),o(f,t,i))):o(null,t,i)};for(r=0,l=a.length;r{g(t,e,n)}))},loadSegments:function(t,e,n){return new Promise((a=>{m(t,e,n,a)}))},reset:function(){l&&(l.abort(),l=null)}},e}wo.__dashjs_factory_name="SegmentBaseLoader";var So=N.A.getSingletonFactory(wo);function Io(t){let e;t=t||{};let n=new DataView(t.data),a=0;function r(t,e){let r,i,o=!0,l=0;if(void 0===e&&(e=!1),t.tag>16777215?(n.getUint32(a)!==t.tag&&(o=!1),l=4):t.tag>65535?(r=n.getUint16(a),i=n.getUint8(a+2),256*r+i!==t.tag&&(o=!1),l=3):t.tag>255?(n.getUint16(a)!==t.tag&&(o=!1),l=2):(n.getUint8(a)!==t.tag&&(o=!1),l=1),!o&&t.required&&!e)throw new Error("required tag not found");return o&&(a+=l),o}function i(t){let e=1,r=128,i=-1,o=0,l=n.getUint8(a),s=0;for(s=0;s<8;s+=1){if((l&r)===r){o=void 0===t?l&~r:l,i=s;break}r>>=1}for(s=0;s4)return function(t){const e=Math.floor(Number.MAX_SAFE_INTEGER/256);let r=0;for(let i=0;ie)throw new Error("Value exceeds safe integer limit");r*=256;const t=n.getUint8(a+i);if(r>Number.MAX_SAFE_INTEGER-t)throw new Error("Value exceeds safe integer limit");r+=t}return a+=t,r}(t);let e=0;for(let r=0;r>>0},moreData:function(){return a{let r=null,i=t?u.resolve(t.path):null,o=t?t.range.split("-"):null,s={range:{start:o?parseFloat(o[0]):null,end:o?parseFloat(o[1]):null},request:r,url:i?i.url:void 0,init:!0,mediaType:e};n.info("Start loading initialization."),r=c(s),l.load({request:r,success:function(){a(t)},error:function(){a(t)}}),n.debug("Perform init load: "+s.url)}))},loadSegments:function(e,r,i){return new Promise((o=>{let d=null,f=e?u.resolve(e.path):null,g=f?f.url:void 0;d=c({bytesLoaded:0,bytesToLoad:8192,range:{start:0,end:8192},request:d,url:g,init:!1,mediaType:r,representation:e}),n.debug("Parsing ebml header"),l.load({request:d,success:function(r){!function(e,r,i,o){if(!e||0===e.byteLength)return void o(null);let s,u,d,f,g=ko(t).create({data:e}),m=i?i.split("-"):null,h=null,p={url:r,range:{start:m?parseFloat(m[0]):null,end:m?parseFloat(m[1]):null},request:h};for(n.debug("Parse EBML header: "+p.url),g.skipOverElement(a.EBML),g.consumeTag(a.Segment),d=g.getMatroskaCodedNum(),d+=g.getPos(),f=g.getPos();g.moreData()&&!g.consumeTagAndSize(a.Segment.Info,!0);)if(!(g.skipOverElement(a.Segment.SeekHead,!0)||g.skipOverElement(a.Segment.Tracks,!0)||g.skipOverElement(a.Segment.Cues,!0)||g.skipOverElement(a.Void,!0)))throw new Error("no valid top level element found");for(;void 0===s;){let t=g.getMatroskaCodedNum(!0),e=g.getMatroskaCodedNum();t===a.Segment.Info.Duration.tag?s=g[a.Segment.Info.Duration.parse](e):g.setPos(g.getPos()+e)}h=c(p),l.load({request:h,success:function(e){u=function(e,r,i,o){let l,s,u,c,d,f,g,m;for(s=function(e){let n,r,i=[],o=ko(t).create({data:e});for(o.consumeTagAndSize(a.Segment.Cues);o.moreData()&&o.consumeTagAndSize(a.Segment.Cues.CuePoint,!0);){for(n={},n.CueTime=o.parseTag(a.Segment.Cues.CuePoint.CueTime),n.CueTracks=[];o.moreData()&&o.consumeTag(a.Segment.Cues.CuePoint.CueTrackPositions,!0);){const t=o.getMatroskaCodedNum(),e=o.getPos();if(r={},r.Track=o.parseTag(a.Segment.Cues.CuePoint.CueTrackPositions.CueTrack),0===r.Track)throw new Error("Cue track cannot be 0");r.ClusterPosition=o.parseTag(a.Segment.Cues.CuePoint.CueTrackPositions.CueClusterPosition),n.CueTracks.push(r),o.setPos(e+t)}if(0===n.CueTracks.length)throw new Error("Mandatory cuetrack not found");i.push(n)}if(0===i.length)throw new Error("mandatory cuepoint not found");return i}(e),u=[],d=0,f=s.length;d0!==t.length)).map((t=>{let e={name:t},n=t.indexOf("[");if(-1!=n){e.name=t.substring(0,n);let a=t.substring(n+1,t.length-1);this.valid=this.valid&&-1==a.indexOf("[");let r=a.indexOf("=");-1!=r?(e.attribute={name:a.substring(1,r),value:a.substring(r+1)},-1!=["'",'"'].indexOf(e.attribute.value[0])&&(e.attribute.value=e.attribute.value.substring(1,e.attribute.value.length-1))):e.position=parseInt(a,10)-1}return e}))}isValid(){return this.valid}findsElement(){return!this.findsAttribute()}findsAttribute(){return this.path[this.path.length-1].name.startsWith("@")}findsTextReplace(){return"text()"===this.path[this.path.length-1].name}getMpdTarget(t,e){let n=null,a=t,r=1,i="MPD";for(;rt[n.name]==n.value))[0]||null}else a=Array.isArray(e)?e[0]:e}r++}return null===a?null:i.startsWith("@")?{name:i.substring(1),leaf:a,target:a}:"text()"===i?{name:"__text",leaf:a,target:a}:{name:i,leaf:a,target:e?n:a}}},Lo=class{constructor(t,e,n){this.action=t,this.xpath=e,this.value=n,this.position=null}getMpdTarget(t){let e="remove"===this.action||"replace"===this.action||"before"===this.position||"after"===this.position;return this.xpath.getMpdTarget(t,e)}};function Po(){let t,e;const n=this.context;return t={getIsPatch:function(t){return t&&t.hasOwnProperty(S.A.ORIGINAL_MPD_ID)||!1},getMpdId:function(t){return t&&t[S.A.ORIGINAL_MPD_ID]||null},getOriginalPublishTime:function(t){return t&&t.hasOwnProperty(S.A.ORIGINAL_PUBLISH_TIME)?new Date(t[S.A.ORIGINAL_PUBLISH_TIME]):null},getPatchOperations:function(t){return t?(t.__children||[]).map((t=>{const n=t.tagName;if("add"!==n&&"remove"!==n&&"replace"!==n)return e.warn(`Ignoring node of invalid action: ${n}`),null;let a=t.sel;if("add"===n&&t.type){if(!t.type.startsWith("@"))return e.warn(`Ignoring add action for prefixed namespace declaration: ${t.type}=${t.__text}`),null;a=`${a}/${t.type}`}let r=new Oo(a);if(!r.isValid())return e.warn(`Ignoring action with invalid selector: ${n} - ${a}`),null;let i=null;r.findsAttribute()||r.findsTextReplace()?i=t.__text||"":"remove"!==n&&(i=t.__children.reduce(((t,e)=>{let n=e.tagName;return"#text"!==n&&(t[n]=t[n]||[],t[n].push(e)),t}),{}));let o=new Lo(n,r,i);return"add"===n&&(o.position=t.pos),o})).filter((t=>!!t)):[]},getPublishTime:function(t){return t&&t.hasOwnProperty(S.A.PUBLISH_TIME)?new Date(t[S.A.PUBLISH_TIME]):null}},e=(0,C.A)(n).getInstance().getLogger(t),t}Po.__dashjs_factory_name="PatchManifestModel";var Fo=N.A.getSingletonFactory(Po);function Uo(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("undefined"!=typeof TextDecoder){const n=new TextDecoder("utf-8").decode(t);if(e){const t=n.indexOf("\0");return-1!==t?n.substring(0,t):n}return n.replace(/\0/g,"")}const n=t.length;let a,r,i,o="",l=0;for(;l>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:o+=String.fromCharCode(a);break;case 12:case 13:r=t[l++],o+=String.fromCharCode((31&a)<<6|63&r);break;case 14:r=t[l++],i=t[l++],o+=String.fromCharCode((15&a)<<12|(63&r)<<6|63&i)}}return o}function jo(t){return function(t,e,n,a){const r=(i=t)instanceof ArrayBuffer?i:i.buffer;var i;let o=1;"BYTES_PER_ELEMENT"in a&&(o=a.BYTES_PER_ELEMENT);const l=(d=t)&&d.buffer instanceof ArrayBuffer&&void 0!==d.byteLength&&void 0!==d.byteOffset?t.byteOffset:0,s=(l+t.byteLength)/o,u=(l+e)/o,c=Math.floor(Math.max(0,Math.min(u,s)));var d;return new a(r,c,Math.floor(Math.min(c+Math.max(n,0),s))-c)}(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,Uint8Array)}function Bo(t){return"PRIV"===t.type?function(t){if(t.size<2)return;const e=Uo(t.data,!0),n=new Uint8Array(t.data.subarray(e.length+1));return{key:t.type,info:e,data:n.buffer}}(t):"W"===t.type[0]?function(t){if("WXXX"===t.type){if(t.size<2)return;let e=1;const n=Uo(t.data.subarray(e),!0);e+=n.length+1;const a=Uo(t.data.subarray(e));return{key:t.type,info:n,data:a}}const e=Uo(t.data);return{key:t.type,info:"",data:e}}(t):"APIC"===t.type?function(t){const e={key:t.type,description:"",data:"",mimeType:null,pictureType:null};if(t.size<2)return;if(3!==t.data[0])return void console.log("Ignore frame with unrecognized character encoding");const n=t.data.subarray(1).indexOf(0);if(-1===n)return;const a=Uo(jo(t.data,1,n)),r=t.data[2+n],i=t.data.subarray(3+n).indexOf(0);if(-1===i)return;const o=Uo(jo(t.data,3+n,i));let l;return l="--\x3e"===a?Uo(jo(t.data,4+n+i)):(s=t.data.subarray(4+n+i))instanceof ArrayBuffer?s:0==s.byteOffset&&s.byteLength==s.buffer.byteLength?s.buffer:new Uint8Array(s).buffer,e.mimeType=a,e.pictureType=r,e.description=o,e.data=l,e;var s}(t):function(t){if(t.size<2)return;if("TXXX"===t.type){let e=1;const n=Uo(t.data.subarray(e),!0);e+=n.length+1;const a=Uo(t.data.subarray(e));return{key:t.type,info:n,data:a}}const e=Uo(t.data.subarray(1));return{key:t.type,info:"",data:e}}(t)}function qo(t,e){let n=0;return n=(127&t[e])<<21,n|=(127&t[e+1])<<14,n|=(127&t[e+2])<<7,n|=127&t[e+3],n}function Go(t){const e=String.fromCharCode(t[0],t[1],t[2],t[3]),n=qo(t,4);return{type:e,size:n,data:t.subarray(10,10+n)}}function Ho(t,e){return e+10<=t.length&&51===t[e]&&68===t[e+1]&&73===t[e+2]&&t[e+3]<255&&t[e+4]<255&&t[e+6]<128&&t[e+7]<128&&t[e+8]<128&&t[e+9]<128}function Yo(t,e){return e+10<=t.length&&73===t[e]&&68===t[e+1]&&51===t[e+2]&&t[e+3]<255&&t[e+4]<255&&t[e+6]<128&&t[e+7]<128&&t[e+8]<128&&t[e+9]<128}function Vo(){let t,e,n,a,r,i;const o=this.context;function l(t,n){const r=n?n.index:0,i=e.getAdaptationsForType(a[r].mpd.manifest,r,t);if(!i||0===i.length)return null;if(i.length>1&&n)for(let t=0,n=i.length;t0?a[0].mpd.manifest:null)}function g(t){try{const n=m(t.streamInfo,a),r=e.getAdaptationsForPeriod(n);return t&&t.streamInfo&&void 0!==t.streamInfo.id&&r?r[t.index]:null}catch(t){return null}}function m(t,e){const n=e.length;for(let a=0;a=0&&void 0!==i)return!0}))[0]&&(n.embeddedCaptions=!0),n.audioChannelConfiguration=e.getAudioChannelConfigurationForAdaptation(a),0===n.audioChannelConfiguration.length&&a.Representation&&a.Representation.length>0&&(n.audioChannelConfiguration=e.getAudioChannelConfigurationForRepresentation(a.Representation[0])),n.roles=e.getRolesForAdaptation(a),n.codec=e.getCodec(a),n.mimeType=e.getMimeType(a),n.contentProtection=e.getContentProtectionByAdaptation(a),n.bitrateList=e.getBitrateListForAdaptation(a),n.selectionPriority=e.getSelectionPriority(a),n.contentProtection&&n.contentProtection.length>0&&(n.contentProtection=function(t,n){if(!t||!t.length||!n)return t;const a=e.getContentProtectionByManifest(n);if(!a||!a.length)return t;const r=a.reduce(((t,e)=>(e.refId&&t.set(e.refId,e),t)),new Map);return t.map((t=>{if(t.ref){const e=r.get(t.ref);e&&t.mergeAttributesFromReference(e)}return t}))}(n.contentProtection,t.period.mpd.manifest),n.contentProtection=function(t){const e=t.map((t=>t.cencDefaultKid)).filter((t=>null!==t));if(e.length){const n=e[0];t.forEach((t=>{t.keyId=n}))}return t}(n.contentProtection),n.normalizedKeyIds=function(t){const e=new Set;return t.forEach((t=>{t.cencDefaultKid&&"string"==typeof t.cencDefaultKid&&e.add(t.cencDefaultKid.replace(/-/g,"").toLowerCase())})),e}(n.contentProtection)),n.isText=e.getIsText(a),n.essentialProperties=e.getCombinedEssentialPropertiesForAdaptationSet(a),n.supplementalProperties=e.getCombinedSupplementalPropertiesForAdaptationSet(a),n.isFragmented=e.getIsFragmented(a),n.isEmbedded=!1,n.adaptationSetSwitchingCompatibleIds=function(t){if(!t||!t.supplementalProperties)return[];let e=[];const n=t.supplementalProperties.filter((t=>t.schemeIdUri===S.A.ADAPTATION_SET_SWITCHING_SCHEME_ID_URI));return n&&n.length>0&&(e=n[0].value.toString().split(",").map((t=>t))),e}(n),n}function p(t,e,n){t.id=e,t.index=100+parseInt(e.substring(2,3)),t.type=r.TEXT,t.codec="cea-608-in-SEI",t.isEmbedded=!0,t.isFragmented=!1,t.lang=rr(n),t.roles=[{schemeIdUri:"urn:mpeg:dash:role:2011",value:"caption"}]}function b(t){let n=new Mo;return n.id=t.id,n.index=t.index,n.start=t.start,n.duration=t.duration,n.manifestInfo=function(t){let n=new zo;return n.dvrWindowSize=t.timeShiftBufferDepth,n.loadedTime=t.manifest.loadedTime,n.availableFrom=t.availabilityStartTime,n.minBufferTime=t.manifest.minBufferTime,n.maxFragmentDuration=t.maxSegmentDuration,n.duration=e.getDuration(t.manifest),n.isDynamic=e.getIsDynamic(t.manifest),n.serviceDescriptions=e.getServiceDescriptions(t.manifest),n.protocol=t.manifest.protocol,n}(t.mpd),n.isLast=1===t.mpd.manifest.Period.length||Math.abs(n.start+n.duration-n.manifestInfo.duration)<1,n.isEncrypted=t.isEncrypted,n}function y(){if(!r)throw new Error("setConfig function has to be called previously")}function E(t){return a.length>0?a[0].mpd.manifest.Period[t]:null}function _(t,e,n){let a,r,i,o,l,s;if(t)for(r=t.AdaptationSet,l=0;l{let n=e.getMpdTarget(t);if(null===n)return;let{name:a,target:r,leaf:i}=n;if(e.xpath.findsAttribute()||"__text"===a){switch(e.action){case"add":case"replace":r[a]=e.value;break;case"remove":delete r[a]}return}let o=(r[a]||[]).indexOf(i),l="prepend"===e.position||"before"===e.position;if("remove"===e.action||"replace"===e.action)if(Array.isArray(r[a])){if(-1!=o){let t=r[a];t.splice(o,1),t.length>0?r[a]=t:delete r[a]}}else delete r[a];"add"!==e.action&&"replace"!==e.action||Object.keys(e.value).forEach((t=>{let n=e.value[t],i=r[t]||[];if(0===i.length&&r[t]&&i.push(r[t]),0===i.length)i=n;else{let r=i.length;r=t==a&&-1!=o?o+(l?0:1)+("replace"===e.action?-1:0):l?0:i.length,i.splice.apply(i,[r,0].concat(n))}r[t]=i}))}))},areMediaInfosEqual:function(t,e){if(!t||!e)return!1;const n=t.id===e.id,a=t.codec===e.codec,r=JSON.stringify(t.viewpoint)===JSON.stringify(e.viewpoint),i=t.lang===e.lang,o=JSON.stringify(t.roles)===JSON.stringify(e.roles),l=JSON.stringify(t.accessibility)===JSON.stringify(e.accessibility),s=JSON.stringify(t.audioChannelConfiguration)===JSON.stringify(e.audioChannelConfiguration);return n&&a&&r&&i&&o&&l&&s},getAllMediaInfoForType:function(t,n,i){let o=a,l=i,c=[];if(l)y(),o=u(l);else{if(!(a.length>0))return c;l=a[0].mpd.manifest}const d=m(t,o);let f=e.getAdaptationsForType(l,t?t.index:null,n);return c=s(l,d,t,f,n),n===r.TEXT&&(f=e.getAdaptationsForType(l,t?t.index:null,r.VIDEO),c=c.concat(s(l,d,t,f,n,!0))),c},getAvailabilityStartTime:function(t){const n=c(t);return e.getAvailabilityStartTime(n)},getBandwidthForRepresentation:function(t,e){let n;return n=_(E(e),t),n?n.bandwidth:null},getBaseURLsFromElement:function(t){return e.getBaseURLsFromElement(t)},getCodec:function(t,n,a){return e.getCodec(t,n,a)},getContentSteering:function(t){return e.getContentSteering(t)},getDuration:function(t){const n=f(t);return e.getDuration(n)},getEssentialPropertiesForAdaptationSet:function(t){try{return e.getEssentialPropertiesForRepresentation(t)}catch(t){return[]}},getEssentialPropertiesForRepresentation:function(t){try{return e.getEssentialPropertiesForRepresentation(t)}catch(t){return[]}},getEvent:function(t,e,n,a){try{if(!t||!e||isNaN(n)||!a)return null;const r=t.scheme_id_uri,i=t.value;if(!e[r+"/"+i])return null;const o=new ae,l=t.timescale||1,s=a.adaptation.period.start,u=e[r+"/"+i],c=isNaN(a.presentationTimeOffset)?isNaN(u.presentationTimeOffset)?0:u.presentationTimeOffset:a.presentationTimeOffset;let d,f=t.presentation_time_delta/l;d=0===t.version?s+n-c+f:s-c+f;const g=t.event_duration/l,m=t.id,h=t.message_data;return o.eventStream=u,o.eventStream.value=i,o.eventStream.timescale=l,o.duration=g,o.id=m,o.calculatedPresentationTime=d,o.messageData=h,o.presentationTimeDelta=f,o.parsedMessageData=r===w.A.ID3_SCHEME_ID_URI?function(t){let e=0;const n=[];for(;Yo(t,e);){const a=qo(t,e+6);t[e+5]>>6&1&&(e+=10),e+=10;const r=e+a;for(;e+100){const o=a[0].mpd.manifest;if(t instanceof Mo){const n=m(t,a);i=e.getEventsForPeriod(n)}else if(t instanceof xo){const n=m(r,a);i=e.getEventStreamForAdaptationSet(o,g(t),n)}else if(t instanceof fe){const t=m(r,a);i=e.getEventStreamForRepresentation(o,n,t)}}return i},getFramerate:function(t){return e.getFramerate(t)},getIndexForRepresentation:function(t,e){return function(t,e){const n=_(t,e,!0);return null!==n?n:-1}(E(e),t)},getIsDVB:function(t){return e.hasProfile(t,"urn:dvb:dash:profile:dvb-dash:2014")},getIsDynamic:function(t){const n=f(t);return e.getIsDynamic(n)},getIsPatch:function(t){return n.getIsPatch(t)},getIsTextTrack:function(t){return e.getIsText(t)},getIsTypeOf:function(t,n){return e.getIsTypeOf(t,n)},getLocation:function(t){return e.getLocation(t)},getMainAdaptationForType:l,getManifestUpdatePeriod:function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e.getManifestUpdatePeriod(t,n)},getMediaInfoForType:function(t,n){if(0===a.length||!t)return null;let r=m(t,a);if(!r)return null;const i=e.getAdaptationsForPeriod(r);let o=l(n,t);return o?h(i[e.getIndexForAdaptation(o,a[0].mpd.manifest,t.index)]):null},getMpd:c,getPatchLocation:function(t){const n=e.getPatchLocation(t),a=e.getPublishTime(t);return n&&0!==n.length&&a?n.filter((t=>isNaN(t.ttl)||a.getTime()+t.ttl>(new Date).getTime())):[]},getPeriodById:function(t){if(!t||0===a.length)return null;const e=a.filter((e=>e.id===t));return e&&e.length>0?e[0]:null},getProducerReferenceTimes:function(t,n){let r,i;const o=m(t,a);return r=n?n.id:null,a.length>0&&o&&(i=r?e.getAdaptationForId(r,a[0].mpd.manifest,o.index):e.getAdaptationForIndex(n?n.index:null,a[0].mpd.manifest,o.index)),i?e.getProducerReferenceTimesForAdaptation(i):[]},getPublishTime:function(t){return e.getPublishTime(t)},getRealAdaptation:function(t,n){let r,i;const o=m(t,a);return r=n?n.id:null,a.length>0&&o&&(i=r?e.getAdaptationForId(r,a[0].mpd.manifest,o.index):e.getAdaptationForIndex(n?n.index:null,a[0].mpd.manifest,o.index)),i},getRealPeriodByIndex:function(t){return e.getRealPeriodForIndex(t,a[0].mpd.manifest)},getRegularPeriods:u,getRepresentationSortFunction:function(){return e.getRepresentationSortFunction()},getStreamsInfo:function(t,e){const n=[];let r=a;if(t&&(y(),r=u(t)),r.length>0){(!e||e>r.length)&&(e=r.length);for(let t=0;t0?a[0].mpd:null;return e.getSuggestedPresentationDelay(t)},getSupplementalCodecs:function(t){const e=t[S.A.SUPPLEMENTAL_CODECS];return e?e.split(" ").map((e=>t.mimeType+';codecs="'+e+'"')):[]},getUTCTimingSources:function(){const t=f();return e.getUTCTimingSources(t)},getVoRepresentations:function(t){let n;const a=g(t);return n=e.getRepresentationsForAdaptation(a,t),n},isPatchValid:function(t,a){let r=e.getId(t),i=n.getMpdId(a),o=e.getPublishTime(t),l=n.getPublishTime(a),s=n.getOriginalPublishTime(a);return!!(r&&i&&r==i&&o&&s&&o.getTime()==s.getTime()&&l&&o.getTime()e.get().streaming.metrics.maxListDepth&&r[n].shift())}function f(t,e,n){d(t,e,n),u(t,e,n)}return n={addBufferLevel:function(t,e,n){let a=new Qo;a.t=e,a.level=n,f(t,I.BUFFER_LEVEL,a)},addBufferState:function(t,e,n){let a=new Zo;a.target=n,a.state=e,f(t,I.BUFFER_STATE,a)},addDVBErrors:function(t){f(w.A.STREAM,I.DVB_ERRORS,t)},addDVRInfo:function(t,e,n,a){let r=new Jo;r.time=e,r.range=a,r.manifestInfo=n,f(t,I.DVR_INFO,r)},addDroppedFrames:function(t,e){let n=new tl,a=c(t).DroppedFrames;e&&(n.time=e.creationTime,n.droppedFrames=e.droppedVideoFrames,a.length>0&&a[a.length-1]==n||f(t,I.DROPPED_FRAMES,n))},addHttpRequest:function t(e,n,a,r){let i=new z.G;n.url&&n.url!==e.url&&(t({mediaType:e.mediaType,type:e.type,url:e.url,serviceLocation:null,range:e.range,startDate:e.startDate,firstByteDate:null,endDate:null,duration:e.duration,fileLoaderType:e.fileLoaderType,resourceTimingValues:e.resourceTimingValues},{url:null,status:null,headers:null},null,r),i.actualurl=n.url),i.tcpid=null,i.type=e.type,i.url=e.url,i.range=e.range||null,i.trequest=e.startDate,i.tresponse=e.firstByteDate,i.responsecode=n.status,i.cmsd=r,i._tfinish=e.endDate,i._stream=e.mediaType,i._mediaduration=e.duration,i._responseHeaders="";for(const t in n.headers)i._responseHeaders+=t+": "+n.headers[t]+"\r\n";i._serviceLocation=e.serviceLocation||null,i._fileLoaderType=e.fileLoaderType,i._resourceTimingValues=e.resourceTimingValues,i._streamId=e&&e.representation&&e.representation.mediaInfo&&e.representation.mediaInfo.streamInfo?e.representation.mediaInfo.streamInfo.id:null,a?a.forEach((t=>{!function(t,e,n,a){let r=new z.N;r.s=e,r.d=n,r.b=a,t.trace.push(r),t.interval||(t.interval=0),t.interval+=n}(i,t.s,t.d,t.b,t.t)})):(delete i.interval,delete i.trace),f(e.mediaType,I.HTTP_REQUEST,i)},addManifestUpdate:function(t,e,n,a){let r=new el;r.mediaType=t,r.type=e,r.requestTime=n,r.fetchTime=a,d(w.A.STREAM,I.MANIFEST_UPDATE,r),u(t,I.MANIFEST_UPDATE,r)},addManifestUpdateRepresentationInfo:function(t,e,n){if(t&&t.representationInfo){const a=new al;a.id=e?e.id:null,a.index=e?e.index:null,a.mediaType=n,a.startNumber=e?e.startNumber:null,a.presentationTimeOffset=e?e.presentationTimeOffset:null,t.representationInfo.push(a),s(t.mediaType,I.MANIFEST_UPDATE_TRACK_INFO,t)}},addManifestUpdateStreamInfo:function(t,e,n,a,r){if(t){let i=new nl;i.id=e,i.index=n,i.start=a,i.duration=r,t.streamInfo.push(i),s(t.mediaType,I.MANIFEST_UPDATE_STREAM_INFO,t)}},addPlayList:function(t){t.trace&&Array.isArray(t.trace)?t.trace.forEach((t=>{t.hasOwnProperty("subreplevel")&&!t.subreplevel&&delete t.subreplevel})):delete t.trace,f(w.A.STREAM,I.PLAY_LIST,t)},addRepresentationSwitch:function(t,e,n,a,r){let i=new Xo;i.t=e,i.mt=n,i.to=a,r?i.lto=r:delete i.lto,f(t,I.TRACK_SWITCH,i)},addRequestsQueue:function(t,e,n){let a=new il;a.loadingRequests=e,a.executedRequests=n,c(t).RequestsQueue=a,u(t,I.REQUESTS_QUEUE,a)},addSchedulingInfo:function(t,e,n,a,r,i,o,l,s){let u=new rl;u.mediaType=t,u.t=e,u.type=n,u.startTime=a,u.availabilityStartTime=r,u.duration=i,u.bandwidth=o,u.range=l,u.state=s,f(t,I.SCHEDULING_INFO,u)},clearAllCurrentMetrics:function(){a={},o()},clearCurrentMetricsForType:function(t){delete a[t],l(t)},getMetricsFor:c,updateManifestUpdateInfo:function(t,e){if(t){for(let n in e)t[n]=e[n];s(t.mediaType,I.MANIFEST_UPDATE,t)}}},a={},n}ol.__dashjs_factory_name="MetricsModel";var ll=N.A.getSingletonFactory(ol);function sl(t){t=t||{};const e=this.context;let n,a,r,i,o=t.metricsModel;function l(t){const e=o.getMetricsFor(t,!0);if(!e)return null;const n=e.HttpList;let a,r=null;if(!n||n.length<=0)return null;for(a=n.length-1;a>=0;){if(n[a].responsecode){r=n[a];break}a--}return r}function s(t){const e=o.getMetricsFor(t,!0);return e&&e.HttpList?e.HttpList:[]}function u(t,e){if(!t)return null;const n=t[e];return n&&0!==n.length?n[n.length-1]:null}return n={getCurrentRepresentationSwitch:function(t){return u(o.getMetricsFor(t,!0),I.TRACK_SWITCH)},getCurrentBufferState:function(t){return u(o.getMetricsFor(t,!0),I.BUFFER_STATE)},getCurrentBufferLevel:function(t){const e=u(o.getMetricsFor(t,!0),I.BUFFER_LEVEL);return e?Wo.round10(e.level/1e3,-3):0},getCurrentHttpRequest:l,getHttpRequests:s,getCurrentDroppedFrames:function(){return u(o.getMetricsFor(w.A.VIDEO,!0),I.DROPPED_FRAMES)},getCurrentSchedulingInfo:function(t){return u(o.getMetricsFor(t,!0),I.SCHEDULING_INFO)},getCurrentDVRInfo:function(t){return u(t?o.getMetricsFor(t,!0):o.getMetricsFor(w.A.VIDEO,!0)||o.getMetricsFor(w.A.AUDIO,!0),I.DVR_INFO)},getCurrentManifestUpdate:function(){return u(o.getMetricsFor(w.A.STREAM),I.MANIFEST_UPDATE)},getLatestFragmentRequestHeaderValueByID:function(t,e){if(!e)return null;let n={},a=l(t);a&&(n=Gt.A.parseHttpHeaders(a._responseHeaders));const r=n[e.toLowerCase()];return void 0===r?null:r},getLatestMPDRequestHeaderValueByID:function(t){if(!t)return null;let e,n,a,r={};for(e=s(w.A.STREAM),a=e.length-1;a>=0;a--)if(n=e[a],n.type===z.G.MPD_TYPE){r=Gt.A.parseHttpHeaders(n._responseHeaders);break}const i=r[t.toLowerCase()];return void 0===i?null:i},addRepresentationSwitch:function(t,e,n,a,r){o.addRepresentationSwitch(t,e,n,a,r)},addDVRInfo:function(t,e,n,a){o.addDVRInfo(t,e,n,a)},updateManifestUpdateInfo:function(t){const e=this.getCurrentManifestUpdate();o.updateManifestUpdateInfo(e,t)},addManifestUpdateStreamInfo:function(t){if(t){const e=this.getCurrentManifestUpdate();o.addManifestUpdateStreamInfo(e,t.id,t.index,t.start,t.duration)}},addManifestUpdateRepresentationInfo:function(t,e){if(t){const n=this.getCurrentManifestUpdate();o.addManifestUpdateRepresentationInfo(n,t,e)}},addManifestUpdate:function(t){o.addManifestUpdate(w.A.STREAM,t.type,t.startDate,t.endDate)},addHttpRequest:function(t,e,n,a,r,i){const l={status:n,headers:a,url:e};o.addHttpRequest(t,l,r,i)},addSchedulingInfo:function(t,e){o.addSchedulingInfo(t.mediaType,new Date,t.type,t.startTime,t.availabilityStartTime,t.duration,t.bandwidth,t.range,e)},addRequestsQueue:function(t,e,n){o.addRequestsQueue(t,e,n)},addBufferLevel:function(t,e,n){o.addBufferLevel(t,e,n)},addBufferState:function(t,e,n){o.addBufferState(t,e,n)},addDroppedFrames:function(t){o.addDroppedFrames(w.A.VIDEO,t)},addPlayList:function(){i&&(o.addPlayList(i),i=null)},addDVBErrors:function(t){o.addDVBErrors(t)},createPlaylistMetrics:function(t,e){i=new St,i.start=new Date,i.mstart=t,i.starttype=e},createPlaylistTraceMetrics:function(t,e,n){!0===a&&(a=!1,r=new It,r.representationid=t,r.start=new Date,r.mstart=e,r.playbackspeed=null!==n?n.toString():null)},updatePlayListTraceMetrics:function(t){if(r)for(let e in r)r[e]=t[e]},pushPlayListTraceMetrics:function(t,e){if(!1===a&&i&&r&&r.start){const n=r.start;r.duration=t.getTime()-n.getTime(),r.stopreason=e,i.trace.push(r),a=!0}},clearAllCurrentMetrics:function(){o.clearAllCurrentMetrics()}},o=o||ll(e).getInstance({settings:t.settings}),a=!0,r=null,i=null,n}sl.__dashjs_factory_name="DashMetrics";var ul=N.A.getSingletonFactory(sl);function cl(){const t=this.context,e=(0,k.A)(t).getInstance(),n=(0,K.A)(t).getInstance();let a,r,i,o;function l(t){o=t}function s(t,e,n,a){let r,i=e.adaptation.period.mpd;const o=i.availabilityStartTime;if(a)r=n&&i.timeShiftBufferDepth!==Number.POSITIVE_INFINITY?new Date(o.getTime()+1e3*(t+i.timeShiftBufferDepth)):i.availabilityEndTime;else if(n){const n=e.availabilityTimeOffset;r=new Date(o.getTime()+1e3*(t-n))}else r=o;return r}function u(t,e){return(t.getTime()-e.mpd.availabilityStartTime.getTime()+1e3*o)/1e3}function c(t,e){return t+(e.adaptation.period.start-e.presentationTimeOffset)}function d(t){const e={start:NaN,end:NaN},n=t[0].getAdapter().getRegularPeriods()[0],a=u(new Date,n);if(!t||0===t.length)return{range:e,now:a};t.forEach((t=>{let n=t.getCurrentRepresentationForType(w.A.VIDEO);if(n||(n=t.getCurrentRepresentationForType(w.A.AUDIO)),!n){const e=t.getAdapter(),a=e.getMediaInfoForType(t.getStreamInfo(),w.A.VIDEO)||e.getMediaInfoForType(t.getStreamInfo(),w.A.AUDIO);n=e.getVoRepresentations(a)[0]}let i={start:NaN,end:NaN};if(n)if(n.segmentInfoType===S.A.SEGMENT_TIMELINE)i=function(t){const e=t.adaptation.period.mpd.manifest.Period[t.adaptation.period.index].AdaptationSet[t.adaptation.index],n=r.getRepresentationFor(t.index,e),a=n.SegmentTemplate||n.SegmentList,i=a.SegmentTimeline,o=a.timescale,l=i.S,s={start:0,end:0},u=l[0].t,d=!isNaN(u),f=d?u:0;let g,m,h,p,b=0;for(d&&(s.start=c(f/o,t)),h=0,p=l.length;hi.start)&&(e.start=i.start),!isNaN(i.end)&&(isNaN(e.end)||e.end2&&void 0!==arguments[2]&&arguments[2];try{let a=0,r=!1,i=NaN;for(;!r&&a=e)?(i=e,r=!0):!n&&o.start>e&&(isNaN(i)||o.starti)&&(i=o.start+o.duration),a+=1}return i}catch(t){return e}}function m(t){void 0===t.offset||isNaN(t.offset)||l(t.offset/1e3)}function h(){o=0,i=0}function p(){e.off(R.A.UPDATE_TIME_SYNC_OFFSET,m,this),h()}return a={initialize:function(){h(),e.on(R.A.UPDATE_TIME_SYNC_OFFSET,m,this)},getClientTimeOffset:function(){return o},setClientTimeOffset:l,getClientReferenceTime:function(){return Date.now()-1e3*i+1e3*o},calcAvailabilityStartTimeFromPresentationTime:function(t,e,n){return s(t,e,n)},calcAvailabilityEndTimeFromPresentationTime:function(t,e,n){return s(t,e,n,!0)},calcPresentationTimeFromWallTime:u,calcPresentationTimeFromMediaTime:c,calcPeriodRelativeTimeFromMpdRelativeTime:function(t,e){return e-t.adaptation.period.start},calcMediaTimeFromPresentationTime:function(t,e){return t-e.adaptation.period.start+e.presentationTimeOffset},calcWallTimeForSegment:function(t,e){let n,a,r;return e&&(n=t.representation.adaptation.period.mpd.suggestedPresentationDelay,a=t.presentationStartTime+n,r=new Date(t.availabilityStartTime.getTime()+1e3*a)),r},calcTimeShiftBufferWindow:function(t,a){if(!a)return function(t){const e={start:NaN,end:NaN};let n=0,a=NaN;return t.forEach((t=>{const e=t.getStreamInfo();n+=e.duration,(isNaN(a)||e.start>6),e.push(128|63&a)):a<65536?(e.push(224|a>>12),e.push(128|63&a>>6),e.push(128|63&a)):(e.push(240|a>>18),e.push(128|63&a>>12),e.push(128|63&a>>6),e.push(128|63&a))}return e},yl=function(t){for(var e=[],n=0;n>18)),n.push(dl.charAt(63&r>>12)),n.push(dl.charAt(63&r>>6)),n.push(dl.charAt(63&r))}return 2==t.length-e?(r=(t[e]<<16)+(t[e+1]<<8),n.push(dl.charAt(63&r>>18)),n.push(dl.charAt(63&r>>12)),n.push(dl.charAt(63&r>>6)),n.push("=")):1==t.length-e&&(r=t[e]<<16,n.push(dl.charAt(63&r>>18)),n.push(dl.charAt(63&r>>12)),n.push("==")),n.join("")},gl=function(){for(var t=[],e=0;e<64;++e)t[dl.charCodeAt(e)]=e;return t["=".charCodeAt(0)]=0,t}(),ml=function(t){for(var e=0,n=[],a=0|t.length/4;0>16),n.push(255&r>>8),n.push(255&r),e+=4}return n&&("="==t.charAt(e-2)?(n.pop(),n.pop()):"="==t.charAt(e-1)&&n.pop()),n},hl={encode:function(t){for(var e=[],n=0;n0&&(m.spans.push({name:h,line:e,row:E}),e="");let t="style_cea608_"+i.foreground+"_"+i.background;i.underline&&(t+="_underline"),i.italics&&(t+="_italics"),b.hasOwnProperty(t)||(b[t]=JSON.parse(JSON.stringify(i))),a=i,h=t}e+=r.uchar}e.trim().length>0&&m.spans.push({name:h,line:e,row:E}),f=!0,g=i}else f=!1,g=-1,c&&(c.p.push(m),m={start:r,end:s,spans:[]},c.y2=E,c.name="region_"+c.x+"_"+c.y1+"_"+c.y2,!1===p.hasOwnProperty(c.name)?(y.push(c),p[c.name]=c):(d=p[c.name],d.p.contat(c.p)),c=null)}c&&(c.p.push(m),c.y2=E+1,c.name="region_"+c.x+"_"+c.y1+"_"+c.y2,!1===p.hasOwnProperty(c.name)?(y.push(c),p[c.name]=c):(d=p[c.name],d.p.contat(c.p)),c=null);const A=[];for(E=0;E0){if(0!==_&&r!=e.row){const t=document.createElement("br");t.className="lineBreak",g.appendChild(t)}let n=!1;r===e.row&&(n=!0),r=e.row;const s=b[e.name],u=document.createElement("span");u.className="spanPadding "+e.name+" customSpanColor",u.style.cssText=i(t,s),0!==_&&n?_===a.spans.length-1?u.textContent=l(e.line):u.textContent=e.line:a.spans.length>1&&_0||(127&e)>0}function Rl(t,e){let n=0;for(;ne+n));o++)6===r&&o+5+a<=t.byteLength&&Rl(Sl(t,o+5,o+5+a),i),o+=a+3;return i}function Cl(t){const e=t.errHandler,n=t.manifestModel,a=t.mediaController,r=t.videoModel,i=t.textTracks,o=t.vttParser,l=t.vttCustomRenderingParser,s=t.ttmlParser,u=t.streamInfo,c=t.settings,d=this.context,f=(0,k.A)(d).getInstance();let g,m,h,p,b,y,E,_,A,T,I,N,D,x,M,O,L,P=!1;function F(){y=null,_=NaN,A=[],T=null,E=!1,b=[],p=null}function U(t){const e={};e[S.A.SUBTITLE]="subtitles",e[S.A.CAPTION]="captions",e[S.A.FORCED_SUBTITLE]="subtitles";const n=new Al;for(let e in t)n[e]=t[e];n.defaultTrack=function(t){let e=!1;return N.length>1&&t.isEmbedded?e=t.id&&t.id===w.A.CC1:1===N.length?t.id&&"string"==typeof t.id&&"CC"===t.id.substring(0,2)&&(e=!0):0===N.length&&(e=t.index===b[0].index),e}(t),n.isTTML=function(t){return t.codec&&t.codec.search(w.A.STPP)>=0||t.mimeType&&t.mimeType.search(w.A.TTML)>=0}(t),n.kind=function(t,e){let n=t.roles&&t.roles.length>0?e[t.roles[0].value]:e.caption;return n=Object.values(e).includes(n)?n:e.caption,n}(t,e),i.addTextTrackInfo(n)}function j(t){const e=t.chunk;e.representation.mediaInfo.embeddedCaptions&&q(e.bytes,e)}function B(t){I=t}function q(t,a){const r=a.representation.mediaInfo,l=r.type,s=r.mimeType,u=r.codec||s;u?-1!==r.codec.indexOf("application/mp4")?function(t,e,a){let r,l;if("InitializationSegment"===e.segmentType)E=!0,_=h.getMediaTimescaleFromMoov(t);else{if(!E)return;l=h.getSamplesInfo(t),r=l.sampleList,r.length>0&&(T=r[0].cts-e.start*_),a.search(w.A.STPP)>=0?function(t,e,a){let r,o;for(p=null!==p?p:K(a),r=0;r0&&i.addCaptions(I,0,l)}(t,r)}}(t,a,u):l===w.A.VIDEO?function(t,e){let n,a;if(e.segmentType===z.G.INIT_SEGMENT_TYPE)0===D&&(D=h.getMediaTimescaleFromMoov(t));else if(e.segmentType===z.G.MEDIA_SEGMENT_TYPE){if(0===D)return void m.warn("CEA-608: No timescale for embeddedTextTrack yet");a=h.getSamplesInfo(t);const r=a.lastSequenceNumber,o=Math.trunc(e.start),l=Math.trunc(e.end);if(O[0]||O[1]||function(){let t;for(let e=0;e0){r.cts!==o?l=0:l+=1;const e=Y();n.fields[t].push([r.cts+e*D,i[t],l]),o=r.cts}}return n.fields.forEach((function(t){t.sort((function(t,e){return t[0]===e[0]?t[2]-e[2]:t[0]-e[0]}))})),n}(t,a.sampleList);for(let t=0;t=0?e=c.get().streaming.text.webvtt.customRenderingEnabled&&l?l:o:(t.search(w.A.TTML)>=0||t.search(w.A.STPP)>=0)&&(e=s),e}function W(t,e){void 0===t&&t===e&&(t=g.buffered.start(0),e=g.buffered.end(g.buffered.length-1)),g.buffered.remove(t,e),i.deleteCuesFromTrackIdx(I,t,e)}function $(t){N.forEach((function(e){const n=i.getTrackIdxForId(e.id);n>=0&&i.deleteCuesFromTrackIdx(n,t.from,t.to)}))}return g={initialize:function(){P||(N=[],I=null,D=0,O=[],x=null,M=null,P=!0,L=wl(d).getInstance(),f.on(R.A.VIDEO_CHUNK_RECEIVED,j,g),f.on(R.A.BUFFER_CLEARED,$,g))},addMediaInfos:function(t,e,n){if(b=b.concat(e),t===w.A.TEXT&&e[0].isFragmented&&!e[0].isEmbedded){y=n,g.buffered=(0,Tl.A)(d).create(),A=a.getTracksFor(w.A.TEXT,u.id).filter((t=>t.isFragmented));const t=a.getCurrentTrackFor(w.A.TEXT,u.id);for(let e=0;e{return a=t,(n=e).startTime===a.startTime&&n.endTime===a.endTime&&n instanceof VTTCue&&a instanceof VTTCue&&n.text===a.text;var n,a}))}addCue(t){const e=this.cues.get(t.startTime);e?this.hasCue(t)||e.push(t):this.cues.set(t.startTime,[t])}}var Ml=n(7640);const zl=["text","align","fontSize","id","isd","line","lineAlign","lineHeight","linePadding","position","positionAlign","region","size","snapToLines","vertical"];function Ol(t){const e=this.context,n=(0,k.A)(e).getInstance(),a=t.videoModel,r=t.streamInfo,i=t.settings;let o,l,s,u,c,d,f,g,m,h,p,b,y,E,_,A,T,v,S,I;function N(t){const e=t.kind,n=void 0!==t.id?t.id:t.lang,r=t.lang,i=t.isTTML,o=t.isEmbedded;return a.addTextTrack(e,n,r,i,o)}function x(t,e,n,a,r,i){let o=0,l=0;t/e>n/a?(l=e,o=l/a*n):(o=t,l=o/n*a);let s=0,u=0,c=0,d=0;return o/l>r?(d=l,c=l*r):(c=o,d=o/r),s=(t-c)/2,u=(e-d)/2,i?{x:s+.1*c,y:u+.1*d,w:.8*c,h:.8*d}:{x:s,y:u,w:c,h:d}}function M(t,e){const r=a.getClientWidth(),i=a.getClientHeight(),o=a.getVideoWidth(),l=a.getVideoHeight(),s=a.getVideoRelativeOffsetTop(),u=a.getVideoRelativeOffsetLeft();if(0!==o&&0!==l){let a=o/l,c=!1;t.isFromCEA608&&(a=3.5/3,c=!0);const d=x.call(this,r,i,o,l,a,c),b=d.w,y=d.h,A=d.x,v=d.y;if(b!=m||y!=h||A!=f||v!=g||e){if(f=A+u,g=v+s,m=b,h=y,p){const t=p.style;t&&(t.left=f+"px",t.top=g+"px",t.width=m+"px",t.height=h+"px",t.zIndex=E&&document[E]||_?T:null,n.trigger(D.A.CAPTION_CONTAINER_RESIZE))}const e=t.activeCues;if(e){const t=e.length;for(let n=0;n=t.startTime}function F(t,e){return!!i.get().streaming.text.extendSegmentedCues&&!!function(t,e,n){for(let a=0;a{e.kind&&"image"===e.kind&&(e.src=O(t,e.src)),U(t,e.contents)}))}function j(t,e,n){const r=X(t),o=i.get().streaming.text.dispatchForManualRendering;if(!r)return;if(!Array.isArray(n)||0===n.length)return;const s=new xl(r.cues);for(let t=0;tL(this))):L(this),l.debug("Cue enter id:"+this.cueID)):(p.appendChild(this.cueHTMLElement),z.call(r,this),n.trigger(D.A.CAPTION_RENDERED,{captionDiv:this.cueHTMLElement,currentTrackIdx:d})))},i.onexit=function(){if(p){const t=p.childNodes;for(let e=0;e=0&&u[t]?a.getTextTrack(u[t].kind,u[t].id,u[t].lang,u[t].isTTML,u[t].isEmbedded):null}function Q(t){if(t===d)return;d=t;const e=X(d);Z.call(this,e),y&&(clearInterval(y),y=null),e&&"html"===e.renderingType&&(M.call(this,e,!0),window.ResizeObserver?(v=new window.ResizeObserver((()=>{M.call(this,e,!0)})),v.observe(a.getElement())):y=setInterval(M.bind(this,e),500))}function Z(t){it.call(this),t&&"html"===t.renderingType?at.call(this):rt.call(this)}function J(t,e,n){let a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return!!t&&(isNaN(e)||(a?t.startTime:t.endTime)>=e)&&(isNaN(n)||(a?t.endTime:t.startTime)<=n)}function tt(t,e,n){if(!(n0?"native":"custom",r="native"===a?t.cues:t.manualCueList;if(!r||0===r.length)return;for(let i=r.length-1;i>=0;i--)J(r[i],e,n,!0)&&!nt(r[i])&&("native"===a?t.removeCue(r[i]):(W(r[i]),delete t.manualCueList[i]))}}function et(t,e,n){let a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(t&&(t.cues||t.manualCueList)){const r=t.cues&&t.cues.length>0?"native":"custom",i="native"===r?t.cues:t.manualCueList;if(!i||0===i.length)return;for(let o=i.length-1;o>=0;o--)J(i[o],e,n,a)&&("native"===r?(i[o].onexit&&i[o].onexit(),t.removeCue(i[o])):(W(i[o]),delete t.manualCueList[o]))}}function nt(t){const e=a.getTime();return e>=t.startTime&&e<=t.endTime}function at(){let t=document.getElementById("native-cue-style");if(t)return;t=document.createElement("style"),t.id="native-cue-style",document.head.appendChild(t);const e=t.sheet,n=a.getElement();try{n&&(n.id?e.insertRule("#"+n.id+"::cue {background: transparent}",0):0!==n.classList.length?e.insertRule("."+n.className+"::cue {background: transparent}",0):e.insertRule("video::cue {background: transparent}",0))}catch(t){l.info(""+t.message)}}function rt(){const t=document.getElementById("native-cue-style");t&&document.head.removeChild(t)}function it(){if(p)for(;p.firstChild;)p.removeChild(p.firstChild)}return o={addCaptions:j,addTextTrackInfo:function(t){u.push(t)},createTracks:function(){u.sort((function(t,e){return t.index-e.index})),p=a.getTTMLRenderingDiv(),b=a.getVttRenderingDiv();let t=-1;for(let e=0;e=0){let e=function(){const a=X(t);a&&"html"===a.renderingType&&M.call(this,a,!0),n.off(D.A.PLAYBACK_METADATA_LOADED,e,this)};n.on(D.A.PLAYBACK_METADATA_LOADED,e,this);for(let e=0;e0){const e=t[0].manualCueList;e&&e.length>0&&e.forEach((t=>{if(t.isActive)if(t.isActive=!1,i.get().streaming.text.dispatchForManualRendering)G(t);else if(b){const e=b.childNodes;for(let n=0;n0){const n=e[0].manualCueList;n&&n.length>0&&n.forEach((e=>{e.startTime<=t&&e.endTime>=t&&!e.isActive?(e.isActive=!0,i.get().streaming.text.dispatchForManualRendering?q(e):WebVTT.processCues(window,[e],b,e.cueID)):e.isActive&&(e.startTime>t||e.endTime1){const[t,a]=n;switch(t){case"align":case"A":e.align=a;break;case"line":case"L":const[t,n]=a.split(","),r=t.endsWith("%");e.line="auto"===t?t:parseInt(t,10),r&&(e.snapToLines=!1),n&&(e.lineAlign=n);break;case"position":case"P":const[i,o]=a.split(",");e.position=parseInt(i,10),o&&(e.positionAlign=o);break;case"size":case"S":e.size=parseInt(a,10)}}})),e}function c(t,e){let n,a=e,i="",o="";for(;""!==t[a]&&a1)for(let a=0;a0&&"WEBVTT"!==o&&o.match(r)){const r=s(o),d=r.cuePoints,f=r.styles,g=c(t,a+1),m=l(d[0].replace(i,"")),h=l(d[1].replace(i,""));!isNaN(m)&&!isNaN(h)&&m>=u&&h>m?""!==g?(u=m,e.push({start:m,end:h,data:g,styles:f})):n.error("Skipping cue due to empty/malformed cue text"):n.error("Skipping cue due to incorrect cue timing")}}return e},getCaptionStyles:u},n=(0,C.A)(t).getInstance().getLogger(e),a=/(?:\r\n|\r|\n)/gm,r=/-->/,i=/(^[\s]+|[\s]+$)/g,o=/\s\b/g,e}Pl.__dashjs_factory_name="VTTParser";var Fl=N.A.getSingletonFactory(Pl);function Ul(){let t,e;return t={parse:function(t){let n=[];return e.oncue=function(t){t.start=t.startTime,t.end=t.endTime,t.data=t.text,t.styles={align:t.align,line:t.line,position:t.position,size:t.size},n.push(t)},e.parse(t),n}},function(){try{window&&window.WebVTT&&window.WebVTT.Parser&&(e=new window.WebVTT.Parser(window,window.vttjs,window.WebVTT.StringDecoder()))}catch(t){}}(),t}Ul.__dashjs_factory_name="VttCustomRenderingParser";var jl=N.A.getSingletonFactory(Ul);function Bl(){const t=this.context,e=(0,k.A)(t).getInstance();let n,a,r=0;function i(){const t="cue_TTML_"+r;return r++,t}return n={parse:function(t,n,r,o,l){let s="";const u=[];let c,d,f;const g={},m={};let h="",p="",b={onOpenTag:function(t,n,r){if(r[" imagetype"]&&!r[" imageType"]&&(e.trigger(D.A.CONFORMANCE_VIOLATION,{level:ka.LEVELS.ERROR,event:ka.EVENTS.NON_COMPLIANT_SMPTE_IMAGE_ATTRIBUTE}),r[" imageType"]=r[" imagetype"]),"image"===n&&("http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt"===t||"http://www.smpte-ra.org/schemas/2052-1/2013/smpte-tt"===t)){if(!r[" imageType"]||"PNG"!==r[" imageType"].value)return void a.warn("smpte-tt imageType != PNG. Discarded");h=r["http://www.w3.org/XML/1998/namespace id"].value}},onCloseTag:function(){h&&(m[h]=p.trim()),p="",h=""},onText:function(t){h&&(p+=t)}};if(!t)throw s="no ttml data to parse",new Error(s);g.data=t,e.trigger(R.A.TTML_TO_PARSE,g);let y=(0,Ml.fromXML)(g.data,(function(t){s=t}),b);e.trigger(R.A.TTML_PARSED,{ttmlString:g.data,ttmlDoc:y});const E=y.getMediaTimeEvents();for(f=0;ft.contents.length))&&(c=E[f]+n,d=E[f+1]+n,c0&&(n=i.resolve(e[0].path).url)}const u=t.essentialProperties.filter((t=>t.schemeIdUri&&t.schemeIdUri===w.A.FONT_DOWNLOAD_DVB_SCHEME)),c=t.supplementalProperties.filter((t=>t.schemeIdUri&&t.schemeIdUri===w.A.FONT_DOWNLOAD_DVB_SCHEME));u.length>0?(l=!0,o=u):o=c,o.forEach((r=>{if(function(t){return!(!(t.value&&1===parseInt(t.value)&&t.dvbUrl&&t.dvbUrl.length>0&&t.dvbFontFamily&&t.dvbFontFamily.length>0&&t.dvbMimeType)||t.dvbMimeType!==w.A.OFF_MIMETYPE&&t.dvbMimeType!==w.A.WOFF_MIMETYPE)}(r)){let u=(i=r.dvbUrl,o=n,a.isPathAbsolute(i)?i:a.isRelative(i)?o?a.resolve(i,o):a.resolve(i):i);d.push({fontFamily:r.dvbFontFamily,url:u,mimeType:r.dvbMimeType,trackId:t.id,streamId:e,isEssential:l,status:s,fontFace:new FontFace(r.dvbFontFamily,`url(${u})`,{display:"swap"})})}var i,o}))}function g(t,e){const n=d[t];d[t]={...n,status:e}}function m(){d=[]}return u={addFontsFromTracks:function(t,e){if(t&&Array.isArray(t)&&e)for(let n=0;n{g(t,l),n.trigger(D.A.DVB_FONT_DOWNLOAD_COMPLETE,e)}),(a=>{g(t,o),c.debug("Font download error: ",a),n.trigger(D.A.DVB_FONT_DOWNLOAD_FAILED,e)}))}},getFonts:function(){return d},getFontsForTrackId:function(t){return d.filter((e=>e.trackId&&e.trackId===t))},reset:function(){!function(){for(const t of d){let e=document.fonts.delete(t.fontFace);c.debug(`Removal of fontFamily: ${t.fontFamily} was ${e?"successful":"unsuccessful"}`)}}(),m()}},c=(0,C.A)(e).getInstance().getLogger(u),m(),u}Gl.__dashjs_factory_name="DVBFonts";var Hl=N.A.getClassFactory(Gl);function Yl(t){let e=this.context;const n=t.adapter,a=t.errHandler,r=t.manifestModel,i=t.mediaController,o=t.baseURLController,l=t.videoModel,s=t.settings;let u,c,d,f,g,m,h,p,b,y,E,_,A,T;function v(t){if(T.error(`Could not download ${t.isEssential?"an essential":"a"} font - fontFamily: ${t.fontFamily}, url: ${t.url}`),t.isEssential){let e=f[t.streamId].getTrackIdxForId(t.trackId);f[t.streamId].setModeForTrackIdx(e,w.A.TEXT_DISABLED)}}function I(t){if(T.debug(`Successfully downloaded ${t.isEssential?"an essential":"a"} font - fontFamily: ${t.fontFamily}, url: ${t.url}`),t.isEssential){let e=f[t.streamId].getTrackIdxForId(t.trackId);e===f[t.streamId].getCurrentTrackIdx()?f[t.streamId].setModeForTrackIdx(e,w.A.TEXT_SHOWING):f[t.streamId].setModeForTrackIdx(e,w.A.TEXT_HIDDEN)}}function N(t){let e=t.tracks,n=t.index;const a=t.streamId;if(!1===s.get().streaming.text.defaultEnabled&&!O()||_)L(a,-1);else{const t=i.getCurrentTrackFor(w.A.TEXT,a);if(t){const r={lang:t.lang,role:t.roles[0],index:t.index,codec:t.codec,accessibility:t.accessibility[0]};e.some(((t,e)=>{if(i.matchSettings(r,t))return L(a,e),n=e,!0}))}b=!1}c[a].lastEnabledIndex=n,p.trigger(D.A.TEXT_TRACKS_ADDED,{enabled:O(),index:n,tracks:e,streamId:a}),E=!0,A.addFontsFromTracks(e,a),A.getFonts().forEach((t=>{if(t.isEssential){let e=f[t.streamId].getTrackIdxForId(t.trackId);f[t.streamId].setModeForTrackIdx(e,w.A.TEXT_DISABLED)}})),A.downloadFonts()}function x(t){try{const e=t.streamId;if(!f[e]||isNaN(t.time))return;f[e].manualCueProcessing(t.time)}catch(t){}}function M(t){try{const e=t.streamId;if(!f[e])return;f[e].disableManualTracks()}catch(t){}}function z(t){try{if(!t||!t.mediaType||t.mediaType!==w.A.AUDIO||!t.currentMediaInfo)return;const e=f[t.streamId].getCurrentTextTrackInfo();let n=NaN;b?n=P(t.streamId):F(e)&&t.currentMediaInfo.lang&&t.currentMediaInfo.lang!==e.lang&&(n=P(t.streamId),isNaN(n)&&(n=-1)),isNaN(n)||L(t.streamId,n)}catch(t){T.error(t)}}function O(){let t=!0;return b&&!y&&(t=!1),t}function L(t,e){b=-1===e,b&&i&&i.saveTextSettingsDisabled();let n=U(t);if(n===e||!f[t])return;f[t].disableManualTracks();let a=f[t].getCurrentTextTrackInfo(),r=a?l.getTextTrack(a.kind,a.id,a.lang,a.isTTML,a.isEmbedded):null;r&&r.mode!==w.A.TEXT_DISABLED&&f[t].setModeForTrackIdx(n,w.A.TEXT_HIDDEN),f[t].setCurrentTrackIdx(e),a=f[t].getCurrentTextTrackInfo();const o=s.get().streaming.text.dispatchForManualRendering;if(a&&!o&&a.mode!==w.A.TEXT_DISABLED&&f[t].setModeForTrackIdx(e,w.A.TEXT_SHOWING),a&&a.isFragmented&&!a.isEmbedded)!function(t,e,n){if(!d[t])return;let a=d[t].getConfig().fragmentedTracks;for(let r=0;r(t._indexToSelect=e,!!(t&&t.roles&&t.roles.length>0)&&F(t))))}(t);if(!e||e.length<=0)return NaN;const n=i.getCurrentTrackFor(w.A.AUDIO,t);if(!n)return NaN;const a=e.find((t=>n.lang===t.lang));return a?a._indexToSelect:NaN}function F(t){return!(!t||!t.roles||0===t.roles.length)&&t.roles.some((t=>t.schemeIdUri===w.A.DASH_ROLE_SCHEME_ID&&t.value===S.A.FORCED_SUBTITLE))}function U(t){return f[t].getCurrentTrackIdx()}function j(){d={},f={},c={},b=!0,E=!1,_=!1}return u={addEmbeddedTrack:function(t,e){const n=t.id;d[n]&&d[n].addEmbeddedTrack(e)},addMediaInfosToBuffer:function(t,e,n){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;const r=t.id;d[r]&&d[r].addMediaInfos(e,n,a)},createTracks:function(t){const e=t.id;f[e]&&f[e].createTracks()},deactivateStream:function(t){if(!t)return;const e=t.id;d[e]&&d[e].resetMediaInfos(),f[e]&&f[e].deleteAllTextTracks()},enableForcedTextStreaming:function(t){return(0,yt.sq)(t,"boolean"),y=t,!0},enableText:function(t,e){return(0,yt.sq)(e,"boolean"),O()!==e&&(e&&L(t,c[t].lastEnabledIndex),e||(c[t].lastEnabledIndex=U(t),E?L(t,-1):_=!0)),!0},getAllTracksAreDisabled:function(){return b},getCurrentTrackIdx:U,getTextSourceBuffer:function(t){const e=t.id;if(d&&d[e])return d[e]},initialize:function(){A=Hl(e).create({adapter:n,baseURLController:o}),p.on(R.A.TEXT_TRACKS_QUEUE_INITIALIZED,N,u),p.on(R.A.DVB_FONT_DOWNLOAD_FAILED,v,u),p.on(R.A.DVB_FONT_DOWNLOAD_COMPLETE,I,u),p.on(R.A.MEDIAINFO_UPDATED,z,u),s.get().streaming.text.webvtt.customRenderingEnabled&&(p.on(R.A.PLAYBACK_TIME_UPDATED,x,u),p.on(R.A.PLAYBACK_SEEKING,M,u))},initializeForStream:function(t){const o=t.id,u=Ll(e).create({videoModel:l,settings:s,streamInfo:t});u.initialize(),f[o]=u;const p=Dl(e).create({errHandler:a,adapter:n,dvbFonts:A,manifestModel:r,mediaController:i,videoModel:l,textTracks:u,vttParser:g,vttCustomRenderingParser:m,ttmlParser:h,streamInfo:t,settings:s});p.initialize(),d[o]=p,c[o]={},c[o].lastEnabledIndex=-1},isTextEnabled:O,reset:function(){Object.keys(d).forEach((t=>{d[t].resetEmbedded(),d[t].reset()})),A.reset(),j(),p.off(R.A.TEXT_TRACKS_QUEUE_INITIALIZED,N,u),p.off(R.A.DVB_FONT_DOWNLOAD_FAILED,v,u),p.off(R.A.DVB_FONT_DOWNLOAD_COMPLETE,I,u),p.off(R.A.MEDIAINFO_UPDATED,z,u),s.get().streaming.text.webvtt.customRenderingEnabled&&(p.off(R.A.PLAYBACK_TIME_UPDATED,x,u),p.off(R.A.PLAYBACK_SEEKING,M,u))},setTextTrack:L,clearDataForStream:function(t){d[t]&&(d[t].resetEmbedded(),d[t].reset(),delete d[t]),f[t]&&(f[t].deleteAllTextTracks(),delete f[t]),c[t]&&delete c[t]}},y=!1,E=!1,_=!1,g=Fl(e).getInstance(),m=jl(e).getInstance(),h=ql(e).getInstance(),p=(0,k.A)(e).getInstance(),T=(0,C.A)(e).getInstance().getLogger(u),j(),u}Yl.__dashjs_factory_name="TextController";var Vl=N.A.getClassFactory(Yl);function Kl(t){t=t||{};const e=this.context,n=(0,C.A)(e).getInstance(),a=t.settings,r=(0,k.A)(e).getInstance();let i,o,l,s,u,c;function d(){return navigator&&navigator.connection&&!isNaN(navigator.connection.downlink)&&navigator.connection.downlink>0?1e3*navigator.connection.downlink:NaN}function f(t,e,n,a){const r=Math.pow(.5,n/a.fast);t.fastEstimate=(1-r)*e+r*t.fastEstimate;const i=Math.pow(.5,n/a.slow);t.slowEstimate=(1-i)*e+i*t.slowEstimate,t.totalWeight+=n}function g(){i={},o={},l={},s={}}const m={addEntry:function(t,e){try{if(!(t&&e&&e.trace&&e.trace.length))return;!function(t){i[t]=i[t]||[],o[t]=o[t]||[],l[t]=l[t]||{fastEstimate:0,slowEstimate:0,totalWeight:0},s[t]=s[t]||{fastEstimate:0,slowEstimate:0,totalWeight:0}}(t);const n=e.tresponse.getTime()-e.trequest.getTime()||1;let g=function(t,e){return t._fileLoaderType&&t._fileLoaderType===w.A.FILE_LOADER_TYPES.FETCH?function(t){const e=t.trace.reduce(((t,e)=>t+e.b[0]),0),n=t.trace.reduce(((t,e)=>t+e.d),0);let r=NaN;return a.get().streaming.abr.throughput.useNetworkInformationApi.fetch&&(r=d()),isNaN(r)&&(r=Math.round(8*e/n)),{downloadedBytes:e,value:r,downloadTimeInMs:n}}(t):function(t,e){let n=NaN,r=NaN,i=!1;if(a.get().streaming.abr.throughput.useResourceTimingApi&&t._resourceTimingValues)n=t._resourceTimingValues.transferSize,r=t._resourceTimingValues.responseEnd-t._resourceTimingValues.responseStart,i=!0;else{if(t.trace.length<=1)return{throughput:NaN,downloadTimeInMs:NaN};n=t.trace.reduce(((t,e)=>t+e.b[0]),0)-t.trace[0].b[0],r=Math.max(t.trace.reduce(((t,e)=>t+e.d),0)-t.trace[0].d,1)}let o=NaN;if(!i&&a.get().streaming.abr.throughput.useNetworkInformationApi.xhr&&(o=d()),isNaN(o)){const t=a.get().streaming.abr.throughput.useDeadTimeLatency?r:r+e;o=Math.round(8*n/t)}return{downloadedBytes:n,value:o,downloadTimeInMs:r}}(t,e)}(e,n);if(g.latencyInMs=n,isNaN(g.value)||!isFinite(g.value))return;if(e.cmsd){const t=e.cmsd.dynamic&&e.cmsd.dynamic.etp?e.cmsd.dynamic.etp:null;if(t){const e=a.get().streaming.cmsd.abr.etpWeightRatio;e>0&&e<=1&&(g.value=g.value*(1-e)+t*e)}}if(function(t,e,n){return a.get().streaming.abr.throughput.useResourceTimingApi&&n._resourceTimingValues?0===n._resourceTimingValues.transferSize&&n._resourceTimingValues.decodedBodySize>0:!isNaN(e)&&(t===w.A.VIDEO?ea.get().streaming.abr.throughput.sampleSettings.maxMeasurementsToKeep&&i[t].shift(),o[t].length>a.get().streaming.abr.throughput.sampleSettings.maxMeasurementsToKeep&&o[t].shift()}(t),r.trigger(D.A.THROUGHPUT_MEASUREMENT_STORED,{throughputValues:g}),e.type!==z.G.MPD_TYPE&&(f(l[t],g.value,a.get().streaming.abr.throughput.ewma.weightDownloadTimeMultiplicationFactor*g.downloadTimeInMs,u.bandwidthHalfLife),f(s[t],n,1,u.latencyHalfLife))}catch(t){c.error(t)}},getThroughputDict:function(t){return t?i[t]:i},getEwmaThroughputDict:function(t){return t?l[t]:l},getEwmaLatencyDict:function(t){return t?s[t]:s},getEwmaHalfLife:function(){return u},getLatencyDict:function(t){return t?o[t]:o},reset:g};return c=n.getLogger(m),u={bandwidthHalfLife:{fast:a.get().streaming.abr.throughput.ewma.throughputFastHalfLifeSeconds,slow:a.get().streaming.abr.throughput.ewma.throughputSlowHalfLifeSeconds},latencyHalfLife:{fast:a.get().streaming.abr.throughput.ewma.latencyFastHalfLifeCount,slow:a.get().streaming.abr.throughput.ewma.latencySlowHalfLifeCount}},g(),m}Kl.__dashjs_factory_name="ThroughputModel";var Wl=N.A.getClassFactory(Kl);function $l(){const t=this.context,e=(0,k.A)(t).getInstance();let n,a,r;function i(){performance.clearResourceTimings()}function o(t){t.metric!==I.HTTP_REQUEST||!t.value||t.value.type!==z.G.MPD_TYPE&&(t.value.type!==z.G.MEDIA_SEGMENT_TYPE||t.mediaType!==w.A.AUDIO&&t.mediaType!==w.A.VIDEO)||n.addEntry(t.mediaType,t.value)}function l(t,e){let i,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:NaN,b=null,y=n.getEwmaHalfLife(),E=null,_=!0;switch(o||(o=r.get().streaming.abr.throughput.averageCalculationMode),t){case w.A.THROUGHPUT_TYPES.BANDWIDTH:b=o===w.A.THROUGHPUT_CALCULATION_MODES.EWMA?n.getEwmaThroughputDict(e):n.getThroughputDict(e),E=y.bandwidthHalfLife,_=!0,l=isNaN(l)?a.getIsDynamic()?r.get().streaming.abr.throughput.sampleSettings.live:r.get().streaming.abr.throughput.sampleSettings.vod:l;break;case w.A.THROUGHPUT_TYPES.LATENCY:b=o===w.A.THROUGHPUT_CALCULATION_MODES.EWMA?n.getEwmaLatencyDict(e):n.getLatencyDict(e),E=y.latencyHalfLife,_=!1,l=isNaN(l)?r.get().streaming.abr.throughput.sampleSettings.averageLatencySampleAmount:l}if(!b||0===b.length)return NaN;switch(o){case w.A.THROUGHPUT_CALCULATION_MODES.ARITHMETIC_MEAN:return i=s(b,l,t),u(b,i);case w.A.THROUGHPUT_CALCULATION_MODES.BYTE_SIZE_WEIGHTED_ARITHMETIC_MEAN:return i=s(b,l,t),c(b,i);case w.A.THROUGHPUT_CALCULATION_MODES.DATE_WEIGHTED_ARITHMETIC_MEAN:return i=s(b,l,t),d(b,i);case w.A.THROUGHPUT_CALCULATION_MODES.HARMONIC_MEAN:return i=s(b,l,t),f(b,i);case w.A.THROUGHPUT_CALCULATION_MODES.BYTE_SIZE_WEIGHTED_HARMONIC_MEAN:return i=s(b,l,t),g(b,i);case w.A.THROUGHPUT_CALCULATION_MODES.DATE_WEIGHTED_HARMONIC_MEAN:return i=s(b,l,t),m(b,i);case w.A.THROUGHPUT_CALCULATION_MODES.EWMA:return h(b,E,_);case w.A.THROUGHPUT_CALCULATION_MODES.ZLEMA:return i=s(b,l,t),p(b,i)}}function s(t,e,n){if(t){if(e>=t.length)e=t.length;else if(n===w.A.THROUGHPUT_TYPES.BANDWIDTH&&r.get().streaming.abr.throughput.sampleSettings.enableSampleSizeAdjustment)for(let n=1;n=r.get().streaming.abr.throughput.sampleSettings.increaseScale||a<=r.get().streaming.abr.throughput.sampleSettings.decreaseScale)&&(e+=1)===t.length)break}}else e=0;return e}function u(t,e){let n=t;return 0!==e&&n&&0!==n.length?(n=n.slice(-e),n.reduce(((t,e)=>t+e.value),0)/n.length):NaN}function c(t,e){let n=t;if(0===e||!n||0===n.length)return NaN;n=n.slice(-e);let a=0;return n.reduce(((t,e)=>{let n=Math.sqrt(e.downloadedBytes);return a+=n,t+e.value*n}),0)/a}function d(t,e){let n=t;if(0===e||!n||0===n.length)return NaN;n=n.slice(-e);let a=0;return n.reduce(((t,e,n)=>{let r=n+1;return a+=r,t+e.value*r}),0)/a}function f(t,e){let n=t;if(0===e||!n||0===n.length)return NaN;n=n.slice(-e);const a=n.reduce(((t,e)=>t+1/e.value),0);return n.length/a}function g(t,e){let n=t;if(0===e||!n||0===n.length)return NaN;n=n.slice(-e);let a=0;const r=n.reduce(((t,e)=>{let n=Math.sqrt(e.downloadedBytes);return a+=n,t+1/e.value*n}),0);return a/r}function m(t,e){let n=t;if(0===e||!n||0===n.length)return NaN;n=n.slice(-e);let a=0;const r=n.reduce(((t,e,n)=>{let r=n+1;return a+=r,t+1/e.value*r}),0);return a/r}function h(t,e){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!t||t.totalWeight<=0)return NaN;const a=t.fastEstimate/(1-Math.pow(.5,t.totalWeight/e.fast)),r=t.slowEstimate/(1-Math.pow(.5,t.totalWeight/e.slow));return n?Math.min(a,r):Math.max(a,r)}function p(t,e){if(0===e||!t||0===t.length)return NaN;let n=t.slice(-e).map((t=>t.value)),a=2/(n.length+1),r=n[n.length-1],i=n[n.length-1];for(let t=0;t1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:NaN;const a=l(w.A.THROUGHPUT_TYPES.BANDWIDTH,t,e,n);return Math.round(a)}const y={getArithmeticMean:u,getAverageLatency:function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:NaN;const a=l(w.A.THROUGHPUT_TYPES.LATENCY,t,e,n);return Math.round(a)},getAverageThroughput:b,getByteSizeWeightedArithmeticMean:c,getByteSizeWeightedHarmonicMean:g,getDateWeightedArithmeticMean:d,getDateWeightedHarmonicMean:m,getEwma:h,getHarmonicMean:f,getRawThroughputData:function(t){return t?n.getThroughputDict(t):[]},getSafeAverageThroughput:function(t){let e=b(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,arguments.length>2&&void 0!==arguments[2]?arguments[2]:NaN);return isNaN(e)||(e*=r.get().streaming.abr.throughput.bandwidthSafetyFactor),e},getZlema:p,initialize:function(){n=Wl(t).create({settings:r}),e.on(D.A.METRIC_ADDED,o,y),performance&&performance.addEventListener("resourcetimingbufferfull",i)},reset:function(){n.reset(),e.off(D.A.METRIC_ADDED,o,y),performance&&performance.removeEventListener("resourcetimingbufferfull",i)},setConfig:function(t){t.settings&&(r=t.settings),t.playbackController&&(a=t.playbackController)}};return y}$l.__dashjs_factory_name="ThroughputController";var Xl=N.A.getSingletonFactory($l);function Ql(){const t="You must first call initialize() and set a source before calling this method",e="You must first call initialize() and set a valid source and view before calling this method",n="You must first call attachView() to set the video element before calling this method",a="You must first call attachSource() with a valid source before calling this method",r="MediaPlayer not initialized!",i=this.context,o=(0,k.A)(i).getInstance();let l=(0,K.A)(i).getInstance();const s=(0,C.A)(i).getInstance({settings:l});let u,c,d,f,g,m,h,p,b,y,E,_,A,T,x,O,L,P,F,U,j,B,q,H,Y,W,$,X,Q,Z,J,tt,et,nt,at,rt,it,ot,lt,st,ut;function ct(){It(null),vt(null),f=null,x&&(x.reset(),x=null),O&&(O.reset(),O=null),j&&j.reset(),l.reset(),P&&(P.reset(),P=null)}function dt(){return!!d&&!!it.getElement()}function ft(){return(0,vo.i)()}function gt(){if(!h)throw e;return Q.isPaused()}function mt(){if(!h)throw e;return Q.getIsDynamic()}function ht(t){const e=W&&W.hasVideoTrack()?w.A.VIDEO:w.A.AUDIO;let n=et.getCurrentDVRInfo(e);return n?pt(n.range.start+t,n):0}function pt(t,e){let n=Q.getOriginalLiveDelay();return t>e.range.end-n&&(t=e.range.end-n),t}function bt(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if(!h)throw e;let n=Tt().currentTime;return""!==t&&(n=W.getTimeRelativeToStreamId(n,t)),n}function Et(t){(0,yt.sq)(t,"boolean"),p=t}function _t(){j.restoreDefaultUTCTimingSources()}function At(){return et}function Tt(){if(!it.getElement())throw n;return it.getElement()}function vt(t){if(!g)throw r;it.setElement(t),t&&(Ct(),function(){if(O||"undefined"==typeof dashjs)return;let t=dashjs.MetricsReporting;if("function"==typeof t){let e=t(i).create();O=e.createMetricsReporting({debug:s,eventBus:o,mediaElement:Tt(),adapter:F,dashMetrics:et,mediaPlayerModel:U,events:R.A,constants:w.A,metricsConstants:I})}}(),function(){if(L||"undefined"==typeof dashjs)return;let t=dashjs.MssHandler;"function"==typeof t&&(V.extend(t.errors),L=t(i).create({eventBus:o,mediaPlayerModel:U,dashMetrics:et,manifestModel:nt,playbackController:Q,streamController:W,protectionController:x,baseURLController:q,errHandler:B,events:R.A,constants:w.A,debug:s,initSegmentType:z.G.INIT_SEGMENT_TYPE,BASE64:_l,ISOBoxer:Jn,settings:l}))}(),W&&W.switchToVideoElement(b)),h&&Rt(),xt(b)}function St(e){if(!m)throw t;let n=W.getActiveStreamInfo();return n?T.getTracksFor(e,n.id).filter((t=>!x||x.areKeyIdsUsable(t.normalizedKeyIds))):[]}function It(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:NaN;if(!g)throw r;"string"==typeof t&&ot.initialize(t),null==e&&(e=NaN),isNaN(e)||(e=Math.max(0,e)),b=e,d=t,(m||h)&&Rt(),dt()&&xt(b)}function kt(){if(!m)throw t;let e=W.getActiveStreamInfo();return e?W.getStreamById(e.id):null}function Rt(){h=!1,m=!1,F.reset(),W.reset(),X.reset(),tt.reset(),Q.reset(),Z.reset(),J.reset(),y.reset(),E.reset(),T.reset(),st.reset(),x&&(l.get().streaming.protection.keepProtectionMediaKeys?x.stop():(x.reset(),x=null,Ct())),$.reset(),at.reset(),rt.reset()}function Nt(){return ii(i).create({debug:s,errHandler:B,dashMetrics:et,mediaPlayerModel:U,mssHandler:L,settings:l})}function Ct(){if(x)return x;if("undefined"==typeof dashjs)return null;let t=dashjs.Protection;if("function"==typeof t){let e=t(i).create();return R.A.extend(t.events),D.A.extend(t.events,{publicOnly:!0}),V.extend(t.errors),x=e.createProtectionSystem({debug:s,errHandler:B,videoModel:it,customParametersModel:j,capabilities:H,eventBus:o,events:R.A,BASE64:_l,constants:w.A,cmcdModel:at,settings:l}),H||(H=(0,si.A)(i).getInstance()),H.setProtectionController(x),x}return null}function Dt(){if(!g)throw r;if(P)return P;if("undefined"==typeof dashjs)return null;let t=dashjs.OfflineController;if("function"==typeof t){R.A.extend(t.events),D.A.extend(t.events,{publicOnly:!0}),V.extend(t.errors);const e=Nt(),n=Ea(i).create();return n.setConfig({manifestModel:nt,adapter:F,manifestLoader:e,errHandler:B,contentSteeringController:J}),P=t(i).create({debug:s,manifestUpdater:n,baseURLController:q,manifestLoader:e,manifestModel:nt,mediaPlayerModel:U,abrController:y,playbackController:Q,adapter:F,errHandler:B,dashMetrics:et,timelineConverter:A,segmentBaseController:st,schemeLoaderFactory:_,eventBus:o,events:R.A,errors:V,constants:w.A,settings:l,dashConstants:S.A,urlUtils:wt(i).getInstance()}),P}return null}function xt(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:NaN;P&&P.resetRecords(),!m&&d&&(m=!0,c.info("Streaming Initialized"),function(){const t=Nt();W||(W=Da(i).getInstance()),$||($=Vl(i).create({errHandler:B,manifestModel:nt,adapter:F,mediaController:T,baseURLController:q,videoModel:it,settings:l})),Y.setConfig({capabilities:H,customParametersModel:j,adapter:F,settings:l,protectionController:x,manifestModel:nt,errHandler:B}),W.setConfig({capabilities:H,capabilitiesFilter:Y,manifestLoader:t,manifestModel:nt,mediaPlayerModel:U,customParametersModel:j,protectionController:x,textController:$,adapter:F,dashMetrics:et,errHandler:B,timelineConverter:A,videoModel:it,playbackController:Q,serviceDescriptionController:Z,contentSteeringController:J,abrController:y,throughputController:E,mediaController:T,settings:l,baseURLController:q,uriFragmentModel:ot,segmentBaseController:st}),X.setConfig({settings:l,playbackController:Q,streamController:W,videoModel:it,timelineConverter:A,adapter:F}),Q.setConfig({streamController:W,serviceDescriptionController:Z,dashMetrics:et,adapter:F,videoModel:it,timelineConverter:A,settings:l}),tt.setConfig({streamController:W,playbackController:Q,mediaPlayerModel:U,videoModel:it,settings:l}),E.setConfig({settings:l,playbackController:Q}),y.setConfig({streamController:W,capabilities:H,domStorage:lt,mediaPlayerModel:U,customParametersModel:j,throughputController:E,cmsdModel:rt,dashMetrics:et,adapter:F,videoModel:it,settings:l}),at.setConfig({abrController:y,dashMetrics:et,playbackController:Q,serviceDescriptionController:Z,throughputController:E}),ut.setConfig({serviceDescriptionController:Z}),rt.setConfig({}),T.initialize(),E.initialize(),y.initialize(),W.initialize(p,f),$.initialize(),X.initialize(),tt.initialize(),at.initialize(p),rt.initialize(),J.initialize(),st.initialize()}(),"string"==typeof d?W.load(d,t):W.loadWithManifest(d,t)),!h&&dt()&&(h=!0,o.trigger(D.A.PLAYBACK_INITIALIZED),c.info("Playback Initialized"))}return u={addABRCustomRule:function(t,e,n){j.addAbrCustomRule(t,e,n)},addRequestInterceptor:function(t){j.addRequestInterceptor(t)},addResponseInterceptor:function(t){j.addResponseInterceptor(t)},addUTCTimingSource:function(t,e){j.addUTCTimingSource(t,e)},attachProtectionController:function(t){x=t},attachSource:It,attachTTMLRenderingDiv:function(t){if(!it.getElement())throw n;it.setTTMLRenderingDiv(t)},attachView:vt,attachVttRenderingDiv:function(t){if(!it.getElement())throw n;it.setVttRenderingDiv(t)},clearDefaultUTCTimingSources:function(){j.clearDefaultUTCTimingSources()},convertToTimeCode:function(t){t=Math.max(t,0);let e=Math.floor(t/3600),n=Math.floor(t%3600/60),a=Math.floor(t%3600%60);return(0===e?"":e<10?"0"+e.toString()+":":e.toString()+":")+(n<10?"0"+n.toString():n.toString())+":"+(a<10?"0"+a.toString():a.toString())},destroy:function(){ct(),N.A.deleteSingletonInstances(i)},duration:function(){if(!h)throw e;let t=Tt().duration;if(Q.getIsDynamic()){const e=W&&W.hasVideoTrack()?w.A.VIDEO:w.A.AUDIO;let n=et.getCurrentDVRInfo(e);t=n?n.range.end-n.range.start:0}return t},enableForcedTextStreaming:function(t){return!(!W.getActiveStreamInfo()||!$)&&$.enableForcedTextStreaming(t)},enableText:function(t){const e=W.getActiveStreamInfo();return!(!e||!$)&&$.enableText(e.id,t)},extend:function(t,e,n){N.A.extend(t,e,n,i)},formatUTC:function(t,e,n){let a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=new Date(1e3*t),i=r.toLocaleDateString(e),o=r.toLocaleTimeString(e,{hour12:n});return a?o+" "+i:o},getABRCustomRules:function(){return j.getAbrCustomRules()},getActiveStream:kt,getAutoPlay:function(){return p},getAvailableBaseUrls:function(){const t=nt.getValue();return t?q.getBaseUrls(t):[]},getAvailableLocations:function(){const t=nt.getValue();if(!t)return[];const e=F.getLocation(t),n=J.getSynthesizedLocationElements(e);return e.concat(n)},getAverageLatency:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:w.A.VIDEO,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:NaN;return E?E.getAverageLatency(t,e,n):0},getAverageThroughput:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:w.A.VIDEO,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:NaN;return E?E.getAverageThroughput(t,e,n):0},getBufferLength:function(t){const e=[w.A.VIDEO,w.A.AUDIO,w.A.TEXT];if(t){if(-1!==e.indexOf(t)){return At().getCurrentBufferLevel(t)||NaN}return c.warn("getBufferLength requested for invalid type"),NaN}{const t=e.map((t=>St(t).length>0?At().getCurrentBufferLevel(t):Number.MAX_VALUE)).reduce(((t,e)=>Math.min(t,e)));return t===Number.MAX_VALUE?NaN:t}},getCurrentLiveLatency:function(){if(!g)throw r;return h?Q.getCurrentLiveLatency():NaN},getCurrentRepresentationForType:function(e){if(!m)throw t;if(e!==w.A.IMAGE&&e!==w.A.VIDEO&&e!==w.A.AUDIO)return null;const n=kt();if(!n)return null;if(e===w.A.IMAGE){const t=n.getThumbnailController();return t?t.getCurrentTrack():-1}return n.getCurrentRepresentationForType(e)},getCurrentSteeringResponseData:function(){if(J)return J.getCurrentSteeringResponseData()},getCurrentTextTrackIndex:function(){let t=NaN;const e=W.getActiveStreamInfo();if(e&&$)return t=$.getCurrentTrackIdx(e.id),t},getCurrentTrackFor:function(e){if(!m)throw t;let n=W.getActiveStreamInfo();return n?T.getCurrentTrackFor(e,n.id):null},getDashAdapter:function(){return F},getDashMetrics:At,getDebug:function(){return s},getDvrSeekOffset:ht,getDvrWindow:function(){if(!h)throw e;const t=W&&W.hasVideoTrack()?w.A.VIDEO:w.A.AUDIO;let n=et.getCurrentDVRInfo(t);if(!n)return{};let a=0;const r=Q.getIsDynamic();return r&&(a=n.manifestInfo.availableFrom.getTime()/1e3),{start:n.range.start,end:n.range.end,startAsUtc:r?a+n.range.start:NaN,endAsUtc:r?a+n.range.end:NaN,size:n.range.end-n.range.start}},getInitialMediaSettingsFor:function(t){if(!g)throw r;return T.getInitialSettings(t)},getLowLatencyModeEnabled:function(){if(!h)throw e;return Q.getLowLatencyModeEnabled()},getManifest:function(){return nt.getValue()},getOfflineController:function(){return Dt()},getPlaybackRate:function(){return Tt().playbackRate},getProtectionController:function(){return Ct()},getRawThroughputData:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:w.A.VIDEO;return E?E.getRawThroughputData(t):[]},getRepresentationsByType:function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!m)throw t;let a=n?W.getStreamById(n):kt();return a?a.getRepresentationsByType(e):[]},getSafeAverageThroughput:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:w.A.VIDEO,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:NaN;return E?E.getSafeAverageThroughput(t,e,n):0},getSettings:function(){return l.get()},getSource:function(){if(!d)throw a;return d},getStreamsFromManifest:function(e){if(!m)throw t;return F.getStreamsInfo(e)},getTTMLRenderingDiv:function(){return it?it.getTTMLRenderingDiv():null},getTargetLiveDelay:function(){if(!h)throw e;return Q.getOriginalLiveDelay()},getTracksFor:St,getTracksForTypeFromManifest:function(e,n,a){if(!m)throw t;return(a=a||F.getStreamsInfo(n,1)[0])?F.getAllMediaInfoForType(a,e,n):[]},getVersion:ft,getVideoElement:Tt,getVolume:function(){return Tt().volume},getXHRWithCredentialsForType:function(t){return j.getXHRWithCredentialsForType(t)},initialize:function(t,e,n){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:NaN;H||(H=(0,si.A)(i).getInstance(),H.setConfig({settings:l,protectionController:x})),B||(B=li(i).getInstance()),H.supportsMediaSource()?(g||(g=!0,A=pl(i).getInstance(),E||(E=Xl(i).getInstance()),y||(y=co(i).getInstance()),_||(_=Un(i).getInstance()),Q||(Q=M(i).getInstance()),T||(T=mr(i).getInstance()),W||(W=Da(i).getInstance()),X||(X=Ma(i).getInstance()),tt||(tt=Oa(i).getInstance()),Z||(Z=ja(i).getInstance()),J||(J=ha(i).getInstance()),Y||(Y=ci(i).getInstance()),F=Ko(i).getInstance(),nt=hi(i).getInstance(),at=an(i).getInstance(),rt=In(i).getInstance(),ut=Dn(i).getInstance(),et=ul(i).getInstance({settings:l}),lt=To(i).getInstance({settings:l}),F.setConfig({constants:w.A,cea608parser:new v,errHandler:B,BASE64:_l}),q||(q=Rr(i).create()),q.setConfig({adapter:F,contentSteeringController:J}),Z.setConfig({adapter:F}),st||(st=Do(i).getInstance({dashMetrics:et,mediaPlayerModel:U,errHandler:B,baseURLController:q,events:R.A,eventBus:o,debug:s,boxParser:na(i).getInstance(),errors:V})),T.setConfig({domStorage:lt,settings:l,mediaPlayerModel:U,customParametersModel:j,videoModel:it}),U.setConfig({playbackController:Q,serviceDescriptionController:Z}),J.setConfig({adapter:F,errHandler:B,dashMetrics:et,mediaPlayerModel:U,manifestModel:nt,serviceDescriptionController:Z,throughputController:E,eventBus:o}),_t(),Et(void 0===n||n),Dt()),t&&vt(t),e&&It(e,a),c.info("[dash.js "+ft()+"] MediaPlayer has been initialized")):B.error(new G.A(V.CAPABILITY_MEDIASOURCE_ERROR_CODE,V.CAPABILITY_MEDIASOURCE_ERROR_MESSAGE))},isDynamic:mt,isMuted:function(){return Tt().muted},isPaused:gt,isReady:dt,isSeeking:function(){if(!h)throw e;return Q.isSeeking()},isTextEnabled:function(){const t=W.getActiveStreamInfo();return!(!t||!$)&&$.isTextEnabled(t)},off:function(t,e,n){o.off(t,e,n)},on:function(t,e,n,a){o.on(t,e,n,a)},pause:function(){if(!h)throw e;Q.pause()},play:function(){if(!h)throw e;(!p||gt()&&h)&&Q.play(!0)},preload:function(){if(!it.getElement()&&!m){if(!d)throw a;xt(b)}},provideThumbnail:function(t,e){if("function"!=typeof e)return;if(t<0)return void e(null);const n=Q.getIsDynamic()?ht(t):t,a=W.getStreamForTime(n);if(null===a)return void e(null);const r=a.getThumbnailController();if(r)return r.provide(n,e);e(null)},refreshManifest:function(t){if(!g)throw r;if(!dt())return t(null,a);let e=this;if("function"==typeof t){const n=function(a){o.off(R.A.INTERNAL_MANIFEST_LOADED,n,e),a.error?t(null,a.error):t(a.manifest)};o.on(R.A.INTERNAL_MANIFEST_LOADED,n,e)}W.refreshManifest()},registerCustomCapabilitiesFilter:function(t){j.registerCustomCapabilitiesFilter(t)},registerLicenseRequestFilter:function(t){j.registerLicenseRequestFilter(t)},registerLicenseResponseFilter:function(t){j.registerLicenseResponseFilter(t)},removeABRCustomRule:function(t){j.removeAbrCustomRule(t)},removeAllABRCustomRule:function(){j.removeAllAbrCustomRule()},removeRequestInterceptor:function(t){j.removeRequestInterceptor(t)},removeResponseInterceptor:function(t){j.removeResponseInterceptor(t)},removeUTCTimingSource:function(t,e){j.removeUTCTimingSource(t,e)},reset:ct,resetCustomInitialTrackSelectionFunction:function(){j.resetCustomInitialTrackSelectionFunction(null)},resetSettings:function(){l.reset()},restoreDefaultUTCTimingSources:_t,retrieveManifest:function(t,e){let n=Nt(),a=this;const r=function(t){t.error?e(null,t.error):e(t.manifest),o.off(R.A.INTERNAL_MANIFEST_LOADED,r,a),n.reset()};o.on(R.A.INTERNAL_MANIFEST_LOADED,r,a),ot.initialize(t),n.load(t)},seek:function(t){if(!h)throw e;if((0,yt.sq)(t,"number"),isNaN(t))throw w.A.BAD_ARGUMENT_ERROR;t<0&&(t=0);let n=Q.getIsDynamic()?ht(t):t;const a=Tt();!Q.getIsDynamic()&&a.duration&&(n=Math.min(a.duration,n)),Q.seek(n,!1,!1,!0)},seekToOriginalLive:function(){h&&mt()&&Q.seekToOriginalLive()},seekToPresentationTime:function(t){if(!h)throw e;if((0,yt.sq)(t,"number"),isNaN(t))throw w.A.BAD_ARGUMENT_ERROR;t<0&&(t=0);const n=Tt();if(!Q.getIsDynamic()&&n.duration&&(t=Math.min(n.duration,t)),Q.getIsDynamic()){const e=W&&W.hasVideoTrack()?w.A.VIDEO:w.A.AUDIO;let n=et.getCurrentDVRInfo(e);if(!n)return;(t=pt(t,n))1&&void 0!==arguments[1]&&arguments[1];if(!m)throw t;!x||x.areKeyIdsUsable(e.normalizedKeyIds)?T.setTrack(e,{noSettingsSave:n}):c.error(`Can not switch to track with index ${e.index} because key is not usable`)},setCustomInitialTrackSelectionFunction:function(t){j.setCustomInitialTrackSelectionFunction(t)},setInitialMediaSettingsFor:function(t,e){if(!g)throw r;let n=function(t){const e=l.get().streaming.defaultSchemeIdUri;let n={};function a(t,e,n){let a={};if(e){if(e instanceof Array)throw"Array type not supported for settings!";return e instanceof Object?(a.schemeIdUri=e.schemeIdUri?e.schemeIdUri:"",a.value=e.value?e.value:""):(a.schemeIdUri=n,a.value=e,c.warn("No schemeIdUri provided for "+t+', using default "'+n+'"')),a}return null}return void 0!==t.id&&(n.id=t.id),void 0!==t.lang&&(n.lang=t.lang),isNaN(t.index)||(n.index=t.index),void 0!==t.viewpoint&&(n.viewpoint=a("viewpoint",t.viewpoint,e.viewpoint)),void 0!==t.audioChannelConfiguration&&(n.audioChannelConfiguration=a("audioChannelConfiguration",t.audioChannelConfiguration,e.audioChannelConfiguration)),void 0!==t.role&&(n.role=a("role",t.role,e.role),n.role.schemeIdUri===w.A.DASH_ROLE_SCHEME_ID&&"Main"===n.role.value&&(n.role.value=S.A.MAIN)),void 0!==t.accessibility&&(n.accessibility=a("accessibility",t.accessibility,e.accessibility)),n}(e);T.setInitialSettings(t,n)},setMute:function(t){(0,yt.sq)(t,"boolean"),Tt().muted=t},setPlaybackRate:function(t){Tt().playbackRate=t},setProtectionData:function(t){f=t,W&&W.setProtectionData(f)},setRepresentationForTypeById:function(e,n){let a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e!==w.A.IMAGE&&e!==w.A.VIDEO&&e!==w.A.AUDIO)return;if(!m)throw t;const r=kt();if(r)if(e===w.A.IMAGE){const t=r.getThumbnailController();t&&t.setTrackById(n)}else{const t=r.getRepresentationForTypeById(e,n);t&&y.setPlaybackQuality(e,W.getActiveStreamInfo(),t,{forceReplace:a})}},setRepresentationForTypeByIndex:function(e,n){let a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e!==w.A.IMAGE&&e!==w.A.VIDEO&&e!==w.A.AUDIO)return;if(!m)throw t;const r=kt();if(r)if(e===w.A.IMAGE){const t=r.getThumbnailController();t&&t.setTrackByIndex(n)}else{const t=r.getRepresentationForTypeByIndex(e,n);t&&y.setPlaybackQuality(e,W.getActiveStreamInfo(),t,{forceReplace:a})}},setTextTrack:function(t){if(!h)throw e;const n=W.getActiveStreamInfo();n&&$&&$.setTextTrack(n.id,t)},setVolume:function(t){if("number"!=typeof t||isNaN(t)||t<0||t>1)throw w.A.BAD_ARGUMENT_ERROR;Tt().volume=t},setXHRWithCredentialsForType:function(t,e){j.setXHRWithCredentialsForType(t,e)},time:bt,timeAsUTC:function(){if(!h)throw e;if(!Q.getIsDynamic()||bt()<0)return NaN;const t=W&&W.hasVideoTrack()?w.A.VIDEO:w.A.AUDIO;let n,a,r=et.getCurrentDVRInfo(t);return r?(n=r.manifestInfo.availableFrom.getTime()/1e3,a=n+bt(),a):0},timeInDvrWindow:function(){if(!h)throw e;if(!Q.getIsDynamic())return bt();let t=Tt().currentTime;const n=W&&W.hasVideoTrack()?w.A.VIDEO:w.A.AUDIO;let a=et.getCurrentDVRInfo(n);return t=null===a||0===t?0:Math.max(0,t-a.range.start),t},trigger:function(t,e,n){o.trigger(t,e,n)},triggerSteeringRequest:function(){if(J)return J.loadSteeringData()},unregisterCustomCapabilitiesFilter:function(t){j.unregisterCustomCapabilitiesFilter(t)},unregisterLicenseRequestFilter:function(t){j.unregisterLicenseRequestFilter(t)},unregisterLicenseResponseFilter:function(t){j.unregisterLicenseResponseFilter(t)},updateSettings:function(t){l.update(t)},updateSource:function(t){d=t,W.load(d)}},c=s.getLogger(u),g=!1,h=!1,m=!1,p=!0,b=NaN,x=null,P=null,f=null,F=null,st=null,R.A.extend(D.A),U=bi(i).getInstance(),j=(0,kn.A)(i).getInstance(),it=mo(i).getInstance(),ot=gi(i).getInstance(),u}Ql.__dashjs_factory_name="MediaPlayer";const Zl=N.A.getClassFactory(Ql);Zl.events=D.A,Zl.errors=V,N.A.updateClassFactory(Ql.__dashjs_factory_name,Zl);var Jl=Zl},1191:function(t,e,n){"use strict";var a=n(7252);class r extends a.A{constructor(){super(),this.AST_IN_FUTURE="astInFuture",this.BASE_URLS_UPDATED="baseUrlsUpdated",this.BUFFER_EMPTY="bufferStalled",this.BUFFER_LOADED="bufferLoaded",this.BUFFER_LEVEL_STATE_CHANGED="bufferStateChanged",this.BUFFER_LEVEL_UPDATED="bufferLevelUpdated",this.DVB_FONT_DOWNLOAD_ADDED="dvbFontDownloadAdded",this.DVB_FONT_DOWNLOAD_COMPLETE="dvbFontDownloadComplete",this.DVB_FONT_DOWNLOAD_FAILED="dvbFontDownloadFailed",this.DYNAMIC_TO_STATIC="dynamicToStatic",this.ERROR="error",this.FRAGMENT_LOADING_COMPLETED="fragmentLoadingCompleted",this.FRAGMENT_LOADING_PROGRESS="fragmentLoadingProgress",this.FRAGMENT_LOADING_STARTED="fragmentLoadingStarted",this.FRAGMENT_LOADING_ABANDONED="fragmentLoadingAbandoned",this.LOG="log",this.MANIFEST_LOADING_STARTED="manifestLoadingStarted",this.MANIFEST_LOADING_FINISHED="manifestLoadingFinished",this.MANIFEST_LOADED="manifestLoaded",this.METRICS_CHANGED="metricsChanged",this.METRIC_CHANGED="metricChanged",this.METRIC_ADDED="metricAdded",this.METRIC_UPDATED="metricUpdated",this.PERIOD_SWITCH_STARTED="periodSwitchStarted",this.PERIOD_SWITCH_COMPLETED="periodSwitchCompleted",this.QUALITY_CHANGE_REQUESTED="qualityChangeRequested",this.QUALITY_CHANGE_RENDERED="qualityChangeRendered",this.NEW_TRACK_SELECTED="newTrackSelected",this.TRACK_CHANGE_RENDERED="trackChangeRendered",this.STREAM_INITIALIZING="streamInitializing",this.STREAM_UPDATED="streamUpdated",this.STREAM_ACTIVATED="streamActivated",this.STREAM_DEACTIVATED="streamDeactivated",this.STREAM_INITIALIZED="streamInitialized",this.STREAM_TEARDOWN_COMPLETE="streamTeardownComplete",this.TEXT_TRACKS_ADDED="allTextTracksAdded",this.TEXT_TRACK_ADDED="textTrackAdded",this.CUE_ENTER="cueEnter",this.CUE_EXIT="cueExit",this.THROUGHPUT_MEASUREMENT_STORED="throughputMeasurementStored",this.TTML_PARSED="ttmlParsed",this.TTML_TO_PARSE="ttmlToParse",this.CAPTION_RENDERED="captionRendered",this.CAPTION_CONTAINER_RESIZE="captionContainerResize",this.CAN_PLAY="canPlay",this.CAN_PLAY_THROUGH="canPlayThrough",this.PLAYBACK_ENDED="playbackEnded",this.PLAYBACK_ERROR="playbackError",this.PLAYBACK_INITIALIZED="playbackInitialized",this.PLAYBACK_NOT_ALLOWED="playbackNotAllowed",this.PLAYBACK_METADATA_LOADED="playbackMetaDataLoaded",this.PLAYBACK_LOADED_DATA="playbackLoadedData",this.PLAYBACK_PAUSED="playbackPaused",this.PLAYBACK_PLAYING="playbackPlaying",this.PLAYBACK_PROGRESS="playbackProgress",this.PLAYBACK_RATE_CHANGED="playbackRateChanged",this.PLAYBACK_SEEKED="playbackSeeked",this.PLAYBACK_SEEKING="playbackSeeking",this.PLAYBACK_STALLED="playbackStalled",this.PLAYBACK_STARTED="playbackStarted",this.PLAYBACK_TIME_UPDATED="playbackTimeUpdated",this.PLAYBACK_VOLUME_CHANGED="playbackVolumeChanged",this.PLAYBACK_WAITING="playbackWaiting",this.MANIFEST_VALIDITY_CHANGED="manifestValidityChanged",this.EVENT_MODE_ON_START="eventModeOnStart",this.EVENT_MODE_ON_RECEIVE="eventModeOnReceive",this.CONFORMANCE_VIOLATION="conformanceViolation",this.REPRESENTATION_SWITCH="representationSwitch",this.ADAPTATION_SET_REMOVED_NO_CAPABILITIES="adaptationSetRemovedNoCapabilities",this.CONTENT_STEERING_REQUEST_COMPLETED="contentSteeringRequestCompleted",this.INBAND_PRFT="inbandPrft",this.MANAGED_MEDIA_SOURCE_START_STREAMING="managedMediaSourceStartStreaming",this.MANAGED_MEDIA_SOURCE_END_STREAMING="managedMediaSourceEndStreaming"}}let i=new r;e.A=i},5212:function(t,e){"use strict";e.A={STREAM:"stream",VIDEO:"video",AUDIO:"audio",TEXT:"text",MUXED:"muxed",IMAGE:"image",STPP:"stpp",TTML:"ttml",VTT:"vtt",WVTT:"wvtt",CONTENT_STEERING:"contentSteering",LIVE_CATCHUP_MODE_DEFAULT:"liveCatchupModeDefault",LIVE_CATCHUP_MODE_LOLP:"liveCatchupModeLoLP",MOVING_AVERAGE_SLIDING_WINDOW:"slidingWindow",MOVING_AVERAGE_EWMA:"ewma",BAD_ARGUMENT_ERROR:"Invalid Arguments",MISSING_CONFIG_ERROR:"Missing config parameter(s)",TRACK_SWITCH_MODE_ALWAYS_REPLACE:"alwaysReplace",TRACK_SWITCH_MODE_NEVER_REPLACE:"neverReplace",TRACK_SELECTION_MODE_FIRST_TRACK:"firstTrack",TRACK_SELECTION_MODE_HIGHEST_BITRATE:"highestBitrate",TRACK_SELECTION_MODE_HIGHEST_EFFICIENCY:"highestEfficiency",TRACK_SELECTION_MODE_WIDEST_RANGE:"widestRange",CMCD_QUERY_KEY:"CMCD",CMCD_MODE_QUERY:"query",CMCD_MODE_HEADER:"header",CMCD_AVAILABLE_KEYS:["br","d","ot","tb","bl","dl","mtp","nor","nrr","su","bs","rtp","cid","pr","sf","sid","st","v"],CMCD_V2_AVAILABLE_KEYS:["msd","ltc"],CMCD_AVAILABLE_REQUESTS:["segment","mpd","xlink","steering","other"],INITIALIZE:"initialize",TEXT_SHOWING:"showing",TEXT_HIDDEN:"hidden",TEXT_DISABLED:"disabled",ACCESSIBILITY_CEA608_SCHEME:"urn:scte:dash:cc:cea-608:2015",CC1:"CC1",CC3:"CC3",UTF8:"utf-8",SCHEME_ID_URI:"schemeIdUri",START_TIME:"starttime",SERVICE_DESCRIPTION_DVB_LL_SCHEME:"urn:dvb:dash:lowlatency:scope:2019",SUPPLEMENTAL_PROPERTY_DVB_LL_SCHEME:"urn:dvb:dash:lowlatency:critical:2019",CTA_5004_2023_SCHEME:"urn:mpeg:dash:cta-5004:2023",THUMBNAILS_SCHEME_ID_URIS:["http://dashif.org/thumbnail_tile","http://dashif.org/guidelines/thumbnail_tile"],FONT_DOWNLOAD_DVB_SCHEME:"urn:dvb:dash:fontdownload:2014",COLOUR_PRIMARIES_SCHEME_ID_URI:"urn:mpeg:mpegB:cicp:ColourPrimaries",URL_QUERY_INFO_SCHEME:"urn:mpeg:dash:urlparam:2014",EXT_URL_QUERY_INFO_SCHEME:"urn:mpeg:dash:urlparam:2016",MATRIX_COEFFICIENTS_SCHEME_ID_URI:"urn:mpeg:mpegB:cicp:MatrixCoefficients",TRANSFER_CHARACTERISTICS_SCHEME_ID_URI:"urn:mpeg:mpegB:cicp:TransferCharacteristics",HDR_METADATA_FORMAT_SCHEME_ID_URI:"urn:dvb:dash:hdr-dmi",HDR_METADATA_FORMAT_VALUES:{ST2094_10:"ST2094-10",SL_HDR2:"SL-HDR2",ST2094_40:"ST2094-40"},MEDIA_CAPABILITIES_API:{COLORGAMUT:{SRGB:"srgb",P3:"p3",REC2020:"rec2020"},TRANSFERFUNCTION:{SRGB:"srgb",PQ:"pq",HLG:"hlg"},HDR_METADATATYPE:{SMPTE_ST_2094_10:"smpteSt2094-10",SLHDR2:"slhdr2",SMPTE_ST_2094_40:"smpteSt2094-40"}},XML:"XML",ARRAY_BUFFER:"ArrayBuffer",DVB_REPORTING_URL:"dvb:reportingUrl",DVB_PROBABILITY:"dvb:probability",OFF_MIMETYPE:"application/font-sfnt",WOFF_MIMETYPE:"application/font-woff",VIDEO_ELEMENT_READY_STATES:{HAVE_NOTHING:0,HAVE_METADATA:1,HAVE_CURRENT_DATA:2,HAVE_FUTURE_DATA:3,HAVE_ENOUGH_DATA:4},FILE_LOADER_TYPES:{FETCH:"fetch_loader",XHR:"xhr_loader"},THROUGHPUT_TYPES:{LATENCY:"throughput_type_latency",BANDWIDTH:"throughput_type_bandwidth"},THROUGHPUT_CALCULATION_MODES:{EWMA:"throughputCalculationModeEwma",ZLEMA:"throughputCalculationModeZlema",ARITHMETIC_MEAN:"throughputCalculationModeArithmeticMean",BYTE_SIZE_WEIGHTED_ARITHMETIC_MEAN:"throughputCalculationModeByteSizeWeightedArithmeticMean",DATE_WEIGHTED_ARITHMETIC_MEAN:"throughputCalculationModeDateWeightedArithmeticMean",HARMONIC_MEAN:"throughputCalculationModeHarmonicMean",BYTE_SIZE_WEIGHTED_HARMONIC_MEAN:"throughputCalculationModeByteSizeWeightedHarmonicMean",DATE_WEIGHTED_HARMONIC_MEAN:"throughputCalculationModeDateWeightedHarmonicMean"},LOW_LATENCY_DOWNLOAD_TIME_CALCULATION_MODE:{MOOF_PARSING:"lowLatencyDownloadTimeCalculationModeMoofParsing",DOWNLOADED_DATA:"lowLatencyDownloadTimeCalculationModeDownloadedData",AAST:"lowLatencyDownloadTimeCalculationModeAast"},RULES_TYPES:{QUALITY_SWITCH_RULES:"qualitySwitchRules",ABANDON_FRAGMENT_RULES:"abandonFragmentRules"},QUALITY_SWITCH_RULES:{BOLA_RULE:"BolaRule",THROUGHPUT_RULE:"ThroughputRule",INSUFFICIENT_BUFFER_RULE:"InsufficientBufferRule",SWITCH_HISTORY_RULE:"SwitchHistoryRule",DROPPED_FRAMES_RULE:"DroppedFramesRule",LEARN_TO_ADAPT_RULE:"L2ARule",LOL_PLUS_RULE:"LoLPRule"},ABANDON_FRAGMENT_RULES:{ABANDON_REQUEST_RULE:"AbandonRequestsRule"},ID3_SCHEME_ID_URI:"https://aomedia.org/emsg/ID3",COMMON_ACCESS_TOKEN_HEADER:"common-access-token",DASH_ROLE_SCHEME_ID:"urn:mpeg:dash:role:2011",CODEC_FAMILIES:{MP3:"mp3",AAC:"aac",AC3:"ac3",EC3:"ec3",DTSX:"dtsx",DTSC:"dtsc",AVC:"avc",HEVC:"hevc"}}},2861:function(t,e){"use strict";e.A={CLEARKEY_KEYSTEM_STRING:"org.w3.clearkey",WIDEVINE_KEYSTEM_STRING:"com.widevine.alpha",PLAYREADY_KEYSTEM_STRING:"com.microsoft.playready",PLAYREADY_RECOMMENDATION_KEYSTEM_STRING:"com.microsoft.playready.recommendation",WIDEVINE_UUID:"edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",PLAYREADY_UUID:"9a04f079-9840-4286-ab92-e65be0885f95",CLEARKEY_UUID:"e2719d58-a985-b3c9-781a-b030af78d30e",W3C_CLEARKEY_UUID:"1077efec-c0b2-4d02-ace3-3c1e52e2fb4b",INITIALIZATION_DATA_TYPE_CENC:"cenc",INITIALIZATION_DATA_TYPE_KEYIDS:"keyids",INITIALIZATION_DATA_TYPE_WEBM:"webm",ENCRYPTION_SCHEME_CENC:"cenc",ENCRYPTION_SCHEME_CBCS:"cbcs",MEDIA_KEY_MESSAGE_TYPES:{LICENSE_REQUEST:"license-request",LICENSE_RENEWAL:"license-renewal",LICENSE_RELEASE:"license-release",INDIVIDUALIZATION_REQUEST:"individualization-request"},ROBUSTNESS_STRINGS:{WIDEVINE:{SW_SECURE_CRYPTO:"SW_SECURE_CRYPTO",SW_SECURE_DECODE:"SW_SECURE_DECODE",HW_SECURE_CRYPTO:"HW_SECURE_CRYPTO",HW_SECURE_DECODE:"HW_SECURE_DECODE",HW_SECURE_ALL:"HW_SECURE_ALL"}},MEDIA_KEY_STATUSES:{USABLE:"usable",EXPIRED:"expired",RELEASED:"released",OUTPUT_RESTRICTED:"output-restricted",OUTPUT_DOWNSCALED:"output-downscaled",STATUS_PENDING:"status-pending",INTERNAL_ERROR:"internal-error"}}},4469:function(t,e,n){"use strict";n.d(e,{default:function(){return K}});class a{constructor(){this.mpdurl=null,this.errorcode=null,this.terror=null,this.url=null,this.ipaddress=null,this.servicelocation=null}}a.SSL_CONNECTION_FAILED_PREFIX="SSL",a.DNS_RESOLUTION_FAILED="C00",a.HOST_UNREACHABLE="C01",a.CONNECTION_REFUSED="C02",a.CONNECTION_ERROR="C03",a.CORRUPT_MEDIA_ISOBMFF="M00",a.CORRUPT_MEDIA_OTHER="M01",a.BASE_URL_CHANGED="F00",a.BECAME_REPORTER="S00";var r=a,i=n(913),o=n(138);function l(t){let e,n;const a=(t=t||{}).eventBus,o=t.dashMetrics,l=t.metricsConstants,s=t.events;function u(t){let e=new r;if(n){for(const n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.mpdurl||(e.mpdurl=n.originalUrl||n.url),e.terror||(e.terror=new Date),o.addDVBErrors(e)}}function c(t){t.error||(n=t.manifest)}function d(t){u({errorcode:r.BASE_URL_CHANGED,servicelocation:t.entry})}function f(){u({errorcode:r.BECAME_REPORTER})}function g(t){var e;t.metric===l.HTTP_REQUEST&&(0===(e=t.value).responsecode||null==e.responsecode||e.responsecode>=400||e.responsecode<100||e.responsecode>=600)&&u({errorcode:e.responsecode||r.CONNECTION_ERROR,url:e.url,terror:e.tresponse,servicelocation:e._serviceLocation})}function m(t){let e;switch(t.error?t.error.code:0){case MediaError.MEDIA_ERR_NETWORK:e=r.CONNECTION_ERROR;break;case MediaError.MEDIA_ERR_DECODE:e=r.CORRUPT_MEDIA_OTHER;break;default:return}u({errorcode:e})}return e={initialize:function(){a.on(s.MANIFEST_UPDATED,c,e),a.on(s.SERVICE_LOCATION_BASE_URL_BLACKLIST_CHANGED,d,e),a.on(s.METRIC_ADDED,g,e),a.on(s.METRIC_UPDATED,g,e),a.on(s.PLAYBACK_ERROR,m,e),a.on(i.A.BECAME_REPORTING_PLAYER,f,e)},reset:function(){a.off(s.MANIFEST_UPDATED,c,e),a.off(s.SERVICE_LOCATION_BASE_URL_BLACKLIST_CHANGED,d,e),a.off(s.METRIC_ADDED,g,e),a.off(s.METRIC_UPDATED,g,e),a.off(s.PLAYBACK_ERROR,m,e),a.off(i.A.BECAME_REPORTING_PLAYER,f,e)}},e}l.__dashjs_factory_name="DVBErrorsTranslator";var s=o.A.getSingletonFactory(l),u=n(7377);function c(t){t=t||{};let e,n,a=!1,r=this.context,i=t.mediaElement;return e={initialize:function(t){t&&t.length&&(t.forEach((t=>{let e=t.starttime,a=e+t.duration;n.add(e,a)})),a=!!t[0]._useWallClockTime)},reset:function(){n.clear()},isEnabled:function(){let t,e=n.length;if(!e)return!0;t=a?(new Date).getTime()/1e3:i.currentTime;for(let a=0;a=200&&r.status<300)&&(n&&n()))};c.push(r);try{r.open("GET",t),r.onloadend=i,r.onerror=i,r.send()}catch(t){r.onerror()}}(r,0,(function(){o=!1}))}))},initialize:function(t,e){let n;if(s=e,l=t.dvbReportingUrl,!l)throw new Error("required parameter missing (dvb:reportingUrl)");i||(n=t.dvbProbability,n&&(1e3===n||n/1e3>=r.random())&&(o=!0),i=!0)},reset:function(){f()}},n=g(u).getInstance(),r=h(u).getInstance(),a=(0,p.A)(u).getInstance(),f(),e}b.__dashjs_factory_name="DVBReporting";var y=o.A.getClassFactory(b);function E(t){t=t||{};const e={"urn:dvb:dash:reporting:2014":y},n=this.context;let a;const r=t.debug?t.debug.getLogger(a):{},i=t.metricsConstants,o=t.mediaPlayerModel||{};return a={create:function(t,a){let l;try{l=e[t.schemeIdUri](n).create({metricsConstants:i,mediaPlayerModel:o}),l.initialize(t,a)}catch(e){l=null,r.error(`ReportingFactory: could not create Reporting with schemeIdUri ${t.schemeIdUri} (${e.message})`)}return l},register:function(t,n){e[t]=n},unregister:function(t){delete e[t]}},a}E.__dashjs_factory_name="ReportingFactory";var _=o.A.getSingletonFactory(E);function A(t){let e,n=[];const a=_(this.context).getInstance(t);return e={initialize:function(t,e){t.some((t=>{let r=a.create(t,e);if(r)return n.push(r),!0}))},reset:function(){n.forEach((t=>t.reset())),n=[]},report:function(t,e){n.forEach((n=>n.report(t,e)))}},e}A.__dashjs_factory_name="ReportingController";var T=o.A.getClassFactory(A);function v(){return{reconstructFullMetricName:function(t,e,n){let a=t;return e&&(a+="("+e,n&&n.length&&(a+=","+n),a+=")"),a},validateN:function(t){if(!t)throw new Error("missing n");if(isNaN(t))throw new Error("n is NaN");if(t<0)throw new Error("n must be positive");return t}}}v.__dashjs_factory_name="HandlerHelpers";var w=o.A.getSingletonFactory(v);function S(t){let e,n,a,r,i,o;t=t||{};let l=this.context,s=w(l).getInstance(),u=[];const c=t.metricsConstants;function d(){let t=function(){try{return Object.keys(u).map((t=>u[t])).reduce(((t,e)=>t.level{e.handleNewMetric(t.metric,t.value,t.mediaType)}))}return e={initialize:function(t,a){t.split(",").forEach(((t,e,r)=>{let i;if(-1!==t.indexOf("(")&&-1===t.indexOf(")")){let n=r[e+1];n&&-1===n.indexOf("(")&&-1!==n.indexOf(")")&&(t+=","+n,delete r[e+1])}i=o.create(t,a),i&&n.push(i)})),r.on(i.METRIC_ADDED,l,e),r.on(i.METRIC_UPDATED,l,e)},reset:function(){r.off(i.METRIC_ADDED,l,e),r.off(i.METRIC_UPDATED,l,e),n.forEach((t=>t.reset())),n=[]}},e}z.__dashjs_factory_name="MetricsHandlersController";var O=o.A.getClassFactory(z);function L(t){let e,n,a,r;t=t||{};let i=this.context;function o(){e&&e.reset(),n&&n.reset(),a&&a.reset()}return r={initialize:function(r){try{a=d(i).create({mediaElement:t.mediaElement}),a.initialize(r.Range),n=T(i).create({debug:t.debug,metricsConstants:t.metricsConstants,mediaPlayerModel:t.mediaPlayerModel}),n.initialize(r.Reporting,a),e=O(i).create({debug:t.debug,eventBus:t.eventBus,metricsConstants:t.metricsConstants,events:t.events}),e.initialize(r.metrics,n)}catch(t){throw o(),t}},reset:o},r}L.__dashjs_factory_name="MetricsController";var P=o.A.getClassFactory(L),F=class{constructor(){this.metrics="",this.Range=[],this.Reporting=[]}},U=class{constructor(){this.starttime=0,this.duration=1/0,this._useWallClockTime=!1}},j=class{constructor(){this.schemeIdUri="",this.value="",this.dvbReportingUrl="",this.dvbProbability=1e3}};function B(t){let e,n=(t=t||{}).adapter;const a=t.constants;return e={getMetrics:function(t){let e=[];return t&&t.Metrics&&t.Metrics.forEach((r=>{var i=new F,o=n.getIsDynamic(t);r.hasOwnProperty("metrics")&&(i.metrics=r.metrics,r.Range&&r.Range.forEach((e=>{var r=new U;r.starttime=function(t,e,r){let i,o,l=0;return e?l=n.getAvailabilityStartTime(t)/1e3:(i=n.getRegularPeriods(t),i.length&&(l=i[0].start)),o=l,r&&r.hasOwnProperty(a.START_TIME)&&(o+=r.starttime),o}(t,o,e),e.hasOwnProperty("duration")?r.duration=e.duration:r.duration=n.getDuration(t),r._useWallClockTime=o,i.Range.push(r)})),r.Reporting&&(r.Reporting.forEach((t=>{var e=new j;t.hasOwnProperty(a.SCHEME_ID_URI)&&(e.schemeIdUri=t.schemeIdUri,t.hasOwnProperty("value")&&(e.value=t.value),t.hasOwnProperty(a.DVB_REPORTING_URL)&&(e.dvbReportingUrl=t[a.DVB_REPORTING_URL]),t.hasOwnProperty(a.DVB_PROBABILITY)&&(e.dvbProbability=t[a.DVB_PROBABILITY]),i.Reporting.push(e))})),e.push(i)))})),e}},e}B.__dashjs_factory_name="ManifestParsing";var q=o.A.getSingletonFactory(B);function G(t){let e;t=t||{};let n={},a=this.context,r=t.eventBus;const o=t.events;function l(e){if(e.error)return;let o=Object.keys(n);q(a).getInstance({adapter:t.adapter,constants:t.constants}).getMetrics(e.manifest).forEach((e=>{const r=JSON.stringify(e);if(n.hasOwnProperty(r))o.splice(r,1);else try{let i=P(a).create(t);i.initialize(e),n[r]=i}catch(t){}})),o.forEach((t=>{n[t].reset(),delete n[t]})),r.trigger(i.A.METRICS_INITIALISATION_COMPLETE)}function s(){Object.keys(n).forEach((t=>{n[t].reset()})),n={}}return e={reset:function(){r.off(o.MANIFEST_UPDATED,l,e),r.off(o.STREAM_TEARDOWN_COMPLETE,s,e)}},r.on(o.MANIFEST_UPDATED,l,e),r.on(o.STREAM_TEARDOWN_COMPLETE,s,e),e}G.__dashjs_factory_name="MetricsCollectionController";var H=o.A.getClassFactory(G);function Y(){let t,e,n=this.context;return t={createMetricsReporting:function(t){return e=s(n).getInstance({eventBus:t.eventBus,dashMetrics:t.dashMetrics,metricsConstants:t.metricsConstants,events:t.events}),e.initialize(),H(n).create(t)},getReportingFactory:function(){return _(n).getInstance()},getMetricsHandlerFactory:function(){return M(n).getInstance()}},t}Y.__dashjs_factory_name="MetricsReporting";const V=dashjs.FactoryMaker.getClassFactory(Y);V.events=i.A,dashjs.FactoryMaker.updateClassFactory(Y.__dashjs_factory_name,V);var K=V},913:function(t,e,n){"use strict";var a=n(7252);class r extends a.A{constructor(){super(),this.METRICS_INITIALISATION_COMPLETE="internal_metricsReportingInitialized",this.BECAME_REPORTING_PLAYER="internal_becameReportingPlayer",this.CMCD_DATA_GENERATED="cmcdDataGenerated"}}let i=new r;e.A=i},1926:function(t,e,n){"use strict";var a=n(5717),r=n(138),i=n(8261),o=n(656),l=n(5212);function s(){let t,e,n,r,s,u,c,d,f,g;const m=this.context,h=(0,i.A)(m).getInstance();function p(){r=[],s=[],u=[],c=[],d=[],g=[],f=null,e=[]}function b(t,e){let n=-1;t.some(((t,a)=>{if(t===e)return n=a,!0})),n<0||t.splice(n,1)}function y(t){let e;for(e=0;e{t(e,a)}))},unregisterCustomCapabilitiesFilter:function(t){b(d,t)},unregisterLicenseRequestFilter:function(t){b(u,t)},unregisterLicenseResponseFilter:function(t){b(c,t)}},n={default:!1},p(),t}s.__dashjs_factory_name="CustomParametersModel",e.A=r.A.getSingletonFactory(s)},3888:function(t,e,n){"use strict";n.d(e,{default:function(){return mt}});var a=n(8854),r=n(2861);const i={prefixes:["clearkey","dashif","ck"]};class o{static findMp4ProtectionElement(t){let e=null;for(let n=0;n0&&(e+=4+16*n.getUint32(e)),e+=4,t.slice(e)}static getPSSHForKeySystem(t,e){let n=o.parsePSSHList(e);return t&&n.hasOwnProperty(t.uuid.toLowerCase())?n[t.uuid.toLowerCase()]:null}static parseInitDataFromContentProtection(t,e){return"pssh"in t&&t.pssh?(t.pssh.__text=t.pssh.__text.replace(/\r?\n|\r/g,"").replace(/\s+/g,""),e.decodeArray(t.pssh.__text).buffer):null}static parsePSSHList(t){if(null==t)return[];let e=new DataView(t.buffer||t),n={},a=0;for(;;){let t,r,i,o,l,s,u=a;if(a>=e.buffer.byteLength)break;if(t=e.getUint32(a),r=a+t,a+=4,1886614376===e.getUint32(a))if(a+=4,i=e.getUint8(a),0===i||1===i){for(a++,a+=3,o="",l=0;l<4;l++)s=e.getUint8(a+l).toString(16),o+=1===s.length?"0"+s:s;for(a+=4,o+="-",l=0;l<2;l++)s=e.getUint8(a+l).toString(16),o+=1===s.length?"0"+s:s;for(a+=2,o+="-",l=0;l<2;l++)s=e.getUint8(a+l).toString(16),o+=1===s.length?"0"+s:s;for(a+=2,o+="-",l=0;l<2;l++)s=e.getUint8(a+l).toString(16),o+=1===s.length?"0"+s:s;for(a+=2,o+="-",l=0;l<6;l++)s=e.getUint8(a+l).toString(16),o+=1===s.length?"0"+s:s;a+=6,o=o.toLowerCase(),a+=4,n[o]=e.buffer.slice(u,r),a=r}else a=r;else a=r}return n}static getLicenseServerUrlFromMediaInfo(t,e){try{if(!t||0===t.length)return null;let n=0,a=null;for(;n0){const t=r.contentProtection.filter((t=>t.schemeIdUri&&t.schemeIdUri===e));if(t&&t.length>0){let e=0;for(;e0?o:[r.A.INITIALIZATION_DATA_TYPE_CENC],t&&t.length&&(this.audioCapabilities=t),e&&e.length&&(this.videoCapabilities=e),this.distinctiveIdentifier=n,this.persistentState=a,this.sessionTypes=i}},c=n(1923),d=n(1944),f=class{constructor(t,e,n,a,r,i,o,l){this.url=t,this.method=e,this.responseType=n,this.headers=a,this.withCredentials=r,this.messageType=i,this.sessionId=o,this.data=l}},g=class{constructor(t,e,n){this.url=t,this.headers=e,this.data=n}},m=n(7568),h=n(7263),p=n(5212),b=n(138);function y(t){const e=(t=t||{}).BASE64,n=t.cmcdModel,a=t.constants,i=t.customParametersModel,o=t.debug,b=t.eventBus,y=t.events,E=t.protectionKeyController,_=t.settings;let A,T,v,w,S,I,k,R,N,C,D,x,M=t.protectionModel,z=[];function O(){if(!(b&&b.hasOwnProperty("on")&&E&&E.hasOwnProperty("getSupportedKeySystemMetadataFromContentProtection")))throw new Error("Missing config parameter(s)")}function L(t,n){D||w?D&&P():function(t,n){if(w)return;var a;w=!0;const r=function(t){const e=[];for(let n=0;n(A&&A[t.ks.systemString]&&A[t.ks.systemString].priority>=0?A[t.ks.systemString].priority:a.length)-(A&&A[e.ks.systemString]&&A[e.ks.systemString].priority>=0?A[e.ks.systemString].priority:a.length))));let i;M.requestKeySystemAccess(r).then((t=>(i=t.data,function(t){let e=t&&t.selectedSystemString?t.selectedSystemString:t.keySystem.systemString;return k.info("DRM: KeySystem Access Granted for system string ("+e+")! Selecting key system..."),M.selectKeySystem(t)}(i)))).then((t=>{!function(t,n){D=t,w=!1,b.trigger(y.KEY_SYSTEM_SELECTED,{data:n});const a=B(D);a&&a.serverCertificate&&a.serverCertificate.length>0&&M.setServerCertificate(e.decodeArray(a.serverCertificate).buffer),P()}(t,i)})).catch((t=>{!function(t,e){D=null,w=!1,e||b.trigger(y.KEY_SYSTEM_SELECTED,{data:null,error:new d.A(c.A.KEY_SYSTEM_ACCESS_DENIED_ERROR_CODE,c.A.KEY_SYSTEM_ACCESS_DENIED_ERROR_MESSAGE+"Error selecting key system! -- "+t.error)})}(t,n)}))}(t,n)}function P(){let t;for(let n=0;n0?e.initDataTypes:[r.A.INITIALIZATION_DATA_TYPE_CENC],l=e&&e.audioRobustness&&e.audioRobustness.length>0?e.audioRobustness:C,c=e&&e.videoRobustness&&e.videoRobustness.length>0?e.videoRobustness:C,d=t.sessionType,f=e&&e.distinctiveIdentifier?e.distinctiveIdentifier:"optional",g=e&&e.persistentState?e.persistentState:"temporary"===d?"optional":"required";return R.forEach((t=>{t.type===a.AUDIO?n.push(new s(t.codec,l)):t.type===a.VIDEO&&i.push(new s(t.codec,c))})),new u(n,i,f,g,[d],o)}function U(t){O(),M.loadKeySession(t)}function j(t){if(t&&function(t){if(!t)return!1;try{const e=M.getSessionTokens();for(let n=0;n{"authorization"===t.toLowerCase()&&(y=!0)})),n&&"boolean"==typeof n.withCredentials&&(y=n.withCredentials);const T=function(t){if(M)if(t.status>=200&&t.status<=299){const n=h.A.parseHttpHeaders(t.getAllResponseHeaders?t.getAllResponseHeaders():null);let r=new g(t.responseURL,n,t.response);X(i.getLicenseResponseFilters(),r).then((()=>{const n=e.getLicenseMessage(r.data,u,o);null!==n?(Y(s),M.updateKeySession(a,n)):$(t,s,u,o,e)}))}else $(t,s,u,o,e)},v=function(t){Y(s,new d.A(c.A.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,c.A.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+u+' update, XHR aborted. status is "'+t.statusText+'" ('+t.status+"), readyState is "+t.readyState))},w=function(t){Y(s,new d.A(c.A.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,c.A.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+u+' update, XHR error. status is "'+t.statusText+'" ('+t.status+"), readyState is "+t.readyState))},S=D.getLicenseRequestFromMessage(A),I=e.getHTTPMethod(o),k=e.getResponseType(u,o),N=n&&!isNaN(n.httpTimeout)?n.httpTimeout:8e3,C=a.getSessionId()||null;let x=new f(p,I,k,b,y,o,C,S);const z=isNaN(_.get().streaming.retryAttempts[m.G.LICENSE])?3:_.get().streaming.retryAttempts[m.G.LICENSE];X(i.getLicenseRequestFilters(),x).then((()=>{V(x,z,N,T,v,w)}))}(e,u,s)}else Y(p,new d.A(c.A.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_CODE,c.A.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_MESSAGE))}function Y(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;b.trigger(y.LICENSE_REQUEST_COMPLETE,{data:t,error:e})}function V(t,e,a,r,i,o){const l=new XMLHttpRequest,s=n.getCmcdParametersFromManifest();if(n.isCmcdEnabled()&&(s.mode?s.mode:_.get().streaming.cmcd.mode)===p.A.CMCD_MODE_QUERY){const e=n.getQueryParameter({url:t.url,type:m.G.LICENSE});e&&(t.url=h.A.addAdditionalQueryParameterToUrl(t.url,[e]))}l.open(t.method,t.url,!0),l.responseType=t.responseType,l.withCredentials=t.withCredentials,a>0&&(l.timeout=a);for(const e in t.headers)l.setRequestHeader(e,t.headers[e]);if(n.isCmcdEnabled()&&(s.mode?s.mode:_.get().streaming.cmcd.mode)===p.A.CMCD_MODE_HEADER){const e=n.getHeaderParameters({url:t.url,type:m.G.LICENSE});if(e)for(const t in e){let n=e[t];n&&l.setRequestHeader(t,n)}}const u=function(){e--;const n=isNaN(_.get().streaming.retryIntervals[m.G.LICENSE])?1e3:_.get().streaming.retryIntervals[m.G.LICENSE];S=setTimeout((function(){V(t,e,a,r,i,o)}),n)};l.onload=function(){I=null,this.status>=200&&this.status<=299||e<=0?r(this):(k.warn("License request failed ("+this.status+"). Retrying it... Pending retries: "+e),u())},l.ontimeout=l.onerror=function(){I=null,e<=0?o(this):(k.warn("License request network request failed . Retrying it... Pending retries: "+e),u())},l.onabort=function(){i(this)},b.trigger(y.LICENSE_REQUEST_SENDING,{url:t.url,headers:t.headers,payload:t.data,sessionId:t.sessionId}),I=l,l.send(t.data)}function K(){I&&(I.onloadend=I.onerror=I.onprogress=void 0,I.abort(),I=null),S&&(clearTimeout(S),S=null)}function W(t,e){if(e)for(const n in e)t[n]=e[n]}function $(t,e,n,a,r){let i="NONE",o=null;t.response&&(i=r.getErrorResponse(t.response,n,a),o={serverResponse:t.response||null,responseCode:t.status||null,responseText:t.statusText||null}),Y(e,new d.A(c.A.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,c.A.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+n+' update, XHR complete. status is "'+t.statusText+'" ('+t.status+"), readyState is "+t.readyState+". Response is "+i,o))}function X(t,e){return t?t.reduce(((t,n)=>t.then((()=>n(e)))),Promise.resolve()):Promise.resolve()}function Q(t,e){if(_.get().streaming.protection.ignoreEmeEncryptedEvent)return;if(k.debug("DRM: onNeedKey"),t.key.initDataType!==r.A.INITIALIZATION_DATA_TYPE_CENC)return void k.warn("DRM: Only 'cenc' initData is supported! Ignoring initData of type: "+t.key.initDataType);if(0===R.length&&(k.warn("DRM: onNeedKey called before initializeForMedia, wait until initialized"),(e=void 0===e?1:e+1)<5))return void z.push(setTimeout((()=>{Q(t,e)}),500));let n=t.key.initData;if(ArrayBuffer.isView(n)&&(n=n.buffer),D){const t=l.getPSSHForKeySystem(D,n);if(t&&q(t))return}k.debug("DRM: initData:",String.fromCharCode.apply(null,new Uint8Array(n)));const a=E.getSupportedKeySystemMetadataFromSegmentPssh(n,A,x);0!==a.length?function(t){N.push(t),L(t,!1)}(a):k.debug("DRM: Received needkey event with initData, but we don't support any of the key systems!")}function Z(t,e){if(t.size<=0)return!1;if(e.size>0&&[...t].every((t=>{const n=e.get(t);return void 0!==n&&""!==n})))return!0;const n=M.getSessionTokens();if(n&&n.length>0){const e=n.filter((e=>[...t].includes(e.normalizedKeyId)));if(e.some((t=>!t.hasTriggeredKeyStatusMapUpdate))||0===e.length)return!1}return!_.get().streaming.protection.ignoreKeyStatuses&&t&&t.size>0&&e&&e.size>0}return T={areKeyIdsExpired:function(t){try{return!!Z(t,v)&&[...t].every((t=>v.get(t)===r.A.MEDIA_KEY_STATUSES.EXPIRED))}catch(t){return k.error(t),!1}},areKeyIdsUsable:function(t){try{return!Z(t,v)||[...t].some((t=>{const e=v.get(t);return e&&e!==r.A.MEDIA_KEY_STATUSES.INTERNAL_ERROR&&e!==r.A.MEDIA_KEY_STATUSES.OUTPUT_RESTRICTED}))}catch(t){return k.error(t),!0}},clearMediaInfoArray:function(){R=[]},closeKeySession:function(t){O(),M.closeKeySession(t)},createKeySession:j,getKeySystems:function(){return E?E.getKeySystems():[]},getSupportedKeySystemMetadataFromContentProtection:function(t){return O(),E.getSupportedKeySystemMetadataFromContentProtection(t,A,x)},handleKeySystemFromManifest:function(){if(!R||0===R.length)return;let t=[];R.forEach((e=>{const n=E.getSupportedKeySystemMetadataFromContentProtection(e.contentProtection,A,x);n.length>0&&(0===t.length&&(t=n),N.push(n))})),t&&t.length>0&&L(t,!0)},initializeForMedia:function(t){if(!t)throw new Error("mediaInfo can not be null or undefined");O(),R.push(t)},loadKeySession:U,removeKeySession:function(t){O(),M.removeKeySession(t)},reset:function(){b.off(y.INTERNAL_KEY_MESSAGE,H,T),O(),K(),G(null),D=null,w=!1,v=new Map,M&&(M.reset(),M=null),z.forEach((t=>clearTimeout(t))),z=[],R=[],N=[]},setKeySystems:function(t){E&&E.setKeySystems(t)},setMediaElement:G,setProtectionData:function(t){A=t,E.setProtectionData(t)},setRobustnessLevel:function(t){C=t},setServerCertificate:function(t){O(),M.setServerCertificate(t)},setSessionType:function(t){x=t},stop:function(){K(),M&&M.stop()},updateKeyStatusesMap:function(t){try{if(!t||!t.sessionToken||!t.parsedKeyStatuses)return;t.sessionToken.hasTriggeredKeyStatusMapUpdate=!0;const e=t.parsedKeyStatuses,n=h.A.parseUserAgent(),a=n&&n.browser&&n.browser.name&&"edge"===n.browser.name.toLowerCase();e.forEach((t=>{a&&D.uuid===r.A.PLAYREADY_UUID&&t.keyId&&16===t.keyId.byteLength&&function(t){const e=h.A.bufferSourceToDataView(t),n=e.getUint32(0,!0),a=e.getUint16(4,!0),r=e.getUint16(6,!0);e.setUint32(0,n,!1),e.setUint16(4,a,!1),e.setUint16(6,r,!1)}(t.keyId);const e=h.A.bufferSourceToHex(t.keyId).slice(0,32);e&&""!==e&&v.set(e,t.status)})),b.trigger(y.KEY_STATUSES_MAP_UPDATED,{keyStatusMap:v})}catch(t){k.error(t)}}},k=o.getLogger(T),N=[],R=[],x="temporary",C="",I=null,S=null,v=new Map,b.on(y.INTERNAL_KEY_MESSAGE,H,T),T}y.__dashjs_factory_name="ProtectionController";var E=b.A.getClassFactory(y),_=class{constructor(t,e){this.keyID=t,this.key=e}},A=class{constructor(t,e){if(e&&"persistent"!==e&&"temporary"!==e)throw new Error("Invalid ClearKey key set type! Must be one of 'persistent' or 'temporary'");this.keyPairs=t,this.type=e}toJWK(){let t,e=this.keyPairs.length,n={keys:[]};for(t=0;tString.fromCharCode(parseInt(t,16)))).join("")),e.replace(/=/g,"").replace(/\//g,"_").replace(/\+/g,"-")}catch(t){return null}}(e.cencDefaultKid)]};a=(new TextEncoder).encode(JSON.stringify(t))}return a}catch(t){return null}},getRequestHeadersFromMessage:function(){return{"Content-Type":"application/json"}},getLicenseRequestFromMessage:function(t){return JSON.stringify(JSON.parse(String.fromCharCode.apply(null,new Uint8Array(t))))},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null},getClearKeysFromProtectionData:function(t,e){let n=null;if(t){const a=JSON.parse(String.fromCharCode.apply(null,new Uint8Array(e))),r=[];for(let e=0;e%CUSTOMDATA%'.replace("%CUSTOMDATA%",e),r=[],o=0;o{b(t,e,0,n,a)}))})(o||(at[u]?at[u]:[u]),l).then((t=>{const e=t&&t.nativeMediaKeySystemAccessObject&&"function"==typeof t.nativeMediaKeySystemAccessObject.getConfiguration?t.nativeMediaKeySystemAccessObject.getConfiguration():null,i=new nt(s,e);i.selectedSystemString=t.selectedSystemString,i.nativeMediaKeySystemAccessObject=t.nativeMediaKeySystemAccessObject,n.trigger(a.KEY_SYSTEM_ACCESS_COMPLETE,{data:i}),r({data:i})})).catch((o=>{if(e+1{a({nativeMediaKeySystemAccessObject:t,selectedSystemString:i})})).catch((i=>{n+1{E(i),l.debug("DRM: Session closed. SessionID = "+i.getSessionId()),n.trigger(a.KEY_SESSION_CLOSED,{data:i.getSessionId()})})),g.push(i),i}function A(t){let e,n;return t&&t.length>0&&(t[0]&&("string"==typeof t[0]?e=t[0]:n=t[0]),t[1]&&("string"==typeof t[1]?e=t[1]:n=t[1])),{status:e,keyId:n}}return o={closeKeySession:function(t){y(t).catch((function(e){E(t),n.trigger(a.KEY_SESSION_CLOSED,{data:null,error:"Error closing session ("+t.getSessionId()+") "+e.name})}))},createKeySession:function(t){if(!s||!f)throw new Error("Can not create sessions until you have selected a key system");const e=f.createSession(t.sessionType),i=_(e,t),o=s.systemString===r.A.CLEARKEY_KEYSTEM_STRING&&(t.initData||t.protData&&t.protData.clearkeys)?r.A.INITIALIZATION_DATA_TYPE_KEYIDS:r.A.INITIALIZATION_DATA_TYPE_CENC;e.generateRequest(o,t.initData).then((function(){l.debug("DRM: Session created. SessionID = "+i.getSessionId()),n.trigger(a.KEY_SESSION_CREATED,{data:i})})).catch((function(t){E(i),n.trigger(a.KEY_SESSION_CREATED,{data:null,error:new d.A(c.A.KEY_SESSION_CREATED_ERROR_CODE,c.A.KEY_SESSION_CREATED_ERROR_MESSAGE+"Error generating key request -- "+t.name)})}))},getAllInitData:function(){const t=[];for(let e=0;e{p(t,0,e,n)}))},reset:function(){const t=g.length;let e;if(0!==t){const r=function(t){E(t),0===g.length&&(u?(u.removeEventListener("encrypted",m),u.setMediaKeys(null).then((function(){n.trigger(a.TEARDOWN_COMPLETE)}))):n.trigger(a.TEARDOWN_COMPLETE))};for(let n=0;n{t.nativeMediaKeySystemAccessObject.createMediaKeys().then((e=>(s=t.keySystem,f=e,u?u.setMediaKeys(f):Promise.resolve()))).then((()=>{e(s)})).catch((function(){n({error:"Error selecting keys system ("+t.keySystem.systemString+")! Could not create MediaKeys -- TODO"})}))}))},setMediaElement:function(t){u!==t&&(u&&(u.removeEventListener("encrypted",m),u.setMediaKeys&&u.setMediaKeys(null)),u=t,u&&(u.addEventListener("encrypted",m),u.setMediaKeys&&f&&u.setMediaKeys(f)))},setServerCertificate:function(t){return new Promise(((e,r)=>{f.setServerCertificate(t).then((function(){l.info("DRM: License server certificate successfully updated."),n.trigger(a.SERVER_CERTIFICATE_UPDATED),e()})).catch((t=>{r(t),n.trigger(a.SERVER_CERTIFICATE_UPDATED,{error:new d.A(c.A.SERVER_CERTIFICATE_UPDATED_ERROR_CODE,c.A.SERVER_CERTIFICATE_UPDATED_ERROR_MESSAGE+t.name)})}))}))},stop:function(){let t;for(let e=0;e{n.trigger(a.KEY_SESSION_UPDATED)})).catch((function(e){n.trigger(a.KEY_ERROR,{error:new d.A(c.A.MEDIA_KEYERR_CODE,"Error sending update() message! "+e.name,t)})}))}},l=i.getLogger(o),s=null,u=null,f=null,g=[],h=Z(e).getInstance(),m={handleEvent:function(t){if("encrypted"===t.type&&t.initData){let e=ArrayBuffer.isView(t.initData)?t.initData.buffer:t.initData;n.trigger(a.NEED_KEY,{key:new tt(e,t.initDataType)})}}},o}at[r.A.PLAYREADY_KEYSTEM_STRING]=[r.A.PLAYREADY_KEYSTEM_STRING,r.A.PLAYREADY_RECOMMENDATION_KEYSTEM_STRING],at[r.A.WIDEVINE_KEYSTEM_STRING]=[r.A.WIDEVINE_KEYSTEM_STRING],at[r.A.CLEARKEY_KEYSTEM_STRING]=[r.A.CLEARKEY_KEYSTEM_STRING],rt.__dashjs_factory_name="DefaultProtectionModel";var it=b.A.getClassFactory(rt);function ot(t){t=t||{};const e=this.context,n=t.eventBus,a=t.events,i=t.debug,o=t.api;let l,s,f,g,m,h,p,b,y;function E(){try{for(let t=0;t=1?e():(t=e.bind(this),f.addEventListener("loadedmetadata",t))}return l={getAllInitData:function(){const t=[];for(let e=0;e{let i=!1;for(let r=0;r{try{m=t.mediaKeys=new window[o.MediaKeys](t.keySystem.systemString),g=t.keySystem,h=t,f&&A(),e(g)}catch(t){n({error:"Error selecting keys system ("+g.systemString+")! Could not create MediaKeys -- TODO"})}}))},setMediaElement:function(t){f!==t&&(f&&f.removeEventListener(o.needkey,b),f=t,f&&(f.addEventListener(o.needkey,b),m&&A()))},createKeySession:function(t){if(!g||!m||!h)throw new Error("Can not create sessions until you have selected a key system");let e=null;if(h.ksConfiguration.videoCapabilities&&h.ksConfiguration.videoCapabilities.length>0&&(e=h.ksConfiguration.videoCapabilities[0]),null===e&&h.ksConfiguration.audioCapabilities&&h.ksConfiguration.audioCapabilities.length>0&&(e=h.ksConfiguration.audioCapabilities[0]),null===e)throw new Error("Can not create sessions for unknown content types.");const r=e.contentType,i=m.createSession(r,new Uint8Array(t.initData),t.cdmData?new Uint8Array(t.cdmData):null),l=function(t,e){return{session:t,keyId:e.keyId,normalizedKeyId:e&&e.keyId&&"string"==typeof e.keyId?e.keyId.replace(/-/g,"").toLowerCase():"",initData:e.initData,hasTriggeredKeyStatusMapUpdate:!1,getKeyId:function(){return this.keyId},getSessionId:function(){return this.session.sessionId},getExpirationTime:function(){return NaN},getSessionType:function(){return"temporary"},getKeyStatuses:function(){return{size:0,has:()=>!1,get:()=>{}}},handleEvent:function(t){switch(t.type){case o.error:let e="KeyError";n.trigger(a.KEY_ERROR,{error:new d.A(c.A.MEDIA_KEYERR_CODE,e,this)});break;case o.message:let r=ArrayBuffer.isView(t.message)?t.message.buffer:t.message;n.trigger(a.INTERNAL_KEY_MESSAGE,{data:new et(this,r,t.destinationURL)});break;case o.ready:s.debug("DRM: Key added."),n.trigger(a.KEY_ADDED);break;case o.close:s.debug("DRM: Session closed. SessionID = "+this.getSessionId()),n.trigger(a.KEY_SESSION_CLOSED,{data:this.getSessionId()})}}}}(i,t);i.addEventListener(o.error,l),i.addEventListener(o.message,l),i.addEventListener(o.ready,l),i.addEventListener(o.close,l),p.push(l),s.debug("DRM: Session created. SessionID = "+l.getSessionId()),n.trigger(a.KEY_SESSION_CREATED,{data:l})},updateKeySession:function(t,e){const r=t.session;y.isClearKey(g)?r.update(new Uint8Array(e.toJWK())):r.update(new Uint8Array(e)),n.trigger(a.KEY_SESSION_UPDATED)},closeKeySession:_,setServerCertificate:function(){},loadKeySession:function(){},removeKeySession:function(){},stop:E,reset:E},s=i.getLogger(l),f=null,g=null,m=null,h=null,p=[],y=Z(e).getInstance(),b={handleEvent:function(t){if(t.type===o.needkey&&t.initData){const e=ArrayBuffer.isView(t.initData)?t.initData.buffer:t.initData;n.trigger(a.NEED_KEY,{key:new tt(e,r.A.INITIALIZATION_DATA_TYPE_CENC)})}}},l}ot.__dashjs_factory_name="ProtectionModel_3Feb2014";var lt=b.A.getClassFactory(ot);function st(t){t=t||{};const e=this.context,n=t.eventBus,a=t.events,i=t.debug,o=t.api,l=t.errHandler;let s,f,g,m,h,p,b,y,E;function _(){g&&v();for(let t=0;t{let i=g;i||(i=document.createElement("video"));let o=!1;for(let r=0;r!1,get:()=>{}}}};return p.push(e),g[o.generateKeyRequest](m.systemString,new Uint8Array(t.initData)),e}throw new Error("Multiple sessions not allowed!")},updateKeySession:function(t,e){const r=t.sessionId;if(h.isClearKey(m))for(let t=0;t0&&(e=p.shift(),b.push(e),e.sessionId=t.sessionId,n.trigger(a.KEY_SESSION_CREATED,{data:e}))):p.length>0&&(e=p.shift(),b.push(e),0!==p.length&&l.error(new d.A(c.A.MEDIA_KEY_MESSAGE_ERROR_CODE,c.A.MEDIA_KEY_MESSAGE_ERROR_MESSAGE))),e){let r=ArrayBuffer.isView(t.message)?t.message.buffer:t.message;e.keyMessage=r,n.trigger(a.INTERNAL_KEY_MESSAGE,{data:new et(e,r,t.defaultURL)})}else f.warn("No session token found for key message")}}},s}st.__dashjs_factory_name="ProtectionModel_01b";var ut=b.A.getClassFactory(st);const ct=[{generateKeyRequest:"generateKeyRequest",addKey:"addKey",cancelKeyRequest:"cancelKeyRequest",needkey:"needkey",keyerror:"keyerror",keyadded:"keyadded",keymessage:"keymessage"},{generateKeyRequest:"webkitGenerateKeyRequest",addKey:"webkitAddKey",cancelKeyRequest:"webkitCancelKeyRequest",needkey:"webkitneedkey",keyerror:"webkitkeyerror",keyadded:"webkitkeyadded",keymessage:"webkitkeymessage"}],dt=[{setMediaKeys:"setMediaKeys",MediaKeys:"MediaKeys",release:"close",needkey:"needkey",error:"keyerror",message:"keymessage",ready:"keyadded",close:"keyclose"},{setMediaKeys:"msSetMediaKeys",MediaKeys:"MSMediaKeys",release:"close",needkey:"msneedkey",error:"mskeyerror",message:"mskeymessage",ready:"mskeyadded",close:"mskeyclose"}];function ft(){let t;const e=this.context;function n(t,e){for(let n=0;n{const a={...t};if(e.ks){a.keySystemConfiguration={},e.ks.systemString&&(a.keySystemConfiguration.keySystem=e.ks.systemString);let t="";e.ks.systemString===i.A.WIDEVINE_KEYSTEM_STRING&&(t=i.A.ROBUSTNESS_STRINGS.WIDEVINE.SW_SECURE_CRYPTO);const o=e.protData,l=o&&o.audioRobustness&&o.audioRobustness.length>0?o.audioRobustness:t,s=o&&o.videoRobustness&&o.videoRobustness.length>0?o.videoRobustness:t;n===r.A.AUDIO?a.keySystemConfiguration[n]={robustness:l}:n===r.A.VIDEO&&(a.keySystemConfiguration[n]={robustness:s})}return a})):[t]}(n,t,e)}function m(t){if(a&&0!==a.length&&t)return a.find((e=>{const n=h(t,e,r.A.AUDIO),a=h(t,e,r.A.VIDEO),i=h(t,e,"keySystemConfiguration");return n&&a&&i}))}function h(t,e,n){return!t[n]&&!e[n]||!(!t[n]||!e[n])&&f.areEqual(t[n],e[n])}function p(t,e){return(t=t.filter((t=>!(t.schemeIdUri&&e.some((e=>e.schemeIdUri===t.schemeIdUri)))))).push(...e),t}return t={areKeyIdsExpired:function(t){return!!(n&&t&&t.normalizedKeyIds&&0!==t.normalizedKeyIds.size)&&n.areKeyIdsExpired(t.normalizedKeyIds)},areKeyIdsUsable:function(t){return!(n&&t&&t.normalizedKeyIds&&0!==t.normalizedKeyIds.size)||n.areKeyIdsUsable(t.normalizedKeyIds)},isCodecSupportedBasedOnTestedConfigurations:function(t,e){if(!t||!t.codec||!1===t.isSupported)return!1;const n=g(t,e).map((t=>m(t))).filter((t=>null!=t));return!(n&&n.length>0)||function(t){return t.some((t=>t&&t.decodingInfo&&t.decodingInfo.supported))}(n)},isProtectionCompatible:function(t,e){return!e||!(!t.isEncrypted&&e.isEncrypted)},runCodecSupportCheck:function(t,n){if(n!==r.A.AUDIO&&n!==r.A.VIDEO)return Promise.resolve();const i=g(t,n);return function(t,n){return e.get().streaming.capabilities.useMediaCapabilitiesApi&&navigator.mediaCapabilities&&navigator.mediaCapabilities.decodingInfo&&(t.codec&&n===r.A.AUDIO||n===r.A.VIDEO&&t.codec&&t.width&&t.height&&t.bitrate&&t.framerate)}(t,n)?function(t){return new Promise((e=>{if(!t||0===t.length)return void e();const n=t.map((t=>function(t){return new Promise((e=>{m(t)?e():navigator.mediaCapabilities.decodingInfo(t).then((n=>{t.decodingInfo=n,a.push(t),e()})).catch((n=>{t.decodingInfo={supported:!1},a.push(t),c.error(n),e()}))}))}(t)));Promise.allSettled(n).then((()=>{e()})).catch((t=>{c.error(t),e()}))}))}(i):(function(t){if(!t||!t.length)return;const e=t[0];if(m(e))return;let n={supported:!1};("ManagedMediaSource"in window&&ManagedMediaSource.isTypeSupported(e.mediaSourceCodecString)||"MediaSource"in window&&MediaSource.isTypeSupported(e.mediaSourceCodecString)||"WebKitMediaSource"in window&&WebKitMediaSource.isTypeSupported(e.mediaSourceCodecString))&&(n.supported=!0),e.decodingInfo=n,a.push(e)}(i),Promise.resolve())},setConfig:function(t){t&&(t.settings&&(e=t.settings),t.protectionController&&(n=t.protectionController))},setEncryptedMediaSupported:function(t){u=t},setProtectionController:function(t){n=t},supportsChangeType:function(){return!!window.SourceBuffer&&!!SourceBuffer.prototype&&!!SourceBuffer.prototype.changeType},supportsEncryptedMedia:function(){return u},supportsEssentialProperty:function(t){let n=e.get().streaming.capabilities.supportedEssentialProperties;e.get().streaming.capabilities.useMediaCapabilitiesApi&&e.get().streaming.capabilities.filterVideoColorimetryEssentialProperties&&(n=p(n,[{schemeIdUri:r.A.COLOUR_PRIMARIES_SCHEME_ID_URI},{schemeIdUri:r.A.MATRIX_COEFFICIENTS_SCHEME_ID_URI},{schemeIdUri:r.A.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI}])),e.get().streaming.capabilities.useMediaCapabilitiesApi&&e.get().streaming.capabilities.filterHDRMetadataFormatEssentialProperties&&(n=p(n,[{schemeIdUri:r.A.HDR_METADATA_FORMAT_SCHEME_ID_URI}]));try{return t.inArray(n)}catch(t){return!0}},supportsMediaSource:s},u=!1,a=[],c=(0,l.A)(d).getInstance().getLogger(t),t}u.__dashjs_factory_name="Capabilities",e.A=a.A.getSingletonFactory(u)},7377:function(t,e,n){"use strict";var a=n(138),r=n(656);function i(){return{customTimeRangeArray:[],length:0,add:function(t,e){let n;for(n=0;nthis.customTimeRangeArray[n].start;n++);for(this.customTimeRangeArray.splice(n,0,{start:t,end:e}),n=0;n=this.customTimeRangeArray[n].end)this.customTimeRangeArray.splice(n,1),n--;else{if(t>this.customTimeRangeArray[n].start&&ethis.customTimeRangeArray[n].start&&tthis.customTimeRangeArray[n].start&&e=this.customTimeRangeArray.length||t<0?NaN:this.customTimeRangeArray[t].start},end:function(t){return(0,r.zQ)(t),t>=this.customTimeRangeArray.length||t<0?NaN:this.customTimeRangeArray[t].end}}}i.__dashjs_factory_name="CustomTimeRanges",e.A=a.A.getClassFactory(i)},7393:function(t,e,n){"use strict";var a=n(138),r=n(7316);function i(){let t;return t={areEqual:function(t,e){return r(t,e)}},t}i.__dashjs_factory_name="ObjectUtils",e.A=a.A.getSingletonFactory(i)},656:function(t,e,n){"use strict";n.d(e,{sq:function(){return r},zQ:function(){return i}});var a=n(5212);function r(t,e){if(typeof t!==e)throw a.A.BAD_ARGUMENT_ERROR}function i(t){if(null===t||isNaN(t)||t%1!=0)throw a.A.BAD_ARGUMENT_ERROR+" : argument is not an integer"}},1944:function(t,e){"use strict";e.A=class{constructor(t,e,n){this.code=t||null,this.message=e||null,this.data=n||null}}},7568:function(t,e,n){"use strict";n.d(e,{G:function(){return a},N:function(){return r}});class a{constructor(){this.tcpid=null,this.type=null,this.url=null,this.actualurl=null,this.range=null,this.trequest=null,this.tresponse=null,this.responsecode=null,this.interval=null,this.trace=[],this.cmsd=null,this._stream=null,this._tfinish=null,this._mediaduration=null,this._responseHeaders=null,this._serviceLocation=null,this._fileLoaderType=null,this._resourceTimingValues=null}}class r{constructor(){this.s=null,this.d=null,this.b=[]}}a.GET="GET",a.HEAD="HEAD",a.MPD_TYPE="MPD",a.XLINK_EXPANSION_TYPE="XLinkExpansion",a.INIT_SEGMENT_TYPE="InitializationSegment",a.INDEX_SEGMENT_TYPE="IndexSegment",a.MEDIA_SEGMENT_TYPE="MediaSegment",a.BITSTREAM_SWITCHING_SEGMENT_TYPE="BitstreamSwitchingSegment",a.MSS_FRAGMENT_INFO_SEGMENT_TYPE="FragmentInfoSegment",a.DVB_REPORTING_TYPE="DVBReporting",a.LICENSE="license",a.CONTENT_STEERING_TYPE="ContentSteering",a.OTHER_TYPE="other"}},e={};function n(a){var r=e[a];if(void 0!==r)return r.exports;var i=e[a]={exports:{}};return t[a].call(i.exports,i,i.exports,n),i.exports}n.amdO={},n.d=function(t,e){for(var a in e)n.o(e,a)&&!n.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:e[a]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var r={};return function(){"use strict";n.d(r,{default:function(){return d}}),n(5393);var t=n(4469),e=n(3888),a=n(255);let i,o=function(){const t="application/dash+xml";let e;function n(n,r,i){if(!n||!/^VIDEO$/i.test(n.nodeName))return null;if(n._dashjs_player)return n._dashjs_player;let o,l=n.id||n.name||"video element";if(!(r=r||[].slice.call(n.querySelectorAll("source")).filter((function(e){return e.type==t}))[0])&&n.src)(r=document.createElement("source")).src=n.src;else if(!r&&!n.src)return null;return i=i||{},o=(0,a.A)(i).create(),o.initialize(n,r.src,n.autoplay),e||(e=o.getDebug().getLogger()),e.debug("Converted "+l+" to dash.js player and added content: "+r.src),n._dashjs_player=o,o}function r(t){return/^VIDEO$/i.test(t.nodeName)?t:r(t.parentNode)}return{create:n,createAll:function(e,a){let i=[];e=e||"[data-dashjs-player]";let o=(a=a||document).querySelectorAll(e);for(let t=0;t